@zuplo/core 5.1828.0 → 5.1830.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.minified.js CHANGED
@@ -392,7 +392,7 @@ ${h}
392
392
  Content-Type: ${i["Content-Type"]}\r
393
393
  \r
394
394
  `;n.write(s);if(typeof i.body==="string"){n.write(i.body);n.write("\r\n")}else{i.body.pipe(n,{end:false});i.body.on("end",()=>{n.write("\r\n");n.write(r);n.end()})}}return n}a(can,"createMultipartStream");function Zu(e,t){const{uri:r,options:n}=lan(e);const i=e.multipart;if(e.multipart&&i.length===2){if(!t){throw new Error("Multipart without callback is not implemented.")}const s=aan.v4();n.headers["Content-Type"]=`multipart/related; boundary=${s}`;n.body=can(s,i);Zu.stats.requestStarting();(0,h2e.default)(r,n).then(o=>{Zu.stats.requestFinished();const u=o.headers.get("content-type");const l=uW(n,o);const c=l.body;if(u==="application/json"||u==="application/json; charset=utf-8"){o.json().then(d=>{l.body=d;t(null,l,d)},d=>{t(d,l,c)});return}o.text().then(d=>{l.body=d;t(null,l,d)},d=>{t(d,l,c)})},o=>{Zu.stats.requestFinished();t(o,null,null)});return}if(t===void 0){const s=uan(new lW.PassThrough);let o;s.once("reading",()=>{if(o){(0,lW.pipeline)(o,s,()=>{})}else{s.once("response",()=>{(0,lW.pipeline)(o,s,()=>{})})}});n.compress=false;Zu.stats.requestStarting();(0,h2e.default)(r,n).then(u=>{Zu.stats.requestFinished();o=u.body;o.on("error",c=>{s.emit("error",c)});const l=uW(n,u);s.emit("response",l)},u=>{Zu.stats.requestFinished();s.emit("error",u)});return s}Zu.stats.requestStarting();(0,h2e.default)(r,n).then(s=>{Zu.stats.requestFinished();const o=s.headers.get("content-type");const u=uW(n,s);const l=u.body;if(o==="application/json"||o==="application/json; charset=utf-8"){if(u.statusCode===204){t(null,u,l);return}s.json().then(c=>{u.body=c;t(null,u,c)},c=>{t(c,u,l)});return}s.text().then(c=>{const d=uW(n,s);d.body=c;t(null,d,c)},c=>{t(c,u,l)})},s=>{Zu.stats.requestFinished();t(s,null,null)});return}a(Zu,"teenyRequest");HR.teenyRequest=Zu;Zu.defaults=e=>{return(t,r)=>{const n={...e,...t};if(r===void 0){return Zu(n)}Zu(n,r)}};Zu.stats=new wgt.TeenyStatistics;Zu.resetStats=()=>{Zu.stats=new wgt.TeenyStatistics(Zu.stats.getOptions())}});var xgt=y((Hxs,dan)=>{dan.exports={name:"@google-cloud/storage",description:"Cloud Storage Client Library for Node.js",version:"7.5.0",license:"Apache-2.0",author:"Google Inc.",engines:{node:">=14"},repository:"googleapis/nodejs-storage",main:"./build/cjs/src/index.js",types:"./build/cjs/src/index.d.ts",type:"module",exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},files:["build/cjs/src","build/cjs/package.json","!build/cjs/src/**/*.map","build/esm/src","!build/esm/src/**/*.map"],keywords:["google apis client","google api client","google apis","google api","google","google cloud platform","google cloud","cloud","google storage","storage"],scripts:{"all-test":"npm test && npm run system-test && npm run samples-test",benchwrapper:"node bin/benchwrapper.js",check:"gts check",clean:"rm -rf build/","compile:cjs":"tsc -p ./tsconfig.cjs.json","compile:esm":"tsc -p .",compile:"npm run compile:cjs && npm run compile:esm","conformance-test":"mocha --parallel build/cjs/conformance-test/ --require build/cjs/conformance-test/globalHooks.js","docs-test":"linkinator docs",docs:"jsdoc -c .jsdoc.json",fix:"gts fix",lint:"gts check",postcompile:"cp ./src/package-json-helper.cjs ./build/cjs/src && cp ./src/package-json-helper.cjs ./build/esm/src","postcompile:cjs":"babel --plugins gapic-tools/build/src/replaceImportMetaUrl,gapic-tools/build/src/toggleESMFlagVariable build/cjs/src/util.js -o build/cjs/src/util.js && cp internal-tooling/helpers/package.cjs.json build/cjs/package.json",precompile:"rm -rf build/","preconformance-test":"npm run compile:cjs -- --sourceMap","predocs-test":"npm run docs",predocs:"npm run compile:cjs -- --sourceMap",prelint:"cd samples; npm link ../; npm install",prepare:"npm run compile","presystem-test:esm":"npm run compile:esm","presystem-test":"npm run compile -- --sourceMap",pretest:"npm run compile -- --sourceMap","samples-test":"npm link && cd samples/ && npm link ../ && npm test && cd ../","system-test:esm":"mocha build/esm/system-test --timeout 600000 --exit","system-test":"mocha build/cjs/system-test --timeout 600000 --exit",test:"c8 mocha build/cjs/test"},dependencies:{"@google-cloud/paginator":"^5.0.0","@google-cloud/projectify":"^4.0.0","@google-cloud/promisify":"^4.0.0","abort-controller":"^3.0.0","async-retry":"^1.3.3",compressible:"^2.0.12",duplexify:"^4.0.0",ent:"^2.2.0","fast-xml-parser":"^4.3.0",gaxios:"^6.0.2","google-auth-library":"^9.0.0",mime:"^3.0.0","mime-types":"^2.0.8","p-limit":"^3.0.1","retry-request":"^7.0.0","teeny-request":"^9.0.0",uuid:"^8.0.0"},devDependencies:{"@babel/cli":"^7.22.10","@babel/core":"^7.22.11","@google-cloud/pubsub":"^4.0.0","@grpc/grpc-js":"^1.0.3","@grpc/proto-loader":"^0.7.0","@types/async-retry":"^1.4.3","@types/compressible":"^2.0.0","@types/ent":"^2.2.1","@types/mime":"^3.0.0","@types/mime-types":"^2.1.0","@types/mocha":"^9.1.1","@types/mockery":"^1.4.29","@types/node":"^20.4.4","@types/node-fetch":"^2.1.3","@types/proxyquire":"^1.3.28","@types/request":"^2.48.4","@types/sinon":"^10.0.15","@types/tmp":"0.2.5","@types/uuid":"^8.0.0","@types/yargs":"^17.0.10",c8:"^8.0.0","form-data":"^4.0.0","gapic-tools":"^0.2.0",gts:"^5.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^3.0.0","jsdoc-region-tag":"^3.0.0",linkinator:"^4.0.0",mocha:"^9.2.2",mockery:"^2.1.0",nock:"~13.3.0","node-fetch":"^2.6.7","pack-n-play":"^2.0.0",proxyquire:"^2.1.3",sinon:"^17.0.0",tmp:"^0.2.0",typescript:"^5.1.6",yargs:"^17.3.1"}}});var VR=y(Rgt=>{function pan(){return xgt()}a(pan,"getPackageJSON");Rgt.getPackageJSON=pan});var P0=y(yi=>{"use strict";var fan=yi&&yi.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var man=yi&&yi.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var v2e=yi&&yi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))fan(t,e,r)}man(t,e);return t};Object.defineProperty(yi,"__esModule",{value:true});yi.PassThroughShim=yi.getModuleFormat=yi.getDirName=yi.getUserAgentString=yi.getRuntimeTrackingString=yi.formatAsUTCISO=yi.convertObjKeysToSnakeCase=yi.unicodeJSONStringify=yi.objectKeyToLowercase=yi.qsStringify=yi.encodeURI=yi.fixedEncodeURIComponent=yi.objectEntries=yi.normalize=void 0;var Kxs=v2e(require("path"));var han=v2e(require("querystring"));var gan=require("stream");var yan=v2e(require("url"));var _an=VR();var Wxs=yan.fileURLToPath;var van=false;function Ean(e,t){const r=typeof e==="object"?e:{};const n=typeof e==="function"?e:t;return{options:r,callback:n}}a(Ean,"normalize");yi.normalize=Ean;function ban(e){return Object.keys(e).map(t=>[t,e[t]])}a(ban,"objectEntries");yi.objectEntries=ban;function Ogt(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}a(Ogt,"fixedEncodeURIComponent");yi.fixedEncodeURIComponent=Ogt;function Pgt(e,t){return e.split("/").map(Ogt).join(t?"%2F":"/")}a(Pgt,"encodeURI");yi.encodeURI=Pgt;function San(e){return han.stringify(e,"&","=",{encodeURIComponent:t=>Pgt(t,true)})}a(San,"qsStringify");yi.qsStringify=San;function Aan(e){const t={};for(let r of Object.keys(e)){const n=e[r];r=r.toLowerCase();t[r]=n}return t}a(Aan,"objectKeyToLowercase");yi.objectKeyToLowercase=Aan;function Can(e){return JSON.stringify(e).replace(/[\u0080-\uFFFF]/g,t=>"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4))}a(Can,"unicodeJSONStringify");yi.unicodeJSONStringify=Can;function y2e(e){if(e instanceof Date||e instanceof RegExp){return e}if(Array.isArray(e)){return e.map(y2e)}if(e instanceof Object){return Object.keys(e).reduce((t,r)=>{const n=r[0].toLocaleLowerCase()+r.slice(1).replace(/([A-Z]+)/g,(i,s)=>{return`_${s.toLowerCase()}`});t[n]=y2e(e[r]);return t},Object())}return e}a(y2e,"convertObjKeysToSnakeCase");yi.convertObjKeysToSnakeCase=y2e;function wan(e,t=false,r="",n=""){const i=e.getUTCFullYear();const s=e.getUTCMonth()+1;const o=e.getUTCDate();const u=e.getUTCHours();const l=e.getUTCMinutes();const c=e.getUTCSeconds();let d=`${i.toString().padStart(4,"0")}${r}${s.toString().padStart(2,"0")}${r}${o.toString().padStart(2,"0")}`;if(t){d=`${d}T${u.toString().padStart(2,"0")}${n}${l.toString().padStart(2,"0")}${n}${c.toString().padStart(2,"0")}Z`}return d}a(wan,"formatAsUTCISO");yi.formatAsUTCISO=wan;function Tan(){if(globalThis.Deno&&globalThis.Deno.version&&globalThis.Deno.version.deno){return`gl-deno/${globalThis.Deno.version.deno}`}else{return`gl-node/${process.versions.node}`}}a(Tan,"getRuntimeTrackingString");yi.getRuntimeTrackingString=Tan;function xan(){const e=(0,_an.getPackageJSON)();const t=e.name.replace("@google-cloud","gcloud-node").replace("/","-");return t+"/"+e.version}a(xan,"getUserAgentString");yi.getUserAgentString=xan;function Ran(){let e="";try{e=__dirname}catch(t){e=__dirname}return e}a(Ran,"getDirName");yi.getDirName=Ran;function Oan(){return van?"ESM":"CJS"}a(Oan,"getModuleFormat");yi.getModuleFormat=Oan;var _2e=class extends gan.PassThrough{static{a(this,"PassThroughShim")}constructor(){super(...arguments);this.shouldEmitReading=true;this.shouldEmitWriting=true}_read(t){if(this.shouldEmitReading){this.emit("reading");this.shouldEmitReading=false}super._read(t)}_write(t,r,n){if(this.shouldEmitWriting){this.emit("writing");this.shouldEmitWriting=false}process.nextTick(()=>{super._write(t,r,n)})}_final(t){if(this.shouldEmitReading){this.emit("reading");this.shouldEmitReading=false}if(this.shouldEmitWriting){this.emit("writing");this.shouldEmitWriting=false}t(null)}};yi.PassThroughShim=_2e});var E2e=y((Jxs,Ngt)=>{Ngt.exports=require("stream")});var Lgt=y((Qxs,Dgt)=>{"use strict";function Igt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t)n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable});r.push.apply(r,n)}return r}a(Igt,"ownKeys");function Pan(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};if(t%2){Igt(Object(r),true).forEach(function(n){Nan(e,n,r[n])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{Igt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}}return e}a(Pan,"_objectSpread");function Nan(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}a(Nan,"_defineProperty");function Ian(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}a(Ian,"_classCallCheck");function kgt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}a(kgt,"_defineProperties");function kan(e,t,r){if(t)kgt(e.prototype,t);if(r)kgt(e,r);return e}a(kan,"_createClass");var Dan=require("buffer");var cW=Dan.Buffer;var Lan=require("util");var b2e=Lan.inspect;var Fan=b2e&&b2e.custom||"inspect";function Ban(e,t,r){cW.prototype.copy.call(e,t,r)}a(Ban,"copyBuffer");Dgt.exports=function(){function e(){Ian(this,e);this.head=null;this.tail=null;this.length=0}a(e,"BufferList");kan(e,[{key:"push",value:a(function t(r){var n={data:r,next:null};if(this.length>0)this.tail.next=n;else this.head=n;this.tail=n;++this.length},"push")},{key:"unshift",value:a(function t(r){var n={data:r,next:this.head};if(this.length===0)this.tail=n;this.head=n;++this.length},"unshift")},{key:"shift",value:a(function t(){if(this.length===0)return;var r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return r},"shift")},{key:"clear",value:a(function t(){this.head=this.tail=null;this.length=0},"clear")},{key:"join",value:a(function t(r){if(this.length===0)return"";var n=this.head;var i=""+n.data;while(n=n.next){i+=r+n.data}return i},"join")},{key:"concat",value:a(function t(r){if(this.length===0)return cW.alloc(0);var n=cW.allocUnsafe(r>>>0);var i=this.head;var s=0;while(i){Ban(i.data,n,s);s+=i.data.length;i=i.next}return n},"concat")},{key:"consume",value:a(function t(r,n){var i;if(r<this.head.data.length){i=this.head.data.slice(0,r);this.head.data=this.head.data.slice(r)}else if(r===this.head.data.length){i=this.shift()}else{i=n?this._getString(r):this._getBuffer(r)}return i},"consume")},{key:"first",value:a(function t(){return this.head.data},"first")},{key:"_getString",value:a(function t(r){var n=this.head;var i=1;var s=n.data;r-=s.length;while(n=n.next){var o=n.data;var u=r>o.length?o.length:r;if(u===o.length)s+=o;else s+=o.slice(0,r);r-=u;if(r===0){if(u===o.length){++i;if(n.next)this.head=n.next;else this.head=this.tail=null}else{this.head=n;n.data=o.slice(u)}break}++i}this.length-=i;return s},"_getString")},{key:"_getBuffer",value:a(function t(r){var n=cW.allocUnsafe(r);var i=this.head;var s=1;i.data.copy(n);r-=i.data.length;while(i=i.next){var o=i.data;var u=r>o.length?o.length:r;o.copy(n,n.length-r,0,u);r-=u;if(r===0){if(u===o.length){++s;if(i.next)this.head=i.next;else this.head=this.tail=null}else{this.head=i;i.data=o.slice(u)}break}++s}this.length-=s;return n},"_getBuffer")},{key:Fan,value:a(function t(r,n){return b2e(this,Pan({},n,{depth:0,customInspect:false}))},"value")}]);return e}()});var A2e=y((eRs,Bgt)=>{"use strict";function Man(e,t){var r=this;var n=this._readableState&&this._readableState.destroyed;var i=this._writableState&&this._writableState.destroyed;if(n||i){if(t){t(e)}else if(e){if(!this._writableState){process.nextTick(S2e,this,e)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(S2e,this,e)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,function(s){if(!t&&s){if(!r._writableState){process.nextTick(Fgt,r,s)}else if(!r._writableState.errorEmitted){r._writableState.errorEmitted=true;process.nextTick(Fgt,r,s)}else{process.nextTick(dW,r)}}else if(t){process.nextTick(dW,r);t(s)}else{process.nextTick(dW,r)}});return this}a(Man,"destroy");function Fgt(e,t){S2e(e,t);dW(e)}a(Fgt,"emitErrorAndCloseNT");function dW(e){if(e._writableState&&!e._writableState.emitClose)return;if(e._readableState&&!e._readableState.emitClose)return;e.emit("close")}a(dW,"emitCloseNT");function qan(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}a(qan,"undestroy");function S2e(e,t){e.emit("error",t)}a(S2e,"emitErrorNT");function Uan(e,t){var r=e._readableState;var n=e._writableState;if(r&&r.autoDestroy||n&&n.autoDestroy)e.destroy(t);else e.emit("error",t)}a(Uan,"errorOrDestroy");Bgt.exports={destroy:Man,undestroy:qan,errorOrDestroy:Uan}});var Yv=y((rRs,Ugt)=>{"use strict";var qgt={};function mf(e,t,r){if(!r){r=Error}function n(s,o,u){if(typeof t==="string"){return t}else{return t(s,o,u)}}a(n,"getMessage");class i extends r{static{a(this,"NodeError")}constructor(o,u,l){super(n(o,u,l))}}i.prototype.name=r.name;i.prototype.code=e;qgt[e]=i}a(mf,"createErrorType");function Mgt(e,t){if(Array.isArray(e)){const r=e.length;e=e.map(n=>String(n));if(r>2){return`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]}else if(r===2){return`one of ${t} ${e[0]} or ${e[1]}`}else{return`of ${t} ${e[0]}`}}else{return`of ${t} ${String(e)}`}}a(Mgt,"oneOf");function $an(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}a($an,"startsWith");function jan(e,t,r){if(r===void 0||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}a(jan,"endsWith");function Gan(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}a(Gan,"includes");mf("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);mf("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;if(typeof t==="string"&&$an(t,"not ")){n="must not be";t=t.replace(/^not /,"")}else{n="must be"}let i;if(jan(e," argument")){i=`The ${e} ${n} ${Mgt(t,"type")}`}else{const s=Gan(e,".")?"property":"argument";i=`The "${e}" ${s} ${n} ${Mgt(t,"type")}`}i+=`. Received type ${typeof r}`;return i},TypeError);mf("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");mf("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});mf("ERR_STREAM_PREMATURE_CLOSE","Premature close");mf("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});mf("ERR_MULTIPLE_CALLBACK","Callback called multiple times");mf("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");mf("ERR_STREAM_WRITE_AFTER_END","write after end");mf("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);mf("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);mf("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Ugt.exports.codes=qgt});var C2e=y((iRs,$gt)=>{"use strict";var Han=Yv().codes.ERR_INVALID_OPT_VALUE;function Van(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}a(Van,"highWaterMarkFrom");function zan(e,t,r,n){var i=Van(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Han(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}a(zan,"getHighWaterMark");$gt.exports={getHighWaterMark:zan}});var jgt=y((aRs,w2e)=>{if(typeof Object.create==="function"){w2e.exports=a(function e(t,r){if(r){t.super_=r;t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}})}},"inherits")}else{w2e.exports=a(function e(t,r){if(r){t.super_=r;var n=a(function(){},"TempCtor");n.prototype=r.prototype;t.prototype=new n;t.prototype.constructor=t}},"inherits")}});var Xv=y((uRs,x2e)=>{try{T2e=require("util");if(typeof T2e.inherits!=="function")throw"";x2e.exports=T2e.inherits}catch(e){x2e.exports=jgt()}var T2e});var Hgt=y((lRs,Ggt)=>{Ggt.exports=require("util").deprecate});var P2e=y((cRs,Xgt)=>{"use strict";Xgt.exports=no;function zgt(e){var t=this;this.next=null;this.entry=null;this.finish=function(){von(t,e)}}a(zgt,"CorkedRequest");var zR;no.WritableState=V9;var Kan={deprecate:Hgt()};var Kgt=E2e();var fW=require("buffer").Buffer;var Wan=global.Uint8Array||function(){};function Yan(e){return fW.from(e)}a(Yan,"_uint8ArrayToBuffer");function Xan(e){return fW.isBuffer(e)||e instanceof Wan}a(Xan,"_isUint8Array");var O2e=A2e();var Jan=C2e();var Qan=Jan.getHighWaterMark;var Jv=Yv().codes;var Zan=Jv.ERR_INVALID_ARG_TYPE;var eon=Jv.ERR_METHOD_NOT_IMPLEMENTED;var ton=Jv.ERR_MULTIPLE_CALLBACK;var ron=Jv.ERR_STREAM_CANNOT_PIPE;var non=Jv.ERR_STREAM_DESTROYED;var ion=Jv.ERR_STREAM_NULL_VALUES;var son=Jv.ERR_STREAM_WRITE_AFTER_END;var aon=Jv.ERR_UNKNOWN_ENCODING;var KR=O2e.errorOrDestroy;Xv()(no,Kgt);function oon(){}a(oon,"nop");function V9(e,t,r){zR=zR||vA();e=e||{};if(typeof r!=="boolean")r=t instanceof zR;this.objectMode=!!e.objectMode;if(r)this.objectMode=this.objectMode||!!e.writableObjectMode;this.highWaterMark=Qan(this,e,"writableHighWaterMark",r);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var n=e.decodeStrings===false;this.decodeStrings=!n;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(i){mon(t,i)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=e.emitClose!==false;this.autoDestroy=!!e.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new zgt(this)}a(V9,"WritableState");V9.prototype.getBuffer=a(function e(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r},"getBuffer");(function(){try{Object.defineProperty(V9.prototype,"buffer",{get:Kan.deprecate(a(function e(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}})();var pW;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){pW=Function.prototype[Symbol.hasInstance];Object.defineProperty(no,Symbol.hasInstance,{value:a(function e(t){if(pW.call(this,t))return true;if(this!==no)return false;return t&&t._writableState instanceof V9},"value")})}else{pW=a(function e(t){return t instanceof this},"realHasInstance")}function no(e){zR=zR||vA();var t=this instanceof zR;if(!t&&!pW.call(no,this))return new no(e);this._writableState=new V9(e,this,t);this.writable=true;if(e){if(typeof e.write==="function")this._write=e.write;if(typeof e.writev==="function")this._writev=e.writev;if(typeof e.destroy==="function")this._destroy=e.destroy;if(typeof e.final==="function")this._final=e.final}Kgt.call(this)}a(no,"Writable");no.prototype.pipe=function(){KR(this,new ron)};function uon(e,t){var r=new son;KR(e,r);process.nextTick(t,r)}a(uon,"writeAfterEnd");function lon(e,t,r,n){var i;if(r===null){i=new ion}else if(typeof r!=="string"&&!t.objectMode){i=new Zan("chunk",["string","Buffer"],r)}if(i){KR(e,i);process.nextTick(n,i);return false}return true}a(lon,"validChunk");no.prototype.write=function(e,t,r){var n=this._writableState;var i=false;var s=!n.objectMode&&Xan(e);if(s&&!fW.isBuffer(e)){e=Yan(e)}if(typeof t==="function"){r=t;t=null}if(s)t="buffer";else if(!t)t=n.defaultEncoding;if(typeof r!=="function")r=oon;if(n.ending)uon(this,r);else if(s||lon(this,n,e,r)){n.pendingcb++;i=don(this,n,s,e,t,r)}return i};no.prototype.cork=function(){this._writableState.corked++};no.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest)Wgt(this,e)}};no.prototype.setDefaultEncoding=a(function e(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new aon(t);this._writableState.defaultEncoding=t;return this},"setDefaultEncoding");Object.defineProperty(no.prototype,"writableBuffer",{enumerable:false,get:a(function e(){return this._writableState&&this._writableState.getBuffer()},"get")});function con(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=fW.from(t,r)}return t}a(con,"decodeChunk");Object.defineProperty(no.prototype,"writableHighWaterMark",{enumerable:false,get:a(function e(){return this._writableState.highWaterMark},"get")});function don(e,t,r,n,i,s){if(!r){var o=con(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var u=t.objectMode?1:n.length;t.length+=u;var l=t.length<t.highWaterMark;if(!l)t.needDrain=true;if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null};if(c){c.next=t.lastBufferedRequest}else{t.bufferedRequest=t.lastBufferedRequest}t.bufferedRequestCount+=1}else{R2e(e,t,false,u,n,i,s)}return l}a(don,"writeOrBuffer");function R2e(e,t,r,n,i,s,o){t.writelen=n;t.writecb=o;t.writing=true;t.sync=true;if(t.destroyed)t.onwrite(new non("write"));else if(r)e._writev(i,t.onwrite);else e._write(i,s,t.onwrite);t.sync=false}a(R2e,"doWrite");function pon(e,t,r,n,i){--t.pendingcb;if(r){process.nextTick(i,n);process.nextTick(H9,e,t);e._writableState.errorEmitted=true;KR(e,n)}else{i(n);e._writableState.errorEmitted=true;KR(e,n);H9(e,t)}}a(pon,"onwriteError");function fon(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}a(fon,"onwriteStateUpdate");function mon(e,t){var r=e._writableState;var n=r.sync;var i=r.writecb;if(typeof i!=="function")throw new ton;fon(r);if(t)pon(e,r,n,t,i);else{var s=Ygt(r)||e.destroyed;if(!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest){Wgt(e,r)}if(n){process.nextTick(Vgt,e,r,s,i)}else{Vgt(e,r,s,i)}}}a(mon,"onwrite");function Vgt(e,t,r,n){if(!r)hon(e,t);t.pendingcb--;n();H9(e,t)}a(Vgt,"afterWrite");function hon(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}a(hon,"onwriteDrain");function Wgt(e,t){t.bufferProcessing=true;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount;var i=new Array(n);var s=t.corkedRequestsFree;s.entry=r;var o=0;var u=true;while(r){i[o]=r;if(!r.isBuf)u=false;r=r.next;o+=1}i.allBuffers=u;R2e(e,t,true,t.length,i,"",s.finish);t.pendingcb++;t.lastBufferedRequest=null;if(s.next){t.corkedRequestsFree=s.next;s.next=null}else{t.corkedRequestsFree=new zgt(t)}t.bufferedRequestCount=0}else{while(r){var l=r.chunk;var c=r.encoding;var d=r.callback;var p=t.objectMode?1:l.length;R2e(e,t,false,p,l,c,d);r=r.next;t.bufferedRequestCount--;if(t.writing){break}}if(r===null)t.lastBufferedRequest=null}t.bufferedRequest=r;t.bufferProcessing=false}a(Wgt,"clearBuffer");no.prototype._write=function(e,t,r){r(new eon("_write()"))};no.prototype._writev=null;no.prototype.end=function(e,t,r){var n=this._writableState;if(typeof e==="function"){r=e;e=null;t=null}else if(typeof t==="function"){r=t;t=null}if(e!==null&&e!==void 0)this.write(e,t);if(n.corked){n.corked=1;this.uncork()}if(!n.ending)_on(this,n,r);return this};Object.defineProperty(no.prototype,"writableLength",{enumerable:false,get:a(function e(){return this._writableState.length},"get")});function Ygt(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}a(Ygt,"needFinish");function gon(e,t){e._final(function(r){t.pendingcb--;if(r){KR(e,r)}t.prefinished=true;e.emit("prefinish");H9(e,t)})}a(gon,"callFinal");function yon(e,t){if(!t.prefinished&&!t.finalCalled){if(typeof e._final==="function"&&!t.destroyed){t.pendingcb++;t.finalCalled=true;process.nextTick(gon,e,t)}else{t.prefinished=true;e.emit("prefinish")}}}a(yon,"prefinish");function H9(e,t){var r=Ygt(t);if(r){yon(e,t);if(t.pendingcb===0){t.finished=true;e.emit("finish");if(t.autoDestroy){var n=e._readableState;if(!n||n.autoDestroy&&n.endEmitted){e.destroy()}}}}return r}a(H9,"finishMaybe");function _on(e,t,r){t.ending=true;H9(e,t);if(r){if(t.finished)process.nextTick(r);else e.once("finish",r)}t.ended=true;e.writable=false}a(_on,"endWritable");function von(e,t,r){var n=e.entry;e.entry=null;while(n){var i=n.callback;t.pendingcb--;i(r);n=n.next}t.corkedRequestsFree.next=e}a(von,"onCorkedFinish");Object.defineProperty(no.prototype,"destroyed",{enumerable:false,get:a(function e(){if(this._writableState===void 0){return false}return this._writableState.destroyed},"get"),set:a(function e(t){if(!this._writableState){return}this._writableState.destroyed=t},"set")});no.prototype.destroy=O2e.destroy;no.prototype._undestroy=O2e.undestroy;no.prototype._destroy=function(e,t){t(e)}});var vA=y((pRs,Qgt)=>{"use strict";var Eon=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};Qgt.exports=N0;var Jgt=k2e();var I2e=P2e();Xv()(N0,Jgt);{N2e=Eon(I2e.prototype);for(mW=0;mW<N2e.length;mW++){hW=N2e[mW];if(!N0.prototype[hW])N0.prototype[hW]=I2e.prototype[hW]}}var N2e;var hW;var mW;function N0(e){if(!(this instanceof N0))return new N0(e);Jgt.call(this,e);I2e.call(this,e);this.allowHalfOpen=true;if(e){if(e.readable===false)this.readable=false;if(e.writable===false)this.writable=false;if(e.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",bon)}}}a(N0,"Duplex");Object.defineProperty(N0.prototype,"writableHighWaterMark",{enumerable:false,get:a(function e(){return this._writableState.highWaterMark},"get")});Object.defineProperty(N0.prototype,"writableBuffer",{enumerable:false,get:a(function e(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(N0.prototype,"writableLength",{enumerable:false,get:a(function e(){return this._writableState.length},"get")});function bon(){if(this._writableState.ended)return;process.nextTick(Son,this)}a(bon,"onend");function Son(e){e.end()}a(Son,"onEndNT");Object.defineProperty(N0.prototype,"destroyed",{enumerable:false,get:a(function e(){if(this._readableState===void 0||this._writableState===void 0){return false}return this._readableState.destroyed&&this._writableState.destroyed},"get"),set:a(function e(t){if(this._readableState===void 0||this._writableState===void 0){return}this._readableState.destroyed=t;this._writableState.destroyed=t},"set")})});var t1t=y((D2e,e1t)=>{var gW=require("buffer");var ay=gW.Buffer;function Zgt(e,t){for(var r in e){t[r]=e[r]}}a(Zgt,"copyProps");if(ay.from&&ay.alloc&&ay.allocUnsafe&&ay.allocUnsafeSlow){e1t.exports=gW}else{Zgt(gW,D2e);D2e.Buffer=WR}function WR(e,t,r){return ay(e,t,r)}a(WR,"SafeBuffer");Zgt(ay,WR);WR.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return ay(e,t,r)};WR.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=ay(e);if(t!==void 0){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};WR.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return ay(e)};WR.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return gW.SlowBuffer(e)}});var B2e=y(n1t=>{"use strict";var F2e=t1t().Buffer;var r1t=F2e.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function Aon(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}a(Aon,"_normalizeEncoding");function Con(e){var t=Aon(e);if(typeof t!=="string"&&(F2e.isEncoding===r1t||!r1t(e)))throw new Error("Unknown encoding: "+e);return t||e}a(Con,"normalizeEncoding");n1t.StringDecoder=z9;function z9(e){this.encoding=Con(e);var t;switch(this.encoding){case"utf16le":this.text=Pon;this.end=Non;t=4;break;case"utf8":this.fillLast=xon;t=4;break;case"base64":this.text=Ion;this.end=kon;t=3;break;default:this.write=Don;this.end=Lon;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=F2e.allocUnsafe(t)}a(z9,"StringDecoder");z9.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===void 0)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r<e.length)return t?t+this.text(e,r):this.text(e,r);return t||""};z9.prototype.end=Oon;z9.prototype.text=Ron;z9.prototype.fillLast=function(e){if(this.lastNeed<=e.length){e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length);this.lastNeed-=e.length};function L2e(e){if(e<=127)return 0;else if(e>>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}a(L2e,"utf8CheckByte");function won(e,t,r){var n=t.length-1;if(n<r)return 0;var i=L2e(t[n]);if(i>=0){if(i>0)e.lastNeed=i-1;return i}if(--n<r||i===-2)return 0;i=L2e(t[n]);if(i>=0){if(i>0)e.lastNeed=i-2;return i}if(--n<r||i===-2)return 0;i=L2e(t[n]);if(i>=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}a(won,"utf8CheckIncomplete");function Ton(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"\uFFFD"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"\uFFFD"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"\uFFFD"}}}}a(Ton,"utf8CheckExtraBytes");function xon(e){var t=this.lastTotal-this.lastNeed;var r=Ton(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}a(xon,"utf8FillLast");function Ron(e,t){var r=won(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}a(Ron,"utf8Text");function Oon(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"\uFFFD";return t}a(Oon,"utf8End");function Pon(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}a(Pon,"utf16Text");function Non(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}a(Non,"utf16End");function Ion(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}a(Ion,"base64Text");function kon(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}a(kon,"base64End");function Don(e){return e.toString(this.encoding)}a(Don,"simpleWrite");function Lon(e){return e&&e.length?this.write(e):""}a(Lon,"simpleEnd")});var yW=y((yRs,a1t)=>{"use strict";var i1t=Yv().codes.ERR_STREAM_PREMATURE_CLOSE;function Fon(e){var t=false;return function(){if(t)return;t=true;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++){n[i]=arguments[i]}e.apply(this,n)}}a(Fon,"once");function Bon(){}a(Bon,"noop");function Mon(e){return e.setHeader&&typeof e.abort==="function"}a(Mon,"isRequest");function s1t(e,t,r){if(typeof t==="function")return s1t(e,null,t);if(!t)t={};r=Fon(r||Bon);var n=t.readable||t.readable!==false&&e.readable;var i=t.writable||t.writable!==false&&e.writable;var s=a(function m(){if(!e.writable)u()},"onlegacyfinish");var o=e._writableState&&e._writableState.finished;var u=a(function m(){i=false;o=true;if(!n)r.call(e)},"onfinish");var l=e._readableState&&e._readableState.endEmitted;var c=a(function m(){n=false;l=true;if(!i)r.call(e)},"onend");var d=a(function m(h){r.call(e,h)},"onerror");var p=a(function m(){var h;if(n&&!l){if(!e._readableState||!e._readableState.ended)h=new i1t;return r.call(e,h)}if(i&&!o){if(!e._writableState||!e._writableState.ended)h=new i1t;return r.call(e,h)}},"onclose");var f=a(function m(){e.req.on("finish",u)},"onrequest");if(Mon(e)){e.on("complete",u);e.on("abort",p);if(e.req)f();else e.on("request",f)}else if(i&&!e._writableState){e.on("end",s);e.on("close",s)}e.on("end",c);e.on("finish",u);if(t.error!==false)e.on("error",d);e.on("close",p);return function(){e.removeListener("complete",u);e.removeListener("abort",p);e.removeListener("request",f);if(e.req)e.req.removeListener("finish",u);e.removeListener("end",s);e.removeListener("close",s);e.removeListener("finish",u);e.removeListener("end",c);e.removeListener("error",d);e.removeListener("close",p)}}a(s1t,"eos");a1t.exports=s1t});var u1t=y((vRs,o1t)=>{"use strict";var _W;function Qv(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}a(Qv,"_defineProperty");var qon=yW();var Zv=Symbol("lastResolve");var EA=Symbol("lastReject");var K9=Symbol("error");var vW=Symbol("ended");var bA=Symbol("lastPromise");var M2e=Symbol("handlePromise");var SA=Symbol("stream");function eE(e,t){return{value:e,done:t}}a(eE,"createIterResult");function Uon(e){var t=e[Zv];if(t!==null){var r=e[SA].read();if(r!==null){e[bA]=null;e[Zv]=null;e[EA]=null;t(eE(r,false))}}}a(Uon,"readAndResolve");function $on(e){process.nextTick(Uon,e)}a($on,"onReadable");function jon(e,t){return function(r,n){e.then(function(){if(t[vW]){r(eE(void 0,true));return}t[M2e](r,n)},n)}}a(jon,"wrapForNext");var Gon=Object.getPrototypeOf(function(){});var Hon=Object.setPrototypeOf((_W={get stream(){return this[SA]},next:a(function e(){var t=this;var r=this[K9];if(r!==null){return Promise.reject(r)}if(this[vW]){return Promise.resolve(eE(void 0,true))}if(this[SA].destroyed){return new Promise(function(o,u){process.nextTick(function(){if(t[K9]){u(t[K9])}else{o(eE(void 0,true))}})})}var n=this[bA];var i;if(n){i=new Promise(jon(n,this))}else{var s=this[SA].read();if(s!==null){return Promise.resolve(eE(s,false))}i=new Promise(this[M2e])}this[bA]=i;return i},"next")},Qv(_W,Symbol.asyncIterator,function(){return this}),Qv(_W,"return",a(function e(){var t=this;return new Promise(function(r,n){t[SA].destroy(null,function(i){if(i){n(i);return}r(eE(void 0,true))})})},"_return")),_W),Gon);var Von=a(function e(t){var r;var n=Object.create(Hon,(r={},Qv(r,SA,{value:t,writable:true}),Qv(r,Zv,{value:null,writable:true}),Qv(r,EA,{value:null,writable:true}),Qv(r,K9,{value:null,writable:true}),Qv(r,vW,{value:t._readableState.endEmitted,writable:true}),Qv(r,M2e,{value:a(function i(s,o){var u=n[SA].read();if(u){n[bA]=null;n[Zv]=null;n[EA]=null;s(eE(u,false))}else{n[Zv]=s;n[EA]=o}},"value"),writable:true}),r));n[bA]=null;qon(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=n[EA];if(s!==null){n[bA]=null;n[Zv]=null;n[EA]=null;s(i)}n[K9]=i;return}var o=n[Zv];if(o!==null){n[bA]=null;n[Zv]=null;n[EA]=null;o(eE(void 0,true))}n[vW]=true});t.on("readable",$on.bind(null,n));return n},"createReadableStreamAsyncIterator");o1t.exports=Von});var p1t=y((bRs,d1t)=>{"use strict";function l1t(e,t,r,n,i,s,o){try{var u=e[s](o);var l=u.value}catch(c){r(c);return}if(u.done){t(l)}else{Promise.resolve(l).then(n,i)}}a(l1t,"asyncGeneratorStep");function zon(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var s=e.apply(t,r);function o(l){l1t(s,n,i,o,u,"next",l)}a(o,"_next");function u(l){l1t(s,n,i,o,u,"throw",l)}a(u,"_throw");o(void 0)})}}a(zon,"_asyncToGenerator");function c1t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t)n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable});r.push.apply(r,n)}return r}a(c1t,"ownKeys");function Kon(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};if(t%2){c1t(Object(r),true).forEach(function(n){Won(e,n,r[n])})}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(r))}else{c1t(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}}return e}a(Kon,"_objectSpread");function Won(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}a(Won,"_defineProperty");var Yon=Yv().codes.ERR_INVALID_ARG_TYPE;function Xon(e,t,r){var n;if(t&&typeof t.next==="function"){n=t}else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new Yon("iterable",["Iterable"],t);var i=new e(Kon({objectMode:true},r));var s=false;i._read=function(){if(!s){s=true;o()}};function o(){return u.apply(this,arguments)}a(o,"next");function u(){u=zon(function*(){try{var l=yield n.next(),c=l.value,d=l.done;if(d){i.push(null)}else if(i.push(yield c)){o()}else{s=false}}catch(p){i.destroy(p)}});return u.apply(this,arguments)}a(u,"_next2");return i}a(Xon,"from");d1t.exports=Xon});var k2e=y((CRs,S1t)=>{"use strict";S1t.exports=Xi;var YR;Xi.ReadableState=g1t;var ARs=require("events").EventEmitter;var h1t=a(function e(t,r){return t.listeners(r).length},"EElistenerCount");var Y9=E2e();var EW=require("buffer").Buffer;var Jon=global.Uint8Array||function(){};function Qon(e){return EW.from(e)}a(Qon,"_uint8ArrayToBuffer");function Zon(e){return EW.isBuffer(e)||e instanceof Jon}a(Zon,"_isUint8Array");var q2e=require("util");var ei;if(q2e&&q2e.debuglog){ei=q2e.debuglog("stream")}else{ei=a(function e(){},"debug")}var eun=Lgt();var z2e=A2e();var tun=C2e();var run=tun.getHighWaterMark;var bW=Yv().codes;var nun=bW.ERR_INVALID_ARG_TYPE;var iun=bW.ERR_STREAM_PUSH_AFTER_EOF;var sun=bW.ERR_METHOD_NOT_IMPLEMENTED;var aun=bW.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var XR;var U2e;var $2e;Xv()(Xi,Y9);var W9=z2e.errorOrDestroy;var j2e=["error","close","destroy","pause","resume"];function oun(e,t,r){if(typeof e.prependListener==="function")return e.prependListener(t,r);if(!e._events||!e._events[t])e.on(t,r);else if(Array.isArray(e._events[t]))e._events[t].unshift(r);else e._events[t]=[r,e._events[t]]}a(oun,"prependListener");function g1t(e,t,r){YR=YR||vA();e=e||{};if(typeof r!=="boolean")r=t instanceof YR;this.objectMode=!!e.objectMode;if(r)this.objectMode=this.objectMode||!!e.readableObjectMode;this.highWaterMark=run(this,e,"readableHighWaterMark",r);this.buffer=new eun;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=e.emitClose!==false;this.autoDestroy=!!e.autoDestroy;this.destroyed=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){if(!XR)XR=B2e().StringDecoder;this.decoder=new XR(e.encoding);this.encoding=e.encoding}}a(g1t,"ReadableState");function Xi(e){YR=YR||vA();if(!(this instanceof Xi))return new Xi(e);var t=this instanceof YR;this._readableState=new g1t(e,this,t);this.readable=true;if(e){if(typeof e.read==="function")this._read=e.read;if(typeof e.destroy==="function")this._destroy=e.destroy}Y9.call(this)}a(Xi,"Readable");Object.defineProperty(Xi.prototype,"destroyed",{enumerable:false,get:a(function e(){if(this._readableState===void 0){return false}return this._readableState.destroyed},"get"),set:a(function e(t){if(!this._readableState){return}this._readableState.destroyed=t},"set")});Xi.prototype.destroy=z2e.destroy;Xi.prototype._undestroy=z2e.undestroy;Xi.prototype._destroy=function(e,t){t(e)};Xi.prototype.push=function(e,t){var r=this._readableState;var n;if(!r.objectMode){if(typeof e==="string"){t=t||r.defaultEncoding;if(t!==r.encoding){e=EW.from(e,t);t=""}n=true}}else{n=true}return y1t(this,e,t,false,n)};Xi.prototype.unshift=function(e){return y1t(this,e,null,true,false)};function y1t(e,t,r,n,i){ei("readableAddChunk",t);var s=e._readableState;if(t===null){s.reading=false;cun(e,s)}else{var o;if(!i)o=uun(s,t);if(o){W9(e,o)}else if(s.objectMode||t&&t.length>0){if(typeof t!=="string"&&!s.objectMode&&Object.getPrototypeOf(t)!==EW.prototype){t=Qon(t)}if(n){if(s.endEmitted)W9(e,new aun);else G2e(e,s,t,true)}else if(s.ended){W9(e,new iun)}else if(s.destroyed){return false}else{s.reading=false;if(s.decoder&&!r){t=s.decoder.write(t);if(s.objectMode||t.length!==0)G2e(e,s,t,false);else V2e(e,s)}else{G2e(e,s,t,false)}}}else if(!n){s.reading=false;V2e(e,s)}}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}a(y1t,"readableAddChunk");function G2e(e,t,r,n){if(t.flowing&&t.length===0&&!t.sync){t.awaitDrain=0;e.emit("data",r)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)SW(e)}V2e(e,t)}a(G2e,"addChunk");function uun(e,t){var r;if(!Zon(t)&&typeof t!=="string"&&t!==void 0&&!e.objectMode){r=new nun("chunk",["string","Buffer","Uint8Array"],t)}return r}a(uun,"chunkInvalid");Xi.prototype.isPaused=function(){return this._readableState.flowing===false};Xi.prototype.setEncoding=function(e){if(!XR)XR=B2e().StringDecoder;var t=new XR(e);this._readableState.decoder=t;this._readableState.encoding=this._readableState.decoder.encoding;var r=this._readableState.buffer.head;var n="";while(r!==null){n+=t.write(r.data);r=r.next}this._readableState.buffer.clear();if(n!=="")this._readableState.buffer.push(n);this._readableState.length=n.length;return this};var f1t=1073741824;function lun(e){if(e>=f1t){e=f1t}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}a(lun,"computeNewHighWaterMark");function m1t(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=lun(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}a(m1t,"howMuchToRead");Xi.prototype.read=function(e){ei("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended)){ei("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)H2e(this);else SW(this);return null}e=m1t(e,t);if(e===0&&t.ended){if(t.length===0)H2e(this);return null}var n=t.needReadable;ei("need readable",n);if(t.length===0||t.length-e<t.highWaterMark){n=true;ei("length less than watermark",n)}if(t.ended||t.reading){n=false;ei("reading or ended",n)}else if(n){ei("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false;if(!t.reading)e=m1t(r,t)}var i;if(e>0)i=E1t(e,t);else i=null;if(i===null){t.needReadable=t.length<=t.highWaterMark;e=0}else{t.length-=e;t.awaitDrain=0}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)H2e(this)}if(i!==null)this.emit("data",i);return i};function cun(e,t){ei("onEofChunk");if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;if(t.sync){SW(e)}else{t.needReadable=false;if(!t.emittedReadable){t.emittedReadable=true;_1t(e)}}}a(cun,"onEofChunk");function SW(e){var t=e._readableState;ei("emitReadable",t.needReadable,t.emittedReadable);t.needReadable=false;if(!t.emittedReadable){ei("emitReadable",t.flowing);t.emittedReadable=true;process.nextTick(_1t,e)}}a(SW,"emitReadable");function _1t(e){var t=e._readableState;ei("emitReadable_",t.destroyed,t.length,t.ended);if(!t.destroyed&&(t.length||t.ended)){e.emit("readable");t.emittedReadable=false}t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark;K2e(e)}a(_1t,"emitReadable_");function V2e(e,t){if(!t.readingMore){t.readingMore=true;process.nextTick(dun,e,t)}}a(V2e,"maybeReadMore");function dun(e,t){while(!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0)){var r=t.length;ei("maybeReadMore read 0");e.read(0);if(r===t.length)break}t.readingMore=false}a(dun,"maybeReadMore_");Xi.prototype._read=function(e){W9(this,new sun("_read()"))};Xi.prototype.pipe=function(e,t){var r=this;var n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1;ei("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==false)&&e!==process.stdout&&e!==process.stderr;var s=i?u:g;if(n.endEmitted)process.nextTick(s);else r.once("end",s);e.on("unpipe",o);function o(_,v){ei("onunpipe");if(_===r){if(v&&v.hasUnpiped===false){v.hasUnpiped=true;d()}}}a(o,"onunpipe");function u(){ei("onend");e.end()}a(u,"onend");var l=pun(r);e.on("drain",l);var c=false;function d(){ei("cleanup");e.removeListener("close",m);e.removeListener("finish",h);e.removeListener("drain",l);e.removeListener("error",f);e.removeListener("unpipe",o);r.removeListener("end",u);r.removeListener("end",g);r.removeListener("data",p);c=true;if(n.awaitDrain&&(!e._writableState||e._writableState.needDrain))l()}a(d,"cleanup");r.on("data",p);function p(_){ei("ondata");var v=e.write(_);ei("dest.write",v);if(v===false){if((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&b1t(n.pipes,e)!==-1)&&!c){ei("false write response, pause",n.awaitDrain);n.awaitDrain++}r.pause()}}a(p,"ondata");function f(_){ei("onerror",_);g();e.removeListener("error",f);if(h1t(e,"error")===0)W9(e,_)}a(f,"onerror");oun(e,"error",f);function m(){e.removeListener("finish",h);g()}a(m,"onclose");e.once("close",m);function h(){ei("onfinish");e.removeListener("close",m);g()}a(h,"onfinish");e.once("finish",h);function g(){ei("unpipe");r.unpipe(e)}a(g,"unpipe");e.emit("pipe",r);if(!n.flowing){ei("pipe resume");r.resume()}return e};function pun(e){return a(function t(){var r=e._readableState;ei("pipeOnDrain",r.awaitDrain);if(r.awaitDrain)r.awaitDrain--;if(r.awaitDrain===0&&h1t(e,"data")){r.flowing=true;K2e(e)}},"pipeOnDrainFunctionResult")}a(pun,"pipeOnDrain");Xi.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var s=0;s<i;s++){n[s].emit("unpipe",this,{hasUnpiped:false})}return this}var o=b1t(t.pipes,e);if(o===-1)return this;t.pipes.splice(o,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this,r);return this};Xi.prototype.on=function(e,t){var r=Y9.prototype.on.call(this,e,t);var n=this._readableState;if(e==="data"){n.readableListening=this.listenerCount("readable")>0;if(n.flowing!==false)this.resume()}else if(e==="readable"){if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.flowing=false;n.emittedReadable=false;ei("on readable",n.length,n.reading);if(n.length){SW(this)}else if(!n.reading){process.nextTick(fun,this)}}}return r};Xi.prototype.addListener=Xi.prototype.on;Xi.prototype.removeListener=function(e,t){var r=Y9.prototype.removeListener.call(this,e,t);if(e==="readable"){process.nextTick(v1t,this)}return r};Xi.prototype.removeAllListeners=function(e){var t=Y9.prototype.removeAllListeners.apply(this,arguments);if(e==="readable"||e===void 0){process.nextTick(v1t,this)}return t};function v1t(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0;if(t.resumeScheduled&&!t.paused){t.flowing=true}else if(e.listenerCount("data")>0){e.resume()}}a(v1t,"updateReadableListening");function fun(e){ei("readable nexttick read 0");e.read(0)}a(fun,"nReadingNextTick");Xi.prototype.resume=function(){var e=this._readableState;if(!e.flowing){ei("resume");e.flowing=!e.readableListening;mun(this,e)}e.paused=false;return this};function mun(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;process.nextTick(hun,e,t)}}a(mun,"resume");function hun(e,t){ei("resume",t.reading);if(!t.reading){e.read(0)}t.resumeScheduled=false;e.emit("resume");K2e(e);if(t.flowing&&!t.reading)e.read(0)}a(hun,"resume_");Xi.prototype.pause=function(){ei("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){ei("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function K2e(e){var t=e._readableState;ei("flow",t.flowing);while(t.flowing&&e.read()!==null){;}}a(K2e,"flow");Xi.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",function(){ei("wrapped end");if(r.decoder&&!r.ended){var o=r.decoder.end();if(o&&o.length)t.push(o)}t.push(null)});e.on("data",function(o){ei("wrapped data");if(r.decoder)o=r.decoder.write(o);if(r.objectMode&&(o===null||o===void 0))return;else if(!r.objectMode&&(!o||!o.length))return;var u=t.push(o);if(!u){n=true;e.pause()}});for(var i in e){if(this[i]===void 0&&typeof e[i]==="function"){this[i]=a(function o(u){return a(function l(){return e[u].apply(e,arguments)},"methodWrapReturnFunction")},"methodWrap")(i)}}for(var s=0;s<j2e.length;s++){e.on(j2e[s],this.emit.bind(this,j2e[s]))}this._read=function(o){ei("wrapped _read",o);if(n){n=false;e.resume()}};return this};if(typeof Symbol==="function"){Xi.prototype[Symbol.asyncIterator]=function(){if(U2e===void 0){U2e=u1t()}return U2e(this)}}Object.defineProperty(Xi.prototype,"readableHighWaterMark",{enumerable:false,get:a(function e(){return this._readableState.highWaterMark},"get")});Object.defineProperty(Xi.prototype,"readableBuffer",{enumerable:false,get:a(function e(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(Xi.prototype,"readableFlowing",{enumerable:false,get:a(function e(){return this._readableState.flowing},"get"),set:a(function e(t){if(this._readableState){this._readableState.flowing=t}},"set")});Xi._fromList=E1t;Object.defineProperty(Xi.prototype,"readableLength",{enumerable:false,get:a(function e(){return this._readableState.length},"get")});function E1t(e,t){if(t.length===0)return null;var r;if(t.objectMode)r=t.buffer.shift();else if(!e||e>=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.first();else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=t.buffer.consume(e,t.decoder)}return r}a(E1t,"fromList");function H2e(e){var t=e._readableState;ei("endReadable",t.endEmitted);if(!t.endEmitted){t.ended=true;process.nextTick(gun,t,e)}}a(H2e,"endReadable");function gun(e,t){ei("endReadableNT",e.endEmitted,e.length);if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end");if(e.autoDestroy){var r=t._writableState;if(!r||r.autoDestroy&&r.finished){t.destroy()}}}}a(gun,"endReadableNT");if(typeof Symbol==="function"){Xi.from=function(e,t){if($2e===void 0){$2e=p1t()}return $2e(Xi,e,t)}}function b1t(e,t){for(var r=0,n=e.length;r<n;r++){if(e[r]===t)return r}return-1}a(b1t,"indexOf")});var W2e=y((TRs,C1t)=>{"use strict";C1t.exports=oy;var AW=Yv().codes;var yun=AW.ERR_METHOD_NOT_IMPLEMENTED;var _un=AW.ERR_MULTIPLE_CALLBACK;var vun=AW.ERR_TRANSFORM_ALREADY_TRANSFORMING;var Eun=AW.ERR_TRANSFORM_WITH_LENGTH_0;var CW=vA();Xv()(oy,CW);function bun(e,t){var r=this._transformState;r.transforming=false;var n=r.writecb;if(n===null){return this.emit("error",new _un)}r.writechunk=null;r.writecb=null;if(t!=null)this.push(t);n(e);var i=this._readableState;i.reading=false;if(i.needReadable||i.length<i.highWaterMark){this._read(i.highWaterMark)}}a(bun,"afterTransform");function oy(e){if(!(this instanceof oy))return new oy(e);CW.call(this,e);this._transformState={afterTransform:bun.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(e){if(typeof e.transform==="function")this._transform=e.transform;if(typeof e.flush==="function")this._flush=e.flush}this.on("prefinish",Sun)}a(oy,"Transform");function Sun(){var e=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush(function(t,r){A1t(e,t,r)})}else{A1t(this,null,null)}}a(Sun,"prefinish");oy.prototype.push=function(e,t){this._transformState.needTransform=false;return CW.prototype.push.call(this,e,t)};oy.prototype._transform=function(e,t,r){r(new yun("_transform()"))};oy.prototype._write=function(e,t,r){var n=this._transformState;n.writecb=r;n.writechunk=e;n.writeencoding=t;if(!n.transforming){var i=this._readableState;if(n.needTransform||i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}};oy.prototype._read=function(e){var t=this._transformState;if(t.writechunk!==null&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};oy.prototype._destroy=function(e,t){CW.prototype._destroy.call(this,e,function(r){t(r)})};function A1t(e,t,r){if(t)return e.emit("error",t);if(r!=null)e.push(r);if(e._writableState.length)throw new Eun;if(e._transformState.transforming)throw new vun;return e.push(null)}a(A1t,"done")});var x1t=y((RRs,T1t)=>{"use strict";T1t.exports=X9;var w1t=W2e();Xv()(X9,w1t);function X9(e){if(!(this instanceof X9))return new X9(e);w1t.call(this,e)}a(X9,"PassThrough");X9.prototype._transform=function(e,t,r){r(null,e)}});var I1t=y((PRs,N1t)=>{"use strict";var Y2e;function Aun(e){var t=false;return function(){if(t)return;t=true;e.apply(void 0,arguments)}}a(Aun,"once");var P1t=Yv().codes;var Cun=P1t.ERR_MISSING_ARGS;var wun=P1t.ERR_STREAM_DESTROYED;function R1t(e){if(e)throw e}a(R1t,"noop");function Tun(e){return e.setHeader&&typeof e.abort==="function"}a(Tun,"isRequest");function xun(e,t,r,n){n=Aun(n);var i=false;e.on("close",function(){i=true});if(Y2e===void 0)Y2e=yW();Y2e(e,{readable:t,writable:r},function(o){if(o)return n(o);i=true;n()});var s=false;return function(o){if(i)return;if(s)return;s=true;if(Tun(e))return e.abort();if(typeof e.destroy==="function")return e.destroy();n(o||new wun("pipe"))}}a(xun,"destroyer");function O1t(e){e()}a(O1t,"call");function Run(e,t){return e.pipe(t)}a(Run,"pipe");function Oun(e){if(!e.length)return R1t;if(typeof e[e.length-1]!=="function")return R1t;return e.pop()}a(Oun,"popCallback");function Pun(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=Oun(t);if(Array.isArray(t[0]))t=t[0];if(t.length<2){throw new Cun("streams")}var i;var s=t.map(function(o,u){var l=u<t.length-1;var c=u>0;return xun(o,l,c,function(d){if(!i)i=d;if(d)s.forEach(O1t);if(l)return;s.forEach(O1t);n(i)})});return t.reduce(Run)}a(Pun,"pipeline");N1t.exports=Pun});var k1t=y((hf,Q9)=>{var J9=require("stream");if(process.env.READABLE_STREAM==="disable"&&J9){Q9.exports=J9.Readable;Object.assign(Q9.exports,J9);Q9.exports.Stream=J9}else{hf=Q9.exports=k2e();hf.Stream=J9||hf;hf.Readable=hf;hf.Writable=P2e();hf.Duplex=vA();hf.Transform=W2e();hf.PassThrough=x1t();hf.finished=yW();hf.pipeline=I1t()}});var X2e=y((IRs,L1t)=>{L1t.exports=D1t;function D1t(e,t){if(e&&t)return D1t(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(n){r[n]=e[n]});return r;function r(){var n=new Array(arguments.length);for(var i=0;i<n.length;i++){n[i]=arguments[i]}var s=e.apply(this,n);var o=n[n.length-1];if(typeof s==="function"&&s!==o){Object.keys(o).forEach(function(u){s[u]=o[u]})}return s}a(r,"wrapper")}a(D1t,"wrappy")});var TW=y((DRs,J2e)=>{var F1t=X2e();J2e.exports=F1t(wW);J2e.exports.strict=F1t(B1t);wW.proto=wW(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return wW(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return B1t(this)},configurable:true})});function wW(e){var t=a(function(){if(t.called)return t.value;t.called=true;return t.value=e.apply(this,arguments)},"f");t.called=false;return t}a(wW,"once");function B1t(e){var t=a(function(){if(t.called)throw new Error(t.onceError);t.called=true;return t.value=e.apply(this,arguments)},"f");var r=e.name||"Function wrapped with `once`";t.onceError=r+" shouldn't be called more than once";t.called=false;return t}a(B1t,"onceStrict")});var U1t=y((FRs,q1t)=>{var Nun=TW();var Iun=a(function(){},"noop");var kun=a(function(e){return e.setHeader&&typeof e.abort==="function"},"isRequest");var Dun=a(function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},"isChildProcess");var M1t=a(function(e,t,r){if(typeof t==="function")return M1t(e,null,t);if(!t)t={};r=Nun(r||Iun);var n=e._writableState;var i=e._readableState;var s=t.readable||t.readable!==false&&e.readable;var o=t.writable||t.writable!==false&&e.writable;var u=false;var l=a(function(){if(!e.writable)c()},"onlegacyfinish");var c=a(function(){o=false;if(!s)r.call(e)},"onfinish");var d=a(function(){s=false;if(!o)r.call(e)},"onend");var p=a(function(_){r.call(e,_?new Error("exited with error code: "+_):null)},"onexit");var f=a(function(_){r.call(e,_)},"onerror");var m=a(function(){process.nextTick(h)},"onclose");var h=a(function(){if(u)return;if(s&&!(i&&(i.ended&&!i.destroyed)))return r.call(e,new Error("premature close"));if(o&&!(n&&(n.ended&&!n.destroyed)))return r.call(e,new Error("premature close"))},"onclosenexttick");var g=a(function(){e.req.on("finish",c)},"onrequest");if(kun(e)){e.on("complete",c);e.on("abort",m);if(e.req)g();else e.on("request",g)}else if(o&&!n){e.on("end",l);e.on("close",l)}if(Dun(e))e.on("exit",p);e.on("end",d);e.on("finish",c);if(t.error!==false)e.on("error",f);e.on("close",m);return function(){u=true;e.removeListener("complete",c);e.removeListener("abort",m);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",c);e.removeListener("end",l);e.removeListener("close",l);e.removeListener("finish",c);e.removeListener("exit",p);e.removeListener("end",d);e.removeListener("error",f);e.removeListener("close",m)}},"eos");q1t.exports=M1t});var j1t=y((MRs,$1t)=>{$1t.exports=Lun;function Lun(e){var t=e._readableState;if(!t)return null;return t.objectMode||typeof e._duplexState==="number"?e.read():e.read(Fun(t))}a(Lun,"shift");function Fun(e){if(e.buffer.length){if(e.buffer.head){return e.buffer.head.data.length}return e.buffer[0].length}return e.length}a(Fun,"getStateLength")});var Z2e=y((URs,z1t)=>{var xW=k1t();var G1t=U1t();var Bun=Xv();var Mun=j1t();var H1t=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]);var Q2e=a(function(e,t){if(e._corked)e.once("uncork",t);else t()},"onuncork");var qun=a(function(e,t){if(e._autoDestroy)e.destroy(t)},"autoDestroy");var V1t=a(function(e,t){return function(r){if(r)qun(e,r.message==="premature close"?null:r);else if(t&&!e._ended)e.end()}},"destroyer");var Uun=a(function(e,t){if(!e)return t();if(e._writableState&&e._writableState.finished)return t();if(e._writableState)return e.end(t);e.end();t()},"end");var $un=a(function(){},"noop");var jun=a(function(e){return new xW.Readable({objectMode:true,highWaterMark:16}).wrap(e)},"toStreams2");var el=a(function(e,t,r){if(!(this instanceof el))return new el(e,t,r);xW.Duplex.call(this,r);this._writable=null;this._readable=null;this._readable2=null;this._autoDestroy=!r||r.autoDestroy!==false;this._forwardDestroy=!r||r.destroy!==false;this._forwardEnd=!r||r.end!==false;this._corked=1;this._ondrain=null;this._drained=false;this._forwarding=false;this._unwrite=null;this._unread=null;this._ended=false;this.destroyed=false;if(e)this.setWritable(e);if(t)this.setReadable(t)},"Duplexify");Bun(el,xW.Duplex);el.obj=function(e,t,r){if(!r)r={};r.objectMode=true;r.highWaterMark=16;return new el(e,t,r)};el.prototype.cork=function(){if(++this._corked===1)this.emit("cork")};el.prototype.uncork=function(){if(this._corked&&--this._corked===0)this.emit("uncork")};el.prototype.setWritable=function(e){if(this._unwrite)this._unwrite();if(this.destroyed){if(e&&e.destroy)e.destroy();return}if(e===null||e===false){this.end();return}var t=this;var r=G1t(e,{writable:true,readable:false},V1t(this,this._forwardEnd));var n=a(function(){var s=t._ondrain;t._ondrain=null;if(s)s()},"ondrain");var i=a(function(){t._writable.removeListener("drain",n);r()},"clear");if(this._unwrite)process.nextTick(n);this._writable=e;this._writable.on("drain",n);this._unwrite=i;this.uncork()};el.prototype.setReadable=function(e){if(this._unread)this._unread();if(this.destroyed){if(e&&e.destroy)e.destroy();return}if(e===null||e===false){this.push(null);this.resume();return}var t=this;var r=G1t(e,{writable:false,readable:true},V1t(this));var n=a(function(){t._forward()},"onreadable");var i=a(function(){t.push(null)},"onend");var s=a(function(){t._readable2.removeListener("readable",n);t._readable2.removeListener("end",i);r()},"clear");this._drained=true;this._readable=e;this._readable2=e._readableState?e:jun(e);this._readable2.on("readable",n);this._readable2.on("end",i);this._unread=s;this._forward()};el.prototype._read=function(){this._drained=true;this._forward()};el.prototype._forward=function(){if(this._forwarding||!this._readable2||!this._drained)return;this._forwarding=true;var e;while(this._drained&&(e=Mun(this._readable2))!==null){if(this.destroyed)continue;this._drained=this.push(e)}this._forwarding=false};el.prototype.destroy=function(e,t){if(!t)t=$un;if(this.destroyed)return t(null);this.destroyed=true;var r=this;process.nextTick(function(){r._destroy(e);t(null)})};el.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null;if(t)t(e);else this.emit("error",e)}if(this._forwardDestroy){if(this._readable&&this._readable.destroy)this._readable.destroy();if(this._writable&&this._writable.destroy)this._writable.destroy()}this.emit("close")};el.prototype._write=function(e,t,r){if(this.destroyed)return;if(this._corked)return Q2e(this,this._write.bind(this,e,t,r));if(e===H1t)return this._finish(r);if(!this._writable)return r();if(this._writable.write(e)===false)this._ondrain=r;else if(!this.destroyed)r()};el.prototype._finish=function(e){var t=this;this.emit("preend");Q2e(this,function(){Uun(t._forwardEnd&&t._writable,function(){if(t._writableState.prefinished===false)t._writableState.prefinished=true;t.emit("prefinish");Q2e(t,e)})})};el.prototype.end=function(e,t,r){if(typeof e==="function")return this.end(null,null,e);if(typeof t==="function")return this.end(e,null,t);this._ended=true;if(e)this.write(e);if(!this._writableState.ending&&!this._writableState.destroyed)this.write(H1t);return xW.Writable.prototype.end.call(this,r)};z1t.exports=el});var CA=y(io=>{"use strict";var Gun=io&&io.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var Hun=io&&io.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var X1t=io&&io.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Gun(t,e,r)}Hun(t,e);return t};var J1t=io&&io.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(io,"__esModule",{value:true});io.util=io.Util=io.PartialFailureError=io.ApiError=io.GCCL_GCS_CMD_KEY=void 0;var Z9=Eft();var Vun=X1t(Oft());var K1t=eW();var W1t=J1t(I0t());var zun=require("stream");var Y1t=Tgt();var Kun=X1t((Lv(),Ct(Dv)));var eSe=nSe();var tSe=P0();var Wun=J1t(Z2e());var Yun=VR();var Xun=(0,Yun.getPackageJSON)();io.GCCL_GCS_CMD_KEY=Symbol.for("GCCL_GCS_CMD");var RW={timeout:6e4,gzip:true,forever:true,pool:{maxSockets:Infinity}};var Jun=true;var Qun=3;var AA=class e extends Error{static{a(this,"ApiError")}constructor(t){super();if(typeof t!=="object"){this.message=t||"";return}const r=t;this.code=r.code;this.errors=r.errors;this.response=r.response;try{this.errors=JSON.parse(this.response.body).error.errors}catch(n){this.errors=r.errors}this.message=e.createMultiErrorMessage(r,this.errors);Error.captureStackTrace(this)}static createMultiErrorMessage(t,r){const n=new Set;if(t.message){n.add(t.message)}if(r&&r.length){r.forEach(({message:s})=>n.add(s))}else if(t.response&&t.response.body){n.add(Vun.decode(t.response.body.toString()))}else if(!t.message){n.add("A failure occurred during this request.")}let i=Array.from(n);if(i.length>1){i=i.map((s,o)=>` ${o+1}. ${s}`);i.unshift("Multiple errors occurred during the request. Please see the `errors` array for complete details.\n");i.push("\n")}return i.join("\n")}};io.ApiError=AA;var OW=class extends Error{static{a(this,"PartialFailureError")}constructor(t){super();const r=t;this.errors=r.errors;this.name="PartialFailureError";this.response=r.response;this.message=AA.createMultiErrorMessage(r,this.errors)}};io.PartialFailureError=OW;var PW=class{static{a(this,"Util")}constructor(){this.ApiError=AA;this.PartialFailureError=OW}noop(){}handleResp(t,r,n,i){i=i||lp.noop;const s={err:t||null,...r&&lp.parseHttpRespMessage(r),...n&&lp.parseHttpRespBody(n)};if(!s.err&&r&&typeof s.body==="object"){s.resp.body=s.body}if(s.err&&r){s.err.response=r}i(s.err,s.body,s.resp)}parseHttpRespMessage(t){const r={resp:t};if(t.statusCode<200||t.statusCode>299){r.err=new AA({errors:new Array,code:t.statusCode,message:t.statusMessage,response:t})}return r}parseHttpRespBody(t){const r={body:t};if(typeof t==="string"){try{r.body=JSON.parse(t)}catch(n){r.body=t}}if(r.body&&r.body.error){r.err=new AA(r.body.error)}return r}makeWritableStream(t,r,n){var i;n=n||lp.noop;const s=new rSe;s.on("progress",c=>t.emit("progress",c));t.setWritable(s);const o={method:"POST",qs:{uploadType:"multipart"},timeout:0,maxRetries:0};const u=r.metadata||{};const l={...o,...r.request,qs:{...o.qs,...(i=r.request)===null||i===void 0?void 0:i.qs},multipart:[{"Content-Type":"application/json",body:JSON.stringify(u)},{"Content-Type":u.contentType||"application/octet-stream",body:s}]};r.makeAuthenticatedRequest(l,{onAuthenticated(c,d){if(c){t.destroy(c);return}RW.headers=lp._getDefaultHeaders(l[io.GCCL_GCS_CMD_KEY]);const p=Y1t.teenyRequest.defaults(RW);p(d,(f,m,h)=>{lp.handleResp(f,m,h,(g,_)=>{if(g){t.destroy(g);return}t.emit("response",m);n(_)})})}})}shouldRetryRequest(t){if(t){if([408,429,500,502,503,504].indexOf(t.code)!==-1){return true}if(t.errors){for(const r of t.errors){const n=r.reason;if(n==="rateLimitExceeded"){return true}if(n==="userRateLimitExceeded"){return true}if(n&&n.includes("EAI_AGAIN")){return true}}}}return false}makeAuthenticatedRequestFactory(t){const r={...t};if(r.projectId===eSe.DEFAULT_PROJECT_ID_TOKEN){delete r.projectId}let n;if(r.authClient instanceof K1t.GoogleAuth){n=r.authClient}else{const o={...r,authClient:r.authClient};n=new K1t.GoogleAuth(o)}function i(o,u){let l;let c;const d={...t};let p;if(!u){l=(0,Wun.default)();d.stream=l}const f=typeof u==="object"?u:void 0;const m=typeof u==="function"?u:void 0;async function h(){c=await n.getProjectId()}a(h,"setProjectId");const g=a(async(v,S)=>{const E=v;const b=v&&typeof v.message==="string"&&v.message.indexOf("Could not load the default credentials")>-1;if(b){S=o}if(!v||b){try{S=lp.decorateRequest(S,c);v=null}catch(A){if(A instanceof Z9.MissingProjectIdError){try{await h();S=lp.decorateRequest(S,c);v=null}catch(C){v=v||C}}else{v=v||A}}}if(v){if(l){l.destroy(v)}else{const A=f&&f.onAuthenticated?f.onAuthenticated:m;A(v)}return}if(f&&f.onAuthenticated){f.onAuthenticated(null,S)}else{p=lp.makeRequest(S,d,(A,...C)=>{if(A&&A.code===401&&E){A=E}m(A,...C)})}},"onAuthenticated");const _=a(async()=>{try{const v=a(async()=>{if(t.projectId&&t.projectId!==eSe.DEFAULT_PROJECT_ID_TOKEN){return t.projectId}if(t.projectIdRequired===false){return eSe.DEFAULT_PROJECT_ID_TOKEN}return h()},"getProjectId");const S=a(async()=>{if(d.customEndpoint&&!d.useAuthWithCustomEndpoint){return o}else{return n.authorizeRequest(o)}},"authorizeRequest");const[E,b]=await Promise.all([v(),S()]);if(E){c=E}return g(null,b)}catch(v){return g(v)}},"prepareRequest");_();if(l){return l}return{abort(){setImmediate(()=>{if(p){p.abort();p=null}})}}}a(i,"makeAuthenticatedRequest");const s=i;s.getCredentials=n.getCredentials.bind(n);s.authClient=n;return s}makeRequest(t,r,n){var i,s,o,u,l;let c=Jun;if(r.autoRetry!==void 0){c=r.autoRetry}else if(((i=r.retryOptions)===null||i===void 0?void 0:i.autoRetry)!==void 0){c=r.retryOptions.autoRetry}let d=Qun;if(r.maxRetries!==void 0){d=r.maxRetries}else if(((s=r.retryOptions)===null||s===void 0?void 0:s.maxRetries)!==void 0){d=r.retryOptions.maxRetries}RW.headers=this._getDefaultHeaders(t[io.GCCL_GCS_CMD_KEY]);const p={request:Y1t.teenyRequest.defaults(RW),retries:c!==false?d:0,noResponseRetries:c!==false?d:0,shouldRetryFn(g){var _,v;const S=lp.parseHttpRespMessage(g).err;if((_=r.retryOptions)===null||_===void 0?void 0:_.retryableErrorFn){return S&&((v=r.retryOptions)===null||v===void 0?void 0:v.retryableErrorFn(S))}return S&&lp.shouldRetryRequest(S)},maxRetryDelay:(o=r.retryOptions)===null||o===void 0?void 0:o.maxRetryDelay,retryDelayMultiplier:(u=r.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier,totalTimeout:(l=r.retryOptions)===null||l===void 0?void 0:l.totalTimeout};if(typeof t.maxRetries==="number"){p.retries=t.maxRetries;p.noResponseRetries=t.maxRetries}if(!r.stream){return(0,W1t.default)(t,p,(g,_,v)=>{lp.handleResp(g,_,v,n)})}const f=r.stream;let m;const h=(t.method||"GET").toUpperCase()==="GET";if(h){m=(0,W1t.default)(t,p);f.setReadable(m)}else{m=p.request(t);f.setWritable(m)}m.on("error",f.destroy.bind(f)).on("response",f.emit.bind(f,"response")).on("complete",f.emit.bind(f,"complete"));f.abort=m.abort;return f}decorateRequest(t,r){delete t.autoPaginate;delete t.autoPaginateVal;delete t.objectMode;if(t.qs!==null&&typeof t.qs==="object"){delete t.qs.autoPaginate;delete t.qs.autoPaginateVal;t.qs=(0,Z9.replaceProjectIdToken)(t.qs,r)}if(Array.isArray(t.multipart)){t.multipart=t.multipart.map(n=>{return(0,Z9.replaceProjectIdToken)(n,r)})}if(t.json!==null&&typeof t.json==="object"){delete t.json.autoPaginate;delete t.json.autoPaginateVal;t.json=(0,Z9.replaceProjectIdToken)(t.json,r)}t.uri=(0,Z9.replaceProjectIdToken)(t.uri,r);return t}isCustomType(t,r){function n(l){return l.constructor&&l.constructor.name.toLowerCase()}a(n,"getConstructorName");const i=r.split("/");const s=i[0]&&i[0].toLowerCase();const o=i[1]&&i[1].toLowerCase();if(o&&n(t)!==o){return false}let u=t;while(true){if(n(u)===s){return true}u=u.parent;if(!u){return false}}}maybeOptionsOrCallback(t,r){return typeof t==="function"?[{},t]:[t,r]}_getDefaultHeaders(t){const r={"User-Agent":(0,tSe.getUserAgentString)(),"x-goog-api-client":`${(0,tSe.getRuntimeTrackingString)()} gccl/${Xun.version}-${(0,tSe.getModuleFormat)()} gccl-invocation-id/${Kun.v4()}`};if(t){r["x-goog-api-client"]+=` gccl-gcs-cmd/${t}`}return r}};io.Util=PW;var rSe=class extends zun.Transform{static{a(this,"ProgressStream")}constructor(){super(...arguments);this.bytesRead=0}_transform(t,r,n){this.bytesRead+=t.length;this.emit("progress",{bytesWritten:this.bytesRead,contentLength:"*"});this.push(t);n()}};var lp=new PW;io.util=lp});var nSe=y(ud=>{"use strict";var Zun=ud&&ud.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var eln=ud&&ud.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var tln=ud&&ud.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Zun(t,e,r)}eln(t,e);return t};Object.defineProperty(ud,"__esModule",{value:true});ud.Service=ud.DEFAULT_PROJECT_ID_TOKEN=void 0;var rln=tln((Lv(),Ct(Dv)));var iSe=CA();var sSe=P0();ud.DEFAULT_PROJECT_ID_TOKEN="{{projectId}}";var aSe=class e{static{a(this,"Service")}constructor(t,r={}){this.baseUrl=t.baseUrl;this.apiEndpoint=t.apiEndpoint;this.timeout=r.timeout;this.globalInterceptors=Array.isArray(r.interceptors_)?r.interceptors_:[];this.interceptors=[];this.packageJson=t.packageJson;this.projectId=r.projectId||ud.DEFAULT_PROJECT_ID_TOKEN;this.projectIdRequired=t.projectIdRequired!==false;this.providedUserAgent=r.userAgent;const n={...t,projectIdRequired:this.projectIdRequired,projectId:this.projectId,authClient:r.authClient||t.authClient,credentials:r.credentials,keyFile:r.keyFilename,email:r.email,token:r.token};this.makeAuthenticatedRequest=iSe.util.makeAuthenticatedRequestFactory(n);this.authClient=this.makeAuthenticatedRequest.authClient;this.getCredentials=this.makeAuthenticatedRequest.getCredentials;const i=!!process.env.FUNCTION_NAME;if(i){this.interceptors.push({request(s){s.forever=false;return s}})}}getRequestInterceptors(){return[].slice.call(this.globalInterceptors).concat(this.interceptors).filter(t=>typeof t.request==="function").map(t=>t.request)}getProjectId(t){if(!t){return this.getProjectIdAsync()}this.getProjectIdAsync().then(r=>t(null,r),t)}async getProjectIdAsync(){const t=await this.authClient.getProjectId();if(this.projectId===ud.DEFAULT_PROJECT_ID_TOKEN&&t){this.projectId=t}return this.projectId}request_(t,r){t={...t,timeout:this.timeout};const n=t.uri.indexOf("http")===0;const i=[this.baseUrl];if(this.projectIdRequired){if(t.projectId){i.push("projects");i.push(t.projectId)}else{i.push("projects");i.push(this.projectId)}}i.push(t.uri);if(n){i.splice(0,i.indexOf(t.uri))}t.uri=i.map(c=>{const d=/^\/*|\/*$/g;return c.replace(d,"")}).join("/").replace(/\/:/g,":");const s=this.getRequestInterceptors();const o=Array.isArray(t.interceptors_)?t.interceptors_:[];o.forEach(c=>{if(typeof c.request==="function"){s.push(c.request)}});s.forEach(c=>{t=c(t)});delete t.interceptors_;const u=this.packageJson;let l=(0,sSe.getUserAgentString)();if(this.providedUserAgent){l=`${this.providedUserAgent} ${l}`}t.headers={...t.headers,"User-Agent":l,"x-goog-api-client":`${(0,sSe.getRuntimeTrackingString)()} gccl/${u.version}-${(0,sSe.getModuleFormat)()} gccl-invocation-id/${rln.v4()}`};if(t[iSe.GCCL_GCS_CMD_KEY]){t.headers["x-goog-api-client"]+=` gccl-gcs-cmd/${t[iSe.GCCL_GCS_CMD_KEY]}`}if(t.shouldReturnStream){return this.makeAuthenticatedRequest(t)}else{this.makeAuthenticatedRequest(t,r)}}request(t,r){e.prototype.request_.call(this,t,r)}requestStream(t){const r={...t,shouldReturnStream:true};return e.prototype.request_.call(this,r)}};ud.Service=aSe});var I0=y(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:true});gf.callbackifyAll=gf.callbackify=gf.promisifyAll=gf.promisify=void 0;function nln(e,t){if(e.promisified_){return e}t=t||{};const r=Array.prototype.slice;const n=a(function(){let i;for(i=arguments.length-1;i>=0;i--){const u=arguments[i];if(typeof u==="undefined"){continue}if(typeof u!=="function"){break}return e.apply(this,arguments)}const s=r.call(arguments,0,i+1);let o=Promise;if(this&&this.Promise){o=this.Promise}return new o((u,l)=>{s.push((...c)=>{const d=r.call(c);const p=d.shift();if(p){return l(p)}if(t.singular&&d.length===1){u(d[0])}else{u(d)}});e.apply(this,s)})},"wrapper");n.promisified_=true;return n}a(nln,"promisify");gf.promisify=nln;function iln(e,t){const r=t&&t.exclude||[];const n=Object.getOwnPropertyNames(e.prototype);const i=n.filter(s=>{return!r.includes(s)&&typeof e.prototype[s]==="function"&&!/(^_|(Stream|_)|promise$)|^constructor$/.test(s)});i.forEach(s=>{const o=e.prototype[s];if(!o.promisified_){e.prototype[s]=gf.promisify(o,t)}})}a(iln,"promisifyAll");gf.promisifyAll=iln;function sln(e){if(e.callbackified_){return e}const t=a(function(){if(typeof arguments[arguments.length-1]!=="function"){return e.apply(this,arguments)}const r=Array.prototype.pop.call(arguments);e.apply(this,arguments).then(n=>{n=Array.isArray(n)?n:[n];r(null,...n)},n=>r(n))},"wrapper");t.callbackified_=true;return t}a(sln,"callbackify");gf.callbackify=sln;function aln(e,t){const r=t&&t.exclude||[];const n=Object.getOwnPropertyNames(e.prototype);const i=n.filter(s=>{return!r.includes(s)&&typeof e.prototype[s]==="function"&&!/^_|(Stream|_)|^constructor$/.test(s)});i.forEach(s=>{const o=e.prototype[s];if(!o.callbackified_){e.prototype[s]=gf.callbackify(o)}})}a(aln,"callbackifyAll");gf.callbackifyAll=aln});var Q1t=y(IW=>{"use strict";Object.defineProperty(IW,"__esModule",{value:true});IW.ServiceObject=void 0;var oln=I0();var uln=require("events");var eL=CA();var NW=class e extends uln.EventEmitter{static{a(this,"ServiceObject")}constructor(t){super();this.metadata={};this.baseUrl=t.baseUrl;this.parent=t.parent;this.id=t.id;this.createMethod=t.createMethod;this.methods=t.methods||{};this.interceptors=[];this.projectId=t.projectId;if(t.methods){Object.getOwnPropertyNames(e.prototype).filter(r=>{return!/^request/.test(r)&&!/^getRequestInterceptors/.test(r)&&this[r]===e.prototype[r]&&!t.methods[r]}).forEach(r=>{this[r]=void 0})}}create(t,r){const n=this;const i=[this.id];if(typeof t==="function"){r=t}if(typeof t==="object"){i.push(t)}function s(...o){const[u,l]=o;if(!u){n.metadata=l.metadata;if(n.id&&l.metadata){n.id=l.metadata.id}o[1]=n}r(...o)}a(s,"onCreate");i.push(s);this.createMethod.apply(null,i)}delete(t,r){var n;const[i,s]=eL.util.maybeOptionsOrCallback(t,r);const o=i.ignoreNotFound;delete i.ignoreNotFound;const u=typeof this.methods.delete==="object"&&this.methods.delete||{};const l={method:"DELETE",uri:"",...u.reqOpts,qs:{...(n=u.reqOpts)===null||n===void 0?void 0:n.qs,...i}};e.prototype.request.call(this,l,(c,d,p)=>{if(c){if(c.code===404&&o){c=null}}s(c,p)})}exists(t,r){const[n,i]=eL.util.maybeOptionsOrCallback(t,r);this.get(n,s=>{if(s){if(s.code===404){i(null,false)}else{i(s)}return}i(null,true)})}get(t,r){const n=this;const[i,s]=eL.util.maybeOptionsOrCallback(t,r);const o=Object.assign({},i);const u=o.autoCreate&&typeof this.create==="function";delete o.autoCreate;function l(c,d,p){if(c){if(c.code===409){n.get(o,s);return}s(c,null,p);return}s(null,d,p)}a(l,"onCreate");this.getMetadata(o,(c,d)=>{if(c){if(c.code===404&&u){const p=[];if(Object.keys(o).length>0){p.push(o)}p.push(l);n.create(...p);return}s(c,null,d);return}s(null,n,d)})}getMetadata(t,r){var n;const[i,s]=eL.util.maybeOptionsOrCallback(t,r);const o=typeof this.methods.getMetadata==="object"&&this.methods.getMetadata||{};const u={uri:"",...o.reqOpts,qs:{...(n=o.reqOpts)===null||n===void 0?void 0:n.qs,...i}};e.prototype.request.call(this,u,(l,c,d)=>{this.metadata=c;s(l,this.metadata,d)})}getRequestInterceptors(){const t=this.interceptors.filter(r=>typeof r.request==="function").map(r=>r.request);return this.parent.getRequestInterceptors().concat(t)}setMetadata(t,r,n){var i,s;const[o,u]=eL.util.maybeOptionsOrCallback(r,n);const l=typeof this.methods.setMetadata==="object"&&this.methods.setMetadata||{};const c={method:"PATCH",uri:"",...l.reqOpts,json:{...(i=l.reqOpts)===null||i===void 0?void 0:i.json,...t},qs:{...(s=l.reqOpts)===null||s===void 0?void 0:s.qs,...o}};e.prototype.request.call(this,c,(d,p,f)=>{this.metadata=p;u(d,this.metadata,f)})}request_(t,r){t={...t};if(this.projectId){t.projectId=this.projectId}const n=t.uri.indexOf("http")===0;const i=[this.baseUrl,this.id||"",t.uri];if(n){i.splice(0,i.indexOf(t.uri))}t.uri=i.filter(u=>u.trim()).map(u=>{const l=/^\/*|\/*$/g;return u.replace(l,"")}).join("/");const s=Array.isArray(t.interceptors_)?t.interceptors_:[];const o=[].slice.call(this.interceptors);t.interceptors_=s.concat(o);if(t.shouldReturnStream){return this.parent.requestStream(t)}this.parent.request(t,r)}request(t,r){this.request_(t,r)}requestStream(t){const r={...t,shouldReturnStream:true};return this.request_(r)}};IW.ServiceObject=NW;(0,oln.promisifyAll)(NW,{exclude:["getRequestInterceptors"]})});var tE=y(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:true});k0.util=k0.ApiError=k0.ServiceObject=k0.Service=void 0;var lln=nSe();Object.defineProperty(k0,"Service",{enumerable:true,get:function(){return lln.Service}});var cln=Q1t();Object.defineProperty(k0,"ServiceObject",{enumerable:true,get:function(){return cln.ServiceObject}});var Z1t=CA();Object.defineProperty(k0,"ApiError",{enumerable:true,get:function(){return Z1t.ApiError}});Object.defineProperty(k0,"util",{enumerable:true,get:function(){return Z1t.util}})});var oSe=y((JRs,eyt)=>{"use strict";var dln=a(e=>{if(e===null||e===void 0){return[]}if(Array.isArray(e)){return e}if(typeof e==="string"){return[e]}if(typeof e[Symbol.iterator]==="function"){return[...e]}return[e]},"arrify");eyt.exports=dln});var tyt=y(kW=>{"use strict";Object.defineProperty(kW,"__esModule",{value:true});kW.ResourceStream=void 0;var pln=require("stream");var uSe=class extends pln.Transform{static{a(this,"ResourceStream")}constructor(t,r){const n=Object.assign({objectMode:true},t.streamOptions);super(n);this._ended=false;this._maxApiCalls=t.maxApiCalls===-1?Infinity:t.maxApiCalls;this._nextQuery=t.query;this._reading=false;this._requestFn=r;this._requestsMade=0;this._resultsToSend=t.maxResults===-1?Infinity:t.maxResults}end(...t){this._ended=true;return super.end(...t)}_read(){if(this._reading){return}this._reading=true;try{this._requestFn(this._nextQuery,(t,r,n)=>{if(t){this.destroy(t);return}this._nextQuery=n;if(this._resultsToSend!==Infinity){r=r.splice(0,this._resultsToSend);this._resultsToSend-=r.length}let i=true;for(const u of r){if(this._ended){break}i=this.push(u)}const s=!this._nextQuery||this._resultsToSend<1;const o=++this._requestsMade>=this._maxApiCalls;if(s||o){this.end()}if(i&&!this._ended){setImmediate(()=>this._read())}this._reading=false})}catch(t){this.destroy(t)}}};kW.ResourceStream=uSe});var lSe=y(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:true});rE.ResourceStream=rE.paginator=rE.Paginator=void 0;var fln=oSe();var ryt=f9();var nyt=tyt();Object.defineProperty(rE,"ResourceStream",{enumerable:true,get:function(){return nyt.ResourceStream}});var DW=class{static{a(this,"Paginator")}extend(t,r){r=fln(r);r.forEach(n=>{const i=t.prototype[n];t.prototype[n+"_"]=i;t.prototype[n]=function(...s){const o=JR.parseArguments_(s);return JR.run_(o,i.bind(this))}})}streamify(t){return function(...r){const n=JR.parseArguments_(r);const i=this[t+"_"]||this[t];return JR.runAsStream_(n,i.bind(this))}}parseArguments_(t){let r;let n=true;let i=-1;let s=-1;let o;const u=t[0];const l=t[t.length-1];if(typeof u==="function"){o=u}else{r=u}if(typeof l==="function"){o=l}if(typeof r==="object"){r=ryt(true,{},r);if(r.maxResults&&typeof r.maxResults==="number"){s=r.maxResults}else if(typeof r.pageSize==="number"){s=r.pageSize}if(r.maxApiCalls&&typeof r.maxApiCalls==="number"){i=r.maxApiCalls;delete r.maxApiCalls}if(s!==-1||r.autoPaginate===false){n=false}}const c={query:r||{},autoPaginate:n,maxApiCalls:i,maxResults:s,callback:o};c.streamOptions=ryt(true,{},c.query);delete c.streamOptions.autoPaginate;delete c.streamOptions.maxResults;delete c.streamOptions.pageSize;return c}run_(t,r){const n=t.query;const i=t.callback;if(!t.autoPaginate){return r(n,i)}const s=new Array;const o=new Promise((u,l)=>{JR.runAsStream_(t,r).on("error",l).on("data",c=>s.push(c)).on("end",()=>u(s))});if(!i){return o.then(u=>[u])}o.then(u=>i(null,u),u=>i(u))}runAsStream_(t,r){return new nyt.ResourceStream(t,r)}};rE.Paginator=DW;var JR=new DW;rE.paginator=JR});var iyt=y((nOs,mln)=>{mln.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/3gpp-ims+xml":{source:"iana",compressible:true},"application/3gpphal+json":{source:"iana",compressible:true},"application/3gpphalforms+json":{source:"iana",compressible:true},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:true},"application/alto-costmap+json":{source:"iana",compressible:true},"application/alto-costmapfilter+json":{source:"iana",compressible:true},"application/alto-directory+json":{source:"iana",compressible:true},"application/alto-endpointcost+json":{source:"iana",compressible:true},"application/alto-endpointcostparams+json":{source:"iana",compressible:true},"application/alto-endpointprop+json":{source:"iana",compressible:true},"application/alto-endpointpropparams+json":{source:"iana",compressible:true},"application/alto-error+json":{source:"iana",compressible:true},"application/alto-networkmap+json":{source:"iana",compressible:true},"application/alto-networkmapfilter+json":{source:"iana",compressible:true},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:true},"application/alto-updatestreamparams+json":{source:"iana",compressible:true},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:true,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:true,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:true,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:true,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:true,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:true,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:true},"application/atsc-rsat+xml":{source:"iana",compressible:true,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:true},"application/bacnet-xdd+zip":{source:"iana",compressible:false},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:false,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/calendar+json":{source:"iana",compressible:true},"application/calendar+xml":{source:"iana",compressible:true,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:true},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:true},"application/ccxml+xml":{source:"iana",compressible:true,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:true,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:true},"application/cellml+xml":{source:"iana",compressible:true},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:true},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:true},"application/clue_info+xml":{source:"iana",compressible:true},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:true},"application/coap-group+json":{source:"iana",compressible:true},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:true},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:true,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:true},"application/cstadata+xml":{source:"iana",compressible:true},"application/csvm+json":{source:"iana",compressible:true},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:true},"application/dash+xml":{source:"iana",compressible:true,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:true,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:true,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:true},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:true},"application/dicom+xml":{source:"iana",compressible:true},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:true},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:true,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:true},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:true,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:true,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:false},"application/edifact":{source:"iana",compressible:false},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:true},"application/elm+xml":{source:"iana",compressible:true},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/emergencycalldata.comment+xml":{source:"iana",compressible:true},"application/emergencycalldata.control+xml":{source:"iana",compressible:true},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:true},"application/emergencycalldata.veds+xml":{source:"iana",compressible:true},"application/emma+xml":{source:"iana",compressible:true,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:true,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:true},"application/epub+zip":{source:"iana",compressible:false,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:true},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:true,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:true},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/fido.trusted-apps+json":{compressible:true},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:false},"application/framework-attributes+xml":{source:"iana",compressible:true},"application/geo+json":{source:"iana",compressible:true,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:true},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:true,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:true,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:false,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:true},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:true},"application/ibe-pkg-reply+xml":{source:"iana",compressible:true},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:true,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:true,extensions:["its"]},"application/java-archive":{source:"apache",compressible:false,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:false,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:false,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:true,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:true},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:true},"application/jrd+json":{source:"iana",compressible:true},"application/jscalendar+json":{source:"iana",compressible:true},"application/json":{source:"iana",charset:"UTF-8",compressible:true,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:true},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:true,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:true},"application/jwk-set+json":{source:"iana",compressible:true},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:true},"application/kpml-response+xml":{source:"iana",compressible:true},"application/ld+json":{source:"iana",compressible:true,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:true,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:true},"application/lost+xml":{source:"iana",compressible:true,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:true},"application/lpf+zip":{source:"iana",compressible:false},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:true,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:true,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:true,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:true,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:true},"application/mathml-presentation+xml":{source:"iana",compressible:true},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:true},"application/mbms-deregister+xml":{source:"iana",compressible:true},"application/mbms-envelope+xml":{source:"iana",compressible:true},"application/mbms-msk+xml":{source:"iana",compressible:true},"application/mbms-msk-response+xml":{source:"iana",compressible:true},"application/mbms-protection-description+xml":{source:"iana",compressible:true},"application/mbms-reception-report+xml":{source:"iana",compressible:true},"application/mbms-register+xml":{source:"iana",compressible:true},"application/mbms-register-response+xml":{source:"iana",compressible:true},"application/mbms-schedule+xml":{source:"iana",compressible:true},"application/mbms-user-service-description+xml":{source:"iana",compressible:true},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:true,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:true},"application/mediaservercontrol+xml":{source:"iana",compressible:true,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:true},"application/metalink+xml":{source:"apache",compressible:true,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:true,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:true,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:true,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:true,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:true,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:true},"application/mrb-publish+xml":{source:"iana",compressible:true},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/msword":{source:"iana",compressible:false,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:true},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:true},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:false,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:true},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:true,extensions:["opf"]},"application/ogg":{source:"iana",compressible:false,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:true,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:true},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:false},"application/p2p-overlay+xml":{source:"iana",compressible:true,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:true,extensions:["xer"]},"application/pdf":{source:"iana",compressible:false,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:false,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:true,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/postscript":{source:"iana",compressible:true,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:true},"application/problem+json":{source:"iana",compressible:true},"application/problem+xml":{source:"iana",compressible:true},"application/provenance+xml":{source:"iana",compressible:true,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:false},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:true},"application/pskc+xml":{source:"iana",compressible:true,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:true},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:true,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:true},"application/rdf+xml":{source:"iana",compressible:true,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:true,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:true},"application/resource-lists+xml":{source:"iana",compressible:true,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:true,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:true},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:true},"application/rls-services+xml":{source:"iana",compressible:true,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:true,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:true,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:true,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:true,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:true,extensions:["rss"]},"application/rtf":{source:"iana",compressible:true,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:true},"application/samlmetadata+xml":{source:"iana",compressible:true},"application/sarif+json":{source:"iana",compressible:true},"application/sarif-external-properties+json":{source:"iana",compressible:true},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:true,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:true},"application/scim+json":{source:"iana",compressible:true},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:true},"application/senml+xml":{source:"iana",compressible:true,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:true},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:true},"application/sensml+xml":{source:"iana",compressible:true,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:true},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:true,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:true},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:true,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:true},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:true,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:true},"application/spirits-event+xml":{source:"iana",compressible:true},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:true,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:true,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:true,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:true,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:true},"application/swid+xml":{source:"iana",compressible:true,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:true},"application/taxii+json":{source:"iana",compressible:true},"application/td+json":{source:"iana",compressible:true},"application/tei+xml":{source:"iana",compressible:true,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:true,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:true},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:true,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:true,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:false,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:true},"application/urc-ressheet+xml":{source:"iana",compressible:true,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:true,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:true},"application/vcard+json":{source:"iana",compressible:true},"application/vcard+xml":{source:"iana",compressible:true},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:true,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:true},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:true},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:true},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:true},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:true},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:true},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:true},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:true},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:true},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:true},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:true},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:true},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:false,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:true,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:true},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:true},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:false,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:true},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:true},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:true},"application/vnd.apple.installer+xml":{source:"iana",compressible:true,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:false,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:true},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:true},"application/vnd.avistar+xml":{source:"iana",compressible:true},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:true,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:true},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:true},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:true},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:true},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:true},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:true,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:true,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:true},"application/vnd.collection.doc+json":{source:"iana",compressible:true},"application/vnd.collection.next+json":{source:"iana",compressible:true},"application/vnd.comicbook+zip":{source:"iana",compressible:false},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:true},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:true,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:true},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:true},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:true},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:true},"application/vnd.cyclonedx+xml":{source:"iana",compressible:true},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:false},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:true,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:true},"application/vnd.dataresource+json":{source:"iana",compressible:true},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:true,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:true},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:true},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:true},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:true},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:true},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:true},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:true},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:true},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:true},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:false},"application/vnd.eszigno3+xml":{source:"iana",compressible:true,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:true},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:false},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:false},"application/vnd.etsi.cug+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:true},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:true},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:true},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:true},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:true},"application/vnd.etsi.sci+xml":{source:"iana",compressible:true},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:true},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:true},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:true},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:false},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:false},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:false},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:true},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:true},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:true},"application/vnd.geo+json":{source:"iana",compressible:true},"application/vnd.geocube+xml":{source:"iana",compressible:true},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:false,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:false,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:false,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:true,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:false,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:true},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:false},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:true},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:true},"application/vnd.hal+xml":{source:"iana",compressible:true,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:true,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:true},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:true},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:true},"application/vnd.hyper-item+json":{source:"iana",compressible:true},"application/vnd.hyperdrive+json":{source:"iana",compressible:true},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:false},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:false},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:true},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:true},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:true},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:true},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:true},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:true,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:false},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:true},"application/vnd.las.las+xml":{source:"iana",compressible:true,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:true},"application/vnd.liberty-request+xml":{source:"iana",compressible:true},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:true,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:false},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:true},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:true},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:false},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:true},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:true},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:true,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:false,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:true,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:true},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:true},"application/vnd.ms-outlook":{compressible:false,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:true},"application/vnd.ms-powerpoint":{source:"iana",compressible:false,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:true},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:true},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:true},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:false,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:true},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:true},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:true},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:true},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:true},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:true},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:true,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:true},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:false,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:false,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:false,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:false,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:true},"application/vnd.oftn.l10n+json":{source:"iana",compressible:true},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:true},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:true},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:true},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:true},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:true},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:true},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:true},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:true},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:true},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:true},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:true},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:true},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:true,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:true},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:true},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:true},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:true},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:true},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:true},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:true},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:true,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:true,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:false,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:false,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:false,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:true},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:true},"application/vnd.oracle.resource+json":{source:"iana",compressible:true},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:true},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:true},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:true},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:true},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:true},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:true},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:true,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:true},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:true,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:true},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:true},"application/vnd.shopkick+json":{source:"iana",compressible:true},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:true},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:true,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:true,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:true,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:true},"application/vnd.syft+json":{source:"iana",compressible:true},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:true,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:true},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:true},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:true},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:true},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:true,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:true},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:true},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:true},"application/vnd.wv.ssp+xml":{source:"iana",compressible:true},"application/vnd.xacml+json":{source:"iana",compressible:true},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:true},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:true,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:true,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:true,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:true},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:true,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:true,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:true},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:true,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:true,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:false,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:false,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:false,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:false,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:false,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:false},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:true,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:true,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:true,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:false,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:true,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:false,extensions:["jnlp"]},"application/x-javascript":{compressible:true},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:false,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:false},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:true,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:false,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:false,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:true,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:false,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:false,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:true,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:true,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:true,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:true,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:true,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:false,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:true,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:true,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:true,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:true,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:true},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:true,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:false,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:true},"application/xaml+xml":{source:"apache",compressible:true,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:true,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:true,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:true,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:true,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:true},"application/xcap-ns+xml":{source:"iana",compressible:true,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:true},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:true},"application/xenc+xml":{source:"iana",compressible:true,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:true,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:true},"application/xliff+xml":{source:"iana",compressible:true,extensions:["xlf"]},"application/xml":{source:"iana",compressible:true,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:true,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:true},"application/xmpp+xml":{source:"iana",compressible:true},"application/xop+xml":{source:"iana",compressible:true,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:true,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:true,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:true,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:true,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:true},"application/yang-data+xml":{source:"iana",compressible:true},"application/yang-patch+json":{source:"iana",compressible:true},"application/yang-patch+xml":{source:"iana",compressible:true},"application/yin+xml":{source:"iana",compressible:true,extensions:["yin"]},"application/zip":{source:"iana",compressible:false,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:false,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:false,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:false},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:false,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:false,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:false,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:false,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:false},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:false},"audio/vorbis":{source:"iana",compressible:false},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:false,extensions:["wav"]},"audio/wave":{compressible:false,extensions:["wav"]},"audio/webm":{source:"apache",compressible:false,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:false,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:false,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:true,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:true,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:false,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:false,extensions:["avif"]},"image/bmp":{source:"iana",compressible:true,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:false,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:false,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:false,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:false,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:false,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:false},"image/png":{source:"iana",compressible:false,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:true,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:false,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:true,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:true,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:true,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:true,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:true,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:false},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:false},"message/imdn+xml":{source:"iana",compressible:true},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:false},"message/rfc822":{source:"iana",compressible:true,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:true,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:true,extensions:["glb"]},"model/iges":{source:"iana",compressible:false,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:false,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:true,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:false,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:false,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:true,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:true},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:false,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:false,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:false,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:false,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:true,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:false},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:false},"multipart/form-data":{source:"iana",compressible:false},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:false},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:false},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:true,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:true},"text/cmd":{compressible:true},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:true,extensions:["css"]},"text/csv":{source:"iana",compressible:true,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:true,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:true},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:true,extensions:["jsx"]},"text/less":{compressible:true,extensions:["less"]},"text/markdown":{source:"iana",compressible:true,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:true,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:true,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:true,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:true,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:true,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:true,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:true,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:true,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:true,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:true},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:true},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:true,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:true,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:true,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:true,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:true,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:true,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:false,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:false,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:false,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:false,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:false,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:false,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:false,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:false,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:true},"x-shader/x-vertex":{compressible:true}}});var cSe=y((iOs,syt)=>{syt.exports=iyt()});var dSe=y(ld=>{"use strict";var LW=cSe();var hln=require("path").extname;var ayt=/^\s*([^;\s]*)(?:;|\s|$)/;var gln=/^text\//i;ld.charset=oyt;ld.charsets={lookup:oyt};ld.contentType=yln;ld.extension=_ln;ld.extensions=Object.create(null);ld.lookup=vln;ld.types=Object.create(null);Eln(ld.extensions,ld.types);function oyt(e){if(!e||typeof e!=="string"){return false}var t=ayt.exec(e);var r=t&&LW[t[1].toLowerCase()];if(r&&r.charset){return r.charset}if(t&&gln.test(t[1])){return"UTF-8"}return false}a(oyt,"charset");function yln(e){if(!e||typeof e!=="string"){return false}var t=e.indexOf("/")===-1?ld.lookup(e):e;if(!t){return false}if(t.indexOf("charset")===-1){var r=ld.charset(t);if(r)t+="; charset="+r.toLowerCase()}return t}a(yln,"contentType");function _ln(e){if(!e||typeof e!=="string"){return false}var t=ayt.exec(e);var r=t&&ld.extensions[t[1].toLowerCase()];if(!r||!r.length){return false}return r[0]}a(_ln,"extension");function vln(e){if(!e||typeof e!=="string"){return false}var t=hln("x."+e).toLowerCase().substr(1);if(!t){return false}return ld.types[t]||false}a(vln,"lookup");function Eln(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(LW).forEach(a(function n(i){var s=LW[i];var o=s.extensions;if(!o||!o.length){return}e[i]=o;for(var u=0;u<o.length;u++){var l=o[u];if(t[l]){var c=r.indexOf(LW[t[l]].source);var d=r.indexOf(s.source);if(t[l]!=="application/octet-stream"&&(c>d||c===d&&t[l].substr(0,12)==="application/")){continue}}t[l]=i}},"forEachMimeType"))}a(Eln,"populateMaps")});var lyt=y((oOs,uyt)=>{var pSe=class{static{a(this,"Node")}constructor(t){this.value=t;this.next=void 0}};var fSe=class{static{a(this,"Queue")}constructor(){this.clear()}enqueue(t){const r=new pSe(t);if(this._head){this._tail.next=r;this._tail=r}else{this._head=r;this._tail=r}this._size++}dequeue(){const t=this._head;if(!t){return}this._head=this._head.next;this._size--;return t.value}clear(){this._head=void 0;this._tail=void 0;this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;while(t){yield t.value;t=t.next}}};uyt.exports=fSe});var mSe=y((lOs,cyt)=>{"use strict";var bln=lyt();var Sln=a(e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const t=new bln;let r=0;const n=a(()=>{r--;if(t.size>0){t.dequeue()()}},"next");const i=a(async(u,l,...c)=>{r++;const d=(async()=>u(...c))();l(d);try{await d}catch{}n()},"run");const s=a((u,l,...c)=>{t.enqueue(i.bind(null,u,l,...c));(async()=>{await Promise.resolve();if(r<e&&t.size>0){t.dequeue()()}})()},"enqueue");const o=a((u,...l)=>new Promise(c=>{s(u,c,...l)}),"generator");Object.defineProperties(o,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}});return o},"pLimit");cyt.exports=Sln});var pyt=y((dOs,dyt)=>{function yf(e,t){if(typeof t==="boolean"){t={forever:t}}this._originalTimeouts=JSON.parse(JSON.stringify(e));this._timeouts=e;this._options=t||{};this._maxRetryTime=t&&t.maxRetryTime||Infinity;this._fn=null;this._errors=[];this._attempts=1;this._operationTimeout=null;this._operationTimeoutCb=null;this._timeout=null;this._operationStart=null;this._timer=null;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}a(yf,"RetryOperation");dyt.exports=yf;yf.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts.slice(0)};yf.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}if(this._timer){clearTimeout(this._timer)}this._timeouts=[];this._cachedTimeouts=null};yf.prototype.retry=function(e){if(this._timeout){clearTimeout(this._timeout)}if(!e){return false}var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime){this._errors.push(e);this._errors.unshift(new Error("RetryOperation timeout occurred"));return false}this._errors.push(e);var r=this._timeouts.shift();if(r===void 0){if(this._cachedTimeouts){this._errors.splice(0,this._errors.length-1);r=this._cachedTimeouts.slice(-1)}else{return false}}var n=this;this._timer=setTimeout(function(){n._attempts++;if(n._operationTimeoutCb){n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout);if(n._options.unref){n._timeout.unref()}}n._fn(n._attempts)},r);if(this._options.unref){this._timer.unref()}return true};yf.prototype.attempt=function(e,t){this._fn=e;if(t){if(t.timeout){this._operationTimeout=t.timeout}if(t.cb){this._operationTimeoutCb=t.cb}}var r=this;if(this._operationTimeoutCb){this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)}this._operationStart=new Date().getTime();this._fn(this._attempts)};yf.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated");this.attempt(e)};yf.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated");this.attempt(e)};yf.prototype.start=yf.prototype.try;yf.prototype.errors=function(){return this._errors};yf.prototype.attempts=function(){return this._attempts};yf.prototype.mainError=function(){if(this._errors.length===0){return null}var e={};var t=null;var r=0;for(var n=0;n<this._errors.length;n++){var i=this._errors[n];var s=i.message;var o=(e[s]||0)+1;e[s]=o;if(o>=r){t=i;r=o}}return t}});var fyt=y(wA=>{var Aln=pyt();wA.operation=function(e){var t=wA.timeouts(e);return new Aln(t,{forever:e&&(e.forever||e.retries===Infinity),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};wA.timeouts=function(e){if(e instanceof Array){return[].concat(e)}var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:Infinity,randomize:false};for(var r in e){t[r]=e[r]}if(t.minTimeout>t.maxTimeout){throw new Error("minTimeout is greater than maxTimeout")}var n=[];for(var i=0;i<t.retries;i++){n.push(this.createTimeout(i,t))}if(e&&e.forever&&!n.length){n.push(this.createTimeout(i,t))}n.sort(function(s,o){return s-o});return n};wA.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1;var n=Math.round(r*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));n=Math.min(n,t.maxTimeout);return n};wA.wrap=function(e,t,r){if(t instanceof Array){r=t;t=null}if(!r){r=[];for(var n in e){if(typeof e[n]==="function"){r.push(n)}}}for(var i=0;i<r.length;i++){var s=r[i];var o=e[s];e[s]=a(function u(l){var c=wA.operation(t);var d=Array.prototype.slice.call(arguments,1);var p=d.pop();d.push(function(f){if(c.retry(f)){return}if(f){arguments[0]=c.mainError()}p.apply(this,arguments)});c.attempt(function(){l.apply(e,d)})},"retryWrapper").bind(e,o);e[s].options=t}}});var hyt=y((hOs,myt)=>{myt.exports=fyt()});var tL=y((gOs,gyt)=>{var Cln=hyt();function wln(e,t){function r(n,i){var s=t||{};var o;if(!("randomize"in s)){s.randomize=true}o=Cln.operation(s);function u(d){i(d||new Error("Aborted"))}a(u,"bail");function l(d,p){if(d.bail){u(d);return}if(!o.retry(d)){i(o.mainError())}else if(s.onRetry){s.onRetry(d,p)}}a(l,"onError");function c(d){var p;try{p=e(u,d)}catch(f){l(f,d);return}Promise.resolve(p).then(n).catch(a(function f(m){l(m,d)},"catchIt"))}a(c,"runAttempt");o.attempt(c)}a(r,"run");return new Promise(r)}a(wln,"retry");gyt.exports=wln});var hSe=y(QR=>{"use strict";Object.defineProperty(QR,"__esModule",{value:true});QR.AclRoleAccessorMethods=QR.Acl=void 0;var Tln=I0();var TA=class e{static{a(this,"AclRoleAccessorMethods")}constructor(){this.owners={};this.readers={};this.writers={};this.owners={};this.readers={};this.writers={};e.roles.forEach(this._assignAccessMethods.bind(this))}_assignAccessMethods(t){const r=e.accessMethods;const n=e.entities;const i=t.toLowerCase()+"s";this[i]=n.reduce((s,o)=>{const u=o.charAt(o.length-1)==="-";r.forEach(l=>{let c=l+o[0].toUpperCase()+o.substring(1);if(u){c=c.replace("-","")}s[c]=(d,p,f)=>{let m;if(typeof p==="function"){f=p;p={}}if(u){m=o+d}else{m=o;f=d}p=Object.assign({entity:m,role:t},p);const h=[p];if(typeof f==="function"){h.push(f)}return this[l].apply(this,h)}});return s},{})}};QR.AclRoleAccessorMethods=TA;TA.accessMethods=["add","delete"];TA.entities=["allAuthenticatedUsers","allUsers","domain-","group-","project-","user-"];TA.roles=["OWNER","READER","WRITER"];var FW=class extends TA{static{a(this,"Acl")}constructor(t){super();this.pathPrefix=t.pathPrefix;this.request_=t.request}add(t,r){const n={};if(t.generation){n.generation=t.generation}if(t.userProject){n.userProject=t.userProject}this.request({method:"POST",uri:"",qs:n,maxRetries:0,json:{entity:t.entity,role:t.role.toUpperCase()}},(i,s)=>{if(i){r(i,null,s);return}r(null,this.makeAclObject_(s),s)})}delete(t,r){const n={};if(t.generation){n.generation=t.generation}if(t.userProject){n.userProject=t.userProject}this.request({method:"DELETE",uri:"/"+encodeURIComponent(t.entity),qs:n},(i,s)=>{r(i,s)})}get(t,r){const n=typeof t==="object"?t:null;const i=typeof t==="function"?t:r;let s="";const o={};if(n){s="/"+encodeURIComponent(n.entity);if(n.generation){o.generation=n.generation}if(n.userProject){o.userProject=n.userProject}}this.request({uri:s,qs:o},(u,l)=>{if(u){i(u,null,l);return}let c;if(l.items){c=l.items.map(this.makeAclObject_)}else{c=this.makeAclObject_(l)}i(null,c,l)})}update(t,r){const n={};if(t.generation){n.generation=t.generation}if(t.userProject){n.userProject=t.userProject}this.request({method:"PUT",uri:"/"+encodeURIComponent(t.entity),qs:n,json:{role:t.role.toUpperCase()}},(i,s)=>{if(i){r(i,null,s);return}r(null,this.makeAclObject_(s),s)})}makeAclObject_(t){const r={entity:t.entity,role:t.role};if(t.projectTeam){r.projectTeam=t.projectTeam}return r}request(t,r){t.uri=this.pathPrefix+t.uri;this.request_(t,r)}};QR.Acl=FW;(0,Tln.promisifyAll)(FW,{exclude:["request"]})});var _yt=y((EOs,yyt)=>{"use strict";var xln=cSe();var Rln=/^text\/|\+(?:json|text|xml)$/i;var Oln=/^\s*([^;\s]*)(?:;|\s|$)/;yyt.exports=Pln;function Pln(e){if(!e||typeof e!=="string"){return false}var t=Oln.exec(e);var r=t&&t[1].toLowerCase();var n=xln[r];if(n&&n.compressible!==void 0){return n.compressible}return Rln.test(r)||void 0}a(Pln,"compressible")});var Eyt=y((SOs,vyt)=>{"use strict";function BW(){this._types=Object.create(null);this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++){this.define(arguments[e])}this.define=this.define.bind(this);this.getType=this.getType.bind(this);this.getExtension=this.getExtension.bind(this)}a(BW,"Mime");BW.prototype.define=function(e,t){for(let r in e){let n=e[r].map(function(i){return i.toLowerCase()});r=r.toLowerCase();for(let i=0;i<n.length;i++){const s=n[i];if(s[0]==="*"){continue}if(!t&&s in this._types){throw new Error('Attempt to change mapping for "'+s+'" extension from "'+this._types[s]+'" to "'+r+'". Pass `force=true` to allow this, otherwise remove "'+s+'" from the list of extensions for "'+r+'".')}this._types[s]=r}if(t||!this._extensions[r]){const i=n[0];this._extensions[r]=i[0]!=="*"?i:i.substr(1)}}};BW.prototype.getType=function(e){e=String(e);let t=e.replace(/^.*[/\\]/,"").toLowerCase();let r=t.replace(/^.*\./,"").toLowerCase();let n=t.length<e.length;let i=r.length<t.length-1;return(i||!n)&&this._types[r]||null};BW.prototype.getExtension=function(e){e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1;return e&&this._extensions[e.toLowerCase()]||null};vyt.exports=BW});var Syt=y((COs,byt)=>{byt.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}});var Cyt=y((wOs,Ayt)=>{Ayt.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}});var Tyt=y((TOs,wyt)=>{"use strict";var Nln=Eyt();wyt.exports=new Nln(Syt(),Cyt())});var Fyt=y((iL,nL)=>{"use strict";Object.defineProperty(iL,"__esModule",{value:true});var Iyt=new WeakMap;var gSe=new WeakMap;function ya(e){const t=Iyt.get(e);console.assert(t!=null,"'this' is expected an Event object, but got",e);return t}a(ya,"pd");function xyt(e){if(e.passiveListener!=null){if(typeof console!=="undefined"&&typeof console.error==="function"){console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener)}return}if(!e.event.cancelable){return}e.canceled=true;if(typeof e.event.preventDefault==="function"){e.event.preventDefault()}}a(xyt,"setCancelFlag");function ZR(e,t){Iyt.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:false,stopped:false,immediateStopped:false,passiveListener:null,timeStamp:t.timeStamp||Date.now()});Object.defineProperty(this,"isTrusted",{value:false,enumerable:true});const r=Object.keys(t);for(let n=0;n<r.length;++n){const i=r[n];if(!(i in this)){Object.defineProperty(this,i,kyt(i))}}}a(ZR,"Event");ZR.prototype={get type(){return ya(this).event.type},get target(){return ya(this).eventTarget},get currentTarget(){return ya(this).currentTarget},composedPath(){const e=ya(this).currentTarget;if(e==null){return[]}return[e]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return ya(this).eventPhase},stopPropagation(){const e=ya(this);e.stopped=true;if(typeof e.event.stopPropagation==="function"){e.event.stopPropagation()}},stopImmediatePropagation(){const e=ya(this);e.stopped=true;e.immediateStopped=true;if(typeof e.event.stopImmediatePropagation==="function"){e.event.stopImmediatePropagation()}},get bubbles(){return Boolean(ya(this).event.bubbles)},get cancelable(){return Boolean(ya(this).event.cancelable)},preventDefault(){xyt(ya(this))},get defaultPrevented(){return ya(this).canceled},get composed(){return Boolean(ya(this).event.composed)},get timeStamp(){return ya(this).timeStamp},get srcElement(){return ya(this).eventTarget},get cancelBubble(){return ya(this).stopped},set cancelBubble(e){if(!e){return}const t=ya(this);t.stopped=true;if(typeof t.event.cancelBubble==="boolean"){t.event.cancelBubble=true}},get returnValue(){return!ya(this).canceled},set returnValue(e){if(!e){xyt(ya(this))}},initEvent(){}};Object.defineProperty(ZR.prototype,"constructor",{value:ZR,configurable:true,writable:true});if(typeof window!=="undefined"&&typeof window.Event!=="undefined"){Object.setPrototypeOf(ZR.prototype,window.Event.prototype);gSe.set(window.Event.prototype,ZR)}function kyt(e){return{get(){return ya(this).event[e]},set(t){ya(this).event[e]=t},configurable:true,enumerable:true}}a(kyt,"defineRedirectDescriptor");function Iln(e){return{value(){const t=ya(this).event;return t[e].apply(t,arguments)},configurable:true,enumerable:true}}a(Iln,"defineCallDescriptor");function kln(e,t){const r=Object.keys(t);if(r.length===0){return e}function n(i,s){e.call(this,i,s)}a(n,"CustomEvent");n.prototype=Object.create(e.prototype,{constructor:{value:n,configurable:true,writable:true}});for(let i=0;i<r.length;++i){const s=r[i];if(!(s in e.prototype)){const o=Object.getOwnPropertyDescriptor(t,s);const u=typeof o.value==="function";Object.defineProperty(n.prototype,s,u?Iln(s):kyt(s))}}return n}a(kln,"defineWrapper");function Dyt(e){if(e==null||e===Object.prototype){return ZR}let t=gSe.get(e);if(t==null){t=kln(Dyt(Object.getPrototypeOf(e)),e);gSe.set(e,t)}return t}a(Dyt,"getWrapper");function Dln(e,t){const r=Dyt(Object.getPrototypeOf(t));return new r(e,t)}a(Dln,"wrapEvent");function Lln(e){return ya(e).immediateStopped}a(Lln,"isStopped");function Fln(e,t){ya(e).eventPhase=t}a(Fln,"setEventPhase");function Bln(e,t){ya(e).currentTarget=t}a(Bln,"setCurrentTarget");function Ryt(e,t){ya(e).passiveListener=t}a(Ryt,"setPassiveListener");var Lyt=new WeakMap;var Oyt=1;var Pyt=2;var MW=3;function qW(e){return e!==null&&typeof e==="object"}a(qW,"isObject");function rL(e){const t=Lyt.get(e);if(t==null){throw new TypeError("'this' is expected an EventTarget object, but got another value.")}return t}a(rL,"getListeners");function Mln(e){return{get(){const t=rL(this);let r=t.get(e);while(r!=null){if(r.listenerType===MW){return r.listener}r=r.next}return null},set(t){if(typeof t!=="function"&&!qW(t)){t=null}const r=rL(this);let n=null;let i=r.get(e);while(i!=null){if(i.listenerType===MW){if(n!==null){n.next=i.next}else if(i.next!==null){r.set(e,i.next)}else{r.delete(e)}}else{n=i}i=i.next}if(t!==null){const s={listener:t,listenerType:MW,passive:false,once:false,next:null};if(n===null){r.set(e,s)}else{n.next=s}}},configurable:true,enumerable:true}}a(Mln,"defineEventAttributeDescriptor");function ySe(e,t){Object.defineProperty(e,`on${t}`,Mln(t))}a(ySe,"defineEventAttribute");function Nyt(e){function t(){ih.call(this)}a(t,"CustomEventTarget");t.prototype=Object.create(ih.prototype,{constructor:{value:t,configurable:true,writable:true}});for(let r=0;r<e.length;++r){ySe(t.prototype,e[r])}return t}a(Nyt,"defineCustomEventTarget");function ih(){if(this instanceof ih){Lyt.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0])){return Nyt(arguments[0])}if(arguments.length>0){const e=new Array(arguments.length);for(let t=0;t<arguments.length;++t){e[t]=arguments[t]}return Nyt(e)}throw new TypeError("Cannot call a class as a function")}a(ih,"EventTarget");ih.prototype={addEventListener(e,t,r){if(t==null){return}if(typeof t!=="function"&&!qW(t)){throw new TypeError("'listener' should be a function or an object.")}const n=rL(this);const i=qW(r);const s=i?Boolean(r.capture):Boolean(r);const o=s?Oyt:Pyt;const u={listener:t,listenerType:o,passive:i&&Boolean(r.passive),once:i&&Boolean(r.once),next:null};let l=n.get(e);if(l===void 0){n.set(e,u);return}let c=null;while(l!=null){if(l.listener===t&&l.listenerType===o){return}c=l;l=l.next}c.next=u},removeEventListener(e,t,r){if(t==null){return}const n=rL(this);const i=qW(r)?Boolean(r.capture):Boolean(r);const s=i?Oyt:Pyt;let o=null;let u=n.get(e);while(u!=null){if(u.listener===t&&u.listenerType===s){if(o!==null){o.next=u.next}else if(u.next!==null){n.set(e,u.next)}else{n.delete(e)}return}o=u;u=u.next}},dispatchEvent(e){if(e==null||typeof e.type!=="string"){throw new TypeError('"event.type" should be a string.')}const t=rL(this);const r=e.type;let n=t.get(r);if(n==null){return true}const i=Dln(this,e);let s=null;while(n!=null){if(n.once){if(s!==null){s.next=n.next}else if(n.next!==null){t.set(r,n.next)}else{t.delete(r)}}else{s=n}Ryt(i,n.passive?n.listener:null);if(typeof n.listener==="function"){try{n.listener.call(this,i)}catch(o){if(typeof console!=="undefined"&&typeof console.error==="function"){console.error(o)}}}else if(n.listenerType!==MW&&typeof n.listener.handleEvent==="function"){n.listener.handleEvent(i)}if(Lln(i)){break}n=n.next}Ryt(i,null);Fln(i,0);Bln(i,null);return!i.defaultPrevented}};Object.defineProperty(ih.prototype,"constructor",{value:ih,configurable:true,writable:true});if(typeof window!=="undefined"&&typeof window.EventTarget!=="undefined"){Object.setPrototypeOf(ih.prototype,window.EventTarget.prototype)}iL.defineEventAttribute=ySe;iL.EventTarget=ih;iL.default=ih;nL.exports=ih;nL.exports.EventTarget=nL.exports["default"]=ih;nL.exports.defineEventAttribute=ySe});var qyt=y((aL,sL)=>{"use strict";Object.defineProperty(aL,"__esModule",{value:true});var _Se=Fyt();var nE=class extends _Se.EventTarget{static{a(this,"AbortSignal")}constructor(){super();throw new TypeError("AbortSignal cannot be constructed directly")}get aborted(){const t=UW.get(this);if(typeof t!=="boolean"){throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`)}return t}};_Se.defineEventAttribute(nE.prototype,"abort");function qln(){const e=Object.create(nE.prototype);_Se.EventTarget.call(e);UW.set(e,false);return e}a(qln,"createAbortSignal");function Uln(e){if(UW.get(e)!==false){return}UW.set(e,true);e.dispatchEvent({type:"abort"})}a(Uln,"abortSignal");var UW=new WeakMap;Object.defineProperties(nE.prototype,{aborted:{enumerable:true}});if(typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol"){Object.defineProperty(nE.prototype,Symbol.toStringTag,{configurable:true,value:"AbortSignal"})}var iE=class{static{a(this,"AbortController")}constructor(){Myt.set(this,qln())}get signal(){return Byt(this)}abort(){Uln(Byt(this))}};var Myt=new WeakMap;function Byt(e){const t=Myt.get(e);if(t==null){throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${e===null?"null":typeof e}`)}return t}a(Byt,"getSignal");Object.defineProperties(iE.prototype,{signal:{enumerable:true},abort:{enumerable:true}});if(typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol"){Object.defineProperty(iE.prototype,Symbol.toStringTag,{configurable:true,value:"AbortController"})}aL.AbortController=iE;aL.AbortSignal=nE;aL.default=iE;sL.exports=iE;sL.exports.AbortController=sL.exports["default"]=iE;sL.exports.AbortSignal=nE});var Gyt=y(Ga=>{"use strict";var $ln=Ga&&Ga.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var jln=Ga&&Ga.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var $yt=Ga&&Ga.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))$ln(t,e,r)}jln(t,e);return t};var Gln=Ga&&Ga.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r};var cp=Ga&&Ga.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var jyt=Ga&&Ga.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};var ly;var cy;var oL;var $W;Object.defineProperty(Ga,"__esModule",{value:true});Ga.createURI=Ga.upload=Ga.Upload=Ga.PROTOCOL_REGEX=void 0;var Hln=jyt(qyt());var Vln=require("crypto");var zln=$yt(w0());var Kln=eW();var Uyt=require("stream");var Wln=jyt(tL());var eO=$yt((Lv(),Ct(Dv)));var Yln=CA();var uy=P0();var Xln=VR();var Jln=404;var vSe=308;var Qln=/.*\.googleapis\.com/;var ESe=(0,Xln.getPackageJSON)();Ga.PROTOCOL_REGEX=/^(\w*):\/\//;var uL=class extends Uyt.Writable{static{a(this,"Upload")}constructor(t){super(t);ly.add(this);this.numBytesWritten=0;this.numRetries=0;this.currentInvocationId={chunk:eO.v4(),uri:eO.v4(),offset:eO.v4()};this.writeBuffers=[];this.numChunksReadInRequest=0;this.localWriteCache=[];this.localWriteCacheByteLength=0;this.upstreamEnded=false;cy.set(this,void 0);t=t||{};if(!t.bucket||!t.file){throw new Error("A bucket and file name are required")}t.authConfig=t.authConfig||{};t.authConfig.scopes=["https://www.googleapis.com/auth/devstorage.full_control"];this.authClient=t.authClient||new Kln.GoogleAuth(t.authConfig);this.apiEndpoint="https://storage.googleapis.com";if(t.apiEndpoint){this.apiEndpoint=this.sanitizeEndpoint(t.apiEndpoint);if(!Qln.test(t.apiEndpoint)){this.authClient=zln}}this.baseURI=`${this.apiEndpoint}/upload/storage/v1/b`;this.bucket=t.bucket;const r=[t.bucket,t.file];if(typeof t.generation==="number"){r.push(`${t.generation}`)}this.cacheKey=r.join("/");this.customRequestOptions=t.customRequestOptions||{};this.file=t.file;this.generation=t.generation;this.kmsKeyName=t.kmsKeyName;this.metadata=t.metadata||{};this.offset=t.offset;this.origin=t.origin;this.params=t.params||{};this.userProject=t.userProject;this.chunkSize=t.chunkSize;this.retryOptions=t.retryOptions;if(t.key){const s=Buffer.from(t.key).toString("base64");this.encryption={key:s,hash:(0,Vln.createHash)("sha256").update(t.key).digest("base64")}}this.predefinedAcl=t.predefinedAcl;if(t.private)this.predefinedAcl="private";if(t.public)this.predefinedAcl="publicRead";const n=t.retryOptions.autoRetry;this.uriProvidedManually=!!t.uri;this.uri=t.uri;this.numBytesWritten=0;this.numRetries=0;if(!n){t.retryOptions.maxRetries=0}this.timeOfFirstRequest=Date.now();const i=t.metadata?Number(t.metadata.contentLength):NaN;this.contentLength=isNaN(i)?"*":i;Gln(this,cy,t[Yln.GCCL_GCS_CMD_KEY],"f");this.once("writing",()=>{if(this.uri){this.continueUploading()}else{this.createURI(s=>{if(s){return this.destroy(s)}this.startUploading();return})}})}_final(t=()=>{}){this.upstreamEnded=true;this.once("uploadFinished",t);process.nextTick(()=>{this.emit("upstreamFinished");this.emit("writing")})}_write(t,r,n=()=>{}){this.emit("writing");this.writeBuffers.push(typeof t==="string"?Buffer.from(t,r):t);this.once("readFromChunkBuffer",n);process.nextTick(()=>this.emit("wroteToChunkBuffer"))}prependLocalBufferToUpstream(t){let r=[];if(t){let i=0;while(t>i){let s=this.localWriteCache.pop();if(!s)break;i+=s.byteLength;if(i>t){const o=i-t;s=s.subarray(o);i-=o}r.unshift(s)}}else{r=this.localWriteCache}const n=this.writeBuffers;this.writeBuffers=r;for(const i of n){this.writeBuffers.push(i)}cp(this,ly,"m",oL).call(this)}*pullFromChunkBuffer(t){while(t){const r=this.writeBuffers.shift();if(!r)break;let n=r;if(r.byteLength>t){n=r.subarray(0,t);this.writeBuffers.unshift(r.subarray(t));t=0}else{t-=r.byteLength}yield n;this.emit("readFromChunkBuffer")}}async waitForNextChunk(){const t=await new Promise(r=>{if(this.writeBuffers.length){return r(true)}if(this.upstreamEnded){return r(false)}const n=a(()=>{s();return r(true)},"wroteToChunkBufferCallback");const i=a(()=>{s();if(this.writeBuffers.length)return r(true);return r(false)},"upstreamFinishedCallback");const s=a(()=>{this.removeListener("wroteToChunkBuffer",n);this.removeListener("upstreamFinished",i)},"removeListeners");this.once("wroteToChunkBuffer",n);this.once("upstreamFinished",i)});return t}async*upstreamIterator(t=Infinity){while(t&&await this.waitForNextChunk()){for(const r of this.pullFromChunkBuffer(t)){t-=r.byteLength;yield r}}}createURI(t){if(!t){return this.createURIAsync()}this.createURIAsync().then(r=>t(null,r),t)}async createURIAsync(){const t={...this.metadata};const r={};if(t.contentLength){r["X-Upload-Content-Length"]=t.contentLength.toString();delete t.contentLength}if(t.contentType){r["X-Upload-Content-Type"]=t.contentType;delete t.contentType}let n=`${(0,uy.getRuntimeTrackingString)()} gccl/${ESe.version}-${(0,uy.getModuleFormat)()} gccl-invocation-id/${this.currentInvocationId.uri}`;if(cp(this,cy,"f")){n+=` gccl-gcs-cmd/${cp(this,cy,"f")}`}const i={method:"POST",url:[this.baseURI,this.bucket,"o"].join("/"),params:Object.assign({name:this.file,uploadType:"resumable"},this.params),data:t,headers:{"User-Agent":(0,uy.getUserAgentString)(),"x-goog-api-client":n,...r}};if(t.contentLength){i.headers["X-Upload-Content-Length"]=t.contentLength.toString()}if(t.contentType){i.headers["X-Upload-Content-Type"]=t.contentType}if(typeof this.generation!=="undefined"){i.params.ifGenerationMatch=this.generation}if(this.kmsKeyName){i.params.kmsKeyName=this.kmsKeyName}if(this.predefinedAcl){i.params.predefinedAcl=this.predefinedAcl}if(this.origin){i.headers.Origin=this.origin}const s=await(0,Wln.default)(async o=>{var u,l,c;try{const d=await this.makeRequest(i);this.currentInvocationId.uri=eO.v4();return d.headers.location}catch(d){const p=d;const f={code:(u=p.response)===null||u===void 0?void 0:u.status,name:(l=p.response)===null||l===void 0?void 0:l.statusText,message:(c=p.response)===null||c===void 0?void 0:c.statusText,errors:[{reason:p.code}]};if(this.retryOptions.maxRetries>0&&this.retryOptions.retryableErrorFn(f)){throw p}else{return o(p)}}},{retries:this.retryOptions.maxRetries,factor:this.retryOptions.retryDelayMultiplier,maxTimeout:this.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.retryOptions.totalTimeout*1e3});this.uri=s;this.offset=0;return s}async continueUploading(){if(typeof this.offset==="number"){this.startUploading();return}await this.getAndSetOffset();this.startUploading()}async startUploading(){const t=!!this.chunkSize;let r=false;this.numChunksReadInRequest=0;if(!this.offset){this.offset=0}if(this.offset<this.numBytesWritten){const c=this.numBytesWritten-this.offset;const d=`The offset is lower than the number of bytes written. The server has ${this.offset} bytes and while ${this.numBytesWritten} bytes has been uploaded - thus ${c} bytes are missing. Stopping as this could result in data loss. Initiate a new upload to continue.`;this.emit("error",new RangeError(d));return}if(this.numBytesWritten<this.offset){const c=this.offset-this.numBytesWritten;for await(const d of this.upstreamIterator(c)){d}this.numBytesWritten=this.offset}let n=void 0;if(typeof this.contentLength==="number"){n=this.contentLength-this.numBytesWritten}if(this.chunkSize){n=n?Math.min(this.chunkSize,n):this.chunkSize}const i=this.upstreamIterator(n);const s=new Uyt.Readable({read:async()=>{if(r)s.push(null);const c=await i.next();if(c.value){this.numChunksReadInRequest++;if(t){cp(this,ly,"m",$W).call(this,c.value)}else{cp(this,ly,"m",oL).call(this);cp(this,ly,"m",$W).call(this,c.value)}this.numBytesWritten+=c.value.byteLength;this.emit("progress",{bytesWritten:this.numBytesWritten,contentLength:this.contentLength});s.push(c.value)}if(c.done){s.push(null)}}});let o=`${(0,uy.getRuntimeTrackingString)()} gccl/${ESe.version}-${(0,uy.getModuleFormat)()} gccl-invocation-id/${this.currentInvocationId.chunk}`;if(cp(this,cy,"f")){o+=` gccl-gcs-cmd/${cp(this,cy,"f")}`}const u={"User-Agent":(0,uy.getUserAgentString)(),"x-goog-api-client":o};if(t){for await(const m of this.upstreamIterator(n)){cp(this,ly,"m",$W).call(this,m)}const c=this.localWriteCacheByteLength;const d=!await this.waitForNextChunk();this.prependLocalBufferToUpstream();let p=this.contentLength;if(typeof this.contentLength!=="number"&&d){p=c+this.numBytesWritten}const f=c+this.numBytesWritten-1;u["Content-Length"]=c;u["Content-Range"]=`bytes ${this.offset}-${f}/${p}`}else{u["Content-Range"]=`bytes ${this.offset}-*/${this.contentLength}`}const l={method:"PUT",url:this.uri,headers:u,body:s};try{const c=await this.makeRequestStream(l);if(c){r=true;this.responseHandler(c)}}catch(c){const d=c;if(this.retryOptions.retryableErrorFn(d)){this.attemptDelayedRetry({status:NaN,data:d});return}this.destroy(d)}}responseHandler(t){if(t.data.error){this.destroy(t.data.error);return}this.currentInvocationId.chunk=eO.v4();const r=this.chunkSize&&t.status===vSe&&t.headers.range;if(r){const n=t.headers.range;this.offset=Number(n.split("-")[1])+1;const i=this.numBytesWritten-this.offset;if(i){this.prependLocalBufferToUpstream(i);this.numBytesWritten-=i}else{cp(this,ly,"m",oL).call(this)}this.continueUploading()}else if(!this.isSuccessfulResponse(t.status)){const n=new Error("Upload failed");n.code=t.status;n.name="Upload failed";if(t===null||t===void 0?void 0:t.data){n.errors=[t===null||t===void 0?void 0:t.data]}this.destroy(n)}else{cp(this,ly,"m",oL).call(this);if(t&&t.data){t.data.size=Number(t.data.size)}this.emit("metadata",t.data);this.emit("uploadFinished")}}async getAndSetOffset(){let t=`${(0,uy.getRuntimeTrackingString)()} gccl/${ESe.version}-${(0,uy.getModuleFormat)()} gccl-invocation-id/${this.currentInvocationId.offset}`;if(cp(this,cy,"f")){t+=` gccl-gcs-cmd/${cp(this,cy,"f")}`}const r={method:"PUT",url:this.uri,headers:{"Content-Length":0,"Content-Range":"bytes */*","User-Agent":(0,uy.getUserAgentString)(),"x-goog-api-client":t}};try{const n=await this.makeRequest(r);this.currentInvocationId.offset=eO.v4();if(n.status===vSe){if(n.headers.range){const i=n.headers.range;this.offset=Number(i.split("-")[1])+1;return}}this.offset=0}catch(n){const i=n;if(this.retryOptions.retryableErrorFn(i)){this.attemptDelayedRetry({status:NaN,data:i});return}this.destroy(i)}}async makeRequest(t){if(this.encryption){t.headers=t.headers||{};t.headers["x-goog-encryption-algorithm"]="AES256";t.headers["x-goog-encryption-key"]=this.encryption.key.toString();t.headers["x-goog-encryption-key-sha256"]=this.encryption.hash.toString()}if(this.userProject){t.params=t.params||{};t.params.userProject=this.userProject}t.validateStatus=i=>{return this.isSuccessfulResponse(i)||i===vSe};const r={...this.customRequestOptions,...t,headers:{...this.customRequestOptions.headers,...t.headers}};const n=await this.authClient.request(r);if(n.data&&n.data.error){throw n.data.error}return n}async makeRequestStream(t){const r=new Hln.default;const n=a(()=>r.abort(),"errorCallback");this.once("error",n);if(this.userProject){t.params=t.params||{};t.params.userProject=this.userProject}t.signal=r.signal;t.validateStatus=()=>true;const i={...this.customRequestOptions,...t,headers:{...this.customRequestOptions.headers,...t.headers}};const s=await this.authClient.request(i);const o=this.onResponse(s);this.removeListener("error",n);return o?s:null}onResponse(t){if(t.status!==200&&this.retryOptions.retryableErrorFn({code:t.status,message:t.statusText,name:t.statusText})){this.attemptDelayedRetry(t);return false}this.emit("response",t);return true}attemptDelayedRetry(t){if(this.numRetries<this.retryOptions.maxRetries){if(t.status===Jln&&this.numChunksReadInRequest===0){this.startUploading()}else{const r=this.getRetryDelay();if(r<=0){this.destroy(new Error(`Retry total time limit exceeded - ${t.data}`));return}this.numBytesWritten-=this.localWriteCacheByteLength;this.prependLocalBufferToUpstream();this.offset=void 0;setTimeout(this.continueUploading.bind(this),r)}this.numRetries++}else{this.destroy(new Error("Retry limit exceeded - "+t.data))}}getRetryDelay(){const t=Math.round(Math.random()*1e3);const r=Math.pow(this.retryOptions.retryDelayMultiplier,this.numRetries)*1e3+t;const n=this.retryOptions.totalTimeout*1e3-(Date.now()-this.timeOfFirstRequest);const i=this.retryOptions.maxRetryDelay*1e3;return Math.min(r,i,n)}sanitizeEndpoint(t){if(!Ga.PROTOCOL_REGEX.test(t)){t=`https://${t}`}return t.replace(/\/+$/,"")}isSuccessfulResponse(t){return t>=200&&t<300}};Ga.Upload=uL;cy=new WeakMap,ly=new WeakSet,oL=a(function e(){this.localWriteCache=[];this.localWriteCacheByteLength=0},"_Upload_resetLocalBuffersCache"),$W=a(function e(t){this.localWriteCache.push(t);this.localWriteCacheByteLength+=t.byteLength},"_Upload_addLocalBufferCache");function Zln(e){return new uL(e)}a(Zln,"upload");Ga.upload=Zln;function ecn(e,t){const r=new uL(e);if(!t){return r.createURI()}r.createURI().then(n=>t(null,n),t)}a(ecn,"createURI");Ga.createURI=ecn});var SSe=y(yu=>{"use strict";var tcn=yu&&yu.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var rcn=yu&&yu.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var Kyt=yu&&yu.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))tcn(t,e,r)}rcn(t,e);return t};Object.defineProperty(yu,"__esModule",{value:true});yu.SigningError=yu.URLSigner=yu.PATH_STYLED_HOST=yu.SignerExceptionMessages=void 0;var ncn=Kyt(require("crypto"));var Hyt=Kyt(require("url"));var Vyt=tO();var sE=P0();var lL;(function(e){e["ACCESSIBLE_DATE_INVALID"]="The accessible at date provided was invalid.";e["EXPIRATION_BEFORE_ACCESSIBLE_DATE"]="An expiration date cannot be before accessible date.";e["X_GOOG_CONTENT_SHA256"]="The header X-Goog-Content-SHA256 must be a hexadecimal string."})(lL||(yu.SignerExceptionMessages=lL={}));var icn="v2";var zyt=7*24*60*60;yu.PATH_STYLED_HOST="https://storage.googleapis.com";var bSe=class{static{a(this,"URLSigner")}constructor(t,r,n){this.bucket=r;this.file=n;this.authClient=t}getSignedUrl(t){const r=this.parseExpires(t.expires);const n=t.method;const i=this.parseAccessibleAt(t.accessibleAt);if(r<i){throw new Error(lL.EXPIRATION_BEFORE_ACCESSIBLE_DATE)}let s;const o=t.virtualHostedStyle||false;if(t.cname){s=t.cname}else if(o){s=`https://${this.bucket.name}.storage.googleapis.com`}const u=1e3;const l=Object.assign({},t,{method:n,expiration:r,accessibleAt:new Date(u*i),bucket:this.bucket.name,file:this.file?(0,sE.encodeURI)(this.file.name,false):void 0});if(s){l.cname=s}const c=t.version||icn;let d;if(c==="v2"){d=this.getSignedUrlV2(l)}else if(c==="v4"){d=this.getSignedUrlV4(l)}else{throw new Error(`Invalid signed URL version: ${c}. Supported versions are 'v2' and 'v4'.`)}return d.then(p=>{p=Object.assign(p,t.queryParams);const f=new Hyt.URL(l.cname||yu.PATH_STYLED_HOST);f.pathname=this.getResourcePath(!!l.cname,this.bucket.name,l.file);f.search=(0,sE.qsStringify)(p);return f.href})}getSignedUrlV2(t){const r=this.getCanonicalHeaders(t.extensionHeaders||{});const n=this.getResourcePath(false,t.bucket,t.file);const i=[t.method,t.contentMd5||"",t.contentType||"",t.expiration,r+n].join("\n");const s=a(async()=>{const o=this.authClient;try{const u=await o.sign(i);const l=await o.getCredentials();return{GoogleAccessId:l.client_email,Expires:t.expiration,Signature:u}}catch(u){const l=u;const c=new cL(l.message);c.stack=l.stack;throw c}},"sign");return s()}getSignedUrlV4(t){t.accessibleAt=t.accessibleAt?t.accessibleAt:new Date;const r=1/1e3;const n=t.expiration-t.accessibleAt.valueOf()*r;if(n>zyt){throw new Error(`Max allowed expiration is seven days (${zyt} seconds).`)}const i=Object.assign({},t.extensionHeaders);const s=new Hyt.URL(t.cname||yu.PATH_STYLED_HOST);i.host=s.host;if(t.contentMd5){i["content-md5"]=t.contentMd5}if(t.contentType){i["content-type"]=t.contentType}let o;const u=i["x-goog-content-sha256"];if(u){if(typeof u!=="string"||!/[A-Fa-f0-9]{40}/.test(u)){throw new Error(lL.X_GOOG_CONTENT_SHA256)}o=u}const l=Object.keys(i).map(m=>m.toLowerCase()).sort().join(";");const c=this.getCanonicalHeaders(i);const d=(0,sE.formatAsUTCISO)(t.accessibleAt);const p=`${d}/auto/storage/goog4_request`;const f=a(async()=>{const m=await this.authClient.getCredentials();const h=`${m.client_email}/${p}`;const g=(0,sE.formatAsUTCISO)(t.accessibleAt?t.accessibleAt:new Date,true);const _={"X-Goog-Algorithm":"GOOG4-RSA-SHA256","X-Goog-Credential":h,"X-Goog-Date":g,"X-Goog-Expires":n.toString(10),"X-Goog-SignedHeaders":l,...t.queryParams||{}};const v=this.getCanonicalQueryParams(_);const S=this.getCanonicalRequest(t.method,this.getResourcePath(!!t.cname,t.bucket,t.file),v,c,l,o);const E=ncn.createHash("sha256").update(S).digest("hex");const b=["GOOG4-RSA-SHA256",g,p,E].join("\n");try{const A=await this.authClient.sign(b);const C=Buffer.from(A,"base64").toString("hex");const T=Object.assign({},_,{"X-Goog-Signature":C});return T}catch(A){const C=A;const T=new cL(C.message);T.stack=C.stack;throw T}},"sign");return f()}getCanonicalHeaders(t){const r=(0,sE.objectEntries)(t).map(([n,i])=>[n.toLowerCase(),i]).sort((n,i)=>n[0].localeCompare(i[0]));return r.filter(([,n])=>n!==void 0).map(([n,i])=>{const s=`${i}`.trim().replace(/\s{2,}/g," ");return`${n}:${s}
395
- `}).join("")}getCanonicalRequest(t,r,n,i,s,o){return[t,r,n,i,s,o||"UNSIGNED-PAYLOAD"].join("\n")}getCanonicalQueryParams(t){return(0,sE.objectEntries)(t).map(([r,n])=>[(0,sE.encodeURI)(r,true),(0,sE.encodeURI)(n,true)]).sort((r,n)=>r[0]<n[0]?-1:1).map(([r,n])=>`${r}=${n}`).join("&")}getResourcePath(t,r,n){if(t){return"/"+(n||"")}else if(n){return`/${r}/${n}`}else{return`/${r}`}}parseExpires(t,r=new Date){const n=new Date(t).valueOf();if(isNaN(n)){throw new Error(Vyt.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(n<r.valueOf()){throw new Error(Vyt.ExceptionMessages.EXPIRATION_DATE_PAST)}return Math.floor(n/1e3)}parseAccessibleAt(t){const r=new Date(t||new Date).valueOf();if(isNaN(r)){throw new Error(lL.ACCESSIBLE_DATE_INVALID)}return Math.floor(r/1e3)}};yu.URLSigner=bSe;var cL=class extends Error{static{a(this,"SigningError")}constructor(){super(...arguments);this.name="SigningError"}};yu.SigningError=cL});var dL=y(Ol=>{"use strict";var Wyt=Ol&&Ol.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r};var jW=Ol&&Ol.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var aE;Object.defineProperty(Ol,"__esModule",{value:true});Ol.CRC32C_EXTENSION_TABLE=Ol.CRC32C_EXTENSIONS=Ol.CRC32C_EXCEPTION_MESSAGES=Ol.CRC32C_DEFAULT_VALIDATOR_GENERATOR=Ol.CRC32C=void 0;var scn=require("fs");var ASe=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697];Ol.CRC32C_EXTENSIONS=ASe;var Yyt=new Int32Array(ASe);Ol.CRC32C_EXTENSION_TABLE=Yyt;var acn=a(()=>new rO,"CRC32C_DEFAULT_VALIDATOR_GENERATOR");Ol.CRC32C_DEFAULT_VALIDATOR_GENERATOR=acn;var GW={INVALID_INIT_BASE64_RANGE:e=>`base64-encoded data expected to equal 4 bytes, not ${e}`,INVALID_INIT_BUFFER_LENGTH:e=>`Buffer expected to equal 4 bytes, not ${e}`,INVALID_INIT_INTEGER:e=>`Number expected to be a safe, unsigned 32-bit integer, not ${e}`};Ol.CRC32C_EXCEPTION_MESSAGES=GW;var rO=class e{static{a(this,"CRC32C")}constructor(t=0){aE.set(this,0);Wyt(this,aE,t,"f")}update(t){let r=jW(this,aE,"f")^4294967295;for(const n of t){const i=e.CRC32C_EXTENSION_TABLE[(n^r)&255];r=i^r>>>8}Wyt(this,aE,r^4294967295,"f")}validate(t){if(typeof t==="number"){return t===jW(this,aE,"f")}else if(typeof t==="string"){return t===this.toString()}else if(Buffer.isBuffer(t)){return Buffer.compare(t,this.toBuffer())===0}else{return t.toString()===this.toString()}}toBuffer(){const t=Buffer.alloc(4);t.writeInt32BE(jW(this,aE,"f"));return t}toJSON(){return this.toString()}toString(){return this.toBuffer().toString("base64")}valueOf(){return jW(this,aE,"f")}static fromBuffer(t){let r;if(Buffer.isBuffer(t)){r=t}else if("buffer"in t){r=Buffer.from(t.buffer)}else{r=Buffer.from(t)}if(r.byteLength!==4){throw new RangeError(GW.INVALID_INIT_BUFFER_LENGTH(r.byteLength))}return new e(r.readInt32BE())}static async fromFile(t){const r=new e;await new Promise((n,i)=>{(0,scn.createReadStream)(t).on("data",s=>r.update(s)).on("end",n).on("error",i)});return r}static fromString(t){const r=Buffer.from(t,"base64");if(r.byteLength!==4){throw new RangeError(GW.INVALID_INIT_BASE64_RANGE(r.byteLength))}return this.fromBuffer(r)}static fromNumber(t){if(!Number.isSafeInteger(t)||t>2**32||t<-(2**32)){throw new RangeError(GW.INVALID_INIT_INTEGER(t))}return new e(t)}static from(t){if(typeof t==="number"){return this.fromNumber(t)}else if(typeof t==="string"){return this.fromString(t)}else if("byteLength"in t){return this.fromBuffer(t)}else{return this.fromString(t.toString())}}};Ol.CRC32C=rO;aE=new WeakMap;rO.CRC32C_EXTENSIONS=ASe;rO.CRC32C_EXTENSION_TABLE=Yyt});var TSe=y(uE=>{"use strict";var CSe=uE&&uE.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r};var D0=uE&&uE.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var xA;var oE;var HW;Object.defineProperty(uE,"__esModule",{value:true});uE.HashStreamValidator=void 0;var ocn=require("crypto");var ucn=require("stream");var lcn=dL();var Xyt=pL();var wSe=class extends ucn.Transform{static{a(this,"HashStreamValidator")}constructor(t={}){super();this.updateHashesOnly=false;xA.set(this,void 0);oE.set(this,void 0);HW.set(this,"");this.crc32cEnabled=!!t.crc32c;this.md5Enabled=!!t.md5;this.updateHashesOnly=!!t.updateHashesOnly;this.crc32cExpected=t.crc32cExpected;this.md5Expected=t.md5Expected;if(this.crc32cEnabled){const r=t.crc32cGenerator||lcn.CRC32C_DEFAULT_VALIDATOR_GENERATOR;CSe(this,xA,r(),"f")}if(this.md5Enabled){CSe(this,oE,(0,ocn.createHash)("md5"),"f")}}_flush(t){if(D0(this,oE,"f")){CSe(this,HW,D0(this,oE,"f").digest("base64"),"f")}if(this.updateHashesOnly){t();return}let r=this.crc32cEnabled||this.md5Enabled;if(this.crc32cEnabled&&this.crc32cExpected){r=!this.test("crc32c",this.crc32cExpected)}if(this.md5Enabled&&this.md5Expected){r=!this.test("md5",this.md5Expected)}if(r){const n=new Xyt.RequestError(Xyt.FileExceptionMessages.DOWNLOAD_MISMATCH);n.code="CONTENT_DOWNLOAD_MISMATCH";t(n)}else{t()}}_transform(t,r,n){this.push(t,r);try{if(D0(this,xA,"f"))D0(this,xA,"f").update(t);if(D0(this,oE,"f"))D0(this,oE,"f").update(t);n()}catch(i){n(i)}}test(t,r){const n=Buffer.isBuffer(r)?r.toString("base64"):r;if(t==="crc32c"&&D0(this,xA,"f")){return D0(this,xA,"f").validate(n)}if(t==="md5"&&D0(this,oE,"f")){return D0(this,HW,"f")===n}return false}};uE.HashStreamValidator=wSe;xA=new WeakMap,oE=new WeakMap,HW=new WeakMap});var pL=y(Ha=>{"use strict";var ccn=Ha&&Ha.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var dcn=Ha&&Ha.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var zW=Ha&&Ha.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))ccn(t,e,r)}dcn(t,e);return t};var pcn=Ha&&Ha.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var KW=Ha&&Ha.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};var RSe;var r_t;Object.defineProperty(Ha,"__esModule",{value:true});Ha.File=Ha.FileExceptionMessages=Ha.RequestError=Ha.STORAGE_POST_POLICY_BASE_URL=Ha.ActionToHTTPMethod=void 0;var lE=tE();var fcn=I0();var mcn=KW(_yt());var hcn=zW(require("crypto"));var Jyt=zW(require("fs"));var gcn=KW(Tyt());var Qyt=zW(Gyt());var fL=require("stream");var Zyt=zW(require("zlib"));var _f=tO();var mL=WW();var ycn=hSe();var xSe=SSe();var dy=CA();var _cn=KW(Z2e());var py=P0();var e_t=TSe();var vcn=KW(tL());var OSe;(function(e){e["read"]="GET";e["write"]="PUT";e["delete"]="DELETE";e["resumable"]="POST"})(OSe||(Ha.ActionToHTTPMethod=OSe={}));Ha.STORAGE_POST_POLICY_BASE_URL="https://storage.googleapis.com";var Ecn=/^gs:\/\/([a-z0-9_.-]+)\/(.+)$/;var hL=class extends Error{static{a(this,"RequestError")}};Ha.RequestError=hL;var t_t=7*24*60*60;var vf;(function(e){e["EXPIRATION_TIME_NA"]="An expiration time is not available.";e["DESTINATION_NO_NAME"]="Destination file should have a name.";e["INVALID_VALIDATION_FILE_RANGE"]="Cannot use validation with file ranges (start/end).";e["MD5_NOT_AVAILABLE"]="MD5 verification was specified, but is not available for the requested object. MD5 is not available for composite objects.";e["EQUALS_CONDITION_TWO_ELEMENTS"]="Equals condition must be an array of 2 elements.";e["STARTS_WITH_TWO_ELEMENTS"]="StartsWith condition must be an array of 2 elements.";e["CONTENT_LENGTH_RANGE_MIN_MAX"]="ContentLengthRange must have numeric min & max fields.";e["DOWNLOAD_MISMATCH"]="The downloaded data did not match the data from the server. To be sure the content is the same, you should download the file again.";e["UPLOAD_MISMATCH_DELETE_FAIL"]="The uploaded data did not match the data from the server.\n As a precaution, we attempted to delete the file, but it was not successful.\n To be sure the content is the same, you should try removing the file manually,\n then uploading the file again.\n \n\nThe delete attempt failed with this message:\n\n ";e["UPLOAD_MISMATCH"]="The uploaded data did not match the data from the server.\n As a precaution, the file has been deleted.\n To be sure the content is the same, you should try uploading the file again."})(vf||(Ha.FileExceptionMessages=vf={}));var VW=class e extends lE.ServiceObject{static{a(this,"File")}constructor(t,r,n={}){var i,s;const o={};let u;if(n.generation!==null){if(typeof n.generation==="string"){u=Number(n.generation)}else{u=n.generation}if(!isNaN(u)){o.generation=u}}Object.assign(o,n.preconditionOpts);const l=n.userProject||t.userProject;if(typeof l==="string"){o.userProject=l}const c={delete:{reqOpts:{qs:o}},exists:{reqOpts:{qs:o}},get:{reqOpts:{qs:o}},getMetadata:{reqOpts:{qs:o}},setMetadata:{reqOpts:{qs:o}}};super({parent:t,baseUrl:"/o",id:encodeURIComponent(r),methods:c});RSe.add(this);this.bucket=t;this.storage=t.parent;if(n.generation!==null){let d;if(typeof n.generation==="string"){d=Number(n.generation)}else{d=n.generation}if(!isNaN(d)){this.generation=d}}this.kmsKeyName=n.kmsKeyName;this.userProject=l;this.name=r;if(n.encryptionKey){this.setEncryptionKey(n.encryptionKey)}this.acl=new ycn.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.crc32cGenerator=n.crc32cGenerator||this.bucket.crc32cGenerator;this.instanceRetryValue=(s=(i=this.storage)===null||i===void 0?void 0:i.retryOptions)===null||s===void 0?void 0:s.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const t=this.bucket.cloudStorageURI;t.pathname=this.name;return t}shouldRetryBasedOnPreconditionAndIdempotencyStrat(t){var r;return!((t===null||t===void 0?void 0:t.ifGenerationMatch)===void 0&&((r=this.instancePreconditionOpts)===null||r===void 0?void 0:r.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever)}copy(t,r,n){var i,s;const o=new Error(vf.DESTINATION_NO_NAME);if(!t){throw o}let u={};if(typeof r==="function"){n=r}else if(r){u={...r}}n=n||lE.util.noop;let l;let c;let d;if(typeof t==="string"){const m=Ecn.exec(t);if(m!==null&&m.length===3){l=this.storage.bucket(m[1]);c=m[2]}else{l=this.bucket;c=t}}else if(t instanceof mL.Bucket){l=t;c=this.name}else if(t instanceof e){l=t.bucket;c=t.name;d=t}else{throw o}const p={};if(this.generation!==void 0){p.sourceGeneration=this.generation}if(u.token!==void 0){p.rewriteToken=u.token}if(u.userProject!==void 0){p.userProject=u.userProject;delete u.userProject}if(u.predefinedAcl!==void 0){p.destinationPredefinedAcl=u.predefinedAcl;delete u.predefinedAcl}d=d||l.file(c);const f={};if(this.encryptionKey!==void 0){f["x-goog-copy-source-encryption-algorithm"]="AES256";f["x-goog-copy-source-encryption-key"]=this.encryptionKeyBase64;f["x-goog-copy-source-encryption-key-sha256"]=this.encryptionKeyHash}if(d.encryptionKey!==void 0){this.setEncryptionKey(d.encryptionKey)}else if(u.destinationKmsKeyName!==void 0){p.destinationKmsKeyName=u.destinationKmsKeyName;delete u.destinationKmsKeyName}else if(d.kmsKeyName!==void 0){p.destinationKmsKeyName=d.kmsKeyName}if(p.destinationKmsKeyName){this.kmsKeyName=p.destinationKmsKeyName;const m=this.interceptors.indexOf(this.encryptionKeyInterceptor);if(m>-1){this.interceptors.splice(m,1)}}if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(u===null||u===void 0?void 0:u.preconditionOpts)){this.storage.retryOptions.autoRetry=false}if(((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)!==void 0){p.ifGenerationMatch=(s=u.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch;delete u.preconditionOpts}this.request({method:"POST",uri:`/rewriteTo/b/${l.name}/o/${encodeURIComponent(d.name)}`,qs:p,json:u,headers:f},(m,h)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(m){n(m,null,h);return}if(h.rewriteToken){const g={token:h.rewriteToken};if(p.userProject){g.userProject=p.userProject}if(p.destinationKmsKeyName){g.destinationKmsKeyName=p.destinationKmsKeyName}this.copy(d,g,n);return}n(null,d,h)})}createReadStream(t={}){t=Object.assign({decompress:true},t);const r=typeof t.start==="number"||typeof t.end==="number";const n=t.end<0;let i=void 0;let s=void 0;const o=new py.PassThroughShim;let u=true;let l=false;if(typeof t.validation==="string"){const m=t.validation.toLowerCase().trim();u=m==="crc32c";l=m==="md5"}else if(t.validation===false){u=false}const c=!r&&(u||l);if(r){if(typeof t.validation==="string"||t.validation===true){throw new Error(vf.INVALID_VALIDATION_FILE_RANGE)}u=false;l=false}const d=a(m=>{if(m){if(s===null||s===void 0?void 0:s.agent){s.agent.destroy()}o.destroy(m)}},"onComplete");const p=a((m,h,g)=>{if(m){this.getBufferFromReadable(g).then(A=>{m.message=A.toString("utf8");o.destroy(m)});return}s=g.request;const _=g.toJSON().headers;const v=_["content-encoding"]==="gzip";const S={};const E=_["x-goog-stored-content-encoding"]==="gzip"&&v||_["x-goog-stored-content-encoding"]==="identity";const b=[];if(c){if(typeof _["x-goog-hash"]==="string"){_["x-goog-hash"].split(",").forEach(A=>{const C=A.indexOf("=");const T=A.substring(0,C);const O=A.substring(C+1);S[T]=O})}i=new e_t.HashStreamValidator({crc32c:u,md5:l,crc32cGenerator:this.crc32cGenerator,crc32cExpected:S.crc32c,md5Expected:S.md5})}if(l&&!S.md5){const A=new hL(vf.MD5_NOT_AVAILABLE);A.code="MD5_NOT_AVAILABLE";o.destroy(A);return}if(E&&c&&i){b.push(i)}if(v&&t.decompress){b.push(Zyt.createGunzip())}(0,fL.pipeline)(g,...b,o,d)},"onResponse");const f=a(()=>{const m={alt:"media"};if(this.generation){m.generation=this.generation}if(t.userProject){m.userProject=t.userProject}const h={"Accept-Encoding":"gzip","Cache-Control":"no-store"};if(r){const _=typeof t.start==="number"?t.start:"0";const v=typeof t.end==="number"?t.end:"";h.Range=`bytes=${n?v:`${_}-${v}`}`}const g={uri:"",headers:h,qs:m};if(t[dy.GCCL_GCS_CMD_KEY]){g[dy.GCCL_GCS_CMD_KEY]=t[dy.GCCL_GCS_CMD_KEY]}this.requestStream(g).on("error",_=>{o.destroy(_)}).on("response",_=>{o.emit("response",_);lE.util.handleResp(null,_,null,p)}).resume()},"makeRequest");o.on("reading",f);return o}createResumableUpload(t,r){var n,i;const s=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const o=this.storage.retryOptions;if(((n=s===null||s===void 0?void 0:s.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&((i=this.instancePreconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever){o.autoRetry=false}Qyt.createURI({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((u,l)=>l(u),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:s.metadata,offset:s.offset,origin:s.origin,predefinedAcl:s.predefinedAcl,private:s.private,public:s.public,userProject:s.userProject||this.userProject,retryOptions:o,params:(s===null||s===void 0?void 0:s.preconditionOpts)||this.instancePreconditionOpts,[dy.GCCL_GCS_CMD_KEY]:s[dy.GCCL_GCS_CMD_KEY]},r);this.storage.retryOptions.autoRetry=this.instanceRetryValue}createWriteStream(t={}){var r;(r=t.metadata)!==null&&r!==void 0?r:t.metadata={};if(t.contentType){t.metadata.contentType=t.contentType}if(!t.metadata.contentType||t.metadata.contentType==="auto"){const f=gcn.default.getType(this.name);if(f){t.metadata.contentType=f}}let n=t.gzip;if(n==="auto"){n=(0,mcn.default)(t.metadata.contentType||"")}if(n){t.metadata.contentEncoding="gzip"}let i=true;let s=false;if(typeof t.validation==="string"){t.validation=t.validation.toLowerCase();i=t.validation==="crc32c";s=t.validation==="md5"}else if(t.validation===false){i=false}let o=a(f=>{u.destroy(f||void 0)},"pipelineCallback");const u=new fL.Writable({final(f){o=f;l.end()},write(f,m,h){l.write(f,m,h)}});const l=new py.PassThroughShim;const c=new e_t.HashStreamValidator({crc32c:i,md5:s,crc32cGenerator:this.crc32cGenerator,updateHashesOnly:true});const d=(0,_cn.default)();let p=false;l.on("reading",()=>u.emit("reading"));l.on("writing",()=>u.emit("writing"));d.on("progress",f=>u.emit("progress",f));d.on("response",f=>u.emit("response",f));d.once("metadata",()=>{p=true});u.on("writing",()=>{if(t.resumable===false){this.startSimpleUpload_(d,t)}else{this.startResumableUpload_(d,t)}(0,fL.pipeline)(l,n?Zyt.createGzip():new fL.PassThrough,c,d,async f=>{if(f){return o(f)}if(!p){try{await new Promise((m,h)=>{d.once("metadata",m);d.once("error",h)})}catch(m){return o(m)}}try{await pcn(this,RSe,"m",r_t).call(this,c,{crc32c:i,md5:s});o()}catch(m){o(m)}})});return u}delete(t,r){const n=typeof t==="object"?t:{};r=typeof t==="function"?t:r;this.disableAutoRetryConditionallyIdempotent_(this.methods.delete,mL.AvailableServiceObjectMethods.delete,n);super.delete(n).then(i=>r(null,...i)).catch(r).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}download(t,r){let n;if(typeof t==="function"){r=t;n={}}else{n=t}let i=false;const s=a((...c)=>{if(!i)r(...c);i=true},"callback");const o=n.destination;delete n.destination;const u=this.createReadStream(n);let l=false;if(o){u.on("error",s).once("data",c=>{l=true;const d=Jyt.createWriteStream(o);d.write(c);u.pipe(d).on("error",s).on("finish",s)}).on("end",()=>{if(!l){const c=Buffer.alloc(0);try{Jyt.writeFileSync(o,c);s(null,c)}catch(d){s(d,c)}}})}else{this.getBufferFromReadable(u).then(c=>s===null||s===void 0?void 0:s(null,c)).catch(s)}}setEncryptionKey(t){this.encryptionKey=t;this.encryptionKeyBase64=Buffer.from(t).toString("base64");this.encryptionKeyHash=hcn.createHash("sha256").update(this.encryptionKeyBase64,"base64").digest("base64");this.encryptionKeyInterceptor={request:r=>{r.headers=r.headers||{};r.headers["x-goog-encryption-algorithm"]="AES256";r.headers["x-goog-encryption-key"]=this.encryptionKeyBase64;r.headers["x-goog-encryption-key-sha256"]=this.encryptionKeyHash;return r}};this.interceptors.push(this.encryptionKeyInterceptor);return this}getExpirationDate(t){this.getMetadata((r,n,i)=>{if(r){t(r,null,i);return}if(!n.retentionExpirationTime){const s=new Error(vf.EXPIRATION_TIME_NA);t(s,null,i);return}t(null,new Date(n.retentionExpirationTime),i)})}generateSignedPostPolicyV2(t,r){const n=(0,py.normalize)(t,r);let i=n.options;const s=n.callback;const o=new Date(i.expires);if(isNaN(o.getTime())){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(o.valueOf()<Date.now()){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_PAST)}i=Object.assign({},i);const u=[["eq","$key",this.name],{bucket:this.bucket.name}];if(Array.isArray(i.equals)){if(!Array.isArray(i.equals[0])){i.equals=[i.equals]}i.equals.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(vf.EQUALS_CONDITION_TWO_ELEMENTS)}u.push(["eq",p[0],p[1]])})}if(Array.isArray(i.startsWith)){if(!Array.isArray(i.startsWith[0])){i.startsWith=[i.startsWith]}i.startsWith.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(vf.STARTS_WITH_TWO_ELEMENTS)}u.push(["starts-with",p[0],p[1]])})}if(i.acl){u.push({acl:i.acl})}if(i.successRedirect){u.push({success_action_redirect:i.successRedirect})}if(i.successStatus){u.push({success_action_status:i.successStatus})}if(i.contentLengthRange){const p=i.contentLengthRange.min;const f=i.contentLengthRange.max;if(typeof p!=="number"||typeof f!=="number"){throw new Error(vf.CONTENT_LENGTH_RANGE_MIN_MAX)}u.push(["content-length-range",p,f])}const l={expiration:o.toISOString(),conditions:u};const c=JSON.stringify(l);const d=Buffer.from(c).toString("base64");this.storage.authClient.sign(d).then(p=>{s(null,{string:c,base64:d,signature:p})},p=>{s(new xSe.SigningError(p.message))})}generateSignedPostPolicyV4(t,r){const n=(0,py.normalize)(t,r);let i=n.options;const s=n.callback;const o=new Date(i.expires);if(isNaN(o.getTime())){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(o.valueOf()<Date.now()){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_PAST)}if(o.valueOf()-Date.now()>t_t*1e3){throw new Error(`Max allowed expiration is seven days (${t_t} seconds).`)}i=Object.assign({},i);let u=Object.assign({},i.fields);const l=new Date;const c=(0,py.formatAsUTCISO)(l,true);const d=(0,py.formatAsUTCISO)(l);const p=a(async()=>{const{client_email:f}=await this.storage.authClient.getCredentials();const m=`${f}/${d}/auto/storage/goog4_request`;u={...u,bucket:this.bucket.name,key:this.name,"x-goog-date":c,"x-goog-credential":m,"x-goog-algorithm":"GOOG4-RSA-SHA256"};const h=i.conditions||[];Object.entries(u).forEach(([E,b])=>{if(!E.startsWith("x-ignore-")){h.push({[E]:b})}});delete u.bucket;const g=(0,py.formatAsUTCISO)(o,true,"-",":");const _={conditions:h,expiration:g};const v=(0,py.unicodeJSONStringify)(_);const S=Buffer.from(v).toString("base64");try{const E=await this.storage.authClient.sign(S);const b=Buffer.from(E,"base64").toString("hex");u["policy"]=S;u["x-goog-signature"]=b;let A;if(i.virtualHostedStyle){A=`https://${this.bucket.name}.storage.googleapis.com/`}else if(i.bucketBoundHostname){A=`${i.bucketBoundHostname}/`}else{A=`${Ha.STORAGE_POST_POLICY_BASE_URL}/${this.bucket.name}/`}return{url:A,fields:u}}catch(E){throw new xSe.SigningError(E.message)}},"sign");p().then(f=>s(null,f),s)}getSignedUrl(t,r){const n=OSe[t.action];const i=(0,py.objectKeyToLowercase)(t.extensionHeaders||{});if(t.action==="resumable"){i["x-goog-resumable"]="start"}const s=Object.assign({},t.queryParams);if(typeof t.responseType==="string"){s["response-content-type"]=t.responseType}if(typeof t.promptSaveAs==="string"){s["response-content-disposition"]='attachment; filename="'+t.promptSaveAs+'"'}if(typeof t.responseDisposition==="string"){s["response-content-disposition"]=t.responseDisposition}if(this.generation){s["generation"]=this.generation.toString()}const o={method:n,expires:t.expires,accessibleAt:t.accessibleAt,extensionHeaders:i,queryParams:s,contentMd5:t.contentMd5,contentType:t.contentType};if(t.cname){o.cname=t.cname}if(t.version){o.version=t.version}if(t.virtualHostedStyle){o.virtualHostedStyle=t.virtualHostedStyle}if(!this.signer){this.signer=new xSe.URLSigner(this.storage.authClient,this.bucket,this)}this.signer.getSignedUrl(o).then(u=>r(null,u),r)}isPublic(t){var r;const n=((r=this.storage)===null||r===void 0?void 0:r.interceptors)||[];const i=this.interceptors||[];const s=n.concat(i);const o=s.reduce((u,l)=>{const c=l.request({uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`});Object.assign(u,c.headers);return u},{});lE.util.makeRequest({method:"GET",uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`,headers:o},{retryOptions:this.storage.retryOptions},u=>{if(u){const l=u;if(l.code===403){t(null,false)}else{t(u)}}else{t(null,true)}})}makePrivate(t,r){var n,i;const s=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const o={predefinedAcl:s.strict?"private":"projectPrivate"};if(((n=s.preconditionOpts)===null||n===void 0?void 0:n.ifMetagenerationMatch)!==void 0){o.ifMetagenerationMatch=(i=s.preconditionOpts)===null||i===void 0?void 0:i.ifMetagenerationMatch;delete s.preconditionOpts}if(s.userProject){o.userProject=s.userProject}const u={...s.metadata,acl:null};this.setMetadata(u,o,r)}makePublic(t){t=t||lE.util.noop;this.acl.add({entity:"allUsers",role:"READER"},(r,n,i)=>{t(r,i)})}publicUrl(){return`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`}move(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||lE.util.noop;this.copy(t,i,(s,o,u)=>{if(s){s.message="file#copy failed with an error - "+s.message;n(s,null,u);return}if(this.name!==o.name||this.bucket.name!==o.bucket.name){this.delete(i,(l,c)=>{if(l){l.message="file#delete failed with an error - "+l.message;n(l,o,c);return}n(null,o,u)})}else{n(null,o,u)}})}rename(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||lE.util.noop;this.move(t,i,n)}request(t,r){return this.parent.request.call(this,t,r)}rotateEncryptionKey(t,r){var n;r=typeof t==="function"?t:r;let i={};if(typeof t==="string"||t instanceof Buffer){i={encryptionKey:t}}else if(typeof t==="object"){i=t}const s=this.bucket.file(this.id,i);const o=((n=i.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)!==void 0?{preconditionOpts:i.preconditionOpts}:{};this.copy(s,o,r)}save(t,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};let s=this.storage.retryOptions.maxRetries;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(i===null||i===void 0?void 0:i.preconditionOpts)){s=0}const o=(0,vcn.default)(async u=>{return new Promise((l,c)=>{if(s===0){this.storage.retryOptions.autoRetry=false}const d=this.createWriteStream(i);if(i.onUploadProgress){d.on("progress",i.onUploadProgress)}const p=a(f=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(f)){return c(f)}return u(f)},"handleError");if(typeof t==="string"||Buffer.isBuffer(t)){d.on("error",p).on("finish",()=>l()).end(t)}else{(0,fL.pipeline)(t,d,f=>{if(f){if(typeof t!=="function"){return u(f)}p(f)}else{l()}})}})},{retries:s,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return o}else{return o.then(()=>{if(n){return n()}}).catch(n)}}setMetadata(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,mL.AvailableServiceObjectMethods.setMetadata,i);super.setMetadata(t,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setStorageClass(t,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};const s={...i,storageClass:t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(o,u,l)=>{return u+"_"+l}).toUpperCase()};this.copy(this,s,(o,u,l)=>{if(o){n(o,l);return}this.metadata=u.metadata;n(null,l)})}setUserProject(t){this.bucket.setUserProject.call(this,t)}startResumableUpload_(t,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.retryOptions;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(r.preconditionOpts)){i.autoRetry=false}const s=Qyt.upload({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((o,u)=>u(o),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:r.metadata,offset:r.offset,predefinedAcl:r.predefinedAcl,private:r.private,public:r.public,uri:r.uri,userProject:r.userProject||this.userProject,retryOptions:{...i},params:(r===null||r===void 0?void 0:r.preconditionOpts)||this.instancePreconditionOpts,chunkSize:r===null||r===void 0?void 0:r.chunkSize,highWaterMark:r===null||r===void 0?void 0:r.highWaterMark,[dy.GCCL_GCS_CMD_KEY]:r[dy.GCCL_GCS_CMD_KEY]});s.on("response",o=>{t.emit("response",o)}).on("metadata",o=>{this.metadata=o;t.emit("metadata")}).on("finish",()=>{t.emit("complete")}).on("progress",o=>t.emit("progress",o));t.setWritable(s);this.storage.retryOptions.autoRetry=this.instanceRetryValue}startSimpleUpload_(t,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.apiEndpoint;const s=this.bucket.name;const o=`${i}/upload/storage/v1/b/${s}/o`;const u={qs:{name:this.name},uri:o,[dy.GCCL_GCS_CMD_KEY]:r[dy.GCCL_GCS_CMD_KEY]};if(this.generation!==void 0){u.qs.ifGenerationMatch=this.generation}if(this.kmsKeyName!==void 0){u.qs.kmsKeyName=this.kmsKeyName}if(typeof r.timeout==="number"){u.timeout=r.timeout}if(r.userProject||this.userProject){u.qs.userProject=r.userProject||this.userProject}if(r.predefinedAcl){u.qs.predefinedAcl=r.predefinedAcl}else if(r.private){u.qs.predefinedAcl="private"}else if(r.public){u.qs.predefinedAcl="publicRead"}Object.assign(u.qs,this.instancePreconditionOpts,r.preconditionOpts);lE.util.makeWritableStream(t,{makeAuthenticatedRequest:l=>{this.request(l,(c,d,p)=>{if(c){t.destroy(c);return}this.metadata=d;t.emit("metadata",d);t.emit("response",p);t.emit("complete")})},metadata:r.metadata,request:u})}disableAutoRetryConditionallyIdempotent_(t,r,n){var i,s,o,u;if(typeof t==="object"&&((s=(i=t===null||t===void 0?void 0:t.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&r===mL.AvailableServiceObjectMethods.delete&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}if(typeof t==="object"&&((u=(o=t===null||t===void 0?void 0:t.reqOpts)===null||o===void 0?void 0:o.qs)===null||u===void 0?void 0:u.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&r===mL.AvailableServiceObjectMethods.setMetadata&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}async getBufferFromReadable(t){const r=[];for await(const n of t){r.push(n)}return Buffer.concat(r)}};Ha.File=VW;RSe=new WeakSet,r_t=a(async function e(t,r={}){const n=this.metadata;let i=!!(r.crc32c||r.md5);if(r.crc32c&&n.crc32c){i=!t.test("crc32c",n.crc32c)}if(r.md5&&n.md5Hash){i=!t.test("md5",n.md5Hash)}if(i){const s=[];let o="";let u="";try{await this.delete();if(r.md5&&!n.md5Hash){o="MD5_NOT_AVAILABLE";u=vf.MD5_NOT_AVAILABLE}else{o="FILE_NO_UPLOAD";u=vf.UPLOAD_MISMATCH}}catch(c){const d=c;o="FILE_NO_UPLOAD_DELETE";u=`${vf.UPLOAD_MISMATCH_DELETE_FAIL}${d.message}`;s.push(d)}const l=new hL(u);l.code=o;l.errors=s;throw l}return true},"_File_validateIntegrity");(0,fcn.promisifyAll)(VW,{exclude:["cloudStorageURI","publicUrl","request","save","setEncryptionKey","shouldRetryBasedOnPreconditionAndIdempotencyStrat","getBufferFromReadable"]})});var NSe=y(nO=>{"use strict";Object.defineProperty(nO,"__esModule",{value:true});nO.Iam=nO.IAMExceptionMessages=void 0;var bcn=I0();var PSe=P0();var YW;(function(e){e["POLICY_OBJECT_REQUIRED"]="A policy object is required.";e["PERMISSIONS_REQUIRED"]="Permissions are required."})(YW||(nO.IAMExceptionMessages=YW={}));var XW=class{static{a(this,"Iam")}constructor(t){this.request_=t.request.bind(t);this.resourceId_="buckets/"+t.getId()}getPolicy(t,r){const{options:n,callback:i}=(0,PSe.normalize)(t,r);const s={};if(n.userProject){s.userProject=n.userProject}if(n.requestedPolicyVersion!==null&&n.requestedPolicyVersion!==void 0){s.optionsRequestedPolicyVersion=n.requestedPolicyVersion}this.request_({uri:"/iam",qs:s},i)}setPolicy(t,r,n){if(t===null||typeof t!=="object"){throw new Error(YW.POLICY_OBJECT_REQUIRED)}const{options:i,callback:s}=(0,PSe.normalize)(r,n);let o;if(t.etag===void 0){o=0}this.request_({method:"PUT",uri:"/iam",maxRetries:o,json:Object.assign({resourceId:this.resourceId_},t),qs:i},s)}testPermissions(t,r,n){if(!Array.isArray(t)&&typeof t!=="string"){throw new Error(YW.PERMISSIONS_REQUIRED)}const{options:i,callback:s}=(0,PSe.normalize)(r,n);const o=Array.isArray(t)?t:[t];const u=Object.assign({permissions:o},i);this.request_({uri:"/iam/testPermissions",qs:u,useQuerystring:true},(l,c)=>{if(l){s(l,null,c);return}const d=Array.isArray(c.permissions)?c.permissions:[];const p=o.reduce((f,m)=>{f[m]=d.indexOf(m)>-1;return f},{});s(null,p,c)})}};nO.Iam=XW;(0,bcn.promisifyAll)(XW)});var ISe=y(QW=>{"use strict";Object.defineProperty(QW,"__esModule",{value:true});QW.Notification=void 0;var Scn=tE();var Acn=I0();var JW=class extends Scn.ServiceObject{static{a(this,"Notification")}constructor(t,r){const n={};const i={create:true,delete:{reqOpts:{qs:n}},get:{reqOpts:{qs:n}},getMetadata:{reqOpts:{qs:n}},exists:true};super({parent:t,baseUrl:"/notificationConfigs",id:r.toString(),createMethod:t.createNotification.bind(t),methods:i})}};QW.Notification=JW;(0,Acn.promisifyAll)(JW)});var WW=y(_u=>{"use strict";var Ccn=_u&&_u.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var wcn=_u&&_u.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var LSe=_u&&_u.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Ccn(t,e,r)}wcn(t,e);return t};var a_t=_u&&_u.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(_u,"__esModule",{value:true});_u.Bucket=_u.BucketExceptionMessages=_u.AvailableServiceObjectMethods=_u.BucketActionToHTTPMethod=void 0;var ZW=tE();var o_t=lSe();var Tcn=I0();var xcn=LSe(require("fs"));var Rcn=LSe(dSe());var Ocn=LSe(require("path"));var n_t=a_t(mSe());var i_t=require("util");var Pcn=a_t(tL());var Ncn=P0();var s_t=hSe();var kSe=pL();var Icn=NSe();var kcn=ISe();var iO=tO();var Dcn=SSe();var Lcn=require("stream");var Fcn=require("url");var DSe;(function(e){e["list"]="GET"})(DSe||(_u.BucketActionToHTTPMethod=DSe={}));var sO;(function(e){e[e["setMetadata"]=0]="setMetadata";e[e["delete"]=1]="delete"})(sO||(_u.AvailableServiceObjectMethods=sO={}));var L0;(function(e){e["PROVIDE_SOURCE_FILE"]="You must provide at least one source file.";e["DESTINATION_FILE_NOT_SPECIFIED"]="A destination file must be specified.";e["CHANNEL_ID_REQUIRED"]="An ID is required to create a channel.";e["TOPIC_NAME_REQUIRED"]="A valid topic name is required.";e["CONFIGURATION_OBJECT_PREFIX_REQUIRED"]="A configuration object with a prefix is required.";e["SPECIFY_FILE_NAME"]="A file name must be specified.";e["METAGENERATION_NOT_PROVIDED"]="A metageneration must be provided.";e["SUPPLY_NOTIFICATION_ID"]="You must supply a notification ID."})(L0||(_u.BucketExceptionMessages=L0={}));var gL=class e extends ZW.ServiceObject{static{a(this,"Bucket")}getFilesStream(t){return new Lcn.Readable}constructor(t,r,n){var i,s,o,u;n=n||{};r=r.replace(/^gs:\/\//,"").replace(/\/+$/,"");const l={};if((i=n===null||n===void 0?void 0:n.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch){l.ifGenerationMatch=n.preconditionOpts.ifGenerationMatch}if((s=n===null||n===void 0?void 0:n.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationNotMatch){l.ifGenerationNotMatch=n.preconditionOpts.ifGenerationNotMatch}if((o=n===null||n===void 0?void 0:n.preconditionOpts)===null||o===void 0?void 0:o.ifMetagenerationMatch){l.ifMetagenerationMatch=n.preconditionOpts.ifMetagenerationMatch}if((u=n===null||n===void 0?void 0:n.preconditionOpts)===null||u===void 0?void 0:u.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=n.preconditionOpts.ifMetagenerationNotMatch}const c=n.userProject;if(typeof c==="string"){l.userProject=c}const d={create:{reqOpts:{qs:l}},delete:{reqOpts:{qs:l}},exists:{reqOpts:{qs:l}},get:{reqOpts:{qs:l}},getMetadata:{reqOpts:{qs:l}},setMetadata:{reqOpts:{qs:l}}};super({parent:t,baseUrl:"/b",id:r,createMethod:t.createBucket.bind(t),methods:d});this.name=r;this.storage=t;this.userProject=n.userProject;this.acl=new s_t.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.acl.default=new s_t.Acl({request:this.request.bind(this),pathPrefix:"/defaultObjectAcl"});this.crc32cGenerator=n.crc32cGenerator||this.storage.crc32cGenerator;this.iam=new Icn.Iam(this);this.getFilesStream=o_t.paginator.streamify("getFiles");this.instanceRetryValue=t.retryOptions.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const t=new Fcn.URL("gs://");t.host=this.name;return t}addLifecycleRule(t,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}i=i||{};const s=Array.isArray(t)?t:[t];for(const o of s){if(o.condition.createdBefore instanceof Date){o.condition.createdBefore=o.condition.createdBefore.toISOString().replace(/T.+$/,"")}if(o.condition.customTimeBefore instanceof Date){o.condition.customTimeBefore=o.condition.customTimeBefore.toISOString().replace(/T.+$/,"")}if(o.condition.noncurrentTimeBefore instanceof Date){o.condition.noncurrentTimeBefore=o.condition.noncurrentTimeBefore.toISOString().replace(/T.+$/,"")}}if(i.append===false){this.setMetadata({lifecycle:{rule:s}},i,n);return}this.getMetadata((o,u)=>{var l,c;if(o){n(o);return}const d=Array.isArray((l=u.lifecycle)===null||l===void 0?void 0:l.rule)?(c=u.lifecycle)===null||c===void 0?void 0:c.rule:[];this.setMetadata({lifecycle:{rule:d.concat(s)}},i,n)})}combine(t,r,n,i){var s;if(!Array.isArray(t)||t.length===0){throw new Error(L0.PROVIDE_SOURCE_FILE)}if(!r){throw new Error(L0.DESTINATION_FILE_NOT_SPECIFIED)}let o={};if(typeof n==="function"){i=n}else if(n){o=n}this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,sO.setMetadata,o);const u=a(d=>{if(d instanceof kSe.File){return d}return this.file(d)},"convertToFile");t=t.map(u);const l=u(r);i=i||ZW.util.noop;if(!l.metadata.contentType){const d=Rcn.contentType(l.name);if(d){l.metadata.contentType=d}}let c=this.storage.retryOptions.maxRetries;if(((s=l===null||l===void 0?void 0:l.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&o.ifGenerationMatch===void 0&&this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryNever){c=0}if(o.ifGenerationMatch===void 0){Object.assign(o,l.instancePreconditionOpts,o)}l.request({method:"POST",uri:"/compose",maxRetries:c,json:{destination:{contentType:l.metadata.contentType},sourceObjects:t.map(d=>{const p={name:d.name};if(d.metadata&&d.metadata.generation){p.generation=parseInt(d.metadata.generation.toString())}return p})},qs:o},(d,p)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(d){i(d,null,p);return}i(null,l,p)})}createChannel(t,r,n,i){if(typeof t!=="string"){throw new Error(L0.CHANNEL_ID_REQUIRED)}let s={};if(typeof n==="function"){i=n}else if(n){s=n}this.request({method:"POST",uri:"/o/watch",json:Object.assign({id:t,type:"web_hook"},r),qs:s},(o,u)=>{if(o){i(o,null,u);return}const l=u.resourceId;const c=this.storage.channel(t,l);c.metadata=u;i(null,c,u)})}createNotification(t,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}const s=t!==null&&typeof t==="object";if(s&&ZW.util.isCustomType(t,"pubsub/topic")){t=t.name}if(typeof t!=="string"){throw new Error(L0.TOPIC_NAME_REQUIRED)}const o=Object.assign({topic:t},i);if(o.topic.indexOf("projects")!==0){o.topic="projects/{{projectId}}/topics/"+o.topic}o.topic="//pubsub.googleapis.com/"+o.topic;if(!o.payloadFormat){o.payloadFormat="JSON_API_V1"}const u={};if(o.userProject){u.userProject=o.userProject;delete o.userProject}this.request({method:"POST",uri:"/notificationConfigs",json:(0,Ncn.convertObjKeysToSnakeCase)(o),qs:u,maxRetries:0},(l,c)=>{if(l){n(l,null,c);return}const d=this.notification(c.id);d.metadata=c;n(null,d,c)})}deleteFiles(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}const i=10;const s=1e3;const o=[];const u=a(l=>{return l.delete(n).catch(c=>{if(!n.force){throw c}o.push(c)})},"deleteFile");(async()=>{try{let l=[];const c=(0,n_t.default)(i);const d=this.getFilesStream(n);for await(const p of d){if(l.length>=s){await Promise.all(l);l=[]}l.push(c(()=>u(p)).catch(f=>{d.destroy();throw f}))}await Promise.all(l);r(o.length>0?o:null)}catch(l){r(l);return}})()}deleteLabels(t,r,n){let i=new Array;let s={};if(typeof t==="function"){n=t}else if(typeof t==="string"){i=[t]}else if(Array.isArray(t)){i=t}else if(t){s=t}if(typeof r==="function"){n=r}else if(r){s=r}const o=a(u=>{const l=u.reduce((c,d)=>{c[d]=null;return c},{});if((s===null||s===void 0?void 0:s.ifMetagenerationMatch)!==void 0){this.setLabels(l,s,n)}else{this.setLabels(l,n)}},"deleteLabels");if(i.length===0){this.getLabels((u,l)=>{if(u){n(u);return}o(Object.keys(l))})}else{o(i)}}disableRequesterPays(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.setMetadata({billing:{requesterPays:false}},n,r)}enableLogging(t,r){if(!t||typeof t==="function"||typeof t.prefix==="undefined"){throw new Error(L0.CONFIGURATION_OBJECT_PREFIX_REQUIRED)}let n=this.id;if(t.bucket&&t.bucket instanceof e){n=t.bucket.id}else if(t.bucket&&typeof t.bucket==="string"){n=t.bucket}const i={};if(t===null||t===void 0?void 0:t.ifMetagenerationMatch){i.ifMetagenerationMatch=t.ifMetagenerationMatch}if(t===null||t===void 0?void 0:t.ifMetagenerationNotMatch){i.ifMetagenerationNotMatch=t.ifMetagenerationNotMatch}(async()=>{try{const[s]=await this.iam.getPolicy();s.bindings.push({members:["group:cloud-storage-analytics@google.com"],role:"roles/storage.objectCreator"});await this.iam.setPolicy(s);this.setMetadata({logging:{logBucket:n,logObjectPrefix:t.prefix}},i,r)}catch(s){r(s);return}})()}enableRequesterPays(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.setMetadata({billing:{requesterPays:true}},n,r)}file(t,r){if(!t){throw Error(L0.SPECIFY_FILE_NAME)}return new kSe.File(this,t,r)}getFiles(t,r){let n=typeof t==="object"?t:{};if(!r){r=t}n=Object.assign({},n);this.request({uri:"/o",qs:n},(i,s)=>{if(i){r(i,null,null,s);return}const o=s.items?s.items:[];const u=o.map(c=>{const d={};if(n.versions){d.generation=c.generation}if(c.kmsKeyName){d.kmsKeyName=c.kmsKeyName}const p=this.file(c.name,d);p.metadata=c;return p});let l=null;if(s.nextPageToken){l=Object.assign({},n,{pageToken:s.nextPageToken})}r(null,u,l,s)})}getLabels(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.getMetadata(n,(i,s)=>{if(i){r(i,null);return}r(null,(s===null||s===void 0?void 0:s.labels)||{})})}getNotifications(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.request({uri:"/notificationConfigs",qs:n},(i,s)=>{if(i){r(i,null,s);return}const o=s.items?s.items:[];const u=o.map(l=>{const c=this.notification(l.id);c.metadata=l;return c});r(null,u,s)})}getSignedUrl(t,r){const n=DSe[t.action];const i={method:n,expires:t.expires,version:t.version,cname:t.cname,extensionHeaders:t.extensionHeaders||{},queryParams:t.queryParams||{}};if(!this.signer){this.signer=new Dcn.URLSigner(this.storage.authClient,this)}this.signer.getSignedUrl(i).then(s=>r(null,s),r)}lock(t,r){const n=typeof t;if(n!=="number"&&n!=="string"){throw new Error(L0.METAGENERATION_NOT_PROVIDED)}this.request({method:"POST",uri:"/lockRetentionPolicy",qs:{ifMetagenerationMatch:t}},r)}makePrivate(t,r){var n,i,s,o;const u=typeof t==="object"?t:{};r=typeof t==="function"?t:r;u.private=true;const l={predefinedAcl:"projectPrivate"};if(u.userProject){l.userProject=u.userProject}if((n=u.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch){l.ifGenerationMatch=u.preconditionOpts.ifGenerationMatch}if((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationNotMatch){l.ifGenerationNotMatch=u.preconditionOpts.ifGenerationNotMatch}if((s=u.preconditionOpts)===null||s===void 0?void 0:s.ifMetagenerationMatch){l.ifMetagenerationMatch=u.preconditionOpts.ifMetagenerationMatch}if((o=u.preconditionOpts)===null||o===void 0?void 0:o.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=u.preconditionOpts.ifMetagenerationNotMatch}const c={...u.metadata,acl:null};this.setMetadata(c,l,d=>{if(d){r(d)}const p=a(()=>{if(u.includeFiles){return(0,i_t.promisify)(this.makeAllFilesPublicPrivate_).call(this,u)}return Promise.resolve([])},"internalCall");p().then(f=>r(null,f)).catch(r)})}makePublic(t,r){const n=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const i={public:true,...n};this.acl.add({entity:"allUsers",role:"READER"}).then(()=>{return this.acl.default.add({entity:"allUsers",role:"READER"})}).then(()=>{if(i.includeFiles){return(0,i_t.promisify)(this.makeAllFilesPublicPrivate_).call(this,i)}return[]}).then(s=>r(null,s),r)}notification(t){if(!t){throw new Error(L0.SUPPLY_NOTIFICATION_ID)}return new kcn.Notification(this,t)}removeRetentionPeriod(t,r){const n=typeof t==="object"?t:{};r=typeof t==="function"?t:r;this.setMetadata({retentionPolicy:null},n,r)}request(t,r){if(this.userProject&&(!t.qs||!t.qs.userProject)){t.qs={...t.qs,userProject:this.userProject}}return super.request(t,r)}setLabels(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||ZW.util.noop;this.setMetadata({labels:t},i,n)}setMetadata(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,sO.setMetadata,i);super.setMetadata(t,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setRetentionPeriod(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({retentionPolicy:{retentionPeriod:t.toString()}},i,n)}setCorsConfiguration(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({cors:t},i,n)}setStorageClass(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;t=t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(s,o,u)=>{return o+"_"+u}).toUpperCase();this.setMetadata({storageClass:t},i,n)}setUserProject(t){this.userProject=t;const r=["create","delete","exists","get","getMetadata","setMetadata"];r.forEach(n=>{const i=this.methods[n];if(typeof i==="object"){if(typeof i.reqOpts==="object"){Object.assign(i.reqOpts.qs,{userProject:t})}else{i.reqOpts={qs:{userProject:t}}}}})}upload(t,r,n){var i,s;const o=a(d=>{const p=(0,Pcn.default)(async f=>{await new Promise((m,h)=>{var g,_;if(d===0&&((_=(g=c===null||c===void 0?void 0:c.storage)===null||g===void 0?void 0:g.retryOptions)===null||_===void 0?void 0:_.autoRetry)){c.storage.retryOptions.autoRetry=false}const v=c.createWriteStream(u);if(u.onUploadProgress){v.on("progress",u.onUploadProgress)}xcn.createReadStream(t).on("error",f).pipe(v).on("error",S=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(S)){return h(S)}else{return f(S)}}).on("finish",()=>{return m()})})},{retries:d,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return p}else{return p.then(()=>{if(n){return n(null,c,c.metadata)}}).catch(n)}},"upload");if(global["GCLOUD_SANDBOX_ENV"]){return}let u=typeof r==="object"?r:{};n=typeof r==="function"?r:n;u=Object.assign({metadata:{}},u);let l=this.storage.retryOptions.maxRetries;if(((i=u===null||u===void 0?void 0:u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&((s=this.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryNever){l=0}let c;if(u.destination instanceof kSe.File){c=u.destination}else if(u.destination!==null&&typeof u.destination==="string"){c=this.file(u.destination,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}else{const d=Ocn.basename(t);c=this.file(d,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}o(l)}makeAllFilesPublicPrivate_(t,r){const n=10;const i=[];const s=[];const o=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const u=a(async l=>{try{await(o.public?l.makePublic():l.makePrivate(o));s.push(l)}catch(c){if(!o.force){throw c}i.push(c)}},"processFile");this.getFiles(o).then(([l])=>{const c=(0,n_t.default)(n);const d=l.map(p=>{return c(()=>u(p))});return Promise.all(d)}).then(()=>r(i.length>0?i:null,s),l=>r(l,s))}getId(){return this.id}disableAutoRetryConditionallyIdempotent_(t,r,n){var i,s;if(typeof t==="object"&&((s=(i=t===null||t===void 0?void 0:t.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&(r===sO.setMetadata||r===sO.delete)&&this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryConditional){this.storage.retryOptions.autoRetry=false}else if(this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}};_u.Bucket=gL;o_t.paginator.extend(gL,"getFiles");(0,Tcn.promisifyAll)(gL,{exclude:["cloudStorageURI","request","file","notification"]})});var FSe=y(tY=>{"use strict";Object.defineProperty(tY,"__esModule",{value:true});tY.Channel=void 0;var u_t=tE();var Bcn=I0();var eY=class extends u_t.ServiceObject{static{a(this,"Channel")}constructor(t,r,n){const i={parent:t,baseUrl:"/channels",id:"",methods:{}};super(i);this.metadata.id=r;this.metadata.resourceId=n}stop(t){t=t||u_t.util.noop;this.request({method:"POST",uri:"/stop",json:this.metadata},(r,n)=>{t(r,n)})}};tY.Channel=eY;(0,Bcn.promisifyAll)(eY)});var BSe=y(nY=>{"use strict";Object.defineProperty(nY,"__esModule",{value:true});nY.HmacKey=void 0;var Mcn=tE();var qcn=tO();var Ucn=I0();var rY=class extends Mcn.ServiceObject{static{a(this,"HmacKey")}constructor(t,r,n){const i={delete:true,get:true,getMetadata:true,setMetadata:{reqOpts:{method:"PUT"}}};const s=n&&n.projectId||t.projectId;super({parent:t,id:r,baseUrl:`/projects/${s}/hmacKeys`,methods:i});this.storage=t;this.instanceRetryValue=t.retryOptions.autoRetry}setMetadata(t,r,n){if(this.storage.retryOptions.idempotencyStrategy!==qcn.IdempotencyStrategy.RetryAlways){this.storage.retryOptions.autoRetry=false}const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;super.setMetadata(t,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}};nY.HmacKey=rY;(0,Ucn.promisifyAll)(rY)});var tO=y(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:true});cs.Storage=cs.RETRYABLE_ERR_FN_DEFAULT=cs.MAX_RETRY_DELAY_DEFAULT=cs.TOTAL_TIMEOUT_DEFAULT=cs.RETRY_DELAY_MULTIPLIER_DEFAULT=cs.MAX_RETRY_DEFAULT=cs.AUTO_RETRY_DEFAULT=cs.PROTOCOL_REGEX=cs.StorageExceptionMessages=cs.ExceptionMessages=cs.IdempotencyStrategy=void 0;var $cn=tE();var MSe=lSe();var jcn=I0();var l_t=require("stream");var d_t=WW();var p_t=FSe();var Gcn=pL();var iY=P0();var Hcn=VR();var f_t=BSe();var Vcn=dL();var qSe;(function(e){e[e["RetryAlways"]=0]="RetryAlways";e[e["RetryConditional"]=1]="RetryConditional";e[e["RetryNever"]=2]="RetryNever"})(qSe||(cs.IdempotencyStrategy=qSe={}));var c_t;(function(e){e["EXPIRATION_DATE_INVALID"]="The expiration date provided was invalid.";e["EXPIRATION_DATE_PAST"]="An expiration date cannot be in the past."})(c_t||(cs.ExceptionMessages=c_t={}));var aO;(function(e){e["BUCKET_NAME_REQUIRED"]="A bucket name is needed to use Cloud Storage.";e["BUCKET_NAME_REQUIRED_CREATE"]="A name is required to create a bucket.";e["HMAC_SERVICE_ACCOUNT"]="The first argument must be a service account email to create an HMAC key.";e["HMAC_ACCESS_ID"]="An access ID is needed to create an HmacKey object."})(aO||(cs.StorageExceptionMessages=aO={}));cs.PROTOCOL_REGEX=/^(\w*):\/\//;cs.AUTO_RETRY_DEFAULT=true;cs.MAX_RETRY_DEFAULT=3;cs.RETRY_DELAY_MULTIPLIER_DEFAULT=2;cs.TOTAL_TIMEOUT_DEFAULT=600;cs.MAX_RETRY_DELAY_DEFAULT=64;var zcn=qSe.RetryConditional;var Kcn=a(function(e){var t;const r=a(n=>{return n.includes("eai_again")||n==="econnreset"||n==="unexpected connection closure"||n==="epipe"||n==="socket connection timeout"},"isConnectionProblem");if(e){if([408,429,500,502,503,504].indexOf(e.code)!==-1){return true}if(typeof e.code==="string"){if(["408","429","500","502","503","504"].indexOf(e.code)!==-1){return true}const n=e.code.toLowerCase();if(r(n)){return true}}if(e.errors){for(const n of e.errors){const i=(t=n===null||n===void 0?void 0:n.reason)===null||t===void 0?void 0:t.toString().toLowerCase();if(i&&r(i)){return true}}}}return false},"RETRYABLE_ERR_FN_DEFAULT");cs.RETRYABLE_ERR_FN_DEFAULT=Kcn;var F0=class e extends $cn.Service{static{a(this,"Storage")}getBucketsStream(){return new l_t.Readable}getHmacKeysStream(){return new l_t.Readable}constructor(t={}){var r,n,i,s,o,u,l,c,d,p,f,m,h,g;let _="https://storage.googleapis.com";let v=false;const S=process.env.STORAGE_EMULATOR_HOST;if(typeof S==="string"){_=e.sanitizeEndpoint(S);v=true}if(t.apiEndpoint){_=e.sanitizeEndpoint(t.apiEndpoint);v=true}t=Object.assign({},t,{apiEndpoint:_});const E=S||`${t.apiEndpoint}/storage/v1`;const b={apiEndpoint:t.apiEndpoint,retryOptions:{autoRetry:((r=t.retryOptions)===null||r===void 0?void 0:r.autoRetry)!==void 0?(n=t.retryOptions)===null||n===void 0?void 0:n.autoRetry:cs.AUTO_RETRY_DEFAULT,maxRetries:((i=t.retryOptions)===null||i===void 0?void 0:i.maxRetries)?(s=t.retryOptions)===null||s===void 0?void 0:s.maxRetries:cs.MAX_RETRY_DEFAULT,retryDelayMultiplier:((o=t.retryOptions)===null||o===void 0?void 0:o.retryDelayMultiplier)?(u=t.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier:cs.RETRY_DELAY_MULTIPLIER_DEFAULT,totalTimeout:((l=t.retryOptions)===null||l===void 0?void 0:l.totalTimeout)?(c=t.retryOptions)===null||c===void 0?void 0:c.totalTimeout:cs.TOTAL_TIMEOUT_DEFAULT,maxRetryDelay:((d=t.retryOptions)===null||d===void 0?void 0:d.maxRetryDelay)?(p=t.retryOptions)===null||p===void 0?void 0:p.maxRetryDelay:cs.MAX_RETRY_DELAY_DEFAULT,retryableErrorFn:((f=t.retryOptions)===null||f===void 0?void 0:f.retryableErrorFn)?(m=t.retryOptions)===null||m===void 0?void 0:m.retryableErrorFn:cs.RETRYABLE_ERR_FN_DEFAULT,idempotencyStrategy:((h=t.retryOptions)===null||h===void 0?void 0:h.idempotencyStrategy)!==void 0?(g=t.retryOptions)===null||g===void 0?void 0:g.idempotencyStrategy:zcn},baseUrl:E,customEndpoint:v,useAuthWithCustomEndpoint:t===null||t===void 0?void 0:t.useAuthWithCustomEndpoint,projectIdRequired:false,scopes:["https://www.googleapis.com/auth/iam","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/devstorage.full_control"],packageJson:(0,Hcn.getPackageJSON)()};super(b,t);this.acl=e.acl;this.crc32cGenerator=t.crc32cGenerator||Vcn.CRC32C_DEFAULT_VALIDATOR_GENERATOR;this.retryOptions=b.retryOptions;this.getBucketsStream=MSe.paginator.streamify("getBuckets");this.getHmacKeysStream=MSe.paginator.streamify("getHmacKeys")}static sanitizeEndpoint(t){if(!cs.PROTOCOL_REGEX.test(t)){t=`https://${t}`}return t.replace(/\/+$/,"")}bucket(t,r){if(!t){throw new Error(aO.BUCKET_NAME_REQUIRED)}return new d_t.Bucket(this,t,r)}channel(t,r){return new p_t.Channel(this,t,r)}createBucket(t,r,n){if(!t){throw new Error(aO.BUCKET_NAME_REQUIRED_CREATE)}let i;if(!n){n=r;i={}}else{i=r}const s={...i,name:t};const o={archive:"ARCHIVE",coldline:"COLDLINE",dra:"DURABLE_REDUCED_AVAILABILITY",multiRegional:"MULTI_REGIONAL",nearline:"NEARLINE",regional:"REGIONAL",standard:"STANDARD"};const u=Object.keys(o);for(const c of u){if(s[c]){if(i.storageClass&&i.storageClass!==c){throw new Error(`Both \`${c}\` and \`storageClass\` were provided.`)}s.storageClass=o[c];delete s[c]}}if(s.requesterPays){s.billing={requesterPays:s.requesterPays};delete s.requesterPays}const l={project:this.projectId};if(s.userProject){l.userProject=s.userProject;delete s.userProject}this.request({method:"POST",uri:"/b",qs:l,json:s},(c,d)=>{if(c){n(c,null,d);return}const p=this.bucket(t);p.metadata=d;n(null,p,d)})}createHmacKey(t,r,n){if(typeof t!=="string"){throw new Error(aO.HMAC_SERVICE_ACCOUNT)}const{options:i,callback:s}=(0,iY.normalize)(r,n);const o=Object.assign({},i,{serviceAccountEmail:t});const u=o.projectId||this.projectId;delete o.projectId;this.request({method:"POST",uri:`/projects/${u}/hmacKeys`,qs:o,maxRetries:0},(l,c)=>{if(l){s(l,null,null,c);return}const d=c.metadata;const p=this.hmacKey(d.accessId,{projectId:d.projectId});p.metadata=c.metadata;s(null,p,c.secret,c)})}getBuckets(t,r){const{options:n,callback:i}=(0,iY.normalize)(t,r);n.project=n.project||this.projectId;this.request({uri:"/b",qs:n},(s,o)=>{if(s){i(s,null,null,o);return}const u=o.items?o.items:[];const l=u.map(d=>{const p=this.bucket(d.id);p.metadata=d;return p});const c=o.nextPageToken?Object.assign({},n,{pageToken:o.nextPageToken}):null;i(null,l,c,o)})}getHmacKeys(t,r){const{options:n,callback:i}=(0,iY.normalize)(t,r);const s=Object.assign({},n);const o=s.projectId||this.projectId;delete s.projectId;this.request({uri:`/projects/${o}/hmacKeys`,qs:s},(u,l)=>{if(u){i(u,null,null,l);return}const c=l.items?l.items:[];const d=c.map(f=>{const m=this.hmacKey(f.accessId,{projectId:f.projectId});m.metadata=f;return m});const p=l.nextPageToken?Object.assign({},n,{pageToken:l.nextPageToken}):null;i(null,d,p,l)})}getServiceAccount(t,r){const{options:n,callback:i}=(0,iY.normalize)(t,r);this.request({uri:`/projects/${this.projectId}/serviceAccount`,qs:n},(s,o)=>{if(s){i(s,null,o);return}const u={};for(const l in o){if(o.hasOwnProperty(l)){const c=l.replace(/_(\w)/g,(d,p)=>p.toUpperCase());u[c]=o[l]}}i(null,u,o)})}hmacKey(t,r){if(!t){throw new Error(aO.HMAC_ACCESS_ID)}return new f_t.HmacKey(this,t,r)}};cs.Storage=F0;F0.Bucket=d_t.Bucket;F0.Channel=p_t.Channel;F0.File=Gcn.File;F0.HmacKey=f_t.HmacKey;F0.acl={OWNER_ROLE:"OWNER",READER_ROLE:"READER",WRITER_ROLE:"WRITER"};MSe.paginator.extend(F0,["getBuckets","getHmacKeys"]);(0,jcn.promisifyAll)(F0,{exclude:["bucket","channel","hmacKey"]})});var sY=y(fy=>{"use strict";var m_t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";var Wcn=m_t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";var h_t="["+m_t+"]["+Wcn+"]*";var Ycn=new RegExp("^"+h_t+"$");var Xcn=a(function(e,t){const r=[];let n=t.exec(e);while(n){const i=[];i.startIndex=t.lastIndex-n[0].length;const s=n.length;for(let o=0;o<s;o++){i.push(n[o])}r.push(i);n=t.exec(e)}return r},"getAllMatches");var Jcn=a(function(e){const t=Ycn.exec(e);return!(t===null||typeof t==="undefined")},"isName");fy.isExist=function(e){return typeof e!=="undefined"};fy.isEmptyObject=function(e){return Object.keys(e).length===0};fy.merge=function(e,t,r){if(t){const n=Object.keys(t);const i=n.length;for(let s=0;s<i;s++){if(r==="strict"){e[n[s]]=[t[n[s]]]}else{e[n[s]]=t[n[s]]}}}};fy.getValue=function(e){if(fy.isExist(e)){return e}else{return""}};fy.isName=Jcn;fy.getAllMatches=Xcn;fy.nameRegexp=h_t});var $Se=y(E_t=>{"use strict";var USe=sY();var Qcn={allowBooleanAttributes:false,unpairedTags:[]};E_t.validate=function(e,t){t=Object.assign({},Qcn,t);const r=[];let n=false;let i=false;if(e[0]==="\uFEFF"){e=e.substr(1)}for(let s=0;s<e.length;s++){if(e[s]==="<"&&e[s+1]==="?"){s+=2;s=y_t(e,s);if(s.err)return s}else if(e[s]==="<"){let o=s;s++;if(e[s]==="!"){s=__t(e,s);continue}else{let u=false;if(e[s]==="/"){u=true;s++}let l="";for(;s<e.length&&e[s]!==">"&&e[s]!==" "&&e[s]!==" "&&e[s]!=="\n"&&e[s]!=="\r";s++){l+=e[s]}l=l.trim();if(l[l.length-1]==="/"){l=l.substring(0,l.length-1);s--}if(!adn(l)){let p;if(l.trim().length===0){p="Invalid space after '<'."}else{p="Tag '"+l+"' is an invalid name."}return Io("InvalidTag",p,cd(e,s))}const c=tdn(e,s);if(c===false){return Io("InvalidAttr","Attributes for '"+l+"' have open quote.",cd(e,s))}let d=c.value;s=c.index;if(d[d.length-1]==="/"){const p=s-d.length;d=d.substring(0,d.length-1);const f=v_t(d,t);if(f===true){n=true}else{return Io(f.err.code,f.err.msg,cd(e,p+f.err.line))}}else if(u){if(!c.tagClosed){return Io("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",cd(e,s))}else if(d.trim().length>0){return Io("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",cd(e,o))}else{const p=r.pop();if(l!==p.tagName){let f=cd(e,p.tagStartPos);return Io("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+l+"'.",cd(e,o))}if(r.length==0){i=true}}}else{const p=v_t(d,t);if(p!==true){return Io(p.err.code,p.err.msg,cd(e,s-d.length+p.err.line))}if(i===true){return Io("InvalidXml","Multiple possible root nodes found.",cd(e,s))}else if(t.unpairedTags.indexOf(l)!==-1){}else{r.push({tagName:l,tagStartPos:o})}n=true}for(s++;s<e.length;s++){if(e[s]==="<"){if(e[s+1]==="!"){s++;s=__t(e,s);continue}else if(e[s+1]==="?"){s=y_t(e,++s);if(s.err)return s}else{break}}else if(e[s]==="&"){const p=idn(e,s);if(p==-1)return Io("InvalidChar","char '&' is not expected.",cd(e,s));s=p}else{if(i===true&&!g_t(e[s])){return Io("InvalidXml","Extra text at the end",cd(e,s))}}}if(e[s]==="<"){s--}}}else{if(g_t(e[s])){continue}return Io("InvalidChar","char '"+e[s]+"' is not expected.",cd(e,s))}}if(!n){return Io("InvalidXml","Start tag expected.",1)}else if(r.length==1){return Io("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",cd(e,r[0].tagStartPos))}else if(r.length>0){return Io("InvalidXml","Invalid '"+JSON.stringify(r.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}return true};function g_t(e){return e===" "||e===" "||e==="\n"||e==="\r"}a(g_t,"isWhiteSpace");function y_t(e,t){const r=t;for(;t<e.length;t++){if(e[t]=="?"||e[t]==" "){const n=e.substr(r,t-r);if(t>5&&n==="xml"){return Io("InvalidXml","XML declaration allowed only at the start of the document.",cd(e,t))}else if(e[t]=="?"&&e[t+1]==">"){t++;break}else{continue}}}return t}a(y_t,"readPI");function __t(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++){if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++){if(e[t]==="<"){r++}else if(e[t]===">"){r--;if(r===0){break}}}}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++){if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}}return t}a(__t,"readCommentAndCDATA");var Zcn='"';var edn="'";function tdn(e,t){let r="";let n="";let i=false;for(;t<e.length;t++){if(e[t]===Zcn||e[t]===edn){if(n===""){n=e[t]}else if(n!==e[t]){}else{n=""}}else if(e[t]===">"){if(n===""){i=true;break}}r+=e[t]}if(n!==""){return false}return{value:r,index:t,tagClosed:i}}a(tdn,"readAttributeStr");var rdn=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function v_t(e,t){const r=USe.getAllMatches(e,rdn);const n={};for(let i=0;i<r.length;i++){if(r[i][1].length===0){return Io("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",yL(r[i]))}else if(r[i][3]!==void 0&&r[i][4]===void 0){return Io("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",yL(r[i]))}else if(r[i][3]===void 0&&!t.allowBooleanAttributes){return Io("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",yL(r[i]))}const s=r[i][2];if(!sdn(s)){return Io("InvalidAttr","Attribute '"+s+"' is an invalid name.",yL(r[i]))}if(!n.hasOwnProperty(s)){n[s]=1}else{return Io("InvalidAttr","Attribute '"+s+"' is repeated.",yL(r[i]))}}return true}a(v_t,"validateAttributeString");function ndn(e,t){let r=/\d/;if(e[t]==="x"){t++;r=/[\da-fA-F]/}for(;t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}a(ndn,"validateNumberAmpersand");function idn(e,t){t++;if(e[t]===";")return-1;if(e[t]==="#"){t++;return ndn(e,t)}let r=0;for(;t<e.length;t++,r++){if(e[t].match(/\w/)&&r<20)continue;if(e[t]===";")break;return-1}return t}a(idn,"validateAmpersand");function Io(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}a(Io,"getErrorObject");function sdn(e){return USe.isName(e)}a(sdn,"validateAttrName");function adn(e){return USe.isName(e)}a(adn,"validateTagName");function cd(e,t){const r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}a(cd,"getLineNumberForPosition");function yL(e){return e.startIndex+e[1].length}a(yL,"getPositionFromMatch")});var S_t=y(jSe=>{var b_t={preserveOrder:false,attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,removeNSPrefix:false,allowBooleanAttributes:false,parseTagValue:true,parseAttributeValue:false,trimValues:true,cdataPropName:false,numberParseOptions:{hex:true,leadingZeros:true,eNotation:true},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:false,isArray:()=>false,commentPropName:false,unpairedTags:[],processEntities:true,htmlEntities:false,ignoreDeclaration:false,ignorePiTags:false,transformTagName:false,transformAttributeName:false,updateTag:function(e,t,r){return e}};var odn=a(function(e){return Object.assign({},b_t,e)},"buildOptions");jSe.buildOptions=odn;jSe.defaultOptions=b_t});var C_t=y((nPs,A_t)=>{"use strict";var GSe=class{static{a(this,"XmlNode")}constructor(t){this.tagname=t;this.child=[];this[":@"]={}}add(t,r){if(t==="__proto__")t="#__proto__";this.child.push({[t]:r})}addChild(t){if(t.tagname==="__proto__")t.tagname="#__proto__";if(t[":@"]&&Object.keys(t[":@"]).length>0){this.child.push({[t.tagname]:t.child,[":@"]:t[":@"]})}else{this.child.push({[t.tagname]:t.child})}}};A_t.exports=GSe});var T_t=y((sPs,w_t)=>{var udn=sY();function ldn(e,t){const r={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let n=1;let i=false,s=false;let o="";for(;t<e.length;t++){if(e[t]==="<"&&!s){if(i&&pdn(e,t)){t+=7;[entityName,val,t]=cdn(e,t+1);if(val.indexOf("&")===-1)r[gdn(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(i&&fdn(e,t))t+=8;else if(i&&mdn(e,t))t+=8;else if(i&&hdn(e,t))t+=9;else if(ddn)s=true;else throw new Error("Invalid DOCTYPE");n++;o=""}else if(e[t]===">"){if(s){if(e[t-1]==="-"&&e[t-2]==="-"){s=false;n--}}else{n--}if(n===0){break}}else if(e[t]==="["){i=true}else{o+=e[t]}}if(n!==0){throw new Error(`Unclosed DOCTYPE`)}}else{throw new Error(`Invalid Tag instead of DOCTYPE`)}return{entities:r,i:t}}a(ldn,"readDocType");function cdn(e,t){let r="";for(;t<e.length&&(e[t]!=="'"&&e[t]!=='"');t++){r+=e[t]}r=r.trim();if(r.indexOf(" ")!==-1)throw new Error("External entites are not supported");const n=e[t++];let i="";for(;t<e.length&&e[t]!==n;t++){i+=e[t]}return[r,i,t]}a(cdn,"readEntityExp");function ddn(e,t){if(e[t+1]==="!"&&e[t+2]==="-"&&e[t+3]==="-")return true;return false}a(ddn,"isComment");function pdn(e,t){if(e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="N"&&e[t+4]==="T"&&e[t+5]==="I"&&e[t+6]==="T"&&e[t+7]==="Y")return true;return false}a(pdn,"isEntity");function fdn(e,t){if(e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="L"&&e[t+4]==="E"&&e[t+5]==="M"&&e[t+6]==="E"&&e[t+7]==="N"&&e[t+8]==="T")return true;return false}a(fdn,"isElement");function mdn(e,t){if(e[t+1]==="!"&&e[t+2]==="A"&&e[t+3]==="T"&&e[t+4]==="T"&&e[t+5]==="L"&&e[t+6]==="I"&&e[t+7]==="S"&&e[t+8]==="T")return true;return false}a(mdn,"isAttlist");function hdn(e,t){if(e[t+1]==="!"&&e[t+2]==="N"&&e[t+3]==="O"&&e[t+4]==="T"&&e[t+5]==="A"&&e[t+6]==="T"&&e[t+7]==="I"&&e[t+8]==="O"&&e[t+9]==="N")return true;return false}a(hdn,"isNotation");function gdn(e){if(udn.isName(e))return e;else throw new Error(`Invalid entity name ${e}`)}a(gdn,"validateEntityName");w_t.exports=ldn});var HSe=y((oPs,x_t)=>{var ydn=/^[-+]?0x[a-fA-F0-9]+$/;var _dn=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt){Number.parseInt=window.parseInt}if(!Number.parseFloat&&window.parseFloat){Number.parseFloat=window.parseFloat}var vdn={hex:true,leadingZeros:true,decimalPoint:".",eNotation:true};function Edn(e,t={}){t=Object.assign({},vdn,t);if(!e||typeof e!=="string")return e;let r=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(r))return e;else if(t.hex&&ydn.test(r)){return Number.parseInt(r,16)}else{const n=_dn.exec(r);if(n){const i=n[1];const s=n[2];let o=bdn(n[3]);const u=n[4]||n[6];if(!t.leadingZeros&&s.length>0&&i&&r[2]!==".")return e;else if(!t.leadingZeros&&s.length>0&&!i&&r[1]!==".")return e;else{const l=Number(r);const c=""+l;if(c.search(/[eE]/)!==-1){if(t.eNotation)return l;else return e}else if(u){if(t.eNotation)return l;else return e}else if(r.indexOf(".")!==-1){if(c==="0"&&o==="")return l;else if(c===o)return l;else if(i&&c==="-"+o)return l;else return e}if(s){if(o===c)return l;else if(i+o===c)return l;else return e}if(r===c)return l;else if(r===i+c)return l;return e}}else{return e}}}a(Edn,"toNumber");function bdn(e){if(e&&e.indexOf(".")!==-1){e=e.replace(/0+$/,"");if(e===".")e="0";else if(e[0]===".")e="0"+e;else if(e[e.length-1]===".")e=e.substr(0,e.length-1);return e}return e}a(bdn,"trimZeros");x_t.exports=Edn});var O_t=y((cPs,R_t)=>{"use strict";var WSe=sY();var _L=C_t();var Sdn=T_t();var Adn=HSe();var lPs="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,WSe.nameRegexp);var VSe=class{static{a(this,"OrderedObjParser")}constructor(t){this.options=t;this.currentNode=null;this.tagsNodeStack=[];this.docTypeEntities={};this.lastEntities={"apos":{regex:/&(apos|#39|#x27);/g,val:"'"},"gt":{regex:/&(gt|#62|#x3E);/g,val:">"},"lt":{regex:/&(lt|#60|#x3C);/g,val:"<"},"quot":{regex:/&(quot|#34|#x22);/g,val:'"'}};this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"};this.htmlEntities={"space":{regex:/&(nbsp|#160);/g,val:" "},"cent":{regex:/&(cent|#162);/g,val:"\xA2"},"pound":{regex:/&(pound|#163);/g,val:"\xA3"},"yen":{regex:/&(yen|#165);/g,val:"\xA5"},"euro":{regex:/&(euro|#8364);/g,val:"\u20AC"},"copyright":{regex:/&(copy|#169);/g,val:"\xA9"},"reg":{regex:/&(reg|#174);/g,val:"\xAE"},"inr":{regex:/&(inr|#8377);/g,val:"\u20B9"}};this.addExternalEntities=Cdn;this.parseXml=Odn;this.parseTextData=wdn;this.resolveNameSpace=Tdn;this.buildAttributesMap=Rdn;this.isItStopNode=kdn;this.replaceEntitiesValue=Ndn;this.readStopNodeData=Ldn;this.saveTextToParentTag=Idn;this.addChild=Pdn}};function Cdn(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}a(Cdn,"addExternalEntities");function wdn(e,t,r,n,i,s,o){if(e!==void 0){if(this.options.trimValues&&!n){e=e.trim()}if(e.length>0){if(!o)e=this.replaceEntitiesValue(e);const u=this.options.tagValueProcessor(t,e,r,i,s);if(u===null||u===void 0){return e}else if(typeof u!==typeof e||u!==e){return u}else if(this.options.trimValues){return KSe(e,this.options.parseTagValue,this.options.numberParseOptions)}else{const l=e.trim();if(l===e){return KSe(e,this.options.parseTagValue,this.options.numberParseOptions)}else{return e}}}}}a(wdn,"parseTextData");function Tdn(e){if(this.options.removeNSPrefix){const t=e.split(":");const r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns"){return""}if(t.length===2){e=r+t[1]}}return e}a(Tdn,"resolveNameSpace");var xdn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Rdn(e,t,r){if(!this.options.ignoreAttributes&&typeof e==="string"){const n=WSe.getAllMatches(e,xdn);const i=n.length;const s={};for(let o=0;o<i;o++){const u=this.resolveNameSpace(n[o][1]);let l=n[o][4];let c=this.options.attributeNamePrefix+u;if(u.length){if(this.options.transformAttributeName){c=this.options.transformAttributeName(c)}if(c==="__proto__")c="#__proto__";if(l!==void 0){if(this.options.trimValues){l=l.trim()}l=this.replaceEntitiesValue(l);const d=this.options.attributeValueProcessor(u,l,t);if(d===null||d===void 0){s[c]=l}else if(typeof d!==typeof l||d!==l){s[c]=d}else{s[c]=KSe(l,this.options.parseAttributeValue,this.options.numberParseOptions)}}else if(this.options.allowBooleanAttributes){s[c]=true}}}if(!Object.keys(s).length){return}if(this.options.attributesGroupName){const o={};o[this.options.attributesGroupName]=s;return o}return s}}a(Rdn,"buildAttributesMap");var Odn=a(function(e){e=e.replace(/\r\n?/g,"\n");const t=new _L("!xml");let r=t;let n="";let i="";for(let s=0;s<e.length;s++){const o=e[s];if(o==="<"){if(e[s+1]==="/"){const u=RA(e,">",s,"Closing Tag is not closed.");let l=e.substring(s+2,u).trim();if(this.options.removeNSPrefix){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1)}}if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r){n=this.saveTextToParentTag(n,r,i)}const c=i.substring(i.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1){throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`)}let d=0;if(c&&this.options.unpairedTags.indexOf(c)!==-1){d=i.lastIndexOf(".",i.lastIndexOf(".")-1);this.tagsNodeStack.pop()}else{d=i.lastIndexOf(".")}i=i.substring(0,d);r=this.tagsNodeStack.pop();n="";s=u}else if(e[s+1]==="?"){let u=zSe(e,s,false,"?>");if(!u)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,i);if(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags){}else{const l=new _L(u.tagName);l.add(this.options.textNodeName,"");if(u.tagName!==u.tagExp&&u.attrExpPresent){l[":@"]=this.buildAttributesMap(u.tagExp,i,u.tagName)}this.addChild(r,l,i)}s=u.closeIndex+1}else if(e.substr(s+1,3)==="!--"){const u=RA(e,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const l=e.substring(s+4,u-2);n=this.saveTextToParentTag(n,r,i);r.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}s=u}else if(e.substr(s+1,2)==="!D"){const u=Sdn(e,s);this.docTypeEntities=u.entities;s=u.i}else if(e.substr(s+1,2)==="!["){const u=RA(e,"]]>",s,"CDATA is not closed.")-2;const l=e.substring(s+9,u);n=this.saveTextToParentTag(n,r,i);if(this.options.cdataPropName){r.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}])}else{let c=this.parseTextData(l,r.tagname,i,true,false,true);if(c==void 0)c="";r.add(this.options.textNodeName,c)}s=u+2}else{let u=zSe(e,s,this.options.removeNSPrefix);let l=u.tagName;const c=u.rawTagName;let d=u.tagExp;let p=u.attrExpPresent;let f=u.closeIndex;if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r&&n){if(r.tagname!=="!xml"){n=this.saveTextToParentTag(n,r,i,false)}}const m=r;if(m&&this.options.unpairedTags.indexOf(m.tagname)!==-1){r=this.tagsNodeStack.pop();i=i.substring(0,i.lastIndexOf("."))}if(l!==t.tagname){i+=i?"."+l:l}if(this.isItStopNode(this.options.stopNodes,i,l)){let h="";if(d.length>0&&d.lastIndexOf("/")===d.length-1){s=u.closeIndex}else if(this.options.unpairedTags.indexOf(l)!==-1){s=u.closeIndex}else{const _=this.readStopNodeData(e,c,f+1);if(!_)throw new Error(`Unexpected end of ${c}`);s=_.i;h=_.tagContent}const g=new _L(l);if(l!==d&&p){g[":@"]=this.buildAttributesMap(d,i,l)}if(h){h=this.parseTextData(h,l,i,true,p,true,true)}i=i.substr(0,i.lastIndexOf("."));g.add(this.options.textNodeName,h);this.addChild(r,g,i)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){if(l[l.length-1]==="/"){l=l.substr(0,l.length-1);i=i.substr(0,i.length-1);d=l}else{d=d.substr(0,d.length-1)}if(this.options.transformTagName){l=this.options.transformTagName(l)}const h=new _L(l);if(l!==d&&p){h[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,h,i);i=i.substr(0,i.lastIndexOf("."))}else{const h=new _L(l);this.tagsNodeStack.push(r);if(l!==d&&p){h[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,h,i);r=h}n="";s=f}}}else{n+=e[s]}}return t.child},"parseXml");function Pdn(e,t,r){const n=this.options.updateTag(t.tagname,r,t[":@"]);if(n===false){}else if(typeof n==="string"){t.tagname=n;e.addChild(t)}else{e.addChild(t)}}a(Pdn,"addChild");var Ndn=a(function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){const r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities){for(let t in this.htmlEntities){const r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e},"replaceEntitiesValue");function Idn(e,t,r,n){if(e){if(n===void 0)n=Object.keys(t.child).length===0;e=this.parseTextData(e,t.tagname,r,false,t[":@"]?Object.keys(t[":@"]).length!==0:false,n);if(e!==void 0&&e!=="")t.add(this.options.textNodeName,e);e=""}return e}a(Idn,"saveTextToParentTag");function kdn(e,t,r){const n="*."+r;for(const i in e){const s=e[i];if(n===s||t===s)return true}return false}a(kdn,"isItStopNode");function Ddn(e,t,r=">"){let n;let i="";for(let s=t;s<e.length;s++){let o=e[s];if(n){if(o===n)n=""}else if(o==='"'||o==="'"){n=o}else if(o===r[0]){if(r[1]){if(e[s+1]===r[1]){return{data:i,index:s}}}else{return{data:i,index:s}}}else if(o===" "){o=" "}i+=o}}a(Ddn,"tagExpWithClosingIndex");function RA(e,t,r,n){const i=e.indexOf(t,r);if(i===-1){throw new Error(n)}else{return i+t.length-1}}a(RA,"findClosingIndex");function zSe(e,t,r,n=">"){const i=Ddn(e,t+1,n);if(!i)return;let s=i.data;const o=i.index;const u=s.search(/\s/);let l=s;let c=true;if(u!==-1){l=s.substr(0,u).replace(/\s\s*$/,"");s=s.substr(u+1)}const d=l;if(r){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1);c=l!==i.data.substr(p+1)}}return{tagName:l,tagExp:s,closeIndex:o,attrExpPresent:c,rawTagName:d}}a(zSe,"readTagExp");function Ldn(e,t,r){const n=r;let i=1;for(;r<e.length;r++){if(e[r]==="<"){if(e[r+1]==="/"){const s=RA(e,">",r,`${t} is not closed`);let o=e.substring(r+2,s).trim();if(o===t){i--;if(i===0){return{tagContent:e.substring(n,r),i:s}}}r=s}else if(e[r+1]==="?"){const s=RA(e,"?>",r+1,"StopNode is not closed.");r=s}else if(e.substr(r+1,3)==="!--"){const s=RA(e,"-->",r+3,"StopNode is not closed.");r=s}else if(e.substr(r+1,2)==="!["){const s=RA(e,"]]>",r,"StopNode is not closed.")-2;r=s}else{const s=zSe(e,r,">");if(s){const o=s&&s.tagName;if(o===t&&s.tagExp[s.tagExp.length-1]!=="/"){i++}r=s.closeIndex}}}}}a(Ldn,"readStopNodeData");function KSe(e,t,r){if(t&&typeof e==="string"){const n=e.trim();if(n==="true")return true;else if(n==="false")return false;else return Adn(e,r)}else{if(WSe.isExist(e)){return e}else{return""}}}a(KSe,"parseValue");R_t.exports=VSe});var I_t=y(N_t=>{"use strict";function Fdn(e,t){return P_t(e,t)}a(Fdn,"prettify");function P_t(e,t,r){let n;const i={};for(let s=0;s<e.length;s++){const o=e[s];const u=Bdn(o);let l="";if(r===void 0)l=u;else l=r+"."+u;if(u===t.textNodeName){if(n===void 0)n=o[u];else n+=""+o[u]}else if(u===void 0){continue}else if(o[u]){let c=P_t(o[u],t,l);const d=qdn(c,t);if(o[":@"]){Mdn(c,o[":@"],l,t)}else if(Object.keys(c).length===1&&c[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode){c=c[t.textNodeName]}else if(Object.keys(c).length===0){if(t.alwaysCreateTextNode)c[t.textNodeName]="";else c=""}if(i[u]!==void 0&&i.hasOwnProperty(u)){if(!Array.isArray(i[u])){i[u]=[i[u]]}i[u].push(c)}else{if(t.isArray(u,l,d)){i[u]=[c]}else{i[u]=c}}}}if(typeof n==="string"){if(n.length>0)i[t.textNodeName]=n}else if(n!==void 0)i[t.textNodeName]=n;return i}a(P_t,"compress");function Bdn(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];if(n!==":@")return n}}a(Bdn,"propName");function Mdn(e,t,r,n){if(t){const i=Object.keys(t);const s=i.length;for(let o=0;o<s;o++){const u=i[o];if(n.isArray(u,r+"."+u,true,true)){e[u]=[t[u]]}else{e[u]=t[u]}}}}a(Mdn,"assignAttributes");function qdn(e,t){const{textNodeName:r}=t;const n=Object.keys(e).length;if(n===0){return true}if(n===1&&(e[r]||typeof e[r]==="boolean"||e[r]===0)){return true}return false}a(qdn,"isLeafTag");N_t.prettify=Fdn});var D_t=y((mPs,k_t)=>{var{buildOptions:Udn}=S_t();var $dn=O_t();var{prettify:jdn}=I_t();var Gdn=$Se();var YSe=class{static{a(this,"XMLParser")}constructor(t){this.externalEntities={};this.options=Udn(t)}parse(t,r){if(typeof t==="string"){}else if(t.toString){t=t.toString()}else{throw new Error("XML data is accepted in String or Bytes[] form.")}if(r){if(r===true)r={};const s=Gdn.validate(t,r);if(s!==true){throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}}const n=new $dn(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);if(this.options.preserveOrder||i===void 0)return i;else return jdn(i,this.options)}addEntity(t,r){if(r.indexOf("&")!==-1){throw new Error("Entity value can't have '&'")}else if(t.indexOf("&")!==-1||t.indexOf(";")!==-1){throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'")}else if(r==="&"){throw new Error("An entity with value '&' is not permitted")}else{this.externalEntities[t]=r}}};k_t.exports=YSe});var q_t=y((gPs,M_t)=>{var Hdn="\n";function Vdn(e,t){let r="";if(t.format&&t.indentBy.length>0){r=Hdn}return F_t(e,t,"",r)}a(Vdn,"toXml");function F_t(e,t,r,n){let i="";let s=false;for(let o=0;o<e.length;o++){const u=e[o];const l=zdn(u);if(l===void 0)continue;let c="";if(r.length===0)c=l;else c=`${r}.${l}`;if(l===t.textNodeName){let h=u[l];if(!Kdn(c,t)){h=t.tagValueProcessor(l,h);h=B_t(h,t)}if(s){i+=n}i+=h;s=false;continue}else if(l===t.cdataPropName){if(s){i+=n}i+=`<![CDATA[${u[l][0][t.textNodeName]}]]>`;s=false;continue}else if(l===t.commentPropName){i+=n+`<!--${u[l][0][t.textNodeName]}-->`;s=true;continue}else if(l[0]==="?"){const h=L_t(u[":@"],t);const g=l==="?xml"?"":n;let _=u[l][0][t.textNodeName];_=_.length!==0?" "+_:"";i+=g+`<${l}${_}${h}?>`;s=true;continue}let d=n;if(d!==""){d+=t.indentBy}const p=L_t(u[":@"],t);const f=n+`<${l}${p}`;const m=F_t(u[l],t,c,d);if(t.unpairedTags.indexOf(l)!==-1){if(t.suppressUnpairedNode)i+=f+">";else i+=f+"/>"}else if((!m||m.length===0)&&t.suppressEmptyNode){i+=f+"/>"}else if(m&&m.endsWith(">")){i+=f+`>${m}${n}</${l}>`}else{i+=f+">";if(m&&n!==""&&(m.includes("/>")||m.includes("</"))){i+=n+t.indentBy+m+n}else{i+=m}i+=`</${l}>`}s=true}return i}a(F_t,"arrToStr");function zdn(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];if(!e.hasOwnProperty(n))continue;if(n!==":@")return n}}a(zdn,"propName");function L_t(e,t){let r="";if(e&&!t.ignoreAttributes){for(let n in e){if(!e.hasOwnProperty(n))continue;let i=t.attributeValueProcessor(n,e[n]);i=B_t(i,t);if(i===true&&t.suppressBooleanAttributes){r+=` ${n.substr(t.attributeNamePrefix.length)}`}else{r+=` ${n.substr(t.attributeNamePrefix.length)}="${i}"`}}}return r}a(L_t,"attr_to_str");function Kdn(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let r=e.substr(e.lastIndexOf(".")+1);for(let n in t.stopNodes){if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+r)return true}return false}a(Kdn,"isStopNode");function B_t(e,t){if(e&&e.length>0&&t.processEntities){for(let r=0;r<t.entities.length;r++){const n=t.entities[r];e=e.replace(n.regex,n.val)}}return e}a(B_t,"replaceEntitiesValue");M_t.exports=Vdn});var $_t=y((_Ps,U_t)=>{"use strict";var Wdn=q_t();var Ydn={attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,cdataPropName:false,format:false,indentBy:" ",suppressEmptyNode:false,suppressUnpairedNode:true,suppressBooleanAttributes:true,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:false,commentPropName:false,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:true,stopNodes:[],oneListGroup:false};function cE(e){this.options=Object.assign({},Ydn,e);if(this.options.ignoreAttributes||this.options.attributesGroupName){this.isAttribute=function(){return false}}else{this.attrPrefixLen=this.options.attributeNamePrefix.length;this.isAttribute=Qdn}this.processTextOrObjNode=Xdn;if(this.options.format){this.indentate=Jdn;this.tagEndChar=">\n";this.newLine="\n"}else{this.indentate=function(){return""};this.tagEndChar=">";this.newLine=""}}a(cE,"Builder");cE.prototype.build=function(e){if(this.options.preserveOrder){return Wdn(e,this.options)}else{if(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1){e={[this.options.arrayNodeName]:e}}return this.j2x(e,0).val}};cE.prototype.j2x=function(e,t){let r="";let n="";for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;if(typeof e[i]==="undefined"){if(this.isAttribute(i)){n+=""}}else if(e[i]===null){if(this.isAttribute(i)){n+=""}else if(i[0]==="?"){n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar}else{n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar}}else if(e[i]instanceof Date){n+=this.buildTextValNode(e[i],i,"",t)}else if(typeof e[i]!=="object"){const s=this.isAttribute(i);if(s){r+=this.buildAttrPairStr(s,""+e[i])}else{if(i===this.options.textNodeName){let o=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(o)}else{n+=this.buildTextValNode(e[i],i,"",t)}}}else if(Array.isArray(e[i])){const s=e[i].length;let o="";for(let u=0;u<s;u++){const l=e[i][u];if(typeof l==="undefined"){}else if(l===null){if(i[0]==="?")n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar;else n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar}else if(typeof l==="object"){if(this.options.oneListGroup){o+=this.j2x(l,t+1).val}else{o+=this.processTextOrObjNode(l,i,t)}}else{o+=this.buildTextValNode(l,i,"",t)}}if(this.options.oneListGroup){o=this.buildObjectNode(o,i,"",t)}n+=o}else{if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const s=Object.keys(e[i]);const o=s.length;for(let u=0;u<o;u++){r+=this.buildAttrPairStr(s[u],""+e[i][s[u]])}}else{n+=this.processTextOrObjNode(e[i],i,t)}}}return{attrStr:r,val:n}};cE.prototype.buildAttrPairStr=function(e,t){t=this.options.attributeValueProcessor(e,""+t);t=this.replaceEntitiesValue(t);if(this.options.suppressBooleanAttributes&&t==="true"){return" "+e}else return" "+e+'="'+t+'"'};function Xdn(e,t,r){const n=this.j2x(e,r+1);if(e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1){return this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r)}else{return this.buildObjectNode(n.val,t,n.attrStr,r)}}a(Xdn,"processTextOrObjNode");cE.prototype.buildObjectNode=function(e,t,r,n){if(e===""){if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;else{return this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar}}else{let i="</"+t+this.tagEndChar;let s="";if(t[0]==="?"){s="?";i=""}if((r||r==="")&&e.indexOf("<")===-1){return this.indentate(n)+"<"+t+r+s+">"+e+i}else if(this.options.commentPropName!==false&&t===this.options.commentPropName&&s.length===0){return this.indentate(n)+`<!--${e}-->`+this.newLine}else{return this.indentate(n)+"<"+t+r+s+this.tagEndChar+e+this.indentate(n)+i}}};cE.prototype.closeTag=function(e){let t="";if(this.options.unpairedTags.indexOf(e)!==-1){if(!this.options.suppressUnpairedNode)t="/"}else if(this.options.suppressEmptyNode){t="/"}else{t=`></${e}`}return t};cE.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==false&&t===this.options.cdataPropName){return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine}else if(this.options.commentPropName!==false&&t===this.options.commentPropName){return this.indentate(n)+`<!--${e}-->`+this.newLine}else if(t[0]==="?"){return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar}else{let i=this.options.tagValueProcessor(t,e);i=this.replaceEntitiesValue(i);if(i===""){return this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar}else{return this.indentate(n)+"<"+t+r+">"+i+"</"+t+this.tagEndChar}}};cE.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities){for(let t=0;t<this.options.entities.length;t++){const r=this.options.entities[t];e=e.replace(r.regex,r.val)}}return e};function Jdn(e){return this.options.indentBy.repeat(e)}a(Jdn,"indentate");function Qdn(e){if(e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName){return e.substr(this.attrPrefixLen)}else{return false}}a(Qdn,"isAttribute");U_t.exports=cE});var G_t=y((EPs,j_t)=>{"use strict";var Zdn=$Se();var epn=D_t();var tpn=$_t();j_t.exports={XMLParser:epn,XMLValidator:Zdn,XMLBuilder:tpn}});var W_t=y(Pl=>{"use strict";var rpn=Pl&&Pl.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var npn=Pl&&Pl.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var ipn=Pl&&Pl.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))rpn(t,e,r)}npn(t,e);return t};var OA=Pl&&Pl.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var K_t=Pl&&Pl.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};var my;var uY;var EL;Object.defineProperty(Pl,"__esModule",{value:true});Pl.TransferManager=Pl.MultiPartUploadError=void 0;var vL=K_t(mSe());var dE=ipn(require("path"));var aY=require("fs");var spn=dL();var apn=eW();var H_t=G_t();var oY=K_t(tL());var opn=require("crypto");var XSe=CA();var V_t=P0();var upn=VR();var lpn=(0,upn.getPackageJSON)();var cpn=5;var dpn=5;var ppn=5;var fpn=32*1024*1024;var mpn=32*1024*1024;var hpn=32*1024*1024;var z_t=5;var gpn="(?:)";var oO={UPLOAD_MANY:"tm.upload_many",DOWNLOAD_MANY:"tm.download_many",UPLOAD_SHARDED:"tm.upload_sharded",DOWNLOAD_SHARDED:"tm.download_sharded"};var ypn=a((e,t,r,n)=>{return new JSe(e,t,r,n)},"defaultMultiPartGenerator");var bL=class extends Error{static{a(this,"MultiPartUploadError")}constructor(t,r,n){super(t);this.uploadId=r;this.partsMap=n}};Pl.MultiPartUploadError=bL;var JSe=class{static{a(this,"XMLMultiPartUploadHelper")}constructor(t,r,n,i){my.add(this);this.authClient=t.storage.authClient||new apn.GoogleAuth;this.uploadId=n||"";this.bucket=t;this.fileName=r;this.baseUrl=`https://${t.name}.${new URL(this.bucket.storage.apiEndpoint).hostname}/${r}`;this.xmlBuilder=new H_t.XMLBuilder({arrayNodeName:"Part"});this.xmlParser=new H_t.XMLParser;this.partsMap=i||new Map;this.retryOptions={retries:this.bucket.storage.retryOptions.maxRetries,factor:this.bucket.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.bucket.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.bucket.storage.retryOptions.totalTimeout*1e3}}async initiateUpload(t={}){const r=`${this.baseUrl}?uploads`;return(0,oY.default)(async n=>{try{const i=await this.authClient.request({headers:OA(this,my,"m",uY).call(this,t),method:"POST",url:r});if(i.data&&i.data.error){throw i.data.error}const s=this.xmlParser.parse(i.data);this.uploadId=s.InitiateMultipartUploadResult.UploadId}catch(i){OA(this,my,"m",EL).call(this,i,n)}},this.retryOptions)}async uploadPart(t,r,n){const i=`${this.baseUrl}?partNumber=${t}&uploadId=${this.uploadId}`;let s=OA(this,my,"m",uY).call(this);if(n==="md5"){const o=(0,opn.createHash)("md5").update(r).digest("base64");s={"Content-MD5":o}}return(0,oY.default)(async o=>{try{const u=await this.authClient.request({url:i,method:"PUT",body:r,headers:s});if(u.data&&u.data.error){throw u.data.error}this.partsMap.set(t,u.headers["etag"])}catch(u){OA(this,my,"m",EL).call(this,u,o)}},this.retryOptions)}async completeUpload(){const t=`${this.baseUrl}?uploadId=${this.uploadId}`;const r=new Map([...this.partsMap.entries()].sort((s,o)=>s[0]-o[0]));const n=[];for(const s of r.entries()){n.push({PartNumber:s[0],ETag:s[1]})}const i=`<CompleteMultipartUpload>${this.xmlBuilder.build(n)}</CompleteMultipartUpload>`;return(0,oY.default)(async s=>{try{const o=await this.authClient.request({headers:OA(this,my,"m",uY).call(this),url:t,method:"POST",body:i});if(o.data&&o.data.error){throw o.data.error}return o}catch(o){OA(this,my,"m",EL).call(this,o,s);return}},this.retryOptions)}async abortUpload(){const t=`${this.baseUrl}?uploadId=${this.uploadId}`;return(0,oY.default)(async r=>{try{const n=await this.authClient.request({url:t,method:"DELETE"});if(n.data&&n.data.error){throw n.data.error}}catch(n){OA(this,my,"m",EL).call(this,n,r);return}},this.retryOptions)}};my=new WeakSet,uY=a(function e(t={}){let r=false;let n=false;for(const[i,s]of Object.entries(t)){if(i.toLocaleLowerCase().trim()==="x-goog-api-client"){r=true;if(!s.includes(oO.UPLOAD_SHARDED)){t[i]=`${s} gccl-gcs-cmd/${oO.UPLOAD_SHARDED}`}}else if(i.toLocaleLowerCase().trim()==="user-agent"){n=true}}if(!r){t["x-goog-api-client"]=`${(0,V_t.getRuntimeTrackingString)()} gccl/${lpn.version} gccl-gcs-cmd/${oO.UPLOAD_SHARDED}`}if(!n){t["User-Agent"]=(0,V_t.getUserAgentString)()}return t},"_XMLMultiPartUploadHelper_setGoogApiClientHeaders"),EL=a(function e(t,r){if(this.bucket.storage.retryOptions.autoRetry&&this.bucket.storage.retryOptions.retryableErrorFn(t)){throw t}else{r(t)}},"_XMLMultiPartUploadHelper_handleErrorResponse");var QSe=class{static{a(this,"TransferManager")}constructor(t){this.bucket=t}async uploadManyFiles(t,r={}){var n;if(r.skipIfExists&&((n=r.passthroughOptions)===null||n===void 0?void 0:n.preconditionOpts)){r.passthroughOptions.preconditionOpts.ifGenerationMatch=0}else if(r.skipIfExists&&r.passthroughOptions===void 0){r.passthroughOptions={preconditionOpts:{ifGenerationMatch:0}}}const i=(0,vL.default)(r.concurrencyLimit||cpn);const s=[];let o=[];if(!Array.isArray(t)){for await(const u of this.getPathsFromDirectory(t)){o.push(u)}}else{o=t}for(const u of o){const l=await aY.promises.lstat(u);if(l.isDirectory()){continue}const c={...r.passthroughOptions,[XSe.GCCL_GCS_CMD_KEY]:oO.UPLOAD_MANY};c.destination=u.split(dE.sep).join(dE.posix.sep);if(r.prefix){c.destination=dE.posix.join(...r.prefix.split(dE.sep),c.destination)}s.push(i(()=>this.bucket.upload(u,c)))}return Promise.all(s)}async downloadManyFiles(t,r={}){const n=(0,vL.default)(r.concurrencyLimit||dpn);const i=[];let s=[];if(!Array.isArray(t)){const l=await this.bucket.getFiles({prefix:t});s=l[0]}else{s=t.map(l=>{if(typeof l==="string"){return this.bucket.file(l)}return l})}const o=r.stripPrefix?`^${r.stripPrefix}`:gpn;const u=new RegExp(o,"g");for(const l of s){const c={...r.passthroughOptions,[XSe.GCCL_GCS_CMD_KEY]:oO.DOWNLOAD_MANY};if(r.prefix){c.destination=dE.join(r.prefix||"",c.destination||"",l.name)}if(r.stripPrefix){c.destination=l.name.replace(u,"")}i.push(n(()=>l.download(c)))}return Promise.all(i)}async downloadFileInChunks(t,r={}){let n=r.chunkSizeBytes||mpn;let i=(0,vL.default)(r.concurrencyLimit||ppn);const s=[];const o=typeof t==="string"?this.bucket.file(t):t;const u=await o.get();const l=parseInt(u[0].metadata.size.toString());if(l<fpn){i=(0,vL.default)(1);n=l}let c=0;const d=r.destination||dE.basename(o.name);const p=await aY.promises.open(d,"w");while(c<l){const m=c;let h=c+n-1;h=h>l?l:h;s.push(i(async()=>{const g=await o.download({start:m,end:h,[XSe.GCCL_GCS_CMD_KEY]:oO.DOWNLOAD_SHARDED});return p.write(g[0],0,g[0].length,m)}));c+=n}let f;try{const m=await Promise.all(s);f=m.map(h=>h.buffer);if(r.validation==="crc32c"){await spn.CRC32C.fromFile(d)}return f}finally{p.close()}}async uploadFileInChunks(t,r={},n=ypn){const i=r.chunkSizeBytes||hpn;const s=(0,vL.default)(r.concurrencyLimit||z_t);const o=r.maxQueueSize||r.concurrencyLimit||z_t;const u=r.uploadName||dE.basename(t);const l=n(this.bucket,u,r.uploadId,r.partsMap);let c=1;let d=[];try{if(r.uploadId===void 0){await l.initiateUpload(r.headers)}const p=l.partsMap.size*i;const f=(0,aY.createReadStream)(t,{highWaterMark:i,start:p});for await(const m of f){if(d.length>=o){await Promise.all(d);d=[]}d.push(s(()=>l.uploadPart(c++,m,r.validation)))}await Promise.all(d);return await l.completeUpload()}catch(p){if((r.autoAbortFailure===void 0||r.autoAbortFailure)&&l.uploadId){try{await l.abortUpload();return}catch(f){throw new bL(f.message,l.uploadId,l.partsMap)}}throw new bL(p.message,l.uploadId,l.partsMap)}}async*getPathsFromDirectory(t){const r=await aY.promises.readdir(t,{withFileTypes:true});for(const n of r){const i=dE.join(t,n.name);n.isDirectory()?yield*this.getPathsFromDirectory(i):yield i}}};Pl.TransferManager=QSe});var X_t=y(Gs=>{"use strict";var _pn=Gs&&Gs.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var ZSe=Gs&&Gs.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))_pn(t,e,r)};Object.defineProperty(Gs,"__esModule",{value:true});Gs.Notification=Gs.Iam=Gs.HmacKey=Gs.File=Gs.Channel=Gs.Bucket=Gs.Storage=Gs.IdempotencyStrategy=Gs.ApiError=void 0;var vpn=tE();Object.defineProperty(Gs,"ApiError",{enumerable:true,get:function(){return vpn.ApiError}});var Y_t=tO();Object.defineProperty(Gs,"IdempotencyStrategy",{enumerable:true,get:function(){return Y_t.IdempotencyStrategy}});Object.defineProperty(Gs,"Storage",{enumerable:true,get:function(){return Y_t.Storage}});var Epn=WW();Object.defineProperty(Gs,"Bucket",{enumerable:true,get:function(){return Epn.Bucket}});ZSe(dL(),Gs);var bpn=FSe();Object.defineProperty(Gs,"Channel",{enumerable:true,get:function(){return bpn.Channel}});var Spn=pL();Object.defineProperty(Gs,"File",{enumerable:true,get:function(){return Spn.File}});ZSe(TSe(),Gs);var Apn=BSe();Object.defineProperty(Gs,"HmacKey",{enumerable:true,get:function(){return Apn.HmacKey}});var Cpn=NSe();Object.defineProperty(Gs,"Iam",{enumerable:true,get:function(){return Cpn.Iam}});var wpn=ISe();Object.defineProperty(Gs,"Notification",{enumerable:true,get:function(){return wpn.Notification}});ZSe(W_t(),Gs)});var tAe=y(_i=>{"use strict";var eAe=_i&&_i.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(_i,"__esModule",{value:true});_i.deleteFolder=_i.untar=_i.tarFolderContent=_i.getParentDirFilename=_i.safePath=_i.UnsafePathError=_i.ensureDirectoryExists=_i.mkdirForFilePathIfNotExits=_i.mkdirIfNotExists=_i.listFolderContents=_i.listFolders=_i.isNotFileOrDirectory=_i.dirExists=_i.deleteFile=_i.fileExists=void 0;var J_t=eAe(require("child_process"));var fE=eAe(require("fs/promises"));var pE=eAe(require("path"));var Q_t=[".git","node_modules",".yarn",".DS_Store"];async function Tpn(e){try{const t=await fE.default.stat(e);return t.isFile()}catch(t){return false}}a(Tpn,"fileExists");_i.fileExists=Tpn;async function xpn(e,t){return await fE.default.rm(e,t)}a(xpn,"deleteFile");_i.deleteFile=xpn;async function cY(e){try{const t=await fE.default.stat(e);return t.isDirectory()}catch(t){return false}}a(cY,"dirExists");_i.dirExists=cY;async function Rpn(e){try{await fE.default.stat(e);return false}catch(t){return true}}a(Rpn,"isNotFileOrDirectory");_i.isNotFileOrDirectory=Rpn;function Opn(e,t){const r=new RegExp(`(.*)(\\/${t})$|(.*)(${t}\\/)`);const n=e.match(r);if(!n){return""}const i=e.split(n[0]);return i[1]===""?"":`/${i[1]}`}a(Opn,"getParentDirectory");async function Ppn(e){if(!await cY(e)){return[]}const t=await fE.default.readdir(e,{withFileTypes:true});const r=[];for await(const n of t){if(!Q_t.includes(n.name)){if(n.isDirectory()){r.push(n.name)}}}return r}a(Ppn,"listFolders");_i.listFolders=Ppn;async function Z_t(e,t,r=true){const n=Opn(e,t);const i=await fE.default.readdir(e,{withFileTypes:true});const s=[];for await(const o of i){if(!Q_t.includes(o.name)||!r){if(o.isDirectory()){const u=await Z_t(pE.default.join(e,o.name),t,r);s.push(...u)}else{s.push(pE.default.join(n,o.name))}}}return s}a(Z_t,"listFolderContents");_i.listFolderContents=Z_t;var Npn=a(async e=>{if(await cY(e)){return true}await fE.default.mkdir(e,{recursive:true})},"mkdirIfNotExists");_i.mkdirIfNotExists=Npn;var Ipn=a(async e=>{const t=pE.default.dirname(e);return(0,_i.mkdirIfNotExists)(t)},"mkdirForFilePathIfNotExits");_i.mkdirForFilePathIfNotExits=Ipn;_i.ensureDirectoryExists=_i.mkdirForFilePathIfNotExits;var lY=class extends Error{static{a(this,"UnsafePathError")}constructor(t){super(t)}};_i.UnsafePathError=lY;function kpn(e){const t=a(r=>{if(!r.startsWith(e)){throw new lY(`Resolved path is not part of the project.`)}return r},"ensureSafePath");return{resolve:(...r)=>t(pE.default.resolve(...r))}}a(kpn,"safePath");_i.safePath=kpn;function Dpn(e){return`${pE.default.basename(pE.default.dirname(e))}/${pE.default.basename(e)}`}a(Dpn,"getParentDirFilename");_i.getParentDirFilename=Dpn;function Lpn(e,t,r,n){const i=pE.default.join(n,r);J_t.default.execSync(`tar --exclude='.git/' --exclude='dist/' -czf ${i} ${t}`,{cwd:e});return i}a(Lpn,"tarFolderContent");_i.tarFolderContent=Lpn;function Fpn(e,t,r,n=false){J_t.default.execSync(`tar -xf ${t} ${n?"--strip-components=1 ":""}-C ${r}`,{cwd:e})}a(Fpn,"untar");_i.untar=Fpn;async function Bpn(e){if(await cY(e)){return await fE.default.rm(e,{recursive:true})}}a(Bpn,"deleteFolder");_i.deleteFolder=Bpn});var ivt=y(ti=>{"use strict";var Mpn=ti&&ti.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var qpn=ti&&ti.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var Upn=ti&&ti.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Mpn(t,e,r)}qpn(t,e);return t};var evt=ti&&ti.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ti,"__esModule",{value:true});ti.uploadFolderAndRemoveMissingSourceFiles=ti.cleanGCPFilePaths=ti.uploadFolder=ti.deleteDirectory=ti.deleteFile=ti.listFolderContent=ti.readFileStream=ti.fileExists=ti.getFileContents=ti.downloadFile=ti.uploadFromMemory=ti.uploadFile=ti.getBucket=ti.BucketName=void 0;var $pn=X_t();var hy=evt(require("path"));var B0=evt(Zd());var dY=Upn(tAe());var PA;(function(e){e[e["Archive"]=0]="Archive";e[e["Bundle"]=1]="Bundle";e[e["SourceCode"]=2]="SourceCode";e[e["Sources"]=3]="Sources";e[e["DevPortalBuild"]=4]="DevPortalBuild"})(PA||(ti.BucketName=PA={}));function M0(e){let t;if(e===PA.Archive){if(B0.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_ARCHIVE_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME}else if(e===PA.Bundle){if(B0.default.GCP_STORAGE_BUNDLE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_BUNDLE_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_BUNDLE_BUCKET_NAME}else if(e===PA.SourceCode){if(B0.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCE_CODE_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}else if(e===PA.Sources){if(B0.default.GCP_STORAGE_SOURCES_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCES_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_SOURCES_BUCKET_NAME}else if(e===PA.DevPortalBuild){if(B0.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}else{throw new Error("Invalid value for argument 'bucketName'")}const r=new $pn.Storage;return r.bucket(t)}a(M0,"getBucket");ti.getBucket=M0;async function rAe(e,t,r,n,i){try{await M0(e).upload(t,{destination:r,metadata:i})}catch(s){n.info(`File upload for ${e}/${r} ran into an issue`);n.error(s)}}a(rAe,"uploadFile");ti.uploadFile=rAe;async function jpn(e,t,r,n,i){try{await M0(e).file(r).save(t,i)}catch(s){n.info(`From Memory upload for ${e}/${r} ran into an issue`);n.error(s)}}a(jpn,"uploadFromMemory");ti.uploadFromMemory=jpn;async function Gpn(e,t,r,n){try{const i={destination:r};await M0(e).file(t).download(i);n.info(`File ${e}/${t} successfully downloaded to ${r}`)}catch(i){n.info(`Downloading file ${e}/${t} ran into an issue`);n.error(i)}}a(Gpn,"downloadFile");ti.downloadFile=Gpn;async function Hpn(e,t,r){try{const n=await M0(e).file(t).download();r.info(`File ${e}/${t} successfully downloaded to memory`);return n.toString()}catch(n){r.info(`Downloading file ${e}/${t} ran into an issue`);r.error(n)}}a(Hpn,"getFileContents");ti.getFileContents=Hpn;async function Vpn(e,t,r){try{r.info(`Check if file ${e}/${t} exists in storage`);const n=await M0(e).file(t).exists();return n[0]}catch(n){r.info(`Ran into an issue while checking if a file ${e}/${t} exists in storage`);r.error(n);return false}}a(Vpn,"fileExists");ti.fileExists=Vpn;function zpn(e,t,r){r.info(`Reading file ${e}/${t} from storage`);return M0(e).file(t).createReadStream({decompress:true})}a(zpn,"readFileStream");ti.readFileStream=zpn;async function tvt(e,t,r){const n=new Set;try{const[i]=await M0(e).getFiles({prefix:t});for(let s=0;s<i.length;s++){const o=i[s];const u=o.name.replace(t,"");if(u===""){continue}const l=u.split("/");if(l.length>1){for(let c=0;c<l.length-1;c++){const d=`/${l[c]}`;if(!n.has(d)){n.add(d)}}}n.add(`/${u}`)}}catch(i){r.info(`Ran into an issue while listing files in ${e}/${t} storage path`);r.error(i)}return[...n]}a(tvt,"listFolderContent");ti.listFolderContent=tvt;async function rvt(e,t,r){try{r.info(`Deleting file ${e}/${t} from storage`);await M0(e).file(t).delete()}catch(n){r.warn(`Failed to delete file ${e}/${t} from storage`);r.error(n)}}a(rvt,"deleteFile");ti.deleteFile=rvt;async function Kpn(e,t,r){try{r.info(`Deleting directory ${e}/${t} from storage`);await M0(e).deleteFiles({prefix:t})}catch(n){r.info(`Failed to delete directory ${e}/${t} from storage`);r.error(n)}}a(Kpn,"deleteDirectory");ti.deleteDirectory=Kpn;async function Wpn(e,t,r,n,i){try{n.info(`Upload folder ${hy.default.basename(t)}`);if(await dY.dirExists(t)){const s=await dY.listFolderContents(t,hy.default.basename(t));if(s&&s.length>0){await Promise.all(s.map(async o=>{return await rAe(e,hy.default.join(t,o),hy.default.join(r,o),n,i)}))}}}catch(s){n.warn(`Failed to upload directory ${t} to bucket ${e}`,s)}}a(Wpn,"uploadFolder");ti.uploadFolder=Wpn;function nvt(e){const t=e.filter(r=>r!=="/").map(r=>r.replace(/^\/+/,""));return t}a(nvt,"cleanGCPFilePaths");ti.cleanGCPFilePaths=nvt;async function Ypn(e,t,r,n,i){try{n.info(`uploadFolderAndRemoveMissingSourceFiles: upload folder ${hy.default.basename(t)}`);if(await dY.dirExists(t)){const s=await tvt(e,r,n);const o=nvt(s);const u=await dY.listFolderContents(t,hy.default.basename(t));const l=o.filter(c=>!u.includes(c)).map(c=>hy.default.join(r,c));await Promise.all(l.map(async c=>{return await rvt(e,c,n)}));await Promise.all(u.map(async c=>{return await rAe(e,hy.default.join(t,c),hy.default.join(r,c),n,i)}))}}catch(s){n.warn(`Failed to upload directory ${t} to bucket ${e}`,s)}}a(Ypn,"uploadFolderAndRemoveMissingSourceFiles");ti.uploadFolderAndRemoveMissingSourceFiles=Ypn});var svt=y(pY=>{"use strict";Object.defineProperty(pY,"__esModule",{value:true});pY.graphQL=void 0;var q0=ac();async function Xpn(e,t,r){const n=await fetch(`https://api.github.com/graphql`,{method:"POST",headers:{Authorization:`Bearer ${t}`},body:e});if(n.status===401){r.warn("Failed GitHub GraphQL query with status 401. User token might have been revoked directly in GitHub.");throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS)}if(n.status===403){r.warn("Failed GitHub GraphQL query with status 403. User token does not have correct permissions to query this GitHub API.");throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===404){r.warn("Failed GitHub GraphQL query with status 404. User token has been revoked and can not query this GitHub API.");throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===400){const i=await n.json();r.warn("Failed GitHub GraphQL query with status 400. A malformed query was ran against the GitHub API.",i);throw new q0.ApiError(q0.Problems.BAD_REQUEST)}if(n.status!==200&&n.status!==304){r.warn(`Failed GitHub GraphQL query with status ${n.status}. There was an unexpected error querying the GitHub API.`);throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}return n}a(Xpn,"graphQL");pY.graphQL=Xpn});var dvt=y(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:true});Ef.SourceControlProvider=Ef.PlanType=Ef.EnvironmentType=Ef.EnvironmentTarget=Ef.DeploymentState=void 0;var avt;(function(e){e[e["IS_STARTING"]=0]="IS_STARTING";e[e["STARTED"]=1]="STARTED";e[e["STOPPED"]=2]="STOPPED";e[e["ERRORED"]=3]="ERRORED"})(avt||(Ef.DeploymentState=avt={}));var ovt;(function(e){e["CLOUDFLARE"]="CLOUDFLARE";e["KNATIVE"]="KNATIVE"})(ovt||(Ef.EnvironmentTarget=ovt={}));var uvt;(function(e){e["PRODUCTION"]="PRODUCTION";e["PREVIEW"]="PREVIEW";e["WORKING_COPY"]="WORKING_COPY"})(uvt||(Ef.EnvironmentType=uvt={}));var lvt;(function(e){e["FREE_V1"]="FREE_V1";e["BUILDER_V1"]="BUILDER_V1";e["BUSINESS_V1"]="BUSINESS_V1";e["CUSTOM"]="CUSTOM";e["EMPLOYEE"]="EMPLOYEE";e["CUSTOM_TRIAL_V1"]="CUSTOM_TRIAL_V1"})(lvt||(Ef.PlanType=lvt={}));var cvt;(function(e){e["GITHUB"]="GITHUB";e["GITLAB"]="GITLAB";e["BITBUCKET"]="BITBUCKET"})(cvt||(Ef.SourceControlProvider=cvt={}))});var fvt=y(pvt=>{"use strict";Object.defineProperty(pvt,"__esModule",{value:true})});var mvt=y(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:true});bf.INTERNAL_ROUTE_VENDOR_TAG=bf.ZUPLO_OPEN_API_ROUTE_KEY=bf.ZUPLO_OPEN_API_PATH_KEY=bf.ZUPLO_OPEN_API_VENDOR_PREFIX=void 0;bf.ZUPLO_OPEN_API_VENDOR_PREFIX="x-zuplo";bf.ZUPLO_OPEN_API_PATH_KEY=`${bf.ZUPLO_OPEN_API_VENDOR_PREFIX}-path`;bf.ZUPLO_OPEN_API_ROUTE_KEY=`${bf.ZUPLO_OPEN_API_VENDOR_PREFIX}-route`;bf.INTERNAL_ROUTE_VENDOR_TAG="x-internal"});var hvt=y((kPs,Jpn)=>{Jpn.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/dev-portal.json",title:"Dev Portal Config",description:"",type:"object",required:[],additionalProperties:false,$defs:{ApiKeysConfig:{type:"object",additionalProperties:false,required:["bucketName"],properties:{bucketName:{type:"string"},apiKey:{type:"string"}}},DevPortalOAuthClientConfig:{type:"object",additionalProperties:false,required:["clientId"],properties:{clientId:{type:"string"},audience:{type:"string",description:"The audience of the API (i.e. the Zup's URL)\nOkta: not required\nAuth0: https://my-api.example.com/"}}},DevPortalOAuthClientCredentialsConfig:{type:"object",description:"This is the M2M configuration used to authenticate with OAuth provider in order to manage OAuth clients",required:["clientId","clientSecret"],additionalProperties:false,properties:{clientId:{type:"string"},clientSecret:{type:"string"}}},DevPortalAPIKeyCredentialConfig:{type:"object",description:"API Key credentials to access identity provider API",required:["apiKey"],additionalProperties:false,properties:{apiKey:{type:"string"}}},DevPortalOAuthConfig:{type:"object",description:"Settings for OAuth that is used to authenticate end-users to the developer portal and (optionally) for configuring issuing of OAuth Client Consumers using the identity provider",required:["provider","authority","jwksUrl"],additionalProperties:false,properties:{provider:{type:"string",enum:["okta","auth0","azure-ad","clerk","oidc"]},authority:{type:"string",description:"This is the full URL of the authorization server.\nOkta: https://dev-1235.okta.com/oauth2/aus123152352342\nAuth0: https://my-account.us.auth0.com\nAzure Active Directory: https://login.microsoftonline.com/{tenant}/v2.0\nClerk: https://your-account-23.clerk.accounts.dev"},jwksUrl:{type:"string",description:"The url of of the JWKS"},devPortalClient:{description:"This is the client that is used to authenticate end-users to the Zuplo developer portal",$ref:"#/$defs/DevPortalOAuthClientConfig"},managementClient:{oneOf:[{$ref:"#/$defs/DevPortalOAuthClientCredentialsConfig"},{$ref:"#/$defs/DevPortalAPIKeyCredentialConfig"}]}}},DevPortalExternalAuthConfig:{type:"object",description:"Settings for external auth that is used to authenticate end-users to the developer portal",additionalProperties:false,required:["loginUrl","provider","logoutUrl"],properties:{provider:{type:"string",enum:["external"]},loginUrl:{type:"string",description:"The URL of your external login page"},logoutUrl:{type:"string",description:"The URL of your external logout endpoint"}}},DevPortalAuthConfig:{type:"object",oneOf:[{$ref:"#/$defs/DevPortalOAuthConfig"},{$ref:"#/$defs/DevPortalExternalAuthConfig"}]},DevPortalMonetizationConfig:{type:"object",description:"Settings for monetization features like self-serve checkout and subscription management",oneOf:[{$ref:"#/$defs/DevPortalStripeMonetizationConfig"}]},DevPortalStripeMonetizationConfig:{type:"object",description:"Settings used to configure Stripe for monetization features like self-serve checkout and subscription management",additionalProperties:false,required:["provider","publishableKey","pricingTableId","secretKey"],properties:{provider:{type:"string",enum:["stripe"]},publishableKey:{type:"string",description:"Your Stripe publishable key - found under Developers > API keys > Standard keys"},secretKey:{type:"string",description:"Your Stripe secret key - found under Developers > API keys > Standard keys"},pricingTableId:{type:"string",description:"The ID of the pricing table that will be used to display pricing information to end-users"},meteringBucketId:{type:"string",description:"The ID of the metering bucket that will be used to track usage of the API"}}}},properties:{$schema:{type:"string"},enabled:{description:"If the developer portal is enabled",type:"boolean",default:true},authentication:{description:"Authentication configuration",$ref:"#/$defs/DevPortalAuthConfig"},monetization:{description:"Monetization configuration",$ref:"#/$defs/DevPortalMonetizationConfig"},sitePathname:{type:"string",default:"/docs"},faviconUrl:{type:"string",description:"The favicon url"},pageTitle:{type:"string",description:"The default page title"},enableAuthentication:{type:"boolean",description:"If sign in to the developer portal is enabled."},enableMonetization:{type:"boolean",description:"If monetization features like self-serve checkout and subscription management are enabled."},requireAuthentication:{type:"boolean",default:false,description:"If authentication is required to access the developer portal. If false, the developer portal will be publicly accessible."},authorizePathname:{type:"string",default:"/oauth/authorize",description:"The path that starts the OAuth flow for third-party-apps"},apiKeys:{description:"Api Keys Service Configuration",$ref:"#/$defs/ApiKeysConfig"},generateExamples:{type:"boolean",default:true,description:"If false, the developer portal will no longer generate examples for endpoints that do not have examples defined"}}}});var CL=y(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:true});Ji.regexpCode=Ji.getEsmExportName=Ji.getProperty=Ji.safeStringify=Ji.stringify=Ji.strConcat=Ji.addCodeArg=Ji.str=Ji._=Ji.nil=Ji._Code=Ji.Name=Ji.IDENTIFIER=Ji._CodeOrName=void 0;var SL=class{static{a(this,"_CodeOrName")}};Ji._CodeOrName=SL;Ji.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var NA=class extends SL{static{a(this,"Name")}constructor(t){super();if(!Ji.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}};Ji.Name=NA;var Sf=class extends SL{static{a(this,"_Code")}constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>{if(n instanceof NA)r[n.str]=(r[n.str]||0)+1;return r},{})}};Ji._Code=Sf;Ji.nil=new Sf("");function gvt(e,...t){const r=[e[0]];let n=0;while(n<t.length){iAe(r,t[n]);r.push(e[++n])}return new Sf(r)}a(gvt,"_");Ji._=gvt;var nAe=new Sf("+");function yvt(e,...t){const r=[AL(e[0])];let n=0;while(n<t.length){r.push(nAe);iAe(r,t[n]);r.push(nAe,AL(e[++n]))}Qpn(r);return new Sf(r)}a(yvt,"str");Ji.str=yvt;function iAe(e,t){if(t instanceof Sf)e.push(...t._items);else if(t instanceof NA)e.push(t);else e.push(tfn(t))}a(iAe,"addCodeArg");Ji.addCodeArg=iAe;function Qpn(e){let t=1;while(t<e.length-1){if(e[t]===nAe){const r=Zpn(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}a(Qpn,"optimize");function Zpn(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof NA||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof NA))return`"${e}${t.slice(1)}`;return}a(Zpn,"mergeExprItems");function efn(e,t){return t.emptyStr()?e:e.emptyStr()?t:yvt`${e}${t}`}a(efn,"strConcat");Ji.strConcat=efn;function tfn(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:AL(Array.isArray(e)?e.join(","):e)}a(tfn,"interpolate");function rfn(e){return new Sf(AL(e))}a(rfn,"stringify");Ji.stringify=rfn;function AL(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}a(AL,"safeStringify");Ji.safeStringify=AL;function nfn(e){return typeof e=="string"&&Ji.IDENTIFIER.test(e)?new Sf(`.${e}`):gvt`[${e}]`}a(nfn,"getProperty");Ji.getProperty=nfn;function ifn(e){if(typeof e=="string"&&Ji.IDENTIFIER.test(e)){return new Sf(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}a(ifn,"getEsmExportName");Ji.getEsmExportName=ifn;function sfn(e){return new Sf(e.toString())}a(sfn,"regexpCode");Ji.regexpCode=sfn});var uAe=y(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:true});vc.ValueScope=vc.ValueScopeName=vc.Scope=vc.varKinds=vc.UsedValueState=void 0;var dd=CL();var sAe=class extends Error{static{a(this,"ValueError")}constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}};var aAe;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(aAe=vc.UsedValueState||(vc.UsedValueState={}));vc.varKinds={const:new dd.Name("const"),let:new dd.Name("let"),var:new dd.Name("var")};var fY=class{static{a(this,"Scope")}constructor({prefixes:t,parent:r}={}){this._names={};this._prefixes=t;this._parent=r}toName(t){return t instanceof dd.Name?t:this.name(t)}name(t){return new dd.Name(this._newName(t))}_newName(t){const r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0?void 0:n.has(t))||this._prefixes&&!this._prefixes.has(t)){throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`)}return this._names[t]={prefix:t,index:0}}};vc.Scope=fY;var mY=class extends dd.Name{static{a(this,"ValueScopeName")}constructor(t,r){super(r);this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t;this.scopePath=(0,dd._)`.${new dd.Name(r)}[${n}]`}};vc.ValueScopeName=mY;var afn=(0,dd._)`\n`;var oAe=class extends fY{static{a(this,"ValueScope")}constructor(t){super(t);this._values={};this._scope=t.scope;this.opts={...t,_n:t.lines?afn:dd.nil}}get(){return this._scope}name(t){return new mY(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(t);const{prefix:s}=i;const o=(n=r.key)!==null&&n!==void 0?n:r.ref;let u=this._values[s];if(u){const d=u.get(o);if(d)return d}else{u=this._values[s]=new Map}u.set(o,i);const l=this._scope[s]||(this._scope[s]=[]);const c=l.length;l[c]=r.ref;i.setValue(r,{property:s,itemIndex:c});return i}getValue(t,r){const n=this._values[t];if(!n)return;return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,dd._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let s=dd.nil;for(const o in t){const u=t[o];if(!u)continue;const l=n[o]=n[o]||new Map;u.forEach(c=>{if(l.has(c))return;l.set(c,aAe.Started);let d=r(c);if(d){const p=this.opts.es5?vc.varKinds.var:vc.varKinds.const;s=(0,dd._)`${s}${p} ${c} = ${d};${this.opts._n}`}else if(d=i===null||i===void 0?void 0:i(c)){s=(0,dd._)`${s}${d}${this.opts._n}`}else{throw new sAe(c)}l.set(c,aAe.Completed)})}return s}};vc.ValueScope=oAe});var En=y(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:true});Vn.or=Vn.and=Vn.not=Vn.CodeGen=Vn.operators=Vn.varKinds=Vn.ValueScopeName=Vn.ValueScope=Vn.Scope=Vn.Name=Vn.regexpCode=Vn.stringify=Vn.getProperty=Vn.nil=Vn.strConcat=Vn.str=Vn._=void 0;var Ti=CL();var sh=uAe();var mE=CL();Object.defineProperty(Vn,"_",{enumerable:true,get:function(){return mE._}});Object.defineProperty(Vn,"str",{enumerable:true,get:function(){return mE.str}});Object.defineProperty(Vn,"strConcat",{enumerable:true,get:function(){return mE.strConcat}});Object.defineProperty(Vn,"nil",{enumerable:true,get:function(){return mE.nil}});Object.defineProperty(Vn,"getProperty",{enumerable:true,get:function(){return mE.getProperty}});Object.defineProperty(Vn,"stringify",{enumerable:true,get:function(){return mE.stringify}});Object.defineProperty(Vn,"regexpCode",{enumerable:true,get:function(){return mE.regexpCode}});Object.defineProperty(Vn,"Name",{enumerable:true,get:function(){return mE.Name}});var _Y=uAe();Object.defineProperty(Vn,"Scope",{enumerable:true,get:function(){return _Y.Scope}});Object.defineProperty(Vn,"ValueScope",{enumerable:true,get:function(){return _Y.ValueScope}});Object.defineProperty(Vn,"ValueScopeName",{enumerable:true,get:function(){return _Y.ValueScopeName}});Object.defineProperty(Vn,"varKinds",{enumerable:true,get:function(){return _Y.varKinds}});Vn.operators={GT:new Ti._Code(">"),GTE:new Ti._Code(">="),LT:new Ti._Code("<"),LTE:new Ti._Code("<="),EQ:new Ti._Code("==="),NEQ:new Ti._Code("!=="),NOT:new Ti._Code("!"),OR:new Ti._Code("||"),AND:new Ti._Code("&&"),ADD:new Ti._Code("+")};var gy=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(t,r){return this}};var lAe=class extends gy{static{a(this,"Def")}constructor(t,r,n){super();this.varKind=t;this.name=r;this.rhs=n}render({es5:t,_n:r}){const n=t?sh.varKinds.var:this.varKind;const i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(!t[this.name.str])return;if(this.rhs)this.rhs=lO(this.rhs,t,r);return this}get names(){return this.rhs instanceof Ti._CodeOrName?this.rhs.names:{}}};var hY=class extends gy{static{a(this,"Assign")}constructor(t,r,n){super();this.lhs=t;this.rhs=r;this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(this.lhs instanceof Ti.Name&&!t[this.lhs.str]&&!this.sideEffects)return;this.rhs=lO(this.rhs,t,r);return this}get names(){const t=this.lhs instanceof Ti.Name?{}:{...this.lhs.names};return yY(t,this.rhs)}};var cAe=class extends hY{static{a(this,"AssignOp")}constructor(t,r,n,i){super(t,n,i);this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}};var dAe=class extends gy{static{a(this,"Label")}constructor(t){super();this.label=t;this.names={}}render({_n:t}){return`${this.label}:`+t}};var pAe=class extends gy{static{a(this,"Break")}constructor(t){super();this.label=t;this.names={}}render({_n:t}){const r=this.label?` ${this.label}`:"";return`break${r};`+t}};var fAe=class extends gy{static{a(this,"Throw")}constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}};var mAe=class extends gy{static{a(this,"AnyCode")}constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){this.code=lO(this.code,t,r);return this}get names(){return this.code instanceof Ti._CodeOrName?this.code.names:{}}};var wL=class extends gy{static{a(this,"ParentNode")}constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){const{nodes:t}=this;let r=t.length;while(r--){const n=t[r].optimizeNodes();if(Array.isArray(n))t.splice(r,1,...n);else if(n)t[r]=n;else t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){const{nodes:n}=this;let i=n.length;while(i--){const s=n[i];if(s.optimizeNames(t,r))continue;ofn(t,s.names);n.splice(i,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>DA(t,r.names),{})}};var yy=class extends wL{static{a(this,"BlockNode")}render(t){return"{"+t._n+super.render(t)+"}"+t._n}};var hAe=class extends wL{static{a(this,"Root")}};var uO=class extends yy{static{a(this,"Else")}};uO.kind="else";var IA=class e extends yy{static{a(this,"If")}constructor(t,r){super(r);this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);if(this.else)r+="else "+this.else.render(t);return r}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(t===true)return this.nodes;let r=this.else;if(r){const n=r.optimizeNodes();r=this.else=Array.isArray(n)?new uO(n):n}if(r){if(t===false)return r instanceof e?r:r.nodes;if(this.nodes.length)return this;return new e(_vt(t),r instanceof e?[r]:r.nodes)}if(t===false||!this.nodes.length)return void 0;return this}optimizeNames(t,r){var n;this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r);if(!(super.optimizeNames(t,r)||this.else))return;this.condition=lO(this.condition,t,r);return this}get names(){const t=super.names;yY(t,this.condition);if(this.else)DA(t,this.else.names);return t}};IA.kind="if";var kA=class extends yy{static{a(this,"For")}};kA.kind="for";var gAe=class extends kA{static{a(this,"ForLoop")}constructor(t){super();this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iteration=lO(this.iteration,t,r);return this}get names(){return DA(super.names,this.iteration.names)}};var yAe=class extends kA{static{a(this,"ForRange")}constructor(t,r,n,i){super();this.varKind=t;this.name=r;this.from=n;this.to=i}render(t){const r=t.es5?sh.varKinds.var:this.varKind;const{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(t)}get names(){const t=yY(super.names,this.from);return yY(t,this.to)}};var gY=class extends kA{static{a(this,"ForIter")}constructor(t,r,n,i){super();this.loop=t;this.varKind=r;this.name=n;this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iterable=lO(this.iterable,t,r);return this}get names(){return DA(super.names,this.iterable.names)}};var TL=class extends yy{static{a(this,"Func")}constructor(t,r,n){super();this.name=t;this.args=r;this.async=n}render(t){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(t)}};TL.kind="func";var xL=class extends wL{static{a(this,"Return")}render(t){return"return "+super.render(t)}};xL.kind="return";var _Ae=class extends yy{static{a(this,"Try")}render(t){let r="try"+super.render(t);if(this.catch)r+=this.catch.render(t);if(this.finally)r+=this.finally.render(t);return r}optimizeNodes(){var t,r;super.optimizeNodes();(t=this.catch)===null||t===void 0?void 0:t.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(t,r){var n,i;super.optimizeNames(t,r);(n=this.catch)===null||n===void 0?void 0:n.optimizeNames(t,r);(i=this.finally)===null||i===void 0?void 0:i.optimizeNames(t,r);return this}get names(){const t=super.names;if(this.catch)DA(t,this.catch.names);if(this.finally)DA(t,this.finally.names);return t}};var RL=class extends yy{static{a(this,"Catch")}constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};RL.kind="catch";var OL=class extends yy{static{a(this,"Finally")}render(t){return"finally"+super.render(t)}};OL.kind="finally";var vAe=class{static{a(this,"CodeGen")}constructor(t,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=t;this._scope=new sh.Scope({parent:t});this._nodes=[new hAe]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){const n=this._extScope.value(t,r);const i=this._values[n.prefix]||(this._values[n.prefix]=new Set);i.add(n);return n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){const s=this._scope.toName(r);if(n!==void 0&&i)this._constants[s.str]=n;this._leafNode(new lAe(t,s,n));return s}const(t,r,n){return this._def(sh.varKinds.const,t,r,n)}let(t,r,n){return this._def(sh.varKinds.let,t,r,n)}var(t,r,n){return this._def(sh.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new hY(t,r,n))}add(t,r){return this._leafNode(new cAe(t,Vn.operators.ADD,r))}code(t){if(typeof t=="function")t();else if(t!==Ti.nil)this._leafNode(new mAe(t));return this}object(...t){const r=["{"];for(const[n,i]of t){if(r.length>1)r.push(",");r.push(n);if(n!==i||this.opts.es5){r.push(":");(0,Ti.addCodeArg)(r,i)}}r.push("}");return new Ti._Code(r)}if(t,r,n){this._blockNode(new IA(t));if(r&&n){this.code(r).else().code(n).endIf()}else if(r){this.code(r).endIf()}else if(n){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(t){return this._elseNode(new IA(t))}else(){return this._elseNode(new uO)}endIf(){return this._endBlockNode(IA,uO)}_for(t,r){this._blockNode(t);if(r)this.code(r).endFor();return this}for(t,r){return this._for(new gAe(t),r)}forRange(t,r,n,i,s=this.opts.es5?sh.varKinds.var:sh.varKinds.let){const o=this._scope.toName(t);return this._for(new yAe(s,o,r,n),()=>i(o))}forOf(t,r,n,i=sh.varKinds.const){const s=this._scope.toName(t);if(this.opts.es5){const o=r instanceof Ti.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ti._)`${o}.length`,u=>{this.var(s,(0,Ti._)`${o}[${u}]`);n(s)})}return this._for(new gY("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?sh.varKinds.var:sh.varKinds.const){if(this.opts.ownProperties){return this.forOf(t,(0,Ti._)`Object.keys(${r})`,n)}const s=this._scope.toName(t);return this._for(new gY("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(kA)}label(t){return this._leafNode(new dAe(t))}break(t){return this._leafNode(new pAe(t))}return(t){const r=new xL;this._blockNode(r);this.code(t);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(xL)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new _Ae;this._blockNode(i);this.code(t);if(r){const s=this.name("e");this._currNode=i.catch=new RL(s);r(s)}if(n){this._currNode=i.finally=new OL;this.code(n)}return this._endBlockNode(RL,OL)}throw(t){return this._leafNode(new fAe(t))}block(t,r){this._blockStarts.push(this._nodes.length);if(t)this.code(t).endBlock(r);return this}endBlock(t){const r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t){throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`)}this._nodes.length=r;return this}func(t,r=Ti.nil,n,i){this._blockNode(new TL(t,r,n));if(i)this.code(i).endFunc();return this}endFunc(){return this._endBlockNode(TL)}optimize(t=1){while(t-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(t){this._currNode.nodes.push(t);return this}_blockNode(t){this._currNode.nodes.push(t);this._nodes.push(t)}_endBlockNode(t,r){const n=this._currNode;if(n instanceof t||r&&n instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){const r=this._currNode;if(!(r instanceof IA)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=t;return this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const r=this._nodes;r[r.length-1]=t}};Vn.CodeGen=vAe;function DA(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}a(DA,"addNames");function yY(e,t){return t instanceof Ti._CodeOrName?DA(e,t.names):e}a(yY,"addExprNames");function lO(e,t,r){if(e instanceof Ti.Name)return n(e);if(!i(e))return e;return new Ti._Code(e._items.reduce((s,o)=>{if(o instanceof Ti.Name)o=n(o);if(o instanceof Ti._Code)s.push(...o._items);else s.push(o);return s},[]));function n(s){const o=r[s.str];if(o===void 0||t[s.str]!==1)return s;delete t[s.str];return o}a(n,"replaceName");function i(s){return s instanceof Ti._Code&&s._items.some(o=>o instanceof Ti.Name&&t[o.str]===1&&r[o.str]!==void 0)}a(i,"canOptimize")}a(lO,"optimizeExpr");function ofn(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}a(ofn,"subtractNames");function _vt(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Ti._)`!${EAe(e)}`}a(_vt,"not");Vn.not=_vt;var ufn=vvt(Vn.operators.AND);function lfn(...e){return e.reduce(ufn)}a(lfn,"and");Vn.and=lfn;var cfn=vvt(Vn.operators.OR);function dfn(...e){return e.reduce(cfn)}a(dfn,"or");Vn.or=dfn;function vvt(e){return(t,r)=>t===Ti.nil?r:r===Ti.nil?t:(0,Ti._)`${EAe(t)} ${e} ${EAe(r)}`}a(vvt,"mappend");function EAe(e){return e instanceof Ti.Name?e:(0,Ti._)`(${e})`}a(EAe,"par")});var ui=y(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:true});zn.checkStrictMode=zn.getErrorPath=zn.Type=zn.useFunc=zn.setEvaluated=zn.evaluatedPropsToName=zn.mergeEvaluated=zn.eachItem=zn.unescapeJsonPointer=zn.escapeJsonPointer=zn.escapeFragment=zn.unescapeFragment=zn.schemaRefOrVal=zn.schemaHasRulesButRef=zn.schemaHasRules=zn.checkUnknownRules=zn.alwaysValidSchema=zn.toHash=void 0;var Hs=En();var pfn=CL();function ffn(e){const t={};for(const r of e)t[r]=true;return t}a(ffn,"toHash");zn.toHash=ffn;function mfn(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return true;Svt(e,t);return!Avt(t,e.self.RULES.all)}a(mfn,"alwaysValidSchema");zn.alwaysValidSchema=mfn;function Svt(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;const i=n.RULES.keywords;for(const s in t){if(!i[s])xvt(e,`unknown keyword: "${s}"`)}}a(Svt,"checkUnknownRules");zn.checkUnknownRules=Svt;function Avt(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return true;return false}a(Avt,"schemaHasRules");zn.schemaHasRules=Avt;function hfn(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return true;return false}a(hfn,"schemaHasRulesButRef");zn.schemaHasRulesButRef=hfn;function gfn({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Hs._)`${r}`}return(0,Hs._)`${e}${t}${(0,Hs.getProperty)(n)}`}a(gfn,"schemaRefOrVal");zn.schemaRefOrVal=gfn;function yfn(e){return Cvt(decodeURIComponent(e))}a(yfn,"unescapeFragment");zn.unescapeFragment=yfn;function _fn(e){return encodeURIComponent(bAe(e))}a(_fn,"escapeFragment");zn.escapeFragment=_fn;function bAe(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}a(bAe,"escapeJsonPointer");zn.escapeJsonPointer=bAe;function Cvt(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}a(Cvt,"unescapeJsonPointer");zn.unescapeJsonPointer=Cvt;function vfn(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}a(vfn,"eachItem");zn.eachItem=vfn;function Evt({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,u)=>{const l=o===void 0?s:o instanceof Hs.Name?(s instanceof Hs.Name?e(i,s,o):t(i,s,o),o):s instanceof Hs.Name?(t(i,o,s),s):r(s,o);return u===Hs.Name&&!(l instanceof Hs.Name)?n(i,l):l}}a(Evt,"makeMergeEvaluated");zn.mergeEvaluated={props:Evt({mergeNames:(e,t,r)=>e.if((0,Hs._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Hs._)`${t} === true`,()=>e.assign(r,true),()=>e.assign(r,(0,Hs._)`${r} || {}`).code((0,Hs._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Hs._)`${r} !== true`,()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,Hs._)`${r} || {}`);SAe(e,r,t)}}),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:wvt}),items:Evt({mergeNames:(e,t,r)=>e.if((0,Hs._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Hs._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Hs._)`${r} !== true`,()=>e.assign(r,t===true?true:(0,Hs._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function wvt(e,t){if(t===true)return e.var("props",true);const r=e.var("props",(0,Hs._)`{}`);if(t!==void 0)SAe(e,r,t);return r}a(wvt,"evaluatedPropsToName");zn.evaluatedPropsToName=wvt;function SAe(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Hs._)`${t}${(0,Hs.getProperty)(n)}`,true))}a(SAe,"setEvaluated");zn.setEvaluated=SAe;var bvt={};function Efn(e,t){return e.scopeValue("func",{ref:t,code:bvt[t.code]||(bvt[t.code]=new pfn._Code(t.code))})}a(Efn,"useFunc");zn.useFunc=Efn;var Tvt;(function(e){e[e["Num"]=0]="Num";e[e["Str"]=1]="Str"})(Tvt=zn.Type||(zn.Type={}));function bfn(e,t,r){if(e instanceof Hs.Name){const n=t===Tvt.Num;return r?n?(0,Hs._)`"[" + ${e} + "]"`:(0,Hs._)`"['" + ${e} + "']"`:n?(0,Hs._)`"/" + ${e}`:(0,Hs._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Hs.getProperty)(e).toString():"/"+bAe(e)}a(bfn,"getErrorPath");zn.getErrorPath=bfn;function xvt(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}a(xvt,"checkStrictMode");zn.checkStrictMode=xvt});var Af=y(AAe=>{"use strict";Object.defineProperty(AAe,"__esModule",{value:true});var Nl=En();var Sfn={data:new Nl.Name("data"),valCxt:new Nl.Name("valCxt"),instancePath:new Nl.Name("instancePath"),parentData:new Nl.Name("parentData"),parentDataProperty:new Nl.Name("parentDataProperty"),rootData:new Nl.Name("rootData"),dynamicAnchors:new Nl.Name("dynamicAnchors"),vErrors:new Nl.Name("vErrors"),errors:new Nl.Name("errors"),this:new Nl.Name("this"),self:new Nl.Name("self"),scope:new Nl.Name("scope"),json:new Nl.Name("json"),jsonPos:new Nl.Name("jsonPos"),jsonLen:new Nl.Name("jsonLen"),jsonPart:new Nl.Name("jsonPart")};AAe.default=Sfn});var PL=y(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:true});Il.extendErrors=Il.resetErrorsCount=Il.reportExtraError=Il.reportError=Il.keyword$DataError=Il.keywordError=void 0;var Fi=En();var vY=ui();var Ec=Af();Il.keywordError={message:({keyword:e})=>(0,Fi.str)`must pass "${e}" keyword validation`};Il.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,Fi.str)`"${e}" keyword must be ${t} ($data)`:(0,Fi.str)`"${e}" keyword is invalid ($data)`};function Afn(e,t=Il.keywordError,r,n){const{it:i}=e;const{gen:s,compositeRule:o,allErrors:u}=i;const l=Pvt(e,t,r);if(n!==null&&n!==void 0?n:o||u){Rvt(s,l)}else{Ovt(i,(0,Fi._)`[${l}]`)}}a(Afn,"reportError");Il.reportError=Afn;function Cfn(e,t=Il.keywordError,r){const{it:n}=e;const{gen:i,compositeRule:s,allErrors:o}=n;const u=Pvt(e,t,r);Rvt(i,u);if(!(s||o)){Ovt(n,Ec.default.vErrors)}}a(Cfn,"reportExtraError");Il.reportExtraError=Cfn;function wfn(e,t){e.assign(Ec.default.errors,t);e.if((0,Fi._)`${Ec.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,Fi._)`${Ec.default.vErrors}.length`,t),()=>e.assign(Ec.default.vErrors,null)))}a(wfn,"resetErrorsCount");Il.resetErrorsCount=wfn;function Tfn({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");const o=e.name("err");e.forRange("i",i,Ec.default.errors,u=>{e.const(o,(0,Fi._)`${Ec.default.vErrors}[${u}]`);e.if((0,Fi._)`${o}.instancePath === undefined`,()=>e.assign((0,Fi._)`${o}.instancePath`,(0,Fi.strConcat)(Ec.default.instancePath,s.errorPath)));e.assign((0,Fi._)`${o}.schemaPath`,(0,Fi.str)`${s.errSchemaPath}/${t}`);if(s.opts.verbose){e.assign((0,Fi._)`${o}.schema`,r);e.assign((0,Fi._)`${o}.data`,n)}})}a(Tfn,"extendErrors");Il.extendErrors=Tfn;function Rvt(e,t){const r=e.const("err",t);e.if((0,Fi._)`${Ec.default.vErrors} === null`,()=>e.assign(Ec.default.vErrors,(0,Fi._)`[${r}]`),(0,Fi._)`${Ec.default.vErrors}.push(${r})`);e.code((0,Fi._)`${Ec.default.errors}++`)}a(Rvt,"addError");function Ovt(e,t){const{gen:r,validateName:n,schemaEnv:i}=e;if(i.$async){r.throw((0,Fi._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,Fi._)`${n}.errors`,t);r.return(false)}}a(Ovt,"returnErrors");var LA={keyword:new Fi.Name("keyword"),schemaPath:new Fi.Name("schemaPath"),params:new Fi.Name("params"),propertyName:new Fi.Name("propertyName"),message:new Fi.Name("message"),schema:new Fi.Name("schema"),parentSchema:new Fi.Name("parentSchema")};function Pvt(e,t,r){const{createErrors:n}=e.it;if(n===false)return(0,Fi._)`{}`;return xfn(e,t,r)}a(Pvt,"errorObjectCode");function xfn(e,t,r={}){const{gen:n,it:i}=e;const s=[Rfn(i,r),Ofn(e,r)];Pfn(e,t,s);return n.object(...s)}a(xfn,"errorObject");function Rfn({errorPath:e},{instancePath:t}){const r=t?(0,Fi.str)`${e}${(0,vY.getErrorPath)(t,vY.Type.Str)}`:e;return[Ec.default.instancePath,(0,Fi.strConcat)(Ec.default.instancePath,r)]}a(Rfn,"errorInstancePath");function Ofn({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,Fi.str)`${t}/${e}`;if(r){i=(0,Fi.str)`${i}${(0,vY.getErrorPath)(r,vY.Type.Str)}`}return[LA.schemaPath,i]}a(Ofn,"errorSchemaPath");function Pfn(e,{params:t,message:r},n){const{keyword:i,data:s,schemaValue:o,it:u}=e;const{opts:l,propertyName:c,topSchemaRef:d,schemaPath:p}=u;n.push([LA.keyword,i],[LA.params,typeof t=="function"?t(e):t||(0,Fi._)`{}`]);if(l.messages){n.push([LA.message,typeof r=="function"?r(e):r])}if(l.verbose){n.push([LA.schema,o],[LA.parentSchema,(0,Fi._)`${d}${p}`],[Ec.default.data,s])}if(c)n.push([LA.propertyName,c])}a(Pfn,"extraErrorProps")});var Ivt=y(cO=>{"use strict";Object.defineProperty(cO,"__esModule",{value:true});cO.boolOrEmptySchema=cO.topBoolOrEmptySchema=void 0;var Nfn=PL();var Ifn=En();var kfn=Af();var Dfn={message:"boolean schema is false"};function Lfn(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){Nvt(e,false)}else if(typeof r=="object"&&r.$async===true){t.return(kfn.default.data)}else{t.assign((0,Ifn._)`${n}.errors`,null);t.return(true)}}a(Lfn,"topBoolOrEmptySchema");cO.topBoolOrEmptySchema=Lfn;function Ffn(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);Nvt(e)}else{r.var(t,true)}}a(Ffn,"boolOrEmptySchema");cO.boolOrEmptySchema=Ffn;function Nvt(e,t){const{gen:r,data:n}=e;const i={gen:r,keyword:"false schema",data:n,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,Nfn.reportError)(i,Dfn,void 0,t)}a(Nvt,"falseSchemaError")});var CAe=y(dO=>{"use strict";Object.defineProperty(dO,"__esModule",{value:true});dO.getRules=dO.isJSONType=void 0;var Bfn=["string","number","integer","boolean","null","object","array"];var Mfn=new Set(Bfn);function qfn(e){return typeof e=="string"&&Mfn.has(e)}a(qfn,"isJSONType");dO.isJSONType=qfn;function Ufn(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}a(Ufn,"getRules");dO.getRules=Ufn});var wAe=y(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:true});hE.shouldUseRule=hE.shouldUseGroup=hE.schemaHasRulesForType=void 0;function $fn({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&kvt(e,n)}a($fn,"schemaHasRulesForType");hE.schemaHasRulesForType=$fn;function kvt(e,t){return t.rules.some(r=>Dvt(e,r))}a(kvt,"shouldUseGroup");hE.shouldUseGroup=kvt;function Dvt(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}a(Dvt,"shouldUseRule");hE.shouldUseRule=Dvt});var IL=y(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:true});tl.reportTypeError=tl.checkDataTypes=tl.checkDataType=tl.coerceAndCheckDataType=tl.getJSONTypes=tl.getSchemaTypes=tl.DataType=void 0;var jfn=CAe();var Gfn=wAe();var Hfn=PL();var On=En();var Lvt=ui();var NL;(function(e){e[e["Correct"]=0]="Correct";e[e["Wrong"]=1]="Wrong"})(NL=tl.DataType||(tl.DataType={}));function Vfn(e){const t=Fvt(e.type);const r=t.includes("null");if(r){if(e.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0){throw new Error('"nullable" cannot be used without "type"')}if(e.nullable===true)t.push("null")}return t}a(Vfn,"getSchemaTypes");tl.getSchemaTypes=Vfn;function Fvt(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(jfn.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}a(Fvt,"getJSONTypes");tl.getJSONTypes=Fvt;function zfn(e,t){const{gen:r,data:n,opts:i}=e;const s=Kfn(t,i.coerceTypes);const o=t.length>0&&!(s.length===0&&t.length===1&&(0,Gfn.schemaHasRulesForType)(e,t[0]));if(o){const u=xAe(t,n,i.strictNumbers,NL.Wrong);r.if(u,()=>{if(s.length)Wfn(e,t,s);else RAe(e)})}return o}a(zfn,"coerceAndCheckDataType");tl.coerceAndCheckDataType=zfn;var Bvt=new Set(["string","number","integer","boolean","null"]);function Kfn(e,t){return t?e.filter(r=>Bvt.has(r)||t==="array"&&r==="array"):[]}a(Kfn,"coerceToTypes");function Wfn(e,t,r){const{gen:n,data:i,opts:s}=e;const o=n.let("dataType",(0,On._)`typeof ${i}`);const u=n.let("coerced",(0,On._)`undefined`);if(s.coerceTypes==="array"){n.if((0,On._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,On._)`${i}[0]`).assign(o,(0,On._)`typeof ${i}`).if(xAe(t,i,s.strictNumbers),()=>n.assign(u,i)))}n.if((0,On._)`${u} !== undefined`);for(const c of r){if(Bvt.has(c)||c==="array"&&s.coerceTypes==="array"){l(c)}}n.else();RAe(e);n.endIf();n.if((0,On._)`${u} !== undefined`,()=>{n.assign(i,u);Yfn(e,u)});function l(c){switch(c){case"string":n.elseIf((0,On._)`${o} == "number" || ${o} == "boolean"`).assign(u,(0,On._)`"" + ${i}`).elseIf((0,On._)`${i} === null`).assign(u,(0,On._)`""`);return;case"number":n.elseIf((0,On._)`${o} == "boolean" || ${i} === null
395
+ `}).join("")}getCanonicalRequest(t,r,n,i,s,o){return[t,r,n,i,s,o||"UNSIGNED-PAYLOAD"].join("\n")}getCanonicalQueryParams(t){return(0,sE.objectEntries)(t).map(([r,n])=>[(0,sE.encodeURI)(r,true),(0,sE.encodeURI)(n,true)]).sort((r,n)=>r[0]<n[0]?-1:1).map(([r,n])=>`${r}=${n}`).join("&")}getResourcePath(t,r,n){if(t){return"/"+(n||"")}else if(n){return`/${r}/${n}`}else{return`/${r}`}}parseExpires(t,r=new Date){const n=new Date(t).valueOf();if(isNaN(n)){throw new Error(Vyt.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(n<r.valueOf()){throw new Error(Vyt.ExceptionMessages.EXPIRATION_DATE_PAST)}return Math.floor(n/1e3)}parseAccessibleAt(t){const r=new Date(t||new Date).valueOf();if(isNaN(r)){throw new Error(lL.ACCESSIBLE_DATE_INVALID)}return Math.floor(r/1e3)}};yu.URLSigner=bSe;var cL=class extends Error{static{a(this,"SigningError")}constructor(){super(...arguments);this.name="SigningError"}};yu.SigningError=cL});var dL=y(Ol=>{"use strict";var Wyt=Ol&&Ol.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r};var jW=Ol&&Ol.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var aE;Object.defineProperty(Ol,"__esModule",{value:true});Ol.CRC32C_EXTENSION_TABLE=Ol.CRC32C_EXTENSIONS=Ol.CRC32C_EXCEPTION_MESSAGES=Ol.CRC32C_DEFAULT_VALIDATOR_GENERATOR=Ol.CRC32C=void 0;var scn=require("fs");var ASe=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697];Ol.CRC32C_EXTENSIONS=ASe;var Yyt=new Int32Array(ASe);Ol.CRC32C_EXTENSION_TABLE=Yyt;var acn=a(()=>new rO,"CRC32C_DEFAULT_VALIDATOR_GENERATOR");Ol.CRC32C_DEFAULT_VALIDATOR_GENERATOR=acn;var GW={INVALID_INIT_BASE64_RANGE:e=>`base64-encoded data expected to equal 4 bytes, not ${e}`,INVALID_INIT_BUFFER_LENGTH:e=>`Buffer expected to equal 4 bytes, not ${e}`,INVALID_INIT_INTEGER:e=>`Number expected to be a safe, unsigned 32-bit integer, not ${e}`};Ol.CRC32C_EXCEPTION_MESSAGES=GW;var rO=class e{static{a(this,"CRC32C")}constructor(t=0){aE.set(this,0);Wyt(this,aE,t,"f")}update(t){let r=jW(this,aE,"f")^4294967295;for(const n of t){const i=e.CRC32C_EXTENSION_TABLE[(n^r)&255];r=i^r>>>8}Wyt(this,aE,r^4294967295,"f")}validate(t){if(typeof t==="number"){return t===jW(this,aE,"f")}else if(typeof t==="string"){return t===this.toString()}else if(Buffer.isBuffer(t)){return Buffer.compare(t,this.toBuffer())===0}else{return t.toString()===this.toString()}}toBuffer(){const t=Buffer.alloc(4);t.writeInt32BE(jW(this,aE,"f"));return t}toJSON(){return this.toString()}toString(){return this.toBuffer().toString("base64")}valueOf(){return jW(this,aE,"f")}static fromBuffer(t){let r;if(Buffer.isBuffer(t)){r=t}else if("buffer"in t){r=Buffer.from(t.buffer)}else{r=Buffer.from(t)}if(r.byteLength!==4){throw new RangeError(GW.INVALID_INIT_BUFFER_LENGTH(r.byteLength))}return new e(r.readInt32BE())}static async fromFile(t){const r=new e;await new Promise((n,i)=>{(0,scn.createReadStream)(t).on("data",s=>r.update(s)).on("end",n).on("error",i)});return r}static fromString(t){const r=Buffer.from(t,"base64");if(r.byteLength!==4){throw new RangeError(GW.INVALID_INIT_BASE64_RANGE(r.byteLength))}return this.fromBuffer(r)}static fromNumber(t){if(!Number.isSafeInteger(t)||t>2**32||t<-(2**32)){throw new RangeError(GW.INVALID_INIT_INTEGER(t))}return new e(t)}static from(t){if(typeof t==="number"){return this.fromNumber(t)}else if(typeof t==="string"){return this.fromString(t)}else if("byteLength"in t){return this.fromBuffer(t)}else{return this.fromString(t.toString())}}};Ol.CRC32C=rO;aE=new WeakMap;rO.CRC32C_EXTENSIONS=ASe;rO.CRC32C_EXTENSION_TABLE=Yyt});var TSe=y(uE=>{"use strict";var CSe=uE&&uE.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r};var D0=uE&&uE.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var xA;var oE;var HW;Object.defineProperty(uE,"__esModule",{value:true});uE.HashStreamValidator=void 0;var ocn=require("crypto");var ucn=require("stream");var lcn=dL();var Xyt=pL();var wSe=class extends ucn.Transform{static{a(this,"HashStreamValidator")}constructor(t={}){super();this.updateHashesOnly=false;xA.set(this,void 0);oE.set(this,void 0);HW.set(this,"");this.crc32cEnabled=!!t.crc32c;this.md5Enabled=!!t.md5;this.updateHashesOnly=!!t.updateHashesOnly;this.crc32cExpected=t.crc32cExpected;this.md5Expected=t.md5Expected;if(this.crc32cEnabled){const r=t.crc32cGenerator||lcn.CRC32C_DEFAULT_VALIDATOR_GENERATOR;CSe(this,xA,r(),"f")}if(this.md5Enabled){CSe(this,oE,(0,ocn.createHash)("md5"),"f")}}_flush(t){if(D0(this,oE,"f")){CSe(this,HW,D0(this,oE,"f").digest("base64"),"f")}if(this.updateHashesOnly){t();return}let r=this.crc32cEnabled||this.md5Enabled;if(this.crc32cEnabled&&this.crc32cExpected){r=!this.test("crc32c",this.crc32cExpected)}if(this.md5Enabled&&this.md5Expected){r=!this.test("md5",this.md5Expected)}if(r){const n=new Xyt.RequestError(Xyt.FileExceptionMessages.DOWNLOAD_MISMATCH);n.code="CONTENT_DOWNLOAD_MISMATCH";t(n)}else{t()}}_transform(t,r,n){this.push(t,r);try{if(D0(this,xA,"f"))D0(this,xA,"f").update(t);if(D0(this,oE,"f"))D0(this,oE,"f").update(t);n()}catch(i){n(i)}}test(t,r){const n=Buffer.isBuffer(r)?r.toString("base64"):r;if(t==="crc32c"&&D0(this,xA,"f")){return D0(this,xA,"f").validate(n)}if(t==="md5"&&D0(this,oE,"f")){return D0(this,HW,"f")===n}return false}};uE.HashStreamValidator=wSe;xA=new WeakMap,oE=new WeakMap,HW=new WeakMap});var pL=y(Ha=>{"use strict";var ccn=Ha&&Ha.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var dcn=Ha&&Ha.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var zW=Ha&&Ha.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))ccn(t,e,r)}dcn(t,e);return t};var pcn=Ha&&Ha.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var KW=Ha&&Ha.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};var RSe;var r_t;Object.defineProperty(Ha,"__esModule",{value:true});Ha.File=Ha.FileExceptionMessages=Ha.RequestError=Ha.STORAGE_POST_POLICY_BASE_URL=Ha.ActionToHTTPMethod=void 0;var lE=tE();var fcn=I0();var mcn=KW(_yt());var hcn=zW(require("crypto"));var Jyt=zW(require("fs"));var gcn=KW(Tyt());var Qyt=zW(Gyt());var fL=require("stream");var Zyt=zW(require("zlib"));var _f=tO();var mL=WW();var ycn=hSe();var xSe=SSe();var dy=CA();var _cn=KW(Z2e());var py=P0();var e_t=TSe();var vcn=KW(tL());var OSe;(function(e){e["read"]="GET";e["write"]="PUT";e["delete"]="DELETE";e["resumable"]="POST"})(OSe||(Ha.ActionToHTTPMethod=OSe={}));Ha.STORAGE_POST_POLICY_BASE_URL="https://storage.googleapis.com";var Ecn=/^gs:\/\/([a-z0-9_.-]+)\/(.+)$/;var hL=class extends Error{static{a(this,"RequestError")}};Ha.RequestError=hL;var t_t=7*24*60*60;var vf;(function(e){e["EXPIRATION_TIME_NA"]="An expiration time is not available.";e["DESTINATION_NO_NAME"]="Destination file should have a name.";e["INVALID_VALIDATION_FILE_RANGE"]="Cannot use validation with file ranges (start/end).";e["MD5_NOT_AVAILABLE"]="MD5 verification was specified, but is not available for the requested object. MD5 is not available for composite objects.";e["EQUALS_CONDITION_TWO_ELEMENTS"]="Equals condition must be an array of 2 elements.";e["STARTS_WITH_TWO_ELEMENTS"]="StartsWith condition must be an array of 2 elements.";e["CONTENT_LENGTH_RANGE_MIN_MAX"]="ContentLengthRange must have numeric min & max fields.";e["DOWNLOAD_MISMATCH"]="The downloaded data did not match the data from the server. To be sure the content is the same, you should download the file again.";e["UPLOAD_MISMATCH_DELETE_FAIL"]="The uploaded data did not match the data from the server.\n As a precaution, we attempted to delete the file, but it was not successful.\n To be sure the content is the same, you should try removing the file manually,\n then uploading the file again.\n \n\nThe delete attempt failed with this message:\n\n ";e["UPLOAD_MISMATCH"]="The uploaded data did not match the data from the server.\n As a precaution, the file has been deleted.\n To be sure the content is the same, you should try uploading the file again."})(vf||(Ha.FileExceptionMessages=vf={}));var VW=class e extends lE.ServiceObject{static{a(this,"File")}constructor(t,r,n={}){var i,s;const o={};let u;if(n.generation!==null){if(typeof n.generation==="string"){u=Number(n.generation)}else{u=n.generation}if(!isNaN(u)){o.generation=u}}Object.assign(o,n.preconditionOpts);const l=n.userProject||t.userProject;if(typeof l==="string"){o.userProject=l}const c={delete:{reqOpts:{qs:o}},exists:{reqOpts:{qs:o}},get:{reqOpts:{qs:o}},getMetadata:{reqOpts:{qs:o}},setMetadata:{reqOpts:{qs:o}}};super({parent:t,baseUrl:"/o",id:encodeURIComponent(r),methods:c});RSe.add(this);this.bucket=t;this.storage=t.parent;if(n.generation!==null){let d;if(typeof n.generation==="string"){d=Number(n.generation)}else{d=n.generation}if(!isNaN(d)){this.generation=d}}this.kmsKeyName=n.kmsKeyName;this.userProject=l;this.name=r;if(n.encryptionKey){this.setEncryptionKey(n.encryptionKey)}this.acl=new ycn.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.crc32cGenerator=n.crc32cGenerator||this.bucket.crc32cGenerator;this.instanceRetryValue=(s=(i=this.storage)===null||i===void 0?void 0:i.retryOptions)===null||s===void 0?void 0:s.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const t=this.bucket.cloudStorageURI;t.pathname=this.name;return t}shouldRetryBasedOnPreconditionAndIdempotencyStrat(t){var r;return!((t===null||t===void 0?void 0:t.ifGenerationMatch)===void 0&&((r=this.instancePreconditionOpts)===null||r===void 0?void 0:r.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever)}copy(t,r,n){var i,s;const o=new Error(vf.DESTINATION_NO_NAME);if(!t){throw o}let u={};if(typeof r==="function"){n=r}else if(r){u={...r}}n=n||lE.util.noop;let l;let c;let d;if(typeof t==="string"){const m=Ecn.exec(t);if(m!==null&&m.length===3){l=this.storage.bucket(m[1]);c=m[2]}else{l=this.bucket;c=t}}else if(t instanceof mL.Bucket){l=t;c=this.name}else if(t instanceof e){l=t.bucket;c=t.name;d=t}else{throw o}const p={};if(this.generation!==void 0){p.sourceGeneration=this.generation}if(u.token!==void 0){p.rewriteToken=u.token}if(u.userProject!==void 0){p.userProject=u.userProject;delete u.userProject}if(u.predefinedAcl!==void 0){p.destinationPredefinedAcl=u.predefinedAcl;delete u.predefinedAcl}d=d||l.file(c);const f={};if(this.encryptionKey!==void 0){f["x-goog-copy-source-encryption-algorithm"]="AES256";f["x-goog-copy-source-encryption-key"]=this.encryptionKeyBase64;f["x-goog-copy-source-encryption-key-sha256"]=this.encryptionKeyHash}if(d.encryptionKey!==void 0){this.setEncryptionKey(d.encryptionKey)}else if(u.destinationKmsKeyName!==void 0){p.destinationKmsKeyName=u.destinationKmsKeyName;delete u.destinationKmsKeyName}else if(d.kmsKeyName!==void 0){p.destinationKmsKeyName=d.kmsKeyName}if(p.destinationKmsKeyName){this.kmsKeyName=p.destinationKmsKeyName;const m=this.interceptors.indexOf(this.encryptionKeyInterceptor);if(m>-1){this.interceptors.splice(m,1)}}if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(u===null||u===void 0?void 0:u.preconditionOpts)){this.storage.retryOptions.autoRetry=false}if(((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)!==void 0){p.ifGenerationMatch=(s=u.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch;delete u.preconditionOpts}this.request({method:"POST",uri:`/rewriteTo/b/${l.name}/o/${encodeURIComponent(d.name)}`,qs:p,json:u,headers:f},(m,h)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(m){n(m,null,h);return}if(h.rewriteToken){const g={token:h.rewriteToken};if(p.userProject){g.userProject=p.userProject}if(p.destinationKmsKeyName){g.destinationKmsKeyName=p.destinationKmsKeyName}this.copy(d,g,n);return}n(null,d,h)})}createReadStream(t={}){t=Object.assign({decompress:true},t);const r=typeof t.start==="number"||typeof t.end==="number";const n=t.end<0;let i=void 0;let s=void 0;const o=new py.PassThroughShim;let u=true;let l=false;if(typeof t.validation==="string"){const m=t.validation.toLowerCase().trim();u=m==="crc32c";l=m==="md5"}else if(t.validation===false){u=false}const c=!r&&(u||l);if(r){if(typeof t.validation==="string"||t.validation===true){throw new Error(vf.INVALID_VALIDATION_FILE_RANGE)}u=false;l=false}const d=a(m=>{if(m){if(s===null||s===void 0?void 0:s.agent){s.agent.destroy()}o.destroy(m)}},"onComplete");const p=a((m,h,g)=>{if(m){this.getBufferFromReadable(g).then(A=>{m.message=A.toString("utf8");o.destroy(m)});return}s=g.request;const _=g.toJSON().headers;const v=_["content-encoding"]==="gzip";const S={};const E=_["x-goog-stored-content-encoding"]==="gzip"&&v||_["x-goog-stored-content-encoding"]==="identity";const b=[];if(c){if(typeof _["x-goog-hash"]==="string"){_["x-goog-hash"].split(",").forEach(A=>{const C=A.indexOf("=");const T=A.substring(0,C);const O=A.substring(C+1);S[T]=O})}i=new e_t.HashStreamValidator({crc32c:u,md5:l,crc32cGenerator:this.crc32cGenerator,crc32cExpected:S.crc32c,md5Expected:S.md5})}if(l&&!S.md5){const A=new hL(vf.MD5_NOT_AVAILABLE);A.code="MD5_NOT_AVAILABLE";o.destroy(A);return}if(E&&c&&i){b.push(i)}if(v&&t.decompress){b.push(Zyt.createGunzip())}(0,fL.pipeline)(g,...b,o,d)},"onResponse");const f=a(()=>{const m={alt:"media"};if(this.generation){m.generation=this.generation}if(t.userProject){m.userProject=t.userProject}const h={"Accept-Encoding":"gzip","Cache-Control":"no-store"};if(r){const _=typeof t.start==="number"?t.start:"0";const v=typeof t.end==="number"?t.end:"";h.Range=`bytes=${n?v:`${_}-${v}`}`}const g={uri:"",headers:h,qs:m};if(t[dy.GCCL_GCS_CMD_KEY]){g[dy.GCCL_GCS_CMD_KEY]=t[dy.GCCL_GCS_CMD_KEY]}this.requestStream(g).on("error",_=>{o.destroy(_)}).on("response",_=>{o.emit("response",_);lE.util.handleResp(null,_,null,p)}).resume()},"makeRequest");o.on("reading",f);return o}createResumableUpload(t,r){var n,i;const s=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const o=this.storage.retryOptions;if(((n=s===null||s===void 0?void 0:s.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&((i=this.instancePreconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever){o.autoRetry=false}Qyt.createURI({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((u,l)=>l(u),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:s.metadata,offset:s.offset,origin:s.origin,predefinedAcl:s.predefinedAcl,private:s.private,public:s.public,userProject:s.userProject||this.userProject,retryOptions:o,params:(s===null||s===void 0?void 0:s.preconditionOpts)||this.instancePreconditionOpts,[dy.GCCL_GCS_CMD_KEY]:s[dy.GCCL_GCS_CMD_KEY]},r);this.storage.retryOptions.autoRetry=this.instanceRetryValue}createWriteStream(t={}){var r;(r=t.metadata)!==null&&r!==void 0?r:t.metadata={};if(t.contentType){t.metadata.contentType=t.contentType}if(!t.metadata.contentType||t.metadata.contentType==="auto"){const f=gcn.default.getType(this.name);if(f){t.metadata.contentType=f}}let n=t.gzip;if(n==="auto"){n=(0,mcn.default)(t.metadata.contentType||"")}if(n){t.metadata.contentEncoding="gzip"}let i=true;let s=false;if(typeof t.validation==="string"){t.validation=t.validation.toLowerCase();i=t.validation==="crc32c";s=t.validation==="md5"}else if(t.validation===false){i=false}let o=a(f=>{u.destroy(f||void 0)},"pipelineCallback");const u=new fL.Writable({final(f){o=f;l.end()},write(f,m,h){l.write(f,m,h)}});const l=new py.PassThroughShim;const c=new e_t.HashStreamValidator({crc32c:i,md5:s,crc32cGenerator:this.crc32cGenerator,updateHashesOnly:true});const d=(0,_cn.default)();let p=false;l.on("reading",()=>u.emit("reading"));l.on("writing",()=>u.emit("writing"));d.on("progress",f=>u.emit("progress",f));d.on("response",f=>u.emit("response",f));d.once("metadata",()=>{p=true});u.on("writing",()=>{if(t.resumable===false){this.startSimpleUpload_(d,t)}else{this.startResumableUpload_(d,t)}(0,fL.pipeline)(l,n?Zyt.createGzip():new fL.PassThrough,c,d,async f=>{if(f){return o(f)}if(!p){try{await new Promise((m,h)=>{d.once("metadata",m);d.once("error",h)})}catch(m){return o(m)}}try{await pcn(this,RSe,"m",r_t).call(this,c,{crc32c:i,md5:s});o()}catch(m){o(m)}})});return u}delete(t,r){const n=typeof t==="object"?t:{};r=typeof t==="function"?t:r;this.disableAutoRetryConditionallyIdempotent_(this.methods.delete,mL.AvailableServiceObjectMethods.delete,n);super.delete(n).then(i=>r(null,...i)).catch(r).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}download(t,r){let n;if(typeof t==="function"){r=t;n={}}else{n=t}let i=false;const s=a((...c)=>{if(!i)r(...c);i=true},"callback");const o=n.destination;delete n.destination;const u=this.createReadStream(n);let l=false;if(o){u.on("error",s).once("data",c=>{l=true;const d=Jyt.createWriteStream(o);d.write(c);u.pipe(d).on("error",s).on("finish",s)}).on("end",()=>{if(!l){const c=Buffer.alloc(0);try{Jyt.writeFileSync(o,c);s(null,c)}catch(d){s(d,c)}}})}else{this.getBufferFromReadable(u).then(c=>s===null||s===void 0?void 0:s(null,c)).catch(s)}}setEncryptionKey(t){this.encryptionKey=t;this.encryptionKeyBase64=Buffer.from(t).toString("base64");this.encryptionKeyHash=hcn.createHash("sha256").update(this.encryptionKeyBase64,"base64").digest("base64");this.encryptionKeyInterceptor={request:r=>{r.headers=r.headers||{};r.headers["x-goog-encryption-algorithm"]="AES256";r.headers["x-goog-encryption-key"]=this.encryptionKeyBase64;r.headers["x-goog-encryption-key-sha256"]=this.encryptionKeyHash;return r}};this.interceptors.push(this.encryptionKeyInterceptor);return this}getExpirationDate(t){this.getMetadata((r,n,i)=>{if(r){t(r,null,i);return}if(!n.retentionExpirationTime){const s=new Error(vf.EXPIRATION_TIME_NA);t(s,null,i);return}t(null,new Date(n.retentionExpirationTime),i)})}generateSignedPostPolicyV2(t,r){const n=(0,py.normalize)(t,r);let i=n.options;const s=n.callback;const o=new Date(i.expires);if(isNaN(o.getTime())){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(o.valueOf()<Date.now()){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_PAST)}i=Object.assign({},i);const u=[["eq","$key",this.name],{bucket:this.bucket.name}];if(Array.isArray(i.equals)){if(!Array.isArray(i.equals[0])){i.equals=[i.equals]}i.equals.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(vf.EQUALS_CONDITION_TWO_ELEMENTS)}u.push(["eq",p[0],p[1]])})}if(Array.isArray(i.startsWith)){if(!Array.isArray(i.startsWith[0])){i.startsWith=[i.startsWith]}i.startsWith.forEach(p=>{if(!Array.isArray(p)||p.length!==2){throw new Error(vf.STARTS_WITH_TWO_ELEMENTS)}u.push(["starts-with",p[0],p[1]])})}if(i.acl){u.push({acl:i.acl})}if(i.successRedirect){u.push({success_action_redirect:i.successRedirect})}if(i.successStatus){u.push({success_action_status:i.successStatus})}if(i.contentLengthRange){const p=i.contentLengthRange.min;const f=i.contentLengthRange.max;if(typeof p!=="number"||typeof f!=="number"){throw new Error(vf.CONTENT_LENGTH_RANGE_MIN_MAX)}u.push(["content-length-range",p,f])}const l={expiration:o.toISOString(),conditions:u};const c=JSON.stringify(l);const d=Buffer.from(c).toString("base64");this.storage.authClient.sign(d).then(p=>{s(null,{string:c,base64:d,signature:p})},p=>{s(new xSe.SigningError(p.message))})}generateSignedPostPolicyV4(t,r){const n=(0,py.normalize)(t,r);let i=n.options;const s=n.callback;const o=new Date(i.expires);if(isNaN(o.getTime())){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_INVALID)}if(o.valueOf()<Date.now()){throw new Error(_f.ExceptionMessages.EXPIRATION_DATE_PAST)}if(o.valueOf()-Date.now()>t_t*1e3){throw new Error(`Max allowed expiration is seven days (${t_t} seconds).`)}i=Object.assign({},i);let u=Object.assign({},i.fields);const l=new Date;const c=(0,py.formatAsUTCISO)(l,true);const d=(0,py.formatAsUTCISO)(l);const p=a(async()=>{const{client_email:f}=await this.storage.authClient.getCredentials();const m=`${f}/${d}/auto/storage/goog4_request`;u={...u,bucket:this.bucket.name,key:this.name,"x-goog-date":c,"x-goog-credential":m,"x-goog-algorithm":"GOOG4-RSA-SHA256"};const h=i.conditions||[];Object.entries(u).forEach(([E,b])=>{if(!E.startsWith("x-ignore-")){h.push({[E]:b})}});delete u.bucket;const g=(0,py.formatAsUTCISO)(o,true,"-",":");const _={conditions:h,expiration:g};const v=(0,py.unicodeJSONStringify)(_);const S=Buffer.from(v).toString("base64");try{const E=await this.storage.authClient.sign(S);const b=Buffer.from(E,"base64").toString("hex");u["policy"]=S;u["x-goog-signature"]=b;let A;if(i.virtualHostedStyle){A=`https://${this.bucket.name}.storage.googleapis.com/`}else if(i.bucketBoundHostname){A=`${i.bucketBoundHostname}/`}else{A=`${Ha.STORAGE_POST_POLICY_BASE_URL}/${this.bucket.name}/`}return{url:A,fields:u}}catch(E){throw new xSe.SigningError(E.message)}},"sign");p().then(f=>s(null,f),s)}getSignedUrl(t,r){const n=OSe[t.action];const i=(0,py.objectKeyToLowercase)(t.extensionHeaders||{});if(t.action==="resumable"){i["x-goog-resumable"]="start"}const s=Object.assign({},t.queryParams);if(typeof t.responseType==="string"){s["response-content-type"]=t.responseType}if(typeof t.promptSaveAs==="string"){s["response-content-disposition"]='attachment; filename="'+t.promptSaveAs+'"'}if(typeof t.responseDisposition==="string"){s["response-content-disposition"]=t.responseDisposition}if(this.generation){s["generation"]=this.generation.toString()}const o={method:n,expires:t.expires,accessibleAt:t.accessibleAt,extensionHeaders:i,queryParams:s,contentMd5:t.contentMd5,contentType:t.contentType};if(t.cname){o.cname=t.cname}if(t.version){o.version=t.version}if(t.virtualHostedStyle){o.virtualHostedStyle=t.virtualHostedStyle}if(!this.signer){this.signer=new xSe.URLSigner(this.storage.authClient,this.bucket,this)}this.signer.getSignedUrl(o).then(u=>r(null,u),r)}isPublic(t){var r;const n=((r=this.storage)===null||r===void 0?void 0:r.interceptors)||[];const i=this.interceptors||[];const s=n.concat(i);const o=s.reduce((u,l)=>{const c=l.request({uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`});Object.assign(u,c.headers);return u},{});lE.util.makeRequest({method:"GET",uri:`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`,headers:o},{retryOptions:this.storage.retryOptions},u=>{if(u){const l=u;if(l.code===403){t(null,false)}else{t(u)}}else{t(null,true)}})}makePrivate(t,r){var n,i;const s=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const o={predefinedAcl:s.strict?"private":"projectPrivate"};if(((n=s.preconditionOpts)===null||n===void 0?void 0:n.ifMetagenerationMatch)!==void 0){o.ifMetagenerationMatch=(i=s.preconditionOpts)===null||i===void 0?void 0:i.ifMetagenerationMatch;delete s.preconditionOpts}if(s.userProject){o.userProject=s.userProject}const u={...s.metadata,acl:null};this.setMetadata(u,o,r)}makePublic(t){t=t||lE.util.noop;this.acl.add({entity:"allUsers",role:"READER"},(r,n,i)=>{t(r,i)})}publicUrl(){return`${this.storage.apiEndpoint}/${this.bucket.name}/${encodeURIComponent(this.name)}`}move(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||lE.util.noop;this.copy(t,i,(s,o,u)=>{if(s){s.message="file#copy failed with an error - "+s.message;n(s,null,u);return}if(this.name!==o.name||this.bucket.name!==o.bucket.name){this.delete(i,(l,c)=>{if(l){l.message="file#delete failed with an error - "+l.message;n(l,o,c);return}n(null,o,u)})}else{n(null,o,u)}})}rename(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||lE.util.noop;this.move(t,i,n)}request(t,r){return this.parent.request.call(this,t,r)}rotateEncryptionKey(t,r){var n;r=typeof t==="function"?t:r;let i={};if(typeof t==="string"||t instanceof Buffer){i={encryptionKey:t}}else if(typeof t==="object"){i=t}const s=this.bucket.file(this.id,i);const o=((n=i.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch)!==void 0?{preconditionOpts:i.preconditionOpts}:{};this.copy(s,o,r)}save(t,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};let s=this.storage.retryOptions.maxRetries;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(i===null||i===void 0?void 0:i.preconditionOpts)){s=0}const o=(0,vcn.default)(async u=>{return new Promise((l,c)=>{if(s===0){this.storage.retryOptions.autoRetry=false}const d=this.createWriteStream(i);if(i.onUploadProgress){d.on("progress",i.onUploadProgress)}const p=a(f=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(f)){return c(f)}return u(f)},"handleError");if(typeof t==="string"||Buffer.isBuffer(t)){d.on("error",p).on("finish",()=>l()).end(t)}else{(0,fL.pipeline)(t,d,f=>{if(f){if(typeof t!=="function"){return u(f)}p(f)}else{l()}})}})},{retries:s,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return o}else{return o.then(()=>{if(n){return n()}}).catch(n)}}setMetadata(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,mL.AvailableServiceObjectMethods.setMetadata,i);super.setMetadata(t,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setStorageClass(t,r,n){n=typeof r==="function"?r:n;const i=typeof r==="object"?r:{};const s={...i,storageClass:t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(o,u,l)=>{return u+"_"+l}).toUpperCase()};this.copy(this,s,(o,u,l)=>{if(o){n(o,l);return}this.metadata=u.metadata;n(null,l)})}setUserProject(t){this.bucket.setUserProject.call(this,t)}startResumableUpload_(t,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.retryOptions;if(!this.shouldRetryBasedOnPreconditionAndIdempotencyStrat(r.preconditionOpts)){i.autoRetry=false}const s=Qyt.upload({authClient:this.storage.authClient,apiEndpoint:this.storage.apiEndpoint,bucket:this.bucket.name,customRequestOptions:this.getRequestInterceptors().reduce((o,u)=>u(o),{}),file:this.name,generation:this.generation,key:this.encryptionKey,kmsKeyName:this.kmsKeyName,metadata:r.metadata,offset:r.offset,predefinedAcl:r.predefinedAcl,private:r.private,public:r.public,uri:r.uri,userProject:r.userProject||this.userProject,retryOptions:{...i},params:(r===null||r===void 0?void 0:r.preconditionOpts)||this.instancePreconditionOpts,chunkSize:r===null||r===void 0?void 0:r.chunkSize,highWaterMark:r===null||r===void 0?void 0:r.highWaterMark,[dy.GCCL_GCS_CMD_KEY]:r[dy.GCCL_GCS_CMD_KEY]});s.on("response",o=>{t.emit("response",o)}).on("metadata",o=>{this.metadata=o;t.emit("metadata")}).on("finish",()=>{t.emit("complete")}).on("progress",o=>t.emit("progress",o));t.setWritable(s);this.storage.retryOptions.autoRetry=this.instanceRetryValue}startSimpleUpload_(t,r={}){var n;(n=r.metadata)!==null&&n!==void 0?n:r.metadata={};const i=this.storage.apiEndpoint;const s=this.bucket.name;const o=`${i}/upload/storage/v1/b/${s}/o`;const u={qs:{name:this.name},uri:o,[dy.GCCL_GCS_CMD_KEY]:r[dy.GCCL_GCS_CMD_KEY]};if(this.generation!==void 0){u.qs.ifGenerationMatch=this.generation}if(this.kmsKeyName!==void 0){u.qs.kmsKeyName=this.kmsKeyName}if(typeof r.timeout==="number"){u.timeout=r.timeout}if(r.userProject||this.userProject){u.qs.userProject=r.userProject||this.userProject}if(r.predefinedAcl){u.qs.predefinedAcl=r.predefinedAcl}else if(r.private){u.qs.predefinedAcl="private"}else if(r.public){u.qs.predefinedAcl="publicRead"}Object.assign(u.qs,this.instancePreconditionOpts,r.preconditionOpts);lE.util.makeWritableStream(t,{makeAuthenticatedRequest:l=>{this.request(l,(c,d,p)=>{if(c){t.destroy(c);return}this.metadata=d;t.emit("metadata",d);t.emit("response",p);t.emit("complete")})},metadata:r.metadata,request:u})}disableAutoRetryConditionallyIdempotent_(t,r,n){var i,s,o,u;if(typeof t==="object"&&((s=(i=t===null||t===void 0?void 0:t.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifGenerationMatch)===void 0&&r===mL.AvailableServiceObjectMethods.delete&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}if(typeof t==="object"&&((u=(o=t===null||t===void 0?void 0:t.reqOpts)===null||o===void 0?void 0:o.qs)===null||u===void 0?void 0:u.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&r===mL.AvailableServiceObjectMethods.setMetadata&&this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===_f.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}async getBufferFromReadable(t){const r=[];for await(const n of t){r.push(n)}return Buffer.concat(r)}};Ha.File=VW;RSe=new WeakSet,r_t=a(async function e(t,r={}){const n=this.metadata;let i=!!(r.crc32c||r.md5);if(r.crc32c&&n.crc32c){i=!t.test("crc32c",n.crc32c)}if(r.md5&&n.md5Hash){i=!t.test("md5",n.md5Hash)}if(i){const s=[];let o="";let u="";try{await this.delete();if(r.md5&&!n.md5Hash){o="MD5_NOT_AVAILABLE";u=vf.MD5_NOT_AVAILABLE}else{o="FILE_NO_UPLOAD";u=vf.UPLOAD_MISMATCH}}catch(c){const d=c;o="FILE_NO_UPLOAD_DELETE";u=`${vf.UPLOAD_MISMATCH_DELETE_FAIL}${d.message}`;s.push(d)}const l=new hL(u);l.code=o;l.errors=s;throw l}return true},"_File_validateIntegrity");(0,fcn.promisifyAll)(VW,{exclude:["cloudStorageURI","publicUrl","request","save","setEncryptionKey","shouldRetryBasedOnPreconditionAndIdempotencyStrat","getBufferFromReadable"]})});var NSe=y(nO=>{"use strict";Object.defineProperty(nO,"__esModule",{value:true});nO.Iam=nO.IAMExceptionMessages=void 0;var bcn=I0();var PSe=P0();var YW;(function(e){e["POLICY_OBJECT_REQUIRED"]="A policy object is required.";e["PERMISSIONS_REQUIRED"]="Permissions are required."})(YW||(nO.IAMExceptionMessages=YW={}));var XW=class{static{a(this,"Iam")}constructor(t){this.request_=t.request.bind(t);this.resourceId_="buckets/"+t.getId()}getPolicy(t,r){const{options:n,callback:i}=(0,PSe.normalize)(t,r);const s={};if(n.userProject){s.userProject=n.userProject}if(n.requestedPolicyVersion!==null&&n.requestedPolicyVersion!==void 0){s.optionsRequestedPolicyVersion=n.requestedPolicyVersion}this.request_({uri:"/iam",qs:s},i)}setPolicy(t,r,n){if(t===null||typeof t!=="object"){throw new Error(YW.POLICY_OBJECT_REQUIRED)}const{options:i,callback:s}=(0,PSe.normalize)(r,n);let o;if(t.etag===void 0){o=0}this.request_({method:"PUT",uri:"/iam",maxRetries:o,json:Object.assign({resourceId:this.resourceId_},t),qs:i},s)}testPermissions(t,r,n){if(!Array.isArray(t)&&typeof t!=="string"){throw new Error(YW.PERMISSIONS_REQUIRED)}const{options:i,callback:s}=(0,PSe.normalize)(r,n);const o=Array.isArray(t)?t:[t];const u=Object.assign({permissions:o},i);this.request_({uri:"/iam/testPermissions",qs:u,useQuerystring:true},(l,c)=>{if(l){s(l,null,c);return}const d=Array.isArray(c.permissions)?c.permissions:[];const p=o.reduce((f,m)=>{f[m]=d.indexOf(m)>-1;return f},{});s(null,p,c)})}};nO.Iam=XW;(0,bcn.promisifyAll)(XW)});var ISe=y(QW=>{"use strict";Object.defineProperty(QW,"__esModule",{value:true});QW.Notification=void 0;var Scn=tE();var Acn=I0();var JW=class extends Scn.ServiceObject{static{a(this,"Notification")}constructor(t,r){const n={};const i={create:true,delete:{reqOpts:{qs:n}},get:{reqOpts:{qs:n}},getMetadata:{reqOpts:{qs:n}},exists:true};super({parent:t,baseUrl:"/notificationConfigs",id:r.toString(),createMethod:t.createNotification.bind(t),methods:i})}};QW.Notification=JW;(0,Acn.promisifyAll)(JW)});var WW=y(_u=>{"use strict";var Ccn=_u&&_u.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var wcn=_u&&_u.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var LSe=_u&&_u.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Ccn(t,e,r)}wcn(t,e);return t};var a_t=_u&&_u.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(_u,"__esModule",{value:true});_u.Bucket=_u.BucketExceptionMessages=_u.AvailableServiceObjectMethods=_u.BucketActionToHTTPMethod=void 0;var ZW=tE();var o_t=lSe();var Tcn=I0();var xcn=LSe(require("fs"));var Rcn=LSe(dSe());var Ocn=LSe(require("path"));var n_t=a_t(mSe());var i_t=require("util");var Pcn=a_t(tL());var Ncn=P0();var s_t=hSe();var kSe=pL();var Icn=NSe();var kcn=ISe();var iO=tO();var Dcn=SSe();var Lcn=require("stream");var Fcn=require("url");var DSe;(function(e){e["list"]="GET"})(DSe||(_u.BucketActionToHTTPMethod=DSe={}));var sO;(function(e){e[e["setMetadata"]=0]="setMetadata";e[e["delete"]=1]="delete"})(sO||(_u.AvailableServiceObjectMethods=sO={}));var L0;(function(e){e["PROVIDE_SOURCE_FILE"]="You must provide at least one source file.";e["DESTINATION_FILE_NOT_SPECIFIED"]="A destination file must be specified.";e["CHANNEL_ID_REQUIRED"]="An ID is required to create a channel.";e["TOPIC_NAME_REQUIRED"]="A valid topic name is required.";e["CONFIGURATION_OBJECT_PREFIX_REQUIRED"]="A configuration object with a prefix is required.";e["SPECIFY_FILE_NAME"]="A file name must be specified.";e["METAGENERATION_NOT_PROVIDED"]="A metageneration must be provided.";e["SUPPLY_NOTIFICATION_ID"]="You must supply a notification ID."})(L0||(_u.BucketExceptionMessages=L0={}));var gL=class e extends ZW.ServiceObject{static{a(this,"Bucket")}getFilesStream(t){return new Lcn.Readable}constructor(t,r,n){var i,s,o,u;n=n||{};r=r.replace(/^gs:\/\//,"").replace(/\/+$/,"");const l={};if((i=n===null||n===void 0?void 0:n.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch){l.ifGenerationMatch=n.preconditionOpts.ifGenerationMatch}if((s=n===null||n===void 0?void 0:n.preconditionOpts)===null||s===void 0?void 0:s.ifGenerationNotMatch){l.ifGenerationNotMatch=n.preconditionOpts.ifGenerationNotMatch}if((o=n===null||n===void 0?void 0:n.preconditionOpts)===null||o===void 0?void 0:o.ifMetagenerationMatch){l.ifMetagenerationMatch=n.preconditionOpts.ifMetagenerationMatch}if((u=n===null||n===void 0?void 0:n.preconditionOpts)===null||u===void 0?void 0:u.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=n.preconditionOpts.ifMetagenerationNotMatch}const c=n.userProject;if(typeof c==="string"){l.userProject=c}const d={create:{reqOpts:{qs:l}},delete:{reqOpts:{qs:l}},exists:{reqOpts:{qs:l}},get:{reqOpts:{qs:l}},getMetadata:{reqOpts:{qs:l}},setMetadata:{reqOpts:{qs:l}}};super({parent:t,baseUrl:"/b",id:r,createMethod:t.createBucket.bind(t),methods:d});this.name=r;this.storage=t;this.userProject=n.userProject;this.acl=new s_t.Acl({request:this.request.bind(this),pathPrefix:"/acl"});this.acl.default=new s_t.Acl({request:this.request.bind(this),pathPrefix:"/defaultObjectAcl"});this.crc32cGenerator=n.crc32cGenerator||this.storage.crc32cGenerator;this.iam=new Icn.Iam(this);this.getFilesStream=o_t.paginator.streamify("getFiles");this.instanceRetryValue=t.retryOptions.autoRetry;this.instancePreconditionOpts=n===null||n===void 0?void 0:n.preconditionOpts}get cloudStorageURI(){const t=new Fcn.URL("gs://");t.host=this.name;return t}addLifecycleRule(t,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}i=i||{};const s=Array.isArray(t)?t:[t];for(const o of s){if(o.condition.createdBefore instanceof Date){o.condition.createdBefore=o.condition.createdBefore.toISOString().replace(/T.+$/,"")}if(o.condition.customTimeBefore instanceof Date){o.condition.customTimeBefore=o.condition.customTimeBefore.toISOString().replace(/T.+$/,"")}if(o.condition.noncurrentTimeBefore instanceof Date){o.condition.noncurrentTimeBefore=o.condition.noncurrentTimeBefore.toISOString().replace(/T.+$/,"")}}if(i.append===false){this.setMetadata({lifecycle:{rule:s}},i,n);return}this.getMetadata((o,u)=>{var l,c;if(o){n(o);return}const d=Array.isArray((l=u.lifecycle)===null||l===void 0?void 0:l.rule)?(c=u.lifecycle)===null||c===void 0?void 0:c.rule:[];this.setMetadata({lifecycle:{rule:d.concat(s)}},i,n)})}combine(t,r,n,i){var s;if(!Array.isArray(t)||t.length===0){throw new Error(L0.PROVIDE_SOURCE_FILE)}if(!r){throw new Error(L0.DESTINATION_FILE_NOT_SPECIFIED)}let o={};if(typeof n==="function"){i=n}else if(n){o=n}this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,sO.setMetadata,o);const u=a(d=>{if(d instanceof kSe.File){return d}return this.file(d)},"convertToFile");t=t.map(u);const l=u(r);i=i||ZW.util.noop;if(!l.metadata.contentType){const d=Rcn.contentType(l.name);if(d){l.metadata.contentType=d}}let c=this.storage.retryOptions.maxRetries;if(((s=l===null||l===void 0?void 0:l.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&o.ifGenerationMatch===void 0&&this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryNever){c=0}if(o.ifGenerationMatch===void 0){Object.assign(o,l.instancePreconditionOpts,o)}l.request({method:"POST",uri:"/compose",maxRetries:c,json:{destination:{contentType:l.metadata.contentType},sourceObjects:t.map(d=>{const p={name:d.name};if(d.metadata&&d.metadata.generation){p.generation=parseInt(d.metadata.generation.toString())}return p})},qs:o},(d,p)=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue;if(d){i(d,null,p);return}i(null,l,p)})}createChannel(t,r,n,i){if(typeof t!=="string"){throw new Error(L0.CHANNEL_ID_REQUIRED)}let s={};if(typeof n==="function"){i=n}else if(n){s=n}this.request({method:"POST",uri:"/o/watch",json:Object.assign({id:t,type:"web_hook"},r),qs:s},(o,u)=>{if(o){i(o,null,u);return}const l=u.resourceId;const c=this.storage.channel(t,l);c.metadata=u;i(null,c,u)})}createNotification(t,r,n){let i={};if(typeof r==="function"){n=r}else if(r){i=r}const s=t!==null&&typeof t==="object";if(s&&ZW.util.isCustomType(t,"pubsub/topic")){t=t.name}if(typeof t!=="string"){throw new Error(L0.TOPIC_NAME_REQUIRED)}const o=Object.assign({topic:t},i);if(o.topic.indexOf("projects")!==0){o.topic="projects/{{projectId}}/topics/"+o.topic}o.topic="//pubsub.googleapis.com/"+o.topic;if(!o.payloadFormat){o.payloadFormat="JSON_API_V1"}const u={};if(o.userProject){u.userProject=o.userProject;delete o.userProject}this.request({method:"POST",uri:"/notificationConfigs",json:(0,Ncn.convertObjKeysToSnakeCase)(o),qs:u,maxRetries:0},(l,c)=>{if(l){n(l,null,c);return}const d=this.notification(c.id);d.metadata=c;n(null,d,c)})}deleteFiles(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}const i=10;const s=1e3;const o=[];const u=a(l=>{return l.delete(n).catch(c=>{if(!n.force){throw c}o.push(c)})},"deleteFile");(async()=>{try{let l=[];const c=(0,n_t.default)(i);const d=this.getFilesStream(n);for await(const p of d){if(l.length>=s){await Promise.all(l);l=[]}l.push(c(()=>u(p)).catch(f=>{d.destroy();throw f}))}await Promise.all(l);r(o.length>0?o:null)}catch(l){r(l);return}})()}deleteLabels(t,r,n){let i=new Array;let s={};if(typeof t==="function"){n=t}else if(typeof t==="string"){i=[t]}else if(Array.isArray(t)){i=t}else if(t){s=t}if(typeof r==="function"){n=r}else if(r){s=r}const o=a(u=>{const l=u.reduce((c,d)=>{c[d]=null;return c},{});if((s===null||s===void 0?void 0:s.ifMetagenerationMatch)!==void 0){this.setLabels(l,s,n)}else{this.setLabels(l,n)}},"deleteLabels");if(i.length===0){this.getLabels((u,l)=>{if(u){n(u);return}o(Object.keys(l))})}else{o(i)}}disableRequesterPays(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.setMetadata({billing:{requesterPays:false}},n,r)}enableLogging(t,r){if(!t||typeof t==="function"||typeof t.prefix==="undefined"){throw new Error(L0.CONFIGURATION_OBJECT_PREFIX_REQUIRED)}let n=this.id;if(t.bucket&&t.bucket instanceof e){n=t.bucket.id}else if(t.bucket&&typeof t.bucket==="string"){n=t.bucket}const i={};if(t===null||t===void 0?void 0:t.ifMetagenerationMatch){i.ifMetagenerationMatch=t.ifMetagenerationMatch}if(t===null||t===void 0?void 0:t.ifMetagenerationNotMatch){i.ifMetagenerationNotMatch=t.ifMetagenerationNotMatch}(async()=>{try{const[s]=await this.iam.getPolicy();s.bindings.push({members:["group:cloud-storage-analytics@google.com"],role:"roles/storage.objectCreator"});await this.iam.setPolicy(s);this.setMetadata({logging:{logBucket:n,logObjectPrefix:t.prefix}},i,r)}catch(s){r(s);return}})()}enableRequesterPays(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.setMetadata({billing:{requesterPays:true}},n,r)}file(t,r){if(!t){throw Error(L0.SPECIFY_FILE_NAME)}return new kSe.File(this,t,r)}getFiles(t,r){let n=typeof t==="object"?t:{};if(!r){r=t}n=Object.assign({},n);this.request({uri:"/o",qs:n},(i,s)=>{if(i){r(i,null,null,s);return}const o=s.items?s.items:[];const u=o.map(c=>{const d={};if(n.versions){d.generation=c.generation}if(c.kmsKeyName){d.kmsKeyName=c.kmsKeyName}const p=this.file(c.name,d);p.metadata=c;return p});let l=null;if(s.nextPageToken){l=Object.assign({},n,{pageToken:s.nextPageToken})}r(null,u,l,s)})}getLabels(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.getMetadata(n,(i,s)=>{if(i){r(i,null);return}r(null,(s===null||s===void 0?void 0:s.labels)||{})})}getNotifications(t,r){let n={};if(typeof t==="function"){r=t}else if(t){n=t}this.request({uri:"/notificationConfigs",qs:n},(i,s)=>{if(i){r(i,null,s);return}const o=s.items?s.items:[];const u=o.map(l=>{const c=this.notification(l.id);c.metadata=l;return c});r(null,u,s)})}getSignedUrl(t,r){const n=DSe[t.action];const i={method:n,expires:t.expires,version:t.version,cname:t.cname,extensionHeaders:t.extensionHeaders||{},queryParams:t.queryParams||{}};if(!this.signer){this.signer=new Dcn.URLSigner(this.storage.authClient,this)}this.signer.getSignedUrl(i).then(s=>r(null,s),r)}lock(t,r){const n=typeof t;if(n!=="number"&&n!=="string"){throw new Error(L0.METAGENERATION_NOT_PROVIDED)}this.request({method:"POST",uri:"/lockRetentionPolicy",qs:{ifMetagenerationMatch:t}},r)}makePrivate(t,r){var n,i,s,o;const u=typeof t==="object"?t:{};r=typeof t==="function"?t:r;u.private=true;const l={predefinedAcl:"projectPrivate"};if(u.userProject){l.userProject=u.userProject}if((n=u.preconditionOpts)===null||n===void 0?void 0:n.ifGenerationMatch){l.ifGenerationMatch=u.preconditionOpts.ifGenerationMatch}if((i=u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationNotMatch){l.ifGenerationNotMatch=u.preconditionOpts.ifGenerationNotMatch}if((s=u.preconditionOpts)===null||s===void 0?void 0:s.ifMetagenerationMatch){l.ifMetagenerationMatch=u.preconditionOpts.ifMetagenerationMatch}if((o=u.preconditionOpts)===null||o===void 0?void 0:o.ifMetagenerationNotMatch){l.ifMetagenerationNotMatch=u.preconditionOpts.ifMetagenerationNotMatch}const c={...u.metadata,acl:null};this.setMetadata(c,l,d=>{if(d){r(d)}const p=a(()=>{if(u.includeFiles){return(0,i_t.promisify)(this.makeAllFilesPublicPrivate_).call(this,u)}return Promise.resolve([])},"internalCall");p().then(f=>r(null,f)).catch(r)})}makePublic(t,r){const n=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const i={public:true,...n};this.acl.add({entity:"allUsers",role:"READER"}).then(()=>{return this.acl.default.add({entity:"allUsers",role:"READER"})}).then(()=>{if(i.includeFiles){return(0,i_t.promisify)(this.makeAllFilesPublicPrivate_).call(this,i)}return[]}).then(s=>r(null,s),r)}notification(t){if(!t){throw new Error(L0.SUPPLY_NOTIFICATION_ID)}return new kcn.Notification(this,t)}removeRetentionPeriod(t,r){const n=typeof t==="object"?t:{};r=typeof t==="function"?t:r;this.setMetadata({retentionPolicy:null},n,r)}request(t,r){if(this.userProject&&(!t.qs||!t.qs.userProject)){t.qs={...t.qs,userProject:this.userProject}}return super.request(t,r)}setLabels(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;n=n||ZW.util.noop;this.setMetadata({labels:t},i,n)}setMetadata(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.disableAutoRetryConditionallyIdempotent_(this.methods.setMetadata,sO.setMetadata,i);super.setMetadata(t,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}setRetentionPeriod(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({retentionPolicy:{retentionPeriod:t.toString()}},i,n)}setCorsConfiguration(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;this.setMetadata({cors:t},i,n)}setStorageClass(t,r,n){const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;t=t.replace(/-/g,"_").replace(/([a-z])([A-Z])/g,(s,o,u)=>{return o+"_"+u}).toUpperCase();this.setMetadata({storageClass:t},i,n)}setUserProject(t){this.userProject=t;const r=["create","delete","exists","get","getMetadata","setMetadata"];r.forEach(n=>{const i=this.methods[n];if(typeof i==="object"){if(typeof i.reqOpts==="object"){Object.assign(i.reqOpts.qs,{userProject:t})}else{i.reqOpts={qs:{userProject:t}}}}})}upload(t,r,n){var i,s;const o=a(d=>{const p=(0,Pcn.default)(async f=>{await new Promise((m,h)=>{var g,_;if(d===0&&((_=(g=c===null||c===void 0?void 0:c.storage)===null||g===void 0?void 0:g.retryOptions)===null||_===void 0?void 0:_.autoRetry)){c.storage.retryOptions.autoRetry=false}const v=c.createWriteStream(u);if(u.onUploadProgress){v.on("progress",u.onUploadProgress)}xcn.createReadStream(t).on("error",f).pipe(v).on("error",S=>{if(this.storage.retryOptions.autoRetry&&this.storage.retryOptions.retryableErrorFn(S)){return h(S)}else{return f(S)}}).on("finish",()=>{return m()})})},{retries:d,factor:this.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.storage.retryOptions.totalTimeout*1e3});if(!n){return p}else{return p.then(()=>{if(n){return n(null,c,c.metadata)}}).catch(n)}},"upload");if(global["GCLOUD_SANDBOX_ENV"]){return}let u=typeof r==="object"?r:{};n=typeof r==="function"?r:n;u=Object.assign({metadata:{}},u);let l=this.storage.retryOptions.maxRetries;if(((i=u===null||u===void 0?void 0:u.preconditionOpts)===null||i===void 0?void 0:i.ifGenerationMatch)===void 0&&((s=this.instancePreconditionOpts)===null||s===void 0?void 0:s.ifGenerationMatch)===void 0&&this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryConditional||this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryNever){l=0}let c;if(u.destination instanceof kSe.File){c=u.destination}else if(u.destination!==null&&typeof u.destination==="string"){c=this.file(u.destination,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}else{const d=Ocn.basename(t);c=this.file(d,{encryptionKey:u.encryptionKey,kmsKeyName:u.kmsKeyName,preconditionOpts:this.instancePreconditionOpts})}o(l)}makeAllFilesPublicPrivate_(t,r){const n=10;const i=[];const s=[];const o=typeof t==="object"?t:{};r=typeof t==="function"?t:r;const u=a(async l=>{try{await(o.public?l.makePublic():l.makePrivate(o));s.push(l)}catch(c){if(!o.force){throw c}i.push(c)}},"processFile");this.getFiles(o).then(([l])=>{const c=(0,n_t.default)(n);const d=l.map(p=>{return c(()=>u(p))});return Promise.all(d)}).then(()=>r(i.length>0?i:null,s),l=>r(l,s))}getId(){return this.id}disableAutoRetryConditionallyIdempotent_(t,r,n){var i,s;if(typeof t==="object"&&((s=(i=t===null||t===void 0?void 0:t.reqOpts)===null||i===void 0?void 0:i.qs)===null||s===void 0?void 0:s.ifMetagenerationMatch)===void 0&&(n===null||n===void 0?void 0:n.ifMetagenerationMatch)===void 0&&(r===sO.setMetadata||r===sO.delete)&&this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryConditional){this.storage.retryOptions.autoRetry=false}else if(this.storage.retryOptions.idempotencyStrategy===iO.IdempotencyStrategy.RetryNever){this.storage.retryOptions.autoRetry=false}}};_u.Bucket=gL;o_t.paginator.extend(gL,"getFiles");(0,Tcn.promisifyAll)(gL,{exclude:["cloudStorageURI","request","file","notification"]})});var FSe=y(tY=>{"use strict";Object.defineProperty(tY,"__esModule",{value:true});tY.Channel=void 0;var u_t=tE();var Bcn=I0();var eY=class extends u_t.ServiceObject{static{a(this,"Channel")}constructor(t,r,n){const i={parent:t,baseUrl:"/channels",id:"",methods:{}};super(i);this.metadata.id=r;this.metadata.resourceId=n}stop(t){t=t||u_t.util.noop;this.request({method:"POST",uri:"/stop",json:this.metadata},(r,n)=>{t(r,n)})}};tY.Channel=eY;(0,Bcn.promisifyAll)(eY)});var BSe=y(nY=>{"use strict";Object.defineProperty(nY,"__esModule",{value:true});nY.HmacKey=void 0;var Mcn=tE();var qcn=tO();var Ucn=I0();var rY=class extends Mcn.ServiceObject{static{a(this,"HmacKey")}constructor(t,r,n){const i={delete:true,get:true,getMetadata:true,setMetadata:{reqOpts:{method:"PUT"}}};const s=n&&n.projectId||t.projectId;super({parent:t,id:r,baseUrl:`/projects/${s}/hmacKeys`,methods:i});this.storage=t;this.instanceRetryValue=t.retryOptions.autoRetry}setMetadata(t,r,n){if(this.storage.retryOptions.idempotencyStrategy!==qcn.IdempotencyStrategy.RetryAlways){this.storage.retryOptions.autoRetry=false}const i=typeof r==="object"?r:{};n=typeof r==="function"?r:n;super.setMetadata(t,i).then(s=>n(null,...s)).catch(n).finally(()=>{this.storage.retryOptions.autoRetry=this.instanceRetryValue})}};nY.HmacKey=rY;(0,Ucn.promisifyAll)(rY)});var tO=y(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:true});cs.Storage=cs.RETRYABLE_ERR_FN_DEFAULT=cs.MAX_RETRY_DELAY_DEFAULT=cs.TOTAL_TIMEOUT_DEFAULT=cs.RETRY_DELAY_MULTIPLIER_DEFAULT=cs.MAX_RETRY_DEFAULT=cs.AUTO_RETRY_DEFAULT=cs.PROTOCOL_REGEX=cs.StorageExceptionMessages=cs.ExceptionMessages=cs.IdempotencyStrategy=void 0;var $cn=tE();var MSe=lSe();var jcn=I0();var l_t=require("stream");var d_t=WW();var p_t=FSe();var Gcn=pL();var iY=P0();var Hcn=VR();var f_t=BSe();var Vcn=dL();var qSe;(function(e){e[e["RetryAlways"]=0]="RetryAlways";e[e["RetryConditional"]=1]="RetryConditional";e[e["RetryNever"]=2]="RetryNever"})(qSe||(cs.IdempotencyStrategy=qSe={}));var c_t;(function(e){e["EXPIRATION_DATE_INVALID"]="The expiration date provided was invalid.";e["EXPIRATION_DATE_PAST"]="An expiration date cannot be in the past."})(c_t||(cs.ExceptionMessages=c_t={}));var aO;(function(e){e["BUCKET_NAME_REQUIRED"]="A bucket name is needed to use Cloud Storage.";e["BUCKET_NAME_REQUIRED_CREATE"]="A name is required to create a bucket.";e["HMAC_SERVICE_ACCOUNT"]="The first argument must be a service account email to create an HMAC key.";e["HMAC_ACCESS_ID"]="An access ID is needed to create an HmacKey object."})(aO||(cs.StorageExceptionMessages=aO={}));cs.PROTOCOL_REGEX=/^(\w*):\/\//;cs.AUTO_RETRY_DEFAULT=true;cs.MAX_RETRY_DEFAULT=3;cs.RETRY_DELAY_MULTIPLIER_DEFAULT=2;cs.TOTAL_TIMEOUT_DEFAULT=600;cs.MAX_RETRY_DELAY_DEFAULT=64;var zcn=qSe.RetryConditional;var Kcn=a(function(e){var t;const r=a(n=>{return n.includes("eai_again")||n==="econnreset"||n==="unexpected connection closure"||n==="epipe"||n==="socket connection timeout"},"isConnectionProblem");if(e){if([408,429,500,502,503,504].indexOf(e.code)!==-1){return true}if(typeof e.code==="string"){if(["408","429","500","502","503","504"].indexOf(e.code)!==-1){return true}const n=e.code.toLowerCase();if(r(n)){return true}}if(e.errors){for(const n of e.errors){const i=(t=n===null||n===void 0?void 0:n.reason)===null||t===void 0?void 0:t.toString().toLowerCase();if(i&&r(i)){return true}}}}return false},"RETRYABLE_ERR_FN_DEFAULT");cs.RETRYABLE_ERR_FN_DEFAULT=Kcn;var F0=class e extends $cn.Service{static{a(this,"Storage")}getBucketsStream(){return new l_t.Readable}getHmacKeysStream(){return new l_t.Readable}constructor(t={}){var r,n,i,s,o,u,l,c,d,p,f,m,h,g;let _="https://storage.googleapis.com";let v=false;const S=process.env.STORAGE_EMULATOR_HOST;if(typeof S==="string"){_=e.sanitizeEndpoint(S);v=true}if(t.apiEndpoint){_=e.sanitizeEndpoint(t.apiEndpoint);v=true}t=Object.assign({},t,{apiEndpoint:_});const E=S||`${t.apiEndpoint}/storage/v1`;const b={apiEndpoint:t.apiEndpoint,retryOptions:{autoRetry:((r=t.retryOptions)===null||r===void 0?void 0:r.autoRetry)!==void 0?(n=t.retryOptions)===null||n===void 0?void 0:n.autoRetry:cs.AUTO_RETRY_DEFAULT,maxRetries:((i=t.retryOptions)===null||i===void 0?void 0:i.maxRetries)?(s=t.retryOptions)===null||s===void 0?void 0:s.maxRetries:cs.MAX_RETRY_DEFAULT,retryDelayMultiplier:((o=t.retryOptions)===null||o===void 0?void 0:o.retryDelayMultiplier)?(u=t.retryOptions)===null||u===void 0?void 0:u.retryDelayMultiplier:cs.RETRY_DELAY_MULTIPLIER_DEFAULT,totalTimeout:((l=t.retryOptions)===null||l===void 0?void 0:l.totalTimeout)?(c=t.retryOptions)===null||c===void 0?void 0:c.totalTimeout:cs.TOTAL_TIMEOUT_DEFAULT,maxRetryDelay:((d=t.retryOptions)===null||d===void 0?void 0:d.maxRetryDelay)?(p=t.retryOptions)===null||p===void 0?void 0:p.maxRetryDelay:cs.MAX_RETRY_DELAY_DEFAULT,retryableErrorFn:((f=t.retryOptions)===null||f===void 0?void 0:f.retryableErrorFn)?(m=t.retryOptions)===null||m===void 0?void 0:m.retryableErrorFn:cs.RETRYABLE_ERR_FN_DEFAULT,idempotencyStrategy:((h=t.retryOptions)===null||h===void 0?void 0:h.idempotencyStrategy)!==void 0?(g=t.retryOptions)===null||g===void 0?void 0:g.idempotencyStrategy:zcn},baseUrl:E,customEndpoint:v,useAuthWithCustomEndpoint:t===null||t===void 0?void 0:t.useAuthWithCustomEndpoint,projectIdRequired:false,scopes:["https://www.googleapis.com/auth/iam","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/devstorage.full_control"],packageJson:(0,Hcn.getPackageJSON)()};super(b,t);this.acl=e.acl;this.crc32cGenerator=t.crc32cGenerator||Vcn.CRC32C_DEFAULT_VALIDATOR_GENERATOR;this.retryOptions=b.retryOptions;this.getBucketsStream=MSe.paginator.streamify("getBuckets");this.getHmacKeysStream=MSe.paginator.streamify("getHmacKeys")}static sanitizeEndpoint(t){if(!cs.PROTOCOL_REGEX.test(t)){t=`https://${t}`}return t.replace(/\/+$/,"")}bucket(t,r){if(!t){throw new Error(aO.BUCKET_NAME_REQUIRED)}return new d_t.Bucket(this,t,r)}channel(t,r){return new p_t.Channel(this,t,r)}createBucket(t,r,n){if(!t){throw new Error(aO.BUCKET_NAME_REQUIRED_CREATE)}let i;if(!n){n=r;i={}}else{i=r}const s={...i,name:t};const o={archive:"ARCHIVE",coldline:"COLDLINE",dra:"DURABLE_REDUCED_AVAILABILITY",multiRegional:"MULTI_REGIONAL",nearline:"NEARLINE",regional:"REGIONAL",standard:"STANDARD"};const u=Object.keys(o);for(const c of u){if(s[c]){if(i.storageClass&&i.storageClass!==c){throw new Error(`Both \`${c}\` and \`storageClass\` were provided.`)}s.storageClass=o[c];delete s[c]}}if(s.requesterPays){s.billing={requesterPays:s.requesterPays};delete s.requesterPays}const l={project:this.projectId};if(s.userProject){l.userProject=s.userProject;delete s.userProject}this.request({method:"POST",uri:"/b",qs:l,json:s},(c,d)=>{if(c){n(c,null,d);return}const p=this.bucket(t);p.metadata=d;n(null,p,d)})}createHmacKey(t,r,n){if(typeof t!=="string"){throw new Error(aO.HMAC_SERVICE_ACCOUNT)}const{options:i,callback:s}=(0,iY.normalize)(r,n);const o=Object.assign({},i,{serviceAccountEmail:t});const u=o.projectId||this.projectId;delete o.projectId;this.request({method:"POST",uri:`/projects/${u}/hmacKeys`,qs:o,maxRetries:0},(l,c)=>{if(l){s(l,null,null,c);return}const d=c.metadata;const p=this.hmacKey(d.accessId,{projectId:d.projectId});p.metadata=c.metadata;s(null,p,c.secret,c)})}getBuckets(t,r){const{options:n,callback:i}=(0,iY.normalize)(t,r);n.project=n.project||this.projectId;this.request({uri:"/b",qs:n},(s,o)=>{if(s){i(s,null,null,o);return}const u=o.items?o.items:[];const l=u.map(d=>{const p=this.bucket(d.id);p.metadata=d;return p});const c=o.nextPageToken?Object.assign({},n,{pageToken:o.nextPageToken}):null;i(null,l,c,o)})}getHmacKeys(t,r){const{options:n,callback:i}=(0,iY.normalize)(t,r);const s=Object.assign({},n);const o=s.projectId||this.projectId;delete s.projectId;this.request({uri:`/projects/${o}/hmacKeys`,qs:s},(u,l)=>{if(u){i(u,null,null,l);return}const c=l.items?l.items:[];const d=c.map(f=>{const m=this.hmacKey(f.accessId,{projectId:f.projectId});m.metadata=f;return m});const p=l.nextPageToken?Object.assign({},n,{pageToken:l.nextPageToken}):null;i(null,d,p,l)})}getServiceAccount(t,r){const{options:n,callback:i}=(0,iY.normalize)(t,r);this.request({uri:`/projects/${this.projectId}/serviceAccount`,qs:n},(s,o)=>{if(s){i(s,null,o);return}const u={};for(const l in o){if(o.hasOwnProperty(l)){const c=l.replace(/_(\w)/g,(d,p)=>p.toUpperCase());u[c]=o[l]}}i(null,u,o)})}hmacKey(t,r){if(!t){throw new Error(aO.HMAC_ACCESS_ID)}return new f_t.HmacKey(this,t,r)}};cs.Storage=F0;F0.Bucket=d_t.Bucket;F0.Channel=p_t.Channel;F0.File=Gcn.File;F0.HmacKey=f_t.HmacKey;F0.acl={OWNER_ROLE:"OWNER",READER_ROLE:"READER",WRITER_ROLE:"WRITER"};MSe.paginator.extend(F0,["getBuckets","getHmacKeys"]);(0,jcn.promisifyAll)(F0,{exclude:["bucket","channel","hmacKey"]})});var sY=y(fy=>{"use strict";var m_t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";var Wcn=m_t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";var h_t="["+m_t+"]["+Wcn+"]*";var Ycn=new RegExp("^"+h_t+"$");var Xcn=a(function(e,t){const r=[];let n=t.exec(e);while(n){const i=[];i.startIndex=t.lastIndex-n[0].length;const s=n.length;for(let o=0;o<s;o++){i.push(n[o])}r.push(i);n=t.exec(e)}return r},"getAllMatches");var Jcn=a(function(e){const t=Ycn.exec(e);return!(t===null||typeof t==="undefined")},"isName");fy.isExist=function(e){return typeof e!=="undefined"};fy.isEmptyObject=function(e){return Object.keys(e).length===0};fy.merge=function(e,t,r){if(t){const n=Object.keys(t);const i=n.length;for(let s=0;s<i;s++){if(r==="strict"){e[n[s]]=[t[n[s]]]}else{e[n[s]]=t[n[s]]}}}};fy.getValue=function(e){if(fy.isExist(e)){return e}else{return""}};fy.isName=Jcn;fy.getAllMatches=Xcn;fy.nameRegexp=h_t});var $Se=y(E_t=>{"use strict";var USe=sY();var Qcn={allowBooleanAttributes:false,unpairedTags:[]};E_t.validate=function(e,t){t=Object.assign({},Qcn,t);const r=[];let n=false;let i=false;if(e[0]==="\uFEFF"){e=e.substr(1)}for(let s=0;s<e.length;s++){if(e[s]==="<"&&e[s+1]==="?"){s+=2;s=y_t(e,s);if(s.err)return s}else if(e[s]==="<"){let o=s;s++;if(e[s]==="!"){s=__t(e,s);continue}else{let u=false;if(e[s]==="/"){u=true;s++}let l="";for(;s<e.length&&e[s]!==">"&&e[s]!==" "&&e[s]!==" "&&e[s]!=="\n"&&e[s]!=="\r";s++){l+=e[s]}l=l.trim();if(l[l.length-1]==="/"){l=l.substring(0,l.length-1);s--}if(!adn(l)){let p;if(l.trim().length===0){p="Invalid space after '<'."}else{p="Tag '"+l+"' is an invalid name."}return Io("InvalidTag",p,cd(e,s))}const c=tdn(e,s);if(c===false){return Io("InvalidAttr","Attributes for '"+l+"' have open quote.",cd(e,s))}let d=c.value;s=c.index;if(d[d.length-1]==="/"){const p=s-d.length;d=d.substring(0,d.length-1);const f=v_t(d,t);if(f===true){n=true}else{return Io(f.err.code,f.err.msg,cd(e,p+f.err.line))}}else if(u){if(!c.tagClosed){return Io("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",cd(e,s))}else if(d.trim().length>0){return Io("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",cd(e,o))}else{const p=r.pop();if(l!==p.tagName){let f=cd(e,p.tagStartPos);return Io("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+l+"'.",cd(e,o))}if(r.length==0){i=true}}}else{const p=v_t(d,t);if(p!==true){return Io(p.err.code,p.err.msg,cd(e,s-d.length+p.err.line))}if(i===true){return Io("InvalidXml","Multiple possible root nodes found.",cd(e,s))}else if(t.unpairedTags.indexOf(l)!==-1){}else{r.push({tagName:l,tagStartPos:o})}n=true}for(s++;s<e.length;s++){if(e[s]==="<"){if(e[s+1]==="!"){s++;s=__t(e,s);continue}else if(e[s+1]==="?"){s=y_t(e,++s);if(s.err)return s}else{break}}else if(e[s]==="&"){const p=idn(e,s);if(p==-1)return Io("InvalidChar","char '&' is not expected.",cd(e,s));s=p}else{if(i===true&&!g_t(e[s])){return Io("InvalidXml","Extra text at the end",cd(e,s))}}}if(e[s]==="<"){s--}}}else{if(g_t(e[s])){continue}return Io("InvalidChar","char '"+e[s]+"' is not expected.",cd(e,s))}}if(!n){return Io("InvalidXml","Start tag expected.",1)}else if(r.length==1){return Io("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",cd(e,r[0].tagStartPos))}else if(r.length>0){return Io("InvalidXml","Invalid '"+JSON.stringify(r.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}return true};function g_t(e){return e===" "||e===" "||e==="\n"||e==="\r"}a(g_t,"isWhiteSpace");function y_t(e,t){const r=t;for(;t<e.length;t++){if(e[t]=="?"||e[t]==" "){const n=e.substr(r,t-r);if(t>5&&n==="xml"){return Io("InvalidXml","XML declaration allowed only at the start of the document.",cd(e,t))}else if(e[t]=="?"&&e[t+1]==">"){t++;break}else{continue}}}return t}a(y_t,"readPI");function __t(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++){if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let r=1;for(t+=8;t<e.length;t++){if(e[t]==="<"){r++}else if(e[t]===">"){r--;if(r===0){break}}}}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++){if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}}return t}a(__t,"readCommentAndCDATA");var Zcn='"';var edn="'";function tdn(e,t){let r="";let n="";let i=false;for(;t<e.length;t++){if(e[t]===Zcn||e[t]===edn){if(n===""){n=e[t]}else if(n!==e[t]){}else{n=""}}else if(e[t]===">"){if(n===""){i=true;break}}r+=e[t]}if(n!==""){return false}return{value:r,index:t,tagClosed:i}}a(tdn,"readAttributeStr");var rdn=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function v_t(e,t){const r=USe.getAllMatches(e,rdn);const n={};for(let i=0;i<r.length;i++){if(r[i][1].length===0){return Io("InvalidAttr","Attribute '"+r[i][2]+"' has no space in starting.",yL(r[i]))}else if(r[i][3]!==void 0&&r[i][4]===void 0){return Io("InvalidAttr","Attribute '"+r[i][2]+"' is without value.",yL(r[i]))}else if(r[i][3]===void 0&&!t.allowBooleanAttributes){return Io("InvalidAttr","boolean attribute '"+r[i][2]+"' is not allowed.",yL(r[i]))}const s=r[i][2];if(!sdn(s)){return Io("InvalidAttr","Attribute '"+s+"' is an invalid name.",yL(r[i]))}if(!n.hasOwnProperty(s)){n[s]=1}else{return Io("InvalidAttr","Attribute '"+s+"' is repeated.",yL(r[i]))}}return true}a(v_t,"validateAttributeString");function ndn(e,t){let r=/\d/;if(e[t]==="x"){t++;r=/[\da-fA-F]/}for(;t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(r))break}return-1}a(ndn,"validateNumberAmpersand");function idn(e,t){t++;if(e[t]===";")return-1;if(e[t]==="#"){t++;return ndn(e,t)}let r=0;for(;t<e.length;t++,r++){if(e[t].match(/\w/)&&r<20)continue;if(e[t]===";")break;return-1}return t}a(idn,"validateAmpersand");function Io(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}a(Io,"getErrorObject");function sdn(e){return USe.isName(e)}a(sdn,"validateAttrName");function adn(e){return USe.isName(e)}a(adn,"validateTagName");function cd(e,t){const r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}a(cd,"getLineNumberForPosition");function yL(e){return e.startIndex+e[1].length}a(yL,"getPositionFromMatch")});var S_t=y(jSe=>{var b_t={preserveOrder:false,attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,removeNSPrefix:false,allowBooleanAttributes:false,parseTagValue:true,parseAttributeValue:false,trimValues:true,cdataPropName:false,numberParseOptions:{hex:true,leadingZeros:true,eNotation:true},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:false,isArray:()=>false,commentPropName:false,unpairedTags:[],processEntities:true,htmlEntities:false,ignoreDeclaration:false,ignorePiTags:false,transformTagName:false,transformAttributeName:false,updateTag:function(e,t,r){return e}};var odn=a(function(e){return Object.assign({},b_t,e)},"buildOptions");jSe.buildOptions=odn;jSe.defaultOptions=b_t});var C_t=y((nPs,A_t)=>{"use strict";var GSe=class{static{a(this,"XmlNode")}constructor(t){this.tagname=t;this.child=[];this[":@"]={}}add(t,r){if(t==="__proto__")t="#__proto__";this.child.push({[t]:r})}addChild(t){if(t.tagname==="__proto__")t.tagname="#__proto__";if(t[":@"]&&Object.keys(t[":@"]).length>0){this.child.push({[t.tagname]:t.child,[":@"]:t[":@"]})}else{this.child.push({[t.tagname]:t.child})}}};A_t.exports=GSe});var T_t=y((sPs,w_t)=>{var udn=sY();function ldn(e,t){const r={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let n=1;let i=false,s=false;let o="";for(;t<e.length;t++){if(e[t]==="<"&&!s){if(i&&pdn(e,t)){t+=7;[entityName,val,t]=cdn(e,t+1);if(val.indexOf("&")===-1)r[gdn(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(i&&fdn(e,t))t+=8;else if(i&&mdn(e,t))t+=8;else if(i&&hdn(e,t))t+=9;else if(ddn)s=true;else throw new Error("Invalid DOCTYPE");n++;o=""}else if(e[t]===">"){if(s){if(e[t-1]==="-"&&e[t-2]==="-"){s=false;n--}}else{n--}if(n===0){break}}else if(e[t]==="["){i=true}else{o+=e[t]}}if(n!==0){throw new Error(`Unclosed DOCTYPE`)}}else{throw new Error(`Invalid Tag instead of DOCTYPE`)}return{entities:r,i:t}}a(ldn,"readDocType");function cdn(e,t){let r="";for(;t<e.length&&(e[t]!=="'"&&e[t]!=='"');t++){r+=e[t]}r=r.trim();if(r.indexOf(" ")!==-1)throw new Error("External entites are not supported");const n=e[t++];let i="";for(;t<e.length&&e[t]!==n;t++){i+=e[t]}return[r,i,t]}a(cdn,"readEntityExp");function ddn(e,t){if(e[t+1]==="!"&&e[t+2]==="-"&&e[t+3]==="-")return true;return false}a(ddn,"isComment");function pdn(e,t){if(e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="N"&&e[t+4]==="T"&&e[t+5]==="I"&&e[t+6]==="T"&&e[t+7]==="Y")return true;return false}a(pdn,"isEntity");function fdn(e,t){if(e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="L"&&e[t+4]==="E"&&e[t+5]==="M"&&e[t+6]==="E"&&e[t+7]==="N"&&e[t+8]==="T")return true;return false}a(fdn,"isElement");function mdn(e,t){if(e[t+1]==="!"&&e[t+2]==="A"&&e[t+3]==="T"&&e[t+4]==="T"&&e[t+5]==="L"&&e[t+6]==="I"&&e[t+7]==="S"&&e[t+8]==="T")return true;return false}a(mdn,"isAttlist");function hdn(e,t){if(e[t+1]==="!"&&e[t+2]==="N"&&e[t+3]==="O"&&e[t+4]==="T"&&e[t+5]==="A"&&e[t+6]==="T"&&e[t+7]==="I"&&e[t+8]==="O"&&e[t+9]==="N")return true;return false}a(hdn,"isNotation");function gdn(e){if(udn.isName(e))return e;else throw new Error(`Invalid entity name ${e}`)}a(gdn,"validateEntityName");w_t.exports=ldn});var HSe=y((oPs,x_t)=>{var ydn=/^[-+]?0x[a-fA-F0-9]+$/;var _dn=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt){Number.parseInt=window.parseInt}if(!Number.parseFloat&&window.parseFloat){Number.parseFloat=window.parseFloat}var vdn={hex:true,leadingZeros:true,decimalPoint:".",eNotation:true};function Edn(e,t={}){t=Object.assign({},vdn,t);if(!e||typeof e!=="string")return e;let r=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(r))return e;else if(t.hex&&ydn.test(r)){return Number.parseInt(r,16)}else{const n=_dn.exec(r);if(n){const i=n[1];const s=n[2];let o=bdn(n[3]);const u=n[4]||n[6];if(!t.leadingZeros&&s.length>0&&i&&r[2]!==".")return e;else if(!t.leadingZeros&&s.length>0&&!i&&r[1]!==".")return e;else{const l=Number(r);const c=""+l;if(c.search(/[eE]/)!==-1){if(t.eNotation)return l;else return e}else if(u){if(t.eNotation)return l;else return e}else if(r.indexOf(".")!==-1){if(c==="0"&&o==="")return l;else if(c===o)return l;else if(i&&c==="-"+o)return l;else return e}if(s){if(o===c)return l;else if(i+o===c)return l;else return e}if(r===c)return l;else if(r===i+c)return l;return e}}else{return e}}}a(Edn,"toNumber");function bdn(e){if(e&&e.indexOf(".")!==-1){e=e.replace(/0+$/,"");if(e===".")e="0";else if(e[0]===".")e="0"+e;else if(e[e.length-1]===".")e=e.substr(0,e.length-1);return e}return e}a(bdn,"trimZeros");x_t.exports=Edn});var O_t=y((cPs,R_t)=>{"use strict";var WSe=sY();var _L=C_t();var Sdn=T_t();var Adn=HSe();var lPs="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,WSe.nameRegexp);var VSe=class{static{a(this,"OrderedObjParser")}constructor(t){this.options=t;this.currentNode=null;this.tagsNodeStack=[];this.docTypeEntities={};this.lastEntities={"apos":{regex:/&(apos|#39|#x27);/g,val:"'"},"gt":{regex:/&(gt|#62|#x3E);/g,val:">"},"lt":{regex:/&(lt|#60|#x3C);/g,val:"<"},"quot":{regex:/&(quot|#34|#x22);/g,val:'"'}};this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"};this.htmlEntities={"space":{regex:/&(nbsp|#160);/g,val:" "},"cent":{regex:/&(cent|#162);/g,val:"\xA2"},"pound":{regex:/&(pound|#163);/g,val:"\xA3"},"yen":{regex:/&(yen|#165);/g,val:"\xA5"},"euro":{regex:/&(euro|#8364);/g,val:"\u20AC"},"copyright":{regex:/&(copy|#169);/g,val:"\xA9"},"reg":{regex:/&(reg|#174);/g,val:"\xAE"},"inr":{regex:/&(inr|#8377);/g,val:"\u20B9"}};this.addExternalEntities=Cdn;this.parseXml=Odn;this.parseTextData=wdn;this.resolveNameSpace=Tdn;this.buildAttributesMap=Rdn;this.isItStopNode=kdn;this.replaceEntitiesValue=Ndn;this.readStopNodeData=Ldn;this.saveTextToParentTag=Idn;this.addChild=Pdn}};function Cdn(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:e[n]}}}a(Cdn,"addExternalEntities");function wdn(e,t,r,n,i,s,o){if(e!==void 0){if(this.options.trimValues&&!n){e=e.trim()}if(e.length>0){if(!o)e=this.replaceEntitiesValue(e);const u=this.options.tagValueProcessor(t,e,r,i,s);if(u===null||u===void 0){return e}else if(typeof u!==typeof e||u!==e){return u}else if(this.options.trimValues){return KSe(e,this.options.parseTagValue,this.options.numberParseOptions)}else{const l=e.trim();if(l===e){return KSe(e,this.options.parseTagValue,this.options.numberParseOptions)}else{return e}}}}}a(wdn,"parseTextData");function Tdn(e){if(this.options.removeNSPrefix){const t=e.split(":");const r=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns"){return""}if(t.length===2){e=r+t[1]}}return e}a(Tdn,"resolveNameSpace");var xdn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Rdn(e,t,r){if(!this.options.ignoreAttributes&&typeof e==="string"){const n=WSe.getAllMatches(e,xdn);const i=n.length;const s={};for(let o=0;o<i;o++){const u=this.resolveNameSpace(n[o][1]);let l=n[o][4];let c=this.options.attributeNamePrefix+u;if(u.length){if(this.options.transformAttributeName){c=this.options.transformAttributeName(c)}if(c==="__proto__")c="#__proto__";if(l!==void 0){if(this.options.trimValues){l=l.trim()}l=this.replaceEntitiesValue(l);const d=this.options.attributeValueProcessor(u,l,t);if(d===null||d===void 0){s[c]=l}else if(typeof d!==typeof l||d!==l){s[c]=d}else{s[c]=KSe(l,this.options.parseAttributeValue,this.options.numberParseOptions)}}else if(this.options.allowBooleanAttributes){s[c]=true}}}if(!Object.keys(s).length){return}if(this.options.attributesGroupName){const o={};o[this.options.attributesGroupName]=s;return o}return s}}a(Rdn,"buildAttributesMap");var Odn=a(function(e){e=e.replace(/\r\n?/g,"\n");const t=new _L("!xml");let r=t;let n="";let i="";for(let s=0;s<e.length;s++){const o=e[s];if(o==="<"){if(e[s+1]==="/"){const u=RA(e,">",s,"Closing Tag is not closed.");let l=e.substring(s+2,u).trim();if(this.options.removeNSPrefix){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1)}}if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r){n=this.saveTextToParentTag(n,r,i)}const c=i.substring(i.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1){throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`)}let d=0;if(c&&this.options.unpairedTags.indexOf(c)!==-1){d=i.lastIndexOf(".",i.lastIndexOf(".")-1);this.tagsNodeStack.pop()}else{d=i.lastIndexOf(".")}i=i.substring(0,d);r=this.tagsNodeStack.pop();n="";s=u}else if(e[s+1]==="?"){let u=zSe(e,s,false,"?>");if(!u)throw new Error("Pi Tag is not closed.");n=this.saveTextToParentTag(n,r,i);if(this.options.ignoreDeclaration&&u.tagName==="?xml"||this.options.ignorePiTags){}else{const l=new _L(u.tagName);l.add(this.options.textNodeName,"");if(u.tagName!==u.tagExp&&u.attrExpPresent){l[":@"]=this.buildAttributesMap(u.tagExp,i,u.tagName)}this.addChild(r,l,i)}s=u.closeIndex+1}else if(e.substr(s+1,3)==="!--"){const u=RA(e,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const l=e.substring(s+4,u-2);n=this.saveTextToParentTag(n,r,i);r.add(this.options.commentPropName,[{[this.options.textNodeName]:l}])}s=u}else if(e.substr(s+1,2)==="!D"){const u=Sdn(e,s);this.docTypeEntities=u.entities;s=u.i}else if(e.substr(s+1,2)==="!["){const u=RA(e,"]]>",s,"CDATA is not closed.")-2;const l=e.substring(s+9,u);n=this.saveTextToParentTag(n,r,i);if(this.options.cdataPropName){r.add(this.options.cdataPropName,[{[this.options.textNodeName]:l}])}else{let c=this.parseTextData(l,r.tagname,i,true,false,true);if(c==void 0)c="";r.add(this.options.textNodeName,c)}s=u+2}else{let u=zSe(e,s,this.options.removeNSPrefix);let l=u.tagName;const c=u.rawTagName;let d=u.tagExp;let p=u.attrExpPresent;let f=u.closeIndex;if(this.options.transformTagName){l=this.options.transformTagName(l)}if(r&&n){if(r.tagname!=="!xml"){n=this.saveTextToParentTag(n,r,i,false)}}const m=r;if(m&&this.options.unpairedTags.indexOf(m.tagname)!==-1){r=this.tagsNodeStack.pop();i=i.substring(0,i.lastIndexOf("."))}if(l!==t.tagname){i+=i?"."+l:l}if(this.isItStopNode(this.options.stopNodes,i,l)){let h="";if(d.length>0&&d.lastIndexOf("/")===d.length-1){s=u.closeIndex}else if(this.options.unpairedTags.indexOf(l)!==-1){s=u.closeIndex}else{const _=this.readStopNodeData(e,c,f+1);if(!_)throw new Error(`Unexpected end of ${c}`);s=_.i;h=_.tagContent}const g=new _L(l);if(l!==d&&p){g[":@"]=this.buildAttributesMap(d,i,l)}if(h){h=this.parseTextData(h,l,i,true,p,true,true)}i=i.substr(0,i.lastIndexOf("."));g.add(this.options.textNodeName,h);this.addChild(r,g,i)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){if(l[l.length-1]==="/"){l=l.substr(0,l.length-1);i=i.substr(0,i.length-1);d=l}else{d=d.substr(0,d.length-1)}if(this.options.transformTagName){l=this.options.transformTagName(l)}const h=new _L(l);if(l!==d&&p){h[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,h,i);i=i.substr(0,i.lastIndexOf("."))}else{const h=new _L(l);this.tagsNodeStack.push(r);if(l!==d&&p){h[":@"]=this.buildAttributesMap(d,i,l)}this.addChild(r,h,i);r=h}n="";s=f}}}else{n+=e[s]}}return t.child},"parseXml");function Pdn(e,t,r){const n=this.options.updateTag(t.tagname,r,t[":@"]);if(n===false){}else if(typeof n==="string"){t.tagname=n;e.addChild(t)}else{e.addChild(t)}}a(Pdn,"addChild");var Ndn=a(function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){const r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities){for(let t in this.htmlEntities){const r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e},"replaceEntitiesValue");function Idn(e,t,r,n){if(e){if(n===void 0)n=Object.keys(t.child).length===0;e=this.parseTextData(e,t.tagname,r,false,t[":@"]?Object.keys(t[":@"]).length!==0:false,n);if(e!==void 0&&e!=="")t.add(this.options.textNodeName,e);e=""}return e}a(Idn,"saveTextToParentTag");function kdn(e,t,r){const n="*."+r;for(const i in e){const s=e[i];if(n===s||t===s)return true}return false}a(kdn,"isItStopNode");function Ddn(e,t,r=">"){let n;let i="";for(let s=t;s<e.length;s++){let o=e[s];if(n){if(o===n)n=""}else if(o==='"'||o==="'"){n=o}else if(o===r[0]){if(r[1]){if(e[s+1]===r[1]){return{data:i,index:s}}}else{return{data:i,index:s}}}else if(o===" "){o=" "}i+=o}}a(Ddn,"tagExpWithClosingIndex");function RA(e,t,r,n){const i=e.indexOf(t,r);if(i===-1){throw new Error(n)}else{return i+t.length-1}}a(RA,"findClosingIndex");function zSe(e,t,r,n=">"){const i=Ddn(e,t+1,n);if(!i)return;let s=i.data;const o=i.index;const u=s.search(/\s/);let l=s;let c=true;if(u!==-1){l=s.substr(0,u).replace(/\s\s*$/,"");s=s.substr(u+1)}const d=l;if(r){const p=l.indexOf(":");if(p!==-1){l=l.substr(p+1);c=l!==i.data.substr(p+1)}}return{tagName:l,tagExp:s,closeIndex:o,attrExpPresent:c,rawTagName:d}}a(zSe,"readTagExp");function Ldn(e,t,r){const n=r;let i=1;for(;r<e.length;r++){if(e[r]==="<"){if(e[r+1]==="/"){const s=RA(e,">",r,`${t} is not closed`);let o=e.substring(r+2,s).trim();if(o===t){i--;if(i===0){return{tagContent:e.substring(n,r),i:s}}}r=s}else if(e[r+1]==="?"){const s=RA(e,"?>",r+1,"StopNode is not closed.");r=s}else if(e.substr(r+1,3)==="!--"){const s=RA(e,"-->",r+3,"StopNode is not closed.");r=s}else if(e.substr(r+1,2)==="!["){const s=RA(e,"]]>",r,"StopNode is not closed.")-2;r=s}else{const s=zSe(e,r,">");if(s){const o=s&&s.tagName;if(o===t&&s.tagExp[s.tagExp.length-1]!=="/"){i++}r=s.closeIndex}}}}}a(Ldn,"readStopNodeData");function KSe(e,t,r){if(t&&typeof e==="string"){const n=e.trim();if(n==="true")return true;else if(n==="false")return false;else return Adn(e,r)}else{if(WSe.isExist(e)){return e}else{return""}}}a(KSe,"parseValue");R_t.exports=VSe});var I_t=y(N_t=>{"use strict";function Fdn(e,t){return P_t(e,t)}a(Fdn,"prettify");function P_t(e,t,r){let n;const i={};for(let s=0;s<e.length;s++){const o=e[s];const u=Bdn(o);let l="";if(r===void 0)l=u;else l=r+"."+u;if(u===t.textNodeName){if(n===void 0)n=o[u];else n+=""+o[u]}else if(u===void 0){continue}else if(o[u]){let c=P_t(o[u],t,l);const d=qdn(c,t);if(o[":@"]){Mdn(c,o[":@"],l,t)}else if(Object.keys(c).length===1&&c[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode){c=c[t.textNodeName]}else if(Object.keys(c).length===0){if(t.alwaysCreateTextNode)c[t.textNodeName]="";else c=""}if(i[u]!==void 0&&i.hasOwnProperty(u)){if(!Array.isArray(i[u])){i[u]=[i[u]]}i[u].push(c)}else{if(t.isArray(u,l,d)){i[u]=[c]}else{i[u]=c}}}}if(typeof n==="string"){if(n.length>0)i[t.textNodeName]=n}else if(n!==void 0)i[t.textNodeName]=n;return i}a(P_t,"compress");function Bdn(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];if(n!==":@")return n}}a(Bdn,"propName");function Mdn(e,t,r,n){if(t){const i=Object.keys(t);const s=i.length;for(let o=0;o<s;o++){const u=i[o];if(n.isArray(u,r+"."+u,true,true)){e[u]=[t[u]]}else{e[u]=t[u]}}}}a(Mdn,"assignAttributes");function qdn(e,t){const{textNodeName:r}=t;const n=Object.keys(e).length;if(n===0){return true}if(n===1&&(e[r]||typeof e[r]==="boolean"||e[r]===0)){return true}return false}a(qdn,"isLeafTag");N_t.prettify=Fdn});var D_t=y((mPs,k_t)=>{var{buildOptions:Udn}=S_t();var $dn=O_t();var{prettify:jdn}=I_t();var Gdn=$Se();var YSe=class{static{a(this,"XMLParser")}constructor(t){this.externalEntities={};this.options=Udn(t)}parse(t,r){if(typeof t==="string"){}else if(t.toString){t=t.toString()}else{throw new Error("XML data is accepted in String or Bytes[] form.")}if(r){if(r===true)r={};const s=Gdn.validate(t,r);if(s!==true){throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}}const n=new $dn(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);if(this.options.preserveOrder||i===void 0)return i;else return jdn(i,this.options)}addEntity(t,r){if(r.indexOf("&")!==-1){throw new Error("Entity value can't have '&'")}else if(t.indexOf("&")!==-1||t.indexOf(";")!==-1){throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'")}else if(r==="&"){throw new Error("An entity with value '&' is not permitted")}else{this.externalEntities[t]=r}}};k_t.exports=YSe});var q_t=y((gPs,M_t)=>{var Hdn="\n";function Vdn(e,t){let r="";if(t.format&&t.indentBy.length>0){r=Hdn}return F_t(e,t,"",r)}a(Vdn,"toXml");function F_t(e,t,r,n){let i="";let s=false;for(let o=0;o<e.length;o++){const u=e[o];const l=zdn(u);if(l===void 0)continue;let c="";if(r.length===0)c=l;else c=`${r}.${l}`;if(l===t.textNodeName){let h=u[l];if(!Kdn(c,t)){h=t.tagValueProcessor(l,h);h=B_t(h,t)}if(s){i+=n}i+=h;s=false;continue}else if(l===t.cdataPropName){if(s){i+=n}i+=`<![CDATA[${u[l][0][t.textNodeName]}]]>`;s=false;continue}else if(l===t.commentPropName){i+=n+`<!--${u[l][0][t.textNodeName]}-->`;s=true;continue}else if(l[0]==="?"){const h=L_t(u[":@"],t);const g=l==="?xml"?"":n;let _=u[l][0][t.textNodeName];_=_.length!==0?" "+_:"";i+=g+`<${l}${_}${h}?>`;s=true;continue}let d=n;if(d!==""){d+=t.indentBy}const p=L_t(u[":@"],t);const f=n+`<${l}${p}`;const m=F_t(u[l],t,c,d);if(t.unpairedTags.indexOf(l)!==-1){if(t.suppressUnpairedNode)i+=f+">";else i+=f+"/>"}else if((!m||m.length===0)&&t.suppressEmptyNode){i+=f+"/>"}else if(m&&m.endsWith(">")){i+=f+`>${m}${n}</${l}>`}else{i+=f+">";if(m&&n!==""&&(m.includes("/>")||m.includes("</"))){i+=n+t.indentBy+m+n}else{i+=m}i+=`</${l}>`}s=true}return i}a(F_t,"arrToStr");function zdn(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const n=t[r];if(!e.hasOwnProperty(n))continue;if(n!==":@")return n}}a(zdn,"propName");function L_t(e,t){let r="";if(e&&!t.ignoreAttributes){for(let n in e){if(!e.hasOwnProperty(n))continue;let i=t.attributeValueProcessor(n,e[n]);i=B_t(i,t);if(i===true&&t.suppressBooleanAttributes){r+=` ${n.substr(t.attributeNamePrefix.length)}`}else{r+=` ${n.substr(t.attributeNamePrefix.length)}="${i}"`}}}return r}a(L_t,"attr_to_str");function Kdn(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let r=e.substr(e.lastIndexOf(".")+1);for(let n in t.stopNodes){if(t.stopNodes[n]===e||t.stopNodes[n]==="*."+r)return true}return false}a(Kdn,"isStopNode");function B_t(e,t){if(e&&e.length>0&&t.processEntities){for(let r=0;r<t.entities.length;r++){const n=t.entities[r];e=e.replace(n.regex,n.val)}}return e}a(B_t,"replaceEntitiesValue");M_t.exports=Vdn});var $_t=y((_Ps,U_t)=>{"use strict";var Wdn=q_t();var Ydn={attributeNamePrefix:"@_",attributesGroupName:false,textNodeName:"#text",ignoreAttributes:true,cdataPropName:false,format:false,indentBy:" ",suppressEmptyNode:false,suppressUnpairedNode:true,suppressBooleanAttributes:true,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:false,commentPropName:false,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:true,stopNodes:[],oneListGroup:false};function cE(e){this.options=Object.assign({},Ydn,e);if(this.options.ignoreAttributes||this.options.attributesGroupName){this.isAttribute=function(){return false}}else{this.attrPrefixLen=this.options.attributeNamePrefix.length;this.isAttribute=Qdn}this.processTextOrObjNode=Xdn;if(this.options.format){this.indentate=Jdn;this.tagEndChar=">\n";this.newLine="\n"}else{this.indentate=function(){return""};this.tagEndChar=">";this.newLine=""}}a(cE,"Builder");cE.prototype.build=function(e){if(this.options.preserveOrder){return Wdn(e,this.options)}else{if(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1){e={[this.options.arrayNodeName]:e}}return this.j2x(e,0).val}};cE.prototype.j2x=function(e,t){let r="";let n="";for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;if(typeof e[i]==="undefined"){if(this.isAttribute(i)){n+=""}}else if(e[i]===null){if(this.isAttribute(i)){n+=""}else if(i[0]==="?"){n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar}else{n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar}}else if(e[i]instanceof Date){n+=this.buildTextValNode(e[i],i,"",t)}else if(typeof e[i]!=="object"){const s=this.isAttribute(i);if(s){r+=this.buildAttrPairStr(s,""+e[i])}else{if(i===this.options.textNodeName){let o=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(o)}else{n+=this.buildTextValNode(e[i],i,"",t)}}}else if(Array.isArray(e[i])){const s=e[i].length;let o="";for(let u=0;u<s;u++){const l=e[i][u];if(typeof l==="undefined"){}else if(l===null){if(i[0]==="?")n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar;else n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar}else if(typeof l==="object"){if(this.options.oneListGroup){o+=this.j2x(l,t+1).val}else{o+=this.processTextOrObjNode(l,i,t)}}else{o+=this.buildTextValNode(l,i,"",t)}}if(this.options.oneListGroup){o=this.buildObjectNode(o,i,"",t)}n+=o}else{if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const s=Object.keys(e[i]);const o=s.length;for(let u=0;u<o;u++){r+=this.buildAttrPairStr(s[u],""+e[i][s[u]])}}else{n+=this.processTextOrObjNode(e[i],i,t)}}}return{attrStr:r,val:n}};cE.prototype.buildAttrPairStr=function(e,t){t=this.options.attributeValueProcessor(e,""+t);t=this.replaceEntitiesValue(t);if(this.options.suppressBooleanAttributes&&t==="true"){return" "+e}else return" "+e+'="'+t+'"'};function Xdn(e,t,r){const n=this.j2x(e,r+1);if(e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1){return this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r)}else{return this.buildObjectNode(n.val,t,n.attrStr,r)}}a(Xdn,"processTextOrObjNode");cE.prototype.buildObjectNode=function(e,t,r,n){if(e===""){if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;else{return this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar}}else{let i="</"+t+this.tagEndChar;let s="";if(t[0]==="?"){s="?";i=""}if((r||r==="")&&e.indexOf("<")===-1){return this.indentate(n)+"<"+t+r+s+">"+e+i}else if(this.options.commentPropName!==false&&t===this.options.commentPropName&&s.length===0){return this.indentate(n)+`<!--${e}-->`+this.newLine}else{return this.indentate(n)+"<"+t+r+s+this.tagEndChar+e+this.indentate(n)+i}}};cE.prototype.closeTag=function(e){let t="";if(this.options.unpairedTags.indexOf(e)!==-1){if(!this.options.suppressUnpairedNode)t="/"}else if(this.options.suppressEmptyNode){t="/"}else{t=`></${e}`}return t};cE.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==false&&t===this.options.cdataPropName){return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine}else if(this.options.commentPropName!==false&&t===this.options.commentPropName){return this.indentate(n)+`<!--${e}-->`+this.newLine}else if(t[0]==="?"){return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar}else{let i=this.options.tagValueProcessor(t,e);i=this.replaceEntitiesValue(i);if(i===""){return this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar}else{return this.indentate(n)+"<"+t+r+">"+i+"</"+t+this.tagEndChar}}};cE.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities){for(let t=0;t<this.options.entities.length;t++){const r=this.options.entities[t];e=e.replace(r.regex,r.val)}}return e};function Jdn(e){return this.options.indentBy.repeat(e)}a(Jdn,"indentate");function Qdn(e){if(e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName){return e.substr(this.attrPrefixLen)}else{return false}}a(Qdn,"isAttribute");U_t.exports=cE});var G_t=y((EPs,j_t)=>{"use strict";var Zdn=$Se();var epn=D_t();var tpn=$_t();j_t.exports={XMLParser:epn,XMLValidator:Zdn,XMLBuilder:tpn}});var W_t=y(Pl=>{"use strict";var rpn=Pl&&Pl.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var npn=Pl&&Pl.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var ipn=Pl&&Pl.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))rpn(t,e,r)}npn(t,e);return t};var OA=Pl&&Pl.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var K_t=Pl&&Pl.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};var my;var uY;var EL;Object.defineProperty(Pl,"__esModule",{value:true});Pl.TransferManager=Pl.MultiPartUploadError=void 0;var vL=K_t(mSe());var dE=ipn(require("path"));var aY=require("fs");var spn=dL();var apn=eW();var H_t=G_t();var oY=K_t(tL());var opn=require("crypto");var XSe=CA();var V_t=P0();var upn=VR();var lpn=(0,upn.getPackageJSON)();var cpn=5;var dpn=5;var ppn=5;var fpn=32*1024*1024;var mpn=32*1024*1024;var hpn=32*1024*1024;var z_t=5;var gpn="(?:)";var oO={UPLOAD_MANY:"tm.upload_many",DOWNLOAD_MANY:"tm.download_many",UPLOAD_SHARDED:"tm.upload_sharded",DOWNLOAD_SHARDED:"tm.download_sharded"};var ypn=a((e,t,r,n)=>{return new JSe(e,t,r,n)},"defaultMultiPartGenerator");var bL=class extends Error{static{a(this,"MultiPartUploadError")}constructor(t,r,n){super(t);this.uploadId=r;this.partsMap=n}};Pl.MultiPartUploadError=bL;var JSe=class{static{a(this,"XMLMultiPartUploadHelper")}constructor(t,r,n,i){my.add(this);this.authClient=t.storage.authClient||new apn.GoogleAuth;this.uploadId=n||"";this.bucket=t;this.fileName=r;this.baseUrl=`https://${t.name}.${new URL(this.bucket.storage.apiEndpoint).hostname}/${r}`;this.xmlBuilder=new H_t.XMLBuilder({arrayNodeName:"Part"});this.xmlParser=new H_t.XMLParser;this.partsMap=i||new Map;this.retryOptions={retries:this.bucket.storage.retryOptions.maxRetries,factor:this.bucket.storage.retryOptions.retryDelayMultiplier,maxTimeout:this.bucket.storage.retryOptions.maxRetryDelay*1e3,maxRetryTime:this.bucket.storage.retryOptions.totalTimeout*1e3}}async initiateUpload(t={}){const r=`${this.baseUrl}?uploads`;return(0,oY.default)(async n=>{try{const i=await this.authClient.request({headers:OA(this,my,"m",uY).call(this,t),method:"POST",url:r});if(i.data&&i.data.error){throw i.data.error}const s=this.xmlParser.parse(i.data);this.uploadId=s.InitiateMultipartUploadResult.UploadId}catch(i){OA(this,my,"m",EL).call(this,i,n)}},this.retryOptions)}async uploadPart(t,r,n){const i=`${this.baseUrl}?partNumber=${t}&uploadId=${this.uploadId}`;let s=OA(this,my,"m",uY).call(this);if(n==="md5"){const o=(0,opn.createHash)("md5").update(r).digest("base64");s={"Content-MD5":o}}return(0,oY.default)(async o=>{try{const u=await this.authClient.request({url:i,method:"PUT",body:r,headers:s});if(u.data&&u.data.error){throw u.data.error}this.partsMap.set(t,u.headers["etag"])}catch(u){OA(this,my,"m",EL).call(this,u,o)}},this.retryOptions)}async completeUpload(){const t=`${this.baseUrl}?uploadId=${this.uploadId}`;const r=new Map([...this.partsMap.entries()].sort((s,o)=>s[0]-o[0]));const n=[];for(const s of r.entries()){n.push({PartNumber:s[0],ETag:s[1]})}const i=`<CompleteMultipartUpload>${this.xmlBuilder.build(n)}</CompleteMultipartUpload>`;return(0,oY.default)(async s=>{try{const o=await this.authClient.request({headers:OA(this,my,"m",uY).call(this),url:t,method:"POST",body:i});if(o.data&&o.data.error){throw o.data.error}return o}catch(o){OA(this,my,"m",EL).call(this,o,s);return}},this.retryOptions)}async abortUpload(){const t=`${this.baseUrl}?uploadId=${this.uploadId}`;return(0,oY.default)(async r=>{try{const n=await this.authClient.request({url:t,method:"DELETE"});if(n.data&&n.data.error){throw n.data.error}}catch(n){OA(this,my,"m",EL).call(this,n,r);return}},this.retryOptions)}};my=new WeakSet,uY=a(function e(t={}){let r=false;let n=false;for(const[i,s]of Object.entries(t)){if(i.toLocaleLowerCase().trim()==="x-goog-api-client"){r=true;if(!s.includes(oO.UPLOAD_SHARDED)){t[i]=`${s} gccl-gcs-cmd/${oO.UPLOAD_SHARDED}`}}else if(i.toLocaleLowerCase().trim()==="user-agent"){n=true}}if(!r){t["x-goog-api-client"]=`${(0,V_t.getRuntimeTrackingString)()} gccl/${lpn.version} gccl-gcs-cmd/${oO.UPLOAD_SHARDED}`}if(!n){t["User-Agent"]=(0,V_t.getUserAgentString)()}return t},"_XMLMultiPartUploadHelper_setGoogApiClientHeaders"),EL=a(function e(t,r){if(this.bucket.storage.retryOptions.autoRetry&&this.bucket.storage.retryOptions.retryableErrorFn(t)){throw t}else{r(t)}},"_XMLMultiPartUploadHelper_handleErrorResponse");var QSe=class{static{a(this,"TransferManager")}constructor(t){this.bucket=t}async uploadManyFiles(t,r={}){var n;if(r.skipIfExists&&((n=r.passthroughOptions)===null||n===void 0?void 0:n.preconditionOpts)){r.passthroughOptions.preconditionOpts.ifGenerationMatch=0}else if(r.skipIfExists&&r.passthroughOptions===void 0){r.passthroughOptions={preconditionOpts:{ifGenerationMatch:0}}}const i=(0,vL.default)(r.concurrencyLimit||cpn);const s=[];let o=[];if(!Array.isArray(t)){for await(const u of this.getPathsFromDirectory(t)){o.push(u)}}else{o=t}for(const u of o){const l=await aY.promises.lstat(u);if(l.isDirectory()){continue}const c={...r.passthroughOptions,[XSe.GCCL_GCS_CMD_KEY]:oO.UPLOAD_MANY};c.destination=u.split(dE.sep).join(dE.posix.sep);if(r.prefix){c.destination=dE.posix.join(...r.prefix.split(dE.sep),c.destination)}s.push(i(()=>this.bucket.upload(u,c)))}return Promise.all(s)}async downloadManyFiles(t,r={}){const n=(0,vL.default)(r.concurrencyLimit||dpn);const i=[];let s=[];if(!Array.isArray(t)){const l=await this.bucket.getFiles({prefix:t});s=l[0]}else{s=t.map(l=>{if(typeof l==="string"){return this.bucket.file(l)}return l})}const o=r.stripPrefix?`^${r.stripPrefix}`:gpn;const u=new RegExp(o,"g");for(const l of s){const c={...r.passthroughOptions,[XSe.GCCL_GCS_CMD_KEY]:oO.DOWNLOAD_MANY};if(r.prefix){c.destination=dE.join(r.prefix||"",c.destination||"",l.name)}if(r.stripPrefix){c.destination=l.name.replace(u,"")}i.push(n(()=>l.download(c)))}return Promise.all(i)}async downloadFileInChunks(t,r={}){let n=r.chunkSizeBytes||mpn;let i=(0,vL.default)(r.concurrencyLimit||ppn);const s=[];const o=typeof t==="string"?this.bucket.file(t):t;const u=await o.get();const l=parseInt(u[0].metadata.size.toString());if(l<fpn){i=(0,vL.default)(1);n=l}let c=0;const d=r.destination||dE.basename(o.name);const p=await aY.promises.open(d,"w");while(c<l){const m=c;let h=c+n-1;h=h>l?l:h;s.push(i(async()=>{const g=await o.download({start:m,end:h,[XSe.GCCL_GCS_CMD_KEY]:oO.DOWNLOAD_SHARDED});return p.write(g[0],0,g[0].length,m)}));c+=n}let f;try{const m=await Promise.all(s);f=m.map(h=>h.buffer);if(r.validation==="crc32c"){await spn.CRC32C.fromFile(d)}return f}finally{p.close()}}async uploadFileInChunks(t,r={},n=ypn){const i=r.chunkSizeBytes||hpn;const s=(0,vL.default)(r.concurrencyLimit||z_t);const o=r.maxQueueSize||r.concurrencyLimit||z_t;const u=r.uploadName||dE.basename(t);const l=n(this.bucket,u,r.uploadId,r.partsMap);let c=1;let d=[];try{if(r.uploadId===void 0){await l.initiateUpload(r.headers)}const p=l.partsMap.size*i;const f=(0,aY.createReadStream)(t,{highWaterMark:i,start:p});for await(const m of f){if(d.length>=o){await Promise.all(d);d=[]}d.push(s(()=>l.uploadPart(c++,m,r.validation)))}await Promise.all(d);return await l.completeUpload()}catch(p){if((r.autoAbortFailure===void 0||r.autoAbortFailure)&&l.uploadId){try{await l.abortUpload();return}catch(f){throw new bL(f.message,l.uploadId,l.partsMap)}}throw new bL(p.message,l.uploadId,l.partsMap)}}async*getPathsFromDirectory(t){const r=await aY.promises.readdir(t,{withFileTypes:true});for(const n of r){const i=dE.join(t,n.name);n.isDirectory()?yield*this.getPathsFromDirectory(i):yield i}}};Pl.TransferManager=QSe});var X_t=y(Gs=>{"use strict";var _pn=Gs&&Gs.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var ZSe=Gs&&Gs.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))_pn(t,e,r)};Object.defineProperty(Gs,"__esModule",{value:true});Gs.Notification=Gs.Iam=Gs.HmacKey=Gs.File=Gs.Channel=Gs.Bucket=Gs.Storage=Gs.IdempotencyStrategy=Gs.ApiError=void 0;var vpn=tE();Object.defineProperty(Gs,"ApiError",{enumerable:true,get:function(){return vpn.ApiError}});var Y_t=tO();Object.defineProperty(Gs,"IdempotencyStrategy",{enumerable:true,get:function(){return Y_t.IdempotencyStrategy}});Object.defineProperty(Gs,"Storage",{enumerable:true,get:function(){return Y_t.Storage}});var Epn=WW();Object.defineProperty(Gs,"Bucket",{enumerable:true,get:function(){return Epn.Bucket}});ZSe(dL(),Gs);var bpn=FSe();Object.defineProperty(Gs,"Channel",{enumerable:true,get:function(){return bpn.Channel}});var Spn=pL();Object.defineProperty(Gs,"File",{enumerable:true,get:function(){return Spn.File}});ZSe(TSe(),Gs);var Apn=BSe();Object.defineProperty(Gs,"HmacKey",{enumerable:true,get:function(){return Apn.HmacKey}});var Cpn=NSe();Object.defineProperty(Gs,"Iam",{enumerable:true,get:function(){return Cpn.Iam}});var wpn=ISe();Object.defineProperty(Gs,"Notification",{enumerable:true,get:function(){return wpn.Notification}});ZSe(W_t(),Gs)});var tAe=y(_i=>{"use strict";var eAe=_i&&_i.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(_i,"__esModule",{value:true});_i.deleteFolder=_i.untar=_i.tarFolderContent=_i.getParentDirFilename=_i.safePath=_i.UnsafePathError=_i.ensureDirectoryExists=_i.mkdirForFilePathIfNotExits=_i.mkdirIfNotExists=_i.listFolderContents=_i.listFolders=_i.isNotFileOrDirectory=_i.dirExists=_i.deleteFile=_i.fileExists=void 0;var J_t=eAe(require("child_process"));var fE=eAe(require("fs/promises"));var pE=eAe(require("path"));var Q_t=[".git","node_modules",".yarn",".DS_Store"];async function Tpn(e){try{const t=await fE.default.stat(e);return t.isFile()}catch(t){return false}}a(Tpn,"fileExists");_i.fileExists=Tpn;async function xpn(e,t){return await fE.default.rm(e,t)}a(xpn,"deleteFile");_i.deleteFile=xpn;async function cY(e){try{const t=await fE.default.stat(e);return t.isDirectory()}catch(t){return false}}a(cY,"dirExists");_i.dirExists=cY;async function Rpn(e){try{await fE.default.stat(e);return false}catch(t){return true}}a(Rpn,"isNotFileOrDirectory");_i.isNotFileOrDirectory=Rpn;function Opn(e,t){const r=new RegExp(`(.*)(\\/${t})$|(.*)(${t}\\/)`);const n=e.match(r);if(!n){return""}const i=e.split(n[0]);return i[1]===""?"":`/${i[1]}`}a(Opn,"getParentDirectory");async function Ppn(e){if(!await cY(e)){return[]}const t=await fE.default.readdir(e,{withFileTypes:true});const r=[];for await(const n of t){if(!Q_t.includes(n.name)){if(n.isDirectory()){r.push(n.name)}}}return r}a(Ppn,"listFolders");_i.listFolders=Ppn;async function Z_t(e,t,r=true){const n=Opn(e,t);const i=await fE.default.readdir(e,{withFileTypes:true});const s=[];for await(const o of i){if(!Q_t.includes(o.name)||!r){if(o.isDirectory()){const u=await Z_t(pE.default.join(e,o.name),t,r);s.push(...u)}else{s.push(pE.default.join(n,o.name))}}}return s}a(Z_t,"listFolderContents");_i.listFolderContents=Z_t;var Npn=a(async e=>{if(await cY(e)){return true}await fE.default.mkdir(e,{recursive:true})},"mkdirIfNotExists");_i.mkdirIfNotExists=Npn;var Ipn=a(async e=>{const t=pE.default.dirname(e);return(0,_i.mkdirIfNotExists)(t)},"mkdirForFilePathIfNotExits");_i.mkdirForFilePathIfNotExits=Ipn;_i.ensureDirectoryExists=_i.mkdirForFilePathIfNotExits;var lY=class extends Error{static{a(this,"UnsafePathError")}constructor(t){super(t)}};_i.UnsafePathError=lY;function kpn(e){const t=a(r=>{if(!r.startsWith(e)){throw new lY(`Resolved path is not part of the project.`)}return r},"ensureSafePath");return{resolve:(...r)=>t(pE.default.resolve(...r))}}a(kpn,"safePath");_i.safePath=kpn;function Dpn(e){return`${pE.default.basename(pE.default.dirname(e))}/${pE.default.basename(e)}`}a(Dpn,"getParentDirFilename");_i.getParentDirFilename=Dpn;function Lpn(e,t,r,n){const i=pE.default.join(n,r);J_t.default.execSync(`tar --exclude='.git/' --exclude='dist/' -czf ${i} ${t}`,{cwd:e});return i}a(Lpn,"tarFolderContent");_i.tarFolderContent=Lpn;function Fpn(e,t,r,n=false){J_t.default.execSync(`tar -xf ${t} ${n?"--strip-components=1 ":""}-C ${r}`,{cwd:e})}a(Fpn,"untar");_i.untar=Fpn;async function Bpn(e){if(await cY(e)){return await fE.default.rm(e,{recursive:true})}}a(Bpn,"deleteFolder");_i.deleteFolder=Bpn});var ivt=y(ti=>{"use strict";var Mpn=ti&&ti.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var qpn=ti&&ti.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var Upn=ti&&ti.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Mpn(t,e,r)}qpn(t,e);return t};var evt=ti&&ti.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(ti,"__esModule",{value:true});ti.uploadFolderAndRemoveMissingSourceFiles=ti.cleanGCPFilePaths=ti.uploadFolder=ti.deleteDirectory=ti.deleteFile=ti.listFolderContent=ti.readFileStream=ti.fileExists=ti.getFileContents=ti.downloadFile=ti.uploadFromMemory=ti.uploadFile=ti.getBucket=ti.BucketName=void 0;var $pn=X_t();var hy=evt(require("path"));var B0=evt(Zd());var dY=Upn(tAe());var PA;(function(e){e[e["Archive"]=0]="Archive";e[e["Bundle"]=1]="Bundle";e[e["SourceCode"]=2]="SourceCode";e[e["Sources"]=3]="Sources";e[e["DevPortalBuild"]=4]="DevPortalBuild"})(PA||(ti.BucketName=PA={}));function M0(e){let t;if(e===PA.Archive){if(B0.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_ARCHIVE_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_ARCHIVE_BUCKET_NAME}else if(e===PA.Bundle){if(B0.default.GCP_STORAGE_BUNDLE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_BUNDLE_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_BUNDLE_BUCKET_NAME}else if(e===PA.SourceCode){if(B0.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCE_CODE_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_SOURCE_CODE_BUCKET_NAME}else if(e===PA.Sources){if(B0.default.GCP_STORAGE_SOURCES_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_SOURCES_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_SOURCES_BUCKET_NAME}else if(e===PA.DevPortalBuild){if(B0.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME===void 0){throw new Error(`Environment variable GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME must be set`)}t=B0.default.GCP_STORAGE_DEV_PORTAL_BUILD_BUCKET_NAME}else{throw new Error("Invalid value for argument 'bucketName'")}const r=new $pn.Storage;return r.bucket(t)}a(M0,"getBucket");ti.getBucket=M0;async function rAe(e,t,r,n,i){try{await M0(e).upload(t,{destination:r,metadata:i})}catch(s){n.info(`File upload for ${e}/${r} ran into an issue`);n.error(s)}}a(rAe,"uploadFile");ti.uploadFile=rAe;async function jpn(e,t,r,n,i){try{await M0(e).file(r).save(t,i)}catch(s){n.info(`From Memory upload for ${e}/${r} ran into an issue`);n.error(s)}}a(jpn,"uploadFromMemory");ti.uploadFromMemory=jpn;async function Gpn(e,t,r,n){try{const i={destination:r};await M0(e).file(t).download(i);n.info(`File ${e}/${t} successfully downloaded to ${r}`)}catch(i){n.info(`Downloading file ${e}/${t} ran into an issue`);n.error(i)}}a(Gpn,"downloadFile");ti.downloadFile=Gpn;async function Hpn(e,t,r){try{const n=await M0(e).file(t).download();r.info(`File ${e}/${t} successfully downloaded to memory`);return n.toString()}catch(n){r.info(`Downloading file ${e}/${t} ran into an issue`);r.error(n)}}a(Hpn,"getFileContents");ti.getFileContents=Hpn;async function Vpn(e,t,r){try{r.info(`Check if file ${e}/${t} exists in storage`);const n=await M0(e).file(t).exists();return n[0]}catch(n){r.info(`Ran into an issue while checking if a file ${e}/${t} exists in storage`);r.error(n);return false}}a(Vpn,"fileExists");ti.fileExists=Vpn;function zpn(e,t,r){r.info(`Reading file ${e}/${t} from storage`);return M0(e).file(t).createReadStream({decompress:true})}a(zpn,"readFileStream");ti.readFileStream=zpn;async function tvt(e,t,r){const n=new Set;try{const[i]=await M0(e).getFiles({prefix:t});for(let s=0;s<i.length;s++){const o=i[s];const u=o.name.replace(t,"");if(u===""){continue}const l=u.split("/");if(l.length>1){for(let c=0;c<l.length-1;c++){const d=`/${l[c]}`;if(!n.has(d)){n.add(d)}}}n.add(`/${u}`)}}catch(i){r.info(`Ran into an issue while listing files in ${e}/${t} storage path`);r.error(i)}return[...n]}a(tvt,"listFolderContent");ti.listFolderContent=tvt;async function rvt(e,t,r){try{r.info(`Deleting file ${e}/${t} from storage`);await M0(e).file(t).delete()}catch(n){r.warn(`Failed to delete file ${e}/${t} from storage`);r.error(n)}}a(rvt,"deleteFile");ti.deleteFile=rvt;async function Kpn(e,t,r){try{r.info(`Deleting directory ${e}/${t} from storage`);await M0(e).deleteFiles({prefix:t})}catch(n){r.info(`Failed to delete directory ${e}/${t} from storage`);r.error(n)}}a(Kpn,"deleteDirectory");ti.deleteDirectory=Kpn;async function Wpn(e,t,r,n,i){try{n.info(`Upload folder ${hy.default.basename(t)}`);if(await dY.dirExists(t)){const s=await dY.listFolderContents(t,hy.default.basename(t));if(s&&s.length>0){await Promise.all(s.map(async o=>{return await rAe(e,hy.default.join(t,o),hy.default.join(r,o),n,i)}))}}}catch(s){n.warn(`Failed to upload directory ${t} to bucket ${e}`,s)}}a(Wpn,"uploadFolder");ti.uploadFolder=Wpn;function nvt(e){const t=e.filter(r=>r!=="/").map(r=>r.replace(/^\/+/,""));return t}a(nvt,"cleanGCPFilePaths");ti.cleanGCPFilePaths=nvt;async function Ypn(e,t,r,n,i){try{n.info(`uploadFolderAndRemoveMissingSourceFiles: upload folder ${hy.default.basename(t)}`);if(await dY.dirExists(t)){const s=await tvt(e,r,n);const o=nvt(s);const u=await dY.listFolderContents(t,hy.default.basename(t));const l=o.filter(c=>!u.includes(c)).map(c=>hy.default.join(r,c));await Promise.all(l.map(async c=>{return await rvt(e,c,n)}));await Promise.all(u.map(async c=>{return await rAe(e,hy.default.join(t,c),hy.default.join(r,c),n,i)}))}}catch(s){n.warn(`Failed to upload directory ${t} to bucket ${e}`,s)}}a(Ypn,"uploadFolderAndRemoveMissingSourceFiles");ti.uploadFolderAndRemoveMissingSourceFiles=Ypn});var svt=y(pY=>{"use strict";Object.defineProperty(pY,"__esModule",{value:true});pY.graphQL=void 0;var q0=ac();async function Xpn(e,t,r){const n=await fetch(`https://api.github.com/graphql`,{method:"POST",headers:{Authorization:`Bearer ${t}`},body:e});if(n.status===401){r.warn("Failed GitHub GraphQL query with status 401. User token might have been revoked directly in GitHub.");throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_REVOKED_ACCESS)}if(n.status===403){r.warn("Failed GitHub GraphQL query with status 403. User token does not have correct permissions to query this GitHub API.");throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===404){r.warn("Failed GitHub GraphQL query with status 404. User token has been revoked and can not query this GitHub API.");throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}if(n.status===400){const i=await n.json();r.warn("Failed GitHub GraphQL query with status 400. A malformed query was ran against the GitHub API.",i);throw new q0.ApiError(q0.Problems.BAD_REQUEST)}if(n.status!==200&&n.status!==304){r.warn(`Failed GitHub GraphQL query with status ${n.status}. There was an unexpected error querying the GitHub API.`);throw new q0.ApiError(q0.Problems.SOURCE_CONTROL_GH_APP_CONFIG_REQUIRED)}return n}a(Xpn,"graphQL");pY.graphQL=Xpn});var dvt=y(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:true});Ef.SourceControlProvider=Ef.PlanType=Ef.EnvironmentType=Ef.EnvironmentTarget=Ef.DeploymentState=void 0;var avt;(function(e){e[e["IS_STARTING"]=0]="IS_STARTING";e[e["STARTED"]=1]="STARTED";e[e["STOPPED"]=2]="STOPPED";e[e["ERRORED"]=3]="ERRORED"})(avt||(Ef.DeploymentState=avt={}));var ovt;(function(e){e["CLOUDFLARE"]="CLOUDFLARE";e["KNATIVE"]="KNATIVE"})(ovt||(Ef.EnvironmentTarget=ovt={}));var uvt;(function(e){e["PRODUCTION"]="PRODUCTION";e["PREVIEW"]="PREVIEW";e["WORKING_COPY"]="WORKING_COPY"})(uvt||(Ef.EnvironmentType=uvt={}));var lvt;(function(e){e["FREE_V1"]="FREE_V1";e["BUILDER_V1"]="BUILDER_V1";e["BUSINESS_V1"]="BUSINESS_V1";e["CUSTOM"]="CUSTOM";e["EMPLOYEE"]="EMPLOYEE";e["CUSTOM_TRIAL_V1"]="CUSTOM_TRIAL_V1"})(lvt||(Ef.PlanType=lvt={}));var cvt;(function(e){e["GITHUB"]="GITHUB";e["GITLAB"]="GITLAB";e["BITBUCKET"]="BITBUCKET"})(cvt||(Ef.SourceControlProvider=cvt={}))});var fvt=y(pvt=>{"use strict";Object.defineProperty(pvt,"__esModule",{value:true})});var mvt=y(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:true});bf.INTERNAL_ROUTE_VENDOR_TAG=bf.ZUPLO_OPEN_API_ROUTE_KEY=bf.ZUPLO_OPEN_API_PATH_KEY=bf.ZUPLO_OPEN_API_VENDOR_PREFIX=void 0;bf.ZUPLO_OPEN_API_VENDOR_PREFIX="x-zuplo";bf.ZUPLO_OPEN_API_PATH_KEY=`${bf.ZUPLO_OPEN_API_VENDOR_PREFIX}-path`;bf.ZUPLO_OPEN_API_ROUTE_KEY=`${bf.ZUPLO_OPEN_API_VENDOR_PREFIX}-route`;bf.INTERNAL_ROUTE_VENDOR_TAG="x-internal"});var hvt=y((kPs,Jpn)=>{Jpn.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"http://schemas.zuplo.com/dev-portal.json",title:"Dev Portal Config",description:"",type:"object",required:[],additionalProperties:false,$defs:{ApiKeysConfig:{type:"object",additionalProperties:false,required:["bucketName"],properties:{bucketName:{type:"string"},apiKey:{type:"string"}}},DevPortalOAuthClientConfig:{type:"object",additionalProperties:false,required:["clientId"],properties:{clientId:{type:"string"},audience:{type:"string",description:"The audience of the API (i.e. the Zup's URL)\nOkta: not required\nAuth0: https://my-api.example.com/"}}},DevPortalOAuthClientCredentialsConfig:{type:"object",description:"This is the M2M configuration used to authenticate with OAuth provider in order to manage OAuth clients",required:["clientId","clientSecret"],additionalProperties:false,properties:{clientId:{type:"string"},clientSecret:{type:"string"}}},DevPortalAPIKeyCredentialConfig:{type:"object",description:"API Key credentials to access identity provider API",required:["apiKey"],additionalProperties:false,properties:{apiKey:{type:"string"}}},DevPortalOAuthConfig:{type:"object",description:"Settings for OAuth that is used to authenticate end-users to the developer portal and (optionally) for configuring issuing of OAuth Client Consumers using the identity provider",required:["provider","authority","jwksUrl"],additionalProperties:false,properties:{provider:{type:"string",enum:["okta","auth0","azure-ad","clerk","oidc"]},authority:{type:"string",description:"This is the full URL of the authorization server.\nOkta: https://dev-1235.okta.com/oauth2/aus123152352342\nAuth0: https://my-account.us.auth0.com\nAzure Active Directory: https://login.microsoftonline.com/{tenant}/v2.0\nClerk: https://your-account-23.clerk.accounts.dev"},jwksUrl:{type:"string",description:"The url of of the JWKS"},devPortalClient:{description:"This is the client that is used to authenticate end-users to the Zuplo developer portal",$ref:"#/$defs/DevPortalOAuthClientConfig"},managementClient:{oneOf:[{$ref:"#/$defs/DevPortalOAuthClientCredentialsConfig"},{$ref:"#/$defs/DevPortalAPIKeyCredentialConfig"}]}}},DevPortalExternalAuthConfig:{type:"object",description:"Settings for external auth that is used to authenticate end-users to the developer portal",additionalProperties:false,required:["loginUrl","provider","logoutUrl"],properties:{provider:{type:"string",enum:["external"]},loginUrl:{type:"string",description:"The URL of your external login page"},logoutUrl:{type:"string",description:"The URL of your external logout endpoint"}}},DevPortalAuthConfig:{type:"object",oneOf:[{$ref:"#/$defs/DevPortalOAuthConfig"},{$ref:"#/$defs/DevPortalExternalAuthConfig"}]},DevPortalMonetizationConfig:{type:"object",description:"Settings for monetization features like self-serve checkout and subscription management",oneOf:[{$ref:"#/$defs/DevPortalStripeMonetizationConfig"}]},DevPortalStripeMonetizationConfig:{type:"object",description:"Settings used to configure Stripe for monetization features like self-serve checkout and subscription management",additionalProperties:false,required:["provider","publishableKey","pricingTableId","secretKey"],properties:{provider:{type:"string",enum:["stripe"]},publishableKey:{type:"string",description:"Your Stripe publishable key - found under Developers > API keys > Standard keys"},secretKey:{type:"string",description:"Your Stripe secret key - found under Developers > API keys > Standard keys"},pricingTableId:{type:"string",description:"The ID of the pricing table that will be used to display pricing information to end-users"},meteringBucketId:{type:"string",description:"The ID of the metering bucket that will be used to track usage of the API"}}}},properties:{$schema:{type:"string"},enabled:{description:"If the developer portal is enabled",type:"boolean",default:true},authentication:{description:"Authentication configuration",$ref:"#/$defs/DevPortalAuthConfig"},monetization:{description:"Monetization configuration",$ref:"#/$defs/DevPortalMonetizationConfig"},sitePathname:{type:"string",default:"/docs"},faviconUrl:{type:"string",description:"The favicon url"},pageTitle:{type:"string",description:"The default page title"},enableAuthentication:{type:"boolean",description:"If sign in to the developer portal is enabled."},enableMonetization:{type:"boolean",description:"If monetization features like self-serve checkout and subscription management are enabled."},enableMetering:{type:"boolean",description:"If monetization features like self-serve checkout and subscription management are enabled."},requireAuthentication:{type:"boolean",default:false,description:"If authentication is required to access the developer portal. If false, the developer portal will be publicly accessible."},authorizePathname:{type:"string",default:"/oauth/authorize",description:"The path that starts the OAuth flow for third-party-apps"},apiKeys:{description:"Api Keys Service Configuration",$ref:"#/$defs/ApiKeysConfig"},generateExamples:{type:"boolean",default:true,description:"If false, the developer portal will no longer generate examples for endpoints that do not have examples defined"}}}});var CL=y(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:true});Ji.regexpCode=Ji.getEsmExportName=Ji.getProperty=Ji.safeStringify=Ji.stringify=Ji.strConcat=Ji.addCodeArg=Ji.str=Ji._=Ji.nil=Ji._Code=Ji.Name=Ji.IDENTIFIER=Ji._CodeOrName=void 0;var SL=class{static{a(this,"_CodeOrName")}};Ji._CodeOrName=SL;Ji.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var NA=class extends SL{static{a(this,"Name")}constructor(t){super();if(!Ji.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}};Ji.Name=NA;var Sf=class extends SL{static{a(this,"_Code")}constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>{if(n instanceof NA)r[n.str]=(r[n.str]||0)+1;return r},{})}};Ji._Code=Sf;Ji.nil=new Sf("");function gvt(e,...t){const r=[e[0]];let n=0;while(n<t.length){iAe(r,t[n]);r.push(e[++n])}return new Sf(r)}a(gvt,"_");Ji._=gvt;var nAe=new Sf("+");function yvt(e,...t){const r=[AL(e[0])];let n=0;while(n<t.length){r.push(nAe);iAe(r,t[n]);r.push(nAe,AL(e[++n]))}Qpn(r);return new Sf(r)}a(yvt,"str");Ji.str=yvt;function iAe(e,t){if(t instanceof Sf)e.push(...t._items);else if(t instanceof NA)e.push(t);else e.push(tfn(t))}a(iAe,"addCodeArg");Ji.addCodeArg=iAe;function Qpn(e){let t=1;while(t<e.length-1){if(e[t]===nAe){const r=Zpn(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}a(Qpn,"optimize");function Zpn(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof NA||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof NA))return`"${e}${t.slice(1)}`;return}a(Zpn,"mergeExprItems");function efn(e,t){return t.emptyStr()?e:e.emptyStr()?t:yvt`${e}${t}`}a(efn,"strConcat");Ji.strConcat=efn;function tfn(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:AL(Array.isArray(e)?e.join(","):e)}a(tfn,"interpolate");function rfn(e){return new Sf(AL(e))}a(rfn,"stringify");Ji.stringify=rfn;function AL(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}a(AL,"safeStringify");Ji.safeStringify=AL;function nfn(e){return typeof e=="string"&&Ji.IDENTIFIER.test(e)?new Sf(`.${e}`):gvt`[${e}]`}a(nfn,"getProperty");Ji.getProperty=nfn;function ifn(e){if(typeof e=="string"&&Ji.IDENTIFIER.test(e)){return new Sf(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}a(ifn,"getEsmExportName");Ji.getEsmExportName=ifn;function sfn(e){return new Sf(e.toString())}a(sfn,"regexpCode");Ji.regexpCode=sfn});var uAe=y(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:true});vc.ValueScope=vc.ValueScopeName=vc.Scope=vc.varKinds=vc.UsedValueState=void 0;var dd=CL();var sAe=class extends Error{static{a(this,"ValueError")}constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}};var aAe;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(aAe=vc.UsedValueState||(vc.UsedValueState={}));vc.varKinds={const:new dd.Name("const"),let:new dd.Name("let"),var:new dd.Name("var")};var fY=class{static{a(this,"Scope")}constructor({prefixes:t,parent:r}={}){this._names={};this._prefixes=t;this._parent=r}toName(t){return t instanceof dd.Name?t:this.name(t)}name(t){return new dd.Name(this._newName(t))}_newName(t){const r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0?void 0:n.has(t))||this._prefixes&&!this._prefixes.has(t)){throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`)}return this._names[t]={prefix:t,index:0}}};vc.Scope=fY;var mY=class extends dd.Name{static{a(this,"ValueScopeName")}constructor(t,r){super(r);this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t;this.scopePath=(0,dd._)`.${new dd.Name(r)}[${n}]`}};vc.ValueScopeName=mY;var afn=(0,dd._)`\n`;var oAe=class extends fY{static{a(this,"ValueScope")}constructor(t){super(t);this._values={};this._scope=t.scope;this.opts={...t,_n:t.lines?afn:dd.nil}}get(){return this._scope}name(t){return new mY(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const i=this.toName(t);const{prefix:s}=i;const o=(n=r.key)!==null&&n!==void 0?n:r.ref;let u=this._values[s];if(u){const d=u.get(o);if(d)return d}else{u=this._values[s]=new Map}u.set(o,i);const l=this._scope[s]||(this._scope[s]=[]);const c=l.length;l[c]=r.ref;i.setValue(r,{property:s,itemIndex:c});return i}getValue(t,r){const n=this._values[t];if(!n)return;return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,dd._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let s=dd.nil;for(const o in t){const u=t[o];if(!u)continue;const l=n[o]=n[o]||new Map;u.forEach(c=>{if(l.has(c))return;l.set(c,aAe.Started);let d=r(c);if(d){const p=this.opts.es5?vc.varKinds.var:vc.varKinds.const;s=(0,dd._)`${s}${p} ${c} = ${d};${this.opts._n}`}else if(d=i===null||i===void 0?void 0:i(c)){s=(0,dd._)`${s}${d}${this.opts._n}`}else{throw new sAe(c)}l.set(c,aAe.Completed)})}return s}};vc.ValueScope=oAe});var En=y(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:true});Vn.or=Vn.and=Vn.not=Vn.CodeGen=Vn.operators=Vn.varKinds=Vn.ValueScopeName=Vn.ValueScope=Vn.Scope=Vn.Name=Vn.regexpCode=Vn.stringify=Vn.getProperty=Vn.nil=Vn.strConcat=Vn.str=Vn._=void 0;var Ti=CL();var sh=uAe();var mE=CL();Object.defineProperty(Vn,"_",{enumerable:true,get:function(){return mE._}});Object.defineProperty(Vn,"str",{enumerable:true,get:function(){return mE.str}});Object.defineProperty(Vn,"strConcat",{enumerable:true,get:function(){return mE.strConcat}});Object.defineProperty(Vn,"nil",{enumerable:true,get:function(){return mE.nil}});Object.defineProperty(Vn,"getProperty",{enumerable:true,get:function(){return mE.getProperty}});Object.defineProperty(Vn,"stringify",{enumerable:true,get:function(){return mE.stringify}});Object.defineProperty(Vn,"regexpCode",{enumerable:true,get:function(){return mE.regexpCode}});Object.defineProperty(Vn,"Name",{enumerable:true,get:function(){return mE.Name}});var _Y=uAe();Object.defineProperty(Vn,"Scope",{enumerable:true,get:function(){return _Y.Scope}});Object.defineProperty(Vn,"ValueScope",{enumerable:true,get:function(){return _Y.ValueScope}});Object.defineProperty(Vn,"ValueScopeName",{enumerable:true,get:function(){return _Y.ValueScopeName}});Object.defineProperty(Vn,"varKinds",{enumerable:true,get:function(){return _Y.varKinds}});Vn.operators={GT:new Ti._Code(">"),GTE:new Ti._Code(">="),LT:new Ti._Code("<"),LTE:new Ti._Code("<="),EQ:new Ti._Code("==="),NEQ:new Ti._Code("!=="),NOT:new Ti._Code("!"),OR:new Ti._Code("||"),AND:new Ti._Code("&&"),ADD:new Ti._Code("+")};var gy=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(t,r){return this}};var lAe=class extends gy{static{a(this,"Def")}constructor(t,r,n){super();this.varKind=t;this.name=r;this.rhs=n}render({es5:t,_n:r}){const n=t?sh.varKinds.var:this.varKind;const i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(!t[this.name.str])return;if(this.rhs)this.rhs=lO(this.rhs,t,r);return this}get names(){return this.rhs instanceof Ti._CodeOrName?this.rhs.names:{}}};var hY=class extends gy{static{a(this,"Assign")}constructor(t,r,n){super();this.lhs=t;this.rhs=r;this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(this.lhs instanceof Ti.Name&&!t[this.lhs.str]&&!this.sideEffects)return;this.rhs=lO(this.rhs,t,r);return this}get names(){const t=this.lhs instanceof Ti.Name?{}:{...this.lhs.names};return yY(t,this.rhs)}};var cAe=class extends hY{static{a(this,"AssignOp")}constructor(t,r,n,i){super(t,n,i);this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}};var dAe=class extends gy{static{a(this,"Label")}constructor(t){super();this.label=t;this.names={}}render({_n:t}){return`${this.label}:`+t}};var pAe=class extends gy{static{a(this,"Break")}constructor(t){super();this.label=t;this.names={}}render({_n:t}){const r=this.label?` ${this.label}`:"";return`break${r};`+t}};var fAe=class extends gy{static{a(this,"Throw")}constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}};var mAe=class extends gy{static{a(this,"AnyCode")}constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){this.code=lO(this.code,t,r);return this}get names(){return this.code instanceof Ti._CodeOrName?this.code.names:{}}};var wL=class extends gy{static{a(this,"ParentNode")}constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){const{nodes:t}=this;let r=t.length;while(r--){const n=t[r].optimizeNodes();if(Array.isArray(n))t.splice(r,1,...n);else if(n)t[r]=n;else t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){const{nodes:n}=this;let i=n.length;while(i--){const s=n[i];if(s.optimizeNames(t,r))continue;ofn(t,s.names);n.splice(i,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>DA(t,r.names),{})}};var yy=class extends wL{static{a(this,"BlockNode")}render(t){return"{"+t._n+super.render(t)+"}"+t._n}};var hAe=class extends wL{static{a(this,"Root")}};var uO=class extends yy{static{a(this,"Else")}};uO.kind="else";var IA=class e extends yy{static{a(this,"If")}constructor(t,r){super(r);this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);if(this.else)r+="else "+this.else.render(t);return r}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(t===true)return this.nodes;let r=this.else;if(r){const n=r.optimizeNodes();r=this.else=Array.isArray(n)?new uO(n):n}if(r){if(t===false)return r instanceof e?r:r.nodes;if(this.nodes.length)return this;return new e(_vt(t),r instanceof e?[r]:r.nodes)}if(t===false||!this.nodes.length)return void 0;return this}optimizeNames(t,r){var n;this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r);if(!(super.optimizeNames(t,r)||this.else))return;this.condition=lO(this.condition,t,r);return this}get names(){const t=super.names;yY(t,this.condition);if(this.else)DA(t,this.else.names);return t}};IA.kind="if";var kA=class extends yy{static{a(this,"For")}};kA.kind="for";var gAe=class extends kA{static{a(this,"ForLoop")}constructor(t){super();this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iteration=lO(this.iteration,t,r);return this}get names(){return DA(super.names,this.iteration.names)}};var yAe=class extends kA{static{a(this,"ForRange")}constructor(t,r,n,i){super();this.varKind=t;this.name=r;this.from=n;this.to=i}render(t){const r=t.es5?sh.varKinds.var:this.varKind;const{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(t)}get names(){const t=yY(super.names,this.from);return yY(t,this.to)}};var gY=class extends kA{static{a(this,"ForIter")}constructor(t,r,n,i){super();this.loop=t;this.varKind=r;this.name=n;this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iterable=lO(this.iterable,t,r);return this}get names(){return DA(super.names,this.iterable.names)}};var TL=class extends yy{static{a(this,"Func")}constructor(t,r,n){super();this.name=t;this.args=r;this.async=n}render(t){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(t)}};TL.kind="func";var xL=class extends wL{static{a(this,"Return")}render(t){return"return "+super.render(t)}};xL.kind="return";var _Ae=class extends yy{static{a(this,"Try")}render(t){let r="try"+super.render(t);if(this.catch)r+=this.catch.render(t);if(this.finally)r+=this.finally.render(t);return r}optimizeNodes(){var t,r;super.optimizeNodes();(t=this.catch)===null||t===void 0?void 0:t.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(t,r){var n,i;super.optimizeNames(t,r);(n=this.catch)===null||n===void 0?void 0:n.optimizeNames(t,r);(i=this.finally)===null||i===void 0?void 0:i.optimizeNames(t,r);return this}get names(){const t=super.names;if(this.catch)DA(t,this.catch.names);if(this.finally)DA(t,this.finally.names);return t}};var RL=class extends yy{static{a(this,"Catch")}constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};RL.kind="catch";var OL=class extends yy{static{a(this,"Finally")}render(t){return"finally"+super.render(t)}};OL.kind="finally";var vAe=class{static{a(this,"CodeGen")}constructor(t,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=t;this._scope=new sh.Scope({parent:t});this._nodes=[new hAe]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){const n=this._extScope.value(t,r);const i=this._values[n.prefix]||(this._values[n.prefix]=new Set);i.add(n);return n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){const s=this._scope.toName(r);if(n!==void 0&&i)this._constants[s.str]=n;this._leafNode(new lAe(t,s,n));return s}const(t,r,n){return this._def(sh.varKinds.const,t,r,n)}let(t,r,n){return this._def(sh.varKinds.let,t,r,n)}var(t,r,n){return this._def(sh.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new hY(t,r,n))}add(t,r){return this._leafNode(new cAe(t,Vn.operators.ADD,r))}code(t){if(typeof t=="function")t();else if(t!==Ti.nil)this._leafNode(new mAe(t));return this}object(...t){const r=["{"];for(const[n,i]of t){if(r.length>1)r.push(",");r.push(n);if(n!==i||this.opts.es5){r.push(":");(0,Ti.addCodeArg)(r,i)}}r.push("}");return new Ti._Code(r)}if(t,r,n){this._blockNode(new IA(t));if(r&&n){this.code(r).else().code(n).endIf()}else if(r){this.code(r).endIf()}else if(n){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(t){return this._elseNode(new IA(t))}else(){return this._elseNode(new uO)}endIf(){return this._endBlockNode(IA,uO)}_for(t,r){this._blockNode(t);if(r)this.code(r).endFor();return this}for(t,r){return this._for(new gAe(t),r)}forRange(t,r,n,i,s=this.opts.es5?sh.varKinds.var:sh.varKinds.let){const o=this._scope.toName(t);return this._for(new yAe(s,o,r,n),()=>i(o))}forOf(t,r,n,i=sh.varKinds.const){const s=this._scope.toName(t);if(this.opts.es5){const o=r instanceof Ti.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ti._)`${o}.length`,u=>{this.var(s,(0,Ti._)`${o}[${u}]`);n(s)})}return this._for(new gY("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?sh.varKinds.var:sh.varKinds.const){if(this.opts.ownProperties){return this.forOf(t,(0,Ti._)`Object.keys(${r})`,n)}const s=this._scope.toName(t);return this._for(new gY("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(kA)}label(t){return this._leafNode(new dAe(t))}break(t){return this._leafNode(new pAe(t))}return(t){const r=new xL;this._blockNode(r);this.code(t);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(xL)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const i=new _Ae;this._blockNode(i);this.code(t);if(r){const s=this.name("e");this._currNode=i.catch=new RL(s);r(s)}if(n){this._currNode=i.finally=new OL;this.code(n)}return this._endBlockNode(RL,OL)}throw(t){return this._leafNode(new fAe(t))}block(t,r){this._blockStarts.push(this._nodes.length);if(t)this.code(t).endBlock(r);return this}endBlock(t){const r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t){throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`)}this._nodes.length=r;return this}func(t,r=Ti.nil,n,i){this._blockNode(new TL(t,r,n));if(i)this.code(i).endFunc();return this}endFunc(){return this._endBlockNode(TL)}optimize(t=1){while(t-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(t){this._currNode.nodes.push(t);return this}_blockNode(t){this._currNode.nodes.push(t);this._nodes.push(t)}_endBlockNode(t,r){const n=this._currNode;if(n instanceof t||r&&n instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){const r=this._currNode;if(!(r instanceof IA)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=t;return this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const r=this._nodes;r[r.length-1]=t}};Vn.CodeGen=vAe;function DA(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}a(DA,"addNames");function yY(e,t){return t instanceof Ti._CodeOrName?DA(e,t.names):e}a(yY,"addExprNames");function lO(e,t,r){if(e instanceof Ti.Name)return n(e);if(!i(e))return e;return new Ti._Code(e._items.reduce((s,o)=>{if(o instanceof Ti.Name)o=n(o);if(o instanceof Ti._Code)s.push(...o._items);else s.push(o);return s},[]));function n(s){const o=r[s.str];if(o===void 0||t[s.str]!==1)return s;delete t[s.str];return o}a(n,"replaceName");function i(s){return s instanceof Ti._Code&&s._items.some(o=>o instanceof Ti.Name&&t[o.str]===1&&r[o.str]!==void 0)}a(i,"canOptimize")}a(lO,"optimizeExpr");function ofn(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}a(ofn,"subtractNames");function _vt(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Ti._)`!${EAe(e)}`}a(_vt,"not");Vn.not=_vt;var ufn=vvt(Vn.operators.AND);function lfn(...e){return e.reduce(ufn)}a(lfn,"and");Vn.and=lfn;var cfn=vvt(Vn.operators.OR);function dfn(...e){return e.reduce(cfn)}a(dfn,"or");Vn.or=dfn;function vvt(e){return(t,r)=>t===Ti.nil?r:r===Ti.nil?t:(0,Ti._)`${EAe(t)} ${e} ${EAe(r)}`}a(vvt,"mappend");function EAe(e){return e instanceof Ti.Name?e:(0,Ti._)`(${e})`}a(EAe,"par")});var ui=y(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:true});zn.checkStrictMode=zn.getErrorPath=zn.Type=zn.useFunc=zn.setEvaluated=zn.evaluatedPropsToName=zn.mergeEvaluated=zn.eachItem=zn.unescapeJsonPointer=zn.escapeJsonPointer=zn.escapeFragment=zn.unescapeFragment=zn.schemaRefOrVal=zn.schemaHasRulesButRef=zn.schemaHasRules=zn.checkUnknownRules=zn.alwaysValidSchema=zn.toHash=void 0;var Hs=En();var pfn=CL();function ffn(e){const t={};for(const r of e)t[r]=true;return t}a(ffn,"toHash");zn.toHash=ffn;function mfn(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return true;Svt(e,t);return!Avt(t,e.self.RULES.all)}a(mfn,"alwaysValidSchema");zn.alwaysValidSchema=mfn;function Svt(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;const i=n.RULES.keywords;for(const s in t){if(!i[s])xvt(e,`unknown keyword: "${s}"`)}}a(Svt,"checkUnknownRules");zn.checkUnknownRules=Svt;function Avt(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return true;return false}a(Avt,"schemaHasRules");zn.schemaHasRules=Avt;function hfn(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return true;return false}a(hfn,"schemaHasRulesButRef");zn.schemaHasRulesButRef=hfn;function gfn({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Hs._)`${r}`}return(0,Hs._)`${e}${t}${(0,Hs.getProperty)(n)}`}a(gfn,"schemaRefOrVal");zn.schemaRefOrVal=gfn;function yfn(e){return Cvt(decodeURIComponent(e))}a(yfn,"unescapeFragment");zn.unescapeFragment=yfn;function _fn(e){return encodeURIComponent(bAe(e))}a(_fn,"escapeFragment");zn.escapeFragment=_fn;function bAe(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}a(bAe,"escapeJsonPointer");zn.escapeJsonPointer=bAe;function Cvt(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}a(Cvt,"unescapeJsonPointer");zn.unescapeJsonPointer=Cvt;function vfn(e,t){if(Array.isArray(e)){for(const r of e)t(r)}else{t(e)}}a(vfn,"eachItem");zn.eachItem=vfn;function Evt({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,u)=>{const l=o===void 0?s:o instanceof Hs.Name?(s instanceof Hs.Name?e(i,s,o):t(i,s,o),o):s instanceof Hs.Name?(t(i,o,s),s):r(s,o);return u===Hs.Name&&!(l instanceof Hs.Name)?n(i,l):l}}a(Evt,"makeMergeEvaluated");zn.mergeEvaluated={props:Evt({mergeNames:(e,t,r)=>e.if((0,Hs._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,Hs._)`${t} === true`,()=>e.assign(r,true),()=>e.assign(r,(0,Hs._)`${r} || {}`).code((0,Hs._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,Hs._)`${r} !== true`,()=>{if(t===true){e.assign(r,true)}else{e.assign(r,(0,Hs._)`${r} || {}`);SAe(e,r,t)}}),mergeValues:(e,t)=>e===true?true:{...e,...t},resultToName:wvt}),items:Evt({mergeNames:(e,t,r)=>e.if((0,Hs._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,Hs._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,Hs._)`${r} !== true`,()=>e.assign(r,t===true?true:(0,Hs._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===true?true:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function wvt(e,t){if(t===true)return e.var("props",true);const r=e.var("props",(0,Hs._)`{}`);if(t!==void 0)SAe(e,r,t);return r}a(wvt,"evaluatedPropsToName");zn.evaluatedPropsToName=wvt;function SAe(e,t,r){Object.keys(r).forEach(n=>e.assign((0,Hs._)`${t}${(0,Hs.getProperty)(n)}`,true))}a(SAe,"setEvaluated");zn.setEvaluated=SAe;var bvt={};function Efn(e,t){return e.scopeValue("func",{ref:t,code:bvt[t.code]||(bvt[t.code]=new pfn._Code(t.code))})}a(Efn,"useFunc");zn.useFunc=Efn;var Tvt;(function(e){e[e["Num"]=0]="Num";e[e["Str"]=1]="Str"})(Tvt=zn.Type||(zn.Type={}));function bfn(e,t,r){if(e instanceof Hs.Name){const n=t===Tvt.Num;return r?n?(0,Hs._)`"[" + ${e} + "]"`:(0,Hs._)`"['" + ${e} + "']"`:n?(0,Hs._)`"/" + ${e}`:(0,Hs._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Hs.getProperty)(e).toString():"/"+bAe(e)}a(bfn,"getErrorPath");zn.getErrorPath=bfn;function xvt(e,t,r=e.opts.strictSchema){if(!r)return;t=`strict mode: ${t}`;if(r===true)throw new Error(t);e.self.logger.warn(t)}a(xvt,"checkStrictMode");zn.checkStrictMode=xvt});var Af=y(AAe=>{"use strict";Object.defineProperty(AAe,"__esModule",{value:true});var Nl=En();var Sfn={data:new Nl.Name("data"),valCxt:new Nl.Name("valCxt"),instancePath:new Nl.Name("instancePath"),parentData:new Nl.Name("parentData"),parentDataProperty:new Nl.Name("parentDataProperty"),rootData:new Nl.Name("rootData"),dynamicAnchors:new Nl.Name("dynamicAnchors"),vErrors:new Nl.Name("vErrors"),errors:new Nl.Name("errors"),this:new Nl.Name("this"),self:new Nl.Name("self"),scope:new Nl.Name("scope"),json:new Nl.Name("json"),jsonPos:new Nl.Name("jsonPos"),jsonLen:new Nl.Name("jsonLen"),jsonPart:new Nl.Name("jsonPart")};AAe.default=Sfn});var PL=y(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:true});Il.extendErrors=Il.resetErrorsCount=Il.reportExtraError=Il.reportError=Il.keyword$DataError=Il.keywordError=void 0;var Fi=En();var vY=ui();var Ec=Af();Il.keywordError={message:({keyword:e})=>(0,Fi.str)`must pass "${e}" keyword validation`};Il.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,Fi.str)`"${e}" keyword must be ${t} ($data)`:(0,Fi.str)`"${e}" keyword is invalid ($data)`};function Afn(e,t=Il.keywordError,r,n){const{it:i}=e;const{gen:s,compositeRule:o,allErrors:u}=i;const l=Pvt(e,t,r);if(n!==null&&n!==void 0?n:o||u){Rvt(s,l)}else{Ovt(i,(0,Fi._)`[${l}]`)}}a(Afn,"reportError");Il.reportError=Afn;function Cfn(e,t=Il.keywordError,r){const{it:n}=e;const{gen:i,compositeRule:s,allErrors:o}=n;const u=Pvt(e,t,r);Rvt(i,u);if(!(s||o)){Ovt(n,Ec.default.vErrors)}}a(Cfn,"reportExtraError");Il.reportExtraError=Cfn;function wfn(e,t){e.assign(Ec.default.errors,t);e.if((0,Fi._)`${Ec.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,Fi._)`${Ec.default.vErrors}.length`,t),()=>e.assign(Ec.default.vErrors,null)))}a(wfn,"resetErrorsCount");Il.resetErrorsCount=wfn;function Tfn({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");const o=e.name("err");e.forRange("i",i,Ec.default.errors,u=>{e.const(o,(0,Fi._)`${Ec.default.vErrors}[${u}]`);e.if((0,Fi._)`${o}.instancePath === undefined`,()=>e.assign((0,Fi._)`${o}.instancePath`,(0,Fi.strConcat)(Ec.default.instancePath,s.errorPath)));e.assign((0,Fi._)`${o}.schemaPath`,(0,Fi.str)`${s.errSchemaPath}/${t}`);if(s.opts.verbose){e.assign((0,Fi._)`${o}.schema`,r);e.assign((0,Fi._)`${o}.data`,n)}})}a(Tfn,"extendErrors");Il.extendErrors=Tfn;function Rvt(e,t){const r=e.const("err",t);e.if((0,Fi._)`${Ec.default.vErrors} === null`,()=>e.assign(Ec.default.vErrors,(0,Fi._)`[${r}]`),(0,Fi._)`${Ec.default.vErrors}.push(${r})`);e.code((0,Fi._)`${Ec.default.errors}++`)}a(Rvt,"addError");function Ovt(e,t){const{gen:r,validateName:n,schemaEnv:i}=e;if(i.$async){r.throw((0,Fi._)`new ${e.ValidationError}(${t})`)}else{r.assign((0,Fi._)`${n}.errors`,t);r.return(false)}}a(Ovt,"returnErrors");var LA={keyword:new Fi.Name("keyword"),schemaPath:new Fi.Name("schemaPath"),params:new Fi.Name("params"),propertyName:new Fi.Name("propertyName"),message:new Fi.Name("message"),schema:new Fi.Name("schema"),parentSchema:new Fi.Name("parentSchema")};function Pvt(e,t,r){const{createErrors:n}=e.it;if(n===false)return(0,Fi._)`{}`;return xfn(e,t,r)}a(Pvt,"errorObjectCode");function xfn(e,t,r={}){const{gen:n,it:i}=e;const s=[Rfn(i,r),Ofn(e,r)];Pfn(e,t,s);return n.object(...s)}a(xfn,"errorObject");function Rfn({errorPath:e},{instancePath:t}){const r=t?(0,Fi.str)`${e}${(0,vY.getErrorPath)(t,vY.Type.Str)}`:e;return[Ec.default.instancePath,(0,Fi.strConcat)(Ec.default.instancePath,r)]}a(Rfn,"errorInstancePath");function Ofn({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,Fi.str)`${t}/${e}`;if(r){i=(0,Fi.str)`${i}${(0,vY.getErrorPath)(r,vY.Type.Str)}`}return[LA.schemaPath,i]}a(Ofn,"errorSchemaPath");function Pfn(e,{params:t,message:r},n){const{keyword:i,data:s,schemaValue:o,it:u}=e;const{opts:l,propertyName:c,topSchemaRef:d,schemaPath:p}=u;n.push([LA.keyword,i],[LA.params,typeof t=="function"?t(e):t||(0,Fi._)`{}`]);if(l.messages){n.push([LA.message,typeof r=="function"?r(e):r])}if(l.verbose){n.push([LA.schema,o],[LA.parentSchema,(0,Fi._)`${d}${p}`],[Ec.default.data,s])}if(c)n.push([LA.propertyName,c])}a(Pfn,"extraErrorProps")});var Ivt=y(cO=>{"use strict";Object.defineProperty(cO,"__esModule",{value:true});cO.boolOrEmptySchema=cO.topBoolOrEmptySchema=void 0;var Nfn=PL();var Ifn=En();var kfn=Af();var Dfn={message:"boolean schema is false"};function Lfn(e){const{gen:t,schema:r,validateName:n}=e;if(r===false){Nvt(e,false)}else if(typeof r=="object"&&r.$async===true){t.return(kfn.default.data)}else{t.assign((0,Ifn._)`${n}.errors`,null);t.return(true)}}a(Lfn,"topBoolOrEmptySchema");cO.topBoolOrEmptySchema=Lfn;function Ffn(e,t){const{gen:r,schema:n}=e;if(n===false){r.var(t,false);Nvt(e)}else{r.var(t,true)}}a(Ffn,"boolOrEmptySchema");cO.boolOrEmptySchema=Ffn;function Nvt(e,t){const{gen:r,data:n}=e;const i={gen:r,keyword:"false schema",data:n,schema:false,schemaCode:false,schemaValue:false,params:{},it:e};(0,Nfn.reportError)(i,Dfn,void 0,t)}a(Nvt,"falseSchemaError")});var CAe=y(dO=>{"use strict";Object.defineProperty(dO,"__esModule",{value:true});dO.getRules=dO.isJSONType=void 0;var Bfn=["string","number","integer","boolean","null","object","array"];var Mfn=new Set(Bfn);function qfn(e){return typeof e=="string"&&Mfn.has(e)}a(qfn,"isJSONType");dO.isJSONType=qfn;function Ufn(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:true,boolean:true,null:true},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}a(Ufn,"getRules");dO.getRules=Ufn});var wAe=y(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:true});hE.shouldUseRule=hE.shouldUseGroup=hE.schemaHasRulesForType=void 0;function $fn({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==true&&kvt(e,n)}a($fn,"schemaHasRulesForType");hE.schemaHasRulesForType=$fn;function kvt(e,t){return t.rules.some(r=>Dvt(e,r))}a(kvt,"shouldUseGroup");hE.shouldUseGroup=kvt;function Dvt(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}a(Dvt,"shouldUseRule");hE.shouldUseRule=Dvt});var IL=y(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:true});tl.reportTypeError=tl.checkDataTypes=tl.checkDataType=tl.coerceAndCheckDataType=tl.getJSONTypes=tl.getSchemaTypes=tl.DataType=void 0;var jfn=CAe();var Gfn=wAe();var Hfn=PL();var On=En();var Lvt=ui();var NL;(function(e){e[e["Correct"]=0]="Correct";e[e["Wrong"]=1]="Wrong"})(NL=tl.DataType||(tl.DataType={}));function Vfn(e){const t=Fvt(e.type);const r=t.includes("null");if(r){if(e.nullable===false)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0){throw new Error('"nullable" cannot be used without "type"')}if(e.nullable===true)t.push("null")}return t}a(Vfn,"getSchemaTypes");tl.getSchemaTypes=Vfn;function Fvt(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(jfn.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}a(Fvt,"getJSONTypes");tl.getJSONTypes=Fvt;function zfn(e,t){const{gen:r,data:n,opts:i}=e;const s=Kfn(t,i.coerceTypes);const o=t.length>0&&!(s.length===0&&t.length===1&&(0,Gfn.schemaHasRulesForType)(e,t[0]));if(o){const u=xAe(t,n,i.strictNumbers,NL.Wrong);r.if(u,()=>{if(s.length)Wfn(e,t,s);else RAe(e)})}return o}a(zfn,"coerceAndCheckDataType");tl.coerceAndCheckDataType=zfn;var Bvt=new Set(["string","number","integer","boolean","null"]);function Kfn(e,t){return t?e.filter(r=>Bvt.has(r)||t==="array"&&r==="array"):[]}a(Kfn,"coerceToTypes");function Wfn(e,t,r){const{gen:n,data:i,opts:s}=e;const o=n.let("dataType",(0,On._)`typeof ${i}`);const u=n.let("coerced",(0,On._)`undefined`);if(s.coerceTypes==="array"){n.if((0,On._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,On._)`${i}[0]`).assign(o,(0,On._)`typeof ${i}`).if(xAe(t,i,s.strictNumbers),()=>n.assign(u,i)))}n.if((0,On._)`${u} !== undefined`);for(const c of r){if(Bvt.has(c)||c==="array"&&s.coerceTypes==="array"){l(c)}}n.else();RAe(e);n.endIf();n.if((0,On._)`${u} !== undefined`,()=>{n.assign(i,u);Yfn(e,u)});function l(c){switch(c){case"string":n.elseIf((0,On._)`${o} == "number" || ${o} == "boolean"`).assign(u,(0,On._)`"" + ${i}`).elseIf((0,On._)`${i} === null`).assign(u,(0,On._)`""`);return;case"number":n.elseIf((0,On._)`${o} == "boolean" || ${i} === null
396
396
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,On._)`+${i}`);return;case"integer":n.elseIf((0,On._)`${o} === "boolean" || ${i} === null
397
397
  || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,On._)`+${i}`);return;case"boolean":n.elseIf((0,On._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(u,false).elseIf((0,On._)`${i} === "true" || ${i} === 1`).assign(u,true);return;case"null":n.elseIf((0,On._)`${i} === "" || ${i} === 0 || ${i} === false`);n.assign(u,null);return;case"array":n.elseIf((0,On._)`${o} === "string" || ${o} === "number"
398
398
  || ${o} === "boolean" || ${i} === null`).assign(u,(0,On._)`[${i}]`)}}a(l,"coerceSpecificType")}a(Wfn,"coerceData");function Yfn({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,On._)`${t} !== undefined`,()=>e.assign((0,On._)`${t}[${r}]`,n))}a(Yfn,"assignParentData");function TAe(e,t,r,n=NL.Correct){const i=n===NL.Correct?On.operators.EQ:On.operators.NEQ;let s;switch(e){case"null":return(0,On._)`${t} ${i} null`;case"array":s=(0,On._)`Array.isArray(${t})`;break;case"object":s=(0,On._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=o((0,On._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=o();break;default:return(0,On._)`typeof ${t} ${i} ${e}`}return n===NL.Correct?s:(0,On.not)(s);function o(u=On.nil){return(0,On.and)((0,On._)`typeof ${t} == "number"`,u,r?(0,On._)`isFinite(${t})`:On.nil)}a(o,"numCond")}a(TAe,"checkDataType");tl.checkDataType=TAe;function xAe(e,t,r,n){if(e.length===1){return TAe(e[0],t,r,n)}let i;const s=(0,Lvt.toHash)(e);if(s.array&&s.object){const o=(0,On._)`typeof ${t} != "object"`;i=s.null?o:(0,On._)`!${t} || ${o}`;delete s.null;delete s.array;delete s.object}else{i=On.nil}if(s.number)delete s.integer;for(const o in s)i=(0,On.and)(i,TAe(o,t,r,n));return i}a(xAe,"checkDataTypes");tl.checkDataTypes=xAe;var Xfn={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,On._)`{type: ${e}}`:(0,On._)`{type: ${t}}`};function RAe(e){const t=Jfn(e);(0,Hfn.reportError)(t,Xfn)}a(RAe,"reportTypeError");tl.reportTypeError=RAe;function Jfn(e){const{gen:t,data:r,schema:n}=e;const i=(0,Lvt.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}a(Jfn,"getTypeErrorContext")});var qvt=y(EY=>{"use strict";Object.defineProperty(EY,"__esModule",{value:true});EY.assignDefaults=void 0;var pO=En();var Qfn=ui();function Zfn(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r){for(const i in r){Mvt(e,i,r[i].default)}}else if(t==="array"&&Array.isArray(n)){n.forEach((i,s)=>Mvt(e,s,i.default))}}a(Zfn,"assignDefaults");EY.assignDefaults=Zfn;function Mvt(e,t,r){const{gen:n,compositeRule:i,data:s,opts:o}=e;if(r===void 0)return;const u=(0,pO._)`${s}${(0,pO.getProperty)(t)}`;if(i){(0,Qfn.checkStrictMode)(e,`default is ignored for: ${u}`);return}let l=(0,pO._)`${u} === undefined`;if(o.useDefaults==="empty"){l=(0,pO._)`${l} || ${u} === null || ${u} === ""`}n.if(l,(0,pO._)`${u} = ${(0,pO.stringify)(r)}`)}a(Mvt,"assignDefault")});var Cf=y(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:true});ks.validateUnion=ks.validateArray=ks.usePattern=ks.callValidateCode=ks.schemaProperties=ks.allSchemaProperties=ks.noPropertyInData=ks.propertyInData=ks.isOwnProperty=ks.hasPropFunc=ks.reportMissingProp=ks.checkMissingProp=ks.checkReportMissingProp=void 0;var _a=En();var OAe=ui();var gE=Af();var emn=ui();function tmn(e,t){const{gen:r,data:n,it:i}=e;r.if(NAe(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,_a._)`${t}`},true);e.error()})}a(tmn,"checkReportMissingProp");ks.checkReportMissingProp=tmn;function rmn({gen:e,data:t,it:{opts:r}},n,i){return(0,_a.or)(...n.map(s=>(0,_a.and)(NAe(e,t,s,r.ownProperties),(0,_a._)`${i} = ${s}`)))}a(rmn,"checkMissingProp");ks.checkMissingProp=rmn;function nmn(e,t){e.setParams({missingProperty:t},true);e.error()}a(nmn,"reportMissingProp");ks.reportMissingProp=nmn;function Uvt(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,_a._)`Object.prototype.hasOwnProperty`})}a(Uvt,"hasPropFunc");ks.hasPropFunc=Uvt;function PAe(e,t,r){return(0,_a._)`${Uvt(e)}.call(${t}, ${r})`}a(PAe,"isOwnProperty");ks.isOwnProperty=PAe;function imn(e,t,r,n){const i=(0,_a._)`${t}${(0,_a.getProperty)(r)} !== undefined`;return n?(0,_a._)`${i} && ${PAe(e,t,r)}`:i}a(imn,"propertyInData");ks.propertyInData=imn;function NAe(e,t,r,n){const i=(0,_a._)`${t}${(0,_a.getProperty)(r)} === undefined`;return n?(0,_a.or)(i,(0,_a.not)(PAe(e,t,r))):i}a(NAe,"noPropertyInData");ks.noPropertyInData=NAe;function $vt(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}a($vt,"allSchemaProperties");ks.allSchemaProperties=$vt;function smn(e,t){return $vt(t).filter(r=>!(0,OAe.alwaysValidSchema)(e,t[r]))}a(smn,"schemaProperties");ks.schemaProperties=smn;function amn({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},u,l,c){const d=c?(0,_a._)`${e}, ${t}, ${n}${i}`:t;const p=[[gE.default.instancePath,(0,_a.strConcat)(gE.default.instancePath,s)],[gE.default.parentData,o.parentData],[gE.default.parentDataProperty,o.parentDataProperty],[gE.default.rootData,gE.default.rootData]];if(o.opts.dynamicRef)p.push([gE.default.dynamicAnchors,gE.default.dynamicAnchors]);const f=(0,_a._)`${d}, ${r.object(...p)}`;return l!==_a.nil?(0,_a._)`${u}.call(${l}, ${f})`:(0,_a._)`${u}(${f})`}a(amn,"callValidateCode");ks.callValidateCode=amn;var omn=(0,_a._)`new RegExp`;function umn({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"";const{regExp:i}=t.code;const s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,_a._)`${i.code==="new RegExp"?omn:(0,emn.useFunc)(e,i)}(${r}, ${n})`})}a(umn,"usePattern");ks.usePattern=umn;function lmn(e){const{gen:t,data:r,keyword:n,it:i}=e;const s=t.name("valid");if(i.allErrors){const u=t.let("valid",true);o(()=>t.assign(u,false));return u}t.var(s,true);o(()=>t.break());return s;function o(u){const l=t.const("len",(0,_a._)`${r}.length`);t.forRange("i",0,l,c=>{e.subschema({keyword:n,dataProp:c,dataPropType:OAe.Type.Num},s);t.if((0,_a.not)(s),u)})}a(o,"validateItems")}a(lmn,"validateArray");ks.validateArray=lmn;function cmn(e){const{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=r.some(l=>(0,OAe.alwaysValidSchema)(i,l));if(s&&!i.opts.unevaluated)return;const o=t.let("valid",false);const u=t.name("_valid");t.block(()=>r.forEach((l,c)=>{const d=e.subschema({keyword:n,schemaProp:c,compositeRule:true},u);t.assign(o,(0,_a._)`${o} || ${u}`);const p=e.mergeValidEvaluated(d,u);if(!p)t.if((0,_a.not)(o))}));e.result(o,()=>e.reset(),()=>e.error(true))}a(cmn,"validateUnion");ks.validateUnion=cmn});var Hvt=y(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:true});U0.validateKeywordUsage=U0.validSchemaType=U0.funcKeywordCode=U0.macroKeywordCode=void 0;var bc=En();var FA=Af();var dmn=Cf();var pmn=PL();function fmn(e,t){const{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=e;const u=t.macro.call(o.self,i,s,o);const l=Gvt(r,n,u);if(o.opts.validateSchema!==false)o.self.validateSchema(u,true);const c=r.name("valid");e.subschema({schema:u,schemaPath:bc.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:true},c);e.pass(c,()=>e.error(true))}a(fmn,"macroKeywordCode");U0.macroKeywordCode=fmn;function mmn(e,t){var r;const{gen:n,keyword:i,schema:s,parentSchema:o,$data:u,it:l}=e;gmn(l,t);const c=!u&&t.compile?t.compile.call(l.self,s,o,l):t.validate;const d=Gvt(n,i,c);const p=n.let("valid");e.block$data(p,f);e.ok((r=t.valid)!==null&&r!==void 0?r:p);function f(){if(t.errors===false){g();if(t.modifying)jvt(e);_(()=>e.error())}else{const v=t.async?m():h();if(t.modifying)jvt(e);_(()=>hmn(e,v))}}a(f,"validateKeyword");function m(){const v=n.let("ruleErrs",null);n.try(()=>g((0,bc._)`await `),S=>n.assign(p,false).if((0,bc._)`${S} instanceof ${l.ValidationError}`,()=>n.assign(v,(0,bc._)`${S}.errors`),()=>n.throw(S)));return v}a(m,"validateAsync");function h(){const v=(0,bc._)`${d}.errors`;n.assign(v,null);g(bc.nil);return v}a(h,"validateSync");function g(v=t.async?(0,bc._)`await `:bc.nil){const S=l.opts.passContext?FA.default.this:FA.default.self;const E=!("compile"in t&&!u||t.schema===false);n.assign(p,(0,bc._)`${v}${(0,dmn.callValidateCode)(e,d,S,E)}`,t.modifying)}a(g,"assignValid");function _(v){var S;n.if((0,bc.not)((S=t.valid)!==null&&S!==void 0?S:p),v)}a(_,"reportErrs")}a(mmn,"funcKeywordCode");U0.funcKeywordCode=mmn;function jvt(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,bc._)`${n.parentData}[${n.parentDataProperty}]`))}a(jvt,"modifyData");function hmn(e,t){const{gen:r}=e;r.if((0,bc._)`Array.isArray(${t})`,()=>{r.assign(FA.default.vErrors,(0,bc._)`${FA.default.vErrors} === null ? ${t} : ${FA.default.vErrors}.concat(${t})`).assign(FA.default.errors,(0,bc._)`${FA.default.vErrors}.length`);(0,pmn.extendErrors)(e)},()=>e.error())}a(hmn,"addErrs");function gmn({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}a(gmn,"checkAsyncKeyword");function Gvt(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,bc.stringify)(r)})}a(Gvt,"useKeyword");function ymn(e,t,r=false){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e=="undefined")}a(ymn,"validSchemaType");U0.validSchemaType=ymn;function _mn({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s){throw new Error("ajv implementation error")}const o=i.dependencies;if(o===null||o===void 0?void 0:o.some(u=>!Object.prototype.hasOwnProperty.call(e,u))){throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`)}if(i.validateSchema){const u=i.validateSchema(e[s]);if(!u){const l=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}}a(_mn,"validateKeywordUsage");U0.validateKeywordUsage=_mn});var zvt=y(yE=>{"use strict";Object.defineProperty(yE,"__esModule",{value:true});yE.extendSubschemaMode=yE.extendSubschemaData=yE.getSubschema=void 0;var $0=En();var Vvt=ui();function vmn(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&n!==void 0){throw new Error('both "keyword" and "schema" passed, only one allowed')}if(t!==void 0){const u=e.schema[t];return r===void 0?{schema:u,schemaPath:(0,$0._)`${e.schemaPath}${(0,$0.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:u[r],schemaPath:(0,$0._)`${e.schemaPath}${(0,$0.getProperty)(t)}${(0,$0.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Vvt.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0){throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"')}return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(vmn,"getSubschema");yE.getSubschema=vmn;function Emn(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0){throw new Error('both "data" and "dataProp" passed, only one allowed')}const{gen:u}=t;if(r!==void 0){const{errorPath:c,dataPathArr:d,opts:p}=t;const f=u.let("data",(0,$0._)`${t.data}${(0,$0.getProperty)(r)}`,true);l(f);e.errorPath=(0,$0.str)`${c}${(0,Vvt.getErrorPath)(r,n,p.jsPropertySyntax)}`;e.parentDataProperty=(0,$0._)`${r}`;e.dataPathArr=[...d,e.parentDataProperty]}if(i!==void 0){const c=i instanceof $0.Name?i:u.let("data",i,true);l(c);if(o!==void 0)e.propertyName=o}if(s)e.dataTypes=s;function l(c){e.data=c;e.dataLevel=t.dataLevel+1;e.dataTypes=[];t.definedProperties=new Set;e.parentData=t.data;e.dataNames=[...t.dataNames,c]}a(l,"dataContextProps")}a(Emn,"extendSubschemaData");yE.extendSubschemaData=Emn;function bmn(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){if(n!==void 0)e.compositeRule=n;if(i!==void 0)e.createErrors=i;if(s!==void 0)e.allErrors=s;e.jtdDiscriminator=t;e.jtdMetadata=r}a(bmn,"extendSubschemaMode");yE.extendSubschemaMode=bmn});var kL=y(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:true});pd.getSchemaRefs=pd.resolveUrl=pd.normalizeId=pd._getFullPath=pd.getFullPath=pd.inlineRef=void 0;var Smn=ui();var Amn=np();var Cmn=lx();var wmn=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Tmn(e,t=true){if(typeof e=="boolean")return true;if(t===true)return!IAe(e);if(!t)return false;return Kvt(e)<=t}a(Tmn,"inlineRef");pd.inlineRef=Tmn;var xmn=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function IAe(e){for(const t in e){if(xmn.has(t))return true;const r=e[t];if(Array.isArray(r)&&r.some(IAe))return true;if(typeof r=="object"&&IAe(r))return true}return false}a(IAe,"hasRef");function Kvt(e){let t=0;for(const r in e){if(r==="$ref")return Infinity;t++;if(wmn.has(r))continue;if(typeof e[r]=="object"){(0,Smn.eachItem)(e[r],n=>t+=Kvt(n))}if(t===Infinity)return Infinity}return t}a(Kvt,"countKeys");function Wvt(e,t="",r){if(r!==false)t=fO(t);const n=e.parse(t);return Yvt(e,n)}a(Wvt,"getFullPath");pd.getFullPath=Wvt;function Yvt(e,t){const r=e.serialize(t);return r.split("#")[0]+"#"}a(Yvt,"_getFullPath");pd._getFullPath=Yvt;var Rmn=/#\/?$/;function fO(e){return e?e.replace(Rmn,""):""}a(fO,"normalizeId");pd.normalizeId=fO;function Omn(e,t,r){r=fO(r);return e.resolve(t,r)}a(Omn,"resolveUrl");pd.resolveUrl=Omn;var Pmn=/^[a-z_][-a-z0-9._]*$/i;function Nmn(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts;const i=fO(e[r]||t);const s={"":i};const o=Wvt(n,i,false);const u={};const l=new Set;Cmn(e,{allKeys:true},(p,f,m,h)=>{if(h===void 0)return;const g=o+f;let _=s[h];if(typeof p[r]=="string")_=v.call(this,p[r]);S.call(this,p.$anchor);S.call(this,p.$dynamicAnchor);s[f]=_;function v(E){const b=this.opts.uriResolver.resolve;E=fO(_?b(_,E):E);if(l.has(E))throw d(E);l.add(E);let A=this.refs[E];if(typeof A=="string")A=this.refs[A];if(typeof A=="object"){c(p,A.schema,E)}else if(E!==fO(g)){if(E[0]==="#"){c(p,u[E],E);u[E]=p}else{this.refs[E]=g}}return E}a(v,"addRef");function S(E){if(typeof E=="string"){if(!Pmn.test(E))throw new Error(`invalid anchor "${E}"`);v.call(this,`#${E}`)}}a(S,"addAnchor")});return u;function c(p,f,m){if(f!==void 0&&!Amn(p,f))throw d(m)}a(c,"checkAmbiguosRef");function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}a(d,"ambiguos")}a(Nmn,"getSchemaRefs");pd.getSchemaRefs=Nmn});var FL=y(_E=>{"use strict";Object.defineProperty(_E,"__esModule",{value:true});_E.getData=_E.KeywordCxt=_E.validateFunctionCode=void 0;var eEt=Ivt();var Xvt=IL();var DAe=wAe();var bY=IL();var Imn=qvt();var LL=Hvt();var kAe=zvt();var Sr=En();var tn=Af();var kmn=kL();var _y=ui();var DL=PL();function Dmn(e){if(nEt(e)){iEt(e);if(rEt(e)){Bmn(e);return}}tEt(e,()=>(0,eEt.topBoolOrEmptySchema)(e))}a(Dmn,"validateFunctionCode");_E.validateFunctionCode=Dmn;function tEt({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){if(i.code.es5){e.func(t,(0,Sr._)`${tn.default.data}, ${tn.default.valCxt}`,n.$async,()=>{e.code((0,Sr._)`"use strict"; ${Jvt(r,i)}`);Fmn(e,i);e.code(s)})}else{e.func(t,(0,Sr._)`${tn.default.data}, ${Lmn(i)}`,n.$async,()=>e.code(Jvt(r,i)).code(s))}}a(tEt,"validateFunction");function Lmn(e){return(0,Sr._)`{${tn.default.instancePath}="", ${tn.default.parentData}, ${tn.default.parentDataProperty}, ${tn.default.rootData}=${tn.default.data}${e.dynamicRef?(0,Sr._)`, ${tn.default.dynamicAnchors}={}`:Sr.nil}}={}`}a(Lmn,"destructureValCxt");function Fmn(e,t){e.if(tn.default.valCxt,()=>{e.var(tn.default.instancePath,(0,Sr._)`${tn.default.valCxt}.${tn.default.instancePath}`);e.var(tn.default.parentData,(0,Sr._)`${tn.default.valCxt}.${tn.default.parentData}`);e.var(tn.default.parentDataProperty,(0,Sr._)`${tn.default.valCxt}.${tn.default.parentDataProperty}`);e.var(tn.default.rootData,(0,Sr._)`${tn.default.valCxt}.${tn.default.rootData}`);if(t.dynamicRef)e.var(tn.default.dynamicAnchors,(0,Sr._)`${tn.default.valCxt}.${tn.default.dynamicAnchors}`)},()=>{e.var(tn.default.instancePath,(0,Sr._)`""`);e.var(tn.default.parentData,(0,Sr._)`undefined`);e.var(tn.default.parentDataProperty,(0,Sr._)`undefined`);e.var(tn.default.rootData,tn.default.data);if(t.dynamicRef)e.var(tn.default.dynamicAnchors,(0,Sr._)`{}`)})}a(Fmn,"destructureValCxtES5");function Bmn(e){const{schema:t,opts:r,gen:n}=e;tEt(e,()=>{if(r.$comment&&t.$comment)aEt(e);jmn(e);n.let(tn.default.vErrors,null);n.let(tn.default.errors,0);if(r.unevaluated)Mmn(e);sEt(e);Vmn(e)});return}a(Bmn,"topSchemaObjCode");function Mmn(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,Sr._)`${r}.evaluated`);t.if((0,Sr._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,Sr._)`${e.evaluated}.props`,(0,Sr._)`undefined`));t.if((0,Sr._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,Sr._)`${e.evaluated}.items`,(0,Sr._)`undefined`))}a(Mmn,"resetEvaluated");function Jvt(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,Sr._)`/*# sourceURL=${r} */`:Sr.nil}a(Jvt,"funcSourceUrl");function qmn(e,t){if(nEt(e)){iEt(e);if(rEt(e)){Umn(e,t);return}}(0,eEt.boolOrEmptySchema)(e,t)}a(qmn,"subschemaCode");function rEt({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return true;return false}a(rEt,"schemaCxtHasRules");function nEt(e){return typeof e.schema!="boolean"}a(nEt,"isSchemaObj");function Umn(e,t){const{schema:r,gen:n,opts:i}=e;if(i.$comment&&r.$comment)aEt(e);Gmn(e);Hmn(e);const s=n.const("_errs",tn.default.errors);sEt(e,s);n.var(t,(0,Sr._)`${s} === ${tn.default.errors}`)}a(Umn,"subSchemaObjCode");function iEt(e){(0,_y.checkUnknownRules)(e);$mn(e)}a(iEt,"checkKeywords");function sEt(e,t){if(e.opts.jtd)return Qvt(e,[],false,t);const r=(0,Xvt.getSchemaTypes)(e.schema);const n=(0,Xvt.coerceAndCheckDataType)(e,r);Qvt(e,r,!n,t)}a(sEt,"typeAndKeywords");function $mn(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&(0,_y.schemaHasRulesButRef)(t,i.RULES)){i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}}a($mn,"checkRefsAndKeywords");function jmn(e){const{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema){(0,_y.checkStrictMode)(e,"default is ignored in the schema root")}}a(jmn,"checkNoDefault");function Gmn(e){const t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,kmn.resolveUrl)(e.opts.uriResolver,e.baseId,t)}a(Gmn,"updateContext");function Hmn(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}a(Hmn,"checkAsyncSchema");function aEt({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const s=r.$comment;if(i.$comment===true){e.code((0,Sr._)`${tn.default.self}.logger.log(${s})`)}else if(typeof i.$comment=="function"){const o=(0,Sr.str)`${n}/$comment`;const u=e.scopeValue("root",{ref:t.root});e.code((0,Sr._)`${tn.default.self}.opts.$comment(${s}, ${o}, ${u}.schema)`)}}a(aEt,"commentKeyword");function Vmn(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;if(r.$async){t.if((0,Sr._)`${tn.default.errors} === 0`,()=>t.return(tn.default.data),()=>t.throw((0,Sr._)`new ${i}(${tn.default.vErrors})`))}else{t.assign((0,Sr._)`${n}.errors`,tn.default.vErrors);if(s.unevaluated)zmn(e);t.return((0,Sr._)`${tn.default.errors} === 0`)}}a(Vmn,"returnResults");function zmn({gen:e,evaluated:t,props:r,items:n}){if(r instanceof Sr.Name)e.assign((0,Sr._)`${t}.props`,r);if(n instanceof Sr.Name)e.assign((0,Sr._)`${t}.items`,n)}a(zmn,"assignEvaluated");function Qvt(e,t,r,n){const{gen:i,schema:s,data:o,allErrors:u,opts:l,self:c}=e;const{RULES:d}=c;if(s.$ref&&(l.ignoreKeywordsWithRef||!(0,_y.schemaHasRulesButRef)(s,d))){i.block(()=>uEt(e,"$ref",d.all.$ref.definition));return}if(!l.jtd)Kmn(e,t);i.block(()=>{for(const f of d.rules)p(f);p(d.post)});function p(f){if(!(0,DAe.shouldUseGroup)(s,f))return;if(f.type){i.if((0,bY.checkDataType)(f.type,o,l.strictNumbers));Zvt(e,f);if(t.length===1&&t[0]===f.type&&r){i.else();(0,bY.reportTypeError)(e)}i.endIf()}else{Zvt(e,f)}if(!u)i.if((0,Sr._)`${tn.default.errors} === ${n||0}`)}a(p,"groupKeywords")}a(Qvt,"schemaKeywords");function Zvt(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;if(i)(0,Imn.assignDefaults)(e,t.type);r.block(()=>{for(const s of t.rules){if((0,DAe.shouldUseRule)(n,s)){uEt(e,s.keyword,s.definition,t.type)}}})}a(Zvt,"iterateKeywords");function Kmn(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;Wmn(e,t);if(!e.opts.allowUnionTypes)Ymn(e,t);Xmn(e,e.dataTypes)}a(Kmn,"checkStrictTypes");function Wmn(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{if(!oEt(e.dataTypes,r)){LAe(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}});Qmn(e,t)}a(Wmn,"checkContextTypes");function Ymn(e,t){if(t.length>1&&!(t.length===2&&t.includes("null"))){LAe(e,"use allowUnionTypes to allow union type keyword")}}a(Ymn,"checkMultipleTypes");function Xmn(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if(typeof i=="object"&&(0,DAe.shouldUseRule)(e.schema,i)){const{type:s}=i.definition;if(s.length&&!s.some(o=>Jmn(t,o))){LAe(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}}a(Xmn,"checkKeywordTypes");function Jmn(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}a(Jmn,"hasApplicableType");function oEt(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}a(oEt,"includesType");function Qmn(e,t){const r=[];for(const n of e.dataTypes){if(oEt(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer")}e.dataTypes=r}a(Qmn,"narrowSchemaTypes");function LAe(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`;(0,_y.checkStrictMode)(e,t,e.opts.strictTypes)}a(LAe,"strictTypesError");var SY=class{static{a(this,"KeywordCxt")}constructor(t,r,n){(0,LL.validateKeywordUsage)(t,r,n);this.gen=t.gen;this.allErrors=t.allErrors;this.keyword=n;this.data=t.data;this.schema=t.schema[n];this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data;this.schemaValue=(0,_y.schemaRefOrVal)(t,this.schema,n,this.$data);this.schemaType=r.schemaType;this.parentSchema=t.schema;this.params={};this.it=t;this.def=r;if(this.$data){this.schemaCode=t.gen.const("vSchema",lEt(this.$data,t))}else{this.schemaCode=this.schemaValue;if(!(0,LL.validSchemaType)(this.schema,r.schemaType,r.allowUndefined)){throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`)}}if("code"in r?r.trackErrors:r.errors!==false){this.errsCount=t.gen.const("_errs",tn.default.errors)}}result(t,r,n){this.failResult((0,Sr.not)(t),r,n)}failResult(t,r,n){this.gen.if(t);if(n)n();else this.error();if(r){this.gen.else();r();if(this.allErrors)this.gen.endIf()}else{if(this.allErrors)this.gen.endIf();else this.gen.else()}}pass(t,r){this.failResult((0,Sr.not)(t),void 0,r)}fail(t){if(t===void 0){this.error();if(!this.allErrors)this.gen.if(false);return}this.gen.if(t);this.error();if(this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,Sr._)`${r} !== undefined && (${(0,Sr.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r);this._error(t,n);this.setParams({});return}this._error(t,n)}_error(t,r){;(t?DL.reportExtraError:DL.reportError)(this,this.def.error,r)}$dataError(){(0,DL.reportError)(this,this.def.$dataError||DL.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,DL.resetErrorsCount)(this.gen,this.errsCount)}ok(t){if(!this.allErrors)this.gen.if(t)}setParams(t,r){if(r)Object.assign(this.params,t);else this.params=t}block$data(t,r,n=Sr.nil){this.gen.block(()=>{this.check$data(t,n);r()})}check$data(t=Sr.nil,r=Sr.nil){if(!this.$data)return;const{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,Sr.or)((0,Sr._)`${i} === undefined`,r));if(t!==Sr.nil)n.assign(t,true);if(s.length||o.validateSchema){n.elseIf(this.invalid$data());this.$dataError();if(t!==Sr.nil)n.assign(t,false)}n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,Sr.or)(o(),u());function o(){if(n.length){if(!(r instanceof Sr.Name))throw new Error("ajv implementation error");const l=Array.isArray(n)?n:[n];return(0,Sr._)`${(0,bY.checkDataTypes)(l,r,s.opts.strictNumbers,bY.DataType.Wrong)}`}return Sr.nil}a(o,"wrong$DataType");function u(){if(i.validateSchema){const l=t.scopeValue("validate$data",{ref:i.validateSchema});return(0,Sr._)`!${l}(${r})`}return Sr.nil}a(u,"invalid$DataSchema")}subschema(t,r){const n=(0,kAe.getSubschema)(this.it,t);(0,kAe.extendSubschemaData)(n,this.it,t);(0,kAe.extendSubschemaMode)(n,t);const i={...this.it,...n,items:void 0,props:void 0};qmn(i,r);return i}mergeEvaluated(t,r){const{it:n,gen:i}=this;if(!n.opts.unevaluated)return;if(n.props!==true&&t.props!==void 0){n.props=_y.mergeEvaluated.props(i,t.props,n.props,r)}if(n.items!==true&&t.items!==void 0){n.items=_y.mergeEvaluated.items(i,t.items,n.items,r)}}mergeValidEvaluated(t,r){const{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==true||n.items!==true)){i.if(r,()=>this.mergeEvaluated(t,Sr.Name));return true}}};_E.KeywordCxt=SY;function uEt(e,t,r,n){const i=new SY(e,r,t);if("code"in r){r.code(i,n)}else if(i.$data&&r.validate){(0,LL.funcKeywordCode)(i,r)}else if("macro"in r){(0,LL.macroKeywordCode)(i,r)}else if(r.compile||r.validate){(0,LL.funcKeywordCode)(i,r)}}a(uEt,"keywordCode");var Zmn=/^\/(?:[^~]|~0|~1)*$/;var ehn=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function lEt(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i;let s;if(e==="")return tn.default.rootData;if(e[0]==="/"){if(!Zmn.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e;s=tn.default.rootData}else{const c=ehn.exec(e);if(!c)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+c[1];i=c[2];if(i==="#"){if(d>=t)throw new Error(l("property/index",d));return n[t-d]}if(d>t)throw new Error(l("data",d));s=r[t-d];if(!i)return s}let o=s;const u=i.split("/");for(const c of u){if(c){s=(0,Sr._)`${s}${(0,Sr.getProperty)((0,_y.unescapeJsonPointer)(c))}`;o=(0,Sr._)`${o} && ${s}`}}return o;function l(c,d){return`Cannot access ${c} ${d} levels up, current level is ${t}`}a(l,"errorMsg")}a(lEt,"getData");_E.getData=lEt});var AY=y(BAe=>{"use strict";Object.defineProperty(BAe,"__esModule",{value:true});var FAe=class extends Error{static{a(this,"ValidationError")}constructor(t){super("validation failed");this.errors=t;this.ajv=this.validation=true}};BAe.default=FAe});var CY=y(UAe=>{"use strict";Object.defineProperty(UAe,"__esModule",{value:true});var MAe=kL();var qAe=class extends Error{static{a(this,"MissingRefError")}constructor(t,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`);this.missingRef=(0,MAe.resolveUrl)(t,r,n);this.missingSchema=(0,MAe.normalizeId)((0,MAe.getFullPath)(t,this.missingRef))}};UAe.default=qAe});var BL=y(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:true});wf.resolveSchema=wf.getCompilingSchema=wf.resolveRef=wf.compileSchema=wf.SchemaEnv=void 0;var ah=En();var thn=AY();var BA=Af();var oh=kL();var cEt=ui();var rhn=FL();var mO=class{static{a(this,"SchemaEnv")}constructor(t){var r;this.refs={};this.dynamicAnchors={};let n;if(typeof t.schema=="object")n=t.schema;this.schema=t.schema;this.schemaId=t.schemaId;this.root=t.root||this;this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,oh.normalizeId)(n===null||n===void 0?void 0:n[t.schemaId||"$id"]);this.schemaPath=t.schemaPath;this.localRefs=t.localRefs;this.meta=t.meta;this.$async=n===null||n===void 0?void 0:n.$async;this.refs={}}};wf.SchemaEnv=mO;function jAe(e){const t=dEt.call(this,e);if(t)return t;const r=(0,oh.getFullPath)(this.opts.uriResolver,e.root.baseId);const{es5:n,lines:i}=this.opts.code;const{ownProperties:s}=this.opts;const o=new ah.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s});let u;if(e.$async){u=o.scopeValue("Error",{ref:thn.default,code:(0,ah._)`require("ajv/dist/runtime/validation_error").default`})}const l=o.scopeName("validate");e.validateName=l;const c={gen:o,allErrors:this.opts.allErrors,data:BA.default.data,parentData:BA.default.parentData,parentDataProperty:BA.default.parentDataProperty,dataNames:[BA.default.data],dataPathArr:[ah.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===true?{ref:e.schema,code:(0,ah.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ah.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ah._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e);(0,rhn.validateFunctionCode)(c);o.optimize(this.opts.code.optimize);const p=o.toString();d=`${o.scopeRefs(BA.default.scope)}return ${p}`;if(this.opts.code.process)d=this.opts.code.process(d,e);const f=new Function(`${BA.default.self}`,`${BA.default.scope}`,d);const m=f(this,this.scope.get());this.scope.value(l,{ref:m});m.errors=null;m.schema=e.schema;m.schemaEnv=e;if(e.$async)m.$async=true;if(this.opts.code.source===true){m.source={validateName:l,validateCode:p,scopeValues:o._values}}if(this.opts.unevaluated){const{props:h,items:g}=c;m.evaluated={props:h instanceof ah.Name?void 0:h,items:g instanceof ah.Name?void 0:g,dynamicProps:h instanceof ah.Name,dynamicItems:g instanceof ah.Name};if(m.source)m.source.evaluated=(0,ah.stringify)(m.evaluated)}e.validate=m;return e}catch(p){delete e.validate;delete e.validateName;if(d)this.logger.error("Error compiling schema, function code:",d);throw p}finally{this._compilations.delete(e)}}a(jAe,"compileSchema");wf.compileSchema=jAe;function nhn(e,t,r){var n;r=(0,oh.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let s=ahn.call(this,e,r);if(s===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r];const{schemaId:u}=this.opts;if(o)s=new mO({schema:o,schemaId:u,root:e,baseId:t})}if(s===void 0)return;return e.refs[r]=ihn.call(this,s)}a(nhn,"resolveRef");wf.resolveRef=nhn;function ihn(e){if((0,oh.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:jAe.call(this,e)}a(ihn,"inlineOrCompile");function dEt(e){for(const t of this._compilations){if(shn(t,e))return t}}a(dEt,"getCompilingSchema");wf.getCompilingSchema=dEt;function shn(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}a(shn,"sameSchemaEnv");function ahn(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||wY.call(this,e,t)}a(ahn,"resolve");function wY(e,t){const r=this.opts.uriResolver.parse(t);const n=(0,oh._getFullPath)(this.opts.uriResolver,r);let i=(0,oh.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i){return $Ae.call(this,r,e)}const s=(0,oh.normalizeId)(n);const o=this.refs[s]||this.schemas[s];if(typeof o=="string"){const u=wY.call(this,e,o);if(typeof(u===null||u===void 0?void 0:u.schema)!=="object")return;return $Ae.call(this,r,u)}if(typeof(o===null||o===void 0?void 0:o.schema)!=="object")return;if(!o.validate)jAe.call(this,o);if(s===(0,oh.normalizeId)(t)){const{schema:u}=o;const{schemaId:l}=this.opts;const c=u[l];if(c)i=(0,oh.resolveUrl)(this.opts.uriResolver,i,c);return new mO({schema:u,schemaId:l,root:e,baseId:i})}return $Ae.call(this,r,o)}a(wY,"resolveSchema");wf.resolveSchema=wY;var ohn=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $Ae(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(const u of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;const l=r[(0,cEt.unescapeFragment)(u)];if(l===void 0)return;r=l;const c=typeof r==="object"&&r[this.opts.schemaId];if(!ohn.has(u)&&c){t=(0,oh.resolveUrl)(this.opts.uriResolver,t,c)}}let s;if(typeof r!="boolean"&&r.$ref&&!(0,cEt.schemaHasRulesButRef)(r,this.RULES)){const u=(0,oh.resolveUrl)(this.opts.uriResolver,t,r.$ref);s=wY.call(this,n,u)}const{schemaId:o}=this.opts;s=s||new mO({schema:r,schemaId:o,root:n,baseId:t});if(s.schema!==s.root.schema)return s;return void 0}a($Ae,"getJsonPointer")});var pEt=y((yNs,uhn)=>{uhn.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:false}});var mEt=y(GAe=>{"use strict";Object.defineProperty(GAe,"__esModule",{value:true});var fEt=nS();fEt.code='require("ajv/dist/runtime/uri").default';GAe.default=fEt});var SEt=y(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:true});rl.CodeGen=rl.Name=rl.nil=rl.stringify=rl.str=rl._=rl.KeywordCxt=void 0;var lhn=FL();Object.defineProperty(rl,"KeywordCxt",{enumerable:true,get:function(){return lhn.KeywordCxt}});var hO=En();Object.defineProperty(rl,"_",{enumerable:true,get:function(){return hO._}});Object.defineProperty(rl,"str",{enumerable:true,get:function(){return hO.str}});Object.defineProperty(rl,"stringify",{enumerable:true,get:function(){return hO.stringify}});Object.defineProperty(rl,"nil",{enumerable:true,get:function(){return hO.nil}});Object.defineProperty(rl,"Name",{enumerable:true,get:function(){return hO.Name}});Object.defineProperty(rl,"CodeGen",{enumerable:true,get:function(){return hO.CodeGen}});var chn=AY();var vEt=CY();var dhn=CAe();var ML=BL();var phn=En();var qL=kL();var TY=IL();var VAe=ui();var hEt=pEt();var fhn=mEt();var EEt=a((e,t)=>new RegExp(e,t),"defaultRegExp");EEt.code="new RegExp";var mhn=["removeAdditional","useDefaults","coerceTypes"];var hhn=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]);var ghn={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."};var yhn={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};var gEt=200;function _hn(e){var t,r,n,i,s,o,u,l,c,d,p,f,m,h,g,_,v,S,E,b,A,C,T,O,P;const R=e.strict;const I=(t=e.code)===null||t===void 0?void 0:t.optimize;const D=I===true||I===void 0?1:I||0;const U=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:EEt;const te=(i=e.uriResolver)!==null&&i!==void 0?i:fhn.default;return{strictSchema:(o=(s=e.strictSchema)!==null&&s!==void 0?s:R)!==null&&o!==void 0?o:true,strictNumbers:(l=(u=e.strictNumbers)!==null&&u!==void 0?u:R)!==null&&l!==void 0?l:true,strictTypes:(d=(c=e.strictTypes)!==null&&c!==void 0?c:R)!==null&&d!==void 0?d:"log",strictTuples:(f=(p=e.strictTuples)!==null&&p!==void 0?p:R)!==null&&f!==void 0?f:"log",strictRequired:(h=(m=e.strictRequired)!==null&&m!==void 0?m:R)!==null&&h!==void 0?h:false,code:e.code?{...e.code,optimize:D,regExp:U}:{optimize:D,regExp:U},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:gEt,loopEnum:(_=e.loopEnum)!==null&&_!==void 0?_:gEt,meta:(v=e.meta)!==null&&v!==void 0?v:true,messages:(S=e.messages)!==null&&S!==void 0?S:true,inlineRefs:(E=e.inlineRefs)!==null&&E!==void 0?E:true,schemaId:(b=e.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(A=e.addUsedSchema)!==null&&A!==void 0?A:true,validateSchema:(C=e.validateSchema)!==null&&C!==void 0?C:true,validateFormats:(T=e.validateFormats)!==null&&T!==void 0?T:true,unicodeRegExp:(O=e.unicodeRegExp)!==null&&O!==void 0?O:true,int32range:(P=e.int32range)!==null&&P!==void 0?P:true,uriResolver:te}}a(_hn,"requiredOptions");var UL=class{static{a(this,"Ajv")}constructor(t={}){this.schemas={};this.refs={};this.formats={};this._compilations=new Set;this._loading={};this._cache=new Map;t=this.opts={...t,..._hn(t)};const{es5:r,lines:n}=this.opts.code;this.scope=new phn.ValueScope({scope:{},prefixes:hhn,es5:r,lines:n});this.logger=Chn(t.logger);const i=t.validateFormats;t.validateFormats=false;this.RULES=(0,dhn.getRules)();yEt.call(this,ghn,t,"NOT SUPPORTED");yEt.call(this,yhn,t,"DEPRECATED","warn");this._metaOpts=Shn.call(this);if(t.formats)Ehn.call(this);this._addVocabularies();this._addDefaultMetaSchema();if(t.keywords)bhn.call(this,t.keywords);if(typeof t.meta=="object")this.addMetaSchema(t.meta);vhn.call(this);t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:r,schemaId:n}=this.opts;let i=hEt;if(n==="id"){i={...hEt};i.id=i.$id;delete i.$id}if(r&&t)this.addMetaSchema(i,i[n],false)}defaultMeta(){const{meta:t,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[r]||t:void 0}validate(t,r){let n;if(typeof t=="string"){n=this.getSchema(t);if(!n)throw new Error(`no schema with key or ref "${t}"`)}else{n=this.compile(t)}const i=n(r);if(!("$async"in n))this.errors=n.errors;return i}compile(t,r){const n=this._addSchema(t,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(t,r){if(typeof this.opts.loadSchema!="function"){throw new Error("options.loadSchema should be a function")}const{loadSchema:n}=this.opts;return i.call(this,t,r);async function i(d,p){await s.call(this,d.$schema);const f=this._addSchema(d,p);return f.validate||o.call(this,f)}a(i,"runCompileAsync");async function s(d){if(d&&!this.getSchema(d)){await i.call(this,{$ref:d},true)}}a(s,"loadMetaSchema");async function o(d){try{return this._compileSchemaEnv(d)}catch(p){if(!(p instanceof vEt.default))throw p;u.call(this,p);await l.call(this,p.missingSchema);return o.call(this,d)}}a(o,"_compileAsync");function u({missingSchema:d,missingRef:p}){if(this.refs[d]){throw new Error(`AnySchema ${d} is loaded but ${p} cannot be resolved`)}}a(u,"checkLoaded");async function l(d){const p=await c.call(this,d);if(!this.refs[d])await s.call(this,p.$schema);if(!this.refs[d])this.addSchema(p,d,r)}a(l,"loadMissingSchema");async function c(d){const p=this._loading[d];if(p)return p;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}a(c,"_loadSchema")}addSchema(t,r,n,i=this.opts.validateSchema){if(Array.isArray(t)){for(const o of t)this.addSchema(o,void 0,n,i);return this}let s;if(typeof t==="object"){const{schemaId:o}=this.opts;s=t[o];if(s!==void 0&&typeof s!="string"){throw new Error(`schema ${o} must be string`)}}r=(0,qL.normalizeId)(r||s);this._checkUnique(r);this.schemas[r]=this._addSchema(t,n,r,i,true);return this}addMetaSchema(t,r,n=this.opts.validateSchema){this.addSchema(t,r,true,n);return this}validateSchema(t,r){if(typeof t=="boolean")return true;let n;n=t.$schema;if(n!==void 0&&typeof n!="string"){throw new Error("$schema must be a string")}n=n||this.opts.defaultMeta||this.defaultMeta();if(!n){this.logger.warn("meta-schema not available");this.errors=null;return true}const i=this.validate(n,t);if(!i&&r){const s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(t){let r;while(typeof(r=_Et.call(this,t))=="string")t=r;if(r===void 0){const{schemaId:n}=this.opts;const i=new ML.SchemaEnv({schema:{},schemaId:n});r=ML.resolveSchema.call(this,i,t);if(!r)return;this.refs[t]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(t){if(t instanceof RegExp){this._removeAllSchemas(this.schemas,t);this._removeAllSchemas(this.refs,t);return this}switch(typeof t){case"undefined":this._removeAllSchemas(this.schemas);this._removeAllSchemas(this.refs);this._cache.clear();return this;case"string":{const r=_Et.call(this,t);if(typeof r=="object")this._cache.delete(r.schema);delete this.schemas[t];delete this.refs[t];return this}case"object":{const r=t;this._cache.delete(r);let n=t[this.opts.schemaId];if(n){n=(0,qL.normalizeId)(n);delete this.schemas[n];delete this.refs[n]}return this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const r of t)this.addKeyword(r);return this}addKeyword(t,r){let n;if(typeof t=="string"){n=t;if(typeof r=="object"){this.logger.warn("these parameters are deprecated, see docs for addKeyword");r.keyword=n}}else if(typeof t=="object"&&r===void 0){r=t;n=r.keyword;if(Array.isArray(n)&&!n.length){throw new Error("addKeywords: keyword must be string or non-empty array")}}else{throw new Error("invalid addKeywords parameters")}Thn.call(this,n,r);if(!r){(0,VAe.eachItem)(n,s=>HAe.call(this,s));return this}Rhn.call(this,r);const i={...r,type:(0,TY.getJSONTypes)(r.type),schemaType:(0,TY.getJSONTypes)(r.schemaType)};(0,VAe.eachItem)(n,i.type.length===0?s=>HAe.call(this,s,i):s=>i.type.forEach(o=>HAe.call(this,s,i,o)));return this}getKeyword(t){const r=this.RULES.all[t];return typeof r=="object"?r.definition:!!r}removeKeyword(t){const{RULES:r}=this;delete r.keywords[t];delete r.all[t];for(const n of r.rules){const i=n.rules.findIndex(s=>s.keyword===t);if(i>=0)n.rules.splice(i,1)}return this}addFormat(t,r){if(typeof r=="string")r=new RegExp(r);this.formats[t]=r;return this}errorsText(t=this.errors,{separator:r=", ",dataVar:n="data"}={}){if(!t||t.length===0)return"No errors";return t.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(t,r){const n=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const i of r){const s=i.split("/").slice(1);let o=t;for(const u of s)o=o[u];for(const u in n){const l=n[u];if(typeof l!="object")continue;const{$data:c}=l.definition;const d=o[u];if(c&&d)o[u]=bEt(d)}}return t}_removeAllSchemas(t,r){for(const n in t){const i=t[n];if(!r||r.test(n)){if(typeof i=="string"){delete t[n]}else if(i&&!i.meta){this._cache.delete(i.schema);delete t[n]}}}}_addSchema(t,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o;const{schemaId:u}=this.opts;if(typeof t=="object"){o=t[u]}else{if(this.opts.jtd)throw new Error("schema must be object");else if(typeof t!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(t);if(l!==void 0)return l;n=(0,qL.normalizeId)(o||n);const c=qL.getSchemaRefs.call(this,t,n);l=new ML.SchemaEnv({schema:t,schemaId:u,meta:r,baseId:n,localRefs:c});this._cache.set(l.schema,l);if(s&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=l}if(i)this.validateSchema(t,true);return l}_checkUnique(t){if(this.schemas[t]||this.refs[t]){throw new Error(`schema with key or id "${t}" already exists`)}}_compileSchemaEnv(t){if(t.meta)this._compileMetaSchema(t);else ML.compileSchema.call(this,t);if(!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const r=this.opts;this.opts=this._metaOpts;try{ML.compileSchema.call(this,t)}finally{this.opts=r}}};rl.default=UL;UL.ValidationError=chn.default;UL.MissingRefError=vEt.default;function yEt(e,t,r,n="error"){for(const i in e){const s=i;if(s in t)this.logger[n](`${r}: option ${i}. ${e[s]}`)}}a(yEt,"checkOptions");function _Et(e){e=(0,qL.normalizeId)(e);return this.schemas[e]||this.refs[e]}a(_Et,"getSchEnv");function vhn(){const e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}a(vhn,"addInitialSchemas");function Ehn(){for(const e in this.opts.formats){const t=this.opts.formats[e];if(t)this.addFormat(e,t)}}a(Ehn,"addInitialFormats");function bhn(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}a(bhn,"addInitialKeywords");function Shn(){const e={...this.opts};for(const t of mhn)delete e[t];return e}a(Shn,"getMetaSchemaOptions");var Ahn={log(){},warn(){},error(){}};function Chn(e){if(e===false)return Ahn;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}a(Chn,"getLogger");var whn=/^[a-z_$][a-z0-9_$:-]*$/i;function Thn(e,t){const{RULES:r}=this;(0,VAe.eachItem)(e,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!whn.test(n))throw new Error(`Keyword ${n} has invalid name`)});if(!t)return;if(t.$data&&!("code"in t||"validate"in t)){throw new Error('$data keyword must have "code" or "validate" function')}}a(Thn,"checkKeyword");function HAe(e,t,r){var n;const i=t===null||t===void 0?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let o=i?s.post:s.rules.find(({type:l})=>l===r);if(!o){o={type:r,rules:[]};s.rules.push(o)}s.keywords[e]=true;if(!t)return;const u={keyword:e,definition:{...t,type:(0,TY.getJSONTypes)(t.type),schemaType:(0,TY.getJSONTypes)(t.schemaType)}};if(t.before)xhn.call(this,o,u,t.before);else o.rules.push(u);s.all[e]=u;(n=t.implements)===null||n===void 0?void 0:n.forEach(l=>this.addKeyword(l))}a(HAe,"addRule");function xhn(e,t,r){const n=e.rules.findIndex(i=>i.keyword===r);if(n>=0){e.rules.splice(n,0,t)}else{e.rules.push(t);this.logger.warn(`rule ${r} is not defined`)}}a(xhn,"addBeforeRule");function Rhn(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=bEt(t);e.validateSchema=this.compile(t,true)}a(Rhn,"keywordMetaschema");var Ohn={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function bEt(e){return{anyOf:[e,Ohn]}}a(bEt,"schemaOrData")});var AEt=y(zAe=>{"use strict";Object.defineProperty(zAe,"__esModule",{value:true});var Phn={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};zAe.default=Phn});var OY=y(MA=>{"use strict";Object.defineProperty(MA,"__esModule",{value:true});MA.callRef=MA.getValidate=void 0;var Nhn=CY();var CEt=Cf();var fd=En();var gO=Af();var wEt=BL();var xY=ui();var Ihn={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e;const{baseId:i,schemaEnv:s,validateName:o,opts:u,self:l}=n;const{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return p();const d=wEt.resolveRef.call(l,c,i,r);if(d===void 0)throw new Nhn.default(n.opts.uriResolver,i,r);if(d instanceof wEt.SchemaEnv)return f(d);return m(d);function p(){if(s===c)return RY(e,o,s,s.$async);const h=t.scopeValue("root",{ref:c});return RY(e,(0,fd._)`${h}.validate`,c,c.$async)}a(p,"callRootRef");function f(h){const g=TEt(e,h);RY(e,g,h,h.$async)}a(f,"callValidate");function m(h){const g=t.scopeValue("schema",u.code.source===true?{ref:h,code:(0,fd.stringify)(h)}:{ref:h});const _=t.name("valid");const v=e.subschema({schema:h,dataTypes:[],schemaPath:fd.nil,topSchemaRef:g,errSchemaPath:r},_);e.mergeEvaluated(v);e.ok(_)}a(m,"inlineRefSchema")}};function TEt(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,fd._)`${r.scopeValue("wrapper",{ref:t})}.validate`}a(TEt,"getValidate");MA.getValidate=TEt;function RY(e,t,r,n){const{gen:i,it:s}=e;const{allErrors:o,schemaEnv:u,opts:l}=s;const c=l.passContext?gO.default.this:fd.nil;if(n)d();else p();function d(){if(!u.$async)throw new Error("async schema referenced by sync schema");const h=i.let("valid");i.try(()=>{i.code((0,fd._)`await ${(0,CEt.callValidateCode)(e,t,c)}`);m(t);if(!o)i.assign(h,true)},g=>{i.if((0,fd._)`!(${g} instanceof ${s.ValidationError})`,()=>i.throw(g));f(g);if(!o)i.assign(h,false)});e.ok(h)}a(d,"callAsyncRef");function p(){e.result((0,CEt.callValidateCode)(e,t,c),()=>m(t),()=>f(t))}a(p,"callSyncRef");function f(h){const g=(0,fd._)`${h}.errors`;i.assign(gO.default.vErrors,(0,fd._)`${gO.default.vErrors} === null ? ${g} : ${gO.default.vErrors}.concat(${g})`);i.assign(gO.default.errors,(0,fd._)`${gO.default.vErrors}.length`)}a(f,"addErrorsFrom");function m(h){var g;if(!s.opts.unevaluated)return;const _=(g=r===null||r===void 0?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(s.props!==true){if(_&&!_.dynamicProps){if(_.props!==void 0){s.props=xY.mergeEvaluated.props(i,_.props,s.props)}}else{const v=i.var("props",(0,fd._)`${h}.evaluated.props`);s.props=xY.mergeEvaluated.props(i,v,s.props,fd.Name)}}if(s.items!==true){if(_&&!_.dynamicItems){if(_.items!==void 0){s.items=xY.mergeEvaluated.items(i,_.items,s.items)}}else{const v=i.var("items",(0,fd._)`${h}.evaluated.items`);s.items=xY.mergeEvaluated.items(i,v,s.items,fd.Name)}}}a(m,"addEvaluatedFrom")}a(RY,"callRef");MA.callRef=RY;MA.default=Ihn});var xEt=y(KAe=>{"use strict";Object.defineProperty(KAe,"__esModule",{value:true});var khn=AEt();var Dhn=OY();var Lhn=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",khn.default,Dhn.default];KAe.default=Lhn});var REt=y(WAe=>{"use strict";Object.defineProperty(WAe,"__esModule",{value:true});var PY=En();var vE=PY.operators;var NY={maximum:{okStr:"<=",ok:vE.LTE,fail:vE.GT},minimum:{okStr:">=",ok:vE.GTE,fail:vE.LT},exclusiveMaximum:{okStr:"<",ok:vE.LT,fail:vE.GTE},exclusiveMinimum:{okStr:">",ok:vE.GT,fail:vE.LTE}};var Fhn={message:({keyword:e,schemaCode:t})=>(0,PY.str)`must be ${NY[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,PY._)`{comparison: ${NY[e].okStr}, limit: ${t}}`};var Bhn={keyword:Object.keys(NY),type:"number",schemaType:"number",$data:true,error:Fhn,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,PY._)`${r} ${NY[t].fail} ${n} || isNaN(${r})`)}};WAe.default=Bhn});var OEt=y(YAe=>{"use strict";Object.defineProperty(YAe,"__esModule",{value:true});var $L=En();var Mhn={message:({schemaCode:e})=>(0,$L.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,$L._)`{multipleOf: ${e}}`};var qhn={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:Mhn,code(e){const{gen:t,data:r,schemaCode:n,it:i}=e;const s=i.opts.multipleOfPrecision;const o=t.let("res");const u=s?(0,$L._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,$L._)`${o} !== parseInt(${o})`;e.fail$data((0,$L._)`(${n} === 0 || (${o} = ${r}/${n}, ${u}))`)}};YAe.default=qhn});var NEt=y(XAe=>{"use strict";Object.defineProperty(XAe,"__esModule",{value:true});function PEt(e){const t=e.length;let r=0;let n=0;let i;while(n<t){r++;i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<t){i=e.charCodeAt(n);if((i&64512)===56320)n++}}return r}a(PEt,"ucs2length");XAe.default=PEt;PEt.code='require("ajv/dist/runtime/ucs2length").default'});var IEt=y(JAe=>{"use strict";Object.defineProperty(JAe,"__esModule",{value:true});var qA=En();var Uhn=ui();var $hn=NEt();var jhn={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,qA.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,qA._)`{limit: ${e}}`};var Ghn={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:jhn,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e;const s=t==="maxLength"?qA.operators.GT:qA.operators.LT;const o=i.opts.unicode===false?(0,qA._)`${r}.length`:(0,qA._)`${(0,Uhn.useFunc)(e.gen,$hn.default)}(${r})`;e.fail$data((0,qA._)`${o} ${s} ${n}`)}};JAe.default=Ghn});var kEt=y(QAe=>{"use strict";Object.defineProperty(QAe,"__esModule",{value:true});var Hhn=Cf();var IY=En();var Vhn={message:({schemaCode:e})=>(0,IY.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,IY._)`{pattern: ${e}}`};var zhn={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:Vhn,code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:s}=e;const o=s.opts.unicodeRegExp?"u":"";const u=r?(0,IY._)`(new RegExp(${i}, ${o}))`:(0,Hhn.usePattern)(e,n);e.fail$data((0,IY._)`!${u}.test(${t})`)}};QAe.default=zhn});var DEt=y(ZAe=>{"use strict";Object.defineProperty(ZAe,"__esModule",{value:true});var jL=En();var Khn={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,jL.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,jL._)`{limit: ${e}}`};var Whn={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:Khn,code(e){const{keyword:t,data:r,schemaCode:n}=e;const i=t==="maxProperties"?jL.operators.GT:jL.operators.LT;e.fail$data((0,jL._)`Object.keys(${r}).length ${i} ${n}`)}};ZAe.default=Whn});var LEt=y(eCe=>{"use strict";Object.defineProperty(eCe,"__esModule",{value:true});var GL=Cf();var HL=En();var Yhn=ui();var Xhn={message:({params:{missingProperty:e}})=>(0,HL.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,HL._)`{missingProperty: ${e}}`};var Jhn={keyword:"required",type:"object",schemaType:"array",$data:true,error:Xhn,code(e){const{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:o}=e;const{opts:u}=o;if(!s&&r.length===0)return;const l=r.length>=u.loopRequired;if(o.allErrors)c();else d();if(u.strictRequired){const m=e.parentSchema.properties;const{definedProperties:h}=e.it;for(const g of r){if((m===null||m===void 0?void 0:m[g])===void 0&&!h.has(g)){const _=o.schemaEnv.baseId+o.errSchemaPath;const v=`required property "${g}" is not defined at "${_}" (strictRequired)`;(0,Yhn.checkStrictMode)(o,v,o.opts.strictRequired)}}}function c(){if(l||s){e.block$data(HL.nil,p)}else{for(const m of r){(0,GL.checkReportMissingProp)(e,m)}}}a(c,"allErrorsMode");function d(){const m=t.let("missing");if(l||s){const h=t.let("valid",true);e.block$data(h,()=>f(m,h));e.ok(h)}else{t.if((0,GL.checkMissingProp)(e,r,m));(0,GL.reportMissingProp)(e,m);t.else()}}a(d,"exitOnErrorMode");function p(){t.forOf("prop",n,m=>{e.setParams({missingProperty:m});t.if((0,GL.noPropertyInData)(t,i,m,u.ownProperties),()=>e.error())})}a(p,"loopAllRequired");function f(m,h){e.setParams({missingProperty:m});t.forOf(m,n,()=>{t.assign(h,(0,GL.propertyInData)(t,i,m,u.ownProperties));t.if((0,HL.not)(h),()=>{e.error();t.break()})},HL.nil)}a(f,"loopUntilMissing")}};eCe.default=Jhn});var FEt=y(tCe=>{"use strict";Object.defineProperty(tCe,"__esModule",{value:true});var VL=En();var Qhn={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,VL.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,VL._)`{limit: ${e}}`};var Zhn={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:Qhn,code(e){const{keyword:t,data:r,schemaCode:n}=e;const i=t==="maxItems"?VL.operators.GT:VL.operators.LT;e.fail$data((0,VL._)`${r}.length ${i} ${n}`)}};tCe.default=Zhn});var kY=y(rCe=>{"use strict";Object.defineProperty(rCe,"__esModule",{value:true});var BEt=np();BEt.code='require("ajv/dist/runtime/equal").default';rCe.default=BEt});var MEt=y(iCe=>{"use strict";Object.defineProperty(iCe,"__esModule",{value:true});var nCe=IL();var nl=En();var e0n=ui();var t0n=kY();var r0n={message:({params:{i:e,j:t}})=>(0,nl.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,nl._)`{i: ${e}, j: ${t}}`};var n0n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:r0n,code(e){const{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:u}=e;if(!n&&!i)return;const l=t.let("valid");const c=s.items?(0,nCe.getSchemaTypes)(s.items):[];e.block$data(l,d,(0,nl._)`${o} === false`);e.ok(l);function d(){const h=t.let("i",(0,nl._)`${r}.length`);const g=t.let("j");e.setParams({i:h,j:g});t.assign(l,true);t.if((0,nl._)`${h} > 1`,()=>(p()?f:m)(h,g))}a(d,"validateUniqueItems");function p(){return c.length>0&&!c.some(h=>h==="object"||h==="array")}a(p,"canOptimize");function f(h,g){const _=t.name("item");const v=(0,nCe.checkDataTypes)(c,_,u.opts.strictNumbers,nCe.DataType.Wrong);const S=t.const("indices",(0,nl._)`{}`);t.for((0,nl._)`;${h}--;`,()=>{t.let(_,(0,nl._)`${r}[${h}]`);t.if(v,(0,nl._)`continue`);if(c.length>1)t.if((0,nl._)`typeof ${_} == "string"`,(0,nl._)`${_} += "_"`);t.if((0,nl._)`typeof ${S}[${_}] == "number"`,()=>{t.assign(g,(0,nl._)`${S}[${_}]`);e.error();t.assign(l,false).break()}).code((0,nl._)`${S}[${_}] = ${h}`)})}a(f,"loopN");function m(h,g){const _=(0,e0n.useFunc)(t,t0n.default);const v=t.name("outer");t.label(v).for((0,nl._)`;${h}--;`,()=>t.for((0,nl._)`${g} = ${h}; ${g}--;`,()=>t.if((0,nl._)`${_}(${r}[${h}], ${r}[${g}])`,()=>{e.error();t.assign(l,false).break(v)})))}a(m,"loopN2")}};iCe.default=n0n});var qEt=y(aCe=>{"use strict";Object.defineProperty(aCe,"__esModule",{value:true});var sCe=En();var i0n=ui();var s0n=kY();var a0n={message:"must be equal to constant",params:({schemaCode:e})=>(0,sCe._)`{allowedValue: ${e}}`};var o0n={keyword:"const",$data:true,error:a0n,code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;if(n||s&&typeof s=="object"){e.fail$data((0,sCe._)`!${(0,i0n.useFunc)(t,s0n.default)}(${r}, ${i})`)}else{e.fail((0,sCe._)`${s} !== ${r}`)}}};aCe.default=o0n});var UEt=y(oCe=>{"use strict";Object.defineProperty(oCe,"__esModule",{value:true});var zL=En();var u0n=ui();var l0n=kY();var c0n={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,zL._)`{allowedValues: ${e}}`};var d0n={keyword:"enum",schemaType:"array",$data:true,error:c0n,code(e){const{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e;if(!n&&i.length===0)throw new Error("enum must have non-empty array");const u=i.length>=o.opts.loopEnum;let l;const c=a(()=>l!==null&&l!==void 0?l:l=(0,u0n.useFunc)(t,l0n.default),"getEql");let d;if(u||n){d=t.let("valid");e.block$data(d,p)}else{if(!Array.isArray(i))throw new Error("ajv implementation error");const m=t.const("vSchema",s);d=(0,zL.or)(...i.map((h,g)=>f(m,g)))}e.pass(d);function p(){t.assign(d,false);t.forOf("v",s,m=>t.if((0,zL._)`${c()}(${r}, ${m})`,()=>t.assign(d,true).break()))}a(p,"loopEnum");function f(m,h){const g=i[h];return typeof g==="object"&&g!==null?(0,zL._)`${c()}(${r}, ${m}[${h}])`:(0,zL._)`${r} === ${g}`}a(f,"equalCode")}};oCe.default=d0n});var $Et=y(uCe=>{"use strict";Object.defineProperty(uCe,"__esModule",{value:true});var p0n=REt();var f0n=OEt();var m0n=IEt();var h0n=kEt();var g0n=DEt();var y0n=LEt();var _0n=FEt();var v0n=MEt();var E0n=qEt();var b0n=UEt();var S0n=[p0n.default,f0n.default,m0n.default,h0n.default,g0n.default,y0n.default,_0n.default,v0n.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},E0n.default,b0n.default];uCe.default=S0n});var cCe=y(KL=>{"use strict";Object.defineProperty(KL,"__esModule",{value:true});KL.validateAdditionalItems=void 0;var UA=En();var lCe=ui();var A0n={message:({params:{len:e}})=>(0,UA.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,UA._)`{limit: ${e}}`};var C0n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:A0n,code(e){const{parentSchema:t,it:r}=e;const{items:n}=t;if(!Array.isArray(n)){(0,lCe.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}jEt(e,n)}};function jEt(e,t){const{gen:r,schema:n,data:i,keyword:s,it:o}=e;o.items=true;const u=r.const("len",(0,UA._)`${i}.length`);if(n===false){e.setParams({len:t.length});e.pass((0,UA._)`${u} <= ${t.length}`)}else if(typeof n=="object"&&!(0,lCe.alwaysValidSchema)(o,n)){const c=r.var("valid",(0,UA._)`${u} <= ${t.length}`);r.if((0,UA.not)(c),()=>l(c));e.ok(c)}function l(c){r.forRange("i",t.length,u,d=>{e.subschema({keyword:s,dataProp:d,dataPropType:lCe.Type.Num},c);if(!o.allErrors)r.if((0,UA.not)(c),()=>r.break())})}a(l,"validateItems")}a(jEt,"validateAdditionalItems");KL.validateAdditionalItems=jEt;KL.default=C0n});var dCe=y(WL=>{"use strict";Object.defineProperty(WL,"__esModule",{value:true});WL.validateTuple=void 0;var GEt=En();var DY=ui();var w0n=Cf();var T0n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return HEt(e,"additionalItems",t);r.items=true;if((0,DY.alwaysValidSchema)(r,t))return;e.ok((0,w0n.validateArray)(e))}};function HEt(e,t,r=e.schema){const{gen:n,parentSchema:i,data:s,keyword:o,it:u}=e;d(i);if(u.opts.unevaluated&&r.length&&u.items!==true){u.items=DY.mergeEvaluated.items(n,r.length,u.items)}const l=n.name("valid");const c=n.const("len",(0,GEt._)`${s}.length`);r.forEach((p,f)=>{if((0,DY.alwaysValidSchema)(u,p))return;n.if((0,GEt._)`${c} > ${f}`,()=>e.subschema({keyword:o,schemaProp:f,dataProp:f},l));e.ok(l)});function d(p){const{opts:f,errSchemaPath:m}=u;const h=r.length;const g=h===p.minItems&&(h===p.maxItems||p[t]===false);if(f.strictTuples&&!g){const _=`"${o}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;(0,DY.checkStrictMode)(u,_,f.strictTuples)}}a(d,"checkStrictTuple")}a(HEt,"validateTuple");WL.validateTuple=HEt;WL.default=T0n});var VEt=y(pCe=>{"use strict";Object.defineProperty(pCe,"__esModule",{value:true});var x0n=dCe();var R0n={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,x0n.validateTuple)(e,"items")};pCe.default=R0n});var KEt=y(fCe=>{"use strict";Object.defineProperty(fCe,"__esModule",{value:true});var zEt=En();var O0n=ui();var P0n=Cf();var N0n=cCe();var I0n={message:({params:{len:e}})=>(0,zEt.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,zEt._)`{limit: ${e}}`};var k0n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:I0n,code(e){const{schema:t,parentSchema:r,it:n}=e;const{prefixItems:i}=r;n.items=true;if((0,O0n.alwaysValidSchema)(n,t))return;if(i)(0,N0n.validateAdditionalItems)(e,i);else e.ok((0,P0n.validateArray)(e))}};fCe.default=k0n});var WEt=y(mCe=>{"use strict";Object.defineProperty(mCe,"__esModule",{value:true});var Tf=En();var LY=ui();var D0n={message:({params:{min:e,max:t}})=>t===void 0?(0,Tf.str)`must contain at least ${e} valid item(s)`:(0,Tf.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Tf._)`{minContains: ${e}}`:(0,Tf._)`{minContains: ${e}, maxContains: ${t}}`};var L0n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:D0n,code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;let o;let u;const{minContains:l,maxContains:c}=n;if(s.opts.next){o=l===void 0?1:l;u=c}else{o=1}const d=t.const("len",(0,Tf._)`${i}.length`);e.setParams({min:o,max:u});if(u===void 0&&o===0){(0,LY.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(u!==void 0&&o>u){(0,LY.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`);e.fail();return}if((0,LY.alwaysValidSchema)(s,r)){let g=(0,Tf._)`${d} >= ${o}`;if(u!==void 0)g=(0,Tf._)`${g} && ${d} <= ${u}`;e.pass(g);return}s.items=true;const p=t.name("valid");if(u===void 0&&o===1){m(p,()=>t.if(p,()=>t.break()))}else if(o===0){t.let(p,true);if(u!==void 0)t.if((0,Tf._)`${i}.length > 0`,f)}else{t.let(p,false);f()}e.result(p,()=>e.reset());function f(){const g=t.name("_valid");const _=t.let("count",0);m(g,()=>t.if(g,()=>h(_)))}a(f,"validateItemsWithCount");function m(g,_){t.forRange("i",0,d,v=>{e.subschema({keyword:"contains",dataProp:v,dataPropType:LY.Type.Num,compositeRule:true},g);_()})}a(m,"validateItems");function h(g){t.code((0,Tf._)`${g}++`);if(u===void 0){t.if((0,Tf._)`${g} >= ${o}`,()=>t.assign(p,true).break())}else{t.if((0,Tf._)`${g} > ${u}`,()=>t.assign(p,false).break());if(o===1)t.assign(p,true);else t.if((0,Tf._)`${g} >= ${o}`,()=>t.assign(p,true))}}a(h,"checkLimits")}};mCe.default=L0n});var FY=y(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:true});j0.validateSchemaDeps=j0.validatePropertyDeps=j0.error=void 0;var hCe=En();var F0n=ui();var YL=Cf();j0.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const n=t===1?"property":"properties";return(0,hCe.str)`must have ${n} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>(0,hCe._)`{property: ${e},
@@ -407,7 +407,7 @@ ${p}
407
407
  ${f}`;const h=`${o}/${e.region}/${n}/${pSn}`;const g=`${PCt}
408
408
  ${s}
409
409
  ${h}
410
- `+await e.crypto.sha256DigestHex(m);const _=await fSn(e.crypto,e.securityCredentials.secretAccessKey,o,e.region,n);const v=await vF(e.crypto,_,g);const S=`${PCt} Credential=${e.securityCredentials.accessKeyId}/${h}, SignedHeaders=${p}, Signature=${(0,NCt.fromArrayBufferToHex)(v)}`;return{amzDate:u.date?void 0:s,authorizationHeader:S,canonicalQuerystring:e.canonicalQuerystring}}a(mSn,"generateAuthenticationHeaderMap")});var ZTe=y(QX=>{"use strict";Object.defineProperty(QX,"__esModule",{value:true});QX.AwsClient=void 0;var hSn=ICt();var gSn=ME();var EF=class extends gSn.BaseExternalAccountClient{static{a(this,"AwsClient")}constructor(t,r){super(t,r);this.environmentId=t.credential_source.environment_id;this.regionUrl=t.credential_source.region_url;this.securityCredentialsUrl=t.credential_source.url;this.regionalCredVerificationUrl=t.credential_source.regional_cred_verification_url;this.imdsV2SessionTokenUrl=t.credential_source.imdsv2_session_token_url;this.awsRequestSigner=null;this.region="";this.validateEnvironmentId()}validateEnvironmentId(){var t;const r=(t=this.environmentId)===null||t===void 0?void 0:t.match(/^(aws)(\d+)$/);if(!r||!this.regionalCredVerificationUrl){throw new Error('No valid AWS "credential_source" provided')}else if(parseInt(r[2],10)!==1){throw new Error(`aws version "${r[2]}" is not supported in the current build.`)}}async retrieveSubjectToken(){if(!this.awsRequestSigner){const i={};if(this.shouldUseMetadataServer()&&this.imdsV2SessionTokenUrl){i["x-aws-ec2-metadata-token"]=await this.getImdsV2SessionToken()}this.region=await this.getAwsRegion(i);this.awsRequestSigner=new hSn.AwsRequestSigner(async()=>{if(this.securityCredentialsFromEnv){return this.securityCredentialsFromEnv}const s=await this.getAwsRoleName(i);const o=await this.getAwsSecurityCredentials(s,i);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,token:o.Token}},this.region)}const t=await this.awsRequestSigner.getRequestOptions({url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"});const r=[];const n=Object.assign({"x-goog-cloud-target-resource":this.audience},t.headers);for(const i in n){r.push({key:i,value:n[i]})}return encodeURIComponent(JSON.stringify({url:t.url,method:t.method,headers:r}))}async getImdsV2SessionToken(){const t={url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};const r=await this.transporter.request(t);return r.data}async getAwsRegion(t){if(this.regionFromEnv){return this.regionFromEnv}if(!this.regionUrl){throw new Error('Unable to determine AWS region due to missing "options.credential_source.region_url"')}const r={url:this.regionUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data.substr(0,n.data.length-1)}async getAwsRoleName(t){if(!this.securityCredentialsUrl){throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"')}const r={url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data}async getAwsSecurityCredentials(t,r){const n=await this.transporter.request({url:`${this.securityCredentialsUrl}/${t}`,responseType:"json",headers:r});return n.data}shouldUseMetadataServer(){return!this.regionFromEnv||!this.securityCredentialsFromEnv}get regionFromEnv(){return process.env["AWS_REGION"]||process.env["AWS_DEFAULT_REGION"]||null}get securityCredentialsFromEnv(){if(process.env["AWS_ACCESS_KEY_ID"]&&process.env["AWS_SECRET_ACCESS_KEY"]){return{accessKeyId:process.env["AWS_ACCESS_KEY_ID"],secretAccessKey:process.env["AWS_SECRET_ACCESS_KEY"],token:process.env["AWS_SESSION_TOKEN"]}}return null}};QX.AwsClient=EF;EF.AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";EF.AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254"});var ixe=y(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:true});Do.InvalidSubjectTokenError=Do.InvalidMessageFieldError=Do.InvalidCodeFieldError=Do.InvalidTokenTypeFieldError=Do.InvalidExpirationTimeFieldError=Do.InvalidSuccessFieldError=Do.InvalidVersionFieldError=Do.ExecutableResponseError=Do.ExecutableResponse=void 0;var ZX="urn:ietf:params:oauth:token-type:saml2";var exe="urn:ietf:params:oauth:token-type:id_token";var txe="urn:ietf:params:oauth:token-type:jwt";var rxe=class{static{a(this,"ExecutableResponse")}constructor(t){if(!t.version){throw new eJ("Executable response must contain a 'version' field.")}if(t.success===void 0){throw new tJ("Executable response must contain a 'success' field.")}this.version=t.version;this.success=t.success;if(this.success){this.expirationTime=t.expiration_time;this.tokenType=t.token_type;if(this.tokenType!==ZX&&this.tokenType!==exe&&this.tokenType!==txe){throw new rJ(`Executable response must contain a 'token_type' field when successful and it must be one of ${exe}, ${txe}, or ${ZX}.`)}if(this.tokenType===ZX){if(!t.saml_response){throw new bF(`Executable response must contain a 'saml_response' field when token_type=${ZX}.`)}this.subjectToken=t.saml_response}else{if(!t.id_token){throw new bF(`Executable response must contain a 'id_token' field when token_type=${exe} or ${txe}.`)}this.subjectToken=t.id_token}}else{if(!t.code){throw new nJ("Executable response must contain a 'code' field when unsuccessful.")}if(!t.message){throw new iJ("Executable response must contain a 'message' field when unsuccessful.")}this.errorCode=t.code;this.errorMessage=t.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};Do.ExecutableResponse=rxe;var tg=class extends Error{static{a(this,"ExecutableResponseError")}constructor(t){super(t);Object.setPrototypeOf(this,new.target.prototype)}};Do.ExecutableResponseError=tg;var eJ=class extends tg{static{a(this,"InvalidVersionFieldError")}};Do.InvalidVersionFieldError=eJ;var tJ=class extends tg{static{a(this,"InvalidSuccessFieldError")}};Do.InvalidSuccessFieldError=tJ;var nxe=class extends tg{static{a(this,"InvalidExpirationTimeFieldError")}};Do.InvalidExpirationTimeFieldError=nxe;var rJ=class extends tg{static{a(this,"InvalidTokenTypeFieldError")}};Do.InvalidTokenTypeFieldError=rJ;var nJ=class extends tg{static{a(this,"InvalidCodeFieldError")}};Do.InvalidCodeFieldError=nJ;var iJ=class extends tg{static{a(this,"InvalidMessageFieldError")}};Do.InvalidMessageFieldError=iJ;var bF=class extends tg{static{a(this,"InvalidSubjectTokenError")}};Do.InvalidSubjectTokenError=bF});var kCt=y(sJ=>{"use strict";Object.defineProperty(sJ,"__esModule",{value:true});sJ.PluggableAuthHandler=void 0;var ySn=aJ();var QA=ixe();var _Sn=require("child_process");var sxe=require("fs");var axe=class e{static{a(this,"PluggableAuthHandler")}constructor(t){if(!t.command){throw new Error("No command provided.")}this.commandComponents=e.parseCommand(t.command);this.timeoutMillis=t.timeoutMillis;if(!this.timeoutMillis){throw new Error("No timeoutMillis provided.")}this.outputFile=t.outputFile}retrieveResponseFromExecutable(t){return new Promise((r,n)=>{const i=_Sn.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(t)}});let s="";i.stdout.on("data",u=>{s+=u});i.stderr.on("data",u=>{s+=u});const o=setTimeout(()=>{i.removeAllListeners();i.kill();return n(new Error("The executable failed to finish within the timeout specified."))},this.timeoutMillis);i.on("close",u=>{clearTimeout(o);if(u===0){try{const l=JSON.parse(s);const c=new QA.ExecutableResponse(l);return r(c)}catch(l){if(l instanceof QA.ExecutableResponseError){return n(l)}return n(new QA.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}}else{return n(new ySn.ExecutableError(s,u.toString()))}})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0){return void 0}let t;try{t=await sxe.promises.realpath(this.outputFile)}catch(n){return void 0}if(!(await sxe.promises.lstat(t)).isFile()){return void 0}const r=await sxe.promises.readFile(t,{encoding:"utf8"});if(r===""){return void 0}try{const n=JSON.parse(r);const i=new QA.ExecutableResponse(n);if(i.isValid()){return new QA.ExecutableResponse(n)}return void 0}catch(n){if(n instanceof QA.ExecutableResponseError){throw n}throw new QA.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(t){const r=t.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r){throw new Error(`Provided command: "${t}" could not be parsed.`)}for(let n=0;n<r.length;n++){if(r[n][0]==='"'&&r[n].slice(-1)==='"'){r[n]=r[n].slice(1,-1)}}return r}};sJ.PluggableAuthHandler=axe});var aJ=y(KO=>{"use strict";Object.defineProperty(KO,"__esModule",{value:true});KO.PluggableAuthClient=KO.ExecutableError=void 0;var vSn=ME();var ESn=ixe();var bSn=kCt();var oJ=class extends Error{static{a(this,"ExecutableError")}constructor(t,r){super(`The executable failed with exit code: ${r} and error message: ${t}.`);this.code=r;Object.setPrototypeOf(this,new.target.prototype)}};KO.ExecutableError=oJ;var SSn=30*1e3;var DCt=5*1e3;var LCt=120*1e3;var ASn="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES";var FCt=1;var oxe=class extends vSn.BaseExternalAccountClient{static{a(this,"PluggableAuthClient")}constructor(t,r){super(t,r);if(!t.credential_source.executable){throw new Error('No valid Pluggable Auth "credential_source" provided.')}this.command=t.credential_source.executable.command;if(!this.command){throw new Error('No valid Pluggable Auth "credential_source" provided.')}if(t.credential_source.executable.timeout_millis===void 0){this.timeoutMillis=SSn}else{this.timeoutMillis=t.credential_source.executable.timeout_millis;if(this.timeoutMillis<DCt||this.timeoutMillis>LCt){throw new Error(`Timeout must be between ${DCt} and ${LCt} milliseconds.`)}}this.outputFile=t.credential_source.executable.output_file;this.handler=new bSn.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile})}async retrieveSubjectToken(){if(process.env[ASn]!=="1"){throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.")}let t=void 0;if(this.outputFile){t=await this.handler.retrieveCachedResponse()}if(!t){const r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience);r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType);r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0");if(this.outputFile){r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile)}const n=this.getServiceAccountEmail();if(n){r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n)}t=await this.handler.retrieveResponseFromExecutable(r)}if(t.version>FCt){throw new Error(`Version of executable is not currently supported, maximum supported version is ${FCt}.`)}if(!t.success){throw new oJ(t.errorMessage,t.errorCode)}if(this.outputFile){if(!t.expirationTime){throw new ESn.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.")}}if(t.isExpired()){throw new Error("Executable response is expired.")}return t.subjectToken}};KO.PluggableAuthClient=oxe});var lxe=y(uJ=>{"use strict";Object.defineProperty(uJ,"__esModule",{value:true});uJ.ExternalAccountClient=void 0;var CSn=ME();var wSn=JTe();var TSn=ZTe();var xSn=aJ();var uxe=class{static{a(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(t,r){var n,i;if(t&&t.type===CSn.EXTERNAL_ACCOUNT_TYPE){if((n=t.credential_source)===null||n===void 0?void 0:n.environment_id){return new TSn.AwsClient(t,r)}else if((i=t.credential_source)===null||i===void 0?void 0:i.executable){return new xSn.PluggableAuthClient(t,r)}else{return new wSn.IdentityPoolClient(t,r)}}else{return null}}};uJ.ExternalAccountClient=uxe});var MCt=y(WO=>{"use strict";Object.defineProperty(WO,"__esModule",{value:true});WO.ExternalAccountAuthorizedUserClient=WO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var RSn=xO();var BCt=UTe();var OSn=Ey();var PSn=require("stream");var NSn=ME();WO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var cxe=class extends BCt.OAuthClientAuthHandler{static{a(this,"ExternalAccountAuthorizedUserHandler")}constructor(t,r,n){super(n);this.url=t;this.transporter=r}async refreshToken(t,r){const n=new URLSearchParams({grant_type:"refresh_token",refresh_token:t});const i={"Content-Type":"application/x-www-form-urlencoded",...r};const s={url:this.url,method:"POST",headers:i,data:n.toString(),responseType:"json"};this.applyClientAuthenticationOptions(s);try{const o=await this.transporter.request(s);const u=o.data;u.res=o;return u}catch(o){if(o instanceof OSn.GaxiosError&&o.response){throw(0,BCt.getErrorFromOAuthErrorResponse)(o.response.data,o)}throw o}}};var dxe=class extends RSn.AuthClient{static{a(this,"ExternalAccountAuthorizedUserClient")}constructor(t,r){super();this.refreshToken=t.refresh_token;const n={confidentialClientType:"basic",clientId:t.client_id,clientSecret:t.client_secret};this.externalAccountAuthorizedUserHandler=new cxe(t.token_url,this.transporter,n);this.cachedAccessToken=null;this.quotaProjectId=t.quota_project_id;if(typeof(r===null||r===void 0?void 0:r.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=NSn.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=r.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(r===null||r===void 0?void 0:r.forceRefreshOnFailure)}async getAccessToken(){if(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof PSn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){const t=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);this.cachedAccessToken={access_token:t.access_token,expiry_date:new Date().getTime()+t.expires_in*1e3,res:t.res};if(t.refresh_token!==void 0){this.refreshToken=t.refresh_token}return this.cachedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};WO.ExternalAccountAuthorizedUserClient=dxe});var $Ct=y(XO=>{"use strict";Object.defineProperty(XO,"__esModule",{value:true});XO.GoogleAuth=XO.CLOUD_SDK_CLIENT_ID=void 0;var ISn=require("child_process");var SF=require("fs");var pxe=tX();var kSn=require("os");var fxe=require("path");var DSn=wO();var LSn=rF();var FSn=Swe();var BSn=Cwe();var MSn=wwe();var YO=DTe();var mxe=FTe();var lJ=MTe();var qSn=lxe();var AF=ME();var qCt=MCt();XO.CLOUD_SDK_CLIENT_ID="764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com";var UCt={NO_PROJECT_ID_FOUND:"Unable to detect a Project Id in the current environment. \nTo learn more about authentication and Google APIs, visit: \nhttps://cloud.google.com/docs/authentication/getting-started"};var cJ=class{static{a(this,"GoogleAuth")}get isGCE(){return this.checkIsGCE}constructor(t){this.checkIsGCE=void 0;this.jsonContent=null;this.cachedCredential=null;t=t||{};this._cachedProjectId=t.projectId||null;this.cachedCredential=t.authClient||null;this.keyFilename=t.keyFilename||t.keyFile;this.scopes=t.scopes;this.jsonContent=t.credentials||null;this.clientOptions=t.clientOptions}setGapicJWTValues(t){t.defaultServicePath=this.defaultServicePath;t.useJWTAccessWithScope=this.useJWTAccessWithScope;t.defaultScopes=this.defaultScopes}getProjectId(t){if(t){this.getProjectIdAsync().then(r=>t(null,r),t)}else{return this.getProjectIdAsync()}}async getProjectIdOptional(){try{return await this.getProjectId()}catch(t){if(t instanceof Error&&t.message===UCt.NO_PROJECT_ID_FOUND){return null}else{throw t}}}async findAndCacheProjectId(){let t=null;t||(t=await this.getProductionProjectId());t||(t=await this.getFileProjectId());t||(t=await this.getDefaultServiceProjectId());t||(t=await this.getGCEProjectId());t||(t=await this.getExternalAccountClientProjectId());if(t){this._cachedProjectId=t;return t}else{throw new Error(UCt.NO_PROJECT_ID_FOUND)}}async getProjectIdAsync(){if(this._cachedProjectId){return this._cachedProjectId}if(!this._findProjectIdPromise){this._findProjectIdPromise=this.findAndCacheProjectId()}return this._findProjectIdPromise}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(t={},r){let n;if(typeof t==="function"){r=t}else{n=t}if(r){this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r)}else{return this.getApplicationDefaultAsync(n)}}async getApplicationDefaultAsync(t={}){if(this.cachedCredential){return await this.prepareAndCacheADC(this.cachedCredential)}const r=process.env["GOOGLE_CLOUD_QUOTA_PROJECT"];let n;n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(t);if(n){if(n instanceof YO.JWT){n.scopes=this.scopes}else if(n instanceof AF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}n=await this._tryGetApplicationCredentialsFromWellKnownFile(t);if(n){if(n instanceof YO.JWT){n.scopes=this.scopes}else if(n instanceof AF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}let i;try{i=await this._checkIsGCE()}catch(s){if(s instanceof Error){s.message=`Unexpected error determining execution environment: ${s.message}`}throw s}if(!i){throw new Error("Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.")}t.scopes=this.getAnyScopes();return await this.prepareAndCacheADC(new FSn.Compute(t),r)}async prepareAndCacheADC(t,r){const n=await this.getProjectIdOptional();if(r){t.quotaProjectId=r}this.cachedCredential=t;return{credential:t,projectId:n}}async _checkIsGCE(){if(this.checkIsGCE===void 0){this.checkIsGCE=await pxe.isAvailable()}return this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(t){const r=process.env["GOOGLE_APPLICATION_CREDENTIALS"]||process.env["google_application_credentials"];if(!r||r.length===0){return null}try{return this._getApplicationCredentialsFromFilePath(r,t)}catch(n){if(n instanceof Error){n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`}throw n}}async _tryGetApplicationCredentialsFromWellKnownFile(t){let r=null;if(this._isWindows()){r=process.env["APPDATA"]}else{const i=process.env["HOME"];if(i){r=fxe.join(i,".config")}}if(r){r=fxe.join(r,"gcloud","application_default_credentials.json");if(!SF.existsSync(r)){r=null}}if(!r){return null}const n=await this._getApplicationCredentialsFromFilePath(r,t);return n}async _getApplicationCredentialsFromFilePath(t,r={}){if(!t||t.length===0){throw new Error("The file path is invalid.")}try{t=SF.realpathSync(t);if(!SF.lstatSync(t).isFile()){throw new Error}}catch(i){if(i instanceof Error){i.message=`The file at ${t} does not exist, or it is not a file. ${i.message}`}throw i}const n=SF.createReadStream(t);return this.fromStream(n,r)}fromImpersonatedJSON(t){var r,n,i,s;if(!t){throw new Error("Must pass in a JSON object containing an impersonated refresh token")}if(t.type!==lJ.IMPERSONATED_ACCOUNT_TYPE){throw new Error(`The incoming JSON object does not have the "${lJ.IMPERSONATED_ACCOUNT_TYPE}" type`)}if(!t.source_credentials){throw new Error("The incoming JSON object does not contain a source_credentials field")}if(!t.service_account_impersonation_url){throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field")}const o=new mxe.UserRefreshClient(t.source_credentials.client_id,t.source_credentials.client_secret,t.source_credentials.refresh_token);const u=(n=(r=/(?<target>[^/]+):generateAccessToken$/.exec(t.service_account_impersonation_url))===null||r===void 0?void 0:r.groups)===null||n===void 0?void 0:n.target;if(!u){throw new RangeError(`Cannot extract target principal from ${t.service_account_impersonation_url}`)}const l=(i=this.getAnyScopes())!==null&&i!==void 0?i:[];const c=new lJ.Impersonated({delegates:(s=t.delegates)!==null&&s!==void 0?s:[],sourceClient:o,targetPrincipal:u,targetScopes:Array.isArray(l)?l:[l]});return c}fromJSON(t,r={}){let n;r=r||{};if(t.type===mxe.USER_REFRESH_ACCOUNT_TYPE){n=new mxe.UserRefreshClient(r);n.fromJSON(t)}else if(t.type===lJ.IMPERSONATED_ACCOUNT_TYPE){n=this.fromImpersonatedJSON(t)}else if(t.type===AF.EXTERNAL_ACCOUNT_TYPE){n=qSn.ExternalAccountClient.fromJSON(t,r);n.scopes=this.getAnyScopes()}else if(t.type===qCt.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE){n=new qCt.ExternalAccountAuthorizedUserClient(t,r)}else{r.scopes=this.scopes;n=new YO.JWT(r);this.setGapicJWTValues(n);n.fromJSON(t)}return n}_cacheClientFromJSON(t,r){const n=this.fromJSON(t,r);this.jsonContent=t;this.cachedCredential=n;return n}fromStream(t,r={},n){let i={};if(typeof r==="function"){n=r}else{i=r}if(n){this.fromStreamAsync(t,i).then(s=>n(null,s),n)}else{return this.fromStreamAsync(t,i)}}fromStreamAsync(t,r){return new Promise((n,i)=>{if(!t){throw new Error("Must pass in a stream containing the Google auth settings.")}let s="";t.setEncoding("utf8").on("error",i).on("data",o=>s+=o).on("end",()=>{try{try{const o=JSON.parse(s);const u=this._cacheClientFromJSON(o,r);return n(u)}catch(o){if(!this.keyFilename)throw o;const u=new YO.JWT({...this.clientOptions,keyFile:this.keyFilename});this.cachedCredential=u;this.setGapicJWTValues(u);return n(u)}}catch(o){return i(o)}})})}fromAPIKey(t,r){r=r||{};const n=new YO.JWT(r);n.fromAPIKey(t);return n}_isWindows(){const t=kSn.platform();if(t&&t.length>=3){if(t.substring(0,3).toLowerCase()==="win"){return true}}return false}async getDefaultServiceProjectId(){return new Promise(t=>{(0,ISn.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n){try{const i=JSON.parse(n).configuration.properties.core.project;t(i);return}catch(i){}}t(null)})})}getProductionProjectId(){return process.env["GCLOUD_PROJECT"]||process.env["GOOGLE_CLOUD_PROJECT"]||process.env["gcloud_project"]||process.env["google_cloud_project"]}async getFileProjectId(){if(this.cachedCredential){return this.cachedCredential.projectId}if(this.keyFilename){const r=await this.getClient();if(r&&r.projectId){return r.projectId}}const t=await this._tryGetApplicationCredentialsFromEnvironmentVariable();if(t){return t.projectId}else{return null}}async getExternalAccountClientProjectId(){if(!this.jsonContent||this.jsonContent.type!==AF.EXTERNAL_ACCOUNT_TYPE){return null}const t=await this.getClient();return await t.getProjectId()}async getGCEProjectId(){try{const t=await pxe.project("project-id");return t}catch(t){return null}}getCredentials(t){if(t){this.getCredentialsAsync().then(r=>t(null,r),t)}else{return this.getCredentialsAsync()}}async getCredentialsAsync(){const t=await this.getClient();if(t instanceof AF.BaseExternalAccountClient){const i=t.getServiceAccountEmail();if(i){return{client_email:i}}}if(this.jsonContent){const i={client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key};return i}const r=await this._checkIsGCE();if(!r){throw new Error("Unknown error.")}const n=await pxe.instance({property:"service-accounts/",params:{recursive:"true"}});if(!n||!n.default||!n.default.email){throw new Error("Failure from metadata server.")}return{client_email:n.default.email}}async getClient(){if(!this.cachedCredential){if(this.jsonContent){this._cacheClientFromJSON(this.jsonContent,this.clientOptions)}else if(this.keyFilename){const t=fxe.resolve(this.keyFilename);const r=SF.createReadStream(t);await this.fromStreamAsync(r,this.clientOptions)}else{await this.getApplicationDefaultAsync(this.clientOptions)}}return this.cachedCredential}async getIdTokenClient(t){const r=await this.getClient();if(!("fetchIdToken"in r)){throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.")}return new BSn.IdTokenClient({targetAudience:t,idTokenProvider:r})}async getAccessToken(){const t=await this.getClient();return(await t.getAccessToken()).token}async getRequestHeaders(t){const r=await this.getClient();return r.getRequestHeaders(t)}async authorizeRequest(t){t=t||{};const r=t.url||t.uri;const n=await this.getClient();const i=await n.getRequestHeaders(r);t.headers=Object.assign(t.headers||{},i);return t}async request(t){const r=await this.getClient();return r.request(t)}getEnv(){return(0,MSn.getEnv)()}async sign(t){const r=await this.getClient();const n=(0,DSn.createCrypto)();if(r instanceof YO.JWT&&r.key){const s=await n.sign(r.key,t);return s}const i=await this.getCredentials();if(!i.client_email){throw new Error("Cannot sign data without `client_email`.")}return this.signBlob(n,i.client_email,t)}async signBlob(t,r,n){const i=`https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/${r}:signBlob`;const s=await this.request({method:"POST",url:i,data:{payload:t.encodeBase64StringUtf8(n)}});return s.data.signedBlob}};XO.GoogleAuth=cJ;cJ.DefaultTransporter=LSn.DefaultTransporter});var jCt=y(dJ=>{"use strict";Object.defineProperty(dJ,"__esModule",{value:true});dJ.IAMAuth=void 0;var hxe=class{static{a(this,"IAMAuth")}constructor(t,r){this.selector=t;this.token=r;this.selector=t;this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};dJ.IAMAuth=hxe});var GCt=y(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:true});fh.DownscopedClient=fh.EXPIRATION_TIME_OFFSET=fh.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var USn=require("stream");var $Sn=xO();var jSn=jTe();var GSn="urn:ietf:params:oauth:grant-type:token-exchange";var HSn="urn:ietf:params:oauth:token-type:access_token";var VSn="urn:ietf:params:oauth:token-type:access_token";var zSn="https://sts.googleapis.com/v1/token";fh.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;fh.EXPIRATION_TIME_OFFSET=5*60*1e3;var gxe=class extends $Sn.AuthClient{static{a(this,"DownscopedClient")}constructor(t,r,n,i){super();this.authClient=t;this.credentialAccessBoundary=r;if(r.accessBoundary.accessBoundaryRules.length===0){throw new Error("At least one access boundary rule needs to be defined.")}else if(r.accessBoundary.accessBoundaryRules.length>fh.MAX_ACCESS_BOUNDARY_RULES_COUNT){throw new Error(`The provided access boundary has more than ${fh.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`)}for(const s of r.accessBoundary.accessBoundaryRules){if(s.availablePermissions.length===0){throw new Error("At least one permission should be defined in access boundary rules.")}}this.stsCredential=new jSn.StsCredentials(zSn);this.cachedDownscopedAccessToken=null;if(typeof(n===null||n===void 0?void 0:n.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=fh.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=n.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(n===null||n===void 0?void 0:n.forceRefreshOnFailure);this.quotaProjectId=i}setCredentials(t){if(!t.expiry_date){throw new Error("The access token expiry_date field is missing in the provided credentials.")}super.setCredentials(t);this.cachedDownscopedAccessToken=t}async getAccessToken(){if(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof USn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){var t;const r=(await this.authClient.getAccessToken()).token;const n={grantType:GSn,requestedTokenType:HSn,subjectToken:r,subjectTokenType:VSn};const i=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary);const s=((t=this.authClient.credentials)===null||t===void 0?void 0:t.expiry_date)||null;const o=i.expires_in?new Date().getTime()+i.expires_in*1e3:s;this.cachedDownscopedAccessToken={access_token:i.access_token,expiry_date:o,res:i.res};this.credentials={};Object.assign(this.credentials,this.cachedDownscopedAccessToken);delete this.credentials.res;this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null});return this.cachedDownscopedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};fh.DownscopedClient=gxe});var yxe=y(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:true});mn.GoogleAuth=mn.auth=mn.DefaultTransporter=mn.PluggableAuthClient=mn.DownscopedClient=mn.BaseExternalAccountClient=mn.ExternalAccountClient=mn.IdentityPoolClient=mn.AwsClient=mn.UserRefreshClient=mn.LoginTicket=mn.OAuth2Client=mn.CodeChallengeMethod=mn.Impersonated=mn.JWT=mn.JWTAccess=mn.IdTokenClient=mn.IAMAuth=mn.GCPEnv=mn.Compute=mn.AuthClient=void 0;var HCt=$Ct();Object.defineProperty(mn,"GoogleAuth",{enumerable:true,get:function(){return HCt.GoogleAuth}});var KSn=xO();Object.defineProperty(mn,"AuthClient",{enumerable:true,get:function(){return KSn.AuthClient}});var WSn=Swe();Object.defineProperty(mn,"Compute",{enumerable:true,get:function(){return WSn.Compute}});var YSn=wwe();Object.defineProperty(mn,"GCPEnv",{enumerable:true,get:function(){return YSn.GCPEnv}});var XSn=jCt();Object.defineProperty(mn,"IAMAuth",{enumerable:true,get:function(){return XSn.IAMAuth}});var JSn=Cwe();Object.defineProperty(mn,"IdTokenClient",{enumerable:true,get:function(){return JSn.IdTokenClient}});var QSn=ITe();Object.defineProperty(mn,"JWTAccess",{enumerable:true,get:function(){return QSn.JWTAccess}});var ZSn=DTe();Object.defineProperty(mn,"JWT",{enumerable:true,get:function(){return ZSn.JWT}});var eAn=MTe();Object.defineProperty(mn,"Impersonated",{enumerable:true,get:function(){return eAn.Impersonated}});var VCt=jA();Object.defineProperty(mn,"CodeChallengeMethod",{enumerable:true,get:function(){return VCt.CodeChallengeMethod}});Object.defineProperty(mn,"OAuth2Client",{enumerable:true,get:function(){return VCt.OAuth2Client}});var tAn=vwe();Object.defineProperty(mn,"LoginTicket",{enumerable:true,get:function(){return tAn.LoginTicket}});var rAn=FTe();Object.defineProperty(mn,"UserRefreshClient",{enumerable:true,get:function(){return rAn.UserRefreshClient}});var nAn=ZTe();Object.defineProperty(mn,"AwsClient",{enumerable:true,get:function(){return nAn.AwsClient}});var iAn=JTe();Object.defineProperty(mn,"IdentityPoolClient",{enumerable:true,get:function(){return iAn.IdentityPoolClient}});var sAn=lxe();Object.defineProperty(mn,"ExternalAccountClient",{enumerable:true,get:function(){return sAn.ExternalAccountClient}});var aAn=ME();Object.defineProperty(mn,"BaseExternalAccountClient",{enumerable:true,get:function(){return aAn.BaseExternalAccountClient}});var oAn=GCt();Object.defineProperty(mn,"DownscopedClient",{enumerable:true,get:function(){return oAn.DownscopedClient}});var uAn=aJ();Object.defineProperty(mn,"PluggableAuthClient",{enumerable:true,get:function(){return uAn.PluggableAuthClient}});var lAn=rF();Object.defineProperty(mn,"DefaultTransporter",{enumerable:true,get:function(){return lAn.DefaultTransporter}});var cAn=new HCt.GoogleAuth;mn.auth=cAn});var QO=y(JO=>{"use strict";var dAn=JO&&JO.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(JO,"__esModule",{value:true});JO.getServiceAccountIdToken=void 0;var pAn=yxe();var fAn=dAn(Bm());var mAn=new pAn.GoogleAuth;var zCt=new fAn.default({max:50,maxAge:1e3*60*50});async function hAn(e){let t=zCt.get(e);if(!t){const r=await mAn.getIdTokenClient(e);t=await r.idTokenProvider.fetchIdToken(e);zCt.set(e,t)}return t}a(hAn,"getServiceAccountIdToken");JO.getServiceAccountIdToken=hAn});var JCt=y(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:true});Df.mergeHeaders=Df.createFinalURL=Df.defaultBodySerializer=Df.defaultQuerySerializer=Df.createClient=void 0;var ZO=ac();var gAn=QO();var yAn=/\/*$/;async function _An(e){const{baseUrl:t,fetch:r=globalThis.fetch,querySerializer:n,bodySerializer:i,zuploExtensions:s,...o}=e;const u=s?.fastifyRequest.log;const l=s?.fastifyRequest.id;const c=s?.options?.userSub??s?.fastifyRequest.getUserSub();const d=new Headers({"zuplo-user":c,"zp-rid":l,...o.headers??{}});const p=await(0,gAn.getServiceAccountIdToken)(t);d.set("Authorization",`Bearer ${p}`);if(["GET","DELETE","HEAD","OPTIONS","TRACE"].includes(o.method?.toUpperCase()??"")){}else{d.set("Content-Type","application/json")}async function f(m,h){const{headers:g,body:_,params:v={},parseAs:S="json",querySerializer:E=n??KCt,bodySerializer:b=i??WCt,...A}=h||{};const C=YCt(m,{baseUrl:t,params:v,querySerializer:E});const T=XCt(d,g,v.header);const O={redirect:"follow",...o,...A,headers:T};if(_)O.body=b(_);if(O.body instanceof FormData)T.delete("Content-Type");const P=await r(C,O);if(P.status===404){const R=await P.json();if(R&&R.hasOwnProperty("type")&&R.hasOwnProperty("title")&&R.hasOwnProperty("status")){throw new ZO.ApiError(R)}throw new ZO.ApiError(ZO.Problems.NOT_FOUND)}if(P.status===204||P.headers.get("Content-Length")==="0"){return P.ok?{data:{},response:P}:{error:{},response:P}}if(P.ok){let R=P.body;if(S!=="stream"){const I=P.clone();R=typeof I[S]==="function"?await I[S]():await I.text()}return{data:R,response:P}}else{u.debug(`Error on internal api: path: ${C}, status: ${P.status}, headers: ${JSON.stringify(P.headers)}, body: ${await P.clone().text()}`);let R={};try{R=await P.clone().json();if(R.type&&R.status&&R.title){throw new ZO.ApiError(R)}}catch(I){}throw new ZO.ApiError(ZO.Problems.INTERNAL_SERVER_ERROR)}}a(f,"coreFetch");return{async GET(m,h){return f(m,{...h,method:"GET"})},async PUT(m,h){return f(m,{...h,method:"PUT"})},async POST(m,h){return f(m,{...h,method:"POST"})},async DELETE(m,h){return f(m,{...h,method:"DELETE"})},async OPTIONS(m,h){return f(m,{...h,method:"OPTIONS"})},async HEAD(m,h){return f(m,{...h,method:"HEAD"})},async PATCH(m,h){return f(m,{...h,method:"PATCH"})},async TRACE(m,h){return f(m,{...h,method:"TRACE"})}}}a(_An,"createClient");Df.createClient=_An;function KCt(e){const t=new URLSearchParams;if(e&&typeof e==="object"){for(const[r,n]of Object.entries(e)){if(n===void 0||n===null)continue;t.set(r,n)}}return t.toString()}a(KCt,"defaultQuerySerializer");Df.defaultQuerySerializer=KCt;function WCt(e){return JSON.stringify(e)}a(WCt,"defaultBodySerializer");Df.defaultBodySerializer=WCt;function YCt(e,t){let r=`${t.baseUrl?t.baseUrl.replace(yAn,""):""}${e}`;if(t.params.path){for(const[n,i]of Object.entries(t.params.path))r=r.replace(`{${n}}`,encodeURIComponent(String(i)))}if(t.params.query){const n=t.querySerializer(t.params.query);if(n)r+=`?${n}`}return r}a(YCt,"createFinalURL");Df.createFinalURL=YCt;function XCt(...e){const t=new Headers;for(const r of e){if(!r||typeof r!=="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n){if(s!==void 0&&s!==null){t.set(i,s)}}}return t}a(XCt,"mergeHeaders");Df.mergeHeaders=XCt});var QCt=y(qE=>{"use strict";var vAn=qE&&qE.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(qE,"__esModule",{value:true});qE.ApiKeyService=qE.createApiKeyServiceClient=void 0;var eP=ac();var EAn=yxe();var pJ=vAn(Zd());var bAn=JCt();async function SAn(e){return(0,bAn.createClient)({baseUrl:pJ.default.API_KEY_MANAGEMENT_SERVICE_URL,zuploExtensions:{fastifyRequest:e}})}a(SAn,"createApiKeyServiceClient");qE.createApiKeyServiceClient=SAn;var _xe=class{static{a(this,"ApiKeyService")}logger;requestId;constructor(t){this.logger=t.log;this.requestId=t.id}async fetchGCP(t,r={}){this.logger.info(`Fetching with GCP JWT ${r.method} ${t} from Api Key Service API.`);const n=new EAn.GoogleAuth;const i=await n.getIdTokenClient(pJ.default.API_KEY_MANAGEMENT_SERVICE_URL);this.logger.info(`Payload to send: ${JSON.stringify({url:`${pJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:"GET",body:r.body,headers:{...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}}})}`);const s=await i.getRequestHeaders();const o=await i.request({url:`${pJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:r.method||"GET",body:r.body,headers:{...s,...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}},validateStatus:u=>u>=200&&u<500});if(o.status===404){const u=await o.data;if(u&&u.hasOwnProperty("type")&&u.hasOwnProperty("title")&&u.hasOwnProperty("status")){throw new eP.ApiError(u)}throw new eP.ApiError(eP.Problems.NOT_FOUND)}if(o.status>=300){this.logger.debug(`Error on api-key-service: path: ${t}, status: ${o.status}, headers: ${JSON.stringify(o.headers)}, body: ${JSON.stringify(o.data)}`);const u=o.data;if(u.type&&u.status&&u.title){throw new eP.ApiError(u)}this.logger.error(`Error not handled on api-key-service: path: ${t}, status: ${o.status}`);throw new eP.ApiError(eP.Problems.INTERNAL_SERVER_ERROR)}if(o.status===204){return{}}return o.data}};qE.ApiKeyService=_xe});var ewt=y(tP=>{"use strict";var AAn=tP&&tP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(tP,"__esModule",{value:true});tP.AuthApiService=void 0;var ZA=ac();var ZCt=AAn(Zd());var CAn=QO();var vxe=class{static{a(this,"AuthApiService")}logger;requestId;baseUrl;constructor(t){this.logger=t.log;this.requestId=t.id;if(!ZCt.default.AUTH_API_URL){throw new Error("AUTH_API_URL is not set")}this.baseUrl=ZCt.default.AUTH_API_URL}async getClientJWT(t,r){let n;try{n=await this.fetch(`/v1/clients/${t}`,{method:"GET"})}catch(s){if(s.status===ZA.Problems.NOT_FOUND.status){n=await this.fetch(`/v1/clients`,{method:"POST",body:JSON.stringify({client_id:t})})}else{throw s}}const i=await this.fetch(`/v1/oauth/token`,{method:"POST",body:JSON.stringify({client_id:t,client_secret:n.client_secret,grant_type:"client_credentials",custom_claims:r})});return i.access_token}async fetch(t,r){this.logger.info(`Fetching internally ${t} from Auth API V2.`);const n=new Headers({"content-type":"application/json","zp-rid":this.requestId,authorization:""});if(process.env.K_SERVICE){const s=await(0,CAn.getServiceAccountIdToken)(this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===ZA.HttpStatusCode.NOT_FOUND){throw new ZA.ApiError(ZA.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on auth-api: path: ${t}, status: ${i.status}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new ZA.ApiError(s)}this.logger.error(`Error not handled on auth-api: path: ${t}, status: ${i.status}`);throw new ZA.ApiError(ZA.Problems.INTERNAL_SERVER_ERROR)}return i.clone().json()}};tP.AuthApiService=vxe});var CF=y(fJ=>{"use strict";Object.defineProperty(fJ,"__esModule",{value:true});fJ.ApiServiceClient=void 0;var rP=ac();var wAn=QO();var Exe=class{static{a(this,"ApiServiceClient")}userSub;logger;requestId;baseUrl;cache;targetAudience;constructor(t,r,n){this.userSub=n.userSub;this.logger=n.logger;this.requestId=n.requestId;this.baseUrl=t;this.cache=r;this.targetAudience=n.targetAudience}async cachedFetch(t,r,n){if(!this.userSub||!n){throw new Error("userSub and cacheKey parameters are required to use cachedFetch")}const i=`${this.userSub}@${n}`;if(this.cache.has(i)){return this.cache.get(i)}const s=await this.fetchInternally(t,r);this.cache.set(i,s);return s}async fetchInternally(t,r){this.logger.info(`Fetching internally ${r.method} ${this.baseUrl}${t}`);const n=new Headers({...r.headers,"zuplo-user":this.userSub,"content-type":"application/json","zp-rid":this.requestId});if(process.env.K_SERVICE){const s=await(0,wAn.getServiceAccountIdToken)(this.targetAudience??this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===404){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.json();if(s&&s.hasOwnProperty("type")&&s.hasOwnProperty("title")&&s.hasOwnProperty("status")){throw new rP.ApiError(s)}throw new rP.ApiError(rP.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new rP.ApiError(s)}this.logger.error(`Error not handled on internal api: path: ${t}, status: ${i.status}`);throw new rP.ApiError(rP.Problems.INTERNAL_SERVER_ERROR)}if(i.status===204){return{}}return i.clone().json()}};fJ.ApiServiceClient=Exe});var iwt=y(rg=>{"use strict";var rwt=rg&&rg.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(rg,"__esModule",{value:true});rg.ContentApiService=rg.getContentApiStorageTarballPath=rg.contentApiTarballFileName=void 0;var TAn=rwt(Bm());var twt=rwt(Zd());var xAn=CF();var RAn=new TAn.default({max:500,maxAge:1e3*60*50});function nwt(e,t){return`${e}--${t}.tar.gz`}a(nwt,"contentApiTarballFileName");rg.contentApiTarballFileName=nwt;function OAn(e,t){const r=nwt(e,t);return`${e}/builds/${r}`}a(OAn,"getContentApiStorageTarballPath");rg.getContentApiStorageTarballPath=OAn;var bxe=class extends xAn.ApiServiceClient{static{a(this,"ContentApiService")}constructor(t){if(!twt.default.CONTENT_API_URL){throw new Error("CONTENT_API_URL is not set")}super(twt.default.CONTENT_API_URL,RAn,t)}};rg.ContentApiService=bxe});var owt=y(nP=>{"use strict";var awt=nP&&nP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(nP,"__esModule",{value:true});nP.DevApiService=void 0;var PAn=awt(Bm());var swt=awt(Zd());var NAn=CF();var IAn=new PAn.default({max:500,maxAge:1e3*60*50});var Sxe=class extends NAn.ApiServiceClient{static{a(this,"DevApiService")}constructor(t,r){if(!swt.default.DEV_API_URL){throw new Error("DEV_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(swt.default.DEV_API_URL,IAn,{userSub:n,logger:t.log,requestId:t.id})}};nP.DevApiService=Sxe});var cwt=y((vDs,lwt)=>{var uwt=require("stream").Stream;var kAn=require("util");lwt.exports=mh;function mh(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}a(mh,"DelayedStream");kAn.inherits(mh,uwt);mh.create=function(e,t){var r=new this;t=t||{};for(var n in t){r[n]=t[n]}r.source=e;var i=e.emit;e.emit=function(){r._handleEmit(arguments);return i.apply(e,arguments)};e.on("error",function(){});if(r.pauseStream){e.pause()}return r};Object.defineProperty(mh.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});mh.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};mh.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};mh.prototype.pause=function(){this.source.pause()};mh.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this));this._bufferedEvents=[]};mh.prototype.pipe=function(){var e=uwt.prototype.pipe.apply(this,arguments);this.resume();return e};mh.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}if(e[0]==="data"){this.dataSize+=e[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(e)};mh.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}});var mwt=y((bDs,fwt)=>{var DAn=require("util");var pwt=require("stream").Stream;var dwt=cwt();fwt.exports=ao;function ao(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}a(ao,"CombinedStream");DAn.inherits(ao,pwt);ao.create=function(e){var t=new this;e=e||{};for(var r in e){t[r]=e[r]}return t};ao.isStreamLike=function(e){return typeof e!=="function"&&typeof e!=="string"&&typeof e!=="boolean"&&typeof e!=="number"&&!Buffer.isBuffer(e)};ao.prototype.append=function(e){var t=ao.isStreamLike(e);if(t){if(!(e instanceof dwt)){var r=dwt.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this));e=r}this._handleErrors(e);if(this.pauseStreams){e.pause()}}this._streams.push(e);return this};ao.prototype.pipe=function(e,t){pwt.prototype.pipe.call(this,e,t);this.resume();return e};ao.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};ao.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e=="undefined"){this.end();return}if(typeof e!=="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=ao.isStreamLike(r);if(n){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};ao.prototype._pipeNext=function(e){this._currentStream=e;var t=ao.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this));e.pipe(this,{end:false});return}var r=e;this.write(r);this._getNext()};ao.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ao.prototype.write=function(e){this.emit("data",e)};ao.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};ao.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};ao.prototype.end=function(){this._reset();this.emit("end")};ao.prototype.destroy=function(){this._reset();this.emit("close")};ao.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};ao.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))};ao.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){if(!t.dataSize){return}e.dataSize+=t.dataSize});if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};ao.prototype._emitError=function(e){this._reset();this.emit("error",e)}});var gwt=y((ADs,hwt)=>{hwt.exports=LAn;function LAn(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t){t(e)}else{setTimeout(e,0)}}a(LAn,"defer")});var Axe=y((wDs,_wt)=>{var ywt=gwt();_wt.exports=FAn;function FAn(e){var t=false;ywt(function(){t=true});return a(function r(n,i){if(t){e(n,i)}else{ywt(a(function s(){e(n,i)},"nextTick_callback"))}},"async_callback")}a(FAn,"async")});var Cxe=y((xDs,vwt)=>{vwt.exports=BAn;function BAn(e){Object.keys(e.jobs).forEach(MAn.bind(e));e.jobs={}}a(BAn,"abort");function MAn(e){if(typeof this.jobs[e]=="function"){this.jobs[e]()}}a(MAn,"clean")});var wxe=y((ODs,bwt)=>{var Ewt=Axe();var qAn=Cxe();bwt.exports=UAn;function UAn(e,t,r,n){var i=r["keyedList"]?r["keyedList"][r.index]:r.index;r.jobs[i]=$An(t,i,e[i],function(s,o){if(!(i in r.jobs)){return}delete r.jobs[i];if(s){qAn(r)}else{r.results[i]=o}n(s,r.results)})}a(UAn,"iterate");function $An(e,t,r,n){var i;if(e.length==2){i=e(r,Ewt(n))}else{i=e(r,t,Ewt(n))}return i}a($An,"runJob")});var Txe=y((NDs,Swt)=>{Swt.exports=jAn;function jAn(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};if(t){n.keyedList.sort(r?t:function(i,s){return t(e[i],e[s])})}return n}a(jAn,"state")});var xxe=y((kDs,Awt)=>{var GAn=Cxe();var HAn=Axe();Awt.exports=VAn;function VAn(e){if(!Object.keys(this.jobs).length){return}this.index=this.size;GAn(this);HAn(e)(null,this.results)}a(VAn,"terminator")});var wwt=y((LDs,Cwt)=>{var zAn=wxe();var KAn=Txe();var WAn=xxe();Cwt.exports=YAn;function YAn(e,t,r){var n=KAn(e);while(n.index<(n["keyedList"]||e).length){zAn(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}});n.index++}return WAn.bind(n,r)}a(YAn,"parallel")});var Rxe=y((BDs,mJ)=>{var Twt=wxe();var XAn=Txe();var JAn=xxe();mJ.exports=QAn;mJ.exports.ascending=xwt;mJ.exports.descending=ZAn;function QAn(e,t,r,n){var i=XAn(e,r);Twt(e,t,i,a(function s(o,u){if(o){n(o,u);return}i.index++;if(i.index<(i["keyedList"]||e).length){Twt(e,t,i,s);return}n(null,i.results)},"iteratorHandler"));return JAn.bind(i,n)}a(QAn,"serialOrdered");function xwt(e,t){return e<t?-1:e>t?1:0}a(xwt,"ascending");function ZAn(e,t){return-1*xwt(e,t)}a(ZAn,"descending")});var Owt=y((qDs,Rwt)=>{var eCn=Rxe();Rwt.exports=tCn;function tCn(e,t,r){return eCn(e,t,null,r)}a(tCn,"serial")});var Nwt=y(($Ds,Pwt)=>{Pwt.exports={parallel:wwt(),serial:Owt(),serialOrdered:Rxe()}});var kwt=y((jDs,Iwt)=>{Iwt.exports=function(e,t){Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]});return e}});var Fwt=y((GDs,Lwt)=>{var Ixe=mwt();var Dwt=require("util");var Oxe=require("path");var rCn=require("http");var nCn=require("https");var iCn=require("url").parse;var sCn=require("fs");var aCn=require("stream").Stream;var Pxe=dSe();var oCn=Nwt();var Nxe=kwt();Lwt.exports=es;Dwt.inherits(es,Ixe);function es(e){if(!(this instanceof es)){return new es(e)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];Ixe.call(this);e=e||{};for(var t in e){this[t]=e[t]}}a(es,"FormData");es.LINE_BREAK="\r\n";es.DEFAULT_CONTENT_TYPE="application/octet-stream";es.prototype.append=function(e,t,r){r=r||{};if(typeof r=="string"){r={filename:r}}var n=Ixe.prototype.append.bind(this);if(typeof t=="number"){t=""+t}if(Dwt.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r);var s=this._multiPartFooter();n(i);n(t);n(s);this._trackLength(i,t,r)};es.prototype._trackLength=function(e,t,r){var n=0;if(r.knownLength!=null){n+=+r.knownLength}else if(Buffer.isBuffer(t)){n=t.length}else if(typeof t==="string"){n=Buffer.byteLength(t)}this._valueLength+=n;this._overheadLength+=Buffer.byteLength(e)+es.LINE_BREAK.length;if(!t||!t.path&&!(t.readable&&t.hasOwnProperty("httpVersion"))&&!(t instanceof aCn)){return}if(!r.knownLength){this._valuesToMeasure.push(t)}};es.prototype._lengthRetriever=function(e,t){if(e.hasOwnProperty("fd")){if(e.end!=void 0&&e.end!=Infinity&&e.start!=void 0){t(null,e.end+1-(e.start?e.start:0))}else{sCn.stat(e.path,function(r,n){var i;if(r){t(r);return}i=n.size-(e.start?e.start:0);t(null,i)})}}else if(e.hasOwnProperty("httpVersion")){t(null,+e.headers["content-length"])}else if(e.hasOwnProperty("httpModule")){e.on("response",function(r){e.pause();t(null,+r.headers["content-length"])});e.resume()}else{t("Unknown stream")}};es.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string"){return r.header}var n=this._getContentDisposition(t,r);var i=this._getContentType(t,r);var s="";var o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};if(typeof r.header=="object"){Nxe(o,r.header)}var u;for(var l in o){if(!o.hasOwnProperty(l))continue;u=o[l];if(u==null){continue}if(!Array.isArray(u)){u=[u]}if(u.length){s+=l+": "+u.join("; ")+es.LINE_BREAK}}return"--"+this.getBoundary()+es.LINE_BREAK+s+es.LINE_BREAK};es.prototype._getContentDisposition=function(e,t){var r,n;if(typeof t.filepath==="string"){r=Oxe.normalize(t.filepath).replace(/\\/g,"/")}else if(t.filename||e.name||e.path){r=Oxe.basename(t.filename||e.name||e.path)}else if(e.readable&&e.hasOwnProperty("httpVersion")){r=Oxe.basename(e.client._httpMessage.path||"")}if(r){n='filename="'+r+'"'}return n};es.prototype._getContentType=function(e,t){var r=t.contentType;if(!r&&e.name){r=Pxe.lookup(e.name)}if(!r&&e.path){r=Pxe.lookup(e.path)}if(!r&&e.readable&&e.hasOwnProperty("httpVersion")){r=e.headers["content-type"]}if(!r&&(t.filepath||t.filename)){r=Pxe.lookup(t.filepath||t.filename)}if(!r&&typeof e=="object"){r=es.DEFAULT_CONTENT_TYPE}return r};es.prototype._multiPartFooter=function(){return function(e){var t=es.LINE_BREAK;var r=this._streams.length===0;if(r){t+=this._lastBoundary()}e(t)}.bind(this)};es.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+es.LINE_BREAK};es.prototype.getHeaders=function(e){var t;var r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e){if(e.hasOwnProperty(t)){r[t.toLowerCase()]=e[t]}}return r};es.prototype.setBoundary=function(e){this._boundary=e};es.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};es.prototype.getBuffer=function(){var e=new Buffer.alloc(0);var t=this.getBoundary();for(var r=0,n=this._streams.length;r<n;r++){if(typeof this._streams[r]!=="function"){if(Buffer.isBuffer(this._streams[r])){e=Buffer.concat([e,this._streams[r]])}else{e=Buffer.concat([e,Buffer.from(this._streams[r])])}if(typeof this._streams[r]!=="string"||this._streams[r].substring(2,t.length+2)!==t){e=Buffer.concat([e,Buffer.from(es.LINE_BREAK)])}}}return Buffer.concat([e,Buffer.from(this._lastBoundary())])};es.prototype._generateBoundary=function(){var e="--------------------------";for(var t=0;t<24;t++){e+=Math.floor(Math.random()*10).toString(16)}this._boundary=e};es.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;if(this._streams.length){e+=this._lastBoundary().length}if(!this.hasKnownLength()){this._error(new Error("Cannot calculate proper length in synchronous way."))}return e};es.prototype.hasKnownLength=function(){var e=true;if(this._valuesToMeasure.length){e=false}return e};es.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length){t+=this._lastBoundary().length}if(!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}oCn.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i});e(null,t)})};es.prototype.submit=function(e,t){var r,n,i={method:"post"};if(typeof e=="string"){e=iCn(e);n=Nxe({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)}else{n=Nxe(e,i);if(!n.port){n.port=n.protocol=="https:"?443:80}}n.headers=this.getHeaders(e.headers);if(n.protocol=="https:"){r=nCn.request(n)}else{r=rCn.request(n)}this.getLength(function(s,o){if(s&&s!=="Unknown stream"){this._error(s);return}if(o){r.setHeader("Content-Length",o)}this.pipe(r);if(t){var u;var l=a(function(c,d){r.removeListener("error",l);r.removeListener("response",u);return t.call(this,c,d)},"callback");u=l.bind(this,null);r.on("error",l);r.on("response",u)}}.bind(this));return r};es.prototype._error=function(e){if(!this.error){this.error=e;this.pause();this.emit("error",e)}};es.prototype.toString=function(){return"[object FormData]"}});var Mwt=y(Bwt=>{"use strict";var uCn=require("url").parse;var lCn={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var cCn=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function dCn(e){var t=typeof e==="string"?uCn(e):e||{};var r=t.protocol;var n=t.host;var i=t.port;if(typeof n!=="string"||!n||typeof r!=="string"){return""}r=r.split(":",1)[0];n=n.replace(/:\d*$/,"");i=parseInt(i)||lCn[r]||0;if(!pCn(n,i)){return""}var s=iP("npm_config_"+r+"_proxy")||iP(r+"_proxy")||iP("npm_config_proxy")||iP("all_proxy");if(s&&s.indexOf("://")===-1){s=r+"://"+s}return s}a(dCn,"getProxyForUrl");function pCn(e,t){var r=(iP("npm_config_no_proxy")||iP("no_proxy")).toLowerCase();if(!r){return true}if(r==="*"){return false}return r.split(/[,\s]/).every(function(n){if(!n){return true}var i=n.match(/^(.+):(\d+)$/);var s=i?i[1]:n;var o=i?parseInt(i[2]):0;if(o&&o!==t){return true}if(!/^[.*]/.test(s)){return e!==s}if(s.charAt(0)==="*"){s=s.slice(1)}return!cCn.call(e,s)})}a(pCn,"shouldProxy");function iP(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}a(iP,"getEnv");Bwt.getProxyForUrl=dCn});var Uwt=y((KDs,qwt)=>{var wF;qwt.exports=function(){if(!wF){try{wF=tp()("follow-redirects")}catch(e){}if(typeof wF!=="function"){wF=a(function(){},"debug")}}wF.apply(null,arguments)}});var Vwt=y((YDs,Hxe)=>{var RF=require("url");var TF=RF.URL;var fCn=require("http");var mCn=require("https");var Bxe=require("stream").Writable;var Mxe=require("assert");var $wt=Uwt();var qxe=false;try{Mxe(new TF)}catch(e){qxe=e.code==="ERR_INVALID_URL"}var hCn=["auth","host","hostname","href","path","pathname","port","protocol","query","search"];var Uxe=["abort","aborted","connect","error","socket","timeout"];var $xe=Object.create(null);Uxe.forEach(function(e){$xe[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var Dxe=OF("ERR_INVALID_URL","Invalid URL",TypeError);var Lxe=OF("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var gCn=OF("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Lxe);var yCn=OF("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var _Cn=OF("ERR_STREAM_WRITE_AFTER_END","write after end");var vCn=Bxe.prototype.destroy||Gwt;function yd(e,t){Bxe.call(this);this._sanitizeOptions(e);this._options=e;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(t){this.on("response",t)}var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof Lxe?i:new Lxe({cause:i}))}};this._performRequest()}a(yd,"RedirectableRequest");yd.prototype=Object.create(Bxe.prototype);yd.prototype.abort=function(){Gxe(this._currentRequest);this._currentRequest.abort();this.emit("abort")};yd.prototype.destroy=function(e){Gxe(this._currentRequest,e);vCn.call(this,e);return this};yd.prototype.write=function(e,t,r){if(this._ending){throw new _Cn}if(!eC(e)&&!SCn(e)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(xF(t)){r=t;t=null}if(e.length===0){if(r){r()}return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength){this._requestBodyLength+=e.length;this._requestBodyBuffers.push({data:e,encoding:t});this._currentRequest.write(e,t,r)}else{this.emit("error",new yCn);this.abort()}};yd.prototype.end=function(e,t,r){if(xF(e)){r=e;e=t=null}else if(xF(t)){r=t;t=null}if(!e){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var i=this._currentRequest;this.write(e,t,function(){n._ended=true;i.end(null,null,r)});this._ending=true}};yd.prototype.setHeader=function(e,t){this._options.headers[e]=t;this._currentRequest.setHeader(e,t)};yd.prototype.removeHeader=function(e){delete this._options.headers[e];this._currentRequest.removeHeader(e)};yd.prototype.setTimeout=function(e,t){var r=this;function n(o){o.setTimeout(e);o.removeListener("timeout",o.destroy);o.addListener("timeout",o.destroy)}a(n,"destroyOnTimeout");function i(o){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout(function(){r.emit("timeout");s()},e);n(o)}a(i,"startTimer");function s(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",s);r.removeListener("error",s);r.removeListener("response",s);r.removeListener("close",s);if(t){r.removeListener("timeout",t)}if(!r.socket){r._currentRequest.removeListener("socket",i)}}a(s,"clearTimer");if(t){this.on("timeout",t)}if(this.socket){i(this.socket)}else{this._currentRequest.once("socket",i)}this.on("socket",n);this.on("abort",s);this.on("error",s);this.on("response",s);this.on("close",s);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){yd.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(yd.prototype,e,{get:function(){return this._currentRequest[e]}})});yd.prototype._sanitizeOptions=function(e){if(!e.headers){e.headers={}}if(e.host){if(!e.hostname){e.hostname=e.host}delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0){e.pathname=e.path}else{e.pathname=e.path.substring(0,t);e.search=e.path.substring(t)}}};yd.prototype._performRequest=function(){var e=this._options.protocol;var t=this._options.nativeProtocols[e];if(!t){throw new TypeError("Unsupported protocol "+e)}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of Uxe){n.on(i,$xe[i])}this._currentUrl=/^\//.test(this._options.path)?RF.format(this._options):this._options.path;if(this._isRedirect){var s=0;var o=this;var u=this._requestBodyBuffers;a(function l(c){if(n===o._currentRequest){if(c){o.emit("error",c)}else if(s<u.length){var d=u[s++];if(!n.finished){n.write(d.data,d.encoding,l)}}else if(o._ended){n.end()}}},"writeNext")()}};yd.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t})}var r=e.headers.location;if(!r||this._options.followRedirects===false||t<300||t>=400){e.responseUrl=this._currentUrl;e.redirects=this._redirects;this.emit("response",e);this._requestBodyBuffers=[];return}Gxe(this._currentRequest);e.destroy();if(++this._redirectCount>this._options.maxRedirects){throw new gCn}var n;var i=this._options.beforeRedirect;if(i){n=Object.assign({Host:e.req.getHeader("host")},this._options.headers)}var s=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];kxe(/^content-/i,this._options.headers)}var o=kxe(/^host$/i,this._options.headers);var u=jxe(this._currentUrl);var l=o||u.host;var c=/^\w+:/.test(r)?this._currentUrl:RF.format(Object.assign(u,{host:l}));var d=ECn(r,c);$wt("redirecting to",d.href);this._isRedirect=true;Fxe(d,this._options);if(d.protocol!==u.protocol&&d.protocol!=="https:"||d.host!==l&&!bCn(d.host,l)){kxe(/^(?:authorization|cookie)$/i,this._options.headers)}if(xF(i)){var p={headers:e.headers,statusCode:t};var f={url:c,method:s,headers:n};i(this._options,p,f);this._sanitizeOptions(this._options)}this._performRequest()};function jwt(e){var t={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(e).forEach(function(n){var i=n+":";var s=r[i]=e[n];var o=t[n]=Object.create(s);function u(c,d,p){if(ACn(c)){c=Fxe(c)}else if(eC(c)){c=Fxe(jxe(c))}else{p=d;d=Hwt(c);c={protocol:i}}if(xF(d)){p=d;d=null}d=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,d);d.nativeProtocols=r;if(!eC(d.host)&&!eC(d.hostname)){d.hostname="::1"}Mxe.equal(d.protocol,i,"protocol mismatch");$wt("options",d);return new yd(d,p)}a(u,"request");function l(c,d,p){var f=o.request(c,d,p);f.end();return f}a(l,"get");Object.defineProperties(o,{request:{value:u,configurable:true,enumerable:true,writable:true},get:{value:l,configurable:true,enumerable:true,writable:true}})});return t}a(jwt,"wrap");function Gwt(){}a(Gwt,"noop");function jxe(e){var t;if(qxe){t=new TF(e)}else{t=Hwt(RF.parse(e));if(!eC(t.protocol)){throw new Dxe({input:e})}}return t}a(jxe,"parseUrl");function ECn(e,t){return qxe?new TF(e,t):jxe(RF.resolve(t,e))}a(ECn,"resolveUrl");function Hwt(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname)){throw new Dxe({input:e.href||e})}if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host)){throw new Dxe({input:e.href||e})}return e}a(Hwt,"validateUrl");function Fxe(e,t){var r=t||{};for(var n of hCn){r[n]=e[n]}if(r.hostname.startsWith("[")){r.hostname=r.hostname.slice(1,-1)}if(r.port!==""){r.port=Number(r.port)}r.path=r.search?r.pathname+r.search:r.pathname;return r}a(Fxe,"spreadUrlObject");function kxe(e,t){var r;for(var n in t){if(e.test(n)){r=t[n];delete t[n]}}return r===null||typeof r==="undefined"?void 0:String(r).trim()}a(kxe,"removeMatchingHeaders");function OF(e,t,r){function n(i){Error.captureStackTrace(this,this.constructor);Object.assign(this,i||{});this.code=e;this.message=this.cause?t+": "+this.cause.message:t}a(n,"CustomError");n.prototype=new(r||Error);Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:false},name:{value:"Error ["+e+"]",enumerable:false}});return n}a(OF,"createErrorType");function Gxe(e,t){for(var r of Uxe){e.removeListener(r,$xe[r])}e.on("error",Gwt);e.destroy(t)}a(Gxe,"destroyRequest");function bCn(e,t){Mxe(eC(e)&&eC(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}a(bCn,"isSubdomain");function eC(e){return typeof e==="string"||e instanceof String}a(eC,"isString");function xF(e){return typeof e==="function"}a(xF,"isFunction");function SCn(e){return typeof e==="object"&&"length"in e}a(SCn,"isBuffer");function ACn(e){return TF&&e instanceof TF}a(ACn,"isURL");Hxe.exports=jwt({http:fCn,https:mCn});Hxe.exports.wrap=jwt});var CJ=y((JDs,DTt)=>{"use strict";var CCn=Fwt();var wCn=require("url");var TCn=Mwt();var xCn=require("http");var RCn=require("https");var lTt=require("util");var OCn=Vwt();var PCn=require("zlib");var cTt=require("stream");var NCn=require("events");function Ty(e){return e&&typeof e==="object"&&"default"in e?e:{"default":e}}a(Ty,"_interopDefaultLegacy");var dTt=Ty(CCn);var ICn=Ty(wCn);var kCn=Ty(xCn);var DCn=Ty(RCn);var LCn=Ty(lTt);var FCn=Ty(OCn);var GE=Ty(PCn);var $E=Ty(cTt);var BCn=Ty(NCn);function pTt(e,t){return a(function r(){return e.apply(t,arguments)},"wrap")}a(pTt,"bind");var{toString:MCn}=Object.prototype;var{getPrototypeOf:sRe}=Object;var EJ=(e=>t=>{const r=MCn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));var ng=a(e=>{e=e.toLowerCase();return t=>EJ(t)===e},"kindOfTest");var bJ=a(e=>t=>typeof t===e,"typeOfTest");var{isArray:uP}=Array;var IF=bJ("undefined");function qCn(e){return e!==null&&!IF(e)&&e.constructor!==null&&!IF(e.constructor)&&Ff(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}a(qCn,"isBuffer");var fTt=ng("ArrayBuffer");function UCn(e){let t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&fTt(e.buffer)}return t}a(UCn,"isArrayBufferView");var $Cn=bJ("string");var Ff=bJ("function");var mTt=bJ("number");var SJ=a(e=>e!==null&&typeof e==="object","isObject");var jCn=a(e=>e===true||e===false,"isBoolean");var gJ=a(e=>{if(EJ(e)!=="object"){return false}const t=sRe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},"isPlainObject");var GCn=ng("Date");var HCn=ng("File");var VCn=ng("Blob");var zCn=ng("FileList");var KCn=a(e=>SJ(e)&&Ff(e.pipe),"isStream");var WCn=a(e=>{let t;return e&&(typeof FormData==="function"&&e instanceof FormData||Ff(e.append)&&((t=EJ(e))==="formdata"||t==="object"&&Ff(e.toString)&&e.toString()==="[object FormData]"))},"isFormData");var YCn=ng("URLSearchParams");var XCn=a(e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function DF(e,t,{allOwnKeys:r=false}={}){if(e===null||typeof e==="undefined"){return}let n;let i;if(typeof e!=="object"){e=[e]}if(uP(e)){for(n=0,i=e.length;n<i;n++){t.call(null,e[n],n,e)}}else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e);const o=s.length;let u;for(n=0;n<o;n++){u=s[n];t.call(null,e[u],u,e)}}}a(DF,"forEach");function hTt(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length;let i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}a(hTt,"findKey");var gTt=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();var yTt=a(e=>!IF(e)&&e!==gTt,"isContextDefined");function Yxe(){const{caseless:e}=yTt(this)&&this||{};const t={};const r=a((n,i)=>{const s=e&&hTt(t,i)||i;if(gJ(t[s])&&gJ(n)){t[s]=Yxe(t[s],n)}else if(gJ(n)){t[s]=Yxe({},n)}else if(uP(n)){t[s]=n.slice()}else{t[s]=n}},"assignValue");for(let n=0,i=arguments.length;n<i;n++){arguments[n]&&DF(arguments[n],r)}return t}a(Yxe,"merge");var JCn=a((e,t,r,{allOwnKeys:n}={})=>{DF(t,(i,s)=>{if(r&&Ff(i)){e[s]=pTt(i,r)}else{e[s]=i}},{allOwnKeys:n});return e},"extend");var QCn=a(e=>{if(e.charCodeAt(0)===65279){e=e.slice(1)}return e},"stripBOM");var ZCn=a((e,t,r,n)=>{e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)},"inherits");var ewn=a((e,t,r,n)=>{let i;let s;let o;const u={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);s=i.length;while(s-- >0){o=i[s];if((!n||n(o,e,t))&&!u[o]){t[o]=e[o];u[o]=true}}e=r!==false&&sRe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},"toFlatObject");var twn=a((e,t,r)=>{e=String(e);if(r===void 0||r>e.length){r=e.length}r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},"endsWith");var rwn=a(e=>{if(!e)return null;if(uP(e))return e;let t=e.length;if(!mTt(t))return null;const r=new Array(t);while(t-- >0){r[t]=e[t]}return r},"toArray");var nwn=(e=>{return t=>{return e&&t instanceof e}})(typeof Uint8Array!=="undefined"&&sRe(Uint8Array));var iwn=a((e,t)=>{const r=e&&e[Symbol.iterator];const n=r.call(e);let i;while((i=n.next())&&!i.done){const s=i.value;t.call(e,s[0],s[1])}},"forEachEntry");var swn=a((e,t)=>{let r;const n=[];while((r=e.exec(t))!==null){n.push(r)}return n},"matchAll");var awn=ng("HTMLFormElement");var own=a(e=>{return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function t(r,n,i){return n.toUpperCase()+i},"replacer"))},"toCamelCase");var zwt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype);var uwn=ng("RegExp");var _Tt=a((e,t)=>{const r=Object.getOwnPropertyDescriptors(e);const n={};DF(r,(i,s)=>{let o;if((o=t(i,s,e))!==false){n[s]=o||i}});Object.defineProperties(e,n)},"reduceDescriptors");var lwn=a(e=>{_Tt(e,(t,r)=>{if(Ff(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}const n=e[r];if(!Ff(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}}})},"freezeMethods");var cwn=a((e,t)=>{const r={};const n=a(i=>{i.forEach(s=>{r[s]=true})},"define");uP(e)?n(e):n(String(e).split(t));return r},"toObjectSet");var dwn=a(()=>{},"noop");var pwn=a((e,t)=>{e=+e;return Number.isFinite(e)?e:t},"toFiniteNumber");var Vxe="abcdefghijklmnopqrstuvwxyz";var Kwt="0123456789";var vTt={DIGIT:Kwt,ALPHA:Vxe,ALPHA_DIGIT:Vxe+Vxe.toUpperCase()+Kwt};var fwn=a((e=16,t=vTt.ALPHA_DIGIT)=>{let r="";const{length:n}=t;while(e--){r+=t[Math.random()*n|0]}return r},"generateString");function mwn(e){return!!(e&&Ff(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}a(mwn,"isSpecCompliantForm");var hwn=a(e=>{const t=new Array(10);const r=a((n,i)=>{if(SJ(n)){if(t.indexOf(n)>=0){return}if(!("toJSON"in n)){t[i]=n;const s=uP(n)?[]:{};DF(n,(o,u)=>{const l=r(o,i+1);!IF(l)&&(s[u]=l)});t[i]=void 0;return s}}return n},"visit");return r(e,0)},"toJSONObject");var gwn=ng("AsyncFunction");var ywn=a(e=>e&&(SJ(e)||Ff(e))&&Ff(e.then)&&Ff(e.catch),"isThenable");var Je={isArray:uP,isArrayBuffer:fTt,isBuffer:qCn,isFormData:WCn,isArrayBufferView:UCn,isString:$Cn,isNumber:mTt,isBoolean:jCn,isObject:SJ,isPlainObject:gJ,isUndefined:IF,isDate:GCn,isFile:HCn,isBlob:VCn,isRegExp:uwn,isFunction:Ff,isStream:KCn,isURLSearchParams:YCn,isTypedArray:nwn,isFileList:zCn,forEach:DF,merge:Yxe,extend:JCn,trim:XCn,stripBOM:QCn,inherits:ZCn,toFlatObject:ewn,kindOf:EJ,kindOfTest:ng,endsWith:twn,toArray:rwn,forEachEntry:iwn,matchAll:swn,isHTMLForm:awn,hasOwnProperty:zwt,hasOwnProp:zwt,reduceDescriptors:_Tt,freezeMethods:lwn,toObjectSet:cwn,toCamelCase:own,noop:dwn,toFiniteNumber:pwn,findKey:hTt,global:gTt,isContextDefined:yTt,ALPHABET:vTt,generateString:fwn,isSpecCompliantForm:mwn,toJSONObject:hwn,isAsyncFn:gwn,isThenable:ywn};function yr(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error().stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}a(yr,"AxiosError");Je.inherits(yr,Error,{toJSON:a(function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Je.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}},"toJSON")});var ETt=yr.prototype;var bTt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{bTt[e]={value:e}});Object.defineProperties(yr,bTt);Object.defineProperty(ETt,"isAxiosError",{value:true});yr.from=(e,t,r,n,i,s)=>{const o=Object.create(ETt);Je.toFlatObject(e,o,a(function u(l){return l!==Error.prototype},"filter"),u=>{return u!=="isAxiosError"});yr.call(o,e.message,t,r,n,i);o.cause=e;o.name=e.name;s&&Object.assign(o,s);return o};function Xxe(e){return Je.isPlainObject(e)||Je.isArray(e)}a(Xxe,"isVisitable");function STt(e){return Je.endsWith(e,"[]")?e.slice(0,-2):e}a(STt,"removeBrackets");function Wwt(e,t,r){if(!e)return t;return e.concat(t).map(a(function n(i,s){i=STt(i);return!r&&s?"["+i+"]":i},"each")).join(r?".":"")}a(Wwt,"renderKey");function _wn(e){return Je.isArray(e)&&!e.some(Xxe)}a(_wn,"isFlatArray");var vwn=Je.toFlatObject(Je,{},null,a(function e(t){return/^is[A-Z]/.test(t)},"filter"));function AJ(e,t,r){if(!Je.isObject(e)){throw new TypeError("target must be an object")}t=t||new(dTt["default"]||FormData);r=Je.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,a(function h(g,_){return!Je.isUndefined(_[g])},"defined"));const n=r.metaTokens;const i=r.visitor||d;const s=r.dots;const o=r.indexes;const u=r.Blob||typeof Blob!=="undefined"&&Blob;const l=u&&Je.isSpecCompliantForm(t);if(!Je.isFunction(i)){throw new TypeError("visitor must be a function")}function c(h){if(h===null)return"";if(Je.isDate(h)){return h.toISOString()}if(!l&&Je.isBlob(h)){throw new yr("Blob is not supported. Use a Buffer instead.")}if(Je.isArrayBuffer(h)||Je.isTypedArray(h)){return l&&typeof Blob==="function"?new Blob([h]):Buffer.from(h)}return h}a(c,"convertValue");function d(h,g,_){let v=h;if(h&&!_&&typeof h==="object"){if(Je.endsWith(g,"{}")){g=n?g:g.slice(0,-2);h=JSON.stringify(h)}else if(Je.isArray(h)&&_wn(h)||(Je.isFileList(h)||Je.endsWith(g,"[]"))&&(v=Je.toArray(h))){g=STt(g);v.forEach(a(function S(E,b){!(Je.isUndefined(E)||E===null)&&t.append(o===true?Wwt([g],b,s):o===null?g:g+"[]",c(E))},"each"));return false}}if(Xxe(h)){return true}t.append(Wwt(_,g,s),c(h));return false}a(d,"defaultVisitor");const p=[];const f=Object.assign(vwn,{defaultVisitor:d,convertValue:c,isVisitable:Xxe});function m(h,g){if(Je.isUndefined(h))return;if(p.indexOf(h)!==-1){throw Error("Circular reference detected in "+g.join("."))}p.push(h);Je.forEach(h,a(function _(v,S){const E=!(Je.isUndefined(v)||v===null)&&i.call(t,v,Je.isString(S)?S.trim():S,g,f);if(E===true){m(v,g?g.concat(S):[S])}},"each"));p.pop()}a(m,"build");if(!Je.isObject(e)){throw new TypeError("data must be an object")}m(e);return t}a(AJ,"toFormData");function Ywt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,a(function r(n){return t[n]},"replacer"))}a(Ywt,"encode$1");function ATt(e,t){this._pairs=[];e&&AJ(e,this,t)}a(ATt,"AxiosURLSearchParams");var CTt=ATt.prototype;CTt.append=a(function e(t,r){this._pairs.push([t,r])},"append");CTt.toString=a(function e(t){const r=t?function(n){return t.call(this,n,Ywt)}:Ywt;return this._pairs.map(a(function n(i){return r(i[0])+"="+r(i[1])},"each"),"").join("&")},"toString");function Ewn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}a(Ewn,"encode");function aRe(e,t,r){if(!t){return e}const n=r&&r.encode||Ewn;const i=r&&r.serialize;let s;if(i){s=i(t,r)}else{s=Je.isURLSearchParams(t)?t.toString():new ATt(t,r).toString(n)}if(s){const o=e.indexOf("#");if(o!==-1){e=e.slice(0,o)}e+=(e.indexOf("?")===-1?"?":"&")+s}return e}a(aRe,"buildURL");var Jxe=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){Je.forEach(this.handlers,a(function r(n){if(n!==null){t(n)}},"forEachHandler"))}};var Xwt=Jxe;var oRe={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var bwn=ICn["default"].URLSearchParams;var Swn={isNode:true,classes:{URLSearchParams:bwn,FormData:dTt["default"],Blob:typeof Blob!=="undefined"&&Blob||null},protocols:["http","https","file","data"]};var wTt=typeof window!=="undefined"&&typeof document!=="undefined";var Awn=(e=>{return wTt&&["ReactNative","NativeScript","NS"].indexOf(e)<0})(typeof navigator!=="undefined"&&navigator.product);var Cwn=(()=>{return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})();var wwn=Object.freeze({__proto__:null,hasBrowserEnv:wTt,hasStandardBrowserWebWorkerEnv:Cwn,hasStandardBrowserEnv:Awn});var Lf={...wwn,...Swn};function Twn(e,t){return AJ(e,new Lf.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){if(Lf.isNode&&Je.isBuffer(r)){this.append(n,r.toString("base64"));return false}return s.defaultVisitor.apply(this,arguments)}},t))}a(Twn,"toURLEncodedForm");function xwn(e){return Je.matchAll(/\w+|\[(\w*)]/g,e).map(t=>{return t[0]==="[]"?"":t[1]||t[0]})}a(xwn,"parsePropPath");function Rwn(e){const t={};const r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++){s=r[n];t[s]=e[s]}return t}a(Rwn,"arrayToObject");function TTt(e){function t(r,n,i,s){let o=r[s++];const u=Number.isFinite(+o);const l=s>=r.length;o=!o&&Je.isArray(i)?i.length:o;if(l){if(Je.hasOwnProp(i,o)){i[o]=[i[o],n]}else{i[o]=n}return!u}if(!i[o]||!Je.isObject(i[o])){i[o]=[]}const c=t(r,n,i[o],s);if(c&&Je.isArray(i[o])){i[o]=Rwn(i[o])}return!u}a(t,"buildPath");if(Je.isFormData(e)&&Je.isFunction(e.entries)){const r={};Je.forEachEntry(e,(n,i)=>{t(xwn(n),i,r,0)});return r}return null}a(TTt,"formDataToJSON");function Own(e,t,r){if(Je.isString(e)){try{(t||JSON.parse)(e);return Je.trim(e)}catch(n){if(n.name!=="SyntaxError"){throw n}}}return(r||JSON.stringify)(e)}a(Own,"stringifySafely");var uRe={transitional:oRe,adapter:["xhr","http"],transformRequest:[a(function e(t,r){const n=r.getContentType()||"";const i=n.indexOf("application/json")>-1;const s=Je.isObject(t);if(s&&Je.isHTMLForm(t)){t=new FormData(t)}const o=Je.isFormData(t);if(o){if(!i){return t}return i?JSON.stringify(TTt(t)):t}if(Je.isArrayBuffer(t)||Je.isBuffer(t)||Je.isStream(t)||Je.isFile(t)||Je.isBlob(t)){return t}if(Je.isArrayBufferView(t)){return t.buffer}if(Je.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1){return Twn(t,this.formSerializer).toString()}if((u=Je.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return AJ(u?{"files[]":t}:t,l&&new l,this.formSerializer)}}if(s||i){r.setContentType("application/json",false);return Own(t)}return t},"transformRequest")],transformResponse:[a(function e(t){const r=this.transitional||uRe.transitional;const n=r&&r.forcedJSONParsing;const i=this.responseType==="json";if(t&&Je.isString(t)&&(n&&!this.responseType||i)){const s=r&&r.silentJSONParsing;const o=!s&&i;try{return JSON.parse(t)}catch(u){if(o){if(u.name==="SyntaxError"){throw yr.from(u,yr.ERR_BAD_RESPONSE,this,null,this.response)}throw u}}}return t},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Lf.classes.FormData,Blob:Lf.classes.Blob},validateStatus:a(function e(t){return t>=200&&t<300},"validateStatus"),headers:{common:{"Accept":"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],e=>{uRe.headers[e]={}});var lRe=uRe;var Pwn=Je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Nwn=a(e=>{const t={};let r;let n;let i;e&&e.split("\n").forEach(a(function s(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&Pwn[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}},"parser"));return t},"parseHeaders");var Jwt=Symbol("internals");function PF(e){return e&&String(e).trim().toLowerCase()}a(PF,"normalizeHeader");function yJ(e){if(e===false||e==null){return e}return Je.isArray(e)?e.map(yJ):String(e)}a(yJ,"normalizeValue");function Iwn(e){const t=Object.create(null);const r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}a(Iwn,"parseTokens");var kwn=a(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),"isValidHeaderName");function zxe(e,t,r,n,i){if(Je.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!Je.isString(t))return;if(Je.isString(n)){return t.indexOf(n)!==-1}if(Je.isRegExp(n)){return n.test(t)}}a(zxe,"matchHeaderValue");function Dwn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>{return r.toUpperCase()+n})}a(Dwn,"formatHeader");function Lwn(e,t){const r=Je.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:true})})}a(Lwn,"buildAccessors");var sP=class{static{a(this,"AxiosHeaders")}constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(u,l,c){const d=PF(l);if(!d){throw new Error("header name must be a non-empty string")}const p=Je.findKey(i,d);if(!p||i[p]===void 0||c===true||c===void 0&&i[p]!==false){i[p||l]=yJ(u)}}a(s,"setHeader");const o=a((u,l)=>Je.forEach(u,(c,d)=>s(c,d,l)),"setHeaders");if(Je.isPlainObject(t)||t instanceof this.constructor){o(t,r)}else if(Je.isString(t)&&(t=t.trim())&&!kwn(t)){o(Nwn(t),r)}else{t!=null&&s(r,t,n)}return this}get(t,r){t=PF(t);if(t){const n=Je.findKey(this,t);if(n){const i=this[n];if(!r){return i}if(r===true){return Iwn(i)}if(Je.isFunction(r)){return r.call(this,i,n)}if(Je.isRegExp(r)){return r.exec(i)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){t=PF(t);if(t){const n=Je.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||zxe(this,this[n],n,r)))}return false}delete(t,r){const n=this;let i=false;function s(o){o=PF(o);if(o){const u=Je.findKey(n,o);if(u&&(!r||zxe(n,n[u],u,r))){delete n[u];i=true}}}a(s,"deleteHeader");if(Je.isArray(t)){t.forEach(s)}else{s(t)}return i}clear(t){const r=Object.keys(this);let n=r.length;let i=false;while(n--){const s=r[n];if(!t||zxe(this,this[s],s,t,true)){delete this[s];i=true}}return i}normalize(t){const r=this;const n={};Je.forEach(this,(i,s)=>{const o=Je.findKey(n,s);if(o){r[o]=yJ(i);delete r[s];return}const u=t?Dwn(s):String(s).trim();if(u!==s){delete r[s]}r[u]=yJ(i);n[u]=true});return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);Je.forEach(this,(n,i)=>{n!=null&&n!==false&&(r[i]=t&&Je.isArray(n)?n.join(", "):n)});return r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);r.forEach(i=>n.set(i));return n}static accessor(t){const r=this[Jwt]=this[Jwt]={accessors:{}};const n=r.accessors;const i=this.prototype;function s(o){const u=PF(o);if(!n[u]){Lwn(i,o);n[u]=true}}a(s,"defineAccessor");Je.isArray(t)?t.forEach(s):s(t);return this}};sP.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Je.reduceDescriptors(sP.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});Je.freezeMethods(sP);var Bf=sP;function Kxe(e,t){const r=this||lRe;const n=t||r;const i=Bf.from(n.headers);let s=n.data;Je.forEach(e,a(function o(u){s=u.call(r,s,i.normalize(),t?t.status:void 0)},"transform"));i.normalize();return s}a(Kxe,"transformData");function xTt(e){return!!(e&&e.__CANCEL__)}a(xTt,"isCancel");function tC(e,t,r){yr.call(this,e==null?"canceled":e,yr.ERR_CANCELED,t,r);this.name="CanceledError"}a(tC,"CanceledError");Je.inherits(tC,yr,{__CANCEL__:true});function NF(e,t,r){const n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new yr("Request failed with status code "+r.status,[yr.ERR_BAD_REQUEST,yr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}a(NF,"settle");function Fwn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}a(Fwn,"isAbsoluteURL");function Bwn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}a(Bwn,"combineURLs");function cRe(e,t){if(e&&!Fwn(t)){return Bwn(e,t)}return t}a(cRe,"buildFullPath");var vJ="1.6.2";function RTt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}a(RTt,"parseProtocol");var Mwn=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function qwn(e,t,r){const n=r&&r.Blob||Lf.classes.Blob;const i=RTt(e);if(t===void 0&&n){t=true}if(i==="data"){e=i.length?e.slice(i.length+1):e;const s=Mwn.exec(e);if(!s){throw new yr("Invalid URL",yr.ERR_INVALID_URL)}const o=s[1];const u=s[2];const l=s[3];const c=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(t){if(!n){throw new yr("Blob is not supported",yr.ERR_NOT_SUPPORT)}return new n([c],{type:o})}return c}throw new yr("Unsupported protocol "+i,yr.ERR_NOT_SUPPORT)}a(qwn,"fromDataURI");function Uwn(e,t){let r=0;const n=1e3/t;let i=null;return a(function s(o,u){const l=Date.now();if(o||l-r>n){if(i){clearTimeout(i);i=null}r=l;return e.apply(null,u)}if(!i){i=setTimeout(()=>{i=null;r=Date.now();return e.apply(null,u)},n-(l-r))}},"throttled")}a(Uwn,"throttle");function OTt(e,t){e=e||10;const r=new Array(e);const n=new Array(e);let i=0;let s=0;let o;t=t!==void 0?t:1e3;return a(function u(l){const c=Date.now();const d=n[s];if(!o){o=c}r[i]=l;n[i]=c;let p=s;let f=0;while(p!==i){f+=r[p++];p=p%e}i=(i+1)%e;if(i===s){s=(s+1)%e}if(c-o<t){return}const m=d&&c-d;return m?Math.round(f*1e3/m):void 0},"push")}a(OTt,"speedometer");var hJ=Symbol("internals");var Qxe=class extends $E["default"].Transform{static{a(this,"AxiosTransformStream")}constructor(t){t=Je.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(u,l)=>{return!Je.isUndefined(l[u])});super({readableHighWaterMark:t.chunkSize});const r=this;const n=this[hJ]={length:t.length,timeWindow:t.timeWindow,ticksRate:t.ticksRate,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:false,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};const i=OTt(n.ticksRate*t.samplesCount,n.timeWindow);this.on("newListener",u=>{if(u==="progress"){if(!n.isCaptured){n.isCaptured=true}}});let s=0;n.updateProgress=Uwn(a(function u(){const l=n.length;const c=n.bytesSeen;const d=c-s;if(!d||r.destroyed)return;const p=i(d);s=c;process.nextTick(()=>{r.emit("progress",{"loaded":c,"total":l,"progress":l?c/l:void 0,"bytes":d,"rate":p?p:void 0,"estimated":p&&l&&c<=l?(l-c)/p:void 0})})},"throttledHandler"),n.ticksRate);const o=a(()=>{n.updateProgress(true)},"onFinish");this.once("end",o);this.once("error",o)}_read(t){const r=this[hJ];if(r.onReadCallback){r.onReadCallback()}return super._read(t)}_transform(t,r,n){const i=this;const s=this[hJ];const o=s.maxRate;const u=this.readableHighWaterMark;const l=s.timeWindow;const c=1e3/l;const d=o/c;const p=s.minChunkSize!==false?Math.max(s.minChunkSize,d*.01):0;function f(h,g){const _=Buffer.byteLength(h);s.bytesSeen+=_;s.bytes+=_;if(s.isCaptured){s.updateProgress()}if(i.push(h)){process.nextTick(g)}else{s.onReadCallback=()=>{s.onReadCallback=null;process.nextTick(g)}}}a(f,"pushChunk");const m=a((h,g)=>{const _=Buffer.byteLength(h);let v=null;let S=u;let E;let b=0;if(o){const A=Date.now();if(!s.ts||(b=A-s.ts)>=l){s.ts=A;E=d-s.bytes;s.bytes=E<0?-E:0;b=0}E=d-s.bytes}if(o){if(E<=0){return setTimeout(()=>{g(null,h)},l-b)}if(E<S){S=E}}if(S&&_>S&&_-S>p){v=h.subarray(S);h=h.subarray(0,S)}f(h,v?()=>{process.nextTick(g,null,v)}:g)},"transformChunk");m(t,a(function h(g,_){if(g){return n(g)}if(_){m(_,h)}else{n(null)}},"transformNextChunk"))}setLength(t){this[hJ].length=+t;return this}};var Qwt=Qxe;var{asyncIterator:Zwt}=Symbol;var $wn=a(async function*(e){if(e.stream){yield*e.stream()}else if(e.arrayBuffer){yield await e.arrayBuffer()}else if(e[Zwt]){yield*e[Zwt]()}else{yield e}},"readBlob");var PTt=$wn;var jwn=Je.ALPHABET.ALPHA_DIGIT+"-_";var kF=new lTt.TextEncoder;var jE="\r\n";var Gwn=kF.encode(jE);var Hwn=2;var Zxe=class{static{a(this,"FormDataPart")}constructor(t,r){const{escapeName:n}=this.constructor;const i=Je.isString(r);let s=`Content-Disposition: form-data; name="${n(t)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${jE}`;if(i){r=kF.encode(String(r).replace(/\r?\n|\r\n?/g,jE))}else{s+=`Content-Type: ${r.type||"application/octet-stream"}${jE}`}this.headers=kF.encode(s+jE);this.contentLength=i?r.byteLength:r.size;this.size=this.headers.byteLength+this.contentLength+Hwn;this.name=t;this.value=r}async*encode(){yield this.headers;const{value:t}=this;if(Je.isTypedArray(t)){yield t}else{yield*PTt(t)}yield Gwn}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}};var Vwn=a((e,t,r)=>{const{tag:n="form-data-boundary",size:i=25,boundary:s=n+"-"+Je.generateString(i,jwn)}=r||{};if(!Je.isFormData(e)){throw TypeError("FormData instance required")}if(s.length<1||s.length>70){throw Error("boundary must be 10-70 characters long")}const o=kF.encode("--"+s+jE);const u=kF.encode("--"+s+"--"+jE+jE);let l=u.byteLength;const c=Array.from(e.entries()).map(([p,f])=>{const m=new Zxe(p,f);l+=m.size;return m});l+=o.byteLength*c.length;l=Je.toFiniteNumber(l);const d={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(l)){d["Content-Length"]=l}t&&t(d);return cTt.Readable.from(async function*(){for(const p of c){yield o;yield*p.encode()}yield u}())},"formDataToStream");var zwn=Vwn;var eRe=class extends $E["default"].Transform{static{a(this,"ZlibHeaderTransformStream")}__transform(t,r,n){this.push(t);n()}_transform(t,r,n){if(t.length!==0){this._transform=this.__transform;if(t[0]!==120){const i=Buffer.alloc(2);i[0]=120;i[1]=156;this.push(i,r)}}this.__transform(t,r,n)}};var Kwn=eRe;var Wwn=a((e,t)=>{return Je.isAsyncFn(e)?function(...r){const n=r.pop();e.apply(this,r).then(i=>{try{t?n(null,...t(i)):n(null,i)}catch(s){n(s)}},n)}:e},"callbackify");var Ywn=Wwn;var eTt={flush:GE["default"].constants.Z_SYNC_FLUSH,finishFlush:GE["default"].constants.Z_SYNC_FLUSH};var Xwn={flush:GE["default"].constants.BROTLI_OPERATION_FLUSH,finishFlush:GE["default"].constants.BROTLI_OPERATION_FLUSH};var tTt=Je.isFunction(GE["default"].createBrotliDecompress);var{http:Jwn,https:Qwn}=FCn["default"];var Zwn=/https:?/;var rTt=Lf.protocols.map(e=>{return e+":"});function eTn(e){if(e.beforeRedirects.proxy){e.beforeRedirects.proxy(e)}if(e.beforeRedirects.config){e.beforeRedirects.config(e)}}a(eTn,"dispatchBeforeRedirect");function NTt(e,t,r){let n=t;if(!n&&n!==false){const i=TCn.getProxyForUrl(r);if(i){n=new URL(i)}}if(n){if(n.username){n.auth=(n.username||"")+":"+(n.password||"")}if(n.auth){if(n.auth.username||n.auth.password){n.auth=(n.auth.username||"")+":"+(n.auth.password||"")}const s=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+s}e.headers.host=e.hostname+(e.port?":"+e.port:"");const i=n.hostname||n.host;e.hostname=i;e.host=i;e.port=n.port;e.path=r;if(n.protocol){e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`}}e.beforeRedirects.proxy=a(function i(s){NTt(s,t,s.href)},"beforeRedirect")}a(NTt,"setProxy");var tTn=typeof process!=="undefined"&&Je.kindOf(process)==="process";var rTn=a(e=>{return new Promise((t,r)=>{let n;let i;const s=a((l,c)=>{if(i)return;i=true;n&&n(l,c)},"done");const o=a(l=>{s(l);t(l)},"_resolve");const u=a(l=>{s(l,true);r(l)},"_reject");e(o,u,l=>n=l).catch(u)})},"wrapAsync");var nTn=a(({address:e,family:t})=>{if(!Je.isString(e)){throw TypeError("address must be a string")}return{address:e,family:t||(e.indexOf(".")<0?6:4)}},"resolveFamily");var nTt=a((e,t)=>nTn(Je.isObject(e)?e:{address:e,family:t}),"buildAddressEntry");var iTn=tTn&&a(function e(t){return rTn(a(async function r(n,i,s){let{data:o,lookup:u,family:l}=t;const{responseType:c,responseEncoding:d}=t;const p=t.method.toUpperCase();let f;let m=false;let h;if(u){const he=Ywn(u,Fe=>Je.isArray(Fe)?Fe:[Fe]);u=a((Fe,Oe,M)=>{he(Fe,Oe,(Q,fe,B)=>{const ye=Je.isArray(fe)?fe.map(De=>nTt(De)):[nTt(fe,B)];Oe.all?M(Q,ye):M(Q,ye[0].address,ye[0].family)})},"lookup")}const g=new BCn["default"];const _=a(()=>{if(t.cancelToken){t.cancelToken.unsubscribe(v)}if(t.signal){t.signal.removeEventListener("abort",v)}g.removeAllListeners()},"onFinished");s((he,Fe)=>{f=true;if(Fe){m=true;_()}});function v(he){g.emit("abort",!he||he.type?new tC(null,t,h):he)}a(v,"abort");g.once("abort",i);if(t.cancelToken||t.signal){t.cancelToken&&t.cancelToken.subscribe(v);if(t.signal){t.signal.aborted?v():t.signal.addEventListener("abort",v)}}const S=cRe(t.baseURL,t.url);const E=new URL(S,"http://localhost");const b=E.protocol||rTt[0];if(b==="data:"){let he;if(p!=="GET"){return NF(n,i,{status:405,statusText:"method not allowed",headers:{},config:t})}try{he=qwn(t.url,c==="blob",{Blob:t.env&&t.env.Blob})}catch(Fe){throw yr.from(Fe,yr.ERR_BAD_REQUEST,t)}if(c==="text"){he=he.toString(d);if(!d||d==="utf8"){he=Je.stripBOM(he)}}else if(c==="stream"){he=$E["default"].Readable.from(he)}return NF(n,i,{data:he,status:200,statusText:"OK",headers:new Bf,config:t})}if(rTt.indexOf(b)===-1){return i(new yr("Unsupported protocol "+b,yr.ERR_BAD_REQUEST,t))}const A=Bf.from(t.headers).normalize();A.set("User-Agent","axios/"+vJ,false);const C=t.onDownloadProgress;const T=t.onUploadProgress;const O=t.maxRate;let P=void 0;let R=void 0;if(Je.isSpecCompliantForm(o)){const he=A.getContentType(/boundary=([-_\w\d]{10,70})/i);o=zwn(o,Fe=>{A.set(Fe)},{tag:`axios-${vJ}-boundary`,boundary:he&&he[1]||void 0})}else if(Je.isFormData(o)&&Je.isFunction(o.getHeaders)){A.set(o.getHeaders());if(!A.hasContentLength()){try{const he=await LCn["default"].promisify(o.getLength).call(o);Number.isFinite(he)&&he>=0&&A.setContentLength(he)}catch(he){}}}else if(Je.isBlob(o)){o.size&&A.setContentType(o.type||"application/octet-stream");A.setContentLength(o.size||0);o=$E["default"].Readable.from(PTt(o))}else if(o&&!Je.isStream(o)){if(Buffer.isBuffer(o));else if(Je.isArrayBuffer(o)){o=Buffer.from(new Uint8Array(o))}else if(Je.isString(o)){o=Buffer.from(o,"utf-8")}else{return i(new yr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",yr.ERR_BAD_REQUEST,t))}A.setContentLength(o.length,false);if(t.maxBodyLength>-1&&o.length>t.maxBodyLength){return i(new yr("Request body larger than maxBodyLength limit",yr.ERR_BAD_REQUEST,t))}}const I=Je.toFiniteNumber(A.getContentLength());if(Je.isArray(O)){P=O[0];R=O[1]}else{P=R=O}if(o&&(T||P)){if(!Je.isStream(o)){o=$E["default"].Readable.from(o,{objectMode:false})}o=$E["default"].pipeline([o,new Qwt({length:I,maxRate:Je.toFiniteNumber(P)})],Je.noop);T&&o.on("progress",he=>{T(Object.assign(he,{upload:true}))})}let D=void 0;if(t.auth){const he=t.auth.username||"";const Fe=t.auth.password||"";D=he+":"+Fe}if(!D&&E.username){const he=E.username;const Fe=E.password;D=he+":"+Fe}D&&A.delete("authorization");let U;try{U=aRe(E.pathname+E.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(he){const Fe=new Error(he.message);Fe.config=t;Fe.url=t.url;Fe.exists=true;return i(Fe)}A.set("Accept-Encoding","gzip, compress, deflate"+(tTt?", br":""),false);const te={path:U,method:p,headers:A.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:D,protocol:b,family:l,beforeRedirect:eTn,beforeRedirects:{}};!Je.isUndefined(u)&&(te.lookup=u);if(t.socketPath){te.socketPath=t.socketPath}else{te.hostname=E.hostname;te.port=E.port;NTt(te,t.proxy,b+"//"+E.hostname+(E.port?":"+E.port:"")+te.path)}let ve;const me=Zwn.test(te.protocol);te.agent=me?t.httpsAgent:t.httpAgent;if(t.transport){ve=t.transport}else if(t.maxRedirects===0){ve=me?DCn["default"]:kCn["default"]}else{if(t.maxRedirects){te.maxRedirects=t.maxRedirects}if(t.beforeRedirect){te.beforeRedirects.config=t.beforeRedirect}ve=me?Qwn:Jwn}if(t.maxBodyLength>-1){te.maxBodyLength=t.maxBodyLength}else{te.maxBodyLength=Infinity}if(t.insecureHTTPParser){te.insecureHTTPParser=t.insecureHTTPParser}h=ve.request(te,a(function he(Fe){if(h.destroyed)return;const Oe=[Fe];const M=+Fe.headers["content-length"];if(C){const De=new Qwt({length:Je.toFiniteNumber(M),maxRate:Je.toFiniteNumber(R)});C&&De.on("progress",$e=>{C(Object.assign($e,{download:true}))});Oe.push(De)}let Q=Fe;const fe=Fe.req||h;if(t.decompress!==false&&Fe.headers["content-encoding"]){if(p==="HEAD"||Fe.statusCode===204){delete Fe.headers["content-encoding"]}switch((Fe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Oe.push(GE["default"].createUnzip(eTt));delete Fe.headers["content-encoding"];break;case"deflate":Oe.push(new Kwn);Oe.push(GE["default"].createUnzip(eTt));delete Fe.headers["content-encoding"];break;case"br":if(tTt){Oe.push(GE["default"].createBrotliDecompress(Xwn));delete Fe.headers["content-encoding"]}}}Q=Oe.length>1?$E["default"].pipeline(Oe,Je.noop):Oe[0];const B=$E["default"].finished(Q,()=>{B();_()});const ye={status:Fe.statusCode,statusText:Fe.statusMessage,headers:new Bf(Fe.headers),config:t,request:fe};if(c==="stream"){ye.data=Q;NF(n,i,ye)}else{const De=[];let $e=0;Q.on("data",a(function gt(ut){De.push(ut);$e+=ut.length;if(t.maxContentLength>-1&&$e>t.maxContentLength){m=true;Q.destroy();i(new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe))}},"handleStreamData"));Q.on("aborted",a(function gt(){if(m){return}const ut=new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe);Q.destroy(ut);i(ut)},"handlerStreamAborted"));Q.on("error",a(function gt(ut){if(h.destroyed)return;i(yr.from(ut,null,t,fe))},"handleStreamError"));Q.on("end",a(function gt(){try{let ut=De.length===1?De[0]:Buffer.concat(De);if(c!=="arraybuffer"){ut=ut.toString(d);if(!d||d==="utf8"){ut=Je.stripBOM(ut)}}ye.data=ut}catch(ut){return i(yr.from(ut,null,t,ye.request,ye))}NF(n,i,ye)},"handleStreamEnd"))}g.once("abort",De=>{if(!Q.destroyed){Q.emit("error",De);Q.destroy()}})},"handleResponse"));g.once("abort",he=>{i(he);h.destroy(he)});h.on("error",a(function he(Fe){i(yr.from(Fe,null,t,h))},"handleRequestError"));h.on("socket",a(function he(Fe){Fe.setKeepAlive(true,1e3*60)},"handleRequestSocket"));if(t.timeout){const he=parseInt(t.timeout,10);if(Number.isNaN(he)){i(new yr("error trying to parse `config.timeout` to int",yr.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(he,a(function Fe(){if(f)return;let Oe=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const M=t.transitional||oRe;if(t.timeoutErrorMessage){Oe=t.timeoutErrorMessage}i(new yr(Oe,M.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,t,h));v()},"handleRequestTimeout"))}if(Je.isStream(o)){let he=false;let Fe=false;o.on("end",()=>{he=true});o.once("error",Oe=>{Fe=true;h.destroy(Oe)});o.on("close",()=>{if(!he&&!Fe){v(new tC("Request stream has been aborted",t,h))}});o.pipe(h)}else{h.end(o)}},"dispatchHttpRequest"))},"httpAdapter");var sTn=Lf.hasStandardBrowserEnv?{write(e,t,r,n,i,s){const o=[e+"="+encodeURIComponent(t)];Je.isNumber(r)&&o.push("expires="+new Date(r).toGMTString());Je.isString(n)&&o.push("path="+n);Je.isString(i)&&o.push("domain="+i);s===true&&o.push("secure");document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var aTn=Lf.hasStandardBrowserEnv?a(function e(){const t=/(msie|trident)/i.test(navigator.userAgent);const r=document.createElement("a");let n;function i(s){let o=s;if(t){r.setAttribute("href",o);o=r.href}r.setAttribute("href",o);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}a(i,"resolveURL");n=i(window.location.href);return a(function s(o){const u=Je.isString(o)?i(o):o;return u.protocol===n.protocol&&u.host===n.host},"isURLSameOrigin")},"standardBrowserEnv")():a(function e(){return a(function t(){return true},"isURLSameOrigin")},"nonStandardBrowserEnv")();function iTt(e,t){let r=0;const n=OTt(50,250);return i=>{const s=i.loaded;const o=i.lengthComputable?i.total:void 0;const u=s-r;const l=n(u);const c=s<=o;r=s;const d={loaded:s,total:o,progress:o?s/o:void 0,bytes:u,rate:l?l:void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};d[t?"download":"upload"]=true;e(d)}}a(iTt,"progressEventReducer");var oTn=typeof XMLHttpRequest!=="undefined";var uTn=oTn&&function(e){return new Promise(a(function t(r,n){let i=e.data;const s=Bf.from(e.headers).normalize();let{responseType:o,withXSRFToken:u}=e;let l;function c(){if(e.cancelToken){e.cancelToken.unsubscribe(l)}if(e.signal){e.signal.removeEventListener("abort",l)}}a(c,"done");let d;if(Je.isFormData(i)){if(Lf.hasStandardBrowserEnv||Lf.hasStandardBrowserWebWorkerEnv){s.setContentType(false)}else if((d=s.getContentType())!==false){const[g,..._]=d?d.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",..._].join("; "))}}let p=new XMLHttpRequest;if(e.auth){const g=e.auth.username||"";const _=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+_))}const f=cRe(e.baseURL,e.url);p.open(e.method.toUpperCase(),aRe(f,e.params,e.paramsSerializer),true);p.timeout=e.timeout;function m(){if(!p){return}const g=Bf.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());const _=!o||o==="text"||o==="json"?p.responseText:p.response;const v={data:_,status:p.status,statusText:p.statusText,headers:g,config:e,request:p};NF(a(function S(E){r(E);c()},"_resolve"),a(function S(E){n(E);c()},"_reject"),v);p=null}a(m,"onloadend");if("onloadend"in p){p.onloadend=m}else{p.onreadystatechange=a(function g(){if(!p||p.readyState!==4){return}if(p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)){return}setTimeout(m)},"handleLoad")}p.onabort=a(function g(){if(!p){return}n(new yr("Request aborted",yr.ECONNABORTED,e,p));p=null},"handleAbort");p.onerror=a(function g(){n(new yr("Network Error",yr.ERR_NETWORK,e,p));p=null},"handleError");p.ontimeout=a(function g(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||oRe;if(e.timeoutErrorMessage){_=e.timeoutErrorMessage}n(new yr(_,v.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,e,p));p=null},"handleTimeout");if(Lf.hasStandardBrowserEnv){u&&Je.isFunction(u)&&(u=u(e));if(u||u!==false&&aTn(f)){const g=e.xsrfHeaderName&&e.xsrfCookieName&&sTn.read(e.xsrfCookieName);if(g){s.set(e.xsrfHeaderName,g)}}}i===void 0&&s.setContentType(null);if("setRequestHeader"in p){Je.forEach(s.toJSON(),a(function g(_,v){p.setRequestHeader(v,_)},"setRequestHeader"))}if(!Je.isUndefined(e.withCredentials)){p.withCredentials=!!e.withCredentials}if(o&&o!=="json"){p.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){p.addEventListener("progress",iTt(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&p.upload){p.upload.addEventListener("progress",iTt(e.onUploadProgress))}if(e.cancelToken||e.signal){l=a(g=>{if(!p){return}n(!g||g.type?new tC(null,e,p):g);p.abort();p=null},"onCanceled");e.cancelToken&&e.cancelToken.subscribe(l);if(e.signal){e.signal.aborted?l():e.signal.addEventListener("abort",l)}}const h=RTt(f);if(h&&Lf.protocols.indexOf(h)===-1){n(new yr("Unsupported protocol "+h+":",yr.ERR_BAD_REQUEST,e));return}p.send(i||null)},"dispatchXhrRequest"))};var tRe={http:iTn,xhr:uTn};Je.forEach(tRe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}});var sTt=a(e=>`- ${e}`,"renderReason");var lTn=a(e=>Je.isFunction(e)||e===null||e===false,"isResolvedHandle");var ITt={getAdapter:e=>{e=Je.isArray(e)?e:[e];const{length:t}=e;let r;let n;const i={};for(let s=0;s<t;s++){r=e[s];let o;n=r;if(!lTn(r)){n=tRe[(o=String(r)).toLowerCase()];if(n===void 0){throw new yr(`Unknown adapter '${o}'`)}}if(n){break}i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===false?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?"since :\n"+s.map(sTt).join("\n"):" "+sTt(s[0]):"as no adapter specified";throw new yr(`There is no suitable adapter to dispatch the request `+o,"ERR_NOT_SUPPORT")}return n},adapters:tRe};function Wxe(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new tC(null,e)}}a(Wxe,"throwIfCancellationRequested");function aTt(e){Wxe(e);e.headers=Bf.from(e.headers);e.data=Kxe.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}const t=ITt.getAdapter(e.adapter||lRe.adapter);return t(e).then(a(function r(n){Wxe(e);n.data=Kxe.call(e,e.transformResponse,n);n.headers=Bf.from(n.headers);return n},"onAdapterResolution"),a(function r(n){if(!xTt(n)){Wxe(e);if(n&&n.response){n.response.data=Kxe.call(e,e.transformResponse,n.response);n.response.headers=Bf.from(n.response.headers)}}return Promise.reject(n)},"onAdapterRejection"))}a(aTt,"dispatchRequest");var oTt=a(e=>e instanceof Bf?e.toJSON():e,"headersToObject");function aP(e,t){t=t||{};const r={};function n(c,d,p){if(Je.isPlainObject(c)&&Je.isPlainObject(d)){return Je.merge.call({caseless:p},c,d)}else if(Je.isPlainObject(d)){return Je.merge({},d)}else if(Je.isArray(d)){return d.slice()}return d}a(n,"getMergedValue");function i(c,d,p){if(!Je.isUndefined(d)){return n(c,d,p)}else if(!Je.isUndefined(c)){return n(void 0,c,p)}}a(i,"mergeDeepProperties");function s(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}}a(s,"valueFromConfig2");function o(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}else if(!Je.isUndefined(c)){return n(void 0,c)}}a(o,"defaultToConfig2");function u(c,d,p){if(p in t){return n(c,d)}else if(p in e){return n(void 0,c)}}a(u,"mergeDirectKeys");const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(c,d)=>i(oTt(c),oTt(d),true)};Je.forEach(Object.keys(Object.assign({},e,t)),a(function c(d){const p=l[d]||i;const f=p(e[d],t[d],d);Je.isUndefined(f)&&p!==u||(r[d]=f)},"computeConfigValue"));return r}a(aP,"mergeConfig");var dRe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dRe[e]=a(function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e},"validator")});var uTt={};dRe.transitional=a(function e(t,r,n){function i(s,o){return"[Axios v"+vJ+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}a(i,"formatMessage");return(s,o,u)=>{if(t===false){throw new yr(i(o," has been removed"+(r?" in "+r:"")),yr.ERR_DEPRECATED)}if(r&&!uTt[o]){uTt[o]=true;console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(s,o,u):true}},"transitional");function cTn(e,t,r){if(typeof e!=="object"){throw new yr("options must be an object",yr.ERR_BAD_OPTION_VALUE)}const n=Object.keys(e);let i=n.length;while(i-- >0){const s=n[i];const o=t[s];if(o){const u=e[s];const l=u===void 0||o(u,s,e);if(l!==true){throw new yr("option "+s+" must be "+l,yr.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new yr("Unknown option "+s,yr.ERR_BAD_OPTION)}}}a(cTn,"assertOptions");var rRe={assertOptions:cTn,validators:dRe};var UE=rRe.validators;var oP=class{static{a(this,"Axios")}constructor(t){this.defaults=t;this.interceptors={request:new Xwt,response:new Xwt}}request(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=aP(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;if(n!==void 0){rRe.assertOptions(n,{silentJSONParsing:UE.transitional(UE.boolean),forcedJSONParsing:UE.transitional(UE.boolean),clarifyTimeoutError:UE.transitional(UE.boolean)},false)}if(i!=null){if(Je.isFunction(i)){r.paramsSerializer={serialize:i}}else{rRe.assertOptions(i,{encode:UE.function,serialize:UE.function},true)}}r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Je.merge(s.common,s[r.method]);s&&Je.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]});r.headers=Bf.concat(o,s);const u=[];let l=true;this.interceptors.request.forEach(a(function h(g){if(typeof g.runWhen==="function"&&g.runWhen(r)===false){return}l=l&&g.synchronous;u.unshift(g.fulfilled,g.rejected)},"unshiftRequestInterceptors"));const c=[];this.interceptors.response.forEach(a(function h(g){c.push(g.fulfilled,g.rejected)},"pushResponseInterceptors"));let d;let p=0;let f;if(!l){const h=[aTt.bind(this),void 0];h.unshift.apply(h,u);h.push.apply(h,c);f=h.length;d=Promise.resolve(r);while(p<f){d=d.then(h[p++],h[p++])}return d}f=u.length;let m=r;p=0;while(p<f){const h=u[p++];const g=u[p++];try{m=h(m)}catch(_){g.call(this,_);break}}try{d=aTt.call(this,m)}catch(h){return Promise.reject(h)}p=0;f=c.length;while(p<f){d=d.then(c[p++],c[p++])}return d}getUri(t){t=aP(this.defaults,t);const r=cRe(t.baseURL,t.url);return aRe(r,t.params,t.paramsSerializer)}};Je.forEach(["delete","get","head","options"],a(function e(t){oP.prototype[t]=function(r,n){return this.request(aP(n||{},{method:t,url:r,data:(n||{}).data}))}},"forEachMethodNoData"));Je.forEach(["post","put","patch"],a(function e(t){function r(n){return a(function i(s,o,u){return this.request(aP(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))},"httpMethod")}a(r,"generateHTTPMethod");oP.prototype[t]=r();oP.prototype[t+"Form"]=r(true)},"forEachMethodWithData"));var _J=oP;var nRe=class e{static{a(this,"CancelToken")}constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let r;this.promise=new Promise(a(function i(s){r=s},"promiseExecutor"));const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;while(s-- >0){n._listeners[s](i)}n._listeners=null});this.promise.then=i=>{let s;const o=new Promise(u=>{n.subscribe(u);s=u}).then(i);o.cancel=a(function u(){n.unsubscribe(s)},"reject");return o};t(a(function i(s,o,u){if(n.reason){return}n.reason=new tC(s,o,u);r(n.reason)},"cancel"))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}}static source(){let t;const r=new e(a(function n(i){t=i},"executor"));return{token:r,cancel:t}}};var dTn=nRe;function pTn(e){return a(function t(r){return e.apply(null,r)},"wrap")}a(pTn,"spread");function fTn(e){return Je.isObject(e)&&e.isAxiosError===true}a(fTn,"isAxiosError");var iRe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(iRe).forEach(([e,t])=>{iRe[t]=e});var mTn=iRe;function kTt(e){const t=new _J(e);const r=pTt(_J.prototype.request,t);Je.extend(r,_J.prototype,t,{allOwnKeys:true});Je.extend(r,t,null,{allOwnKeys:true});r.create=a(function n(i){return kTt(aP(e,i))},"create");return r}a(kTt,"createInstance");var Lo=kTt(lRe);Lo.Axios=_J;Lo.CanceledError=tC;Lo.CancelToken=dTn;Lo.isCancel=xTt;Lo.VERSION=vJ;Lo.toFormData=AJ;Lo.AxiosError=yr;Lo.Cancel=Lo.CanceledError;Lo.all=a(function e(t){return Promise.all(t)},"all");Lo.spread=pTn;Lo.isAxiosError=fTn;Lo.mergeConfig=aP;Lo.AxiosHeaders=Bf;Lo.formToJSON=e=>TTt(Je.isHTMLForm(e)?new FormData(e):e);Lo.getAdapter=ITt.getAdapter;Lo.HttpStatusCode=mTn;Lo.default=Lo;DTt.exports=Lo});var TJ=y(wJ=>{"use strict";Object.defineProperty(wJ,"__esModule",{value:true});wJ.CredentialsMethod=void 0;var LTt;(function(e){e["None"]="none";e["ApiToken"]="api_token";e["ClientCredentials"]="client_credentials"})(LTt||(wJ.CredentialsMethod=LTt={}))});var nC=y(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:true});Fo.FgaRequiredParamError=Fo.FgaValidationError=Fo.FgaApiAuthenticationError=Fo.FgaApiInternalError=Fo.FgaApiRateLimitExceededError=Fo.FgaApiNotFoundError=Fo.FgaApiValidationError=Fo.FgaApiError=Fo.FgaError=void 0;var lP=class extends Error{static{a(this,"FgaError")}constructor(t,r){super(r||typeof t==="string"?t:`FGA Error${(t===null||t===void 0?void 0:t.message)?`: ${t.message}`:""}`);this.name="FgaError";if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Fo.FgaError=lP;function RJ(e){let t=(e||"").split("/");if(t.length<4){t=[]}const r=t[2]||"";const n=t[3]||"";return{storeId:r,endpointCategory:n}}a(RJ,"getRequestMetadataFromPath");var FTt="fga-request-id";function _Re(e){return e.response?Object.fromEntries(Object.entries(e.response.headers).map(([t,r])=>[t.toLowerCase(),r])):{}}a(_Re,"getResponseHeaders");var rC=class extends lP{static{a(this,"FgaApiError")}constructor(t,r){var n,i,s,o,u,l,c,d,p,f;super(r?r:t);this.name="FgaApiError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestData=(s=t.config)===null||s===void 0?void 0:s.data;this.requestURL=(o=t.config)===null||o===void 0?void 0:o.url;this.method=(u=t.config)===null||u===void 0?void 0:u.method;const{storeId:m,endpointCategory:h}=RJ((l=t.request)===null||l===void 0?void 0:l.path);this.storeId=m;this.endpointCategory=h;this.apiErrorMessage=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message;this.responseData=(p=t.response)===null||p===void 0?void 0:p.data;this.responseHeader=(f=t.response)===null||f===void 0?void 0:f.headers;const g=_Re(t);this.requestId=g[FTt];if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Fo.FgaApiError=rC;var pRe=class extends rC{static{a(this,"FgaApiValidationError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiValidationError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:p}=RJ((s=t.request)===null||s===void 0?void 0:s.path);this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Validation Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Fo.FgaApiValidationError=pRe;var fRe=class extends rC{static{a(this,"FgaApiNotFoundError")}constructor(t,r){var n,i,s,o,u,l,c;super(t);this.name="FgaApiNotFoundError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;this.message=r?r:((o=(s=t.response)===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.message)?`FGA API NotFound Error: ${(u=t.config)===null||u===void 0?void 0:u.method} : Error ${(c=(l=t.response)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.message}`:t.message}};Fo.FgaApiNotFoundError=fRe;var mRe=class extends rC{static{a(this,"FgaApiRateLimitExceededError")}constructor(t,r){var n,i,s;super(t);this.name="FgaApiRateLimitExceededError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:o}=RJ((s=t.request)===null||s===void 0?void 0:s.path);const u=_Re(t);this.message=r?r:`FGA API Rate Limit Error for ${this.method} ${o}`}};Fo.FgaApiRateLimitExceededError=mRe;var hRe=class extends rC{static{a(this,"FgaApiInternalError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiInternalError";const{endpointCategory:p}=RJ((n=t.request)===null||n===void 0?void 0:n.path);this.apiErrorCode=(s=(i=t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.code;this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Internal Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Fo.FgaApiInternalError=hRe;var gRe=class extends lP{static{a(this,"FgaApiAuthenticationError")}constructor(t){var r,n,i,s,o,u,l,c,d,p;super(`FGA Authentication Error.${((r=t.response)===null||r===void 0?void 0:r.statusText)?` ${t.response.statusText}`:""}`);this.name="FgaApiAuthenticationError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestURL=(s=t.config)===null||s===void 0?void 0:s.url;this.method=(o=t.config)===null||o===void 0?void 0:o.method;this.responseData=(u=t.response)===null||u===void 0?void 0:u.data;this.responseHeader=(l=t.response)===null||l===void 0?void 0:l.headers;this.apiErrorCode=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.code;const f=_Re(t);this.requestId=f[FTt];let m;try{m=JSON.parse(((p=t.config)===null||p===void 0?void 0:p.data)||"{}")}catch(h){}this.clientId=m===null||m===void 0?void 0:m.client_id;this.audience=m===null||m===void 0?void 0:m.audience;this.grantType=m===null||m===void 0?void 0:m.grant_type;if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Fo.FgaApiAuthenticationError=gRe;var xJ=class extends lP{static{a(this,"FgaValidationError")}constructor(t,r){super(r);this.field=t;this.name="FgaValidationError"}};Fo.FgaValidationError=xJ;var yRe=class extends xJ{static{a(this,"FgaRequiredParamError")}constructor(t,r,n){super(r,n);this.functionName=t;this.name="FgaRequiredParamError"}};Fo.FgaRequiredParamError=yRe});var LF=y(HE=>{"use strict";Object.defineProperty(HE,"__esModule",{value:true});HE.isWellFormedUlidString=HE.isWellFormedUriString=HE.assertParamExists=void 0;var hTn=nC();var gTn=a(function(e,t,r){if(r===null||r===void 0){throw new hTn.FgaRequiredParamError(e,t,`Required parameter ${t} was null or undefined when calling ${e}.`)}},"assertParamExists");HE.assertParamExists=gTn;var yTn=a(e=>{try{const t=new URL(e);return(t.toString()===e||t.toString()===`${e}/`)&&(t.protocol==="https:"||t.protocol==="http:")}catch(t){return false}},"isWellFormedUriString");HE.isWellFormedUriString=yTn;var _Tn=a(e=>{var t;const r=/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;return!!(typeof e==="string"&&((t=e.match(r))===null||t===void 0?void 0:t.length))},"isWellFormedUlidString");HE.isWellFormedUlidString=_Tn});var ERe=y(cP=>{"use strict";Object.defineProperty(cP,"__esModule",{value:true});cP.Configuration=cP.GetDefaultRetryParams=void 0;var FF=TJ();var vRe=nC();var OJ=LF();var vTn=15;var ETn=100;var bTn="openfga-sdk js/0.3.0";function STn(e=vTn,t=ETn){return{maxRetry:e,minWaitInMs:t}}a(STn,"GetDefaultRetryParams");cP.GetDefaultRetryParams=STn;var PJ=class{static{a(this,"Configuration")}constructor(t={}){this.apiScheme="https";this.getBasePath=()=>`${this.apiScheme}://${this.apiHost}`;this.apiScheme=t.apiScheme||this.apiScheme;this.apiHost=t.apiHost;this.storeId=t.storeId;const r=t.credentials;if(r){switch(r===null||r===void 0?void 0:r.method){case FF.CredentialsMethod.ApiToken:this.credentials={method:r.method,config:{token:r.config.token,headerName:"Authorization",headerValuePrefix:"Bearer"}};break;case FF.CredentialsMethod.ClientCredentials:this.credentials={method:FF.CredentialsMethod.ClientCredentials,config:{clientId:r.config.clientId,clientSecret:r.config.clientSecret,apiAudience:r.config.apiAudience,apiTokenIssuer:r.config.apiTokenIssuer}};break;case FF.CredentialsMethod.None:default:this.credentials={method:FF.CredentialsMethod.None};break}}const n=t.baseOptions||{};n.headers=n.headers||{};if(typeof process==="object"&&process.title==="node"&&!n.headers["User-Agent"]){n.headers["User-Agent"]=bTn}this.baseOptions=n;this.retryParams=t.retryParams}isValid(){var t;(0,OJ.assertParamExists)("Configuration","apiScheme",this.apiScheme);(0,OJ.assertParamExists)("Configuration","apiHost",this.apiHost);if(!(0,OJ.isWellFormedUriString)(this.getBasePath())){throw new vRe.FgaValidationError(`Configuration.apiScheme (${this.apiScheme}) and Configuration.apiHost (${this.apiHost}) do not form a valid URI (${this.getBasePath()})`)}if(this.storeId&&!(0,OJ.isWellFormedUlidString)(this.storeId)){throw new vRe.FgaValidationError("storeId")}if(((t=this.retryParams)===null||t===void 0?void 0:t.maxRetry)&&this.retryParams.maxRetry>15){throw new vRe.FgaValidationError("Configuration.retryParams.maxRetry exceeds maximum allowed limit of 15")}return true}};cP.Configuration=PJ;PJ.sdkVersion="0.3.0"});var BTt=y(NJ=>{"use strict";Object.defineProperty(NJ,"__esModule",{value:true});NJ.assertNever=void 0;function ATn(e){throw new Error(`Assertion failed. Unacceptable value: '${e}'`)}a(ATn,"assertNever");NJ.assertNever=ATn});var MTt=y(IJ=>{"use strict";Object.defineProperty(IJ,"__esModule",{value:true});IJ.chunkArray=void 0;function CTn(e,t){const r=[];const n=[...e];while(n.length>0){r.push(n.splice(0,t))}return r}a(CTn,"chunkArray");IJ.chunkArray=CTn});var UTt=y(dP=>{"use strict";Object.defineProperty(dP,"__esModule",{value:true});dP.generateRandomIdWithNonUniqueFallback=dP.generateRandomId=void 0;var kJ=require("crypto");function qTt(){if(typeof kJ.randomUUID==="function"){return(0,kJ.randomUUID)()}if(typeof kJ.randomBytes==="function"){return(0,kJ.randomBytes)(20).toString("hex")}return}a(qTt,"generateRandomId");dP.generateRandomId=qTt;function wTn(){return qTt()||"00000000-0000-0000-0000-000000000000"}a(wTn,"generateRandomIdWithNonUniqueFallback");dP.generateRandomIdWithNonUniqueFallback=wTn});var $Tt=y(DJ=>{"use strict";Object.defineProperty(DJ,"__esModule",{value:true});DJ.setHeaderIfNotSet=void 0;function TTn(e,t,r){if(!e[t]&&r){e[t]=r}}a(TTn,"setHeaderIfNotSet");DJ.setHeaderIfNotSet=TTn});var jTt=y(LJ=>{"use strict";Object.defineProperty(LJ,"__esModule",{value:true});LJ.setNotEnumerableProperty=void 0;function xTn(e,t,r){Object.defineProperty(e,t,{enumerable:false,writable:false,value:r})}a(xTn,"setNotEnumerableProperty");LJ.setNotEnumerableProperty=xTn});var bRe=y(hh=>{"use strict";var RTn=hh&&hh.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var BF=hh&&hh.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))RTn(t,e,r)};Object.defineProperty(hh,"__esModule",{value:true});BF(BTt(),hh);BF(MTt(),hh);BF(UTt(),hh);BF($Tt(),hh);BF(jTt(),hh)});var ARe=y(eu=>{"use strict";var SRe=eu&&eu.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(eu,"__esModule",{value:true});eu.createRequestFunction=eu.attemptHttpRequest=eu.toPathString=eu.serializeDataIfNeeded=eu.setSearchParams=eu.setBearerAuthToObject=eu.DUMMY_BASE_URL=void 0;var OTn=FJ();var iC=nC();var PTn=bRe();eu.DUMMY_BASE_URL="https://example.com";var NTn=a(function(e,t){return SRe(this,void 0,void 0,function*(){const r=yield t.getAccessTokenHeader();if(r&&!e[r.name]){e[r.name]=r.value}})},"setBearerAuthToObject");eu.setBearerAuthToObject=NTn;var ITn=a(function(e,...t){const r=new URLSearchParams(e.search);for(const n of t){for(const i in n){if(Array.isArray(n[i])){r.delete(i);for(const s of n[i]){r.append(i,s)}}else{r.set(i,n[i])}}}e.search=r.toString()},"setSearchParams");eu.setSearchParams=ITn;var kTn=a(e=>{const t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(t.test(e)||e.toLowerCase()==="application/json-patch+json")},"isJsonMime");var DTn=a(function(e,t){const r=typeof e!=="string";const n=r?kTn(t.headers["Content-Type"]):r;return n?JSON.stringify(e!==void 0?e:{}):e||""},"serializeDataIfNeeded");eu.serializeDataIfNeeded=DTn;var LTn=a(function(e){return e.pathname+e.search+e.hash},"toPathString");eu.toPathString=LTn;function FTn(e){return e&&typeof e==="object"&&e.isAxiosError===true}a(FTn,"isAxiosError");function BTn(e,t){const r=Math.ceil(Math.pow(2,e)*t);const n=Math.ceil(Math.pow(2,e+1)*t);return Math.floor(Math.random()*(n-r)+r)}a(BTn,"randomTime");function GTt(e,t,r){var n;return SRe(this,void 0,void 0,function*(){let i=0;do{i++;try{return yield r(e)}catch(s){if(!FTn(s)){throw new iC.FgaError(s)}const o=(n=s===null||s===void 0?void 0:s.response)===null||n===void 0?void 0:n.status;if(o===400||o===422){throw new iC.FgaApiValidationError(s)}else if(o===401||o===403){throw new iC.FgaApiAuthenticationError(s)}else if(o===404){throw new iC.FgaApiNotFoundError(s)}else if(o===429||o>=500){if(i>=t.maxRetry){if(o===429){throw new iC.FgaApiRateLimitExceededError(s)}else{throw new iC.FgaApiInternalError(s)}}yield new Promise(u=>setTimeout(u,BTn(i,t.minWaitInMs)))}else{throw new iC.FgaApiError(s)}}}while(i<t.maxRetry+1)})}a(GTt,"attemptHttpRequest");eu.attemptHttpRequest=GTt;var MTn=a(function(e,t,r,n){var i,s;r.isValid();const o=((i=e.options)===null||i===void 0?void 0:i.retryParams)?(s=e.options)===null||s===void 0?void 0:s.retryParams:r.retryParams;const u=o?o.maxRetry:0;const l=o?o.minWaitInMs:0;if(!n){n=OTn.Credentials.init(r)}return(c=t)=>SRe(this,void 0,void 0,function*(){yield(0,eu.setBearerAuthToObject)(e.options.headers,n);const d=Object.assign(Object.assign({},e.options),{url:r.getBasePath()+e.url});const p=yield GTt(d,{maxRetry:u,minWaitInMs:l},c);const f=typeof(p===null||p===void 0?void 0:p.data)==="undefined"?{}:p===null||p===void 0?void 0:p.data;const m=Object.assign({},f);(0,PTn.setNotEnumerableProperty)(m,"$response",p);return m})},"createRequestFunction");eu.createRequestFunction=MTn});var VTt=y(pP=>{"use strict";var CRe=pP&&pP.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(pP,"__esModule",{value:true});pP.Credentials=void 0;var HTt=CJ();var VE=LF();var wRe=nC();var qTn=ARe();var Mf=TJ();var TRe=class e{static{a(this,"Credentials")}static init(t){return new e(t.credentials)}constructor(t,r=HTt.default){this.authConfig=t;this.axios=r;this.initConfig();this.isValid()}initConfig(){var t;switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Mf.CredentialsMethod.ApiToken:if(this.authConfig.config){if(!this.authConfig.config.headerName){this.authConfig.config.headerName="Authorization"}if(!this.authConfig.config.headerValuePrefix){this.authConfig.config.headerValuePrefix="Bearer"}}break;case Mf.CredentialsMethod.ClientCredentials:case Mf.CredentialsMethod.None:default:break}}isValid(){var t,r,n,i,s,o,u,l,c;const{authConfig:d}=this;switch(d===null||d===void 0?void 0:d.method){case Mf.CredentialsMethod.None:break;case Mf.CredentialsMethod.ApiToken:(0,VE.assertParamExists)("Credentials","config.token",(t=d.config)===null||t===void 0?void 0:t.token);(0,VE.assertParamExists)("Credentials","config.headerName",(r=d.config)===null||r===void 0?void 0:r.headerName);(0,VE.assertParamExists)("Credentials","config.headerName",(n=d.config)===null||n===void 0?void 0:n.headerName);break;case Mf.CredentialsMethod.ClientCredentials:(0,VE.assertParamExists)("Credentials","config.clientId",(i=d.config)===null||i===void 0?void 0:i.clientId);(0,VE.assertParamExists)("Credentials","config.clientSecret",(s=d.config)===null||s===void 0?void 0:s.clientSecret);(0,VE.assertParamExists)("Credentials","config.apiTokenIssuer",(o=d.config)===null||o===void 0?void 0:o.apiTokenIssuer);(0,VE.assertParamExists)("Credentials","config.apiAudience",(u=d.config)===null||u===void 0?void 0:u.apiAudience);if(!(0,VE.isWellFormedUriString)(`https://${(l=d.config)===null||l===void 0?void 0:l.apiTokenIssuer}`)){throw new wRe.FgaValidationError(`Configuration.apiTokenIssuer does not form a valid URI (https://${(c=d.config)===null||c===void 0?void 0:c.apiTokenIssuer})`)}break}}getAccessTokenHeader(){var t;return CRe(this,void 0,void 0,function*(){const r=yield this.getAccessTokenValue();switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Mf.CredentialsMethod.None:return;case Mf.CredentialsMethod.ApiToken:return{name:this.authConfig.config.headerName,value:`${this.authConfig.config.headerValuePrefix?`${this.authConfig.config.headerValuePrefix} `:""}${r}`};case Mf.CredentialsMethod.ClientCredentials:return{name:"Authorization",value:`Bearer ${r}`}}})}getAccessTokenValue(){var t;return CRe(this,void 0,void 0,function*(){switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Mf.CredentialsMethod.None:return;case Mf.CredentialsMethod.ApiToken:return this.authConfig.config.token;case Mf.CredentialsMethod.ClientCredentials:if(this.accessToken&&(!this.accessTokenExpiryDate||this.accessTokenExpiryDate>new Date)){return this.accessToken}return this.refreshAccessToken()}})}refreshAccessToken(){var t;return CRe(this,void 0,void 0,function*(){const r=(t=this.authConfig)===null||t===void 0?void 0:t.config;try{const n=yield(0,qTn.attemptHttpRequest)({url:`https://${r.apiTokenIssuer}/oauth/token`,method:"post",data:{client_id:r.clientId,client_secret:r.clientSecret,audience:r.apiAudience,grant_type:"client_credentials"}},{maxRetry:3,minWaitInMs:100},HTt.default);if(n){this.accessToken=n.data.access_token;this.accessTokenExpiryDate=new Date(Date.now()+n.data.expires_in*1e3)}return this.accessToken}catch(n){if(n instanceof wRe.FgaApiError){n.constructor=wRe.FgaApiAuthenticationError;n.name="FgaApiAuthenticationError";n.clientId=r.clientId;n.audience=r.apiAudience;n.grantType="client_credentials"}throw n}})}};pP.Credentials=TRe});var FJ=y(zE=>{"use strict";var UTn=zE&&zE.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var zTt=zE&&zE.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))UTn(t,e,r)};Object.defineProperty(zE,"__esModule",{value:true});zTt(VTt(),zE);zTt(TJ(),zE)});var RRe=y(BJ=>{"use strict";Object.defineProperty(BJ,"__esModule",{value:true});BJ.BaseAPI=void 0;var $Tn=CJ();var jTn=require("http");var GTn=require("https");var KTt=ERe();var HTn=FJ();var VTn=1e4;var xRe=class{static{a(this,"BaseAPI")}constructor(t,r){var n;this.axios=r;if(t instanceof KTt.Configuration){this.configuration=t}else{this.configuration=new KTt.Configuration(t)}this.configuration.isValid();this.credentials=HTn.Credentials.init(this.configuration);if(!this.axios){const i=new jTn.Agent({keepAlive:true});const s=new GTn.Agent({keepAlive:true});this.axios=$Tn.default.create({httpAgent:i,httpsAgent:s,timeout:VTn,headers:(n=this.configuration.baseOptions)===null||n===void 0?void 0:n.headers})}}get storeId(){return this.configuration.storeId}set storeId(t){this.configuration.storeId=t}};BJ.BaseAPI=xRe});var PRe=y(Ts=>{"use strict";var As=Ts&&Ts.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(Ts,"__esModule",{value:true});Ts.OpenFgaApi=Ts.OpenFgaApiFactory=Ts.OpenFgaApiFp=Ts.OpenFgaApiAxiosParamCreator=void 0;var Tc=CJ();var zTn=RRe();var sr=ARe();var za=LF();var KTn=a(function(e,t){return{check:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("check","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/check".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),createStore:(r,n={})=>As(this,void 0,void 0,function*(){const i="/stores";const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),deleteStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"DELETE"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),expand:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("expand","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/expand".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),getStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"GET"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),listObjects:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("listObjects","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/list-objects".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),listStores:(r,n,i={})=>As(this,void 0,void 0,function*(){const s="/stores";const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),read:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("read","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/read".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),readAssertions:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAssertions","authorizationModelId",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAuthorizationModel","id",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models/{id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModels:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),readChanges:(r,n,i,s={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const o="/stores/{store_id}/changes".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const u=new URL(o,sr.DUMMY_BASE_URL);let l;if(e){l=e.baseOptions}const c=Object.assign(Object.assign({method:"GET"},l),s);const d={};const p={};if(r!==void 0){p["type"]=r}if(n!==void 0){p["page_size"]=n}if(i!==void 0){p["continuation_token"]=i}(0,sr.setSearchParams)(u,p,s.query);c.headers=Object.assign(Object.assign({},d),s.headers);return{url:(0,sr.toPathString)(u),options:c}}),write:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("write","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/write".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),writeAssertions:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAssertions","authorizationModelId",r);(0,za.assertParamExists)("writeAssertions","body",n);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"PUT"},u),i);const c={};const d={};c["Content-Type"]="application/json";(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);l.data=(0,sr.serializeDataIfNeeded)(n,l);return{url:(0,sr.toPathString)(o),options:l}}),writeAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAuthorizationModel","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}})}},"OpenFgaApiAxiosParamCreator");Ts.OpenFgaApiAxiosParamCreator=KTn;var WTn=a(function(e,t){const r=(0,Ts.OpenFgaApiAxiosParamCreator)(e,t);return{check(n,i){return As(this,void 0,void 0,function*(){const s=yield r.check(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},createStore(n,i){return As(this,void 0,void 0,function*(){const s=yield r.createStore(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},deleteStore(n){return As(this,void 0,void 0,function*(){const i=yield r.deleteStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},expand(n,i){return As(this,void 0,void 0,function*(){const s=yield r.expand(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},getStore(n){return As(this,void 0,void 0,function*(){const i=yield r.getStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},listObjects(n,i){return As(this,void 0,void 0,function*(){const s=yield r.listObjects(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},listStores(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.listStores(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},read(n,i){return As(this,void 0,void 0,function*(){const s=yield r.read(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAssertions(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAssertions(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModels(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.readAuthorizationModels(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},readChanges(n,i,s,o){return As(this,void 0,void 0,function*(){const u=yield r.readChanges(n,i,s,o);return(0,sr.createRequestFunction)(u,Tc.default,e,t)})},write(n,i){return As(this,void 0,void 0,function*(){const s=yield r.write(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},writeAssertions(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.writeAssertions(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},writeAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.writeAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})}}},"OpenFgaApiFp");Ts.OpenFgaApiFp=WTn;var YTn=a(function(e,t,r){const n=(0,Ts.OpenFgaApiFp)(e,t);return{check(i,s){return n.check(i,s).then(o=>o(r))},createStore(i,s){return n.createStore(i,s).then(o=>o(r))},deleteStore(i){return n.deleteStore(i).then(s=>s(r))},expand(i,s){return n.expand(i,s).then(o=>o(r))},getStore(i){return n.getStore(i).then(s=>s(r))},listObjects(i,s){return n.listObjects(i,s).then(o=>o(r))},listStores(i,s,o){return n.listStores(i,s,o).then(u=>u(r))},read(i,s){return n.read(i,s).then(o=>o(r))},readAssertions(i,s){return n.readAssertions(i,s).then(o=>o(r))},readAuthorizationModel(i,s){return n.readAuthorizationModel(i,s).then(o=>o(r))},readAuthorizationModels(i,s,o){return n.readAuthorizationModels(i,s,o).then(u=>u(r))},readChanges(i,s,o,u){return n.readChanges(i,s,o,u).then(l=>l(r))},write(i,s){return n.write(i,s).then(o=>o(r))},writeAssertions(i,s,o){return n.writeAssertions(i,s,o).then(u=>u(r))},writeAuthorizationModel(i,s){return n.writeAuthorizationModel(i,s).then(o=>o(r))}}},"OpenFgaApiFactory");Ts.OpenFgaApiFactory=YTn;var ORe=class extends zTn.BaseAPI{static{a(this,"OpenFgaApi")}check(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).check(t,r).then(n=>n(this.axios))}createStore(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).createStore(t,r).then(n=>n(this.axios))}deleteStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).deleteStore(t).then(r=>r(this.axios))}expand(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).expand(t,r).then(n=>n(this.axios))}getStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).getStore(t).then(r=>r(this.axios))}listObjects(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listObjects(t,r).then(n=>n(this.axios))}listStores(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listStores(t,r,n).then(i=>i(this.axios))}read(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).read(t,r).then(n=>n(this.axios))}readAssertions(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAssertions(t,r).then(n=>n(this.axios))}readAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModel(t,r).then(n=>n(this.axios))}readAuthorizationModels(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModels(t,r,n).then(i=>i(this.axios))}readChanges(t,r,n,i){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readChanges(t,r,n,i).then(s=>s(this.axios))}write(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).write(t,r).then(n=>n(this.axios))}writeAssertions(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAssertions(t,r,n).then(i=>i(this.axios))}writeAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAuthorizationModel(t,r).then(n=>n(this.axios))}};Ts.OpenFgaApi=ORe});var YTt=y((T6s,WTt)=>{async function*XTn(e,t,r){const n=new Set;async function i(){const[s,o]=await Promise.race(n);n.delete(s);return o}a(i,"consume");for(const s of t){const o=(async()=>await r(s,t))().then(u=>[o,u]);n.add(o);if(n.size>=e){yield await i()}}while(n.size){yield await i()}}a(XTn,"asyncPool");WTt.exports=XTn});var XTt=y(ig=>{"use strict";var Ka=ig&&ig.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};var NRe=ig&&ig.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(u,l){o=e[s](o),i(u,l,o.done,o.value)})}}a(n,"verb");function i(s,o,u,l){Promise.resolve(l).then(function(c){s({value:c,done:u})},o)}a(i,"settle")};Object.defineProperty(ig,"__esModule",{value:true});ig.OpenFgaClient=ig.ClientWriteStatus=void 0;var IRe=YTt();var JTn=PRe();var QTn=RRe();var kRe=nC();var _d=bRe();var ZTn=LF();var DRe=10;var fP="X-OpenFGA-Client-Method";var LRe="X-OpenFGA-Client-Bulk-Request-Id";var mP;(function(e){e["SUCCESS"]="success";e["FAILURE"]="failure"})(mP||(ig.ClientWriteStatus=mP={}));var FRe=class extends QTn.BaseAPI{static{a(this,"OpenFgaClient")}constructor(t,r){super(t,r);this.axios=r;this.api=new JTn.OpenFgaApi(this.configuration,r);this.authorizationModelId=t.authorizationModelId;this.getAuthorizationModelId()}getAuthorizationModelId(t={}){const r=(t===null||t===void 0?void 0:t.authorizationModelId)||this.authorizationModelId;if(r&&!(0,ZTn.isWellFormedUlidString)(r)){throw new kRe.FgaValidationError("authorizationModelId")}return r}checkValidApiConnection(t={}){return Ka(this,void 0,void 0,function*(){if(this.getAuthorizationModelId(t)){yield this.readAuthorizationModel(t)}else{yield this.readLatestAuthorizationModel(t)}})}listStores(t={}){return Ka(this,void 0,void 0,function*(){return this.api.listStores(t.pageSize,t.continuationToken,t)})}createStore(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.createStore(t,r)})}getStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.getStore(t)})}deleteStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.deleteStore(t)})}readAuthorizationModels(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAuthorizationModels(t.pageSize,t.continuationToken,t)})}writeAuthorizationModel(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAuthorizationModel(t,r)})}readAuthorizationModel(t={}){return Ka(this,void 0,void 0,function*(){const r=this.getAuthorizationModelId(t);if(!r){throw new kRe.FgaRequiredParamError("ClientConfiguration","authorizationModelId")}return this.api.readAuthorizationModel(r,t)})}readLatestAuthorizationModel(t={}){var r;return Ka(this,void 0,void 0,function*(){const{headers:n={}}=t;(0,_d.setHeaderIfNotSet)(n,fP,"ReadLatestAuthorizationModel");const i=yield this.readAuthorizationModels(Object.assign(Object.assign({},t),{pageSize:1,headers:n}));const s=i;s.authorization_model=(r=i.authorization_models)===null||r===void 0?void 0:r[0];delete s.authorization_models;return s})}readChanges(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.readChanges(t.type,r.pageSize,r.continuationToken,r)})}read(t={},r={}){return Ka(this,void 0,void 0,function*(){const n={page_size:r.pageSize,continuation_token:r.continuationToken};if(t.user||t.object||t.relation){n.tuple_key=t}return this.api.read(n,r)})}write(t,r={}){return Ka(this,void 0,void 0,function*(){const{transaction:n={},headers:i={}}=r;const{maxPerChunk:s=1,maxParallelRequests:o=DRe}=n;const{writes:u,deletes:l}=t;const c=this.getAuthorizationModelId(r);if(!(n===null||n===void 0?void 0:n.disable)){const d={authorization_model_id:c};if(u===null||u===void 0?void 0:u.length){d.writes={tuple_keys:u}}if(l===null||l===void 0?void 0:l.length){d.deletes={tuple_keys:l}}yield this.api.write(d,r);return{writes:(u===null||u===void 0?void 0:u.map(p=>({tuple_key:p,status:mP.SUCCESS})))||[],deletes:(l===null||l===void 0?void 0:l.map(p=>({tuple_key:p,status:mP.SUCCESS})))||[]}}return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var d,p,f,m,h,g,_,v;(0,_d.setHeaderIfNotSet)(i,fP,"Write");(0,_d.setHeaderIfNotSet)(i,LRe,(0,_d.generateRandomIdWithNonUniqueFallback)());const S=[];if(u===null||u===void 0?void 0:u.length){try{for(var E=true,b=NRe(IRe(o,(0,_d.chunkArray)(u,s),R=>this.writeTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:R.map(D=>({tuple_key:D,status:mP.FAILURE,err:I})),deletes:[]})))),A;A=yield b.next(),d=A.done,!d;E=true){m=A.value;E=false;const R=m;S.push(R.writes)}}catch(R){p={error:R}}finally{try{if(!E&&!d&&(f=b.return))yield f.call(b)}finally{if(p)throw p.error}}}const C=[];if(l===null||l===void 0?void 0:l.length){try{for(var T=true,O=NRe(IRe(o,(0,_d.chunkArray)(l,s),R=>this.deleteTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:[],deletes:R.map(D=>({tuple_key:D,status:mP.FAILURE,err:I}))})))),P;P=yield O.next(),h=P.done,!h;T=true){v=P.value;T=false;const R=v;C.push(R.deletes)}}catch(R){g={error:R}}finally{try{if(!T&&!h&&(_=O.return))yield _.call(O)}finally{if(g)throw g.error}}}return{writes:S.flat(),deletes:C.flat()}}))(),this.checkValidApiConnection(r)]).then(d=>d[0])})}writeTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,_d.setHeaderIfNotSet)(n,fP,"WriteTuples");return this.write({writes:t},Object.assign(Object.assign({},r),{headers:n}))})}deleteTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,_d.setHeaderIfNotSet)(n,fP,"DeleteTuples");return this.write({deletes:t},Object.assign(Object.assign({},r),{headers:n}))})}check(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.check({tuple_key:{user:t.user,relation:t.relation,object:t.object},context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]},authorization_model_id:this.getAuthorizationModelId(r)},r)})}batchCheck(t,r={}){return Ka(this,void 0,void 0,function*(){return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var n,i,s,o;const{headers:u={},maxParallelRequests:l=DRe}=r;(0,_d.setHeaderIfNotSet)(u,fP,"BatchCheck");(0,_d.setHeaderIfNotSet)(u,LRe,(0,_d.generateRandomIdWithNonUniqueFallback)());const c=[];try{for(var d=true,p=NRe(IRe(l,t,m=>this.check(m,Object.assign(Object.assign({},r),{headers:u})).then(h=>{h._request=m;return h}).catch(h=>{return{allowed:void 0,error:h,_request:m}}))),f;f=yield p.next(),n=f.done,!n;d=true){o=f.value;d=false;const m=o;c.push(m)}}catch(m){i={error:m}}finally{try{if(!d&&!n&&(s=p.return))yield s.call(p)}finally{if(i)throw i.error}}return{responses:c}}))(),this.checkValidApiConnection(r)]).then(n=>n[0])})}expand(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.expand({authorization_model_id:this.getAuthorizationModelId(r),tuple_key:t},r)})}listObjects(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.listObjects({authorization_model_id:this.getAuthorizationModelId(r),user:t.user,relation:t.relation,type:t.type,context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]}},r)})}listRelations(t,r={}){return Ka(this,void 0,void 0,function*(){const{user:n,object:i,relations:s,contextualTuples:o,context:u}=t;const{headers:l={},maxParallelRequests:c=DRe}=r;(0,_d.setHeaderIfNotSet)(l,fP,"ListRelations");(0,_d.setHeaderIfNotSet)(l,LRe,(0,_d.generateRandomIdWithNonUniqueFallback)());if(!(s===null||s===void 0?void 0:s.length)){throw new kRe.FgaValidationError("relations","When calling listRelations, at least one relation must be passed in the relations field")}const d=yield this.batchCheck(s.map(f=>({user:n,relation:f,object:i,contextualTuples:o,context:u})),Object.assign(Object.assign({},r),{headers:l,maxParallelRequests:c}));const p=d.responses.find(f=>f.error);if(p){throw p.error}return{relations:d.responses.filter(f=>f.allowed).map(f=>f._request.relation)}})}readAssertions(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAssertions(this.getAuthorizationModelId(t),t)})}writeAssertions(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAssertions(this.getAuthorizationModelId(r),{assertions:t.map(n=>({tuple_key:{user:n.user,relation:n.relation,object:n.object},expectation:n.expectation}))},r)})}};ig.OpenFgaClient=FRe});var nxt=y(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:true});vd.TypeName=vd.TupleOperation=vd.NullValue=vd.NotFoundErrorCode=vd.InternalErrorCode=vd.ErrorCode=void 0;var JTt;(function(e){e["NoError"]="no_error";e["ValidationError"]="validation_error";e["AuthorizationModelNotFound"]="authorization_model_not_found";e["AuthorizationModelResolutionTooComplex"]="authorization_model_resolution_too_complex";e["InvalidWriteInput"]="invalid_write_input";e["CannotAllowDuplicateTuplesInOneRequest"]="cannot_allow_duplicate_tuples_in_one_request";e["CannotAllowDuplicateTypesInOneRequest"]="cannot_allow_duplicate_types_in_one_request";e["CannotAllowMultipleReferencesToOneRelation"]="cannot_allow_multiple_references_to_one_relation";e["InvalidContinuationToken"]="invalid_continuation_token";e["InvalidTupleSet"]="invalid_tuple_set";e["InvalidCheckInput"]="invalid_check_input";e["InvalidExpandInput"]="invalid_expand_input";e["UnsupportedUserSet"]="unsupported_user_set";e["InvalidObjectFormat"]="invalid_object_format";e["WriteFailedDueToInvalidInput"]="write_failed_due_to_invalid_input";e["AuthorizationModelAssertionsNotFound"]="authorization_model_assertions_not_found";e["LatestAuthorizationModelNotFound"]="latest_authorization_model_not_found";e["TypeNotFound"]="type_not_found";e["RelationNotFound"]="relation_not_found";e["EmptyRelationDefinition"]="empty_relation_definition";e["InvalidUser"]="invalid_user";e["InvalidTuple"]="invalid_tuple";e["UnknownRelation"]="unknown_relation";e["StoreIdInvalidLength"]="store_id_invalid_length";e["AssertionsTooManyItems"]="assertions_too_many_items";e["IdTooLong"]="id_too_long";e["AuthorizationModelIdTooLong"]="authorization_model_id_too_long";e["TupleKeyValueNotSpecified"]="tuple_key_value_not_specified";e["TupleKeysTooManyOrTooFewItems"]="tuple_keys_too_many_or_too_few_items";e["PageSizeInvalid"]="page_size_invalid";e["ParamMissingValue"]="param_missing_value";e["DifferenceBaseMissingValue"]="difference_base_missing_value";e["SubtractBaseMissingValue"]="subtract_base_missing_value";e["ObjectTooLong"]="object_too_long";e["RelationTooLong"]="relation_too_long";e["TypeDefinitionsTooFewItems"]="type_definitions_too_few_items";e["TypeInvalidLength"]="type_invalid_length";e["TypeInvalidPattern"]="type_invalid_pattern";e["RelationsTooFewItems"]="relations_too_few_items";e["RelationsTooLong"]="relations_too_long";e["RelationsInvalidPattern"]="relations_invalid_pattern";e["ObjectInvalidPattern"]="object_invalid_pattern";e["QueryStringTypeContinuationTokenMismatch"]="query_string_type_continuation_token_mismatch";e["ExceededEntityLimit"]="exceeded_entity_limit";e["InvalidContextualTuple"]="invalid_contextual_tuple";e["DuplicateContextualTuple"]="duplicate_contextual_tuple";e["InvalidAuthorizationModel"]="invalid_authorization_model";e["UnsupportedSchemaVersion"]="unsupported_schema_version"})(JTt||(vd.ErrorCode=JTt={}));var QTt;(function(e){e["NoInternalError"]="no_internal_error";e["InternalError"]="internal_error";e["Cancelled"]="cancelled";e["DeadlineExceeded"]="deadline_exceeded";e["AlreadyExists"]="already_exists";e["ResourceExhausted"]="resource_exhausted";e["FailedPrecondition"]="failed_precondition";e["Aborted"]="aborted";e["OutOfRange"]="out_of_range";e["Unavailable"]="unavailable";e["DataLoss"]="data_loss"})(QTt||(vd.InternalErrorCode=QTt={}));var ZTt;(function(e){e["NoNotFoundError"]="no_not_found_error";e["UndefinedEndpoint"]="undefined_endpoint";e["StoreIdNotFound"]="store_id_not_found";e["Unimplemented"]="unimplemented"})(ZTt||(vd.NotFoundErrorCode=ZTt={}));var ext;(function(e){e["NullValue"]="NULL_VALUE"})(ext||(vd.NullValue=ext={}));var txt;(function(e){e["Write"]="TUPLE_OPERATION_WRITE";e["Delete"]="TUPLE_OPERATION_DELETE"})(txt||(vd.TupleOperation=txt={}));var rxt;(function(e){e["Unspecified"]="TYPE_NAME_UNSPECIFIED";e["Any"]="TYPE_NAME_ANY";e["Bool"]="TYPE_NAME_BOOL";e["String"]="TYPE_NAME_STRING";e["Int"]="TYPE_NAME_INT";e["Uint"]="TYPE_NAME_UINT";e["Double"]="TYPE_NAME_DOUBLE";e["Duration"]="TYPE_NAME_DURATION";e["Timestamp"]="TYPE_NAME_TIMESTAMP";e["Map"]="TYPE_NAME_MAP";e["List"]="TYPE_NAME_LIST";e["Ipaddress"]="TYPE_NAME_IPADDRESS"})(rxt||(vd.TypeName=rxt={}))});var axt=y(Au=>{"use strict";var exn=Au&&Au.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var MJ=Au&&Au.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))exn(t,e,r)};Object.defineProperty(Au,"__esModule",{value:true});Au.CredentialsMethod=Au.Credentials=Au.GetDefaultRetryParams=Au.Configuration=void 0;MJ(PRe(),Au);MJ(XTt(),Au);MJ(nxt(),Au);var ixt=ERe();Object.defineProperty(Au,"Configuration",{enumerable:true,get:function(){return ixt.Configuration}});Object.defineProperty(Au,"GetDefaultRetryParams",{enumerable:true,get:function(){return ixt.GetDefaultRetryParams}});var sxt=FJ();Object.defineProperty(Au,"Credentials",{enumerable:true,get:function(){return sxt.Credentials}});Object.defineProperty(Au,"CredentialsMethod",{enumerable:true,get:function(){return sxt.CredentialsMethod}});MJ(nC(),Au)});var uxt=y(hP=>{"use strict";var txn=hP&&hP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(hP,"__esModule",{value:true});hP.OpenFGAService=void 0;var MF=txn(Zd());var oxt=axt();var rxn=QO();var BRe=class{static{a(this,"OpenFGAService")}logger;openFGAClient;baseUrl;apiHost;storeId;modelId;userSub;constructor(t,r){if(!MF.default.OPENFGA_SERVICE_URL){throw new Error("OPENFGA_SERVICE_URL is not set")}this.userSub=r&&r.userSub?r.userSub:t.getUserSub();this.baseUrl=MF.default.OPENFGA_SERVICE_URL;this.apiHost=MF.default.OPENFGA_SERVICE_URL.replace(/^(https:\/\/)/,"");this.storeId=MF.default.OPENFGA_STORE_ID;this.modelId=MF.default.OPENFGA_MODEL_ID;this.logger=t.log}async getOpenFgaClient(){if(!this.openFGAClient){const t=await(0,rxn.getServiceAccountIdToken)(this.baseUrl);this.openFGAClient=new oxt.OpenFgaClient({apiScheme:"https",apiHost:this.apiHost,storeId:this.storeId,authorizationModelId:this.modelId,credentials:{method:oxt.CredentialsMethod.ApiToken,config:{token:t}}})}return this.openFGAClient}async createAccountMember(t){try{const r=await this.getOpenFgaClient();await r.write({writes:[{user:`user:${this.userSub}`,relation:"admin",object:`account:${t}`}]})}catch(r){this.logger.warn(`RBAC failed to create account membership. Error: ${r.message}`)}}async getAccountMemberships(){const t=await this.getOpenFgaClient();const r=await t.listObjects({user:`user:${this.userSub}`,relation:"member",type:"account"});if(r){return r.objects.map(n=>n.replace(/^(account:)/,""))}return[]}async isAccountMember(t){try{const r=await this.getOpenFgaClient();const{allowed:n}=await r.check({user:`user:${this.userSub}`,relation:"member",object:`account:${t}`});if(!n){return false}return n}catch(r){this.logger.warn(`RBAC failed to check account membership. Error: ${r.message}`);return false}}async isZuploAdmin(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-admin"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo admin. Error: ${t.message}`);return false}}async isDeployerServiceAccount(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-deployer"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo deployer. Error: ${t.message}`);return false}}async createProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({writes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to create account-project association. Error: ${n.message}`)}}async deleteProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({deletes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to delete account-project association. Error: ${n.message}`)}}};hP.OpenFGAService=BRe});var dxt=y(gP=>{"use strict";var cxt=gP&&gP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(gP,"__esModule",{value:true});gP.TenantService=void 0;var nxn=cxt(Bm());var lxt=cxt(Zd());var ixn=CF();var sxn=new nxn.default({max:500,maxAge:1e3*60*50});var MRe=class extends ixn.ApiServiceClient{static{a(this,"TenantService")}constructor(t,r){if(!lxt.default.TENANT_API_URL){throw new Error("TENANT_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(lxt.default.TENANT_API_URL,sxn,{userSub:n,logger:t.log,requestId:t.id})}};gP.TenantService=MRe});var fxt=y(yP=>{"use strict";var pxt=yP&&yP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(yP,"__esModule",{value:true});yP.MeteringService=void 0;var axn=pxt(Bm());var qRe=pxt(Zd());var oxn=CF();var uxn=new axn.default({max:500,maxAge:1e3*60*50});var URe=class extends oxn.ApiServiceClient{static{a(this,"MeteringService")}constructor(t,r){if(!qRe.default.METERING_SERVICE_URL){throw new Error("METERING_SERVICE_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(qRe.default.METERING_SERVICE_URL,uxn,{userSub:n,logger:t.log,requestId:t.id,targetAudience:qRe.default.METERING_SERVICE_URL})}};yP.MeteringService=URe});var mxt=y(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:true});sg.validateHostname=sg.kebabCase=sg.snakeCase=sg.sizeInBytes=void 0;function lxn(e){return new TextEncoder().encode(JSON.stringify(e)).length}a(lxn,"sizeInBytes");sg.sizeInBytes=lxn;function cxn(e){if(!e||e===null){return""}return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(t=>t.toLowerCase()).join("_")}a(cxn,"snakeCase");sg.snakeCase=cxn;function dxn(e){if(!e||e===null){return""}const t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);if(t===null){return""}return t.map(r=>r.toLowerCase()).join("-")}a(dxn,"kebabCase");sg.kebabCase=dxn;function pxn(e){try{const t=/^(?!https?:\/\/)([a-zA-Z0-9.-]*|(\*))*\.[a-zA-Z]+$/;if(e&&!t.test(e)){return false}return true}catch(t){}return false}a(pxn,"validateHostname");sg.validateHostname=pxn});var yxt=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:true});_e.Type=_e.JsonType=_e.JavaScriptTypeBuilder=_e.JsonTypeBuilder=_e.TypeBuilder=_e.TypeBuilderError=_e.TransformEncodeBuilder=_e.TransformDecodeBuilder=_e.TemplateLiteralDslParser=_e.TemplateLiteralGenerator=_e.TemplateLiteralGeneratorError=_e.TemplateLiteralFinite=_e.TemplateLiteralFiniteError=_e.TemplateLiteralParser=_e.TemplateLiteralParserError=_e.TemplateLiteralResolver=_e.TemplateLiteralPattern=_e.TemplateLiteralPatternError=_e.UnionResolver=_e.KeyArrayResolver=_e.KeyArrayResolverError=_e.KeyResolver=_e.ObjectMap=_e.Intrinsic=_e.IndexedAccessor=_e.TypeClone=_e.TypeExtends=_e.TypeExtendsResult=_e.TypeExtendsError=_e.ExtendsUndefined=_e.TypeGuard=_e.TypeGuardUnknownTypeError=_e.ValueGuard=_e.FormatRegistry=_e.TypeBoxError=_e.TypeRegistry=_e.PatternStringExact=_e.PatternNumberExact=_e.PatternBooleanExact=_e.PatternString=_e.PatternNumber=_e.PatternBoolean=_e.Kind=_e.Hint=_e.Optional=_e.Readonly=_e.Transform=void 0;_e.Transform=Symbol.for("TypeBox.Transform");_e.Readonly=Symbol.for("TypeBox.Readonly");_e.Optional=Symbol.for("TypeBox.Optional");_e.Hint=Symbol.for("TypeBox.Hint");_e.Kind=Symbol.for("TypeBox.Kind");_e.PatternBoolean="(true|false)";_e.PatternNumber="(0|[1-9][0-9]*)";_e.PatternString="(.*)";_e.PatternBooleanExact=`^${_e.PatternBoolean}$`;_e.PatternNumberExact=`^${_e.PatternNumber}$`;_e.PatternStringExact=`^${_e.PatternString}$`;var $Re;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})($Re||(_e.TypeRegistry=$Re={}));var gh=class extends Error{static{a(this,"TypeBoxError")}constructor(t){super(t)}};_e.TypeBoxError=gh;var hxt;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})(hxt||(_e.FormatRegistry=hxt={}));var Jt;(function(e){function t(c){return Array.isArray(c)}a(t,"IsArray");e.IsArray=t;function r(c){return typeof c==="bigint"}a(r,"IsBigInt");e.IsBigInt=r;function n(c){return typeof c==="boolean"}a(n,"IsBoolean");e.IsBoolean=n;function i(c){return c===null}a(i,"IsNull");e.IsNull=i;function s(c){return typeof c==="number"}a(s,"IsNumber");e.IsNumber=s;function o(c){return typeof c==="object"&&c!==null}a(o,"IsObject");e.IsObject=o;function u(c){return typeof c==="string"}a(u,"IsString");e.IsString=u;function l(c){return c===void 0}a(l,"IsUndefined");e.IsUndefined=l})(Jt||(_e.ValueGuard=Jt={}));var jRe=class extends gh{static{a(this,"TypeGuardUnknownTypeError")}};_e.TypeGuardUnknownTypeError=jRe;var Ee;(function(e){function t(L){try{new RegExp(L);return true}catch{return false}}a(t,"IsPattern");function r(L){if(!Jt.IsString(L))return false;for(let Se=0;Se<L.length;Se++){const Le=L.charCodeAt(Se);if(Le>=7&&Le<=13||Le===27||Le===127){return false}}return true}a(r,"IsControlCharacterFree");function n(L){return o(L)||se(L)}a(n,"IsAdditionalProperties");function i(L){return Jt.IsUndefined(L)||Jt.IsBigInt(L)}a(i,"IsOptionalBigInt");function s(L){return Jt.IsUndefined(L)||Jt.IsNumber(L)}a(s,"IsOptionalNumber");function o(L){return Jt.IsUndefined(L)||Jt.IsBoolean(L)}a(o,"IsOptionalBoolean");function u(L){return Jt.IsUndefined(L)||Jt.IsString(L)}a(u,"IsOptionalString");function l(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)&&t(L)}a(l,"IsOptionalPattern");function c(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)}a(c,"IsOptionalFormat");function d(L){return Jt.IsUndefined(L)||se(L)}a(d,"IsOptionalSchema");function p(L){return C(L,"Any")&&u(L.$id)}a(p,"TAny");e.TAny=p;function f(L){return C(L,"Array")&&L.type==="array"&&u(L.$id)&&se(L.items)&&s(L.minItems)&&s(L.maxItems)&&o(L.uniqueItems)&&d(L.contains)&&s(L.minContains)&&s(L.maxContains)}a(f,"TArray");e.TArray=f;function m(L){return C(L,"AsyncIterator")&&L.type==="AsyncIterator"&&u(L.$id)&&se(L.items)}a(m,"TAsyncIterator");e.TAsyncIterator=m;function h(L){return C(L,"BigInt")&&L.type==="bigint"&&u(L.$id)&&i(L.exclusiveMaximum)&&i(L.exclusiveMinimum)&&i(L.maximum)&&i(L.minimum)&&i(L.multipleOf)}a(h,"TBigInt");e.TBigInt=h;function g(L){return C(L,"Boolean")&&L.type==="boolean"&&u(L.$id)}a(g,"TBoolean");e.TBoolean=g;function _(L){return C(L,"Constructor")&&L.type==="constructor"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(_,"TConstructor");e.TConstructor=_;function v(L){return C(L,"Date")&&L.type==="Date"&&u(L.$id)&&s(L.exclusiveMaximumTimestamp)&&s(L.exclusiveMinimumTimestamp)&&s(L.maximumTimestamp)&&s(L.minimumTimestamp)&&s(L.multipleOfTimestamp)}a(v,"TDate");e.TDate=v;function S(L){return C(L,"Function")&&L.type==="function"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(S,"TFunction");e.TFunction=S;function E(L){return C(L,"Integer")&&L.type==="integer"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(E,"TInteger");e.TInteger=E;function b(L){return C(L,"Intersect")&&(Jt.IsString(L.type)&&L.type!=="object"?false:true)&&Jt.IsArray(L.allOf)&&L.allOf.every(Se=>se(Se)&&!De(Se))&&u(L.type)&&(o(L.unevaluatedProperties)||d(L.unevaluatedProperties))&&u(L.$id)}a(b,"TIntersect");e.TIntersect=b;function A(L){return C(L,"Iterator")&&L.type==="Iterator"&&u(L.$id)&&se(L.items)}a(A,"TIterator");e.TIterator=A;function C(L,Se){return T(L)&&L[_e.Kind]===Se}a(C,"TKindOf");e.TKindOf=C;function T(L){return Jt.IsObject(L)&&_e.Kind in L&&Jt.IsString(L[_e.Kind])}a(T,"TKind");e.TKind=T;function O(L){return I(L)&&Jt.IsString(L.const)}a(O,"TLiteralString");e.TLiteralString=O;function P(L){return I(L)&&Jt.IsNumber(L.const)}a(P,"TLiteralNumber");e.TLiteralNumber=P;function R(L){return I(L)&&Jt.IsBoolean(L.const)}a(R,"TLiteralBoolean");e.TLiteralBoolean=R;function I(L){return C(L,"Literal")&&u(L.$id)&&(Jt.IsBoolean(L.const)||Jt.IsNumber(L.const)||Jt.IsString(L.const))}a(I,"TLiteral");e.TLiteral=I;function D(L){return C(L,"Never")&&Jt.IsObject(L.not)&&Object.getOwnPropertyNames(L.not).length===0}a(D,"TNever");e.TNever=D;function U(L){return C(L,"Not")&&se(L.not)}a(U,"TNot");e.TNot=U;function te(L){return C(L,"Null")&&L.type==="null"&&u(L.$id)}a(te,"TNull");e.TNull=te;function ve(L){return C(L,"Number")&&L.type==="number"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(ve,"TNumber");e.TNumber=ve;function me(L){return C(L,"Object")&&L.type==="object"&&u(L.$id)&&Jt.IsObject(L.properties)&&n(L.additionalProperties)&&s(L.minProperties)&&s(L.maxProperties)&&Object.entries(L.properties).every(([Se,Le])=>r(Se)&&se(Le))}a(me,"TObject");e.TObject=me;function he(L){return C(L,"Promise")&&L.type==="Promise"&&u(L.$id)&&se(L.item)}a(he,"TPromise");e.TPromise=he;function Fe(L){return C(L,"Record")&&L.type==="object"&&u(L.$id)&&n(L.additionalProperties)&&Jt.IsObject(L.patternProperties)&&(Se=>{const Le=Object.getOwnPropertyNames(Se.patternProperties);return Le.length===1&&t(Le[0])&&Jt.IsObject(Se.patternProperties)&&se(Se.patternProperties[Le[0]])})(L)}a(Fe,"TRecord");e.TRecord=Fe;function Oe(L){return Jt.IsObject(L)&&_e.Hint in L&&L[_e.Hint]==="Recursive"}a(Oe,"TRecursive");e.TRecursive=Oe;function M(L){return C(L,"Ref")&&u(L.$id)&&Jt.IsString(L.$ref)}a(M,"TRef");e.TRef=M;function Q(L){return C(L,"String")&&L.type==="string"&&u(L.$id)&&s(L.minLength)&&s(L.maxLength)&&l(L.pattern)&&c(L.format)}a(Q,"TString");e.TString=Q;function fe(L){return C(L,"Symbol")&&L.type==="symbol"&&u(L.$id)}a(fe,"TSymbol");e.TSymbol=fe;function B(L){return C(L,"TemplateLiteral")&&L.type==="string"&&Jt.IsString(L.pattern)&&L.pattern[0]==="^"&&L.pattern[L.pattern.length-1]==="$"}a(B,"TTemplateLiteral");e.TTemplateLiteral=B;function ye(L){return C(L,"This")&&u(L.$id)&&Jt.IsString(L.$ref)}a(ye,"TThis");e.TThis=ye;function De(L){return Jt.IsObject(L)&&_e.Transform in L}a(De,"TTransform");e.TTransform=De;function $e(L){return C(L,"Tuple")&&L.type==="array"&&u(L.$id)&&Jt.IsNumber(L.minItems)&&Jt.IsNumber(L.maxItems)&&L.minItems===L.maxItems&&(Jt.IsUndefined(L.items)&&Jt.IsUndefined(L.additionalItems)&&L.minItems===0||Jt.IsArray(L.items)&&L.items.every(Se=>se(Se)))}a($e,"TTuple");e.TTuple=$e;function gt(L){return C(L,"Undefined")&&L.type==="undefined"&&u(L.$id)}a(gt,"TUndefined");e.TUndefined=gt;function ut(L){return F(L)&&L.anyOf.every(Se=>O(Se)||P(Se))}a(ut,"TUnionLiteral");e.TUnionLiteral=ut;function F(L){return C(L,"Union")&&u(L.$id)&&Jt.IsObject(L)&&Jt.IsArray(L.anyOf)&&L.anyOf.every(Se=>se(Se))}a(F,"TUnion");e.TUnion=F;function G(L){return C(L,"Uint8Array")&&L.type==="Uint8Array"&&u(L.$id)&&s(L.minByteLength)&&s(L.maxByteLength)}a(G,"TUint8Array");e.TUint8Array=G;function $(L){return C(L,"Unknown")&&u(L.$id)}a($,"TUnknown");e.TUnknown=$;function W(L){return C(L,"Unsafe")}a(W,"TUnsafe");e.TUnsafe=W;function pe(L){return C(L,"Void")&&L.type==="void"&&u(L.$id)}a(pe,"TVoid");e.TVoid=pe;function H(L){return Jt.IsObject(L)&&L[_e.Readonly]==="Readonly"}a(H,"TReadonly");e.TReadonly=H;function de(L){return Jt.IsObject(L)&&L[_e.Optional]==="Optional"}a(de,"TOptional");e.TOptional=de;function se(L){return Jt.IsObject(L)&&(p(L)||f(L)||g(L)||h(L)||m(L)||_(L)||v(L)||S(L)||E(L)||b(L)||A(L)||I(L)||D(L)||U(L)||te(L)||ve(L)||me(L)||he(L)||Fe(L)||M(L)||Q(L)||fe(L)||B(L)||ye(L)||$e(L)||gt(L)||F(L)||G(L)||$(L)||W(L)||pe(L)||T(L)&&$Re.Has(L[_e.Kind]))}a(se,"TSchema");e.TSchema=se})(Ee||(_e.TypeGuard=Ee={}));var gxt;(function(e){function t(r){return r[_e.Kind]==="Intersect"?r.allOf.every(n=>t(n)):r[_e.Kind]==="Union"?r.anyOf.some(n=>t(n)):r[_e.Kind]==="Undefined"?true:r[_e.Kind]==="Not"?!t(r.not):false}a(t,"Check");e.Check=t})(gxt||(_e.ExtendsUndefined=gxt={}));var qJ=class extends gh{static{a(this,"TypeExtendsError")}};_e.TypeExtendsError=qJ;var at;(function(e){e[e["Union"]=0]="Union";e[e["True"]=1]="True";e[e["False"]=2]="False"})(at||(_e.TypeExtendsResult=at={}));var sC;(function(e){function t(N){return N===at.False?N:at.True}a(t,"IntoBooleanResult");function r(N){throw new qJ(N)}a(r,"Throw");function n(N){return Ee.TNever(N)||Ee.TIntersect(N)||Ee.TUnion(N)||Ee.TUnknown(N)||Ee.TAny(N)}a(n,"IsStructuralRight");function i(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):r("StructuralRight")}a(i,"StructuralRight");function s(N,k){return at.True}a(s,"TAnyRight");function o(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)&&k.anyOf.some(Ae=>Ee.TAny(Ae)||Ee.TUnknown(Ae))?at.True:Ee.TUnion(k)?at.Union:Ee.TUnknown(k)?at.True:Ee.TAny(k)?at.True:at.Union}a(o,"TAny");function u(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)?at.True:at.False}a(u,"TArrayRight");function l(N,k){return Ee.TObject(k)&&B(k)?at.True:n(k)?i(N,k):!Ee.TArray(k)?at.False:t(J(N.items,k.items))}a(l,"TArray");function c(N,k){return n(k)?i(N,k):!Ee.TAsyncIterator(k)?at.False:t(J(N.items,k.items))}a(c,"TAsyncIterator");function d(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBigInt(k)?at.True:at.False}a(d,"TBigInt");function p(N,k){return Ee.TLiteral(N)&&Jt.IsBoolean(N.const)?at.True:Ee.TBoolean(N)?at.True:at.False}a(p,"TBooleanRight");function f(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBoolean(k)?at.True:at.False}a(f,"TBoolean");function m(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TConstructor(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(m,"TConstructor");function h(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TDate(k)?at.True:at.False}a(h,"TDate");function g(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TFunction(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(g,"TFunction");function _(N,k){return Ee.TLiteral(N)&&Jt.IsNumber(N.const)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(_,"TIntegerRight");function v(N,k){return Ee.TInteger(k)||Ee.TNumber(k)?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):at.False}a(v,"TInteger");function S(N,k){return k.allOf.every(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(S,"TIntersectRight");function E(N,k){return N.allOf.some(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(E,"TIntersect");function b(N,k){return n(k)?i(N,k):!Ee.TIterator(k)?at.False:t(J(N.items,k.items))}a(b,"TIterator");function A(N,k){return Ee.TLiteral(k)&&k.const===N.const?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):at.False}a(A,"TLiteral");function C(N,k){return at.False}a(C,"TNeverRight");function T(N,k){return at.True}a(T,"TNever");function O(N){let[k,Ae]=[N,0];while(true){if(!Ee.TNot(k))break;k=k.not;Ae+=1}return Ae%2===0?k:_e.Type.Unknown()}a(O,"UnwrapTNot");function P(N,k){return Ee.TNot(N)?J(O(N),k):Ee.TNot(k)?J(N,O(k)):r("Invalid fallthrough for Not")}a(P,"TNot");function R(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TNull(k)?at.True:at.False}a(R,"TNull");function I(N,k){return Ee.TLiteralNumber(N)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(I,"TNumberRight");function D(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TInteger(k)||Ee.TNumber(k)?at.True:at.False}a(D,"TNumber");function U(N,k){return Object.getOwnPropertyNames(N.properties).length===k}a(U,"IsObjectPropertyCount");function te(N){return B(N)}a(te,"IsObjectStringLike");function ve(N){return U(N,0)||U(N,1)&&"description"in N.properties&&Ee.TUnion(N.properties.description)&&N.properties.description.anyOf.length===2&&(Ee.TString(N.properties.description.anyOf[0])&&Ee.TUndefined(N.properties.description.anyOf[1])||Ee.TString(N.properties.description.anyOf[1])&&Ee.TUndefined(N.properties.description.anyOf[0]))}a(ve,"IsObjectSymbolLike");function me(N){return U(N,0)}a(me,"IsObjectNumberLike");function he(N){return U(N,0)}a(he,"IsObjectBooleanLike");function Fe(N){return U(N,0)}a(Fe,"IsObjectBigIntLike");function Oe(N){return U(N,0)}a(Oe,"IsObjectDateLike");function M(N){return B(N)}a(M,"IsObjectUint8ArrayLike");function Q(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(Q,"IsObjectFunctionLike");function fe(N){return U(N,0)}a(fe,"IsObjectConstructorLike");function B(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(B,"IsObjectArrayLike");function ye(N){const k=_e.Type.Function([_e.Type.Any()],_e.Type.Any());return U(N,0)||U(N,1)&&"then"in N.properties&&t(J(N.properties["then"],k))===at.True}a(ye,"IsObjectPromiseLike");function De(N,k){return J(N,k)===at.False?at.False:Ee.TOptional(N)&&!Ee.TOptional(k)?at.False:at.True}a(De,"Property");function $e(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)||Ee.TLiteralString(N)&&te(k)||Ee.TLiteralNumber(N)&&me(k)||Ee.TLiteralBoolean(N)&&he(k)||Ee.TSymbol(N)&&ve(k)||Ee.TBigInt(N)&&Fe(k)||Ee.TString(N)&&te(k)||Ee.TSymbol(N)&&ve(k)||Ee.TNumber(N)&&me(k)||Ee.TInteger(N)&&me(k)||Ee.TBoolean(N)&&he(k)||Ee.TUint8Array(N)&&M(k)||Ee.TDate(N)&&Oe(k)||Ee.TConstructor(N)&&fe(k)||Ee.TFunction(N)&&Q(k)?at.True:Ee.TRecord(N)&&Ee.TString(F(N))?(()=>{return k[_e.Hint]==="Record"?at.True:at.False})():Ee.TRecord(N)&&Ee.TNumber(F(N))?(()=>{return U(k,0)?at.True:at.False})():at.False}a($e,"TObjectRight");function gt(N,k){return n(k)?i(N,k):Ee.TRecord(k)?$(N,k):!Ee.TObject(k)?at.False:(()=>{for(const Ae of Object.getOwnPropertyNames(k.properties)){if(!(Ae in N.properties))return at.False;if(De(N.properties[Ae],k.properties[Ae])===at.False){return at.False}}return at.True})()}a(gt,"TObject");function ut(N,k){return n(k)?i(N,k):Ee.TObject(k)&&ye(k)?at.True:!Ee.TPromise(k)?at.False:t(J(N.item,k.item))}a(ut,"TPromise");function F(N){return _e.PatternNumberExact in N.patternProperties?_e.Type.Number():_e.PatternStringExact in N.patternProperties?_e.Type.String():r("Unknown record key pattern")}a(F,"RecordKey");function G(N){return _e.PatternNumberExact in N.patternProperties?N.patternProperties[_e.PatternNumberExact]:_e.PatternStringExact in N.patternProperties?N.patternProperties[_e.PatternStringExact]:r("Unable to get record value schema")}a(G,"RecordValue");function $(N,k){const[Ae,Be]=[F(k),G(k)];return Ee.TLiteralString(N)&&Ee.TNumber(Ae)&&t(J(N,Be))===at.True?at.True:Ee.TUint8Array(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TString(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TArray(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TObject(N)?(()=>{for(const et of Object.getOwnPropertyNames(N.properties)){if(De(Be,N.properties[et])===at.False){return at.False}}return at.True})():at.False}a($,"TRecordRight");function W(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TRecord(k)?at.False:J(G(N),G(k))}a(W,"TRecord");function pe(N,k){return Ee.TLiteral(N)&&Jt.IsString(N.const)?at.True:Ee.TString(N)?at.True:at.False}a(pe,"TStringRight");function H(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?at.True:at.False}a(H,"TString");function de(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TSymbol(k)?at.True:at.False}a(de,"TSymbol");function se(N,k){return Ee.TTemplateLiteral(N)?J(xy.Resolve(N),k):Ee.TTemplateLiteral(k)?J(N,xy.Resolve(k)):r("Invalid fallthrough for TemplateLiteral")}a(se,"TTemplateLiteral");function L(N,k){return Ee.TArray(k)&&N.items!==void 0&&N.items.every(Ae=>J(Ae,k.items)===at.True)}a(L,"IsArrayOfTuple");function Se(N,k){return Ee.TNever(N)?at.True:Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:at.False}a(Se,"TTupleRight");function Le(N,k){return n(k)?i(N,k):Ee.TObject(k)&&B(k)?at.True:Ee.TArray(k)&&L(N,k)?at.True:!Ee.TTuple(k)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)||!Jt.IsUndefined(N.items)&&Jt.IsUndefined(k.items)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)?at.True:N.items.every((Ae,Be)=>J(Ae,k.items[Be])===at.True)?at.True:at.False}a(Le,"TTuple");function Ke(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TUint8Array(k)?at.True:at.False}a(Ke,"TUint8Array");function St(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TVoid(k)?j(N,k):Ee.TUndefined(k)?at.True:at.False}a(St,"TUndefined");function Mt(N,k){return k.anyOf.some(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(Mt,"TUnionRight");function _r(N,k){return N.anyOf.every(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(_r,"TUnion");function Ur(N,k){return at.True}a(Ur,"TUnknownRight");function Ve(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TAny(k)?s(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):Ee.TArray(k)?u(N,k):Ee.TTuple(k)?Se(N,k):Ee.TObject(k)?$e(N,k):Ee.TUnknown(k)?at.True:at.False}a(Ve,"TUnknown");function j(N,k){return Ee.TUndefined(N)?at.True:Ee.TUndefined(N)?at.True:at.False}a(j,"VoidRight");function q(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):Ee.TObject(k)?$e(N,k):Ee.TVoid(k)?at.True:at.False}a(q,"TVoid");function J(N,k){return Ee.TTemplateLiteral(N)||Ee.TTemplateLiteral(k)?se(N,k):Ee.TNot(N)||Ee.TNot(k)?P(N,k):Ee.TAny(N)?o(N,k):Ee.TArray(N)?l(N,k):Ee.TBigInt(N)?d(N,k):Ee.TBoolean(N)?f(N,k):Ee.TAsyncIterator(N)?c(N,k):Ee.TConstructor(N)?m(N,k):Ee.TDate(N)?h(N,k):Ee.TFunction(N)?g(N,k):Ee.TInteger(N)?v(N,k):Ee.TIntersect(N)?E(N,k):Ee.TIterator(N)?b(N,k):Ee.TLiteral(N)?A(N,k):Ee.TNever(N)?T(N,k):Ee.TNull(N)?R(N,k):Ee.TNumber(N)?D(N,k):Ee.TObject(N)?gt(N,k):Ee.TRecord(N)?W(N,k):Ee.TString(N)?H(N,k):Ee.TSymbol(N)?de(N,k):Ee.TTuple(N)?Le(N,k):Ee.TPromise(N)?ut(N,k):Ee.TUint8Array(N)?Ke(N,k):Ee.TUndefined(N)?St(N,k):Ee.TUnion(N)?_r(N,k):Ee.TUnknown(N)?Ve(N,k):Ee.TVoid(N)?q(N,k):r(`Unknown left type operand '${N[_e.Kind]}'`)}a(J,"Visit");function ae(N,k){return J(N,k)}a(ae,"Extends");e.Extends=ae})(sC||(_e.TypeExtends=sC={}));var Rr;(function(e){function t(o){const u=Object.getOwnPropertyNames(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});const l=Object.getOwnPropertySymbols(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});return{...u,...l}}a(t,"ObjectType");function r(o){return o.map(u=>n(u))}a(r,"ArrayType");function n(o){return Jt.IsArray(o)?r(o):Jt.IsObject(o)?t(o):o}a(n,"Visit");function i(o){return o.map(u=>s(u))}a(i,"Rest");e.Rest=i;function s(o,u={}){return{...n(o),...u}}a(s,"Type");e.Type=s})(Rr||(_e.TypeClone=Rr={}));var GRe;(function(e){function t(m){return m.map(h=>{const{[_e.Optional]:g,..._}=Rr.Type(h);return _})}a(t,"OptionalUnwrap");function r(m){return m.every(h=>Ee.TOptional(h))}a(r,"IsIntersectOptional");function n(m){return m.some(h=>Ee.TOptional(h))}a(n,"IsUnionOptional");function i(m){return r(m.allOf)?_e.Type.Optional(_e.Type.Intersect(t(m.allOf))):m}a(i,"ResolveIntersect");function s(m){return n(m.anyOf)?_e.Type.Optional(_e.Type.Union(t(m.anyOf))):m}a(s,"ResolveUnion");function o(m){return m[_e.Kind]==="Intersect"?i(m):m[_e.Kind]==="Union"?s(m):m}a(o,"ResolveOptional");function u(m,h){const g=m.allOf.reduce((_,v)=>{const S=p(v,h);return S[_e.Kind]==="Never"?_:[..._,S]},[]);return o(_e.Type.Intersect(g))}a(u,"TIntersect");function l(m,h){const g=m.anyOf.map(_=>p(_,h));return o(_e.Type.Union(g))}a(l,"TUnion");function c(m,h){const g=m.properties[h];return Jt.IsUndefined(g)?_e.Type.Never():_e.Type.Union([g])}a(c,"TObject");function d(m,h){const g=m.items;if(Jt.IsUndefined(g))return _e.Type.Never();const _=g[h];if(Jt.IsUndefined(_))return _e.Type.Never();return _}a(d,"TTuple");function p(m,h){return m[_e.Kind]==="Intersect"?u(m,h):m[_e.Kind]==="Union"?l(m,h):m[_e.Kind]==="Object"?c(m,h):m[_e.Kind]==="Tuple"?d(m,h):_e.Type.Never()}a(p,"Visit");function f(m,h,g={}){const _=h.map(v=>p(m,v.toString()));return o(_e.Type.Union(_,g))}a(f,"Resolve");e.Resolve=f})(GRe||(_e.IndexedAccessor=GRe={}));var _P;(function(e){function t(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toLowerCase()}${f}`}a(t,"Uncapitalize");function r(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toUpperCase()}${f}`}a(r,"Capitalize");function n(d){return d.toUpperCase()}a(n,"Uppercase");function i(d){return d.toLowerCase()}a(i,"Lowercase");function s(d,p){const f=EP.ParseExact(d.pattern);const m=bP.Check(f);if(!m)return{...d,pattern:o(d.pattern,p)};const h=[...SP.Generate(f)];const g=h.map(S=>_e.Type.Literal(S));const _=u(g,p);const v=_e.Type.Union(_);return _e.Type.TemplateLiteral([v])}a(s,"IntrinsicTemplateLiteral");function o(d,p){return typeof d==="string"?p==="Uncapitalize"?t(d):p==="Capitalize"?r(d):p==="Uppercase"?n(d):p==="Lowercase"?i(d):d:d.toString()}a(o,"IntrinsicLiteral");function u(d,p){if(d.length===0)return[];const[f,...m]=d;return[c(f,p),...u(m,p)]}a(u,"IntrinsicRest");function l(d,p){return Ee.TTemplateLiteral(d)?s(d,p):Ee.TUnion(d)?_e.Type.Union(u(d.anyOf,p)):Ee.TLiteral(d)?_e.Type.Literal(o(d.const,p)):d}a(l,"Visit");function c(d,p){return l(d,p)}a(c,"Map");e.Map=c})(_P||(_e.Intrinsic=_P={}));var vP;(function(e){function t(o,u){return _e.Type.Intersect(o.allOf.map(l=>i(l,u)),{...o})}a(t,"TIntersect");function r(o,u){return _e.Type.Union(o.anyOf.map(l=>i(l,u)),{...o})}a(r,"TUnion");function n(o,u){return u(o)}a(n,"TObject");function i(o,u){return o[_e.Kind]==="Intersect"?t(o,u):o[_e.Kind]==="Union"?r(o,u):o[_e.Kind]==="Object"?n(o,u):o}a(i,"Visit");function s(o,u,l){return{...i(Rr.Type(o),u),...l}}a(s,"Map");e.Map=s})(vP||(_e.ObjectMap=vP={}));var UJ;(function(e){function t(c){return c[0]==="^"&&c[c.length-1]==="$"?c.slice(1,c.length-1):c}a(t,"UnwrapPattern");function r(c,d){return c.allOf.reduce((p,f)=>[...p,...o(f,d)],[])}a(r,"TIntersect");function n(c,d){const p=c.anyOf.map(f=>o(f,d));return[...p.reduce((f,m)=>m.map(h=>p.every(g=>g.includes(h))?f.add(h):f)[0],new Set)]}a(n,"TUnion");function i(c,d){return Object.getOwnPropertyNames(c.properties)}a(i,"TObject");function s(c,d){return d.includePatterns?Object.getOwnPropertyNames(c.patternProperties):[]}a(s,"TRecord");function o(c,d){return Ee.TIntersect(c)?r(c,d):Ee.TUnion(c)?n(c,d):Ee.TObject(c)?i(c,d):Ee.TRecord(c)?s(c,d):[]}a(o,"Visit");function u(c,d){return[...new Set(o(c,d))]}a(u,"ResolveKeys");e.ResolveKeys=u;function l(c){const d=u(c,{includePatterns:true});const p=d.map(f=>`(${t(f)})`);return`^(${p.join("|")})$`}a(l,"ResolvePattern");e.ResolvePattern=l})(UJ||(_e.KeyResolver=UJ={}));var $J=class extends gh{static{a(this,"KeyArrayResolverError")}};_e.KeyArrayResolverError=$J;var qF;(function(e){function t(r){return Array.isArray(r)?r:Ee.TUnionLiteral(r)?r.anyOf.map(n=>n.const.toString()):Ee.TLiteral(r)?[r.const]:Ee.TTemplateLiteral(r)?(()=>{const n=EP.ParseExact(r.pattern);if(!bP.Check(n))throw new $J("Cannot resolve keys from infinite template expression");return[...SP.Generate(n)]})():[]}a(t,"Resolve");e.Resolve=t})(qF||(_e.KeyArrayResolver=qF={}));var HRe;(function(e){function*t(n){for(const i of n.anyOf){if(i[_e.Kind]==="Union"){yield*t(i)}else{yield i}}}a(t,"TUnion");function r(n){return _e.Type.Union([...t(n)],{...n})}a(r,"Resolve");e.Resolve=r})(HRe||(_e.UnionResolver=HRe={}));var jJ=class extends gh{static{a(this,"TemplateLiteralPatternError")}};_e.TemplateLiteralPatternError=jJ;var GJ;(function(e){function t(s){throw new jJ(s)}a(t,"Throw");function r(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(r,"Escape");function n(s,o){return Ee.TTemplateLiteral(s)?s.pattern.slice(1,s.pattern.length-1):Ee.TUnion(s)?`(${s.anyOf.map(u=>n(u,o)).join("|")})`:Ee.TNumber(s)?`${o}${_e.PatternNumber}`:Ee.TInteger(s)?`${o}${_e.PatternNumber}`:Ee.TBigInt(s)?`${o}${_e.PatternNumber}`:Ee.TString(s)?`${o}${_e.PatternString}`:Ee.TLiteral(s)?`${o}${r(s.const.toString())}`:Ee.TBoolean(s)?`${o}${_e.PatternBoolean}`:t(`Unexpected Kind '${s[_e.Kind]}'`)}a(n,"Visit");function i(s){return`^${s.map(o=>n(o,"")).join("")}$`}a(i,"Create");e.Create=i})(GJ||(_e.TemplateLiteralPattern=GJ={}));var xy;(function(e){function t(r){const n=EP.ParseExact(r.pattern);if(!bP.Check(n))return _e.Type.String();const i=[...SP.Generate(n)].map(s=>_e.Type.Literal(s));return _e.Type.Union(i)}a(t,"Resolve");e.Resolve=t})(xy||(_e.TemplateLiteralResolver=xy={}));var UF=class extends gh{static{a(this,"TemplateLiteralParserError")}};_e.TemplateLiteralParserError=UF;var EP;(function(e){function t(m,h,g){return m[h]===g&&m.charCodeAt(h-1)!==92}a(t,"IsNonEscaped");function r(m,h){return t(m,h,"(")}a(r,"IsOpenParen");function n(m,h){return t(m,h,")")}a(n,"IsCloseParen");function i(m,h){return t(m,h,"|")}a(i,"IsSeparator");function s(m){if(!(r(m,0)&&n(m,m.length-1)))return false;let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(h===0&&g!==m.length-1)return false}return true}a(s,"IsGroup");function o(m){return m.slice(1,m.length-1)}a(o,"InGroup");function u(m){let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(i(m,g)&&h===0)return true}return false}a(u,"IsPrecedenceOr");function l(m){for(let h=0;h<m.length;h++){if(r(m,h))return true}return false}a(l,"IsPrecedenceAnd");function c(m){let[h,g]=[0,0];const _=[];for(let S=0;S<m.length;S++){if(r(m,S))h+=1;if(n(m,S))h-=1;if(i(m,S)&&h===0){const E=m.slice(g,S);if(E.length>0)_.push(p(E));g=S+1}}const v=m.slice(g);if(v.length>0)_.push(p(v));if(_.length===0)return{type:"const",const:""};if(_.length===1)return _[0];return{type:"or",expr:_}}a(c,"Or");function d(m){function h(v,S){if(!r(v,S))throw new UF(`TemplateLiteralParser: Index must point to open parens`);let E=0;for(let b=S;b<v.length;b++){if(r(v,b))E+=1;if(n(v,b))E-=1;if(E===0)return[S,b]}throw new UF(`TemplateLiteralParser: Unclosed group parens in expression`)}a(h,"Group");function g(v,S){for(let E=S;E<v.length;E++){if(r(v,E))return[S,E]}return[S,v.length]}a(g,"Range");const _=[];for(let v=0;v<m.length;v++){if(r(m,v)){const[S,E]=h(m,v);const b=m.slice(S,E+1);_.push(p(b));v=E}else{const[S,E]=g(m,v);const b=m.slice(S,E);if(b.length>0)_.push(p(b));v=E-1}}return _.length===0?{type:"const",const:""}:_.length===1?_[0]:{type:"and",expr:_}}a(d,"And");function p(m){return s(m)?p(o(m)):u(m)?c(m):l(m)?d(m):{type:"const",const:m}}a(p,"Parse");e.Parse=p;function f(m){return p(m.slice(1,m.length-1))}a(f,"ParseExact");e.ParseExact=f})(EP||(_e.TemplateLiteralParser=EP={}));var HJ=class extends gh{static{a(this,"TemplateLiteralFiniteError")}};_e.TemplateLiteralFiniteError=HJ;var bP;(function(e){function t(o){throw new HJ(o)}a(t,"Throw");function r(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="0"&&o.expr[1].type==="const"&&o.expr[1].const==="[1-9][0-9]*"}a(r,"IsNumber");function n(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="true"&&o.expr[1].type==="const"&&o.expr[1].const==="false"}a(n,"IsBoolean");function i(o){return o.type==="const"&&o.const===".*"}a(i,"IsString");function s(o){return n(o)?true:r(o)||i(o)?false:o.type==="and"?o.expr.every(u=>s(u)):o.type==="or"?o.expr.every(u=>s(u)):o.type==="const"?true:t(`Unknown expression type`)}a(s,"Check");e.Check=s})(bP||(_e.TemplateLiteralFinite=bP={}));var VJ=class extends gh{static{a(this,"TemplateLiteralGeneratorError")}};_e.TemplateLiteralGeneratorError=VJ;var SP;(function(e){function*t(o){if(o.length===1)return yield*o[0];for(const u of o[0]){for(const l of t(o.slice(1))){yield`${u}${l}`}}}a(t,"Reduce");function*r(o){return yield*t(o.expr.map(u=>[...s(u)]))}a(r,"And");function*n(o){for(const u of o.expr)yield*s(u)}a(n,"Or");function*i(o){return yield o.const}a(i,"Const");function*s(o){return o.type==="and"?yield*r(o):o.type==="or"?yield*n(o):o.type==="const"?yield*i(o):(()=>{throw new VJ("Unknown expression")})()}a(s,"Generate");e.Generate=s})(SP||(_e.TemplateLiteralGenerator=SP={}));var VRe;(function(e){function*t(s){const o=s.trim().replace(/"|'/g,"");return o==="boolean"?yield _e.Type.Boolean():o==="number"?yield _e.Type.Number():o==="bigint"?yield _e.Type.BigInt():o==="string"?yield _e.Type.String():yield(()=>{const u=o.split("|").map(l=>_e.Type.Literal(l.trim()));return u.length===0?_e.Type.Never():u.length===1?u[0]:_e.Type.Union(u)})()}a(t,"ParseUnion");function*r(s){if(s[1]!=="{"){const o=_e.Type.Literal("$");const u=n(s.slice(1));return yield*[o,...u]}for(let o=2;o<s.length;o++){if(s[o]==="}"){const u=t(s.slice(2,o));const l=n(s.slice(o+1));return yield*[...u,...l]}}yield _e.Type.Literal(s)}a(r,"ParseTerminal");function*n(s){for(let o=0;o<s.length;o++){if(s[o]==="$"){const u=_e.Type.Literal(s.slice(0,o));const l=r(s.slice(o));return yield*[u,...l]}}yield _e.Type.Literal(s)}a(n,"ParseLiteral");function i(s){return[...n(s)]}a(i,"Parse");e.Parse=i})(VRe||(_e.TemplateLiteralDslParser=VRe={}));var zJ=class{static{a(this,"TransformDecodeBuilder")}constructor(t){this.schema=t}Decode(t){return new KJ(this.schema,t)}};_e.TransformDecodeBuilder=zJ;var KJ=class{static{a(this,"TransformEncodeBuilder")}constructor(t,r){this.schema=t;this.decode=r}Encode(t){const r=Rr.Type(this.schema);return Ee.TTransform(r)?(()=>{const n=a(o=>r[_e.Transform].Encode(t(o)),"Encode");const i=a(o=>this.decode(r[_e.Transform].Decode(o)),"Decode");const s={Encode:n,Decode:i};return{...r,[_e.Transform]:s}})():(()=>{const n={Decode:this.decode,Encode:t};return{...r,[_e.Transform]:n}})()}};_e.TransformEncodeBuilder=KJ;var fxn=0;var WJ=class extends gh{static{a(this,"TypeBuilderError")}};_e.TypeBuilderError=WJ;var YJ=class{static{a(this,"TypeBuilder")}Create(t){return t}Throw(t){throw new WJ(t)}Discard(t,r){const{[r]:n,...i}=t;return i}Strict(t){return JSON.parse(JSON.stringify(t))}};_e.TypeBuilder=YJ;var $F=class extends YJ{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(t){return this.Readonly(this.Optional(t))}Readonly(t){return{...Rr.Type(t),[_e.Readonly]:"Readonly"}}Optional(t){return{...Rr.Type(t),[_e.Optional]:"Optional"}}Any(t={}){return this.Create({...t,[_e.Kind]:"Any"})}Array(t,r={}){return this.Create({...r,[_e.Kind]:"Array",type:"array",items:Rr.Type(t)})}Boolean(t={}){return this.Create({...t,[_e.Kind]:"Boolean",type:"boolean"})}Capitalize(t,r={}){return{..._P.Map(Rr.Type(t),"Capitalize"),...r}}Composite(t,r){const n=_e.Type.Intersect(t,{});const i=UJ.ResolveKeys(n,{includePatterns:false});const s=i.reduce((o,u)=>({...o,[u]:_e.Type.Index(n,[u])}),{});return _e.Type.Object(s,r)}Enum(t,r={}){const n=Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]);const i=n.map(s=>Jt.IsString(s)?{[_e.Kind]:"Literal",type:"string",const:s}:{[_e.Kind]:"Literal",type:"number",const:s});return this.Create({...r,[_e.Kind]:"Union",anyOf:i})}Extends(t,r,n,i,s={}){switch(sC.Extends(t,r)){case at.Union:return this.Union([Rr.Type(n,s),Rr.Type(i,s)]);case at.True:return Rr.Type(n,s);case at.False:return Rr.Type(i,s)}}Exclude(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Exclude(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Exclude(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)===at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?this.Never(n):Rr.Type(t,n)}Extract(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Extract(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Extract(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)!==at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?Rr.Type(t,n):this.Never(n)}Index(t,r,n={}){return Ee.TArray(t)&&Ee.TNumber(r)?(()=>{return Rr.Type(t.items,n)})():Ee.TTuple(t)&&Ee.TNumber(r)?(()=>{const i=Jt.IsUndefined(t.items)?[]:t.items;const s=i.map(o=>Rr.Type(o));return this.Union(s,n)})():(()=>{const i=qF.Resolve(r);const s=Rr.Type(t);return GRe.Resolve(s,i,n)})()}Integer(t={}){return this.Create({...t,[_e.Kind]:"Integer",type:"integer"})}Intersect(t,r={}){if(t.length===0)return _e.Type.Never();if(t.length===1)return Rr.Type(t[0],r);if(t.some(o=>Ee.TTransform(o)))this.Throw("Cannot intersect transform types");const n=t.every(o=>Ee.TObject(o));const i=Rr.Rest(t);const s=Ee.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:Rr.Type(r.unevaluatedProperties)}:{};return r.unevaluatedProperties===false||Ee.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[_e.Kind]:"Intersect",type:"object",allOf:i}):this.Create({...r,...s,[_e.Kind]:"Intersect",allOf:i})}KeyOf(t,r={}){return Ee.TRecord(t)?(()=>{const n=Object.getOwnPropertyNames(t.patternProperties)[0];return n===_e.PatternNumberExact?this.Number(r):n===_e.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():Ee.TTuple(t)?(()=>{const n=Jt.IsUndefined(t.items)?[]:t.items;const i=n.map((s,o)=>_e.Type.Literal(o.toString()));return this.Union(i,r)})():Ee.TArray(t)?(()=>{return this.Number(r)})():(()=>{const n=UJ.ResolveKeys(t,{includePatterns:false});if(n.length===0)return this.Never(r);const i=n.map(s=>this.Literal(s));return this.Union(i,r)})()}Literal(t,r={}){return this.Create({...r,[_e.Kind]:"Literal",const:t,type:typeof t})}Lowercase(t,r={}){return{..._P.Map(Rr.Type(t),"Lowercase"),...r}}Never(t={}){return this.Create({...t,[_e.Kind]:"Never",not:{}})}Not(t,r){return this.Create({...r,[_e.Kind]:"Not",not:Rr.Type(t)})}Null(t={}){return this.Create({...t,[_e.Kind]:"Null",type:"null"})}Number(t={}){return this.Create({...t,[_e.Kind]:"Number",type:"number"})}Object(t,r={}){const n=Object.getOwnPropertyNames(t);const i=n.filter(l=>Ee.TOptional(t[l]));const s=n.filter(l=>!i.includes(l));const o=Ee.TSchema(r.additionalProperties)?{additionalProperties:Rr.Type(r.additionalProperties)}:{};const u=n.reduce((l,c)=>({...l,[c]:Rr.Type(t[c])}),{});return s.length>0?this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u,required:s}):this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u})}Omit(t,r,n={}){const i=qF.Resolve(r);return vP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>!i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Partial(t,r={}){return vP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Optional(n.properties[o])}},{});return this.Object(i,this.Discard(n,"required"))},r)}Pick(t,r,n={}){const i=qF.Resolve(r);return vP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(!i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Record(t,r,n={}){return Ee.TTemplateLiteral(t)?(()=>{const i=EP.ParseExact(t.pattern);return bP.Check(i)?this.Object([...SP.Generate(i)].reduce((s,o)=>({...s,[o]:Rr.Type(r)}),{}),n):this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[t.pattern]:Rr.Type(r)}})})():Ee.TUnion(t)?(()=>{const i=HRe.Resolve(t);if(Ee.TUnionLiteral(i)){const s=i.anyOf.reduce((o,u)=>({...o,[u.const]:Rr.Type(r)}),{});return this.Object(s,{...n,[_e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():Ee.TLiteral(t)?(()=>{return Jt.IsString(t.const)||Jt.IsNumber(t.const)?this.Object({[t.const]:Rr.Type(r)},n):this.Throw("Record key of type literal is not of type string or number")})():Ee.TInteger(t)||Ee.TNumber(t)?(()=>{return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[_e.PatternNumberExact]:Rr.Type(r)}})})():Ee.TString(t)?(()=>{const i=Jt.IsUndefined(t.pattern)?_e.PatternStringExact:t.pattern;return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[i]:Rr.Type(r)}})})():this.Never()}Recursive(t,r={}){if(Jt.IsUndefined(r.$id))r.$id=`T${fxn++}`;const n=t({[_e.Kind]:"This",$ref:`${r.$id}`});n.$id=r.$id;return this.Create({...r,[_e.Hint]:"Recursive",...n})}Ref(t,r={}){if(Jt.IsString(t))return this.Create({...r,[_e.Kind]:"Ref",$ref:t});if(Jt.IsUndefined(t.$id))this.Throw("Reference target type must specify an $id");return this.Create({...r,[_e.Kind]:"Ref",$ref:t.$id})}Required(t,r={}){return vP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Discard(n.properties[o],_e.Optional)}},{});return this.Object(i,n)},r)}Rest(t){return Ee.TTuple(t)&&!Jt.IsUndefined(t.items)?Rr.Rest(t.items):Ee.TIntersect(t)?Rr.Rest(t.allOf):Ee.TUnion(t)?Rr.Rest(t.anyOf):[]}String(t={}){return this.Create({...t,[_e.Kind]:"String",type:"string"})}TemplateLiteral(t,r={}){const n=Jt.IsString(t)?GJ.Create(VRe.Parse(t)):GJ.Create(t);return this.Create({...r,[_e.Kind]:"TemplateLiteral",type:"string",pattern:n})}Transform(t){return new zJ(t)}Tuple(t,r={}){const[n,i,s]=[false,t.length,t.length];const o=Rr.Rest(t);const u=t.length>0?{...r,[_e.Kind]:"Tuple",type:"array",items:o,additionalItems:n,minItems:i,maxItems:s}:{...r,[_e.Kind]:"Tuple",type:"array",minItems:i,maxItems:s};return this.Create(u)}Uncapitalize(t,r={}){return{..._P.Map(Rr.Type(t),"Uncapitalize"),...r}}Union(t,r={}){return Ee.TTemplateLiteral(t)?xy.Resolve(t):(()=>{const n=t;if(n.length===0)return this.Never(r);if(n.length===1)return this.Create(Rr.Type(n[0],r));const i=Rr.Rest(n);return this.Create({...r,[_e.Kind]:"Union",anyOf:i})})()}Unknown(t={}){return this.Create({...t,[_e.Kind]:"Unknown"})}Unsafe(t={}){return this.Create({...t,[_e.Kind]:t[_e.Kind]||"Unsafe"})}Uppercase(t,r={}){return{..._P.Map(Rr.Type(t),"Uppercase"),...r}}};_e.JsonTypeBuilder=$F;var XJ=class extends $F{static{a(this,"JavaScriptTypeBuilder")}AsyncIterator(t,r={}){return this.Create({...r,[_e.Kind]:"AsyncIterator",type:"AsyncIterator",items:Rr.Type(t)})}Awaited(t,r={}){const n=a(i=>i.length>0?(()=>{const[s,...o]=i;return[this.Awaited(s),...n(o)]})():i,"Unwrap");return Ee.TIntersect(t)?_e.Type.Intersect(n(t.allOf)):Ee.TUnion(t)?_e.Type.Union(n(t.anyOf)):Ee.TPromise(t)?this.Awaited(t.item):Rr.Type(t,r)}BigInt(t={}){return this.Create({...t,[_e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(t,r={}){return this.Tuple([...t.parameters],{...r})}Constructor(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Constructor",type:"constructor",parameters:i,returns:s})}Date(t={}){return this.Create({...t,[_e.Kind]:"Date",type:"Date"})}Function(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Function",type:"function",parameters:i,returns:s})}InstanceType(t,r={}){return Rr.Type(t.returns,r)}Iterator(t,r={}){return this.Create({...r,[_e.Kind]:"Iterator",type:"Iterator",items:Rr.Type(t)})}Parameters(t,r={}){return this.Tuple(t.parameters,{...r})}Promise(t,r={}){return this.Create({...r,[_e.Kind]:"Promise",type:"Promise",item:Rr.Type(t)})}RegExp(t,r={}){const n=Jt.IsString(t)?t:t.source;return this.Create({...r,[_e.Kind]:"String",type:"string",pattern:n})}RegEx(t,r={}){return this.RegExp(t,r)}ReturnType(t,r={}){return Rr.Type(t.returns,r)}Symbol(t){return this.Create({...t,[_e.Kind]:"Symbol",type:"symbol"})}Undefined(t={}){return this.Create({...t,[_e.Kind]:"Undefined",type:"undefined"})}Uint8Array(t={}){return this.Create({...t,[_e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(t={}){return this.Create({...t,[_e.Kind]:"Void",type:"void"})}};_e.JavaScriptTypeBuilder=XJ;_e.JsonType=new $F;_e.Type=new XJ});var _xt=y(JJ=>{"use strict";Object.defineProperty(JJ,"__esModule",{value:true});JJ.CustomTypeBuilder=void 0;var jF=yxt();var zRe=class extends jF.TypeBuilder{static{a(this,"CustomTypeBuilder")}static Date(){return jF.Type.Unsafe({type:"string",format:"date-time"})}static Nullable(t){return jF.Type.Union([t,jF.Type.Null()])}static StringEnum(t){return jF.Type.Unsafe({type:"string",enum:t})}};JJ.CustomTypeBuilder=zRe});var Sxt=y(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:true});Tr.throwIfNotNumber=Tr.throwIfNotString=Tr.throwIfUndefinedOrNull=Tr.throwIfUndefined=Tr.ArgumentTypeError=Tr.ArgumentUndefinedError=Tr.ValidationError=Tr.withUndefinedAsNull=Tr.withNullAsUndefined=Tr.validateConstraint=Tr.validateConstraints=Tr.areFunctions=Tr.isFunction=Tr.isEmptyObject=Tr.assertAllDefined=Tr.assertIsDefined=Tr.assertType=Tr.isUndefinedOrNull=Tr.isDefined=Tr.isUndefined=Tr.isBoolean=Tr.isIterable=Tr.isNumber=Tr.isTypedArray=Tr.isObject=Tr.isStringArray=Tr.isString=void 0;function QJ(e){return typeof e==="string"}a(QJ,"isString");Tr.isString=QJ;function mxn(e){return Array.isArray(e)&&e.every(t=>QJ(t))}a(mxn,"isStringArray");Tr.isStringArray=mxn;function vxt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}a(vxt,"isObject");Tr.isObject=vxt;function hxn(e){const t=Object.getPrototypeOf(Uint8Array);return typeof e==="object"&&e instanceof t}a(hxn,"isTypedArray");Tr.isTypedArray=hxn;function Ext(e){return typeof e==="number"&&!isNaN(e)}a(Ext,"isNumber");Tr.isNumber=Ext;function gxn(e){return!!e&&typeof e[Symbol.iterator]==="function"}a(gxn,"isIterable");Tr.isIterable=gxn;function yxn(e){return e===true||e===false}a(yxn,"isBoolean");Tr.isBoolean=yxn;function KRe(e){return typeof e==="undefined"}a(KRe,"isUndefined");Tr.isUndefined=KRe;function _xn(e){return!AP(e)}a(_xn,"isDefined");Tr.isDefined=_xn;function AP(e){return KRe(e)||e===null}a(AP,"isUndefinedOrNull");Tr.isUndefinedOrNull=AP;function vxn(e,t){if(!e){throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}}a(vxn,"assertType");Tr.assertType=vxn;function Exn(e){if(AP(e)){throw new Error("Assertion Failed: argument is undefined or null")}return e}a(Exn,"assertIsDefined");Tr.assertIsDefined=Exn;function bxn(...e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(AP(n)){throw new Error(`Assertion Failed: argument at index ${r} is undefined or null`)}t.push(n)}return t}a(bxn,"assertAllDefined");Tr.assertAllDefined=bxn;var Sxn=Object.prototype.hasOwnProperty;function Axn(e){if(!vxt(e)){return false}for(const t in e){if(Sxn.call(e,t)){return false}}return true}a(Axn,"isEmptyObject");Tr.isEmptyObject=Axn;function WRe(e){return typeof e==="function"}a(WRe,"isFunction");Tr.isFunction=WRe;function Cxn(...e){return e.length>0&&e.every(WRe)}a(Cxn,"areFunctions");Tr.areFunctions=Cxn;function wxn(e,t){const r=Math.min(e.length,t.length);for(let n=0;n<r;n++){bxt(e[n],t[n])}}a(wxn,"validateConstraints");Tr.validateConstraints=wxn;function bxt(e,t){if(QJ(t)){if(typeof e!==t){throw new Error(`argument does not match constraint: typeof ${t}`)}}else if(WRe(t)){try{if(e instanceof t){return}}catch{}if(!AP(e)&&e.constructor===t){return}if(t.length===1&&t.call(void 0,e)===true){return}throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}a(bxt,"validateConstraint");Tr.validateConstraint=bxt;function Txn(e){return e===null?void 0:e}a(Txn,"withNullAsUndefined");Tr.withNullAsUndefined=Txn;function xxn(e){return typeof e==="undefined"?null:e}a(xxn,"withUndefinedAsNull");Tr.withUndefinedAsNull=xxn;var GF=class extends Error{static{a(this,"ValidationError")}constructor(t){super(t)}};Tr.ValidationError=GF;var HF=class extends GF{static{a(this,"ArgumentUndefinedError")}constructor(t){super(`The argument '${t}' is undefined.`)}};Tr.ArgumentUndefinedError=HF;var VF=class extends GF{static{a(this,"ArgumentTypeError")}constructor(t,r){super(`The argument '${t}' must be of type '${r}'.`)}};Tr.ArgumentTypeError=VF;function Rxn(e,t){if(KRe(e)){throw new HF(t)}return true}a(Rxn,"throwIfUndefined");Tr.throwIfUndefined=Rxn;function YRe(e,t){if(AP(e)){throw new HF(t)}}a(YRe,"throwIfUndefinedOrNull");Tr.throwIfUndefinedOrNull=YRe;function Oxn(e,t){YRe(e,t);if(!QJ(e)){throw new VF(t,"string")}return true}a(Oxn,"throwIfNotString");Tr.throwIfNotString=Oxn;function Pxn(e,t){YRe(e,t);if(!Ext(e)){throw new VF(t,"number")}return true}a(Pxn,"throwIfNotNumber");Tr.throwIfNotNumber=Pxn});var hn=y(mt=>{"use strict";var Axt=mt&&mt.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var Nxn=mt&&mt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var ZJ=mt&&mt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Axt(t,e,r)}Nxn(t,e);return t};var KE=mt&&mt.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))Axt(t,e,r)};Object.defineProperty(mt,"__esModule",{value:true});mt.getRequiredEnvVar=mt.env=mt.EnvironmentalVariableRequiredError=mt.xfs=mt.RouteValidator=mt.JsonValidator=mt.MeteringService=mt.TenantService=mt.OpenFGAService=mt.DevApiService=mt.getContentApiStorageTarballPath=mt.contentApiTarballFileName=mt.ContentApiService=mt.AuthApiService=mt.getServiceAccountIdToken=mt.createApiKeyServiceClient=mt.ApiKeyService=mt.RouteVersions=mt.startsWithReservedKeyword=mt.logger=mt.createNewLogger=mt.graphQL=mt.CloudStorage=mt.fly=mt.ApiServer=mt.featureFlagsPlugin=mt.ensureZuploUserPlugin=mt.ensureZuploAdminPlugin=mt.ensureServiceAccountPlugin=mt.apiKeyAuthPlugin=mt.errorHandler=mt.DeploymentLogState=mt.signString=mt.FeatureFlags=mt.VALID_COMPATIBILITY_DATES=mt.DEFAULT_COMPATIBILITY_DATE=mt.COMPATIBILITY_FLAG_MAPPINGS=mt.WARNING_STATUS=mt.WARNING_SEVERITY=mt.GOOD_STATUS=mt.FAILURE_STATUS=mt.ERROR_SEVERITY=mt.BuildIssueError=mt.hasBlockedNotifications=mt.getDefaultFlags=mt.getBuildFlagsForDeployment=mt.CommonAuth=void 0;var XRe=ZJ(Zd());mt.env=XRe.default;Object.defineProperty(mt,"EnvironmentalVariableRequiredError",{enumerable:true,get:function(){return XRe.EnvironmentalVariableRequiredError}});Object.defineProperty(mt,"getRequiredEnvVar",{enumerable:true,get:function(){return XRe.getRequiredEnvVar}});KE(ac(),mt);var Ixn=jce();Object.defineProperty(mt,"CommonAuth",{enumerable:true,get:function(){return Ixn.CommonAuth}});var JRe=jGe();Object.defineProperty(mt,"getBuildFlagsForDeployment",{enumerable:true,get:function(){return JRe.getBuildFlagsForDeployment}});Object.defineProperty(mt,"getDefaultFlags",{enumerable:true,get:function(){return JRe.getDefaultFlags}});Object.defineProperty(mt,"hasBlockedNotifications",{enumerable:true,get:function(){return JRe.hasBlockedNotifications}});var CP=GGe();Object.defineProperty(mt,"BuildIssueError",{enumerable:true,get:function(){return CP.BuildIssueError}});Object.defineProperty(mt,"ERROR_SEVERITY",{enumerable:true,get:function(){return CP.ERROR_SEVERITY}});Object.defineProperty(mt,"FAILURE_STATUS",{enumerable:true,get:function(){return CP.FAILURE_STATUS}});Object.defineProperty(mt,"GOOD_STATUS",{enumerable:true,get:function(){return CP.GOOD_STATUS}});Object.defineProperty(mt,"WARNING_SEVERITY",{enumerable:true,get:function(){return CP.WARNING_SEVERITY}});Object.defineProperty(mt,"WARNING_STATUS",{enumerable:true,get:function(){return CP.WARNING_STATUS}});var kxn=HGe();Object.defineProperty(mt,"COMPATIBILITY_FLAG_MAPPINGS",{enumerable:true,get:function(){return kxn.COMPATIBILITY_FLAG_MAPPINGS}});var Cxt=KGe();Object.defineProperty(mt,"DEFAULT_COMPATIBILITY_DATE",{enumerable:true,get:function(){return Cxt.DEFAULT_COMPATIBILITY_DATE}});Object.defineProperty(mt,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return Cxt.VALID_COMPATIBILITY_DATES}});var Dxn=Gce();Object.defineProperty(mt,"FeatureFlags",{enumerable:true,get:function(){return Dxn.FeatureFlags}});var Lxn=WGe();Object.defineProperty(mt,"signString",{enumerable:true,get:function(){return Lxn.signString}});KE(YGe(),mt);var Fxn=zce();Object.defineProperty(mt,"DeploymentLogState",{enumerable:true,get:function(){return Fxn.DeploymentLogState}});KE(nHe(),mt);KE(Kce(),mt);var Bxn=Wce();Object.defineProperty(mt,"errorHandler",{enumerable:true,get:function(){return Bxn.errorHandler}});var zF=Zce();Object.defineProperty(mt,"apiKeyAuthPlugin",{enumerable:true,get:function(){return zF.apiKeyAuthPlugin}});Object.defineProperty(mt,"ensureServiceAccountPlugin",{enumerable:true,get:function(){return zF.ensureServiceAccountPlugin}});Object.defineProperty(mt,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return zF.ensureZuploAdminPlugin}});Object.defineProperty(mt,"ensureZuploUserPlugin",{enumerable:true,get:function(){return zF.ensureZuploUserPlugin}});Object.defineProperty(mt,"featureFlagsPlugin",{enumerable:true,get:function(){return zF.featureFlagsPlugin}});var Mxn=gft();Object.defineProperty(mt,"ApiServer",{enumerable:true,get:function(){return Mxn.ApiServer}});mt.fly=ZJ(vft());mt.CloudStorage=ZJ(ivt());var qxn=svt();Object.defineProperty(mt,"graphQL",{enumerable:true,get:function(){return qxn.graphQL}});KE(x2t(),mt);var wxt=oEe();Object.defineProperty(mt,"createNewLogger",{enumerable:true,get:function(){return wxt.createNewLogger}});Object.defineProperty(mt,"logger",{enumerable:true,get:function(){return wxt.logger}});var Uxn=JCe();Object.defineProperty(mt,"startsWithReservedKeyword",{enumerable:true,get:function(){return Uxn.startsWithReservedKeyword}});var $xn=R2t();Object.defineProperty(mt,"RouteVersions",{enumerable:true,get:function(){return $xn.RouteVersions}});var Txt=QCt();Object.defineProperty(mt,"ApiKeyService",{enumerable:true,get:function(){return Txt.ApiKeyService}});Object.defineProperty(mt,"createApiKeyServiceClient",{enumerable:true,get:function(){return Txt.createApiKeyServiceClient}});var jxn=QO();Object.defineProperty(mt,"getServiceAccountIdToken",{enumerable:true,get:function(){return jxn.getServiceAccountIdToken}});var Gxn=ewt();Object.defineProperty(mt,"AuthApiService",{enumerable:true,get:function(){return Gxn.AuthApiService}});var QRe=iwt();Object.defineProperty(mt,"ContentApiService",{enumerable:true,get:function(){return QRe.ContentApiService}});Object.defineProperty(mt,"contentApiTarballFileName",{enumerable:true,get:function(){return QRe.contentApiTarballFileName}});Object.defineProperty(mt,"getContentApiStorageTarballPath",{enumerable:true,get:function(){return QRe.getContentApiStorageTarballPath}});var Hxn=owt();Object.defineProperty(mt,"DevApiService",{enumerable:true,get:function(){return Hxn.DevApiService}});var Vxn=uxt();Object.defineProperty(mt,"OpenFGAService",{enumerable:true,get:function(){return Vxn.OpenFGAService}});var zxn=dxt();Object.defineProperty(mt,"TenantService",{enumerable:true,get:function(){return zxn.TenantService}});var Kxn=fxt();Object.defineProperty(mt,"MeteringService",{enumerable:true,get:function(){return Kxn.MeteringService}});KE(mxt(),mt);KE(_xt(),mt);KE(Sxt(),mt);var Wxn=GY();Object.defineProperty(mt,"JsonValidator",{enumerable:true,get:function(){return Wxn.JsonValidator}});var Yxn=iwe();Object.defineProperty(mt,"RouteValidator",{enumerable:true,get:function(){return Yxn.RouteValidator}});mt.xfs=ZJ(tAe())});var Fn=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:true});Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.NODE_BUILD_OUTPUT_FILE=Vt.NODE_ENTRY_NAME=Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE=Vt.WORKER_BUILD_OUTPUT_FILE=Vt.WORKER_ENTRY_NAME=Vt.ENV_MODULE_FILE=Vt.ZUPLO_SYSTEM_ENV_FILE=Vt.ENV_FILE=Vt.CACHE_DIRECTORY=Vt.BUILD_CACHE_FILE=Vt.ZUPLO_FILE_SCHEMA=Vt.NON_STANDARD_NODE_ENV=Vt.GENERATED_TYPES_DIR_NAME=Vt.GENERATED_BUILD_JSON_FILE=Vt.GENERATED_SOURCE_DIR_NAME=Vt.BUILD_OUTPUT_DIR=Vt.DEFAULT_TEST_FILE=Vt.DEFAULT_DOCS_MARKDOWN_FILE=Vt.DOCS_THEME_FILE=Vt.DOCS_SIDEBAR_FILE=Vt.ZUPLO_FALLBACK_JSON_FILE=Vt.ZUPLO_PREFERRED_JSON_FILE=Vt.DEFAULT_MODULE_FILE=Vt.OPEN_API_FILE_SUFFIX=Vt.OPEN_API_CONFIG_FILE=Vt.OPEN_API_UNVERSIONED_DIR_NAME=Vt.DEV_PORTAL_OUTPUT_DIR_NAME=Vt.DEV_PORTAL_CONFIG_FILE=Vt.POLICIES_CONFIG_FILE=Vt.ROUTES_OAS_CONFIG_FILE=Vt.LOCAL_API_KEYS_CONFIG_FILE=Vt.DEV_PORTAL_V4_PATH=Vt.USER_DOCS_DIR_NAME=Vt.USER_SCHEMAS_DIR_NAME=Vt.USER_CONFIG_DIR_NAME=Vt.USER_TEST_DIR_NAME=Vt.USER_MODULES_DIR_NAME=void 0;Vt.USER_MODULES_DIR_NAME="modules";Vt.USER_TEST_DIR_NAME="tests";Vt.USER_CONFIG_DIR_NAME="config";Vt.USER_SCHEMAS_DIR_NAME="schemas";Vt.USER_DOCS_DIR_NAME="docs";Vt.DEV_PORTAL_V4_PATH="v4";Vt.LOCAL_API_KEYS_CONFIG_FILE="api-keys.json";Vt.ROUTES_OAS_CONFIG_FILE="routes.oas.json";Vt.POLICIES_CONFIG_FILE="policies.json";Vt.DEV_PORTAL_CONFIG_FILE="dev-portal.json";Vt.DEV_PORTAL_OUTPUT_DIR_NAME="dev-portal";Vt.OPEN_API_UNVERSIONED_DIR_NAME="unversioned";Vt.OPEN_API_CONFIG_FILE="open-api.json";Vt.OPEN_API_FILE_SUFFIX=".oas.json";Vt.DEFAULT_MODULE_FILE="hello-world.ts";Vt.ZUPLO_PREFERRED_JSON_FILE="zuplo.jsonc";Vt.ZUPLO_FALLBACK_JSON_FILE="zuplo.json";Vt.DOCS_SIDEBAR_FILE="sidebar.json";Vt.DOCS_THEME_FILE="theme.css";Vt.DEFAULT_DOCS_MARKDOWN_FILE="index.md";Vt.DEFAULT_TEST_FILE="hello-world.json";Vt.BUILD_OUTPUT_DIR="dist";Vt.GENERATED_SOURCE_DIR_NAME=".zuplo";Vt.GENERATED_BUILD_JSON_FILE="build.json";Vt.GENERATED_TYPES_DIR_NAME="types";Vt.NON_STANDARD_NODE_ENV=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against.`;Vt.ZUPLO_FILE_SCHEMA="zuplo";Vt.BUILD_CACHE_FILE="buildstate.json";Vt.CACHE_DIRECTORY=".cache";Vt.ENV_FILE=".env";Vt.ZUPLO_SYSTEM_ENV_FILE=".env.zuplo";Vt.ENV_MODULE_FILE="environment.ts";Vt.WORKER_ENTRY_NAME="worker.ts";Vt.WORKER_BUILD_OUTPUT_FILE="worker.js";Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE="worker.js.map";Vt.NODE_ENTRY_NAME="server.ts";Vt.NODE_BUILD_OUTPUT_FILE="main.js";Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.OPEN_API_CONFIG_FILE});var tu=y(wP=>{"use strict";Object.defineProperty(wP,"__esModule",{value:true});wP.runPlugins=wP.PluginResult=void 0;var ZRe=class{static{a(this,"PluginResult")}errors=[];warnings=[];constructor(t){if(t){this.errors.push(t)}}};wP.PluginResult=ZRe;async function Xxn(e,t){const r=[];const n=[];const i=new Map;for await(const s of e){try{const o=await s(t,i);n.push(...o.errors.map(u=>{if(u.pluginName===""){u.pluginName=s.name}return u}));r.push(...o.warnings);if(o.errors.length>0){break}}catch(o){n.push(o);break}}return{errors:n,warnings:r}}a(Xxn,"runPlugins");wP.runPlugins=Xxn});var xs=y(tOe=>{"use strict";Object.defineProperty(tOe,"__esModule",{value:true});var eQ=require("perf_hooks");var eOe=[];async function Jxn(e,t){const r=eQ.performance.timerify(t);const n=new eQ.PerformanceObserver(i=>{const s=i.getEntries()[0];eOe.push({name:e,duration:s.duration});n.disconnect()});n.observe({entryTypes:["function"]});return r()}a(Jxn,"timeFn");var Qxn={mark:e=>{eQ.performance.mark(e)},measure:(e,t,r)=>{eQ.performance.measure(e,t,r)},timeFn:Jxn,report:()=>{if(eOe.length>0){console.table(eOe)}}};tOe.default=Qxn});var rOe=y(TP=>{"use strict";var Zxn=TP&&TP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(TP,"__esModule",{value:true});TP.getZuploConfig=void 0;var KF=hn();var eRn=require("jsonc-parser");var tRn=require("fs/promises");var xxt=Zxn(require("path"));var Rxt=Fn();async function rRn(e){const t=xxt.default.join(e,Rxt.ZUPLO_PREFERRED_JSON_FILE);const r=xxt.default.join(e,Rxt.ZUPLO_FALLBACK_JSON_FILE);let n=false;let i=t;if(await KF.xfs.fileExists(t)){n=true;i=t}else if(await KF.xfs.fileExists(r)){n=true;i=r}const s={};if(n){const o=await(0,tRn.readFile)(i,"utf-8");const u=[];const l=(0,eRn.parse)(o,u);if(typeof l!=="object"){const c={message:`Invalid zuplo.json file`,detail:`The zuplo.json file is not a valid JSON object`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("version"in l&&l.version!==1){const c={message:`Invalid version set in zuplo.config`,detail:`version in zuplo.json must be set to 1`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("compatibilityDate"in l&&KF.VALID_COMPATIBILITY_DATES&&typeof l.compatibilityDate==="string"){if(!KF.VALID_COMPATIBILITY_DATES.includes(l.compatibilityDate)){const c={message:`Invalid compatibilityDate set in zuplo.config`,detail:`compatibilityDate was set to ${l.compatibilityDate}. Valid compatibility dates are ${KF.VALID_COMPATIBILITY_DATES.join(", ")}`,pluginName:"buildData",severity:"error"};return{errors:[c]}}s.compatibilityDate=l.compatibilityDate}}return{config:s,errors:[]}}a(rRn,"getZuploConfig");TP.getZuploConfig=rRn});var WF=y(tQ=>{"use strict";Object.defineProperty(tQ,"__esModule",{value:true});tQ.TargetPlatform=void 0;var Oxt;(function(e){e["Worker"]="worker"})(Oxt||(tQ.TargetPlatform=Oxt={}))});var Nxt=y(xP=>{"use strict";var Pxt=xP&&xP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(xP,"__esModule",{value:true});xP.cleanOutput=void 0;var nRn=Pxt(require("fs/promises"));var iRn=Pxt(xs());var sRn=a(async function({outputDirectory:e,systemDirectory:t,logger:r}){return iRn.default.timeFn("Cleaning output",async()=>{r.debug("Cleaning output");const n=[e,t];for await(const i of n){try{await nRn.default.rm(i,{recursive:true,force:true})}catch(s){r.error(s)}}return{warnings:[],errors:[]}})},"cleanOutput");xP.cleanOutput=sRn});var kxt=y(RP=>{"use strict";var Ixt=RP&&RP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(RP,"__esModule",{value:true});RP.createSystemDir=void 0;var aRn=hn();var oRn=Ixt(require("fs/promises"));var uRn=Ixt(xs());var lRn=a(async function({systemDirectory:e,logger:t}){return uRn.default.timeFn("Creating system directory",async()=>{t.debug("Creating system directory");try{if(await aRn.xfs.dirExists(e)){t.debug("System directory already exists, skipping");return{warnings:[],errors:[]}}await oRn.default.mkdir(e)}catch(r){t.error(r);return{warnings:[],errors:[]}}return{warnings:[],errors:[]}})},"createSystemDir");RP.createSystemDir=lRn});var Dxt=y(OP=>{"use strict";var cRn=OP&&OP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(OP,"__esModule",{value:true});OP.checkForDeprecations=void 0;var dRn=cRn(xs());var pRn=a(async function({logger:e}){return dRn.default.timeFn("Checking for breaking changes",async()=>{e.debug("Checking for breaking changes");return{warnings:[],errors:[]}})},"checkForDeprecations");OP.checkForDeprecations=pRn});var Lxt=y(nOe=>{var aC=require("path");var YE=process.platform==="win32";var WE=require("fs");var fRn=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function mRn(){var e;if(fRn){var t=new Error;e=r}else e=n;return e;function r(i){if(i){t.message=i.message;i=t;n(i)}}a(r,"debugCallback");function n(i){if(i){if(process.throwDeprecation)throw i;else if(!process.noDeprecation){var s="fs: missing callback "+(i.stack||i.message);if(process.traceDeprecation)console.trace(s);else console.error(s)}}}a(n,"missingCallback")}a(mRn,"rethrow");function hRn(e){return typeof e==="function"?e:mRn()}a(hRn,"maybeCallback");var o5s=aC.normalize;if(YE){Ry=/(.*?)(?:[\/\\]+|$)/g}else{Ry=/(.*?)(?:[\/]+|$)/g}var Ry;if(YE){YF=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{YF=/^[\/]*/}var YF;nOe.realpathSync=a(function e(t,r){t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var n=t,i={},s={};var o;var u;var l;var c;d();function d(){var _=YF.exec(t);o=_[0].length;u=_[0];l=_[0];c="";if(YE&&!s[l]){WE.lstatSync(l);s[l]=true}}a(d,"start");while(o<t.length){Ry.lastIndex=o;var p=Ry.exec(t);c=u;u+=p[0];l=c+p[1];o=Ry.lastIndex;if(s[l]||r&&r[l]===l){continue}var f;if(r&&Object.prototype.hasOwnProperty.call(r,l)){f=r[l]}else{var m=WE.lstatSync(l);if(!m.isSymbolicLink()){s[l]=true;if(r)r[l]=l;continue}var h=null;if(!YE){var g=m.dev.toString(32)+":"+m.ino.toString(32);if(i.hasOwnProperty(g)){h=i[g]}}if(h===null){WE.statSync(l);h=WE.readlinkSync(l)}f=aC.resolve(c,h);if(r)r[l]=f;if(!YE)i[g]=h}t=aC.resolve(f,t.slice(o));d()}if(r)r[n]=t;return t},"realpathSync");nOe.realpath=a(function e(t,r,n){if(typeof n!=="function"){n=hRn(r);r=null}t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(n.bind(null,null,r[t]))}var i=t,s={},o={};var u;var l;var c;var d;p();function p(){var _=YF.exec(t);u=_[0].length;l=_[0];c=_[0];d="";if(YE&&!o[c]){WE.lstat(c,function(v){if(v)return n(v);o[c]=true;f()})}else{process.nextTick(f)}}a(p,"start");function f(){if(u>=t.length){if(r)r[i]=t;return n(null,t)}Ry.lastIndex=u;var _=Ry.exec(t);d=l;l+=_[0];c=d+_[1];u=Ry.lastIndex;if(o[c]||r&&r[c]===c){return process.nextTick(f)}if(r&&Object.prototype.hasOwnProperty.call(r,c)){return g(r[c])}return WE.lstat(c,m)}a(f,"LOOP");function m(_,v){if(_)return n(_);if(!v.isSymbolicLink()){o[c]=true;if(r)r[c]=c;return process.nextTick(f)}if(!YE){var S=v.dev.toString(32)+":"+v.ino.toString(32);if(s.hasOwnProperty(S)){return h(null,s[S],c)}}WE.stat(c,function(E){if(E)return n(E);WE.readlink(c,function(b,A){if(!YE)s[S]=A;h(b,A)})})}a(m,"gotStat");function h(_,v,S){if(_)return n(_);var E=aC.resolve(d,v);if(r)r[S]=E;g(E)}a(h,"gotTarget");function g(_){t=aC.resolve(_,t.slice(u));p()}a(g,"gotResolvedLink")},"realpath")});var oOe=y((c5s,qxt)=>{qxt.exports=XE;XE.realpath=XE;XE.sync=aOe;XE.realpathSync=aOe;XE.monkeypatch=yRn;XE.unmonkeypatch=_Rn;var PP=require("fs");var iOe=PP.realpath;var sOe=PP.realpathSync;var gRn=process.version;var Fxt=/^v[0-5]\./.test(gRn);var Bxt=Lxt();function Mxt(e){return e&&e.syscall==="realpath"&&(e.code==="ELOOP"||e.code==="ENOMEM"||e.code==="ENAMETOOLONG")}a(Mxt,"newError");function XE(e,t,r){if(Fxt){return iOe(e,t,r)}if(typeof t==="function"){r=t;t=null}iOe(e,t,function(n,i){if(Mxt(n)){Bxt.realpath(e,t,r)}else{r(n,i)}})}a(XE,"realpath");function aOe(e,t){if(Fxt){return sOe(e,t)}try{return sOe(e,t)}catch(r){if(Mxt(r)){return Bxt.realpathSync(e,t)}else{throw r}}}a(aOe,"realpathSync");function yRn(){PP.realpath=XE;PP.realpathSync=aOe}a(yRn,"monkeypatch");function _Rn(){PP.realpath=iOe;PP.realpathSync=sOe}a(_Rn,"unmonkeypatch")});var $xt=y((p5s,Uxt)=>{Uxt.exports=function(e,t){var r=[];for(var n=0;n<e.length;n++){var i=t(e[n],n);if(vRn(i))r.push.apply(r,i);else r.push(i)}return r};var vRn=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}});var uOe=y((f5s,Vxt)=>{"use strict";Vxt.exports=Gxt;function Gxt(e,t,r){if(e instanceof RegExp)e=jxt(e,r);if(t instanceof RegExp)t=jxt(t,r);var n=Hxt(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}a(Gxt,"balanced");function jxt(e,t){var r=t.match(e);return r?r[0]:null}a(jxt,"maybeMatch");Gxt.range=Hxt;function Hxt(e,t,r){var n,i,s,o,u;var l=r.indexOf(e);var c=r.indexOf(t,l+1);var d=l;if(l>=0&&c>0){if(e===t){return[l,c]}n=[];s=r.length;while(d>=0&&!u){if(d==l){n.push(d);l=r.indexOf(e,d+1)}else if(n.length==1){u=[n.pop(),c]}else{i=n.pop();if(i<s){s=i;o=c}c=r.indexOf(t,d+1)}d=l<c&&l>=0?l:c}if(n.length){u=[s,o]}}return u}a(Hxt,"range")});var Zxt=y((h5s,Qxt)=>{var ERn=$xt();var zxt=uOe();Qxt.exports=ARn;var Kxt="\0SLASH"+Math.random()+"\0";var Wxt="\0OPEN"+Math.random()+"\0";var cOe="\0CLOSE"+Math.random()+"\0";var Yxt="\0COMMA"+Math.random()+"\0";var Xxt="\0PERIOD"+Math.random()+"\0";function lOe(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}a(lOe,"numeric");function bRn(e){return e.split("\\\\").join(Kxt).split("\\{").join(Wxt).split("\\}").join(cOe).split("\\,").join(Yxt).split("\\.").join(Xxt)}a(bRn,"escapeBraces");function SRn(e){return e.split(Kxt).join("\\").split(Wxt).join("{").split(cOe).join("}").split(Yxt).join(",").split(Xxt).join(".")}a(SRn,"unescapeBraces");function Jxt(e){if(!e)return[""];var t=[];var r=zxt("{","}",e);if(!r)return e.split(",");var n=r.pre;var i=r.body;var s=r.post;var o=n.split(",");o[o.length-1]+="{"+i+"}";var u=Jxt(s);if(s.length){o[o.length-1]+=u.shift();o.push.apply(o,u)}t.push.apply(t,o);return t}a(Jxt,"parseCommaParts");function ARn(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return NP(bRn(e),true).map(SRn)}a(ARn,"expandTop");function CRn(e){return"{"+e+"}"}a(CRn,"embrace");function wRn(e){return/^-?0\d/.test(e)}a(wRn,"isPadded");function TRn(e,t){return e<=t}a(TRn,"lte");function xRn(e,t){return e>=t}a(xRn,"gte");function NP(e,t){var r=[];var n=zxt("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var o=i||s;var u=n.body.indexOf(",")>=0;if(!o&&!u){if(n.post.match(/,.*\}/)){e=n.pre+"{"+n.body+cOe+n.post;return NP(e)}return[e]}var l;if(o){l=n.body.split(/\.\./)}else{l=Jxt(n.body);if(l.length===1){l=NP(l[0],false).map(CRn);if(l.length===1){var d=n.post.length?NP(n.post,false):[""];return d.map(function(I){return n.pre+l[0]+I})}}}var c=n.pre;var d=n.post.length?NP(n.post,false):[""];var p;if(o){var f=lOe(l[0]);var m=lOe(l[1]);var h=Math.max(l[0].length,l[1].length);var g=l.length==3?Math.abs(lOe(l[2])):1;var _=TRn;var v=m<f;if(v){g*=-1;_=xRn}var S=l.some(wRn);p=[];for(var E=f;_(E,m);E+=g){var b;if(s){b=String.fromCharCode(E);if(b==="\\")b=""}else{b=String(E);if(S){var A=h-b.length;if(A>0){var C=new Array(A+1).join("0");if(E<0)b="-"+C+b.slice(1);else b=C+b}}}p.push(b)}}else{p=ERn(l,function(R){return NP(R,false)})}for(var T=0;T<p.length;T++){for(var O=0;O<d.length;O++){var P=c+p[T]+d[O];if(!t||o||P)r.push(P)}}return r}a(NP,"expand")});var iQ=y((y5s,iRt)=>{iRt.exports=mp;mp.Minimatch=ol;var XF=function(){try{return require("path")}catch(e){}}()||{sep:"/"};mp.sep=XF.sep;var fOe=mp.GLOBSTAR=ol.GLOBSTAR={};var RRn=Zxt();var eRt={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var dOe="[^/]";var pOe=dOe+"*?";var ORn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var PRn="(?:(?!(?:\\/|^)\\.).)*?";var tRt=NRn("().*{}+?[]^$\\!");function NRn(e){return e.split("").reduce(function(t,r){t[r]=true;return t},{})}a(NRn,"charSet");var rRt=/\/+/;mp.filter=IRn;function IRn(e,t){t=t||{};return function(r,n,i){return mp(r,e,t)}}a(IRn,"filter");function JE(e,t){t=t||{};var r={};Object.keys(e).forEach(function(n){r[n]=e[n]});Object.keys(t).forEach(function(n){r[n]=t[n]});return r}a(JE,"ext");mp.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return mp}var t=mp;var r=a(function n(i,s,o){return t(i,s,JE(e,o))},"minimatch");r.Minimatch=a(function n(i,s){return new t.Minimatch(i,JE(e,s))},"Minimatch");r.Minimatch.defaults=a(function n(i){return t.defaults(JE(e,i)).Minimatch},"defaults");r.filter=a(function n(i,s){return t.filter(i,JE(e,s))},"filter");r.defaults=a(function n(i){return t.defaults(JE(e,i))},"defaults");r.makeRe=a(function n(i,s){return t.makeRe(i,JE(e,s))},"makeRe");r.braceExpand=a(function n(i,s){return t.braceExpand(i,JE(e,s))},"braceExpand");r.match=function(n,i,s){return t.match(n,i,JE(e,s))};return r};ol.defaults=function(e){return mp.defaults(e).Minimatch};function mp(e,t,r){nQ(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new ol(t,r).match(e)}a(mp,"minimatch");function ol(e,t){if(!(this instanceof ol)){return new ol(e,t)}nQ(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&XF.sep!=="/"){e=e.split(XF.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}a(ol,"Minimatch");ol.prototype.debug=function(){};ol.prototype.make=kRn;function kRn(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=a(function n(){console.error.apply(console,arguments)},"debug");this.debug(this.pattern,r);r=this.globParts=r.map(function(n){return n.split(rRt)});this.debug(this.pattern,r);r=r.map(function(n,i,s){return n.map(this.parse,this)},this);this.debug(this.pattern,r);r=r.filter(function(n){return n.indexOf(false)===-1});this.debug(this.pattern,r);this.set=r}a(kRn,"make");ol.prototype.parseNegate=DRn;function DRn(){var e=this.pattern;var t=false;var r=this.options;var n=0;if(r.nonegate)return;for(var i=0,s=e.length;i<s&&e.charAt(i)==="!";i++){t=!t;n++}if(n)this.pattern=e.substr(n);this.negate=t}a(DRn,"parseNegate");mp.braceExpand=function(e,t){return nRt(e,t)};ol.prototype.braceExpand=nRt;function nRt(e,t){if(!t){if(this instanceof ol){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;nQ(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return RRn(e)}a(nRt,"braceExpand");var LRn=1024*64;var nQ=a(function(e){if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>LRn){throw new TypeError("pattern is too long")}},"assertValidPattern");ol.prototype.parse=FRn;var rQ={};function FRn(e,t){nQ(e);var r=this.options;if(e==="**"){if(!r.noglobstar)return fOe;else e="*"}if(e==="")return"";var n="";var i=!!r.nocase;var s=false;var o=[];var u=[];var l;var c=false;var d=-1;var p=-1;var f=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var m=this;function h(){if(l){switch(l){case"*":n+=pOe;i=true;break;case"?":n+=dOe;i=true;break;default:n+="\\"+l;break}m.debug("clearStateChar %j %j",l,n);l=false}}a(h,"clearStateChar");for(var g=0,_=e.length,v;g<_&&(v=e.charAt(g));g++){this.debug("%s %s %s %j",e,g,n,v);if(s&&tRt[v]){n+="\\"+v;s=false;continue}switch(v){case"/":{return false}case"\\":h();s=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",e,g,n,v);if(c){this.debug(" in class");if(v==="!"&&g===p+1)v="^";n+=v;continue}m.debug("call clearStateChar %j",l);h();l=v;if(r.noext)h();continue;case"(":if(c){n+="(";continue}if(!l){n+="\\(";continue}o.push({type:l,start:g-1,reStart:n.length,open:eRt[l].open,close:eRt[l].close});n+=l==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",l,n);l=false;continue;case")":if(c||!o.length){n+="\\)";continue}h();i=true;var S=o.pop();n+=S.close;if(S.type==="!"){u.push(S)}S.reEnd=n.length;continue;case"|":if(c||!o.length||s){n+="\\|";s=false;continue}h();n+="|";continue;case"[":h();if(c){n+="\\"+v;continue}c=true;p=g;d=n.length;n+=v;continue;case"]":if(g===p+1||!c){n+="\\"+v;s=false;continue}var E=e.substring(p+1,g);try{RegExp("["+E+"]")}catch(M){var b=this.parse(E,rQ);n=n.substr(0,d)+"\\["+b[0]+"\\]";i=i||b[1];c=false;continue}i=true;c=false;n+=v;continue;default:h();if(s){s=false}else if(tRt[v]&&!(v==="^"&&c)){n+="\\"}n+=v}}if(c){E=e.substr(p+1);b=this.parse(E,rQ);n=n.substr(0,d)+"\\["+b[0];i=i||b[1]}for(S=o.pop();S;S=o.pop()){var A=n.slice(S.reStart+S.open.length);this.debug("setting tail",n,S);A=A.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(M,Q,fe){if(!fe){fe="\\"}return Q+Q+fe+"|"});this.debug("tail=%j\n %s",A,A,S,n);var C=S.type==="*"?pOe:S.type==="?"?dOe:"\\"+S.type;i=true;n=n.slice(0,S.reStart)+C+"\\("+A}h();if(s){n+="\\\\"}var T=false;switch(n.charAt(0)){case"[":case".":case"(":T=true}for(var O=u.length-1;O>-1;O--){var P=u[O];var R=n.slice(0,P.reStart);var I=n.slice(P.reStart,P.reEnd-8);var D=n.slice(P.reEnd-8,P.reEnd);var U=n.slice(P.reEnd);D+=U;var te=R.split("(").length-1;var ve=U;for(g=0;g<te;g++){ve=ve.replace(/\)[+*?]?/,"")}U=ve;var me="";if(U===""&&t!==rQ){me="$"}var he=R+I+U+me+D;n=he}if(n!==""&&i){n="(?=.)"+n}if(T){n=f+n}if(t===rQ){return[n,i]}if(!i){return MRn(e)}var Fe=r.nocase?"i":"";try{var Oe=new RegExp("^"+n+"$",Fe)}catch(M){return new RegExp("$.")}Oe._glob=e;Oe._src=n;return Oe}a(FRn,"parse");mp.makeRe=function(e,t){return new ol(e,t||{}).makeRe()};ol.prototype.makeRe=BRn;function BRn(){if(this.regexp||this.regexp===false)return this.regexp;var e=this.set;if(!e.length){this.regexp=false;return this.regexp}var t=this.options;var r=t.noglobstar?pOe:t.dot?ORn:PRn;var n=t.nocase?"i":"";var i=e.map(function(s){return s.map(function(o){return o===fOe?r:typeof o==="string"?qRn(o):o._src}).join("\\/")}).join("|");i="^(?:"+i+")$";if(this.negate)i="^(?!"+i+").*$";try{this.regexp=new RegExp(i,n)}catch(s){this.regexp=false}return this.regexp}a(BRn,"makeRe");mp.match=function(e,t,r){r=r||{};var n=new ol(t,r);e=e.filter(function(i){return n.match(i)});if(n.options.nonull&&!e.length){e.push(t)}return e};ol.prototype.match=a(function e(t,r){if(typeof r==="undefined")r=this.partial;this.debug("match",t,this.pattern);if(this.comment)return false;if(this.empty)return t==="";if(t==="/"&&r)return true;var n=this.options;if(XF.sep!=="/"){t=t.split(XF.sep).join("/")}t=t.split(rRt);this.debug(this.pattern,"split",t);var i=this.set;this.debug(this.pattern,"set",i);var s;var o;for(o=t.length-1;o>=0;o--){s=t[o];if(s)break}for(o=0;o<i.length;o++){var u=i[o];var l=t;if(n.matchBase&&u.length===1){l=[s]}var c=this.matchOne(l,u,r);if(c){if(n.flipNegate)return true;return!this.negate}}if(n.flipNegate)return false;return this.negate},"match");ol.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{"this":this,file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var i=0,s=0,o=e.length,u=t.length;i<o&&s<u;i++,s++){this.debug("matchOne loop");var l=t[s];var c=e[i];this.debug(t,l,c);if(l===false)return false;if(l===fOe){this.debug("GLOBSTAR",[t,l,c]);var d=i;var p=s+1;if(p===u){this.debug("** at the end");for(;i<o;i++){if(e[i]==="."||e[i]===".."||!n.dot&&e[i].charAt(0)===".")return false}return true}while(d<o){var f=e[d];this.debug("\nglobstar while",e,d,t,p,f);if(this.matchOne(e.slice(d),t.slice(p),r)){this.debug("globstar found match!",d,o,f);return true}else{if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue");d++}}if(r){this.debug("\n>>> no match, partial?",e,d,t,p);if(d===o)return true}return false}var m;if(typeof l==="string"){m=c===l;this.debug("string match",l,c,m)}else{m=c.match(l);this.debug("pattern match",l,c,m)}if(!m)return false}if(i===o&&s===u){return true}else if(i===o){return r}else if(s===u){return i===o-1&&e[i]===""}throw new Error("wtf?")};function MRn(e){return e.replace(/\\(.)/g,"$1")}a(MRn,"globUnescape");function qRn(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}a(qRn,"regExpEscape")});var aQ=y((v5s,sQ)=>{"use strict";function sRt(e){return e.charAt(0)==="/"}a(sRt,"posix");function aRt(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var r=t.exec(e);var n=r[1]||"";var i=Boolean(n&&n.charAt(1)!==":");return Boolean(r[2]||i)}a(aRt,"win32");sQ.exports=process.platform==="win32"?aRt:sRt;sQ.exports.posix=sRt;sQ.exports.win32=aRt});var hOe=y(QE=>{QE.setopts=VRn;QE.ownProp=oRt;QE.makeAbs=JF;QE.finish=zRn;QE.mark=KRn;QE.isIgnored=lRt;QE.childrenIgnored=WRn;function oRt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}a(oRt,"ownProp");var URn=require("fs");var IP=require("path");var $Rn=iQ();var uRt=aQ();var mOe=$Rn.Minimatch;function jRn(e,t){return e.localeCompare(t,"en")}a(jRn,"alphasort");function GRn(e,t){e.ignore=t.ignore||[];if(!Array.isArray(e.ignore))e.ignore=[e.ignore];if(e.ignore.length){e.ignore=e.ignore.map(HRn)}}a(GRn,"setupIgnores");function HRn(e){var t=null;if(e.slice(-3)==="/**"){var r=e.replace(/(\/\*\*)+$/,"");t=new mOe(r,{dot:true})}return{matcher:new mOe(e,{dot:true}),gmatcher:t}}a(HRn,"ignoreMap");function VRn(e,t,r){if(!r)r={};if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar){throw new Error("base matching requires globstar")}t="**/"+t}e.silent=!!r.silent;e.pattern=t;e.strict=r.strict!==false;e.realpath=!!r.realpath;e.realpathCache=r.realpathCache||Object.create(null);e.follow=!!r.follow;e.dot=!!r.dot;e.mark=!!r.mark;e.nodir=!!r.nodir;if(e.nodir)e.mark=true;e.sync=!!r.sync;e.nounique=!!r.nounique;e.nonull=!!r.nonull;e.nosort=!!r.nosort;e.nocase=!!r.nocase;e.stat=!!r.stat;e.noprocess=!!r.noprocess;e.absolute=!!r.absolute;e.fs=r.fs||URn;e.maxLength=r.maxLength||Infinity;e.cache=r.cache||Object.create(null);e.statCache=r.statCache||Object.create(null);e.symlinks=r.symlinks||Object.create(null);GRn(e,r);e.changedCwd=false;var n=process.cwd();if(!oRt(r,"cwd"))e.cwd=n;else{e.cwd=IP.resolve(r.cwd);e.changedCwd=e.cwd!==n}e.root=r.root||IP.resolve(e.cwd,"/");e.root=IP.resolve(e.root);if(process.platform==="win32")e.root=e.root.replace(/\\/g,"/");e.cwdAbs=uRt(e.cwd)?e.cwd:JF(e,e.cwd);if(process.platform==="win32")e.cwdAbs=e.cwdAbs.replace(/\\/g,"/");e.nomount=!!r.nomount;r.nonegate=true;r.nocomment=true;r.allowWindowsEscape=false;e.minimatch=new mOe(t,r);e.options=e.minimatch.options}a(VRn,"setopts");function zRn(e){var t=e.nounique;var r=t?[]:Object.create(null);for(var n=0,i=e.matches.length;n<i;n++){var s=e.matches[n];if(!s||Object.keys(s).length===0){if(e.nonull){var o=e.minimatch.globSet[n];if(t)r.push(o);else r[o]=true}}else{var u=Object.keys(s);if(t)r.push.apply(r,u);else u.forEach(function(l){r[l]=true})}}if(!t)r=Object.keys(r);if(!e.nosort)r=r.sort(jRn);if(e.mark){for(var n=0;n<r.length;n++){r[n]=e._mark(r[n])}if(e.nodir){r=r.filter(function(l){var c=!/\/$/.test(l);var d=e.cache[l]||e.cache[JF(e,l)];if(c&&d)c=d!=="DIR"&&!Array.isArray(d);return c})}}if(e.ignore.length)r=r.filter(function(l){return!lRt(e,l)});e.found=r}a(zRn,"finish");function KRn(e,t){var r=JF(e,t);var n=e.cache[r];var i=t;if(n){var s=n==="DIR"||Array.isArray(n);var o=t.slice(-1)==="/";if(s&&!o)i+="/";else if(!s&&o)i=i.slice(0,-1);if(i!==t){var u=JF(e,i);e.statCache[u]=e.statCache[r];e.cache[u]=e.cache[r]}}return i}a(KRn,"mark");function JF(e,t){var r=t;if(t.charAt(0)==="/"){r=IP.join(e.root,t)}else if(uRt(t)||t===""){r=t}else if(e.changedCwd){r=IP.resolve(e.cwd,t)}else{r=IP.resolve(t)}if(process.platform==="win32")r=r.replace(/\\/g,"/");return r}a(JF,"makeAbs");function lRt(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return r.matcher.match(t)||!!(r.gmatcher&&r.gmatcher.match(t))})}a(lRt,"isIgnored");function WRn(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return!!(r.gmatcher&&r.gmatcher.match(t))})}a(WRn,"childrenIgnored")});var mRt=y((T5s,fRt)=>{fRt.exports=pRt;pRt.GlobSync=ru;var YRn=oOe();var cRt=iQ();var A5s=cRt.Minimatch;var C5s=_Oe().Glob;var w5s=require("util");var gOe=require("path");var dRt=require("assert");var oQ=aQ();var oC=hOe();var XRn=oC.setopts;var yOe=oC.ownProp;var JRn=oC.childrenIgnored;var QRn=oC.isIgnored;function pRt(e,t){if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new ru(e,t).found}a(pRt,"globSync");function ru(e,t){if(!e)throw new Error("must provide pattern");if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof ru))return new ru(e,t);XRn(this,e,t);if(this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++){this._process(this.minimatch.set[n],n,false)}this._finish()}a(ru,"GlobSync");ru.prototype._finish=function(){dRt.ok(this instanceof ru);if(this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var i in t){try{i=e._makeAbs(i);var s=YRn.realpathSync(i,e.realpathCache);n[s]=true}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=true;else throw o}}})}oC.finish(this)};ru.prototype._process=function(e,t,r){dRt.ok(this instanceof ru);var n=0;while(typeof e[n]==="string"){n++}var i;switch(n){case e.length:this._processSimple(e.join("/"),t);return;case 0:i=null;break;default:i=e.slice(0,n).join("/");break}var s=e.slice(n);var o;if(i===null)o=".";else if(oQ(i)||oQ(e.map(function(c){return typeof c==="string"?c:"[*]"}).join("/"))){if(!i||!oQ(i))i="/"+i;o=i}else o=i;var u=this._makeAbs(o);if(JRn(this,o))return;var l=s[0]===cRt.GLOBSTAR;if(l)this._processGlobStar(i,o,u,s,t,r);else this._processReaddir(i,o,u,s,t,r)};ru.prototype._processReaddir=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n[0];var l=!!this.minimatch.negate;var c=u._glob;var d=this.dot||c.charAt(0)===".";var p=[];for(var f=0;f<o.length;f++){var m=o[f];if(m.charAt(0)!=="."||d){var h;if(l&&!e){h=!m.match(u)}else{h=m.match(u)}if(h)p.push(m)}}var g=p.length;if(g===0)return;if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var f=0;f<g;f++){var m=p[f];if(e){if(e.slice(-1)!=="/")m=e+"/"+m;else m=e+m}if(m.charAt(0)==="/"&&!this.nomount){m=gOe.join(this.root,m)}this._emitMatch(i,m)}return}n.shift();for(var f=0;f<g;f++){var m=p[f];var _;if(e)_=[e,m];else _=[m];this._process(_.concat(n),i,s)}};ru.prototype._emitMatch=function(e,t){if(QRn(this,t))return;var r=this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute){t=r}if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;if(this.stat)this._stat(t)};ru.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,false);var t;var r;var n;try{r=this.fs.lstatSync(e)}catch(s){if(s.code==="ENOENT"){return null}}var i=r&&r.isSymbolicLink();this.symlinks[e]=i;if(!i&&r&&!r.isDirectory())this.cache[e]="FILE";else t=this._readdir(e,false);return t};ru.prototype._readdir=function(e,t){var r;if(t&&!yOe(this.symlinks,e))return this._readdirInGlobStar(e);if(yOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){this._readdirError(e,i);return null}};ru.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat){for(var r=0;r<t.length;r++){var n=t[r];if(e==="/")n=e+n;else n=e+"/"+n;this.cache[n]=true}}this.cache[e]=t;return t};ru.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);this.cache[r]="FILE";if(r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);n.path=this.cwd;n.code=t.code;throw n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict)throw t;if(!this.silent)console.error("glob error",t);break}};ru.prototype._processGlobStar=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n.slice(1);var l=e?[e]:[];var c=l.concat(u);this._process(c,i,false);var d=o.length;var p=this.symlinks[r];if(p&&s)return;for(var f=0;f<d;f++){var m=o[f];if(m.charAt(0)==="."&&!this.dot)continue;var h=l.concat(o[f],u);this._process(h,i,true);var g=l.concat(o[f],n);this._process(g,i,true)}};ru.prototype._processSimple=function(e,t){var r=this._stat(e);if(!this.matches[t])this.matches[t]=Object.create(null);if(!r)return;if(e&&oQ(e)&&!this.nomount){var n=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=gOe.join(this.root,e)}else{e=gOe.resolve(this.root,e);if(n)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e)};ru.prototype._stat=function(e){var t=this._makeAbs(e);var r=e.slice(-1)==="/";if(e.length>this.maxLength)return false;if(!this.stat&&yOe(this.cache,t)){var o=this.cache[t];if(Array.isArray(o))o="DIR";if(!r||o==="DIR")return o;if(r&&o==="FILE")return false}var n;var i=this.statCache[t];if(!i){var s;try{s=this.fs.lstatSync(t)}catch(u){if(u&&(u.code==="ENOENT"||u.code==="ENOTDIR")){this.statCache[t]=false;return false}}if(s&&s.isSymbolicLink()){try{i=this.fs.statSync(t)}catch(u){i=s}}else{i=s}}this.statCache[t]=i;var o=true;if(i)o=i.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(r&&o==="FILE")return false;return o};ru.prototype._mark=function(e){return oC.mark(this,e)};ru.prototype._makeAbs=function(e){return oC.makeAbs(this,e)}});var gRt=y((R5s,hRt)=>{var ZRn=X2e();var QF=Object.create(null);var eOn=TW();hRt.exports=ZRn(tOn);function tOn(e,t){if(QF[e]){QF[e].push(t);return null}else{QF[e]=[t];return rOn(e)}}a(tOn,"inflight");function rOn(e){return eOn(a(function t(){var r=QF[e];var n=r.length;var i=nOn(arguments);try{for(var s=0;s<n;s++){r[s].apply(null,i)}}finally{if(r.length>n){r.splice(0,n);process.nextTick(function(){t.apply(null,i)})}else{delete QF[e]}}},"RES"))}a(rOn,"makeres");function nOn(e){var t=e.length;var r=[];for(var n=0;n<t;n++)r[n]=e[n];return r}a(nOn,"slice")});var _Oe=y((I5s,_Rt)=>{_Rt.exports=uC;var iOn=oOe();var yRt=iQ();var P5s=yRt.Minimatch;var sOn=Xv();var aOn=require("events").EventEmitter;var vOe=require("path");var EOe=require("assert");var ZF=aQ();var SOe=mRt();var lC=hOe();var oOn=lC.setopts;var bOe=lC.ownProp;var AOe=gRt();var N5s=require("util");var uOn=lC.childrenIgnored;var lOn=lC.isIgnored;var cOn=TW();function uC(e,t,r){if(typeof t==="function")r=t,t={};if(!t)t={};if(t.sync){if(r)throw new TypeError("callback provided to sync glob");return SOe(e,t)}return new Cs(e,t,r)}a(uC,"glob");uC.sync=SOe;var dOn=uC.GlobSync=SOe.GlobSync;uC.glob=uC;function pOn(e,t){if(t===null||typeof t!=="object"){return e}var r=Object.keys(t);var n=r.length;while(n--){e[r[n]]=t[r[n]]}return e}a(pOn,"extend");uC.hasMagic=function(e,t){var r=pOn({},t);r.noprocess=true;var n=new Cs(e,r);var i=n.minimatch.set;if(!e)return false;if(i.length>1)return true;for(var s=0;s<i[0].length;s++){if(typeof i[0][s]!=="string")return true}return false};uC.Glob=Cs;sOn(Cs,aOn);function Cs(e,t,r){if(typeof t==="function"){r=t;t=null}if(t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new dOn(e,t)}if(!(this instanceof Cs))return new Cs(e,t,r);oOn(this,e,t);this._didRealPath=false;var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof r==="function"){r=cOn(r);this.on("error",r);this.on("end",function(l){r(null,l)})}var i=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return u();var s=true;for(var o=0;o<n;o++){this._process(this.minimatch.set[o],o,false,u)}s=false;function u(){--i._processing;if(i._processing<=0){if(s){process.nextTick(function(){i._finish()})}else{i._finish()}}}a(u,"done")}a(Cs,"Glob");Cs.prototype._finish=function(){EOe(this instanceof Cs);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();lC.finish(this);this.emit("end",this.found)};Cs.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var e=this.matches.length;if(e===0)return this._finish();var t=this;for(var r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){if(--e===0)t._finish()}a(n,"next")};Cs.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r);var i=this;var s=n.length;if(s===0)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(u,l){u=i._makeAbs(u);iOn.realpath(u,i.realpathCache,function(c,d){if(!c)o[d]=true;else if(c.syscall==="stat")o[u]=true;else i.emit("error",c);if(--s===0){i.matches[e]=o;t()}})})};Cs.prototype._mark=function(e){return lC.mark(this,e)};Cs.prototype._makeAbs=function(e){return lC.makeAbs(this,e)};Cs.prototype.abort=function(){this.aborted=true;this.emit("abort")};Cs.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Cs.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<n.length;t++){var i=n[t];this._processing--;this._process(i[0],i[1],i[2],i[3])}}}};Cs.prototype._process=function(e,t,r,n){EOe(this instanceof Cs);EOe(typeof n==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([e,t,r,n]);return}var i=0;while(typeof e[i]==="string"){i++}var s;switch(i){case e.length:this._processSimple(e.join("/"),t,n);return;case 0:s=null;break;default:s=e.slice(0,i).join("/");break}var o=e.slice(i);var u;if(s===null)u=".";else if(ZF(s)||ZF(e.map(function(d){return typeof d==="string"?d:"[*]"}).join("/"))){if(!s||!ZF(s))s="/"+s;u=s}else u=s;var l=this._makeAbs(u);if(uOn(this,u))return n();var c=o[0]===yRt.GLOBSTAR;if(c)this._processGlobStar(s,u,l,o,t,r,n);else this._processReaddir(s,u,l,o,t,r,n)};Cs.prototype._processReaddir=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){return u._processReaddir2(e,t,r,n,i,s,c,o)})};Cs.prototype._processReaddir2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n[0];var c=!!this.minimatch.negate;var d=l._glob;var p=this.dot||d.charAt(0)===".";var f=[];for(var m=0;m<o.length;m++){var h=o[m];if(h.charAt(0)!=="."||p){var g;if(c&&!e){g=!h.match(l)}else{g=h.match(l)}if(g)f.push(h)}}var _=f.length;if(_===0)return u();if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var m=0;m<_;m++){var h=f[m];if(e){if(e!=="/")h=e+"/"+h;else h=e+h}if(h.charAt(0)==="/"&&!this.nomount){h=vOe.join(this.root,h)}this._emitMatch(i,h)}return u()}n.shift();for(var m=0;m<_;m++){var h=f[m];var v;if(e){if(e!=="/")h=e+"/"+h;else h=e+h}this._process([h].concat(n),i,s,u)}u()};Cs.prototype._emitMatch=function(e,t){if(this.aborted)return;if(lOn(this,t))return;if(this.paused){this._emitQueue.push([e,t]);return}var r=ZF(t)?t:this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute)t=r;if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;var i=this.statCache[r];if(i)this.emit("stat",t,i);this.emit("match",t)};Cs.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,false,t);var r="lstat\0"+e;var n=this;var i=AOe(r,s);if(i)n.fs.lstat(e,i);function s(o,u){if(o&&o.code==="ENOENT")return t();var l=u&&u.isSymbolicLink();n.symlinks[e]=l;if(!l&&u&&!u.isDirectory()){n.cache[e]="FILE";t()}else n._readdir(e,false,t)}a(s,"lstatcb_")};Cs.prototype._readdir=function(e,t,r){if(this.aborted)return;r=AOe("readdir\0"+e+"\0"+t,r);if(!r)return;if(t&&!bOe(this.symlinks,e))return this._readdirInGlobStar(e,r);if(bOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;i.fs.readdir(e,fOn(this,e,r))};function fOn(e,t,r){return function(n,i){if(n)e._readdirError(t,n,r);else e._readdirEntries(t,i,r)}}a(fOn,"readdirCb");Cs.prototype._readdirEntries=function(e,t,r){if(this.aborted)return;if(!this.mark&&!this.stat){for(var n=0;n<t.length;n++){var i=t[n];if(e==="/")i=e+i;else i=e+"/"+i;this.cache[i]=true}}this.cache[e]=t;return r(null,t)};Cs.prototype._readdirError=function(e,t,r){if(this.aborted)return;switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);this.cache[n]="FILE";if(n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd;i.code=t.code;this.emit("error",i);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict){this.emit("error",t);this.abort()}if(!this.silent)console.error("glob error",t);break}return r()};Cs.prototype._processGlobStar=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){u._processGlobStar2(e,t,r,n,i,s,c,o)})};Cs.prototype._processGlobStar2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n.slice(1);var c=e?[e]:[];var d=c.concat(l);this._process(d,i,false,u);var p=this.symlinks[r];var f=o.length;if(p&&s)return u();for(var m=0;m<f;m++){var h=o[m];if(h.charAt(0)==="."&&!this.dot)continue;var g=c.concat(o[m],l);this._process(g,i,true,u);var _=c.concat(o[m],n);this._process(_,i,true,u)}u()};Cs.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,s){n._processSimple2(e,t,i,s,r)})};Cs.prototype._processSimple2=function(e,t,r,n,i){if(!this.matches[t])this.matches[t]=Object.create(null);if(!n)return i();if(e&&ZF(e)&&!this.nomount){var s=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=vOe.join(this.root,e)}else{e=vOe.resolve(this.root,e);if(s)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e);i()};Cs.prototype._stat=function(e,t){var r=this._makeAbs(e);var n=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&bOe(this.cache,r)){var i=this.cache[r];if(Array.isArray(i))i="DIR";if(!n||i==="DIR")return t(null,i);if(n&&i==="FILE")return t()}var s;var o=this.statCache[r];if(o!==void 0){if(o===false)return t(null,o);else{var u=o.isDirectory()?"DIR":"FILE";if(n&&u==="FILE")return t();else return t(null,u,o)}}var l=this;var c=AOe("stat\0"+r,d);if(c)l.fs.lstat(r,c);function d(p,f){if(f&&f.isSymbolicLink()){return l.fs.stat(r,function(m,h){if(m)l._stat2(e,r,null,f,t);else l._stat2(e,r,m,h,t)})}else{l._stat2(e,r,p,f,t)}}a(d,"lstatcb_")};Cs.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[t]=false;return i()}var s=e.slice(-1)==="/";this.statCache[t]=n;if(t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,false,n);var o=true;if(n)o=n.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(s&&o==="FILE")return i();return i(null,o,n)}});var xRt=y((D5s,TRt)=>{TRt.exports=TOe;TOe.sync=wRt;var ds=require("assert");var SRt=require("path");var vRt=require("fs");var cQ=_Oe();var ARt=parseInt("666",8);var mOn={nosort:true,silent:true};var COe=0;var e7=process.platform==="win32";function CRt(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach(function(r){e[r]=e[r]||vRt[r];r=r+"Sync";e[r]=e[r]||vRt[r]});e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}e.disableGlob=e.disableGlob||false;e.glob=e.glob||mOn}a(CRt,"defaults");function TOe(e,t,r){if(typeof t==="function"){r=t;t={}}ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds.equal(typeof r,"function","rimraf: callback function required");ds(t,"rimraf: invalid options argument provided");ds.equal(typeof t,"object","rimraf: options should be object");CRt(t);var n=0;var i=null;var s=0;if(t.disableGlob||!cQ.hasMagic(e))return u(null,[e]);t.lstat(e,function(l,c){if(!l)return u(null,[e]);cQ(e,t.glob,u)});function o(l){i=i||l;if(--s===0)r(i)}a(o,"next");function u(l,c){if(l)return r(l);s=c.length;if(s===0)return r();c.forEach(function(d){wOe(d,t,a(function p(f){if(f){if((f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<t.maxBusyTries){n++;var m=n*100;return setTimeout(function(){wOe(d,t,p)},m)}if(f.code==="EMFILE"&&COe<t.emfileWait){return setTimeout(function(){wOe(d,t,p)},COe++)}if(f.code==="ENOENT")f=null}COe=0;o(f)},"CB"))})}a(u,"afterGlob")}a(TOe,"rimraf");function wOe(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.lstat(e,function(n,i){if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&e7)ERt(e,t,n,r);if(i&&i.isDirectory())return uQ(e,t,n,r);t.unlink(e,function(s){if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return e7?ERt(e,t,s,r):uQ(e,t,s,r);if(s.code==="EISDIR")return uQ(e,t,s,r)}return r(s)})})}a(wOe,"rimraf_");function ERt(e,t,r,n){ds(e);ds(t);ds(typeof n==="function");if(r)ds(r instanceof Error);t.chmod(e,ARt,function(i){if(i)n(i.code==="ENOENT"?null:r);else t.stat(e,function(s,o){if(s)n(s.code==="ENOENT"?null:r);else if(o.isDirectory())uQ(e,t,r,n);else t.unlink(e,n)})})}a(ERt,"fixWinEPERM");function bRt(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.chmodSync(e,ARt)}catch(i){if(i.code==="ENOENT")return;else throw r}try{var n=t.statSync(e)}catch(i){if(i.code==="ENOENT")return;else throw r}if(n.isDirectory())lQ(e,t,r);else t.unlinkSync(e)}a(bRt,"fixWinEPERMSync");function uQ(e,t,r,n){ds(e);ds(t);if(r)ds(r instanceof Error);ds(typeof n==="function");t.rmdir(e,function(i){if(i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM"))hOn(e,t,n);else if(i&&i.code==="ENOTDIR")n(r);else n(i)})}a(uQ,"rmdir");function hOn(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.readdir(e,function(n,i){if(n)return r(n);var s=i.length;if(s===0)return t.rmdir(e,r);var o;i.forEach(function(u){TOe(SRt.join(e,u),t,function(l){if(o)return;if(l)return r(o=l);if(--s===0)t.rmdir(e,r)})})})}a(hOn,"rmkids");function wRt(e,t){t=t||{};CRt(t);ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds(t,"rimraf: missing options");ds.equal(typeof t,"object","rimraf: options should be object");var r;if(t.disableGlob||!cQ.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(s){r=cQ.sync(e,t.glob)}}if(!r.length)return;for(var n=0;n<r.length;n++){var e=r[n];try{var i=t.lstatSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM"&&e7)bRt(e,t,o)}try{if(i&&i.isDirectory())lQ(e,t,null);else t.unlinkSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM")return e7?bRt(e,t,o):lQ(e,t,o);if(o.code!=="EISDIR")throw o;lQ(e,t,o)}}}a(wRt,"rimrafSync");function lQ(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")gOn(e,t)}}a(lQ,"rmdirSync");function gOn(e,t){ds(e);ds(t);t.readdirSync(e).forEach(function(o){wRt(SRt.join(e,o),t)});var r=e7?100:1;var n=0;do{var i=true;try{var s=t.rmdirSync(e,t);i=false;return s}finally{if(++n<r&&i)continue}}while(true)}a(gOn,"rmkidsSync")});var NRt=y((F5s,PRt)=>{var t7=require("path");var RRt=require("fs");var ORt=parseInt("0777",8);PRt.exports=kP.mkdirp=kP.mkdirP=kP;function kP(e,t,r,n){if(typeof t==="function"){r=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}var i=t.mode;var s=t.fs||RRt;if(i===void 0){i=ORt}if(!n)n=null;var o=r||function(){};e=t7.resolve(e);s.mkdir(e,i,function(u){if(!u){n=n||e;return o(null,n)}switch(u.code){case"ENOENT":if(t7.dirname(e)===e)return o(u);kP(t7.dirname(e),t,function(l,c){if(l)o(l,c);else kP(e,t,o,c)});break;default:s.stat(e,function(l,c){if(l||!c.isDirectory())o(u,n);else o(null,n)});break}})}a(kP,"mkdirP");kP.sync=a(function e(t,r,n){if(!r||typeof r!=="object"){r={mode:r}}var i=r.mode;var s=r.fs||RRt;if(i===void 0){i=ORt}if(!n)n=null;t=t7.resolve(t);try{s.mkdirSync(t,i);n=n||t}catch(u){switch(u.code){case"ENOENT":n=e(t7.dirname(t),r,n);e(t,r,n);break;default:var o;try{o=s.statSync(t)}catch(l){throw u}if(!o.isDirectory())throw u;break}}return n},"sync")});var $Rt=y((yh,URt)=>{var xOe=require("fs");var kRt=require("path");var dQ=require("constants");var yOn=require("os");var ROe=xRt();var DRt=NRt();var M5s=require("os").tmpdir();var LRt=ROe.sync;var FRt=kRt.resolve(yOn.tmpdir());var OOe=dQ.O_CREAT|dQ.O_TRUNC|dQ.O_RDWR|dQ.O_EXCL;var r7=a(function(e){if(typeof e==="function"){return[void 0,e]}var t;var r=new Promise(function(n,i){t=a(function(){var s=Array.from(arguments);var o=s.shift();process.nextTick(function(){if(o){i(o)}else if(s.length===1){n(s[0])}else{n(s)}})},"promiseCallback")});return[r,t]},"promisify");var DP=a(function(e,t){var r=_On(e,t);var n=new Date;var i=[r.prefix,n.getFullYear(),n.getMonth(),n.getDate(),"-",process.pid,"-",(Math.random()*4294967296+1).toString(36),r.suffix].join("");return kRt.join(r.dir||FRt,i)},"generateName");var _On=a(function(e,t){var r={prefix:null,suffix:null};if(e){switch(typeof e){case"string":r.prefix=e;break;case"object":r=e;break;default:throw new Error("Unknown affix declaration: "+r)}}else{r.prefix=t}return r},"parseAffixes");var ag=false;var vOn=a(function(e){ag=e!==false;return URt.exports},"track");var IRt=false;var pQ=[];var fQ=[];function POe(e){if(!ag)return false;MRt();pQ.push(e)}a(POe,"deleteFileOnExit");function BRt(e){if(!ag)return false;MRt();fQ.push(e)}a(BRt,"deleteDirOnExit");function MRt(){if(!ag)return false;if(!IRt){process.addListener("exit",function(){try{qRt()}catch(e){console.warn("Fail to clean temporary files on exit : ",e);throw e}});IRt=true}}a(MRt,"attachExitListener");function EOn(){if(!ag){return false}var e=0;var t;while((t=pQ.shift())!==void 0){LRt(t,{maxBusyTries:6});e++}return e}a(EOn,"cleanupFilesSync");function bOn(e){var t=r7(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=pQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=pQ.shift())!==void 0){ROe(s,{maxBusyTries:6},o)}return r}a(bOn,"cleanupFiles");function SOn(){if(!ag){return false}var e=0;var t;while((t=fQ.shift())!==void 0){LRt(t,{maxBusyTries:6});e++}return e}a(SOn,"cleanupDirsSync");function AOn(e){var t=r7(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=fQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u,n);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=fQ.shift())!==void 0){ROe(s,{maxBusyTries:6},o)}return r}a(AOn,"cleanupDirs");function qRt(){if(!ag){return false}var e=EOn();var t=SOn();return{files:e,dirs:t}}a(qRt,"cleanupSync");function COn(e){var t=r7(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}bOn(function(n,i){if(n){e(n,{files:i})}else{AOn(function(s,o){e(s,{files:i,dirs:o})})}});return r}a(COn,"cleanup");var wOn=a((e,t)=>{const r=r7(t);const n=r[0];t=r[1];let i=DP(e,"d-");DRt(i,448,s=>{if(!s){BRt(i)}t(s,i)});return n},"mkdir");var TOn=a(e=>{let t=DP(e,"d-");DRt.sync(t,448);BRt(t);return t},"mkdirSync");var xOn=a((e,t)=>{const r=r7(t);const n=r[0];t=r[1];const i=DP(e,"f-");xOe.open(i,OOe,384,(s,o)=>{if(!s){POe(i)}t(s,{path:i,fd:o})});return n},"open");var ROn=a(e=>{const t=DP(e,"f-");let r=xOe.openSync(t,OOe,384);POe(t);return{path:t,fd:r}},"openSync");var OOn=a(e=>{const t=DP(e,"s-");let r=xOe.createWriteStream(t,{flags:OOe,mode:384});POe(t);return r},"createWriteStream");yh.dir=FRt;yh.track=vOn;yh.mkdir=wOn;yh.mkdirSync=TOn;yh.open=xOn;yh.openSync=ROn;yh.path=DP;yh.cleanup=COn;yh.cleanupSync=qRt;yh.createWriteStream=OOn});var VRt=y(LP=>{"use strict";var HRt=LP&&LP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(LP,"__esModule",{value:true});LP.generateBuildData=void 0;var mQ=hn();var jRt=require("fs/promises");var GRt=HRt(require("path"));var POn=Fn();var NOn=HRt(xs());var IOn=a(async function({systemDirectory:e,buildId:t,logger:r,config:n,publicZuploEnvironmentVariables:i}){return NOn.default.timeFn("Generating build data",async()=>{r.debug(`Generating build data`);const s=await(0,jRt.readFile)(GRt.default.resolve(__dirname,"../../../package.json"),"utf-8");const o=JSON.parse(s);const u={BUILD_ID:t??"",GIT_SHA:process.env.GIT_SHA,TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:mQ.env.isProduction(),BUILD_ENV:mQ.env.NODE_ENV,ZUPLO_VERSION:o.version,API_VERSION:process.env.API_VERSION,COMPATIBILITY_DATE:n?.compatibilityDate,ACCOUNT_NAME:i?.ZUPLO_ACCOUNT_NAME,PROJECT_NAME:i?.ZUPLO_PROJECT_NAME,ENVIRONMENT_TYPE:i?.ZUPLO_ENVIRONMENT_TYPE,COMPATIBILITY_FLAGS:mQ.COMPATIBILITY_FLAG_MAPPINGS?mQ.COMPATIBILITY_FLAG_MAPPINGS[n?.compatibilityDate??"none"]:{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false}};const l=JSON.stringify(u,void 0,2);const c=GRt.default.join(e,POn.GENERATED_BUILD_JSON_FILE);try{await(0,jRt.writeFile)(c,l.trimStart(),"utf-8")}catch(d){r.error(d);const p={message:`Error creating file at ${c}`,pluginName:"buildData",severity:"error"};return{warnings:[],errors:[p]}}return{warnings:[],errors:[]}})},"generateBuildData");LP.generateBuildData=IOn});var zRt=y(FP=>{"use strict";var IOe=FP&&FP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(FP,"__esModule",{value:true});FP.generateWorker=void 0;var kOn=IOe(require("fs/promises"));var DOn=IOe(require("path"));var NOe=Fn();var LOn=IOe(xs());var FOn=a(async function({systemDirectory:e,logger:t}){return LOn.default.timeFn("Generating Worker shim",async()=>{t.debug("Generating Worker shim");const r=`import { Handler, ServiceProviderImpl } from "@zuplo/runtime";
410
+ `+await e.crypto.sha256DigestHex(m);const _=await fSn(e.crypto,e.securityCredentials.secretAccessKey,o,e.region,n);const v=await vF(e.crypto,_,g);const S=`${PCt} Credential=${e.securityCredentials.accessKeyId}/${h}, SignedHeaders=${p}, Signature=${(0,NCt.fromArrayBufferToHex)(v)}`;return{amzDate:u.date?void 0:s,authorizationHeader:S,canonicalQuerystring:e.canonicalQuerystring}}a(mSn,"generateAuthenticationHeaderMap")});var ZTe=y(QX=>{"use strict";Object.defineProperty(QX,"__esModule",{value:true});QX.AwsClient=void 0;var hSn=ICt();var gSn=ME();var EF=class extends gSn.BaseExternalAccountClient{static{a(this,"AwsClient")}constructor(t,r){super(t,r);this.environmentId=t.credential_source.environment_id;this.regionUrl=t.credential_source.region_url;this.securityCredentialsUrl=t.credential_source.url;this.regionalCredVerificationUrl=t.credential_source.regional_cred_verification_url;this.imdsV2SessionTokenUrl=t.credential_source.imdsv2_session_token_url;this.awsRequestSigner=null;this.region="";this.validateEnvironmentId()}validateEnvironmentId(){var t;const r=(t=this.environmentId)===null||t===void 0?void 0:t.match(/^(aws)(\d+)$/);if(!r||!this.regionalCredVerificationUrl){throw new Error('No valid AWS "credential_source" provided')}else if(parseInt(r[2],10)!==1){throw new Error(`aws version "${r[2]}" is not supported in the current build.`)}}async retrieveSubjectToken(){if(!this.awsRequestSigner){const i={};if(this.shouldUseMetadataServer()&&this.imdsV2SessionTokenUrl){i["x-aws-ec2-metadata-token"]=await this.getImdsV2SessionToken()}this.region=await this.getAwsRegion(i);this.awsRequestSigner=new hSn.AwsRequestSigner(async()=>{if(this.securityCredentialsFromEnv){return this.securityCredentialsFromEnv}const s=await this.getAwsRoleName(i);const o=await this.getAwsSecurityCredentials(s,i);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,token:o.Token}},this.region)}const t=await this.awsRequestSigner.getRequestOptions({url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"});const r=[];const n=Object.assign({"x-goog-cloud-target-resource":this.audience},t.headers);for(const i in n){r.push({key:i,value:n[i]})}return encodeURIComponent(JSON.stringify({url:t.url,method:t.method,headers:r}))}async getImdsV2SessionToken(){const t={url:this.imdsV2SessionTokenUrl,method:"PUT",responseType:"text",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};const r=await this.transporter.request(t);return r.data}async getAwsRegion(t){if(this.regionFromEnv){return this.regionFromEnv}if(!this.regionUrl){throw new Error('Unable to determine AWS region due to missing "options.credential_source.region_url"')}const r={url:this.regionUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data.substr(0,n.data.length-1)}async getAwsRoleName(t){if(!this.securityCredentialsUrl){throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"')}const r={url:this.securityCredentialsUrl,method:"GET",responseType:"text",headers:t};const n=await this.transporter.request(r);return n.data}async getAwsSecurityCredentials(t,r){const n=await this.transporter.request({url:`${this.securityCredentialsUrl}/${t}`,responseType:"json",headers:r});return n.data}shouldUseMetadataServer(){return!this.regionFromEnv||!this.securityCredentialsFromEnv}get regionFromEnv(){return process.env["AWS_REGION"]||process.env["AWS_DEFAULT_REGION"]||null}get securityCredentialsFromEnv(){if(process.env["AWS_ACCESS_KEY_ID"]&&process.env["AWS_SECRET_ACCESS_KEY"]){return{accessKeyId:process.env["AWS_ACCESS_KEY_ID"],secretAccessKey:process.env["AWS_SECRET_ACCESS_KEY"],token:process.env["AWS_SESSION_TOKEN"]}}return null}};QX.AwsClient=EF;EF.AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";EF.AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254"});var ixe=y(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:true});Do.InvalidSubjectTokenError=Do.InvalidMessageFieldError=Do.InvalidCodeFieldError=Do.InvalidTokenTypeFieldError=Do.InvalidExpirationTimeFieldError=Do.InvalidSuccessFieldError=Do.InvalidVersionFieldError=Do.ExecutableResponseError=Do.ExecutableResponse=void 0;var ZX="urn:ietf:params:oauth:token-type:saml2";var exe="urn:ietf:params:oauth:token-type:id_token";var txe="urn:ietf:params:oauth:token-type:jwt";var rxe=class{static{a(this,"ExecutableResponse")}constructor(t){if(!t.version){throw new eJ("Executable response must contain a 'version' field.")}if(t.success===void 0){throw new tJ("Executable response must contain a 'success' field.")}this.version=t.version;this.success=t.success;if(this.success){this.expirationTime=t.expiration_time;this.tokenType=t.token_type;if(this.tokenType!==ZX&&this.tokenType!==exe&&this.tokenType!==txe){throw new rJ(`Executable response must contain a 'token_type' field when successful and it must be one of ${exe}, ${txe}, or ${ZX}.`)}if(this.tokenType===ZX){if(!t.saml_response){throw new bF(`Executable response must contain a 'saml_response' field when token_type=${ZX}.`)}this.subjectToken=t.saml_response}else{if(!t.id_token){throw new bF(`Executable response must contain a 'id_token' field when token_type=${exe} or ${txe}.`)}this.subjectToken=t.id_token}}else{if(!t.code){throw new nJ("Executable response must contain a 'code' field when unsuccessful.")}if(!t.message){throw new iJ("Executable response must contain a 'message' field when unsuccessful.")}this.errorCode=t.code;this.errorMessage=t.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};Do.ExecutableResponse=rxe;var tg=class extends Error{static{a(this,"ExecutableResponseError")}constructor(t){super(t);Object.setPrototypeOf(this,new.target.prototype)}};Do.ExecutableResponseError=tg;var eJ=class extends tg{static{a(this,"InvalidVersionFieldError")}};Do.InvalidVersionFieldError=eJ;var tJ=class extends tg{static{a(this,"InvalidSuccessFieldError")}};Do.InvalidSuccessFieldError=tJ;var nxe=class extends tg{static{a(this,"InvalidExpirationTimeFieldError")}};Do.InvalidExpirationTimeFieldError=nxe;var rJ=class extends tg{static{a(this,"InvalidTokenTypeFieldError")}};Do.InvalidTokenTypeFieldError=rJ;var nJ=class extends tg{static{a(this,"InvalidCodeFieldError")}};Do.InvalidCodeFieldError=nJ;var iJ=class extends tg{static{a(this,"InvalidMessageFieldError")}};Do.InvalidMessageFieldError=iJ;var bF=class extends tg{static{a(this,"InvalidSubjectTokenError")}};Do.InvalidSubjectTokenError=bF});var kCt=y(sJ=>{"use strict";Object.defineProperty(sJ,"__esModule",{value:true});sJ.PluggableAuthHandler=void 0;var ySn=aJ();var QA=ixe();var _Sn=require("child_process");var sxe=require("fs");var axe=class e{static{a(this,"PluggableAuthHandler")}constructor(t){if(!t.command){throw new Error("No command provided.")}this.commandComponents=e.parseCommand(t.command);this.timeoutMillis=t.timeoutMillis;if(!this.timeoutMillis){throw new Error("No timeoutMillis provided.")}this.outputFile=t.outputFile}retrieveResponseFromExecutable(t){return new Promise((r,n)=>{const i=_Sn.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(t)}});let s="";i.stdout.on("data",u=>{s+=u});i.stderr.on("data",u=>{s+=u});const o=setTimeout(()=>{i.removeAllListeners();i.kill();return n(new Error("The executable failed to finish within the timeout specified."))},this.timeoutMillis);i.on("close",u=>{clearTimeout(o);if(u===0){try{const l=JSON.parse(s);const c=new QA.ExecutableResponse(l);return r(c)}catch(l){if(l instanceof QA.ExecutableResponseError){return n(l)}return n(new QA.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}}else{return n(new ySn.ExecutableError(s,u.toString()))}})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0){return void 0}let t;try{t=await sxe.promises.realpath(this.outputFile)}catch(n){return void 0}if(!(await sxe.promises.lstat(t)).isFile()){return void 0}const r=await sxe.promises.readFile(t,{encoding:"utf8"});if(r===""){return void 0}try{const n=JSON.parse(r);const i=new QA.ExecutableResponse(n);if(i.isValid()){return new QA.ExecutableResponse(n)}return void 0}catch(n){if(n instanceof QA.ExecutableResponseError){throw n}throw new QA.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(t){const r=t.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r){throw new Error(`Provided command: "${t}" could not be parsed.`)}for(let n=0;n<r.length;n++){if(r[n][0]==='"'&&r[n].slice(-1)==='"'){r[n]=r[n].slice(1,-1)}}return r}};sJ.PluggableAuthHandler=axe});var aJ=y(KO=>{"use strict";Object.defineProperty(KO,"__esModule",{value:true});KO.PluggableAuthClient=KO.ExecutableError=void 0;var vSn=ME();var ESn=ixe();var bSn=kCt();var oJ=class extends Error{static{a(this,"ExecutableError")}constructor(t,r){super(`The executable failed with exit code: ${r} and error message: ${t}.`);this.code=r;Object.setPrototypeOf(this,new.target.prototype)}};KO.ExecutableError=oJ;var SSn=30*1e3;var DCt=5*1e3;var LCt=120*1e3;var ASn="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES";var FCt=1;var oxe=class extends vSn.BaseExternalAccountClient{static{a(this,"PluggableAuthClient")}constructor(t,r){super(t,r);if(!t.credential_source.executable){throw new Error('No valid Pluggable Auth "credential_source" provided.')}this.command=t.credential_source.executable.command;if(!this.command){throw new Error('No valid Pluggable Auth "credential_source" provided.')}if(t.credential_source.executable.timeout_millis===void 0){this.timeoutMillis=SSn}else{this.timeoutMillis=t.credential_source.executable.timeout_millis;if(this.timeoutMillis<DCt||this.timeoutMillis>LCt){throw new Error(`Timeout must be between ${DCt} and ${LCt} milliseconds.`)}}this.outputFile=t.credential_source.executable.output_file;this.handler=new bSn.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile})}async retrieveSubjectToken(){if(process.env[ASn]!=="1"){throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.")}let t=void 0;if(this.outputFile){t=await this.handler.retrieveCachedResponse()}if(!t){const r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience);r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType);r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0");if(this.outputFile){r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile)}const n=this.getServiceAccountEmail();if(n){r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n)}t=await this.handler.retrieveResponseFromExecutable(r)}if(t.version>FCt){throw new Error(`Version of executable is not currently supported, maximum supported version is ${FCt}.`)}if(!t.success){throw new oJ(t.errorMessage,t.errorCode)}if(this.outputFile){if(!t.expirationTime){throw new ESn.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.")}}if(t.isExpired()){throw new Error("Executable response is expired.")}return t.subjectToken}};KO.PluggableAuthClient=oxe});var lxe=y(uJ=>{"use strict";Object.defineProperty(uJ,"__esModule",{value:true});uJ.ExternalAccountClient=void 0;var CSn=ME();var wSn=JTe();var TSn=ZTe();var xSn=aJ();var uxe=class{static{a(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(t,r){var n,i;if(t&&t.type===CSn.EXTERNAL_ACCOUNT_TYPE){if((n=t.credential_source)===null||n===void 0?void 0:n.environment_id){return new TSn.AwsClient(t,r)}else if((i=t.credential_source)===null||i===void 0?void 0:i.executable){return new xSn.PluggableAuthClient(t,r)}else{return new wSn.IdentityPoolClient(t,r)}}else{return null}}};uJ.ExternalAccountClient=uxe});var MCt=y(WO=>{"use strict";Object.defineProperty(WO,"__esModule",{value:true});WO.ExternalAccountAuthorizedUserClient=WO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var RSn=xO();var BCt=UTe();var OSn=Ey();var PSn=require("stream");var NSn=ME();WO.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var cxe=class extends BCt.OAuthClientAuthHandler{static{a(this,"ExternalAccountAuthorizedUserHandler")}constructor(t,r,n){super(n);this.url=t;this.transporter=r}async refreshToken(t,r){const n=new URLSearchParams({grant_type:"refresh_token",refresh_token:t});const i={"Content-Type":"application/x-www-form-urlencoded",...r};const s={url:this.url,method:"POST",headers:i,data:n.toString(),responseType:"json"};this.applyClientAuthenticationOptions(s);try{const o=await this.transporter.request(s);const u=o.data;u.res=o;return u}catch(o){if(o instanceof OSn.GaxiosError&&o.response){throw(0,BCt.getErrorFromOAuthErrorResponse)(o.response.data,o)}throw o}}};var dxe=class extends RSn.AuthClient{static{a(this,"ExternalAccountAuthorizedUserClient")}constructor(t,r){super();this.refreshToken=t.refresh_token;const n={confidentialClientType:"basic",clientId:t.client_id,clientSecret:t.client_secret};this.externalAccountAuthorizedUserHandler=new cxe(t.token_url,this.transporter,n);this.cachedAccessToken=null;this.quotaProjectId=t.quota_project_id;if(typeof(r===null||r===void 0?void 0:r.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=NSn.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=r.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(r===null||r===void 0?void 0:r.forceRefreshOnFailure)}async getAccessToken(){if(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof PSn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){const t=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);this.cachedAccessToken={access_token:t.access_token,expiry_date:new Date().getTime()+t.expires_in*1e3,res:t.res};if(t.refresh_token!==void 0){this.refreshToken=t.refresh_token}return this.cachedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};WO.ExternalAccountAuthorizedUserClient=dxe});var $Ct=y(XO=>{"use strict";Object.defineProperty(XO,"__esModule",{value:true});XO.GoogleAuth=XO.CLOUD_SDK_CLIENT_ID=void 0;var ISn=require("child_process");var SF=require("fs");var pxe=tX();var kSn=require("os");var fxe=require("path");var DSn=wO();var LSn=rF();var FSn=Swe();var BSn=Cwe();var MSn=wwe();var YO=DTe();var mxe=FTe();var lJ=MTe();var qSn=lxe();var AF=ME();var qCt=MCt();XO.CLOUD_SDK_CLIENT_ID="764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com";var UCt={NO_PROJECT_ID_FOUND:"Unable to detect a Project Id in the current environment. \nTo learn more about authentication and Google APIs, visit: \nhttps://cloud.google.com/docs/authentication/getting-started"};var cJ=class{static{a(this,"GoogleAuth")}get isGCE(){return this.checkIsGCE}constructor(t){this.checkIsGCE=void 0;this.jsonContent=null;this.cachedCredential=null;t=t||{};this._cachedProjectId=t.projectId||null;this.cachedCredential=t.authClient||null;this.keyFilename=t.keyFilename||t.keyFile;this.scopes=t.scopes;this.jsonContent=t.credentials||null;this.clientOptions=t.clientOptions}setGapicJWTValues(t){t.defaultServicePath=this.defaultServicePath;t.useJWTAccessWithScope=this.useJWTAccessWithScope;t.defaultScopes=this.defaultScopes}getProjectId(t){if(t){this.getProjectIdAsync().then(r=>t(null,r),t)}else{return this.getProjectIdAsync()}}async getProjectIdOptional(){try{return await this.getProjectId()}catch(t){if(t instanceof Error&&t.message===UCt.NO_PROJECT_ID_FOUND){return null}else{throw t}}}async findAndCacheProjectId(){let t=null;t||(t=await this.getProductionProjectId());t||(t=await this.getFileProjectId());t||(t=await this.getDefaultServiceProjectId());t||(t=await this.getGCEProjectId());t||(t=await this.getExternalAccountClientProjectId());if(t){this._cachedProjectId=t;return t}else{throw new Error(UCt.NO_PROJECT_ID_FOUND)}}async getProjectIdAsync(){if(this._cachedProjectId){return this._cachedProjectId}if(!this._findProjectIdPromise){this._findProjectIdPromise=this.findAndCacheProjectId()}return this._findProjectIdPromise}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(t={},r){let n;if(typeof t==="function"){r=t}else{n=t}if(r){this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r)}else{return this.getApplicationDefaultAsync(n)}}async getApplicationDefaultAsync(t={}){if(this.cachedCredential){return await this.prepareAndCacheADC(this.cachedCredential)}const r=process.env["GOOGLE_CLOUD_QUOTA_PROJECT"];let n;n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(t);if(n){if(n instanceof YO.JWT){n.scopes=this.scopes}else if(n instanceof AF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}n=await this._tryGetApplicationCredentialsFromWellKnownFile(t);if(n){if(n instanceof YO.JWT){n.scopes=this.scopes}else if(n instanceof AF.BaseExternalAccountClient){n.scopes=this.getAnyScopes()}return await this.prepareAndCacheADC(n,r)}let i;try{i=await this._checkIsGCE()}catch(s){if(s instanceof Error){s.message=`Unexpected error determining execution environment: ${s.message}`}throw s}if(!i){throw new Error("Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.")}t.scopes=this.getAnyScopes();return await this.prepareAndCacheADC(new FSn.Compute(t),r)}async prepareAndCacheADC(t,r){const n=await this.getProjectIdOptional();if(r){t.quotaProjectId=r}this.cachedCredential=t;return{credential:t,projectId:n}}async _checkIsGCE(){if(this.checkIsGCE===void 0){this.checkIsGCE=await pxe.isAvailable()}return this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(t){const r=process.env["GOOGLE_APPLICATION_CREDENTIALS"]||process.env["google_application_credentials"];if(!r||r.length===0){return null}try{return this._getApplicationCredentialsFromFilePath(r,t)}catch(n){if(n instanceof Error){n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`}throw n}}async _tryGetApplicationCredentialsFromWellKnownFile(t){let r=null;if(this._isWindows()){r=process.env["APPDATA"]}else{const i=process.env["HOME"];if(i){r=fxe.join(i,".config")}}if(r){r=fxe.join(r,"gcloud","application_default_credentials.json");if(!SF.existsSync(r)){r=null}}if(!r){return null}const n=await this._getApplicationCredentialsFromFilePath(r,t);return n}async _getApplicationCredentialsFromFilePath(t,r={}){if(!t||t.length===0){throw new Error("The file path is invalid.")}try{t=SF.realpathSync(t);if(!SF.lstatSync(t).isFile()){throw new Error}}catch(i){if(i instanceof Error){i.message=`The file at ${t} does not exist, or it is not a file. ${i.message}`}throw i}const n=SF.createReadStream(t);return this.fromStream(n,r)}fromImpersonatedJSON(t){var r,n,i,s;if(!t){throw new Error("Must pass in a JSON object containing an impersonated refresh token")}if(t.type!==lJ.IMPERSONATED_ACCOUNT_TYPE){throw new Error(`The incoming JSON object does not have the "${lJ.IMPERSONATED_ACCOUNT_TYPE}" type`)}if(!t.source_credentials){throw new Error("The incoming JSON object does not contain a source_credentials field")}if(!t.service_account_impersonation_url){throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field")}const o=new mxe.UserRefreshClient(t.source_credentials.client_id,t.source_credentials.client_secret,t.source_credentials.refresh_token);const u=(n=(r=/(?<target>[^/]+):generateAccessToken$/.exec(t.service_account_impersonation_url))===null||r===void 0?void 0:r.groups)===null||n===void 0?void 0:n.target;if(!u){throw new RangeError(`Cannot extract target principal from ${t.service_account_impersonation_url}`)}const l=(i=this.getAnyScopes())!==null&&i!==void 0?i:[];const c=new lJ.Impersonated({delegates:(s=t.delegates)!==null&&s!==void 0?s:[],sourceClient:o,targetPrincipal:u,targetScopes:Array.isArray(l)?l:[l]});return c}fromJSON(t,r={}){let n;r=r||{};if(t.type===mxe.USER_REFRESH_ACCOUNT_TYPE){n=new mxe.UserRefreshClient(r);n.fromJSON(t)}else if(t.type===lJ.IMPERSONATED_ACCOUNT_TYPE){n=this.fromImpersonatedJSON(t)}else if(t.type===AF.EXTERNAL_ACCOUNT_TYPE){n=qSn.ExternalAccountClient.fromJSON(t,r);n.scopes=this.getAnyScopes()}else if(t.type===qCt.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE){n=new qCt.ExternalAccountAuthorizedUserClient(t,r)}else{r.scopes=this.scopes;n=new YO.JWT(r);this.setGapicJWTValues(n);n.fromJSON(t)}return n}_cacheClientFromJSON(t,r){const n=this.fromJSON(t,r);this.jsonContent=t;this.cachedCredential=n;return n}fromStream(t,r={},n){let i={};if(typeof r==="function"){n=r}else{i=r}if(n){this.fromStreamAsync(t,i).then(s=>n(null,s),n)}else{return this.fromStreamAsync(t,i)}}fromStreamAsync(t,r){return new Promise((n,i)=>{if(!t){throw new Error("Must pass in a stream containing the Google auth settings.")}let s="";t.setEncoding("utf8").on("error",i).on("data",o=>s+=o).on("end",()=>{try{try{const o=JSON.parse(s);const u=this._cacheClientFromJSON(o,r);return n(u)}catch(o){if(!this.keyFilename)throw o;const u=new YO.JWT({...this.clientOptions,keyFile:this.keyFilename});this.cachedCredential=u;this.setGapicJWTValues(u);return n(u)}}catch(o){return i(o)}})})}fromAPIKey(t,r){r=r||{};const n=new YO.JWT(r);n.fromAPIKey(t);return n}_isWindows(){const t=kSn.platform();if(t&&t.length>=3){if(t.substring(0,3).toLowerCase()==="win"){return true}}return false}async getDefaultServiceProjectId(){return new Promise(t=>{(0,ISn.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n){try{const i=JSON.parse(n).configuration.properties.core.project;t(i);return}catch(i){}}t(null)})})}getProductionProjectId(){return process.env["GCLOUD_PROJECT"]||process.env["GOOGLE_CLOUD_PROJECT"]||process.env["gcloud_project"]||process.env["google_cloud_project"]}async getFileProjectId(){if(this.cachedCredential){return this.cachedCredential.projectId}if(this.keyFilename){const r=await this.getClient();if(r&&r.projectId){return r.projectId}}const t=await this._tryGetApplicationCredentialsFromEnvironmentVariable();if(t){return t.projectId}else{return null}}async getExternalAccountClientProjectId(){if(!this.jsonContent||this.jsonContent.type!==AF.EXTERNAL_ACCOUNT_TYPE){return null}const t=await this.getClient();return await t.getProjectId()}async getGCEProjectId(){try{const t=await pxe.project("project-id");return t}catch(t){return null}}getCredentials(t){if(t){this.getCredentialsAsync().then(r=>t(null,r),t)}else{return this.getCredentialsAsync()}}async getCredentialsAsync(){const t=await this.getClient();if(t instanceof AF.BaseExternalAccountClient){const i=t.getServiceAccountEmail();if(i){return{client_email:i}}}if(this.jsonContent){const i={client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key};return i}const r=await this._checkIsGCE();if(!r){throw new Error("Unknown error.")}const n=await pxe.instance({property:"service-accounts/",params:{recursive:"true"}});if(!n||!n.default||!n.default.email){throw new Error("Failure from metadata server.")}return{client_email:n.default.email}}async getClient(){if(!this.cachedCredential){if(this.jsonContent){this._cacheClientFromJSON(this.jsonContent,this.clientOptions)}else if(this.keyFilename){const t=fxe.resolve(this.keyFilename);const r=SF.createReadStream(t);await this.fromStreamAsync(r,this.clientOptions)}else{await this.getApplicationDefaultAsync(this.clientOptions)}}return this.cachedCredential}async getIdTokenClient(t){const r=await this.getClient();if(!("fetchIdToken"in r)){throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.")}return new BSn.IdTokenClient({targetAudience:t,idTokenProvider:r})}async getAccessToken(){const t=await this.getClient();return(await t.getAccessToken()).token}async getRequestHeaders(t){const r=await this.getClient();return r.getRequestHeaders(t)}async authorizeRequest(t){t=t||{};const r=t.url||t.uri;const n=await this.getClient();const i=await n.getRequestHeaders(r);t.headers=Object.assign(t.headers||{},i);return t}async request(t){const r=await this.getClient();return r.request(t)}getEnv(){return(0,MSn.getEnv)()}async sign(t){const r=await this.getClient();const n=(0,DSn.createCrypto)();if(r instanceof YO.JWT&&r.key){const s=await n.sign(r.key,t);return s}const i=await this.getCredentials();if(!i.client_email){throw new Error("Cannot sign data without `client_email`.")}return this.signBlob(n,i.client_email,t)}async signBlob(t,r,n){const i=`https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/${r}:signBlob`;const s=await this.request({method:"POST",url:i,data:{payload:t.encodeBase64StringUtf8(n)}});return s.data.signedBlob}};XO.GoogleAuth=cJ;cJ.DefaultTransporter=LSn.DefaultTransporter});var jCt=y(dJ=>{"use strict";Object.defineProperty(dJ,"__esModule",{value:true});dJ.IAMAuth=void 0;var hxe=class{static{a(this,"IAMAuth")}constructor(t,r){this.selector=t;this.token=r;this.selector=t;this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};dJ.IAMAuth=hxe});var GCt=y(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:true});fh.DownscopedClient=fh.EXPIRATION_TIME_OFFSET=fh.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var USn=require("stream");var $Sn=xO();var jSn=jTe();var GSn="urn:ietf:params:oauth:grant-type:token-exchange";var HSn="urn:ietf:params:oauth:token-type:access_token";var VSn="urn:ietf:params:oauth:token-type:access_token";var zSn="https://sts.googleapis.com/v1/token";fh.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;fh.EXPIRATION_TIME_OFFSET=5*60*1e3;var gxe=class extends $Sn.AuthClient{static{a(this,"DownscopedClient")}constructor(t,r,n,i){super();this.authClient=t;this.credentialAccessBoundary=r;if(r.accessBoundary.accessBoundaryRules.length===0){throw new Error("At least one access boundary rule needs to be defined.")}else if(r.accessBoundary.accessBoundaryRules.length>fh.MAX_ACCESS_BOUNDARY_RULES_COUNT){throw new Error(`The provided access boundary has more than ${fh.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`)}for(const s of r.accessBoundary.accessBoundaryRules){if(s.availablePermissions.length===0){throw new Error("At least one permission should be defined in access boundary rules.")}}this.stsCredential=new jSn.StsCredentials(zSn);this.cachedDownscopedAccessToken=null;if(typeof(n===null||n===void 0?void 0:n.eagerRefreshThresholdMillis)!=="number"){this.eagerRefreshThresholdMillis=fh.EXPIRATION_TIME_OFFSET}else{this.eagerRefreshThresholdMillis=n.eagerRefreshThresholdMillis}this.forceRefreshOnFailure=!!(n===null||n===void 0?void 0:n.forceRefreshOnFailure);this.quotaProjectId=i}setCredentials(t){if(!t.expiry_date){throw new Error("The access token expiry_date field is missing in the provided credentials.")}super.setCredentials(t);this.cachedDownscopedAccessToken=t}async getAccessToken(){if(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken)){await this.refreshAccessTokenAsync()}return{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){const t=await this.getAccessToken();const r={Authorization:`Bearer ${t.token}`};return this.addSharedMetadataHeaders(r)}request(t,r){if(r){this.requestAsync(t).then(n=>r(null,n),n=>{return r(n,n.response)})}else{return this.requestAsync(t)}}async requestAsync(t,r=false){let n;try{const i=await this.getRequestHeaders();t.headers=t.headers||{};if(i&&i["x-goog-user-project"]){t.headers["x-goog-user-project"]=i["x-goog-user-project"]}if(i&&i.Authorization){t.headers.Authorization=i.Authorization}n=await this.transporter.request(t)}catch(i){const s=i.response;if(s){const o=s.status;const u=s.config.data instanceof USn.Readable;const l=o===401||o===403;if(!r&&l&&!u&&this.forceRefreshOnFailure){await this.refreshAccessTokenAsync();return await this.requestAsync(t,true)}}throw i}return n}async refreshAccessTokenAsync(){var t;const r=(await this.authClient.getAccessToken()).token;const n={grantType:GSn,requestedTokenType:HSn,subjectToken:r,subjectTokenType:VSn};const i=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary);const s=((t=this.authClient.credentials)===null||t===void 0?void 0:t.expiry_date)||null;const o=i.expires_in?new Date().getTime()+i.expires_in*1e3:s;this.cachedDownscopedAccessToken={access_token:i.access_token,expiry_date:o,res:i.res};this.credentials={};Object.assign(this.credentials,this.cachedDownscopedAccessToken);delete this.credentials.res;this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null});return this.cachedDownscopedAccessToken}isExpired(t){const r=new Date().getTime();return t.expiry_date?r>=t.expiry_date-this.eagerRefreshThresholdMillis:false}};fh.DownscopedClient=gxe});var yxe=y(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:true});mn.GoogleAuth=mn.auth=mn.DefaultTransporter=mn.PluggableAuthClient=mn.DownscopedClient=mn.BaseExternalAccountClient=mn.ExternalAccountClient=mn.IdentityPoolClient=mn.AwsClient=mn.UserRefreshClient=mn.LoginTicket=mn.OAuth2Client=mn.CodeChallengeMethod=mn.Impersonated=mn.JWT=mn.JWTAccess=mn.IdTokenClient=mn.IAMAuth=mn.GCPEnv=mn.Compute=mn.AuthClient=void 0;var HCt=$Ct();Object.defineProperty(mn,"GoogleAuth",{enumerable:true,get:function(){return HCt.GoogleAuth}});var KSn=xO();Object.defineProperty(mn,"AuthClient",{enumerable:true,get:function(){return KSn.AuthClient}});var WSn=Swe();Object.defineProperty(mn,"Compute",{enumerable:true,get:function(){return WSn.Compute}});var YSn=wwe();Object.defineProperty(mn,"GCPEnv",{enumerable:true,get:function(){return YSn.GCPEnv}});var XSn=jCt();Object.defineProperty(mn,"IAMAuth",{enumerable:true,get:function(){return XSn.IAMAuth}});var JSn=Cwe();Object.defineProperty(mn,"IdTokenClient",{enumerable:true,get:function(){return JSn.IdTokenClient}});var QSn=ITe();Object.defineProperty(mn,"JWTAccess",{enumerable:true,get:function(){return QSn.JWTAccess}});var ZSn=DTe();Object.defineProperty(mn,"JWT",{enumerable:true,get:function(){return ZSn.JWT}});var eAn=MTe();Object.defineProperty(mn,"Impersonated",{enumerable:true,get:function(){return eAn.Impersonated}});var VCt=jA();Object.defineProperty(mn,"CodeChallengeMethod",{enumerable:true,get:function(){return VCt.CodeChallengeMethod}});Object.defineProperty(mn,"OAuth2Client",{enumerable:true,get:function(){return VCt.OAuth2Client}});var tAn=vwe();Object.defineProperty(mn,"LoginTicket",{enumerable:true,get:function(){return tAn.LoginTicket}});var rAn=FTe();Object.defineProperty(mn,"UserRefreshClient",{enumerable:true,get:function(){return rAn.UserRefreshClient}});var nAn=ZTe();Object.defineProperty(mn,"AwsClient",{enumerable:true,get:function(){return nAn.AwsClient}});var iAn=JTe();Object.defineProperty(mn,"IdentityPoolClient",{enumerable:true,get:function(){return iAn.IdentityPoolClient}});var sAn=lxe();Object.defineProperty(mn,"ExternalAccountClient",{enumerable:true,get:function(){return sAn.ExternalAccountClient}});var aAn=ME();Object.defineProperty(mn,"BaseExternalAccountClient",{enumerable:true,get:function(){return aAn.BaseExternalAccountClient}});var oAn=GCt();Object.defineProperty(mn,"DownscopedClient",{enumerable:true,get:function(){return oAn.DownscopedClient}});var uAn=aJ();Object.defineProperty(mn,"PluggableAuthClient",{enumerable:true,get:function(){return uAn.PluggableAuthClient}});var lAn=rF();Object.defineProperty(mn,"DefaultTransporter",{enumerable:true,get:function(){return lAn.DefaultTransporter}});var cAn=new HCt.GoogleAuth;mn.auth=cAn});var QO=y(JO=>{"use strict";var dAn=JO&&JO.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(JO,"__esModule",{value:true});JO.getServiceAccountIdToken=void 0;var pAn=yxe();var fAn=dAn(Bm());var mAn=new pAn.GoogleAuth;var zCt=new fAn.default({max:50,maxAge:1e3*60*50});async function hAn(e){let t=zCt.get(e);if(!t){const r=await mAn.getIdTokenClient(e);t=await r.idTokenProvider.fetchIdToken(e);zCt.set(e,t)}return t}a(hAn,"getServiceAccountIdToken");JO.getServiceAccountIdToken=hAn});var JCt=y(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:true});Df.mergeHeaders=Df.createFinalURL=Df.defaultBodySerializer=Df.defaultQuerySerializer=Df.createClient=void 0;var ZO=ac();var gAn=QO();var yAn=/\/*$/;async function _An(e){const{baseUrl:t,fetch:r=globalThis.fetch,querySerializer:n,bodySerializer:i,zuploExtensions:s,...o}=e;const u=s?.fastifyRequest.log;const l=s?.fastifyRequest.id;const c=s?.options?.userSub??s?.fastifyRequest.getUserSub();const d=new Headers({"zuplo-user":c,"zp-rid":l,...o.headers??{}});const p=await(0,gAn.getServiceAccountIdToken)(t);d.set("Authorization",`Bearer ${p}`);if(["GET","DELETE","HEAD","OPTIONS","TRACE"].includes(o.method?.toUpperCase()??"")){d.delete("Content-Type")}else{d.set("Content-Type","application/json")}async function f(m,h){const{headers:g,body:_,params:v={},parseAs:S="json",querySerializer:E=n??KCt,bodySerializer:b=i??WCt,...A}=h||{};const C=YCt(m,{baseUrl:t,params:v,querySerializer:E});const T=XCt(d,g,v.header);const O={redirect:"follow",...o,...A,headers:T};if(_)O.body=b(_);if(O.body instanceof FormData)T.delete("Content-Type");const P=await r(C,O);if(P.status===404){const R=await P.json();if(R&&R.hasOwnProperty("type")&&R.hasOwnProperty("title")&&R.hasOwnProperty("status")){throw new ZO.ApiError(R)}throw new ZO.ApiError(ZO.Problems.NOT_FOUND)}if(P.status===204||P.headers.get("Content-Length")==="0"){return P.ok?{data:{},response:P}:{error:{},response:P}}if(P.ok){let R=P.body;if(S!=="stream"){const I=P.clone();R=typeof I[S]==="function"?await I[S]():await I.text()}return{data:R,response:P}}else{u.debug(`Error on internal api: path: ${C}, status: ${P.status}, headers: ${JSON.stringify(P.headers)}, body: ${await P.clone().text()}`);let R={};try{R=await P.clone().json();if(R.type&&R.status&&R.title){throw new ZO.ApiError(R)}}catch(I){}throw new ZO.ApiError(ZO.Problems.INTERNAL_SERVER_ERROR)}}a(f,"coreFetch");return{async GET(m,h){return f(m,{...h,method:"GET"})},async PUT(m,h){return f(m,{...h,method:"PUT"})},async POST(m,h){return f(m,{...h,method:"POST"})},async DELETE(m,h){return f(m,{...h,method:"DELETE"})},async OPTIONS(m,h){return f(m,{...h,method:"OPTIONS"})},async HEAD(m,h){return f(m,{...h,method:"HEAD"})},async PATCH(m,h){return f(m,{...h,method:"PATCH"})},async TRACE(m,h){return f(m,{...h,method:"TRACE"})}}}a(_An,"createClient");Df.createClient=_An;function KCt(e){const t=new URLSearchParams;if(e&&typeof e==="object"){for(const[r,n]of Object.entries(e)){if(n===void 0||n===null)continue;t.set(r,n)}}return t.toString()}a(KCt,"defaultQuerySerializer");Df.defaultQuerySerializer=KCt;function WCt(e){return JSON.stringify(e)}a(WCt,"defaultBodySerializer");Df.defaultBodySerializer=WCt;function YCt(e,t){let r=`${t.baseUrl?t.baseUrl.replace(yAn,""):""}${e}`;if(t.params.path){for(const[n,i]of Object.entries(t.params.path))r=r.replace(`{${n}}`,encodeURIComponent(String(i)))}if(t.params.query){const n=t.querySerializer(t.params.query);if(n)r+=`?${n}`}return r}a(YCt,"createFinalURL");Df.createFinalURL=YCt;function XCt(...e){const t=new Headers;for(const r of e){if(!r||typeof r!=="object")continue;const n=r instanceof Headers?r.entries():Object.entries(r);for(const[i,s]of n){if(s!==void 0&&s!==null){t.set(i,s)}}}return t}a(XCt,"mergeHeaders");Df.mergeHeaders=XCt});var QCt=y(qE=>{"use strict";var vAn=qE&&qE.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(qE,"__esModule",{value:true});qE.ApiKeyService=qE.createApiKeyServiceClient=void 0;var eP=ac();var EAn=yxe();var pJ=vAn(Zd());var bAn=JCt();async function SAn(e){return(0,bAn.createClient)({baseUrl:pJ.default.API_KEY_MANAGEMENT_SERVICE_URL,zuploExtensions:{fastifyRequest:e}})}a(SAn,"createApiKeyServiceClient");qE.createApiKeyServiceClient=SAn;var _xe=class{static{a(this,"ApiKeyService")}logger;requestId;constructor(t){this.logger=t.log;this.requestId=t.id}async fetchGCP(t,r={}){this.logger.info(`Fetching with GCP JWT ${r.method} ${t} from Api Key Service API.`);const n=new EAn.GoogleAuth;const i=await n.getIdTokenClient(pJ.default.API_KEY_MANAGEMENT_SERVICE_URL);this.logger.info(`Payload to send: ${JSON.stringify({url:`${pJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:"GET",body:r.body,headers:{...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}}})}`);const s=await i.getRequestHeaders();const o=await i.request({url:`${pJ.default.API_KEY_MANAGEMENT_SERVICE_URL}/${t}`,method:r.method||"GET",body:r.body,headers:{...s,...r.headers,...r.method!=="DELETE"&&{"content-type":"application/json"}},validateStatus:u=>u>=200&&u<500});if(o.status===404){const u=await o.data;if(u&&u.hasOwnProperty("type")&&u.hasOwnProperty("title")&&u.hasOwnProperty("status")){throw new eP.ApiError(u)}throw new eP.ApiError(eP.Problems.NOT_FOUND)}if(o.status>=300){this.logger.debug(`Error on api-key-service: path: ${t}, status: ${o.status}, headers: ${JSON.stringify(o.headers)}, body: ${JSON.stringify(o.data)}`);const u=o.data;if(u.type&&u.status&&u.title){throw new eP.ApiError(u)}this.logger.error(`Error not handled on api-key-service: path: ${t}, status: ${o.status}`);throw new eP.ApiError(eP.Problems.INTERNAL_SERVER_ERROR)}if(o.status===204){return{}}return o.data}};qE.ApiKeyService=_xe});var ewt=y(tP=>{"use strict";var AAn=tP&&tP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(tP,"__esModule",{value:true});tP.AuthApiService=void 0;var ZA=ac();var ZCt=AAn(Zd());var CAn=QO();var vxe=class{static{a(this,"AuthApiService")}logger;requestId;baseUrl;constructor(t){this.logger=t.log;this.requestId=t.id;if(!ZCt.default.AUTH_API_URL){throw new Error("AUTH_API_URL is not set")}this.baseUrl=ZCt.default.AUTH_API_URL}async getClientJWT(t,r){let n;try{n=await this.fetch(`/v1/clients/${t}`,{method:"GET"})}catch(s){if(s.status===ZA.Problems.NOT_FOUND.status){n=await this.fetch(`/v1/clients`,{method:"POST",body:JSON.stringify({client_id:t})})}else{throw s}}const i=await this.fetch(`/v1/oauth/token`,{method:"POST",body:JSON.stringify({client_id:t,client_secret:n.client_secret,grant_type:"client_credentials",custom_claims:r})});return i.access_token}async fetch(t,r){this.logger.info(`Fetching internally ${t} from Auth API V2.`);const n=new Headers({"content-type":"application/json","zp-rid":this.requestId,authorization:""});if(process.env.K_SERVICE){const s=await(0,CAn.getServiceAccountIdToken)(this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===ZA.HttpStatusCode.NOT_FOUND){throw new ZA.ApiError(ZA.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on auth-api: path: ${t}, status: ${i.status}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new ZA.ApiError(s)}this.logger.error(`Error not handled on auth-api: path: ${t}, status: ${i.status}`);throw new ZA.ApiError(ZA.Problems.INTERNAL_SERVER_ERROR)}return i.clone().json()}};tP.AuthApiService=vxe});var CF=y(fJ=>{"use strict";Object.defineProperty(fJ,"__esModule",{value:true});fJ.ApiServiceClient=void 0;var rP=ac();var wAn=QO();var Exe=class{static{a(this,"ApiServiceClient")}userSub;logger;requestId;baseUrl;cache;targetAudience;constructor(t,r,n){this.userSub=n.userSub;this.logger=n.logger;this.requestId=n.requestId;this.baseUrl=t;this.cache=r;this.targetAudience=n.targetAudience}async cachedFetch(t,r,n){if(!this.userSub||!n){throw new Error("userSub and cacheKey parameters are required to use cachedFetch")}const i=`${this.userSub}@${n}`;if(this.cache.has(i)){return this.cache.get(i)}const s=await this.fetchInternally(t,r);this.cache.set(i,s);return s}async fetchInternally(t,r){this.logger.info(`Fetching internally ${r.method} ${this.baseUrl}${t}`);const n=new Headers({...r.headers,"zuplo-user":this.userSub,"content-type":"application/json","zp-rid":this.requestId});if(process.env.K_SERVICE){const s=await(0,wAn.getServiceAccountIdToken)(this.targetAudience??this.baseUrl);n.set("Authorization",`Bearer ${s}`)}const i=await fetch(`${this.baseUrl}${t}`,{...r,headers:n});if(i.status===404){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.json();if(s&&s.hasOwnProperty("type")&&s.hasOwnProperty("title")&&s.hasOwnProperty("status")){throw new rP.ApiError(s)}throw new rP.ApiError(rP.Problems.NOT_FOUND)}if(!i.ok){this.logger.debug(`Error on internal api: path: ${t}, status: ${i.status}, body: ${JSON.stringify(i.clone().text())}`);const s=await i.clone().json();if(s.type&&s.status&&s.title){throw new rP.ApiError(s)}this.logger.error(`Error not handled on internal api: path: ${t}, status: ${i.status}`);throw new rP.ApiError(rP.Problems.INTERNAL_SERVER_ERROR)}if(i.status===204){return{}}return i.clone().json()}};fJ.ApiServiceClient=Exe});var iwt=y(rg=>{"use strict";var rwt=rg&&rg.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(rg,"__esModule",{value:true});rg.ContentApiService=rg.getContentApiStorageTarballPath=rg.contentApiTarballFileName=void 0;var TAn=rwt(Bm());var twt=rwt(Zd());var xAn=CF();var RAn=new TAn.default({max:500,maxAge:1e3*60*50});function nwt(e,t){return`${e}--${t}.tar.gz`}a(nwt,"contentApiTarballFileName");rg.contentApiTarballFileName=nwt;function OAn(e,t){const r=nwt(e,t);return`${e}/builds/${r}`}a(OAn,"getContentApiStorageTarballPath");rg.getContentApiStorageTarballPath=OAn;var bxe=class extends xAn.ApiServiceClient{static{a(this,"ContentApiService")}constructor(t){if(!twt.default.CONTENT_API_URL){throw new Error("CONTENT_API_URL is not set")}super(twt.default.CONTENT_API_URL,RAn,t)}};rg.ContentApiService=bxe});var owt=y(nP=>{"use strict";var awt=nP&&nP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(nP,"__esModule",{value:true});nP.DevApiService=void 0;var PAn=awt(Bm());var swt=awt(Zd());var NAn=CF();var IAn=new PAn.default({max:500,maxAge:1e3*60*50});var Sxe=class extends NAn.ApiServiceClient{static{a(this,"DevApiService")}constructor(t,r){if(!swt.default.DEV_API_URL){throw new Error("DEV_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(swt.default.DEV_API_URL,IAn,{userSub:n,logger:t.log,requestId:t.id})}};nP.DevApiService=Sxe});var cwt=y((vDs,lwt)=>{var uwt=require("stream").Stream;var kAn=require("util");lwt.exports=mh;function mh(){this.source=null;this.dataSize=0;this.maxDataSize=1024*1024;this.pauseStream=true;this._maxDataSizeExceeded=false;this._released=false;this._bufferedEvents=[]}a(mh,"DelayedStream");kAn.inherits(mh,uwt);mh.create=function(e,t){var r=new this;t=t||{};for(var n in t){r[n]=t[n]}r.source=e;var i=e.emit;e.emit=function(){r._handleEmit(arguments);return i.apply(e,arguments)};e.on("error",function(){});if(r.pauseStream){e.pause()}return r};Object.defineProperty(mh.prototype,"readable",{configurable:true,enumerable:true,get:function(){return this.source.readable}});mh.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};mh.prototype.resume=function(){if(!this._released){this.release()}this.source.resume()};mh.prototype.pause=function(){this.source.pause()};mh.prototype.release=function(){this._released=true;this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this));this._bufferedEvents=[]};mh.prototype.pipe=function(){var e=uwt.prototype.pipe.apply(this,arguments);this.resume();return e};mh.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}if(e[0]==="data"){this.dataSize+=e[1].length;this._checkIfMaxDataSizeExceeded()}this._bufferedEvents.push(e)};mh.prototype._checkIfMaxDataSizeExceeded=function(){if(this._maxDataSizeExceeded){return}if(this.dataSize<=this.maxDataSize){return}this._maxDataSizeExceeded=true;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}});var mwt=y((bDs,fwt)=>{var DAn=require("util");var pwt=require("stream").Stream;var dwt=cwt();fwt.exports=ao;function ao(){this.writable=false;this.readable=true;this.dataSize=0;this.maxDataSize=2*1024*1024;this.pauseStreams=true;this._released=false;this._streams=[];this._currentStream=null;this._insideLoop=false;this._pendingNext=false}a(ao,"CombinedStream");DAn.inherits(ao,pwt);ao.create=function(e){var t=new this;e=e||{};for(var r in e){t[r]=e[r]}return t};ao.isStreamLike=function(e){return typeof e!=="function"&&typeof e!=="string"&&typeof e!=="boolean"&&typeof e!=="number"&&!Buffer.isBuffer(e)};ao.prototype.append=function(e){var t=ao.isStreamLike(e);if(t){if(!(e instanceof dwt)){var r=dwt.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this));e=r}this._handleErrors(e);if(this.pauseStreams){e.pause()}}this._streams.push(e);return this};ao.prototype.pipe=function(e,t){pwt.prototype.pipe.call(this,e,t);this.resume();return e};ao.prototype._getNext=function(){this._currentStream=null;if(this._insideLoop){this._pendingNext=true;return}this._insideLoop=true;try{do{this._pendingNext=false;this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=false}};ao.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e=="undefined"){this.end();return}if(typeof e!=="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=ao.isStreamLike(r);if(n){r.on("data",this._checkDataSize.bind(this));this._handleErrors(r)}this._pipeNext(r)}.bind(this))};ao.prototype._pipeNext=function(e){this._currentStream=e;var t=ao.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this));e.pipe(this,{end:false});return}var r=e;this.write(r);this._getNext()};ao.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ao.prototype.write=function(e){this.emit("data",e)};ao.prototype.pause=function(){if(!this.pauseStreams){return}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function")this._currentStream.pause();this.emit("pause")};ao.prototype.resume=function(){if(!this._released){this._released=true;this.writable=true;this._getNext()}if(this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function")this._currentStream.resume();this.emit("resume")};ao.prototype.end=function(){this._reset();this.emit("end")};ao.prototype.destroy=function(){this._reset();this.emit("close")};ao.prototype._reset=function(){this.writable=false;this._streams=[];this._currentStream=null};ao.prototype._checkDataSize=function(){this._updateDataSize();if(this.dataSize<=this.maxDataSize){return}var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))};ao.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){if(!t.dataSize){return}e.dataSize+=t.dataSize});if(this._currentStream&&this._currentStream.dataSize){this.dataSize+=this._currentStream.dataSize}};ao.prototype._emitError=function(e){this._reset();this.emit("error",e)}});var gwt=y((ADs,hwt)=>{hwt.exports=LAn;function LAn(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;if(t){t(e)}else{setTimeout(e,0)}}a(LAn,"defer")});var Axe=y((wDs,_wt)=>{var ywt=gwt();_wt.exports=FAn;function FAn(e){var t=false;ywt(function(){t=true});return a(function r(n,i){if(t){e(n,i)}else{ywt(a(function s(){e(n,i)},"nextTick_callback"))}},"async_callback")}a(FAn,"async")});var Cxe=y((xDs,vwt)=>{vwt.exports=BAn;function BAn(e){Object.keys(e.jobs).forEach(MAn.bind(e));e.jobs={}}a(BAn,"abort");function MAn(e){if(typeof this.jobs[e]=="function"){this.jobs[e]()}}a(MAn,"clean")});var wxe=y((ODs,bwt)=>{var Ewt=Axe();var qAn=Cxe();bwt.exports=UAn;function UAn(e,t,r,n){var i=r["keyedList"]?r["keyedList"][r.index]:r.index;r.jobs[i]=$An(t,i,e[i],function(s,o){if(!(i in r.jobs)){return}delete r.jobs[i];if(s){qAn(r)}else{r.results[i]=o}n(s,r.results)})}a(UAn,"iterate");function $An(e,t,r,n){var i;if(e.length==2){i=e(r,Ewt(n))}else{i=e(r,t,Ewt(n))}return i}a($An,"runJob")});var Txe=y((NDs,Swt)=>{Swt.exports=jAn;function jAn(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};if(t){n.keyedList.sort(r?t:function(i,s){return t(e[i],e[s])})}return n}a(jAn,"state")});var xxe=y((kDs,Awt)=>{var GAn=Cxe();var HAn=Axe();Awt.exports=VAn;function VAn(e){if(!Object.keys(this.jobs).length){return}this.index=this.size;GAn(this);HAn(e)(null,this.results)}a(VAn,"terminator")});var wwt=y((LDs,Cwt)=>{var zAn=wxe();var KAn=Txe();var WAn=xxe();Cwt.exports=YAn;function YAn(e,t,r){var n=KAn(e);while(n.index<(n["keyedList"]||e).length){zAn(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}});n.index++}return WAn.bind(n,r)}a(YAn,"parallel")});var Rxe=y((BDs,mJ)=>{var Twt=wxe();var XAn=Txe();var JAn=xxe();mJ.exports=QAn;mJ.exports.ascending=xwt;mJ.exports.descending=ZAn;function QAn(e,t,r,n){var i=XAn(e,r);Twt(e,t,i,a(function s(o,u){if(o){n(o,u);return}i.index++;if(i.index<(i["keyedList"]||e).length){Twt(e,t,i,s);return}n(null,i.results)},"iteratorHandler"));return JAn.bind(i,n)}a(QAn,"serialOrdered");function xwt(e,t){return e<t?-1:e>t?1:0}a(xwt,"ascending");function ZAn(e,t){return-1*xwt(e,t)}a(ZAn,"descending")});var Owt=y((qDs,Rwt)=>{var eCn=Rxe();Rwt.exports=tCn;function tCn(e,t,r){return eCn(e,t,null,r)}a(tCn,"serial")});var Nwt=y(($Ds,Pwt)=>{Pwt.exports={parallel:wwt(),serial:Owt(),serialOrdered:Rxe()}});var kwt=y((jDs,Iwt)=>{Iwt.exports=function(e,t){Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]});return e}});var Fwt=y((GDs,Lwt)=>{var Ixe=mwt();var Dwt=require("util");var Oxe=require("path");var rCn=require("http");var nCn=require("https");var iCn=require("url").parse;var sCn=require("fs");var aCn=require("stream").Stream;var Pxe=dSe();var oCn=Nwt();var Nxe=kwt();Lwt.exports=es;Dwt.inherits(es,Ixe);function es(e){if(!(this instanceof es)){return new es(e)}this._overheadLength=0;this._valueLength=0;this._valuesToMeasure=[];Ixe.call(this);e=e||{};for(var t in e){this[t]=e[t]}}a(es,"FormData");es.LINE_BREAK="\r\n";es.DEFAULT_CONTENT_TYPE="application/octet-stream";es.prototype.append=function(e,t,r){r=r||{};if(typeof r=="string"){r={filename:r}}var n=Ixe.prototype.append.bind(this);if(typeof t=="number"){t=""+t}if(Dwt.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r);var s=this._multiPartFooter();n(i);n(t);n(s);this._trackLength(i,t,r)};es.prototype._trackLength=function(e,t,r){var n=0;if(r.knownLength!=null){n+=+r.knownLength}else if(Buffer.isBuffer(t)){n=t.length}else if(typeof t==="string"){n=Buffer.byteLength(t)}this._valueLength+=n;this._overheadLength+=Buffer.byteLength(e)+es.LINE_BREAK.length;if(!t||!t.path&&!(t.readable&&t.hasOwnProperty("httpVersion"))&&!(t instanceof aCn)){return}if(!r.knownLength){this._valuesToMeasure.push(t)}};es.prototype._lengthRetriever=function(e,t){if(e.hasOwnProperty("fd")){if(e.end!=void 0&&e.end!=Infinity&&e.start!=void 0){t(null,e.end+1-(e.start?e.start:0))}else{sCn.stat(e.path,function(r,n){var i;if(r){t(r);return}i=n.size-(e.start?e.start:0);t(null,i)})}}else if(e.hasOwnProperty("httpVersion")){t(null,+e.headers["content-length"])}else if(e.hasOwnProperty("httpModule")){e.on("response",function(r){e.pause();t(null,+r.headers["content-length"])});e.resume()}else{t("Unknown stream")}};es.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string"){return r.header}var n=this._getContentDisposition(t,r);var i=this._getContentType(t,r);var s="";var o={"Content-Disposition":["form-data",'name="'+e+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};if(typeof r.header=="object"){Nxe(o,r.header)}var u;for(var l in o){if(!o.hasOwnProperty(l))continue;u=o[l];if(u==null){continue}if(!Array.isArray(u)){u=[u]}if(u.length){s+=l+": "+u.join("; ")+es.LINE_BREAK}}return"--"+this.getBoundary()+es.LINE_BREAK+s+es.LINE_BREAK};es.prototype._getContentDisposition=function(e,t){var r,n;if(typeof t.filepath==="string"){r=Oxe.normalize(t.filepath).replace(/\\/g,"/")}else if(t.filename||e.name||e.path){r=Oxe.basename(t.filename||e.name||e.path)}else if(e.readable&&e.hasOwnProperty("httpVersion")){r=Oxe.basename(e.client._httpMessage.path||"")}if(r){n='filename="'+r+'"'}return n};es.prototype._getContentType=function(e,t){var r=t.contentType;if(!r&&e.name){r=Pxe.lookup(e.name)}if(!r&&e.path){r=Pxe.lookup(e.path)}if(!r&&e.readable&&e.hasOwnProperty("httpVersion")){r=e.headers["content-type"]}if(!r&&(t.filepath||t.filename)){r=Pxe.lookup(t.filepath||t.filename)}if(!r&&typeof e=="object"){r=es.DEFAULT_CONTENT_TYPE}return r};es.prototype._multiPartFooter=function(){return function(e){var t=es.LINE_BREAK;var r=this._streams.length===0;if(r){t+=this._lastBoundary()}e(t)}.bind(this)};es.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+es.LINE_BREAK};es.prototype.getHeaders=function(e){var t;var r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e){if(e.hasOwnProperty(t)){r[t.toLowerCase()]=e[t]}}return r};es.prototype.setBoundary=function(e){this._boundary=e};es.prototype.getBoundary=function(){if(!this._boundary){this._generateBoundary()}return this._boundary};es.prototype.getBuffer=function(){var e=new Buffer.alloc(0);var t=this.getBoundary();for(var r=0,n=this._streams.length;r<n;r++){if(typeof this._streams[r]!=="function"){if(Buffer.isBuffer(this._streams[r])){e=Buffer.concat([e,this._streams[r]])}else{e=Buffer.concat([e,Buffer.from(this._streams[r])])}if(typeof this._streams[r]!=="string"||this._streams[r].substring(2,t.length+2)!==t){e=Buffer.concat([e,Buffer.from(es.LINE_BREAK)])}}}return Buffer.concat([e,Buffer.from(this._lastBoundary())])};es.prototype._generateBoundary=function(){var e="--------------------------";for(var t=0;t<24;t++){e+=Math.floor(Math.random()*10).toString(16)}this._boundary=e};es.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;if(this._streams.length){e+=this._lastBoundary().length}if(!this.hasKnownLength()){this._error(new Error("Cannot calculate proper length in synchronous way."))}return e};es.prototype.hasKnownLength=function(){var e=true;if(this._valuesToMeasure.length){e=false}return e};es.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length){t+=this._lastBoundary().length}if(!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}oCn.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i});e(null,t)})};es.prototype.submit=function(e,t){var r,n,i={method:"post"};if(typeof e=="string"){e=iCn(e);n=Nxe({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)}else{n=Nxe(e,i);if(!n.port){n.port=n.protocol=="https:"?443:80}}n.headers=this.getHeaders(e.headers);if(n.protocol=="https:"){r=nCn.request(n)}else{r=rCn.request(n)}this.getLength(function(s,o){if(s&&s!=="Unknown stream"){this._error(s);return}if(o){r.setHeader("Content-Length",o)}this.pipe(r);if(t){var u;var l=a(function(c,d){r.removeListener("error",l);r.removeListener("response",u);return t.call(this,c,d)},"callback");u=l.bind(this,null);r.on("error",l);r.on("response",u)}}.bind(this));return r};es.prototype._error=function(e){if(!this.error){this.error=e;this.pause();this.emit("error",e)}};es.prototype.toString=function(){return"[object FormData]"}});var Mwt=y(Bwt=>{"use strict";var uCn=require("url").parse;var lCn={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};var cCn=String.prototype.endsWith||function(e){return e.length<=this.length&&this.indexOf(e,this.length-e.length)!==-1};function dCn(e){var t=typeof e==="string"?uCn(e):e||{};var r=t.protocol;var n=t.host;var i=t.port;if(typeof n!=="string"||!n||typeof r!=="string"){return""}r=r.split(":",1)[0];n=n.replace(/:\d*$/,"");i=parseInt(i)||lCn[r]||0;if(!pCn(n,i)){return""}var s=iP("npm_config_"+r+"_proxy")||iP(r+"_proxy")||iP("npm_config_proxy")||iP("all_proxy");if(s&&s.indexOf("://")===-1){s=r+"://"+s}return s}a(dCn,"getProxyForUrl");function pCn(e,t){var r=(iP("npm_config_no_proxy")||iP("no_proxy")).toLowerCase();if(!r){return true}if(r==="*"){return false}return r.split(/[,\s]/).every(function(n){if(!n){return true}var i=n.match(/^(.+):(\d+)$/);var s=i?i[1]:n;var o=i?parseInt(i[2]):0;if(o&&o!==t){return true}if(!/^[.*]/.test(s)){return e!==s}if(s.charAt(0)==="*"){s=s.slice(1)}return!cCn.call(e,s)})}a(pCn,"shouldProxy");function iP(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}a(iP,"getEnv");Bwt.getProxyForUrl=dCn});var Uwt=y((KDs,qwt)=>{var wF;qwt.exports=function(){if(!wF){try{wF=tp()("follow-redirects")}catch(e){}if(typeof wF!=="function"){wF=a(function(){},"debug")}}wF.apply(null,arguments)}});var Vwt=y((YDs,Hxe)=>{var RF=require("url");var TF=RF.URL;var fCn=require("http");var mCn=require("https");var Bxe=require("stream").Writable;var Mxe=require("assert");var $wt=Uwt();var qxe=false;try{Mxe(new TF)}catch(e){qxe=e.code==="ERR_INVALID_URL"}var hCn=["auth","host","hostname","href","path","pathname","port","protocol","query","search"];var Uxe=["abort","aborted","connect","error","socket","timeout"];var $xe=Object.create(null);Uxe.forEach(function(e){$xe[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var Dxe=OF("ERR_INVALID_URL","Invalid URL",TypeError);var Lxe=OF("ERR_FR_REDIRECTION_FAILURE","Redirected request failed");var gCn=OF("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Lxe);var yCn=OF("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var _Cn=OF("ERR_STREAM_WRITE_AFTER_END","write after end");var vCn=Bxe.prototype.destroy||Gwt;function yd(e,t){Bxe.call(this);this._sanitizeOptions(e);this._options=e;this._ended=false;this._ending=false;this._redirectCount=0;this._redirects=[];this._requestBodyLength=0;this._requestBodyBuffers=[];if(t){this.on("response",t)}var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof Lxe?i:new Lxe({cause:i}))}};this._performRequest()}a(yd,"RedirectableRequest");yd.prototype=Object.create(Bxe.prototype);yd.prototype.abort=function(){Gxe(this._currentRequest);this._currentRequest.abort();this.emit("abort")};yd.prototype.destroy=function(e){Gxe(this._currentRequest,e);vCn.call(this,e);return this};yd.prototype.write=function(e,t,r){if(this._ending){throw new _Cn}if(!eC(e)&&!SCn(e)){throw new TypeError("data should be a string, Buffer or Uint8Array")}if(xF(t)){r=t;t=null}if(e.length===0){if(r){r()}return}if(this._requestBodyLength+e.length<=this._options.maxBodyLength){this._requestBodyLength+=e.length;this._requestBodyBuffers.push({data:e,encoding:t});this._currentRequest.write(e,t,r)}else{this.emit("error",new yCn);this.abort()}};yd.prototype.end=function(e,t,r){if(xF(e)){r=e;e=t=null}else if(xF(t)){r=t;t=null}if(!e){this._ended=this._ending=true;this._currentRequest.end(null,null,r)}else{var n=this;var i=this._currentRequest;this.write(e,t,function(){n._ended=true;i.end(null,null,r)});this._ending=true}};yd.prototype.setHeader=function(e,t){this._options.headers[e]=t;this._currentRequest.setHeader(e,t)};yd.prototype.removeHeader=function(e){delete this._options.headers[e];this._currentRequest.removeHeader(e)};yd.prototype.setTimeout=function(e,t){var r=this;function n(o){o.setTimeout(e);o.removeListener("timeout",o.destroy);o.addListener("timeout",o.destroy)}a(n,"destroyOnTimeout");function i(o){if(r._timeout){clearTimeout(r._timeout)}r._timeout=setTimeout(function(){r.emit("timeout");s()},e);n(o)}a(i,"startTimer");function s(){if(r._timeout){clearTimeout(r._timeout);r._timeout=null}r.removeListener("abort",s);r.removeListener("error",s);r.removeListener("response",s);r.removeListener("close",s);if(t){r.removeListener("timeout",t)}if(!r.socket){r._currentRequest.removeListener("socket",i)}}a(s,"clearTimer");if(t){this.on("timeout",t)}if(this.socket){i(this.socket)}else{this._currentRequest.once("socket",i)}this.on("socket",n);this.on("abort",s);this.on("error",s);this.on("response",s);this.on("close",s);return this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){yd.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(yd.prototype,e,{get:function(){return this._currentRequest[e]}})});yd.prototype._sanitizeOptions=function(e){if(!e.headers){e.headers={}}if(e.host){if(!e.hostname){e.hostname=e.host}delete e.host}if(!e.pathname&&e.path){var t=e.path.indexOf("?");if(t<0){e.pathname=e.path}else{e.pathname=e.path.substring(0,t);e.search=e.path.substring(t)}}};yd.prototype._performRequest=function(){var e=this._options.protocol;var t=this._options.nativeProtocols[e];if(!t){throw new TypeError("Unsupported protocol "+e)}if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of Uxe){n.on(i,$xe[i])}this._currentUrl=/^\//.test(this._options.path)?RF.format(this._options):this._options.path;if(this._isRedirect){var s=0;var o=this;var u=this._requestBodyBuffers;a(function l(c){if(n===o._currentRequest){if(c){o.emit("error",c)}else if(s<u.length){var d=u[s++];if(!n.finished){n.write(d.data,d.encoding,l)}}else if(o._ended){n.end()}}},"writeNext")()}};yd.prototype._processResponse=function(e){var t=e.statusCode;if(this._options.trackRedirects){this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t})}var r=e.headers.location;if(!r||this._options.followRedirects===false||t<300||t>=400){e.responseUrl=this._currentUrl;e.redirects=this._redirects;this.emit("response",e);this._requestBodyBuffers=[];return}Gxe(this._currentRequest);e.destroy();if(++this._redirectCount>this._options.maxRedirects){throw new gCn}var n;var i=this._options.beforeRedirect;if(i){n=Object.assign({Host:e.req.getHeader("host")},this._options.headers)}var s=this._options.method;if((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method)){this._options.method="GET";this._requestBodyBuffers=[];kxe(/^content-/i,this._options.headers)}var o=kxe(/^host$/i,this._options.headers);var u=jxe(this._currentUrl);var l=o||u.host;var c=/^\w+:/.test(r)?this._currentUrl:RF.format(Object.assign(u,{host:l}));var d=ECn(r,c);$wt("redirecting to",d.href);this._isRedirect=true;Fxe(d,this._options);if(d.protocol!==u.protocol&&d.protocol!=="https:"||d.host!==l&&!bCn(d.host,l)){kxe(/^(?:authorization|cookie)$/i,this._options.headers)}if(xF(i)){var p={headers:e.headers,statusCode:t};var f={url:c,method:s,headers:n};i(this._options,p,f);this._sanitizeOptions(this._options)}this._performRequest()};function jwt(e){var t={maxRedirects:21,maxBodyLength:10*1024*1024};var r={};Object.keys(e).forEach(function(n){var i=n+":";var s=r[i]=e[n];var o=t[n]=Object.create(s);function u(c,d,p){if(ACn(c)){c=Fxe(c)}else if(eC(c)){c=Fxe(jxe(c))}else{p=d;d=Hwt(c);c={protocol:i}}if(xF(d)){p=d;d=null}d=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,d);d.nativeProtocols=r;if(!eC(d.host)&&!eC(d.hostname)){d.hostname="::1"}Mxe.equal(d.protocol,i,"protocol mismatch");$wt("options",d);return new yd(d,p)}a(u,"request");function l(c,d,p){var f=o.request(c,d,p);f.end();return f}a(l,"get");Object.defineProperties(o,{request:{value:u,configurable:true,enumerable:true,writable:true},get:{value:l,configurable:true,enumerable:true,writable:true}})});return t}a(jwt,"wrap");function Gwt(){}a(Gwt,"noop");function jxe(e){var t;if(qxe){t=new TF(e)}else{t=Hwt(RF.parse(e));if(!eC(t.protocol)){throw new Dxe({input:e})}}return t}a(jxe,"parseUrl");function ECn(e,t){return qxe?new TF(e,t):jxe(RF.resolve(t,e))}a(ECn,"resolveUrl");function Hwt(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname)){throw new Dxe({input:e.href||e})}if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host)){throw new Dxe({input:e.href||e})}return e}a(Hwt,"validateUrl");function Fxe(e,t){var r=t||{};for(var n of hCn){r[n]=e[n]}if(r.hostname.startsWith("[")){r.hostname=r.hostname.slice(1,-1)}if(r.port!==""){r.port=Number(r.port)}r.path=r.search?r.pathname+r.search:r.pathname;return r}a(Fxe,"spreadUrlObject");function kxe(e,t){var r;for(var n in t){if(e.test(n)){r=t[n];delete t[n]}}return r===null||typeof r==="undefined"?void 0:String(r).trim()}a(kxe,"removeMatchingHeaders");function OF(e,t,r){function n(i){Error.captureStackTrace(this,this.constructor);Object.assign(this,i||{});this.code=e;this.message=this.cause?t+": "+this.cause.message:t}a(n,"CustomError");n.prototype=new(r||Error);Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:false},name:{value:"Error ["+e+"]",enumerable:false}});return n}a(OF,"createErrorType");function Gxe(e,t){for(var r of Uxe){e.removeListener(r,$xe[r])}e.on("error",Gwt);e.destroy(t)}a(Gxe,"destroyRequest");function bCn(e,t){Mxe(eC(e)&&eC(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}a(bCn,"isSubdomain");function eC(e){return typeof e==="string"||e instanceof String}a(eC,"isString");function xF(e){return typeof e==="function"}a(xF,"isFunction");function SCn(e){return typeof e==="object"&&"length"in e}a(SCn,"isBuffer");function ACn(e){return TF&&e instanceof TF}a(ACn,"isURL");Hxe.exports=jwt({http:fCn,https:mCn});Hxe.exports.wrap=jwt});var CJ=y((JDs,DTt)=>{"use strict";var CCn=Fwt();var wCn=require("url");var TCn=Mwt();var xCn=require("http");var RCn=require("https");var lTt=require("util");var OCn=Vwt();var PCn=require("zlib");var cTt=require("stream");var NCn=require("events");function Ty(e){return e&&typeof e==="object"&&"default"in e?e:{"default":e}}a(Ty,"_interopDefaultLegacy");var dTt=Ty(CCn);var ICn=Ty(wCn);var kCn=Ty(xCn);var DCn=Ty(RCn);var LCn=Ty(lTt);var FCn=Ty(OCn);var GE=Ty(PCn);var $E=Ty(cTt);var BCn=Ty(NCn);function pTt(e,t){return a(function r(){return e.apply(t,arguments)},"wrap")}a(pTt,"bind");var{toString:MCn}=Object.prototype;var{getPrototypeOf:sRe}=Object;var EJ=(e=>t=>{const r=MCn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null));var ng=a(e=>{e=e.toLowerCase();return t=>EJ(t)===e},"kindOfTest");var bJ=a(e=>t=>typeof t===e,"typeOfTest");var{isArray:uP}=Array;var IF=bJ("undefined");function qCn(e){return e!==null&&!IF(e)&&e.constructor!==null&&!IF(e.constructor)&&Ff(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}a(qCn,"isBuffer");var fTt=ng("ArrayBuffer");function UCn(e){let t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&fTt(e.buffer)}return t}a(UCn,"isArrayBufferView");var $Cn=bJ("string");var Ff=bJ("function");var mTt=bJ("number");var SJ=a(e=>e!==null&&typeof e==="object","isObject");var jCn=a(e=>e===true||e===false,"isBoolean");var gJ=a(e=>{if(EJ(e)!=="object"){return false}const t=sRe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},"isPlainObject");var GCn=ng("Date");var HCn=ng("File");var VCn=ng("Blob");var zCn=ng("FileList");var KCn=a(e=>SJ(e)&&Ff(e.pipe),"isStream");var WCn=a(e=>{let t;return e&&(typeof FormData==="function"&&e instanceof FormData||Ff(e.append)&&((t=EJ(e))==="formdata"||t==="object"&&Ff(e.toString)&&e.toString()==="[object FormData]"))},"isFormData");var YCn=ng("URLSearchParams");var XCn=a(e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function DF(e,t,{allOwnKeys:r=false}={}){if(e===null||typeof e==="undefined"){return}let n;let i;if(typeof e!=="object"){e=[e]}if(uP(e)){for(n=0,i=e.length;n<i;n++){t.call(null,e[n],n,e)}}else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e);const o=s.length;let u;for(n=0;n<o;n++){u=s[n];t.call(null,e[u],u,e)}}}a(DF,"forEach");function hTt(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length;let i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}a(hTt,"findKey");var gTt=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();var yTt=a(e=>!IF(e)&&e!==gTt,"isContextDefined");function Yxe(){const{caseless:e}=yTt(this)&&this||{};const t={};const r=a((n,i)=>{const s=e&&hTt(t,i)||i;if(gJ(t[s])&&gJ(n)){t[s]=Yxe(t[s],n)}else if(gJ(n)){t[s]=Yxe({},n)}else if(uP(n)){t[s]=n.slice()}else{t[s]=n}},"assignValue");for(let n=0,i=arguments.length;n<i;n++){arguments[n]&&DF(arguments[n],r)}return t}a(Yxe,"merge");var JCn=a((e,t,r,{allOwnKeys:n}={})=>{DF(t,(i,s)=>{if(r&&Ff(i)){e[s]=pTt(i,r)}else{e[s]=i}},{allOwnKeys:n});return e},"extend");var QCn=a(e=>{if(e.charCodeAt(0)===65279){e=e.slice(1)}return e},"stripBOM");var ZCn=a((e,t,r,n)=>{e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)},"inherits");var ewn=a((e,t,r,n)=>{let i;let s;let o;const u={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);s=i.length;while(s-- >0){o=i[s];if((!n||n(o,e,t))&&!u[o]){t[o]=e[o];u[o]=true}}e=r!==false&&sRe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},"toFlatObject");var twn=a((e,t,r)=>{e=String(e);if(r===void 0||r>e.length){r=e.length}r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},"endsWith");var rwn=a(e=>{if(!e)return null;if(uP(e))return e;let t=e.length;if(!mTt(t))return null;const r=new Array(t);while(t-- >0){r[t]=e[t]}return r},"toArray");var nwn=(e=>{return t=>{return e&&t instanceof e}})(typeof Uint8Array!=="undefined"&&sRe(Uint8Array));var iwn=a((e,t)=>{const r=e&&e[Symbol.iterator];const n=r.call(e);let i;while((i=n.next())&&!i.done){const s=i.value;t.call(e,s[0],s[1])}},"forEachEntry");var swn=a((e,t)=>{let r;const n=[];while((r=e.exec(t))!==null){n.push(r)}return n},"matchAll");var awn=ng("HTMLFormElement");var own=a(e=>{return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function t(r,n,i){return n.toUpperCase()+i},"replacer"))},"toCamelCase");var zwt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype);var uwn=ng("RegExp");var _Tt=a((e,t)=>{const r=Object.getOwnPropertyDescriptors(e);const n={};DF(r,(i,s)=>{let o;if((o=t(i,s,e))!==false){n[s]=o||i}});Object.defineProperties(e,n)},"reduceDescriptors");var lwn=a(e=>{_Tt(e,(t,r)=>{if(Ff(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}const n=e[r];if(!Ff(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}}})},"freezeMethods");var cwn=a((e,t)=>{const r={};const n=a(i=>{i.forEach(s=>{r[s]=true})},"define");uP(e)?n(e):n(String(e).split(t));return r},"toObjectSet");var dwn=a(()=>{},"noop");var pwn=a((e,t)=>{e=+e;return Number.isFinite(e)?e:t},"toFiniteNumber");var Vxe="abcdefghijklmnopqrstuvwxyz";var Kwt="0123456789";var vTt={DIGIT:Kwt,ALPHA:Vxe,ALPHA_DIGIT:Vxe+Vxe.toUpperCase()+Kwt};var fwn=a((e=16,t=vTt.ALPHA_DIGIT)=>{let r="";const{length:n}=t;while(e--){r+=t[Math.random()*n|0]}return r},"generateString");function mwn(e){return!!(e&&Ff(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}a(mwn,"isSpecCompliantForm");var hwn=a(e=>{const t=new Array(10);const r=a((n,i)=>{if(SJ(n)){if(t.indexOf(n)>=0){return}if(!("toJSON"in n)){t[i]=n;const s=uP(n)?[]:{};DF(n,(o,u)=>{const l=r(o,i+1);!IF(l)&&(s[u]=l)});t[i]=void 0;return s}}return n},"visit");return r(e,0)},"toJSONObject");var gwn=ng("AsyncFunction");var ywn=a(e=>e&&(SJ(e)||Ff(e))&&Ff(e.then)&&Ff(e.catch),"isThenable");var Je={isArray:uP,isArrayBuffer:fTt,isBuffer:qCn,isFormData:WCn,isArrayBufferView:UCn,isString:$Cn,isNumber:mTt,isBoolean:jCn,isObject:SJ,isPlainObject:gJ,isUndefined:IF,isDate:GCn,isFile:HCn,isBlob:VCn,isRegExp:uwn,isFunction:Ff,isStream:KCn,isURLSearchParams:YCn,isTypedArray:nwn,isFileList:zCn,forEach:DF,merge:Yxe,extend:JCn,trim:XCn,stripBOM:QCn,inherits:ZCn,toFlatObject:ewn,kindOf:EJ,kindOfTest:ng,endsWith:twn,toArray:rwn,forEachEntry:iwn,matchAll:swn,isHTMLForm:awn,hasOwnProperty:zwt,hasOwnProp:zwt,reduceDescriptors:_Tt,freezeMethods:lwn,toObjectSet:cwn,toCamelCase:own,noop:dwn,toFiniteNumber:pwn,findKey:hTt,global:gTt,isContextDefined:yTt,ALPHABET:vTt,generateString:fwn,isSpecCompliantForm:mwn,toJSONObject:hwn,isAsyncFn:gwn,isThenable:ywn};function yr(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=new Error().stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}a(yr,"AxiosError");Je.inherits(yr,Error,{toJSON:a(function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Je.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}},"toJSON")});var ETt=yr.prototype;var bTt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{bTt[e]={value:e}});Object.defineProperties(yr,bTt);Object.defineProperty(ETt,"isAxiosError",{value:true});yr.from=(e,t,r,n,i,s)=>{const o=Object.create(ETt);Je.toFlatObject(e,o,a(function u(l){return l!==Error.prototype},"filter"),u=>{return u!=="isAxiosError"});yr.call(o,e.message,t,r,n,i);o.cause=e;o.name=e.name;s&&Object.assign(o,s);return o};function Xxe(e){return Je.isPlainObject(e)||Je.isArray(e)}a(Xxe,"isVisitable");function STt(e){return Je.endsWith(e,"[]")?e.slice(0,-2):e}a(STt,"removeBrackets");function Wwt(e,t,r){if(!e)return t;return e.concat(t).map(a(function n(i,s){i=STt(i);return!r&&s?"["+i+"]":i},"each")).join(r?".":"")}a(Wwt,"renderKey");function _wn(e){return Je.isArray(e)&&!e.some(Xxe)}a(_wn,"isFlatArray");var vwn=Je.toFlatObject(Je,{},null,a(function e(t){return/^is[A-Z]/.test(t)},"filter"));function AJ(e,t,r){if(!Je.isObject(e)){throw new TypeError("target must be an object")}t=t||new(dTt["default"]||FormData);r=Je.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,a(function h(g,_){return!Je.isUndefined(_[g])},"defined"));const n=r.metaTokens;const i=r.visitor||d;const s=r.dots;const o=r.indexes;const u=r.Blob||typeof Blob!=="undefined"&&Blob;const l=u&&Je.isSpecCompliantForm(t);if(!Je.isFunction(i)){throw new TypeError("visitor must be a function")}function c(h){if(h===null)return"";if(Je.isDate(h)){return h.toISOString()}if(!l&&Je.isBlob(h)){throw new yr("Blob is not supported. Use a Buffer instead.")}if(Je.isArrayBuffer(h)||Je.isTypedArray(h)){return l&&typeof Blob==="function"?new Blob([h]):Buffer.from(h)}return h}a(c,"convertValue");function d(h,g,_){let v=h;if(h&&!_&&typeof h==="object"){if(Je.endsWith(g,"{}")){g=n?g:g.slice(0,-2);h=JSON.stringify(h)}else if(Je.isArray(h)&&_wn(h)||(Je.isFileList(h)||Je.endsWith(g,"[]"))&&(v=Je.toArray(h))){g=STt(g);v.forEach(a(function S(E,b){!(Je.isUndefined(E)||E===null)&&t.append(o===true?Wwt([g],b,s):o===null?g:g+"[]",c(E))},"each"));return false}}if(Xxe(h)){return true}t.append(Wwt(_,g,s),c(h));return false}a(d,"defaultVisitor");const p=[];const f=Object.assign(vwn,{defaultVisitor:d,convertValue:c,isVisitable:Xxe});function m(h,g){if(Je.isUndefined(h))return;if(p.indexOf(h)!==-1){throw Error("Circular reference detected in "+g.join("."))}p.push(h);Je.forEach(h,a(function _(v,S){const E=!(Je.isUndefined(v)||v===null)&&i.call(t,v,Je.isString(S)?S.trim():S,g,f);if(E===true){m(v,g?g.concat(S):[S])}},"each"));p.pop()}a(m,"build");if(!Je.isObject(e)){throw new TypeError("data must be an object")}m(e);return t}a(AJ,"toFormData");function Ywt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,a(function r(n){return t[n]},"replacer"))}a(Ywt,"encode$1");function ATt(e,t){this._pairs=[];e&&AJ(e,this,t)}a(ATt,"AxiosURLSearchParams");var CTt=ATt.prototype;CTt.append=a(function e(t,r){this._pairs.push([t,r])},"append");CTt.toString=a(function e(t){const r=t?function(n){return t.call(this,n,Ywt)}:Ywt;return this._pairs.map(a(function n(i){return r(i[0])+"="+r(i[1])},"each"),"").join("&")},"toString");function Ewn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}a(Ewn,"encode");function aRe(e,t,r){if(!t){return e}const n=r&&r.encode||Ewn;const i=r&&r.serialize;let s;if(i){s=i(t,r)}else{s=Je.isURLSearchParams(t)?t.toString():new ATt(t,r).toString(n)}if(s){const o=e.indexOf("#");if(o!==-1){e=e.slice(0,o)}e+=(e.indexOf("?")===-1?"?":"&")+s}return e}a(aRe,"buildURL");var Jxe=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){Je.forEach(this.handlers,a(function r(n){if(n!==null){t(n)}},"forEachHandler"))}};var Xwt=Jxe;var oRe={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var bwn=ICn["default"].URLSearchParams;var Swn={isNode:true,classes:{URLSearchParams:bwn,FormData:dTt["default"],Blob:typeof Blob!=="undefined"&&Blob||null},protocols:["http","https","file","data"]};var wTt=typeof window!=="undefined"&&typeof document!=="undefined";var Awn=(e=>{return wTt&&["ReactNative","NativeScript","NS"].indexOf(e)<0})(typeof navigator!=="undefined"&&navigator.product);var Cwn=(()=>{return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})();var wwn=Object.freeze({__proto__:null,hasBrowserEnv:wTt,hasStandardBrowserWebWorkerEnv:Cwn,hasStandardBrowserEnv:Awn});var Lf={...wwn,...Swn};function Twn(e,t){return AJ(e,new Lf.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){if(Lf.isNode&&Je.isBuffer(r)){this.append(n,r.toString("base64"));return false}return s.defaultVisitor.apply(this,arguments)}},t))}a(Twn,"toURLEncodedForm");function xwn(e){return Je.matchAll(/\w+|\[(\w*)]/g,e).map(t=>{return t[0]==="[]"?"":t[1]||t[0]})}a(xwn,"parsePropPath");function Rwn(e){const t={};const r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++){s=r[n];t[s]=e[s]}return t}a(Rwn,"arrayToObject");function TTt(e){function t(r,n,i,s){let o=r[s++];const u=Number.isFinite(+o);const l=s>=r.length;o=!o&&Je.isArray(i)?i.length:o;if(l){if(Je.hasOwnProp(i,o)){i[o]=[i[o],n]}else{i[o]=n}return!u}if(!i[o]||!Je.isObject(i[o])){i[o]=[]}const c=t(r,n,i[o],s);if(c&&Je.isArray(i[o])){i[o]=Rwn(i[o])}return!u}a(t,"buildPath");if(Je.isFormData(e)&&Je.isFunction(e.entries)){const r={};Je.forEachEntry(e,(n,i)=>{t(xwn(n),i,r,0)});return r}return null}a(TTt,"formDataToJSON");function Own(e,t,r){if(Je.isString(e)){try{(t||JSON.parse)(e);return Je.trim(e)}catch(n){if(n.name!=="SyntaxError"){throw n}}}return(r||JSON.stringify)(e)}a(Own,"stringifySafely");var uRe={transitional:oRe,adapter:["xhr","http"],transformRequest:[a(function e(t,r){const n=r.getContentType()||"";const i=n.indexOf("application/json")>-1;const s=Je.isObject(t);if(s&&Je.isHTMLForm(t)){t=new FormData(t)}const o=Je.isFormData(t);if(o){if(!i){return t}return i?JSON.stringify(TTt(t)):t}if(Je.isArrayBuffer(t)||Je.isBuffer(t)||Je.isStream(t)||Je.isFile(t)||Je.isBlob(t)){return t}if(Je.isArrayBufferView(t)){return t.buffer}if(Je.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1){return Twn(t,this.formSerializer).toString()}if((u=Je.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return AJ(u?{"files[]":t}:t,l&&new l,this.formSerializer)}}if(s||i){r.setContentType("application/json",false);return Own(t)}return t},"transformRequest")],transformResponse:[a(function e(t){const r=this.transitional||uRe.transitional;const n=r&&r.forcedJSONParsing;const i=this.responseType==="json";if(t&&Je.isString(t)&&(n&&!this.responseType||i)){const s=r&&r.silentJSONParsing;const o=!s&&i;try{return JSON.parse(t)}catch(u){if(o){if(u.name==="SyntaxError"){throw yr.from(u,yr.ERR_BAD_RESPONSE,this,null,this.response)}throw u}}}return t},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Lf.classes.FormData,Blob:Lf.classes.Blob},validateStatus:a(function e(t){return t>=200&&t<300},"validateStatus"),headers:{common:{"Accept":"application/json, text/plain, */*","Content-Type":void 0}}};Je.forEach(["delete","get","head","post","put","patch"],e=>{uRe.headers[e]={}});var lRe=uRe;var Pwn=Je.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Nwn=a(e=>{const t={};let r;let n;let i;e&&e.split("\n").forEach(a(function s(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&Pwn[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}},"parser"));return t},"parseHeaders");var Jwt=Symbol("internals");function PF(e){return e&&String(e).trim().toLowerCase()}a(PF,"normalizeHeader");function yJ(e){if(e===false||e==null){return e}return Je.isArray(e)?e.map(yJ):String(e)}a(yJ,"normalizeValue");function Iwn(e){const t=Object.create(null);const r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}a(Iwn,"parseTokens");var kwn=a(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),"isValidHeaderName");function zxe(e,t,r,n,i){if(Je.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!Je.isString(t))return;if(Je.isString(n)){return t.indexOf(n)!==-1}if(Je.isRegExp(n)){return n.test(t)}}a(zxe,"matchHeaderValue");function Dwn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>{return r.toUpperCase()+n})}a(Dwn,"formatHeader");function Lwn(e,t){const r=Je.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:true})})}a(Lwn,"buildAccessors");var sP=class{static{a(this,"AxiosHeaders")}constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(u,l,c){const d=PF(l);if(!d){throw new Error("header name must be a non-empty string")}const p=Je.findKey(i,d);if(!p||i[p]===void 0||c===true||c===void 0&&i[p]!==false){i[p||l]=yJ(u)}}a(s,"setHeader");const o=a((u,l)=>Je.forEach(u,(c,d)=>s(c,d,l)),"setHeaders");if(Je.isPlainObject(t)||t instanceof this.constructor){o(t,r)}else if(Je.isString(t)&&(t=t.trim())&&!kwn(t)){o(Nwn(t),r)}else{t!=null&&s(r,t,n)}return this}get(t,r){t=PF(t);if(t){const n=Je.findKey(this,t);if(n){const i=this[n];if(!r){return i}if(r===true){return Iwn(i)}if(Je.isFunction(r)){return r.call(this,i,n)}if(Je.isRegExp(r)){return r.exec(i)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){t=PF(t);if(t){const n=Je.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||zxe(this,this[n],n,r)))}return false}delete(t,r){const n=this;let i=false;function s(o){o=PF(o);if(o){const u=Je.findKey(n,o);if(u&&(!r||zxe(n,n[u],u,r))){delete n[u];i=true}}}a(s,"deleteHeader");if(Je.isArray(t)){t.forEach(s)}else{s(t)}return i}clear(t){const r=Object.keys(this);let n=r.length;let i=false;while(n--){const s=r[n];if(!t||zxe(this,this[s],s,t,true)){delete this[s];i=true}}return i}normalize(t){const r=this;const n={};Je.forEach(this,(i,s)=>{const o=Je.findKey(n,s);if(o){r[o]=yJ(i);delete r[s];return}const u=t?Dwn(s):String(s).trim();if(u!==s){delete r[s]}r[u]=yJ(i);n[u]=true});return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);Je.forEach(this,(n,i)=>{n!=null&&n!==false&&(r[i]=t&&Je.isArray(n)?n.join(", "):n)});return r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);r.forEach(i=>n.set(i));return n}static accessor(t){const r=this[Jwt]=this[Jwt]={accessors:{}};const n=r.accessors;const i=this.prototype;function s(o){const u=PF(o);if(!n[u]){Lwn(i,o);n[u]=true}}a(s,"defineAccessor");Je.isArray(t)?t.forEach(s):s(t);return this}};sP.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Je.reduceDescriptors(sP.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});Je.freezeMethods(sP);var Bf=sP;function Kxe(e,t){const r=this||lRe;const n=t||r;const i=Bf.from(n.headers);let s=n.data;Je.forEach(e,a(function o(u){s=u.call(r,s,i.normalize(),t?t.status:void 0)},"transform"));i.normalize();return s}a(Kxe,"transformData");function xTt(e){return!!(e&&e.__CANCEL__)}a(xTt,"isCancel");function tC(e,t,r){yr.call(this,e==null?"canceled":e,yr.ERR_CANCELED,t,r);this.name="CanceledError"}a(tC,"CanceledError");Je.inherits(tC,yr,{__CANCEL__:true});function NF(e,t,r){const n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new yr("Request failed with status code "+r.status,[yr.ERR_BAD_REQUEST,yr.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}a(NF,"settle");function Fwn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}a(Fwn,"isAbsoluteURL");function Bwn(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}a(Bwn,"combineURLs");function cRe(e,t){if(e&&!Fwn(t)){return Bwn(e,t)}return t}a(cRe,"buildFullPath");var vJ="1.6.2";function RTt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}a(RTt,"parseProtocol");var Mwn=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function qwn(e,t,r){const n=r&&r.Blob||Lf.classes.Blob;const i=RTt(e);if(t===void 0&&n){t=true}if(i==="data"){e=i.length?e.slice(i.length+1):e;const s=Mwn.exec(e);if(!s){throw new yr("Invalid URL",yr.ERR_INVALID_URL)}const o=s[1];const u=s[2];const l=s[3];const c=Buffer.from(decodeURIComponent(l),u?"base64":"utf8");if(t){if(!n){throw new yr("Blob is not supported",yr.ERR_NOT_SUPPORT)}return new n([c],{type:o})}return c}throw new yr("Unsupported protocol "+i,yr.ERR_NOT_SUPPORT)}a(qwn,"fromDataURI");function Uwn(e,t){let r=0;const n=1e3/t;let i=null;return a(function s(o,u){const l=Date.now();if(o||l-r>n){if(i){clearTimeout(i);i=null}r=l;return e.apply(null,u)}if(!i){i=setTimeout(()=>{i=null;r=Date.now();return e.apply(null,u)},n-(l-r))}},"throttled")}a(Uwn,"throttle");function OTt(e,t){e=e||10;const r=new Array(e);const n=new Array(e);let i=0;let s=0;let o;t=t!==void 0?t:1e3;return a(function u(l){const c=Date.now();const d=n[s];if(!o){o=c}r[i]=l;n[i]=c;let p=s;let f=0;while(p!==i){f+=r[p++];p=p%e}i=(i+1)%e;if(i===s){s=(s+1)%e}if(c-o<t){return}const m=d&&c-d;return m?Math.round(f*1e3/m):void 0},"push")}a(OTt,"speedometer");var hJ=Symbol("internals");var Qxe=class extends $E["default"].Transform{static{a(this,"AxiosTransformStream")}constructor(t){t=Je.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(u,l)=>{return!Je.isUndefined(l[u])});super({readableHighWaterMark:t.chunkSize});const r=this;const n=this[hJ]={length:t.length,timeWindow:t.timeWindow,ticksRate:t.ticksRate,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:false,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};const i=OTt(n.ticksRate*t.samplesCount,n.timeWindow);this.on("newListener",u=>{if(u==="progress"){if(!n.isCaptured){n.isCaptured=true}}});let s=0;n.updateProgress=Uwn(a(function u(){const l=n.length;const c=n.bytesSeen;const d=c-s;if(!d||r.destroyed)return;const p=i(d);s=c;process.nextTick(()=>{r.emit("progress",{"loaded":c,"total":l,"progress":l?c/l:void 0,"bytes":d,"rate":p?p:void 0,"estimated":p&&l&&c<=l?(l-c)/p:void 0})})},"throttledHandler"),n.ticksRate);const o=a(()=>{n.updateProgress(true)},"onFinish");this.once("end",o);this.once("error",o)}_read(t){const r=this[hJ];if(r.onReadCallback){r.onReadCallback()}return super._read(t)}_transform(t,r,n){const i=this;const s=this[hJ];const o=s.maxRate;const u=this.readableHighWaterMark;const l=s.timeWindow;const c=1e3/l;const d=o/c;const p=s.minChunkSize!==false?Math.max(s.minChunkSize,d*.01):0;function f(h,g){const _=Buffer.byteLength(h);s.bytesSeen+=_;s.bytes+=_;if(s.isCaptured){s.updateProgress()}if(i.push(h)){process.nextTick(g)}else{s.onReadCallback=()=>{s.onReadCallback=null;process.nextTick(g)}}}a(f,"pushChunk");const m=a((h,g)=>{const _=Buffer.byteLength(h);let v=null;let S=u;let E;let b=0;if(o){const A=Date.now();if(!s.ts||(b=A-s.ts)>=l){s.ts=A;E=d-s.bytes;s.bytes=E<0?-E:0;b=0}E=d-s.bytes}if(o){if(E<=0){return setTimeout(()=>{g(null,h)},l-b)}if(E<S){S=E}}if(S&&_>S&&_-S>p){v=h.subarray(S);h=h.subarray(0,S)}f(h,v?()=>{process.nextTick(g,null,v)}:g)},"transformChunk");m(t,a(function h(g,_){if(g){return n(g)}if(_){m(_,h)}else{n(null)}},"transformNextChunk"))}setLength(t){this[hJ].length=+t;return this}};var Qwt=Qxe;var{asyncIterator:Zwt}=Symbol;var $wn=a(async function*(e){if(e.stream){yield*e.stream()}else if(e.arrayBuffer){yield await e.arrayBuffer()}else if(e[Zwt]){yield*e[Zwt]()}else{yield e}},"readBlob");var PTt=$wn;var jwn=Je.ALPHABET.ALPHA_DIGIT+"-_";var kF=new lTt.TextEncoder;var jE="\r\n";var Gwn=kF.encode(jE);var Hwn=2;var Zxe=class{static{a(this,"FormDataPart")}constructor(t,r){const{escapeName:n}=this.constructor;const i=Je.isString(r);let s=`Content-Disposition: form-data; name="${n(t)}"${!i&&r.name?`; filename="${n(r.name)}"`:""}${jE}`;if(i){r=kF.encode(String(r).replace(/\r?\n|\r\n?/g,jE))}else{s+=`Content-Type: ${r.type||"application/octet-stream"}${jE}`}this.headers=kF.encode(s+jE);this.contentLength=i?r.byteLength:r.size;this.size=this.headers.byteLength+this.contentLength+Hwn;this.name=t;this.value=r}async*encode(){yield this.headers;const{value:t}=this;if(Je.isTypedArray(t)){yield t}else{yield*PTt(t)}yield Gwn}static escapeName(t){return String(t).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}};var Vwn=a((e,t,r)=>{const{tag:n="form-data-boundary",size:i=25,boundary:s=n+"-"+Je.generateString(i,jwn)}=r||{};if(!Je.isFormData(e)){throw TypeError("FormData instance required")}if(s.length<1||s.length>70){throw Error("boundary must be 10-70 characters long")}const o=kF.encode("--"+s+jE);const u=kF.encode("--"+s+"--"+jE+jE);let l=u.byteLength;const c=Array.from(e.entries()).map(([p,f])=>{const m=new Zxe(p,f);l+=m.size;return m});l+=o.byteLength*c.length;l=Je.toFiniteNumber(l);const d={"Content-Type":`multipart/form-data; boundary=${s}`};if(Number.isFinite(l)){d["Content-Length"]=l}t&&t(d);return cTt.Readable.from(async function*(){for(const p of c){yield o;yield*p.encode()}yield u}())},"formDataToStream");var zwn=Vwn;var eRe=class extends $E["default"].Transform{static{a(this,"ZlibHeaderTransformStream")}__transform(t,r,n){this.push(t);n()}_transform(t,r,n){if(t.length!==0){this._transform=this.__transform;if(t[0]!==120){const i=Buffer.alloc(2);i[0]=120;i[1]=156;this.push(i,r)}}this.__transform(t,r,n)}};var Kwn=eRe;var Wwn=a((e,t)=>{return Je.isAsyncFn(e)?function(...r){const n=r.pop();e.apply(this,r).then(i=>{try{t?n(null,...t(i)):n(null,i)}catch(s){n(s)}},n)}:e},"callbackify");var Ywn=Wwn;var eTt={flush:GE["default"].constants.Z_SYNC_FLUSH,finishFlush:GE["default"].constants.Z_SYNC_FLUSH};var Xwn={flush:GE["default"].constants.BROTLI_OPERATION_FLUSH,finishFlush:GE["default"].constants.BROTLI_OPERATION_FLUSH};var tTt=Je.isFunction(GE["default"].createBrotliDecompress);var{http:Jwn,https:Qwn}=FCn["default"];var Zwn=/https:?/;var rTt=Lf.protocols.map(e=>{return e+":"});function eTn(e){if(e.beforeRedirects.proxy){e.beforeRedirects.proxy(e)}if(e.beforeRedirects.config){e.beforeRedirects.config(e)}}a(eTn,"dispatchBeforeRedirect");function NTt(e,t,r){let n=t;if(!n&&n!==false){const i=TCn.getProxyForUrl(r);if(i){n=new URL(i)}}if(n){if(n.username){n.auth=(n.username||"")+":"+(n.password||"")}if(n.auth){if(n.auth.username||n.auth.password){n.auth=(n.auth.username||"")+":"+(n.auth.password||"")}const s=Buffer.from(n.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+s}e.headers.host=e.hostname+(e.port?":"+e.port:"");const i=n.hostname||n.host;e.hostname=i;e.host=i;e.port=n.port;e.path=r;if(n.protocol){e.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`}}e.beforeRedirects.proxy=a(function i(s){NTt(s,t,s.href)},"beforeRedirect")}a(NTt,"setProxy");var tTn=typeof process!=="undefined"&&Je.kindOf(process)==="process";var rTn=a(e=>{return new Promise((t,r)=>{let n;let i;const s=a((l,c)=>{if(i)return;i=true;n&&n(l,c)},"done");const o=a(l=>{s(l);t(l)},"_resolve");const u=a(l=>{s(l,true);r(l)},"_reject");e(o,u,l=>n=l).catch(u)})},"wrapAsync");var nTn=a(({address:e,family:t})=>{if(!Je.isString(e)){throw TypeError("address must be a string")}return{address:e,family:t||(e.indexOf(".")<0?6:4)}},"resolveFamily");var nTt=a((e,t)=>nTn(Je.isObject(e)?e:{address:e,family:t}),"buildAddressEntry");var iTn=tTn&&a(function e(t){return rTn(a(async function r(n,i,s){let{data:o,lookup:u,family:l}=t;const{responseType:c,responseEncoding:d}=t;const p=t.method.toUpperCase();let f;let m=false;let h;if(u){const he=Ywn(u,Fe=>Je.isArray(Fe)?Fe:[Fe]);u=a((Fe,Oe,M)=>{he(Fe,Oe,(Q,fe,B)=>{const ye=Je.isArray(fe)?fe.map(De=>nTt(De)):[nTt(fe,B)];Oe.all?M(Q,ye):M(Q,ye[0].address,ye[0].family)})},"lookup")}const g=new BCn["default"];const _=a(()=>{if(t.cancelToken){t.cancelToken.unsubscribe(v)}if(t.signal){t.signal.removeEventListener("abort",v)}g.removeAllListeners()},"onFinished");s((he,Fe)=>{f=true;if(Fe){m=true;_()}});function v(he){g.emit("abort",!he||he.type?new tC(null,t,h):he)}a(v,"abort");g.once("abort",i);if(t.cancelToken||t.signal){t.cancelToken&&t.cancelToken.subscribe(v);if(t.signal){t.signal.aborted?v():t.signal.addEventListener("abort",v)}}const S=cRe(t.baseURL,t.url);const E=new URL(S,"http://localhost");const b=E.protocol||rTt[0];if(b==="data:"){let he;if(p!=="GET"){return NF(n,i,{status:405,statusText:"method not allowed",headers:{},config:t})}try{he=qwn(t.url,c==="blob",{Blob:t.env&&t.env.Blob})}catch(Fe){throw yr.from(Fe,yr.ERR_BAD_REQUEST,t)}if(c==="text"){he=he.toString(d);if(!d||d==="utf8"){he=Je.stripBOM(he)}}else if(c==="stream"){he=$E["default"].Readable.from(he)}return NF(n,i,{data:he,status:200,statusText:"OK",headers:new Bf,config:t})}if(rTt.indexOf(b)===-1){return i(new yr("Unsupported protocol "+b,yr.ERR_BAD_REQUEST,t))}const A=Bf.from(t.headers).normalize();A.set("User-Agent","axios/"+vJ,false);const C=t.onDownloadProgress;const T=t.onUploadProgress;const O=t.maxRate;let P=void 0;let R=void 0;if(Je.isSpecCompliantForm(o)){const he=A.getContentType(/boundary=([-_\w\d]{10,70})/i);o=zwn(o,Fe=>{A.set(Fe)},{tag:`axios-${vJ}-boundary`,boundary:he&&he[1]||void 0})}else if(Je.isFormData(o)&&Je.isFunction(o.getHeaders)){A.set(o.getHeaders());if(!A.hasContentLength()){try{const he=await LCn["default"].promisify(o.getLength).call(o);Number.isFinite(he)&&he>=0&&A.setContentLength(he)}catch(he){}}}else if(Je.isBlob(o)){o.size&&A.setContentType(o.type||"application/octet-stream");A.setContentLength(o.size||0);o=$E["default"].Readable.from(PTt(o))}else if(o&&!Je.isStream(o)){if(Buffer.isBuffer(o));else if(Je.isArrayBuffer(o)){o=Buffer.from(new Uint8Array(o))}else if(Je.isString(o)){o=Buffer.from(o,"utf-8")}else{return i(new yr("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",yr.ERR_BAD_REQUEST,t))}A.setContentLength(o.length,false);if(t.maxBodyLength>-1&&o.length>t.maxBodyLength){return i(new yr("Request body larger than maxBodyLength limit",yr.ERR_BAD_REQUEST,t))}}const I=Je.toFiniteNumber(A.getContentLength());if(Je.isArray(O)){P=O[0];R=O[1]}else{P=R=O}if(o&&(T||P)){if(!Je.isStream(o)){o=$E["default"].Readable.from(o,{objectMode:false})}o=$E["default"].pipeline([o,new Qwt({length:I,maxRate:Je.toFiniteNumber(P)})],Je.noop);T&&o.on("progress",he=>{T(Object.assign(he,{upload:true}))})}let D=void 0;if(t.auth){const he=t.auth.username||"";const Fe=t.auth.password||"";D=he+":"+Fe}if(!D&&E.username){const he=E.username;const Fe=E.password;D=he+":"+Fe}D&&A.delete("authorization");let U;try{U=aRe(E.pathname+E.search,t.params,t.paramsSerializer).replace(/^\?/,"")}catch(he){const Fe=new Error(he.message);Fe.config=t;Fe.url=t.url;Fe.exists=true;return i(Fe)}A.set("Accept-Encoding","gzip, compress, deflate"+(tTt?", br":""),false);const te={path:U,method:p,headers:A.toJSON(),agents:{http:t.httpAgent,https:t.httpsAgent},auth:D,protocol:b,family:l,beforeRedirect:eTn,beforeRedirects:{}};!Je.isUndefined(u)&&(te.lookup=u);if(t.socketPath){te.socketPath=t.socketPath}else{te.hostname=E.hostname;te.port=E.port;NTt(te,t.proxy,b+"//"+E.hostname+(E.port?":"+E.port:"")+te.path)}let ve;const me=Zwn.test(te.protocol);te.agent=me?t.httpsAgent:t.httpAgent;if(t.transport){ve=t.transport}else if(t.maxRedirects===0){ve=me?DCn["default"]:kCn["default"]}else{if(t.maxRedirects){te.maxRedirects=t.maxRedirects}if(t.beforeRedirect){te.beforeRedirects.config=t.beforeRedirect}ve=me?Qwn:Jwn}if(t.maxBodyLength>-1){te.maxBodyLength=t.maxBodyLength}else{te.maxBodyLength=Infinity}if(t.insecureHTTPParser){te.insecureHTTPParser=t.insecureHTTPParser}h=ve.request(te,a(function he(Fe){if(h.destroyed)return;const Oe=[Fe];const M=+Fe.headers["content-length"];if(C){const De=new Qwt({length:Je.toFiniteNumber(M),maxRate:Je.toFiniteNumber(R)});C&&De.on("progress",$e=>{C(Object.assign($e,{download:true}))});Oe.push(De)}let Q=Fe;const fe=Fe.req||h;if(t.decompress!==false&&Fe.headers["content-encoding"]){if(p==="HEAD"||Fe.statusCode===204){delete Fe.headers["content-encoding"]}switch((Fe.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Oe.push(GE["default"].createUnzip(eTt));delete Fe.headers["content-encoding"];break;case"deflate":Oe.push(new Kwn);Oe.push(GE["default"].createUnzip(eTt));delete Fe.headers["content-encoding"];break;case"br":if(tTt){Oe.push(GE["default"].createBrotliDecompress(Xwn));delete Fe.headers["content-encoding"]}}}Q=Oe.length>1?$E["default"].pipeline(Oe,Je.noop):Oe[0];const B=$E["default"].finished(Q,()=>{B();_()});const ye={status:Fe.statusCode,statusText:Fe.statusMessage,headers:new Bf(Fe.headers),config:t,request:fe};if(c==="stream"){ye.data=Q;NF(n,i,ye)}else{const De=[];let $e=0;Q.on("data",a(function gt(ut){De.push(ut);$e+=ut.length;if(t.maxContentLength>-1&&$e>t.maxContentLength){m=true;Q.destroy();i(new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe))}},"handleStreamData"));Q.on("aborted",a(function gt(){if(m){return}const ut=new yr("maxContentLength size of "+t.maxContentLength+" exceeded",yr.ERR_BAD_RESPONSE,t,fe);Q.destroy(ut);i(ut)},"handlerStreamAborted"));Q.on("error",a(function gt(ut){if(h.destroyed)return;i(yr.from(ut,null,t,fe))},"handleStreamError"));Q.on("end",a(function gt(){try{let ut=De.length===1?De[0]:Buffer.concat(De);if(c!=="arraybuffer"){ut=ut.toString(d);if(!d||d==="utf8"){ut=Je.stripBOM(ut)}}ye.data=ut}catch(ut){return i(yr.from(ut,null,t,ye.request,ye))}NF(n,i,ye)},"handleStreamEnd"))}g.once("abort",De=>{if(!Q.destroyed){Q.emit("error",De);Q.destroy()}})},"handleResponse"));g.once("abort",he=>{i(he);h.destroy(he)});h.on("error",a(function he(Fe){i(yr.from(Fe,null,t,h))},"handleRequestError"));h.on("socket",a(function he(Fe){Fe.setKeepAlive(true,1e3*60)},"handleRequestSocket"));if(t.timeout){const he=parseInt(t.timeout,10);if(Number.isNaN(he)){i(new yr("error trying to parse `config.timeout` to int",yr.ERR_BAD_OPTION_VALUE,t,h));return}h.setTimeout(he,a(function Fe(){if(f)return;let Oe=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const M=t.transitional||oRe;if(t.timeoutErrorMessage){Oe=t.timeoutErrorMessage}i(new yr(Oe,M.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,t,h));v()},"handleRequestTimeout"))}if(Je.isStream(o)){let he=false;let Fe=false;o.on("end",()=>{he=true});o.once("error",Oe=>{Fe=true;h.destroy(Oe)});o.on("close",()=>{if(!he&&!Fe){v(new tC("Request stream has been aborted",t,h))}});o.pipe(h)}else{h.end(o)}},"dispatchHttpRequest"))},"httpAdapter");var sTn=Lf.hasStandardBrowserEnv?{write(e,t,r,n,i,s){const o=[e+"="+encodeURIComponent(t)];Je.isNumber(r)&&o.push("expires="+new Date(r).toGMTString());Je.isString(n)&&o.push("path="+n);Je.isString(i)&&o.push("domain="+i);s===true&&o.push("secure");document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var aTn=Lf.hasStandardBrowserEnv?a(function e(){const t=/(msie|trident)/i.test(navigator.userAgent);const r=document.createElement("a");let n;function i(s){let o=s;if(t){r.setAttribute("href",o);o=r.href}r.setAttribute("href",o);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}a(i,"resolveURL");n=i(window.location.href);return a(function s(o){const u=Je.isString(o)?i(o):o;return u.protocol===n.protocol&&u.host===n.host},"isURLSameOrigin")},"standardBrowserEnv")():a(function e(){return a(function t(){return true},"isURLSameOrigin")},"nonStandardBrowserEnv")();function iTt(e,t){let r=0;const n=OTt(50,250);return i=>{const s=i.loaded;const o=i.lengthComputable?i.total:void 0;const u=s-r;const l=n(u);const c=s<=o;r=s;const d={loaded:s,total:o,progress:o?s/o:void 0,bytes:u,rate:l?l:void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};d[t?"download":"upload"]=true;e(d)}}a(iTt,"progressEventReducer");var oTn=typeof XMLHttpRequest!=="undefined";var uTn=oTn&&function(e){return new Promise(a(function t(r,n){let i=e.data;const s=Bf.from(e.headers).normalize();let{responseType:o,withXSRFToken:u}=e;let l;function c(){if(e.cancelToken){e.cancelToken.unsubscribe(l)}if(e.signal){e.signal.removeEventListener("abort",l)}}a(c,"done");let d;if(Je.isFormData(i)){if(Lf.hasStandardBrowserEnv||Lf.hasStandardBrowserWebWorkerEnv){s.setContentType(false)}else if((d=s.getContentType())!==false){const[g,..._]=d?d.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",..._].join("; "))}}let p=new XMLHttpRequest;if(e.auth){const g=e.auth.username||"";const _=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+_))}const f=cRe(e.baseURL,e.url);p.open(e.method.toUpperCase(),aRe(f,e.params,e.paramsSerializer),true);p.timeout=e.timeout;function m(){if(!p){return}const g=Bf.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());const _=!o||o==="text"||o==="json"?p.responseText:p.response;const v={data:_,status:p.status,statusText:p.statusText,headers:g,config:e,request:p};NF(a(function S(E){r(E);c()},"_resolve"),a(function S(E){n(E);c()},"_reject"),v);p=null}a(m,"onloadend");if("onloadend"in p){p.onloadend=m}else{p.onreadystatechange=a(function g(){if(!p||p.readyState!==4){return}if(p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)){return}setTimeout(m)},"handleLoad")}p.onabort=a(function g(){if(!p){return}n(new yr("Request aborted",yr.ECONNABORTED,e,p));p=null},"handleAbort");p.onerror=a(function g(){n(new yr("Network Error",yr.ERR_NETWORK,e,p));p=null},"handleError");p.ontimeout=a(function g(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||oRe;if(e.timeoutErrorMessage){_=e.timeoutErrorMessage}n(new yr(_,v.clarifyTimeoutError?yr.ETIMEDOUT:yr.ECONNABORTED,e,p));p=null},"handleTimeout");if(Lf.hasStandardBrowserEnv){u&&Je.isFunction(u)&&(u=u(e));if(u||u!==false&&aTn(f)){const g=e.xsrfHeaderName&&e.xsrfCookieName&&sTn.read(e.xsrfCookieName);if(g){s.set(e.xsrfHeaderName,g)}}}i===void 0&&s.setContentType(null);if("setRequestHeader"in p){Je.forEach(s.toJSON(),a(function g(_,v){p.setRequestHeader(v,_)},"setRequestHeader"))}if(!Je.isUndefined(e.withCredentials)){p.withCredentials=!!e.withCredentials}if(o&&o!=="json"){p.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){p.addEventListener("progress",iTt(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&p.upload){p.upload.addEventListener("progress",iTt(e.onUploadProgress))}if(e.cancelToken||e.signal){l=a(g=>{if(!p){return}n(!g||g.type?new tC(null,e,p):g);p.abort();p=null},"onCanceled");e.cancelToken&&e.cancelToken.subscribe(l);if(e.signal){e.signal.aborted?l():e.signal.addEventListener("abort",l)}}const h=RTt(f);if(h&&Lf.protocols.indexOf(h)===-1){n(new yr("Unsupported protocol "+h+":",yr.ERR_BAD_REQUEST,e));return}p.send(i||null)},"dispatchXhrRequest"))};var tRe={http:iTn,xhr:uTn};Je.forEach(tRe,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(r){}Object.defineProperty(e,"adapterName",{value:t})}});var sTt=a(e=>`- ${e}`,"renderReason");var lTn=a(e=>Je.isFunction(e)||e===null||e===false,"isResolvedHandle");var ITt={getAdapter:e=>{e=Je.isArray(e)?e:[e];const{length:t}=e;let r;let n;const i={};for(let s=0;s<t;s++){r=e[s];let o;n=r;if(!lTn(r)){n=tRe[(o=String(r)).toLowerCase()];if(n===void 0){throw new yr(`Unknown adapter '${o}'`)}}if(n){break}i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===false?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?"since :\n"+s.map(sTt).join("\n"):" "+sTt(s[0]):"as no adapter specified";throw new yr(`There is no suitable adapter to dispatch the request `+o,"ERR_NOT_SUPPORT")}return n},adapters:tRe};function Wxe(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new tC(null,e)}}a(Wxe,"throwIfCancellationRequested");function aTt(e){Wxe(e);e.headers=Bf.from(e.headers);e.data=Kxe.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}const t=ITt.getAdapter(e.adapter||lRe.adapter);return t(e).then(a(function r(n){Wxe(e);n.data=Kxe.call(e,e.transformResponse,n);n.headers=Bf.from(n.headers);return n},"onAdapterResolution"),a(function r(n){if(!xTt(n)){Wxe(e);if(n&&n.response){n.response.data=Kxe.call(e,e.transformResponse,n.response);n.response.headers=Bf.from(n.response.headers)}}return Promise.reject(n)},"onAdapterRejection"))}a(aTt,"dispatchRequest");var oTt=a(e=>e instanceof Bf?e.toJSON():e,"headersToObject");function aP(e,t){t=t||{};const r={};function n(c,d,p){if(Je.isPlainObject(c)&&Je.isPlainObject(d)){return Je.merge.call({caseless:p},c,d)}else if(Je.isPlainObject(d)){return Je.merge({},d)}else if(Je.isArray(d)){return d.slice()}return d}a(n,"getMergedValue");function i(c,d,p){if(!Je.isUndefined(d)){return n(c,d,p)}else if(!Je.isUndefined(c)){return n(void 0,c,p)}}a(i,"mergeDeepProperties");function s(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}}a(s,"valueFromConfig2");function o(c,d){if(!Je.isUndefined(d)){return n(void 0,d)}else if(!Je.isUndefined(c)){return n(void 0,c)}}a(o,"defaultToConfig2");function u(c,d,p){if(p in t){return n(c,d)}else if(p in e){return n(void 0,c)}}a(u,"mergeDirectKeys");const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(c,d)=>i(oTt(c),oTt(d),true)};Je.forEach(Object.keys(Object.assign({},e,t)),a(function c(d){const p=l[d]||i;const f=p(e[d],t[d],d);Je.isUndefined(f)&&p!==u||(r[d]=f)},"computeConfigValue"));return r}a(aP,"mergeConfig");var dRe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dRe[e]=a(function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e},"validator")});var uTt={};dRe.transitional=a(function e(t,r,n){function i(s,o){return"[Axios v"+vJ+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}a(i,"formatMessage");return(s,o,u)=>{if(t===false){throw new yr(i(o," has been removed"+(r?" in "+r:"")),yr.ERR_DEPRECATED)}if(r&&!uTt[o]){uTt[o]=true;console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(s,o,u):true}},"transitional");function cTn(e,t,r){if(typeof e!=="object"){throw new yr("options must be an object",yr.ERR_BAD_OPTION_VALUE)}const n=Object.keys(e);let i=n.length;while(i-- >0){const s=n[i];const o=t[s];if(o){const u=e[s];const l=u===void 0||o(u,s,e);if(l!==true){throw new yr("option "+s+" must be "+l,yr.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new yr("Unknown option "+s,yr.ERR_BAD_OPTION)}}}a(cTn,"assertOptions");var rRe={assertOptions:cTn,validators:dRe};var UE=rRe.validators;var oP=class{static{a(this,"Axios")}constructor(t){this.defaults=t;this.interceptors={request:new Xwt,response:new Xwt}}request(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=aP(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;if(n!==void 0){rRe.assertOptions(n,{silentJSONParsing:UE.transitional(UE.boolean),forcedJSONParsing:UE.transitional(UE.boolean),clarifyTimeoutError:UE.transitional(UE.boolean)},false)}if(i!=null){if(Je.isFunction(i)){r.paramsSerializer={serialize:i}}else{rRe.assertOptions(i,{encode:UE.function,serialize:UE.function},true)}}r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&Je.merge(s.common,s[r.method]);s&&Je.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]});r.headers=Bf.concat(o,s);const u=[];let l=true;this.interceptors.request.forEach(a(function h(g){if(typeof g.runWhen==="function"&&g.runWhen(r)===false){return}l=l&&g.synchronous;u.unshift(g.fulfilled,g.rejected)},"unshiftRequestInterceptors"));const c=[];this.interceptors.response.forEach(a(function h(g){c.push(g.fulfilled,g.rejected)},"pushResponseInterceptors"));let d;let p=0;let f;if(!l){const h=[aTt.bind(this),void 0];h.unshift.apply(h,u);h.push.apply(h,c);f=h.length;d=Promise.resolve(r);while(p<f){d=d.then(h[p++],h[p++])}return d}f=u.length;let m=r;p=0;while(p<f){const h=u[p++];const g=u[p++];try{m=h(m)}catch(_){g.call(this,_);break}}try{d=aTt.call(this,m)}catch(h){return Promise.reject(h)}p=0;f=c.length;while(p<f){d=d.then(c[p++],c[p++])}return d}getUri(t){t=aP(this.defaults,t);const r=cRe(t.baseURL,t.url);return aRe(r,t.params,t.paramsSerializer)}};Je.forEach(["delete","get","head","options"],a(function e(t){oP.prototype[t]=function(r,n){return this.request(aP(n||{},{method:t,url:r,data:(n||{}).data}))}},"forEachMethodNoData"));Je.forEach(["post","put","patch"],a(function e(t){function r(n){return a(function i(s,o,u){return this.request(aP(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))},"httpMethod")}a(r,"generateHTTPMethod");oP.prototype[t]=r();oP.prototype[t+"Form"]=r(true)},"forEachMethodWithData"));var _J=oP;var nRe=class e{static{a(this,"CancelToken")}constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let r;this.promise=new Promise(a(function i(s){r=s},"promiseExecutor"));const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;while(s-- >0){n._listeners[s](i)}n._listeners=null});this.promise.then=i=>{let s;const o=new Promise(u=>{n.subscribe(u);s=u}).then(i);o.cancel=a(function u(){n.unsubscribe(s)},"reject");return o};t(a(function i(s,o,u){if(n.reason){return}n.reason=new tC(s,o,u);r(n.reason)},"cancel"))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}}static source(){let t;const r=new e(a(function n(i){t=i},"executor"));return{token:r,cancel:t}}};var dTn=nRe;function pTn(e){return a(function t(r){return e.apply(null,r)},"wrap")}a(pTn,"spread");function fTn(e){return Je.isObject(e)&&e.isAxiosError===true}a(fTn,"isAxiosError");var iRe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(iRe).forEach(([e,t])=>{iRe[t]=e});var mTn=iRe;function kTt(e){const t=new _J(e);const r=pTt(_J.prototype.request,t);Je.extend(r,_J.prototype,t,{allOwnKeys:true});Je.extend(r,t,null,{allOwnKeys:true});r.create=a(function n(i){return kTt(aP(e,i))},"create");return r}a(kTt,"createInstance");var Lo=kTt(lRe);Lo.Axios=_J;Lo.CanceledError=tC;Lo.CancelToken=dTn;Lo.isCancel=xTt;Lo.VERSION=vJ;Lo.toFormData=AJ;Lo.AxiosError=yr;Lo.Cancel=Lo.CanceledError;Lo.all=a(function e(t){return Promise.all(t)},"all");Lo.spread=pTn;Lo.isAxiosError=fTn;Lo.mergeConfig=aP;Lo.AxiosHeaders=Bf;Lo.formToJSON=e=>TTt(Je.isHTMLForm(e)?new FormData(e):e);Lo.getAdapter=ITt.getAdapter;Lo.HttpStatusCode=mTn;Lo.default=Lo;DTt.exports=Lo});var TJ=y(wJ=>{"use strict";Object.defineProperty(wJ,"__esModule",{value:true});wJ.CredentialsMethod=void 0;var LTt;(function(e){e["None"]="none";e["ApiToken"]="api_token";e["ClientCredentials"]="client_credentials"})(LTt||(wJ.CredentialsMethod=LTt={}))});var nC=y(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:true});Fo.FgaRequiredParamError=Fo.FgaValidationError=Fo.FgaApiAuthenticationError=Fo.FgaApiInternalError=Fo.FgaApiRateLimitExceededError=Fo.FgaApiNotFoundError=Fo.FgaApiValidationError=Fo.FgaApiError=Fo.FgaError=void 0;var lP=class extends Error{static{a(this,"FgaError")}constructor(t,r){super(r||typeof t==="string"?t:`FGA Error${(t===null||t===void 0?void 0:t.message)?`: ${t.message}`:""}`);this.name="FgaError";if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Fo.FgaError=lP;function RJ(e){let t=(e||"").split("/");if(t.length<4){t=[]}const r=t[2]||"";const n=t[3]||"";return{storeId:r,endpointCategory:n}}a(RJ,"getRequestMetadataFromPath");var FTt="fga-request-id";function _Re(e){return e.response?Object.fromEntries(Object.entries(e.response.headers).map(([t,r])=>[t.toLowerCase(),r])):{}}a(_Re,"getResponseHeaders");var rC=class extends lP{static{a(this,"FgaApiError")}constructor(t,r){var n,i,s,o,u,l,c,d,p,f;super(r?r:t);this.name="FgaApiError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestData=(s=t.config)===null||s===void 0?void 0:s.data;this.requestURL=(o=t.config)===null||o===void 0?void 0:o.url;this.method=(u=t.config)===null||u===void 0?void 0:u.method;const{storeId:m,endpointCategory:h}=RJ((l=t.request)===null||l===void 0?void 0:l.path);this.storeId=m;this.endpointCategory=h;this.apiErrorMessage=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message;this.responseData=(p=t.response)===null||p===void 0?void 0:p.data;this.responseHeader=(f=t.response)===null||f===void 0?void 0:f.headers;const g=_Re(t);this.requestId=g[FTt];if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Fo.FgaApiError=rC;var pRe=class extends rC{static{a(this,"FgaApiValidationError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiValidationError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:p}=RJ((s=t.request)===null||s===void 0?void 0:s.path);this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Validation Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Fo.FgaApiValidationError=pRe;var fRe=class extends rC{static{a(this,"FgaApiNotFoundError")}constructor(t,r){var n,i,s,o,u,l,c;super(t);this.name="FgaApiNotFoundError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;this.message=r?r:((o=(s=t.response)===null||s===void 0?void 0:s.data)===null||o===void 0?void 0:o.message)?`FGA API NotFound Error: ${(u=t.config)===null||u===void 0?void 0:u.method} : Error ${(c=(l=t.response)===null||l===void 0?void 0:l.data)===null||c===void 0?void 0:c.message}`:t.message}};Fo.FgaApiNotFoundError=fRe;var mRe=class extends rC{static{a(this,"FgaApiRateLimitExceededError")}constructor(t,r){var n,i,s;super(t);this.name="FgaApiRateLimitExceededError";this.apiErrorCode=(i=(n=t.response)===null||n===void 0?void 0:n.data)===null||i===void 0?void 0:i.code;const{endpointCategory:o}=RJ((s=t.request)===null||s===void 0?void 0:s.path);const u=_Re(t);this.message=r?r:`FGA API Rate Limit Error for ${this.method} ${o}`}};Fo.FgaApiRateLimitExceededError=mRe;var hRe=class extends rC{static{a(this,"FgaApiInternalError")}constructor(t,r){var n,i,s,o,u,l,c,d;super(t);this.name="FgaApiInternalError";const{endpointCategory:p}=RJ((n=t.request)===null||n===void 0?void 0:n.path);this.apiErrorCode=(s=(i=t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.code;this.message=r?r:((u=(o=t.response)===null||o===void 0?void 0:o.data)===null||u===void 0?void 0:u.message)?`FGA API Internal Error: ${(l=t.config)===null||l===void 0?void 0:l.method} ${p} : Error ${(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.message}`:t.message}};Fo.FgaApiInternalError=hRe;var gRe=class extends lP{static{a(this,"FgaApiAuthenticationError")}constructor(t){var r,n,i,s,o,u,l,c,d,p;super(`FGA Authentication Error.${((r=t.response)===null||r===void 0?void 0:r.statusText)?` ${t.response.statusText}`:""}`);this.name="FgaApiAuthenticationError";this.statusCode=(n=t.response)===null||n===void 0?void 0:n.status;this.statusText=(i=t.response)===null||i===void 0?void 0:i.statusText;this.requestURL=(s=t.config)===null||s===void 0?void 0:s.url;this.method=(o=t.config)===null||o===void 0?void 0:o.method;this.responseData=(u=t.response)===null||u===void 0?void 0:u.data;this.responseHeader=(l=t.response)===null||l===void 0?void 0:l.headers;this.apiErrorCode=(d=(c=t.response)===null||c===void 0?void 0:c.data)===null||d===void 0?void 0:d.code;const f=_Re(t);this.requestId=f[FTt];let m;try{m=JSON.parse(((p=t.config)===null||p===void 0?void 0:p.data)||"{}")}catch(h){}this.clientId=m===null||m===void 0?void 0:m.client_id;this.audience=m===null||m===void 0?void 0:m.audience;this.grantType=m===null||m===void 0?void 0:m.grant_type;if(t===null||t===void 0?void 0:t.stack){this.stack=t.stack}}};Fo.FgaApiAuthenticationError=gRe;var xJ=class extends lP{static{a(this,"FgaValidationError")}constructor(t,r){super(r);this.field=t;this.name="FgaValidationError"}};Fo.FgaValidationError=xJ;var yRe=class extends xJ{static{a(this,"FgaRequiredParamError")}constructor(t,r,n){super(r,n);this.functionName=t;this.name="FgaRequiredParamError"}};Fo.FgaRequiredParamError=yRe});var LF=y(HE=>{"use strict";Object.defineProperty(HE,"__esModule",{value:true});HE.isWellFormedUlidString=HE.isWellFormedUriString=HE.assertParamExists=void 0;var hTn=nC();var gTn=a(function(e,t,r){if(r===null||r===void 0){throw new hTn.FgaRequiredParamError(e,t,`Required parameter ${t} was null or undefined when calling ${e}.`)}},"assertParamExists");HE.assertParamExists=gTn;var yTn=a(e=>{try{const t=new URL(e);return(t.toString()===e||t.toString()===`${e}/`)&&(t.protocol==="https:"||t.protocol==="http:")}catch(t){return false}},"isWellFormedUriString");HE.isWellFormedUriString=yTn;var _Tn=a(e=>{var t;const r=/^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;return!!(typeof e==="string"&&((t=e.match(r))===null||t===void 0?void 0:t.length))},"isWellFormedUlidString");HE.isWellFormedUlidString=_Tn});var ERe=y(cP=>{"use strict";Object.defineProperty(cP,"__esModule",{value:true});cP.Configuration=cP.GetDefaultRetryParams=void 0;var FF=TJ();var vRe=nC();var OJ=LF();var vTn=15;var ETn=100;var bTn="openfga-sdk js/0.3.0";function STn(e=vTn,t=ETn){return{maxRetry:e,minWaitInMs:t}}a(STn,"GetDefaultRetryParams");cP.GetDefaultRetryParams=STn;var PJ=class{static{a(this,"Configuration")}constructor(t={}){this.apiScheme="https";this.getBasePath=()=>`${this.apiScheme}://${this.apiHost}`;this.apiScheme=t.apiScheme||this.apiScheme;this.apiHost=t.apiHost;this.storeId=t.storeId;const r=t.credentials;if(r){switch(r===null||r===void 0?void 0:r.method){case FF.CredentialsMethod.ApiToken:this.credentials={method:r.method,config:{token:r.config.token,headerName:"Authorization",headerValuePrefix:"Bearer"}};break;case FF.CredentialsMethod.ClientCredentials:this.credentials={method:FF.CredentialsMethod.ClientCredentials,config:{clientId:r.config.clientId,clientSecret:r.config.clientSecret,apiAudience:r.config.apiAudience,apiTokenIssuer:r.config.apiTokenIssuer}};break;case FF.CredentialsMethod.None:default:this.credentials={method:FF.CredentialsMethod.None};break}}const n=t.baseOptions||{};n.headers=n.headers||{};if(typeof process==="object"&&process.title==="node"&&!n.headers["User-Agent"]){n.headers["User-Agent"]=bTn}this.baseOptions=n;this.retryParams=t.retryParams}isValid(){var t;(0,OJ.assertParamExists)("Configuration","apiScheme",this.apiScheme);(0,OJ.assertParamExists)("Configuration","apiHost",this.apiHost);if(!(0,OJ.isWellFormedUriString)(this.getBasePath())){throw new vRe.FgaValidationError(`Configuration.apiScheme (${this.apiScheme}) and Configuration.apiHost (${this.apiHost}) do not form a valid URI (${this.getBasePath()})`)}if(this.storeId&&!(0,OJ.isWellFormedUlidString)(this.storeId)){throw new vRe.FgaValidationError("storeId")}if(((t=this.retryParams)===null||t===void 0?void 0:t.maxRetry)&&this.retryParams.maxRetry>15){throw new vRe.FgaValidationError("Configuration.retryParams.maxRetry exceeds maximum allowed limit of 15")}return true}};cP.Configuration=PJ;PJ.sdkVersion="0.3.0"});var BTt=y(NJ=>{"use strict";Object.defineProperty(NJ,"__esModule",{value:true});NJ.assertNever=void 0;function ATn(e){throw new Error(`Assertion failed. Unacceptable value: '${e}'`)}a(ATn,"assertNever");NJ.assertNever=ATn});var MTt=y(IJ=>{"use strict";Object.defineProperty(IJ,"__esModule",{value:true});IJ.chunkArray=void 0;function CTn(e,t){const r=[];const n=[...e];while(n.length>0){r.push(n.splice(0,t))}return r}a(CTn,"chunkArray");IJ.chunkArray=CTn});var UTt=y(dP=>{"use strict";Object.defineProperty(dP,"__esModule",{value:true});dP.generateRandomIdWithNonUniqueFallback=dP.generateRandomId=void 0;var kJ=require("crypto");function qTt(){if(typeof kJ.randomUUID==="function"){return(0,kJ.randomUUID)()}if(typeof kJ.randomBytes==="function"){return(0,kJ.randomBytes)(20).toString("hex")}return}a(qTt,"generateRandomId");dP.generateRandomId=qTt;function wTn(){return qTt()||"00000000-0000-0000-0000-000000000000"}a(wTn,"generateRandomIdWithNonUniqueFallback");dP.generateRandomIdWithNonUniqueFallback=wTn});var $Tt=y(DJ=>{"use strict";Object.defineProperty(DJ,"__esModule",{value:true});DJ.setHeaderIfNotSet=void 0;function TTn(e,t,r){if(!e[t]&&r){e[t]=r}}a(TTn,"setHeaderIfNotSet");DJ.setHeaderIfNotSet=TTn});var jTt=y(LJ=>{"use strict";Object.defineProperty(LJ,"__esModule",{value:true});LJ.setNotEnumerableProperty=void 0;function xTn(e,t,r){Object.defineProperty(e,t,{enumerable:false,writable:false,value:r})}a(xTn,"setNotEnumerableProperty");LJ.setNotEnumerableProperty=xTn});var bRe=y(hh=>{"use strict";var RTn=hh&&hh.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var BF=hh&&hh.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))RTn(t,e,r)};Object.defineProperty(hh,"__esModule",{value:true});BF(BTt(),hh);BF(MTt(),hh);BF(UTt(),hh);BF($Tt(),hh);BF(jTt(),hh)});var ARe=y(eu=>{"use strict";var SRe=eu&&eu.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(eu,"__esModule",{value:true});eu.createRequestFunction=eu.attemptHttpRequest=eu.toPathString=eu.serializeDataIfNeeded=eu.setSearchParams=eu.setBearerAuthToObject=eu.DUMMY_BASE_URL=void 0;var OTn=FJ();var iC=nC();var PTn=bRe();eu.DUMMY_BASE_URL="https://example.com";var NTn=a(function(e,t){return SRe(this,void 0,void 0,function*(){const r=yield t.getAccessTokenHeader();if(r&&!e[r.name]){e[r.name]=r.value}})},"setBearerAuthToObject");eu.setBearerAuthToObject=NTn;var ITn=a(function(e,...t){const r=new URLSearchParams(e.search);for(const n of t){for(const i in n){if(Array.isArray(n[i])){r.delete(i);for(const s of n[i]){r.append(i,s)}}else{r.set(i,n[i])}}}e.search=r.toString()},"setSearchParams");eu.setSearchParams=ITn;var kTn=a(e=>{const t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(t.test(e)||e.toLowerCase()==="application/json-patch+json")},"isJsonMime");var DTn=a(function(e,t){const r=typeof e!=="string";const n=r?kTn(t.headers["Content-Type"]):r;return n?JSON.stringify(e!==void 0?e:{}):e||""},"serializeDataIfNeeded");eu.serializeDataIfNeeded=DTn;var LTn=a(function(e){return e.pathname+e.search+e.hash},"toPathString");eu.toPathString=LTn;function FTn(e){return e&&typeof e==="object"&&e.isAxiosError===true}a(FTn,"isAxiosError");function BTn(e,t){const r=Math.ceil(Math.pow(2,e)*t);const n=Math.ceil(Math.pow(2,e+1)*t);return Math.floor(Math.random()*(n-r)+r)}a(BTn,"randomTime");function GTt(e,t,r){var n;return SRe(this,void 0,void 0,function*(){let i=0;do{i++;try{return yield r(e)}catch(s){if(!FTn(s)){throw new iC.FgaError(s)}const o=(n=s===null||s===void 0?void 0:s.response)===null||n===void 0?void 0:n.status;if(o===400||o===422){throw new iC.FgaApiValidationError(s)}else if(o===401||o===403){throw new iC.FgaApiAuthenticationError(s)}else if(o===404){throw new iC.FgaApiNotFoundError(s)}else if(o===429||o>=500){if(i>=t.maxRetry){if(o===429){throw new iC.FgaApiRateLimitExceededError(s)}else{throw new iC.FgaApiInternalError(s)}}yield new Promise(u=>setTimeout(u,BTn(i,t.minWaitInMs)))}else{throw new iC.FgaApiError(s)}}}while(i<t.maxRetry+1)})}a(GTt,"attemptHttpRequest");eu.attemptHttpRequest=GTt;var MTn=a(function(e,t,r,n){var i,s;r.isValid();const o=((i=e.options)===null||i===void 0?void 0:i.retryParams)?(s=e.options)===null||s===void 0?void 0:s.retryParams:r.retryParams;const u=o?o.maxRetry:0;const l=o?o.minWaitInMs:0;if(!n){n=OTn.Credentials.init(r)}return(c=t)=>SRe(this,void 0,void 0,function*(){yield(0,eu.setBearerAuthToObject)(e.options.headers,n);const d=Object.assign(Object.assign({},e.options),{url:r.getBasePath()+e.url});const p=yield GTt(d,{maxRetry:u,minWaitInMs:l},c);const f=typeof(p===null||p===void 0?void 0:p.data)==="undefined"?{}:p===null||p===void 0?void 0:p.data;const m=Object.assign({},f);(0,PTn.setNotEnumerableProperty)(m,"$response",p);return m})},"createRequestFunction");eu.createRequestFunction=MTn});var VTt=y(pP=>{"use strict";var CRe=pP&&pP.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(pP,"__esModule",{value:true});pP.Credentials=void 0;var HTt=CJ();var VE=LF();var wRe=nC();var qTn=ARe();var Mf=TJ();var TRe=class e{static{a(this,"Credentials")}static init(t){return new e(t.credentials)}constructor(t,r=HTt.default){this.authConfig=t;this.axios=r;this.initConfig();this.isValid()}initConfig(){var t;switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Mf.CredentialsMethod.ApiToken:if(this.authConfig.config){if(!this.authConfig.config.headerName){this.authConfig.config.headerName="Authorization"}if(!this.authConfig.config.headerValuePrefix){this.authConfig.config.headerValuePrefix="Bearer"}}break;case Mf.CredentialsMethod.ClientCredentials:case Mf.CredentialsMethod.None:default:break}}isValid(){var t,r,n,i,s,o,u,l,c;const{authConfig:d}=this;switch(d===null||d===void 0?void 0:d.method){case Mf.CredentialsMethod.None:break;case Mf.CredentialsMethod.ApiToken:(0,VE.assertParamExists)("Credentials","config.token",(t=d.config)===null||t===void 0?void 0:t.token);(0,VE.assertParamExists)("Credentials","config.headerName",(r=d.config)===null||r===void 0?void 0:r.headerName);(0,VE.assertParamExists)("Credentials","config.headerName",(n=d.config)===null||n===void 0?void 0:n.headerName);break;case Mf.CredentialsMethod.ClientCredentials:(0,VE.assertParamExists)("Credentials","config.clientId",(i=d.config)===null||i===void 0?void 0:i.clientId);(0,VE.assertParamExists)("Credentials","config.clientSecret",(s=d.config)===null||s===void 0?void 0:s.clientSecret);(0,VE.assertParamExists)("Credentials","config.apiTokenIssuer",(o=d.config)===null||o===void 0?void 0:o.apiTokenIssuer);(0,VE.assertParamExists)("Credentials","config.apiAudience",(u=d.config)===null||u===void 0?void 0:u.apiAudience);if(!(0,VE.isWellFormedUriString)(`https://${(l=d.config)===null||l===void 0?void 0:l.apiTokenIssuer}`)){throw new wRe.FgaValidationError(`Configuration.apiTokenIssuer does not form a valid URI (https://${(c=d.config)===null||c===void 0?void 0:c.apiTokenIssuer})`)}break}}getAccessTokenHeader(){var t;return CRe(this,void 0,void 0,function*(){const r=yield this.getAccessTokenValue();switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Mf.CredentialsMethod.None:return;case Mf.CredentialsMethod.ApiToken:return{name:this.authConfig.config.headerName,value:`${this.authConfig.config.headerValuePrefix?`${this.authConfig.config.headerValuePrefix} `:""}${r}`};case Mf.CredentialsMethod.ClientCredentials:return{name:"Authorization",value:`Bearer ${r}`}}})}getAccessTokenValue(){var t;return CRe(this,void 0,void 0,function*(){switch((t=this.authConfig)===null||t===void 0?void 0:t.method){case Mf.CredentialsMethod.None:return;case Mf.CredentialsMethod.ApiToken:return this.authConfig.config.token;case Mf.CredentialsMethod.ClientCredentials:if(this.accessToken&&(!this.accessTokenExpiryDate||this.accessTokenExpiryDate>new Date)){return this.accessToken}return this.refreshAccessToken()}})}refreshAccessToken(){var t;return CRe(this,void 0,void 0,function*(){const r=(t=this.authConfig)===null||t===void 0?void 0:t.config;try{const n=yield(0,qTn.attemptHttpRequest)({url:`https://${r.apiTokenIssuer}/oauth/token`,method:"post",data:{client_id:r.clientId,client_secret:r.clientSecret,audience:r.apiAudience,grant_type:"client_credentials"}},{maxRetry:3,minWaitInMs:100},HTt.default);if(n){this.accessToken=n.data.access_token;this.accessTokenExpiryDate=new Date(Date.now()+n.data.expires_in*1e3)}return this.accessToken}catch(n){if(n instanceof wRe.FgaApiError){n.constructor=wRe.FgaApiAuthenticationError;n.name="FgaApiAuthenticationError";n.clientId=r.clientId;n.audience=r.apiAudience;n.grantType="client_credentials"}throw n}})}};pP.Credentials=TRe});var FJ=y(zE=>{"use strict";var UTn=zE&&zE.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var zTt=zE&&zE.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))UTn(t,e,r)};Object.defineProperty(zE,"__esModule",{value:true});zTt(VTt(),zE);zTt(TJ(),zE)});var RRe=y(BJ=>{"use strict";Object.defineProperty(BJ,"__esModule",{value:true});BJ.BaseAPI=void 0;var $Tn=CJ();var jTn=require("http");var GTn=require("https");var KTt=ERe();var HTn=FJ();var VTn=1e4;var xRe=class{static{a(this,"BaseAPI")}constructor(t,r){var n;this.axios=r;if(t instanceof KTt.Configuration){this.configuration=t}else{this.configuration=new KTt.Configuration(t)}this.configuration.isValid();this.credentials=HTn.Credentials.init(this.configuration);if(!this.axios){const i=new jTn.Agent({keepAlive:true});const s=new GTn.Agent({keepAlive:true});this.axios=$Tn.default.create({httpAgent:i,httpsAgent:s,timeout:VTn,headers:(n=this.configuration.baseOptions)===null||n===void 0?void 0:n.headers})}}get storeId(){return this.configuration.storeId}set storeId(t){this.configuration.storeId=t}};BJ.BaseAPI=xRe});var PRe=y(Ts=>{"use strict";var As=Ts&&Ts.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};Object.defineProperty(Ts,"__esModule",{value:true});Ts.OpenFgaApi=Ts.OpenFgaApiFactory=Ts.OpenFgaApiFp=Ts.OpenFgaApiAxiosParamCreator=void 0;var Tc=CJ();var zTn=RRe();var sr=ARe();var za=LF();var KTn=a(function(e,t){return{check:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("check","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/check".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),createStore:(r,n={})=>As(this,void 0,void 0,function*(){const i="/stores";const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),deleteStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"DELETE"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),expand:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("expand","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/expand".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),getStore:(r={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const n="/stores/{store_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const i=new URL(n,sr.DUMMY_BASE_URL);let s;if(e){s=e.baseOptions}const o=Object.assign(Object.assign({method:"GET"},s),r);const u={};const l={};(0,sr.setSearchParams)(i,l,r.query);o.headers=Object.assign(Object.assign({},u),r.headers);return{url:(0,sr.toPathString)(i),options:o}}),listObjects:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("listObjects","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/list-objects".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),listStores:(r,n,i={})=>As(this,void 0,void 0,function*(){const s="/stores";const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),read:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("read","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/read".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),readAssertions:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAssertions","authorizationModelId",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("readAuthorizationModel","id",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models/{id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"id"}}`,encodeURIComponent(String(r)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"GET"},o),n);const l={};const c={};(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);return{url:(0,sr.toPathString)(s),options:u}}),readAuthorizationModels:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"GET"},u),i);const c={};const d={};if(r!==void 0){d["page_size"]=r}if(n!==void 0){d["continuation_token"]=n}(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);return{url:(0,sr.toPathString)(o),options:l}}),readChanges:(r,n,i,s={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("Configuration","storeId",e.storeId);const o="/stores/{store_id}/changes".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const u=new URL(o,sr.DUMMY_BASE_URL);let l;if(e){l=e.baseOptions}const c=Object.assign(Object.assign({method:"GET"},l),s);const d={};const p={};if(r!==void 0){p["type"]=r}if(n!==void 0){p["page_size"]=n}if(i!==void 0){p["continuation_token"]=i}(0,sr.setSearchParams)(u,p,s.query);c.headers=Object.assign(Object.assign({},d),s.headers);return{url:(0,sr.toPathString)(u),options:c}}),write:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("write","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/write".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}}),writeAssertions:(r,n,i={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAssertions","authorizationModelId",r);(0,za.assertParamExists)("writeAssertions","body",n);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const s="/stores/{store_id}/assertions/{authorization_model_id}".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId))).replace(`{${"authorization_model_id"}}`,encodeURIComponent(String(r)));const o=new URL(s,sr.DUMMY_BASE_URL);let u;if(e){u=e.baseOptions}const l=Object.assign(Object.assign({method:"PUT"},u),i);const c={};const d={};c["Content-Type"]="application/json";(0,sr.setSearchParams)(o,d,i.query);l.headers=Object.assign(Object.assign({},c),i.headers);l.data=(0,sr.serializeDataIfNeeded)(n,l);return{url:(0,sr.toPathString)(o),options:l}}),writeAuthorizationModel:(r,n={})=>As(this,void 0,void 0,function*(){(0,za.assertParamExists)("writeAuthorizationModel","body",r);(0,za.assertParamExists)("Configuration","storeId",e.storeId);const i="/stores/{store_id}/authorization-models".replace(`{${"store_id"}}`,encodeURIComponent(String(e.storeId)));const s=new URL(i,sr.DUMMY_BASE_URL);let o;if(e){o=e.baseOptions}const u=Object.assign(Object.assign({method:"POST"},o),n);const l={};const c={};l["Content-Type"]="application/json";(0,sr.setSearchParams)(s,c,n.query);u.headers=Object.assign(Object.assign({},l),n.headers);u.data=(0,sr.serializeDataIfNeeded)(r,u);return{url:(0,sr.toPathString)(s),options:u}})}},"OpenFgaApiAxiosParamCreator");Ts.OpenFgaApiAxiosParamCreator=KTn;var WTn=a(function(e,t){const r=(0,Ts.OpenFgaApiAxiosParamCreator)(e,t);return{check(n,i){return As(this,void 0,void 0,function*(){const s=yield r.check(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},createStore(n,i){return As(this,void 0,void 0,function*(){const s=yield r.createStore(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},deleteStore(n){return As(this,void 0,void 0,function*(){const i=yield r.deleteStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},expand(n,i){return As(this,void 0,void 0,function*(){const s=yield r.expand(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},getStore(n){return As(this,void 0,void 0,function*(){const i=yield r.getStore(n);return(0,sr.createRequestFunction)(i,Tc.default,e,t)})},listObjects(n,i){return As(this,void 0,void 0,function*(){const s=yield r.listObjects(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},listStores(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.listStores(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},read(n,i){return As(this,void 0,void 0,function*(){const s=yield r.read(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAssertions(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAssertions(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.readAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},readAuthorizationModels(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.readAuthorizationModels(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},readChanges(n,i,s,o){return As(this,void 0,void 0,function*(){const u=yield r.readChanges(n,i,s,o);return(0,sr.createRequestFunction)(u,Tc.default,e,t)})},write(n,i){return As(this,void 0,void 0,function*(){const s=yield r.write(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})},writeAssertions(n,i,s){return As(this,void 0,void 0,function*(){const o=yield r.writeAssertions(n,i,s);return(0,sr.createRequestFunction)(o,Tc.default,e,t)})},writeAuthorizationModel(n,i){return As(this,void 0,void 0,function*(){const s=yield r.writeAuthorizationModel(n,i);return(0,sr.createRequestFunction)(s,Tc.default,e,t)})}}},"OpenFgaApiFp");Ts.OpenFgaApiFp=WTn;var YTn=a(function(e,t,r){const n=(0,Ts.OpenFgaApiFp)(e,t);return{check(i,s){return n.check(i,s).then(o=>o(r))},createStore(i,s){return n.createStore(i,s).then(o=>o(r))},deleteStore(i){return n.deleteStore(i).then(s=>s(r))},expand(i,s){return n.expand(i,s).then(o=>o(r))},getStore(i){return n.getStore(i).then(s=>s(r))},listObjects(i,s){return n.listObjects(i,s).then(o=>o(r))},listStores(i,s,o){return n.listStores(i,s,o).then(u=>u(r))},read(i,s){return n.read(i,s).then(o=>o(r))},readAssertions(i,s){return n.readAssertions(i,s).then(o=>o(r))},readAuthorizationModel(i,s){return n.readAuthorizationModel(i,s).then(o=>o(r))},readAuthorizationModels(i,s,o){return n.readAuthorizationModels(i,s,o).then(u=>u(r))},readChanges(i,s,o,u){return n.readChanges(i,s,o,u).then(l=>l(r))},write(i,s){return n.write(i,s).then(o=>o(r))},writeAssertions(i,s,o){return n.writeAssertions(i,s,o).then(u=>u(r))},writeAuthorizationModel(i,s){return n.writeAuthorizationModel(i,s).then(o=>o(r))}}},"OpenFgaApiFactory");Ts.OpenFgaApiFactory=YTn;var ORe=class extends zTn.BaseAPI{static{a(this,"OpenFgaApi")}check(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).check(t,r).then(n=>n(this.axios))}createStore(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).createStore(t,r).then(n=>n(this.axios))}deleteStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).deleteStore(t).then(r=>r(this.axios))}expand(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).expand(t,r).then(n=>n(this.axios))}getStore(t){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).getStore(t).then(r=>r(this.axios))}listObjects(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listObjects(t,r).then(n=>n(this.axios))}listStores(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).listStores(t,r,n).then(i=>i(this.axios))}read(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).read(t,r).then(n=>n(this.axios))}readAssertions(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAssertions(t,r).then(n=>n(this.axios))}readAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModel(t,r).then(n=>n(this.axios))}readAuthorizationModels(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readAuthorizationModels(t,r,n).then(i=>i(this.axios))}readChanges(t,r,n,i){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).readChanges(t,r,n,i).then(s=>s(this.axios))}write(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).write(t,r).then(n=>n(this.axios))}writeAssertions(t,r,n){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAssertions(t,r,n).then(i=>i(this.axios))}writeAuthorizationModel(t,r){return(0,Ts.OpenFgaApiFp)(this.configuration,this.credentials).writeAuthorizationModel(t,r).then(n=>n(this.axios))}};Ts.OpenFgaApi=ORe});var YTt=y((T6s,WTt)=>{async function*XTn(e,t,r){const n=new Set;async function i(){const[s,o]=await Promise.race(n);n.delete(s);return o}a(i,"consume");for(const s of t){const o=(async()=>await r(s,t))().then(u=>[o,u]);n.add(o);if(n.size>=e){yield await i()}}while(n.size){yield await i()}}a(XTn,"asyncPool");WTt.exports=XTn});var XTt=y(ig=>{"use strict";var Ka=ig&&ig.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}a(i,"adopt");return new(r||(r=Promise))(function(s,o){function u(d){try{c(n.next(d))}catch(p){o(p)}}a(u,"fulfilled");function l(d){try{c(n["throw"](d))}catch(p){o(p)}}a(l,"rejected");function c(d){d.done?s(d.value):i(d.value).then(u,l)}a(c,"step");c((n=n.apply(e,t||[])).next())})};var NRe=ig&&ig.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(u,l){o=e[s](o),i(u,l,o.done,o.value)})}}a(n,"verb");function i(s,o,u,l){Promise.resolve(l).then(function(c){s({value:c,done:u})},o)}a(i,"settle")};Object.defineProperty(ig,"__esModule",{value:true});ig.OpenFgaClient=ig.ClientWriteStatus=void 0;var IRe=YTt();var JTn=PRe();var QTn=RRe();var kRe=nC();var _d=bRe();var ZTn=LF();var DRe=10;var fP="X-OpenFGA-Client-Method";var LRe="X-OpenFGA-Client-Bulk-Request-Id";var mP;(function(e){e["SUCCESS"]="success";e["FAILURE"]="failure"})(mP||(ig.ClientWriteStatus=mP={}));var FRe=class extends QTn.BaseAPI{static{a(this,"OpenFgaClient")}constructor(t,r){super(t,r);this.axios=r;this.api=new JTn.OpenFgaApi(this.configuration,r);this.authorizationModelId=t.authorizationModelId;this.getAuthorizationModelId()}getAuthorizationModelId(t={}){const r=(t===null||t===void 0?void 0:t.authorizationModelId)||this.authorizationModelId;if(r&&!(0,ZTn.isWellFormedUlidString)(r)){throw new kRe.FgaValidationError("authorizationModelId")}return r}checkValidApiConnection(t={}){return Ka(this,void 0,void 0,function*(){if(this.getAuthorizationModelId(t)){yield this.readAuthorizationModel(t)}else{yield this.readLatestAuthorizationModel(t)}})}listStores(t={}){return Ka(this,void 0,void 0,function*(){return this.api.listStores(t.pageSize,t.continuationToken,t)})}createStore(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.createStore(t,r)})}getStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.getStore(t)})}deleteStore(t={}){return Ka(this,void 0,void 0,function*(){return this.api.deleteStore(t)})}readAuthorizationModels(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAuthorizationModels(t.pageSize,t.continuationToken,t)})}writeAuthorizationModel(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAuthorizationModel(t,r)})}readAuthorizationModel(t={}){return Ka(this,void 0,void 0,function*(){const r=this.getAuthorizationModelId(t);if(!r){throw new kRe.FgaRequiredParamError("ClientConfiguration","authorizationModelId")}return this.api.readAuthorizationModel(r,t)})}readLatestAuthorizationModel(t={}){var r;return Ka(this,void 0,void 0,function*(){const{headers:n={}}=t;(0,_d.setHeaderIfNotSet)(n,fP,"ReadLatestAuthorizationModel");const i=yield this.readAuthorizationModels(Object.assign(Object.assign({},t),{pageSize:1,headers:n}));const s=i;s.authorization_model=(r=i.authorization_models)===null||r===void 0?void 0:r[0];delete s.authorization_models;return s})}readChanges(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.readChanges(t.type,r.pageSize,r.continuationToken,r)})}read(t={},r={}){return Ka(this,void 0,void 0,function*(){const n={page_size:r.pageSize,continuation_token:r.continuationToken};if(t.user||t.object||t.relation){n.tuple_key=t}return this.api.read(n,r)})}write(t,r={}){return Ka(this,void 0,void 0,function*(){const{transaction:n={},headers:i={}}=r;const{maxPerChunk:s=1,maxParallelRequests:o=DRe}=n;const{writes:u,deletes:l}=t;const c=this.getAuthorizationModelId(r);if(!(n===null||n===void 0?void 0:n.disable)){const d={authorization_model_id:c};if(u===null||u===void 0?void 0:u.length){d.writes={tuple_keys:u}}if(l===null||l===void 0?void 0:l.length){d.deletes={tuple_keys:l}}yield this.api.write(d,r);return{writes:(u===null||u===void 0?void 0:u.map(p=>({tuple_key:p,status:mP.SUCCESS})))||[],deletes:(l===null||l===void 0?void 0:l.map(p=>({tuple_key:p,status:mP.SUCCESS})))||[]}}return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var d,p,f,m,h,g,_,v;(0,_d.setHeaderIfNotSet)(i,fP,"Write");(0,_d.setHeaderIfNotSet)(i,LRe,(0,_d.generateRandomIdWithNonUniqueFallback)());const S=[];if(u===null||u===void 0?void 0:u.length){try{for(var E=true,b=NRe(IRe(o,(0,_d.chunkArray)(u,s),R=>this.writeTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:R.map(D=>({tuple_key:D,status:mP.FAILURE,err:I})),deletes:[]})))),A;A=yield b.next(),d=A.done,!d;E=true){m=A.value;E=false;const R=m;S.push(R.writes)}}catch(R){p={error:R}}finally{try{if(!E&&!d&&(f=b.return))yield f.call(b)}finally{if(p)throw p.error}}}const C=[];if(l===null||l===void 0?void 0:l.length){try{for(var T=true,O=NRe(IRe(o,(0,_d.chunkArray)(l,s),R=>this.deleteTuples(R,Object.assign(Object.assign({},r),{headers:i,transaction:void 0})).catch(I=>({writes:[],deletes:R.map(D=>({tuple_key:D,status:mP.FAILURE,err:I}))})))),P;P=yield O.next(),h=P.done,!h;T=true){v=P.value;T=false;const R=v;C.push(R.deletes)}}catch(R){g={error:R}}finally{try{if(!T&&!h&&(_=O.return))yield _.call(O)}finally{if(g)throw g.error}}}return{writes:S.flat(),deletes:C.flat()}}))(),this.checkValidApiConnection(r)]).then(d=>d[0])})}writeTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,_d.setHeaderIfNotSet)(n,fP,"WriteTuples");return this.write({writes:t},Object.assign(Object.assign({},r),{headers:n}))})}deleteTuples(t,r={}){return Ka(this,void 0,void 0,function*(){const{headers:n={}}=r;(0,_d.setHeaderIfNotSet)(n,fP,"DeleteTuples");return this.write({deletes:t},Object.assign(Object.assign({},r),{headers:n}))})}check(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.check({tuple_key:{user:t.user,relation:t.relation,object:t.object},context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]},authorization_model_id:this.getAuthorizationModelId(r)},r)})}batchCheck(t,r={}){return Ka(this,void 0,void 0,function*(){return Promise.all([(()=>Ka(this,void 0,void 0,function*(){var n,i,s,o;const{headers:u={},maxParallelRequests:l=DRe}=r;(0,_d.setHeaderIfNotSet)(u,fP,"BatchCheck");(0,_d.setHeaderIfNotSet)(u,LRe,(0,_d.generateRandomIdWithNonUniqueFallback)());const c=[];try{for(var d=true,p=NRe(IRe(l,t,m=>this.check(m,Object.assign(Object.assign({},r),{headers:u})).then(h=>{h._request=m;return h}).catch(h=>{return{allowed:void 0,error:h,_request:m}}))),f;f=yield p.next(),n=f.done,!n;d=true){o=f.value;d=false;const m=o;c.push(m)}}catch(m){i={error:m}}finally{try{if(!d&&!n&&(s=p.return))yield s.call(p)}finally{if(i)throw i.error}}return{responses:c}}))(),this.checkValidApiConnection(r)]).then(n=>n[0])})}expand(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.expand({authorization_model_id:this.getAuthorizationModelId(r),tuple_key:t},r)})}listObjects(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.listObjects({authorization_model_id:this.getAuthorizationModelId(r),user:t.user,relation:t.relation,type:t.type,context:t.context,contextual_tuples:{tuple_keys:t.contextualTuples||[]}},r)})}listRelations(t,r={}){return Ka(this,void 0,void 0,function*(){const{user:n,object:i,relations:s,contextualTuples:o,context:u}=t;const{headers:l={},maxParallelRequests:c=DRe}=r;(0,_d.setHeaderIfNotSet)(l,fP,"ListRelations");(0,_d.setHeaderIfNotSet)(l,LRe,(0,_d.generateRandomIdWithNonUniqueFallback)());if(!(s===null||s===void 0?void 0:s.length)){throw new kRe.FgaValidationError("relations","When calling listRelations, at least one relation must be passed in the relations field")}const d=yield this.batchCheck(s.map(f=>({user:n,relation:f,object:i,contextualTuples:o,context:u})),Object.assign(Object.assign({},r),{headers:l,maxParallelRequests:c}));const p=d.responses.find(f=>f.error);if(p){throw p.error}return{relations:d.responses.filter(f=>f.allowed).map(f=>f._request.relation)}})}readAssertions(t={}){return Ka(this,void 0,void 0,function*(){return this.api.readAssertions(this.getAuthorizationModelId(t),t)})}writeAssertions(t,r={}){return Ka(this,void 0,void 0,function*(){return this.api.writeAssertions(this.getAuthorizationModelId(r),{assertions:t.map(n=>({tuple_key:{user:n.user,relation:n.relation,object:n.object},expectation:n.expectation}))},r)})}};ig.OpenFgaClient=FRe});var nxt=y(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:true});vd.TypeName=vd.TupleOperation=vd.NullValue=vd.NotFoundErrorCode=vd.InternalErrorCode=vd.ErrorCode=void 0;var JTt;(function(e){e["NoError"]="no_error";e["ValidationError"]="validation_error";e["AuthorizationModelNotFound"]="authorization_model_not_found";e["AuthorizationModelResolutionTooComplex"]="authorization_model_resolution_too_complex";e["InvalidWriteInput"]="invalid_write_input";e["CannotAllowDuplicateTuplesInOneRequest"]="cannot_allow_duplicate_tuples_in_one_request";e["CannotAllowDuplicateTypesInOneRequest"]="cannot_allow_duplicate_types_in_one_request";e["CannotAllowMultipleReferencesToOneRelation"]="cannot_allow_multiple_references_to_one_relation";e["InvalidContinuationToken"]="invalid_continuation_token";e["InvalidTupleSet"]="invalid_tuple_set";e["InvalidCheckInput"]="invalid_check_input";e["InvalidExpandInput"]="invalid_expand_input";e["UnsupportedUserSet"]="unsupported_user_set";e["InvalidObjectFormat"]="invalid_object_format";e["WriteFailedDueToInvalidInput"]="write_failed_due_to_invalid_input";e["AuthorizationModelAssertionsNotFound"]="authorization_model_assertions_not_found";e["LatestAuthorizationModelNotFound"]="latest_authorization_model_not_found";e["TypeNotFound"]="type_not_found";e["RelationNotFound"]="relation_not_found";e["EmptyRelationDefinition"]="empty_relation_definition";e["InvalidUser"]="invalid_user";e["InvalidTuple"]="invalid_tuple";e["UnknownRelation"]="unknown_relation";e["StoreIdInvalidLength"]="store_id_invalid_length";e["AssertionsTooManyItems"]="assertions_too_many_items";e["IdTooLong"]="id_too_long";e["AuthorizationModelIdTooLong"]="authorization_model_id_too_long";e["TupleKeyValueNotSpecified"]="tuple_key_value_not_specified";e["TupleKeysTooManyOrTooFewItems"]="tuple_keys_too_many_or_too_few_items";e["PageSizeInvalid"]="page_size_invalid";e["ParamMissingValue"]="param_missing_value";e["DifferenceBaseMissingValue"]="difference_base_missing_value";e["SubtractBaseMissingValue"]="subtract_base_missing_value";e["ObjectTooLong"]="object_too_long";e["RelationTooLong"]="relation_too_long";e["TypeDefinitionsTooFewItems"]="type_definitions_too_few_items";e["TypeInvalidLength"]="type_invalid_length";e["TypeInvalidPattern"]="type_invalid_pattern";e["RelationsTooFewItems"]="relations_too_few_items";e["RelationsTooLong"]="relations_too_long";e["RelationsInvalidPattern"]="relations_invalid_pattern";e["ObjectInvalidPattern"]="object_invalid_pattern";e["QueryStringTypeContinuationTokenMismatch"]="query_string_type_continuation_token_mismatch";e["ExceededEntityLimit"]="exceeded_entity_limit";e["InvalidContextualTuple"]="invalid_contextual_tuple";e["DuplicateContextualTuple"]="duplicate_contextual_tuple";e["InvalidAuthorizationModel"]="invalid_authorization_model";e["UnsupportedSchemaVersion"]="unsupported_schema_version"})(JTt||(vd.ErrorCode=JTt={}));var QTt;(function(e){e["NoInternalError"]="no_internal_error";e["InternalError"]="internal_error";e["Cancelled"]="cancelled";e["DeadlineExceeded"]="deadline_exceeded";e["AlreadyExists"]="already_exists";e["ResourceExhausted"]="resource_exhausted";e["FailedPrecondition"]="failed_precondition";e["Aborted"]="aborted";e["OutOfRange"]="out_of_range";e["Unavailable"]="unavailable";e["DataLoss"]="data_loss"})(QTt||(vd.InternalErrorCode=QTt={}));var ZTt;(function(e){e["NoNotFoundError"]="no_not_found_error";e["UndefinedEndpoint"]="undefined_endpoint";e["StoreIdNotFound"]="store_id_not_found";e["Unimplemented"]="unimplemented"})(ZTt||(vd.NotFoundErrorCode=ZTt={}));var ext;(function(e){e["NullValue"]="NULL_VALUE"})(ext||(vd.NullValue=ext={}));var txt;(function(e){e["Write"]="TUPLE_OPERATION_WRITE";e["Delete"]="TUPLE_OPERATION_DELETE"})(txt||(vd.TupleOperation=txt={}));var rxt;(function(e){e["Unspecified"]="TYPE_NAME_UNSPECIFIED";e["Any"]="TYPE_NAME_ANY";e["Bool"]="TYPE_NAME_BOOL";e["String"]="TYPE_NAME_STRING";e["Int"]="TYPE_NAME_INT";e["Uint"]="TYPE_NAME_UINT";e["Double"]="TYPE_NAME_DOUBLE";e["Duration"]="TYPE_NAME_DURATION";e["Timestamp"]="TYPE_NAME_TIMESTAMP";e["Map"]="TYPE_NAME_MAP";e["List"]="TYPE_NAME_LIST";e["Ipaddress"]="TYPE_NAME_IPADDRESS"})(rxt||(vd.TypeName=rxt={}))});var axt=y(Au=>{"use strict";var exn=Au&&Au.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var MJ=Au&&Au.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))exn(t,e,r)};Object.defineProperty(Au,"__esModule",{value:true});Au.CredentialsMethod=Au.Credentials=Au.GetDefaultRetryParams=Au.Configuration=void 0;MJ(PRe(),Au);MJ(XTt(),Au);MJ(nxt(),Au);var ixt=ERe();Object.defineProperty(Au,"Configuration",{enumerable:true,get:function(){return ixt.Configuration}});Object.defineProperty(Au,"GetDefaultRetryParams",{enumerable:true,get:function(){return ixt.GetDefaultRetryParams}});var sxt=FJ();Object.defineProperty(Au,"Credentials",{enumerable:true,get:function(){return sxt.Credentials}});Object.defineProperty(Au,"CredentialsMethod",{enumerable:true,get:function(){return sxt.CredentialsMethod}});MJ(nC(),Au)});var uxt=y(hP=>{"use strict";var txn=hP&&hP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(hP,"__esModule",{value:true});hP.OpenFGAService=void 0;var MF=txn(Zd());var oxt=axt();var rxn=QO();var BRe=class{static{a(this,"OpenFGAService")}logger;openFGAClient;baseUrl;apiHost;storeId;modelId;userSub;constructor(t,r){if(!MF.default.OPENFGA_SERVICE_URL){throw new Error("OPENFGA_SERVICE_URL is not set")}this.userSub=r&&r.userSub?r.userSub:t.getUserSub();this.baseUrl=MF.default.OPENFGA_SERVICE_URL;this.apiHost=MF.default.OPENFGA_SERVICE_URL.replace(/^(https:\/\/)/,"");this.storeId=MF.default.OPENFGA_STORE_ID;this.modelId=MF.default.OPENFGA_MODEL_ID;this.logger=t.log}async getOpenFgaClient(){if(!this.openFGAClient){const t=await(0,rxn.getServiceAccountIdToken)(this.baseUrl);this.openFGAClient=new oxt.OpenFgaClient({apiScheme:"https",apiHost:this.apiHost,storeId:this.storeId,authorizationModelId:this.modelId,credentials:{method:oxt.CredentialsMethod.ApiToken,config:{token:t}}})}return this.openFGAClient}async createAccountMember(t){try{const r=await this.getOpenFgaClient();await r.write({writes:[{user:`user:${this.userSub}`,relation:"admin",object:`account:${t}`}]})}catch(r){this.logger.warn(`RBAC failed to create account membership. Error: ${r.message}`)}}async getAccountMemberships(){const t=await this.getOpenFgaClient();const r=await t.listObjects({user:`user:${this.userSub}`,relation:"member",type:"account"});if(r){return r.objects.map(n=>n.replace(/^(account:)/,""))}return[]}async isAccountMember(t){try{const r=await this.getOpenFgaClient();const{allowed:n}=await r.check({user:`user:${this.userSub}`,relation:"member",object:`account:${t}`});if(!n){return false}return n}catch(r){this.logger.warn(`RBAC failed to check account membership. Error: ${r.message}`);return false}}async isZuploAdmin(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-admin"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo admin. Error: ${t.message}`);return false}}async isDeployerServiceAccount(){try{const t=await this.getOpenFgaClient();const{tuples:r}=await t.read({object:"role:zuplo-deployer"});const n=[];r.forEach(i=>{const s=i.key.user.replace(/^(user:)/,"");n.push(s)});return n.includes(this.userSub)}catch(t){this.logger.warn(`RBAC failed to check for zuplo deployer. Error: ${t.message}`);return false}}async createProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({writes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to create account-project association. Error: ${n.message}`)}}async deleteProjectAccountAssociation(t,r){try{const n=await this.getOpenFgaClient();await n.write({deletes:[{user:`account:${t}`,relation:"associated_account",object:`project:${r}`}]})}catch(n){this.logger.warn(`RBAC failed to delete account-project association. Error: ${n.message}`)}}};hP.OpenFGAService=BRe});var dxt=y(gP=>{"use strict";var cxt=gP&&gP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(gP,"__esModule",{value:true});gP.TenantService=void 0;var nxn=cxt(Bm());var lxt=cxt(Zd());var ixn=CF();var sxn=new nxn.default({max:500,maxAge:1e3*60*50});var MRe=class extends ixn.ApiServiceClient{static{a(this,"TenantService")}constructor(t,r){if(!lxt.default.TENANT_API_URL){throw new Error("TENANT_API_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(lxt.default.TENANT_API_URL,sxn,{userSub:n,logger:t.log,requestId:t.id})}};gP.TenantService=MRe});var fxt=y(yP=>{"use strict";var pxt=yP&&yP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(yP,"__esModule",{value:true});yP.MeteringService=void 0;var axn=pxt(Bm());var qRe=pxt(Zd());var oxn=CF();var uxn=new axn.default({max:500,maxAge:1e3*60*50});var URe=class extends oxn.ApiServiceClient{static{a(this,"MeteringService")}constructor(t,r){if(!qRe.default.METERING_SERVICE_URL){throw new Error("METERING_SERVICE_URL is not set")}const n=r&&r.userSub?r.userSub:t.getUserSub();super(qRe.default.METERING_SERVICE_URL,uxn,{userSub:n,logger:t.log,requestId:t.id,targetAudience:qRe.default.METERING_SERVICE_URL})}};yP.MeteringService=URe});var mxt=y(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:true});sg.validateHostname=sg.kebabCase=sg.snakeCase=sg.sizeInBytes=void 0;function lxn(e){return new TextEncoder().encode(JSON.stringify(e)).length}a(lxn,"sizeInBytes");sg.sizeInBytes=lxn;function cxn(e){if(!e||e===null){return""}return e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map(t=>t.toLowerCase()).join("_")}a(cxn,"snakeCase");sg.snakeCase=cxn;function dxn(e){if(!e||e===null){return""}const t=e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g);if(t===null){return""}return t.map(r=>r.toLowerCase()).join("-")}a(dxn,"kebabCase");sg.kebabCase=dxn;function pxn(e){try{const t=/^(?!https?:\/\/)([a-zA-Z0-9.-]*|(\*))*\.[a-zA-Z]+$/;if(e&&!t.test(e)){return false}return true}catch(t){}return false}a(pxn,"validateHostname");sg.validateHostname=pxn});var yxt=y(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:true});_e.Type=_e.JsonType=_e.JavaScriptTypeBuilder=_e.JsonTypeBuilder=_e.TypeBuilder=_e.TypeBuilderError=_e.TransformEncodeBuilder=_e.TransformDecodeBuilder=_e.TemplateLiteralDslParser=_e.TemplateLiteralGenerator=_e.TemplateLiteralGeneratorError=_e.TemplateLiteralFinite=_e.TemplateLiteralFiniteError=_e.TemplateLiteralParser=_e.TemplateLiteralParserError=_e.TemplateLiteralResolver=_e.TemplateLiteralPattern=_e.TemplateLiteralPatternError=_e.UnionResolver=_e.KeyArrayResolver=_e.KeyArrayResolverError=_e.KeyResolver=_e.ObjectMap=_e.Intrinsic=_e.IndexedAccessor=_e.TypeClone=_e.TypeExtends=_e.TypeExtendsResult=_e.TypeExtendsError=_e.ExtendsUndefined=_e.TypeGuard=_e.TypeGuardUnknownTypeError=_e.ValueGuard=_e.FormatRegistry=_e.TypeBoxError=_e.TypeRegistry=_e.PatternStringExact=_e.PatternNumberExact=_e.PatternBooleanExact=_e.PatternString=_e.PatternNumber=_e.PatternBoolean=_e.Kind=_e.Hint=_e.Optional=_e.Readonly=_e.Transform=void 0;_e.Transform=Symbol.for("TypeBox.Transform");_e.Readonly=Symbol.for("TypeBox.Readonly");_e.Optional=Symbol.for("TypeBox.Optional");_e.Hint=Symbol.for("TypeBox.Hint");_e.Kind=Symbol.for("TypeBox.Kind");_e.PatternBoolean="(true|false)";_e.PatternNumber="(0|[1-9][0-9]*)";_e.PatternString="(.*)";_e.PatternBooleanExact=`^${_e.PatternBoolean}$`;_e.PatternNumberExact=`^${_e.PatternNumber}$`;_e.PatternStringExact=`^${_e.PatternString}$`;var $Re;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})($Re||(_e.TypeRegistry=$Re={}));var gh=class extends Error{static{a(this,"TypeBoxError")}constructor(t){super(t)}};_e.TypeBoxError=gh;var hxt;(function(e){const t=new Map;function r(){return new Map(t)}a(r,"Entries");e.Entries=r;function n(){return t.clear()}a(n,"Clear");e.Clear=n;function i(l){return t.delete(l)}a(i,"Delete");e.Delete=i;function s(l){return t.has(l)}a(s,"Has");e.Has=s;function o(l,c){t.set(l,c)}a(o,"Set");e.Set=o;function u(l){return t.get(l)}a(u,"Get");e.Get=u})(hxt||(_e.FormatRegistry=hxt={}));var Jt;(function(e){function t(c){return Array.isArray(c)}a(t,"IsArray");e.IsArray=t;function r(c){return typeof c==="bigint"}a(r,"IsBigInt");e.IsBigInt=r;function n(c){return typeof c==="boolean"}a(n,"IsBoolean");e.IsBoolean=n;function i(c){return c===null}a(i,"IsNull");e.IsNull=i;function s(c){return typeof c==="number"}a(s,"IsNumber");e.IsNumber=s;function o(c){return typeof c==="object"&&c!==null}a(o,"IsObject");e.IsObject=o;function u(c){return typeof c==="string"}a(u,"IsString");e.IsString=u;function l(c){return c===void 0}a(l,"IsUndefined");e.IsUndefined=l})(Jt||(_e.ValueGuard=Jt={}));var jRe=class extends gh{static{a(this,"TypeGuardUnknownTypeError")}};_e.TypeGuardUnknownTypeError=jRe;var Ee;(function(e){function t(L){try{new RegExp(L);return true}catch{return false}}a(t,"IsPattern");function r(L){if(!Jt.IsString(L))return false;for(let Se=0;Se<L.length;Se++){const Le=L.charCodeAt(Se);if(Le>=7&&Le<=13||Le===27||Le===127){return false}}return true}a(r,"IsControlCharacterFree");function n(L){return o(L)||se(L)}a(n,"IsAdditionalProperties");function i(L){return Jt.IsUndefined(L)||Jt.IsBigInt(L)}a(i,"IsOptionalBigInt");function s(L){return Jt.IsUndefined(L)||Jt.IsNumber(L)}a(s,"IsOptionalNumber");function o(L){return Jt.IsUndefined(L)||Jt.IsBoolean(L)}a(o,"IsOptionalBoolean");function u(L){return Jt.IsUndefined(L)||Jt.IsString(L)}a(u,"IsOptionalString");function l(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)&&t(L)}a(l,"IsOptionalPattern");function c(L){return Jt.IsUndefined(L)||Jt.IsString(L)&&r(L)}a(c,"IsOptionalFormat");function d(L){return Jt.IsUndefined(L)||se(L)}a(d,"IsOptionalSchema");function p(L){return C(L,"Any")&&u(L.$id)}a(p,"TAny");e.TAny=p;function f(L){return C(L,"Array")&&L.type==="array"&&u(L.$id)&&se(L.items)&&s(L.minItems)&&s(L.maxItems)&&o(L.uniqueItems)&&d(L.contains)&&s(L.minContains)&&s(L.maxContains)}a(f,"TArray");e.TArray=f;function m(L){return C(L,"AsyncIterator")&&L.type==="AsyncIterator"&&u(L.$id)&&se(L.items)}a(m,"TAsyncIterator");e.TAsyncIterator=m;function h(L){return C(L,"BigInt")&&L.type==="bigint"&&u(L.$id)&&i(L.exclusiveMaximum)&&i(L.exclusiveMinimum)&&i(L.maximum)&&i(L.minimum)&&i(L.multipleOf)}a(h,"TBigInt");e.TBigInt=h;function g(L){return C(L,"Boolean")&&L.type==="boolean"&&u(L.$id)}a(g,"TBoolean");e.TBoolean=g;function _(L){return C(L,"Constructor")&&L.type==="constructor"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(_,"TConstructor");e.TConstructor=_;function v(L){return C(L,"Date")&&L.type==="Date"&&u(L.$id)&&s(L.exclusiveMaximumTimestamp)&&s(L.exclusiveMinimumTimestamp)&&s(L.maximumTimestamp)&&s(L.minimumTimestamp)&&s(L.multipleOfTimestamp)}a(v,"TDate");e.TDate=v;function S(L){return C(L,"Function")&&L.type==="function"&&u(L.$id)&&Jt.IsArray(L.parameters)&&L.parameters.every(Se=>se(Se))&&se(L.returns)}a(S,"TFunction");e.TFunction=S;function E(L){return C(L,"Integer")&&L.type==="integer"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(E,"TInteger");e.TInteger=E;function b(L){return C(L,"Intersect")&&(Jt.IsString(L.type)&&L.type!=="object"?false:true)&&Jt.IsArray(L.allOf)&&L.allOf.every(Se=>se(Se)&&!De(Se))&&u(L.type)&&(o(L.unevaluatedProperties)||d(L.unevaluatedProperties))&&u(L.$id)}a(b,"TIntersect");e.TIntersect=b;function A(L){return C(L,"Iterator")&&L.type==="Iterator"&&u(L.$id)&&se(L.items)}a(A,"TIterator");e.TIterator=A;function C(L,Se){return T(L)&&L[_e.Kind]===Se}a(C,"TKindOf");e.TKindOf=C;function T(L){return Jt.IsObject(L)&&_e.Kind in L&&Jt.IsString(L[_e.Kind])}a(T,"TKind");e.TKind=T;function O(L){return I(L)&&Jt.IsString(L.const)}a(O,"TLiteralString");e.TLiteralString=O;function P(L){return I(L)&&Jt.IsNumber(L.const)}a(P,"TLiteralNumber");e.TLiteralNumber=P;function R(L){return I(L)&&Jt.IsBoolean(L.const)}a(R,"TLiteralBoolean");e.TLiteralBoolean=R;function I(L){return C(L,"Literal")&&u(L.$id)&&(Jt.IsBoolean(L.const)||Jt.IsNumber(L.const)||Jt.IsString(L.const))}a(I,"TLiteral");e.TLiteral=I;function D(L){return C(L,"Never")&&Jt.IsObject(L.not)&&Object.getOwnPropertyNames(L.not).length===0}a(D,"TNever");e.TNever=D;function U(L){return C(L,"Not")&&se(L.not)}a(U,"TNot");e.TNot=U;function te(L){return C(L,"Null")&&L.type==="null"&&u(L.$id)}a(te,"TNull");e.TNull=te;function ve(L){return C(L,"Number")&&L.type==="number"&&u(L.$id)&&s(L.exclusiveMaximum)&&s(L.exclusiveMinimum)&&s(L.maximum)&&s(L.minimum)&&s(L.multipleOf)}a(ve,"TNumber");e.TNumber=ve;function me(L){return C(L,"Object")&&L.type==="object"&&u(L.$id)&&Jt.IsObject(L.properties)&&n(L.additionalProperties)&&s(L.minProperties)&&s(L.maxProperties)&&Object.entries(L.properties).every(([Se,Le])=>r(Se)&&se(Le))}a(me,"TObject");e.TObject=me;function he(L){return C(L,"Promise")&&L.type==="Promise"&&u(L.$id)&&se(L.item)}a(he,"TPromise");e.TPromise=he;function Fe(L){return C(L,"Record")&&L.type==="object"&&u(L.$id)&&n(L.additionalProperties)&&Jt.IsObject(L.patternProperties)&&(Se=>{const Le=Object.getOwnPropertyNames(Se.patternProperties);return Le.length===1&&t(Le[0])&&Jt.IsObject(Se.patternProperties)&&se(Se.patternProperties[Le[0]])})(L)}a(Fe,"TRecord");e.TRecord=Fe;function Oe(L){return Jt.IsObject(L)&&_e.Hint in L&&L[_e.Hint]==="Recursive"}a(Oe,"TRecursive");e.TRecursive=Oe;function M(L){return C(L,"Ref")&&u(L.$id)&&Jt.IsString(L.$ref)}a(M,"TRef");e.TRef=M;function Q(L){return C(L,"String")&&L.type==="string"&&u(L.$id)&&s(L.minLength)&&s(L.maxLength)&&l(L.pattern)&&c(L.format)}a(Q,"TString");e.TString=Q;function fe(L){return C(L,"Symbol")&&L.type==="symbol"&&u(L.$id)}a(fe,"TSymbol");e.TSymbol=fe;function B(L){return C(L,"TemplateLiteral")&&L.type==="string"&&Jt.IsString(L.pattern)&&L.pattern[0]==="^"&&L.pattern[L.pattern.length-1]==="$"}a(B,"TTemplateLiteral");e.TTemplateLiteral=B;function ye(L){return C(L,"This")&&u(L.$id)&&Jt.IsString(L.$ref)}a(ye,"TThis");e.TThis=ye;function De(L){return Jt.IsObject(L)&&_e.Transform in L}a(De,"TTransform");e.TTransform=De;function $e(L){return C(L,"Tuple")&&L.type==="array"&&u(L.$id)&&Jt.IsNumber(L.minItems)&&Jt.IsNumber(L.maxItems)&&L.minItems===L.maxItems&&(Jt.IsUndefined(L.items)&&Jt.IsUndefined(L.additionalItems)&&L.minItems===0||Jt.IsArray(L.items)&&L.items.every(Se=>se(Se)))}a($e,"TTuple");e.TTuple=$e;function gt(L){return C(L,"Undefined")&&L.type==="undefined"&&u(L.$id)}a(gt,"TUndefined");e.TUndefined=gt;function ut(L){return F(L)&&L.anyOf.every(Se=>O(Se)||P(Se))}a(ut,"TUnionLiteral");e.TUnionLiteral=ut;function F(L){return C(L,"Union")&&u(L.$id)&&Jt.IsObject(L)&&Jt.IsArray(L.anyOf)&&L.anyOf.every(Se=>se(Se))}a(F,"TUnion");e.TUnion=F;function G(L){return C(L,"Uint8Array")&&L.type==="Uint8Array"&&u(L.$id)&&s(L.minByteLength)&&s(L.maxByteLength)}a(G,"TUint8Array");e.TUint8Array=G;function $(L){return C(L,"Unknown")&&u(L.$id)}a($,"TUnknown");e.TUnknown=$;function W(L){return C(L,"Unsafe")}a(W,"TUnsafe");e.TUnsafe=W;function pe(L){return C(L,"Void")&&L.type==="void"&&u(L.$id)}a(pe,"TVoid");e.TVoid=pe;function H(L){return Jt.IsObject(L)&&L[_e.Readonly]==="Readonly"}a(H,"TReadonly");e.TReadonly=H;function de(L){return Jt.IsObject(L)&&L[_e.Optional]==="Optional"}a(de,"TOptional");e.TOptional=de;function se(L){return Jt.IsObject(L)&&(p(L)||f(L)||g(L)||h(L)||m(L)||_(L)||v(L)||S(L)||E(L)||b(L)||A(L)||I(L)||D(L)||U(L)||te(L)||ve(L)||me(L)||he(L)||Fe(L)||M(L)||Q(L)||fe(L)||B(L)||ye(L)||$e(L)||gt(L)||F(L)||G(L)||$(L)||W(L)||pe(L)||T(L)&&$Re.Has(L[_e.Kind]))}a(se,"TSchema");e.TSchema=se})(Ee||(_e.TypeGuard=Ee={}));var gxt;(function(e){function t(r){return r[_e.Kind]==="Intersect"?r.allOf.every(n=>t(n)):r[_e.Kind]==="Union"?r.anyOf.some(n=>t(n)):r[_e.Kind]==="Undefined"?true:r[_e.Kind]==="Not"?!t(r.not):false}a(t,"Check");e.Check=t})(gxt||(_e.ExtendsUndefined=gxt={}));var qJ=class extends gh{static{a(this,"TypeExtendsError")}};_e.TypeExtendsError=qJ;var at;(function(e){e[e["Union"]=0]="Union";e[e["True"]=1]="True";e[e["False"]=2]="False"})(at||(_e.TypeExtendsResult=at={}));var sC;(function(e){function t(N){return N===at.False?N:at.True}a(t,"IntoBooleanResult");function r(N){throw new qJ(N)}a(r,"Throw");function n(N){return Ee.TNever(N)||Ee.TIntersect(N)||Ee.TUnion(N)||Ee.TUnknown(N)||Ee.TAny(N)}a(n,"IsStructuralRight");function i(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):r("StructuralRight")}a(i,"StructuralRight");function s(N,k){return at.True}a(s,"TAnyRight");function o(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)&&k.anyOf.some(Ae=>Ee.TAny(Ae)||Ee.TUnknown(Ae))?at.True:Ee.TUnion(k)?at.Union:Ee.TUnknown(k)?at.True:Ee.TAny(k)?at.True:at.Union}a(o,"TAny");function u(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)?at.True:at.False}a(u,"TArrayRight");function l(N,k){return Ee.TObject(k)&&B(k)?at.True:n(k)?i(N,k):!Ee.TArray(k)?at.False:t(J(N.items,k.items))}a(l,"TArray");function c(N,k){return n(k)?i(N,k):!Ee.TAsyncIterator(k)?at.False:t(J(N.items,k.items))}a(c,"TAsyncIterator");function d(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBigInt(k)?at.True:at.False}a(d,"TBigInt");function p(N,k){return Ee.TLiteral(N)&&Jt.IsBoolean(N.const)?at.True:Ee.TBoolean(N)?at.True:at.False}a(p,"TBooleanRight");function f(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TBoolean(k)?at.True:at.False}a(f,"TBoolean");function m(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TConstructor(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(m,"TConstructor");function h(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TDate(k)?at.True:at.False}a(h,"TDate");function g(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TFunction(k)?at.False:N.parameters.length>k.parameters.length?at.False:!N.parameters.every((Ae,Be)=>t(J(k.parameters[Be],Ae))===at.True)?at.False:t(J(N.returns,k.returns))}a(g,"TFunction");function _(N,k){return Ee.TLiteral(N)&&Jt.IsNumber(N.const)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(_,"TIntegerRight");function v(N,k){return Ee.TInteger(k)||Ee.TNumber(k)?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):at.False}a(v,"TInteger");function S(N,k){return k.allOf.every(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(S,"TIntersectRight");function E(N,k){return N.allOf.some(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(E,"TIntersect");function b(N,k){return n(k)?i(N,k):!Ee.TIterator(k)?at.False:t(J(N.items,k.items))}a(b,"TIterator");function A(N,k){return Ee.TLiteral(k)&&k.const===N.const?at.True:n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):at.False}a(A,"TLiteral");function C(N,k){return at.False}a(C,"TNeverRight");function T(N,k){return at.True}a(T,"TNever");function O(N){let[k,Ae]=[N,0];while(true){if(!Ee.TNot(k))break;k=k.not;Ae+=1}return Ae%2===0?k:_e.Type.Unknown()}a(O,"UnwrapTNot");function P(N,k){return Ee.TNot(N)?J(O(N),k):Ee.TNot(k)?J(N,O(k)):r("Invalid fallthrough for Not")}a(P,"TNot");function R(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TNull(k)?at.True:at.False}a(R,"TNull");function I(N,k){return Ee.TLiteralNumber(N)?at.True:Ee.TNumber(N)||Ee.TInteger(N)?at.True:at.False}a(I,"TNumberRight");function D(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TInteger(k)||Ee.TNumber(k)?at.True:at.False}a(D,"TNumber");function U(N,k){return Object.getOwnPropertyNames(N.properties).length===k}a(U,"IsObjectPropertyCount");function te(N){return B(N)}a(te,"IsObjectStringLike");function ve(N){return U(N,0)||U(N,1)&&"description"in N.properties&&Ee.TUnion(N.properties.description)&&N.properties.description.anyOf.length===2&&(Ee.TString(N.properties.description.anyOf[0])&&Ee.TUndefined(N.properties.description.anyOf[1])||Ee.TString(N.properties.description.anyOf[1])&&Ee.TUndefined(N.properties.description.anyOf[0]))}a(ve,"IsObjectSymbolLike");function me(N){return U(N,0)}a(me,"IsObjectNumberLike");function he(N){return U(N,0)}a(he,"IsObjectBooleanLike");function Fe(N){return U(N,0)}a(Fe,"IsObjectBigIntLike");function Oe(N){return U(N,0)}a(Oe,"IsObjectDateLike");function M(N){return B(N)}a(M,"IsObjectUint8ArrayLike");function Q(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(Q,"IsObjectFunctionLike");function fe(N){return U(N,0)}a(fe,"IsObjectConstructorLike");function B(N){const k=_e.Type.Number();return U(N,0)||U(N,1)&&"length"in N.properties&&t(J(N.properties["length"],k))===at.True}a(B,"IsObjectArrayLike");function ye(N){const k=_e.Type.Function([_e.Type.Any()],_e.Type.Any());return U(N,0)||U(N,1)&&"then"in N.properties&&t(J(N.properties["then"],k))===at.True}a(ye,"IsObjectPromiseLike");function De(N,k){return J(N,k)===at.False?at.False:Ee.TOptional(N)&&!Ee.TOptional(k)?at.False:at.True}a(De,"Property");function $e(N,k){return Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:Ee.TNever(N)||Ee.TLiteralString(N)&&te(k)||Ee.TLiteralNumber(N)&&me(k)||Ee.TLiteralBoolean(N)&&he(k)||Ee.TSymbol(N)&&ve(k)||Ee.TBigInt(N)&&Fe(k)||Ee.TString(N)&&te(k)||Ee.TSymbol(N)&&ve(k)||Ee.TNumber(N)&&me(k)||Ee.TInteger(N)&&me(k)||Ee.TBoolean(N)&&he(k)||Ee.TUint8Array(N)&&M(k)||Ee.TDate(N)&&Oe(k)||Ee.TConstructor(N)&&fe(k)||Ee.TFunction(N)&&Q(k)?at.True:Ee.TRecord(N)&&Ee.TString(F(N))?(()=>{return k[_e.Hint]==="Record"?at.True:at.False})():Ee.TRecord(N)&&Ee.TNumber(F(N))?(()=>{return U(k,0)?at.True:at.False})():at.False}a($e,"TObjectRight");function gt(N,k){return n(k)?i(N,k):Ee.TRecord(k)?$(N,k):!Ee.TObject(k)?at.False:(()=>{for(const Ae of Object.getOwnPropertyNames(k.properties)){if(!(Ae in N.properties))return at.False;if(De(N.properties[Ae],k.properties[Ae])===at.False){return at.False}}return at.True})()}a(gt,"TObject");function ut(N,k){return n(k)?i(N,k):Ee.TObject(k)&&ye(k)?at.True:!Ee.TPromise(k)?at.False:t(J(N.item,k.item))}a(ut,"TPromise");function F(N){return _e.PatternNumberExact in N.patternProperties?_e.Type.Number():_e.PatternStringExact in N.patternProperties?_e.Type.String():r("Unknown record key pattern")}a(F,"RecordKey");function G(N){return _e.PatternNumberExact in N.patternProperties?N.patternProperties[_e.PatternNumberExact]:_e.PatternStringExact in N.patternProperties?N.patternProperties[_e.PatternStringExact]:r("Unable to get record value schema")}a(G,"RecordValue");function $(N,k){const[Ae,Be]=[F(k),G(k)];return Ee.TLiteralString(N)&&Ee.TNumber(Ae)&&t(J(N,Be))===at.True?at.True:Ee.TUint8Array(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TString(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TArray(N)&&Ee.TNumber(Ae)?J(N,Be):Ee.TObject(N)?(()=>{for(const et of Object.getOwnPropertyNames(N.properties)){if(De(Be,N.properties[et])===at.False){return at.False}}return at.True})():at.False}a($,"TRecordRight");function W(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):!Ee.TRecord(k)?at.False:J(G(N),G(k))}a(W,"TRecord");function pe(N,k){return Ee.TLiteral(N)&&Jt.IsString(N.const)?at.True:Ee.TString(N)?at.True:at.False}a(pe,"TStringRight");function H(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TString(k)?at.True:at.False}a(H,"TString");function de(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TSymbol(k)?at.True:at.False}a(de,"TSymbol");function se(N,k){return Ee.TTemplateLiteral(N)?J(xy.Resolve(N),k):Ee.TTemplateLiteral(k)?J(N,xy.Resolve(k)):r("Invalid fallthrough for TemplateLiteral")}a(se,"TTemplateLiteral");function L(N,k){return Ee.TArray(k)&&N.items!==void 0&&N.items.every(Ae=>J(Ae,k.items)===at.True)}a(L,"IsArrayOfTuple");function Se(N,k){return Ee.TNever(N)?at.True:Ee.TUnknown(N)?at.False:Ee.TAny(N)?at.Union:at.False}a(Se,"TTupleRight");function Le(N,k){return n(k)?i(N,k):Ee.TObject(k)&&B(k)?at.True:Ee.TArray(k)&&L(N,k)?at.True:!Ee.TTuple(k)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)||!Jt.IsUndefined(N.items)&&Jt.IsUndefined(k.items)?at.False:Jt.IsUndefined(N.items)&&!Jt.IsUndefined(k.items)?at.True:N.items.every((Ae,Be)=>J(Ae,k.items[Be])===at.True)?at.True:at.False}a(Le,"TTuple");function Ke(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TUint8Array(k)?at.True:at.False}a(Ke,"TUint8Array");function St(N,k){return n(k)?i(N,k):Ee.TObject(k)?$e(N,k):Ee.TRecord(k)?$(N,k):Ee.TVoid(k)?j(N,k):Ee.TUndefined(k)?at.True:at.False}a(St,"TUndefined");function Mt(N,k){return k.anyOf.some(Ae=>J(N,Ae)===at.True)?at.True:at.False}a(Mt,"TUnionRight");function _r(N,k){return N.anyOf.every(Ae=>J(Ae,k)===at.True)?at.True:at.False}a(_r,"TUnion");function Ur(N,k){return at.True}a(Ur,"TUnknownRight");function Ve(N,k){return Ee.TNever(k)?C(N,k):Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TAny(k)?s(N,k):Ee.TString(k)?pe(N,k):Ee.TNumber(k)?I(N,k):Ee.TInteger(k)?_(N,k):Ee.TBoolean(k)?p(N,k):Ee.TArray(k)?u(N,k):Ee.TTuple(k)?Se(N,k):Ee.TObject(k)?$e(N,k):Ee.TUnknown(k)?at.True:at.False}a(Ve,"TUnknown");function j(N,k){return Ee.TUndefined(N)?at.True:Ee.TUndefined(N)?at.True:at.False}a(j,"VoidRight");function q(N,k){return Ee.TIntersect(k)?S(N,k):Ee.TUnion(k)?Mt(N,k):Ee.TUnknown(k)?Ur(N,k):Ee.TAny(k)?s(N,k):Ee.TObject(k)?$e(N,k):Ee.TVoid(k)?at.True:at.False}a(q,"TVoid");function J(N,k){return Ee.TTemplateLiteral(N)||Ee.TTemplateLiteral(k)?se(N,k):Ee.TNot(N)||Ee.TNot(k)?P(N,k):Ee.TAny(N)?o(N,k):Ee.TArray(N)?l(N,k):Ee.TBigInt(N)?d(N,k):Ee.TBoolean(N)?f(N,k):Ee.TAsyncIterator(N)?c(N,k):Ee.TConstructor(N)?m(N,k):Ee.TDate(N)?h(N,k):Ee.TFunction(N)?g(N,k):Ee.TInteger(N)?v(N,k):Ee.TIntersect(N)?E(N,k):Ee.TIterator(N)?b(N,k):Ee.TLiteral(N)?A(N,k):Ee.TNever(N)?T(N,k):Ee.TNull(N)?R(N,k):Ee.TNumber(N)?D(N,k):Ee.TObject(N)?gt(N,k):Ee.TRecord(N)?W(N,k):Ee.TString(N)?H(N,k):Ee.TSymbol(N)?de(N,k):Ee.TTuple(N)?Le(N,k):Ee.TPromise(N)?ut(N,k):Ee.TUint8Array(N)?Ke(N,k):Ee.TUndefined(N)?St(N,k):Ee.TUnion(N)?_r(N,k):Ee.TUnknown(N)?Ve(N,k):Ee.TVoid(N)?q(N,k):r(`Unknown left type operand '${N[_e.Kind]}'`)}a(J,"Visit");function ae(N,k){return J(N,k)}a(ae,"Extends");e.Extends=ae})(sC||(_e.TypeExtends=sC={}));var Rr;(function(e){function t(o){const u=Object.getOwnPropertyNames(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});const l=Object.getOwnPropertySymbols(o).reduce((c,d)=>({...c,[d]:n(o[d])}),{});return{...u,...l}}a(t,"ObjectType");function r(o){return o.map(u=>n(u))}a(r,"ArrayType");function n(o){return Jt.IsArray(o)?r(o):Jt.IsObject(o)?t(o):o}a(n,"Visit");function i(o){return o.map(u=>s(u))}a(i,"Rest");e.Rest=i;function s(o,u={}){return{...n(o),...u}}a(s,"Type");e.Type=s})(Rr||(_e.TypeClone=Rr={}));var GRe;(function(e){function t(m){return m.map(h=>{const{[_e.Optional]:g,..._}=Rr.Type(h);return _})}a(t,"OptionalUnwrap");function r(m){return m.every(h=>Ee.TOptional(h))}a(r,"IsIntersectOptional");function n(m){return m.some(h=>Ee.TOptional(h))}a(n,"IsUnionOptional");function i(m){return r(m.allOf)?_e.Type.Optional(_e.Type.Intersect(t(m.allOf))):m}a(i,"ResolveIntersect");function s(m){return n(m.anyOf)?_e.Type.Optional(_e.Type.Union(t(m.anyOf))):m}a(s,"ResolveUnion");function o(m){return m[_e.Kind]==="Intersect"?i(m):m[_e.Kind]==="Union"?s(m):m}a(o,"ResolveOptional");function u(m,h){const g=m.allOf.reduce((_,v)=>{const S=p(v,h);return S[_e.Kind]==="Never"?_:[..._,S]},[]);return o(_e.Type.Intersect(g))}a(u,"TIntersect");function l(m,h){const g=m.anyOf.map(_=>p(_,h));return o(_e.Type.Union(g))}a(l,"TUnion");function c(m,h){const g=m.properties[h];return Jt.IsUndefined(g)?_e.Type.Never():_e.Type.Union([g])}a(c,"TObject");function d(m,h){const g=m.items;if(Jt.IsUndefined(g))return _e.Type.Never();const _=g[h];if(Jt.IsUndefined(_))return _e.Type.Never();return _}a(d,"TTuple");function p(m,h){return m[_e.Kind]==="Intersect"?u(m,h):m[_e.Kind]==="Union"?l(m,h):m[_e.Kind]==="Object"?c(m,h):m[_e.Kind]==="Tuple"?d(m,h):_e.Type.Never()}a(p,"Visit");function f(m,h,g={}){const _=h.map(v=>p(m,v.toString()));return o(_e.Type.Union(_,g))}a(f,"Resolve");e.Resolve=f})(GRe||(_e.IndexedAccessor=GRe={}));var _P;(function(e){function t(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toLowerCase()}${f}`}a(t,"Uncapitalize");function r(d){const[p,f]=[d.slice(0,1),d.slice(1)];return`${p.toUpperCase()}${f}`}a(r,"Capitalize");function n(d){return d.toUpperCase()}a(n,"Uppercase");function i(d){return d.toLowerCase()}a(i,"Lowercase");function s(d,p){const f=EP.ParseExact(d.pattern);const m=bP.Check(f);if(!m)return{...d,pattern:o(d.pattern,p)};const h=[...SP.Generate(f)];const g=h.map(S=>_e.Type.Literal(S));const _=u(g,p);const v=_e.Type.Union(_);return _e.Type.TemplateLiteral([v])}a(s,"IntrinsicTemplateLiteral");function o(d,p){return typeof d==="string"?p==="Uncapitalize"?t(d):p==="Capitalize"?r(d):p==="Uppercase"?n(d):p==="Lowercase"?i(d):d:d.toString()}a(o,"IntrinsicLiteral");function u(d,p){if(d.length===0)return[];const[f,...m]=d;return[c(f,p),...u(m,p)]}a(u,"IntrinsicRest");function l(d,p){return Ee.TTemplateLiteral(d)?s(d,p):Ee.TUnion(d)?_e.Type.Union(u(d.anyOf,p)):Ee.TLiteral(d)?_e.Type.Literal(o(d.const,p)):d}a(l,"Visit");function c(d,p){return l(d,p)}a(c,"Map");e.Map=c})(_P||(_e.Intrinsic=_P={}));var vP;(function(e){function t(o,u){return _e.Type.Intersect(o.allOf.map(l=>i(l,u)),{...o})}a(t,"TIntersect");function r(o,u){return _e.Type.Union(o.anyOf.map(l=>i(l,u)),{...o})}a(r,"TUnion");function n(o,u){return u(o)}a(n,"TObject");function i(o,u){return o[_e.Kind]==="Intersect"?t(o,u):o[_e.Kind]==="Union"?r(o,u):o[_e.Kind]==="Object"?n(o,u):o}a(i,"Visit");function s(o,u,l){return{...i(Rr.Type(o),u),...l}}a(s,"Map");e.Map=s})(vP||(_e.ObjectMap=vP={}));var UJ;(function(e){function t(c){return c[0]==="^"&&c[c.length-1]==="$"?c.slice(1,c.length-1):c}a(t,"UnwrapPattern");function r(c,d){return c.allOf.reduce((p,f)=>[...p,...o(f,d)],[])}a(r,"TIntersect");function n(c,d){const p=c.anyOf.map(f=>o(f,d));return[...p.reduce((f,m)=>m.map(h=>p.every(g=>g.includes(h))?f.add(h):f)[0],new Set)]}a(n,"TUnion");function i(c,d){return Object.getOwnPropertyNames(c.properties)}a(i,"TObject");function s(c,d){return d.includePatterns?Object.getOwnPropertyNames(c.patternProperties):[]}a(s,"TRecord");function o(c,d){return Ee.TIntersect(c)?r(c,d):Ee.TUnion(c)?n(c,d):Ee.TObject(c)?i(c,d):Ee.TRecord(c)?s(c,d):[]}a(o,"Visit");function u(c,d){return[...new Set(o(c,d))]}a(u,"ResolveKeys");e.ResolveKeys=u;function l(c){const d=u(c,{includePatterns:true});const p=d.map(f=>`(${t(f)})`);return`^(${p.join("|")})$`}a(l,"ResolvePattern");e.ResolvePattern=l})(UJ||(_e.KeyResolver=UJ={}));var $J=class extends gh{static{a(this,"KeyArrayResolverError")}};_e.KeyArrayResolverError=$J;var qF;(function(e){function t(r){return Array.isArray(r)?r:Ee.TUnionLiteral(r)?r.anyOf.map(n=>n.const.toString()):Ee.TLiteral(r)?[r.const]:Ee.TTemplateLiteral(r)?(()=>{const n=EP.ParseExact(r.pattern);if(!bP.Check(n))throw new $J("Cannot resolve keys from infinite template expression");return[...SP.Generate(n)]})():[]}a(t,"Resolve");e.Resolve=t})(qF||(_e.KeyArrayResolver=qF={}));var HRe;(function(e){function*t(n){for(const i of n.anyOf){if(i[_e.Kind]==="Union"){yield*t(i)}else{yield i}}}a(t,"TUnion");function r(n){return _e.Type.Union([...t(n)],{...n})}a(r,"Resolve");e.Resolve=r})(HRe||(_e.UnionResolver=HRe={}));var jJ=class extends gh{static{a(this,"TemplateLiteralPatternError")}};_e.TemplateLiteralPatternError=jJ;var GJ;(function(e){function t(s){throw new jJ(s)}a(t,"Throw");function r(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(r,"Escape");function n(s,o){return Ee.TTemplateLiteral(s)?s.pattern.slice(1,s.pattern.length-1):Ee.TUnion(s)?`(${s.anyOf.map(u=>n(u,o)).join("|")})`:Ee.TNumber(s)?`${o}${_e.PatternNumber}`:Ee.TInteger(s)?`${o}${_e.PatternNumber}`:Ee.TBigInt(s)?`${o}${_e.PatternNumber}`:Ee.TString(s)?`${o}${_e.PatternString}`:Ee.TLiteral(s)?`${o}${r(s.const.toString())}`:Ee.TBoolean(s)?`${o}${_e.PatternBoolean}`:t(`Unexpected Kind '${s[_e.Kind]}'`)}a(n,"Visit");function i(s){return`^${s.map(o=>n(o,"")).join("")}$`}a(i,"Create");e.Create=i})(GJ||(_e.TemplateLiteralPattern=GJ={}));var xy;(function(e){function t(r){const n=EP.ParseExact(r.pattern);if(!bP.Check(n))return _e.Type.String();const i=[...SP.Generate(n)].map(s=>_e.Type.Literal(s));return _e.Type.Union(i)}a(t,"Resolve");e.Resolve=t})(xy||(_e.TemplateLiteralResolver=xy={}));var UF=class extends gh{static{a(this,"TemplateLiteralParserError")}};_e.TemplateLiteralParserError=UF;var EP;(function(e){function t(m,h,g){return m[h]===g&&m.charCodeAt(h-1)!==92}a(t,"IsNonEscaped");function r(m,h){return t(m,h,"(")}a(r,"IsOpenParen");function n(m,h){return t(m,h,")")}a(n,"IsCloseParen");function i(m,h){return t(m,h,"|")}a(i,"IsSeparator");function s(m){if(!(r(m,0)&&n(m,m.length-1)))return false;let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(h===0&&g!==m.length-1)return false}return true}a(s,"IsGroup");function o(m){return m.slice(1,m.length-1)}a(o,"InGroup");function u(m){let h=0;for(let g=0;g<m.length;g++){if(r(m,g))h+=1;if(n(m,g))h-=1;if(i(m,g)&&h===0)return true}return false}a(u,"IsPrecedenceOr");function l(m){for(let h=0;h<m.length;h++){if(r(m,h))return true}return false}a(l,"IsPrecedenceAnd");function c(m){let[h,g]=[0,0];const _=[];for(let S=0;S<m.length;S++){if(r(m,S))h+=1;if(n(m,S))h-=1;if(i(m,S)&&h===0){const E=m.slice(g,S);if(E.length>0)_.push(p(E));g=S+1}}const v=m.slice(g);if(v.length>0)_.push(p(v));if(_.length===0)return{type:"const",const:""};if(_.length===1)return _[0];return{type:"or",expr:_}}a(c,"Or");function d(m){function h(v,S){if(!r(v,S))throw new UF(`TemplateLiteralParser: Index must point to open parens`);let E=0;for(let b=S;b<v.length;b++){if(r(v,b))E+=1;if(n(v,b))E-=1;if(E===0)return[S,b]}throw new UF(`TemplateLiteralParser: Unclosed group parens in expression`)}a(h,"Group");function g(v,S){for(let E=S;E<v.length;E++){if(r(v,E))return[S,E]}return[S,v.length]}a(g,"Range");const _=[];for(let v=0;v<m.length;v++){if(r(m,v)){const[S,E]=h(m,v);const b=m.slice(S,E+1);_.push(p(b));v=E}else{const[S,E]=g(m,v);const b=m.slice(S,E);if(b.length>0)_.push(p(b));v=E-1}}return _.length===0?{type:"const",const:""}:_.length===1?_[0]:{type:"and",expr:_}}a(d,"And");function p(m){return s(m)?p(o(m)):u(m)?c(m):l(m)?d(m):{type:"const",const:m}}a(p,"Parse");e.Parse=p;function f(m){return p(m.slice(1,m.length-1))}a(f,"ParseExact");e.ParseExact=f})(EP||(_e.TemplateLiteralParser=EP={}));var HJ=class extends gh{static{a(this,"TemplateLiteralFiniteError")}};_e.TemplateLiteralFiniteError=HJ;var bP;(function(e){function t(o){throw new HJ(o)}a(t,"Throw");function r(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="0"&&o.expr[1].type==="const"&&o.expr[1].const==="[1-9][0-9]*"}a(r,"IsNumber");function n(o){return o.type==="or"&&o.expr.length===2&&o.expr[0].type==="const"&&o.expr[0].const==="true"&&o.expr[1].type==="const"&&o.expr[1].const==="false"}a(n,"IsBoolean");function i(o){return o.type==="const"&&o.const===".*"}a(i,"IsString");function s(o){return n(o)?true:r(o)||i(o)?false:o.type==="and"?o.expr.every(u=>s(u)):o.type==="or"?o.expr.every(u=>s(u)):o.type==="const"?true:t(`Unknown expression type`)}a(s,"Check");e.Check=s})(bP||(_e.TemplateLiteralFinite=bP={}));var VJ=class extends gh{static{a(this,"TemplateLiteralGeneratorError")}};_e.TemplateLiteralGeneratorError=VJ;var SP;(function(e){function*t(o){if(o.length===1)return yield*o[0];for(const u of o[0]){for(const l of t(o.slice(1))){yield`${u}${l}`}}}a(t,"Reduce");function*r(o){return yield*t(o.expr.map(u=>[...s(u)]))}a(r,"And");function*n(o){for(const u of o.expr)yield*s(u)}a(n,"Or");function*i(o){return yield o.const}a(i,"Const");function*s(o){return o.type==="and"?yield*r(o):o.type==="or"?yield*n(o):o.type==="const"?yield*i(o):(()=>{throw new VJ("Unknown expression")})()}a(s,"Generate");e.Generate=s})(SP||(_e.TemplateLiteralGenerator=SP={}));var VRe;(function(e){function*t(s){const o=s.trim().replace(/"|'/g,"");return o==="boolean"?yield _e.Type.Boolean():o==="number"?yield _e.Type.Number():o==="bigint"?yield _e.Type.BigInt():o==="string"?yield _e.Type.String():yield(()=>{const u=o.split("|").map(l=>_e.Type.Literal(l.trim()));return u.length===0?_e.Type.Never():u.length===1?u[0]:_e.Type.Union(u)})()}a(t,"ParseUnion");function*r(s){if(s[1]!=="{"){const o=_e.Type.Literal("$");const u=n(s.slice(1));return yield*[o,...u]}for(let o=2;o<s.length;o++){if(s[o]==="}"){const u=t(s.slice(2,o));const l=n(s.slice(o+1));return yield*[...u,...l]}}yield _e.Type.Literal(s)}a(r,"ParseTerminal");function*n(s){for(let o=0;o<s.length;o++){if(s[o]==="$"){const u=_e.Type.Literal(s.slice(0,o));const l=r(s.slice(o));return yield*[u,...l]}}yield _e.Type.Literal(s)}a(n,"ParseLiteral");function i(s){return[...n(s)]}a(i,"Parse");e.Parse=i})(VRe||(_e.TemplateLiteralDslParser=VRe={}));var zJ=class{static{a(this,"TransformDecodeBuilder")}constructor(t){this.schema=t}Decode(t){return new KJ(this.schema,t)}};_e.TransformDecodeBuilder=zJ;var KJ=class{static{a(this,"TransformEncodeBuilder")}constructor(t,r){this.schema=t;this.decode=r}Encode(t){const r=Rr.Type(this.schema);return Ee.TTransform(r)?(()=>{const n=a(o=>r[_e.Transform].Encode(t(o)),"Encode");const i=a(o=>this.decode(r[_e.Transform].Decode(o)),"Decode");const s={Encode:n,Decode:i};return{...r,[_e.Transform]:s}})():(()=>{const n={Decode:this.decode,Encode:t};return{...r,[_e.Transform]:n}})()}};_e.TransformEncodeBuilder=KJ;var fxn=0;var WJ=class extends gh{static{a(this,"TypeBuilderError")}};_e.TypeBuilderError=WJ;var YJ=class{static{a(this,"TypeBuilder")}Create(t){return t}Throw(t){throw new WJ(t)}Discard(t,r){const{[r]:n,...i}=t;return i}Strict(t){return JSON.parse(JSON.stringify(t))}};_e.TypeBuilder=YJ;var $F=class extends YJ{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(t){return this.Readonly(this.Optional(t))}Readonly(t){return{...Rr.Type(t),[_e.Readonly]:"Readonly"}}Optional(t){return{...Rr.Type(t),[_e.Optional]:"Optional"}}Any(t={}){return this.Create({...t,[_e.Kind]:"Any"})}Array(t,r={}){return this.Create({...r,[_e.Kind]:"Array",type:"array",items:Rr.Type(t)})}Boolean(t={}){return this.Create({...t,[_e.Kind]:"Boolean",type:"boolean"})}Capitalize(t,r={}){return{..._P.Map(Rr.Type(t),"Capitalize"),...r}}Composite(t,r){const n=_e.Type.Intersect(t,{});const i=UJ.ResolveKeys(n,{includePatterns:false});const s=i.reduce((o,u)=>({...o,[u]:_e.Type.Index(n,[u])}),{});return _e.Type.Object(s,r)}Enum(t,r={}){const n=Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]);const i=n.map(s=>Jt.IsString(s)?{[_e.Kind]:"Literal",type:"string",const:s}:{[_e.Kind]:"Literal",type:"number",const:s});return this.Create({...r,[_e.Kind]:"Union",anyOf:i})}Extends(t,r,n,i,s={}){switch(sC.Extends(t,r)){case at.Union:return this.Union([Rr.Type(n,s),Rr.Type(i,s)]);case at.True:return Rr.Type(n,s);case at.False:return Rr.Type(i,s)}}Exclude(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Exclude(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Exclude(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)===at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?this.Never(n):Rr.Type(t,n)}Extract(t,r,n={}){return Ee.TTemplateLiteral(t)?this.Extract(xy.Resolve(t),r,n):Ee.TTemplateLiteral(r)?this.Extract(t,xy.Resolve(r),n):Ee.TUnion(t)?(()=>{const i=t.anyOf.filter(s=>sC.Extends(s,r)!==at.False);return i.length===1?Rr.Type(i[0],n):this.Union(i,n)})():sC.Extends(t,r)!==at.False?Rr.Type(t,n):this.Never(n)}Index(t,r,n={}){return Ee.TArray(t)&&Ee.TNumber(r)?(()=>{return Rr.Type(t.items,n)})():Ee.TTuple(t)&&Ee.TNumber(r)?(()=>{const i=Jt.IsUndefined(t.items)?[]:t.items;const s=i.map(o=>Rr.Type(o));return this.Union(s,n)})():(()=>{const i=qF.Resolve(r);const s=Rr.Type(t);return GRe.Resolve(s,i,n)})()}Integer(t={}){return this.Create({...t,[_e.Kind]:"Integer",type:"integer"})}Intersect(t,r={}){if(t.length===0)return _e.Type.Never();if(t.length===1)return Rr.Type(t[0],r);if(t.some(o=>Ee.TTransform(o)))this.Throw("Cannot intersect transform types");const n=t.every(o=>Ee.TObject(o));const i=Rr.Rest(t);const s=Ee.TSchema(r.unevaluatedProperties)?{unevaluatedProperties:Rr.Type(r.unevaluatedProperties)}:{};return r.unevaluatedProperties===false||Ee.TSchema(r.unevaluatedProperties)||n?this.Create({...r,...s,[_e.Kind]:"Intersect",type:"object",allOf:i}):this.Create({...r,...s,[_e.Kind]:"Intersect",allOf:i})}KeyOf(t,r={}){return Ee.TRecord(t)?(()=>{const n=Object.getOwnPropertyNames(t.patternProperties)[0];return n===_e.PatternNumberExact?this.Number(r):n===_e.PatternStringExact?this.String(r):this.Throw("Unable to resolve key type from Record key pattern")})():Ee.TTuple(t)?(()=>{const n=Jt.IsUndefined(t.items)?[]:t.items;const i=n.map((s,o)=>_e.Type.Literal(o.toString()));return this.Union(i,r)})():Ee.TArray(t)?(()=>{return this.Number(r)})():(()=>{const n=UJ.ResolveKeys(t,{includePatterns:false});if(n.length===0)return this.Never(r);const i=n.map(s=>this.Literal(s));return this.Union(i,r)})()}Literal(t,r={}){return this.Create({...r,[_e.Kind]:"Literal",const:t,type:typeof t})}Lowercase(t,r={}){return{..._P.Map(Rr.Type(t),"Lowercase"),...r}}Never(t={}){return this.Create({...t,[_e.Kind]:"Never",not:{}})}Not(t,r){return this.Create({...r,[_e.Kind]:"Not",not:Rr.Type(t)})}Null(t={}){return this.Create({...t,[_e.Kind]:"Null",type:"null"})}Number(t={}){return this.Create({...t,[_e.Kind]:"Number",type:"number"})}Object(t,r={}){const n=Object.getOwnPropertyNames(t);const i=n.filter(l=>Ee.TOptional(t[l]));const s=n.filter(l=>!i.includes(l));const o=Ee.TSchema(r.additionalProperties)?{additionalProperties:Rr.Type(r.additionalProperties)}:{};const u=n.reduce((l,c)=>({...l,[c]:Rr.Type(t[c])}),{});return s.length>0?this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u,required:s}):this.Create({...r,...o,[_e.Kind]:"Object",type:"object",properties:u})}Omit(t,r,n={}){const i=qF.Resolve(r);return vP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>!i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Partial(t,r={}){return vP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Optional(n.properties[o])}},{});return this.Object(i,this.Discard(n,"required"))},r)}Pick(t,r,n={}){const i=qF.Resolve(r);return vP.Map(this.Discard(Rr.Type(t),_e.Transform),s=>{if(Jt.IsArray(s.required)){s.required=s.required.filter(o=>i.includes(o));if(s.required.length===0)delete s.required}for(const o of Object.getOwnPropertyNames(s.properties)){if(!i.includes(o))delete s.properties[o]}return this.Create(s)},n)}Record(t,r,n={}){return Ee.TTemplateLiteral(t)?(()=>{const i=EP.ParseExact(t.pattern);return bP.Check(i)?this.Object([...SP.Generate(i)].reduce((s,o)=>({...s,[o]:Rr.Type(r)}),{}),n):this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[t.pattern]:Rr.Type(r)}})})():Ee.TUnion(t)?(()=>{const i=HRe.Resolve(t);if(Ee.TUnionLiteral(i)){const s=i.anyOf.reduce((o,u)=>({...o,[u.const]:Rr.Type(r)}),{});return this.Object(s,{...n,[_e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():Ee.TLiteral(t)?(()=>{return Jt.IsString(t.const)||Jt.IsNumber(t.const)?this.Object({[t.const]:Rr.Type(r)},n):this.Throw("Record key of type literal is not of type string or number")})():Ee.TInteger(t)||Ee.TNumber(t)?(()=>{return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[_e.PatternNumberExact]:Rr.Type(r)}})})():Ee.TString(t)?(()=>{const i=Jt.IsUndefined(t.pattern)?_e.PatternStringExact:t.pattern;return this.Create({...n,[_e.Kind]:"Record",type:"object",patternProperties:{[i]:Rr.Type(r)}})})():this.Never()}Recursive(t,r={}){if(Jt.IsUndefined(r.$id))r.$id=`T${fxn++}`;const n=t({[_e.Kind]:"This",$ref:`${r.$id}`});n.$id=r.$id;return this.Create({...r,[_e.Hint]:"Recursive",...n})}Ref(t,r={}){if(Jt.IsString(t))return this.Create({...r,[_e.Kind]:"Ref",$ref:t});if(Jt.IsUndefined(t.$id))this.Throw("Reference target type must specify an $id");return this.Create({...r,[_e.Kind]:"Ref",$ref:t.$id})}Required(t,r={}){return vP.Map(this.Discard(Rr.Type(t),_e.Transform),n=>{const i=Object.getOwnPropertyNames(n.properties).reduce((s,o)=>{return{...s,[o]:this.Discard(n.properties[o],_e.Optional)}},{});return this.Object(i,n)},r)}Rest(t){return Ee.TTuple(t)&&!Jt.IsUndefined(t.items)?Rr.Rest(t.items):Ee.TIntersect(t)?Rr.Rest(t.allOf):Ee.TUnion(t)?Rr.Rest(t.anyOf):[]}String(t={}){return this.Create({...t,[_e.Kind]:"String",type:"string"})}TemplateLiteral(t,r={}){const n=Jt.IsString(t)?GJ.Create(VRe.Parse(t)):GJ.Create(t);return this.Create({...r,[_e.Kind]:"TemplateLiteral",type:"string",pattern:n})}Transform(t){return new zJ(t)}Tuple(t,r={}){const[n,i,s]=[false,t.length,t.length];const o=Rr.Rest(t);const u=t.length>0?{...r,[_e.Kind]:"Tuple",type:"array",items:o,additionalItems:n,minItems:i,maxItems:s}:{...r,[_e.Kind]:"Tuple",type:"array",minItems:i,maxItems:s};return this.Create(u)}Uncapitalize(t,r={}){return{..._P.Map(Rr.Type(t),"Uncapitalize"),...r}}Union(t,r={}){return Ee.TTemplateLiteral(t)?xy.Resolve(t):(()=>{const n=t;if(n.length===0)return this.Never(r);if(n.length===1)return this.Create(Rr.Type(n[0],r));const i=Rr.Rest(n);return this.Create({...r,[_e.Kind]:"Union",anyOf:i})})()}Unknown(t={}){return this.Create({...t,[_e.Kind]:"Unknown"})}Unsafe(t={}){return this.Create({...t,[_e.Kind]:t[_e.Kind]||"Unsafe"})}Uppercase(t,r={}){return{..._P.Map(Rr.Type(t),"Uppercase"),...r}}};_e.JsonTypeBuilder=$F;var XJ=class extends $F{static{a(this,"JavaScriptTypeBuilder")}AsyncIterator(t,r={}){return this.Create({...r,[_e.Kind]:"AsyncIterator",type:"AsyncIterator",items:Rr.Type(t)})}Awaited(t,r={}){const n=a(i=>i.length>0?(()=>{const[s,...o]=i;return[this.Awaited(s),...n(o)]})():i,"Unwrap");return Ee.TIntersect(t)?_e.Type.Intersect(n(t.allOf)):Ee.TUnion(t)?_e.Type.Union(n(t.anyOf)):Ee.TPromise(t)?this.Awaited(t.item):Rr.Type(t,r)}BigInt(t={}){return this.Create({...t,[_e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(t,r={}){return this.Tuple([...t.parameters],{...r})}Constructor(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Constructor",type:"constructor",parameters:i,returns:s})}Date(t={}){return this.Create({...t,[_e.Kind]:"Date",type:"Date"})}Function(t,r,n){const[i,s]=[Rr.Rest(t),Rr.Type(r)];return this.Create({...n,[_e.Kind]:"Function",type:"function",parameters:i,returns:s})}InstanceType(t,r={}){return Rr.Type(t.returns,r)}Iterator(t,r={}){return this.Create({...r,[_e.Kind]:"Iterator",type:"Iterator",items:Rr.Type(t)})}Parameters(t,r={}){return this.Tuple(t.parameters,{...r})}Promise(t,r={}){return this.Create({...r,[_e.Kind]:"Promise",type:"Promise",item:Rr.Type(t)})}RegExp(t,r={}){const n=Jt.IsString(t)?t:t.source;return this.Create({...r,[_e.Kind]:"String",type:"string",pattern:n})}RegEx(t,r={}){return this.RegExp(t,r)}ReturnType(t,r={}){return Rr.Type(t.returns,r)}Symbol(t){return this.Create({...t,[_e.Kind]:"Symbol",type:"symbol"})}Undefined(t={}){return this.Create({...t,[_e.Kind]:"Undefined",type:"undefined"})}Uint8Array(t={}){return this.Create({...t,[_e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(t={}){return this.Create({...t,[_e.Kind]:"Void",type:"void"})}};_e.JavaScriptTypeBuilder=XJ;_e.JsonType=new $F;_e.Type=new XJ});var _xt=y(JJ=>{"use strict";Object.defineProperty(JJ,"__esModule",{value:true});JJ.CustomTypeBuilder=void 0;var jF=yxt();var zRe=class extends jF.TypeBuilder{static{a(this,"CustomTypeBuilder")}static Date(){return jF.Type.Unsafe({type:"string",format:"date-time"})}static Nullable(t){return jF.Type.Union([t,jF.Type.Null()])}static StringEnum(t){return jF.Type.Unsafe({type:"string",enum:t})}};JJ.CustomTypeBuilder=zRe});var Sxt=y(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:true});Tr.throwIfNotNumber=Tr.throwIfNotString=Tr.throwIfUndefinedOrNull=Tr.throwIfUndefined=Tr.ArgumentTypeError=Tr.ArgumentUndefinedError=Tr.ValidationError=Tr.withUndefinedAsNull=Tr.withNullAsUndefined=Tr.validateConstraint=Tr.validateConstraints=Tr.areFunctions=Tr.isFunction=Tr.isEmptyObject=Tr.assertAllDefined=Tr.assertIsDefined=Tr.assertType=Tr.isUndefinedOrNull=Tr.isDefined=Tr.isUndefined=Tr.isBoolean=Tr.isIterable=Tr.isNumber=Tr.isTypedArray=Tr.isObject=Tr.isStringArray=Tr.isString=void 0;function QJ(e){return typeof e==="string"}a(QJ,"isString");Tr.isString=QJ;function mxn(e){return Array.isArray(e)&&e.every(t=>QJ(t))}a(mxn,"isStringArray");Tr.isStringArray=mxn;function vxt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}a(vxt,"isObject");Tr.isObject=vxt;function hxn(e){const t=Object.getPrototypeOf(Uint8Array);return typeof e==="object"&&e instanceof t}a(hxn,"isTypedArray");Tr.isTypedArray=hxn;function Ext(e){return typeof e==="number"&&!isNaN(e)}a(Ext,"isNumber");Tr.isNumber=Ext;function gxn(e){return!!e&&typeof e[Symbol.iterator]==="function"}a(gxn,"isIterable");Tr.isIterable=gxn;function yxn(e){return e===true||e===false}a(yxn,"isBoolean");Tr.isBoolean=yxn;function KRe(e){return typeof e==="undefined"}a(KRe,"isUndefined");Tr.isUndefined=KRe;function _xn(e){return!AP(e)}a(_xn,"isDefined");Tr.isDefined=_xn;function AP(e){return KRe(e)||e===null}a(AP,"isUndefinedOrNull");Tr.isUndefinedOrNull=AP;function vxn(e,t){if(!e){throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}}a(vxn,"assertType");Tr.assertType=vxn;function Exn(e){if(AP(e)){throw new Error("Assertion Failed: argument is undefined or null")}return e}a(Exn,"assertIsDefined");Tr.assertIsDefined=Exn;function bxn(...e){const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(AP(n)){throw new Error(`Assertion Failed: argument at index ${r} is undefined or null`)}t.push(n)}return t}a(bxn,"assertAllDefined");Tr.assertAllDefined=bxn;var Sxn=Object.prototype.hasOwnProperty;function Axn(e){if(!vxt(e)){return false}for(const t in e){if(Sxn.call(e,t)){return false}}return true}a(Axn,"isEmptyObject");Tr.isEmptyObject=Axn;function WRe(e){return typeof e==="function"}a(WRe,"isFunction");Tr.isFunction=WRe;function Cxn(...e){return e.length>0&&e.every(WRe)}a(Cxn,"areFunctions");Tr.areFunctions=Cxn;function wxn(e,t){const r=Math.min(e.length,t.length);for(let n=0;n<r;n++){bxt(e[n],t[n])}}a(wxn,"validateConstraints");Tr.validateConstraints=wxn;function bxt(e,t){if(QJ(t)){if(typeof e!==t){throw new Error(`argument does not match constraint: typeof ${t}`)}}else if(WRe(t)){try{if(e instanceof t){return}}catch{}if(!AP(e)&&e.constructor===t){return}if(t.length===1&&t.call(void 0,e)===true){return}throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}a(bxt,"validateConstraint");Tr.validateConstraint=bxt;function Txn(e){return e===null?void 0:e}a(Txn,"withNullAsUndefined");Tr.withNullAsUndefined=Txn;function xxn(e){return typeof e==="undefined"?null:e}a(xxn,"withUndefinedAsNull");Tr.withUndefinedAsNull=xxn;var GF=class extends Error{static{a(this,"ValidationError")}constructor(t){super(t)}};Tr.ValidationError=GF;var HF=class extends GF{static{a(this,"ArgumentUndefinedError")}constructor(t){super(`The argument '${t}' is undefined.`)}};Tr.ArgumentUndefinedError=HF;var VF=class extends GF{static{a(this,"ArgumentTypeError")}constructor(t,r){super(`The argument '${t}' must be of type '${r}'.`)}};Tr.ArgumentTypeError=VF;function Rxn(e,t){if(KRe(e)){throw new HF(t)}return true}a(Rxn,"throwIfUndefined");Tr.throwIfUndefined=Rxn;function YRe(e,t){if(AP(e)){throw new HF(t)}}a(YRe,"throwIfUndefinedOrNull");Tr.throwIfUndefinedOrNull=YRe;function Oxn(e,t){YRe(e,t);if(!QJ(e)){throw new VF(t,"string")}return true}a(Oxn,"throwIfNotString");Tr.throwIfNotString=Oxn;function Pxn(e,t){YRe(e,t);if(!Ext(e)){throw new VF(t,"number")}return true}a(Pxn,"throwIfNotNumber");Tr.throwIfNotNumber=Pxn});var hn=y(mt=>{"use strict";var Axt=mt&&mt.__createBinding||(Object.create?function(e,t,r,n){if(n===void 0)n=r;var i=Object.getOwnPropertyDescriptor(t,r);if(!i||("get"in i?!t.__esModule:i.writable||i.configurable)){i={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,n,i)}:function(e,t,r,n){if(n===void 0)n=r;e[n]=t[r]});var Nxn=mt&&mt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var ZJ=mt&&mt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Axt(t,e,r)}Nxn(t,e);return t};var KE=mt&&mt.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))Axt(t,e,r)};Object.defineProperty(mt,"__esModule",{value:true});mt.getRequiredEnvVar=mt.env=mt.EnvironmentalVariableRequiredError=mt.xfs=mt.RouteValidator=mt.JsonValidator=mt.MeteringService=mt.TenantService=mt.OpenFGAService=mt.DevApiService=mt.getContentApiStorageTarballPath=mt.contentApiTarballFileName=mt.ContentApiService=mt.AuthApiService=mt.getServiceAccountIdToken=mt.createApiKeyServiceClient=mt.ApiKeyService=mt.RouteVersions=mt.startsWithReservedKeyword=mt.logger=mt.createNewLogger=mt.graphQL=mt.CloudStorage=mt.fly=mt.ApiServer=mt.featureFlagsPlugin=mt.ensureZuploUserPlugin=mt.ensureZuploAdminPlugin=mt.ensureServiceAccountPlugin=mt.apiKeyAuthPlugin=mt.errorHandler=mt.DeploymentLogState=mt.signString=mt.FeatureFlags=mt.VALID_COMPATIBILITY_DATES=mt.DEFAULT_COMPATIBILITY_DATE=mt.COMPATIBILITY_FLAG_MAPPINGS=mt.WARNING_STATUS=mt.WARNING_SEVERITY=mt.GOOD_STATUS=mt.FAILURE_STATUS=mt.ERROR_SEVERITY=mt.BuildIssueError=mt.hasBlockedNotifications=mt.getDefaultFlags=mt.getBuildFlagsForDeployment=mt.CommonAuth=void 0;var XRe=ZJ(Zd());mt.env=XRe.default;Object.defineProperty(mt,"EnvironmentalVariableRequiredError",{enumerable:true,get:function(){return XRe.EnvironmentalVariableRequiredError}});Object.defineProperty(mt,"getRequiredEnvVar",{enumerable:true,get:function(){return XRe.getRequiredEnvVar}});KE(ac(),mt);var Ixn=jce();Object.defineProperty(mt,"CommonAuth",{enumerable:true,get:function(){return Ixn.CommonAuth}});var JRe=jGe();Object.defineProperty(mt,"getBuildFlagsForDeployment",{enumerable:true,get:function(){return JRe.getBuildFlagsForDeployment}});Object.defineProperty(mt,"getDefaultFlags",{enumerable:true,get:function(){return JRe.getDefaultFlags}});Object.defineProperty(mt,"hasBlockedNotifications",{enumerable:true,get:function(){return JRe.hasBlockedNotifications}});var CP=GGe();Object.defineProperty(mt,"BuildIssueError",{enumerable:true,get:function(){return CP.BuildIssueError}});Object.defineProperty(mt,"ERROR_SEVERITY",{enumerable:true,get:function(){return CP.ERROR_SEVERITY}});Object.defineProperty(mt,"FAILURE_STATUS",{enumerable:true,get:function(){return CP.FAILURE_STATUS}});Object.defineProperty(mt,"GOOD_STATUS",{enumerable:true,get:function(){return CP.GOOD_STATUS}});Object.defineProperty(mt,"WARNING_SEVERITY",{enumerable:true,get:function(){return CP.WARNING_SEVERITY}});Object.defineProperty(mt,"WARNING_STATUS",{enumerable:true,get:function(){return CP.WARNING_STATUS}});var kxn=HGe();Object.defineProperty(mt,"COMPATIBILITY_FLAG_MAPPINGS",{enumerable:true,get:function(){return kxn.COMPATIBILITY_FLAG_MAPPINGS}});var Cxt=KGe();Object.defineProperty(mt,"DEFAULT_COMPATIBILITY_DATE",{enumerable:true,get:function(){return Cxt.DEFAULT_COMPATIBILITY_DATE}});Object.defineProperty(mt,"VALID_COMPATIBILITY_DATES",{enumerable:true,get:function(){return Cxt.VALID_COMPATIBILITY_DATES}});var Dxn=Gce();Object.defineProperty(mt,"FeatureFlags",{enumerable:true,get:function(){return Dxn.FeatureFlags}});var Lxn=WGe();Object.defineProperty(mt,"signString",{enumerable:true,get:function(){return Lxn.signString}});KE(YGe(),mt);var Fxn=zce();Object.defineProperty(mt,"DeploymentLogState",{enumerable:true,get:function(){return Fxn.DeploymentLogState}});KE(nHe(),mt);KE(Kce(),mt);var Bxn=Wce();Object.defineProperty(mt,"errorHandler",{enumerable:true,get:function(){return Bxn.errorHandler}});var zF=Zce();Object.defineProperty(mt,"apiKeyAuthPlugin",{enumerable:true,get:function(){return zF.apiKeyAuthPlugin}});Object.defineProperty(mt,"ensureServiceAccountPlugin",{enumerable:true,get:function(){return zF.ensureServiceAccountPlugin}});Object.defineProperty(mt,"ensureZuploAdminPlugin",{enumerable:true,get:function(){return zF.ensureZuploAdminPlugin}});Object.defineProperty(mt,"ensureZuploUserPlugin",{enumerable:true,get:function(){return zF.ensureZuploUserPlugin}});Object.defineProperty(mt,"featureFlagsPlugin",{enumerable:true,get:function(){return zF.featureFlagsPlugin}});var Mxn=gft();Object.defineProperty(mt,"ApiServer",{enumerable:true,get:function(){return Mxn.ApiServer}});mt.fly=ZJ(vft());mt.CloudStorage=ZJ(ivt());var qxn=svt();Object.defineProperty(mt,"graphQL",{enumerable:true,get:function(){return qxn.graphQL}});KE(x2t(),mt);var wxt=oEe();Object.defineProperty(mt,"createNewLogger",{enumerable:true,get:function(){return wxt.createNewLogger}});Object.defineProperty(mt,"logger",{enumerable:true,get:function(){return wxt.logger}});var Uxn=JCe();Object.defineProperty(mt,"startsWithReservedKeyword",{enumerable:true,get:function(){return Uxn.startsWithReservedKeyword}});var $xn=R2t();Object.defineProperty(mt,"RouteVersions",{enumerable:true,get:function(){return $xn.RouteVersions}});var Txt=QCt();Object.defineProperty(mt,"ApiKeyService",{enumerable:true,get:function(){return Txt.ApiKeyService}});Object.defineProperty(mt,"createApiKeyServiceClient",{enumerable:true,get:function(){return Txt.createApiKeyServiceClient}});var jxn=QO();Object.defineProperty(mt,"getServiceAccountIdToken",{enumerable:true,get:function(){return jxn.getServiceAccountIdToken}});var Gxn=ewt();Object.defineProperty(mt,"AuthApiService",{enumerable:true,get:function(){return Gxn.AuthApiService}});var QRe=iwt();Object.defineProperty(mt,"ContentApiService",{enumerable:true,get:function(){return QRe.ContentApiService}});Object.defineProperty(mt,"contentApiTarballFileName",{enumerable:true,get:function(){return QRe.contentApiTarballFileName}});Object.defineProperty(mt,"getContentApiStorageTarballPath",{enumerable:true,get:function(){return QRe.getContentApiStorageTarballPath}});var Hxn=owt();Object.defineProperty(mt,"DevApiService",{enumerable:true,get:function(){return Hxn.DevApiService}});var Vxn=uxt();Object.defineProperty(mt,"OpenFGAService",{enumerable:true,get:function(){return Vxn.OpenFGAService}});var zxn=dxt();Object.defineProperty(mt,"TenantService",{enumerable:true,get:function(){return zxn.TenantService}});var Kxn=fxt();Object.defineProperty(mt,"MeteringService",{enumerable:true,get:function(){return Kxn.MeteringService}});KE(mxt(),mt);KE(_xt(),mt);KE(Sxt(),mt);var Wxn=GY();Object.defineProperty(mt,"JsonValidator",{enumerable:true,get:function(){return Wxn.JsonValidator}});var Yxn=iwe();Object.defineProperty(mt,"RouteValidator",{enumerable:true,get:function(){return Yxn.RouteValidator}});mt.xfs=ZJ(tAe())});var Fn=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:true});Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.NODE_BUILD_OUTPUT_FILE=Vt.NODE_ENTRY_NAME=Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE=Vt.WORKER_BUILD_OUTPUT_FILE=Vt.WORKER_ENTRY_NAME=Vt.ENV_MODULE_FILE=Vt.ZUPLO_SYSTEM_ENV_FILE=Vt.ENV_FILE=Vt.CACHE_DIRECTORY=Vt.BUILD_CACHE_FILE=Vt.ZUPLO_FILE_SCHEMA=Vt.NON_STANDARD_NODE_ENV=Vt.GENERATED_TYPES_DIR_NAME=Vt.GENERATED_BUILD_JSON_FILE=Vt.GENERATED_SOURCE_DIR_NAME=Vt.BUILD_OUTPUT_DIR=Vt.DEFAULT_TEST_FILE=Vt.DEFAULT_DOCS_MARKDOWN_FILE=Vt.DOCS_THEME_FILE=Vt.DOCS_SIDEBAR_FILE=Vt.ZUPLO_FALLBACK_JSON_FILE=Vt.ZUPLO_PREFERRED_JSON_FILE=Vt.DEFAULT_MODULE_FILE=Vt.OPEN_API_FILE_SUFFIX=Vt.OPEN_API_CONFIG_FILE=Vt.OPEN_API_UNVERSIONED_DIR_NAME=Vt.DEV_PORTAL_OUTPUT_DIR_NAME=Vt.DEV_PORTAL_CONFIG_FILE=Vt.POLICIES_CONFIG_FILE=Vt.ROUTES_OAS_CONFIG_FILE=Vt.LOCAL_API_KEYS_CONFIG_FILE=Vt.DEV_PORTAL_V4_PATH=Vt.USER_DOCS_DIR_NAME=Vt.USER_SCHEMAS_DIR_NAME=Vt.USER_CONFIG_DIR_NAME=Vt.USER_TEST_DIR_NAME=Vt.USER_MODULES_DIR_NAME=void 0;Vt.USER_MODULES_DIR_NAME="modules";Vt.USER_TEST_DIR_NAME="tests";Vt.USER_CONFIG_DIR_NAME="config";Vt.USER_SCHEMAS_DIR_NAME="schemas";Vt.USER_DOCS_DIR_NAME="docs";Vt.DEV_PORTAL_V4_PATH="v4";Vt.LOCAL_API_KEYS_CONFIG_FILE="api-keys.json";Vt.ROUTES_OAS_CONFIG_FILE="routes.oas.json";Vt.POLICIES_CONFIG_FILE="policies.json";Vt.DEV_PORTAL_CONFIG_FILE="dev-portal.json";Vt.DEV_PORTAL_OUTPUT_DIR_NAME="dev-portal";Vt.OPEN_API_UNVERSIONED_DIR_NAME="unversioned";Vt.OPEN_API_CONFIG_FILE="open-api.json";Vt.OPEN_API_FILE_SUFFIX=".oas.json";Vt.DEFAULT_MODULE_FILE="hello-world.ts";Vt.ZUPLO_PREFERRED_JSON_FILE="zuplo.jsonc";Vt.ZUPLO_FALLBACK_JSON_FILE="zuplo.json";Vt.DOCS_SIDEBAR_FILE="sidebar.json";Vt.DOCS_THEME_FILE="theme.css";Vt.DEFAULT_DOCS_MARKDOWN_FILE="index.md";Vt.DEFAULT_TEST_FILE="hello-world.json";Vt.BUILD_OUTPUT_DIR="dist";Vt.GENERATED_SOURCE_DIR_NAME=".zuplo";Vt.GENERATED_BUILD_JSON_FILE="build.json";Vt.GENERATED_TYPES_DIR_NAME="types";Vt.NON_STANDARD_NODE_ENV=`You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against.`;Vt.ZUPLO_FILE_SCHEMA="zuplo";Vt.BUILD_CACHE_FILE="buildstate.json";Vt.CACHE_DIRECTORY=".cache";Vt.ENV_FILE=".env";Vt.ZUPLO_SYSTEM_ENV_FILE=".env.zuplo";Vt.ENV_MODULE_FILE="environment.ts";Vt.WORKER_ENTRY_NAME="worker.ts";Vt.WORKER_BUILD_OUTPUT_FILE="worker.js";Vt.WORKER_BUILD_OUTPUT_SOURCEMAP_FILE="worker.js.map";Vt.NODE_ENTRY_NAME="server.ts";Vt.NODE_BUILD_OUTPUT_FILE="main.js";Vt.NODE_BUILD_OPEN_API_OUTPUT_FILE=Vt.OPEN_API_CONFIG_FILE});var tu=y(wP=>{"use strict";Object.defineProperty(wP,"__esModule",{value:true});wP.runPlugins=wP.PluginResult=void 0;var ZRe=class{static{a(this,"PluginResult")}errors=[];warnings=[];constructor(t){if(t){this.errors.push(t)}}};wP.PluginResult=ZRe;async function Xxn(e,t){const r=[];const n=[];const i=new Map;for await(const s of e){try{const o=await s(t,i);n.push(...o.errors.map(u=>{if(u.pluginName===""){u.pluginName=s.name}return u}));r.push(...o.warnings);if(o.errors.length>0){break}}catch(o){n.push(o);break}}return{errors:n,warnings:r}}a(Xxn,"runPlugins");wP.runPlugins=Xxn});var xs=y(tOe=>{"use strict";Object.defineProperty(tOe,"__esModule",{value:true});var eQ=require("perf_hooks");var eOe=[];async function Jxn(e,t){const r=eQ.performance.timerify(t);const n=new eQ.PerformanceObserver(i=>{const s=i.getEntries()[0];eOe.push({name:e,duration:s.duration});n.disconnect()});n.observe({entryTypes:["function"]});return r()}a(Jxn,"timeFn");var Qxn={mark:e=>{eQ.performance.mark(e)},measure:(e,t,r)=>{eQ.performance.measure(e,t,r)},timeFn:Jxn,report:()=>{if(eOe.length>0){console.table(eOe)}}};tOe.default=Qxn});var rOe=y(TP=>{"use strict";var Zxn=TP&&TP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(TP,"__esModule",{value:true});TP.getZuploConfig=void 0;var KF=hn();var eRn=require("jsonc-parser");var tRn=require("fs/promises");var xxt=Zxn(require("path"));var Rxt=Fn();async function rRn(e){const t=xxt.default.join(e,Rxt.ZUPLO_PREFERRED_JSON_FILE);const r=xxt.default.join(e,Rxt.ZUPLO_FALLBACK_JSON_FILE);let n=false;let i=t;if(await KF.xfs.fileExists(t)){n=true;i=t}else if(await KF.xfs.fileExists(r)){n=true;i=r}const s={};if(n){const o=await(0,tRn.readFile)(i,"utf-8");const u=[];const l=(0,eRn.parse)(o,u);if(typeof l!=="object"){const c={message:`Invalid zuplo.json file`,detail:`The zuplo.json file is not a valid JSON object`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("version"in l&&l.version!==1){const c={message:`Invalid version set in zuplo.config`,detail:`version in zuplo.json must be set to 1`,pluginName:"buildData",severity:"error"};return{errors:[c]}}if("compatibilityDate"in l&&KF.VALID_COMPATIBILITY_DATES&&typeof l.compatibilityDate==="string"){if(!KF.VALID_COMPATIBILITY_DATES.includes(l.compatibilityDate)){const c={message:`Invalid compatibilityDate set in zuplo.config`,detail:`compatibilityDate was set to ${l.compatibilityDate}. Valid compatibility dates are ${KF.VALID_COMPATIBILITY_DATES.join(", ")}`,pluginName:"buildData",severity:"error"};return{errors:[c]}}s.compatibilityDate=l.compatibilityDate}}return{config:s,errors:[]}}a(rRn,"getZuploConfig");TP.getZuploConfig=rRn});var WF=y(tQ=>{"use strict";Object.defineProperty(tQ,"__esModule",{value:true});tQ.TargetPlatform=void 0;var Oxt;(function(e){e["Worker"]="worker"})(Oxt||(tQ.TargetPlatform=Oxt={}))});var Nxt=y(xP=>{"use strict";var Pxt=xP&&xP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(xP,"__esModule",{value:true});xP.cleanOutput=void 0;var nRn=Pxt(require("fs/promises"));var iRn=Pxt(xs());var sRn=a(async function({outputDirectory:e,systemDirectory:t,logger:r}){return iRn.default.timeFn("Cleaning output",async()=>{r.debug("Cleaning output");const n=[e,t];for await(const i of n){try{await nRn.default.rm(i,{recursive:true,force:true})}catch(s){r.error(s)}}return{warnings:[],errors:[]}})},"cleanOutput");xP.cleanOutput=sRn});var kxt=y(RP=>{"use strict";var Ixt=RP&&RP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(RP,"__esModule",{value:true});RP.createSystemDir=void 0;var aRn=hn();var oRn=Ixt(require("fs/promises"));var uRn=Ixt(xs());var lRn=a(async function({systemDirectory:e,logger:t}){return uRn.default.timeFn("Creating system directory",async()=>{t.debug("Creating system directory");try{if(await aRn.xfs.dirExists(e)){t.debug("System directory already exists, skipping");return{warnings:[],errors:[]}}await oRn.default.mkdir(e)}catch(r){t.error(r);return{warnings:[],errors:[]}}return{warnings:[],errors:[]}})},"createSystemDir");RP.createSystemDir=lRn});var Dxt=y(OP=>{"use strict";var cRn=OP&&OP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(OP,"__esModule",{value:true});OP.checkForDeprecations=void 0;var dRn=cRn(xs());var pRn=a(async function({logger:e}){return dRn.default.timeFn("Checking for breaking changes",async()=>{e.debug("Checking for breaking changes");return{warnings:[],errors:[]}})},"checkForDeprecations");OP.checkForDeprecations=pRn});var Lxt=y(nOe=>{var aC=require("path");var YE=process.platform==="win32";var WE=require("fs");var fRn=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function mRn(){var e;if(fRn){var t=new Error;e=r}else e=n;return e;function r(i){if(i){t.message=i.message;i=t;n(i)}}a(r,"debugCallback");function n(i){if(i){if(process.throwDeprecation)throw i;else if(!process.noDeprecation){var s="fs: missing callback "+(i.stack||i.message);if(process.traceDeprecation)console.trace(s);else console.error(s)}}}a(n,"missingCallback")}a(mRn,"rethrow");function hRn(e){return typeof e==="function"?e:mRn()}a(hRn,"maybeCallback");var o5s=aC.normalize;if(YE){Ry=/(.*?)(?:[\/\\]+|$)/g}else{Ry=/(.*?)(?:[\/]+|$)/g}var Ry;if(YE){YF=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{YF=/^[\/]*/}var YF;nOe.realpathSync=a(function e(t,r){t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return r[t]}var n=t,i={},s={};var o;var u;var l;var c;d();function d(){var _=YF.exec(t);o=_[0].length;u=_[0];l=_[0];c="";if(YE&&!s[l]){WE.lstatSync(l);s[l]=true}}a(d,"start");while(o<t.length){Ry.lastIndex=o;var p=Ry.exec(t);c=u;u+=p[0];l=c+p[1];o=Ry.lastIndex;if(s[l]||r&&r[l]===l){continue}var f;if(r&&Object.prototype.hasOwnProperty.call(r,l)){f=r[l]}else{var m=WE.lstatSync(l);if(!m.isSymbolicLink()){s[l]=true;if(r)r[l]=l;continue}var h=null;if(!YE){var g=m.dev.toString(32)+":"+m.ino.toString(32);if(i.hasOwnProperty(g)){h=i[g]}}if(h===null){WE.statSync(l);h=WE.readlinkSync(l)}f=aC.resolve(c,h);if(r)r[l]=f;if(!YE)i[g]=h}t=aC.resolve(f,t.slice(o));d()}if(r)r[n]=t;return t},"realpathSync");nOe.realpath=a(function e(t,r,n){if(typeof n!=="function"){n=hRn(r);r=null}t=aC.resolve(t);if(r&&Object.prototype.hasOwnProperty.call(r,t)){return process.nextTick(n.bind(null,null,r[t]))}var i=t,s={},o={};var u;var l;var c;var d;p();function p(){var _=YF.exec(t);u=_[0].length;l=_[0];c=_[0];d="";if(YE&&!o[c]){WE.lstat(c,function(v){if(v)return n(v);o[c]=true;f()})}else{process.nextTick(f)}}a(p,"start");function f(){if(u>=t.length){if(r)r[i]=t;return n(null,t)}Ry.lastIndex=u;var _=Ry.exec(t);d=l;l+=_[0];c=d+_[1];u=Ry.lastIndex;if(o[c]||r&&r[c]===c){return process.nextTick(f)}if(r&&Object.prototype.hasOwnProperty.call(r,c)){return g(r[c])}return WE.lstat(c,m)}a(f,"LOOP");function m(_,v){if(_)return n(_);if(!v.isSymbolicLink()){o[c]=true;if(r)r[c]=c;return process.nextTick(f)}if(!YE){var S=v.dev.toString(32)+":"+v.ino.toString(32);if(s.hasOwnProperty(S)){return h(null,s[S],c)}}WE.stat(c,function(E){if(E)return n(E);WE.readlink(c,function(b,A){if(!YE)s[S]=A;h(b,A)})})}a(m,"gotStat");function h(_,v,S){if(_)return n(_);var E=aC.resolve(d,v);if(r)r[S]=E;g(E)}a(h,"gotTarget");function g(_){t=aC.resolve(_,t.slice(u));p()}a(g,"gotResolvedLink")},"realpath")});var oOe=y((c5s,qxt)=>{qxt.exports=XE;XE.realpath=XE;XE.sync=aOe;XE.realpathSync=aOe;XE.monkeypatch=yRn;XE.unmonkeypatch=_Rn;var PP=require("fs");var iOe=PP.realpath;var sOe=PP.realpathSync;var gRn=process.version;var Fxt=/^v[0-5]\./.test(gRn);var Bxt=Lxt();function Mxt(e){return e&&e.syscall==="realpath"&&(e.code==="ELOOP"||e.code==="ENOMEM"||e.code==="ENAMETOOLONG")}a(Mxt,"newError");function XE(e,t,r){if(Fxt){return iOe(e,t,r)}if(typeof t==="function"){r=t;t=null}iOe(e,t,function(n,i){if(Mxt(n)){Bxt.realpath(e,t,r)}else{r(n,i)}})}a(XE,"realpath");function aOe(e,t){if(Fxt){return sOe(e,t)}try{return sOe(e,t)}catch(r){if(Mxt(r)){return Bxt.realpathSync(e,t)}else{throw r}}}a(aOe,"realpathSync");function yRn(){PP.realpath=XE;PP.realpathSync=aOe}a(yRn,"monkeypatch");function _Rn(){PP.realpath=iOe;PP.realpathSync=sOe}a(_Rn,"unmonkeypatch")});var $xt=y((p5s,Uxt)=>{Uxt.exports=function(e,t){var r=[];for(var n=0;n<e.length;n++){var i=t(e[n],n);if(vRn(i))r.push.apply(r,i);else r.push(i)}return r};var vRn=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}});var uOe=y((f5s,Vxt)=>{"use strict";Vxt.exports=Gxt;function Gxt(e,t,r){if(e instanceof RegExp)e=jxt(e,r);if(t instanceof RegExp)t=jxt(t,r);var n=Hxt(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}a(Gxt,"balanced");function jxt(e,t){var r=t.match(e);return r?r[0]:null}a(jxt,"maybeMatch");Gxt.range=Hxt;function Hxt(e,t,r){var n,i,s,o,u;var l=r.indexOf(e);var c=r.indexOf(t,l+1);var d=l;if(l>=0&&c>0){if(e===t){return[l,c]}n=[];s=r.length;while(d>=0&&!u){if(d==l){n.push(d);l=r.indexOf(e,d+1)}else if(n.length==1){u=[n.pop(),c]}else{i=n.pop();if(i<s){s=i;o=c}c=r.indexOf(t,d+1)}d=l<c&&l>=0?l:c}if(n.length){u=[s,o]}}return u}a(Hxt,"range")});var Zxt=y((h5s,Qxt)=>{var ERn=$xt();var zxt=uOe();Qxt.exports=ARn;var Kxt="\0SLASH"+Math.random()+"\0";var Wxt="\0OPEN"+Math.random()+"\0";var cOe="\0CLOSE"+Math.random()+"\0";var Yxt="\0COMMA"+Math.random()+"\0";var Xxt="\0PERIOD"+Math.random()+"\0";function lOe(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}a(lOe,"numeric");function bRn(e){return e.split("\\\\").join(Kxt).split("\\{").join(Wxt).split("\\}").join(cOe).split("\\,").join(Yxt).split("\\.").join(Xxt)}a(bRn,"escapeBraces");function SRn(e){return e.split(Kxt).join("\\").split(Wxt).join("{").split(cOe).join("}").split(Yxt).join(",").split(Xxt).join(".")}a(SRn,"unescapeBraces");function Jxt(e){if(!e)return[""];var t=[];var r=zxt("{","}",e);if(!r)return e.split(",");var n=r.pre;var i=r.body;var s=r.post;var o=n.split(",");o[o.length-1]+="{"+i+"}";var u=Jxt(s);if(s.length){o[o.length-1]+=u.shift();o.push.apply(o,u)}t.push.apply(t,o);return t}a(Jxt,"parseCommaParts");function ARn(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return NP(bRn(e),true).map(SRn)}a(ARn,"expandTop");function CRn(e){return"{"+e+"}"}a(CRn,"embrace");function wRn(e){return/^-?0\d/.test(e)}a(wRn,"isPadded");function TRn(e,t){return e<=t}a(TRn,"lte");function xRn(e,t){return e>=t}a(xRn,"gte");function NP(e,t){var r=[];var n=zxt("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var o=i||s;var u=n.body.indexOf(",")>=0;if(!o&&!u){if(n.post.match(/,.*\}/)){e=n.pre+"{"+n.body+cOe+n.post;return NP(e)}return[e]}var l;if(o){l=n.body.split(/\.\./)}else{l=Jxt(n.body);if(l.length===1){l=NP(l[0],false).map(CRn);if(l.length===1){var d=n.post.length?NP(n.post,false):[""];return d.map(function(I){return n.pre+l[0]+I})}}}var c=n.pre;var d=n.post.length?NP(n.post,false):[""];var p;if(o){var f=lOe(l[0]);var m=lOe(l[1]);var h=Math.max(l[0].length,l[1].length);var g=l.length==3?Math.abs(lOe(l[2])):1;var _=TRn;var v=m<f;if(v){g*=-1;_=xRn}var S=l.some(wRn);p=[];for(var E=f;_(E,m);E+=g){var b;if(s){b=String.fromCharCode(E);if(b==="\\")b=""}else{b=String(E);if(S){var A=h-b.length;if(A>0){var C=new Array(A+1).join("0");if(E<0)b="-"+C+b.slice(1);else b=C+b}}}p.push(b)}}else{p=ERn(l,function(R){return NP(R,false)})}for(var T=0;T<p.length;T++){for(var O=0;O<d.length;O++){var P=c+p[T]+d[O];if(!t||o||P)r.push(P)}}return r}a(NP,"expand")});var iQ=y((y5s,iRt)=>{iRt.exports=mp;mp.Minimatch=ol;var XF=function(){try{return require("path")}catch(e){}}()||{sep:"/"};mp.sep=XF.sep;var fOe=mp.GLOBSTAR=ol.GLOBSTAR={};var RRn=Zxt();var eRt={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var dOe="[^/]";var pOe=dOe+"*?";var ORn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var PRn="(?:(?!(?:\\/|^)\\.).)*?";var tRt=NRn("().*{}+?[]^$\\!");function NRn(e){return e.split("").reduce(function(t,r){t[r]=true;return t},{})}a(NRn,"charSet");var rRt=/\/+/;mp.filter=IRn;function IRn(e,t){t=t||{};return function(r,n,i){return mp(r,e,t)}}a(IRn,"filter");function JE(e,t){t=t||{};var r={};Object.keys(e).forEach(function(n){r[n]=e[n]});Object.keys(t).forEach(function(n){r[n]=t[n]});return r}a(JE,"ext");mp.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return mp}var t=mp;var r=a(function n(i,s,o){return t(i,s,JE(e,o))},"minimatch");r.Minimatch=a(function n(i,s){return new t.Minimatch(i,JE(e,s))},"Minimatch");r.Minimatch.defaults=a(function n(i){return t.defaults(JE(e,i)).Minimatch},"defaults");r.filter=a(function n(i,s){return t.filter(i,JE(e,s))},"filter");r.defaults=a(function n(i){return t.defaults(JE(e,i))},"defaults");r.makeRe=a(function n(i,s){return t.makeRe(i,JE(e,s))},"makeRe");r.braceExpand=a(function n(i,s){return t.braceExpand(i,JE(e,s))},"braceExpand");r.match=function(n,i,s){return t.match(n,i,JE(e,s))};return r};ol.defaults=function(e){return mp.defaults(e).Minimatch};function mp(e,t,r){nQ(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new ol(t,r).match(e)}a(mp,"minimatch");function ol(e,t){if(!(this instanceof ol)){return new ol(e,t)}nQ(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&XF.sep!=="/"){e=e.split(XF.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}a(ol,"Minimatch");ol.prototype.debug=function(){};ol.prototype.make=kRn;function kRn(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=a(function n(){console.error.apply(console,arguments)},"debug");this.debug(this.pattern,r);r=this.globParts=r.map(function(n){return n.split(rRt)});this.debug(this.pattern,r);r=r.map(function(n,i,s){return n.map(this.parse,this)},this);this.debug(this.pattern,r);r=r.filter(function(n){return n.indexOf(false)===-1});this.debug(this.pattern,r);this.set=r}a(kRn,"make");ol.prototype.parseNegate=DRn;function DRn(){var e=this.pattern;var t=false;var r=this.options;var n=0;if(r.nonegate)return;for(var i=0,s=e.length;i<s&&e.charAt(i)==="!";i++){t=!t;n++}if(n)this.pattern=e.substr(n);this.negate=t}a(DRn,"parseNegate");mp.braceExpand=function(e,t){return nRt(e,t)};ol.prototype.braceExpand=nRt;function nRt(e,t){if(!t){if(this instanceof ol){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;nQ(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return RRn(e)}a(nRt,"braceExpand");var LRn=1024*64;var nQ=a(function(e){if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>LRn){throw new TypeError("pattern is too long")}},"assertValidPattern");ol.prototype.parse=FRn;var rQ={};function FRn(e,t){nQ(e);var r=this.options;if(e==="**"){if(!r.noglobstar)return fOe;else e="*"}if(e==="")return"";var n="";var i=!!r.nocase;var s=false;var o=[];var u=[];var l;var c=false;var d=-1;var p=-1;var f=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var m=this;function h(){if(l){switch(l){case"*":n+=pOe;i=true;break;case"?":n+=dOe;i=true;break;default:n+="\\"+l;break}m.debug("clearStateChar %j %j",l,n);l=false}}a(h,"clearStateChar");for(var g=0,_=e.length,v;g<_&&(v=e.charAt(g));g++){this.debug("%s %s %s %j",e,g,n,v);if(s&&tRt[v]){n+="\\"+v;s=false;continue}switch(v){case"/":{return false}case"\\":h();s=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s %s %s %j <-- stateChar",e,g,n,v);if(c){this.debug(" in class");if(v==="!"&&g===p+1)v="^";n+=v;continue}m.debug("call clearStateChar %j",l);h();l=v;if(r.noext)h();continue;case"(":if(c){n+="(";continue}if(!l){n+="\\(";continue}o.push({type:l,start:g-1,reStart:n.length,open:eRt[l].open,close:eRt[l].close});n+=l==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",l,n);l=false;continue;case")":if(c||!o.length){n+="\\)";continue}h();i=true;var S=o.pop();n+=S.close;if(S.type==="!"){u.push(S)}S.reEnd=n.length;continue;case"|":if(c||!o.length||s){n+="\\|";s=false;continue}h();n+="|";continue;case"[":h();if(c){n+="\\"+v;continue}c=true;p=g;d=n.length;n+=v;continue;case"]":if(g===p+1||!c){n+="\\"+v;s=false;continue}var E=e.substring(p+1,g);try{RegExp("["+E+"]")}catch(M){var b=this.parse(E,rQ);n=n.substr(0,d)+"\\["+b[0]+"\\]";i=i||b[1];c=false;continue}i=true;c=false;n+=v;continue;default:h();if(s){s=false}else if(tRt[v]&&!(v==="^"&&c)){n+="\\"}n+=v}}if(c){E=e.substr(p+1);b=this.parse(E,rQ);n=n.substr(0,d)+"\\["+b[0];i=i||b[1]}for(S=o.pop();S;S=o.pop()){var A=n.slice(S.reStart+S.open.length);this.debug("setting tail",n,S);A=A.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(M,Q,fe){if(!fe){fe="\\"}return Q+Q+fe+"|"});this.debug("tail=%j\n %s",A,A,S,n);var C=S.type==="*"?pOe:S.type==="?"?dOe:"\\"+S.type;i=true;n=n.slice(0,S.reStart)+C+"\\("+A}h();if(s){n+="\\\\"}var T=false;switch(n.charAt(0)){case"[":case".":case"(":T=true}for(var O=u.length-1;O>-1;O--){var P=u[O];var R=n.slice(0,P.reStart);var I=n.slice(P.reStart,P.reEnd-8);var D=n.slice(P.reEnd-8,P.reEnd);var U=n.slice(P.reEnd);D+=U;var te=R.split("(").length-1;var ve=U;for(g=0;g<te;g++){ve=ve.replace(/\)[+*?]?/,"")}U=ve;var me="";if(U===""&&t!==rQ){me="$"}var he=R+I+U+me+D;n=he}if(n!==""&&i){n="(?=.)"+n}if(T){n=f+n}if(t===rQ){return[n,i]}if(!i){return MRn(e)}var Fe=r.nocase?"i":"";try{var Oe=new RegExp("^"+n+"$",Fe)}catch(M){return new RegExp("$.")}Oe._glob=e;Oe._src=n;return Oe}a(FRn,"parse");mp.makeRe=function(e,t){return new ol(e,t||{}).makeRe()};ol.prototype.makeRe=BRn;function BRn(){if(this.regexp||this.regexp===false)return this.regexp;var e=this.set;if(!e.length){this.regexp=false;return this.regexp}var t=this.options;var r=t.noglobstar?pOe:t.dot?ORn:PRn;var n=t.nocase?"i":"";var i=e.map(function(s){return s.map(function(o){return o===fOe?r:typeof o==="string"?qRn(o):o._src}).join("\\/")}).join("|");i="^(?:"+i+")$";if(this.negate)i="^(?!"+i+").*$";try{this.regexp=new RegExp(i,n)}catch(s){this.regexp=false}return this.regexp}a(BRn,"makeRe");mp.match=function(e,t,r){r=r||{};var n=new ol(t,r);e=e.filter(function(i){return n.match(i)});if(n.options.nonull&&!e.length){e.push(t)}return e};ol.prototype.match=a(function e(t,r){if(typeof r==="undefined")r=this.partial;this.debug("match",t,this.pattern);if(this.comment)return false;if(this.empty)return t==="";if(t==="/"&&r)return true;var n=this.options;if(XF.sep!=="/"){t=t.split(XF.sep).join("/")}t=t.split(rRt);this.debug(this.pattern,"split",t);var i=this.set;this.debug(this.pattern,"set",i);var s;var o;for(o=t.length-1;o>=0;o--){s=t[o];if(s)break}for(o=0;o<i.length;o++){var u=i[o];var l=t;if(n.matchBase&&u.length===1){l=[s]}var c=this.matchOne(l,u,r);if(c){if(n.flipNegate)return true;return!this.negate}}if(n.flipNegate)return false;return this.negate},"match");ol.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{"this":this,file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var i=0,s=0,o=e.length,u=t.length;i<o&&s<u;i++,s++){this.debug("matchOne loop");var l=t[s];var c=e[i];this.debug(t,l,c);if(l===false)return false;if(l===fOe){this.debug("GLOBSTAR",[t,l,c]);var d=i;var p=s+1;if(p===u){this.debug("** at the end");for(;i<o;i++){if(e[i]==="."||e[i]===".."||!n.dot&&e[i].charAt(0)===".")return false}return true}while(d<o){var f=e[d];this.debug("\nglobstar while",e,d,t,p,f);if(this.matchOne(e.slice(d),t.slice(p),r)){this.debug("globstar found match!",d,o,f);return true}else{if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",e,d,t,p);break}this.debug("globstar swallow a segment, and continue");d++}}if(r){this.debug("\n>>> no match, partial?",e,d,t,p);if(d===o)return true}return false}var m;if(typeof l==="string"){m=c===l;this.debug("string match",l,c,m)}else{m=c.match(l);this.debug("pattern match",l,c,m)}if(!m)return false}if(i===o&&s===u){return true}else if(i===o){return r}else if(s===u){return i===o-1&&e[i]===""}throw new Error("wtf?")};function MRn(e){return e.replace(/\\(.)/g,"$1")}a(MRn,"globUnescape");function qRn(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}a(qRn,"regExpEscape")});var aQ=y((v5s,sQ)=>{"use strict";function sRt(e){return e.charAt(0)==="/"}a(sRt,"posix");function aRt(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var r=t.exec(e);var n=r[1]||"";var i=Boolean(n&&n.charAt(1)!==":");return Boolean(r[2]||i)}a(aRt,"win32");sQ.exports=process.platform==="win32"?aRt:sRt;sQ.exports.posix=sRt;sQ.exports.win32=aRt});var hOe=y(QE=>{QE.setopts=VRn;QE.ownProp=oRt;QE.makeAbs=JF;QE.finish=zRn;QE.mark=KRn;QE.isIgnored=lRt;QE.childrenIgnored=WRn;function oRt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}a(oRt,"ownProp");var URn=require("fs");var IP=require("path");var $Rn=iQ();var uRt=aQ();var mOe=$Rn.Minimatch;function jRn(e,t){return e.localeCompare(t,"en")}a(jRn,"alphasort");function GRn(e,t){e.ignore=t.ignore||[];if(!Array.isArray(e.ignore))e.ignore=[e.ignore];if(e.ignore.length){e.ignore=e.ignore.map(HRn)}}a(GRn,"setupIgnores");function HRn(e){var t=null;if(e.slice(-3)==="/**"){var r=e.replace(/(\/\*\*)+$/,"");t=new mOe(r,{dot:true})}return{matcher:new mOe(e,{dot:true}),gmatcher:t}}a(HRn,"ignoreMap");function VRn(e,t,r){if(!r)r={};if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar){throw new Error("base matching requires globstar")}t="**/"+t}e.silent=!!r.silent;e.pattern=t;e.strict=r.strict!==false;e.realpath=!!r.realpath;e.realpathCache=r.realpathCache||Object.create(null);e.follow=!!r.follow;e.dot=!!r.dot;e.mark=!!r.mark;e.nodir=!!r.nodir;if(e.nodir)e.mark=true;e.sync=!!r.sync;e.nounique=!!r.nounique;e.nonull=!!r.nonull;e.nosort=!!r.nosort;e.nocase=!!r.nocase;e.stat=!!r.stat;e.noprocess=!!r.noprocess;e.absolute=!!r.absolute;e.fs=r.fs||URn;e.maxLength=r.maxLength||Infinity;e.cache=r.cache||Object.create(null);e.statCache=r.statCache||Object.create(null);e.symlinks=r.symlinks||Object.create(null);GRn(e,r);e.changedCwd=false;var n=process.cwd();if(!oRt(r,"cwd"))e.cwd=n;else{e.cwd=IP.resolve(r.cwd);e.changedCwd=e.cwd!==n}e.root=r.root||IP.resolve(e.cwd,"/");e.root=IP.resolve(e.root);if(process.platform==="win32")e.root=e.root.replace(/\\/g,"/");e.cwdAbs=uRt(e.cwd)?e.cwd:JF(e,e.cwd);if(process.platform==="win32")e.cwdAbs=e.cwdAbs.replace(/\\/g,"/");e.nomount=!!r.nomount;r.nonegate=true;r.nocomment=true;r.allowWindowsEscape=false;e.minimatch=new mOe(t,r);e.options=e.minimatch.options}a(VRn,"setopts");function zRn(e){var t=e.nounique;var r=t?[]:Object.create(null);for(var n=0,i=e.matches.length;n<i;n++){var s=e.matches[n];if(!s||Object.keys(s).length===0){if(e.nonull){var o=e.minimatch.globSet[n];if(t)r.push(o);else r[o]=true}}else{var u=Object.keys(s);if(t)r.push.apply(r,u);else u.forEach(function(l){r[l]=true})}}if(!t)r=Object.keys(r);if(!e.nosort)r=r.sort(jRn);if(e.mark){for(var n=0;n<r.length;n++){r[n]=e._mark(r[n])}if(e.nodir){r=r.filter(function(l){var c=!/\/$/.test(l);var d=e.cache[l]||e.cache[JF(e,l)];if(c&&d)c=d!=="DIR"&&!Array.isArray(d);return c})}}if(e.ignore.length)r=r.filter(function(l){return!lRt(e,l)});e.found=r}a(zRn,"finish");function KRn(e,t){var r=JF(e,t);var n=e.cache[r];var i=t;if(n){var s=n==="DIR"||Array.isArray(n);var o=t.slice(-1)==="/";if(s&&!o)i+="/";else if(!s&&o)i=i.slice(0,-1);if(i!==t){var u=JF(e,i);e.statCache[u]=e.statCache[r];e.cache[u]=e.cache[r]}}return i}a(KRn,"mark");function JF(e,t){var r=t;if(t.charAt(0)==="/"){r=IP.join(e.root,t)}else if(uRt(t)||t===""){r=t}else if(e.changedCwd){r=IP.resolve(e.cwd,t)}else{r=IP.resolve(t)}if(process.platform==="win32")r=r.replace(/\\/g,"/");return r}a(JF,"makeAbs");function lRt(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return r.matcher.match(t)||!!(r.gmatcher&&r.gmatcher.match(t))})}a(lRt,"isIgnored");function WRn(e,t){if(!e.ignore.length)return false;return e.ignore.some(function(r){return!!(r.gmatcher&&r.gmatcher.match(t))})}a(WRn,"childrenIgnored")});var mRt=y((T5s,fRt)=>{fRt.exports=pRt;pRt.GlobSync=ru;var YRn=oOe();var cRt=iQ();var A5s=cRt.Minimatch;var C5s=_Oe().Glob;var w5s=require("util");var gOe=require("path");var dRt=require("assert");var oQ=aQ();var oC=hOe();var XRn=oC.setopts;var yOe=oC.ownProp;var JRn=oC.childrenIgnored;var QRn=oC.isIgnored;function pRt(e,t){if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new ru(e,t).found}a(pRt,"globSync");function ru(e,t){if(!e)throw new Error("must provide pattern");if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof ru))return new ru(e,t);XRn(this,e,t);if(this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++){this._process(this.minimatch.set[n],n,false)}this._finish()}a(ru,"GlobSync");ru.prototype._finish=function(){dRt.ok(this instanceof ru);if(this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var i in t){try{i=e._makeAbs(i);var s=YRn.realpathSync(i,e.realpathCache);n[s]=true}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=true;else throw o}}})}oC.finish(this)};ru.prototype._process=function(e,t,r){dRt.ok(this instanceof ru);var n=0;while(typeof e[n]==="string"){n++}var i;switch(n){case e.length:this._processSimple(e.join("/"),t);return;case 0:i=null;break;default:i=e.slice(0,n).join("/");break}var s=e.slice(n);var o;if(i===null)o=".";else if(oQ(i)||oQ(e.map(function(c){return typeof c==="string"?c:"[*]"}).join("/"))){if(!i||!oQ(i))i="/"+i;o=i}else o=i;var u=this._makeAbs(o);if(JRn(this,o))return;var l=s[0]===cRt.GLOBSTAR;if(l)this._processGlobStar(i,o,u,s,t,r);else this._processReaddir(i,o,u,s,t,r)};ru.prototype._processReaddir=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n[0];var l=!!this.minimatch.negate;var c=u._glob;var d=this.dot||c.charAt(0)===".";var p=[];for(var f=0;f<o.length;f++){var m=o[f];if(m.charAt(0)!=="."||d){var h;if(l&&!e){h=!m.match(u)}else{h=m.match(u)}if(h)p.push(m)}}var g=p.length;if(g===0)return;if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var f=0;f<g;f++){var m=p[f];if(e){if(e.slice(-1)!=="/")m=e+"/"+m;else m=e+m}if(m.charAt(0)==="/"&&!this.nomount){m=gOe.join(this.root,m)}this._emitMatch(i,m)}return}n.shift();for(var f=0;f<g;f++){var m=p[f];var _;if(e)_=[e,m];else _=[m];this._process(_.concat(n),i,s)}};ru.prototype._emitMatch=function(e,t){if(QRn(this,t))return;var r=this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute){t=r}if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;if(this.stat)this._stat(t)};ru.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,false);var t;var r;var n;try{r=this.fs.lstatSync(e)}catch(s){if(s.code==="ENOENT"){return null}}var i=r&&r.isSymbolicLink();this.symlinks[e]=i;if(!i&&r&&!r.isDirectory())this.cache[e]="FILE";else t=this._readdir(e,false);return t};ru.prototype._readdir=function(e,t){var r;if(t&&!yOe(this.symlinks,e))return this._readdirInGlobStar(e);if(yOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){this._readdirError(e,i);return null}};ru.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat){for(var r=0;r<t.length;r++){var n=t[r];if(e==="/")n=e+n;else n=e+"/"+n;this.cache[n]=true}}this.cache[e]=t;return t};ru.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);this.cache[r]="FILE";if(r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);n.path=this.cwd;n.code=t.code;throw n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict)throw t;if(!this.silent)console.error("glob error",t);break}};ru.prototype._processGlobStar=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(!o)return;var u=n.slice(1);var l=e?[e]:[];var c=l.concat(u);this._process(c,i,false);var d=o.length;var p=this.symlinks[r];if(p&&s)return;for(var f=0;f<d;f++){var m=o[f];if(m.charAt(0)==="."&&!this.dot)continue;var h=l.concat(o[f],u);this._process(h,i,true);var g=l.concat(o[f],n);this._process(g,i,true)}};ru.prototype._processSimple=function(e,t){var r=this._stat(e);if(!this.matches[t])this.matches[t]=Object.create(null);if(!r)return;if(e&&oQ(e)&&!this.nomount){var n=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=gOe.join(this.root,e)}else{e=gOe.resolve(this.root,e);if(n)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e)};ru.prototype._stat=function(e){var t=this._makeAbs(e);var r=e.slice(-1)==="/";if(e.length>this.maxLength)return false;if(!this.stat&&yOe(this.cache,t)){var o=this.cache[t];if(Array.isArray(o))o="DIR";if(!r||o==="DIR")return o;if(r&&o==="FILE")return false}var n;var i=this.statCache[t];if(!i){var s;try{s=this.fs.lstatSync(t)}catch(u){if(u&&(u.code==="ENOENT"||u.code==="ENOTDIR")){this.statCache[t]=false;return false}}if(s&&s.isSymbolicLink()){try{i=this.fs.statSync(t)}catch(u){i=s}}else{i=s}}this.statCache[t]=i;var o=true;if(i)o=i.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(r&&o==="FILE")return false;return o};ru.prototype._mark=function(e){return oC.mark(this,e)};ru.prototype._makeAbs=function(e){return oC.makeAbs(this,e)}});var gRt=y((R5s,hRt)=>{var ZRn=X2e();var QF=Object.create(null);var eOn=TW();hRt.exports=ZRn(tOn);function tOn(e,t){if(QF[e]){QF[e].push(t);return null}else{QF[e]=[t];return rOn(e)}}a(tOn,"inflight");function rOn(e){return eOn(a(function t(){var r=QF[e];var n=r.length;var i=nOn(arguments);try{for(var s=0;s<n;s++){r[s].apply(null,i)}}finally{if(r.length>n){r.splice(0,n);process.nextTick(function(){t.apply(null,i)})}else{delete QF[e]}}},"RES"))}a(rOn,"makeres");function nOn(e){var t=e.length;var r=[];for(var n=0;n<t;n++)r[n]=e[n];return r}a(nOn,"slice")});var _Oe=y((I5s,_Rt)=>{_Rt.exports=uC;var iOn=oOe();var yRt=iQ();var P5s=yRt.Minimatch;var sOn=Xv();var aOn=require("events").EventEmitter;var vOe=require("path");var EOe=require("assert");var ZF=aQ();var SOe=mRt();var lC=hOe();var oOn=lC.setopts;var bOe=lC.ownProp;var AOe=gRt();var N5s=require("util");var uOn=lC.childrenIgnored;var lOn=lC.isIgnored;var cOn=TW();function uC(e,t,r){if(typeof t==="function")r=t,t={};if(!t)t={};if(t.sync){if(r)throw new TypeError("callback provided to sync glob");return SOe(e,t)}return new Cs(e,t,r)}a(uC,"glob");uC.sync=SOe;var dOn=uC.GlobSync=SOe.GlobSync;uC.glob=uC;function pOn(e,t){if(t===null||typeof t!=="object"){return e}var r=Object.keys(t);var n=r.length;while(n--){e[r[n]]=t[r[n]]}return e}a(pOn,"extend");uC.hasMagic=function(e,t){var r=pOn({},t);r.noprocess=true;var n=new Cs(e,r);var i=n.minimatch.set;if(!e)return false;if(i.length>1)return true;for(var s=0;s<i[0].length;s++){if(typeof i[0][s]!=="string")return true}return false};uC.Glob=Cs;sOn(Cs,aOn);function Cs(e,t,r){if(typeof t==="function"){r=t;t=null}if(t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new dOn(e,t)}if(!(this instanceof Cs))return new Cs(e,t,r);oOn(this,e,t);this._didRealPath=false;var n=this.minimatch.set.length;this.matches=new Array(n);if(typeof r==="function"){r=cOn(r);this.on("error",r);this.on("end",function(l){r(null,l)})}var i=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(n===0)return u();var s=true;for(var o=0;o<n;o++){this._process(this.minimatch.set[o],o,false,u)}s=false;function u(){--i._processing;if(i._processing<=0){if(s){process.nextTick(function(){i._finish()})}else{i._finish()}}}a(u,"done")}a(Cs,"Glob");Cs.prototype._finish=function(){EOe(this instanceof Cs);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();lC.finish(this);this.emit("end",this.found)};Cs.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var e=this.matches.length;if(e===0)return this._finish();var t=this;for(var r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){if(--e===0)t._finish()}a(n,"next")};Cs.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r);var i=this;var s=n.length;if(s===0)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(u,l){u=i._makeAbs(u);iOn.realpath(u,i.realpathCache,function(c,d){if(!c)o[d]=true;else if(c.syscall==="stat")o[u]=true;else i.emit("error",c);if(--s===0){i.matches[e]=o;t()}})})};Cs.prototype._mark=function(e){return lC.mark(this,e)};Cs.prototype._makeAbs=function(e){return lC.makeAbs(this,e)};Cs.prototype.abort=function(){this.aborted=true;this.emit("abort")};Cs.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Cs.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<n.length;t++){var i=n[t];this._processing--;this._process(i[0],i[1],i[2],i[3])}}}};Cs.prototype._process=function(e,t,r,n){EOe(this instanceof Cs);EOe(typeof n==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([e,t,r,n]);return}var i=0;while(typeof e[i]==="string"){i++}var s;switch(i){case e.length:this._processSimple(e.join("/"),t,n);return;case 0:s=null;break;default:s=e.slice(0,i).join("/");break}var o=e.slice(i);var u;if(s===null)u=".";else if(ZF(s)||ZF(e.map(function(d){return typeof d==="string"?d:"[*]"}).join("/"))){if(!s||!ZF(s))s="/"+s;u=s}else u=s;var l=this._makeAbs(u);if(uOn(this,u))return n();var c=o[0]===yRt.GLOBSTAR;if(c)this._processGlobStar(s,u,l,o,t,r,n);else this._processReaddir(s,u,l,o,t,r,n)};Cs.prototype._processReaddir=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){return u._processReaddir2(e,t,r,n,i,s,c,o)})};Cs.prototype._processReaddir2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n[0];var c=!!this.minimatch.negate;var d=l._glob;var p=this.dot||d.charAt(0)===".";var f=[];for(var m=0;m<o.length;m++){var h=o[m];if(h.charAt(0)!=="."||p){var g;if(c&&!e){g=!h.match(l)}else{g=h.match(l)}if(g)f.push(h)}}var _=f.length;if(_===0)return u();if(n.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var m=0;m<_;m++){var h=f[m];if(e){if(e!=="/")h=e+"/"+h;else h=e+h}if(h.charAt(0)==="/"&&!this.nomount){h=vOe.join(this.root,h)}this._emitMatch(i,h)}return u()}n.shift();for(var m=0;m<_;m++){var h=f[m];var v;if(e){if(e!=="/")h=e+"/"+h;else h=e+h}this._process([h].concat(n),i,s,u)}u()};Cs.prototype._emitMatch=function(e,t){if(this.aborted)return;if(lOn(this,t))return;if(this.paused){this._emitQueue.push([e,t]);return}var r=ZF(t)?t:this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute)t=r;if(this.matches[e][t])return;if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=true;var i=this.statCache[r];if(i)this.emit("stat",t,i);this.emit("match",t)};Cs.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,false,t);var r="lstat\0"+e;var n=this;var i=AOe(r,s);if(i)n.fs.lstat(e,i);function s(o,u){if(o&&o.code==="ENOENT")return t();var l=u&&u.isSymbolicLink();n.symlinks[e]=l;if(!l&&u&&!u.isDirectory()){n.cache[e]="FILE";t()}else n._readdir(e,false,t)}a(s,"lstatcb_")};Cs.prototype._readdir=function(e,t,r){if(this.aborted)return;r=AOe("readdir\0"+e+"\0"+t,r);if(!r)return;if(t&&!bOe(this.symlinks,e))return this._readdirInGlobStar(e,r);if(bOe(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;i.fs.readdir(e,fOn(this,e,r))};function fOn(e,t,r){return function(n,i){if(n)e._readdirError(t,n,r);else e._readdirEntries(t,i,r)}}a(fOn,"readdirCb");Cs.prototype._readdirEntries=function(e,t,r){if(this.aborted)return;if(!this.mark&&!this.stat){for(var n=0;n<t.length;n++){var i=t[n];if(e==="/")i=e+i;else i=e+"/"+i;this.cache[i]=true}}this.cache[e]=t;return r(null,t)};Cs.prototype._readdirError=function(e,t,r){if(this.aborted)return;switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);this.cache[n]="FILE";if(n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd;i.code=t.code;this.emit("error",i);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict){this.emit("error",t);this.abort()}if(!this.silent)console.error("glob error",t);break}return r()};Cs.prototype._processGlobStar=function(e,t,r,n,i,s,o){var u=this;this._readdir(r,s,function(l,c){u._processGlobStar2(e,t,r,n,i,s,c,o)})};Cs.prototype._processGlobStar2=function(e,t,r,n,i,s,o,u){if(!o)return u();var l=n.slice(1);var c=e?[e]:[];var d=c.concat(l);this._process(d,i,false,u);var p=this.symlinks[r];var f=o.length;if(p&&s)return u();for(var m=0;m<f;m++){var h=o[m];if(h.charAt(0)==="."&&!this.dot)continue;var g=c.concat(o[m],l);this._process(g,i,true,u);var _=c.concat(o[m],n);this._process(_,i,true,u)}u()};Cs.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,s){n._processSimple2(e,t,i,s,r)})};Cs.prototype._processSimple2=function(e,t,r,n,i){if(!this.matches[t])this.matches[t]=Object.create(null);if(!n)return i();if(e&&ZF(e)&&!this.nomount){var s=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=vOe.join(this.root,e)}else{e=vOe.resolve(this.root,e);if(s)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e);i()};Cs.prototype._stat=function(e,t){var r=this._makeAbs(e);var n=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&bOe(this.cache,r)){var i=this.cache[r];if(Array.isArray(i))i="DIR";if(!n||i==="DIR")return t(null,i);if(n&&i==="FILE")return t()}var s;var o=this.statCache[r];if(o!==void 0){if(o===false)return t(null,o);else{var u=o.isDirectory()?"DIR":"FILE";if(n&&u==="FILE")return t();else return t(null,u,o)}}var l=this;var c=AOe("stat\0"+r,d);if(c)l.fs.lstat(r,c);function d(p,f){if(f&&f.isSymbolicLink()){return l.fs.stat(r,function(m,h){if(m)l._stat2(e,r,null,f,t);else l._stat2(e,r,m,h,t)})}else{l._stat2(e,r,p,f,t)}}a(d,"lstatcb_")};Cs.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[t]=false;return i()}var s=e.slice(-1)==="/";this.statCache[t]=n;if(t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,false,n);var o=true;if(n)o=n.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(s&&o==="FILE")return i();return i(null,o,n)}});var xRt=y((D5s,TRt)=>{TRt.exports=TOe;TOe.sync=wRt;var ds=require("assert");var SRt=require("path");var vRt=require("fs");var cQ=_Oe();var ARt=parseInt("666",8);var mOn={nosort:true,silent:true};var COe=0;var e7=process.platform==="win32";function CRt(e){var t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach(function(r){e[r]=e[r]||vRt[r];r=r+"Sync";e[r]=e[r]||vRt[r]});e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}e.disableGlob=e.disableGlob||false;e.glob=e.glob||mOn}a(CRt,"defaults");function TOe(e,t,r){if(typeof t==="function"){r=t;t={}}ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds.equal(typeof r,"function","rimraf: callback function required");ds(t,"rimraf: invalid options argument provided");ds.equal(typeof t,"object","rimraf: options should be object");CRt(t);var n=0;var i=null;var s=0;if(t.disableGlob||!cQ.hasMagic(e))return u(null,[e]);t.lstat(e,function(l,c){if(!l)return u(null,[e]);cQ(e,t.glob,u)});function o(l){i=i||l;if(--s===0)r(i)}a(o,"next");function u(l,c){if(l)return r(l);s=c.length;if(s===0)return r();c.forEach(function(d){wOe(d,t,a(function p(f){if(f){if((f.code==="EBUSY"||f.code==="ENOTEMPTY"||f.code==="EPERM")&&n<t.maxBusyTries){n++;var m=n*100;return setTimeout(function(){wOe(d,t,p)},m)}if(f.code==="EMFILE"&&COe<t.emfileWait){return setTimeout(function(){wOe(d,t,p)},COe++)}if(f.code==="ENOENT")f=null}COe=0;o(f)},"CB"))})}a(u,"afterGlob")}a(TOe,"rimraf");function wOe(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.lstat(e,function(n,i){if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&e7)ERt(e,t,n,r);if(i&&i.isDirectory())return uQ(e,t,n,r);t.unlink(e,function(s){if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return e7?ERt(e,t,s,r):uQ(e,t,s,r);if(s.code==="EISDIR")return uQ(e,t,s,r)}return r(s)})})}a(wOe,"rimraf_");function ERt(e,t,r,n){ds(e);ds(t);ds(typeof n==="function");if(r)ds(r instanceof Error);t.chmod(e,ARt,function(i){if(i)n(i.code==="ENOENT"?null:r);else t.stat(e,function(s,o){if(s)n(s.code==="ENOENT"?null:r);else if(o.isDirectory())uQ(e,t,r,n);else t.unlink(e,n)})})}a(ERt,"fixWinEPERM");function bRt(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.chmodSync(e,ARt)}catch(i){if(i.code==="ENOENT")return;else throw r}try{var n=t.statSync(e)}catch(i){if(i.code==="ENOENT")return;else throw r}if(n.isDirectory())lQ(e,t,r);else t.unlinkSync(e)}a(bRt,"fixWinEPERMSync");function uQ(e,t,r,n){ds(e);ds(t);if(r)ds(r instanceof Error);ds(typeof n==="function");t.rmdir(e,function(i){if(i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM"))hOn(e,t,n);else if(i&&i.code==="ENOTDIR")n(r);else n(i)})}a(uQ,"rmdir");function hOn(e,t,r){ds(e);ds(t);ds(typeof r==="function");t.readdir(e,function(n,i){if(n)return r(n);var s=i.length;if(s===0)return t.rmdir(e,r);var o;i.forEach(function(u){TOe(SRt.join(e,u),t,function(l){if(o)return;if(l)return r(o=l);if(--s===0)t.rmdir(e,r)})})})}a(hOn,"rmkids");function wRt(e,t){t=t||{};CRt(t);ds(e,"rimraf: missing path");ds.equal(typeof e,"string","rimraf: path should be a string");ds(t,"rimraf: missing options");ds.equal(typeof t,"object","rimraf: options should be object");var r;if(t.disableGlob||!cQ.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(s){r=cQ.sync(e,t.glob)}}if(!r.length)return;for(var n=0;n<r.length;n++){var e=r[n];try{var i=t.lstatSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM"&&e7)bRt(e,t,o)}try{if(i&&i.isDirectory())lQ(e,t,null);else t.unlinkSync(e)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM")return e7?bRt(e,t,o):lQ(e,t,o);if(o.code!=="EISDIR")throw o;lQ(e,t,o)}}}a(wRt,"rimrafSync");function lQ(e,t,r){ds(e);ds(t);if(r)ds(r instanceof Error);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")gOn(e,t)}}a(lQ,"rmdirSync");function gOn(e,t){ds(e);ds(t);t.readdirSync(e).forEach(function(o){wRt(SRt.join(e,o),t)});var r=e7?100:1;var n=0;do{var i=true;try{var s=t.rmdirSync(e,t);i=false;return s}finally{if(++n<r&&i)continue}}while(true)}a(gOn,"rmkidsSync")});var NRt=y((F5s,PRt)=>{var t7=require("path");var RRt=require("fs");var ORt=parseInt("0777",8);PRt.exports=kP.mkdirp=kP.mkdirP=kP;function kP(e,t,r,n){if(typeof t==="function"){r=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}var i=t.mode;var s=t.fs||RRt;if(i===void 0){i=ORt}if(!n)n=null;var o=r||function(){};e=t7.resolve(e);s.mkdir(e,i,function(u){if(!u){n=n||e;return o(null,n)}switch(u.code){case"ENOENT":if(t7.dirname(e)===e)return o(u);kP(t7.dirname(e),t,function(l,c){if(l)o(l,c);else kP(e,t,o,c)});break;default:s.stat(e,function(l,c){if(l||!c.isDirectory())o(u,n);else o(null,n)});break}})}a(kP,"mkdirP");kP.sync=a(function e(t,r,n){if(!r||typeof r!=="object"){r={mode:r}}var i=r.mode;var s=r.fs||RRt;if(i===void 0){i=ORt}if(!n)n=null;t=t7.resolve(t);try{s.mkdirSync(t,i);n=n||t}catch(u){switch(u.code){case"ENOENT":n=e(t7.dirname(t),r,n);e(t,r,n);break;default:var o;try{o=s.statSync(t)}catch(l){throw u}if(!o.isDirectory())throw u;break}}return n},"sync")});var $Rt=y((yh,URt)=>{var xOe=require("fs");var kRt=require("path");var dQ=require("constants");var yOn=require("os");var ROe=xRt();var DRt=NRt();var M5s=require("os").tmpdir();var LRt=ROe.sync;var FRt=kRt.resolve(yOn.tmpdir());var OOe=dQ.O_CREAT|dQ.O_TRUNC|dQ.O_RDWR|dQ.O_EXCL;var r7=a(function(e){if(typeof e==="function"){return[void 0,e]}var t;var r=new Promise(function(n,i){t=a(function(){var s=Array.from(arguments);var o=s.shift();process.nextTick(function(){if(o){i(o)}else if(s.length===1){n(s[0])}else{n(s)}})},"promiseCallback")});return[r,t]},"promisify");var DP=a(function(e,t){var r=_On(e,t);var n=new Date;var i=[r.prefix,n.getFullYear(),n.getMonth(),n.getDate(),"-",process.pid,"-",(Math.random()*4294967296+1).toString(36),r.suffix].join("");return kRt.join(r.dir||FRt,i)},"generateName");var _On=a(function(e,t){var r={prefix:null,suffix:null};if(e){switch(typeof e){case"string":r.prefix=e;break;case"object":r=e;break;default:throw new Error("Unknown affix declaration: "+r)}}else{r.prefix=t}return r},"parseAffixes");var ag=false;var vOn=a(function(e){ag=e!==false;return URt.exports},"track");var IRt=false;var pQ=[];var fQ=[];function POe(e){if(!ag)return false;MRt();pQ.push(e)}a(POe,"deleteFileOnExit");function BRt(e){if(!ag)return false;MRt();fQ.push(e)}a(BRt,"deleteDirOnExit");function MRt(){if(!ag)return false;if(!IRt){process.addListener("exit",function(){try{qRt()}catch(e){console.warn("Fail to clean temporary files on exit : ",e);throw e}});IRt=true}}a(MRt,"attachExitListener");function EOn(){if(!ag){return false}var e=0;var t;while((t=pQ.shift())!==void 0){LRt(t,{maxBusyTries:6});e++}return e}a(EOn,"cleanupFilesSync");function bOn(e){var t=r7(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=pQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=pQ.shift())!==void 0){ROe(s,{maxBusyTries:6},o)}return r}a(bOn,"cleanupFiles");function SOn(){if(!ag){return false}var e=0;var t;while((t=fQ.shift())!==void 0){LRt(t,{maxBusyTries:6});e++}return e}a(SOn,"cleanupDirsSync");function AOn(e){var t=r7(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}var n=0;var i=fQ.length;if(!i){e(null,n);return r}var s;var o=a(function(u){if(!i){return}if(u){e(u,n);i=0;return}else{n++}i--;if(!i){e(null,n)}},"rimrafCallback");while((s=fQ.shift())!==void 0){ROe(s,{maxBusyTries:6},o)}return r}a(AOn,"cleanupDirs");function qRt(){if(!ag){return false}var e=EOn();var t=SOn();return{files:e,dirs:t}}a(qRt,"cleanupSync");function COn(e){var t=r7(e);var r=t[0];e=t[1];if(!ag){e(new Error("not tracking"));return r}bOn(function(n,i){if(n){e(n,{files:i})}else{AOn(function(s,o){e(s,{files:i,dirs:o})})}});return r}a(COn,"cleanup");var wOn=a((e,t)=>{const r=r7(t);const n=r[0];t=r[1];let i=DP(e,"d-");DRt(i,448,s=>{if(!s){BRt(i)}t(s,i)});return n},"mkdir");var TOn=a(e=>{let t=DP(e,"d-");DRt.sync(t,448);BRt(t);return t},"mkdirSync");var xOn=a((e,t)=>{const r=r7(t);const n=r[0];t=r[1];const i=DP(e,"f-");xOe.open(i,OOe,384,(s,o)=>{if(!s){POe(i)}t(s,{path:i,fd:o})});return n},"open");var ROn=a(e=>{const t=DP(e,"f-");let r=xOe.openSync(t,OOe,384);POe(t);return{path:t,fd:r}},"openSync");var OOn=a(e=>{const t=DP(e,"s-");let r=xOe.createWriteStream(t,{flags:OOe,mode:384});POe(t);return r},"createWriteStream");yh.dir=FRt;yh.track=vOn;yh.mkdir=wOn;yh.mkdirSync=TOn;yh.open=xOn;yh.openSync=ROn;yh.path=DP;yh.cleanup=COn;yh.cleanupSync=qRt;yh.createWriteStream=OOn});var VRt=y(LP=>{"use strict";var HRt=LP&&LP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(LP,"__esModule",{value:true});LP.generateBuildData=void 0;var mQ=hn();var jRt=require("fs/promises");var GRt=HRt(require("path"));var POn=Fn();var NOn=HRt(xs());var IOn=a(async function({systemDirectory:e,buildId:t,logger:r,config:n,publicZuploEnvironmentVariables:i}){return NOn.default.timeFn("Generating build data",async()=>{r.debug(`Generating build data`);const s=await(0,jRt.readFile)(GRt.default.resolve(__dirname,"../../../package.json"),"utf-8");const o=JSON.parse(s);const u={BUILD_ID:t??"",GIT_SHA:process.env.GIT_SHA,TIMESTAMP:new Date().toISOString(),IS_PRODUCTION:mQ.env.isProduction(),BUILD_ENV:mQ.env.NODE_ENV,ZUPLO_VERSION:o.version,API_VERSION:process.env.API_VERSION,COMPATIBILITY_DATE:n?.compatibilityDate,ACCOUNT_NAME:i?.ZUPLO_ACCOUNT_NAME,PROJECT_NAME:i?.ZUPLO_PROJECT_NAME,ENVIRONMENT_TYPE:i?.ZUPLO_ENVIRONMENT_TYPE,COMPATIBILITY_FLAGS:mQ.COMPATIBILITY_FLAG_MAPPINGS?mQ.COMPATIBILITY_FLAG_MAPPINGS[n?.compatibilityDate??"none"]:{runOutboundPoliciesOnHandlerOnAllStatuses:false,doNotRunHooksOnSystemRoutes:false}};const l=JSON.stringify(u,void 0,2);const c=GRt.default.join(e,POn.GENERATED_BUILD_JSON_FILE);try{await(0,jRt.writeFile)(c,l.trimStart(),"utf-8")}catch(d){r.error(d);const p={message:`Error creating file at ${c}`,pluginName:"buildData",severity:"error"};return{warnings:[],errors:[p]}}return{warnings:[],errors:[]}})},"generateBuildData");LP.generateBuildData=IOn});var zRt=y(FP=>{"use strict";var IOe=FP&&FP.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};Object.defineProperty(FP,"__esModule",{value:true});FP.generateWorker=void 0;var kOn=IOe(require("fs/promises"));var DOn=IOe(require("path"));var NOe=Fn();var LOn=IOe(xs());var FOn=a(async function({systemDirectory:e,logger:t}){return LOn.default.timeFn("Generating Worker shim",async()=>{t.debug("Generating Worker shim");const r=`import { Handler, ServiceProviderImpl } from "@zuplo/runtime";
411
411
  import routeLoader from "../config/routes.json";
412
412
  import * as schemaValidations from "./ajv-schema.json";
413
413
  import { runtimeInit } from "../modules/zuplo.runtime.ts";