needle-cloud 2.7.0-rc.1790700197.979cfcc → 2.7.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.
@@ -1 +1 @@
1
- import e from"node-fetch";import{File as t}from"@web-std/file";import n,{randomUUID as o}from"node:crypto";import{Command as i,Option as a}from"commander";import s,{existsSync as r,statSync as c,readFileSync as l,readdirSync as p,appendFileSync as u,mkdirSync as d,writeFileSync as m,lstatSync as f,readFile as h}from"fs";import{execFileSync as g}from"child_process";import v from"open";import x,{resolve as b,join as y,relative as w,sep as _,isAbsolute as k,dirname as S}from"path";import j from"ora";import{existsSync as T,mkdirSync as E,renameSync as $,realpathSync as O,statSync as R,rename as A,appendFileSync as C,openSync as N,readSync as P,closeSync as I,createReadStream as U,readFileSync as z,writeFileSync as L,watch as F}from"node:fs";import{writeFile as D}from"node:fs/promises";import q,{homedir as B}from"node:os";import M,{resolve as W,join as G}from"node:path";import H from"util";import J,{Readable as V}from"stream";import K from"http";import Y from"https";import Z from"url";import X,{randomUUID as Q}from"crypto";import ee from"net";import te from"tls";import ne from"assert";import oe from"tty";import ie,{homedir as ae,tmpdir as se}from"os";import re,{EventEmitter as ce}from"events";import le from"http2";import pe from"zlib";import{createInterface as ue}from"node:readline/promises";import de from"dotenv";import me from"@logto/node";import{createInterface as fe}from"node:readline";import{Readable as he}from"node:stream";import{createGzip as ge}from"node:zlib";import{Router as ve}from"express";import xe,{WebSocketServer as be}from"ws";import{execFile as ye,execFileSync as we}from"node:child_process";import{minimatch as _e}from"minimatch";import ke from"body-parser";const Se="STRING",je="BOOLEAN",Te="NUMBER",Ee="ARRAY";function $e(e){return e.replace(/[-_](\w)/g,(e,t)=>t.toUpperCase())}function Oe(e){const t=e.match(/--[\w-]+/g);return t?t[t.length-1]:e.split(/[\s,]+/)[0]}function Re(e){return $e(Oe(e).replace(/^--/,""))}function Ae(e){return $e(e.replace(/[[\]<>]/g,"").replace(/\.\.\.$/,"").trim())}function Ce(e,t){if(null==e)return e;switch(t){case je:{if("boolean"==typeof e)return e;const t=String(e).toLowerCase();return""===t||!["false","0","no","off"].includes(t)&&(!!["true","1","yes","on"].includes(t)||Boolean(e))}case Te:{const t=Number(e);return Number.isNaN(t)?e:t}case Ee:return Array.isArray(e)?e:String(e).split(",");case Se:return Array.isArray(e)?e:String(e);default:return e}}const Ne={error:(...e)=>console.error(...e),warn:(...e)=>console.warn(...e),info:(...e)=>console.log(...e),debug:(...e)=>console.debug(...e),log:(...e)=>console.log(...e)};class Pe{constructor(e,t){this.name=e,this.description=null!=t?t:"",this.visible=!0,this.strictOptions=!0,this._aliases=[],this._helpTexts=[],this._action=void 0,this.options=[],this.args=[]}alias(e){return this._aliases.push(e),this}getAliases(){return[...this._aliases]}configure(e={}){return void 0!==e.visible&&(this.visible=!1!==e.visible),void 0!==e.strictOptions&&(this.strictOptions=!1!==e.strictOptions),this}hide(){return this.visible=!1,this}help(e){return e&&this._helpTexts.push(e),this}option(e,t,n={}){return this.options.push({synopsis:e,description:null!=t?t:"",name:Re(e),validator:n.validator,default:n.default,required:!0===n.required,hidden:!0===n.hidden}),this}argument(e,t,n={}){return this.args.push({synopsis:e,description:null!=t?t:"",name:Ae(e),validator:n.validator,default:n.default}),this}action(e){return this._action=e,this}isHelpCommand(){return!1}}class Ie{constructor(){this.STRING=Se,this.BOOLEAN=je,this.NUMBER=Te,this.ARRAY=Ee,this._version=void 0,this._description=void 0,this._name="needle-cloud",this._commands=[],this._exitOverride=!1,this._testHooks=null}version(e){return this._version=e,this}description(e){return this._description=e,this}name(e){return this._name=e,this}command(e,t){const n=new Pe(e,t);return this._commands.push(n),n}getCommands(){return[...this._commands]}exitOverride(){return this._exitOverride=!0,this}async run(e){const t=this._build();try{return await t.parseAsync(null!=e?e:process.argv.slice(2),{from:"user"})}catch(t){var n,o,i;if(this._exitOverride)throw t;const a=null!=(n=null==(o=this._testHooks)?void 0:o.error)?n:e=>console.error(e);return a(`error: ${t instanceof Error&&t.message||String(t)}`),(null!=e?e:process.argv).includes("--verbose")&&t instanceof Error&&t.stack&&a(t.stack),null!=(i=this._testHooks)&&i.exit?this._testHooks.exit(1):process.exit(1)}}_build(){const e=new i(this._name);this._version&&e.version(this._version),this._description&&e.description(this._description),this._exitOverride&&e.exitOverride();const t=new Map,n=o=>{if(1===o.length)return e;const a=o.slice(0,-1).join(" ");let s=t.get(a);return s||(s=new i(o[o.length-2]),this._exitOverride&&s.exitOverride(),t.set(a,s),n(o.slice(0,-1)).addCommand(s)),s};for(const e of this._commands){const o=e.name.split(/\s+/),s=t.get(e.name),r=null!=s?s:new i(o[o.length-1]);t.set(e.name,r),r.description(e.description);for(const t of e._aliases)r.alias(t);for(const t of e._helpTexts)r.addHelpText("after","\n"+t);this._exitOverride&&r.exitOverride(),e.strictOptions||(r.allowUnknownOption(!0),r.allowExcessArguments(!0));for(const t of e.args)r.argument(t.synopsis,t.description);for(const t of e.options){let e=t.synopsis;t.validator&&!Oe(e).startsWith("--no-")&&(e=/[<[]/.test(e)?e.replace(/<([\w-]+)>/,"[$1]"):`${e} [value]`);const n=new a(e,t.description);t.hidden&&n.hideHelp(),t.required&&n.makeOptionMandatory(),r.addOption(n)}e._action&&r.action(async(...t)=>{var n;const o=null!=(n=t[e.args.length])?n:{},i={};e.args.forEach((e,n)=>{const o=t[n];i[e.name]=Ce(void 0===o?e.default:o,e.validator)});const a={};for(const t of e.options){if(Oe(t.synopsis).startsWith("--no-")){const e=$e(Oe(t.synopsis).replace(/^--no-/,""));a[t.name]=!1===o[e];continue}const e=o[t.name];a[t.name]=Ce(void 0===e?t.default:e,t.validator)}for(const[e,t]of Object.entries(o))e in a||(a[e]=t);await e._action({args:i,options:a,logger:Ne,command:r})}),s||n(o).addCommand(r,{hidden:!e.visible})}return e}}function Ue(){return new Ie}var ze={program:Ue(),createProgram:Ue,STRING:Se,BOOLEAN:je,NUMBER:Te,ARRAY:Ee};const Le={status:"/v1/status",version:"/v1/version",api:"/v1/api",usage:{get:"/v1/usage"},affiliate:{get:"/v1/affiliate/get",link_clicked:"/v1/affiliate/link_clicked"},account:{public_key:"/v1/account/public_key",post_machine:"/v1/account/machine",connect:"/v1/account/connect",get_licenses:"/v1/account/get/licenses",set_license_active:"/v1/account/set_license_active",set_licenses_active:"/v1/account/set_licenses_active",buy_licenses:"/v1/account/buy_licenses",update_licenses:"/v1/account/update_licenses",preview_invitation:"/v1/account/preview_invitation",update_payment_method:"/v1/account/update_payment_method",get_billing:"/v1/account/get_billing",generate_invoice:"/v1/account/generate_invoice",resume_subscription:"/v1/account/resume_subscription",cancel_subscription:"/v1/account/cancel_subscription",start_billingportal_session:"/v1/account/start_billingportal_session",post_preferences:"/v1/account/preferences",get_preferences:"/v1/account/preferences"},payment:{info:"/v1/payment/info",create:"/v1/payment/create"},ai:{llmstxt:"/v1/ai/llmstxt",chat:"/v1/ai/chat",chat_personal:"/v1/ai/chat/personal",list_chats:"/v1/ai/chat/list",chat_image:"/v1/ai/chat/image",chat_tool_result:"/v1/ai/chat/tool-result",chat_stop:"/v1/ai/chat/stop",chat_enqueue:"/v1/ai/chat/enqueue",chat_enqueue_cancel:"/v1/ai/chat/enqueue/cancel",ask:"/v1/ai/ask",completions:"/v1/ai/completions",evaluate:"/v1/ai/evaluate",post_settings:"/v1/ai/chat/settings",ws:"/v1/ws",cli_ws:"/v1/cli/ws"},organizations:{get:"/v1/organizations/get",orgs_details:"/v1/organizations/details",licenses:"/v1/organizations/licenses",get_invitations:"/v1/organizations/get_invitations"},events:{get:"/v1/events/get",post:"/v1/events/post",list:"/v1/events/list"},reports:{get:"/v1/reports/get",post:"/v1/reports/post"},diagnostics:{download_failed:"/v1/diagnostics/download-failed"},questionnaire:{get:"/v1/questionnaires/get",post:"/v1/questionnaires/post"},roadmap:{get:"/v1/roadmap/get",post_vote:"/v1/roadmap/post"},tokens:{create:"/v1/tokens/create",delete:"/v1/tokens/delete",list:"/v1/tokens/list"},get:{stats:"/v1/get/stats",jobs:"/v1/list/jobs",deployments:"/v1/list/deployments",discounts:"/v1/get/discounts"},files:{entry:"/v1/files/:identifier/:version/",file:"/v1/files/:identifier/:version/*"},view:{get_analytics:"/v1/view/analytics",get_public_info:"/v1/view/public/info",post_version:"/v1/view/post_version"},content:{root:"/v1/content",download:"/v1/content/download",detail:"/v1/content/:identifier",update:"/v1/content/:identifier",delete:"/v1/content/:identifier",restore:"/v1/content/:identifier/restore",visits:"/v1/content/:identifier/visits",domains:"/v1/content/:identifier/domains",domain_item:"/v1/content/:identifier/domains/:hostname",domain_verify:"/v1/content/:identifier/domains/:hostname/verify"},analytics:{content_list:"/v1/analytics/content-list"},public:{content_list:"/v1/public/content",content_detail:"/v1/public/content/:identifier"},collections:{list:"/v1/collections/list",get:"/v1/collections/get",create:"/v1/collections/create",update:"/v1/collections/update",delete:"/v1/collections/delete",add_item:"/v1/collections/add-item",remove_item:"/v1/collections/remove-item",reorder_items:"/v1/collections/reorder-items"},projects:{create:"/v1/projects/create",list:"/v1/projects/list",head:"/v1/projects/head",push:"/v1/projects/push",pull:"/v1/projects/pull",delete:"/v1/projects/delete",restore:"/v1/projects/restore",archive:"/v1/projects/archive",unarchive:"/v1/projects/unarchive",clone:"/v1/projects/clone",update:"/v1/projects/update",blobs_check:"/v1/projects/blobs/check",blobs_upload:"/v1/projects/blobs/upload",blobs_complete:"/v1/projects/blobs/complete",blobs_download:"/v1/projects/blobs/download",revisions:"/v1/projects/revisions",revisions_update:"/v1/projects/revisions/update",deployments:"/v1/projects/deployments",promote:"/v1/projects/promote",promotions:"/v1/projects/promotions"},upload:{request:"/v1/upload/request",request_put_url:"/v1/upload/put",update_results:"/v1/upload/results",done:"/v1/upload/done",cancel:"/v1/upload/cancel",multipart_create:"/v1/upload/multipart/create",multipart_part_urls:"/v1/upload/multipart/part-urls",multipart_complete:"/v1/upload/multipart/complete",multipart_abort:"/v1/upload/multipart/abort"},jobs:{create:"/v1/jobs/create",get_id:"/v1/jobs/get_id",request_start:"/v1/jobs/request_start",presigned_url:"/v1/jobs/presigned-url",presigned_urls:"/v1/jobs/presigned-urls",download_urls:"/v1/jobs/download-urls",request_restart:"/v1/jobs/restart",delete:"/v1/jobs/delete",post_update:"/v1/jobs/update",post_results_stats:"/v1/jobs/results_stats",post_usage:"/v1/jobs/post_usage",get_status:"/v1/jobs/status",get_org:"/v1/jobs/org",query:"/v1/jobs/query",request_job_that_needs_stats:"/v1/jobs/job_needs_stats"},worker:{ping:"/v1/worker/ping",get_available_count:"/v1/worker/get_available_count",post_available_info:"/v1/worker/post_available_info",get_available_info:"/v1/worker/get_available_info"},local_projects:{get:{user:"/v1/local_projects/user",by_id:"/v1/local_projects/"},post:"/v1/local_projects"}};function Fe(e){const t={authorization:"Bearer "+e.authToken};return e.org&&(t["x-needle-cloud-org"]=e.org),e.roles&&(t.roles=e.roles.join(",")),e.roles_org&&(t.roles_org=e.roles_org.join(",")),t}const De={credentials:"omit"};function qe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Be}=Object.prototype,{getPrototypeOf:Me}=Object,{iterator:We,toStringTag:Ge}=Symbol,He=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Je=(e,t)=>{let n=e;const o=[];for(;null!=n&&n!==Object.prototype;){if(-1!==o.indexOf(n))return!1;if(o.push(n),He(n,t))return!0;n=Me(n)}return!1},Ve=(Ke=Object.create(null),e=>{const t=Be.call(e);return Ke[t]||(Ke[t]=t.slice(8,-1).toLowerCase())});var Ke;const Ye=e=>(e=e.toLowerCase(),t=>Ve(t)===e),Ze=e=>t=>typeof t===e,{isArray:Xe}=Array,Qe=Ze("undefined");function et(e){return null!==e&&!Qe(e)&&null!==e.constructor&&!Qe(e.constructor)&&ot(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tt=Ye("ArrayBuffer"),nt=Ze("string"),ot=Ze("function"),it=Ze("number"),at=e=>null!==e&&"object"==typeof e,st=e=>{if(!at(e))return!1;const t=Me(e);return!(null!==t&&t!==Object.prototype&&null!==Me(t)||Je(e,Ge)||Je(e,We))},rt=Ye("Date"),ct=Ye("File"),lt=Ye("Blob"),pt=Ye("FileList"),ut=Ye("Set"),dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},mt=void 0!==dt.FormData?dt.FormData:void 0,ft=Ye("URLSearchParams"),[ht,gt,vt,xt]=["ReadableStream","Request","Response","Headers"].map(Ye);function bt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,i;if("object"!=typeof e&&(e=[e]),Xe(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{if(et(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(o=0;o<a;o++)s=i[o],t.call(null,e[s],s,e)}}function yt(e,t){if(et(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o,i=n.length;for(;i-- >0;)if(o=n[i],t===o.toLowerCase())return o;return null}const wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,_t=e=>!Qe(e)&&e!==wt,kt=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&Me(Uint8Array)),St=Ye("HTMLFormElement"),{propertyIsEnumerable:jt}=Object.prototype,Tt=Ye("RegExp"),Et=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};bt(n,(n,i)=>{let a;!1!==(a=t(n,i,e))&&(o[i]=a||n)}),Object.defineProperties(e,o)},$t=Ye("AsyncFunction"),Ot=(Rt="function"==typeof setImmediate,At=ot(wt.postMessage),Rt?setImmediate:At?(Ct=`axios@${Math.random()}`,Nt=[],wt.addEventListener("message",({source:e,data:t})=>{e===wt&&t===Ct&&Nt.length&&Nt.shift()()},!1),e=>{Nt.push(e),wt.postMessage(Ct,"*")}):e=>setTimeout(e));var Rt,At,Ct,Nt;const Pt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(wt):"undefined"!=typeof process&&process.nextTick||Ot,It=e=>null!=e&&ot(e[We]);var Ut={isArray:Xe,isArrayBuffer:tt,isBuffer:et,isFormData:e=>{if(!e)return!1;if(mt&&e instanceof mt)return!0;const t=Me(e);if(!t||t===Object.prototype)return!1;if(!ot(e.append))return!1;const n=Ve(e);return"formdata"===n||"object"===n&&ot(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&tt(e.buffer),t},isString:nt,isNumber:it,isBoolean:e=>!0===e||!1===e,isObject:at,isPlainObject:st,isEmptyObject:e=>{if(!at(e)||et(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ht,isRequest:gt,isResponse:vt,isHeaders:xt,isUndefined:Qe,isDate:rt,isFile:ct,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lt,isRegExp:Tt,isFunction:ot,isStream:e=>at(e)&&ot(e.pipe),isURLSearchParams:ft,isTypedArray:kt,isFileList:pt,forEach:bt,merge:function e(...t){const{caseless:n,skipUndefined:o}=_t(this)&&this||{},i={},a=(t,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;const s=n&&"string"==typeof a&&yt(i,a)||a,r=He(i,s)?i[s]:void 0;st(r)&&st(t)?i[s]=e(r,t):st(t)?i[s]=e({},t):Xe(t)?i[s]=t.slice():o&&Qe(t)||(i[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||et(n))continue;if(bt(n,a),"object"!=typeof n||Xe(n))continue;const o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){const t=o[e];jt.call(n,t)&&a(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:o}={})=>(bt(t,(t,o)=>{n&&ot(t)?Object.defineProperty(e,o,{__proto__:null,value:qe(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let i,a,s;const r={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],o&&!o(s,e,t)||r[s]||(t[s]=e[s],r[s]=!0);e=!1!==n&&Me(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ve,kindOfTest:Ye,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length);const o=e.indexOf(t,n-=t.length);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(Xe(e))return e;let t=e.length;if(!it(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[We]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:St,hasOwnProperty:He,hasOwnProp:He,hasOwnInPrototypeChain:Je,getSafeProp:(e,t)=>null!=e&&Je(e,t)?e[t]:void 0,reduceDescriptors:Et,freezeMethods:e=>{Et(e,(t,n)=>{if(ot(e)&&["arguments","caller","callee"].includes(n))return!1;ot(e[n])&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach(e=>{n[e]=!0})};return Xe(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:yt,global:wt,isContextDefined:_t,isSpecCompliantForm:function(e){return!!(e&&ot(e.append)&&"FormData"===e[Ge]&&e[We])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(at(e)){if(t.has(e))return;if(et(e))return e;if(!("toJSON"in e)){let o;if(t.add(e),ut(e)){o=[];for(const t of e){const e=n(t);!Qe(e)&&o.push(e)}}else o=Xe(e)?[]:{},bt(e,(e,t)=>{const i=n(e);!Qe(i)&&(o[t]=i)});return t.delete(e),o}}return e};return n(e)},isAsyncFn:$t,isThenable:e=>e&&(at(e)||ot(e))&&ot(e.then)&&ot(e.catch),setImmediate:Ot,asap:Pt,isIterable:It,isSafeIterable:e=>null!=e&&Je(e,We)&&It(e)};const zt=Ut.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"]),Lt=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ft=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Dt(e,t){return Ut.isArray(e)?e.map(e=>Dt(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function qt(e){const t=Object.create(null);return Ut.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>Dt(e,Ft))(e)}),t}const Bt=Symbol("internals");function Mt(e){return e&&String(e).trim().toLowerCase()}function Wt(e){return!1===e||null==e?e:Ut.isArray(e)?e.map(Wt):(e=>Dt(e,Lt))(String(e))}const Gt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Ht(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Jt(e,t,n,o,i){return Ut.isFunction(o)?o.call(this,t,n):(i&&(t=n),Ut.isString(t)?Ut.isString(o)?-1!==t.indexOf(o):Ut.isRegExp(o)?o.test(t):void 0:void 0)}class Vt{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function i(e,t,n){const i=Mt(t);if(!i)return;const a=Ut.findKey(o,i);(!a||void 0===o[a]||!0===n||void 0===n&&!1!==o[a])&&(o[a||t]=Wt(e))}const a=(e,t)=>Ut.forEach(e,(e,n)=>i(e,n,t));if(Ut.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Ut.isString(e)&&(e=e.trim())&&!(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))(e))a((e=>{const t={};let n,o,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim();const a=Ut.hasOwnProp(t,n);!n||a&&Ut.hasOwnProp(zt,n)||("set-cookie"===n?a?t[n].push(o):t[n]=[o]:t[n]=a?t[n]+", "+o:o)}),t})(e),t);else if(Ut.isObject(e)&&Ut.isSafeIterable(e)){let n,o,i=Object.create(null);for(const t of e){if(!Ut.isArray(t))throw new TypeError("Object iterator must return a key-value pair");o=t[0],Ut.hasOwnProp(i,o)?(n=i[o],i[o]=Ut.isArray(n)?[...n,t[1]]:[n,t[1]]):i[o]=t[1]}a(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Mt(e)){const n=Ut.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(Ut.isFunction(t))return t.call(this,e,n);if(Ut.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Mt(e)){const n=Ut.findKey(this,e);return!(!n||void 0===this[n]||t&&!Jt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function i(e){if(e=Mt(e)){const i=Ut.findKey(n,e);!i||t&&!Jt(0,n[i],i,t)||(delete n[i],o=!0)}}return Ut.isArray(e)?e.forEach(i):i(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const i=t[n];e&&!Jt(0,this[i],i,e,!0)||(delete this[i],o=!0)}return o}normalize(e){const t=this,n={};return Ut.forEach(this,(o,i)=>{const a=Ut.findKey(n,i);if(a)return t[a]=Wt(o),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=Wt(o),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ut.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&Ut.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return Ut.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let o=0,i=!1,a=!1;function s(e){const i=Ht(n.slice(o,e)),a=i.indexOf("=");if(a<1)return;const s=Ht(i.slice(0,a));if(!Gt.test(s))return;const r=s.toLowerCase();if("__proto__"===r||"constructor"===r||"prototype"===r)return;const c=Ht(i.slice(a+1));t[r]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let o=1;o<t;o++){const i=e.charCodeAt(o);if(34===i)return e;if(92===i&&(o+=1,o>=t))return e;n+=e[o]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i?a?a=!1:92===t?a=!0:34===t&&(i=!1):34===t?i=!0:44!==t&&59!==t||(s(e),o=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Bt]=this[Bt]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=Mt(e);t[o]||(function(e,t){const n=Ut.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{__proto__:null,value:function(e,n,i){return this[o].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[o]=!0)}return Ut.isArray(e)?e.forEach(o):o(e),this}}Vt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ut.reduceDescriptors(Vt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Ut.freezeMethods(Vt);var Kt=Vt;const Yt="[REDACTED ****]";class Zt extends Error{static from(e,t,n,o,i,a){let s=e.message;!s&&Ut.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return function(e){try{return String(e)}catch(e){return""}}(e&&e.message?e.message:e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const r=new Zt(s,t||e.code,n,o,i);return Object.defineProperty(r,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),r.name=e.name,null!=e.status&&null==r.status&&(r.status=e.status),a&&Object.assign(r,a),r}constructor(e,t,n,o,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&Ut.hasOwnProp(e,"redact")?e.redact:void 0,n=Ut.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),o=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(Ut.isBuffer(e))return e;if(-1!==o.indexOf(e))return;let t;if(e instanceof Kt&&(e=e.toJSON()),o.push(e),Ut.isArray(e))t=[],e.forEach((e,n)=>{const o=i(e);Ut.isUndefined(o)||(t[n]=o)});else{if(!Ut.isPlainObject(e)&&function(e){if(Ut.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Ut.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return o.pop(),e;t=Object.create(null);for(const[o,a]of Object.entries(e)){const e=n.has(o.toLowerCase())?Yt:i(a);Ut.isUndefined(e)||(t[o]=e)}}return o.pop(),t};return i(e)}(e,t):Ut.toJSONObject(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:n,code:this.code,status:this.status}}}Zt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Zt.ERR_BAD_OPTION="ERR_BAD_OPTION",Zt.ECONNABORTED="ECONNABORTED",Zt.ETIMEDOUT="ETIMEDOUT",Zt.ECONNREFUSED="ECONNREFUSED",Zt.ERR_NETWORK="ERR_NETWORK",Zt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Zt.ERR_DEPRECATED="ERR_DEPRECATED",Zt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Zt.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Zt.ERR_CANCELED="ERR_CANCELED",Zt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Zt.ERR_INVALID_URL="ERR_INVALID_URL",Zt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Xt=Zt,Qt=J.Stream,en=tn;function tn(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}H.inherits(tn,Qt),tn.create=function(e,t){var n=new this;for(var o in t=t||{})n[o]=t[o];n.source=e;var i=e.emit;return e.emit=function(){return n._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),n.pauseStream&&e.pause(),n},Object.defineProperty(tn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),tn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},tn.prototype.resume=function(){this._released||this.release(),this.source.resume()},tn.prototype.pause=function(){this.source.pause()},tn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},tn.prototype.pipe=function(){var e=Qt.prototype.pipe.apply(this,arguments);return this.resume(),e},tn.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},tn.prototype._checkIfMaxDataSizeExceeded=function(){this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize||(this._maxDataSizeExceeded=!0,this.emit("error",new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.")))};var nn=J.Stream,on=an;function an(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}H.inherits(an,nn),an.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},an.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},an.prototype.append=function(e){if(an.isStreamLike(e)){if(!(e instanceof en)){var t=en.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},an.prototype.pipe=function(e,t){return nn.prototype.pipe.call(this,e,t),this.resume(),e},an.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},an.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){an.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},an.prototype._pipeNext=function(e){if(this._currentStream=e,an.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});this.write(e),this._getNext()},an.prototype._handleErrors=function(e){var t=this;e.on("error",function(e){t._emitError(e)})},an.prototype.write=function(e){this.emit("data",e)},an.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},an.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},an.prototype.end=function(){this._reset(),this.emit("end")},an.prototype.destroy=function(){this._reset(),this.emit("close")},an.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},an.prototype._checkDataSize=function(){this._updateDataSize(),this.dataSize<=this.maxDataSize||this._emitError(new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded."))},an.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},an.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var sn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function rn(e){var t={exports:{}};return e(t,t.exports),t.exports}var cn={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"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:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,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:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"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:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0,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:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"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:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,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:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,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:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"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:!0},"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:!1,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:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,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:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,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:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,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:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"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:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"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:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"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:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,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:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,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:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"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:!1,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:!0,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:!0},"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:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,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:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,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:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,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:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"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:!0},"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:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,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:!0,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:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"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:!0},"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:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"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:!0},"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:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"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:!0,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:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"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:!0},"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:!0},"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:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"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:!0},"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:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"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:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"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:!1},"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:!1},"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:!1},"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:!0},"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:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"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:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"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:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"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:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,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:!1},"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:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"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:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"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:!0},"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:!0},"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:!0,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:!1,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:!0,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:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,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:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,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:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"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:!1,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:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,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:!0},"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:!1,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:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,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:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0,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:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"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:!0},"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:!0},"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:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"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:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"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:!0,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:!0},"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:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"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:!0},"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:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,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:!0,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:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,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:!0,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:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"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:!0,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:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"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:!0},"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:!0,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:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"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:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,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:!1,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:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,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:!1},"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:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,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:!0,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:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,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:!1},"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:!0,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:!1,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:!1,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:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,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:!0,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:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"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:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,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:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,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:!1,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:!1,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:!1},"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:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,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:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,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:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,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:!1,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:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,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:!1},"image/png":{source:"iana",compressible:!1,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:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,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:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,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:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,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:!1},"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:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,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:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,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:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,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:!0},"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:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"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:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"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:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,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:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,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:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,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:!0,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:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,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:!0,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:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,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:!0,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:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,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:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,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:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,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:!1,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:!0},"x-shader/x-vertex":{compressible:!0}},ln=rn(function(e,t){var n,o,i,a=x.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var t=s.exec(e),n=t&&cn[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!r.test(t[1]))&&"UTF-8"}t.charset=c,t.charsets={lookup:c},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var o=t.charset(n);o&&(n+="; charset="+o.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),o=n&&t.extensions[n[1].toLowerCase()];return!(!o||!o.length)&&o[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=a("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),n=t.extensions,o=t.types,i=["nginx","apache",void 0,"iana"],Object.keys(cn).forEach(function(e){var t=cn[e],a=t.extensions;if(a&&a.length){n[e]=a;for(var s=0;s<a.length;s++){var r=a[s];if(o[r]){var c=i.indexOf(cn[o[r]].source),l=i.indexOf(t.source);if("application/octet-stream"!==o[r]&&(c>l||c===l&&"application/"===o[r].substr(0,12)))continue}o[r]=e}}})}),pn=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},un=function(e){var t=!1;return pn(function(){t=!0}),function(n,o){t?e(n,o):pn(function(){e(n,o)})}},dn=function(e){Object.keys(e.jobs).forEach(mn.bind(e)),e.jobs={}};function mn(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var fn=function(e,t,n,o){var i=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[i]=function(e,t,n,o){return 2==e.length?e(n,un(o)):e(n,t,un(o))}(t,i,e[i],function(e,t){i in n.jobs&&(delete n.jobs[i],e?dn(n):n.results[i]=t,o(e,n.results))})},hn=function(e,t){var n=!Array.isArray(e),o={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};return t&&o.keyedList.sort(n?t:function(n,o){return t(e[n],e[o])}),o},gn=function(e){Object.keys(this.jobs).length&&(this.index=this.size,dn(this),un(e)(null,this.results))},vn=function(e,t,n,o){var i=hn(e,n);return fn(e,t,i,function n(a,s){a?o(a,s):(i.index++,i.index<(i.keyedList||e).length?fn(e,t,i,n):o(null,i.results))}),gn.bind(i,o)};function xn(e,t){return e<t?-1:e>t?1:0}vn.ascending=xn,vn.descending=function(e,t){return-1*xn(e,t)};var bn=Object,yn=Error,wn=EvalError,_n=RangeError,kn=ReferenceError,Sn=SyntaxError,jn=TypeError,Tn=URIError,En=Math.abs,$n=Math.floor,On=Math.max,Rn=Math.min,An=Math.pow,Cn=Math.round,Nn=Number.isNaN||function(e){return e!=e},Pn=Object.getOwnPropertyDescriptor;if(Pn)try{Pn([],"length")}catch(e){Pn=null}var In=Pn,Un=Object.defineProperty||!1;if(Un)try{Un({},"a",{value:1})}catch(e){Un=!1}var zn,Ln=Un,Fn=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var o in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0},Dn="undefined"!=typeof Symbol&&Symbol,qn="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null,Bn=bn,Mn=Bn.getPrototypeOf||null,Wn=Object.prototype.toString,Gn=Math.max,Hn=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},Jn=Function.prototype.bind||function(e){var t=this;if("function"!=typeof t||"[object Function]"!==Wn.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,o=function(e,t){for(var n=[],o=1,i=0;o<e.length;o+=1,i+=1)n[i]=e[o];return n}(arguments),i=Gn(0,t.length-o.length),a=[],s=0;s<i;s++)a[s]="$"+s;if(n=Function("binder","return function ("+function(e,t){for(var n="",o=0;o<e.length;o+=1)n+=e[o],o+1<e.length&&(n+=",");return n}(a)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var i=t.apply(this,Hn(o,arguments));return Object(i)===i?i:this}return t.apply(e,Hn(o,arguments))}),t.prototype){var r=function(){};r.prototype=t.prototype,n.prototype=new r,r.prototype=null}return n},Vn=Function.prototype.call,Kn=Function.prototype.apply,Yn="undefined"!=typeof Reflect&&Reflect&&Reflect.apply||Jn.call(Vn,Kn),Zn=jn,Xn=In;try{zn=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var Qn,eo=!!zn&&Xn&&Xn(Object.prototype,"__proto__"),to=Object,no=to.getPrototypeOf,oo=eo&&"function"==typeof eo.get?function(e){if(e.length<1||"function"!=typeof e[0])throw new Zn("a function is required");return Yn(Jn,Vn,e)}([eo.get]):"function"==typeof no&&function(e){return no(null==e?e:to(e))},io=qn?function(e){return qn(e)}:Mn?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return Mn(e)}:oo?function(e){return oo(e)}:null,ao=Jn.call(Function.prototype.call,Object.prototype.hasOwnProperty),so=yn,ro=wn,co=_n,lo=kn,po=Sn,uo=Tn,mo=En,fo=$n,ho=On,go=Rn,vo=An,xo=Cn,bo=Ln,yo=ao,wo=Function,_o=function(e){try{return wo('"use strict"; return ('+e+").constructor;")()}catch(e){}},ko=function(){throw new Zn},So=Xn?function(){try{return ko}catch(e){try{return Xn(arguments,"callee").get}catch(e){return ko}}}():ko,jo="function"==typeof Dn&&"function"==typeof Symbol&&"symbol"==typeof Dn("foo")&&"symbol"==typeof Symbol("bar")&&Fn(),To={},Eo="undefined"!=typeof Uint8Array&&io?io(Uint8Array):Qn,$o={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?Qn:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Qn:ArrayBuffer,"%ArrayIteratorPrototype%":jo&&io?io([][Symbol.iterator]()):Qn,"%AsyncFromSyncIteratorPrototype%":Qn,"%AsyncFunction%":To,"%AsyncGenerator%":To,"%AsyncGeneratorFunction%":To,"%AsyncIteratorPrototype%":To,"%Atomics%":"undefined"==typeof Atomics?Qn:Atomics,"%BigInt%":"undefined"==typeof BigInt?Qn:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Qn:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Qn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Qn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":so,"%eval%":eval,"%EvalError%":ro,"%Float16Array%":"undefined"==typeof Float16Array?Qn:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?Qn:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Qn:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Qn:FinalizationRegistry,"%Function%":wo,"%GeneratorFunction%":To,"%Int8Array%":"undefined"==typeof Int8Array?Qn:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Qn:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Qn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jo&&io?io(io([][Symbol.iterator]())):Qn,"%JSON%":"object"==typeof JSON?JSON:Qn,"%Map%":"undefined"==typeof Map?Qn:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&jo&&io?io((new Map)[Symbol.iterator]()):Qn,"%Math%":Math,"%Number%":Number,"%Object%":Bn,"%Object.getOwnPropertyDescriptor%":Xn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Qn:Promise,"%Proxy%":"undefined"==typeof Proxy?Qn:Proxy,"%RangeError%":co,"%ReferenceError%":lo,"%Reflect%":"undefined"==typeof Reflect?Qn:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Qn:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&jo&&io?io((new Set)[Symbol.iterator]()):Qn,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Qn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jo&&io?io(""[Symbol.iterator]()):Qn,"%Symbol%":jo?Symbol:Qn,"%SyntaxError%":po,"%ThrowTypeError%":So,"%TypedArray%":Eo,"%TypeError%":Zn,"%Uint8Array%":"undefined"==typeof Uint8Array?Qn:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Qn:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Qn:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Qn:Uint32Array,"%URIError%":uo,"%WeakMap%":"undefined"==typeof WeakMap?Qn:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Qn:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Qn:WeakSet,"%Function.prototype.call%":Vn,"%Function.prototype.apply%":Kn,"%Object.defineProperty%":bo,"%Object.getPrototypeOf%":Mn,"%Math.abs%":mo,"%Math.floor%":fo,"%Math.max%":ho,"%Math.min%":go,"%Math.pow%":vo,"%Math.round%":xo,"%Math.sign%":function(e){return Nn(e)||0===e?e:e<0?-1:1},"%Reflect.getPrototypeOf%":qn};if(io)try{null.error}catch(e){var Oo=io(io(e));$o["%Error.prototype%"]=Oo}var Ro=function e(t){var n;if("%AsyncFunction%"===t)n=_o("async function () {}");else if("%GeneratorFunction%"===t)n=_o("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=_o("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&io&&(n=io(i.prototype))}return $o[t]=n,n},Ao={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Co=Jn.call(Vn,Array.prototype.concat),No=Jn.call(Kn,Array.prototype.splice),Po=Jn.call(Vn,String.prototype.replace),Io=Jn.call(Vn,String.prototype.slice),Uo=Jn.call(Vn,RegExp.prototype.exec),zo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Lo=/\\(\\)?/g,Fo=function(e,t){var n,o=e;if(yo(Ao,o)&&(o="%"+(n=Ao[o])[0]+"%"),yo($o,o)){var i=$o[o];if(i===To&&(i=Ro(o)),void 0===i&&!t)throw new Zn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:i}}throw new po("intrinsic "+e+" does not exist!")},Do=function(e,t){if("string"!=typeof e||0===e.length)throw new Zn("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new Zn('"allowMissing" argument must be a boolean');if(null===Uo(/^%?[^%]*%?$/,e))throw new po("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=Io(e,0,1),n=Io(e,-1);if("%"===t&&"%"!==n)throw new po("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new po("invalid intrinsic syntax, expected opening `%`");var o=[];return Po(e,zo,function(e,t,n,i){o[o.length]=n?Po(i,Lo,"$1"):t||e}),o}(e),o=n.length>0?n[0]:"",i=Fo("%"+o+"%",t),a=i.name,s=i.value,r=!1,c=i.alias;c&&(o=c[0],No(n,Co([0,1],c)));for(var l=1,p=!0;l<n.length;l+=1){var u=n[l],d=Io(u,0,1),m=Io(u,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new po("property names with quotes must have matching quotes");if("constructor"!==u&&p||(r=!0),yo($o,a="%"+(o+="."+u)+"%"))s=$o[a];else if(null!=s){if(!(u in s)){if(!t)throw new Zn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Xn&&l+1>=n.length){var f=Xn(s,u);s=(p=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:s[u]}else p=yo(s,u),s=s[u];p&&!r&&($o[a]=s)}}return s}("%Object.defineProperty%",!0),qo=Fn()&&Symbol.toStringTag?Symbol.toStringTag:null,Bo=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e},Mo=Z.parse,Wo=J.Stream;function Go(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Ho(e){if(!(this instanceof Ho))return new Ho(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],on.call(this),e=e||{})this[t]=e[t]}H.inherits(Ho,on),Ho.LINE_BREAK="\r\n",Ho.DEFAULT_CONTENT_TYPE="application/octet-stream",Ho.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var o=on.prototype.append.bind(this);if("number"!=typeof t&&null!=t||(t=String(t)),Array.isArray(t))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,t,n),a=this._multiPartFooter();o(i),o(t),o(a),this._trackLength(i,t,n)}},Ho.prototype._trackLength=function(e,t,n){var o=0;null!=n.knownLength?o+=Number(n.knownLength):Buffer.isBuffer(t)?o=t.length:"string"==typeof t&&(o=Buffer.byteLength(t)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+Ho.LINE_BREAK.length,t&&(t.path||t.readable&&yo(t,"httpVersion")||t instanceof Wo)&&(n.knownLength||this._valuesToMeasure.push(t))},Ho.prototype._lengthRetriever=function(e,t){yo(e,"fd")?null!=e.end&&Infinity!=e.end&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):s.stat(e.path,function(n,o){n?t(n):t(null,o.size-(e.start?e.start:0))}):yo(e,"httpVersion")?t(null,Number(e.headers["content-length"])):yo(e,"httpModule")?(e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume()):t("Unknown stream")},Ho.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var o,i=this._getContentDisposition(t,n),a=this._getContentType(t,n),s="",r={"Content-Disposition":["form-data",'name="'+Go(e)+'"'].concat(i||[]),"Content-Type":[].concat(a||[])};for(var c in"object"==typeof n.header&&Bo(r,n.header),r)if(yo(r,c)){if(null==(o=r[c]))continue;Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+Ho.LINE_BREAK)}return"--"+this.getBoundary()+Ho.LINE_BREAK+s+Ho.LINE_BREAK},Ho.prototype._getContentDisposition=function(e,t){var n;if("string"==typeof t.filepath?n=x.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?n=x.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&yo(e,"httpVersion")&&(n=x.basename(e.client._httpMessage.path||"")),n)return'filename="'+Go(n)+'"'},Ho.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e&&e.name&&(n=ln.lookup(e.name)),!n&&e&&e.path&&(n=ln.lookup(e.path)),!n&&e&&e.readable&&yo(e,"httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=ln.lookup(t.filepath||t.filename)),!n&&e&&"object"==typeof e&&(n=Ho.DEFAULT_CONTENT_TYPE),n},Ho.prototype._multiPartFooter=function(){return function(e){var t=Ho.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},Ho.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ho.LINE_BREAK},Ho.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)yo(e,t)&&(n[t.toLowerCase()]=e[t]);return n},Ho.prototype.setBoundary=function(e){if("string"!=typeof e)throw new TypeError("FormData boundary must be a string");this._boundary=e},Ho.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Ho.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,o=this._streams.length;n<o;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(Ho.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Ho.prototype._generateBoundary=function(){this._boundary="--------------------------"+X.randomBytes(12).toString("hex")},Ho.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Ho.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Ho.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?function(e,t,n){for(var o=hn(e);o.index<(o.keyedList||e).length;)fn(e,t,o,function(e,t){e?n(e,t):0!==Object.keys(o.jobs).length||n(null,o.results)}),o.index++;gn.bind(o,n)}(this._valuesToMeasure,this._lengthRetriever,function(n,o){n?e(n):(o.forEach(function(e){t+=e}),e(null,t))}):process.nextTick(e.bind(this,null,t))},Ho.prototype.submit=function(e,t){var n,o,i={method:"post"};return"string"==typeof e?(e=Mo(e),o=Bo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(o=Bo(e,i)).port||(o.port="https:"===o.protocol?443:80),o.headers=this.getHeaders(e.headers),n="https:"===o.protocol?Y.request(o):K.request(o),this.getLength(function(e,o){if(e&&"Unknown stream"!==e)this._error(e);else if(o&&n.setHeader("Content-Length",o),this.pipe(n),t){var i,a=function(e,o){return n.removeListener("error",a),n.removeListener("response",i),t.call(this,e,o)};i=a.bind(this,null),n.on("error",a),n.on("response",i)}}.bind(this)),n},Ho.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Ho.prototype.toString=function(){return"[object FormData]"},function(e,t){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==n&&"boolean"!=typeof n||void 0!==o&&"boolean"!=typeof o)throw new Zn("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!qo||!n&&yo(e,qo)||(Do?Do(e,qo,{configurable:!o,enumerable:!1,value:t,writable:!1}):e[qo]=t)}(Ho.prototype,"FormData");var Jo=Ho,Vo={isBufferAvailable:()=>"undefined"!=typeof Buffer,from:e=>Buffer.from(e)};const Ko=100;function Yo(e){return Ut.isPlainObject(e)||Ut.isArray(e)}function Zo(e){return Ut.endsWith(e,"[]")?e.slice(0,-2):e}function Xo(e,t,n){return e?e.concat(t).map(function(e,t){return e=Zo(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Qo=Ut.toFlatObject(Ut,{},null,function(e){return/^is[A-Z]/.test(e)});function ei(e,t,n){if(!Ut.isObject(e))throw new TypeError("target must be an object");t=t||new(Jo||FormData);const o=(n=Ut.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Ut.isUndefined(t[e])})).metaTokens,i=n.visitor||m,a=n.dots,s=n.indexes,r=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?Ko:n.maxDepth,l=r&&Ut.isSpecCompliantForm(t),p=[];if(!Ut.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Ut.isDate(e))return e.toISOString();if(Ut.isBoolean(e))return e.toString();if(!l&&Ut.isBlob(e))throw new Xt("Blob is not supported. Use a Buffer instead.");if(Ut.isArrayBuffer(e)||Ut.isTypedArray(e)){if(l&&"function"==typeof r)return new r([e]);if(Vo&&Vo.isBufferAvailable())return Vo.from(e);throw new Xt("Blob is not supported. Use a Buffer instead.",Xt.ERR_NOT_SUPPORT)}return e}function d(e){if(e>c)throw new Xt("Object is too deeply nested ("+e+" levels). Max depth: "+c,Xt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,n,i){let r=e;if(Ut.isReactNative(t)&&Ut.isReactNativeBlob(e))return t.append(Xo(i,n,a),u(e)),!1;if(e&&!i&&"object"==typeof e)if(Ut.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(Infinity===c)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,t){if(!Ut.isObject(t))return t;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(t),d(1+n.length-1),t})}(e);else if(Ut.isArray(e)&&function(e){return Ut.isArray(e)&&!e.some(Yo)}(e)||(Ut.isFileList(e)||Ut.endsWith(n,"[]"))&&(r=Ut.toArray(e)))return n=Zo(n),r.forEach(function(e,o){!Ut.isUndefined(e)&&null!==e&&t.append(!0===s?Xo([n],o,a):null===s?n:n+"[]",u(e))}),!1;return!!Yo(e)||(t.append(Xo(i,n,a),u(e)),!1)}const f=Object.assign(Qo,{defaultVisitor:m,convertValue:u,isVisitable:Yo});if(!Ut.isObject(e))throw new TypeError("data must be an object");return function e(n,o,a=0){if(!Ut.isUndefined(n)){if(d(a),-1!==p.indexOf(n))throw new Error("Circular reference detected in "+o.join("."));p.push(n),Ut.forEach(n,function(n,s){!0===(!(Ut.isUndefined(n)||null===n)&&i.call(t,n,Ut.isString(s)?s.trim():s,o,f))&&e(n,o?o.concat(s):[s],a+1)}),p.pop()}}(e),t}function ti(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ni(e,t){this._pairs=[],e&&ei(e,this,t)}const oi=ni.prototype;function ii(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ai(e,t,n){if(!t)return e;e=e||"";const o=Ut.isFunction(n)?{serialize:n}:n,i=Ut.getSafeProp(o,"encode")||ii,a=Ut.getSafeProp(o,"serialize");let s;if(s=a?a(t,o):Ut.isURLSearchParams(t)?t.toString():new ni(t,o).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}oi.append=function(e,t){this._pairs.push([e,t])},oi.toString=function(e){const t=e?t=>e.call(this,t,ti):ti;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var si=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ut.forEach(this.handlers,function(t){null!==t&&e(t)})}},ri={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ci=Z.URLSearchParams;const li="abcdefghijklmnopqrstuvwxyz",pi="0123456789",ui={DIGIT:pi,ALPHA:li,ALPHA_DIGIT:li+li.toUpperCase()+pi};var di={isNode:!0,classes:{URLSearchParams:ci,FormData:Jo,Blob:"undefined"!=typeof Blob&&Blob||null},ALPHABET:ui,generateString:(e=16,t=ui.ALPHA_DIGIT)=>{let n="";const{length:o}=t,i=new Uint32Array(e);X.randomFillSync(i);for(let a=0;a<e;a++)n+=t[i[a]%o];return n},protocols:["http","https","file","data"]};const mi="undefined"!=typeof window&&"undefined"!=typeof document,fi="object"==typeof navigator&&navigator||void 0,hi=mi&&(!fi||["ReactNative","NativeScript","NS"].indexOf(fi.product)<0);var gi={__proto__:null,hasBrowserEnv:mi,hasStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,hasStandardBrowserEnv:hi,navigator:fi,origin:mi&&window.location.href||"http://localhost",...di};const vi=Ko;function xi(e){if(e>vi)throw new Xt("FormData field is too deeply nested ("+e+" levels). Max depth: "+vi,Xt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function bi(e){function t(e,n,o,i){xi(i);let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),r=i>=e.length;return a=!a&&Ut.isArray(o)?o.length:a,r?(o[a]=Ut.hasOwnProp(o,a)?Ut.isArray(o[a])?o[a].concat(n):[o[a],n]:n,!s):(Ut.hasOwnProp(o,a)&&Ut.isObject(o[a])||(o[a]=[]),t(e,n,o[a],i)&&Ut.isArray(o[a])&&(o[a]=function(e){const t={},n=Object.keys(e);let o;const i=n.length;let a;for(o=0;o<i;o++)a=n[o],t[a]=e[a];return t}(o[a])),!s)}if(Ut.isFormData(e)&&Ut.isFunction(e.entries)){const n={};return Ut.forEachEntry(e,(e,o)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let o;for(;null!==(o=n.exec(e));)xi(t.length),t.push("[]"===o[0]?"":o[1]||o[0]);return t}(e),o,n,0)}),n}return null}const yi=(e,t)=>null!=e&&Ut.hasOwnProp(e,t)?e[t]:void 0,wi={transitional:ri,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,i=Ut.isObject(e);if(i&&Ut.isHTMLForm(e)&&(e=new FormData(e)),Ut.isFormData(e))return o?JSON.stringify(bi(e)):e;if(Ut.isArrayBuffer(e)||Ut.isBuffer(e)||Ut.isStream(e)||Ut.isFile(e)||Ut.isBlob(e)||Ut.isReadableStream(e))return e;if(Ut.isArrayBufferView(e))return e.buffer;if(Ut.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){const t=yi(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ei(e,new gi.classes.URLSearchParams,{visitor:function(e,t,n,o){return gi.isNode&&Ut.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((a=Ut.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=yi(this,"env"),o=n&&n.FormData;return ei(a?{"files[]":e}:e,o&&new o,t)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Ut.isString(e))try{return(0,JSON.parse)(e),Ut.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=yi(this,"transitional")||wi.transitional,n=t&&t.forcedJSONParsing,o=yi(this,"responseType"),i="json"===o;if(Ut.isResponse(e)||Ut.isReadableStream(e))return e;if(e&&Ut.isString(e)&&(n&&!o||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,yi(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Xt.from(e,Xt.ERR_BAD_RESPONSE,this,null,yi(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gi.classes.FormData,Blob:gi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ut.forEach(["delete","get","head","post","put","patch","query"],e=>{wi.headers[e]={}});var _i=wi;function ki(e,t){const n=this||_i,o=t||n,i=Kt.from(o.headers);let a=o.data;return Ut.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Si(e){return!(!e||!e.__CANCEL__)}var ji=class extends Xt{constructor(e,t,n){super(null==e?"canceled":e,Xt.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ti(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new Xt("Request failed with status code "+n.status,n.status>=400&&n.status<500?Xt.ERR_BAD_REQUEST:Xt.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Ei=/^https?:(?!\/\/)/i,$i=/[\t\n\r]/g;function Oi(e,t){if("string"==typeof e){const n=function(e){return function(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace($i,"")}(e);if(Ei.test(n))throw new Xt(`Invalid URL ${JSON.stringify(function(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Yt}@`),n=t.indexOf("#"),o=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Yt}`);return-1===n?o:`${o}#${i=t.slice(n+1),i?i.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${Yt}`):i}`;var i}(n))}: missing "//" after protocol`,Xt.ERR_INVALID_URL,t)}}function Ri(e,t,n,o){Oi(t,o);let i=!function(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(i||!1===n)?(Oi(e,o),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}var Ai={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Ci(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var Ni=1e3,Pi=60*Ni,Ii=60*Pi,Ui=24*Ii,zi=7*Ui,Li=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return n*zi;case"days":case"day":case"d":return n*Ui;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Ii;case"minutes":case"minute":case"mins":case"min":case"m":return n*Pi;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ni;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=Ui?Fi(e,t,Ui,"day"):t>=Ii?Fi(e,t,Ii,"hour"):t>=Pi?Fi(e,t,Pi,"minute"):t>=Ni?Fi(e,t,Ni,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=Ui?Math.round(e/Ui)+"d":t>=Ii?Math.round(e/Ii)+"h":t>=Pi?Math.round(e/Pi)+"m":t>=Ni?Math.round(e/Ni)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Fi(e,t,n,o){var i=t>=1.5*n;return Math.round(e/n)+" "+o+(i?"s":"")}var Di=function(e){function t(e){let o,i,a,s=null;function r(...e){if(!r.enabled)return;const n=r,i=Number(new Date);n.diff=i-(o||i),n.prev=o,n.curr=i,o=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(o,i)=>{if("%%"===o)return"%";a++;const s=t.formatters[i];return"function"==typeof s&&(o=s.call(n,e[a]),e.splice(a,1),a--),o}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return r.namespace=e,r.useColors=t.useColors(),r.color=t.selectColor(e),r.extend=n,r.destroy=t.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,a=t.enabled(e)),a),set:e=>{s=e}}),"function"==typeof t.init&&t.init(r),r}function n(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length;for(n=0;n<i;n++)o[n]&&("-"===(e=o[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,o;for(n=0,o=t.skips.length;n<o;n++)if(t.skips[n].test(e))return!1;for(n=0,o=t.names.length;n<o;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Li,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},qi=rn(function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Di(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),Bi=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",o=t.indexOf(n+e),i=t.indexOf("--");return-1!==o&&(-1===i||o<i)};const{env:Mi}=process;let Wi;function Gi(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Hi(e,t){if(0===Wi)return 0;if(Bi("color=16m")||Bi("color=full")||Bi("color=truecolor"))return 3;if(Bi("color=256"))return 2;if(e&&!t&&void 0===Wi)return 0;const n=Wi||0;if("dumb"===Mi.TERM)return n;if("win32"===process.platform){const e=ie.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in Mi)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in Mi)||"codeship"===Mi.CI_NAME?1:n;if("TEAMCITY_VERSION"in Mi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Mi.TEAMCITY_VERSION)?1:0;if("truecolor"===Mi.COLORTERM)return 3;if("TERM_PROGRAM"in Mi){const e=parseInt((Mi.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Mi.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Mi.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Mi.TERM)||"COLORTERM"in Mi?1:n}Bi("no-color")||Bi("no-colors")||Bi("color=false")||Bi("color=never")?Wi=0:(Bi("color")||Bi("colors")||Bi("color=true")||Bi("color=always"))&&(Wi=1),"FORCE_COLOR"in Mi&&(Wi="true"===Mi.FORCE_COLOR?1:"false"===Mi.FORCE_COLOR?0:0===Mi.FORCE_COLOR.length?1:Math.min(parseInt(Mi.FORCE_COLOR,10),3));var Ji={supportsColor:function(e){return Gi(Hi(e,e&&e.isTTY))},stdout:Gi(Hi(!0,oe.isatty(1))),stderr:Gi(Hi(!0,oe.isatty(2)))},Vi=rn(function(e,t){t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let o=0;o<n.length;o++)e.inspectOpts[n[o]]=t.inspectOpts[n[o]]},t.log=function(...e){return process.stderr.write(H.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:o,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),a=` ${i};1m${o} `;n[0]=a+n[0].split("\n").join("\n"+a),n.push(i+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+o+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):oe.isatty(process.stderr.fd)},t.destroy=H.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{Ji&&(Ji.stderr||Ji).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let o=process.env[t];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),e[n]=o,e},{}),e.exports=Di(t);const{formatters:n}=e.exports;n.o=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},n.O=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts)}}),Ki=rn(function(e){e.exports="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?qi:Vi}),Yi=/*#__PURE__*/Object.defineProperty({default:function(e){return function(t,n){return new Promise((o,i)=>{e.call(this,t,n,(e,t)=>{e?i(e):o(t)})})}}},"__esModule",{value:!0}),Zi=sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Xi=Zi(Ki),Qi=Zi(Yi),ea=Xi.default("agent-base");function ta(){const{stack:e}=new Error;return"string"==typeof e&&e.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}function na(e,t){return new na.Agent(e,t)}!function(e){e.Agent=class extends re.EventEmitter{constructor(e,t){super();let n=t;"function"==typeof e?this.callback=e:e&&(n=e),this.timeout=null,n&&"number"==typeof n.timeout&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=Infinity,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:ta()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:ta()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,t,n){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){const n=Object.assign({},t);"boolean"!=typeof n.secureEndpoint&&(n.secureEndpoint=ta()),null==n.host&&(n.host="localhost"),null==n.port&&(n.port=n.secureEndpoint?443:80),null==n.protocol&&(n.protocol=n.secureEndpoint?"https:":"http:"),n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,e._last=!0,e.shouldKeepAlive=!1;let o=!1,i=null;const a=n.timeout||this.timeout,s=t=>{e._hadError||(e.emit("error",t),e._hadError=!0)},r=()=>{i=null,o=!0;const e=new Error(`A "socket" was not created for HTTP request before ${a}ms`);e.code="ETIMEOUT",s(e)},c=e=>{o||(null!==i&&(clearTimeout(i),i=null),s(e))},l=t=>{if(o)return;if(null!=i&&(clearTimeout(i),i=null),a=t,Boolean(a)&&"function"==typeof a.addRequest)return ea("Callback returned another Agent instance %o",t.constructor.name),void t.addRequest(e,n);var a;if(t)return t.once("free",()=>{this.freeSocket(t,n)}),void e.onSocket(t);const r=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);s(r)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(ea("Converting legacy callback function to promise"),this.promisifiedCallback=Qi.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof a&&a>0&&(i=setTimeout(r,a)),"port"in n&&"number"!=typeof n.port&&(n.port=Number(n.port));try{ea("Resolving socket for %o request: %o",n.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,n)).then(l,c)}catch(e){Promise.reject(e).catch(c)}}else s(new Error("`callback` is not defined"))}freeSocket(e,t){ea("Freeing socket %o %o",e.constructor.name,t),e.destroy()}destroy(){ea("Destroying agent %o",this.constructor.name)}},e.prototype=e.Agent.prototype}(na||(na={}));var oa=na;const ia=(sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ki).default("https-proxy-agent:parse-proxy-response");var aa=/*#__PURE__*/Object.defineProperty({default:function(e){return new Promise((t,n)=>{let o=0;const i=[];function a(){const n=e.read();n?function(e){i.push(e),o+=e.length;const n=Buffer.concat(i,o);if(-1===n.indexOf("\r\n\r\n"))return ia("have not received end of HTTP headers yet..."),void a();const s=n.toString("ascii",0,n.indexOf("\r\n")),r=+s.split(" ")[1];ia("got proxy server response: %o",s),t({statusCode:r,buffered:n})}(n):e.once("readable",a)}function s(e){ia("onclose had error %o",e)}function r(){ia("onend")}e.on("error",function t(o){e.removeListener("end",r),e.removeListener("error",t),e.removeListener("close",s),e.removeListener("readable",a),ia("onerror %o",o),n(o)}),e.on("close",s),e.on("end",r),a()})}},"__esModule",{value:!0}),sa=sn&&sn.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function r(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,r)}c((o=o.apply(e,t||[])).next())})},ra=sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const ca=ra(ee),la=ra(te),pa=ra(Z),ua=ra(ne),da=ra(Ki),ma=ra(aa),fa=da.default("https-proxy-agent:agent");function ha(e){e.resume()}const ga=(sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(/*#__PURE__*/Object.defineProperty({default:class extends oa.Agent{constructor(e){let t;if(t="string"==typeof e?pa.default.parse(e):e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");fa("creating new HttpsProxyAgent instance: %o",t),super(t);const n=Object.assign({},t);var o;this.secureProxy=t.secureProxy||"string"==typeof(o=n.protocol)&&/^https:?$/i.test(o),n.host=n.hostname||n.host,"string"==typeof n.port&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(e,t){return sa(this,void 0,void 0,function*(){const{proxy:n,secureProxy:o}=this;let i;o?(fa("Creating `tls.Socket`: %o",n),i=la.default.connect(n)):(fa("Creating `net.Socket`: %o",n),i=ca.default.connect(n));const a=Object.assign({},n.headers);let s=`CONNECT ${t.host}:${t.port} HTTP/1.1\r\n`;n.auth&&(a["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:r,port:c,secureEndpoint:l}=t;(function(e,t){return Boolean(!t&&80===e||t&&443===e)})(c,l)||(r+=`:${c}`),a.Host=r,a.Connection="close";for(const e of Object.keys(a))s+=`${e}: ${a[e]}\r\n`;const p=ma.default(i);i.write(`${s}\r\n`);const{statusCode:u,buffered:d}=yield p;if(200===u){if(e.once("socket",ha),t.secureEndpoint){fa("Upgrading socket connection to TLS");const e=t.servername||t.host;return la.default.connect(Object.assign(Object.assign({},function(e,...t){const n={};let o;for(o in e)t.includes(o)||(n[o]=e[o]);return n}(t,"host","hostname","path","port")),{socket:i,servername:e}))}return i}i.destroy();const m=new ca.default.Socket({writable:!1});return m.readable=!0,e.once("socket",e=>{fa("replaying proxy buffer for failed request"),ua.default(e.listenerCount("data")>0),e.push(d),e.push(null)}),m})}}},"__esModule",{value:!0}));function va(e){return new ga.default(e)}!function(e){e.HttpsProxyAgent=ga.default,e.prototype=ga.default.prototype}(va||(va={}));var xa,ba,ya,wa,_a=va,ka=function(){if(!xa){try{xa=Ki("follow-redirects")}catch(e){}"function"!=typeof xa&&(xa=function(){})}xa.apply(null,arguments)},Sa=Z.URL,ja=J.Writable;ba="undefined"!=typeof process,ya="undefined"!=typeof window&&"undefined"!=typeof document,wa=Ja(Error.captureStackTrace),ba||!ya&&wa||console.warn("The follow-redirects package should be excluded from browser builds.");var Ta=!1;try{ne(new Sa(""))}catch(e){Ta="ERR_INVALID_URL"===e.code}var Ea=["Authorization","Proxy-Authorization","Cookie"],$a=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Oa=["abort","aborted","connect","error","socket","timeout"],Ra=Object.create(null);Oa.forEach(function(e){Ra[e]=function(t,n,o){this._redirectable.emit(e,t,n,o)}});var Aa=Wa("ERR_INVALID_URL","Invalid URL",TypeError),Ca=Wa("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Na=Wa("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Ca),Pa=Wa("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Ia=Wa("ERR_STREAM_WRITE_AFTER_END","write after end"),Ua=ja.prototype.destroy||Fa;function za(e,t){ja.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){try{n._processResponse(e)}catch(e){n.emit("error",e instanceof Ca?e:new Ca({cause:e}))}},this._headerFilter=new RegExp("^(?:"+Ea.concat(e.sensitiveHeaders).map(Va).join("|")+")$","i"),this._performRequest()}function La(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach(function(o){var i=o+":",a=n[i]=e[o],s=t[o]=Object.create(a);Object.defineProperties(s,{request:{value:function(e,o,a){return Sa&&e instanceof Sa?e=Ba(e):Ha(e)?e=Ba(Da(e)):(a=o,o=qa(e),e={protocol:i}),Ja(o)&&(a=o,o=null),(o=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,o)).nativeProtocols=n,Ha(o.host)||Ha(o.hostname)||(o.hostname="::1"),ne.equal(o.protocol,i,"protocol mismatch"),ka("options",o),new za(o,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var o=s.request(e,t,n);return o.end(),o},configurable:!0,enumerable:!0,writable:!0}})}),t}function Fa(){}function Da(e){var t;if(Ta)t=new Sa(e);else if(!Ha((t=qa(Z.parse(e))).protocol))throw new Aa({input:e});return t}function qa(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Aa({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Aa({input:e.href||e});return e}function Ba(e,t){var n=t||{};for(var o of $a)n[o]=e[o];return n.hostname.startsWith("[")&&(n.hostname=n.hostname.slice(1,-1)),""!==n.port&&(n.port=Number(n.port)),n.path=n.search?n.pathname+n.search:n.pathname,n}function Ma(e,t){var n;for(var o in t)e.test(o)&&(n=t[o],delete t[o]);return null==n?void 0:String(n).trim()}function Wa(e,t,n){function o(n){Ja(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return o.prototype=new(n||Error),Object.defineProperties(o.prototype,{constructor:{value:o,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),o}function Ga(e,t){for(var n of Oa)e.removeListener(n,Ra[n]);e.on("error",Fa),e.destroy(t)}function Ha(e){return"string"==typeof e||e instanceof String}function Ja(e){return"function"==typeof e}function Va(e){return e.replace(/[\]\\/()*+?.$]/g,"\\$&")}(za.prototype=Object.create(ja.prototype)).abort=function(){Ga(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},za.prototype.destroy=function(e){return Ga(this._currentRequest,e),Ua.call(this,e),this},za.prototype.write=function(e,t,n){if(this._ending)throw new Ia;if(!(Ha(e)||"object"==typeof(o=e)&&"length"in o))throw new TypeError("data should be a string, Buffer or Uint8Array");var o;Ja(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new Pa),this.abort()):n&&n()},za.prototype.end=function(e,t,n){if(Ja(e)?(n=e,e=t=null):Ja(t)&&(n=t,t=null),e){var o=this,i=this._currentRequest;this.write(e,t,function(){o._ended=!0,i.end(null,null,n)}),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},za.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},za.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},za.prototype.setTimeout=function(e,t){var n=this;function o(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function i(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout(function(){n.emit("timeout"),a()},e),o(t)}function a(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",a),n.removeListener("error",a),n.removeListener("response",a),n.removeListener("close",a),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",o),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){za.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(za.prototype,e,{get:function(){return this._currentRequest[e]}})}),za.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.sensitiveHeaders instanceof Array||(e.sensitiveHeaders=[]),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},za.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var o=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var i of(o._redirectable=this,Oa))o.on(i,Ra[i]);if(this._currentUrl=/^\//.test(this._options.path)?Z.format(this._options):this._options.path,this._isRedirect){var a=0,s=this,r=this._requestBodyBuffers;!function e(t){if(o===s._currentRequest)if(t)s.emit("error",t);else if(a<r.length){var n=r[a++];o.finished||o.write(n.data,n.encoding,e)}else s._ended&&o.end()}()}},za.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n,o=e.headers.location;if(!o||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Ga(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Na;var i=this._options.beforeRedirect;i&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var a=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Ma(/^content-/i,this._options.headers));var s=Ma(/^host$/i,this._options.headers),r=Da(this._currentUrl),c=s||r.host,l=/^\w+:/.test(o)?this._currentUrl:Z.format(Object.assign(r,{host:c})),p=function(e,t){return Ta?new Sa(e,t):Da(Z.resolve(t,e))}(o,l);ka("redirecting to",p.href),this._isRedirect=!0,Ba(p,this._options),(p.protocol!==r.protocol&&"https:"!==p.protocol||p.host!==c&&!function(e,t){ne(Ha(e)&&Ha(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(p.host,c))&&Ma(this._headerFilter,this._options.headers),Ja(i)&&(i(this._options,{headers:e.headers,statusCode:t},{url:l,method:a,headers:n}),this._sanitizeOptions(this._options)),this._performRequest()};var Ka=La({http:K,https:Y});Ka.wrap=La;const Ya="1.19.0";function Za(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Xa=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/,Qa=["content-type","content-length"];function es(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{Qa.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}const ts=Symbol("internals");var ns=class extends J.Transform{constructor(e){super({readableHighWaterMark:(e=Ut.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(e,t)=>!Ut.isUndefined(t[e]))).chunkSize});const t=this[ts]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",e=>{"progress"===e&&(t.isCaptured||(t.isCaptured=!0))})}_read(e){const t=this[ts];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const o=this[ts],i=o.maxRate,a=this.readableHighWaterMark,s=o.timeWindow,r=i/(1e3/s),c=!1!==o.minChunkSize?Math.max(o.minChunkSize,.01*r):0,l=(e,t)=>{const n=Buffer.byteLength(e);o.bytesSeen+=n,o.bytes+=n,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(e)?process.nextTick(t):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(t)}},p=(e,t)=>{const n=Buffer.byteLength(e);let p,u=null,d=a,m=0;if(i){const e=Date.now();(!o.ts||(m=e-o.ts)>=s)&&(o.ts=e,p=r-o.bytes,o.bytes=p<0?-p:0,m=0),p=r-o.bytes}if(i){if(p<=0)return setTimeout(()=>{t(null,e)},s-m);p<d&&(d=p)}d&&n>d&&n-d>c&&(u=e.subarray(d),e=e.subarray(0,d)),l(e,u?()=>{process.nextTick(t,null,u)}:t)};p(e,function e(t,o){if(t)return n(t);o?p(o,e):n(null)})}};const{asyncIterator:os}=Symbol;var is=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[os]?yield*e[os]():yield e};const as=gi.ALPHABET.ALPHA_DIGIT+"-_",ss="function"==typeof TextEncoder?new TextEncoder:new H.TextEncoder,rs="\r\n",cs=ss.encode(rs);class ls{constructor(e,t){const{escapeName:n}=this.constructor,o=Ut.isString(t);let i=`Content-Disposition: form-data; name="${n(e)}"${!o&&t.name?`; filename="${n(t.name)}"`:""}${rs}`;o?t=ss.encode(String(t).replace(/\r?\n|\r\n?/g,rs)):i+=`Content-Type: ${String(t.type||"application/octet-stream").replace(/[\r\n]/g,"")}${rs}`,this.headers=ss.encode(i+rs),this.contentLength=o?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=t}async*encode(){yield this.headers;const{value:e}=this;Ut.isTypedArray(e)?yield e:yield*is(e),yield cs}static escapeName(e){return String(e).replace(/[\r\n"]/g,e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e]))}}var ps=class extends J.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,t)}this.__transform(e,t,n)}},us=(e,t)=>Ut.isAsyncFn(e)?function(...n){const o=n.pop();e.apply(this,n).then(e=>{try{t?o(null,...t(e)):o(null,e)}catch(e){o(e)}},o)}:e;const ds=new Set(["localhost","0.0.0.0"]),ms=e=>{const t=e.split(".");return 4===t.length&&"127"===t[0]&&t.every(e=>/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255)},fs=e=>{if(/^0[xX][0-9a-fA-F]+$/.test(e)){const t=parseInt(e.slice(2),16);return Number.isFinite(t)?t:null}if(e.length>1&&/^0[0-7]+$/.test(e)){const t=parseInt(e,8);return Number.isFinite(t)?t:null}if(e.length>1&&/^0[0-9]+$/.test(e))return null;if(/^[0-9]+$/.test(e)){const t=parseInt(e,10);return Number.isFinite(t)?t:null}return null},hs=e=>/^0{1,4}$/.test(e),gs=e=>!!e&&(!!ds.has(e)||!!ms(e)||!!(e=>{if("::"===e)return!0;const t=e.indexOf("::");if(-1!==t){if(t!==e.lastIndexOf("::"))return!1;const n=e.slice(0,t),o=e.slice(t+2),i=n?n.split(":"):[],a=o?o.split(":"):[];return i.length+a.length<8&&i.every(hs)&&a.every(hs)}const n=e.split(":");return 8===n.length&&n.every(hs)})(e)||(e=>{if("::1"===e)return!0;const t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return ms(t[1]);const n=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(n){const e=parseInt(n[1],16);return e>=32512&&e<=32767}const o=e.split(":");if(8===o.length){for(let e=0;e<7;e++)if(!/^0+$/.test(o[e]))return!1;return/^0*1$/.test(o[7])}return!1})(e)),vs={http:80,https:443,ws:80,wss:443,ftp:21},xs=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,bs=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,ys=e=>{if(!e)return e;"["===e.charAt(0)&&"]"===e.charAt(e.length-1)&&(e=e.slice(1,-1));const t=e.replace(/\.+$/,""),n=(e=>{if("string"!=typeof e||!e||-1!==e.indexOf(":"))return e;let t=e;if("["===t.charAt(0)&&"]"===t.charAt(t.length-1)&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return e;const n=t.split(".");if(n.some(e=>""===e))return e;if(4===n.length){const t=n.map(fs);return t.some(e=>null===e||e<0||e>255)?e:t.join(".")}if(n.length>4)return e;if(1===n.length)return e;const o=n.slice(0,-1),i=4-o.length,a=fs(n[n.length-1]);if(null===a)return e;if(a<0||a>(1<<8*i)-1)return e;const s=new Array(i).fill(0);for(let e=i-1,t=a;e>=0;e--,t>>=8)s[e]=255&t;const r=o.map(fs);return r.some(e=>null===e||e<0||e>255)?e:[...r,...s].join(".")})(t);return n!==t?n:(e=>{if("string"!=typeof e||-1===e.indexOf(":"))return e;const t=e.match(xs);if(t)return t[1];const n=e.match(bs);if(n){const e=parseInt(n[1],16),t=parseInt(n[2],16);return`${e>>8}.${255&e}.${t>>8}.${255&t}`}return e})(t)},ws=(e,t,n=3)=>{let o=0;const i=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let i,a=0,s=0;return t=void 0!==t?t:1e3,function(r){const c=Date.now(),l=o[s];i||(i=c),n[a]=r,o[a]=c;let p=s,u=0;for(;p!==a;)u+=n[p++],p%=e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),c-i<t)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(n,a){let s,r,c=0,l=1e3/a;const p=(n,a=Date.now())=>{c=a,s=null,r&&(clearTimeout(r),r=null),(n=>{if(!n||"number"!=typeof n.loaded)return;const a=n.loaded,s=n.lengthComputable?n.total:void 0,r=Math.max(0,null!=s?Math.min(a,s):a),c=Math.max(0,r-o),l=i(c);o=Math.max(o,r),e({loaded:r,total:s,progress:s?r/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s?(s-r)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-c;n>=l?p(e,t):(s=e,r||(r=setTimeout(()=>{r=null,p(s)},l-n)))},()=>s&&p(s)]}(0,n)},_s=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},ks=(e,t=Ut.asap)=>(...n)=>t(()=>e(...n)),Ss=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,js=(e,t,n)=>t+2<n&&Ss(e.charCodeAt(t+1))&&Ss(e.charCodeAt(t+2)),Ts=e=>e<=57?e-48:(223&e)-55,Es=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,$s=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Os=e=>{const t=e.length;let n=0,o=0,i=!1;for(let s=0;s<t;s++){let r=e.charCodeAt(s);37===r&&js(e,s,t)&&(r=16*Ts(e.charCodeAt(s+1))+Ts(e.charCodeAt(s+2)),s+=2),9!==(a=r)&&10!==a&&12!==a&&13!==a&&32!==a&&(61!==r?!Es(r)||o>0?i=!0:n++:o++)}var a;return i||o>2||o>0&&(n+o)%4!=0||n%4==1?$s(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Rs=(e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const o=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(o))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&js(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a},As={flush:pe.constants.Z_SYNC_FLUSH,finishFlush:pe.constants.Z_SYNC_FLUSH},Cs={flush:pe.constants.BROTLI_OPERATION_FLUSH,finishFlush:pe.constants.BROTLI_OPERATION_FLUSH},Ns={flush:pe.constants.ZSTD_e_flush,finishFlush:pe.constants.ZSTD_e_flush},Ps=Ut.isFunction(pe.createBrotliDecompress),Is=Ut.isFunction(pe.createZstdDecompress),Us="gzip, compress, deflate"+(Ps?", br":""),zs=Us+(Is?", zstd":""),Ls="undefined"!=typeof process&&process.nextTick?process.nextTick.bind(process):Ut.asap,{http:Fs,https:Ds}=Ka,qs=/https:?/,Bs=Symbol("axios.http.socketListener"),Ms=Symbol("axios.http.currentReq"),Ws=Symbol("axios.http.installedTunnel"),Gs=new Map,Hs=new WeakMap,Js={22:21,24:5},Vs=gi.protocols.map(e=>e+":"),Ks=e=>{if(!Ut.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Ys=(e,[t,n])=>(e.on("end",n).on("error",n),t),Zs=new class{constructor(){this.sessions=Object.create(null)}getSession(e,t){t=Object.assign({sessionTimeout:1e3},t);let n=this.sessions[e];if(n){let e=n.length;for(let o=0;o<e;o++){const[e,i]=n[o];if(!e.destroyed&&!e.closed&&H.isDeepStrictEqual(i,t))return e}}const o=le.connect(e,t);let i,a;const s=()=>{if(i)return;i=!0,a&&(clearTimeout(a),a=null);let t=n,s=t.length,r=s;for(;r--;)if(t[r][0]===o)return 1===s?delete this.sessions[e]:t.splice(r,1),void(o.closed||o.close())},r=o.request,{sessionTimeout:c}=t;if(null!=c){let e=0;o.request=function(){const t=r.apply(this,arguments);return e++,a&&(clearTimeout(a),a=null),t.once("close",()=>{--e||(a=setTimeout(()=>{a=null,s()},c))}),t}}o.once("close",s);let l=[o,t];return n?n.push(l):n=this.sessions[e]=[l],o}};function Xs(e,t,n){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.auth&&e.beforeRedirects.auth(e),e.beforeRedirects.sensitiveHeaders&&e.beforeRedirects.sensitiveHeaders(e,n),e.beforeRedirects.config&&e.beforeRedirects.config(e,t,n)}function Qs(e,t,n,o,i,a){let s=t;const r=function(e,t,n){return qs.test(e.protocol)?n||Y.globalAgent:t||K.globalAgent}(e,a,i);if(!s&&!1!==s&&!function(e,t=process.versions&&process.versions.node){if(!function(e=process.versions&&process.versions.node){if(!e)return!1;const[t,n]=e.split(".").map(e=>Number(e));return!(!Number.isInteger(t)||!Number.isInteger(n))&&(t>24||null!=Js[t]&&n>=Js[t])}(t))return!1;const n=e&&e.options;return Boolean(n&&Ut.hasOwnProp(n,"proxyEnv")&&null!=n.proxyEnv)}(r)){const e=function(e){var t=("string"==typeof e?function(e){try{return new URL(e)}catch{return null}}(e):e)||{},n=t.protocol,o=t.host,i=t.port;if("string"!=typeof o||!o||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=Ci("no_proxy").toLowerCase();return!n||"*"!==n&&n.split(/[,\s]/).every(function(n){if(!n)return!0;var o=n.match(/^(.+):(\d+)$/),i=o?o[1]:n,a=o?parseInt(o[2]):0;return!(!a||a===t)||(/^[.*]/.test(i)?("*"===i.charAt(0)&&(i=i.slice(1)),!e.endsWith(i)):e!==i)})}(o=o.replace(/:\d*$/,""),i=parseInt(i)||Ai[n]||0))return"";var a=Ci(n+"_proxy")||Ci("all_proxy");return a&&-1===a.indexOf("://")&&(a=n+"://"+a),a}(n);e&&(function(e){let t;try{t=new URL(e)}catch(e){return!1}const n=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!n)return!1;if("*"===n)return!0;const o=Number.parseInt(t.port,10)||vs[t.protocol.split(":",1)[0]]||0,i=ys(t.hostname.toLowerCase());return n.split(/[\s,]+/).some(e=>{if(!e)return!1;if("*"===e)return!0;let[t,n]=(e=>{let t=e,n=0;if("["===t.charAt(0)){const e=t.indexOf("]");if(-1!==e){const o=t.slice(1,e),i=t.slice(e+1);return":"===i.charAt(0)&&/^\d+$/.test(i.slice(1))&&(n=Number.parseInt(i.slice(1),10)),[o,n]}}const o=t.indexOf(":"),i=t.lastIndexOf(":");return-1!==o&&o===i&&/^\d+$/.test(t.slice(i+1))&&(n=Number.parseInt(t.slice(i+1),10),t=t.slice(0,i)),[t,n]})(e);return t=ys(t),!!t&&(!n||n===o)&&("*"===t.charAt(0)&&(t=t.slice(1)),"."===t.charAt(0)?i.endsWith(t):i===t||gs(i)&&gs(t))})}(n)||(s=new URL(e)))}if(o&&e.headers)for(const t of Object.keys(e.headers))"proxy-authorization"===t.toLowerCase()&&delete e.headers[t];if(o&&e.agent&&e.agent[Ws]&&(e.agent=void 0),s){const t=s instanceof URL,o=e=>t||Ut.hasOwnProp(s,e)?s[e]:void 0,a=o("username"),r=o("password");let c=Ut.hasOwnProp(s,"auth")?s.auth:void 0;if(a&&(c=(a||"")+":"+(r||"")),c){const e="object"==typeof c,t=e&&Ut.hasOwnProp(c,"username")?c.username:void 0,n=e&&Ut.hasOwnProp(c,"password")?c.password:void 0;if(Boolean(t||n))c=(t||"")+":"+(n||"");else if(e)throw new Xt("Invalid proxy authorization",Xt.ERR_BAD_OPTION,{proxy:s})}if(qs.test(e.protocol)){if(!(i instanceof _a)){const t=o("hostname")||o("host"),n=o("port"),a=o("protocol"),s=a?a.includes(":")?a:`${a}:`:"http:",r=t&&t.includes(":")&&!t.startsWith("[")?`[${t}]`:t,l=new URL(`${s}//${r}${n?":"+n:""}`),p={protocol:l.protocol,hostname:l.hostname.replace(/^\[|\]$/g,""),port:l.port,auth:c&&"string"==typeof c?c:void 0};"https:"===l.protocol&&(p.ALPNProtocols=["http/1.1"]);const u=function(e,t){const n=e.protocol+"//"+e.hostname+":"+(e.port||"")+"#"+(e.auth||""),o=t?Hs.get(t)||Hs.set(t,new Map).get(t):Gs;let i=o.get(n);if(i)return i;const a=t&&t.options?{...t.options,...e}:e;if(i=new _a(a),t&&t.options){const e={...t.options},n=i.callback;i.callback=function(t,o){return n.call(this,t,{...e,...o})}}return i[Ws]=!0,o.set(n,i),i}(p,i);e.agent=u,e.agents&&(e.agents.https=u)}}else{if(c){const t=Buffer.from(c,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}let t=!1;for(const n of Object.keys(e.headers))if("host"===n.toLowerCase()){t=!0;break}t||(e.headers.host=e.hostname+(e.port?":"+e.port:""));const i=o("hostname")||o("host");e.hostname=i,e.host=i,e.port=o("port"),e.path=n;const a=o("protocol");a&&(e.protocol=a.includes(":")?a:`${a}:`)}}e.beforeRedirects.proxy=function(e){Qs(e,t,e.href,!0,i,a)}}const er="undefined"!=typeof process&&"process"===Ut.kindOf(process),tr=(e,t)=>(({address:e,family:t})=>{if(!Ut.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}})(Ut.isObject(e)?e:{address:e,family:t}),nr={request(e,t){const n=e.protocol+"//"+e.hostname+":"+(e.port||("https:"===e.protocol?443:80)),{http2Options:o,headers:i}=e,a=Zs.getSession(n,o),{HTTP2_HEADER_SCHEME:s,HTTP2_HEADER_METHOD:r,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:l}=le.constants,p={[s]:e.protocol.replace(":",""),[r]:e.method,[c]:e.path};Ut.forEach(i,(e,t)=>{":"!==t.charAt(0)&&(p[t]=e)});const u=a.request(p);return u.once("response",e=>{const n=u,o=(e=Object.assign({},e))[l];delete e[l],n.headers=e,n.statusCode=+o,t(n)}),u}};var or,ir,ar=er&&function(e){return t=async function(t,n,o){const i=t=>Ut.getSafeProp(e,t),a=i("transitional")||ri;let s=i("data"),r=i("lookup"),c=i("family"),l=i("httpVersion");void 0===l&&(l=1);let p=i("http2Options");const u=i("httpAgent"),d=i("httpsAgent"),m=i("proxy"),f=i("responseType"),h=i("responseEncoding"),g=i("socketPath"),v=i("method").toUpperCase(),x=i("maxRedirects"),y=i("maxBodyLength"),w=i("maxContentLength"),_=i("decompress");let k,S,j,T=!1;if(l=+l,Number.isNaN(l))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(1!==l&&2!==l)throw TypeError(`Unsupported protocol version '${l}'`);const E=2===l;if(r){const e=us(r,e=>Ut.isArray(e)?e:[e]);r=(t,n,o)=>{e(t,n,(e,t,i)=>{if(e)return o(e);const a=Ut.isArray(t)?t.map(e=>tr(e)):[tr(t,i)];n.all?o(e,a):o(e,a[0].address,a[0].family)})}}const $=new ce;function O(t){try{$.emit("abort",!t||t.type?new ji(null,e,S):t)}catch(e){}}function R(){j&&(clearTimeout(j),j=null)}$.once("abort",n);const A=()=>{R(),e.cancelToken&&e.cancelToken.unsubscribe(O),e.signal&&e.signal.removeEventListener("abort",O),$.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(O),e.signal&&(e.signal.aborted?O():e.signal.addEventListener("abort",O))),o((e,t)=>{if(k=!0,R(),t)return T=!0,void A();const{data:n}=e;if(n instanceof J.Readable||n instanceof J.Duplex){const e=J.finished(n,()=>{e(),A()})}else A()});const C=Ri(i("baseURL"),i("url"),i("allowAbsoluteUrls"),e),N=new URL(C,g?"http://localhost":gi.hasBrowserEnv?gi.origin:void 0),P=N.protocol||Vs[0];if("data:"===P){if(w>-1){const t=function(e){return Rs(e,$s)}(String(i("url")||C||""));if(t>w)return n(new Xt("maxContentLength size of "+w+" exceeded",Xt.ERR_BAD_RESPONSE,e))}let o;if("GET"!==v)return Ti(t,n,{status:405,statusText:"method not allowed",headers:{},config:e});try{o=function(e,t,n){const o=n&&n.Blob||gi.classes.Blob,i=Za(e);if(void 0===t&&o&&(t=!0),"data"===i){e=i.length?e.slice(i.length+1):e;const n=Xa.exec(e);if(!n)throw new Xt("Invalid URL",Xt.ERR_INVALID_URL);const a=n[1],s=n[2],r=n[3]?"base64":"utf8",c=n[4];let l="";a?l=s?a+s:a:s&&(l="text/plain"+s);const p="base64"===r?Buffer.from(c,"base64"):Buffer.from(decodeURIComponent(c),r);if(t){if(!o)throw new Xt("Blob is not supported",Xt.ERR_NOT_SUPPORT);return new o([p],{type:l})}return p}throw new Xt("Unsupported protocol "+i,Xt.ERR_NOT_SUPPORT)}(i("url"),"blob"===f,{Blob:e.env&&e.env.Blob})}catch(t){throw Xt.from(t,Xt.ERR_BAD_REQUEST,e)}return"text"===f?(o=o.toString(h),h&&"utf8"!==h||(o=Ut.stripBOM(o))):"stream"===f&&(o=J.Readable.from(o)),Ti(t,n,{data:o,status:200,statusText:"OK",headers:new Kt,config:e})}if(-1===Vs.indexOf(P))return n(new Xt("Unsupported protocol "+P,Xt.ERR_BAD_REQUEST,e));const I=Kt.from(e.headers).normalize();I.set("User-Agent","axios/"+Ya,!1);const{onUploadProgress:U,onDownloadProgress:z}=e,L=e.maxRate;let F,D;if(Ut.isSpecCompliantForm(s)){const e=I.getContentType(/boundary=([-_\w\d]{10,70})/i);s=((e,t,n)=>{const{tag:o="form-data-boundary",size:i=25,boundary:a=o+"-"+gi.generateString(i,as)}=n||{};if(!Ut.isFormData(e))throw new TypeError("FormData instance required");if(a.length<1||a.length>70)throw new Error("boundary must be 1-70 characters long");const s=ss.encode("--"+a+rs),r=ss.encode("--"+a+"--"+rs);let c=r.byteLength;const l=Array.from(e.entries()).map(([e,t])=>{const n=new ls(e,t);return c+=n.size,n});c+=s.byteLength*l.length,c=Ut.toFiniteNumber(c);const p={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(p["Content-Length"]=c),t&&t(p),V.from(async function*(){for(const e of l)yield s,yield*e.encode();yield r}())})(s,e=>{I.set(e)},{tag:`axios-${Ya}-boundary`,boundary:e&&e[1]||void 0})}else if(Ut.isFormData(s)&&Ut.isFunction(s.getHeaders)&&s.getHeaders!==Object.prototype.getHeaders){if(es(I,s.getHeaders(),i("formDataHeaderPolicy")),!I.hasContentLength())try{const e=await H.promisify(s.getLength).call(s);Number.isFinite(e)&&e>=0&&I.setContentLength(e)}catch(e){}}else if(Ut.isBlob(s)||Ut.isFile(s))s.size&&I.setContentType(s.type||"application/octet-stream"),I.setContentLength(s.size||0),s=J.Readable.from(is(s));else if(s&&!Ut.isStream(s)){if(Buffer.isBuffer(s));else if(Ut.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else{if(!Ut.isString(s))return n(new Xt("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Xt.ERR_BAD_REQUEST,e));s=Buffer.from(s,"utf-8")}if(I.setContentLength(s.length,!1),y>-1&&s.length>y)return n(new Xt("Request body larger than maxBodyLength limit",Xt.ERR_BAD_REQUEST,e))}const q=Ut.toFiniteNumber(I.getContentLength());let B;Ut.isArray(L)?(F=L[0],D=L[1]):F=D=L,s&&(U||F)&&(Ut.isStream(s)||(s=J.Readable.from(s,{objectMode:!1})),s=J.pipeline([s,new ns({maxRate:Ut.toFiniteNumber(F)})],Ut.noop),U&&s.on("progress",Ys(s,_s(q,ws(ks(U,Ls),!1,3)))));const M=i("auth");let W;M&&(B=(Ut.getSafeProp(M,"username")||"")+":"+(Ut.getSafeProp(M,"password")||"")),B||!N.username&&!N.password||(B=Ks(N.username)+":"+Ks(N.password)),B&&I.delete("authorization");try{W=ai(N.pathname+N.search,i("params"),i("paramsSerializer")).replace(/^\?/,"")}catch(t){return n(Xt.from(t,Xt.ERR_BAD_REQUEST,e,null,null,{url:i("url"),exists:!0}))}I.set("Accept-Encoding",Ut.hasOwnProp(a,"advertiseZstdAcceptEncoding")&&!0===a.advertiseZstdAcceptEncoding?zs:Us,!1);const G=Object.assign(Object.create(null),{path:W,method:v,headers:qt(I),agents:{http:u,https:d},auth:B,protocol:P,family:c,beforeRedirect:Xs,beforeRedirects:Object.create(null),http2Options:p});if(!Ut.isUndefined(r)&&(G.lookup=r),g){if("string"!=typeof g)return n(new Xt("socketPath must be a string",Xt.ERR_BAD_OPTION_VALUE,e));const t=i("allowedSocketPaths");if(null!=t){const o=Array.isArray(t)?t:[t],i=b(g);if(!o.some(e=>"string"==typeof e&&b(e)===i))return n(new Xt(`socketPath "${g}" is not permitted by allowedSocketPaths`,Xt.ERR_BAD_OPTION_VALUE,e))}G.socketPath=g}else G.hostname=N.hostname.startsWith("[")?N.hostname.slice(1,-1):N.hostname,G.port=N.port,Qs(G,m,P+"//"+N.hostname+(N.port?":"+N.port:"")+G.path,!1,d,u);let Z,X=!1,Q=!1;const ee=qs.test(G.protocol);if(null==G.agent&&(G.agent=ee?d:u),E)Z=nr;else{const t=i("transport");if(t)Z=t;else if(0===x)Z=ee?Y:K,X=!0;else{Q=!0,G.sensitiveHeaders=[],x&&(G.maxRedirects=x);const t=i("beforeRedirect");if(t&&(G.beforeRedirects.config=t),B){const e=N.origin,t=B;G.beforeRedirects.auth=function(n){try{new URL(n.href).origin===e&&(n.auth=t)}catch(e){}}}const o=i("sensitiveHeaders");if(null!=o){if(!Ut.isArray(o))return n(new Xt("sensitiveHeaders must be an array of strings",Xt.ERR_BAD_OPTION_VALUE,e));const t=new Set;for(const i of o){if(!Ut.isString(i))return n(new Xt("sensitiveHeaders must be an array of strings",Xt.ERR_BAD_OPTION_VALUE,e));t.add(i.toLowerCase())}t.size&&(G.sensitiveHeaders=Array.from(t),G.beforeRedirects.sensitiveHeaders=function(e,n){(function(e,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(e.href).origin}catch(e){return!1}})(e,n)||function(e,t){e&&Object.keys(e).forEach(n=>{t.has(n.toLowerCase())&&delete e[n]})}(e.headers,t)})}Z=ee?Ds:Fs}}G.maxBodyLength=y>-1?y:Infinity,G.insecureHTTPParser=Boolean(i("insecureHTTPParser")),S=Z.request(G,function(o){if(R(),S.destroyed)return;const i=[o],a=Ut.toFiniteNumber(o.headers["content-length"]);if(z||D){const e=new ns({maxRate:Ut.toFiniteNumber(D)});z&&e.on("progress",Ys(e,_s(a,ws(ks(z,Ls),!0,3)))),i.push(e)}let s=o;const r=o.req||S;if(!1!==_&&o.headers["content-encoding"])switch("HEAD"!==v&&204!==o.statusCode||delete o.headers["content-encoding"],(o.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":i.push(pe.createUnzip(As)),delete o.headers["content-encoding"];break;case"deflate":i.push(new ps),i.push(pe.createUnzip(As)),delete o.headers["content-encoding"];break;case"br":Ps&&(i.push(pe.createBrotliDecompress(Cs)),delete o.headers["content-encoding"]);break;case"zstd":Is&&(i.push(pe.createZstdDecompress(Ns)),delete o.headers["content-encoding"])}s=i.length>1?J.pipeline(i,Ut.noop):i[0];const c={status:o.statusCode,statusText:o.statusMessage,headers:new Kt(o.headers),config:e,request:r};if("stream"===f){if(w>-1){const t=w,n=s;s=J.Readable.from(async function*(){let o=0;for await(const i of n){if(o+=i.length,o>t)throw new Xt("maxContentLength size of "+t+" exceeded",Xt.ERR_BAD_RESPONSE,e,r);yield i}}(),{objectMode:!1})}c.data=s,Ti(t,n,c)}else{const o=[];let i=0;s.on("data",function(t){o.push(t),i+=t.length,w>-1&&i>w&&(T=!0,s.destroy(),O(new Xt("maxContentLength size of "+w+" exceeded",Xt.ERR_BAD_RESPONSE,e,r)))}),s.on("aborted",function(){if(T)return;const t=new Xt("stream has been aborted",Xt.ERR_BAD_RESPONSE,e,r,c);s.destroy(t),n(t)}),s.on("error",function(t){T||n(Xt.from(t,null,e,r,c))}),s.on("end",function(){try{let e=1===o.length?o[0]:Buffer.concat(o);"arraybuffer"!==f&&(e=e.toString(h),h&&"utf8"!==h||(e=Ut.stripBOM(e))),c.data=e}catch(t){return n(Xt.from(t,null,e,c.request,c))}Ti(t,n,c)})}$.once("abort",e=>{s.destroyed||(s.emit("error",e),s.destroy())})}),$.once("abort",e=>{S.close?S.close():S.destroy(e)}),S.on("error",function(t){n(Xt.from(t,null,e,S))});const te=new Set;if(S.on("socket",function(e){"function"==typeof e.setKeepAlive&&e.setKeepAlive(!0,6e4),e[Bs]||(e.on("error",function(t){const n=e[Ms];n&&!n.destroyed&&n.destroy(t)}),e[Bs]=!0),e[Ms]=S,te.add(e)}),S.once("close",function(){R();for(const e of te)e[Ms]===S&&(e[Ms]=null);te.clear()}),i("timeout")){const t=parseInt(i("timeout"),10);if(Number.isNaN(t))return void O(new Xt("error trying to parse `config.timeout` to int",Xt.ERR_BAD_OPTION_VALUE,e,S));const n=function(){k||O(function(){const t=i("timeout");let n=t?"timeout of "+t+"ms exceeded":"timeout exceeded";const o=i("timeoutErrorMessage");return o&&(n=o),new Xt(n,a.clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,e,S)}())};X&&t>0&&(j=setTimeout(n,t)),S.setTimeout(t,n)}else S.setTimeout(0);if(Ut.isStream(s)){let t=!1,n=!1;s.on("end",()=>{t=!0}),s.once("error",e=>{n=!0,S.destroy(e)}),s.on("close",()=>{t||n||O(new ji("Request stream has been aborted",e,S))});let o=s;if(y>-1&&!Q){const t=y;let n=0;o=J.pipeline([s,new J.Transform({transform(o,i,a){if(n+=o.length,n>t)return a(new Xt("Request body larger than maxBodyLength limit",Xt.ERR_BAD_REQUEST,e,S));a(null,o)}})],Ut.noop),o.on("error",e=>{S.destroyed||S.destroy(e)})}o.pipe(S)}else s&&S.write(s),S.end()},new Promise((e,n)=>{let o,i;const a=(e,t)=>{i||(i=!0,o&&o(e,t))},s=e=>{a(e,!0),n(e)};t(t=>{a(t),e(t)},s,e=>o=e).catch(s)});var t},sr=gi.hasStandardBrowserEnv?(or=new URL(gi.origin),ir=gi.navigator&&/(msie|trident)/i.test(gi.navigator.userAgent),e=>(e=new URL(e,gi.origin),or.protocol===e.protocol&&or.host===e.host&&(ir||or.port===e.port))):()=>!0,rr=gi.hasStandardBrowserEnv?{write(e,t,n,o,i,a,s){if("undefined"==typeof document)return;const r=[`${e}=${encodeURIComponent(t)}`];Ut.isNumber(n)&&r.push(`expires=${new Date(n).toUTCString()}`),Ut.isString(o)&&r.push(`path=${o}`),Ut.isString(i)&&r.push(`domain=${i}`),!0===a&&r.push("secure"),Ut.isString(s)&&r.push(`SameSite=${s}`),document.cookie=r.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const o=t[n].replace(/^\s+/,""),i=o.indexOf("=");if(-1!==i&&o.slice(0,i)===e)try{return decodeURIComponent(o.slice(i+1))}catch(e){return o.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const cr=e=>e instanceof Kt?{...e}:e,lr=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function pr(e,t){e=e||{},t=t||{};const n=Object.create(null);function o(e,t,n,o){return Ut.isPlainObject(e)&&Ut.isPlainObject(t)?Ut.merge.call({caseless:o},e,t):Ut.isPlainObject(t)?Ut.merge({},t):Ut.isArray(t)?t.slice():t}function i(e,t,n,i){return Ut.isUndefined(t)?Ut.isUndefined(e)?void 0:o(void 0,e,0,i):o(e,t,0,i)}function a(e,t){if(!Ut.isUndefined(t))return o(void 0,t)}function s(e,t){return Ut.isUndefined(t)?Ut.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function r(n,i,a){return Ut.hasOwnProp(t,a)?o(n,i):Ut.hasOwnProp(e,a)?o(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:r,headers:(e,t,n)=>i(cr(e),cr(t),0,!0)};return Ut.forEach(lr({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=Ut.hasOwnProp(c,o)?c[o]:i,s=a(Ut.hasOwnProp(e,o)?e[o]:void 0,Ut.hasOwnProp(t,o)?t[o]:void 0,o);Ut.isUndefined(s)&&a!==r||(n[o]=s)}),Ut.hasOwnProp(t,"validateStatus")&&Ut.isUndefined(t.validateStatus)&&!1===function(n){const o=Ut.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Ut.isUndefined(o)){if(!Ut.isPlainObject(o))return;if(Ut.hasOwnProp(o,n))return o[n]}const i=Ut.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Ut.isPlainObject(i)&&Ut.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Ut.hasOwnProp(e,"validateStatus")?n.validateStatus=o(void 0,e.validateStatus):delete n.validateStatus),n}function ur(e){const t=pr({},e),n=e=>Ut.hasOwnProp(t,e)?t[e]:void 0,o=n("data");let i=n("withXSRFToken");const a=n("xsrfHeaderName"),s=n("xsrfCookieName");let r=n("headers");const c=n("auth"),l=n("baseURL"),p=n("allowAbsoluteUrls"),u=n("url");if(t.headers=r=Kt.from(r),t.url=ai(Ri(l,u,p,t),n("params"),n("paramsSerializer")),c){const t=Ut.getSafeProp(c,"username")||"",n=Ut.getSafeProp(c,"password")||"";try{r.set("Authorization","Basic "+btoa(t+":"+(n?(e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))(n):"")))}catch(t){throw Xt.from(t,Xt.ERR_BAD_OPTION_VALUE,e)}}if(Ut.isFormData(o)&&(gi.hasStandardBrowserEnv||gi.hasStandardBrowserWebWorkerEnv||Ut.isReactNative(o)?r.setContentType(void 0):Ut.isFunction(o.getHeaders)&&es(r,o.getHeaders(),n("formDataHeaderPolicy"))),gi.hasStandardBrowserEnv&&(Ut.isFunction(i)&&(i=i(t)),!0===i||null==i&&sr(t.url))){const e=a&&s&&rr.read(s);e&&r.set(a,e)}return t}var dr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const o=ur(e);let i=o.data;const a=Kt.from(o.headers).normalize();let s,r,c,l,p,{responseType:u,onUploadProgress:d,onDownloadProgress:m}=o;function f(){l&&l(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const o=Kt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Ti(function(e){t(e),f()},function(e){n(e),f()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:o,config:e,request:h}),h=null}h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&h.responseURL.startsWith("file:"))&&setTimeout(g)},h.onabort=function(){h&&(n(new Xt("Request aborted",Xt.ECONNABORTED,e,h)),f(),h=null)},h.onerror=function(t){const o=new Xt(t&&t.message?t.message:"Network Error",Xt.ERR_NETWORK,e,h);o.event=t||null,n(o),f(),h=null},h.ontimeout=function(){let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new Xt(t,(o.transitional||ri).clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,e,h)),f(),h=null},void 0===i&&a.setContentType(null),"setRequestHeader"in h&&Ut.forEach(qt(a),function(e,t){h.setRequestHeader(t,e)}),Ut.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),u&&"json"!==u&&(h.responseType=o.responseType),m&&([c,p]=ws(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([r,l]=ws(d),h.upload.addEventListener("progress",r),h.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(s=t=>{h&&(n(!t||t.type?new ji(null,e,h):t),h.abort(),f(),h=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const v=Za(o.url);if(v&&!gi.protocols.includes(v))return n(new Xt("Unsupported protocol "+v+":",Xt.ERR_BAD_REQUEST,e)),void f();h.send(i||null)})},mr=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let o=!1;const i=function(e){if(!o){o=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Xt?t:new ji(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,i(new Xt(`timeout of ${t}ms exceeded`,Xt.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>{o||(e.aborted?i.call(e):e.addEventListener("abort",i,{once:!0}))});const{signal:r}=n;return r.unsubscribe=()=>Ut.asap(s),r};const fr=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let o,i=0;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},hr=(e,t,n,o)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*fr(n,t)}(e,t);let a,s=0,r=e=>{a||(a=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await i.next();if(t)return r(),void e.close();if(n){let e=s+=o.byteLength;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw r(e),e}},cancel:e=>(r(e),i.return())},{highWaterMark:2})},{isFunction:gr}=Ut,vr=e=>{if(!Ut.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},xr=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},br=e=>{const t=null!=Ut.global?Ut.global:globalThis,{ReadableStream:n,TextEncoder:o}=t;e=Ut.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:a,Response:s}=e,r=i?gr(i):"function"==typeof fetch,c=gr(a),l=gr(s);if(!r)return!1;const p=r&&gr(n),u=r&&("function"==typeof o?(d=new o,e=>d.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer()));var d;const m=c&&p&&xr(()=>{let e=!1;const t=new a(gi.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),o=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!o}),f=l&&p&&xr(()=>Ut.isReadableStream(new s("").body)),h={stream:f&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new Xt(`Response type '${e}' is not supported`,Xt.ERR_NOT_SUPPORT,n)})});const g=async e=>{if(null==e)return 0;if(Ut.isBlob(e))return e.size;if(Ut.isSpecCompliantForm(e)){const t=new a(gi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Ut.isArrayBufferView(e)||Ut.isArrayBuffer(e)?e.byteLength:(Ut.isURLSearchParams(e)&&(e+=""),Ut.isString(e)?(await u(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:r,signal:l,cancelToken:u,timeout:d,onDownloadProgress:v,onUploadProgress:x,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:_,maxContentLength:k,maxBodyLength:S}=ur(e);const j=Ut.isNumber(k)&&k>-1,T=Ut.isNumber(S)&&S>-1;let E=i||fetch;b=b?(b+"").toLowerCase():"text";let $=mr([l,u&&u.toAbortSignal()],d),O=null;const R=$&&$.unsubscribe&&(()=>{$.unsubscribe()});let A,C=null;const N=()=>new Xt("Request body larger than maxBodyLength limit",Xt.ERR_BAD_REQUEST,e,O);try{let i;const l=Ut.hasOwnProp(e,"auth")?e.auth:void 0;if(l&&(i={username:Ut.getSafeProp(l,"username")||"",password:Ut.getSafeProp(l,"password")||""}),(e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,gi.origin);i||!e.username&&!e.password||(i={username:vr(e.username),password:vr(e.password)}),(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(i&&(y.delete("authorization"),y.set("Authorization","Basic "+btoa((e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))((i.username||"")+":"+(i.password||""))))),j&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return Rs(-1===t?e:e.slice(0,t),Os)}(t);if(n>k)throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O)}if(T&&"get"!==n&&"head"!==n){const e=await g(r);if("number"==typeof e&&isFinite(e)&&(A=e,e>S))throw N()}const u=T&&(Ut.isReadableStream(r)||Ut.isStream(r)),d=(e,t,n)=>hr(e,65536,e=>{if(T&&e>S)throw C=N();t&&t(e)},n);if(m&&"get"!==n&&"head"!==n&&(x||u)){if(A=null==A?await(async(e,t)=>{const n=Ut.toFiniteNumber(e.getContentLength());return null==n?g(t):n})(y,r):A,0!==A||u){let e,n=new a(t,{method:"POST",body:r,duplex:"half"});if(Ut.isFormData(r)&&(e=n.headers.get("content-type"))&&y.setContentType(e),n.body){const[e,t]=x&&_s(A,ws(ks(x)))||[];r=d(n.body,e,t)}}}else if(u&&!c&&p&&"get"!==n&&"head"!==n)r=d(r);else if(u&&c&&!m&&"get"!==n&&"head"!==n)throw new Xt("Stream request bodies are not supported by the current fetch implementation",Xt.ERR_NOT_SUPPORT,e,O);Ut.isString(w)||(w=w?"include":"omit");const P=c&&"credentials"in a.prototype;if(Ut.isFormData(r)){const e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete("content-type")}y.set("User-Agent","axios/"+Ya,!1);const I={..._,signal:$,method:n.toUpperCase(),headers:qt(y.normalize()),body:r,duplex:"half",credentials:P?w:void 0};O=c&&new a(t,I);let U=await(c?E(O,_):E(t,I));const z=Kt.from(U.headers);if(j){const t=Ut.toFiniteNumber(z.getContentLength());if(null!=t&&t>k)throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O)}const L=f&&("stream"===b||"response"===b);if(f&&U.body&&(v||j||L&&R)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=U[e]});const n=Ut.toFiniteNumber(z.getContentLength()),[o,i]=v&&_s(n,ws(ks(v),!0))||[];let a=0;U=new s(hr(U.body,65536,t=>{if(j&&(a=t,a>k))throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O);o&&o(t)},()=>{i&&i(),R&&R()}),t)}b=b||"text";let F=await h[Ut.findKey(h,b)||"text"](U,e);if(j&&!f&&!L){let t;if(null!=F&&("number"==typeof F.byteLength?t=F.byteLength:"number"==typeof F.size?t=F.size:"string"==typeof F&&(t="function"==typeof o?(new o).encode(F).byteLength:F.length)),"number"==typeof t&&t>k)throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O)}return!L&&R&&R(),await new Promise((t,n)=>{Ti(t,n,{data:F,headers:Kt.from(U.headers),status:U.status,statusText:U.statusText,config:e,request:O})})}catch(t){if(R&&R(),$&&$.aborted&&$.reason instanceof Xt){const n=$.reason;throw n.config=e,O&&(n.request=O),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(C)throw O&&!C.request&&(C.request=O),C;if(t instanceof Xt)throw O&&!t.request&&(t.request=O),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new Xt("Network Error",Xt.ERR_NETWORK,e,O,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw Xt.from(t,t&&t.code,e,O,t&&t.response)}}},yr=new Map,wr=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:i}=t,a=[o,i,n];let s,r,c=a.length,l=yr;for(;c--;)s=a[c],r=l.get(s),void 0===r&&l.set(s,r=c?new Map:br(t)),l=r;return r};wr();const _r={http:ar,xhr:dr,fetch:{get:wr}};Ut.forEach(_r,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const kr=e=>`- ${e}`,Sr=e=>Ut.isFunction(e)||null===e||!1===e;var jr=function(e,t){e=Ut.isArray(e)?e:[e];const{length:n}=e;let o,i;const a={};for(let s=0;s<n;s++){let n;if(o=e[s],i=o,!Sr(o)&&(i=_r[(n=String(o)).toLowerCase()],void 0===i))throw new Xt(`Unknown adapter '${n}'`);if(i&&(Ut.isFunction(i)||(i=i.get(t))))break;a[n||"#"+s]=i}if(!i){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(kr).join("\n"):" "+kr(e[0]):"as no adapter specified";throw new Xt("There is no suitable adapter to dispatch the request "+t,Xt.ERR_NOT_SUPPORT)}return i};function Tr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ji(null,e)}function Er(e){return Tr(e),e.headers=Kt.from(e.headers),e.data=ki.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jr(e.adapter||_i.adapter,e)(e).then(function(t){Tr(e),e.response=t;try{t.data=ki.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Kt.from(t.headers),t},function(t){if(!Si(t)&&(Tr(e),t&&t.response)){e.response=t.response;try{t.response.data=ki.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Kt.from(t.response.headers)}return Promise.reject(t)})}const $r={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$r[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Or={};$r.transitional=function(e,t,n){function o(e,t){return"[Axios v"+Ya+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new Xt(o(i," has been removed"+(t?" in "+t:"")),Xt.ERR_DEPRECATED);return t&&!Or[i]&&(Or[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}},$r.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Rr={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new Xt("options must be an object",Xt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(s){const t=e[a],n=void 0===t||s(t,a,e);if(!0!==n)throw new Xt("option "+a+" must be "+n,Xt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Xt("Unknown option "+a,Xt.ERR_BAD_OPTION)}},validators:$r};const Ar=Rr.validators;class Cr{constructor(e){this.defaults=e||{},this.interceptors={request:new si,response:new si}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),o=-1===t?-1:n.indexOf("\n",t+1),i=-1===o?"":n.slice(o+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pr(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:i}=t;void 0!==n&&Rr.assertOptions(n,{silentJSONParsing:Ar.transitional(Ar.boolean),forcedJSONParsing:Ar.transitional(Ar.boolean),clarifyTimeoutError:Ar.transitional(Ar.boolean),legacyInterceptorReqResOrdering:Ar.transitional(Ar.boolean),advertiseZstdAcceptEncoding:Ar.transitional(Ar.boolean),validateStatusUndefinedResolves:Ar.transitional(Ar.boolean)},!1),null!=o&&(Ut.isFunction(o)?t.paramsSerializer={serialize:o}:Rr.assertOptions(o,{encode:Ar.function,serialize:Ar.function},!0)),void 0!==t.allowAbsoluteUrls||(t.allowAbsoluteUrls=void 0===this.defaults.allowAbsoluteUrls||this.defaults.allowAbsoluteUrls),Rr.assertOptions(t,{baseUrl:Ar.spelling("baseURL"),withXsrfToken:Ar.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&Ut.merge(i.common,i[t.method]);i&&Ut.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete i[e]}),t.headers=Kt.concat(a,i);const s=[];let r=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;r=r&&e.synchronous;const n=t.transitional||ri;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let p,u=0;if(!r){const e=[Er.bind(this),void 0];for(e.unshift(...s),e.push(...c),p=e.length,l=Promise.resolve(t);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=t;for(;u<p;){const e=s[u++],t=s[u++];try{d=e?e(d):d}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);Ut.isThenable(n)&&(l=Promise.resolve(n).then(()=>Er.call(this,d)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Er.call(this,d)}catch(e){l=Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return ai(Ri((e=pr(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}Ut.forEach(["delete","get","head","options"],function(e){Cr.prototype[e]=function(t,n){return this.request(pr(n||{},{method:e,url:t,data:n&&Ut.hasOwnProp(n,"data")?n.data:void 0}))}}),Ut.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,i){return this.request(pr(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Cr.prototype[e]=t(),"query"!==e&&(Cr.prototype[e+"Form"]=t(!0))});var Nr=Cr;class Pr{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,i){n.reason||(n.reason=new ji(e,o,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Pr(function(t){e=t}),cancel:e}}}var Ir=Pr;const Ur={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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ur).forEach(([e,t])=>{Ur[t]=e});var zr=Ur;const Lr=function e(t){const n=new Nr(t),o=qe(Nr.prototype.request,n);return Ut.extend(o,Nr.prototype,n,{allOwnKeys:!0}),Ut.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(pr(t,n))},o}(_i);Lr.Axios=Nr,Lr.CanceledError=ji,Lr.CancelToken=Ir,Lr.isCancel=Si,Lr.VERSION=Ya,Lr.toFormData=ei,Lr.AxiosError=Xt,Lr.Cancel=Lr.CanceledError,Lr.all=function(e){return Promise.all(e)},Lr.spread=function(e){return function(t){return e.apply(null,t)}},Lr.isAxiosError=function(e){return Ut.isObject(e)&&!0===e.isAxiosError},Lr.mergeConfig=pr,Lr.AxiosHeaders=Kt,Lr.formToJSON=e=>bi(Ut.isHTMLForm(e)?new FormData(e):e),Lr.getAdapter=jr,Lr.HttpStatusCode=zr,Lr.default=Lr;var Fr=Lr;const{CanceledError:Dr}=Fr,qr=/screenshot(\-\d+?)?\.needle\.(webp|png|jpg|jpeg)/;async function Br(e,t){const n=t.baseUrl+Le.jobs.post_update,o={...Fe(t),job_id:e.identifier,status:e.status},i={status_message:e.status_message,error:e.error,progress:e.progress},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)}).catch(e=>(console.error(e),null));return!!a&&a.ok}async function Mr(e,t){const n=t.baseUrl+Le.jobs.get_status,o={...Fe(t),job_id:e,org:t.org},i=await fetch(n,{...De,method:"GET",headers:o}).catch(e=>(t.verbose?console.error("Failed to get job status",e):console.error("Failed to get job status",e.message),null));return i?i.ok?await i.json():(console.error("Failed to get status",i.status,await i.text()),{failed:!0,httpStatus:i.status}):{failed:!0}}function Wr(e={}){var t,n;const o=null!=(t=e.maxAuthFailures)?t:2,i=null!=(n=e.maxTransientFailures)?n:10;let a=0,s=0;return{record(e){if(e&&!0!==e.failed)return a=0,s=0,null;const t=null==e?void 0:e.httpStatus;return 401===t||403===t?(a++,a>=o?{abort:!0,reason:`Not authorized to read the job status (HTTP ${t}). Your access token is invalid or expired — run \`needle-cloud login\` or pass a fresh --token.`}:null):(s++,s>=i?{abort:!0,reason:`Could not read the job status after ${s} attempts${t?` (last: HTTP ${t})`:""}. The job may still be running — check it in the Needle Cloud dashboard.`}:null)}}}const Gr=6,Hr=1e3,Jr=15e3,Vr=9e4,Kr=new Set(["CERT_HAS_EXPIRED","UNABLE_TO_VERIFY_LEAF_SIGNATURE","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","ERR_TLS_CERT_ALTNAME_INVALID"]),Yr=new Set([408,429]);function Zr(e){var t;if(function(e){const t=null==e?void 0:e.name,n=null==e?void 0:e.code;return"CanceledError"===t||"AbortError"===t||"ERR_CANCELED"===n||"ABORT_ERR"===n}(e))return!1;const n=null==e||null==(t=e.response)?void 0:t.status;if("number"==typeof n&&n>0)return!!Yr.has(n)||!(n>=400&&n<500);const o=function(e){var t,n;const o=null!=(t=null==e?void 0:e.code)?t:null==e||null==(n=e.cause)?void 0:n.code;return"string"==typeof o&&o.length?o:null}(e);return!o||!Kr.has(o)}function Xr(e,t={}){const{baseMs:n=Hr,maxMs:o=Jr,random:i=Math.random}=t,a=Math.max(1,Math.floor(e)),s=Math.min(o,n*2**(a-1))/2;return Math.max(1,Math.round(s+i()*s))}async function Qr(e,t={}){const{maxAttempts:n=Gr,budgetMs:o=Vr,baseMs:i=Hr,maxMs:a=Jr,isRetryable:s=Zr,sleep:r=ec,now:c=Date.now,random:l=Math.random,onRetry:p}=t,u=c();let d,m=0;for(;m<n;){m++;try{return{ok:!0,value:await e(m),attempts:m}}catch(e){if(d=e,!s(e))return{ok:!1,error:e,attempts:m,reason:"permanent"};if(m>=n)return{ok:!1,error:e,attempts:m,reason:"attempts-exhausted"};const t=Xr(m,{baseMs:i,maxMs:a,random:l});if(c()-u+t>=o)return{ok:!1,error:e,attempts:m,reason:"budget-exhausted"};null==p||p({attempt:m,waitMs:t,error:e}),await r(t)}}return{ok:!1,error:d,attempts:m,reason:"attempts-exhausted"}}function ec(e){return new Promise(t=>setTimeout(t,e))}const tc=5242880,nc=1e4,oc=16777216,ic=67108864;var ac=rn(function(e,t){e.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],o=e[1],i=e[2],a=e[3];o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[0]-680876936|0)<<7|n>>>25)+o|0)&o|~n&i)+t[1]-389564586|0)<<12|a>>>20)+n|0)&n|~a&o)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&n)+t[3]-1044525330|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[4]-176418897|0)<<7|n>>>25)+o|0)&o|~n&i)+t[5]+1200080426|0)<<12|a>>>20)+n|0)&n|~a&o)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&n)+t[7]-45705983|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[8]+1770035416|0)<<7|n>>>25)+o|0)&o|~n&i)+t[9]-1958414417|0)<<12|a>>>20)+n|0)&n|~a&o)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&n)+t[11]-1990404162|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[12]+1804603682|0)<<7|n>>>25)+o|0)&o|~n&i)+t[13]-40341101|0)<<12|a>>>20)+n|0)&n|~a&o)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&n)+t[15]+1236535329|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[1]-165796510|0)<<5|n>>>27)+o|0)&i|o&~i)+t[6]-1069501632|0)<<9|a>>>23)+n|0)&o|n&~o)+t[11]+643717713|0)<<14|i>>>18)+a|0)&n|a&~n)+t[0]-373897302|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[5]-701558691|0)<<5|n>>>27)+o|0)&i|o&~i)+t[10]+38016083|0)<<9|a>>>23)+n|0)&o|n&~o)+t[15]-660478335|0)<<14|i>>>18)+a|0)&n|a&~n)+t[4]-405537848|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[9]+568446438|0)<<5|n>>>27)+o|0)&i|o&~i)+t[14]-1019803690|0)<<9|a>>>23)+n|0)&o|n&~o)+t[3]-187363961|0)<<14|i>>>18)+a|0)&n|a&~n)+t[8]+1163531501|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[13]-1444681467|0)<<5|n>>>27)+o|0)&i|o&~i)+t[2]-51403784|0)<<9|a>>>23)+n|0)&o|n&~o)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&n|a&~n)+t[12]-1926607734|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[5]-378558|0)<<4|n>>>28)+o|0)^o^i)+t[8]-2022574463|0)<<11|a>>>21)+n|0)^n^o)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^n)+t[14]-35309556|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[1]-1530992060|0)<<4|n>>>28)+o|0)^o^i)+t[4]+1272893353|0)<<11|a>>>21)+n|0)^n^o)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^n)+t[10]-1094730640|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[13]+681279174|0)<<4|n>>>28)+o|0)^o^i)+t[0]-358537222|0)<<11|a>>>21)+n|0)^n^o)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^n)+t[6]+76029189|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[9]-640364487|0)<<4|n>>>28)+o|0)^o^i)+t[12]-421815835|0)<<11|a>>>21)+n|0)^n^o)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^n)+t[2]-995338651|0)<<23|o>>>9)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[0]-198630844|0)<<6|n>>>26)+o|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~n))+t[5]-57434055|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[12]+1700485571|0)<<6|n>>>26)+o|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~n))+t[1]-2054922799|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[8]+1873313359|0)<<6|n>>>26)+o|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~n))+t[13]+1309151649|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[4]-145523070|0)<<6|n>>>26)+o|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~n))+t[9]-343485551|0)<<21|o>>>11)+i|0,e[0]=n+e[0]|0,e[1]=o+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}function o(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function i(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function a(e){var t,i,a,s,r,c,l=e.length,p=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)n(p,o(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(p,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*l).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),c=parseInt(s[1],16)||0,a[14]=r,a[15]=c,n(p,a),p}function s(e){var n,o="";for(n=0;n<4;n+=1)o+=t[e>>8*n+4&15]+t[e>>8*n&15];return o}function r(e){var t;for(t=0;t<e.length;t+=1)e[t]=s(e[t]);return e.join("")}function c(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function l(e){var t,n=[],o=e.length;for(t=0;t<o-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function p(){this.reset()}return r(a("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(t,n){var o,i,a,s,r=this.byteLength,c=e(t,r),l=r;return void 0!==n&&(l=e(n,r)),c>l?new ArrayBuffer(0):(o=l-c,i=new ArrayBuffer(o),a=new Uint8Array(i),s=new Uint8Array(this,c,o),a.set(s),i)}}(),p.prototype.append=function(e){return this.appendBinary(c(e)),this},p.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)n(this._hash,o(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},p.prototype.end=function(e){var t,n,o=this._buff,i=o.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)a[t>>2]|=o.charCodeAt(t)<<(t%4<<3);return this._finish(a,i),n=r(this._hash),e&&(n=l(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},p.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(e,t){var o,i,a,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;o=(o=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(o[2],16),a=parseInt(o[1],16)||0,e[14]=i,e[15]=a,n(this._hash,e)},p.hash=function(e,t){return p.hashBinary(c(e),t)},p.hashBinary=function(e,t){var n=r(a(e));return t?l(n):n},(p.ArrayBuffer=function(){this.reset()}).prototype.append=function(e){var t,o,a,s,r=(o=this._buff.buffer,a=e,(s=new Uint8Array(o.byteLength+a.byteLength)).set(new Uint8Array(o)),s.set(new Uint8Array(a),o.byteLength),s),c=r.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)n(this._hash,i(r.subarray(t-64,t)));return this._buff=t-64<c?new Uint8Array(r.buffer.slice(t-64)):new Uint8Array(0),this},p.ArrayBuffer.prototype.end=function(e){var t,n,o=this._buff,i=o.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)a[t>>2]|=o[t]<<(t%4<<3);return this._finish(a,i),n=r(this._hash),e&&(n=l(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var e=p.prototype.getState.call(this);return e.buff=String.fromCharCode.apply(null,new Uint8Array(e.buff)),e},p.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var n,o=e.length,i=new ArrayBuffer(o),a=new Uint8Array(i);for(n=0;n<o;n+=1)a[n]=e.charCodeAt(n);return a}(e.buff),p.prototype.setState.call(this,e)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(e,t){var o=r(function(e){var t,o,a,s,r,c,l=e.length,p=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)n(p,i(e.subarray(t-64,t)));for(o=(e=t-64<l?e.subarray(t-64):new Uint8Array(0)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<o;t+=1)a[t>>2]|=e[t]<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(p,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*l).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),c=parseInt(s[1],16)||0,a[14]=r,a[15]=c,n(p,a),p}(new Uint8Array(e)));return t?l(o):o},p}()}),sc=ac;function rc(e,t=0){return uc(e,t,2).getUint16(0,!0)}function cc(e,t=0){return uc(e,t,4).getUint32(0,!0)}function lc(e,t=0,n=e.byteLength){const o=e.slice(t,t+n);return dc.decode(new Uint8Array(o))}function pc(e,t,n=0){if(e.length<t.length+n)return!1;for(const[o,i]of t.entries())if(null!==i&&i!==e[o+n])return!1;return!0}function uc(e,t,n){const o=e.slice(t,t+n);return new DataView(new Uint8Array(o).buffer)}const dc=new TextDecoder("utf8"),mc=[["db","application/vnd.sqlite3",[83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0]],["woff","font/woff",[119,79,70,70]],["woff2","font/woff2",[119,79,70,50]],["bmp","image/bmp",[66,77]],["gif","image/gif",[71,73,70,56,55,97]],["gif","image/gif",[71,73,70,56,57,97]],["heic","image/heic",[102,116,121,112,104,101,105],{offset:4}],["heic","image/heic",[102,116,121,112,109],{offset:4}],["ico","image/x-icon",[0,0,1,0]],["jpg","image/jpeg",[255,216,255]],["pdf","application/pdf",[37,80,68,70,45]],["png","image/png",[137,80,78,71,13,10,26,10]],["7z","application/x-7z-compressed",[55,122,188,175,39,28]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,0]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,1,0]],["rtf","application/rtf",[123,92,114,116,102,49]],["bz2","application/x-bzip2",[66,90,104]],["gz","application/gzip",[31,139]],["tar","application/x-tar",[117,115,116,97,114,0,48,48],{offset:257}],["tar","application/x-tar",[117,115,116,97,114,32,32,0],{offset:257}],["tif","image/tiff",[73,73,42,0]],["tiff","image/tiff",[77,77,0,42]],["zip","application/zip",[80,75,3,4],{exact:!1}],["zip","application/zip",[80,75,5,6]],["mp3","audio/mp3",[255,251]],["mp3","audio/mp3",[255,243]],["mp3","audio/mp3",[255,242]],["mp3","audio/mp3",[73,68,51]],["mp4","video/mp4",[102,116,121,112,105,115,111,109],{offset:4}],["avi","video/x-msvideo",[82,73,70,70,null,null,null,null,65,86,73,32]],["wav","audio/wav",[82,73,70,70,null,null,null,null,87,65,86,69]],["ogx","application/ogg",[79,103,103,83],{exact:!1},[["oga","audio/ogg",[127,70,76,65,67],{offset:28}],["ogg","audio/ogg",[1,118,111,114,98,105,115],{offset:28}],["ogm","video/ogg",[1,118,105,100,101,111,0],{offset:28}],["ogv","video/ogg",[128,116,104,101,111,114,97],{offset:28}]]],["webp","image/webp",[82,73,70,70,null,null,null,null,87,69,66,80]],["psd","image/vnd.adobe.photoshop",[56,66,80,83]],["flac","audio/x-flac",[102,76,97,67]],["wasm","application/wasm",[0,97,115,109]],["deb","application/x-deb",[33,60,97,114,99,104,62,10]],["exe","application/x-msdownload",[77,90]],["exe","application/x-msdownload",[90,77]],["class","application/java-vm",[202,254,186,190]]];function fc(e){return e.flatMap(([e,t,n,o={},i=[]])=>[[e,t,n,o],...i])}function hc(e,t){const n=rc(e,26),o=lc(e,30,n),[i]=o.split("/"),a=o.endsWith(".xml");return"META-INF"===i?{ext:"jar",mime:"application/java-archive"}:"ppt"===i&&a?{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:"word"===i&&a?{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:"xl"===i&&a?{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}:"mimetype"===i?function(e,t){const n=cc(e,18),o=cc(e,22),i=rc(e,28);if(n===o){const o=lc(e,30+t+i,n);if("application/vnd.oasis.opendocument.presentation"===o)return{ext:"odp",mime:o};if("application/vnd.oasis.opendocument.spreadsheet"===o)return{ext:"ods",mime:o};if("application/vnd.oasis.opendocument.text"===o)return{ext:"odt",mime:o};if("application/epub+zip"===o)return{ext:"epub",mime:o}}}(e,n)??t:t}const gc=function(e){return fc(e).map(([e,t,n,{offset:o=0}={}])=>n.length+o).reduce((e,t)=>t>e?t:e,0)}(mc);function vc(e,t){for(const[n,o,i,{exact:a=!0,offset:s=0}={},r=[]]of t)if(pc(e,i,s)){if("zip"===n&&!a)return hc(e.buffer,{ext:n,mime:o});if(!a&&r.length)for(const[t,n,o,{offset:i=0}={}]of r)if(pc(e,o,i))return{ext:t,mime:n};return{ext:n,mime:o}}}function xc(e,t,n=void 0){const o=function(e,t,n){let o=0;for(;;){let t=e.indexOf("\\",o);if(-1===t)break;o=t+1,e=e.replace("\\","/")}return e}(e).split("/").pop()||e,i=(null==n?void 0:n.type)||yc(t,e),a=new File([t],o,{type:i});return a.path=e,a}const bc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function yc(e,t=void 0){const n=function(e,{extra:t=!1,hint:n}={}){const o=new Uint8Array(e.slice(0,gc));if(n){const e=function(e,{ext:t,mime:n}){return t||n?fc(e).filter(e=>e[0]===t||e[1]===n):[]}(mc,n);if(e.length>0){const t=vc(o,e);if(void 0!==t)return t}}return vc(o,mc)||(t?function(e){return function(e){try{const t=lc(e);if(!function(e){for(let t=0;t<e.length;t++)try{const n=e.charCodeAt(t);if(65533===n||n<=8)return!1}catch{return!1}return!0}(t))return;try{return JSON.parse(t),{ext:"json",mime:"application/json"}}catch{return{ext:"txt",mime:"text/plain"}}}catch{return}}(e)}(e):void 0)}(e);if(n)return n.mime;const o=new Uint8Array(e).subarray(0,4);let i="";for(var a=0;a<o.length;a++)i+=o[a].toString(16);let s="unknown";switch(i){case"676c5446":s="model/gltf-binary";break;case"89504e47":s="image/png";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;default:s="unknown"}return"unknown"===s&&"string"==typeof t&&(s=function(e){const t=e.toLowerCase();let n="";return t.endsWith(".html")||t.endsWith(".html.gz")||t.endsWith(".html.br")?n="text/html":t.endsWith(".js")||t.endsWith(".js.gz")||t.endsWith(".js.br")||t.endsWith(".mjs")||t.endsWith(".mjs.gz")||t.endsWith(".mjs.br")||t.endsWith(".cjs")||t.endsWith(".cjs.gz")||t.endsWith(".cjs.br")?n="application/javascript":t.endsWith(".wasm")?n="application/wasm":t.endsWith(".css")||t.endsWith(".css.gz")||t.endsWith(".css.br")?n="text/css":t.endsWith(".json")?n="application/json":t.endsWith(".txt")?n="text/plain":t.endsWith(".md")?n="text/markdown":t.endsWith(".yaml")||t.endsWith(".yml")?n="application/yaml":t.endsWith(".bin")?n="application/octet-stream":t.endsWith(".png")?n="image/png":t.endsWith(".jpg")||t.endsWith(".jpeg")?n="image/jpeg":t.endsWith(".gif")?n="image/gif":t.endsWith(".webp")?n="image/webp":t.endsWith(".avif")?n="image/avif":t.endsWith(".bmp")?n="image/bmp":t.endsWith(".tiff")||t.endsWith(".tif")?n="image/tiff":t.endsWith(".ico")?n="image/x-icon":t.endsWith(".svg")?n="image/svg+xml":t.endsWith(".xml")?n="application/xml":t.endsWith(".hdr")?n="image/vnd.radiance":t.endsWith(".exr")?n="image/x-exr":t.endsWith(".ktx2")?n="image/ktx2":t.endsWith(".ktx")?n="image/ktx":t.endsWith(".dds")?n="image/vnd-ms.dds":t.endsWith(".ogg")?n="audio/ogg":t.endsWith(".mp3")?n="audio/mpeg":t.endsWith(".wav")?n="audio/wave":t.endsWith(".flac")?n="audio/flac":t.endsWith(".m4a")?n="audio/mp4":t.endsWith(".aac")?n="audio/aac":t.endsWith(".mp4")?n="video/mp4":t.endsWith(".webm")?n="video/webm":t.endsWith(".mov")?n="video/quicktime":t.endsWith(".woff2")?n="font/woff2":t.endsWith(".woff")?n="font/woff":t.endsWith(".ttf")?n="font/ttf":t.endsWith(".otf")?n="font/otf":t.endsWith(".zip")?n="application/zip":t.endsWith(".glb")?n="model/gltf-binary":t.endsWith(".gltf")?n="model/gltf+json":t.endsWith(".vrm")?n="model/gltf-binary":t.endsWith(".usdz")?n="model/vnd.usdz+zip":t.endsWith(".usda")?n="model/vnd.usd-usda":t.endsWith(".usdc")?n="model/vnd.usd-usdc":t.endsWith(".usd")?n="model/vnd.usd-usd":t.endsWith(".mtl")?n="model/mtl":t.endsWith(".obj")?n="model/obj":t.endsWith(".fbx")?n="model/vnd.autodesk.fbx":t.endsWith(".stl")?n="model/stl":t.endsWith(".mtlx")?n="application/materialx+xml":t.endsWith(".ply")?n="model/ply":t.endsWith(".dae")?n="model/vnd.collada+xml":t.endsWith(".3mf")?n="model/3mf":(t.endsWith(".splat")||t.endsWith(".spz")||t.endsWith(".ksplat")||t.endsWith(".sog")||t.endsWith(".sogs"))&&(n="application/octet-stream"),n}(t)),s}function wc(e){return"string"==typeof e&&0!==e.length&&e.toLowerCase().endsWith(".exr")}function _c(e){if("string"!=typeof e||0===e.length)return!1;const t=e.toLowerCase();return t.endsWith(".hdr")||t.endsWith(".hdri")}function kc(e){return"string"==typeof e&&0!==e.length&&/\.pmrem(\d+x\d+)?\.ktx2$/i.test(e)}function Sc(e,t){const n=e.toLowerCase();return"application/gzip"===t||"application/brotli"===t?(n.endsWith(".html.gz")||n.endsWith(".html.br")?(t="text/html",e=e.substring(0,e.length-3)):n.endsWith(".js.gz")||n.endsWith(".js.br")||n.endsWith(".mjs.gz")||n.endsWith(".mjs.br")||n.endsWith(".cjs.gz")||n.endsWith(".cjs.br")?(t="application/javascript",e=e.substring(0,e.length-3)):n.endsWith(".css.gz")||n.endsWith(".css.br")?(t="text/css",e=e.substring(0,e.length-3)):n.endsWith(".json.gz")||n.endsWith(".json.br")?(t="text/json",e=e.substring(0,e.length-3)):n.endsWith(".txt.gz")||n.endsWith(".txt.br")?(t="text/plain",e=e.substring(0,e.length-3)):n.endsWith(".wasm.gz")||n.endsWith(".wasm.br")?(t="application/wasm",e=e.substring(0,e.length-3)):n.endsWith(".bin.gz")||n.endsWith(".bin.br")?(t="application/octet-stream",e=e.substring(0,e.length-3)):n.endsWith(".png.gz")||n.endsWith(".png.br")?(t="image/png",e=e.substring(0,e.length-3)):n.endsWith(".jpg.gz")||n.endsWith(".jpg.br")||n.endsWith(".jpeg.gz")||n.endsWith(".jpeg.br")?(t="image/jpeg",e=e.substring(0,e.length-3)):n.endsWith(".gif.gz")||n.endsWith(".gif.br")?(t="image/gif",e=e.substring(0,e.length-3)):n.endsWith(".webp.gz")||n.endsWith(".webp.br")?(t="image/webp",e=e.substring(0,e.length-3)):n.endsWith(".svg.gz")||n.endsWith(".svg.br")?(t="image/svg+xml",e=e.substring(0,e.length-3)):n.endsWith(".xml.gz")||n.endsWith(".xml.br")?(t="application/xml",e=e.substring(0,e.length-3)):n.endsWith(".ico.gz")||n.endsWith(".ico.br")?(t="image/x-icon",e=e.substring(0,e.length-3)):n.endsWith(".avif.gz")||n.endsWith(".avif.br")?(t="image/avif",e=e.substring(0,e.length-3)):n.endsWith(".bmp.gz")||n.endsWith(".bmp.br")?(t="image/bmp",e=e.substring(0,e.length-3)):n.endsWith(".tiff.gz")||n.endsWith(".tiff.br")||n.endsWith(".tif.gz")||n.endsWith(".tif.br")?(t="image/tiff",e=e.substring(0,e.length-3)):n.endsWith(".hdr.gz")||n.endsWith(".hdr.br")?(t="image/vnd.radiance",e=e.substring(0,e.length-3)):n.endsWith(".exr.gz")||n.endsWith(".exr.br")?(t="image/x-exr",e=e.substring(0,e.length-3)):n.endsWith(".ktx2.gz")||n.endsWith(".ktx2.br")?(t="image/ktx2",e=e.substring(0,e.length-3)):n.endsWith(".ktx.gz")||n.endsWith(".ktx.br")?(t="image/ktx",e=e.substring(0,e.length-3)):n.endsWith(".dds.gz")||n.endsWith(".dds.br")?(t="image/vnd-ms.dds",e=e.substring(0,e.length-3)):n.endsWith(".webm.gz")||n.endsWith(".webm.br")?(t="video/webm",e=e.substring(0,e.length-3)):n.endsWith(".mp4.gz")||n.endsWith(".mp4.br")?(t="video/mp4",e=e.substring(0,e.length-3)):n.endsWith(".mov.gz")||n.endsWith(".mov.br")?(t="video/quicktime",e=e.substring(0,e.length-3)):n.endsWith(".mp3.gz")||n.endsWith(".mp3.br")?(t="audio/mpeg",e=e.substring(0,e.length-3)):n.endsWith(".wav.gz")||n.endsWith(".wav.br")?(t="audio/wave",e=e.substring(0,e.length-3)):n.endsWith(".ogg.gz")||n.endsWith(".ogg.br")?(t="audio/ogg",e=e.substring(0,e.length-3)):n.endsWith(".flac.gz")||n.endsWith(".flac.br")?(t="audio/flac",e=e.substring(0,e.length-3)):n.endsWith(".m4a.gz")||n.endsWith(".m4a.br")?(t="audio/mp4",e=e.substring(0,e.length-3)):n.endsWith(".aac.gz")||n.endsWith(".aac.br")?(t="audio/aac",e=e.substring(0,e.length-3)):n.endsWith(".woff2.gz")||n.endsWith(".woff2.br")?(t="font/woff2",e=e.substring(0,e.length-3)):n.endsWith(".woff.gz")||n.endsWith(".woff.br")?(t="font/woff",e=e.substring(0,e.length-3)):n.endsWith(".ttf.gz")||n.endsWith(".ttf.br")?(t="font/ttf",e=e.substring(0,e.length-3)):n.endsWith(".otf.gz")||n.endsWith(".otf.br")?(t="font/otf",e=e.substring(0,e.length-3)):n.endsWith(".md.gz")||n.endsWith(".md.br")?(t="text/markdown",e=e.substring(0,e.length-3)):n.endsWith(".yaml.gz")||n.endsWith(".yaml.br")||n.endsWith(".yml.gz")||n.endsWith(".yml.br")?(t="application/yaml",e=e.substring(0,e.length-3)):n.endsWith(".zip.gz")||n.endsWith(".zip.br")?(t="application/zip",e=e.substring(0,e.length-3)):n.endsWith(".glb.gz")||n.endsWith(".glb.br")?(t="model/gltf-binary",e=e.substring(0,e.length-3)):n.endsWith(".gltf.gz")||n.endsWith(".gltf.br")?(t="model/gltf+json",e=e.substring(0,e.length-3)):n.endsWith(".vrm.gz")||n.endsWith(".vrm.br")?(t="model/gltf-binary",e=e.substring(0,e.length-3)):n.endsWith(".usdz.gz")||n.endsWith(".usdz.br")?(t="model/vnd.usdz+zip",e=e.substring(0,e.length-3)):n.endsWith(".usda.gz")||n.endsWith(".usda.br")?(t="model/vnd.usd-usda",e=e.substring(0,e.length-3)):n.endsWith(".usdc.gz")||n.endsWith(".usdc.br")?(t="model/vnd.usd-usdc",e=e.substring(0,e.length-3)):n.endsWith(".usd.gz")||n.endsWith(".usd.br")?(t="model/vnd.usd-usd",e=e.substring(0,e.length-3)):n.endsWith(".obj.gz")||n.endsWith(".obj.br")?(t="model/obj",e=e.substring(0,e.length-3)):n.endsWith(".mtl.gz")||n.endsWith(".mtl.br")?(t="model/mtl",e=e.substring(0,e.length-3)):n.endsWith(".stl.gz")||n.endsWith(".stl.br")?(t="model/stl",e=e.substring(0,e.length-3)):n.endsWith(".mtlx.gz")||n.endsWith(".mtlx.br")?(t="application/materialx+xml",e=e.substring(0,e.length-3)):n.endsWith(".ply.gz")||n.endsWith(".ply.br")?(t="model/ply",e=e.substring(0,e.length-3)):n.endsWith(".dae.gz")||n.endsWith(".dae.br")?(t="model/vnd.collada+xml",e=e.substring(0,e.length-3)):n.endsWith(".3mf.gz")||n.endsWith(".3mf.br")?(t="model/3mf",e=e.substring(0,e.length-3)):(n.endsWith(".splat.gz")||n.endsWith(".splat.br")||n.endsWith(".spz.gz")||n.endsWith(".spz.br")||n.endsWith(".ksplat.gz")||n.endsWith(".ksplat.br")||n.endsWith(".sog.gz")||n.endsWith(".sog.br")||n.endsWith(".sogs.gz")||n.endsWith(".sogs.br"))&&(t="application/octet-stream",e=e.substring(0,e.length-3)),{filename:e,mimetype:t}):null}function jc(e,t=void 0,n=!0){const o=Math.abs(e);if(o>=1099511627776){let o=n?" TB":"";return(e/1099511627776).toFixed(void 0===t?2:t)+o}if(o>=1073741824){let o=n?" GB":"";return(e/1073741824).toFixed(void 0===t?2:t)+o}if(o>=1048576){let o=n?" MB":"";return(e/1048576).toFixed(void 0===t?1:t)+o}if(o>=1024){let o=n?" KB":"";return(e/1024).toFixed(void 0===t?0:t)+o}let i=n?" B":"";return e.toFixed(0)+i}function Tc(e){return e.split("/").reduce((e,t)=>("."===t||(".."===t?e.pop():null!=t&&t.length&&e.push(t)),e),[]).join("/")}const Ec=1179937895,$c=1313821514,Oc=12,Rc=8;function Ac(e,t){let n=t;for(;n<e.length&&0!==e[n];)n++;return n>=e.length?null:new TextDecoder("latin1").decode(e.subarray(t,n))}async function Cc(e){return new Promise(t=>setTimeout(t,e))}function Nc(e,t,n=void 0){e instanceof Date&&(e=e.getTime()),t instanceof Date&&(t=t.getTime());let o=t-e,i=o>0;const a=!1!==(null==n?void 0:n.prefix),s=!1!==(null==n?void 0:n.suffix);let r="",c="";o<0&&(o=-o);const l=Math.floor(o/1e3),p=Math.floor(l/60),u=Math.floor(p/60),d=Math.floor(u/24);if(null!=(null==n?void 0:n.limitInDays)&&d>=n.limitInDays)return a&&(r="on "),`${r}${new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}${c}`;r=a?i?"":"in ":"",c=s&&i?" ago":"";const m=Math.floor(d/30),f=Math.floor(m/12);return 1===f?`${r}1 year${c}`:f>1?`${r}${Math.floor(f)} years${c}`:1===m?`${r}1 month${c}`:m>1?`${r}${Math.floor(m)} months${c}`:1===d?i&&null!=n&&n.allowSimple?"yesterday":`${r}1 day${c}`:d>1?`${r}${Math.floor(d)} days${c}`:1===u?`${r}1 hour${c}`:u>1?`${r}${Math.floor(u)} hours${c}`:1===p?`${r}1 minute${c}`:p>1?`${r}${Math.floor(p)} minutes${c}`:null!=n&&n.allowSimple&&l<10?"just now":`${r}${l.toFixed(0)} seconds${c}`}const Pc=/^image_(?<image_lod>\d+)_|^mesh_lod_(?<mesh_lod>\d+)_/;function Ic(e){return e.includes("\\u")?JSON.parse(`"${e}"`):decodeURIComponent(e)}function Uc(e){let t=null,n="";const o=e.filter(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());if(1===o.length)return t=o[0],t;const i=e.filter(e=>e.name.toLowerCase().endsWith(".html")||e.name.toLowerCase().endsWith(".htm")||e.name.toLowerCase().endsWith(".html.gz")||e.name.toLowerCase().endsWith(".html.br"));if(1===i.length)return i[0];if(i.length>1){const e=new Map;for(const t of i){const n=t.path.split("/");let o=e.get(n.length);o||(o=[],e.set(n.length,o)),o.push(t)}const o=Array.from(e.keys()).sort((e,t)=>e-t);if(o.length>0)for(const n of o){const o=e.get(n);if(!o)continue;const i=o.find(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());return i?(t=i,t):(t=o[0],t)}return n="Invalid upload: Multiple HTML files found but could not determine root.",console.error(n,i.map(e=>e.path||e.name)),{error:n}}const a=e.filter(e=>e.name.toLowerCase().endsWith(".glb")||e.name.toLowerCase().endsWith(".gltf")||e.name.toLowerCase().endsWith(".vrm"));if(a.length>1){const e=function(e){const t=new Array,n=/(mesh_lod|image)_\d_(.{1,50})/;for(const o of e){if(n.test(o.name))continue;const e=o.name.toLowerCase();(e.endsWith(".gltf")||e.endsWith(".vrm")||e.endsWith(".glb"))&&t.push(o)}return 1==t.length?t[0]:null!=(o=Fc(t)[0])?o:null;var o}(a);return e?(t=e,t):(n="Invalid upload: Multiple glb/glTF/vrm files found. This is currently not supported.",console.error(n,a.map(e=>e.path||e.name)),{error:n})}if(1===a.length)return t=a[0],t;const s=e.filter(e=>e.name.toLowerCase().endsWith(".usdz")||e.name.toLowerCase().endsWith(".usd")||e.name.toLowerCase().endsWith(".usda")||e.name.toLowerCase().endsWith(".usdc"));if(s.length>=1)return t=function(e){var t;const n=Fc(e),o=["usda","usdz","usd","usdc"];for(const e of o){const t=n.find(t=>t.name.toLowerCase().endsWith(`.${e}`));if(t)return t}return null!=(t=n[0])?t:null}(s),t;const r=e.filter(e=>e.name.toLowerCase().endsWith(".fbx"));if(r.length>1)return n="Invalid upload: Multiple fbx files found. This is currently not supported.",console.error(n,r),{error:n};if(1===r.length)return t=r[0],t;const c=e.filter(e=>e.name.toLowerCase().endsWith(".obj"));if(c.length>1)return n="Invalid upload: Multiple obj files found. This is currently not supported.",console.error(n,c),{error:n};if(1===c.length)return t=c[0],t;const l=e.filter(e=>e.name.toLowerCase().endsWith(".stl"));if(l.length>1)return n="Invalid upload: Multiple stl files found. This is currently not supported.",console.error(n,l),{error:n};if(1===l.length)return t=l[0],t;const p=e.filter(e=>{const t=e.name.toLowerCase();return t.endsWith(".ply")||t.endsWith(".splat")||t.endsWith(".spz")||t.endsWith(".ksplat")||t.endsWith(".sog")||t.endsWith(".sogs")});if(p.length>1)return n="Invalid upload: Multiple splat files found. Upload them as separate content items.",console.error(n,p.map(e=>e.path||e.name)),{error:n};if(1===p.length)return t=p[0],t;if(1===e.length&&!e[0].arrayBuffer&&e[0].path.toLowerCase().startsWith("http"))return t=e[0],t;const u=e.filter(e=>e.name.toLowerCase().endsWith("package.json"));if(1===u.length)return t=u[0],t;if(u.length>1)return n="Invalid upload: Multiple package.json files found. This is currently not supported.",console.error(n,u),{error:n};const d=e.filter(e=>e.name.toLowerCase().endsWith(".mtlx"));if(d.length>1)return n="Invalid upload: Multiple mtlx files found. This is currently not supported.",console.error(n,d),{error:n};if(1===d.length)return t=d[0],t;const m=e.filter(e=>{const t=e.name.toLowerCase();return wc(t)||_c(t)||kc(t)});return m.length>1?(n="Invalid upload: Multiple HDRI files found. Upload them as separate content items.",console.error(n,m.map(e=>e.path||e.name)),{error:n}):1===m.length?(t=m[0],t):t||{error:"No supported file to upload found..."}}const zc=new Set(["glb","gltf","vrm"]),Lc=new Set(["fbx","obj","stl","usd","usda","usdz"]);function Fc(e){let t=Infinity,n=[];for(const o of e){const e=o.path.split("/").length;e<t?(t=e,n=[o]):e===t&&n.push(o)}return n}class Dc{constructor(e,t){this.totalFiles=e,this.estimatedTotalSize=t,this.uploadedSize=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime,this.lastUploadedSize=0,this.speedEMA=null,this.emaFactor=.1,this.smoothedRemainingTime=null,this.recentSpeeds=new Array,this.maxRecentSpeeds=20,this.initialEstimateThreshold=.05}updateProgress(e){const t=Date.now(),n=(t-this.lastUpdateTime)/1e3,o=e-this.lastUploadedSize;if(this.uploadedSize=e,n>0&&o>0){this.recentSpeeds.push(o/n),this.recentSpeeds.length>this.maxRecentSpeeds&&this.recentSpeeds.shift();const e=this.recentSpeeds.reduce((e,t)=>e+t,0)/this.recentSpeeds.length;this.speedEMA=null===this.speedEMA?e:this.emaFactor*e+(1-this.emaFactor)*this.speedEMA}this.lastUpdateTime=t,this.lastUploadedSize=e;const i=this.uploadedSize/this.estimatedTotalSize,a=(t-this.startTime)/1e3,s=this.speedEMA&&this.speedEMA>0?this.speedEMA:this.uploadedSize/a;let r;if(r=s>0?(this.estimatedTotalSize-this.uploadedSize)/s:Infinity,i>=this.initialEstimateThreshold)if(null===this.smoothedRemainingTime)this.smoothedRemainingTime=r;else{const e=.1;this.smoothedRemainingTime=(1-e)*this.smoothedRemainingTime+e*r}else this.smoothedRemainingTime=a/i-a;return this.smoothedRemainingTime=Math.max(this.smoothedRemainingTime,(this.estimatedTotalSize-this.uploadedSize)/s),{progress:100*i,estimatedTimeRemaining:Math.round(this.smoothedRemainingTime),estimatedTimeRemainingString:this.smoothedRemainingTime>3?this.__formatTime(this.smoothedRemainingTime):"few seconds"}}__formatTime(e){if(!isFinite(e))return"Calculating...";if(e<60)return`${Math.round(e)}sec`;const t=Math.floor(e/60);if(t<60)return`${t}min`;const n=Math.floor(t/60);if(n<24)return`${n}h ${t%60}min`;const o=Math.floor(n/24);return o<=10?`${o}d`:"Calculating..."}}const qc=15e3;function Bc(e,t,n={setTimeout:setTimeout,clearTimeout:clearTimeout}){return function(o,i){const a=e.call(this,o,i);if(!a||"function"!=typeof a.once)return a;const s=n.setTimeout(()=>{const e=new Error(`connect timeout: no connection within ${t/1e3}s`);e.code="ETIMEDOUT",a.destroy(e)},t),r=()=>n.clearTimeout(s);return a.once("connect",r),a.once("secureConnect",r),a.once("error",r),a.once("close",r),a}}let Mc;async function Wc(e={}){var t,n;if(!(null!=(t=e.isNode)?t:"undefined"!=typeof process&&null!=(n=process.versions)&&n.node))return{};if(Mc)return Mc;const[{default:o},{default:i}]=await Promise.all([import("node:http"),import("node:https")]),a=new o.Agent({keepAlive:!0}),s=new i.Agent({keepAlive:!0});for(const e of[a,s])e.createConnection=Bc(e.createConnection,qc);return Mc={httpAgent:a,httpsAgent:s},Mc}async function Gc(e){const t=await import("./pako.esm-01431bd2.js"),n=await e.arrayBuffer(),o=t.gzip(new Uint8Array(n)).buffer.slice(0);if(o.byteLength>51200&&o.byteLength>=n.byteLength){if(n.byteLength>0)return null}else if(!(o instanceof ArrayBuffer))return console.error("gzipCompress: Invalid ArrayBuffer"),{error:`Gzip compressing failed for "${e.name}" (unexpected result)`};return xc(`${"path"in e?e.path:e.name}.gz`,o,{type:"application/gzip"})}const Hc=16777216;async function Jc(e,t,n=void 0){const o=async function(e,t,n){var o,i,a,s,r,c,l,p,u,d,m,f,h,g,v,x,b,y,w,_;let{files:k,skipped:S}=function(e){const t=[];return{files:e.filter(e=>{const n=e.name||"";return!(!n||n.endsWith("/"))||(t.push({name:n,reason:"directory-entry"}),!1)}),skipped:t}}(t.files);for(const e of S)console.warn(`[upload] Skipping directory entry: "${e.name}"`);t.files=k;const j=(null==(o=n)?void 0:o.loglevel)||"none";if(!k.length)return"none"!=j&&console.error("No files to upload"),{success:!1,error:"No files to upload"};if(!t.entrypoint){const e=Uc(k);if(null==e)return{success:!1,error:"No entrypoint file found"};if("object"==typeof e&&"error"in e)return{success:!1,error:e.error};"info"===j&&console.log("Entrypoint: "+e.name),t.entrypoint=e}t.entrypoint&&!k.includes(t.entrypoint)&&k.push(t.entrypoint);const T=await async function(e){if(e.length>5e3)return{success:!1,error:"Too many files. Maximum filecount is 5000"};let t=0,n=0,o=0,i=0;for(let c=e.length-1;c>=0;c--){const l=e[c];if(t+=l.size,t>1073741824)return{success:!1,error:`Total file size exceeds limit of ${1024..toFixed(0)} MB. Please reduce the size of your upload.`};const p=l.name.toLocaleLowerCase();if(".ds_store"!==p){if(p.endsWith(".gltf")?o++:p.endsWith(".glb")?(r=p)&&Pc.test(r)||i++:p.endsWith(".vrm")&&n++,p.endsWith(".gltf")){var a;o+=1,console.log(`Found glTF file ${l.name}. Will check if all dependencies are available\n`,e);const t=await l.text(),n=t.matchAll(/"uri"\s*:\s*"(?<value>.*?)"/g);if(!n)continue;const i=JSON.parse(t);if("2.0"!==i.asset.version)return console.warn("⚠ glTF version is not 2.0. This is currently not supported."),{success:!1,error:`glTF version ${i.asset.version} is unsupported.Please use glTF 2.0.`};const r=null==(a=l.path)?void 0:a.split("/"),c=r.splice(0,r.length-1).join("/");for(const t of n){var s;const n=null==(s=t.groups)?void 0:s.value;if(n){let t=!1;if(n.startsWith("http://")||n.startsWith("https://")||n.startsWith("www.")){console.log(`✅ Found remote dependency ${n} `);break}if(n.startsWith("data:")){console.log(`✅ Found embedded dependency ${n} `);break}{const o=Tc(`${c}/${Ic(n)}`);console.log('❓ Check if local dependency exists "'+o+'"');for(const n of e){if(n.webkitRelativePath===o||n.name==o){t=!0,console.log(`✅ Found dependency in name or webkit: ${n.name} || ${n.webkitRelativePath} `);break}if(n.path===o){t=!0,console.log(`✅ Found dependency in path: ${n.path} `);break}}}if(!t)return console.warn("⚠ Missing dependency "+n,c),{success:!1,error:"Missing resource: "+n}}}}}else e.splice(c,1)}var r;return{success:!0,vrm_count:n,gltf_count:o,glb_count:i}}(k);if("error"in T)return{success:!1,error:T.error||"Failed to validate files"};if(null!=(i=t.entrypoint)&&i.name.endsWith(".htm")||null!=(a=t.entrypoint)&&a.name.endsWith(".html")||null!=(s=t.entrypoint)&&s.name.endsWith(".html.gz")||null!=(r=t.entrypoint)&&r.name.endsWith(".html.br"))n||(n={}),n.type="deployment";else if(T.vrm_count>10)return{success:!1,error:"Multiple model files found - this is not supported for asset uploads. Please upload a single model file only."};const E=await async function(e,t={}){const{raw:n=!1,loglevel:o="none",entrypoint:i=null}=t,a=(...e)=>{"none"!==o&&console.log(...e)};if(n)return"none"!==o&&console.warn("Raw upload - skipping gzip compression of files"),{files:e,entrypoint:i};const s=new Set(e.map(Yc)),r=[];let c=i;for(const t of e){const n=Yc(t),p=t.name.toLowerCase();if(!Vc.some(e=>p.endsWith(e))){r.push(t);continue}const u=Kc.find(e=>s.has(`${n}${e}`));if(u){var l;a(`Skipping gzip compression, using pre-compressed file: ${n}${u}`),i===t&&(c=null!=(l=e.find(e=>Yc(e)===`${n}${u}`))?l:c);continue}a(`gZip compressing file: ${t.name}`);const d=await Gc(t).catch(e=>({error:`Error compressing ${t.name}: ${e.message}`}));if(null===d){"none"!==o&&console.error(`Did not compress file: ${t.name}`),r.push(t);continue}if("error"in d)return{files:e,entrypoint:i,error:d.error};if(!d)return{files:e,entrypoint:i,error:`Failed to compress ${t.name}`};const m=i===t;r.push(d),m&&(c=d),a(`gZip compressed file: ${t.name} ${m?"(entrypoint)":""}`)}return{files:r,entrypoint:c}}(k,{raw:t.raw,loglevel:null!=(c=null==(l=n)?void 0:l.loglevel)?c:j,entrypoint:t.entrypoint});if(E.error)return{success:!1,error:E.error,status:500};k=E.files,t.files=k,t.entrypoint=E.entrypoint,k.sort((e,t)=>e.name.includes(".needle")&&!t.name.includes(".needle")?-1:!e.name.includes(".needle")&&t.name.includes(".needle")?1:0);const{baseUrl:$,authToken:O}=e,R="Bearer "+O,A={...Fe(e),triggered_by:t.triggered_by,filename:`${encodeURIComponent(t.entrypoint.name)}`,"total-files":k.length.toString(),"total-files-size":k.reduce((e,t)=>e+t.size,0).toString()};null!=(p=n)&&p.content_id&&(A.content_id=n.content_id),null!=(u=n)&&u.type&&(A.type=n.type),null!=(d=n)&&d.name&&(A.name=encodeURIComponent(n.name)),null!=(m=n)&&m.parent_job_id&&(A.parent_job_id=n.parent_job_id);const C={entrypoint:(null==(f=t.entrypoint)?void 0:f.path)||(null==(h=t.entrypoint)?void 0:h.name),files:[]};null!=(g=n)&&g.content_type&&(C.content_type=n.content_type);const N={outputs:[C],...t.metadata?{metadata:t.metadata}:{},...!1===(null==(v=n)?void 0:v.optimizations)?{optimizations:!1}:{},...!0===(null==(x=n)?void 0:x.verify)?{verify:!0}:{}},P=[];for(let e=0;e<k.length;e++){var I,U,z;const t=k[e];let o=t.path||t.webkitRelativePath||t.name;if(null!=(I=o)&&I.includes(":"))throw new Error(`Invalid filename: ${o}`);let i=await t.arrayBuffer();const a=t.size;let s=t.type;if(null!=(U=s)&&U.length&&"unknown"!==s.toLowerCase()||(s=yc(i,o)),"deployment"===(null==(z=n)?void 0:z.type)){const e=Sc(o,s);e&&(o=e.filename,s=e.mimetype)}const r=function(e){let t="";for(let n=0;n<e.length;n+=3){const o=e.charCodeAt(n),i=n+1<e.length?e.charCodeAt(n+1):0,a=n+2<e.length?e.charCodeAt(n+2):0;t+=bc[o>>2]+bc[(3&o)<<4|i>>4]+(n+1<e.length?bc[(15&i)<<2|a>>6]:"=")+(n+2<e.length?bc[63&a]:"=")}return t}(sc.ArrayBuffer.hash(i,!0));P[e]=i,C.files[e]={filename:o,content_type:s,content_length:a,content_md5:r}}if("deployment"!==(null==(b=n)?void 0:b.type)){const e=t.entrypoint.name.toLowerCase();let o;if(e.endsWith(".glb")||e.endsWith(".gltf"))try{const n=P[k.indexOf(t.entrypoint)];o=function(e){return function(e){if(!e)return!1;const t=!e.nodes||0===e.nodes.length,n=!e.meshes||0===e.meshes.length,o=Array.isArray(e.materials)&&1===e.materials.length;return t&&n&&o}(e)?"material":"3d-asset"}(e.endsWith(".glb")?function(e){const t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<Oc+Rc)throw new Error("Buffer too small to be a GLB");const n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(n.getUint32(0,!0)!==Ec)throw new Error("Not a GLB (magic mismatch)");const o=n.getUint32(Oc,!0);if(n.getUint32(Oc+4,!0)!==$c)throw new Error("First chunk is not JSON");const i=Oc+Rc,a=i+o;if(a>t.byteLength)throw new Error("JSON chunk exceeds buffer length");const s=t.subarray(i,a),r=(new TextDecoder).decode(s);return JSON.parse(r)}(n):JSON.parse((new TextDecoder).decode(n)))}catch(e){return{success:!1,error:`Failed to inspect "${t.entrypoint.name}": ${e.message}`}}else e.endsWith(".mtlx")?o="material":(wc(e)||_c(e)||kc(e))&&(o="hdri");if(o){var L;if(null!=(L=n)&&L.content_type&&n.content_type!==o)return{success:!1,error:`Content type mismatch: "${t.entrypoint.name}" contains "${o}" but "${n.content_type}" was requested.`};C.content_type=o}}try{const e=await async function(e){var t,n,o,i,a;if(!e||"function"!=typeof e.slice||"number"!=typeof e.size)return null;const s=Math.min(e.size,65536);if(s<=0)return null;let r;try{const t=await e.slice(0,s).arrayBuffer();r=new Uint8Array(t)}catch{return null}return null!=(t=null!=(n=null!=(o=null!=(i=null!=(a=function(e){if(e.length<24)return null;if(137!==e[0]||80!==e[1]||78!==e[2]||71!==e[3])return null;if(13!==e[4]||10!==e[5]||26!==e[6]||10!==e[7])return null;const t=new DataView(e.buffer,e.byteOffset),n=t.getUint32(16,!1),o=t.getUint32(20,!1);return n&&o?{width:n,height:o}:null}(r))?a:function(e){if(e.length<28)return null;const t=[171,75,84,88,32,50,48,187,13,10,26,10];for(let n=0;n<t.length;n++)if(e[n]!==t[n])return null;const n=new DataView(e.buffer,e.byteOffset),o=n.getUint32(20,!0),i=n.getUint32(24,!0);return o&&i?{width:o,height:i}:null}(r))?i:function(e){if(e.length<16)return null;if(118!==e[0]||47!==e[1]||49!==e[2]||1!==e[3])return null;const t=new DataView(e.buffer,e.byteOffset);let n=8;for(;n<e.length;){const o=Ac(e,n);if(null===o)return null;if(0===o.length)return null;n+=o.length+1;const i=Ac(e,n);if(null===i)return null;if(n+=i.length+1,n+4>e.length)return null;const a=t.getInt32(n,!0);if(n+=4,a<0||n+a>e.length)return null;if("dataWindow"===o&&"box2i"===i&&16===a){const e=t.getInt32(n,!0),o=t.getInt32(n+4,!0),i=t.getInt32(n+8,!0)-e+1,a=t.getInt32(n+12,!0)-o+1;return i<=0||a<=0?null:{width:i,height:a}}n+=a}return null}(r))?o:function(e){if(e.length<30)return null;if(82!==e[0]||73!==e[1]||70!==e[2]||70!==e[3])return null;if(87!==e[8]||69!==e[9]||66!==e[10]||80!==e[11])return null;const t=String.fromCharCode(e[12],e[13],e[14],e[15]);if("VP8 "===t){const t=16383&(e[26]|e[27]<<8),n=16383&(e[28]|e[29]<<8);return t&&n?{width:t,height:n}:null}return"VP8L"===t?47!==e[20]?null:{width:1+(16383&(e[21]|e[22]<<8)),height:1+(16383&(e[22]>>6|e[23]<<2|(15&e[24])<<10))}:"VP8X"===t?{width:1+(e[24]|e[25]<<8|e[26]<<16),height:1+(e[27]|e[28]<<8|e[29]<<16)}:null}(r))?n:function(e){if(e.length<4)return null;if(255!==e[0]||216!==e[1])return null;let t=2;for(;t<e.length-8;){for(;t<e.length&&255===e[t];)t++;if(t>=e.length)return null;const n=e[t++];if(1===n||n>=208&&n<=217)continue;if(t+2>e.length)return null;const o=e[t]<<8|e[t+1];if(o<2||t+o>e.length)return null;if(n>=192&&n<=207&&196!==n&&200!==n&&204!==n){if(t+7>e.length)return null;const n=e[t+3]<<8|e[t+4],o=e[t+5]<<8|e[t+6];return o&&n?{width:o,height:n}:null}t+=o}return null}(r))?t:function(e){if(e.length<10)return null;if(35!==e[0]||63!==e[1])return null;const t=new TextDecoder("latin1").decode(e.subarray(0,Math.min(e.length,4096))).match(/[+-]Y\s+(\d+)\s+[+-]X\s+(\d+)/);if(!t)return null;const n=parseInt(t[1],10),o=parseInt(t[2],10);return o&&n?{width:o,height:n}:null}(r)}(t.entrypoint);e&&(C.width=e.width,C.height=e.height)}catch(e){"debug"===j&&console.warn("readImageResolution failed; uploading without dimensions",e)}const F=await fetch($+Le.upload.request,{...De,method:"POST",headers:A,body:JSON.stringify(N)}).catch(e=>"fetch failed"==e.message||"Failed to fetch"==e.message?`Network error. Make sure you are connected to the internet and ${$} is reachable.`:(console.error("Failed to begin upload\n",e),null));if(null===F||"string"==typeof F)return{success:!1,error:F||"Failed to begin upload"};if(!F.ok){const e=await F.text();if(e.startsWith("{")){const t=JSON.parse(e);if("error"in t)return{success:!1,status:F.status,error:t.error}}return"none"!=j&&console.error("Failed to begin upload\n",F.status,e),{success:!1,status:F.status,error:`${e}`}}const D=await F.json();"debug"===j&&console.debug("BeginResponse",D);const q=k.reduce((e,t)=>e+t.size,0);var B;if("exists"===D.type)return"none"!=j&&console.log("Upload already exists",D.id),null!=(B=n)&&B.onStart&&n.onStart(D.id,D.content_id),{success:!0,uploadSkipped:!0,id:D.id,type:D.job_type,content_id:D.content_id,filesUploaded:k.length,totalSize:q,url:D.url,edit_url:D.edit_url};const M=t.entrypoint.webkitRelativePath||t.entrypoint.name;let W=0;null==(y=n)||null==(y=y.abort)||y.addEventListener("abort",async()=>{console.log("Upload aborted: Cancelling upload"),await fetch($+Le.upload.cancel,{...De,method:"POST",headers:{authorization:R,id:D.id}})});let G=!1,H=Date.now();function J(t,n,o=!1){if(!o&&Date.now()-H<1e3)return!1;if(G&&"completed"!==n)return void("none"!=j&&console.warn("Invalid status update..."));H=Date.now();const i=Math.floor(W/q*100);return"debug"===j&&console.log("SET STATUS: "+n,t,i),Br({identifier:D.id,status:n,status_message:t,progress:i},e),!0}null!=(w=n)&&w.onStart&&n.onStart(D.id,D.content_id);const V=Date.now(),K=new Dc(k.length,q/1024/1024),Y=new Array,Z=function(e){let t=0;for(const n of e)Number.isFinite(n)&&n>=0&&(t=Math.max(t,n));return t>=ic?2:t>=Hc?4:10}(C.files.map(e=>e.content_length));"debug"===j&&console.debug(`Upload file concurrency: ${Z}`);let X=!1;const Q=[...k],ee=k.length,te=function(e,t=25e3){let n=!1;const o=setInterval(()=>{if(!n)try{const t=e();t&&"function"==typeof t.then&&t.catch(e=>{console.warn("[upload] heartbeat tick failed:",e)})}catch(e){console.warn("[upload] heartbeat tick threw:",e)}},t);return o&&"function"==typeof o.unref&&o.unref(),function(){n||(n=!0,clearInterval(o))}}(()=>J("Upload in progress","running",!0));try{var ne;for(let o=0;o<Q.length;o++){var oe;if(!(X||null!=(oe=n)&&null!=(oe=oe.abort)&&oe.aborted)){if(Y.length<Z){console.debug(`Uploading file ${o}/${k.length}: ${k[o].name}`);let i=0,a=0;const s=C.files[o],r=s.filename,c=P[o],l=s.content_length,p=s.content_type,u=k[o],d=u.name.endsWith(".gz")?"gzip":u.name.endsWith(".br")?"br":void 0,m=al({uploadId:D.id,uploadRequestPUTUrl:D.request_put_url,entrypointPath:M,file:k[o],fileName:r,fileMd5:s.content_md5,fileBuffer:c,fileType:p,content_encoding:d,fileSize:l,fileIndex:o,fileNumber:o+1,fileCount:ee,loglevel:j,experimental:t.experimental,args:e,options:n,onProgress:e=>{var t;const s=e.progress||0;i=k[o].size*s;const c=i-a;if(a=i,W+=c,null!=(t=n)&&t.progress){const e=W/q,t=k.length,i=k[o].size,a=(Date.now()-V)/1e3,c=K.updateProgress(W/1024/1024);n.progress({uploadedBytes:W,totalBytes:q,progress01:e,fileName:k[o].name,fileSize:i,fileProgress01:s,fileIndex:o,totalFiles:t,estimatedTimeLeftDisplay:c.estimatedTimeRemainingString,estimatedTimeLeft:c.estimatedTimeRemaining,elapsedTime:a}),J(`Uploading file ${o+1}/${t} (${r}): ${(100*s).toFixed(0)}% of ${jc(q)}. Finished in approx. ${c.estimatedTimeRemainingString}`,"running",!1)}}}).then(e=>{if(!0!==e)return e;for(let e=Y.length-1;e>=0;e--)Y[e]===m&&Y.splice(e,1);J(`Uploaded ${jc(W)+" of "+jc(q)} for ${k[o].name}`,"running")}).catch(e=>{var t;null!=(t=n)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),X=!0)});Y.push(m)}Y.length>=Z&&await Promise.race(Y)}}null!=(ne=n)&&null!=(ne=ne.abort)&&ne.aborted?console.debug("Upload aborted"):X&&console.debug("Upload failed"),await Promise.all(Y).catch(e=>{var t;null!=(t=n)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),X=!0)})}finally{te()}if(X)return await Br({identifier:D.id,status:"failed",error:"Failed to upload files"},e),{success:!1,error:"Failed to upload files"};if(null!=(_=n)&&null!=(_=_.abort)&&_.aborted)return await Br({identifier:D.id,status:"canceled",status_message:"Upload aborted",error:"Upload aborted"},e),{success:!1,error:"Upload aborted"};G=!0,console.log(`Upload Done: All files uploaded to ${D.id}`);const ie={...Fe(e),id:D.id};"none"!=j&&console.log("Completing upload - notify server");let ae=null;for(let e=0;e<5;e++){var se;await Cc(1e3*e);const t=AbortSignal.timeout(6e4+5e3*e);if(ae=await fetch($+Le.upload.done,{...De,method:"POST",headers:ie,signal:t}).catch(t=>(console.error(`Failed to complete upload (${e+1} / 5)`,t.message),null)),!0===(null==(se=ae)?void 0:se.ok))break;if(ae&&ae.status>=400&&ae.status<500)break;var re;"none"!=j&&e<4&&console.warn(`Failed to complete upload (${(null==(re=ae)?void 0:re.status)||"no status"}): will retry in 1 second`)}if(!ae)return console.error("Failed to complete upload"),{success:!1,error:"Failed to complete upload"};if(!ae.ok){if(524===ae.status)return console.error("Failed to complete upload: Gateway Timeout"),{success:!1,error:"Failed to complete upload: Gateway Timeout"};{const e=await ae.text().catch(()=>"");return console.error(`Failed to complete upload (${ae.status}): ${e}`),{success:!1,error:`Failed to complete upload: ${e?e.substring(0,300):`status ${ae.status}`}`}}}"none"!=j&&console.log("Upload complete");const ce=await ae.json();return{success:!0,type:ce.type,uploadSkipped:!1,id:ce.id,content_id:ce.content_id,url:ce.url,edit_url:ce.edit_url,filesUploaded:k.length,totalSize:q}}(e,t,n);return await o.finally(()=>{})}const Vc=[".html",".js",".css"],Kc=[".gz",".br"];function Yc(e){return"path"in e&&e.path?e.path:e.name}function Zc(e){var t;const n=null==e||null==(t=e.config)?void 0:t.url;if(!n)return null;try{return new URL(n).host}catch{return null}}const Xc=400,Qc=255;function el(e){const t="string"==typeof e?e:String(null!=e?e:"");return t.length<=Qc?t:t.slice(0,Qc-1)+"…"}const tl={ECONNRESET:"connection reset before the upload completed",ECONNREFUSED:"connection refused by the storage host",ECONNABORTED:"connection aborted — timed out or closed mid-request",ENOTFOUND:"DNS lookup failed for the storage host",EAI_AGAIN:"DNS lookup failed temporarily — resolver unavailable",ETIMEDOUT:"connection timed out",EPIPE:"connection closed while sending the file",EHOSTUNREACH:"storage host unreachable from this network",ENETUNREACH:"network unreachable",EPROTO:"TLS or protocol error",ERR_NETWORK:"network error — the request never reached the storage host",CERT_HAS_EXPIRED:"the TLS certificate for the storage host has expired",UNABLE_TO_VERIFY_LEAF_SIGNATURE:"the TLS certificate for the storage host could not be verified",DEPTH_ZERO_SELF_SIGNED_CERT:"a self-signed TLS certificate was presented for the storage host",SELF_SIGNED_CERT_IN_CHAIN:"a self-signed TLS certificate was presented for the storage host"};function nl(e){if(!e)return"unknown upload error";const t=[];try{const i=e.response,a=null==i?void 0:i.status,s=null==i?void 0:i.statusText;a&&t.push(`HTTP ${a}${s?" "+s:""}`);const r=null==i?void 0:i.data;if(null!=r){var n,o;let i;if("string"==typeof r)i=r;else try{i=JSON.stringify(r)}catch{i=String(r)}const a=null==(n=i.match(/<Code>([^<]+)<\/Code>/))?void 0:n[1],s=null==(o=i.match(/<Message>([^<]+)<\/Message>/))?void 0:o[1];if(a)t.push(`S3 ${a}${s?": "+s:""}`);else if(function(e){return/^\s*(<!DOCTYPE\s+html|<html[\s>])/i.test(e)}(i)){const n=Zc(e);t.push("blocked by a network filter or proxy"+(n?` before it reached ${n}`:"")+" — ask your network administrator to allow this host")}else i&&t.push(i.slice(0,200))}let c=null;if(!i&&(c=function(e){var t,n;const o=null!=(t=null==e?void 0:e.code)?t:null==e||null==(n=e.cause)?void 0:n.code;return"string"==typeof o&&o.length?o:null}(e),c)){const n=tl[c];t.push(n?`${c} (${n})`:c);const o=Zc(e);o&&t.push(`while uploading to ${o}`)}const l=e.message?String(e.message):"",p=a&&/^Request failed with status code \d+$/.test(l)||null!==c&&l.includes(c);l&&!p&&t.push(l)}catch{}return 0===t.length&&e.message&&t.push(String(e.message)),t.length?t.join(" — "):"unknown upload error"}const ol=12e4;function il(e,t){let n=null,o=!1;const i=()=>{n&&(clearTimeout(n),n=null)};return{reset:()=>{o||(i(),n=setTimeout(()=>{o=!0,n=null,t()},e))},cancel:i}}async function al(e){if(e.fileSize>=ic)return async function(e){const{uploadId:t,entrypointPath:n,file:o,fileName:i,fileMd5:a,fileType:s,content_encoding:r,fileSize:c,args:l,options:p,onProgress:u,partSize:d,concurrency:m,maxRetries:f,retryDelayMs:h,putPart:g}=e,{baseUrl:v}=l,x=()=>({...Fe(l),"Content-Type":"application/json",org:l.org,job_id:t}),b={...x(),filesize:c.toString()},y=JSON.stringify({filename:i,entrypoint:n,"content-type":s,"content-md5":a,"content-encoding":r,output_index:0});async function w(e,t,n){const o=await fetch(e,{...De,method:"POST",headers:t,body:JSON.stringify(n)});if(!o.ok)throw new Error(`${e} ${o.status}: ${await o.text().catch(()=>"")}`);return o.json()}return await async function(e){const{size:t,slice:n,partSize:o=oc,concurrency:i=4,maxRetries:a=5,retryDelayMs:s=1e3,createUpload:r,getPartUrls:c,putPart:l,completeUpload:p,abortUpload:u,onProgress:d,signal:m,checkCancelled:f}=e,h=async()=>{if(m&&m.aborted)return!0;if(f)try{return!!await f()}catch{return!1}return!1};if(await h())throw new Error("Upload aborted");const g=function(e,t=oc){if(!Number.isFinite(e)||e<=0)return[];let n=Math.max(t,tc,Math.ceil(e/nc));const o=[];let i=0,a=1;for(;i<e;){const t=Math.min(i+n,e);o.push({partNumber:a,start:i,end:t,size:t-i}),i=t,a++}return o}(t,o);if(0===g.length)throw new Error("Nothing to upload (size <= 0)");const{upload_id:v,key:x}=await r(),b=await c(v,x,g.map(e=>e.partNumber)),y=new Map(b.map(e=>[e.part_number,e.url])),w=[];let _=0,k=null;const S=async e=>{const t=y.get(e.partNumber);if(!t)throw new Error(`Missing presigned url for part ${e.partNumber}`);let o=!1;const i=await Qr(async()=>{if(await h())throw o=!0,new Error("Upload aborted");try{const o=n(e.start,e.end),i=await l({url:t,payload:o,partNumber:e.partNumber,size:e.size,signal:m});if(!i)throw new Error(`No ETag returned for part ${e.partNumber}`);return i}catch(e){throw await h()&&(o=!0),e}},{maxAttempts:a+1,baseMs:s,isRetryable:e=>!o&&Zr(e),...s>0?{}:{sleep:async()=>{}}});if(!i.ok)throw i.error||new Error(`Failed to upload part ${e.partNumber}`);w.push({part_number:e.partNumber,etag:i.value}),_+=e.size,d&&d(_)},j=[...g],T=Math.max(1,Math.min(i,g.length));if(await Promise.all(Array.from({length:T},()=>(async()=>{for(;j.length>0;){if(k||await h())return;const e=j.shift();if(!e)return;try{await S(e)}catch(e){return void(k=k||e)}}})())),k||await h())throw await u(v,x).catch(()=>{}),k||new Error("Upload aborted");return w.sort((e,t)=>e.part_number-t.part_number),await p(v,x,w),{ok:!0,key:x,upload_id:v,parts:g.length}}({size:c,partSize:d,concurrency:m,maxRetries:f,retryDelayMs:h,slice:(e,t)=>o.slice(e,t),signal:null==p?void 0:p.abort,onProgress:e=>{u&&u({loaded:e,total:c,progress:c?e/c:0})},createUpload:async()=>{const e=await fetch(v+Le.upload.multipart_create,{...De,method:"POST",headers:b,body:y});if(!e.ok)throw new Error(`multipart/create ${e.status}: ${await e.text().catch(()=>"")}`);const t=await e.json();return{upload_id:t.upload_id,key:t.key}},getPartUrls:async(e,t,n)=>(await w(v+Le.upload.multipart_part_urls,x(),{key:t,upload_id:e,part_numbers:n})).urls,putPart:g||(({url:e,payload:t,partNumber:n,signal:o})=>async function({url:e,payload:t,partNumber:n,contentType:o,signal:i}){const a=i,s=new AbortController;let r=!1;const c=()=>s.abort();a&&(a.aborted?s.abort():a.addEventListener("abort",c,{once:!0}));const l=il(ol,()=>{r=!0,s.abort()});l.reset();try{var p,u;const n=await Fr.put(e,t,{...De,...await Wc(),withCredentials:!1,signal:s.signal,headers:{"Content-Type":o},onUploadProgress:()=>l.reset()});if(200!==n.status)throw new Error(nl({response:n}));const i=(null==(p=n.headers)?void 0:p.etag)||(null==(u=n.headers)?void 0:u.ETag);if(!i)throw new Error("part PUT returned no ETag (is the bucket's CORS exposeHeaders:etag set?)");return i}catch(e){if(null!=a&&a.aborted)throw e;if(r)throw new Error(`Part ${n} stalled: no progress for ${ol/1e3}s`);throw new Error(nl(e))}finally{l.cancel(),a&&a.removeEventListener("abort",c)}}({url:e,payload:t,partNumber:n,signal:o,contentType:s})),completeUpload:async(e,t,n)=>w(v+Le.upload.multipart_complete,x(),{key:t,upload_id:e,parts:n}),abortUpload:async(e,t)=>{await fetch(v+Le.upload.multipart_abort,{...De,method:"POST",headers:x(),body:JSON.stringify({key:t,upload_id:e})}).catch(()=>{})}}),!0}(e);const{uploadId:t,uploadRequestPUTUrl:n,entrypointPath:o,file:i,fileName:a,fileBuffer:s,fileMd5:r,fileSize:c,fileType:l,content_encoding:p,fileIndex:u,fileNumber:d,fileCount:m,loglevel:f,args:h,options:g,experimental:v}=e;"info"===f&&console.log(`Uploading file "${i.name}" type=${l} (${c}) ${i.type} with hash ${r}`);const x={...Fe(h),"Content-Type":"application/json",org:h.org,job_id:t,filesize:c.toString(),progress:(u/m*100).toFixed(0)},b={filename:a,entrypoint:o,"content-type":l,"content-md5":r,"content-encoding":p,output_index:0};"debug"===f&&console.debug("Requesting presigned URL with headers",x);const y=JSON.stringify(b);let w=null,_="";const k=await Qr(async()=>{var e;if(null!=g&&null!=(e=g.abort)&&e.aborted)throw new Dr("Upload aborted");const t=await fetch(n,{...De,method:"POST",headers:x,body:y});if(!t.ok){const e=await t.text().catch(()=>"");throw _=e,{response:{status:t.status,statusText:t.statusText,data:e}}}return await t.json()},{baseMs:500,onRetry:({attempt:e,waitMs:t,error:n})=>{console.warn(`Failed to get presigned url for "${a}" "${l}": ${nl(n)}\n→ Retry #${e} in ${t}ms`)}});if(k.ok)w=k.value;else if(k.error instanceof Dr)throw k.error;if(null==w){const e=_||nl(k.error);throw new Error(`Failed to get presigned url for "${a}" "${l}" \n${e}`)}const S=w.presigned_url;var j=!1;let T=null;const E=[];let $=0;const O=await Qr(async t=>{var n;if(null!=g&&null!=(n=g.abort)&&n.aborted)throw new Dr("Upload aborted");const o={"Content-Type":l,"Content-MD5":r};v&&(o["Content-Length"]=c.toString()),p&&(o["Content-Encoding"]=p),1===t&&"none"!=f&&console.log(`Uploading file ${d}/${m}: ${a}`),"debug"===f&&console.debug("PUT with headers",o);const i=new AbortController;let u=!1;const h=()=>i.abort();null!=g&&g.abort&&(g.abort.aborted?i.abort():g.abort.addEventListener("abort",h,{once:!0}));const x=il(ol,()=>{u=!0,i.abort()});x.reset();try{const t=await Fr.put(S,s,{...De,...await Wc(),withCredentials:!1,signal:i.signal,headers:o,onUploadProgress:t=>{x.reset(),e.onProgress(t)}});if(200!==t.status)throw{response:t};return t}catch(e){var b;if(null!=g&&null!=(b=g.abort)&&b.aborted)throw new Dr("Upload aborted");if(u)throw T=`stalled: no upload progress for ${ol/1e3}s`,E.push(T),"none"!==f&&console.error(`Upload stalled (PUT) (${d}, ${a}) after ${ol/1e3}s with no progress`),new Error(T);throw T=nl(e),E.push(T),e instanceof Dr||("none"!==f&&console.error(`Failed to upload file (PUT) (${d}, ${a}) "${T}"`),"debug"===f&&(console.log(o,{fileSize:c}),e.response?console.debug(e.response):console.debug(e))),e}finally{x.cancel(),null!=g&&g.abort&&g.abort.removeEventListener("abort",h)}},{onRetry:({attempt:e,waitMs:t})=>{"none"!==f&&console.log(`Retry PUT #${e} for file ${a} in ${t}ms`)}});if($=O.attempts,O.ok)j=!0,"info"===f&&console.log(`Uploaded file ${d}/${m} "${a}" (${l}, ${jc(c)})`);else if(O.error instanceof Dr)throw O.error;if(!j){var R;const e=null!=(R=function(e){if(!Array.isArray(e))return null;const t=[];for(const n of e){if("string"!=typeof n)continue;const e=n.trim();e&&!t.includes(e)&&t.push(e)}return t.length?t.join("; "):null}(E))?R:T,n=function(e,t,n){const o="string"==typeof t?t.trim():"",i="number"==typeof n&&n>1?` after ${n} attempts`:"";return o?`Failed to upload file ${e}${i}: ${o.length>Xc?o.slice(0,Xc)+"…":o}`:`Failed to upload file ${e}${i}`}(a,e,$);throw console.error(n),await Br({identifier:t,status:"failed",status_message:el(n),error:"Failed to upload file "+a},h),new Error(n)}return!0}async function sl(e,t,n){const o=e.baseUrl+Le.jobs.presigned_url,i=await fetch(o,{...De,method:"POST",headers:{...Fe(e),job_id:t},body:JSON.stringify(n)}).catch(e=>(console.error(e),null));return i&&i.ok?await i.text():(console.error("Failed to get presigned download URL",null==i?void 0:i.status),null)}async function rl(e,t){const n=e.baseUrl+Le.jobs.create,o={...Fe(e),"content-type":"application/json"},i={type:"ai-material",triggered_by:e.trigger_type,parameters:{...t}},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request texture generation (${a.status}): ${e}`),{error:e||`Request failed (${a.status})`}}return await a.json().catch(e=>(console.error(e),null))}async function cl(e,t={}){const n=new URL(e.baseUrl+Le.content.root);t.content_type&&n.searchParams.set("content_type",t.content_type),t.content_format&&n.searchParams.set("content_format",t.content_format),t.search&&n.searchParams.set("search",t.search),t.tags&&n.searchParams.set("tags",t.tags),t.types&&n.searchParams.set("types",t.types),t.trash&&n.searchParams.set("trash","true"),t.is_public&&n.searchParams.set("is_public","true"),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.collection_id&&n.searchParams.set("collection_id",t.collection_id),t.offset&&n.searchParams.set("offset",String(t.offset));const o=Fe(e),i=await fetch(n,{...De,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to list content (${i.status}): ${e}`)}return await i.json()}async function ll(e,t){const n=`${e.baseUrl}${Le.content.root}/${t}`,o=Fe(e),i=await fetch(n,{...De,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to get content (${i.status}): ${e}`)}return await i.json()}async function pl(e,t){const n=`${e.baseUrl}${Le.content.root}/${t}`,o=Fe(e),i=await fetch(n,{...De,method:"DELETE",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to delete content (${i.status}): ${e}`)}return await i.json()}const ul={schema:{name:"load_needle_engine_skill",description:'Load the Needle Engine skill: authoritative coding guidelines, component patterns, the Unity/Blender-to-web export workflow, and reference docs. Load this BEFORE answering ANY Needle Engine coding or workflow question — do NOT answer from prior knowledge, which is frequently wrong about how Needle actually works (for example: the relationship between Unity C# scripts and TypeScript components, and what the editor export does — Needle does NOT auto-convert C# logic to TypeScript). ALWAYS load first when the user: shares or asks about Unity C# code (a MonoBehaviour, the Needle.Engine.* namespace) or Blender scripts in a Needle context; asks how a Unity or Blender component maps to, converts to, ports to, or works in Needle Engine or TypeScript; asks about components, lifecycle, serialization, XR, networking, deployment, or the export/codegen pipeline; or reports a Needle Engine bug or error. Do NOT load for greetings or small talk that contains no technical question — wait for the actual question first. Without arguments loads the main skill file. Use the "file" parameter to load specific reference files (e.g. "references/api.md", "references/components.md"). Call without arguments first to discover available references.',inputSchema:{type:"object",properties:{file:{type:"string",description:'File to load relative to the skill root, e.g. "references/api.md". Defaults to the main skill file.'}},additionalProperties:!1,required:[]}},async execute(e){const t=(null==e?void 0:e.file)||"SKILL.md";if(t.includes("..")||t.startsWith("/"))return{error:"Invalid file path."};try{const e="https://raw.githubusercontent.com/needle-tools/ai/main/providers/claude/plugin/skills/needle-engine/"+encodeURI(t),n=new AbortController,o=setTimeout(()=>n.abort(),5e3),i=await fetch(e,{signal:n.signal,redirect:"follow"});return clearTimeout(o),i.ok?{content:await i.text()}:{error:`Could not fetch '${t}' (HTTP ${i.status})`}}catch(e){return{error:`Error fetching skill: ${e.message}`}}}};function dl(e){let t,n=null,o="";for(const i of e.split("\n"))i.startsWith("event: ")?n=i.slice(7).trim():i.startsWith("data: ")?o=i.slice(6):i.startsWith("id: ")&&(t=parseInt(i.slice(4).trim(),10));if(!n)return null;let i=null;switch(n){case"delta":i={type:"delta",content:decodeURIComponent(o)};break;case"message":i={type:"message",content:decodeURIComponent(o)};break;case"status":i={type:"status",message:decodeURIComponent(o)};break;case"error":i={type:"error",message:decodeURIComponent(o)};break;case"notice":i={type:"notice",message:decodeURIComponent(o)};break;case"stopped":i={type:"stopped"};break;case"tool_call":i={type:"tool_call",...JSON.parse(o)};break;case"tool_result":i={type:"tool_result",...JSON.parse(o)};break;case"message_inserted":i={type:"message_inserted",...JSON.parse(o)};break;case"elicitation":i={type:"elicitation",...JSON.parse(o)};break;case"done":{const e=JSON.parse(o),{chat_url:t,...n}=e;i={type:"done",token_usage:n},t&&(i.chat_url=t);break}case"message_id":i={type:"message_id",message_id:decodeURIComponent(o)};break;case"chat_id":i={type:"chat_id",chat_id:decodeURIComponent(o)}}return i&&void 0!==t&&(i.id=t),i}function ml(e,t){const n=Fe(e);return null!=t&&t.personal&&(n["x-needle-ai-chat"]="personal"),null!=t&&t.instanceId&&(n["x-needle-instance-id"]=t.instanceId),n}function fl(e,t){return t.stream?async function*(e,t){const n=new URL(e.baseUrl+Le.ai.chat),o=ml(e,t);o["Content-Type"]="application/json";const i={type:"new_message",slug:t.slug,message:t.message,stream:!0,source:t.source,full_url:t.full_url,pathname:t.pathname,context:t.context,disabled_tools:t.disabled_tools},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to stream chat message (${a.status}): ${e}`)}if(!a.body)throw new Error("Response body is null — streaming not supported in this environment");yield*async function*(e){const t=e.getReader(),n=new TextDecoder;let o="";try{for(;;){const{done:e,value:i}=await t.read();if(e)break;o+=n.decode(i,{stream:!0});const a=o.split("\n\n");o=a.pop()||"";for(const e of a){const t=dl(e);t&&(yield t)}}if(o.trim()){const e=dl(o);e&&(yield e)}}finally{t.releaseLock()}}(a.body)}(e,t):async function(e,t){const n=new URL(e.baseUrl+Le.ai.chat),o=ml(e,t);o["Content-Type"]="application/json";const i={type:"new_message",slug:t.slug,message:t.message,stream:!1,source:t.source,full_url:t.full_url,pathname:t.pathname,context:t.context,disabled_tools:t.disabled_tools},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to send chat message (${a.status}): ${e}`)}return await a.json()}(e,t)}const hl=200,gl=["github.com","gitlab.com","bitbucket.org"],vl=/[\w.+-]+@[\w-]+\.[\w.]+/;function xl(e){if(e)return vl.test(e)?void 0:e}function bl(e,t){return String(g("git",e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],...t?{cwd:t}:{}})||"").trim()}function yl(e,t){try{return bl(e,t)}catch{return""}}function wl(e){try{const t=bl(["rev-parse","HEAD"],e);if(!t)return null;const n=yl(["rev-parse","--abbrev-ref","HEAD"],e),o=yl(["log","-1","--pretty=%s"],e),i=xl(yl(["log","-1","--pretty=%an"],e)),a=yl(["status","--porcelain"],e).length>0,s=yl(["remote","get-url","origin"],e),r=t.slice(0,7),{repository:c,url:l}=function(e,t){if(!e)return{};const n=/^(?:https?:\/\/(?:[^@/]+@)?([^/]+)\/|git@([^:]+):)(.+?)(?:\.git)?$/.exec(e.trim());if(!n)return{};const o=(n[1]||n[2]||"").toLowerCase(),i=n[3];return i?gl.includes(o)?{repository:i,url:`https://${o}/${i}/${"bitbucket.org"===o?"commits":"commit"}/${t}`}:{repository:i}:{}}(s,t),p={type:"git",id:t,label:`${n||r}@${r}${a?" (dirty)":""}`};return n&&(p.branch=n),i&&(p.author=i),o&&(p.message=o.slice(0,hl)),a&&(p.dirty=!0),c&&(p.repository=c),l&&(p.url=l),p}catch{return null}}function _l(e){if("string"==typeof e)return e.trim()||void 0}const kl=()=>"https://cloud.needle.tools/account",Sl=()=>"https://cloud.needle.tools/edit";function jl(e){return v(e)}const Tl=["node_modules",".git",".vscode",".vercel",".github",".idea"];function El(e,t,n=null,o="",i=0){if(null===n){if(i>0)throw new Error("result must be provided if level > 0. Did you forget to pass it?");n={files:[],total_size:0}}if(0===i){if(!r(t))throw new Error(`Directory or file "${t}" does not exist.`);if(c(t).isFile()){const e=xc(t,l(t));return e.path=e.name,n.files.push(e),n.entrypoint=e,n}}else if(i>20)throw new Error("Recursion depth too high. Are you sure you are providing the correct directory?");const a=p(t,{withFileTypes:!0});for(const i of a)if(0==i.isDirectory()){if("optimization"===e&&0==((s=(s=i.name).toLowerCase()).endsWith(".glb")||s.endsWith(".gltf")||s.endsWith(".vrm")||s.endsWith(".usdz")||s.endsWith(".usd")||s.endsWith(".fbx")))continue;const a=xc(o+i.name,l(t+"/"+i.name));if(n.files.push(a),n.total_size+=a.size,n.total_size>1073741824)throw new Error(`Collected filesize exceeds ${1024..toFixed(0)} MB. Are you sure you are providing the correct directory?`);if(n.files.length>1e4)throw new Error(`Too many files (${n.files.length}): The maximum filecount is 10,000.`)}var s;for(const s of a)if(s.isDirectory()){if(Tl.includes(s.name))continue;El(e,t+"/"+s.name,n,o+s.name+"/",i+1)}return n}const $l=new RegExp("\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b","g"),Ol=new RegExp("\\b[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\b","gi"),Rl=new RegExp("(Authorization:\\s*)([^\\s,;\"']+(?:\\s+[^\\s,;\"']+)?)","gi"),Al=new RegExp("\\bBearer\\s+([A-Za-z0-9._\\-=]+)","g"),Cl=new RegExp("([?&]token=)([^&\\s\"'<>]+)","g"),Nl=new RegExp("<redacted:\\d+ch>","g");function Pl(e){if("string"!=typeof e)return e;if(0===e.length)return e;if(Nl.test(e)&&(Nl.lastIndex=0,!function(e){$l.lastIndex=0,Ol.lastIndex=0,Rl.lastIndex=0,Al.lastIndex=0,Cl.lastIndex=0;const t=$l.test(e)||Ol.test(e)||Rl.test(e)||Al.test(e)||Cl.test(e);return $l.lastIndex=0,Ol.lastIndex=0,Rl.lastIndex=0,Al.lastIndex=0,Cl.lastIndex=0,t}(e.replace(Nl,""))))return e;Nl.lastIndex=0;let t=e;return t=t.replace(Rl,(e,t,n)=>`${t}<redacted:${n.length}ch>`),t=t.replace(Cl,(e,t,n)=>`${t}<redacted:${n.length}ch>`),t=t.replace(Al,(e,t)=>`<redacted:${("Bearer "+t).length}ch>`),t=t.replace($l,e=>`<redacted:${e.length}ch>`),t=t.replace(Ol,e=>`<redacted:${e.length}ch>`),t}const Il=["cli.log","cli.prev.log"],Ul=M.join(q.homedir(),".needle","cli","logs");E(Ul,{recursive:!0});try{!function(e,t){const n={migrated:[],skipped:[]};if(!e||!t)return n;if(M.resolve(e)===M.resolve(t))return n;if(!T(e))return n;for(const o of Il){const i=M.join(e,o);if(T(i))try{E(t,{recursive:!0});const e=M.join(t,o);if(T(e)){const e=M.join(t,o.replace(/\.log$/,"")+".legacy.log");$(i,e),n.skipped.push(o)}else $(i,e),n.migrated.push(o)}catch(e){console.error(`[needle-cloud] Failed to migrate legacy log ${o}: ${e instanceof Error?e.message:e}`)}}}(M.join(O(q.tmpdir()),"Needle","Cloud","logs"),Ul)}catch(e){console.error(`[needle-cloud] legacy log migration check failed: ${e instanceof Error?e.message:e}`)}const zl=M.resolve(Ul,"cli.log");if(T(zl)){const e=R(zl),t=e.mtimeMs;if(Date.now()-t>432e5||e.size>52428800){const e=Fl();A(zl,e,t=>{t?console.error(`Failed to rename log file: ${t.message}`):console.log(`Log file renamed to ${e}`)})}}function Ll(){return zl}function Fl(){return M.resolve(Ul,"cli.prev.log")}function Dl(e,t){try{let n=Pl(String(null!=e?e:""));return n=`[${(new Date).toISOString()}] ${n}`,null!=t&&t.emptyLineBefore&&(n="\n"+n),C(zl,n+"\n"),!0}catch(e){return console.error(`Failed to write to log file: ${e instanceof Error?e.message:e}`),!1}}async function ql(e,t){return e=Pl(e),e=`[${(new Date).toISOString()}] ${e}`,null!=t&&t.emptyLineBefore&&(e="\n"+e),D(zl,e+"\n",{flag:"a"}).then(()=>!0).catch(e=>(console.error(`Failed to write to log file: ${e.message}`),!1))}var Bl={__proto__:null,getLogFilePath:Ll,getPrevLogsFilePath:Fl,getPipelineLogFilePath:function(){return M.join(q.homedir(),".needle","optimization-pipeline","logs","pipeline.log")},writeToLogFileSync:Dl,writeToLogFile:ql};function Ml(e,t,n){process.env.GITHUB_ACTIONS&&(process.env.GITHUB_OUTPUT?u(process.env.GITHUB_OUTPUT,`${e}=${t}\n`):null==n||n.logger.warn("GITHUB_OUTPUT environment variable is not set. Cannot set output variables."))}async function Wl(e){var t;e.directory=x.resolve(e.directory);let{files:n,entrypoint:o}=El("deployment",e.directory);if(e.entrypoint&&(o=n.find(t=>t.path===e.entrypoint),!o))return process.exitCode=1,void j().fail(`Entrypoint "${e.entrypoint}" not found. Please make sure you provide a valid entrypoint.`);if(!o){const e=Uc(n);if("error"in e)return process.exitCode=1,ql(`[Deployment] Error determining entrypoint: ${e.error}`),void j().fail(`Error: ${e.error}`);o=e}if(!(n.length>0&&o&&(o.name.toLowerCase().endsWith(".html")||o.name.toLowerCase().endsWith(".html.gz")||o.name.toLowerCase().endsWith(".html.br"))))return process.exitCode=1,ql("[Deployment] Deployment is not valid: No .html file found."),void j().fail("Deployment is not valid: No .html file found.");if(!o)return process.exitCode=1,ql("[Deployment] No entrypoint found. Please provide an index.html file in your project."),void j().fail("No entrypoint found. Please provide an index.html file in your project.");const i=null!=(t=e.endpoint)&&t.length?e.endpoint:"https://cloud.needle.tools/api";let a=e.name;a||(a=Gl(e.directory)||void 0);let s=null==i?void 0:i.includes("localhost");const r=a?` of "${a}"`:"",c=j().start(`Begin deployment${r} ${s?"(local)":""} of ${n.length} files...`);c.spinner="earth",await Cc(50);let l=-1,p=null;const u=e.noProvenance?null:function(e=process.env,t,n){try{return function(e=process.env,t){try{if(_l(e.NEEDLE_CLOUD_NO_PROVENANCE))return null;let n=wl(t);_l(e.GITHUB_ACTIONS)&&(n=function(e,t){var n,o;const i=_l(t.GITHUB_SHA),a=_l(t.GITHUB_REF_NAME),s=_l(t.GITHUB_REPOSITORY),r=null!=(n=_l(t.GITHUB_SERVER_URL))?n:"https://github.com";if(!i&&!a)return e;const c={type:"git",...null!=e?e:{}};i&&(c.id=i),a&&(c.branch=a),s&&(c.repository=s),s&&i&&(c.url=`${r}/${s}/commit/${i}`);const l=String(null!=(o=c.id)?o:"").slice(0,7);return l&&(c.label=`${a||l}@${l}${c.dirty?" (dirty)":""}`),c}(n,e));const o=function(e=process.env){var t;if(!_l(e.CI))return{type:"local"};if(!_l(e.GITHUB_ACTIONS))return{type:"ci"};const n={type:"github-actions"},o=_l(e.GITHUB_RUN_ID),i=_l(e.GITHUB_REPOSITORY),a=null!=(t=_l(e.GITHUB_SERVER_URL))?t:"https://github.com";o&&(n.id=o);const s=xl(_l(e.GITHUB_ACTOR));return s&&(n.actor=s),_l(e.GITHUB_EVENT_NAME)&&(n.event=_l(e.GITHUB_EVENT_NAME)),o&&i&&(n.url=`${a}/${i}/actions/runs/${o}`),n}(e);return n||"local"!==o.type?{...n?{source:n}:{},runner:o,client:{name:"needle-cloud-cli"}}:null}catch(e){var n;return console.warn(`[provenance] Could not determine provenance: ${null!=(n=null==e?void 0:e.message)?n:e}`),null}}(e,t&&wl(t)?t:n)}catch(e){var o;return console.warn(`[provenance] Could not determine provenance: ${null!=(o=null==e?void 0:e.message)?o:e}`),null}}(process.env,e.directory);if(null!=u&&u.source){var d;const{label:e,author:t}=u.source;ql(`[provenance] ${e}${t?` by ${t}`:""} (${null==(d=u.runner)?void 0:d.type})`)}ql(`Deployment started${r} ${s?"(local)":""} of ${n.length} files...`);const m=await Jc({baseUrl:i,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:n,entrypoint:o,experimental:e.experimental,raw:e.raw,...u?{metadata:u}:{}},{name:a,type:"deployment",loglevel:e.verbose?"debug":"none",progress:e=>{if(e.fileIndex!==l){l=e.fileIndex;const t=e.totalBytes/1024/1024;c.text=`Uploading file ${e.fileIndex+1} of ${e.totalFiles} files: ${(e.uploadedBytes/1024/1024).toFixed(1)} / ${t.toFixed(1)} MB. Total progress: ${(100*e.progress01).toFixed(1)} %. Time passed: ${e.elapsedTime.toFixed(0)}sec. About ${e.estimatedTimeLeftDisplay} until complete.`}}}).catch(e=>(p=e instanceof Error?e.message:String(e),null));if(null!=m&&!0===m.success){c.succeed(`🚀 Deployment${r} successful (${m.content_id}/${m.id})`);let t="";t=m.url?m.url:"https://cloud.needle.tools/view/"+m.content_id+"/"+m.id,console.log("🔗 View the deployment at: "+t),e.open&&jl(t);try{Ml("deployment_url",t,{logger:e.logger}),Ml("edit_id",m.content_id,{logger:e.logger})}catch(t){e.logger.error("Error writing output for CI: "+t)}}else{process.exitCode=1;const e=p||(null==m?void 0:m.error)||"Deployment failed";ql(`[Deployment] Failed: ${e}`),c.fail(e)}}function Gl(e,t=0){if(t>10)return null;const n=x.join(e,"needle.config.json");if(r(n)){const t=x.join(e,"package.json");if(r(t)){var o;const e=l(t,"utf8"),n=JSON.parse(e);if(null!=(o=n.name)&&o.length)return n.name}return x.basename(e)}const i=x.dirname(e);return i===e?null:Gl(i,t+1)}async function Hl(e,t={}){const n=t.purposeLabel?` ${t.purposeLabel}`:"";if(!r(e.fileOrDirectory))return j().fail(`File not found: ${e.fileOrDirectory}`),{error:"File not found"};if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${kl()}`};if(void 0!==e.name&&e.name&&(e.name.length<=0||"true"===e.name||"false"===e.name))return{error:`Name is not valid: "${e.name}". Please provide a valid name`};e.fileOrDirectory=b(e.fileOrDirectory);const o=j(`Gathering files ${e.fileOrDirectory}`).start();let i=null;try{i=El("optimization",e.fileOrDirectory)}catch(t){return j().fail(`${t.message||`Failed to collect files in ${e.fileOrDirectory}`}`),{error:"Failed to collect files"}}o.text=`Uploading ${i.files.length} files${n}:\n- ${i.files.map(e=>e.path||e.name).join("\n -")}`;const a="https://cloud.needle.tools/api";e.verbose&&console.log("Using endpoint:",a);const s=function(e){var t,n;if(function(e){return e.some(e=>{let t=e.name.toLowerCase();return!!(t.endsWith(".html")||t.endsWith(".htm")||t.endsWith(".html.gz")||t.endsWith(".html.br"))||"mimetype"in e&&"text/html"===e.mimetype})}(e))return{kind:"deployment",contentType:void 0,uploadType:"deployment",canOptimize:!1,canConvertToGLB:!1};if(function(e){if(null==e||!e.length)return!1;const t=e.filter(e=>wc(e.name)||_c(e.name)||kc(e.name));return 1===t.length&&Uc(e)===t[0]}(e))return{kind:"environment-texture",contentType:"hdri",uploadType:void 0,canOptimize:!1,canConvertToGLB:!1};const o=null!=(t=null==(n=e[0])||null==(n=n.name.split(".").pop())?void 0:n.toLowerCase())?t:"";return{kind:"asset",contentType:"3d-asset",uploadType:void 0,canOptimize:e.some(e=>{var t;const n=null==(t=e.name.split(".").pop())?void 0:t.toLowerCase();return null!=n&&zc.has(n)}),canConvertToGLB:Lc.has(o)}}(i.files),c="asset"===s.kind?void 0:s.contentType,l=await Jc({baseUrl:a,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:i.files,entrypoint:i.entrypoint},{type:s.uploadType||"upload",name:e.name,content_type:c,...!1===t.optimizations?{optimizations:!1}:{},loglevel:e.verbose?"debug":"none",progress:e=>{o.text=`Uploading ${e.fileName} - finished in approx. ${e.estimatedTimeLeftDisplay}, ${100*e.progress01}%`}});if(0==l.success){const e=`${l.error||"Unknown error: could not start upload"}`;return o.fail(e),{error:e,noprint:!0}}const p=l.edit_url||`${Sl()}/${l.content_id}?select_team=1`;return o.succeed(l.uploadSkipped?`Files have already been uploaded to ${p}`:`Uploaded ${i.files.length} files${n} to ${p}`),{res:l,editUrl:p}}async function Jl(e){if(!e.outDir)throw new Error("Output directory is required");const t=j("Downloading results...").start(),n=await async function(e){const t=await async function(e){if(!e.identifier)return null;const t={...Fe(e)},n={job_id:e.identifier,fields:e.fields,content_format:e.content_format},o=e.baseUrl+Le.jobs.query,i=await fetch(o,{...De,method:"POST",headers:t,body:JSON.stringify(n)}).catch(e=>(console.error(e),null));if(null==i)return null;if(!i.ok)return console.error("Failed to get job",i.status,await i.text()),null;const a=await i.json().catch(e=>(console.error(e),null));return null==a?null:a.job}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,fields:["results"],content_format:e.content_format});if(null==t||!t.results)return{error:`Job ${e.identifier} did not produce any result files`};const n=t.results;if(!n.bucket||!n.directory)return{error:`Job ${e.identifier} has incomplete result data`};const o=[];for(const t of n.files){if((i=t.filename).startsWith(".extras/")||i.startsWith(".extras\\")||i.endsWith("screenshot.needle.webp")||qr.test(i)||i.endsWith(".needle.log"))continue;const a=`${n.directory}/${t.filename}`,s=await sl(e,e.identifier,{bucket:n.bucket,key:a});if(!s){console.error(`Failed to get presigned URL for: ${t.filename}`);continue}const r=await fetch(s).catch(e=>(console.error(e),null));if(!r||!r.ok){console.error(`Failed to download (${null==r?void 0:r.status} | ${null==r?void 0:r.statusText}): ${t.filename}`);continue}const c=await r.arrayBuffer().catch(e=>(console.error(e),null));if(!c)return{error:`Failed to read downloaded file: ${t.filename}`};o.push({filename:t.filename,data:c})}var i;return{files:o}}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,content_format:e.content_format});if("error"in n)return t.fail(n.error),{error:n.error};const o=[];for(const i of n.files){t.text=`Downloading ${i.filename}`,r(e.outDir)||d(e.outDir,{recursive:!0});let a=i.filename;if(e.filename){const t=i.filename.substring(i.filename.lastIndexOf("."));if(1===n.files.length)a=e.filename.includes(".")?e.filename:e.filename+t;else{const t=i.filename.substring(i.filename.lastIndexOf(".")),n=i.filename.substring(0,i.filename.lastIndexOf("."));a=e.filename+"-"+n+t}}const s=e.outDir+"/"+a,c=s.split("/").slice(0,-1).join("/");r(c)||d(c,{recursive:!0}),e.verbose&&console.log(`Writing ${i.filename} (${(i.data.byteLength/1024).toFixed(2)} KB) to "${s}"`),m(s,Buffer.from(i.data)),o.push(s)}return t.succeed(`Downloaded ${o.length} ${1===o.length?"file":"files"}: ${o.join(", ")}`),e.verbose&&console.log("Downloaded files:\n",o),{success:!0,paths:o}}async function Vl(e){const{token:t,org_id:n,slug:o,message:i,stream:a}=e;if(a){const e=fl({baseUrl:"https://cloud.needle.tools/api",authToken:t,org:n},{slug:o,message:i,stream:!0,source:"cli"});for await(const t of e)switch(t.type){case"delta":process.stdout.write(t.content);break;case"message":break;case"status":process.stdout.write(`[${t.message}]\n`);break;case"error":return void j().fail(t.message);case"tool_call":process.stdout.write(`[tool: ${t.name}]\n`);break;case"done":process.stdout.write("\n")}}else{const e=j("Thinking...").start(),a=await fl({baseUrl:"https://cloud.needle.tools/api",authToken:t,org:n},{slug:o,message:i,stream:!1,source:"cli"});e.stop(),console.log(a.content)}}async function Kl(e,t=pl){if(!e.identifier)throw new Error("A content identifier is required");return t({baseUrl:e.endpoint,authToken:e.authToken,org:e.org},e.identifier)}async function Yl(e){const t=new URL((e.endpoint||"https://cloud.needle.tools/api")+Le.get.deployments);t.searchParams.append("offset",e.offset.toString()),t.searchParams.append("limit",e.limit.toString()),e.names&&t.searchParams.append("name",e.names.map(e=>e.trim()).join(","));const n=await fetch(t,{method:"GET",headers:{...Fe({authToken:e.authToken,org:e.org})}});return n.ok?await n.json():{status:n.status,error:await n.text()}}const Zl=["#e06c75","#d19a66","#e5c07b","#98c379","#7ec8a4","#56b6c2","#61afef","#528bff","#c678dd","#e88de4","#be5046","#d4976c","#b5cea8","#4ec9b0","#9cdcfe","#c8ae9d"];function Xl(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;const[n,o,i]=function(e){const t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,255&t]}(Zl[Math.abs(t)%Zl.length]);return`[38;2;${n};${o};${i}m${e}`}function Ql(e){return`${e}`}const ep=8424,tp="http://localhost:8424",np=/^\[(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\]\s?(.*)$/,op=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}):\s*(.*)$/,ip=[[/^\[MCP\]|^MCP (New session|websocket server|Request|SSE|Bridge)|^Unknown MCP/,"mcp"],[/^Needle Cloud connection:|^Cloud tool (request|result|error):/,"cloud"],[/^Denied:/,"denial"],[/^Local (server|token)|^Starting Needle CLI server|^Restarting auth server|^Server is running|^Running server uses different/,"server"],[/^OIDC:|^Sign in|^Sign out|^User logged in|^Logged in successfully|^Token refresh failed|^Failed to validate (login|logout)|^Getting access token|^No access token|^ERR: Missing NEEDLE_CLOUD_TOKEN|^Too many logins|^WARN: You do not have a default organization|^User signed in|^Error during sign in/,"auth"],[/^Settings(:| changed)/,"settings"],[/^\[Deployment\]|^Deployment started/,"deployment"],[/^\[generate-material\]/,"ai"],[/^Active project changed|^Error saving project info/,"project"]],ap=[[/^ERR:|^ERROR:|^Error\b|^Failed\b/,"error"],[/\bconnection: error\b|\bFailed to\b|\b(Token refresh failed)\b|\b(rejected|terminating|pong timeout)\b/i,"error"],[/^WARN:|^WARNING:|^Warning\b/,"warn"]];function sp(e){for(const[t,n]of ip)if(t.test(e))return n;return"general"}function rp(e){for(const[t,n]of ap)if(t.test(e))return n;return"info"}const cp=new RegExp("\\b([A-Z][A-Z0-9_]*(?:_KEY|_TOKEN|_SECRET|_PASSWORD))=([^\\s,;\"']+)","g"),lp=new RegExp("\\b(User(?:name)?:\\s*)([A-Za-z0-9._\\-]{1,64})","g"),pp=new RegExp("\\b[A-Za-z0-9._%+\\-]+@[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,}\\b","g"),up=52428800;function dp(e,t){if(!T(e))return null;if(t<=0)return"";const{size:n}=R(e);if(0===n)return"";const o=n>t?n-t:0,i=n-o,a=Buffer.allocUnsafe(i),s=N(e,"r");try{let e=0;for(;e<i;){const t=P(s,a,e,i-e,o+e);if(0===t)break;e+=t}}finally{I(s)}if(o>0){const e=a.indexOf(10);return-1===e?"":a.slice(e+1).toString("utf8")}return a.toString("utf8")}async function*mp(e){const t=fe({input:U(e,{encoding:"utf8"}),crlfDelay:Infinity});for await(const e of t)yield e}function fp(e,t,n,o){var i,a;if(0===e.length)return[];const s=function(e){if("string"!=typeof e)return{ts:null,level:"info",source:"general",message:""};let t=null,n=e,o=e.match(np);if(o)t=o[1],n=o[2];else if(o=e.match(op),o){const e=new Date(`${o[1]}T${o[2]}`);Number.isNaN(e.getTime())||(t=e.toISOString(),n=o[3])}return{ts:t,level:rp(n),source:sp(n),message:n}}(e),r=null!=(i=null!=(a=s.ts)?a:n)?i:null,c=s.level,l=null!=t?t:s.source;return function(e){if("string"!=typeof e)return[e];if(e.length<=16384)return[e];const t=e.length,n=Math.max(1,16344),o=Math.ceil(t/n),i=[];for(let a=0;a<o;a++){const s=a*n,r=e.slice(s,s+n);i.push(`${r} [chunk ${a+1}/${o} of ${t} bytes]`)}return i}(function(e,t){if("string"!=typeof e)return e;if(0===e.length)return e;let n=Pl(e);return n=function(e,t){if(!t)return e;const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\\/g,"\\\\+"),o=new RegExp(n,"gi");return e.replace(o,"~")}(n,null==t?void 0:t.homeDir),n=function(e){return e.replace(cp,(e,t,n)=>`${t}=<redacted:${n.length}ch>`)}(n),n=function(e){return e.replace(lp,(e,t,n)=>`${t}<redacted:${n.length}ch>`)}(n),n=function(e){return e.replace(pp,e=>`<redacted:${e.length}ch>`)}(n),n}(s.message,o)).map(e=>({ts:r,level:c,source:l,message:e}))}const hp="https://haystack.needle.tools/api/ingest/logs",gp="https://haystack.needle.tools";async function vp(e){try{return await e.json()}catch{return null}}async function xp(e){try{return await e.text()}catch{return""}}function bp(e){const t=e instanceof Error?e.message:String(e),n=e&&"object"==typeof e?e.cause:void 0;let o=t;if(n){const e=n instanceof Error?n.message:String(n),t="object"==typeof n&&null!==n?n.code:void 0;o=t?`${e} (${t})`:e}return`Network error reaching ${hp}: ${o}`}var yp,wp={__proto__:null,HAYSTACK_RESOURCE:gp,runSendLogs:async function(e,t){var n;let o=await t.getAccessToken();if(!o&&t.recoverAuth)try{t.stdout.write("Updating sign-in (your stored permissions need a one-time refresh)...\n"),o=await t.recoverAuth()}catch{o=null}if(!o)return{ok:!1,error:"Not signed in. Run `needle-cloud login` first, then retry."};const i={type:"meta",...t.meta,mode:e.mode,...e.note?{note:e.note}:{}},a=t.findActiveEditorLog(),s=function(e){const t=he.from(async function*(e){if(yield JSON.stringify(e.meta)+"\n",e.prevLogPath&&T(e.prevLogPath)){let t=null;for await(const n of mp(e.prevLogPath)){const o=fp(n,null,t,e.redactOpts);for(const e of o)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}if(e.cliLogPath&&T(e.cliLogPath)){let t=null;for await(const n of mp(e.cliLogPath)){const o=fp(n,null,t,e.redactOpts);for(const e of o)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}if(e.editor){var t,n;const o=null!=(t=e.editor.tailBytes)?t:up,i=null!=(n=e.editor.paths)?n:e.editor.path?[e.editor.path]:[];for(const t of i){const n=dp(t,o);if(!n)continue;let i=null;try{i=R(t).mtime.toISOString()}catch{}for(const t of n.split("\n")){const n=fp(t,e.editor.editor,i,e.redactOpts);for(const e of n)e.ts&&(i=e.ts),yield JSON.stringify(e)+"\n"}}}if(e.pipelineLogPath&&T(e.pipelineLogPath)){var o;const t=null!=(o=e.pipelineTailBytes)?o:up,n=dp(e.pipelineLogPath,t);if(n){let t=null;try{t=R(e.pipelineLogPath).mtime.toISOString()}catch{}for(const o of n.split("\n")){const n=fp(o,"gltf-build-pipeline",t,e.redactOpts);for(const e of n)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}}}(e),{objectMode:!1});return t.pipe(ge())}({meta:i,cliLogPath:t.paths.cliLogPath,prevLogPath:t.paths.prevLogPath,editor:a,pipelineLogPath:null!=(n=t.paths.pipelineLogPath)?n:null,redactOpts:{homeDir:t.paths.homeDir}});if(e.dryRun){const{gunzipSync:e}=await import("node:zlib"),n=[];for await(const e of s)n.push(e);const o=e(Buffer.concat(n)).toString("utf8");return t.stdout.write(o),{ok:!0}}let r,c;try{const e=[];for await(const t of s)e.push(t);r=Buffer.concat(e)}catch(e){return{ok:!1,error:`Failed to build upload payload: ${e instanceof Error?e.message:String(e)}`}}try{c=await t.fetch(hp,{method:"POST",body:r,headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}catch(e){return{ok:!1,error:bp(e)}}if(401===c.status){const e=await xp(c);return{ok:!1,error:`401 Unauthorized from ${hp}: ${e&&e.length>0?e:"no reason given"} (try \`needle-cloud login\` if your sign-in expired; if you're already signed in, the server may not accept this token's issuer/audience)`}}if(429===c.status){const e=await xp(c);return{ok:!1,error:`429 Rate-limited: ${e&&e.length>0?e:"no reason given"}. You've hit the upload quota for this account; try again later.`}}if(413===c.status){const e=await vp(c);return{ok:!0,refId:null==e?void 0:e.ref_id,truncated:!0}}if(!c.ok){const e=await xp(c);return(400===(l=c.status)||l>=500)&&await async function({token:e,fetch:t,baseMeta:n,status:o,bodyText:i}){const{gzipSync:a}=await import("node:zlib"),s={type:"meta",...n,mode:"crash",note:"send-logs upload error follow-up"},r={ts:(new Date).toISOString(),level:"error",source:"send-logs",message:`Upload failed: status=${o} body=${(null!=i?i:"").slice(0,1024)}`},c=JSON.stringify(s)+"\n"+JSON.stringify(r)+"\n",l=a(Buffer.from(c,"utf8"));await t(hp,{method:"POST",body:l,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}({token:o,fetch:t.fetch,baseMeta:t.meta,status:c.status,bodyText:e}).catch(()=>{}),{ok:!1,error:`Server returned ${c.status}: ${e}`}}var l;const p=await vp(c);return{ok:!0,refId:null==p?void 0:p.ref_id,truncated:Boolean(null==p?void 0:p.truncated)}}};const _p={appId:"2stnsoa6a1b0gwc7lra55",appSecret:"seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",endpoint:"https://auth.needle.tools",resources:["https://cloud.needle.tools/api",gp],scopes:["openid","profile","email","roles","urn:logto:scope:organizations","urn:logto:scope:organization_roles","identities","custom_data","all","read","write","delete","upload","download","invite","editor","cli:logs:write"]},kp={getAccessToken:!0,fetchUserInfo:!0,resource:null==(yp=_p.resources)?void 0:yp[0],resources:_p.resources||[],scopes:_p.scopes||[]};function Sp(e="default"){return null==e?`${tp}/?signed-out=1`:"too-many-logins"===e?`${tp}/?too-many-logins=1`:"error"===e?`${tp}/?error=1`:`${tp}/?signed-out=1`}var jp;function Tp(){$p.clear(),s.existsSync(Ap)&&s.rmSync(Ap,{recursive:!0}),s.existsSync(Cp)&&s.rmSync(Cp,{recursive:!0})}const Ep=process.argv.includes("--debug-auth"),$p=new Map;let Op=null==(jp=_p.resources)?void 0:jp[0];if(Op)try{Op=new URL(Op).hostname}catch(e){Ep&&console.error("Invalid resource URL",Op)}let Rp=Op||"-";Rp=Rp.replace(/[^a-zA-Z0-9\.\-]/g,"");const Ap=x.join(ae(),".needle",".auth",Rp),Cp=`${se()}/Needle/Cloud/.auth/${Rp}`;!function(){if(s.existsSync(Cp)){Ep&&console.debug("Migrating auth data from legacy location",Cp,"→",Ap);try{s.existsSync(Ap)||s.mkdirSync(Ap,{recursive:!0,mode:448});for(const e of s.readdirSync(Cp)){const t=x.join(Cp,e),n=x.join(Ap,e);s.statSync(t).isFile()&&!s.existsSync(n)&&(s.copyFileSync(t,n),s.chmodSync(n,384))}s.rmSync(Cp,{recursive:!0}),Ep&&console.debug("Legacy auth data migrated successfully")}catch(e){Ep&&console.error("Failed to migrate legacy auth data",e)}}}();const Np={accessToken:`${Ap}/accessToken`,refreshToken:`${Ap}/refreshToken`,idToken:`${Ap}/idToken`,signInSession:`${Ap}/signInSession`};function Pp(e){return Np[e]||`${Ap}/${e}`}const Ip=new class{constructor(){this.basePath=Ap}async setItem(e,t){Ep&&console.debug("\n- SET ITEM",e,t),s.existsSync(this.basePath)||s.mkdirSync(this.basePath,{recursive:!0,mode:448});const n=Pp(e);n&&s.writeFileSync(n,t,{mode:384}),$p.set(e,t)}async getItem(e){Ep&&console.debug("\n- GET ITEM",e);const t=$p.get(e);if(void 0===t){const t=Pp(e);if(t){if(s.existsSync(t)){const n=s.readFileSync(t,"utf8");return $p.set(e,n),n}}else console.error(`Unknown token name: ${e}`);return null}return String(t)}async removeItem(e){Ep&&console.debug("\n- REMOVE ITEM",e),$p.delete(e);const t=Pp(e);if(t&&s.existsSync(t)){try{const e=s.statSync(t).size;e>0&&s.writeFileSync(t,Buffer.alloc(e,0),{mode:384})}catch{}s.rmSync(t)}}};let Up=null;function zp(){return Up||(Up=new me(_p,{storage:Ip,navigate:()=>{}})),Up}function Lp(){Up=null}let Fp=Promise.resolve();function Dp(e){const t=Fp.then(e,e);return Fp=t.then(()=>{},()=>{}),t}async function qp(e){return Bp(zp(),e)}async function Bp(e,t){try{const n=await Dp(()=>e.getAccessToken(t));return null!=n?n:null}catch(e){return function(e){return Boolean(e)&&"object"==typeof e&&"not_authenticated"===e.code}(e)||(ql(`Token refresh failed for resource ${t}: ${e instanceof Error?e.message:e}`),Mp(e)&&(ql(`Token refresh: clearing dead grant for resource ${t}`),Tp(),Up=null)),null}}function Mp(e){return function(e){var t,n;if(!e||"object"!=typeof e)return!1;const o=e,i=e=>{if("string"!=typeof e)return!1;const t=e.replace(/^oidc\./,"");return"invalid_grant"===t||"invalid_target"===t};return i(o.code)||i(null==(t=o.data)?void 0:t.error)||i(null==(n=o.data)?void 0:n.code)}(e)}async function Wp(){return qp(kp.resource)}function Gp(){return Vp(zp())}async function Hp(e){var t;if(!e)return{status:401,error:"Not authenticated"};const n=null==(t=e.userInfo)?void 0:t.custom_data;return n?n.default_org?n.default_org:(console.warn("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),ql("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),null):null}function Jp(e){return new me(_p,{storage:Ip,navigate:t=>{if(null==e.navigate)throw new Error("Can not navigate");e.navigate(t)}})}function Vp(e){return function(e,t){return Dp(()=>e.getContext(t))}(e,kp).then(t=>{const n=t;return n.client=e,n}).catch(async e=>{const t=e instanceof Error?e.message:String(e);return"oidc.invalid_token"==e.code||"oidc.invalid_grant"==e.code?(ql(`OIDC: ${e.code} – token refresh failed, clearing stale tokens`),Tp(),Up=null,console.error("Session expired – please log in again: npx needle-cloud login")):e.code?(console.error(e.code),ql(`OIDC: ${e.code} – ${t}`)):ql(`OIDC: getContext failed – ${t}`),null})}var Kp={__proto__:null,resetSharedClient:Lp,tryGetFreshAccessTokenForResource:qp,acquireAccessToken:Bp,shouldClearAuthOnError:Mp,tryGetFreshAccessToken:Wp,tryGetUser:Gp,tryGetDefaultOrgId:Hp,createNodeClient:Jp,getUserFromClient:Vp};let Yp=null;function Zp(e){var t;const n=null==(t=e.userInfo)?void 0:t.custom_data;if(!n)return[];const o=n.machines;return o?o.map(e=>e.name):[]}let Xp=Date.now();async function Qp(e){var t;const n=Date.now();n-Xp>3e4&&"client"in e&&(Xp=n,await e.client.fetchUserInfo().catch(console.error));const o=null==(t=e.userInfo)?void 0:t.custom_data;if(!o)return!1;if(Yp||await eu(),!Yp)return console.error("Failed to get machine id"),!0;const i=o.machines;if(!i)return!1;const a=i.some(e=>e.id===Yp);return a}async function eu(){return Yp||await import("node-machine-id").then(async e=>{const t=await e.default.machineId(!1);Yp=t}),Yp}function tu(){return ie.userInfo().username+"@"+ie.hostname()}async function nu(e,t={signout:!1}){if(e.accessToken){const o={machine_id:await eu(),machine_name:tu(),platform:ie.platform(),arch:ie.arch()},i=await fetch("https://cloud.needle.tools/api"+Le.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(e=>{var t,n;const o=(null==e||null==(t=e.cause)?void 0:t.code)||(null==e||null==(n=e.cause)?void 0:n.message)||(null==e?void 0:e.message)||"connection refused";return console.error(`Failed to validate login: ${o} - Make sure https://cloud.needle.tools/api is reachable`),ql(`Failed to validate login: "${o}" - Make sure https://cloud.needle.tools/api is reachable.`),{status:502,error:`Failed to validate login at 'https://cloud.needle.tools/api' (${o}) - make sure this URL is reachable.`}});if(!i)return!1;if("error"in i)return i;let a=!0;if(403===i.status){const e=await i.text();if(e.trimStart().startsWith("{")){const t=JSON.parse(e);t.logins&&(a=!1,ql("Too many logins from different machines"),j().fail("You have reached the maximum number of allowed logins\n"),j().warn(`Please logout from one of the following machines:\n- ${t.logins.join("\n- ")}\n`))}}var n;return!!a||(t.signout&&(Tp(),"client"in e&&(null==(n=e.client)||n.signOut(Sp("too-many-logins")))),!1)}return!0}let ou=null;function iu(){if(ou)return ou;{const e=ru();return ou=e,e}}const au="projects.json";function su(){const e=process.env.HOME||process.env.USERPROFILE||process.cwd(),t=y(e,".needle");return r(t)||d(t,{recursive:!0}),y(t,au)}function ru(){const e=su();if(!r(e))return{entries:[]};const t=l(e,"utf-8");try{const e=JSON.parse(t);return ou=e,e}catch(e){return console.error("Failed to parse project info file:",e),{entries:[]}}}const cu=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8"));function lu(){return cu.version}const pu=process.env.NEEDLE_SEARCH_ENDPOINT||"https://search.needle.tools",uu=process.env.NEEDLE_SEARCH_API_KEY||"da5737c00d6822c32a1b9e3b5dab094bfc17e205aef2f7f3e1a0fd4ebc77b79f",du=[{name:"needle_cloud_me",description:"Get current Needle Cloud user information",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},{name:"needle_search",description:"Search Needle Engine documentation, forum posts, and community discussions. Returns relevant content ranked by semantic similarity. Use this to find information about Needle Engine features, APIs, components, workflows, and troubleshooting.\n\nIMPORTANT: If search results seem irrelevant or low-quality (scores below 0.6, or results don't match the topic), retry with different search terms — up to 3 total attempts. Try varying your query: use specific class/method names, try shorter keyword-based queries, or rephrase the question. Do NOT guess or fabricate answers based on poor search results.",inputSchema:{type:"object",properties:{query:{type:"string",description:'What to search for, e.g. "how to add physics components" or "WebXR hand tracking" or "deploy to vercel"'},limit:{type:"number",description:"Maximum number of results to return (1-20, default 5)"}},additionalProperties:!1,required:["query"]}}],mu={needle_cloud_me:async function(e){try{const e=await Gp(),t=null==e?void 0:e.userInfo;return t?JSON.stringify({id:t.sub,name:t.name||t.preferred_username,email:t.email,profile_picture:t.picture}):"No user is currently logged in."}catch(e){return"Error retrieving user: "+(e instanceof Error?e.message:String(e))}},needle_search:async function(t){const n=t.query;if(!n||"string"!=typeof n)return{content:[{type:"text",text:"Error: query parameter is required."}]};const o=Math.min(Math.max(Number(t.limit)||5,1),20),i=`${pu}/api/semantic-search?q=${encodeURIComponent(n)}&limit=${o}`,a={Accept:"application/json"};uu&&(a.Authorization=`Bearer ${uu}`);try{const t=await e(i,{headers:a,signal:AbortSignal.timeout(15e3)});if(!t.ok){const e=await t.text().catch(()=>"");return{content:[{type:"text",text:`Search API error (${t.status}): ${e}`}]}}const o=await t.json();if(!o.results||0===o.results.length)return{content:[{type:"text",text:`No results found for: "${n}"`}]};const s=o.results.map((e,t)=>`## [${t+1}] ${e.title} (score: ${e.score})\nSource: ${e.source}${e.url?` — ${e.url}`:""}\n\n`+e.content+(e.truncated?`\n\n> Content truncated (${e.content.length} of ${e.contentLength} chars shown).${e.url?` Full content: ${e.url}`:""}`:"")).join("\n\n---\n\n");return{content:[{type:"text",text:`Found ${o.results.length} results for "${n}" (${o.durationMs}ms):\n\n${s}`}]}}catch(e){return{content:[{type:"text",text:`Search failed: ${e instanceof Error?e.message:String(e)}`}]}}}},fu=new Map;function hu(e,t){const n=du.findIndex(t=>t.name===e);-1!==n&&(du.splice(n,1),delete mu[e],t())}function gu(e,t,n,o){const i=du.findIndex(t=>t.name===e.name);if(-1!==i&&du.splice(i,1),du.push(e),mu[e.name]=t,vu.delete(e.name),null!=n&&n.source){const t=fu.get(n.source)||new Set;t.add(e.name),fu.set(n.source,t)}o()}const vu=new Map;async function xu(e,t){const n=mu[e];if(!n){const t=vu.get(e);if(t)return{isError:!0,content:[{type:"text",text:`This tool is currently unavailable because "${t}" disconnected. Please reconnect (e.g. reopen the browser tab) and try again. You should also call tools/list to refresh your available tools.`}]};throw new Error(`Tool "${e}" is not registered.`)}const o=await n(t);if("string"==typeof o)return{content:[{type:"text",text:o}]};if("object"==typeof o)return Array.isArray(o.content)?o:{content:[{type:"text",text:JSON.stringify(o)}]};throw new Error(`Invalid tool result type for tool "${e}".`)}const bu=200,yu=2e3,wu=new RegExp("^[A-Za-z0-9_./*?\\[\\]{},\\-]+$");function _u({pattern:e,glob:t,root:n,maxResults:o}){if("string"!=typeof e)throw new Error("invalid pattern: must be a string");if(e.length>yu)throw new Error(`invalid pattern: exceeds ${yu} characters`);if(null!=t&&""!==t){if("string"!=typeof t)throw new Error("invalid glob: must be a string");if(t.length>bu)throw new Error(`invalid glob: exceeds ${bu} characters`);if(!wu.test(t))throw new Error("invalid glob: contains disallowed characters")}const i=["-rn"];return t&&i.push(`--include=${t}`),i.push(`--max-count=${o}`,"-E",e,n),i}const ku=new Set;async function Su(e,t=ye){const n={check:"typescript",diagnostics:[]};if(!e)return{...n,status:"unavailable",message:"No connected web project. Open your project in the editor first."};const o=W(e),i=G(o,"tsconfig.json"),a=G(o,"node_modules/typescript/lib/tsc.js");if(!T(i))return{...n,status:"unavailable",message:"The connected web project has no tsconfig.json."};if(!T(a))return{...n,status:"unavailable",message:"TypeScript is not installed in the connected web project. Install the project dependencies first."};if(ku.has(o))return{...n,status:"error",message:"A check is already running for this project."};ku.add(o);try{const e={...process.env};delete e.NODE_OPTIONS,delete e.NODE_PATH;const{error:s,stdout:r,stderr:c}=await new Promise(n=>{t(process.execPath,[a,"--project",i,"--noEmit","--incremental","false","--pretty","false"],{cwd:o,shell:!1,timeout:1e4,maxBuffer:262144,windowsHide:!0,encoding:"utf8",env:e},(e,t,o)=>n({error:e,stdout:t,stderr:o}))});if(s&&(s.killed||"number"!=typeof s.code))return{...n,status:"error",message:s.killed?"Type checking exceeded the 10 second limit.":`Could not finish type checking: ${s.code||s.message}`,output:String(c||r).slice(0,4e3)};const l=[],p=[];for(const e of String(r).split(/\r?\n/)){const t=/^(?:(.+)\((\d+),(\d+)\): )?error (TS\d+): (.*)$/.exec(e);t?l.push({...t[1]?{file:t[1],line:Number(t[2]),column:Number(t[3])}:{},code:t[4],severity:"error",message:t[5]}):e.trim()&&(/^\s/.test(e)&&l.length?l[l.length-1].message+="\n"+e:p.push(e))}const u=Boolean(c||p.length||s&&!l.length);return{check:"typescript",project:o,status:u?"error":l.length?"failed":"passed",diagnostics:l.slice(0,100),totalDiagnostics:l.length,truncated:l.length>100,...u?{message:"The compiler did not return a complete diagnostic result.",output:[c,...p].join("\n").slice(0,4e3)}:{}}}finally{ku.delete(o)}}const ju=(e,t)=>String(null!=e?e:"").slice(0,t);function Tu(e){try{const t=new RegExp(e,"i");return{test:e=>t.test(e),mode:"regex"}}catch{const t=e.toLowerCase();return{test:e=>e.toLowerCase().includes(t),mode:"literal"}}}const Eu=function(e,t=Su,n=Date.now){let o;return async(i={})=>{var a,s,r,c;const l={status:"error",message:"Use mode check, results or error; file/code filters, nonnegative integer offset/index. No paths or commands can be selected."};if(!i||"object"!=typeof i||Array.isArray(i))return l;if(Object.keys(i).some(e=>!["mode","file","code","offset","index"].includes(e)))return l;const p=null!=(a=i.mode)?a:"check";if(!["check","results","error"].includes(p))return l;for(const e of[i.file,i.code])if(void 0!==e&&("string"!=typeof e||e.length>250))return l;for(const e of[i.offset,i.index])if(void 0!==e&&(!Number.isSafeInteger(e)||e<0))return l;const u=e();if(o&&o.project!==u&&(o=void 0),"check"===p&&(o={project:u,result:await t(u),time:n()}),!o)return{status:"unavailable",message:"No saved check for this local project. Run files_check_project with mode check first."};const d=o.result,m=null!=(s=d.diagnostics)?s:[],f=m.map((e,t)=>({...e,index:t})).filter(e=>{var t;return(!i.file||(null!=(t=e.file)?t:"").toLowerCase().includes(i.file.toLowerCase()))&&(!i.code||e.code===i.code)}),h=null!=(r=i.offset)?r:0,g="error"===p?f.filter(e=>{var t,n;return e.index===(null!=(t=i.index)?t:null==(n=f.at(-1))?void 0:n.index)}):f.slice(h,h+5);if("error"===p&&!g.length)return{status:"unavailable",message:"No matching error in the latest check. Use mode results to list available error indexes."};const v="error"===p?2e3:300;return{status:d.status,check:"typescript",checkedAt:new Date(o.time).toISOString(),cached:"check"!==p,project:ju(u,300),totalDiagnostics:null!=(c=d.totalDiagnostics)?c:m.length,retainedDiagnostics:m.length,matchingDiagnostics:f.length,truncated:Boolean(d.truncated),diagnostics:g.map(e=>({...e,...e.file?{file:ju(e.file,300)}:{},message:ju(e.message,v),messageTruncated:e.message.length>v})),..."error"!==p&&h+g.length<f.length?{nextOffset:h+g.length}:{},...d.message?{message:ju(d.message,500)}:{},...d.output?{output:ju(d.output,"error"===p?2e3:500),outputTruncated:d.output.length>("error"===p?2e3:500)}:{}}}}(()=>{var e;return null==(e=Ou())?void 0:e.web_location});function $u(e={}){gu({name:"files_editor_log_path",description:"Get the filepath to the editor log file on disk (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];if(null!=e&&e.log_location){const n=c(e.log_location).mtime;t.content.push({type:"text",text:`${e.log_location} (last modified: ${n.toLocaleString()})`})}else{let n="No recent project with known log location known.";e&&(n+=" Recent project is "+(null==e?void 0:e.project_location)),t.content.push({type:"text",text:n})}}return t},{source:"cli"},()=>{}),gu({name:"files_editor_project_path",description:"Get the filepath to the currently opened project in the editor (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.content.push(null!=e&&e.project_location?{type:"text",text:e.project_location}:{type:"text",text:"No recent project with known project location known."})}return t},{source:"cli"},()=>{}),gu({name:"files_editor_scene_path",description:"Get the filepath to the currently opened scene in the editor (Unity or Blender). Use this to find out which scene the user is working on.",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.content.push(null!=e&&e.scene_location?{type:"text",text:e.scene_location}:{type:"text",text:"No recent project with known scene location known."})}return t},{source:"cli"},()=>{}),gu({name:"files_web_project_path",description:"Get the filepath to the web project directory (the Needle Engine web frontend project).",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.content.push(null!=e&&e.web_location?{type:"text",text:e.web_location}:{type:"text",text:"No recent project with known web project location known."})}return t},{source:"cli"},()=>{}),gu({name:"files_read",description:"Read a file from the user's local project on disk (editor project or web project). The path must be relative to the project root or an absolute path inside the project. Returns the file contents (or a portion if offset/limit are specified). Use 'filter' to search for specific terms within the file.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path (relative to project root, or absolute within the project)"},offset:{type:"number",description:"Line number to start reading from (1-based, default: 1). In filter mode: number of matches to skip."},limit:{type:"number",description:"Maximum number of lines to return (default: 200, max: 1000). In filter mode: max matches to return."},filter:{type:"string",description:'Regex to search for in the file (case-insensitive, e.g. "error|warning"). Falls back to a literal substring match if the pattern isn\'t valid regex. Returns matching lines with line numbers instead of sequential content.'}},additionalProperties:!1,required:["path"]}},async e=>{const t=Cu(e.path);if(!t)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};try{const n=c(t.resolved).mtime.toISOString(),o=l(t.resolved,"utf-8").split("\n");if(e.filter){const i=Tu(e.filter),a=[];for(let e=0;e<o.length;e++)i.test(o[e])&&a.push(`${e+1}: ${o[e]}`);const s=a.length,r=Math.max(0,e.offset||0),c=Math.min(Math.max(e.limit||200,1),1e3),l=a.slice(r,r+c);return{content:[{type:"text",text:`File: ${t.resolved} (modified: ${n}) — filter="${e.filter}" (${i.mode}) → ${s} matches (showing ${r+1}-${r+l.length}) in ${o.length} lines\n`+l.join("\n")}]}}const i=Math.max(1,e.offset||1),a=Math.min(e.limit||200,1e3),s=o.slice(i-1,i-1+a),r=s.map((e,t)=>`${i+t}: ${e}`).join("\n");return{content:[{type:"text",text:`File: ${t.resolved} (${o.length} lines, modified: ${n}, showing ${i}-${i+s.length-1})\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading file: ${e.message}`}]}}},{source:"cli"},()=>{}),gu({name:"files_grep",description:"Search for a pattern in the user's local project files on disk (editor project and web project) using grep. Returns matching lines with file paths and line numbers. Note: runtime-only things (e.g. node-material shaders) have no source files — read those with the inspector_* tools instead.",inputSchema:{type:"object",properties:{pattern:{type:"string",description:"Search pattern (regular expression)"},glob:{type:"string",description:"File glob filter, e.g. '*.ts' or '*.cs' (optional)"},max_results:{type:"number",description:"Maximum number of matching lines to return (default: 50)"}},additionalProperties:!1,required:["pattern"]}},async e=>{const t=Au();if(0===t.length)return{content:[{type:"text",text:"Error: no active project found."}]};const n=Math.min(e.max_results||50,200),o=[];try{_u({pattern:e.pattern,glob:e.glob,root:".",maxResults:n})}catch(e){return{content:[{type:"text",text:`Error: ${e.message}`}]}}for(const a of t)try{const t=_u({pattern:e.pattern,glob:e.glob,root:a,maxResults:n});let s="";try{s=g("grep",t,{encoding:"utf-8",maxBuffer:1048576,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch(e){if(1!==(null==e?void 0:e.status))throw e;var i;s=(null==(i=e.stdout)||null==i.toString?void 0:i.toString())||""}if(s.trim()){const e=s.trim().split("\n").map(e=>e.startsWith(a)?e.substring(a.length+1):e);o.push(...e)}}catch{}if(0===o.length){const n=t.length>0?`\nSearched in:\n${t.join("\n")}`:"\nNo project directories available to search.";return{content:[{type:"text",text:`No matches found for pattern: ${e.pattern}${n}`}]}}const a=o.slice(0,n);return{content:[{type:"text",text:`Found ${o.length} matches${o.length>n?` (showing first ${n})`:""}:\n`+a.join("\n")}]}},{source:"cli"},()=>{}),gu({name:"files_list",description:"List files in the user's local project directories on disk matching an optional glob pattern. By default searches both the editor project (Unity/Blender) and the web project. Use the 'project' parameter to target a specific one. Results are prefixed with <web_project>/..., <unity>/..., or <blender>/... so you know which root each file belongs to.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Subdirectory to list (relative to the selected project root, default: root)"},pattern:{type:"string",description:"Glob pattern to filter files, e.g. '*.ts' or '*.glb'. Supports multiple patterns separated by '|', e.g. '*.gltf|*.glb' (optional)"},recursive:{type:"boolean",description:"Whether to list files recursively (default: false)"},project:{type:"string",enum:["web","editor"],description:"Which project root to search: 'web' for the Needle Engine web project (use this for exported assets, source files, node_modules), 'editor' for the Unity/Blender project. Omit to search both."}},additionalProperties:!1,required:[]}},async e=>{const t=Ou();if(!t)return{content:[{type:"text",text:"Error: no active project found."}]};const n="blender"===t.editor?"<blender>":"unity"===t.editor?"<unity>":"<editor_project>",o=[];if(e.project&&"editor"!==e.project||!t.project_location||o.push({root:b(t.project_location),label:n}),e.project&&"web"!==e.project||!t.web_location||o.push({root:b(t.web_location),label:"<web_project>"}),0===o.length)return{content:[{type:"text",text:"Error: no active project found."}]};const i=[];for(const{root:t,label:n}of o){const o=e.path?Ru(e.path,t):t;if(o)try{var a;const s=Pu(o,t,null!=(a=e.recursive)&&a,e.pattern,0);i.push(...s.map(e=>({file:e,root:t,label:n})))}catch{}}if(0===i.length)return{content:[{type:"text",text:"No files found."+(o.length>0?`\nSearched in:\n${o.map(e=>`${e.label} → ${e.root}`).join("\n")}`:"\nNo project directories available to search.")}]};const s=i.slice(0,500).map(e=>`${e.label}/${w(e.root,e.file)}`);return{content:[{type:"text",text:`Found ${i.length} files${i.length>500?" (showing first 500)":""}:\n`+s.join("\n")}]}},{source:"cli"},()=>{}),gu({name:"files_read_editor_log",description:"Read or search the Unity or Blender editor log file. By default reads the last N lines. Use the 'filter' parameter to search for specific terms (e.g. error messages, warnings, component names) across the entire log.",inputSchema:{type:"object",properties:{lines:{type:"number",description:"Number of lines to read from the end of the log (default: 100, max: 500). Ignored when filter is set."},filter:{type:"string",description:'Regex to search for in the log (case-insensitive, e.g. "error|exception|warning"). Falls back to a literal substring match if the pattern isn\'t valid regex. Returns all matching lines from the entire log instead of just the tail.'},offset:{type:"number",description:"Number of matching results to skip from the start (default: 0). Only used with filter."},limit:{type:"number",description:"Maximum number of matching results to return (default: 200, max: 500). Only used with filter."}},additionalProperties:!1,required:[]}},async e=>{const t=Ou();var n;if(null==t||!t.log_location)return ql(`read_editor_log: no editor log file known (project: ${null!=(n=null==t?void 0:t.project_location)?n:"none"})`),{content:[{type:"text",text:"Error: no editor log file known. Is a Unity or Blender project open?"}]};try{const n=l(t.log_location,"utf-8").split("\n");let o,i;if(e.filter){const t=Tu(e.filter);o=[];for(let e=0;e<n.length;e++)t.test(n[e])&&o.push(`L${e+1}: ${n[e]}`);const a=o.length,s=Math.max(0,e.offset||0),r=Math.min(Math.max(e.limit||200,1),500);o=o.slice(s,s+r),i=`filter="${e.filter}" (${t.mode}) → ${a} matches (showing ${s+1}-${s+o.length}) in ${n.length} total lines`}else{const t=Math.min(Math.max(e.lines||100,1),500);o=n.slice(-t),i=`last ${t} of ${n.length} lines`}const a="unity"===t.editor?function(e){const t=[],n=new Map;let o=!1,i=0;for(const a of e){if(/^\s+at\s/.test(a)||/^\s*(UnityEngine\.|System\.|Unity\.)/.test(a)||/^\s+\w+[\w.<>]+\s*\(/.test(a)){o||(o=!0,i=0),i++,i<=3?t.push(a):4===i&&t.push(" ... (stack trace truncated)");continue}if(o=!1,i=0,!a.trim())continue;const e=n.get(a)||0;if(n.set(a,e+1),0===e)t.push(a);else if(1===e)t.push(` [repeated ${e+1}x] ${a}`);else{const n=t.length-1;n>=0&&t[n].startsWith(" [repeated")&&(t[n]=` [repeated ${e+1}x] ${a}`)}}return t}(o):o,s=5e4;let r=a.join("\n"),c="";if(r.length>s){r=r.substring(r.length-s);const e=r.indexOf("\n");e>0&&(r=r.substring(e+1)),c=" (output truncated to last ~50KB)"}return{content:[{type:"text",text:`Editor log: ${t.log_location} (${i}, ${a.length} after processing, editor: ${t.editor})${c}:\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading log: ${e.message}`}]}}},{source:"cli"},()=>{}),gu({name:"files_read_gltf",description:"Read and summarize a glTF or GLB file from the user's local project on disk. Without a query, returns a structured summary including nodes, meshes, materials, animations, extensions, and compression/optimization hints. Use 'query' to drill into specific parts using JSON pointer paths. Use '*' as a wildcard for array indices or object keys. For GLB files, extracts the JSON chunk and skips binary data.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path to a .gltf or .glb file (relative to project root, or absolute path)"},query:{type:"string",description:"JSON pointer path to extract a specific part of the glTF, e.g. '/nodes/0', '/materials', '/extensions/NEEDLE_progressive', '/materials/*/extensions'. Use '*' as a wildcard for array indices or object keys."}},additionalProperties:!1,required:["path"]}},async e=>{let t=Cu(e.path);if(!t)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};if(!r(t.resolved))return{content:[{type:"text",text:`Error: file not found: ${t.resolved}`}]};try{const n=function(e){const t=e.toLowerCase();if(t.endsWith(".gltf")){const t=l(e,"utf-8");return JSON.parse(t)}if(t.endsWith(".glb")){const t=l(e);if(t.length<20)return null;if(1179937895!==t.readUInt32LE(0))return null;const n=t.readUInt32LE(12);if(1313821514!==t.readUInt32LE(16))return null;const o=t.toString("utf-8",20,20+n);return JSON.parse(o)}return null}(t.resolved);if(!n)return{content:[{type:"text",text:"Error: could not parse glTF/GLB file."}]};const o=5e4;if(e.query){const i=Nu(n,e.query.replace(/^\//,"").split("/"));if(void 0===i)return{content:[{type:"text",text:`No data found at pointer: ${e.query}`}]};let a=JSON.stringify(i),s=!1;return a.length>o&&(a=a.substring(0,o),s=!0),{content:[{type:"text",text:`${e.query} in ${t.resolved}`+(s?` (truncated to ${o} chars)`:"")+"\n"+a}]}}let i=function(e,t){var n,o,i,a,s,r,c,l,p,u,d,m,f;const h=[`glTF: ${t}`];if(e.asset){const t=[];e.asset.version&&t.push(`v${e.asset.version}`),e.asset.generator&&t.push(e.asset.generator),h.push(`Asset: ${t.join(", ")}`)}if(null!=(n=e.extensionsUsed)&&n.length&&h.push(`Extensions used: ${e.extensionsUsed.join(", ")}`),null!=(o=e.extensionsRequired)&&o.length&&h.push(`Extensions required: ${e.extensionsRequired.join(", ")}`),null!=(i=e.scenes)&&i.length&&h.push(`Scenes: ${e.scenes.length}${void 0!==e.scene?` (default: ${e.scene})`:""}`),null!=(a=e.nodes)&&a.length){var g,v,x;h.push(`\nNodes (${e.nodes.length}):`);const t=null!=(g=null==(v=e.scenes)||null==(v=v[null!=(x=e.scene)?x:0])?void 0:v.nodes)?g:[],n=new Set,o=(t,i)=>{if(i>6||n.has(t))return;n.add(t);const a=e.nodes[t];if(!a)return;const s=" ".repeat(i),r=[];if(void 0!==a.mesh&&r.push(`mesh:${a.mesh}`),void 0!==a.camera&&r.push(`camera:${a.camera}`),void 0!==a.skin&&r.push(`skin:${a.skin}`),a.extensions&&r.push(`ext:[${Object.keys(a.extensions).join(",")}]`),h.push(`${s}- ${a.name||`node_${t}`}${r.length?` (${r.join(", ")})`:""}`),a.children)for(const e of a.children)o(e,i+1)};for(const e of t)o(e,1);n.size<e.nodes.length&&n.size>0&&h.push(` ... and ${e.nodes.length-n.size} more nodes`)}if(null!=(s=e.meshes)&&s.length){h.push(`\nMeshes (${e.meshes.length}):`);for(const t of e.meshes.slice(0,30)){var b,y;const e=null!=(b=null==(y=t.primitives)?void 0:y.length)?b:0;h.push(` - ${t.name||"(unnamed)"} (${e} primitive${1!==e?"s":""})`)}e.meshes.length>30&&h.push(` ... and ${e.meshes.length-30} more`)}if(null!=(r=e.materials)&&r.length){h.push(`\nMaterials (${e.materials.length}):`);for(const t of e.materials.slice(0,30)){const e=t.name||"(unnamed)",n=[];t.pbrMetallicRoughness&&n.push("PBR"),t.alphaMode&&"OPAQUE"!==t.alphaMode&&n.push(t.alphaMode),t.doubleSided&&n.push("doubleSided"),t.extensions&&n.push(`ext:[${Object.keys(t.extensions).join(",")}]`),h.push(` - ${e}${n.length?` (${n.join(", ")})`:""}`)}e.materials.length>30&&h.push(` ... and ${e.materials.length-30} more`)}if(null!=(c=e.textures)&&c.length&&h.push(`Textures: ${e.textures.length}`),null!=(l=e.images)&&l.length&&h.push(`Images: ${e.images.length}`),null!=(p=e.animations)&&p.length){h.push(`\nAnimations (${e.animations.length}):`);for(const t of e.animations.slice(0,20)){var w,_;const e=null!=(w=null==(_=t.channels)?void 0:_.length)?w:0;h.push(` - ${t.name||"(unnamed)"} (${e} channel${1!==e?"s":""})`)}e.animations.length>20&&h.push(` ... and ${e.animations.length-20} more`)}if(null!=(u=e.skins)&&u.length){h.push(`\nSkins (${e.skins.length}):`);for(const t of e.skins.slice(0,10)){var k,S;h.push(` - ${t.name||"(unnamed)"} (${null!=(k=null==(S=t.joints)?void 0:S.length)?k:0} joints)`)}}if(null!=(d=e.cameras)&&d.length){h.push(`\nCameras (${e.cameras.length}):`);for(const t of e.cameras)h.push(` - ${t.name||"(unnamed)"} (${t.type})`)}if(null!=(m=e.buffers)&&m.length){const t=e.buffers.reduce((e,t)=>e+(t.byteLength||0),0);h.push(`\nBuffers: ${e.buffers.length} (${(t/1024/1024).toFixed(1)} MB total)`)}return null!=(f=e.accessors)&&f.length&&h.push(`Accessors: ${e.accessors.length}`),h.join("\n")}(n,t.resolved);return i.length>o&&(i=i.substring(0,o)+"\n... (truncated)"),{content:[{type:"text",text:i}]}}catch(e){return{content:[{type:"text",text:`Error reading glTF: ${e.message}`}]}}},{source:"cli"},()=>{}),gu(ul.schema,async e=>{const t=await ul.execute(e);return"error"in t?{content:[{type:"text",text:t.error}]}:{content:[{type:"text",text:t.content}]}},{source:"cli"},()=>{}),gu({name:"files_check_project",description:"Check the connected local web project for TypeScript errors without emitting files or applying fixes. Default mode check runs its installed compiler (10 second limit) and returns up to 5 short diagnostics. Use mode results with file/code filters and offset to browse the latest check without rerunning. Use mode error with an index for details; omit index for the last matching error. Results are timestamped snapshots, retained until another check or project change, or CLI exit: run check again after edits. Retains at most 100 diagnostics. Reports current errors, not whether they predate edits. Not a linter or Unity/Blender compiler.",inputSchema:{type:"object",properties:{mode:{type:"string",enum:["check","results","error"],description:"Run a new check, browse cached results, or inspect one cached error."},file:{type:"string",maxLength:250,description:"Filter diagnostic filenames by case-insensitive substring; does not select a project or restrict compiler inputs."},code:{type:"string",maxLength:250,description:"Exact diagnostic code, e.g. TS2322."},offset:{type:"integer",minimum:0,description:"Offset within filtered results; 5 errors per page."},index:{type:"integer",minimum:0,description:"Diagnostic index from the latest check for mode error; defaults to the last matching error."}},additionalProperties:!1,required:[]}},async e=>{const t=await Eu(e);return{content:[{type:"text",text:JSON.stringify(t)}],isError:"error"===t.status||"unavailable"===t.status}},{source:"cli"},()=>{}),null!=e&&e.logToolCount&&ql(`[MCP] registered ${du.length} built-in tools: ${du.map(e=>e.name).join(", ")}`)}function Ou(){var e;const t=iu();return null!=t&&null!=(e=t.entries)&&e.length?t.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0]:null}function Ru(e,t){const n=b(t,e),o=b(t);return n.startsWith(o+_)||n===o?n:null}function Au(){const e=Ou();if(!e)return[];const t=[];return e.project_location&&t.push(b(e.project_location)),e.web_location&&t.push(b(e.web_location)),t}function Cu(e){const t=Au();for(const n of t){const t=Ru(e,n);if(t&&r(t))return{resolved:t,root:n}}for(const n of t){const t=Ru(e,n);if(t)return{resolved:t,root:n}}const n=b(e);for(const e of t)if(n.startsWith(e+_)||n===e)return{resolved:n,root:e};return null}function Nu(e,t){if(0===t.length||null==e)return e;const[n,...o]=t;if("*"!==n)return Nu(e[/^\d+$/.test(n)?Number(n):n],o);if(Array.isArray(e)){const t=e.map(e=>Nu(e,o)).filter(e=>void 0!==e);return t.length>0?t:void 0}if("object"==typeof e){const t={};for(const n of Object.keys(e)){const i=Nu(e[n],o);void 0!==i&&(t[n]=i)}return Object.keys(t).length>0?t:void 0}}function Pu(e,t,n,o,i){if(i>10)return[];const a=[],s=p(e,{withFileTypes:!0}),r="node_modules"===(e.split("/").pop()||e.split("\\").pop()||"");for(const c of s){if(r){if(".needle"!==c.name&&".vite"!==c.name)continue}else{if("Library"===c.name)continue;if(c.name.startsWith(".")||"node_modules"===c.name){if(!n)continue;if(c.name.startsWith("."))continue}}const s=y(e,c.name);if(c.isDirectory())n&&a.push(...Pu(s,t,!0,o,i+1));else{if(o&&!o.split("|").map(e=>(e=e.trim()).startsWith(".")&&!e.startsWith("*.")?"*"+e:e).filter(Boolean).some(e=>_e(c.name,e,{nocase:!0})))continue;a.push(s)}}return a}const Iu="settings.json";function Uu(){return G(B(),".needle")}function zu(e){const t=G(null!=e?e:Uu(),Iu);if(!T(t))return{};try{const e=JSON.parse(z(t,"utf-8"));return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch{return{}}}function Lu(e){return"disabled"===zu(e).remote_ai_tools}function Fu(e,t){if(!T(e))try{E(e,{recursive:!0})}catch{}let n=null,o=null;try{n=F(e,{persistent:!1},(e,n)=>{n&&n.toString()!==Iu||(o&&clearTimeout(o),o=setTimeout(()=>{o=null;try{t()}catch{}},50))}),null==n.on||n.on("error",()=>{})}catch{}return()=>{o&&(clearTimeout(o),o=null);try{var e;null==(e=n)||e.close()}catch{}n=null}}var Du={__proto__:null,KNOWN_SETTINGS:{remote_ai_tools:{displayName:"Remote AI tools",default:"enabled",description:"Allow Needle Cloud AI chat to dispatch tool calls (file reads, search, etc.) to this machine.",command:"needle-cloud settings remote-ai-tools <true|false>"}},defaultSettingsDir:Uu,readSettings:zu,writeSetting:function(e,t,n){const o=zu(e);null===n?delete o[t]:o[t]=n,E(e,{recursive:!0}),L(G(e,Iu),JSON.stringify(o,null,2)+"\n","utf-8")},areRemoteAiToolsDisabled:Lu,watchSettings:Fu};const qu=2e3,Bu=6e4,Mu=25e3,Wu=1e4,Gu=o();let Hu=null,Ju=null,Vu=null,Ku=null,Yu=qu,Zu=!1,Xu=!1;function Qu(){Hu||(Lu()?ql("Needle Cloud connection: skipped (remote_ai_tools disabled in settings)"):(Zu=!1,Ju&&(clearTimeout(Ju),Ju=null),Yu=qu,td()))}function ed(e){Zu=!0,nd(),Ju&&(clearTimeout(Ju),Ju=null),Hu?(ql(`Needle Cloud connection: closing (reason: ${null!=e?e:"shutdown"})`),Hu.close(1e3,null!=e?e:"shutdown"),Hu=null):e&&ql(`Needle Cloud connection: disconnect requested (reason: ${e}) — no active connection`)}async function td(){let e=await Wp();if(e||(e=function(){const e=Pp("accessToken");if(s.existsSync(e)){const t=s.readFileSync(e,"utf8");if(t){const e=JSON.parse(t),n=null==e?void 0:e["@https://cloud.needle.tools/api"];return null==n?void 0:n.token}}return null}(),e&&ql("Needle Cloud connection: using cached token (refresh failed)")),!e)return Xu||(ql("Needle Cloud connection: skipped (not logged in)"),Xu=!0),void od(!0);Xu=!1;const t="https://cloud.needle.tools/api".replace(/^http/,"ws")+"/v1/cli/ws?token="+encodeURIComponent(e)+"&instance="+encodeURIComponent(Gu);ql("Needle Cloud connection: connecting...");const n=`needle-cloud/${lu()} Node/${process.versions.node}`;Hu=new xe(t,{headers:{"User-Agent":n,Origin:"cli://needle-cloud"}}),Hu.on("open",()=>{Yu=qu,ql("Needle Cloud connection: established"),function(){var e,t,n,o,i;if(!Hu||Hu.readyState!==xe.OPEN)return;const a=iu(),s=null==a||null==(e=a.entries)||null==(e=e.sort((e,t)=>t.last_accessed-e.last_accessed))?void 0:e[0],r={type:"presence",editor:null!=(t=null==s?void 0:s.editor)?t:"unknown",project:null!=(n=null==s?void 0:s.project_location)?n:null,scene:null!=(o=null==s?void 0:s.scene_location)?o:null,web_project:null!=(i=null==s?void 0:s.web_location)?i:null,cli_version:lu()};Hu.send(JSON.stringify(r))}(),function(){if(!Hu||Hu.readyState!==xe.OPEN)return;try{$u()}catch(e){ql(`Needle Cloud connection: registerServerTools failed: ${e}`)}const e=du.map(e=>e.name);var t;ql(`Needle Cloud connection: sending ${e.length} tools: ${e.join(", ")}`),Hu.send(JSON.stringify({type:"tools",tools:(t=du,t.map(e=>{var t;return{name:e.name,description:e.description,inputSchema:e.inputSchema,capability:null!=(t=e.capability)?t:"local"}}))}))}(),nd(),Vu=setInterval(()=>{Hu&&Hu.readyState===xe.OPEN&&(Hu.ping(),Ku=setTimeout(()=>{ql("Needle Cloud connection: pong timeout, terminating"),Hu&&Hu.terminate()},Wu))},Mu)}),Hu.on("pong",()=>{Ku&&(clearTimeout(Ku),Ku=null)}),Hu.on("message",e=>{try{const n=JSON.parse(e.toString());var t;"execute_tool"===n.type&&n.requestId&&n.toolName&&async function(e,t,n){ql(`Cloud tool request: ${t}(${Object.keys(n).length>0?" "+Object.entries(n).map(([e,t])=>`${e}=${JSON.stringify(t)}`).join(", "):""}) [${e}]`);const o=Date.now();try{var i,a;const s=await xu(t,n);ql(`Cloud tool result: ${t} → ${null!=(i=null==s||null==(a=s.content)?void 0:a.reduce((e,t)=>{var n;return e+((null==(n=t.text)?void 0:n.length)||0)},0))?i:0} chars in ${Date.now()-o}ms [${e}]`),Hu&&Hu.readyState===xe.OPEN&&Hu.send(JSON.stringify({type:"tool_result",requestId:e,result:s}))}catch(n){const i=n instanceof Error?n.message:String(n);ql(`Cloud tool error: ${t} → ${i} in ${Date.now()-o}ms [${e}]`),Hu&&Hu.readyState===xe.OPEN&&Hu.send(JSON.stringify({type:"tool_result",requestId:e,error:i}))}}(n.requestId,n.toolName,null!=(t=n.args)?t:{})}catch{}}),Hu.on("close",(e,t)=>{const n=(null==t?void 0:t.toString())||"";ql(`Needle Cloud connection: closed (code=${e}${n?" "+n:""})`),nd(),Hu=null,Zu||od()}),Hu.on("error",e=>{ql(`Needle Cloud connection: error - ${e.message||"connection refused"} (is https://cloud.needle.tools/api reachable?)`)})}function nd(){Vu&&(clearInterval(Vu),Vu=null),Ku&&(clearTimeout(Ku),Ku=null)}function od(e=!1){Zu||Ju||(e||ql(`Needle Cloud connection: reconnecting in ${Yu/1e3}s`),Ju=setTimeout(()=>{Ju=null,td()},Yu),Yu=Math.min(2*Yu,Bu))}const id=e=>{const t=ve();return t.use("/:action",async(t,n,o)=>{const{action:i}=t.params,a=Jp({navigate:e=>{n.redirect(e)}});switch(i){case"sign-in":e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,ql("Sign in..."),await a.clearAllTokens(),Lp();try{await a.signIn(`${tp}/auth-callback`)}catch(e){const t=null==e?void 0:e.cause,o=`Sign-in failed: ${null!=t&&t.code?`${t.code}${t.address?` (${t.address}:${t.port})`:""}`:(null==e?void 0:e.message)||"unknown error"}`;return ql(o),console.error(o),n.status(502).send(o)}break;case"sign-out":{var s,r;const t=await Gp(),n=(null==t||null==(s=t.userInfo)?void 0:s.sub)||(null==t||null==(r=t.claims)?void 0:r.sub),o=null==t?void 0:t.accessToken;ql(`Sign out... (${n})`),n&&o&&await async function(e){return!e.accessToken||import("node-machine-id").then(async t=>{const n=await eu();return Yp=n,await fetch("https://cloud.needle.tools/api"+Le.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify({action:"logout",machine_id:n,machine_name:tu()})}).catch(e=>{ql(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`),console.error(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`)}),!0})}({userId:n,accessToken:o}).catch(e=>{console.error(e),ql(`Failed to validate logout: ${e}`)}),e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,console.log("User signed out"+(n?`: ${n}`:"")),await a.signOut(Sp()),Lp();break}case"auth-callback":if(t.url){const o=await a.handleSignInCallback(`${tp}${t.originalUrl}`).catch(e=>({error:e}));if(Lp(),o&&"error"in o){ql(`Error during sign in: ${o.error}`);const e=o.error instanceof Error?o.error.message:String(o.error);n.redirect(tp+"?cancelled&message="+encodeURIComponent(e))}else{var c,l,p,u;const t=await Gp();if(null!=t&&t.isAuthenticated){var d,m;e.invalid_login=!1,e.user_email=(null==(d=t.claims)?void 0:d.email)||(null==(m=t.userInfo)?void 0:m.email)||null,e.logged_in_machine_names=[...Zp(t)];const o=await nu(t,{signout:!0});if(!o)return e.invalid_login=!0,e.invalid_login_type="too-many-logins",n.redirect(Sp("too-many-logins"));if("object"==typeof o&&"error"in o)return e.invalid_login=!0,e.invalid_login_type="error",e.error=o.error,n.redirect(Sp("error"));Lp()}console.log(`User logged in: ${(null==t||null==(c=t.userInfo)?void 0:c.sub)||(null==t||null==(l=t.claims)?void 0:l.sub)}`),ql(`User logged in: ${(null==t||null==(p=t.userInfo)?void 0:p.sub)||(null==t||null==(u=t.claims)?void 0:u.sub)}`),Qu(),n.redirect(tp)}}break;default:o()}}),t};function ad(e){var t,n,o,i;if(!e)return"";let a=(null==(t=e.claims)?void 0:t.name)||(null==(n=e.userInfo)?void 0:n.name)||(null==(o=e.claims)?void 0:o.username)||"";var s;return(!a||a.length<=0)&&null!=(i=e.claims)&&i.email?function(e){return e?(e=(e=(e=(e=e.split("@")[0]).replace(/[^a-zA-Z0-9]/g," ")).replace(/\s+/g," ")).split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),e):e}(null==(s=e.claims)?void 0:s.email):a}async function sd(e,t=null){var n,o;if(!e)return{status:500,error:"User is not provided"};if(!e.isAuthenticated)return{status:403,error:"User is not authenticated"};const i=(null==(n=e.claims)?void 0:n.sub)||(null==(o=e.userInfo)?void 0:o.sub);t===i&&(t=null);let a=null;if(null==t)a=e.accessToken;else if(null!=t){var s;let n=null==e||null==(s=e.userInfo)||null==(s=s.organization_data)?void 0:s.find(e=>e.id===t);if(!n){var r;const o=t.toLowerCase();n=null==e||null==(r=e.userInfo)||null==(r=r.organization_data)?void 0:r.find(e=>e.name.toLowerCase()===o)}if(!n)return{status:403,error:`User is not part of team "${t}"`};t=n.id,a=await e.client.getOrganizationToken(n.id).catch(e=>{var o;return console.error(`Error getting organization token for "${null==(o=n)?void 0:o.name}" (${t}): ${e.message}`),null})}return a?{authToken:a,org:t}:{status:403,error:"No access token found"}}const rd=function(){return async(e,t,n)=>{const o=await Gp();Object.defineProperty(e,"user",{enumerable:!0,get:()=>o}),n()}},cd=`${tp}/mcp`,ld="2025-06-18",pd={name:"Needle Cloud MCP",version:"1.0.0"};function ud(e){return{jsonrpc:"2.0",id:e,result:{protocolVersion:ld,capabilities:{tools:{listChanged:!0}},serverInfo:pd}}}async function dd(e,t){const n=!0===(null==t?void 0:t.proxy),{method:o,params:i,id:a}=e;if("initialize"===o)return ud(null!=a?a:0);if("ping"===o)return{jsonrpc:"2.0",id:a,result:{}};if("notifications/initialized"===o||"notifications/cancelled"===o)return null;if("tools/list"===o){try{$u()}catch{}let e=du;if(n){const t=await async function(){try{var e,t;const n=await fetch(cd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list"}),signal:AbortSignal.timeout(2e3)});return n.ok&&null!=(e=null==(t=(await n.json()).result)?void 0:t.tools)?e:[]}catch{return[]}}();if(t.length>0){const n=new Set(du.map(e=>e.name));e=[...du,...t.filter(e=>!n.has(e.name))]}}return{jsonrpc:"2.0",id:a,result:{tools:e}}}if("tools/call"===o){const e=null==i?void 0:i.name;try{$u()}catch{}try{return{jsonrpc:"2.0",id:a,result:await xu(e,(null==i?void 0:i.arguments)||{})}}catch(t){if(n)try{const t=await async function(e,t){const n=await fetch(cd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:e,arguments:t}}),signal:AbortSignal.timeout(35e3)}),o=await n.json();if(o.error)throw new Error(o.error.message);return o.result}(e,(null==i?void 0:i.arguments)||{});return{jsonrpc:"2.0",id:a,result:t}}catch{}return{jsonrpc:"2.0",id:a,error:{code:-32603,message:`Tool execution failed: ${t.message}`}}}}return{jsonrpc:"2.0",id:null!=a?a:null,error:{code:-32601,message:`Method '${o}' not found`}}}function md(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let fd=!1;const hd=ve(),gd=new Set,vd=new Map;let xd=0;function bd(){const e=[];for(const[t,{connectedAt:n,userAgent:o}]of vd)e.push({id:t,connectedAt:n,userAgent:o});return e}function yd(e,t,n){if((t.headers.accept||"").includes("text/event-stream")){n.setHeader("Content-Type","text/event-stream"),n.setHeader("Cache-Control","no-cache"),n.setHeader("Connection","keep-alive"),n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),n.flushHeaders(),n.write(": connected\n\n");const o=t.headers["user-agent"]||"";return vd.set(e,{id:e,client:n,connectedAt:Date.now(),userAgent:o}),console.log(`[MCP] SSE client connected (ID: ${e}) ${o}. Total clients: ${vd.size}`),ql(`MCP SSE client connected (ID: ${e}) ${o}. Total clients: ${vd.size}`),t.on("close",()=>{console.log(`[MCP] SSE client disconnected (ID: ${e}): ${o}`),ql(`MCP SSE client disconnected (ID: ${e}): ${o}`),vd.delete(e)}),!0}return!1}function wd(e){if(!Array.isArray(e))return console.error("Invalid input: paths should be an array of strings."),null;for(const t of e)if(!1!==r(t))try{const e=_d(t);if(e)return e}catch(e){}}function _d(e){const t=y(e,".git");if(r(t)){const e=function(e){const t=f(e);if(t.isDirectory())return y(e,"config");if(t.isFile()){const t=l(e,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(t){let n=t[1].trim();k(n)||(n=b(S(e),n));const o=y(n,"config");if(r(o))return o;const i=y(n,"commondir");if(r(i)){let e=l(i,"utf-8").trim();return k(e)||(e=b(n,e)),y(e,"config")}}}return null}(t);if(e&&r(e)){const t=function(e){const t=l(e,"utf-8"),n=/\[remote\s+"(?<name>.+?)"\].+?url\s*=\s*(?<url>.+?)$/gms,o=[];let i;for(;null!==(i=n.exec(t));)if(i.groups){const e=i.groups.name,t=i.groups.url.trim();t.length&&o.push({name:e,url:t})}const a=o.find(e=>"origin"===e.name)||o.find(e=>"upstream"===e.name)||o[0];return a?a.url:null}(e);if(t)return t}}const n=y(e,".plastic");if(r(n)){const e=y(n,"replicas.db");if(r(e)){const t=l(e,"utf-8").split("\n");for(const e of t){const t=e.split("=");if(2===t.length&&"repo"===t[0].trim()){const e=t[1].trim();if(e.length)return e}}}}const o=y(e,"..");return o===e?null:_d(o)}hd.get("/mcp",async(e,t)=>{if(yd(xd++,e,t))return;const n=function(e){const t=[...du].sort((e,t)=>e.name.localeCompare(t.name)),n=t.map(e=>`\n <div class="tool">\n <span class="tool-name">${md(e.name)}</span>\n <span class="tool-desc">${md(function(e){const t=e.indexOf("\n");return-1===t?e:e.slice(0,t)}(e.description))}</span>\n </div>`).join("\n");return`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Needle MCP Server</title>\n <style>\n * { box-sizing: border-box; }\n body {\n background: #f0f4ef;\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.6;\n padding: 20px 24px;\n max-width: 960px;\n margin: 0 auto;\n color: #1a1a1a;\n }\n header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n }\n h2 {\n margin-top: 1.2em;\n margin-bottom: 0.4em;\n }\n a { color: inherit; }\n img.logo {\n height: 2em;\n width: auto;\n }\n .badge {\n font-size: 0.75em;\n background: #d0d4cf;\n padding: 2px 8px;\n border-radius: 10px;\n vertical-align: middle;\n font-weight: normal;\n }\n .tools-info {\n color: #555;\n font-size: 0.9rem;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n /* Tool items */\n .tool {\n background: #fff;\n border: 1px solid #d8dcd7;\n border-radius: 6px;\n margin-bottom: 6px;\n padding: 10px 14px;\n display: flex;\n align-items: baseline;\n gap: 10px;\n }\n .tool-name {\n font-weight: 600;\n white-space: nowrap;\n }\n .tool-desc {\n color: #555;\n font-size: 0.9rem;\n }\n</style>\n</head>\n<body>\n <header>\n <img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" />\n <strong>Needle MCP Server</strong>\n </header>\n\n <p>The Needle MCP server is alive and running.</p>\n\n <h2>Usage</h2>\n <p><a href="https://fwd.needle.tools/mcp">Open Documentation</a></p>\n\n <h2>Available Tools <span class="badge">${t.length}</span></h2>\n <p class="tools-info">These tools are available to AI agents connected via the Model Context Protocol (MCP).</p>\n ${n}\n</body>\n</html>`}();t.status(200).header("Content-Type","text/html; charset=utf-8").send(n)}),hd.post("/mcp",async(e,t)=>{const n=e.headers.accept||"",o=e.headers["user-agent"]||"",{method:i,id:a}=e.body;console.log(`[MCP] Received request from ${o} (${i}) (ID: ${a})`),t.setHeader("Content-Type","application/json"),t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id");try{if("initialize"===i&&n.includes("text/event-stream")){const n=void 0!==a?a:xd++;if(yd(n,e,t)){fd=!0;const e=ud(n);return void t.write(`data: ${JSON.stringify(e)}\n\n`)}}const r=await dd(e.body);if("initialize"===i){fd=!0;const e=Q();gd.add(e),t.setHeader("Mcp-Session-Id",e),console.log(`[MCP] New session created: ${e} for ${o}`),ql(`MCP New session: ${e} for ${o}`)}if(null===r)return t.status(204).end();if(ql(`MCP Request: ${i}`),"tools/list"===i){var s;const e=(null==(s=r.result)||null==(s=s.tools)?void 0:s.map(e=>e.name))||[];console.log(`[MCP] Sending tools/list: ${e.length} tools [${e.join(", ")}]`)}else{const e=JSON.stringify(r);console.log(`[MCP] Sending response for ${i}:`,e.length>500?e.substring(0,500)+" [...]":e)}t.json(r)}catch(e){console.error("[MCP] Error processing request:",e);const n={jsonrpc:"2.0",error:{code:-32603,message:"Internal server error",data:"development"===process.env.NODE_ENV?e.stack:void 0},id:a||null};t.json(n)}}),hd.options("/mcp",(e,t)=>{t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS, DELETE"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),t.status(204).end()});let kd=!1;function Sd(e,t={}){kd&&process.stdout.write(JSON.stringify({jsonrpc:"2.0",method:e,params:t})+"\n")}var jd={__proto__:null,sendStdioNotification:Sd,startStdio:function(){kd=!0,process.stdin.resume();const e=fe({input:process.stdin,terminal:!1});e.on("line",async e=>{const t=e.trim();if(!t)return;let n;try{n=JSON.parse(t)}catch{return void process.stdout.write(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}})+"\n")}const o=await dd(n,{proxy:!0});null!==o&&process.stdout.write(JSON.stringify(o)+"\n")}),e.on("close",()=>{kd=!1,process.exit(0)})}};let Td=null;function Ed(){Td&&clearTimeout(Td),Td=setTimeout(()=>{!function(e,t={}){if(0===vd.size)return;const n=`data: ${JSON.stringify({jsonrpc:"2.0",method:"notifications/tools/list_changed",params:t})}\n\n`;for(const[e,{client:t}]of vd)try{t.write(n)}catch(t){console.error(`[MCP] Error sending notification to client (${e}):`,t),vd.delete(e)}}(),Sd("notifications/tools/list_changed")},10)}const $d=new Set(["https://cloud.needle.tools","https://needle.tools","https://engine.needle.tools","https://docs.needle.tools","chrome-extension://kjcepmifiddcepiocokclhibpkgcdomk","chrome-extension://jonplpbnhmanoekkgcepnedhghflblmo"]),Od=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Rd(e){if("string"!=typeof e||0===e.length)return!1;if($d.has(e))return!0;let t;try{t=new URL(e)}catch{return!1}if("/"!==t.pathname&&""!==t.pathname)return!1;if(""!==t.search||""!==t.hash)return!1;if("http:"!==t.protocol&&"https:"!==t.protocol)return!1;const n=t.hostname.toLowerCase();return!!Od.has(n)||"::1"===n}const Ad="[MCP]",Cd=new Array,Nd="2026-09-29T16:42:55.875Z";var Pd={__proto__:null,BUILD_TIME:Nd};const{json:Id}=ke;function Ud(e){const t=null==e?void 0:e.cause;return null!=t&&t.code?`${t.code}${t.address?` (${t.address}:${t.port})`:""}`:null!=t&&t.message?t.message:null!=e&&e.code?e.code:null!=e&&e.message&&"fetch failed"!==e.message?e.message:"connection refused or network unreachable"}async function zd(t={restart:!1}){const n=await e(tp).catch(e=>({ok:!1})),i="/sign-in",a="/api/authenticated",s="/api/projects",c="/api/content",l={baseUrl:tp,port:ep,isHost:!1,auth_endpoints:{"sign-in":`${tp}${i}`,"sign-out":`${tp}/sign-out`,"is-authenticated":`${tp}${a}`}};let p=n.ok;if(p){var u;const f=await e(`${tp}/api/info`).catch(()=>null);if(null!=f&&f.ok){const g=await f.json().catch(()=>null);null!=g&&g.api_endpoint&&"https://cloud.needle.tools/api"!==g.api_endpoint&&(ql(`Running server uses different API endpoint (${g.api_endpoint} vs https://cloud.needle.tools/api), restarting...`),t||(t={}),t.restart=!0)}if(!0===(null==(u=t)?void 0:u.restart)){ql("Restarting auth server...");const v=`${tp}/restart`;t.ora&&(t.ora.text="Sending restart request to server");const x=new AbortController;setTimeout(()=>x.abort(),1e4);let b={};try{const _=y(ae(),".needle","local-server-token"),k=JSON.parse((await import("fs")).readFileSync(_,"utf-8"));k.token&&(b={Authorization:`Bearer ${k.token}`})}catch{}const w=await e(v,{method:"post",signal:x.signal,headers:b}).catch(e=>({ok:!1,status:400,error:e}));if(w.ok)return await Cc(300),zd({restart:!1});console.error("Failed to restart server",w.status),ql(`Failed to restart server: ${w.status}`)}}if(!p){process.title="Needle CLI server";const S=await import("express").catch(e=>{throw console.error("Error starting the auth server (express not found)",e),ql("Error starting the auth server"),new Error("Failed to load express module")});if(!S)throw ql("Error loading auth server module"),new Error("Failed to load express module");ql(`Starting Needle CLI server ${lu()} (built ${Nd})... (Using api at https://cloud.needle.tools/api)`,{emptyLineBefore:!0}),l.isHost=!0;let j=null;const $={invalid_login:!1,invalid_login_type:null,user_email:null,logged_in_machine_names:[]};let O=S.default();O.use(Id({limit:"10mb"}));const R=y(ae(),".needle"),A=function(e,t){var n;const i=G(e,"local-server-token"),a=null!=(n=function(e){if(!T(e))return null;try{const t=z(e,"utf-8");if(0===t.length)return null;const n=JSON.parse(t);if(n&&"string"==typeof n.token&&n.token.length>0)return n.token}catch{}return null}(i))?n:o();E(e,{recursive:!0});const s=JSON.stringify({token:a,pid:process.pid,port:t},null,2);if(L(i,s,{encoding:"utf-8",mode:384}),"win32"===process.platform)try{const e=process.env.USERNAME||process.env.USER||"";e&&we("icacls",[i,"/inheritance:r","/grant:r",`${e}:(F)`],{stdio:"ignore",timeout:5e3})}catch{}return a}(R,ep);ql(`Local token written to ${y(R,"local-server-token")}`);const C=function(e,t=5e3){const n=new Map,o=Math.max(1,Math.round(t/1e3));return(i,a)=>{const s=Date.now(),r=n.get(i);if(!r||s-r.lastLog>t){var c;const t=null!=(c=null==r?void 0:r.suppressed)?c:0;e(t>0?`${a} [+${t} similar in last ${o}s]`:a),n.set(i,{lastLog:s,suppressed:0})}else r.suppressed++}}(e=>ql(`Denied: ${e}`),5e3);O.use(function(e){const t=null==e?void 0:e.onDenied;return(e,n,o)=>{var i,a;if("OPTIONS"===e.method)return o();const s=null==(i=e.headers)?void 0:i.origin,r=null==(a=e.headers)?void 0:a["sec-fetch-site"];if("none"===r||"same-origin"===r)return o();if(s){if(Rd(s))return o();if(t)try{var c,l,p,u;const n=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown",o=null!=(p=null!=(u=e.path)?u:e.url)?p:"?";t(`origin|${s}|${o}`,`denied origin=${s} path=${o} ua="${n}"`)}catch{}return n.status(403).send("Forbidden: origin not allowed")}return o()}}({onDenied:C}));const N=new Set(["/","/sign-in","/sign-out","/auth-callback","/api/info","/api/authenticated","/api/public_key","/mcp","/register"]),P="needle_local";O.use((e,t,n)=>{var o,i,a;if("OPTIONS"===e.method)return n();if(N.has(e.path))return n();if(e.path.startsWith("/mcp/"))return n();if(e.path.startsWith("/.well-known/"))return n();const s=null==(o=e.headers)?void 0:o.authorization;if(s){const e=s.split(" ");if(2===e.length&&"Bearer"===e[0]&&e[1]===A)return n()}if((null==(i=e.query)?void 0:i.token)===A)return n();const r=((null==(a=e.headers)?void 0:a.cookie)||"").split(";").map(e=>e.trim()).find(e=>e.startsWith(P+"="));if(r&&r.split("=")[1]===A)return n();try{var c,l;const t=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown";C(`token|${t}|${e.path}`,`path=${e.path} ua="${t}" — no valid token or cookie`)}catch{}return t.status(401).send("Unauthorized: token required")}),O.use(id($)),t.ora?(t.ora.start("Starting MCP server..."),t.ora.succeed(`MCP server available at ${tp}/mcp`)):console.log(`\nMCP server available at ${tp}/mcp .`),O.use(hd);const I="\n <title>Needle Cloud</title>\n <link rel=\"icon\" href=\"https://cdn.needle.tools/static/branding/favicon.ico\" type=\"image/x-icon\">\n <style>\n body { \n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 18px;\n padding: 2rem;\n background: #f0f4ef;\n }\n a {\n color: rgb(120, 76, 223);\n }\n .main_panel {\n display: flex;\n flex-direction: column;\n gap: .5rem;\n justify-content: flex-start;\n align-items: center;\n width: min(80ch, 90vw);\n margin: 0 auto;\n\n height: 100%;\n\n & img.logo {\n height: 3rem;\n margin-bottom: 1rem;\n }\n }\n .secondary {\n color: rgba(0, 0, 0, .5);\n }\n .error-details {\n font-size: 12px;\n color: rgba(0, 0, 0, .5);\n }\n .error-details a {\n color: inherit;\n }\n </style>",U=`<div class="main_panel"><img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" title="Needle Logo (${lu()})"/>`,F="</div>";let D="";O.get("/",rd(),async(e,t)=>{var n,o;if(null!=(n=e.user)&&n.isAuthenticated?t.cookie(P,A,{httpOnly:!0,sameSite:"strict",path:"/"}):t.clearCookie(P,{path:"/"}),t.set({"Content-Type":"text/html; charset=utf-8"}),t.write(I),null!=e.query.cancelled)return t.end("Login cancelled. You can close this window now."),void ql("Login cancelled by user");if(null!=e.query["too-many-logins"]&&$.logged_in_machine_names.length){var a;const e=kl();let n="<div>";return n+="<strong>You have reached the maximum number of allowed device logins!</strong><br/><br/>",n+=(null==(a=$.logged_in_machine_names)?void 0:a.map(e=>`• ${e}`).join("<br/>"))+"<br/><br/>",n+=`1) Go to <a href="${e}#device-logins" target="_blank">Needle Cloud device logins</a> and logout one of your devices.<br/>\n 2) Then <a href="${i}">sign-in on this machine</a>.<br/><br/>`,n+="</div>",t.status(406),t.end(U+n+F),void ql(`Login failed: Too many logins from different machines: [${$.logged_in_machine_names.join(", ")}]`)}if(null!=e.query.error)return t.status(500),void t.end(`${U}\n <div>\n <strong>An error occurred</strong>: Please make sure <i>https://cloud.needle.tools/api</i> and <i>https://auth.needle.tools</i> are reachable and not blocked by your firewall or network. After that please try to <a href="${i}">sign-in</a> again.\n <br/><span class="error-details">If the issue persists, please contact support and include the log file: <a title="Link to local log file. Please copy this url and open it in your file explorer or terminal" href="file://${Ll()}" target="_blank">${Ll()}</a></span>\n </div>\n ${F}`);if(null!=(o=e.user)&&o.isAuthenticated){var s;if(!await Qp(e.user)){if($.invalid_login=!0,$.logged_in_machine_names=[...Zp(e.user)],Tp(),ql("Cleared stored auth data"),"client"in e.user){const t=e.user;await t.client.clearAccessToken(),await t.client.clearAllTokens(),ql("Cleared all tokens")}return t.end(`${U}<div>You have been logged out from this machine. You can close this window now or try to <a href="${i}">sign in</a> again</div>${F}`)}$.invalid_login=!1,t.end(`${U}\n <div>\n Hi ${ad(e.user)} — you logged in successfully. You can close this window now.\n </div>\n ${F}`);const n=`Logged in successfully as ${ad(e.user)} (${null==(s=e.user.userInfo)?void 0:s.sub})`;return void(D!==n&&(D=n,ql(D)))}let r=`<span><a href="${i}">Sign in</a> to your Needle account</span>`;"1"===e.query["signed-out"]&&(r=`<span class="secondary">You have been signed out successfully.</span>${r}`),t.write(U+r+F),t.end()}),O.post("/restart",(e,n)=>{var o;t.ora&&(t.ora.text="Received restart event. This instance will close"),null==(o=j)||o.close(e=>{e&&console.error(e)}),setTimeout(()=>{process.exit(0)},100),n.status(200).end("Server is restarting"),ql("Server is restarting\n")}),O.get("/api/logs",async(e,t)=>{const n=Ll();r(n)?h(n,"utf-8",(e,o)=>{if(e)return console.error(e),void t.status(500).end("Failed to read log file");t.set({"Content-Type":"text/plain; charset=utf-8"});const i=o.split("\n").filter(e=>e.length>0).reverse().join("\n");let a=`--- Needle CLI v${lu()} (built ${Nd}) Log File (newest first) ---\n${n}\n\n`;a+=i,t.status(200).end(a)}):t.status(404).end("Log file not found")}),O.get("/api/info",(e,t)=>{t.json({api_endpoint:"https://cloud.needle.tools/api",version:lu()})}),O.get(a,rd(),async(e,t)=>{var n;if(!0===$.invalid_login){const e=Ld($);return t.status(e.status).json(e)}$.invalid_login=!1,t.status(null!=(n=e.user)&&n.isAuthenticated?200:400).send()}),O.get("/api/user",rd(),async(e,t)=>{var n;const o=e.user;if(null==o||!o.isAuthenticated){if(!0===$.invalid_login){const e=Ld($);return t.status(e.status).json(e)}return t.status(401).json({error:"Not authenticated"})}if($.invalid_login=!1,!await Qp(o))return Tp(),t.status(403).json({error:"You have been logged out from this machine"});if(null==o||!o.claims)return t.status(400).json({error:"User claims not found"});if(null==o||!o.userInfo)return t.status(400).json({error:"User info not found"});const i=null==o||null==(n=o.claims)?void 0:n.organization_roles,a=null==o?void 0:o.userInfo.custom_data,s={authenticated:o.isAuthenticated,id:o.userInfo.sub,name:ad(o),email:o.claims.email||o.userInfo.email||"",profile_picture:o.userInfo.picture||"",default_org_id:(null==a?void 0:a.default_org)||"none",orgs:[]},r=["manage","owner","member","developer"];o.userInfo.organization_data&&(s.orgs=o.userInfo.organization_data.map(e=>{var t;const n={id:e.id,name:e.name,roles:(null==i?void 0:i.filter(t=>t.startsWith(e.id)).map(e=>e.split(":")[1]))||[],canWrite:!1};return n.canWrite=null==(t=n.roles)?void 0:t.some(e=>r.includes(e)),n}).sort((e,t)=>e.id===s.default_org_id?-1:t.id===s.default_org_id?1:e.name.localeCompare(t.name))),t.json(s)}),O.get("/api/license",rd(),async(t,n)=>{var o,i,a;const s=null==(o=t.query.token)?void 0:o.toString(),r=null==(i=t.query.org)?void 0:i.toString();let c=null;if(s)c={authToken:s};else{const e=await Gp();if(!e||!e.isAuthenticated)return n.status(401).json({error:"Not authenticated",code:"not_authenticated"});if(!await Qp(e))return Tp(),n.status(403).json({error:"Invalid login"});c=await sd(e,r||null).catch(e=>({status:500,error:e.message}))}if(!c)return n.status(500).json({error:"Failed to fetch licenses (Missing auth)"});if("error"in c)return n.status(c.status).json({error:c.error});const l=Fe(c),p=null==(a=t.query.integration)?void 0:a.toLocaleString(),u={...l,"x-needle":"cli","x-needle-integration":null!=p&&p.length?p:"unknown"},d=await e(`https://cloud.needle.tools/api${Le.account.get_licenses}`,{method:"GET",headers:u}).catch(e=>{const t=Ud(e);return console.error("Failed to fetch licenses:",t),ql(`Failed to fetch licenses: "${t}" - is https://cloud.needle.tools/api reachable?`),null});if(!d)return n.status(502).json({error:"Failed to fetch licenses: upstream API unreachable"});if(d.ok){const e=await d.json();return void 0===e.can_use_editor&&(e.can_use_editor=!0),n.json(e)}return n.status(d.status).json({error:d.statusText})}),O.get("/api/deployments",rd(),async(e,t)=>{var n;const o=await Gp();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i=null==(n=e.query.org)?void 0:n.toString(),a=await sd(o,i).catch(e=>({status:500,error:e.message}));if("error"in a)return t.status(a.status).json({error:a.error});if(i&&!a.org)return t.status(400).json({error:"Organization not found"});const s=await Yl({endpoint:"https://cloud.needle.tools/api",authToken:a.authToken,org:a.org||void 0,limit:20,offset:0,names:void 0}).catch(e=>(console.error("List Deployments error: "+e.message),{status:502,error:"Failed to list deployments: upstream API unreachable"}));if("error"in s)return t.status(s.status).json({error:s.error});for(const e of s.deployments)e.editUrl=`${Sl()}/${e.id}`;const r={...s};return t.json(r)}),O.get(c,rd(),async(e,t)=>{var n,o,i,a,s,r,c,l;const p=await Gp();if(!p||!p.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const u=(null==(n=e.query.org)?void 0:n.toString())||(null==(o=p.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,d=await sd(p,u).catch(e=>({status:500,error:e.message}));if("error"in d)return t.status(d.status).json({error:d.error});const m={content_type:(null==(i=e.query.content_type)?void 0:i.toString())||void 0,content_format:(null==(a=e.query.content_format)?void 0:a.toString())||void 0,search:(null==(s=e.query.search)?void 0:s.toString())||void 0,tags:(null==(r=e.query.tags)?void 0:r.toString())||void 0,types:(null==(c=e.query.types)?void 0:c.toString())||void 0,trash:"true"===e.query.trash||void 0,collection_id:(null==(l=e.query.collection_id)?void 0:l.toString())||void 0,limit:e.query.limit?parseInt(e.query.limit.toString()):void 0,page:e.query.page?parseInt(e.query.page.toString()):void 0,offset:e.query.offset?parseInt(e.query.offset.toString()):void 0},f=await cl({baseUrl:"https://cloud.needle.tools/api",authToken:d.authToken,org:d.org||void 0},m).catch(e=>(console.error("List content error: "+e.message),{status:502,error:"Failed to list content: upstream API unreachable"}));return"error"in f?t.status(f.status).json({error:f.error}):t.json(f)}),O.get(c+"/:identifier",rd(),async(e,t)=>{var n,o;const i=await Gp();if(!i||!i.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const a=(null==(n=e.query.org)?void 0:n.toString())||(null==(o=i.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,s=await sd(i,a).catch(e=>({status:500,error:e.message}));if("error"in s)return t.status(s.status).json({error:s.error});const r=await ll({baseUrl:"https://cloud.needle.tools/api",authToken:s.authToken,org:s.org||void 0},e.params.identifier).catch(e=>(console.error("Get content error: "+e.message),{status:502,error:"Failed to get content: upstream API unreachable"}));return"error"in r?t.status(r.status).json({error:r.error}):t.json(r)}),O.get(s,rd(),async(t,n)=>{const o=await Gp();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i=`https://cloud.needle.tools/api${Le.local_projects.get.user}`,a=await e(i,{method:"GET",headers:{Authorization:`Bearer ${o.accessToken}`}}).catch(e=>(console.error("Failed to fetch projects:",Ud(e)),null));if(!a)return n.status(502).json({error:"Failed to fetch projects: upstream API unreachable"});if(!a.ok)return n.status(a.status).json({error:a.statusText});const s=await a.json().catch(e=>console.error(e));return n.json(s)}),O.get(s+"/:id",rd(),async(t,n)=>{var o;const i=await Gp();if(!i||!i.isAuthenticated)return n.status(401).json({error:"Not authenticated"});let a=null==(o=t.query.org)?void 0:o.toString();const s=await sd(i,a).catch(e=>({status:500,error:e.message}));if(!s)return n.status(500).json({error:"Failed to fetch projects"});if("error"in s)return n.status(s.status).json({error:s.error});const r=Fe(s),c=`https://cloud.needle.tools/api${Le.local_projects.get.by_id}${encodeURIComponent(t.params.id)}`,l=await e(c,{method:"GET",headers:{...r}}).catch(e=>(console.error("Failed to fetch project:",Ud(e)),null));if(!l)return n.status(502).json({error:"Failed to fetch project: upstream API unreachable. Please try again later or contact hi@needle.tools"});if(!l.ok)return n.status(l.status).json({error:l.statusText});const p=await l.json().catch(e=>(console.error(e),null));return p?n.json(p):n.status(500).json({error:"Failed to parse data. Please try again later or contact hi@needle.tools"})}),O.post("/api/projects",rd(),async(t,n)=>{const o=await Gp();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i="string"==typeof t.body?JSON.parse(t.body):t.body,a={machine_id:await eu(),project_id:i.project_id,project_name:i.project_name,scene_name:i.scene_name,web_project_path:i.web_project_path,editor_name:i.editor_name,editor_version:i.editor_version};if(!a.project_id||!a.project_name)return n.status(400).json({error:"Invalid request"});const s=`https://cloud.needle.tools/api${Le.local_projects.post}`,r=await e(s,{method:"POST",headers:{Authorization:`Bearer ${o.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(a)}).catch(e=>(console.error("Failed to upsert project:",Ud(e)),null));return r?r.ok?n.send("OK"):n.status(r.status).json({error:r.statusText}):n.status(502).json({error:"Failed to upsert project: upstream API unreachable"})}),O.get("/api/public_key",rd(),async(t,n)=>{var o,i;const a=await Gp();if(!a||!a.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const s=null==(o=t.query.org)?void 0:o.toString(),r=await sd(a,s).catch(e=>({error:e.message,status:500}));if(!r)return n.status(500).json({error:"Failed to fetch public key"});if("error"in r)return n.status(r.status).json({error:r.error});const c={project_id:(null==(i=t.query.project_id)?void 0:i.toString())||void 0,machine_id:await eu()},l=await e(`https://cloud.needle.tools/api${Le.account.public_key}`,{method:"POST",headers:{...Fe(r),"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(e=>(console.error("Failed to fetch public key:",Ud(e)),null));if(!l)return n.status(502).json({error:"Failed to fetch public key: upstream API unreachable"});if(l.ok){const e=await l.json().catch(console.error);return null!=e&&e.public_key?n.json(e):n.status(500).json({error:"Failed to fetch public key"})}return n.status(l.status).json({error:l.statusText})}),O.get("/api/local_project_id",async(e,t)=>{const n=e.query.paths;if(!n)return t.status(400).json({error:"Missing paths"});let o=[];"string"==typeof n?o=n.split(",").map(e=>e.trim()).filter(e=>e.length>0):Array.isArray(n)&&(o=n.map(e=>e.toString().trim()).filter(e=>e.length>0));const i=wd(o);return i?t.json({project_id:i}):t.status(404).json({error:"Project ID not found"})}),O.post("/api/project/info",rd(),async(e,t)=>{(function(e){try{!function(e){var t,n,o,i;const a={last_accessed:Date.now(),editor:null!=(t=e.scene_path)&&t.endsWith(".unity")?"unity":null!=(n=e.scene_path)&&n.endsWith(".blend")?"blender":"unknown",editor_version:e.editor_version,editor_installation_path:e.editor_installation_path,log_location:e.editor_log_path,project_location:e.unity_project_path||e.blender_project_path||e.scene_path,scene_location:e.scene_path,web_location:e.web_project_path,needle_engine_integration_location:e.needle_sourcecode_location},s=su();let r=ru();const c=r.entries.findIndex(e=>e.project_location===a.project_location),l=null==(o=r.entries[0])?void 0:o.project_location;-1!==c?r.entries[c]=a:r.entries.push(a),r.entries.sort((e,t)=>t.last_accessed-e.last_accessed),r.entries.length>30&&(r.entries=r.entries.slice(0,30));const p=null==(i=r.entries[0])?void 0:i.project_location;p&&p!==l&&ql(`Active project changed: ${l||"(none)"} → ${p}`);try{ou=r;const e=JSON.stringify(r);m(s,e,"utf-8")}catch(e){console.error("Failed to save project info:",e)}}(e)}catch(e){ql("Error saving project info: "+e)}})("string"==typeof e.body?JSON.parse(e.body):e.body),t.send("OK")});let q=null;const B=new Promise(e=>q=e);let M=!1;if(j=O.listen(ep,()=>{null==q||q()}),j.on("error",e=>{if("EADDRINUSE"===(null==e?void 0:e.code))return ql(`License server port ${ep} already in use — a server is already running; not starting a second one.`),M=!0,l.isHost=!1,void(null==q||q());console.error("[needle] License server failed to start:",(null==e?void 0:e.message)||e),ql(`License server failed to start: ${(null==e?void 0:e.message)||e}`),process.exit(1)}),function(e,t){e.on("connection",e=>{const n=e.remoteAddress;if(!function(e){if(!e)return!1;const t=e.includes("%")?e.slice(0,e.indexOf("%")):e;return"127.0.0.1"===t||"::1"===t||"::ffff:127.0.0.1"===t}(n)){try{null==t||t(`Local server: rejected non-loopback connection from ${n||"unknown"}`)}catch{}e.destroy()}})}(j,ql),j.on("close",d),process.on("exit",d),process.on("SIGINT",()=>{d(),process.exit(0)}),await B.catch(e=>{console.error(e),ql(`Error starting the auth server (promise failed): ${e.message}`)}),M)return l;function d(){ql("Cleaning up auth server...")}(function(e,t){const n=new be({server:e,path:"/mcp/ws",verifyClient:({req:e},t)=>{var n;const o=null==(n=e.headers)?void 0:n.origin;if(o&&!Rd(o))return ql(`${Ad} rejected WS upgrade: disallowed origin ${o}`),void t(!1,403,"Forbidden: origin not allowed");t(!0)}});ql("MCP websocket server created.");let o=0,i=new Map;n.on("connection",e=>{const t=++o;Cd.push(e),console.log(`${Ad} client connected (#${t})`),ql(`${Ad} client connected (#${t})`),e.on("close",()=>{const n=Cd.indexOf(e);-1!==n&&Cd.splice(n,1);const o=i.get(t);if(o){for(const e of o)hu(e,Ed);i.delete(t)}console.log(`${Ad} client disconnected (#${t})`),ql(`${Ad} client disconnected (#${t})`)});const n=new Map;e.on("message",o=>{try{const a=o.toString(),s=JSON.parse(a);switch(s.command){default:console.log(`${Ad} Unknown command: ${s.command}`),ql(`Unknown MCP websocket command received: ${s.command}`);break;case"get_connected_clients":!function(t,n){const o={clients:[...bd()],command:"mcp_server_response",messageId:"messageId"in t?t.messageId:void 0};e.send(JSON.stringify(o))}(s);break;case"register_tools":{const o=s.tools,a=s.source;a&&function(e,t){const n=fu.get(e);if(n&&n.size>0){console.log(`[MCP] Removing ${n.size} tools registered from ${e}`);let o=!1;for(const t of n){const n=du.findIndex(e=>e.name===t);-1!==n&&(du.splice(n,1),delete mu[t],vu.set(t,e),o=!0)}fu.delete(e),o&&t()}}(a,Ed);const r=a||"unknown";console.log(`${Ad} ${r} registered ${o.length} tool${1===o.length?"":"s"}`),ql(`${Ad} ${r} registered ${o.length} tool${1===o.length?"":"s"}`);const c=i.get(t)||new Set;i.set(t,c);for(const t of o)c.add(t.name),gu(t,async o=>{console.log(`Tool ${t.name} executed via WebSocket with args:`,o);const i=`${t.name}-${Date.now()}-${Math.random()}`;return await new Promise((a,s)=>{const r=setTimeout(()=>{n.has(i)&&(console.error(`${Ad} Tool execution timed out for tool: ${t.name}`),n.delete(i),s(new Error(`Tool execution timed out for tool: ${t.name}`)))},3e4);n.set(i,{resolve:e=>{a(e),clearTimeout(r)},reject:s}),e.send(JSON.stringify({command:"execute_tool",toolName:t.name,args:o,requestId:i}))})},{source:a},Ed);break}case"tool_result":{const e=s.requestId,t=s.result;if(console.log(`${Ad} Received tool result for requestId: ${e}`,t),n.has(e)){const o=n.get(e);null==o||o.resolve(t),n.delete(e)}else console.error(`${Ad} No pending tool execution found for requestId: ${e}`);break}}}catch(e){console.error(`${Ad} Error processing WebSocket message:`,e)}})})})(j),$u({logToolCount:!0}),Qu();const W=Fu(R,()=>{Lu()?(ql("Settings changed: remote_ai_tools disabled — closing cloud connection"),ed("remote_ai_tools setting disabled")):(ql("Settings changed: remote_ai_tools enabled — opening cloud connection"),Qu())});process.on("exit",()=>{W(),ed("process exit")})}return l}function Ld(e){let t="";return t=e.error?e.error:e.logged_in_machine_names.length>0?`You're already authenticated on ${e.logged_in_machine_names.length} other machine(s)${e.user_email?` with ${e.user_email}`:""}. Please logout from other machines first on ${kl()}. You're currently logged in on: ${e.logged_in_machine_names.join(", ")}`:"An unknown error occured.",{status:403,error:t}}async function Fd(e={headless:!1,silent:!1,clearAuthData:!1}){return!0===e.clearAuthData&&await Tp(),qd("sign-in",{...e})}function Dd(e={}){return qd("sign-out",{...e})}function qd(t,n){return new Promise(async(o,i)=>{let a=!1;if("sign-in"==t){const e=await Gp();if(null!=e&&e.isAuthenticated&&e.accessToken)return await nu(e)?(a=!0,n.ora&&(n.ora.text=`Authorized as ${ad(e)}`),"gotoAccountPage"in n&&!0===n.gotoAccountPage&&(n.ora&&(n.ora.text="Opening account page in the browser"),jl(kl()),await new Promise(e=>setTimeout(e,2e3))),o(e)):o(null);if(!0===n.headless)return o(null)}else if("sign-out"==t&&!0===n.headless){a=!0,Tp();const t=await zd(),n=await e(t.auth_endpoints["sign-out"],{follow:2});return o(n.ok)}const s=await zd();switch(n.timeout||(n.timeout=6e5),"number"==typeof n.timeout&&n.timeout>0&&setTimeout(()=>{a||(n.ora&&n.ora.fail('Timeout "'+t+'"'),o(null))},n.timeout),t){case"sign-in":const e=s.auth_endpoints["sign-in"];setTimeout(()=>jl(e),300),n.ora&&(n.ora.text=`Please authenticate in the browser: ${e}`),setTimeout(l,2e3);break;case"sign-out":Tp(),jl(s.auth_endpoints["sign-out"]),setTimeout(l,2e3)}let r=0;const c=10;function l(){e(s.auth_endpoints["is-authenticated"]).then(async e=>{if(200===e.status||400===e.status||403===e.status)switch(t){case"sign-in":if(200===e.status){const e=await Gp();return e&&!await nu(e)?o(null):(a=!0,n.ora&&e&&(n.ora.text="User is authenticated"),o(e))}if(403===e.status){n.ora&&n.ora.fail("Authentication failed");const t=await e.text();if(t.startsWith("{")){const e=JSON.parse(t);if("logged_in_machine_names"in e&&Array.isArray(e.logged_in_machine_names)){const t=e.logged_in_machine_names;j().fail(`You're already authenticated on ${t.length} other machine(s). Please logout from other machines first. You're currently logged in on: ${t.join(", ")}`)}}return o(null)}break;case"sign-out":if(400===e.status)return a=!0,Tp(),n.ora&&(n.ora.text="User is signed-out"),o(!0)}else if(r++,r>c)return n.ora?n.ora.fail(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`):n.silent||console.error(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`),o(null);setTimeout(l,1e3)}).catch(e=>{r>=10&&console.debug("Error polling auth status: "+e.message)})}})}const Bd=/token|secret|password|authorization|api[-_]?key|access[-_]?key|private[-_]?key|client[-_]?secret/i;function Md(e,t){return async function(n){const o=function(e,t){const n=[];if(e&&Object.keys(e).length>0&&n.push(`args=${Wd(e)}`),t&&Object.keys(t).length>0){const e=Object.fromEntries(Object.entries(t).map(([e,t])=>Bd.test(e)?[e,"<redacted>"]:[e,t]));n.push(`options=${Wd(e)}`)}return n.join(" ")}(null==n?void 0:n.args,null==n?void 0:n.options);ql(`CLI action: ${e}${o?" "+o:""}`);const i=Date.now();try{const o=await t(n);return ql(`CLI action: ${e} succeeded in ${Date.now()-i}ms`),o}catch(t){const n=t instanceof Error?t.message:String(t);throw Dl(`CLI action: ${e} failed in ${Date.now()-i}ms: ${n}`),t}}}function Wd(e){try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():"function"==typeof t?"<fn>":t)}catch{return"<unserializable>"}}globalThis.fetch||(globalThis.fetch=e),globalThis.File||(globalThis.File=t),globalThis.crypto||(globalThis.crypto=n.webcrypto),function(e={}){var t,n,o;const i=null!=(t=e.proc)?t:process,a=null!=(n=e.log)?n:Dl,s=null!=(o=e.error)?o:e=>console.error(e),r=(e,t)=>{const n=t instanceof Error&&t.message||String(t);try{const o=t instanceof Error&&t.stack?`\n${t.stack}`:"";a(`CLI crashed (${e}): ${n}${o}`)}catch{}try{s(`error: ${n}`)}catch{}try{i.exit(1)}catch{}};i.on("unhandledRejection",e=>r("unhandled rejection",e)),i.on("uncaughtException",e=>r("uncaught exception",e))}();const Gd=process.argv.includes("--silent"),Hd=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8")),Jd="The access token to use. Use the login command or get a token from https://cloud.needle.tools. You can pass the access token with your command or set the environment variable NEEDLE_CLOUD_TOKEN";async function Vd(e,t=null,n=!0){let o,i=null==e?void 0:e.toString();var a;if(i||(de.config(),process.env.NEEDLE_CLOUD_TOKEN&&(i=process.env.NEEDLE_CLOUD_TOKEN,null!=(a=i)&&a.length&&console.log("Using NEEDLE_CLOUD_TOKEN token from env"))),""===i||"true"===i){const e=(await import("node:readline")).createInterface({input:process.stdin}),t=10;let n,i="",a=!1;return new Promise(s=>{const r="Paste your https://cloud.needle.tools/team#token access token here:",c=j({text:r,interval:200,spinner:"moon"}).start();process.stdin.setRawMode(!0),process.stdin.on("data",l=>{const p=l.toString();""===p&&process.exit();const u="\n"===p||"\r"===p;if(!u&&"\n"!==p&&"\r"!==p){""===p||"\b"===p?i=i.slice(0,-1):i+=p;const e=i.replace(/./g,"*");c.text=`${r} ${e}`}clearTimeout(n),n=setTimeout(()=>{if(!a&&(u||i.trim().length>t)){process.stdin.setRawMode(!1),e.close(),a=!0;const t=i.trim();if(t.length>0){const e=t.slice(3,-3).replace(/./g,"*");c.succeed("Access token received: "+e)}else c.fail("No access token provided");s({accessToken:t,org_id:o})}},150)})})}if(!i){let e;await async function(){const e=await Gp();return null==e?void 0:e.isAuthenticated}()||(e=Gd?void 0:j("No access token found. Please sign in to authenticate...").start()),ql("No access token provided, attempting login. Org: "+t);const a=Fd({headless:!n,ora:e,timeout:12e4}),d=await a;var s;if(d&&!await Qp(d)?(null==(s=e)||s.fail("You are not logged in from this machine. Please login again."),await Dd({headless:!0}),process.exit(1)):e&&(ql("User logged in via getAccessToken "+(null==d?void 0:d.isAuthenticated)),d?e.succeed("Logged in"):e.fail("Login failed")),null!=d&&d.isAuthenticated){var r;if(null==t){const e=await Hp(d);"string"==typeof e&&(t=e)}else t===(null==(r=d.userInfo)?void 0:r.sub)&&(t=null);if(t){var c,l,p;if(o=null==(c=d.userInfo)||null==(c=c.organization_data)||null==(c=c.find(e=>e.id===t))?void 0:c.id,o||(t=null==(l=t.toString())?void 0:l.toLowerCase(),null!=o||(o=null==(p=d.userInfo)||null==(p=p.organization_data)||null==(p=p.find(e=>e.name.toLowerCase()===t))?void 0:p.id)),!o)throw new Error(`ERR: You (${ad(d)}) are not a member of the team "${t}" or the team does not exist. Please check the team name/id and try again.`);i=await(null==d?void 0:d.client.getOrganizationToken(o)),ql("Getting access token for org "+o+", "+i.substring(0,8)+"...")}else{var u;ql("Getting access token for user "+(null==(u=d.userInfo)?void 0:u.sub)),i=null==d?void 0:d.accessToken}}}return i||(console.error("ERR: Missing NEEDLE_CLOUD_TOKEN token. Please provide the access token argument or set the environment variable NEEDLE_CLOUD_TOKEN. Get an access token for your team at https://cloud.needle.tools/team"),ql("ERR: Missing NEEDLE_CLOUD_TOKEN token. Org: "+o),process.exit(403)),{accessToken:i,org_id:o}}function Kd(e){return null!=e.org&&console.warn("Warning: --org is deprecated. Use --team instead."),e.team||e.org}const Yd=ze.program;async function Zd(){const{spawn:e}=await import("node:child_process");e(process.execPath,[process.argv[1],"start","--integration","cli-login"],{stdio:"inherit",env:{...process.env,NEEDLE_CLOUD_TOKEN:process.env.NEEDLE_CLOUD_TOKEN||""}}),await new Promise(e=>setTimeout(e,1e3))}Yd.version(Hd.version).description("Command-line interface (CLI) for Needle Cloud"),Yd.command("version","Print the CLI version").configure({visible:!1}).action(()=>{Gd||console.log(`☁ Needle CLI — ${Hd.version}, Node ${process.version}`)}),Yd.command("start","Starts the Needle Auth server").alias("start-server").configure({visible:!1,strictOptions:!1}).help("Start the local server for Needle Cloud. This is required to authenticate with Needle Cloud and access your account and data.").option("--restart <restart>","Restarts the server",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--integration <integration>","Hint for the process which integration triggered this command",{required:!1,validator:Yd.STRING}).action(async({options:e})=>{const t=e.integration,n=Gd?void 0:j("Starting Needle License server "+(t?`(from ${t})`:"")).start();zd({ora:n,restart:e.restart}).catch(e=>{console.error("Failed to start server:",e),null==n||n.fail("Failed to start server: "+e.message),process.exit(1)}).then(e=>{null!=e&&e.baseUrl&&e.isHost?null==n||n.succeed(`Server started on ${e.baseUrl} (v${lu()}, built ${function(e){if("string"!=typeof Nd||0===Nd.length)return"unknown";const t=new Date(Nd);if(Number.isNaN(t.getTime()))return"unknown";const n=e=>String(e).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}()})`):!1===(null==e?void 0:e.isHost)?(t||null==n||n.warn(`Server is running on ${e.baseUrl||e.port}`),process.exit(0)):(null==n||n.fail("Failed to start server"),process.exit(1))})}),Yd.command("settings","Show current Needle CLI settings").action(async()=>{const{readSettings:e,KNOWN_SETTINGS:t}=await Promise.resolve().then(function(){return Du}),n=e();for(const[e,o]of Object.entries(t)){const t=n[e],i=void 0!==t?String(t):o.default;console.log(`\n ${"enabled"===i?"[x]":"[ ]"} ${o.displayName}: ${i}${void 0===t?" (default)":""}`),console.log(` ${o.description}`),console.log(` Change: ${o.command}`)}console.log("")}),Yd.command("settings remote-ai-tools","Enable or disable cloud AI tool dispatch to this machine").help("When disabled, the CLI does NOT connect to the Needle Cloud AI tool dispatcher (wss://cloud.needle.tools/v1/cli/ws), so cloud-side AI chats cannot invoke tools (file reads, grep, etc.) on this machine. The local /mcp/ws endpoint used by Unity/Blender stays available. Setting persists in ~/.needle/settings.json.").argument("<enabled>","true to enable, false to disable",{validator:Yd.BOOLEAN}).action(Md("settings remote-ai-tools",async({args:e})=>{const{writeSetting:t,defaultSettingsDir:n}=await Promise.resolve().then(function(){return Du}),o=e.enabled,i=n();o?(t(i,"remote_ai_tools",null),console.log("Remote AI tools enabled (default)."),ql("Settings: remote_ai_tools set to enabled (default) via CLI command")):(t(i,"remote_ai_tools","disabled"),console.log("Remote AI tools disabled. The cloud AI chat will not be able to dispatch tools to this machine."),ql("Settings: remote_ai_tools set to disabled via CLI command"))})),Yd.command("mcp","Start MCP server for AI agents (stdio transport)").help('Start the Needle Cloud MCP server using stdio transport.\nThis is the standard way to connect AI agents (Claude Desktop, Cursor, VS Code, etc.).\n\nAdd to your MCP client config:\n{\n "mcpServers": {\n "needle": {\n "command": "npx",\n "args": ["-y", "needle-cloud", "mcp"]\n }\n }\n}').action(Md("mcp",async()=>{const{startStdio:e}=await Promise.resolve().then(function(){return jd});e()})),Yd.command("get-project-id","Gets the project id for a local project").configure({visible:!1,strictOptions:!1}).argument("<paths...>","The path to the local project (web project directory)").action(async({args:e})=>{const t=wd(e.paths);t?console.log(`Found project ID: "${t}"`):console.log("No project ID found.")}),Yd.command("send-logs","Upload CLI, editor, and optimization-pipeline logs to Needle (secrets and sensitive info redacted)").help("Stream the current and previous CLI log, the most recent editor log (Unity or Blender), and the optimization-pipeline log to Needle for support diagnosis. Before upload, tokens, Bearer/Authorization values, UUIDs, home-directory paths, email addresses, Username/User fields, and *_KEY / *_TOKEN / *_SECRET / *_PASSWORD env-var values are redacted (replaced with <redacted:Nch> so the length is preserved for debugging). Returns a reference ID to paste into your bug report. Requires sign-in; the upload is tagged with your Needle account.").option("--crash <crash>","Mark this upload as a crash report (uses the crash-mode daily quota)",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--note <note>","One-line note attached to the upload",{required:!1}).option("--dry-run <dryRun>","Print the redacted payload without uploading",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("send-logs",async({options:e})=>{var t,n,o,i,a,s,r;const{runSendLogs:c,HAYSTACK_RESOURCE:l}=await Promise.resolve().then(function(){return wp}),{tryGetFreshAccessTokenForResource:p}=await Promise.resolve().then(function(){return Kp}),{findActiveEditorLog:u}=await import("./cli.send-logs.discovery-eaea5688.js"),{getLogFilePath:d,getPrevLogsFilePath:m,getPipelineLogFilePath:f}=await Promise.resolve().then(function(){return Bl}),{homedir:h,platform:g}=await import("os"),{existsSync:v}=await import("fs"),{BUILD_TIME:x}=await Promise.resolve().then(function(){return Pd}),{getNodeVersion:b,getNpmVersion:y,getArch:w,getOsRelease:_,getCpuCount:k,getTotalMemoryMb:S,getTzOffsetMinutes:T,isCi:E,isTty:$}=await import("./cli.runtime-465aa7a3.js"),O=null!=(t=null!=(n=null==(o=e.crash)||null==o.valueOf?void 0:o.valueOf())?n:e.crash)&&t?"crash":"normal",R=e.note,A=null!=(i=null!=(a=null==(s=e.dryRun)||null==s.valueOf?void 0:s.valueOf())?a:e.dryRun)&&i,C=d(),N=m(),P=f(),I={getAccessToken:()=>p(l),fetch:globalThis.fetch,paths:{cliLogPath:v(C)?C:null,prevLogPath:v(N)?N:null,pipelineLogPath:v(P)?P:null,homeDir:h()},meta:{cli_version:lu(),build_time:x,os:g(),os_release:_(),arch:w(),node_version:b(),npm_version:null!=(r=y())?r:"unknown",cpu_count:k(),total_memory_mb:S(),tz_offset_minutes:T(),is_ci:E(),is_tty:$()},findActiveEditorLog:u,stdout:process.stdout,stderr:process.stderr},U=A?"Building payload (dry-run)":"Uploading logs",z=Gd?void 0:j(U).start();I.recoverAuth=async()=>{null==z||z.stop();try{await Zd();const e=await Fd({clearAuthData:!0,silent:Gd,ora:void 0});if(null==e||!e.isAuthenticated)return null}catch(e){return ql(`send-logs: auto-recovery login failed: ${e instanceof Error?e.message:e}`),null}finally{null==z||z.start(U)}return await p(l)};const L=await c({mode:O,note:R,dryRun:A},I);L.ok?A?null==z||z.succeed("Dry-run payload printed above. Nothing was uploaded."):L.truncated?(null==z||z.warn(`Uploaded (truncated at server cap). Reference: ${L.refId}`),console.log(`Share ${L.refId} in your bug report.`)):(null==z||z.succeed(`Uploaded. Reference: ${L.refId}`),console.log(`Share ${L.refId} in your bug report.`)):(null==z||z.fail(L.error||"Upload failed"),process.exitCode=1)})),Yd.command("login","Login to Needle Cloud").help("Login to Needle Cloud. If you are already logged in, this will refresh the access token.").option("--headless <headless>","The headless process will not open a browser window to login. If the user is not authorized then no auth flow can be started. Use this if you only want to **check** if the user is authenticated",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--clear <clear>","Refresh the access token",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(async({options:e})=>{await Zd();const t=e.headless.valueOf()||!1,n=e.clear.valueOf()||!1,o=Gd?void 0:j("Login").start();await Fd({headless:t,silent:Gd,clearAuthData:n,ora:o}).then(async e=>{null!=e&&e.isAuthenticated?null==o||o.succeed("Successfully logged in as "+ad(e)):0==t?null!=e&&e.claims||null!=e&&e.userInfo?null==o||o.warn(`You (${ad(e)}) are not authenticated...`):null==o||o.fail("Login failed"):Gd||null==o||o.warn("Not logged in"),process.exit(null!=e&&e.isAuthenticated?0:1)})}),Yd.command("logout","Logout of Needle Cloud").help("Logout of Needle Cloud (if you have logged in before).").option("--headless <headless>","Headless will not open a browser window to logout",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(async({options:e})=>{await Zd();const t=e.headless.valueOf()||!1;await Dd({headless:t}).then(e=>{e?j("Logged out").succeed():j("Logout failed").fail(),process.exit(e?0:1)})}),Yd.command("me","Prints your user information").help("Prints basic informaton about the logged in Needle Cloud account (your account)").action(async({})=>{const e=Gd?void 0:j("Query user data").start(),t=await Gp();if(null!=t&&t.isAuthenticated&&await Qp(t)){const a=t.userInfo||t.claims;var n,o,i;a?(null==e||e.succeed(`You are logged in as ${ad(t)}`),console.log(`- Name: ${ad(t)}`),console.log(`- ID: ${a.sub}`),a.email&&console.log(`- Email: ${a.email}`),a.phone_number&&console.log(`- Phone: ${a.phone_number}`),null!=(n=t.userInfo)&&n.organization_data&&console.log(`- Teams [${null==(o=t.userInfo)?void 0:o.organization_data.length}]: ${null==(i=t.userInfo)?void 0:i.organization_data.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>e.name).join(", ")}`)):null==e||e.fail("Failed to get user data")}else null==e||e.warn("You are not logged in")}),Yd.command("get-pro","Start license flow for Needle Engine PRO").configure({visible:!1,strictArgsCount:!1,strictOptions:!1}).option("--team <team>","The team to purchase the license for",{validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{validator:Yd.STRING,hidden:!0}).action(Md("get-pro",async({options:e})=>{var t;let n=(null==(t=Kd(e))?void 0:t.toString())||null;const o=j().start("Start Needle Engine PRO purchase flow"),i=function(e){e=e||{};const t="undefined"!=typeof window?window.location:null;"current_page"===e.baseUrl&&(e.baseUrl=null==t?void 0:t.href);let n=e.pathname||(null==t?void 0:t.pathname),o=e.baseUrl||(null==t?void 0:t.href);if(!n||!o)return null;const i=new URL(n,o);return t&&(i.search=t.search),e.license||(e.license="needle-engine:pro"),i.searchParams.set("purchase_intent",e.license),e.account_id&&i.searchParams.set("account_id",e.account_id),e.return_url&&i.searchParams.set("return_url",e.return_url),e.checkout_if_possible&&i.searchParams.set("checkout_if_possible","true"),e.show_all_cards&&i.searchParams.set("show_all_cards","true"),e.affiliate_id&&i.searchParams.set("affiliate_id",e.affiliate_id),e.tracking_id&&i.searchParams.set("tracking_id",e.tracking_id),i}({baseUrl:"https://cloud.needle.tools",pathname:n?`/team/${n}`:"/account",account_id:n,license:"needle-engine:pro",return_url:null});if(!i)return void o.fail("Failed to get purchase url - please visit https://cloud.needle.tools");const a=i.toString();o.succeed(`Started Needle Engine PRO purchase flow: opening browser at ${a}`),jl(a)}));const Xd={account:{url:kl}},Qd=`"${Object.keys(Xd).join('", "')}"`;Yd.command("open",`Open a page in the default browser. Options are: ${Qd}`).argument("<page>",`The page to open. Options are: ${Qd}`,{validator:Yd.STRING}).configure({strictOptions:!1,strictArgsCount:!1,visible:!1}).help("").action(async({args:e,logger:t})=>{const n=e.page.toString(),o=Xd[n];o?"url"in o?jl(o.url()):t.error(`Unknown argument: ${n}`):t.error(`Unknown argument: ${n}. Options are: ${Qd}`)}),Yd.command("list-deployments","Get a list of deployed websites").configure({visible:!1}).help("").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).option("--limit <limit>","Limit the number of deployments to show (min: 0, max: 100)",{validator:Yd.NUMBER,default:10}).option("--offset <offset>","The offset for deployments (default: 0, min: 0)",{validator:Yd.NUMBER,default:0}).option("--format <format>","The output format. Options: cli (default), json",{validator:Yd.STRING,default:"cli",hidden:!0}).option("--name","Filter by one or multiple deployment names (separated by ;)",{validator:Yd.STRING}).action(async({options:e,logger:t})=>{var n,o,i;const{accessToken:a,org_id:s}=await Vd(e.token,Kd(e)),r=(null==(n=e.endpoint)?void 0:n.toString())||"https://cloud.needle.tools/api",c=e.limit.valueOf(),l=e.offset.valueOf(),p=(null==(o=e.format)?void 0:o.toString())||"cli",u=(null==(i=e.name)?void 0:i.toString())||void 0;if(c<0)return void t.error("The limit can not be negative");if(c>100)return void t.error("The limit can not be higher than 100");const d=j("Query deployments").start(),m=await Yl({endpoint:r,authToken:a,org:s,limit:c,offset:l,names:null==u?void 0:u.split(";")}).catch(e=>{t.error(e)});if(m&&"error"in m)d.fail(m.error+" (status: "+m.status+")");else if(m){if("json"===p){d.succeed(`Found ${m.deployments.length} deployments`);const e=JSON.stringify(m.deployments);return void console.log(e)}m.deployments.length>0?(d.succeed(`Found ${m.deployments.length} deployments`),m.deployments.forEach((e,n)=>{t.info(`${n+c*l}: ${e.name} – ${e.url}`)})):d.warn("No deployments found"),process.exit(0)}else d.fail("Failed to query deployments"),process.exit(1)}),Yd.command("list","List content items (3d assets, deployments, materials, etc.)").alias("list-content").help('List content items stored in Needle Cloud.\n\nUse --type to filter by content type (e.g. "material", "3d-asset", "deployment").\nUse --format to filter by output format (e.g. "glb", "textures").').option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).option("--type <type>","Filter by content type (e.g. material, 3d-asset, deployment)",{required:!1,validator:Yd.STRING}).option("--format <format>","Filter by output format (e.g. glb, textures)",{required:!1,validator:Yd.STRING}).option("--search <search>","Search by name, title or description",{required:!1,validator:Yd.STRING}).option("--limit <limit>","Max number of items to show (default: 20, max: 100)",{validator:Yd.NUMBER,default:20}).option("--offset <offset>","Offset for pagination (default: 0)",{validator:Yd.NUMBER,default:0}).option("--output <output>","Output style: cli (default), json",{validator:Yd.STRING,default:"cli"}).action(async({options:e,logger:t})=>{var n,o,i,a,s,r,c,l,p;const{accessToken:u,org_id:d}=await Vd(e.token,Kd(e)),m=(null==(n=e.endpoint)?void 0:n.toString())||"https://cloud.needle.tools/api",f=Math.min(null!=(o=null==(i=e.limit)?void 0:i.valueOf())?o:20,100),h=null!=(a=null==(s=e.offset)?void 0:s.valueOf())?a:0,g=(null==(r=e.output)?void 0:r.toString())||"cli",v=(null==(c=e.type)?void 0:c.toString())||void 0,x=(null==(l=e.format)?void 0:l.toString())||void 0,b=(null==(p=e.search)?void 0:p.toString())||void 0,y=j("Querying content...").start();try{const e=await cl({baseUrl:m,authToken:u,org:d},{content_type:v,content_format:x,search:b,limit:f,offset:h});if("json"===g)return y.succeed(`Found ${e.items.length} of ${e.total} items`),void console.log(JSON.stringify(e.items,null,2));0===e.items.length&&(y.warn("No content found"+(v?` (type: ${v})`:"")+(x?` (format: ${x})`:"")),process.exit(0)),y.succeed(`Found ${e.items.length} of ${e.total} items`);const n=e.items.map(e=>{var t;const n=e.title||"(untitled)";return{id:e.identifier,type:e.content_type||"?",formats:null!=(t=e.content_formats)&&t.length?e.content_formats.join(", "):"",name:n.length>20?n.slice(0,17)+"...":n,versions:String(e.version_count||0),date:e.created_at?Nc(new Date(e.created_at),new Date,{allowSimple:!0,limitInDays:2}):""}}),o={id:Math.max(2,...n.map(e=>e.id.length)),type:Math.max(4,...n.map(e=>e.type.length)),formats:Math.max(7,...n.map(e=>e.formats.length)),name:Math.max(4,...n.map(e=>e.name.length))},i=Ql(` ${"ID".padEnd(o.id)} ${"TYPE".padEnd(o.type)} ${"FORMATS".padEnd(o.formats)} ${"NAME".padEnd(o.name)} ${"#".padStart(3)} AGE`);t.info(i);for(const e of n){const n=Xl(e.type).padEnd(o.type+11),i=(e.formats?e.formats.split(", "):[]).map(e=>Xl(e)).join(", ")+" ".repeat(Math.max(0,o.formats-e.formats.length));t.info(` ${Ql(e.id.padEnd(o.id))} ${n} ${i} ${e.name.padEnd(o.name)} ${e.versions.padStart(3)} ${Ql(e.date)}`)}e.total>h+f&&t.info(` ... ${e.total-h-f} more (use --offset ${h+f})`),process.exit(0)}catch(e){y.fail(e.message),process.exit(1)}}),Yd.command("delete","Move a content item to the trash").help("Move a content item to the trash. This immediately frees total storage capacity but does not refund monthly usage. The item can be restored for 31 days if enough total storage is available.\n\nUsage:\n needle-cloud delete <identifier>").argument("<identifier>","Content item identifier",{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The Needle Cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).action(async({args:e,options:t})=>{var n;const{accessToken:o,org_id:i}=await Vd(t.token,Kd(t)),a=(null==(n=t.endpoint)?void 0:n.toString())||"https://cloud.needle.tools/api",s=e.identifier.toString(),r=j(`Deleting content "${s}"...`).start();try{const e=await Kl({identifier:s,endpoint:a,authToken:o,org:i});r.succeed(e.message||`Moved content "${s}" to the trash`),process.exit(0)}catch(e){r.fail(e.message),process.exit(1)}}),Yd.command("download","Download a content item by identifier").help('Download files from a content item.\n\nUse --format to select which output format to download (e.g. "glb", "textures").\n\nUsage:\n needle-cloud download <identifier> [directory]\n needle-cloud download abc123 --format glb').argument("<identifier>","Content item identifier",{validator:Yd.STRING}).argument("[directory]","Output directory (default: current directory)",{default:"."}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).option("--format <format>","Output format to download (e.g. glb, textures)",{required:!1,validator:Yd.STRING}).option("--name <name>","Output filename (without extension)",{required:!1,validator:Yd.STRING}).option("--verbose","Show detailed download info",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(async({args:e,options:t,logger:n})=>{var o,i,a,s,r,c;const{accessToken:l,org_id:p}=await Vd(t.token,Kd(t)),u=(null==(o=t.endpoint)?void 0:o.toString())||"https://cloud.needle.tools/api",d=e.identifier.toString(),m=(null==(i=e.directory)?void 0:i.toString())||".",f=(null==(a=t.name)?void 0:a.toString())||void 0,h=null!=(s=null==(r=t.verbose)?void 0:r.valueOf())&&s,g=(null==(c=t.format)?void 0:c.toString())||void 0,v=j("Looking up content...").start();try{var x;const e={baseUrl:u,authToken:l,org:p},t=await ll(e,d).catch(()=>null);if(!t)return void v.fail(`Content not found: "${d}". Use the exact content identifier (see list-content).`);const o=null==(x=t.versions)?void 0:x[0];if(!o)return void v.fail(`Content "${t.title||t.name}" has no versions`);let i=o.identifier;if(g){let e=!1;for(const n of t.versions){if(n.content_format===g){i=n.identifier,e=!0;break}const t=n.variants.find(e=>e.content_format===g);if(t){i=t.identifier,e=!0;break}}if(!e)return void v.fail(`No output with format "${g}" found for "${t.title||t.name}"`)}v.text=`Downloading "${t.title||t.name}"${g?` (format: ${g})`:""}...`,v.stop();const a=await Jl({baseUrl:u,authToken:l,org:p,identifier:i,outDir:m,filename:f,verbose:h,content_format:g});"error"in a&&n.error(a.error)}catch(e){v.fail(e.message)}}),Yd.command("deploy","Deploy a website to Needle").help("").argument("<directory>","The directory to deploy",{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to deploy to (not needed when using token/accesstoken)",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id to deloy to (not needed when using token/accesstoken)",{required:!1,validator:Yd.STRING,hidden:!0}).option("--name <name>","The project name. This name will also be used in your website URL",{required:!1,validator:Yd.STRING}).option("--entrypoint <entrypoint>",'The entrypoint file to use (e.g. "index.html"). This is useful if you want to deploy a folder with multiple HTML files and you want to configure which file to load initially or if you have multiple model files in one folder',{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING,hidden:!0}).option("--open","Open the deployment in the default browser",{default:!0,validator:Yd.BOOLEAN}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Yd.BOOLEAN,default:!1,hidden:!0}).option("--experimental","Use the experimental upload API. Mostly used for debugging (default: false)",{required:!1,validator:Yd.BOOLEAN,default:!1,hidden:!0}).option("--raw","Use raw to disallow modifications like gzip compression on upload",{required:!1,validator:Yd.BOOLEAN,default:!1,hidden:!0}).option("--no-provenance","Do not record which commit and CI run this deployment came from",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("deploy",async({args:e,options:t,logger:n})=>{var o,i,a,s;const r=t.open,{accessToken:c,org_id:l}=await Vd(t.token,Kd(t)),p=t.verbose.valueOf(),u=t.experimental.valueOf()||!1,d=t.raw.valueOf()||!1,m=(null==(o=t.noProvenance)?void 0:o.valueOf())||!1;await Wl({logger:n,endpoint:(null==(i=t.endpoint)?void 0:i.toString())||void 0,token:c,org_id:l,directory:e.directory.toString(),name:(null==(a=t.name)?void 0:a.toString())||void 0,entrypoint:(null==(s=t.entrypoint)?void 0:s.toString())||void 0,open:r,verbose:p||!1,experimental:u||!1,raw:d||!1,noProvenance:m})})),Yd.command("upload","Upload files or a folder to Needle Cloud").help("Uploads your files and returns the link to manage them on Needle Cloud. Processing jobs (asset optimization and related derived formats) are scheduled automatically in the background — this command does not wait for them; use `optimize` to upload and wait for the optimized result. Use --no-optimize to store the files exactly as uploaded, with no jobs scheduled.").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Yd.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be uploaded",{validator:Yd.STRING}).option("--name <name>","The upload project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Yd.STRING}).option("--no-optimize","Do not schedule any processing jobs — store the files exactly as uploaded",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("upload",async({args:e,options:t})=>{var n,o,i;const a=(null==(n=t.verbose)?void 0:n.valueOf())||!1,{accessToken:s,org_id:r}=await Vd(t.token,Kd(t));if(s!=t.token){const e=await Gp();null!=e&&e.isAuthenticated?r||(j("Please provide an organization id to upload files...").fail(),process.exit(1)):(j("Please login to upload files...").fail(),process.exit(1))}const c=await async function(e){const t=await Hl({token:e.token,org_id:e.org_id,fileOrDirectory:e.fileOrDirectory,name:e.name,verbose:e.verbose},{optimizations:!e.noOptimize&&void 0});return"error"in t?t:(e.noOptimize&&j().info("No processing jobs were scheduled (--no-optimize)."),{success:!0,editUrl:t.editUrl})}({token:s,org_id:r,fileOrDirectory:e.path.toString(),name:(null==(o=t.name)?void 0:o.toString())||void 0,noOptimize:(null==(i=t.noOptimize)?void 0:i.valueOf())||!1,verbose:a}).catch(e=>{console.error(e),process.exit(1)});"error"in c&&(c.noprint||console.error(c.error),process.exit(1))})),Yd.command("optimize","Optimize glTF, GLB, VRM, FBX, USD files").help("").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Yd.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be optimized",{validator:Yd.STRING}).option("--outdir <outdir>","The output directory for the optimized file(s). If set your optimized asset files will automatically be downloaded to this directory.",{required:!1,validator:Yd.STRING}).option("--name <name>","The optimization project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Yd.STRING}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--progressive","Use Needle progressive loading",{required:!1,validator:Yd.BOOLEAN,default:!0}).option("--usecase <usecase>",'The use case for the optimization. This can be "product" (default) or "world".',{required:!1,validator:Yd.STRING,default:"product"}).action(Md("optimize",async({args:e,options:t,logger:n})=>{var o,i,a,s;const l=t.verbose.valueOf(),{accessToken:p,org_id:u}=await Vd(t.token,Kd(t));if(p!=t.token){const e=await Gp();null!=e&&e.isAuthenticated?u||(j("Please provide an organization id to optimize files...").fail(),process.exit(1)):(j("Please login to optimize files...").fail(),process.exit(1));const t=await async function(e,t){const n=e.baseUrl+Le.account.get_licenses,o={...{...t},...Fe(e)},i=await fetch(n,{...De,method:"GET",headers:o}).catch(e=>(console.error(e),null));return i?i.ok?(await i.json()).licenses:(console.error(i.statusText,await i.text()),[]):[]}({baseUrl:"https://cloud.needle.tools/api",authToken:p,org:u},{type:"org",org_id:u});(!t||t.length<=0||!t.find(e=>"Needle Engine"===e.type&&("pro"===e.license||"enterprise"===e.license)))&&(j("Update to Needle PRO or Enterprise required to optimize files via CLI. Visit https://cloud.needle.tools/get-pro").fail(),process.exit(1))}const d=(null==(o=t.progressive)?void 0:o.valueOf())||!0,m=(null==(i=t.usecase)?void 0:i.toString())||"product",f=await async function(e){if(e.outDir){var t;if((null==(t=e.outDir)?void 0:t.length)<=0){const e="Output Directory is invalid";return j().fail(e),{error:e}}if(r(e.outDir)&&c(e.outDir).isFile()){const e="The output directory is a file - it must be a directory";return j().fail(e),{error:e}}}const n=await Hl({token:e.token,org_id:e.org_id,fileOrDirectory:e.fileOrDirectory,name:e.name,verbose:e.verbose},{purposeLabel:"for optimization"});if("error"in n)return n;{const t=n.res,i="https://cloud.needle.tools/api",a=await async function(e,t={progressive:!0}){const n=e.baseUrl+Le.jobs.create,o={...Fe(e),"content-type":"application/json"},i={type:"optimization",job_id:e.id,triggered_by:e.trigger_type,parameters:{...t}},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request optimization (${a.status}): ${e} `),null}return await a.json().catch(e=>(console.error(e),null))}({baseUrl:i,authToken:e.token,org:e.org_id,id:t.id,trigger_type:"cli"},function(e){return e.progressive?{progressive:!0,usecase:e.usecase||"product"}:{progressive:!1}}(e));if(!a)return{error:"Failed to send optimization request"};if("error"in a){const e=`Failed to optimize: ${a.error}`;return console.error(e),{error:e}}{const t=a.job,n=j(`Optimization requested for ${t.name||t.identifier}`).start();let s=!1;n.color="gray";const r=Wr();for(;;){if("completed"===a.job.status){var o;s=!0,n.succeed(`${null!=(o=a.message)?o:"Optimization completed"}`);break}let c=2e3;const l=await Mr(t.identifier,{baseUrl:i,authToken:e.token,org:a.job.org}),p=r.record(l);if(p)return n.fail(p.reason),{error:p.reason};if("new"!==(null==l?void 0:l.status)&&"pending"!==(null==l?void 0:l.status)||(n.text="Your asset is queued - waiting for optimization to start",n.color="yellow",c=2e3),"running"===(null==l?void 0:l.status))n.text=`Your asset is being optimized: ${l.progress?`${l.progress}%`:""} ${l.status_message?`— ${l.status_message}`:""}`,n.color="cyan",c=1e3;else if("stalled"===(null==l?void 0:l.status))c=2500;else{if("completed"===(null==l?void 0:l.status)){s=!0,n.succeed(`Your asset has finished optimizing: ${l.status_message}`);break}if("canceled"===(null==l?void 0:l.status))return n.fail(`Optimization cancelled: ${l.error}`),{error:l.error||"Optimization cancelled"};if("failed"===(null==l?void 0:l.status))return n.fail(`Optimization failed: ${l.error}`),console.error(`Optimization failed: ${l.error}`),{error:l.error||"Optimization failed"}}await Cc(c)}if(s){if(e.outDir){const n=await Jl({baseUrl:i,authToken:e.token,org:e.org_id,identifier:t.identifier,outDir:e.outDir,verbose:e.verbose});if("error"in n)return{error:n.error}}else j().succeed(`Asset successfully optimized: https://cloud.needle.tools/edit/${t.content_id} (To download optimized files, use the --outdir option)`);return{success:!0}}}}return{error:"Unknown error"}}({logger:n,token:p,org_id:u,fileOrDirectory:e.path.toString(),name:(null==(a=t.name)?void 0:a.toString())||void 0,progressive:d,usecase:m,outDir:(null==(s=t.outdir)?void 0:s.toString())||void 0,verbose:l||!1}).catch(e=>{console.error(e),process.exit(1)});Array.isArray(f)?process.exit(0):"error"in f&&(f.noprint||console.error(f.error),process.exit(1))})),Yd.command("generate-material","Generate a PBR material from a text prompt").help("").argument("<prompt>","The text prompt describing the material to generate",{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Yd.STRING,hidden:!0}).option("--resolution <resolution>","The material texture resolution (256, 512, 1k, 2k, 4k)",{default:"512",required:!1,validator:Yd.STRING}).option("--name <name>","Output filename",{required:!1,validator:Yd.STRING}).option("--outdir <outdir>","Output directory to download the generated file(s) to. If not set, the job ID is printed instead.",{required:!1,validator:Yd.STRING}).action(Md("generate-material",async({args:e,options:t,logger:n})=>{var o,i,a;const{accessToken:s,org_id:r}=await Vd(t.token,Kd(t)),c=e.prompt.toString(),l=null==(o=t.resolution)?void 0:o.toString(),p=null==(i=t.outdir)?void 0:i.toString(),u=null==(a=t.name)?void 0:a.toString(),d=await async function(e){if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${kl()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const t="https://cloud.needle.tools/api";ql(`[generate-material] Starting request to ${t}, prompt="${e.prompt}", resolution=${e.resolution||512}`,{emptyLineBefore:!0});const n=j("Requesting material generation...").start(),o=await Promise.race([rl({baseUrl:t,authToken:e.token,org:e.org_id,trigger_type:"cli"},{prompt:e.prompt,resolution:e.resolution||512}).catch(e=>({error:e.message||"Request failed"})),new Promise(e=>setTimeout(()=>e({error:"Request timed out after 30s. Please try again."}),3e4))]);if("error"in o)return ql(`[generate-material] Request failed: ${o.error}`),n.fail(o.error),{error:o.error};const i=o.job;if(ql(`[generate-material] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return ql(`[generate-material] Job canceled: ${i.status_message||"quota exceeded"}`),n.fail(i.status_message||"Material generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};n.succeed(`Material generation requested: ${i.identifier}`);const a=j("Waiting for material generation...").start();a.color="gray";const s=Wr();for(;;){if("completed"===i.status){a.succeed("Material generation completed");break}let n=2e3;const o=await Mr(i.identifier,{baseUrl:t,authToken:e.token,org:i.org}),r=s.record(o);if(r)return a.fail(r.reason),{error:r.reason};if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your material is queued - waiting for generation to start",a.color="yellow",n=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating material: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",n=1e3;else{if("completed"===(null==o?void 0:o.status)){ql(`[generate-material] Job completed: ${i.identifier}`),a.succeed(`Material generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return ql(`[generate-material] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`Material generation canceled: ${o.error||""}`),{error:o.error||"Material generation canceled"};if("failed"===(null==o?void 0:o.status))return ql(`[generate-material] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`Material generation failed: ${o.error||""}`),{error:o.error||"Material generation failed"}}await Cc(n)}if(e.outDir){const n=await Jl({baseUrl:t,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in n)return{error:n.error}}return{success:!0,identifier:i.identifier}}({logger:n,token:s,org_id:r,prompt:c,resolution:l,outputName:u,outDir:p});"error"in d&&(d.error&&n.error(d.error),process.exit(1)),!p&&d.identifier&&console.log(d.identifier),process.exit(0)})),Yd.command("generate-3d","Generate a 3D model from a text prompt").help("").argument("<prompt>",'A description of the object to generate, e.g. "a weathered wooden crate with iron bands"',{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Yd.STRING,hidden:!0}).option("--quality <quality>","Quality tier: standard (default, includes physically based material maps) or draft (faster and cheaper, base color only)",{default:"standard",required:!1,validator:Yd.STRING}).option("--face-count <faceCount>","Target polygon count (40000-1500000). Leave unset to let the generator choose.",{required:!1,validator:Yd.NUMBER}).option("--name <name>","Output filename",{required:!1,validator:Yd.STRING}).option("--outdir <outdir>","Output directory to download the generated file(s) to. If not set, the job ID is printed instead.",{required:!1,validator:Yd.STRING}).action(Md("generate-3d",async({args:e,options:t,logger:n})=>{var o,i,a;const{accessToken:s,org_id:r}=await Vd(t.token,Kd(t)),c=e.prompt.toString(),l=null==(o=t.quality)?void 0:o.toString(),p=null!=t.faceCount?Number(t.faceCount):void 0,u=null==(i=t.outdir)?void 0:i.toString(),d=null==(a=t.name)?void 0:a.toString(),m=await async function(e){if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${kl()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const t="https://cloud.needle.tools/api";ql(`[generate-3d] Starting request to ${t}, prompt="${e.prompt}", quality=${e.quality||"draft"}`,{emptyLineBefore:!0});const n=j("Requesting 3D generation...").start(),o=await async function(e,t){var n;if(null!=(n=e.signal)&&n.aborted)return{error:"The 3D generation request was cancelled"};const o=e.baseUrl+Le.jobs.create,i={...Fe(e),"content-type":"application/json"},a={type:"ai-3d-asset",triggered_by:e.trigger_type,parameters:{...t}},s=await fetch(o,{...De,method:"POST",headers:i,body:JSON.stringify(a),signal:e.signal}).catch(e=>function(e){return"AbortError"===(null==e?void 0:e.name)||"TimeoutError"===(null==e?void 0:e.name)}(e)?{__aborted:!0}:(console.error(`Failed to request 3D asset generation: ${null==e?void 0:e.message}`),{__failed:(null==e?void 0:e.message)||"Request failed"}));if("__aborted"in s)return{error:"The 3D generation request was cancelled"};if("__failed"in s)return{error:s.__failed};if(!s.ok){const e=await s.text();return console.error(`Failed to request 3D asset generation (${s.status}): ${e}`),{error:e||`Request failed (${s.status})`}}const r=await s.json().catch(e=>(console.error(e),null));return null!=r&&r.job?r:{error:"The server did not return a job"}}({baseUrl:t,authToken:e.token,org:e.org_id,trigger_type:"cli",signal:AbortSignal.timeout(3e4)},{prompt:e.prompt,...e.quality?{quality:e.quality}:{},...e.face_count?{face_count:e.face_count}:{}});if("error"in o)return ql(`[generate-3d] Request failed: ${o.error}`),n.fail(o.error),{error:o.error};const i=o.job;if(ql(`[generate-3d] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return ql(`[generate-3d] Job canceled: ${i.status_message||"quota exceeded"}`),n.fail(i.status_message||"3D generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};n.succeed(`3D generation requested: ${i.identifier}`);const a=j("Waiting for the 3D model...").start();a.color="gray";const s=Wr();for(;;){if("completed"===i.status){a.succeed("3D generation completed");break}let n=2e3;const o=await Mr(i.identifier,{baseUrl:t,authToken:e.token,org:i.org}),r=s.record(o);if(r)return a.fail(r.reason),{error:r.reason};if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your model is queued - waiting for generation to start",a.color="yellow",n=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating 3D model: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",n=1e3;else{if("completed"===(null==o?void 0:o.status)){ql(`[generate-3d] Job completed: ${i.identifier}`),a.succeed(`3D generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return ql(`[generate-3d] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`3D generation canceled: ${o.error||""}`),{error:o.error||"3D generation canceled"};if("failed"===(null==o?void 0:o.status))return ql(`[generate-3d] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`3D generation failed: ${o.error||""}`),{error:o.error||"3D generation failed"}}await Cc(n)}if(e.outDir){const n=await Jl({baseUrl:t,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in n)return{error:n.error}}return{success:!0,identifier:i.identifier}}({logger:n,token:s,org_id:r,prompt:c,quality:l,face_count:p,outputName:d,outDir:u});"error"in m&&(m.error&&n.error(m.error),process.exit(1)),!u&&m.identifier&&console.log(m.identifier),process.exit(0)})),Yd.command("ask","Send a message to the Needle Cloud AI").help("Send a message to the Needle Cloud AI chat.\n\nWithout a message argument, starts an interactive session.\nBy default streams the response to the terminal. Use --no-stream for a single JSON response.\nUse --slug to continue an existing chat conversation.\nDefault slug is <your-user-id>-cli (persistent across sessions).").argument("[message...]","The message to send (omit for interactive mode)").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--slug <slug>","Chat slug to continue an existing conversation",{required:!1,validator:Yd.STRING}).option("--no-stream","Disable streaming (returns full response at once)",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("ask",async({args:e,options:t})=>{var n,o;const{accessToken:i,org_id:a}=await Vd(t.token,Kd(t)),s=Array.isArray(e.message)?e.message:e.message?[e.message]:[],r=s.length?s.join(" "):void 0,c=(null==(n=t.slug)?void 0:n.toString())||void 0,l=(null==(o=t.noStream)?void 0:o.valueOf())||!1;await async function(e){const{token:t,org_id:n,message:o,slug:i,stream:a}=e,s=i||function(e){try{const t=e.split(".")[1],n=JSON.parse(Buffer.from(t,"base64url").toString());if(n.sub)return n.sub+"-cli"}catch{}return"cli-"+Math.random().toString(36).slice(2,10)}(t);await async function(e){const{token:t,org_id:n,slug:o,stream:i,initialMessage:a}=e,s=ue({input:process.stdin,output:process.stdout});console.log(`Needle Cloud AI (chat: ${o})`),console.log('Type your message. Press Ctrl+C or type "exit" to quit.\n');try{for(a&&(console.log(`> ${a}`),await Vl({token:t,org_id:n,slug:o,message:a,stream:i}),console.log(""));;){const e=(await s.question("> ")).trim();if(e){if("exit"===e||"quit"===e)break;await Vl({token:t,org_id:n,slug:o,message:e,stream:i}),console.log("")}}}finally{s.close()}}({token:t,org_id:n,slug:s,stream:a,initialMessage:o})}({token:i,org_id:a,message:r,slug:c,stream:!l}),process.exit(0)}));export{iu as g,Yd as p};
1
+ import e from"node-fetch";import{File as t}from"@web-std/file";import n,{randomUUID as o}from"node:crypto";import{Command as i,Option as a}from"commander";import s,{existsSync as r,statSync as c,readFileSync as l,readdirSync as p,appendFileSync as u,mkdirSync as d,writeFileSync as m,lstatSync as f,readFile as h}from"fs";import{execFileSync as g}from"child_process";import v from"open";import x,{resolve as b,join as y,relative as w,sep as _,isAbsolute as k,dirname as S}from"path";import j from"ora";import{existsSync as T,mkdirSync as E,renameSync as $,realpathSync as O,statSync as R,rename as A,appendFileSync as C,openSync as N,readSync as P,closeSync as I,createReadStream as U,readFileSync as z,writeFileSync as L,watch as F}from"node:fs";import{writeFile as D}from"node:fs/promises";import q,{homedir as B}from"node:os";import M,{resolve as W,join as G}from"node:path";import H from"util";import J,{Readable as V}from"stream";import K from"http";import Y from"https";import Z from"url";import X,{randomUUID as Q}from"crypto";import ee from"net";import te from"tls";import ne from"assert";import oe from"tty";import ie,{homedir as ae,tmpdir as se}from"os";import re,{EventEmitter as ce}from"events";import le from"http2";import pe from"zlib";import{createInterface as ue}from"node:readline/promises";import de from"dotenv";import me from"@logto/node";import{createInterface as fe}from"node:readline";import{Readable as he}from"node:stream";import{createGzip as ge}from"node:zlib";import{Router as ve}from"express";import xe,{WebSocketServer as be}from"ws";import{execFile as ye,execFileSync as we}from"node:child_process";import{minimatch as _e}from"minimatch";import ke from"body-parser";const Se="STRING",je="BOOLEAN",Te="NUMBER",Ee="ARRAY";function $e(e){return e.replace(/[-_](\w)/g,(e,t)=>t.toUpperCase())}function Oe(e){const t=e.match(/--[\w-]+/g);return t?t[t.length-1]:e.split(/[\s,]+/)[0]}function Re(e){return $e(Oe(e).replace(/^--/,""))}function Ae(e){return $e(e.replace(/[[\]<>]/g,"").replace(/\.\.\.$/,"").trim())}function Ce(e,t){if(null==e)return e;switch(t){case je:{if("boolean"==typeof e)return e;const t=String(e).toLowerCase();return""===t||!["false","0","no","off"].includes(t)&&(!!["true","1","yes","on"].includes(t)||Boolean(e))}case Te:{const t=Number(e);return Number.isNaN(t)?e:t}case Ee:return Array.isArray(e)?e:String(e).split(",");case Se:return Array.isArray(e)?e:String(e);default:return e}}const Ne={error:(...e)=>console.error(...e),warn:(...e)=>console.warn(...e),info:(...e)=>console.log(...e),debug:(...e)=>console.debug(...e),log:(...e)=>console.log(...e)};class Pe{constructor(e,t){this.name=e,this.description=null!=t?t:"",this.visible=!0,this.strictOptions=!0,this._aliases=[],this._helpTexts=[],this._action=void 0,this.options=[],this.args=[]}alias(e){return this._aliases.push(e),this}getAliases(){return[...this._aliases]}configure(e={}){return void 0!==e.visible&&(this.visible=!1!==e.visible),void 0!==e.strictOptions&&(this.strictOptions=!1!==e.strictOptions),this}hide(){return this.visible=!1,this}help(e){return e&&this._helpTexts.push(e),this}option(e,t,n={}){return this.options.push({synopsis:e,description:null!=t?t:"",name:Re(e),validator:n.validator,default:n.default,required:!0===n.required,hidden:!0===n.hidden}),this}argument(e,t,n={}){return this.args.push({synopsis:e,description:null!=t?t:"",name:Ae(e),validator:n.validator,default:n.default}),this}action(e){return this._action=e,this}isHelpCommand(){return!1}}class Ie{constructor(){this.STRING=Se,this.BOOLEAN=je,this.NUMBER=Te,this.ARRAY=Ee,this._version=void 0,this._description=void 0,this._name="needle-cloud",this._commands=[],this._exitOverride=!1,this._testHooks=null}version(e){return this._version=e,this}description(e){return this._description=e,this}name(e){return this._name=e,this}command(e,t){const n=new Pe(e,t);return this._commands.push(n),n}getCommands(){return[...this._commands]}exitOverride(){return this._exitOverride=!0,this}async run(e){const t=this._build();try{return await t.parseAsync(null!=e?e:process.argv.slice(2),{from:"user"})}catch(t){var n,o,i;if(this._exitOverride)throw t;const a=null!=(n=null==(o=this._testHooks)?void 0:o.error)?n:e=>console.error(e);return a(`error: ${t instanceof Error&&t.message||String(t)}`),(null!=e?e:process.argv).includes("--verbose")&&t instanceof Error&&t.stack&&a(t.stack),null!=(i=this._testHooks)&&i.exit?this._testHooks.exit(1):process.exit(1)}}_build(){const e=new i(this._name);this._version&&e.version(this._version),this._description&&e.description(this._description),this._exitOverride&&e.exitOverride();const t=new Map,n=o=>{if(1===o.length)return e;const a=o.slice(0,-1).join(" ");let s=t.get(a);return s||(s=new i(o[o.length-2]),this._exitOverride&&s.exitOverride(),t.set(a,s),n(o.slice(0,-1)).addCommand(s)),s};for(const e of this._commands){const o=e.name.split(/\s+/),s=t.get(e.name),r=null!=s?s:new i(o[o.length-1]);t.set(e.name,r),r.description(e.description);for(const t of e._aliases)r.alias(t);for(const t of e._helpTexts)r.addHelpText("after","\n"+t);this._exitOverride&&r.exitOverride(),e.strictOptions||(r.allowUnknownOption(!0),r.allowExcessArguments(!0));for(const t of e.args)r.argument(t.synopsis,t.description);for(const t of e.options){let e=t.synopsis;t.validator&&!Oe(e).startsWith("--no-")&&(e=/[<[]/.test(e)?e.replace(/<([\w-]+)>/,"[$1]"):`${e} [value]`);const n=new a(e,t.description);t.hidden&&n.hideHelp(),t.required&&n.makeOptionMandatory(),r.addOption(n)}e._action&&r.action(async(...t)=>{var n;const o=null!=(n=t[e.args.length])?n:{},i={};e.args.forEach((e,n)=>{const o=t[n];i[e.name]=Ce(void 0===o?e.default:o,e.validator)});const a={};for(const t of e.options){if(Oe(t.synopsis).startsWith("--no-")){const e=$e(Oe(t.synopsis).replace(/^--no-/,""));a[t.name]=!1===o[e];continue}const e=o[t.name];a[t.name]=Ce(void 0===e?t.default:e,t.validator)}for(const[e,t]of Object.entries(o))e in a||(a[e]=t);await e._action({args:i,options:a,logger:Ne,command:r})}),s||n(o).addCommand(r,{hidden:!e.visible})}return e}}function Ue(){return new Ie}var ze={program:Ue(),createProgram:Ue,STRING:Se,BOOLEAN:je,NUMBER:Te,ARRAY:Ee};const Le={status:"/v1/status",version:"/v1/version",api:"/v1/api",usage:{get:"/v1/usage"},affiliate:{get:"/v1/affiliate/get",link_clicked:"/v1/affiliate/link_clicked"},account:{public_key:"/v1/account/public_key",post_machine:"/v1/account/machine",connect:"/v1/account/connect",get_licenses:"/v1/account/get/licenses",set_license_active:"/v1/account/set_license_active",set_licenses_active:"/v1/account/set_licenses_active",buy_licenses:"/v1/account/buy_licenses",update_licenses:"/v1/account/update_licenses",preview_invitation:"/v1/account/preview_invitation",update_payment_method:"/v1/account/update_payment_method",get_billing:"/v1/account/get_billing",generate_invoice:"/v1/account/generate_invoice",resume_subscription:"/v1/account/resume_subscription",cancel_subscription:"/v1/account/cancel_subscription",start_billingportal_session:"/v1/account/start_billingportal_session",post_preferences:"/v1/account/preferences",get_preferences:"/v1/account/preferences"},payment:{info:"/v1/payment/info",create:"/v1/payment/create"},ai:{llmstxt:"/v1/ai/llmstxt",chat:"/v1/ai/chat",chat_personal:"/v1/ai/chat/personal",list_chats:"/v1/ai/chat/list",chat_image:"/v1/ai/chat/image",chat_tool_result:"/v1/ai/chat/tool-result",chat_stop:"/v1/ai/chat/stop",chat_enqueue:"/v1/ai/chat/enqueue",chat_enqueue_cancel:"/v1/ai/chat/enqueue/cancel",ask:"/v1/ai/ask",completions:"/v1/ai/completions",evaluate:"/v1/ai/evaluate",post_settings:"/v1/ai/chat/settings",ws:"/v1/ws",cli_ws:"/v1/cli/ws"},organizations:{get:"/v1/organizations/get",orgs_details:"/v1/organizations/details",licenses:"/v1/organizations/licenses",get_invitations:"/v1/organizations/get_invitations"},events:{get:"/v1/events/get",post:"/v1/events/post",list:"/v1/events/list"},reports:{get:"/v1/reports/get",post:"/v1/reports/post"},diagnostics:{download_failed:"/v1/diagnostics/download-failed"},questionnaire:{get:"/v1/questionnaires/get",post:"/v1/questionnaires/post"},roadmap:{get:"/v1/roadmap/get",post_vote:"/v1/roadmap/post"},tokens:{create:"/v1/tokens/create",delete:"/v1/tokens/delete",list:"/v1/tokens/list"},get:{stats:"/v1/get/stats",jobs:"/v1/list/jobs",deployments:"/v1/list/deployments",discounts:"/v1/get/discounts"},files:{entry:"/v1/files/:identifier/:version/",file:"/v1/files/:identifier/:version/*"},view:{get_analytics:"/v1/view/analytics",get_public_info:"/v1/view/public/info",post_version:"/v1/view/post_version"},content:{root:"/v1/content",download:"/v1/content/download",detail:"/v1/content/:identifier",update:"/v1/content/:identifier",delete:"/v1/content/:identifier",restore:"/v1/content/:identifier/restore",visits:"/v1/content/:identifier/visits",domains:"/v1/content/:identifier/domains",domain_item:"/v1/content/:identifier/domains/:hostname",domain_verify:"/v1/content/:identifier/domains/:hostname/verify"},analytics:{content_list:"/v1/analytics/content-list"},public:{content_list:"/v1/public/content",content_detail:"/v1/public/content/:identifier"},collections:{list:"/v1/collections/list",get:"/v1/collections/get",create:"/v1/collections/create",update:"/v1/collections/update",delete:"/v1/collections/delete",add_item:"/v1/collections/add-item",remove_item:"/v1/collections/remove-item",reorder_items:"/v1/collections/reorder-items"},projects:{create:"/v1/projects/create",list:"/v1/projects/list",head:"/v1/projects/head",push:"/v1/projects/push",pull:"/v1/projects/pull",delete:"/v1/projects/delete",restore:"/v1/projects/restore",archive:"/v1/projects/archive",unarchive:"/v1/projects/unarchive",clone:"/v1/projects/clone",update:"/v1/projects/update",blobs_check:"/v1/projects/blobs/check",blobs_upload:"/v1/projects/blobs/upload",blobs_complete:"/v1/projects/blobs/complete",blobs_download:"/v1/projects/blobs/download",revisions:"/v1/projects/revisions",revisions_update:"/v1/projects/revisions/update",deployments:"/v1/projects/deployments",promote:"/v1/projects/promote",promotions:"/v1/projects/promotions"},upload:{request:"/v1/upload/request",request_put_url:"/v1/upload/put",update_results:"/v1/upload/results",done:"/v1/upload/done",cancel:"/v1/upload/cancel",multipart_create:"/v1/upload/multipart/create",multipart_part_urls:"/v1/upload/multipart/part-urls",multipart_complete:"/v1/upload/multipart/complete",multipart_abort:"/v1/upload/multipart/abort"},jobs:{create:"/v1/jobs/create",get_id:"/v1/jobs/get_id",request_start:"/v1/jobs/request_start",presigned_url:"/v1/jobs/presigned-url",presigned_urls:"/v1/jobs/presigned-urls",download_urls:"/v1/jobs/download-urls",request_restart:"/v1/jobs/restart",delete:"/v1/jobs/delete",post_update:"/v1/jobs/update",post_results_stats:"/v1/jobs/results_stats",post_usage:"/v1/jobs/post_usage",get_status:"/v1/jobs/status",get_org:"/v1/jobs/org",query:"/v1/jobs/query",request_job_that_needs_stats:"/v1/jobs/job_needs_stats"},worker:{ping:"/v1/worker/ping",get_available_count:"/v1/worker/get_available_count",post_available_info:"/v1/worker/post_available_info",get_available_info:"/v1/worker/get_available_info"},local_projects:{get:{user:"/v1/local_projects/user",by_id:"/v1/local_projects/"},post:"/v1/local_projects"}};function Fe(e){const t={authorization:"Bearer "+e.authToken};return e.org&&(t["x-needle-cloud-org"]=e.org),e.roles&&(t.roles=e.roles.join(",")),e.roles_org&&(t.roles_org=e.roles_org.join(",")),t}const De={credentials:"omit"};function qe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Be}=Object.prototype,{getPrototypeOf:Me}=Object,{iterator:We,toStringTag:Ge}=Symbol,He=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Je=(e,t)=>{let n=e;const o=[];for(;null!=n&&n!==Object.prototype;){if(-1!==o.indexOf(n))return!1;if(o.push(n),He(n,t))return!0;n=Me(n)}return!1},Ve=(Ke=Object.create(null),e=>{const t=Be.call(e);return Ke[t]||(Ke[t]=t.slice(8,-1).toLowerCase())});var Ke;const Ye=e=>(e=e.toLowerCase(),t=>Ve(t)===e),Ze=e=>t=>typeof t===e,{isArray:Xe}=Array,Qe=Ze("undefined");function et(e){return null!==e&&!Qe(e)&&null!==e.constructor&&!Qe(e.constructor)&&ot(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tt=Ye("ArrayBuffer"),nt=Ze("string"),ot=Ze("function"),it=Ze("number"),at=e=>null!==e&&"object"==typeof e,st=e=>{if(!at(e))return!1;const t=Me(e);return!(null!==t&&t!==Object.prototype&&null!==Me(t)||Je(e,Ge)||Je(e,We))},rt=Ye("Date"),ct=Ye("File"),lt=Ye("Blob"),pt=Ye("FileList"),ut=Ye("Set"),dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},mt=void 0!==dt.FormData?dt.FormData:void 0,ft=Ye("URLSearchParams"),[ht,gt,vt,xt]=["ReadableStream","Request","Response","Headers"].map(Ye);function bt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let o,i;if("object"!=typeof e&&(e=[e]),Xe(e))for(o=0,i=e.length;o<i;o++)t.call(null,e[o],o,e);else{if(et(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(o=0;o<a;o++)s=i[o],t.call(null,e[s],s,e)}}function yt(e,t){if(et(e))return null;t=t.toLowerCase();const n=Object.keys(e);let o,i=n.length;for(;i-- >0;)if(o=n[i],t===o.toLowerCase())return o;return null}const wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,_t=e=>!Qe(e)&&e!==wt,kt=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&Me(Uint8Array)),St=Ye("HTMLFormElement"),{propertyIsEnumerable:jt}=Object.prototype,Tt=Ye("RegExp"),Et=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};bt(n,(n,i)=>{let a;!1!==(a=t(n,i,e))&&(o[i]=a||n)}),Object.defineProperties(e,o)},$t=Ye("AsyncFunction"),Ot=(Rt="function"==typeof setImmediate,At=ot(wt.postMessage),Rt?setImmediate:At?(Ct=`axios@${Math.random()}`,Nt=[],wt.addEventListener("message",({source:e,data:t})=>{e===wt&&t===Ct&&Nt.length&&Nt.shift()()},!1),e=>{Nt.push(e),wt.postMessage(Ct,"*")}):e=>setTimeout(e));var Rt,At,Ct,Nt;const Pt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(wt):"undefined"!=typeof process&&process.nextTick||Ot,It=e=>null!=e&&ot(e[We]);var Ut={isArray:Xe,isArrayBuffer:tt,isBuffer:et,isFormData:e=>{if(!e)return!1;if(mt&&e instanceof mt)return!0;const t=Me(e);if(!t||t===Object.prototype)return!1;if(!ot(e.append))return!1;const n=Ve(e);return"formdata"===n||"object"===n&&ot(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&tt(e.buffer),t},isString:nt,isNumber:it,isBoolean:e=>!0===e||!1===e,isObject:at,isPlainObject:st,isEmptyObject:e=>{if(!at(e)||et(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ht,isRequest:gt,isResponse:vt,isHeaders:xt,isUndefined:Qe,isDate:rt,isFile:ct,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:lt,isRegExp:Tt,isFunction:ot,isStream:e=>at(e)&&ot(e.pipe),isURLSearchParams:ft,isTypedArray:kt,isFileList:pt,forEach:bt,merge:function e(...t){const{caseless:n,skipUndefined:o}=_t(this)&&this||{},i={},a=(t,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;const s=n&&"string"==typeof a&&yt(i,a)||a,r=He(i,s)?i[s]:void 0;st(r)&&st(t)?i[s]=e(r,t):st(t)?i[s]=e({},t):Xe(t)?i[s]=t.slice():o&&Qe(t)||(i[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||et(n))continue;if(bt(n,a),"object"!=typeof n||Xe(n))continue;const o=Object.getOwnPropertySymbols(n);for(let e=0;e<o.length;e++){const t=o[e];jt.call(n,t)&&a(n[t],t)}}return i},extend:(e,t,n,{allOwnKeys:o}={})=>(bt(t,(t,o)=>{n&&ot(t)?Object.defineProperty(e,o,{__proto__:null,value:qe(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,o)=>{let i,a,s;const r={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],o&&!o(s,e,t)||r[s]||(t[s]=e[s],r[s]=!0);e=!1!==n&&Me(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ve,kindOfTest:Ye,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length);const o=e.indexOf(t,n-=t.length);return-1!==o&&o===n},toArray:e=>{if(!e)return null;if(Xe(e))return e;let t=e.length;if(!it(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[We]).call(e);let o;for(;(o=n.next())&&!o.done;){const n=o.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const o=[];for(;null!==(n=e.exec(t));)o.push(n);return o},isHTMLForm:St,hasOwnProperty:He,hasOwnProp:He,hasOwnInPrototypeChain:Je,getSafeProp:(e,t)=>null!=e&&Je(e,t)?e[t]:void 0,reduceDescriptors:Et,freezeMethods:e=>{Et(e,(t,n)=>{if(ot(e)&&["arguments","caller","callee"].includes(n))return!1;ot(e[n])&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},o=e=>{e.forEach(e=>{n[e]=!0})};return Xe(e)?o(e):o(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:yt,global:wt,isContextDefined:_t,isSpecCompliantForm:function(e){return!!(e&&ot(e.append)&&"FormData"===e[Ge]&&e[We])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(at(e)){if(t.has(e))return;if(et(e))return e;if(!("toJSON"in e)){let o;if(t.add(e),ut(e)){o=[];for(const t of e){const e=n(t);!Qe(e)&&o.push(e)}}else o=Xe(e)?[]:{},bt(e,(e,t)=>{const i=n(e);!Qe(i)&&(o[t]=i)});return t.delete(e),o}}return e};return n(e)},isAsyncFn:$t,isThenable:e=>e&&(at(e)||ot(e))&&ot(e.then)&&ot(e.catch),setImmediate:Ot,asap:Pt,isIterable:It,isSafeIterable:e=>null!=e&&Je(e,We)&&It(e)};const zt=Ut.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"]),Lt=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ft=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Dt(e,t){return Ut.isArray(e)?e.map(e=>Dt(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function qt(e){const t=Object.create(null);return Ut.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>Dt(e,Ft))(e)}),t}const Bt=Symbol("internals");function Mt(e){return e&&String(e).trim().toLowerCase()}function Wt(e){return!1===e||null==e?e:Ut.isArray(e)?e.map(Wt):(e=>Dt(e,Lt))(String(e))}const Gt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Ht(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Jt(e,t,n,o,i){return Ut.isFunction(o)?o.call(this,t,n):(i&&(t=n),Ut.isString(t)?Ut.isString(o)?-1!==t.indexOf(o):Ut.isRegExp(o)?o.test(t):void 0:void 0)}class Vt{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function i(e,t,n){const i=Mt(t);if(!i)return;const a=Ut.findKey(o,i);(!a||void 0===o[a]||!0===n||void 0===n&&!1!==o[a])&&(o[a||t]=Wt(e))}const a=(e,t)=>Ut.forEach(e,(e,n)=>i(e,n,t));if(Ut.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Ut.isString(e)&&(e=e.trim())&&!(e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))(e))a((e=>{const t={};let n,o,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),o=e.substring(i+1).trim();const a=Ut.hasOwnProp(t,n);!n||a&&Ut.hasOwnProp(zt,n)||("set-cookie"===n?a?t[n].push(o):t[n]=[o]:t[n]=a?t[n]+", "+o:o)}),t})(e),t);else if(Ut.isObject(e)&&Ut.isSafeIterable(e)){let n,o,i=Object.create(null);for(const t of e){if(!Ut.isArray(t))throw new TypeError("Object iterator must return a key-value pair");o=t[0],Ut.hasOwnProp(i,o)?(n=i[o],i[o]=Ut.isArray(n)?[...n,t[1]]:[n,t[1]]):i[o]=t[1]}a(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Mt(e)){const n=Ut.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}(e);if(Ut.isFunction(t))return t.call(this,e,n);if(Ut.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Mt(e)){const n=Ut.findKey(this,e);return!(!n||void 0===this[n]||t&&!Jt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let o=!1;function i(e){if(e=Mt(e)){const i=Ut.findKey(n,e);!i||t&&!Jt(0,n[i],i,t)||(delete n[i],o=!0)}}return Ut.isArray(e)?e.forEach(i):i(e),o}clear(e){const t=Object.keys(this);let n=t.length,o=!1;for(;n--;){const i=t[n];e&&!Jt(0,this[i],i,e,!0)||(delete this[i],o=!0)}return o}normalize(e){const t=this,n={};return Ut.forEach(this,(o,i)=>{const a=Ut.findKey(n,i);if(a)return t[a]=Wt(o),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();s!==i&&delete t[i],t[s]=Wt(o),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Ut.forEach(this,(n,o)=>{null!=n&&!1!==n&&(t[o]=e&&Ut.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return Ut.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let o=0,i=!1,a=!1;function s(e){const i=Ht(n.slice(o,e)),a=i.indexOf("=");if(a<1)return;const s=Ht(i.slice(0,a));if(!Gt.test(s))return;const r=s.toLowerCase();if("__proto__"===r||"constructor"===r||"prototype"===r)return;const c=Ht(i.slice(a+1));t[r]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let o=1;o<t;o++){const i=e.charCodeAt(o);if(34===i)return e;if(92===i&&(o+=1,o>=t))return e;n+=e[o]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);i?a?a=!1:92===t?a=!0:34===t&&(i=!1):34===t?i=!0:44!==t&&59!==t||(s(e),o=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Bt]=this[Bt]={accessors:{}}).accessors,n=this.prototype;function o(e){const o=Mt(e);t[o]||(function(e,t){const n=Ut.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{__proto__:null,value:function(e,n,i){return this[o].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[o]=!0)}return Ut.isArray(e)?e.forEach(o):o(e),this}}Vt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ut.reduceDescriptors(Vt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Ut.freezeMethods(Vt);var Kt=Vt;const Yt="[REDACTED ****]";class Zt extends Error{static from(e,t,n,o,i,a){let s=e.message;!s&&Ut.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return function(e){try{return String(e)}catch(e){return""}}(e&&e.message?e.message:e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const r=new Zt(s,t||e.code,n,o,i);return Object.defineProperty(r,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),r.name=e.name,null!=e.status&&null==r.status&&(r.status=e.status),a&&Object.assign(r,a),r}constructor(e,t,n,o,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){const e=this.config,t=e&&Ut.hasOwnProp(e,"redact")?e.redact:void 0,n=Ut.isArray(t)&&t.length>0?function(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),o=[],i=e=>{if(null===e||"object"!=typeof e)return e;if(Ut.isBuffer(e))return e;if(-1!==o.indexOf(e))return;let t;if(e instanceof Kt&&(e=e.toJSON()),o.push(e),Ut.isArray(e))t=[],e.forEach((e,n)=>{const o=i(e);Ut.isUndefined(o)||(t[n]=o)});else{if(!Ut.isPlainObject(e)&&function(e){if(Ut.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Ut.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return o.pop(),e;t=Object.create(null);for(const[o,a]of Object.entries(e)){const e=n.has(o.toLowerCase())?Yt:i(a);Ut.isUndefined(e)||(t[o]=e)}}return o.pop(),t};return i(e)}(e,t):Ut.toJSONObject(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:n,code:this.code,status:this.status}}}Zt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Zt.ERR_BAD_OPTION="ERR_BAD_OPTION",Zt.ECONNABORTED="ECONNABORTED",Zt.ETIMEDOUT="ETIMEDOUT",Zt.ECONNREFUSED="ECONNREFUSED",Zt.ERR_NETWORK="ERR_NETWORK",Zt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Zt.ERR_DEPRECATED="ERR_DEPRECATED",Zt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Zt.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Zt.ERR_CANCELED="ERR_CANCELED",Zt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Zt.ERR_INVALID_URL="ERR_INVALID_URL",Zt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Xt=Zt,Qt=J.Stream,en=tn;function tn(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}H.inherits(tn,Qt),tn.create=function(e,t){var n=new this;for(var o in t=t||{})n[o]=t[o];n.source=e;var i=e.emit;return e.emit=function(){return n._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),n.pauseStream&&e.pause(),n},Object.defineProperty(tn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),tn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},tn.prototype.resume=function(){this._released||this.release(),this.source.resume()},tn.prototype.pause=function(){this.source.pause()},tn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},tn.prototype.pipe=function(){var e=Qt.prototype.pipe.apply(this,arguments);return this.resume(),e},tn.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},tn.prototype._checkIfMaxDataSizeExceeded=function(){this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize||(this._maxDataSizeExceeded=!0,this.emit("error",new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.")))};var nn=J.Stream,on=an;function an(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}H.inherits(an,nn),an.create=function(e){var t=new this;for(var n in e=e||{})t[n]=e[n];return t},an.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},an.prototype.append=function(e){if(an.isStreamLike(e)){if(!(e instanceof en)){var t=en.create(e,{maxDataSize:Infinity,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=t}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},an.prototype.pipe=function(e,t){return nn.prototype.pipe.call(this,e,t),this.resume(),e},an.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},an.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){an.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},an.prototype._pipeNext=function(e){if(this._currentStream=e,an.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});this.write(e),this._getNext()},an.prototype._handleErrors=function(e){var t=this;e.on("error",function(e){t._emitError(e)})},an.prototype.write=function(e){this.emit("data",e)},an.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},an.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},an.prototype.end=function(){this._reset(),this.emit("end")},an.prototype.destroy=function(){this._reset(),this.emit("close")},an.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},an.prototype._checkDataSize=function(){this._updateDataSize(),this.dataSize<=this.maxDataSize||this._emitError(new Error("DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded."))},an.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},an.prototype._emitError=function(e){this._reset(),this.emit("error",e)};var sn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function rn(e){var t={exports:{}};return e(t,t.exports),t.exports}var cn={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"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:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,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:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"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:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0,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:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"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:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,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:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,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:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"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:!0},"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:!1,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:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,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:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,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:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,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:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"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:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"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:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"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:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,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:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,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:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"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:!1,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:!0,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:!0},"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:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,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:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,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:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,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:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"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:!0},"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:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,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:!0,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:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"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:!0},"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:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"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:!0},"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:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"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:!0,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:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"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:!0},"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:!0},"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:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"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:!0},"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:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"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:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"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:!1},"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:!1},"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:!1},"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:!0},"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:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"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:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"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:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"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:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,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:!1},"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:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"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:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"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:!0},"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:!0},"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:!0,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:!1,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:!0,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:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,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:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,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:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"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:!1,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:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,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:!0},"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:!1,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:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,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:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"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:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"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:!0,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:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"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:!0},"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:!0},"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:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"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:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"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:!0,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:!0},"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:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"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:!0},"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:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,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:!0,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:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,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:!0,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:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"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:!0,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:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"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:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"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:!0},"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:!0,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:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"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:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,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:!1,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:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,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:!1},"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:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,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:!0,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:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,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:!1},"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:!0,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:!1,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:!1,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:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,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:!0,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:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"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:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,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:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,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:!1,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:!1,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:!1},"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:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,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:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,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:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,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:!1,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:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,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:!1},"image/png":{source:"iana",compressible:!1,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:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,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:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,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:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,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:!1},"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:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,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:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,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:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,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:!0},"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:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"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:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"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:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,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:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,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:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,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:!0,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:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,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:!0,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:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,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:!0,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:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,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:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,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:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,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:!1,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:!0},"x-shader/x-vertex":{compressible:!0}},ln=rn(function(e,t){var n,o,i,a=x.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,r=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var t=s.exec(e),n=t&&cn[t[1].toLowerCase()];return n&&n.charset?n.charset:!(!t||!r.test(t[1]))&&"UTF-8"}t.charset=c,t.charsets={lookup:c},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var n=-1===e.indexOf("/")?t.lookup(e):e;if(!n)return!1;if(-1===n.indexOf("charset")){var o=t.charset(n);o&&(n+="; charset="+o.toLowerCase())}return n},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),o=n&&t.extensions[n[1].toLowerCase()];return!(!o||!o.length)&&o[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var n=a("x."+e).toLowerCase().substr(1);return n&&t.types[n]||!1},t.types=Object.create(null),n=t.extensions,o=t.types,i=["nginx","apache",void 0,"iana"],Object.keys(cn).forEach(function(e){var t=cn[e],a=t.extensions;if(a&&a.length){n[e]=a;for(var s=0;s<a.length;s++){var r=a[s];if(o[r]){var c=i.indexOf(cn[o[r]].source),l=i.indexOf(t.source);if("application/octet-stream"!==o[r]&&(c>l||c===l&&"application/"===o[r].substr(0,12)))continue}o[r]=e}}})}),pn=function(e){var t="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;t?t(e):setTimeout(e,0)},un=function(e){var t=!1;return pn(function(){t=!0}),function(n,o){t?e(n,o):pn(function(){e(n,o)})}},dn=function(e){Object.keys(e.jobs).forEach(mn.bind(e)),e.jobs={}};function mn(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var fn=function(e,t,n,o){var i=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[i]=function(e,t,n,o){return 2==e.length?e(n,un(o)):e(n,t,un(o))}(t,i,e[i],function(e,t){i in n.jobs&&(delete n.jobs[i],e?dn(n):n.results[i]=t,o(e,n.results))})},hn=function(e,t){var n=!Array.isArray(e),o={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};return t&&o.keyedList.sort(n?t:function(n,o){return t(e[n],e[o])}),o},gn=function(e){Object.keys(this.jobs).length&&(this.index=this.size,dn(this),un(e)(null,this.results))},vn=function(e,t,n,o){var i=hn(e,n);return fn(e,t,i,function n(a,s){a?o(a,s):(i.index++,i.index<(i.keyedList||e).length?fn(e,t,i,n):o(null,i.results))}),gn.bind(i,o)};function xn(e,t){return e<t?-1:e>t?1:0}vn.ascending=xn,vn.descending=function(e,t){return-1*xn(e,t)};var bn=Object,yn=Error,wn=EvalError,_n=RangeError,kn=ReferenceError,Sn=SyntaxError,jn=TypeError,Tn=URIError,En=Math.abs,$n=Math.floor,On=Math.max,Rn=Math.min,An=Math.pow,Cn=Math.round,Nn=Number.isNaN||function(e){return e!=e},Pn=Object.getOwnPropertyDescriptor;if(Pn)try{Pn([],"length")}catch(e){Pn=null}var In=Pn,Un=Object.defineProperty||!1;if(Un)try{Un({},"a",{value:1})}catch(e){Un=!1}var zn,Ln=Un,Fn=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var o in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0},Dn="undefined"!=typeof Symbol&&Symbol,qn="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null,Bn=bn,Mn=Bn.getPrototypeOf||null,Wn=Object.prototype.toString,Gn=Math.max,Hn=function(e,t){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},Jn=Function.prototype.bind||function(e){var t=this;if("function"!=typeof t||"[object Function]"!==Wn.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,o=function(e,t){for(var n=[],o=1,i=0;o<e.length;o+=1,i+=1)n[i]=e[o];return n}(arguments),i=Gn(0,t.length-o.length),a=[],s=0;s<i;s++)a[s]="$"+s;if(n=Function("binder","return function ("+function(e,t){for(var n="",o=0;o<e.length;o+=1)n+=e[o],o+1<e.length&&(n+=",");return n}(a)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var i=t.apply(this,Hn(o,arguments));return Object(i)===i?i:this}return t.apply(e,Hn(o,arguments))}),t.prototype){var r=function(){};r.prototype=t.prototype,n.prototype=new r,r.prototype=null}return n},Vn=Function.prototype.call,Kn=Function.prototype.apply,Yn="undefined"!=typeof Reflect&&Reflect&&Reflect.apply||Jn.call(Vn,Kn),Zn=jn,Xn=In;try{zn=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var Qn,eo=!!zn&&Xn&&Xn(Object.prototype,"__proto__"),to=Object,no=to.getPrototypeOf,oo=eo&&"function"==typeof eo.get?function(e){if(e.length<1||"function"!=typeof e[0])throw new Zn("a function is required");return Yn(Jn,Vn,e)}([eo.get]):"function"==typeof no&&function(e){return no(null==e?e:to(e))},io=qn?function(e){return qn(e)}:Mn?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return Mn(e)}:oo?function(e){return oo(e)}:null,ao=Jn.call(Function.prototype.call,Object.prototype.hasOwnProperty),so=yn,ro=wn,co=_n,lo=kn,po=Sn,uo=Tn,mo=En,fo=$n,ho=On,go=Rn,vo=An,xo=Cn,bo=Ln,yo=ao,wo=Function,_o=function(e){try{return wo('"use strict"; return ('+e+").constructor;")()}catch(e){}},ko=function(){throw new Zn},So=Xn?function(){try{return ko}catch(e){try{return Xn(arguments,"callee").get}catch(e){return ko}}}():ko,jo="function"==typeof Dn&&"function"==typeof Symbol&&"symbol"==typeof Dn("foo")&&"symbol"==typeof Symbol("bar")&&Fn(),To={},Eo="undefined"!=typeof Uint8Array&&io?io(Uint8Array):Qn,$o={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?Qn:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Qn:ArrayBuffer,"%ArrayIteratorPrototype%":jo&&io?io([][Symbol.iterator]()):Qn,"%AsyncFromSyncIteratorPrototype%":Qn,"%AsyncFunction%":To,"%AsyncGenerator%":To,"%AsyncGeneratorFunction%":To,"%AsyncIteratorPrototype%":To,"%Atomics%":"undefined"==typeof Atomics?Qn:Atomics,"%BigInt%":"undefined"==typeof BigInt?Qn:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?Qn:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?Qn:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Qn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":so,"%eval%":eval,"%EvalError%":ro,"%Float16Array%":"undefined"==typeof Float16Array?Qn:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?Qn:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Qn:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Qn:FinalizationRegistry,"%Function%":wo,"%GeneratorFunction%":To,"%Int8Array%":"undefined"==typeof Int8Array?Qn:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Qn:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Qn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jo&&io?io(io([][Symbol.iterator]())):Qn,"%JSON%":"object"==typeof JSON?JSON:Qn,"%Map%":"undefined"==typeof Map?Qn:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&jo&&io?io((new Map)[Symbol.iterator]()):Qn,"%Math%":Math,"%Number%":Number,"%Object%":Bn,"%Object.getOwnPropertyDescriptor%":Xn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Qn:Promise,"%Proxy%":"undefined"==typeof Proxy?Qn:Proxy,"%RangeError%":co,"%ReferenceError%":lo,"%Reflect%":"undefined"==typeof Reflect?Qn:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Qn:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&jo&&io?io((new Set)[Symbol.iterator]()):Qn,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Qn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jo&&io?io(""[Symbol.iterator]()):Qn,"%Symbol%":jo?Symbol:Qn,"%SyntaxError%":po,"%ThrowTypeError%":So,"%TypedArray%":Eo,"%TypeError%":Zn,"%Uint8Array%":"undefined"==typeof Uint8Array?Qn:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Qn:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Qn:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Qn:Uint32Array,"%URIError%":uo,"%WeakMap%":"undefined"==typeof WeakMap?Qn:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Qn:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Qn:WeakSet,"%Function.prototype.call%":Vn,"%Function.prototype.apply%":Kn,"%Object.defineProperty%":bo,"%Object.getPrototypeOf%":Mn,"%Math.abs%":mo,"%Math.floor%":fo,"%Math.max%":ho,"%Math.min%":go,"%Math.pow%":vo,"%Math.round%":xo,"%Math.sign%":function(e){return Nn(e)||0===e?e:e<0?-1:1},"%Reflect.getPrototypeOf%":qn};if(io)try{null.error}catch(e){var Oo=io(io(e));$o["%Error.prototype%"]=Oo}var Ro=function e(t){var n;if("%AsyncFunction%"===t)n=_o("async function () {}");else if("%GeneratorFunction%"===t)n=_o("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=_o("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&io&&(n=io(i.prototype))}return $o[t]=n,n},Ao={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Co=Jn.call(Vn,Array.prototype.concat),No=Jn.call(Kn,Array.prototype.splice),Po=Jn.call(Vn,String.prototype.replace),Io=Jn.call(Vn,String.prototype.slice),Uo=Jn.call(Vn,RegExp.prototype.exec),zo=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Lo=/\\(\\)?/g,Fo=function(e,t){var n,o=e;if(yo(Ao,o)&&(o="%"+(n=Ao[o])[0]+"%"),yo($o,o)){var i=$o[o];if(i===To&&(i=Ro(o)),void 0===i&&!t)throw new Zn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:i}}throw new po("intrinsic "+e+" does not exist!")},Do=function(e,t){if("string"!=typeof e||0===e.length)throw new Zn("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new Zn('"allowMissing" argument must be a boolean');if(null===Uo(/^%?[^%]*%?$/,e))throw new po("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=function(e){var t=Io(e,0,1),n=Io(e,-1);if("%"===t&&"%"!==n)throw new po("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new po("invalid intrinsic syntax, expected opening `%`");var o=[];return Po(e,zo,function(e,t,n,i){o[o.length]=n?Po(i,Lo,"$1"):t||e}),o}(e),o=n.length>0?n[0]:"",i=Fo("%"+o+"%",t),a=i.name,s=i.value,r=!1,c=i.alias;c&&(o=c[0],No(n,Co([0,1],c)));for(var l=1,p=!0;l<n.length;l+=1){var u=n[l],d=Io(u,0,1),m=Io(u,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new po("property names with quotes must have matching quotes");if("constructor"!==u&&p||(r=!0),yo($o,a="%"+(o+="."+u)+"%"))s=$o[a];else if(null!=s){if(!(u in s)){if(!t)throw new Zn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Xn&&l+1>=n.length){var f=Xn(s,u);s=(p=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:s[u]}else p=yo(s,u),s=s[u];p&&!r&&($o[a]=s)}}return s}("%Object.defineProperty%",!0),qo=Fn()&&Symbol.toStringTag?Symbol.toStringTag:null,Bo=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e},Mo=Z.parse,Wo=J.Stream;function Go(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Ho(e){if(!(this instanceof Ho))return new Ho(e);for(var t in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],on.call(this),e=e||{})this[t]=e[t]}H.inherits(Ho,on),Ho.LINE_BREAK="\r\n",Ho.DEFAULT_CONTENT_TYPE="application/octet-stream",Ho.prototype.append=function(e,t,n){"string"==typeof(n=n||{})&&(n={filename:n});var o=on.prototype.append.bind(this);if("number"!=typeof t&&null!=t||(t=String(t)),Array.isArray(t))this._error(new Error("Arrays are not supported."));else{var i=this._multiPartHeader(e,t,n),a=this._multiPartFooter();o(i),o(t),o(a),this._trackLength(i,t,n)}},Ho.prototype._trackLength=function(e,t,n){var o=0;null!=n.knownLength?o+=Number(n.knownLength):Buffer.isBuffer(t)?o=t.length:"string"==typeof t&&(o=Buffer.byteLength(t)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+Ho.LINE_BREAK.length,t&&(t.path||t.readable&&yo(t,"httpVersion")||t instanceof Wo)&&(n.knownLength||this._valuesToMeasure.push(t))},Ho.prototype._lengthRetriever=function(e,t){yo(e,"fd")?null!=e.end&&Infinity!=e.end&&null!=e.start?t(null,e.end+1-(e.start?e.start:0)):s.stat(e.path,function(n,o){n?t(n):t(null,o.size-(e.start?e.start:0))}):yo(e,"httpVersion")?t(null,Number(e.headers["content-length"])):yo(e,"httpModule")?(e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume()):t("Unknown stream")},Ho.prototype._multiPartHeader=function(e,t,n){if("string"==typeof n.header)return n.header;var o,i=this._getContentDisposition(t,n),a=this._getContentType(t,n),s="",r={"Content-Disposition":["form-data",'name="'+Go(e)+'"'].concat(i||[]),"Content-Type":[].concat(a||[])};for(var c in"object"==typeof n.header&&Bo(r,n.header),r)if(yo(r,c)){if(null==(o=r[c]))continue;Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+Ho.LINE_BREAK)}return"--"+this.getBoundary()+Ho.LINE_BREAK+s+Ho.LINE_BREAK},Ho.prototype._getContentDisposition=function(e,t){var n;if("string"==typeof t.filepath?n=x.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?n=x.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&yo(e,"httpVersion")&&(n=x.basename(e.client._httpMessage.path||"")),n)return'filename="'+Go(n)+'"'},Ho.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e&&e.name&&(n=ln.lookup(e.name)),!n&&e&&e.path&&(n=ln.lookup(e.path)),!n&&e&&e.readable&&yo(e,"httpVersion")&&(n=e.headers["content-type"]),n||!t.filepath&&!t.filename||(n=ln.lookup(t.filepath||t.filename)),!n&&e&&"object"==typeof e&&(n=Ho.DEFAULT_CONTENT_TYPE),n},Ho.prototype._multiPartFooter=function(){return function(e){var t=Ho.LINE_BREAK;0===this._streams.length&&(t+=this._lastBoundary()),e(t)}.bind(this)},Ho.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ho.LINE_BREAK},Ho.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)yo(e,t)&&(n[t.toLowerCase()]=e[t]);return n},Ho.prototype.setBoundary=function(e){if("string"!=typeof e)throw new TypeError("FormData boundary must be a string");this._boundary=e},Ho.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Ho.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,o=this._streams.length;n<o;n++)"function"!=typeof this._streams[n]&&(e=Buffer.isBuffer(this._streams[n])?Buffer.concat([e,this._streams[n]]):Buffer.concat([e,Buffer.from(this._streams[n])]),"string"==typeof this._streams[n]&&this._streams[n].substring(2,t.length+2)===t||(e=Buffer.concat([e,Buffer.from(Ho.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Ho.prototype._generateBoundary=function(){this._boundary="--------------------------"+X.randomBytes(12).toString("hex")},Ho.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Ho.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Ho.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;this._streams.length&&(t+=this._lastBoundary().length),this._valuesToMeasure.length?function(e,t,n){for(var o=hn(e);o.index<(o.keyedList||e).length;)fn(e,t,o,function(e,t){e?n(e,t):0!==Object.keys(o.jobs).length||n(null,o.results)}),o.index++;gn.bind(o,n)}(this._valuesToMeasure,this._lengthRetriever,function(n,o){n?e(n):(o.forEach(function(e){t+=e}),e(null,t))}):process.nextTick(e.bind(this,null,t))},Ho.prototype.submit=function(e,t){var n,o,i={method:"post"};return"string"==typeof e?(e=Mo(e),o=Bo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(o=Bo(e,i)).port||(o.port="https:"===o.protocol?443:80),o.headers=this.getHeaders(e.headers),n="https:"===o.protocol?Y.request(o):K.request(o),this.getLength(function(e,o){if(e&&"Unknown stream"!==e)this._error(e);else if(o&&n.setHeader("Content-Length",o),this.pipe(n),t){var i,a=function(e,o){return n.removeListener("error",a),n.removeListener("response",i),t.call(this,e,o)};i=a.bind(this,null),n.on("error",a),n.on("response",i)}}.bind(this)),n},Ho.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Ho.prototype.toString=function(){return"[object FormData]"},function(e,t){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(void 0!==n&&"boolean"!=typeof n||void 0!==o&&"boolean"!=typeof o)throw new Zn("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");!qo||!n&&yo(e,qo)||(Do?Do(e,qo,{configurable:!o,enumerable:!1,value:t,writable:!1}):e[qo]=t)}(Ho.prototype,"FormData");var Jo=Ho,Vo={isBufferAvailable:()=>"undefined"!=typeof Buffer,from:e=>Buffer.from(e)};const Ko=100;function Yo(e){return Ut.isPlainObject(e)||Ut.isArray(e)}function Zo(e){return Ut.endsWith(e,"[]")?e.slice(0,-2):e}function Xo(e,t,n){return e?e.concat(t).map(function(e,t){return e=Zo(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Qo=Ut.toFlatObject(Ut,{},null,function(e){return/^is[A-Z]/.test(e)});function ei(e,t,n){if(!Ut.isObject(e))throw new TypeError("target must be an object");t=t||new(Jo||FormData);const o=(n=Ut.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Ut.isUndefined(t[e])})).metaTokens,i=n.visitor||m,a=n.dots,s=n.indexes,r=n.Blob||"undefined"!=typeof Blob&&Blob,c=void 0===n.maxDepth?Ko:n.maxDepth,l=r&&Ut.isSpecCompliantForm(t),p=[];if(!Ut.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Ut.isDate(e))return e.toISOString();if(Ut.isBoolean(e))return e.toString();if(!l&&Ut.isBlob(e))throw new Xt("Blob is not supported. Use a Buffer instead.");if(Ut.isArrayBuffer(e)||Ut.isTypedArray(e)){if(l&&"function"==typeof r)return new r([e]);if(Vo&&Vo.isBufferAvailable())return Vo.from(e);throw new Xt("Blob is not supported. Use a Buffer instead.",Xt.ERR_NOT_SUPPORT)}return e}function d(e){if(e>c)throw new Xt("Object is too deeply nested ("+e+" levels). Max depth: "+c,Xt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,n,i){let r=e;if(Ut.isReactNative(t)&&Ut.isReactNativeBlob(e))return t.append(Xo(i,n,a),u(e)),!1;if(e&&!i&&"object"==typeof e)if(Ut.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(Infinity===c)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,t){if(!Ut.isObject(t))return t;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(t),d(1+n.length-1),t})}(e);else if(Ut.isArray(e)&&function(e){return Ut.isArray(e)&&!e.some(Yo)}(e)||(Ut.isFileList(e)||Ut.endsWith(n,"[]"))&&(r=Ut.toArray(e)))return n=Zo(n),r.forEach(function(e,o){!Ut.isUndefined(e)&&null!==e&&t.append(!0===s?Xo([n],o,a):null===s?n:n+"[]",u(e))}),!1;return!!Yo(e)||(t.append(Xo(i,n,a),u(e)),!1)}const f=Object.assign(Qo,{defaultVisitor:m,convertValue:u,isVisitable:Yo});if(!Ut.isObject(e))throw new TypeError("data must be an object");return function e(n,o,a=0){if(!Ut.isUndefined(n)){if(d(a),-1!==p.indexOf(n))throw new Error("Circular reference detected in "+o.join("."));p.push(n),Ut.forEach(n,function(n,s){!0===(!(Ut.isUndefined(n)||null===n)&&i.call(t,n,Ut.isString(s)?s.trim():s,o,f))&&e(n,o?o.concat(s):[s],a+1)}),p.pop()}}(e),t}function ti(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function ni(e,t){this._pairs=[],e&&ei(e,this,t)}const oi=ni.prototype;function ii(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ai(e,t,n){if(!t)return e;e=e||"";const o=Ut.isFunction(n)?{serialize:n}:n,i=Ut.getSafeProp(o,"encode")||ii,a=Ut.getSafeProp(o,"serialize");let s;if(s=a?a(t,o):Ut.isURLSearchParams(t)?t.toString():new ni(t,o).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}oi.append=function(e,t){this._pairs.push([e,t])},oi.toString=function(e){const t=e?t=>e.call(this,t,ti):ti;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var si=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ut.forEach(this.handlers,function(t){null!==t&&e(t)})}},ri={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ci=Z.URLSearchParams;const li="abcdefghijklmnopqrstuvwxyz",pi="0123456789",ui={DIGIT:pi,ALPHA:li,ALPHA_DIGIT:li+li.toUpperCase()+pi};var di={isNode:!0,classes:{URLSearchParams:ci,FormData:Jo,Blob:"undefined"!=typeof Blob&&Blob||null},ALPHABET:ui,generateString:(e=16,t=ui.ALPHA_DIGIT)=>{let n="";const{length:o}=t,i=new Uint32Array(e);X.randomFillSync(i);for(let a=0;a<e;a++)n+=t[i[a]%o];return n},protocols:["http","https","file","data"]};const mi="undefined"!=typeof window&&"undefined"!=typeof document,fi="object"==typeof navigator&&navigator||void 0,hi=mi&&(!fi||["ReactNative","NativeScript","NS"].indexOf(fi.product)<0);var gi={__proto__:null,hasBrowserEnv:mi,hasStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,hasStandardBrowserEnv:hi,navigator:fi,origin:mi&&window.location.href||"http://localhost",...di};const vi=Ko;function xi(e){if(e>vi)throw new Xt("FormData field is too deeply nested ("+e+" levels). Max depth: "+vi,Xt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function bi(e){function t(e,n,o,i){xi(i);let a=e[i++];if("__proto__"===a)return!0;const s=Number.isFinite(+a),r=i>=e.length;return a=!a&&Ut.isArray(o)?o.length:a,r?(o[a]=Ut.hasOwnProp(o,a)?Ut.isArray(o[a])?o[a].concat(n):[o[a],n]:n,!s):(Ut.hasOwnProp(o,a)&&Ut.isObject(o[a])||(o[a]=[]),t(e,n,o[a],i)&&Ut.isArray(o[a])&&(o[a]=function(e){const t={},n=Object.keys(e);let o;const i=n.length;let a;for(o=0;o<i;o++)a=n[o],t[a]=e[a];return t}(o[a])),!s)}if(Ut.isFormData(e)&&Ut.isFunction(e.entries)){const n={};return Ut.forEachEntry(e,(e,o)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let o;for(;null!==(o=n.exec(e));)xi(t.length),t.push("[]"===o[0]?"":o[1]||o[0]);return t}(e),o,n,0)}),n}return null}const yi=(e,t)=>null!=e&&Ut.hasOwnProp(e,t)?e[t]:void 0,wi={transitional:ri,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",o=n.indexOf("application/json")>-1,i=Ut.isObject(e);if(i&&Ut.isHTMLForm(e)&&(e=new FormData(e)),Ut.isFormData(e))return o?JSON.stringify(bi(e)):e;if(Ut.isArrayBuffer(e)||Ut.isBuffer(e)||Ut.isStream(e)||Ut.isFile(e)||Ut.isBlob(e)||Ut.isReadableStream(e))return e;if(Ut.isArrayBufferView(e))return e.buffer;if(Ut.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){const t=yi(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ei(e,new gi.classes.URLSearchParams,{visitor:function(e,t,n,o){return gi.isNode&&Ut.isBuffer(e)?(this.append(t,e.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((a=Ut.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=yi(this,"env"),o=n&&n.FormData;return ei(a?{"files[]":e}:e,o&&new o,t)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Ut.isString(e))try{return(0,JSON.parse)(e),Ut.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=yi(this,"transitional")||wi.transitional,n=t&&t.forcedJSONParsing,o=yi(this,"responseType"),i="json"===o;if(Ut.isResponse(e)||Ut.isReadableStream(e))return e;if(e&&Ut.isString(e)&&(n&&!o||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,yi(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw Xt.from(e,Xt.ERR_BAD_RESPONSE,this,null,yi(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gi.classes.FormData,Blob:gi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ut.forEach(["delete","get","head","post","put","patch","query"],e=>{wi.headers[e]={}});var _i=wi;function ki(e,t){const n=this||_i,o=t||n,i=Kt.from(o.headers);let a=o.data;return Ut.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Si(e){return!(!e||!e.__CANCEL__)}var ji=class extends Xt{constructor(e,t,n){super(null==e?"canceled":e,Xt.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function Ti(e,t,n){const o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(new Xt("Request failed with status code "+n.status,n.status>=400&&n.status<500?Xt.ERR_BAD_REQUEST:Xt.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Ei=/^https?:(?!\/\/)/i,$i=/[\t\n\r]/g;function Oi(e,t){if("string"==typeof e){const n=function(e){return function(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace($i,"")}(e);if(Ei.test(n))throw new Xt(`Invalid URL ${JSON.stringify(function(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Yt}@`),n=t.indexOf("#"),o=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Yt}`);return-1===n?o:`${o}#${i=t.slice(n+1),i?i.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${Yt}`):i}`;var i}(n))}: missing "//" after protocol`,Xt.ERR_INVALID_URL,t)}}function Ri(e,t,n,o){Oi(t,o);let i=!function(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(i||!1===n)?(Oi(e,o),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}var Ai={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Ci(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var Ni=1e3,Pi=60*Ni,Ii=60*Pi,Ui=24*Ii,zi=7*Ui,Li=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return n*zi;case"days":case"day":case"d":return n*Ui;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Ii;case"minutes":case"minute":case"mins":case"min":case"m":return n*Pi;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ni;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=Ui?Fi(e,t,Ui,"day"):t>=Ii?Fi(e,t,Ii,"hour"):t>=Pi?Fi(e,t,Pi,"minute"):t>=Ni?Fi(e,t,Ni,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=Ui?Math.round(e/Ui)+"d":t>=Ii?Math.round(e/Ii)+"h":t>=Pi?Math.round(e/Pi)+"m":t>=Ni?Math.round(e/Ni)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Fi(e,t,n,o){var i=t>=1.5*n;return Math.round(e/n)+" "+o+(i?"s":"")}var Di=function(e){function t(e){let o,i,a,s=null;function r(...e){if(!r.enabled)return;const n=r,i=Number(new Date);n.diff=i-(o||i),n.prev=o,n.curr=i,o=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(o,i)=>{if("%%"===o)return"%";a++;const s=t.formatters[i];return"function"==typeof s&&(o=s.call(n,e[a]),e.splice(a,1),a--),o}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return r.namespace=e,r.useColors=t.useColors(),r.color=t.selectColor(e),r.extend=n,r.destroy=t.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,a=t.enabled(e)),a),set:e=>{s=e}}),"function"==typeof t.init&&t.init(r),r}function n(e,n){const o=t(this.namespace+(void 0===n?":":n)+e);return o.log=this.log,o}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const o=("string"==typeof e?e:"").split(/[\s,]+/),i=o.length;for(n=0;n<i;n++)o[n]&&("-"===(e=o[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,o;for(n=0,o=t.skips.length;n<o;n++)if(t.skips[n].test(e))return!1;for(n=0,o=t.names.length;n<o;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Li,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},qi=rn(function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(o++,"%c"===e&&(i=o))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Di(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),Bi=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",o=t.indexOf(n+e),i=t.indexOf("--");return-1!==o&&(-1===i||o<i)};const{env:Mi}=process;let Wi;function Gi(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Hi(e,t){if(0===Wi)return 0;if(Bi("color=16m")||Bi("color=full")||Bi("color=truecolor"))return 3;if(Bi("color=256"))return 2;if(e&&!t&&void 0===Wi)return 0;const n=Wi||0;if("dumb"===Mi.TERM)return n;if("win32"===process.platform){const e=ie.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in Mi)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in Mi)||"codeship"===Mi.CI_NAME?1:n;if("TEAMCITY_VERSION"in Mi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Mi.TEAMCITY_VERSION)?1:0;if("truecolor"===Mi.COLORTERM)return 3;if("TERM_PROGRAM"in Mi){const e=parseInt((Mi.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Mi.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Mi.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Mi.TERM)||"COLORTERM"in Mi?1:n}Bi("no-color")||Bi("no-colors")||Bi("color=false")||Bi("color=never")?Wi=0:(Bi("color")||Bi("colors")||Bi("color=true")||Bi("color=always"))&&(Wi=1),"FORCE_COLOR"in Mi&&(Wi="true"===Mi.FORCE_COLOR?1:"false"===Mi.FORCE_COLOR?0:0===Mi.FORCE_COLOR.length?1:Math.min(parseInt(Mi.FORCE_COLOR,10),3));var Ji={supportsColor:function(e){return Gi(Hi(e,e&&e.isTTY))},stdout:Gi(Hi(!0,oe.isatty(1))),stderr:Gi(Hi(!0,oe.isatty(2)))},Vi=rn(function(e,t){t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let o=0;o<n.length;o++)e.inspectOpts[n[o]]=t.inspectOpts[n[o]]},t.log=function(...e){return process.stderr.write(H.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:o,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),a=` ${i};1m${o} `;n[0]=a+n[0].split("\n").join("\n"+a),n.push(i+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+o+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):oe.isatty(process.stderr.fd)},t.destroy=H.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{Ji&&(Ji.stderr||Ji).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let o=process.env[t];return o=!!/^(yes|on|true|enabled)$/i.test(o)||!/^(no|off|false|disabled)$/i.test(o)&&("null"===o?null:Number(o)),e[n]=o,e},{}),e.exports=Di(t);const{formatters:n}=e.exports;n.o=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},n.O=function(e){return this.inspectOpts.colors=this.useColors,H.inspect(e,this.inspectOpts)}}),Ki=rn(function(e){e.exports="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?qi:Vi}),Yi=/*#__PURE__*/Object.defineProperty({default:function(e){return function(t,n){return new Promise((o,i)=>{e.call(this,t,n,(e,t)=>{e?i(e):o(t)})})}}},"__esModule",{value:!0}),Zi=sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Xi=Zi(Ki),Qi=Zi(Yi),ea=Xi.default("agent-base");function ta(){const{stack:e}=new Error;return"string"==typeof e&&e.split("\n").some(e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:"))}function na(e,t){return new na.Agent(e,t)}!function(e){e.Agent=class extends re.EventEmitter{constructor(e,t){super();let n=t;"function"==typeof e?this.callback=e:e&&(n=e),this.timeout=null,n&&"number"==typeof n.timeout&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=Infinity,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:ta()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:ta()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,t,n){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){const n=Object.assign({},t);"boolean"!=typeof n.secureEndpoint&&(n.secureEndpoint=ta()),null==n.host&&(n.host="localhost"),null==n.port&&(n.port=n.secureEndpoint?443:80),null==n.protocol&&(n.protocol=n.secureEndpoint?"https:":"http:"),n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,e._last=!0,e.shouldKeepAlive=!1;let o=!1,i=null;const a=n.timeout||this.timeout,s=t=>{e._hadError||(e.emit("error",t),e._hadError=!0)},r=()=>{i=null,o=!0;const e=new Error(`A "socket" was not created for HTTP request before ${a}ms`);e.code="ETIMEOUT",s(e)},c=e=>{o||(null!==i&&(clearTimeout(i),i=null),s(e))},l=t=>{if(o)return;if(null!=i&&(clearTimeout(i),i=null),a=t,Boolean(a)&&"function"==typeof a.addRequest)return ea("Callback returned another Agent instance %o",t.constructor.name),void t.addRequest(e,n);var a;if(t)return t.once("free",()=>{this.freeSocket(t,n)}),void e.onSocket(t);const r=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);s(r)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(ea("Converting legacy callback function to promise"),this.promisifiedCallback=Qi.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof a&&a>0&&(i=setTimeout(r,a)),"port"in n&&"number"!=typeof n.port&&(n.port=Number(n.port));try{ea("Resolving socket for %o request: %o",n.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,n)).then(l,c)}catch(e){Promise.reject(e).catch(c)}}else s(new Error("`callback` is not defined"))}freeSocket(e,t){ea("Freeing socket %o %o",e.constructor.name,t),e.destroy()}destroy(){ea("Destroying agent %o",this.constructor.name)}},e.prototype=e.Agent.prototype}(na||(na={}));var oa=na;const ia=(sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ki).default("https-proxy-agent:parse-proxy-response");var aa=/*#__PURE__*/Object.defineProperty({default:function(e){return new Promise((t,n)=>{let o=0;const i=[];function a(){const n=e.read();n?function(e){i.push(e),o+=e.length;const n=Buffer.concat(i,o);if(-1===n.indexOf("\r\n\r\n"))return ia("have not received end of HTTP headers yet..."),void a();const s=n.toString("ascii",0,n.indexOf("\r\n")),r=+s.split(" ")[1];ia("got proxy server response: %o",s),t({statusCode:r,buffered:n})}(n):e.once("readable",a)}function s(e){ia("onclose had error %o",e)}function r(){ia("onend")}e.on("error",function t(o){e.removeListener("end",r),e.removeListener("error",t),e.removeListener("close",s),e.removeListener("readable",a),ia("onerror %o",o),n(o)}),e.on("close",s),e.on("end",r),a()})}},"__esModule",{value:!0}),sa=sn&&sn.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function r(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,r)}c((o=o.apply(e,t||[])).next())})},ra=sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const ca=ra(ee),la=ra(te),pa=ra(Z),ua=ra(ne),da=ra(Ki),ma=ra(aa),fa=da.default("https-proxy-agent:agent");function ha(e){e.resume()}const ga=(sn&&sn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(/*#__PURE__*/Object.defineProperty({default:class extends oa.Agent{constructor(e){let t;if(t="string"==typeof e?pa.default.parse(e):e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");fa("creating new HttpsProxyAgent instance: %o",t),super(t);const n=Object.assign({},t);var o;this.secureProxy=t.secureProxy||"string"==typeof(o=n.protocol)&&/^https:?$/i.test(o),n.host=n.hostname||n.host,"string"==typeof n.port&&(n.port=parseInt(n.port,10)),!n.port&&n.host&&(n.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in n)&&(n.ALPNProtocols=["http 1.1"]),n.host&&n.path&&(delete n.path,delete n.pathname),this.proxy=n}callback(e,t){return sa(this,void 0,void 0,function*(){const{proxy:n,secureProxy:o}=this;let i;o?(fa("Creating `tls.Socket`: %o",n),i=la.default.connect(n)):(fa("Creating `net.Socket`: %o",n),i=ca.default.connect(n));const a=Object.assign({},n.headers);let s=`CONNECT ${t.host}:${t.port} HTTP/1.1\r\n`;n.auth&&(a["Proxy-Authorization"]=`Basic ${Buffer.from(n.auth).toString("base64")}`);let{host:r,port:c,secureEndpoint:l}=t;(function(e,t){return Boolean(!t&&80===e||t&&443===e)})(c,l)||(r+=`:${c}`),a.Host=r,a.Connection="close";for(const e of Object.keys(a))s+=`${e}: ${a[e]}\r\n`;const p=ma.default(i);i.write(`${s}\r\n`);const{statusCode:u,buffered:d}=yield p;if(200===u){if(e.once("socket",ha),t.secureEndpoint){fa("Upgrading socket connection to TLS");const e=t.servername||t.host;return la.default.connect(Object.assign(Object.assign({},function(e,...t){const n={};let o;for(o in e)t.includes(o)||(n[o]=e[o]);return n}(t,"host","hostname","path","port")),{socket:i,servername:e}))}return i}i.destroy();const m=new ca.default.Socket({writable:!1});return m.readable=!0,e.once("socket",e=>{fa("replaying proxy buffer for failed request"),ua.default(e.listenerCount("data")>0),e.push(d),e.push(null)}),m})}}},"__esModule",{value:!0}));function va(e){return new ga.default(e)}!function(e){e.HttpsProxyAgent=ga.default,e.prototype=ga.default.prototype}(va||(va={}));var xa,ba,ya,wa,_a=va,ka=function(){if(!xa){try{xa=Ki("follow-redirects")}catch(e){}"function"!=typeof xa&&(xa=function(){})}xa.apply(null,arguments)},Sa=Z.URL,ja=J.Writable;ba="undefined"!=typeof process,ya="undefined"!=typeof window&&"undefined"!=typeof document,wa=Ja(Error.captureStackTrace),ba||!ya&&wa||console.warn("The follow-redirects package should be excluded from browser builds.");var Ta=!1;try{ne(new Sa(""))}catch(e){Ta="ERR_INVALID_URL"===e.code}var Ea=["Authorization","Proxy-Authorization","Cookie"],$a=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Oa=["abort","aborted","connect","error","socket","timeout"],Ra=Object.create(null);Oa.forEach(function(e){Ra[e]=function(t,n,o){this._redirectable.emit(e,t,n,o)}});var Aa=Wa("ERR_INVALID_URL","Invalid URL",TypeError),Ca=Wa("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Na=Wa("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Ca),Pa=Wa("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Ia=Wa("ERR_STREAM_WRITE_AFTER_END","write after end"),Ua=ja.prototype.destroy||Fa;function za(e,t){ja.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){try{n._processResponse(e)}catch(e){n.emit("error",e instanceof Ca?e:new Ca({cause:e}))}},this._headerFilter=new RegExp("^(?:"+Ea.concat(e.sensitiveHeaders).map(Va).join("|")+")$","i"),this._performRequest()}function La(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach(function(o){var i=o+":",a=n[i]=e[o],s=t[o]=Object.create(a);Object.defineProperties(s,{request:{value:function(e,o,a){return Sa&&e instanceof Sa?e=Ba(e):Ha(e)?e=Ba(Da(e)):(a=o,o=qa(e),e={protocol:i}),Ja(o)&&(a=o,o=null),(o=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,o)).nativeProtocols=n,Ha(o.host)||Ha(o.hostname)||(o.hostname="::1"),ne.equal(o.protocol,i,"protocol mismatch"),ka("options",o),new za(o,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var o=s.request(e,t,n);return o.end(),o},configurable:!0,enumerable:!0,writable:!0}})}),t}function Fa(){}function Da(e){var t;if(Ta)t=new Sa(e);else if(!Ha((t=qa(Z.parse(e))).protocol))throw new Aa({input:e});return t}function qa(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Aa({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Aa({input:e.href||e});return e}function Ba(e,t){var n=t||{};for(var o of $a)n[o]=e[o];return n.hostname.startsWith("[")&&(n.hostname=n.hostname.slice(1,-1)),""!==n.port&&(n.port=Number(n.port)),n.path=n.search?n.pathname+n.search:n.pathname,n}function Ma(e,t){var n;for(var o in t)e.test(o)&&(n=t[o],delete t[o]);return null==n?void 0:String(n).trim()}function Wa(e,t,n){function o(n){Ja(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,n||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return o.prototype=new(n||Error),Object.defineProperties(o.prototype,{constructor:{value:o,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),o}function Ga(e,t){for(var n of Oa)e.removeListener(n,Ra[n]);e.on("error",Fa),e.destroy(t)}function Ha(e){return"string"==typeof e||e instanceof String}function Ja(e){return"function"==typeof e}function Va(e){return e.replace(/[\]\\/()*+?.$]/g,"\\$&")}(za.prototype=Object.create(ja.prototype)).abort=function(){Ga(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},za.prototype.destroy=function(e){return Ga(this._currentRequest,e),Ua.call(this,e),this},za.prototype.write=function(e,t,n){if(this._ending)throw new Ia;if(!(Ha(e)||"object"==typeof(o=e)&&"length"in o))throw new TypeError("data should be a string, Buffer or Uint8Array");var o;Ja(t)&&(n=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,n)):(this.emit("error",new Pa),this.abort()):n&&n()},za.prototype.end=function(e,t,n){if(Ja(e)?(n=e,e=t=null):Ja(t)&&(n=t,t=null),e){var o=this,i=this._currentRequest;this.write(e,t,function(){o._ended=!0,i.end(null,null,n)}),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,n)},za.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},za.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},za.prototype.setTimeout=function(e,t){var n=this;function o(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function i(t){n._timeout&&clearTimeout(n._timeout),n._timeout=setTimeout(function(){n.emit("timeout"),a()},e),o(t)}function a(){n._timeout&&(clearTimeout(n._timeout),n._timeout=null),n.removeListener("abort",a),n.removeListener("error",a),n.removeListener("response",a),n.removeListener("close",a),t&&n.removeListener("timeout",t),n.socket||n._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",o),this.on("abort",a),this.on("error",a),this.on("response",a),this.on("close",a),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){za.prototype[e]=function(t,n){return this._currentRequest[e](t,n)}}),["aborted","connection","socket"].forEach(function(e){Object.defineProperty(za.prototype,e,{get:function(){return this._currentRequest[e]}})}),za.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.sensitiveHeaders instanceof Array||(e.sensitiveHeaders=[]),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},za.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var n=e.slice(0,-1);this._options.agent=this._options.agents[n]}var o=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var i of(o._redirectable=this,Oa))o.on(i,Ra[i]);if(this._currentUrl=/^\//.test(this._options.path)?Z.format(this._options):this._options.path,this._isRedirect){var a=0,s=this,r=this._requestBodyBuffers;!function e(t){if(o===s._currentRequest)if(t)s.emit("error",t);else if(a<r.length){var n=r[a++];o.finished||o.write(n.data,n.encoding,e)}else s._ended&&o.end()}()}},za.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var n,o=e.headers.location;if(!o||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(Ga(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Na;var i=this._options.beforeRedirect;i&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var a=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Ma(/^content-/i,this._options.headers));var s=Ma(/^host$/i,this._options.headers),r=Da(this._currentUrl),c=s||r.host,l=/^\w+:/.test(o)?this._currentUrl:Z.format(Object.assign(r,{host:c})),p=function(e,t){return Ta?new Sa(e,t):Da(Z.resolve(t,e))}(o,l);ka("redirecting to",p.href),this._isRedirect=!0,Ba(p,this._options),(p.protocol!==r.protocol&&"https:"!==p.protocol||p.host!==c&&!function(e,t){ne(Ha(e)&&Ha(t));var n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(p.host,c))&&Ma(this._headerFilter,this._options.headers),Ja(i)&&(i(this._options,{headers:e.headers,statusCode:t},{url:l,method:a,headers:n}),this._sanitizeOptions(this._options)),this._performRequest()};var Ka=La({http:K,https:Y});Ka.wrap=La;const Ya="1.19.0";function Za(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Xa=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/,Qa=["content-type","content-length"];function es(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{Qa.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}const ts=Symbol("internals");var ns=class extends J.Transform{constructor(e){super({readableHighWaterMark:(e=Ut.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(e,t)=>!Ut.isUndefined(t[e]))).chunkSize});const t=this[ts]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",e=>{"progress"===e&&(t.isCaptured||(t.isCaptured=!0))})}_read(e){const t=this[ts];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const o=this[ts],i=o.maxRate,a=this.readableHighWaterMark,s=o.timeWindow,r=i/(1e3/s),c=!1!==o.minChunkSize?Math.max(o.minChunkSize,.01*r):0,l=(e,t)=>{const n=Buffer.byteLength(e);o.bytesSeen+=n,o.bytes+=n,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(e)?process.nextTick(t):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(t)}},p=(e,t)=>{const n=Buffer.byteLength(e);let p,u=null,d=a,m=0;if(i){const e=Date.now();(!o.ts||(m=e-o.ts)>=s)&&(o.ts=e,p=r-o.bytes,o.bytes=p<0?-p:0,m=0),p=r-o.bytes}if(i){if(p<=0)return setTimeout(()=>{t(null,e)},s-m);p<d&&(d=p)}d&&n>d&&n-d>c&&(u=e.subarray(d),e=e.subarray(0,d)),l(e,u?()=>{process.nextTick(t,null,u)}:t)};p(e,function e(t,o){if(t)return n(t);o?p(o,e):n(null)})}};const{asyncIterator:os}=Symbol;var is=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[os]?yield*e[os]():yield e};const as=gi.ALPHABET.ALPHA_DIGIT+"-_",ss="function"==typeof TextEncoder?new TextEncoder:new H.TextEncoder,rs="\r\n",cs=ss.encode(rs);class ls{constructor(e,t){const{escapeName:n}=this.constructor,o=Ut.isString(t);let i=`Content-Disposition: form-data; name="${n(e)}"${!o&&t.name?`; filename="${n(t.name)}"`:""}${rs}`;o?t=ss.encode(String(t).replace(/\r?\n|\r\n?/g,rs)):i+=`Content-Type: ${String(t.type||"application/octet-stream").replace(/[\r\n]/g,"")}${rs}`,this.headers=ss.encode(i+rs),this.contentLength=o?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=t}async*encode(){yield this.headers;const{value:e}=this;Ut.isTypedArray(e)?yield e:yield*is(e),yield cs}static escapeName(e){return String(e).replace(/[\r\n"]/g,e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e]))}}var ps=class extends J.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,t)}this.__transform(e,t,n)}},us=(e,t)=>Ut.isAsyncFn(e)?function(...n){const o=n.pop();e.apply(this,n).then(e=>{try{t?o(null,...t(e)):o(null,e)}catch(e){o(e)}},o)}:e;const ds=new Set(["localhost","0.0.0.0"]),ms=e=>{const t=e.split(".");return 4===t.length&&"127"===t[0]&&t.every(e=>/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255)},fs=e=>{if(/^0[xX][0-9a-fA-F]+$/.test(e)){const t=parseInt(e.slice(2),16);return Number.isFinite(t)?t:null}if(e.length>1&&/^0[0-7]+$/.test(e)){const t=parseInt(e,8);return Number.isFinite(t)?t:null}if(e.length>1&&/^0[0-9]+$/.test(e))return null;if(/^[0-9]+$/.test(e)){const t=parseInt(e,10);return Number.isFinite(t)?t:null}return null},hs=e=>/^0{1,4}$/.test(e),gs=e=>!!e&&(!!ds.has(e)||!!ms(e)||!!(e=>{if("::"===e)return!0;const t=e.indexOf("::");if(-1!==t){if(t!==e.lastIndexOf("::"))return!1;const n=e.slice(0,t),o=e.slice(t+2),i=n?n.split(":"):[],a=o?o.split(":"):[];return i.length+a.length<8&&i.every(hs)&&a.every(hs)}const n=e.split(":");return 8===n.length&&n.every(hs)})(e)||(e=>{if("::1"===e)return!0;const t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return ms(t[1]);const n=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(n){const e=parseInt(n[1],16);return e>=32512&&e<=32767}const o=e.split(":");if(8===o.length){for(let e=0;e<7;e++)if(!/^0+$/.test(o[e]))return!1;return/^0*1$/.test(o[7])}return!1})(e)),vs={http:80,https:443,ws:80,wss:443,ftp:21},xs=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,bs=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,ys=e=>{if(!e)return e;"["===e.charAt(0)&&"]"===e.charAt(e.length-1)&&(e=e.slice(1,-1));const t=e.replace(/\.+$/,""),n=(e=>{if("string"!=typeof e||!e||-1!==e.indexOf(":"))return e;let t=e;if("["===t.charAt(0)&&"]"===t.charAt(t.length-1)&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return e;const n=t.split(".");if(n.some(e=>""===e))return e;if(4===n.length){const t=n.map(fs);return t.some(e=>null===e||e<0||e>255)?e:t.join(".")}if(n.length>4)return e;if(1===n.length)return e;const o=n.slice(0,-1),i=4-o.length,a=fs(n[n.length-1]);if(null===a)return e;if(a<0||a>(1<<8*i)-1)return e;const s=new Array(i).fill(0);for(let e=i-1,t=a;e>=0;e--,t>>=8)s[e]=255&t;const r=o.map(fs);return r.some(e=>null===e||e<0||e>255)?e:[...r,...s].join(".")})(t);return n!==t?n:(e=>{if("string"!=typeof e||-1===e.indexOf(":"))return e;const t=e.match(xs);if(t)return t[1];const n=e.match(bs);if(n){const e=parseInt(n[1],16),t=parseInt(n[2],16);return`${e>>8}.${255&e}.${t>>8}.${255&t}`}return e})(t)},ws=(e,t,n=3)=>{let o=0;const i=function(e,t){e=e||10;const n=new Array(e),o=new Array(e);let i,a=0,s=0;return t=void 0!==t?t:1e3,function(r){const c=Date.now(),l=o[s];i||(i=c),n[a]=r,o[a]=c;let p=s,u=0;for(;p!==a;)u+=n[p++],p%=e;if(a=(a+1)%e,a===s&&(s=(s+1)%e),c-i<t)return;const d=l&&c-l;return d?Math.round(1e3*u/d):void 0}}(50,250);return function(n,a){let s,r,c=0,l=1e3/a;const p=(n,a=Date.now())=>{c=a,s=null,r&&(clearTimeout(r),r=null),(n=>{if(!n||"number"!=typeof n.loaded)return;const a=n.loaded,s=n.lengthComputable?n.total:void 0,r=Math.max(0,null!=s?Math.min(a,s):a),c=Math.max(0,r-o),l=i(c);o=Math.max(o,r),e({loaded:r,total:s,progress:s?r/s:void 0,bytes:c,rate:l||void 0,estimated:l&&s?(s-r)/l:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})})(...n)};return[(...e)=>{const t=Date.now(),n=t-c;n>=l?p(e,t):(s=e,r||(r=setTimeout(()=>{r=null,p(s)},l-n)))},()=>s&&p(s)]}(0,n)},_s=(e,t)=>{const n=null!=e;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},ks=(e,t=Ut.asap)=>(...n)=>t(()=>e(...n)),Ss=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,js=(e,t,n)=>t+2<n&&Ss(e.charCodeAt(t+1))&&Ss(e.charCodeAt(t+2)),Ts=e=>e<=57?e-48:(223&e)-55,Es=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,$s=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Os=e=>{const t=e.length;let n=0,o=0,i=!1;for(let s=0;s<t;s++){let r=e.charCodeAt(s);37===r&&js(e,s,t)&&(r=16*Ts(e.charCodeAt(s+1))+Ts(e.charCodeAt(s+2)),s+=2),9!==(a=r)&&10!==a&&12!==a&&13!==a&&32!==a&&(61!==r?!Es(r)||o>0?i=!0:n++:o++)}var a;return i||o>2||o>0&&(n+o)%4!=0||n%4==1?$s(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Rs=(e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const o=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(o))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&js(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a},As={flush:pe.constants.Z_SYNC_FLUSH,finishFlush:pe.constants.Z_SYNC_FLUSH},Cs={flush:pe.constants.BROTLI_OPERATION_FLUSH,finishFlush:pe.constants.BROTLI_OPERATION_FLUSH},Ns={flush:pe.constants.ZSTD_e_flush,finishFlush:pe.constants.ZSTD_e_flush},Ps=Ut.isFunction(pe.createBrotliDecompress),Is=Ut.isFunction(pe.createZstdDecompress),Us="gzip, compress, deflate"+(Ps?", br":""),zs=Us+(Is?", zstd":""),Ls="undefined"!=typeof process&&process.nextTick?process.nextTick.bind(process):Ut.asap,{http:Fs,https:Ds}=Ka,qs=/https:?/,Bs=Symbol("axios.http.socketListener"),Ms=Symbol("axios.http.currentReq"),Ws=Symbol("axios.http.installedTunnel"),Gs=new Map,Hs=new WeakMap,Js={22:21,24:5},Vs=gi.protocols.map(e=>e+":"),Ks=e=>{if(!Ut.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Ys=(e,[t,n])=>(e.on("end",n).on("error",n),t),Zs=new class{constructor(){this.sessions=Object.create(null)}getSession(e,t){t=Object.assign({sessionTimeout:1e3},t);let n=this.sessions[e];if(n){let e=n.length;for(let o=0;o<e;o++){const[e,i]=n[o];if(!e.destroyed&&!e.closed&&H.isDeepStrictEqual(i,t))return e}}const o=le.connect(e,t);let i,a;const s=()=>{if(i)return;i=!0,a&&(clearTimeout(a),a=null);let t=n,s=t.length,r=s;for(;r--;)if(t[r][0]===o)return 1===s?delete this.sessions[e]:t.splice(r,1),void(o.closed||o.close())},r=o.request,{sessionTimeout:c}=t;if(null!=c){let e=0;o.request=function(){const t=r.apply(this,arguments);return e++,a&&(clearTimeout(a),a=null),t.once("close",()=>{--e||(a=setTimeout(()=>{a=null,s()},c))}),t}}o.once("close",s);let l=[o,t];return n?n.push(l):n=this.sessions[e]=[l],o}};function Xs(e,t,n){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.auth&&e.beforeRedirects.auth(e),e.beforeRedirects.sensitiveHeaders&&e.beforeRedirects.sensitiveHeaders(e,n),e.beforeRedirects.config&&e.beforeRedirects.config(e,t,n)}function Qs(e,t,n,o,i,a){let s=t;const r=function(e,t,n){return qs.test(e.protocol)?n||Y.globalAgent:t||K.globalAgent}(e,a,i);if(!s&&!1!==s&&!function(e,t=process.versions&&process.versions.node){if(!function(e=process.versions&&process.versions.node){if(!e)return!1;const[t,n]=e.split(".").map(e=>Number(e));return!(!Number.isInteger(t)||!Number.isInteger(n))&&(t>24||null!=Js[t]&&n>=Js[t])}(t))return!1;const n=e&&e.options;return Boolean(n&&Ut.hasOwnProp(n,"proxyEnv")&&null!=n.proxyEnv)}(r)){const e=function(e){var t=("string"==typeof e?function(e){try{return new URL(e)}catch{return null}}(e):e)||{},n=t.protocol,o=t.host,i=t.port;if("string"!=typeof o||!o||"string"!=typeof n)return"";if(n=n.split(":",1)[0],!function(e,t){var n=Ci("no_proxy").toLowerCase();return!n||"*"!==n&&n.split(/[,\s]/).every(function(n){if(!n)return!0;var o=n.match(/^(.+):(\d+)$/),i=o?o[1]:n,a=o?parseInt(o[2]):0;return!(!a||a===t)||(/^[.*]/.test(i)?("*"===i.charAt(0)&&(i=i.slice(1)),!e.endsWith(i)):e!==i)})}(o=o.replace(/:\d*$/,""),i=parseInt(i)||Ai[n]||0))return"";var a=Ci(n+"_proxy")||Ci("all_proxy");return a&&-1===a.indexOf("://")&&(a=n+"://"+a),a}(n);e&&(function(e){let t;try{t=new URL(e)}catch(e){return!1}const n=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!n)return!1;if("*"===n)return!0;const o=Number.parseInt(t.port,10)||vs[t.protocol.split(":",1)[0]]||0,i=ys(t.hostname.toLowerCase());return n.split(/[\s,]+/).some(e=>{if(!e)return!1;if("*"===e)return!0;let[t,n]=(e=>{let t=e,n=0;if("["===t.charAt(0)){const e=t.indexOf("]");if(-1!==e){const o=t.slice(1,e),i=t.slice(e+1);return":"===i.charAt(0)&&/^\d+$/.test(i.slice(1))&&(n=Number.parseInt(i.slice(1),10)),[o,n]}}const o=t.indexOf(":"),i=t.lastIndexOf(":");return-1!==o&&o===i&&/^\d+$/.test(t.slice(i+1))&&(n=Number.parseInt(t.slice(i+1),10),t=t.slice(0,i)),[t,n]})(e);return t=ys(t),!!t&&(!n||n===o)&&("*"===t.charAt(0)&&(t=t.slice(1)),"."===t.charAt(0)?i.endsWith(t):i===t||gs(i)&&gs(t))})}(n)||(s=new URL(e)))}if(o&&e.headers)for(const t of Object.keys(e.headers))"proxy-authorization"===t.toLowerCase()&&delete e.headers[t];if(o&&e.agent&&e.agent[Ws]&&(e.agent=void 0),s){const t=s instanceof URL,o=e=>t||Ut.hasOwnProp(s,e)?s[e]:void 0,a=o("username"),r=o("password");let c=Ut.hasOwnProp(s,"auth")?s.auth:void 0;if(a&&(c=(a||"")+":"+(r||"")),c){const e="object"==typeof c,t=e&&Ut.hasOwnProp(c,"username")?c.username:void 0,n=e&&Ut.hasOwnProp(c,"password")?c.password:void 0;if(Boolean(t||n))c=(t||"")+":"+(n||"");else if(e)throw new Xt("Invalid proxy authorization",Xt.ERR_BAD_OPTION,{proxy:s})}if(qs.test(e.protocol)){if(!(i instanceof _a)){const t=o("hostname")||o("host"),n=o("port"),a=o("protocol"),s=a?a.includes(":")?a:`${a}:`:"http:",r=t&&t.includes(":")&&!t.startsWith("[")?`[${t}]`:t,l=new URL(`${s}//${r}${n?":"+n:""}`),p={protocol:l.protocol,hostname:l.hostname.replace(/^\[|\]$/g,""),port:l.port,auth:c&&"string"==typeof c?c:void 0};"https:"===l.protocol&&(p.ALPNProtocols=["http/1.1"]);const u=function(e,t){const n=e.protocol+"//"+e.hostname+":"+(e.port||"")+"#"+(e.auth||""),o=t?Hs.get(t)||Hs.set(t,new Map).get(t):Gs;let i=o.get(n);if(i)return i;const a=t&&t.options?{...t.options,...e}:e;if(i=new _a(a),t&&t.options){const e={...t.options},n=i.callback;i.callback=function(t,o){return n.call(this,t,{...e,...o})}}return i[Ws]=!0,o.set(n,i),i}(p,i);e.agent=u,e.agents&&(e.agents.https=u)}}else{if(c){const t=Buffer.from(c,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}let t=!1;for(const n of Object.keys(e.headers))if("host"===n.toLowerCase()){t=!0;break}t||(e.headers.host=e.hostname+(e.port?":"+e.port:""));const i=o("hostname")||o("host");e.hostname=i,e.host=i,e.port=o("port"),e.path=n;const a=o("protocol");a&&(e.protocol=a.includes(":")?a:`${a}:`)}}e.beforeRedirects.proxy=function(e){Qs(e,t,e.href,!0,i,a)}}const er="undefined"!=typeof process&&"process"===Ut.kindOf(process),tr=(e,t)=>(({address:e,family:t})=>{if(!Ut.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}})(Ut.isObject(e)?e:{address:e,family:t}),nr={request(e,t){const n=e.protocol+"//"+e.hostname+":"+(e.port||("https:"===e.protocol?443:80)),{http2Options:o,headers:i}=e,a=Zs.getSession(n,o),{HTTP2_HEADER_SCHEME:s,HTTP2_HEADER_METHOD:r,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:l}=le.constants,p={[s]:e.protocol.replace(":",""),[r]:e.method,[c]:e.path};Ut.forEach(i,(e,t)=>{":"!==t.charAt(0)&&(p[t]=e)});const u=a.request(p);return u.once("response",e=>{const n=u,o=(e=Object.assign({},e))[l];delete e[l],n.headers=e,n.statusCode=+o,t(n)}),u}};var or,ir,ar=er&&function(e){return t=async function(t,n,o){const i=t=>Ut.getSafeProp(e,t),a=i("transitional")||ri;let s=i("data"),r=i("lookup"),c=i("family"),l=i("httpVersion");void 0===l&&(l=1);let p=i("http2Options");const u=i("httpAgent"),d=i("httpsAgent"),m=i("proxy"),f=i("responseType"),h=i("responseEncoding"),g=i("socketPath"),v=i("method").toUpperCase(),x=i("maxRedirects"),y=i("maxBodyLength"),w=i("maxContentLength"),_=i("decompress");let k,S,j,T=!1;if(l=+l,Number.isNaN(l))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(1!==l&&2!==l)throw TypeError(`Unsupported protocol version '${l}'`);const E=2===l;if(r){const e=us(r,e=>Ut.isArray(e)?e:[e]);r=(t,n,o)=>{e(t,n,(e,t,i)=>{if(e)return o(e);const a=Ut.isArray(t)?t.map(e=>tr(e)):[tr(t,i)];n.all?o(e,a):o(e,a[0].address,a[0].family)})}}const $=new ce;function O(t){try{$.emit("abort",!t||t.type?new ji(null,e,S):t)}catch(e){}}function R(){j&&(clearTimeout(j),j=null)}$.once("abort",n);const A=()=>{R(),e.cancelToken&&e.cancelToken.unsubscribe(O),e.signal&&e.signal.removeEventListener("abort",O),$.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(O),e.signal&&(e.signal.aborted?O():e.signal.addEventListener("abort",O))),o((e,t)=>{if(k=!0,R(),t)return T=!0,void A();const{data:n}=e;if(n instanceof J.Readable||n instanceof J.Duplex){const e=J.finished(n,()=>{e(),A()})}else A()});const C=Ri(i("baseURL"),i("url"),i("allowAbsoluteUrls"),e),N=new URL(C,g?"http://localhost":gi.hasBrowserEnv?gi.origin:void 0),P=N.protocol||Vs[0];if("data:"===P){if(w>-1){const t=function(e){return Rs(e,$s)}(String(i("url")||C||""));if(t>w)return n(new Xt("maxContentLength size of "+w+" exceeded",Xt.ERR_BAD_RESPONSE,e))}let o;if("GET"!==v)return Ti(t,n,{status:405,statusText:"method not allowed",headers:{},config:e});try{o=function(e,t,n){const o=n&&n.Blob||gi.classes.Blob,i=Za(e);if(void 0===t&&o&&(t=!0),"data"===i){e=i.length?e.slice(i.length+1):e;const n=Xa.exec(e);if(!n)throw new Xt("Invalid URL",Xt.ERR_INVALID_URL);const a=n[1],s=n[2],r=n[3]?"base64":"utf8",c=n[4];let l="";a?l=s?a+s:a:s&&(l="text/plain"+s);const p="base64"===r?Buffer.from(c,"base64"):Buffer.from(decodeURIComponent(c),r);if(t){if(!o)throw new Xt("Blob is not supported",Xt.ERR_NOT_SUPPORT);return new o([p],{type:l})}return p}throw new Xt("Unsupported protocol "+i,Xt.ERR_NOT_SUPPORT)}(i("url"),"blob"===f,{Blob:e.env&&e.env.Blob})}catch(t){throw Xt.from(t,Xt.ERR_BAD_REQUEST,e)}return"text"===f?(o=o.toString(h),h&&"utf8"!==h||(o=Ut.stripBOM(o))):"stream"===f&&(o=J.Readable.from(o)),Ti(t,n,{data:o,status:200,statusText:"OK",headers:new Kt,config:e})}if(-1===Vs.indexOf(P))return n(new Xt("Unsupported protocol "+P,Xt.ERR_BAD_REQUEST,e));const I=Kt.from(e.headers).normalize();I.set("User-Agent","axios/"+Ya,!1);const{onUploadProgress:U,onDownloadProgress:z}=e,L=e.maxRate;let F,D;if(Ut.isSpecCompliantForm(s)){const e=I.getContentType(/boundary=([-_\w\d]{10,70})/i);s=((e,t,n)=>{const{tag:o="form-data-boundary",size:i=25,boundary:a=o+"-"+gi.generateString(i,as)}=n||{};if(!Ut.isFormData(e))throw new TypeError("FormData instance required");if(a.length<1||a.length>70)throw new Error("boundary must be 1-70 characters long");const s=ss.encode("--"+a+rs),r=ss.encode("--"+a+"--"+rs);let c=r.byteLength;const l=Array.from(e.entries()).map(([e,t])=>{const n=new ls(e,t);return c+=n.size,n});c+=s.byteLength*l.length,c=Ut.toFiniteNumber(c);const p={"Content-Type":`multipart/form-data; boundary=${a}`};return Number.isFinite(c)&&(p["Content-Length"]=c),t&&t(p),V.from(async function*(){for(const e of l)yield s,yield*e.encode();yield r}())})(s,e=>{I.set(e)},{tag:`axios-${Ya}-boundary`,boundary:e&&e[1]||void 0})}else if(Ut.isFormData(s)&&Ut.isFunction(s.getHeaders)&&s.getHeaders!==Object.prototype.getHeaders){if(es(I,s.getHeaders(),i("formDataHeaderPolicy")),!I.hasContentLength())try{const e=await H.promisify(s.getLength).call(s);Number.isFinite(e)&&e>=0&&I.setContentLength(e)}catch(e){}}else if(Ut.isBlob(s)||Ut.isFile(s))s.size&&I.setContentType(s.type||"application/octet-stream"),I.setContentLength(s.size||0),s=J.Readable.from(is(s));else if(s&&!Ut.isStream(s)){if(Buffer.isBuffer(s));else if(Ut.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else{if(!Ut.isString(s))return n(new Xt("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Xt.ERR_BAD_REQUEST,e));s=Buffer.from(s,"utf-8")}if(I.setContentLength(s.length,!1),y>-1&&s.length>y)return n(new Xt("Request body larger than maxBodyLength limit",Xt.ERR_BAD_REQUEST,e))}const q=Ut.toFiniteNumber(I.getContentLength());let B;Ut.isArray(L)?(F=L[0],D=L[1]):F=D=L,s&&(U||F)&&(Ut.isStream(s)||(s=J.Readable.from(s,{objectMode:!1})),s=J.pipeline([s,new ns({maxRate:Ut.toFiniteNumber(F)})],Ut.noop),U&&s.on("progress",Ys(s,_s(q,ws(ks(U,Ls),!1,3)))));const M=i("auth");let W;M&&(B=(Ut.getSafeProp(M,"username")||"")+":"+(Ut.getSafeProp(M,"password")||"")),B||!N.username&&!N.password||(B=Ks(N.username)+":"+Ks(N.password)),B&&I.delete("authorization");try{W=ai(N.pathname+N.search,i("params"),i("paramsSerializer")).replace(/^\?/,"")}catch(t){return n(Xt.from(t,Xt.ERR_BAD_REQUEST,e,null,null,{url:i("url"),exists:!0}))}I.set("Accept-Encoding",Ut.hasOwnProp(a,"advertiseZstdAcceptEncoding")&&!0===a.advertiseZstdAcceptEncoding?zs:Us,!1);const G=Object.assign(Object.create(null),{path:W,method:v,headers:qt(I),agents:{http:u,https:d},auth:B,protocol:P,family:c,beforeRedirect:Xs,beforeRedirects:Object.create(null),http2Options:p});if(!Ut.isUndefined(r)&&(G.lookup=r),g){if("string"!=typeof g)return n(new Xt("socketPath must be a string",Xt.ERR_BAD_OPTION_VALUE,e));const t=i("allowedSocketPaths");if(null!=t){const o=Array.isArray(t)?t:[t],i=b(g);if(!o.some(e=>"string"==typeof e&&b(e)===i))return n(new Xt(`socketPath "${g}" is not permitted by allowedSocketPaths`,Xt.ERR_BAD_OPTION_VALUE,e))}G.socketPath=g}else G.hostname=N.hostname.startsWith("[")?N.hostname.slice(1,-1):N.hostname,G.port=N.port,Qs(G,m,P+"//"+N.hostname+(N.port?":"+N.port:"")+G.path,!1,d,u);let Z,X=!1,Q=!1;const ee=qs.test(G.protocol);if(null==G.agent&&(G.agent=ee?d:u),E)Z=nr;else{const t=i("transport");if(t)Z=t;else if(0===x)Z=ee?Y:K,X=!0;else{Q=!0,G.sensitiveHeaders=[],x&&(G.maxRedirects=x);const t=i("beforeRedirect");if(t&&(G.beforeRedirects.config=t),B){const e=N.origin,t=B;G.beforeRedirects.auth=function(n){try{new URL(n.href).origin===e&&(n.auth=t)}catch(e){}}}const o=i("sensitiveHeaders");if(null!=o){if(!Ut.isArray(o))return n(new Xt("sensitiveHeaders must be an array of strings",Xt.ERR_BAD_OPTION_VALUE,e));const t=new Set;for(const i of o){if(!Ut.isString(i))return n(new Xt("sensitiveHeaders must be an array of strings",Xt.ERR_BAD_OPTION_VALUE,e));t.add(i.toLowerCase())}t.size&&(G.sensitiveHeaders=Array.from(t),G.beforeRedirects.sensitiveHeaders=function(e,n){(function(e,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(e.href).origin}catch(e){return!1}})(e,n)||function(e,t){e&&Object.keys(e).forEach(n=>{t.has(n.toLowerCase())&&delete e[n]})}(e.headers,t)})}Z=ee?Ds:Fs}}G.maxBodyLength=y>-1?y:Infinity,G.insecureHTTPParser=Boolean(i("insecureHTTPParser")),S=Z.request(G,function(o){if(R(),S.destroyed)return;const i=[o],a=Ut.toFiniteNumber(o.headers["content-length"]);if(z||D){const e=new ns({maxRate:Ut.toFiniteNumber(D)});z&&e.on("progress",Ys(e,_s(a,ws(ks(z,Ls),!0,3)))),i.push(e)}let s=o;const r=o.req||S;if(!1!==_&&o.headers["content-encoding"])switch("HEAD"!==v&&204!==o.statusCode||delete o.headers["content-encoding"],(o.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":i.push(pe.createUnzip(As)),delete o.headers["content-encoding"];break;case"deflate":i.push(new ps),i.push(pe.createUnzip(As)),delete o.headers["content-encoding"];break;case"br":Ps&&(i.push(pe.createBrotliDecompress(Cs)),delete o.headers["content-encoding"]);break;case"zstd":Is&&(i.push(pe.createZstdDecompress(Ns)),delete o.headers["content-encoding"])}s=i.length>1?J.pipeline(i,Ut.noop):i[0];const c={status:o.statusCode,statusText:o.statusMessage,headers:new Kt(o.headers),config:e,request:r};if("stream"===f){if(w>-1){const t=w,n=s;s=J.Readable.from(async function*(){let o=0;for await(const i of n){if(o+=i.length,o>t)throw new Xt("maxContentLength size of "+t+" exceeded",Xt.ERR_BAD_RESPONSE,e,r);yield i}}(),{objectMode:!1})}c.data=s,Ti(t,n,c)}else{const o=[];let i=0;s.on("data",function(t){o.push(t),i+=t.length,w>-1&&i>w&&(T=!0,s.destroy(),O(new Xt("maxContentLength size of "+w+" exceeded",Xt.ERR_BAD_RESPONSE,e,r)))}),s.on("aborted",function(){if(T)return;const t=new Xt("stream has been aborted",Xt.ERR_BAD_RESPONSE,e,r,c);s.destroy(t),n(t)}),s.on("error",function(t){T||n(Xt.from(t,null,e,r,c))}),s.on("end",function(){try{let e=1===o.length?o[0]:Buffer.concat(o);"arraybuffer"!==f&&(e=e.toString(h),h&&"utf8"!==h||(e=Ut.stripBOM(e))),c.data=e}catch(t){return n(Xt.from(t,null,e,c.request,c))}Ti(t,n,c)})}$.once("abort",e=>{s.destroyed||(s.emit("error",e),s.destroy())})}),$.once("abort",e=>{S.close?S.close():S.destroy(e)}),S.on("error",function(t){n(Xt.from(t,null,e,S))});const te=new Set;if(S.on("socket",function(e){"function"==typeof e.setKeepAlive&&e.setKeepAlive(!0,6e4),e[Bs]||(e.on("error",function(t){const n=e[Ms];n&&!n.destroyed&&n.destroy(t)}),e[Bs]=!0),e[Ms]=S,te.add(e)}),S.once("close",function(){R();for(const e of te)e[Ms]===S&&(e[Ms]=null);te.clear()}),i("timeout")){const t=parseInt(i("timeout"),10);if(Number.isNaN(t))return void O(new Xt("error trying to parse `config.timeout` to int",Xt.ERR_BAD_OPTION_VALUE,e,S));const n=function(){k||O(function(){const t=i("timeout");let n=t?"timeout of "+t+"ms exceeded":"timeout exceeded";const o=i("timeoutErrorMessage");return o&&(n=o),new Xt(n,a.clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,e,S)}())};X&&t>0&&(j=setTimeout(n,t)),S.setTimeout(t,n)}else S.setTimeout(0);if(Ut.isStream(s)){let t=!1,n=!1;s.on("end",()=>{t=!0}),s.once("error",e=>{n=!0,S.destroy(e)}),s.on("close",()=>{t||n||O(new ji("Request stream has been aborted",e,S))});let o=s;if(y>-1&&!Q){const t=y;let n=0;o=J.pipeline([s,new J.Transform({transform(o,i,a){if(n+=o.length,n>t)return a(new Xt("Request body larger than maxBodyLength limit",Xt.ERR_BAD_REQUEST,e,S));a(null,o)}})],Ut.noop),o.on("error",e=>{S.destroyed||S.destroy(e)})}o.pipe(S)}else s&&S.write(s),S.end()},new Promise((e,n)=>{let o,i;const a=(e,t)=>{i||(i=!0,o&&o(e,t))},s=e=>{a(e,!0),n(e)};t(t=>{a(t),e(t)},s,e=>o=e).catch(s)});var t},sr=gi.hasStandardBrowserEnv?(or=new URL(gi.origin),ir=gi.navigator&&/(msie|trident)/i.test(gi.navigator.userAgent),e=>(e=new URL(e,gi.origin),or.protocol===e.protocol&&or.host===e.host&&(ir||or.port===e.port))):()=>!0,rr=gi.hasStandardBrowserEnv?{write(e,t,n,o,i,a,s){if("undefined"==typeof document)return;const r=[`${e}=${encodeURIComponent(t)}`];Ut.isNumber(n)&&r.push(`expires=${new Date(n).toUTCString()}`),Ut.isString(o)&&r.push(`path=${o}`),Ut.isString(i)&&r.push(`domain=${i}`),!0===a&&r.push("secure"),Ut.isString(s)&&r.push(`SameSite=${s}`),document.cookie=r.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const o=t[n].replace(/^\s+/,""),i=o.indexOf("=");if(-1!==i&&o.slice(0,i)===e)try{return decodeURIComponent(o.slice(i+1))}catch(e){return o.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const cr=e=>e instanceof Kt?{...e}:e,lr=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function pr(e,t){e=e||{},t=t||{};const n=Object.create(null);function o(e,t,n,o){return Ut.isPlainObject(e)&&Ut.isPlainObject(t)?Ut.merge.call({caseless:o},e,t):Ut.isPlainObject(t)?Ut.merge({},t):Ut.isArray(t)?t.slice():t}function i(e,t,n,i){return Ut.isUndefined(t)?Ut.isUndefined(e)?void 0:o(void 0,e,0,i):o(e,t,0,i)}function a(e,t){if(!Ut.isUndefined(t))return o(void 0,t)}function s(e,t){return Ut.isUndefined(t)?Ut.isUndefined(e)?void 0:o(void 0,e):o(void 0,t)}function r(n,i,a){return Ut.hasOwnProp(t,a)?o(n,i):Ut.hasOwnProp(e,a)?o(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:r,headers:(e,t,n)=>i(cr(e),cr(t),0,!0)};return Ut.forEach(lr({...e,...t}),function(o){if("__proto__"===o||"constructor"===o||"prototype"===o)return;const a=Ut.hasOwnProp(c,o)?c[o]:i,s=a(Ut.hasOwnProp(e,o)?e[o]:void 0,Ut.hasOwnProp(t,o)?t[o]:void 0,o);Ut.isUndefined(s)&&a!==r||(n[o]=s)}),Ut.hasOwnProp(t,"validateStatus")&&Ut.isUndefined(t.validateStatus)&&!1===function(n){const o=Ut.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Ut.isUndefined(o)){if(!Ut.isPlainObject(o))return;if(Ut.hasOwnProp(o,n))return o[n]}const i=Ut.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Ut.isPlainObject(i)&&Ut.hasOwnProp(i,n))return i[n]}("validateStatusUndefinedResolves")&&(Ut.hasOwnProp(e,"validateStatus")?n.validateStatus=o(void 0,e.validateStatus):delete n.validateStatus),n}function ur(e){const t=pr({},e),n=e=>Ut.hasOwnProp(t,e)?t[e]:void 0,o=n("data");let i=n("withXSRFToken");const a=n("xsrfHeaderName"),s=n("xsrfCookieName");let r=n("headers");const c=n("auth"),l=n("baseURL"),p=n("allowAbsoluteUrls"),u=n("url");if(t.headers=r=Kt.from(r),t.url=ai(Ri(l,u,p,t),n("params"),n("paramsSerializer")),c){const t=Ut.getSafeProp(c,"username")||"",n=Ut.getSafeProp(c,"password")||"";try{r.set("Authorization","Basic "+btoa(t+":"+(n?(e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))(n):"")))}catch(t){throw Xt.from(t,Xt.ERR_BAD_OPTION_VALUE,e)}}if(Ut.isFormData(o)&&(gi.hasStandardBrowserEnv||gi.hasStandardBrowserWebWorkerEnv||Ut.isReactNative(o)?r.setContentType(void 0):Ut.isFunction(o.getHeaders)&&es(r,o.getHeaders(),n("formDataHeaderPolicy"))),gi.hasStandardBrowserEnv&&(Ut.isFunction(i)&&(i=i(t)),!0===i||null==i&&sr(t.url))){const e=a&&s&&rr.read(s);e&&r.set(a,e)}return t}var dr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const o=ur(e);let i=o.data;const a=Kt.from(o.headers).normalize();let s,r,c,l,p,{responseType:u,onUploadProgress:d,onDownloadProgress:m}=o;function f(){l&&l(),p&&p(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let h=new XMLHttpRequest;function g(){if(!h)return;const o=Kt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());Ti(function(e){t(e),f()},function(e){n(e),f()},{data:u&&"text"!==u&&"json"!==u?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:o,config:e,request:h}),h=null}h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout,"onloadend"in h?h.onloadend=g:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&h.responseURL.startsWith("file:"))&&setTimeout(g)},h.onabort=function(){h&&(n(new Xt("Request aborted",Xt.ECONNABORTED,e,h)),f(),h=null)},h.onerror=function(t){const o=new Xt(t&&t.message?t.message:"Network Error",Xt.ERR_NETWORK,e,h);o.event=t||null,n(o),f(),h=null},h.ontimeout=function(){let t=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";o.timeoutErrorMessage&&(t=o.timeoutErrorMessage),n(new Xt(t,(o.transitional||ri).clarifyTimeoutError?Xt.ETIMEDOUT:Xt.ECONNABORTED,e,h)),f(),h=null},void 0===i&&a.setContentType(null),"setRequestHeader"in h&&Ut.forEach(qt(a),function(e,t){h.setRequestHeader(t,e)}),Ut.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),u&&"json"!==u&&(h.responseType=o.responseType),m&&([c,p]=ws(m,!0),h.addEventListener("progress",c)),d&&h.upload&&([r,l]=ws(d),h.upload.addEventListener("progress",r),h.upload.addEventListener("loadend",l)),(o.cancelToken||o.signal)&&(s=t=>{h&&(n(!t||t.type?new ji(null,e,h):t),h.abort(),f(),h=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const v=Za(o.url);if(v&&!gi.protocols.includes(v))return n(new Xt("Unsupported protocol "+v+":",Xt.ERR_BAD_REQUEST,e)),void f();h.send(i||null)})},mr=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let o=!1;const i=function(e){if(!o){o=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Xt?t:new ji(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,i(new Xt(`timeout of ${t}ms exceeded`,Xt.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>{o||(e.aborted?i.call(e):e.addEventListener("abort",i,{once:!0}))});const{signal:r}=n;return r.unsubscribe=()=>Ut.asap(s),r};const fr=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let o,i=0;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},hr=(e,t,n,o)=>{const i=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*fr(n,t)}(e,t);let a,s=0,r=e=>{a||(a=!0,o&&o(e))};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await i.next();if(t)return r(),void e.close();if(n){let e=s+=o.byteLength;n(e)}e.enqueue(new Uint8Array(o))}catch(e){throw r(e),e}},cancel:e=>(r(e),i.return())},{highWaterMark:2})},{isFunction:gr}=Ut,vr=e=>{if(!Ut.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},xr=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},br=e=>{const t=null!=Ut.global?Ut.global:globalThis,{ReadableStream:n,TextEncoder:o}=t;e=Ut.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:a,Response:s}=e,r=i?gr(i):"function"==typeof fetch,c=gr(a),l=gr(s);if(!r)return!1;const p=r&&gr(n),u=r&&("function"==typeof o?(d=new o,e=>d.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer()));var d;const m=c&&p&&xr(()=>{let e=!1;const t=new a(gi.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),o=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!o}),f=l&&p&&xr(()=>Ut.isReadableStream(new s("").body)),h={stream:f&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!h[e]&&(h[e]=(t,n)=>{let o=t&&t[e];if(o)return o.call(t);throw new Xt(`Response type '${e}' is not supported`,Xt.ERR_NOT_SUPPORT,n)})});const g=async e=>{if(null==e)return 0;if(Ut.isBlob(e))return e.size;if(Ut.isSpecCompliantForm(e)){const t=new a(gi.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Ut.isArrayBufferView(e)||Ut.isArrayBuffer(e)?e.byteLength:(Ut.isURLSearchParams(e)&&(e+=""),Ut.isString(e)?(await u(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:r,signal:l,cancelToken:u,timeout:d,onDownloadProgress:v,onUploadProgress:x,responseType:b,headers:y,withCredentials:w="same-origin",fetchOptions:_,maxContentLength:k,maxBodyLength:S}=ur(e);const j=Ut.isNumber(k)&&k>-1,T=Ut.isNumber(S)&&S>-1;let E=i||fetch;b=b?(b+"").toLowerCase():"text";let $=mr([l,u&&u.toAbortSignal()],d),O=null;const R=$&&$.unsubscribe&&(()=>{$.unsubscribe()});let A,C=null;const N=()=>new Xt("Request body larger than maxBodyLength limit",Xt.ERR_BAD_REQUEST,e,O);try{let i;const l=Ut.hasOwnProp(e,"auth")?e.auth:void 0;if(l&&(i={username:Ut.getSafeProp(l,"username")||"",password:Ut.getSafeProp(l,"password")||""}),(e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,gi.origin);i||!e.username&&!e.password||(i={username:vr(e.username),password:vr(e.password)}),(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(i&&(y.delete("authorization"),y.set("Authorization","Basic "+btoa((e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))((i.username||"")+":"+(i.password||""))))),j&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return Rs(-1===t?e:e.slice(0,t),Os)}(t);if(n>k)throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O)}if(T&&"get"!==n&&"head"!==n){const e=await g(r);if("number"==typeof e&&isFinite(e)&&(A=e,e>S))throw N()}const u=T&&(Ut.isReadableStream(r)||Ut.isStream(r)),d=(e,t,n)=>hr(e,65536,e=>{if(T&&e>S)throw C=N();t&&t(e)},n);if(m&&"get"!==n&&"head"!==n&&(x||u)){if(A=null==A?await(async(e,t)=>{const n=Ut.toFiniteNumber(e.getContentLength());return null==n?g(t):n})(y,r):A,0!==A||u){let e,n=new a(t,{method:"POST",body:r,duplex:"half"});if(Ut.isFormData(r)&&(e=n.headers.get("content-type"))&&y.setContentType(e),n.body){const[e,t]=x&&_s(A,ws(ks(x)))||[];r=d(n.body,e,t)}}}else if(u&&!c&&p&&"get"!==n&&"head"!==n)r=d(r);else if(u&&c&&!m&&"get"!==n&&"head"!==n)throw new Xt("Stream request bodies are not supported by the current fetch implementation",Xt.ERR_NOT_SUPPORT,e,O);Ut.isString(w)||(w=w?"include":"omit");const P=c&&"credentials"in a.prototype;if(Ut.isFormData(r)){const e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete("content-type")}y.set("User-Agent","axios/"+Ya,!1);const I={..._,signal:$,method:n.toUpperCase(),headers:qt(y.normalize()),body:r,duplex:"half",credentials:P?w:void 0};O=c&&new a(t,I);let U=await(c?E(O,_):E(t,I));const z=Kt.from(U.headers);if(j){const t=Ut.toFiniteNumber(z.getContentLength());if(null!=t&&t>k)throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O)}const L=f&&("stream"===b||"response"===b);if(f&&U.body&&(v||j||L&&R)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=U[e]});const n=Ut.toFiniteNumber(z.getContentLength()),[o,i]=v&&_s(n,ws(ks(v),!0))||[];let a=0;U=new s(hr(U.body,65536,t=>{if(j&&(a=t,a>k))throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O);o&&o(t)},()=>{i&&i(),R&&R()}),t)}b=b||"text";let F=await h[Ut.findKey(h,b)||"text"](U,e);if(j&&!f&&!L){let t;if(null!=F&&("number"==typeof F.byteLength?t=F.byteLength:"number"==typeof F.size?t=F.size:"string"==typeof F&&(t="function"==typeof o?(new o).encode(F).byteLength:F.length)),"number"==typeof t&&t>k)throw new Xt("maxContentLength size of "+k+" exceeded",Xt.ERR_BAD_RESPONSE,e,O)}return!L&&R&&R(),await new Promise((t,n)=>{Ti(t,n,{data:F,headers:Kt.from(U.headers),status:U.status,statusText:U.statusText,config:e,request:O})})}catch(t){if(R&&R(),$&&$.aborted&&$.reason instanceof Xt){const n=$.reason;throw n.config=e,O&&(n.request=O),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(C)throw O&&!C.request&&(C.request=O),C;if(t instanceof Xt)throw O&&!t.request&&(t.request=O),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new Xt("Network Error",Xt.ERR_NETWORK,e,O,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw Xt.from(t,t&&t.code,e,O,t&&t.response)}}},yr=new Map,wr=e=>{let t=e&&e.env||{};const{fetch:n,Request:o,Response:i}=t,a=[o,i,n];let s,r,c=a.length,l=yr;for(;c--;)s=a[c],r=l.get(s),void 0===r&&l.set(s,r=c?new Map:br(t)),l=r;return r};wr();const _r={http:ar,xhr:dr,fetch:{get:wr}};Ut.forEach(_r,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const kr=e=>`- ${e}`,Sr=e=>Ut.isFunction(e)||null===e||!1===e;var jr=function(e,t){e=Ut.isArray(e)?e:[e];const{length:n}=e;let o,i;const a={};for(let s=0;s<n;s++){let n;if(o=e[s],i=o,!Sr(o)&&(i=_r[(n=String(o)).toLowerCase()],void 0===i))throw new Xt(`Unknown adapter '${n}'`);if(i&&(Ut.isFunction(i)||(i=i.get(t))))break;a[n||"#"+s]=i}if(!i){const e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(kr).join("\n"):" "+kr(e[0]):"as no adapter specified";throw new Xt("There is no suitable adapter to dispatch the request "+t,Xt.ERR_NOT_SUPPORT)}return i};function Tr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ji(null,e)}function Er(e){return Tr(e),e.headers=Kt.from(e.headers),e.data=ki.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jr(e.adapter||_i.adapter,e)(e).then(function(t){Tr(e),e.response=t;try{t.data=ki.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Kt.from(t.headers),t},function(t){if(!Si(t)&&(Tr(e),t&&t.response)){e.response=t.response;try{t.response.data=ki.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Kt.from(t.response.headers)}return Promise.reject(t)})}const $r={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$r[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Or={};$r.transitional=function(e,t,n){function o(e,t){return"[Axios v"+Ya+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new Xt(o(i," has been removed"+(t?" in "+t:"")),Xt.ERR_DEPRECATED);return t&&!Or[i]&&(Or[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}},$r.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Rr={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new Xt("options must be an object",Xt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let i=o.length;for(;i-- >0;){const a=o[i],s=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(s){const t=e[a],n=void 0===t||s(t,a,e);if(!0!==n)throw new Xt("option "+a+" must be "+n,Xt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Xt("Unknown option "+a,Xt.ERR_BAD_OPTION)}},validators:$r};const Ar=Rr.validators;class Cr{constructor(e){this.defaults=e||{},this.interceptors={request:new si,response:new si}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(n){const t=n.indexOf("\n"),o=-1===t?-1:n.indexOf("\n",t+1),i=-1===o?"":n.slice(o+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=pr(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:i}=t;void 0!==n&&Rr.assertOptions(n,{silentJSONParsing:Ar.transitional(Ar.boolean),forcedJSONParsing:Ar.transitional(Ar.boolean),clarifyTimeoutError:Ar.transitional(Ar.boolean),legacyInterceptorReqResOrdering:Ar.transitional(Ar.boolean),advertiseZstdAcceptEncoding:Ar.transitional(Ar.boolean),validateStatusUndefinedResolves:Ar.transitional(Ar.boolean)},!1),null!=o&&(Ut.isFunction(o)?t.paramsSerializer={serialize:o}:Rr.assertOptions(o,{encode:Ar.function,serialize:Ar.function},!0)),void 0!==t.allowAbsoluteUrls||(t.allowAbsoluteUrls=void 0===this.defaults.allowAbsoluteUrls||this.defaults.allowAbsoluteUrls),Rr.assertOptions(t,{baseUrl:Ar.spelling("baseURL"),withXsrfToken:Ar.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&Ut.merge(i.common,i[t.method]);i&&Ut.forEach(["delete","get","head","post","put","patch","query","common"],e=>{delete i[e]}),t.headers=Kt.concat(a,i);const s=[];let r=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;r=r&&e.synchronous;const n=t.transitional||ri;n&&n.legacyInterceptorReqResOrdering?s.unshift(e.fulfilled,e.rejected):s.push(e.fulfilled,e.rejected)});const c=[];let l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let p,u=0;if(!r){const e=[Er.bind(this),void 0];for(e.unshift(...s),e.push(...c),p=e.length,l=Promise.resolve(t);u<p;)l=l.then(e[u++],e[u++]);return l}p=s.length;let d=t;for(;u<p;){const e=s[u++],t=s[u++];try{d=e?e(d):d}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);Ut.isThenable(n)&&(l=Promise.resolve(n).then(()=>Er.call(this,d)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Er.call(this,d)}catch(e){l=Promise.reject(e)}for(u=0,p=c.length;u<p;)l=l.then(c[u++],c[u++]);return l}getUri(e){return ai(Ri((e=pr(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}Ut.forEach(["delete","get","head","options"],function(e){Cr.prototype[e]=function(t,n){return this.request(pr(n||{},{method:e,url:t,data:n&&Ut.hasOwnProp(n,"data")?n.data:void 0}))}}),Ut.forEach(["post","put","patch","query"],function(e){function t(t){return function(n,o,i){return this.request(pr(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Cr.prototype[e]=t(),"query"!==e&&(Cr.prototype[e+"Form"]=t(!0))});var Nr=Cr;class Pr{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const o=new Promise(e=>{n.subscribe(e),t=e}).then(e);return o.cancel=function(){n.unsubscribe(t)},o},e(function(e,o,i){n.reason||(n.reason=new ji(e,o,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Pr(function(t){e=t}),cancel:e}}}var Ir=Pr;const Ur={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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ur).forEach(([e,t])=>{Ur[t]=e});var zr=Ur;const Lr=function e(t){const n=new Nr(t),o=qe(Nr.prototype.request,n);return Ut.extend(o,Nr.prototype,n,{allOwnKeys:!0}),Ut.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(pr(t,n))},o}(_i);Lr.Axios=Nr,Lr.CanceledError=ji,Lr.CancelToken=Ir,Lr.isCancel=Si,Lr.VERSION=Ya,Lr.toFormData=ei,Lr.AxiosError=Xt,Lr.Cancel=Lr.CanceledError,Lr.all=function(e){return Promise.all(e)},Lr.spread=function(e){return function(t){return e.apply(null,t)}},Lr.isAxiosError=function(e){return Ut.isObject(e)&&!0===e.isAxiosError},Lr.mergeConfig=pr,Lr.AxiosHeaders=Kt,Lr.formToJSON=e=>bi(Ut.isHTMLForm(e)?new FormData(e):e),Lr.getAdapter=jr,Lr.HttpStatusCode=zr,Lr.default=Lr;var Fr=Lr;const{CanceledError:Dr}=Fr,qr=/screenshot(\-\d+?)?\.needle\.(webp|png|jpg|jpeg)/;async function Br(e,t){const n=t.baseUrl+Le.jobs.post_update,o={...Fe(t),job_id:e.identifier,status:e.status},i={status_message:e.status_message,error:e.error,progress:e.progress},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)}).catch(e=>(console.error(e),null));return!!a&&a.ok}async function Mr(e,t){const n=t.baseUrl+Le.jobs.get_status,o={...Fe(t),job_id:e,org:t.org},i=await fetch(n,{...De,method:"GET",headers:o}).catch(e=>(t.verbose?console.error("Failed to get job status",e):console.error("Failed to get job status",e.message),null));return i?i.ok?await i.json():(console.error("Failed to get status",i.status,await i.text()),{failed:!0,httpStatus:i.status}):{failed:!0}}function Wr(e={}){var t,n;const o=null!=(t=e.maxAuthFailures)?t:2,i=null!=(n=e.maxTransientFailures)?n:10;let a=0,s=0;return{record(e){if(e&&!0!==e.failed)return a=0,s=0,null;const t=null==e?void 0:e.httpStatus;return 401===t||403===t?(a++,a>=o?{abort:!0,reason:`Not authorized to read the job status (HTTP ${t}). Your access token is invalid or expired — run \`needle-cloud login\` or pass a fresh --token.`}:null):(s++,s>=i?{abort:!0,reason:`Could not read the job status after ${s} attempts${t?` (last: HTTP ${t})`:""}. The job may still be running — check it in the Needle Cloud dashboard.`}:null)}}}const Gr=6,Hr=1e3,Jr=15e3,Vr=9e4,Kr=new Set(["CERT_HAS_EXPIRED","UNABLE_TO_VERIFY_LEAF_SIGNATURE","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","ERR_TLS_CERT_ALTNAME_INVALID"]),Yr=new Set([408,429]);function Zr(e){var t;if(function(e){const t=null==e?void 0:e.name,n=null==e?void 0:e.code;return"CanceledError"===t||"AbortError"===t||"ERR_CANCELED"===n||"ABORT_ERR"===n}(e))return!1;const n=null==e||null==(t=e.response)?void 0:t.status;if("number"==typeof n&&n>0)return!!Yr.has(n)||!(n>=400&&n<500);const o=function(e){var t,n;const o=null!=(t=null==e?void 0:e.code)?t:null==e||null==(n=e.cause)?void 0:n.code;return"string"==typeof o&&o.length?o:null}(e);return!o||!Kr.has(o)}function Xr(e,t={}){const{baseMs:n=Hr,maxMs:o=Jr,random:i=Math.random}=t,a=Math.max(1,Math.floor(e)),s=Math.min(o,n*2**(a-1))/2;return Math.max(1,Math.round(s+i()*s))}async function Qr(e,t={}){const{maxAttempts:n=Gr,budgetMs:o=Vr,baseMs:i=Hr,maxMs:a=Jr,isRetryable:s=Zr,sleep:r=ec,now:c=Date.now,random:l=Math.random,onRetry:p}=t,u=c();let d,m=0;for(;m<n;){m++;try{return{ok:!0,value:await e(m),attempts:m}}catch(e){if(d=e,!s(e))return{ok:!1,error:e,attempts:m,reason:"permanent"};if(m>=n)return{ok:!1,error:e,attempts:m,reason:"attempts-exhausted"};const t=Xr(m,{baseMs:i,maxMs:a,random:l});if(c()-u+t>=o)return{ok:!1,error:e,attempts:m,reason:"budget-exhausted"};null==p||p({attempt:m,waitMs:t,error:e}),await r(t)}}return{ok:!1,error:d,attempts:m,reason:"attempts-exhausted"}}function ec(e){return new Promise(t=>setTimeout(t,e))}const tc=5242880,nc=1e4,oc=16777216,ic=67108864;var ac=rn(function(e,t){e.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],o=e[1],i=e[2],a=e[3];o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[0]-680876936|0)<<7|n>>>25)+o|0)&o|~n&i)+t[1]-389564586|0)<<12|a>>>20)+n|0)&n|~a&o)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&n)+t[3]-1044525330|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[4]-176418897|0)<<7|n>>>25)+o|0)&o|~n&i)+t[5]+1200080426|0)<<12|a>>>20)+n|0)&n|~a&o)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&n)+t[7]-45705983|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[8]+1770035416|0)<<7|n>>>25)+o|0)&o|~n&i)+t[9]-1958414417|0)<<12|a>>>20)+n|0)&n|~a&o)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&n)+t[11]-1990404162|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&i|~o&a)+t[12]+1804603682|0)<<7|n>>>25)+o|0)&o|~n&i)+t[13]-40341101|0)<<12|a>>>20)+n|0)&n|~a&o)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&n)+t[15]+1236535329|0)<<22|o>>>10)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[1]-165796510|0)<<5|n>>>27)+o|0)&i|o&~i)+t[6]-1069501632|0)<<9|a>>>23)+n|0)&o|n&~o)+t[11]+643717713|0)<<14|i>>>18)+a|0)&n|a&~n)+t[0]-373897302|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[5]-701558691|0)<<5|n>>>27)+o|0)&i|o&~i)+t[10]+38016083|0)<<9|a>>>23)+n|0)&o|n&~o)+t[15]-660478335|0)<<14|i>>>18)+a|0)&n|a&~n)+t[4]-405537848|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[9]+568446438|0)<<5|n>>>27)+o|0)&i|o&~i)+t[14]-1019803690|0)<<9|a>>>23)+n|0)&o|n&~o)+t[3]-187363961|0)<<14|i>>>18)+a|0)&n|a&~n)+t[8]+1163531501|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o&a|i&~a)+t[13]-1444681467|0)<<5|n>>>27)+o|0)&i|o&~i)+t[2]-51403784|0)<<9|a>>>23)+n|0)&o|n&~o)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&n|a&~n)+t[12]-1926607734|0)<<20|o>>>12)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[5]-378558|0)<<4|n>>>28)+o|0)^o^i)+t[8]-2022574463|0)<<11|a>>>21)+n|0)^n^o)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^n)+t[14]-35309556|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[1]-1530992060|0)<<4|n>>>28)+o|0)^o^i)+t[4]+1272893353|0)<<11|a>>>21)+n|0)^n^o)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^n)+t[10]-1094730640|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[13]+681279174|0)<<4|n>>>28)+o|0)^o^i)+t[0]-358537222|0)<<11|a>>>21)+n|0)^n^o)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^n)+t[6]+76029189|0)<<23|o>>>9)+i|0,o=((o+=((i=((i+=((a=((a+=((n=((n+=(o^i^a)+t[9]-640364487|0)<<4|n>>>28)+o|0)^o^i)+t[12]-421815835|0)<<11|a>>>21)+n|0)^n^o)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^n)+t[2]-995338651|0)<<23|o>>>9)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[0]-198630844|0)<<6|n>>>26)+o|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~n))+t[5]-57434055|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[12]+1700485571|0)<<6|n>>>26)+o|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~n))+t[1]-2054922799|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[8]+1873313359|0)<<6|n>>>26)+o|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~n))+t[13]+1309151649|0)<<21|o>>>11)+i|0,o=((o+=((a=((a+=(o^((n=((n+=(i^(o|~a))+t[4]-145523070|0)<<6|n>>>26)+o|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+n|0)^((i=((i+=(n^(a|~o))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~n))+t[9]-343485551|0)<<21|o>>>11)+i|0,e[0]=n+e[0]|0,e[1]=o+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}function o(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function i(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function a(e){var t,i,a,s,r,c,l=e.length,p=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)n(p,o(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(p,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*l).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),c=parseInt(s[1],16)||0,a[14]=r,a[15]=c,n(p,a),p}function s(e){var n,o="";for(n=0;n<4;n+=1)o+=t[e>>8*n+4&15]+t[e>>8*n&15];return o}function r(e){var t;for(t=0;t<e.length;t+=1)e[t]=s(e[t]);return e.join("")}function c(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function l(e){var t,n=[],o=e.length;for(t=0;t<o-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function p(){this.reset()}return r(a("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(t,n){var o,i,a,s,r=this.byteLength,c=e(t,r),l=r;return void 0!==n&&(l=e(n,r)),c>l?new ArrayBuffer(0):(o=l-c,i=new ArrayBuffer(o),a=new Uint8Array(i),s=new Uint8Array(this,c,o),a.set(s),i)}}(),p.prototype.append=function(e){return this.appendBinary(c(e)),this},p.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)n(this._hash,o(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},p.prototype.end=function(e){var t,n,o=this._buff,i=o.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)a[t>>2]|=o.charCodeAt(t)<<(t%4<<3);return this._finish(a,i),n=r(this._hash),e&&(n=l(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},p.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(e,t){var o,i,a,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;o=(o=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(o[2],16),a=parseInt(o[1],16)||0,e[14]=i,e[15]=a,n(this._hash,e)},p.hash=function(e,t){return p.hashBinary(c(e),t)},p.hashBinary=function(e,t){var n=r(a(e));return t?l(n):n},(p.ArrayBuffer=function(){this.reset()}).prototype.append=function(e){var t,o,a,s,r=(o=this._buff.buffer,a=e,(s=new Uint8Array(o.byteLength+a.byteLength)).set(new Uint8Array(o)),s.set(new Uint8Array(a),o.byteLength),s),c=r.length;for(this._length+=e.byteLength,t=64;t<=c;t+=64)n(this._hash,i(r.subarray(t-64,t)));return this._buff=t-64<c?new Uint8Array(r.buffer.slice(t-64)):new Uint8Array(0),this},p.ArrayBuffer.prototype.end=function(e){var t,n,o=this._buff,i=o.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)a[t>>2]|=o[t]<<(t%4<<3);return this._finish(a,i),n=r(this._hash),e&&(n=l(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var e=p.prototype.getState.call(this);return e.buff=String.fromCharCode.apply(null,new Uint8Array(e.buff)),e},p.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var n,o=e.length,i=new ArrayBuffer(o),a=new Uint8Array(i);for(n=0;n<o;n+=1)a[n]=e.charCodeAt(n);return a}(e.buff),p.prototype.setState.call(this,e)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(e,t){var o=r(function(e){var t,o,a,s,r,c,l=e.length,p=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=l;t+=64)n(p,i(e.subarray(t-64,t)));for(o=(e=t-64<l?e.subarray(t-64):new Uint8Array(0)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<o;t+=1)a[t>>2]|=e[t]<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(n(p,a),t=0;t<16;t+=1)a[t]=0;return s=(s=8*l).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),c=parseInt(s[1],16)||0,a[14]=r,a[15]=c,n(p,a),p}(new Uint8Array(e)));return t?l(o):o},p}()}),sc=ac;function rc(e,t=0){return uc(e,t,2).getUint16(0,!0)}function cc(e,t=0){return uc(e,t,4).getUint32(0,!0)}function lc(e,t=0,n=e.byteLength){const o=e.slice(t,t+n);return dc.decode(new Uint8Array(o))}function pc(e,t,n=0){if(e.length<t.length+n)return!1;for(const[o,i]of t.entries())if(null!==i&&i!==e[o+n])return!1;return!0}function uc(e,t,n){const o=e.slice(t,t+n);return new DataView(new Uint8Array(o).buffer)}const dc=new TextDecoder("utf8"),mc=[["db","application/vnd.sqlite3",[83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0]],["woff","font/woff",[119,79,70,70]],["woff2","font/woff2",[119,79,70,50]],["bmp","image/bmp",[66,77]],["gif","image/gif",[71,73,70,56,55,97]],["gif","image/gif",[71,73,70,56,57,97]],["heic","image/heic",[102,116,121,112,104,101,105],{offset:4}],["heic","image/heic",[102,116,121,112,109],{offset:4}],["ico","image/x-icon",[0,0,1,0]],["jpg","image/jpeg",[255,216,255]],["pdf","application/pdf",[37,80,68,70,45]],["png","image/png",[137,80,78,71,13,10,26,10]],["7z","application/x-7z-compressed",[55,122,188,175,39,28]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,0]],["rar","application/x-rar-compressed",[82,97,114,33,26,7,1,0]],["rtf","application/rtf",[123,92,114,116,102,49]],["bz2","application/x-bzip2",[66,90,104]],["gz","application/gzip",[31,139]],["tar","application/x-tar",[117,115,116,97,114,0,48,48],{offset:257}],["tar","application/x-tar",[117,115,116,97,114,32,32,0],{offset:257}],["tif","image/tiff",[73,73,42,0]],["tiff","image/tiff",[77,77,0,42]],["zip","application/zip",[80,75,3,4],{exact:!1}],["zip","application/zip",[80,75,5,6]],["mp3","audio/mp3",[255,251]],["mp3","audio/mp3",[255,243]],["mp3","audio/mp3",[255,242]],["mp3","audio/mp3",[73,68,51]],["mp4","video/mp4",[102,116,121,112,105,115,111,109],{offset:4}],["avi","video/x-msvideo",[82,73,70,70,null,null,null,null,65,86,73,32]],["wav","audio/wav",[82,73,70,70,null,null,null,null,87,65,86,69]],["ogx","application/ogg",[79,103,103,83],{exact:!1},[["oga","audio/ogg",[127,70,76,65,67],{offset:28}],["ogg","audio/ogg",[1,118,111,114,98,105,115],{offset:28}],["ogm","video/ogg",[1,118,105,100,101,111,0],{offset:28}],["ogv","video/ogg",[128,116,104,101,111,114,97],{offset:28}]]],["webp","image/webp",[82,73,70,70,null,null,null,null,87,69,66,80]],["psd","image/vnd.adobe.photoshop",[56,66,80,83]],["flac","audio/x-flac",[102,76,97,67]],["wasm","application/wasm",[0,97,115,109]],["deb","application/x-deb",[33,60,97,114,99,104,62,10]],["exe","application/x-msdownload",[77,90]],["exe","application/x-msdownload",[90,77]],["class","application/java-vm",[202,254,186,190]]];function fc(e){return e.flatMap(([e,t,n,o={},i=[]])=>[[e,t,n,o],...i])}function hc(e,t){const n=rc(e,26),o=lc(e,30,n),[i]=o.split("/"),a=o.endsWith(".xml");return"META-INF"===i?{ext:"jar",mime:"application/java-archive"}:"ppt"===i&&a?{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:"word"===i&&a?{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:"xl"===i&&a?{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}:"mimetype"===i?function(e,t){const n=cc(e,18),o=cc(e,22),i=rc(e,28);if(n===o){const o=lc(e,30+t+i,n);if("application/vnd.oasis.opendocument.presentation"===o)return{ext:"odp",mime:o};if("application/vnd.oasis.opendocument.spreadsheet"===o)return{ext:"ods",mime:o};if("application/vnd.oasis.opendocument.text"===o)return{ext:"odt",mime:o};if("application/epub+zip"===o)return{ext:"epub",mime:o}}}(e,n)??t:t}const gc=function(e){return fc(e).map(([e,t,n,{offset:o=0}={}])=>n.length+o).reduce((e,t)=>t>e?t:e,0)}(mc);function vc(e,t){for(const[n,o,i,{exact:a=!0,offset:s=0}={},r=[]]of t)if(pc(e,i,s)){if("zip"===n&&!a)return hc(e.buffer,{ext:n,mime:o});if(!a&&r.length)for(const[t,n,o,{offset:i=0}={}]of r)if(pc(e,o,i))return{ext:t,mime:n};return{ext:n,mime:o}}}function xc(e,t,n=void 0){const o=function(e,t,n){let o=0;for(;;){let t=e.indexOf("\\",o);if(-1===t)break;o=t+1,e=e.replace("\\","/")}return e}(e).split("/").pop()||e,i=(null==n?void 0:n.type)||yc(t,e),a=new File([t],o,{type:i});return a.path=e,a}const bc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function yc(e,t=void 0){const n=function(e,{extra:t=!1,hint:n}={}){const o=new Uint8Array(e.slice(0,gc));if(n){const e=function(e,{ext:t,mime:n}){return t||n?fc(e).filter(e=>e[0]===t||e[1]===n):[]}(mc,n);if(e.length>0){const t=vc(o,e);if(void 0!==t)return t}}return vc(o,mc)||(t?function(e){return function(e){try{const t=lc(e);if(!function(e){for(let t=0;t<e.length;t++)try{const n=e.charCodeAt(t);if(65533===n||n<=8)return!1}catch{return!1}return!0}(t))return;try{return JSON.parse(t),{ext:"json",mime:"application/json"}}catch{return{ext:"txt",mime:"text/plain"}}}catch{return}}(e)}(e):void 0)}(e);if(n)return n.mime;const o=new Uint8Array(e).subarray(0,4);let i="";for(var a=0;a<o.length;a++)i+=o[a].toString(16);let s="unknown";switch(i){case"676c5446":s="model/gltf-binary";break;case"89504e47":s="image/png";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;default:s="unknown"}return"unknown"===s&&"string"==typeof t&&(s=function(e){const t=e.toLowerCase();let n="";return t.endsWith(".html")||t.endsWith(".html.gz")||t.endsWith(".html.br")?n="text/html":t.endsWith(".js")||t.endsWith(".js.gz")||t.endsWith(".js.br")||t.endsWith(".mjs")||t.endsWith(".mjs.gz")||t.endsWith(".mjs.br")||t.endsWith(".cjs")||t.endsWith(".cjs.gz")||t.endsWith(".cjs.br")?n="application/javascript":t.endsWith(".wasm")?n="application/wasm":t.endsWith(".css")||t.endsWith(".css.gz")||t.endsWith(".css.br")?n="text/css":t.endsWith(".json")?n="application/json":t.endsWith(".txt")?n="text/plain":t.endsWith(".md")?n="text/markdown":t.endsWith(".yaml")||t.endsWith(".yml")?n="application/yaml":t.endsWith(".bin")?n="application/octet-stream":t.endsWith(".png")?n="image/png":t.endsWith(".jpg")||t.endsWith(".jpeg")?n="image/jpeg":t.endsWith(".gif")?n="image/gif":t.endsWith(".webp")?n="image/webp":t.endsWith(".avif")?n="image/avif":t.endsWith(".bmp")?n="image/bmp":t.endsWith(".tiff")||t.endsWith(".tif")?n="image/tiff":t.endsWith(".ico")?n="image/x-icon":t.endsWith(".svg")?n="image/svg+xml":t.endsWith(".xml")?n="application/xml":t.endsWith(".hdr")?n="image/vnd.radiance":t.endsWith(".exr")?n="image/x-exr":t.endsWith(".ktx2")?n="image/ktx2":t.endsWith(".ktx")?n="image/ktx":t.endsWith(".dds")?n="image/vnd-ms.dds":t.endsWith(".ogg")?n="audio/ogg":t.endsWith(".mp3")?n="audio/mpeg":t.endsWith(".wav")?n="audio/wave":t.endsWith(".flac")?n="audio/flac":t.endsWith(".m4a")?n="audio/mp4":t.endsWith(".aac")?n="audio/aac":t.endsWith(".mp4")?n="video/mp4":t.endsWith(".webm")?n="video/webm":t.endsWith(".mov")?n="video/quicktime":t.endsWith(".woff2")?n="font/woff2":t.endsWith(".woff")?n="font/woff":t.endsWith(".ttf")?n="font/ttf":t.endsWith(".otf")?n="font/otf":t.endsWith(".zip")?n="application/zip":t.endsWith(".glb")?n="model/gltf-binary":t.endsWith(".gltf")?n="model/gltf+json":t.endsWith(".vrm")?n="model/gltf-binary":t.endsWith(".usdz")?n="model/vnd.usdz+zip":t.endsWith(".usda")?n="model/vnd.usd-usda":t.endsWith(".usdc")?n="model/vnd.usd-usdc":t.endsWith(".usd")?n="model/vnd.usd-usd":t.endsWith(".mtl")?n="model/mtl":t.endsWith(".obj")?n="model/obj":t.endsWith(".fbx")?n="model/vnd.autodesk.fbx":t.endsWith(".stl")?n="model/stl":t.endsWith(".mtlx")?n="application/materialx+xml":t.endsWith(".ply")?n="model/ply":t.endsWith(".dae")?n="model/vnd.collada+xml":t.endsWith(".3mf")?n="model/3mf":(t.endsWith(".splat")||t.endsWith(".spz")||t.endsWith(".ksplat")||t.endsWith(".sog")||t.endsWith(".sogs"))&&(n="application/octet-stream"),n}(t)),s}function wc(e){return"string"==typeof e&&0!==e.length&&e.toLowerCase().endsWith(".exr")}function _c(e){if("string"!=typeof e||0===e.length)return!1;const t=e.toLowerCase();return t.endsWith(".hdr")||t.endsWith(".hdri")}function kc(e){return"string"==typeof e&&0!==e.length&&/\.pmrem(\d+x\d+)?\.ktx2$/i.test(e)}function Sc(e,t){const n=e.toLowerCase();return"application/gzip"===t||"application/brotli"===t?(n.endsWith(".html.gz")||n.endsWith(".html.br")?(t="text/html",e=e.substring(0,e.length-3)):n.endsWith(".js.gz")||n.endsWith(".js.br")||n.endsWith(".mjs.gz")||n.endsWith(".mjs.br")||n.endsWith(".cjs.gz")||n.endsWith(".cjs.br")?(t="application/javascript",e=e.substring(0,e.length-3)):n.endsWith(".css.gz")||n.endsWith(".css.br")?(t="text/css",e=e.substring(0,e.length-3)):n.endsWith(".json.gz")||n.endsWith(".json.br")?(t="text/json",e=e.substring(0,e.length-3)):n.endsWith(".txt.gz")||n.endsWith(".txt.br")?(t="text/plain",e=e.substring(0,e.length-3)):n.endsWith(".wasm.gz")||n.endsWith(".wasm.br")?(t="application/wasm",e=e.substring(0,e.length-3)):n.endsWith(".bin.gz")||n.endsWith(".bin.br")?(t="application/octet-stream",e=e.substring(0,e.length-3)):n.endsWith(".png.gz")||n.endsWith(".png.br")?(t="image/png",e=e.substring(0,e.length-3)):n.endsWith(".jpg.gz")||n.endsWith(".jpg.br")||n.endsWith(".jpeg.gz")||n.endsWith(".jpeg.br")?(t="image/jpeg",e=e.substring(0,e.length-3)):n.endsWith(".gif.gz")||n.endsWith(".gif.br")?(t="image/gif",e=e.substring(0,e.length-3)):n.endsWith(".webp.gz")||n.endsWith(".webp.br")?(t="image/webp",e=e.substring(0,e.length-3)):n.endsWith(".svg.gz")||n.endsWith(".svg.br")?(t="image/svg+xml",e=e.substring(0,e.length-3)):n.endsWith(".xml.gz")||n.endsWith(".xml.br")?(t="application/xml",e=e.substring(0,e.length-3)):n.endsWith(".ico.gz")||n.endsWith(".ico.br")?(t="image/x-icon",e=e.substring(0,e.length-3)):n.endsWith(".avif.gz")||n.endsWith(".avif.br")?(t="image/avif",e=e.substring(0,e.length-3)):n.endsWith(".bmp.gz")||n.endsWith(".bmp.br")?(t="image/bmp",e=e.substring(0,e.length-3)):n.endsWith(".tiff.gz")||n.endsWith(".tiff.br")||n.endsWith(".tif.gz")||n.endsWith(".tif.br")?(t="image/tiff",e=e.substring(0,e.length-3)):n.endsWith(".hdr.gz")||n.endsWith(".hdr.br")?(t="image/vnd.radiance",e=e.substring(0,e.length-3)):n.endsWith(".exr.gz")||n.endsWith(".exr.br")?(t="image/x-exr",e=e.substring(0,e.length-3)):n.endsWith(".ktx2.gz")||n.endsWith(".ktx2.br")?(t="image/ktx2",e=e.substring(0,e.length-3)):n.endsWith(".ktx.gz")||n.endsWith(".ktx.br")?(t="image/ktx",e=e.substring(0,e.length-3)):n.endsWith(".dds.gz")||n.endsWith(".dds.br")?(t="image/vnd-ms.dds",e=e.substring(0,e.length-3)):n.endsWith(".webm.gz")||n.endsWith(".webm.br")?(t="video/webm",e=e.substring(0,e.length-3)):n.endsWith(".mp4.gz")||n.endsWith(".mp4.br")?(t="video/mp4",e=e.substring(0,e.length-3)):n.endsWith(".mov.gz")||n.endsWith(".mov.br")?(t="video/quicktime",e=e.substring(0,e.length-3)):n.endsWith(".mp3.gz")||n.endsWith(".mp3.br")?(t="audio/mpeg",e=e.substring(0,e.length-3)):n.endsWith(".wav.gz")||n.endsWith(".wav.br")?(t="audio/wave",e=e.substring(0,e.length-3)):n.endsWith(".ogg.gz")||n.endsWith(".ogg.br")?(t="audio/ogg",e=e.substring(0,e.length-3)):n.endsWith(".flac.gz")||n.endsWith(".flac.br")?(t="audio/flac",e=e.substring(0,e.length-3)):n.endsWith(".m4a.gz")||n.endsWith(".m4a.br")?(t="audio/mp4",e=e.substring(0,e.length-3)):n.endsWith(".aac.gz")||n.endsWith(".aac.br")?(t="audio/aac",e=e.substring(0,e.length-3)):n.endsWith(".woff2.gz")||n.endsWith(".woff2.br")?(t="font/woff2",e=e.substring(0,e.length-3)):n.endsWith(".woff.gz")||n.endsWith(".woff.br")?(t="font/woff",e=e.substring(0,e.length-3)):n.endsWith(".ttf.gz")||n.endsWith(".ttf.br")?(t="font/ttf",e=e.substring(0,e.length-3)):n.endsWith(".otf.gz")||n.endsWith(".otf.br")?(t="font/otf",e=e.substring(0,e.length-3)):n.endsWith(".md.gz")||n.endsWith(".md.br")?(t="text/markdown",e=e.substring(0,e.length-3)):n.endsWith(".yaml.gz")||n.endsWith(".yaml.br")||n.endsWith(".yml.gz")||n.endsWith(".yml.br")?(t="application/yaml",e=e.substring(0,e.length-3)):n.endsWith(".zip.gz")||n.endsWith(".zip.br")?(t="application/zip",e=e.substring(0,e.length-3)):n.endsWith(".glb.gz")||n.endsWith(".glb.br")?(t="model/gltf-binary",e=e.substring(0,e.length-3)):n.endsWith(".gltf.gz")||n.endsWith(".gltf.br")?(t="model/gltf+json",e=e.substring(0,e.length-3)):n.endsWith(".vrm.gz")||n.endsWith(".vrm.br")?(t="model/gltf-binary",e=e.substring(0,e.length-3)):n.endsWith(".usdz.gz")||n.endsWith(".usdz.br")?(t="model/vnd.usdz+zip",e=e.substring(0,e.length-3)):n.endsWith(".usda.gz")||n.endsWith(".usda.br")?(t="model/vnd.usd-usda",e=e.substring(0,e.length-3)):n.endsWith(".usdc.gz")||n.endsWith(".usdc.br")?(t="model/vnd.usd-usdc",e=e.substring(0,e.length-3)):n.endsWith(".usd.gz")||n.endsWith(".usd.br")?(t="model/vnd.usd-usd",e=e.substring(0,e.length-3)):n.endsWith(".obj.gz")||n.endsWith(".obj.br")?(t="model/obj",e=e.substring(0,e.length-3)):n.endsWith(".mtl.gz")||n.endsWith(".mtl.br")?(t="model/mtl",e=e.substring(0,e.length-3)):n.endsWith(".stl.gz")||n.endsWith(".stl.br")?(t="model/stl",e=e.substring(0,e.length-3)):n.endsWith(".mtlx.gz")||n.endsWith(".mtlx.br")?(t="application/materialx+xml",e=e.substring(0,e.length-3)):n.endsWith(".ply.gz")||n.endsWith(".ply.br")?(t="model/ply",e=e.substring(0,e.length-3)):n.endsWith(".dae.gz")||n.endsWith(".dae.br")?(t="model/vnd.collada+xml",e=e.substring(0,e.length-3)):n.endsWith(".3mf.gz")||n.endsWith(".3mf.br")?(t="model/3mf",e=e.substring(0,e.length-3)):(n.endsWith(".splat.gz")||n.endsWith(".splat.br")||n.endsWith(".spz.gz")||n.endsWith(".spz.br")||n.endsWith(".ksplat.gz")||n.endsWith(".ksplat.br")||n.endsWith(".sog.gz")||n.endsWith(".sog.br")||n.endsWith(".sogs.gz")||n.endsWith(".sogs.br"))&&(t="application/octet-stream",e=e.substring(0,e.length-3)),{filename:e,mimetype:t}):null}function jc(e,t=void 0,n=!0){const o=Math.abs(e);if(o>=1099511627776){let o=n?" TB":"";return(e/1099511627776).toFixed(void 0===t?2:t)+o}if(o>=1073741824){let o=n?" GB":"";return(e/1073741824).toFixed(void 0===t?2:t)+o}if(o>=1048576){let o=n?" MB":"";return(e/1048576).toFixed(void 0===t?1:t)+o}if(o>=1024){let o=n?" KB":"";return(e/1024).toFixed(void 0===t?0:t)+o}let i=n?" B":"";return e.toFixed(0)+i}function Tc(e){return e.split("/").reduce((e,t)=>("."===t||(".."===t?e.pop():null!=t&&t.length&&e.push(t)),e),[]).join("/")}const Ec=1179937895,$c=1313821514,Oc=12,Rc=8;function Ac(e,t){let n=t;for(;n<e.length&&0!==e[n];)n++;return n>=e.length?null:new TextDecoder("latin1").decode(e.subarray(t,n))}async function Cc(e){return new Promise(t=>setTimeout(t,e))}function Nc(e,t,n=void 0){e instanceof Date&&(e=e.getTime()),t instanceof Date&&(t=t.getTime());let o=t-e,i=o>0;const a=!1!==(null==n?void 0:n.prefix),s=!1!==(null==n?void 0:n.suffix);let r="",c="";o<0&&(o=-o);const l=Math.floor(o/1e3),p=Math.floor(l/60),u=Math.floor(p/60),d=Math.floor(u/24);if(null!=(null==n?void 0:n.limitInDays)&&d>=n.limitInDays)return a&&(r="on "),`${r}${new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}${c}`;r=a?i?"":"in ":"",c=s&&i?" ago":"";const m=Math.floor(d/30),f=Math.floor(m/12);return 1===f?`${r}1 year${c}`:f>1?`${r}${Math.floor(f)} years${c}`:1===m?`${r}1 month${c}`:m>1?`${r}${Math.floor(m)} months${c}`:1===d?i&&null!=n&&n.allowSimple?"yesterday":`${r}1 day${c}`:d>1?`${r}${Math.floor(d)} days${c}`:1===u?`${r}1 hour${c}`:u>1?`${r}${Math.floor(u)} hours${c}`:1===p?`${r}1 minute${c}`:p>1?`${r}${Math.floor(p)} minutes${c}`:null!=n&&n.allowSimple&&l<10?"just now":`${r}${l.toFixed(0)} seconds${c}`}const Pc=/^image_(?<image_lod>\d+)_|^mesh_lod_(?<mesh_lod>\d+)_/;function Ic(e){return e.includes("\\u")?JSON.parse(`"${e}"`):decodeURIComponent(e)}function Uc(e){let t=null,n="";const o=e.filter(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());if(1===o.length)return t=o[0],t;const i=e.filter(e=>e.name.toLowerCase().endsWith(".html")||e.name.toLowerCase().endsWith(".htm")||e.name.toLowerCase().endsWith(".html.gz")||e.name.toLowerCase().endsWith(".html.br"));if(1===i.length)return i[0];if(i.length>1){const e=new Map;for(const t of i){const n=t.path.split("/");let o=e.get(n.length);o||(o=[],e.set(n.length,o)),o.push(t)}const o=Array.from(e.keys()).sort((e,t)=>e-t);if(o.length>0)for(const n of o){const o=e.get(n);if(!o)continue;const i=o.find(e=>"index.html"===e.name.toLowerCase()||"index.html.gz"===e.name.toLowerCase()||"index.html.br"===e.name.toLowerCase());return i?(t=i,t):(t=o[0],t)}return n="Invalid upload: Multiple HTML files found but could not determine root.",console.error(n,i.map(e=>e.path||e.name)),{error:n}}const a=e.filter(e=>e.name.toLowerCase().endsWith(".glb")||e.name.toLowerCase().endsWith(".gltf")||e.name.toLowerCase().endsWith(".vrm"));if(a.length>1){const e=function(e){const t=new Array,n=/(mesh_lod|image)_\d_(.{1,50})/;for(const o of e){if(n.test(o.name))continue;const e=o.name.toLowerCase();(e.endsWith(".gltf")||e.endsWith(".vrm")||e.endsWith(".glb"))&&t.push(o)}return 1==t.length?t[0]:null!=(o=Fc(t)[0])?o:null;var o}(a);return e?(t=e,t):(n="Invalid upload: Multiple glb/glTF/vrm files found. This is currently not supported.",console.error(n,a.map(e=>e.path||e.name)),{error:n})}if(1===a.length)return t=a[0],t;const s=e.filter(e=>e.name.toLowerCase().endsWith(".usdz")||e.name.toLowerCase().endsWith(".usd")||e.name.toLowerCase().endsWith(".usda")||e.name.toLowerCase().endsWith(".usdc"));if(s.length>=1)return t=function(e){var t;const n=Fc(e),o=["usda","usdz","usd","usdc"];for(const e of o){const t=n.find(t=>t.name.toLowerCase().endsWith(`.${e}`));if(t)return t}return null!=(t=n[0])?t:null}(s),t;const r=e.filter(e=>e.name.toLowerCase().endsWith(".fbx"));if(r.length>1)return n="Invalid upload: Multiple fbx files found. This is currently not supported.",console.error(n,r),{error:n};if(1===r.length)return t=r[0],t;const c=e.filter(e=>e.name.toLowerCase().endsWith(".obj"));if(c.length>1)return n="Invalid upload: Multiple obj files found. This is currently not supported.",console.error(n,c),{error:n};if(1===c.length)return t=c[0],t;const l=e.filter(e=>e.name.toLowerCase().endsWith(".stl"));if(l.length>1)return n="Invalid upload: Multiple stl files found. This is currently not supported.",console.error(n,l),{error:n};if(1===l.length)return t=l[0],t;const p=e.filter(e=>{const t=e.name.toLowerCase();return t.endsWith(".ply")||t.endsWith(".splat")||t.endsWith(".spz")||t.endsWith(".ksplat")||t.endsWith(".sog")||t.endsWith(".sogs")});if(p.length>1)return n="Invalid upload: Multiple splat files found. Upload them as separate content items.",console.error(n,p.map(e=>e.path||e.name)),{error:n};if(1===p.length)return t=p[0],t;if(1===e.length&&!e[0].arrayBuffer&&e[0].path.toLowerCase().startsWith("http"))return t=e[0],t;const u=e.filter(e=>e.name.toLowerCase().endsWith("package.json"));if(1===u.length)return t=u[0],t;if(u.length>1)return n="Invalid upload: Multiple package.json files found. This is currently not supported.",console.error(n,u),{error:n};const d=e.filter(e=>e.name.toLowerCase().endsWith(".mtlx"));if(d.length>1)return n="Invalid upload: Multiple mtlx files found. This is currently not supported.",console.error(n,d),{error:n};if(1===d.length)return t=d[0],t;const m=e.filter(e=>{const t=e.name.toLowerCase();return wc(t)||_c(t)||kc(t)});return m.length>1?(n="Invalid upload: Multiple HDRI files found. Upload them as separate content items.",console.error(n,m.map(e=>e.path||e.name)),{error:n}):1===m.length?(t=m[0],t):t||{error:"No supported file to upload found..."}}const zc=new Set(["glb","gltf","vrm"]),Lc=new Set(["fbx","obj","stl","usd","usda","usdz"]);function Fc(e){let t=Infinity,n=[];for(const o of e){const e=o.path.split("/").length;e<t?(t=e,n=[o]):e===t&&n.push(o)}return n}class Dc{constructor(e,t){this.totalFiles=e,this.estimatedTotalSize=t,this.uploadedSize=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime,this.lastUploadedSize=0,this.speedEMA=null,this.emaFactor=.1,this.smoothedRemainingTime=null,this.recentSpeeds=new Array,this.maxRecentSpeeds=20,this.initialEstimateThreshold=.05}updateProgress(e){const t=Date.now(),n=(t-this.lastUpdateTime)/1e3,o=e-this.lastUploadedSize;if(this.uploadedSize=e,n>0&&o>0){this.recentSpeeds.push(o/n),this.recentSpeeds.length>this.maxRecentSpeeds&&this.recentSpeeds.shift();const e=this.recentSpeeds.reduce((e,t)=>e+t,0)/this.recentSpeeds.length;this.speedEMA=null===this.speedEMA?e:this.emaFactor*e+(1-this.emaFactor)*this.speedEMA}this.lastUpdateTime=t,this.lastUploadedSize=e;const i=this.uploadedSize/this.estimatedTotalSize,a=(t-this.startTime)/1e3,s=this.speedEMA&&this.speedEMA>0?this.speedEMA:this.uploadedSize/a;let r;if(r=s>0?(this.estimatedTotalSize-this.uploadedSize)/s:Infinity,i>=this.initialEstimateThreshold)if(null===this.smoothedRemainingTime)this.smoothedRemainingTime=r;else{const e=.1;this.smoothedRemainingTime=(1-e)*this.smoothedRemainingTime+e*r}else this.smoothedRemainingTime=a/i-a;return this.smoothedRemainingTime=Math.max(this.smoothedRemainingTime,(this.estimatedTotalSize-this.uploadedSize)/s),{progress:100*i,estimatedTimeRemaining:Math.round(this.smoothedRemainingTime),estimatedTimeRemainingString:this.smoothedRemainingTime>3?this.__formatTime(this.smoothedRemainingTime):"few seconds"}}__formatTime(e){if(!isFinite(e))return"Calculating...";if(e<60)return`${Math.round(e)}sec`;const t=Math.floor(e/60);if(t<60)return`${t}min`;const n=Math.floor(t/60);if(n<24)return`${n}h ${t%60}min`;const o=Math.floor(n/24);return o<=10?`${o}d`:"Calculating..."}}const qc=15e3;function Bc(e,t,n={setTimeout:setTimeout,clearTimeout:clearTimeout}){return function(o,i){const a=e.call(this,o,i);if(!a||"function"!=typeof a.once)return a;const s=n.setTimeout(()=>{const e=new Error(`connect timeout: no connection within ${t/1e3}s`);e.code="ETIMEDOUT",a.destroy(e)},t),r=()=>n.clearTimeout(s);return a.once("connect",r),a.once("secureConnect",r),a.once("error",r),a.once("close",r),a}}let Mc;async function Wc(e={}){var t,n;if(!(null!=(t=e.isNode)?t:"undefined"!=typeof process&&null!=(n=process.versions)&&n.node))return{};if(Mc)return Mc;const[{default:o},{default:i}]=await Promise.all([import("node:http"),import("node:https")]),a=new o.Agent({keepAlive:!0}),s=new i.Agent({keepAlive:!0});for(const e of[a,s])e.createConnection=Bc(e.createConnection,qc);return Mc={httpAgent:a,httpsAgent:s},Mc}async function Gc(e){const t=await import("./pako.esm-01431bd2.js"),n=await e.arrayBuffer(),o=t.gzip(new Uint8Array(n)).buffer.slice(0);if(o.byteLength>51200&&o.byteLength>=n.byteLength){if(n.byteLength>0)return null}else if(!(o instanceof ArrayBuffer))return console.error("gzipCompress: Invalid ArrayBuffer"),{error:`Gzip compressing failed for "${e.name}" (unexpected result)`};return xc(`${"path"in e?e.path:e.name}.gz`,o,{type:"application/gzip"})}const Hc=16777216;async function Jc(e,t,n=void 0){const o=async function(e,t,n){var o,i,a,s,r,c,l,p,u,d,m,f,h,g,v,x,b,y,w,_;let{files:k,skipped:S}=function(e){const t=[];return{files:e.filter(e=>{const n=e.name||"";return!(!n||n.endsWith("/"))||(t.push({name:n,reason:"directory-entry"}),!1)}),skipped:t}}(t.files);for(const e of S)console.warn(`[upload] Skipping directory entry: "${e.name}"`);t.files=k;const j=(null==(o=n)?void 0:o.loglevel)||"none";if(!k.length)return"none"!=j&&console.error("No files to upload"),{success:!1,error:"No files to upload"};if(!t.entrypoint){const e=Uc(k);if(null==e)return{success:!1,error:"No entrypoint file found"};if("object"==typeof e&&"error"in e)return{success:!1,error:e.error};"info"===j&&console.log("Entrypoint: "+e.name),t.entrypoint=e}t.entrypoint&&!k.includes(t.entrypoint)&&k.push(t.entrypoint);const T=await async function(e){if(e.length>5e3)return{success:!1,error:"Too many files. Maximum filecount is 5000"};let t=0,n=0,o=0,i=0;for(let c=e.length-1;c>=0;c--){const l=e[c];if(t+=l.size,t>1073741824)return{success:!1,error:`Total file size exceeds limit of ${1024..toFixed(0)} MB. Please reduce the size of your upload.`};const p=l.name.toLocaleLowerCase();if(".ds_store"!==p){if(p.endsWith(".gltf")?o++:p.endsWith(".glb")?(r=p)&&Pc.test(r)||i++:p.endsWith(".vrm")&&n++,p.endsWith(".gltf")){var a;o+=1,console.log(`Found glTF file ${l.name}. Will check if all dependencies are available\n`,e);const t=await l.text(),n=t.matchAll(/"uri"\s*:\s*"(?<value>.*?)"/g);if(!n)continue;const i=JSON.parse(t);if("2.0"!==i.asset.version)return console.warn("⚠ glTF version is not 2.0. This is currently not supported."),{success:!1,error:`glTF version ${i.asset.version} is unsupported.Please use glTF 2.0.`};const r=null==(a=l.path)?void 0:a.split("/"),c=r.splice(0,r.length-1).join("/");for(const t of n){var s;const n=null==(s=t.groups)?void 0:s.value;if(n){let t=!1;if(n.startsWith("http://")||n.startsWith("https://")||n.startsWith("www.")){console.log(`✅ Found remote dependency ${n} `);break}if(n.startsWith("data:")){console.log(`✅ Found embedded dependency ${n} `);break}{const o=Tc(`${c}/${Ic(n)}`);console.log('❓ Check if local dependency exists "'+o+'"');for(const n of e){if(n.webkitRelativePath===o||n.name==o){t=!0,console.log(`✅ Found dependency in name or webkit: ${n.name} || ${n.webkitRelativePath} `);break}if(n.path===o){t=!0,console.log(`✅ Found dependency in path: ${n.path} `);break}}}if(!t)return console.warn("⚠ Missing dependency "+n,c),{success:!1,error:"Missing resource: "+n}}}}}else e.splice(c,1)}var r;return{success:!0,vrm_count:n,gltf_count:o,glb_count:i}}(k);if("error"in T)return{success:!1,error:T.error||"Failed to validate files"};if(null!=(i=t.entrypoint)&&i.name.endsWith(".htm")||null!=(a=t.entrypoint)&&a.name.endsWith(".html")||null!=(s=t.entrypoint)&&s.name.endsWith(".html.gz")||null!=(r=t.entrypoint)&&r.name.endsWith(".html.br"))n||(n={}),n.type="deployment";else if(T.vrm_count>10)return{success:!1,error:"Multiple model files found - this is not supported for asset uploads. Please upload a single model file only."};const E=await async function(e,t={}){const{raw:n=!1,loglevel:o="none",entrypoint:i=null}=t,a=(...e)=>{"none"!==o&&console.log(...e)};if(n)return"none"!==o&&console.warn("Raw upload - skipping gzip compression of files"),{files:e,entrypoint:i};const s=new Set(e.map(Yc)),r=[];let c=i;for(const t of e){const n=Yc(t),p=t.name.toLowerCase();if(!Vc.some(e=>p.endsWith(e))){r.push(t);continue}const u=Kc.find(e=>s.has(`${n}${e}`));if(u){var l;a(`Skipping gzip compression, using pre-compressed file: ${n}${u}`),i===t&&(c=null!=(l=e.find(e=>Yc(e)===`${n}${u}`))?l:c);continue}a(`gZip compressing file: ${t.name}`);const d=await Gc(t).catch(e=>({error:`Error compressing ${t.name}: ${e.message}`}));if(null===d){"none"!==o&&console.error(`Did not compress file: ${t.name}`),r.push(t);continue}if("error"in d)return{files:e,entrypoint:i,error:d.error};if(!d)return{files:e,entrypoint:i,error:`Failed to compress ${t.name}`};const m=i===t;r.push(d),m&&(c=d),a(`gZip compressed file: ${t.name} ${m?"(entrypoint)":""}`)}return{files:r,entrypoint:c}}(k,{raw:t.raw,loglevel:null!=(c=null==(l=n)?void 0:l.loglevel)?c:j,entrypoint:t.entrypoint});if(E.error)return{success:!1,error:E.error,status:500};k=E.files,t.files=k,t.entrypoint=E.entrypoint,k.sort((e,t)=>e.name.includes(".needle")&&!t.name.includes(".needle")?-1:!e.name.includes(".needle")&&t.name.includes(".needle")?1:0);const{baseUrl:$,authToken:O}=e,R="Bearer "+O,A={...Fe(e),triggered_by:t.triggered_by,filename:`${encodeURIComponent(t.entrypoint.name)}`,"total-files":k.length.toString(),"total-files-size":k.reduce((e,t)=>e+t.size,0).toString()};null!=(p=n)&&p.content_id&&(A.content_id=n.content_id),null!=(u=n)&&u.type&&(A.type=n.type),null!=(d=n)&&d.name&&(A.name=encodeURIComponent(n.name)),null!=(m=n)&&m.parent_job_id&&(A.parent_job_id=n.parent_job_id);const C={entrypoint:(null==(f=t.entrypoint)?void 0:f.path)||(null==(h=t.entrypoint)?void 0:h.name),files:[]};null!=(g=n)&&g.content_type&&(C.content_type=n.content_type);const N={outputs:[C],...t.metadata?{metadata:t.metadata}:{},...!1===(null==(v=n)?void 0:v.optimizations)?{optimizations:!1}:{},...!0===(null==(x=n)?void 0:x.verify)?{verify:!0}:{}},P=[];for(let e=0;e<k.length;e++){var I,U,z;const t=k[e];let o=t.path||t.webkitRelativePath||t.name;if(null!=(I=o)&&I.includes(":"))throw new Error(`Invalid filename: ${o}`);let i=await t.arrayBuffer();const a=t.size;let s=t.type;if(null!=(U=s)&&U.length&&"unknown"!==s.toLowerCase()||(s=yc(i,o)),"deployment"===(null==(z=n)?void 0:z.type)){const e=Sc(o,s);e&&(o=e.filename,s=e.mimetype)}const r=function(e){let t="";for(let n=0;n<e.length;n+=3){const o=e.charCodeAt(n),i=n+1<e.length?e.charCodeAt(n+1):0,a=n+2<e.length?e.charCodeAt(n+2):0;t+=bc[o>>2]+bc[(3&o)<<4|i>>4]+(n+1<e.length?bc[(15&i)<<2|a>>6]:"=")+(n+2<e.length?bc[63&a]:"=")}return t}(sc.ArrayBuffer.hash(i,!0));P[e]=i,C.files[e]={filename:o,content_type:s,content_length:a,content_md5:r}}if("deployment"!==(null==(b=n)?void 0:b.type)){const e=t.entrypoint.name.toLowerCase();let o;if(e.endsWith(".glb")||e.endsWith(".gltf"))try{const n=P[k.indexOf(t.entrypoint)];o=function(e){return function(e){if(!e)return!1;const t=!e.nodes||0===e.nodes.length,n=!e.meshes||0===e.meshes.length,o=Array.isArray(e.materials)&&1===e.materials.length;return t&&n&&o}(e)?"material":"3d-asset"}(e.endsWith(".glb")?function(e){const t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.byteLength<Oc+Rc)throw new Error("Buffer too small to be a GLB");const n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(n.getUint32(0,!0)!==Ec)throw new Error("Not a GLB (magic mismatch)");const o=n.getUint32(Oc,!0);if(n.getUint32(Oc+4,!0)!==$c)throw new Error("First chunk is not JSON");const i=Oc+Rc,a=i+o;if(a>t.byteLength)throw new Error("JSON chunk exceeds buffer length");const s=t.subarray(i,a),r=(new TextDecoder).decode(s);return JSON.parse(r)}(n):JSON.parse((new TextDecoder).decode(n)))}catch(e){return{success:!1,error:`Failed to inspect "${t.entrypoint.name}": ${e.message}`}}else e.endsWith(".mtlx")?o="material":(wc(e)||_c(e)||kc(e))&&(o="hdri");if(o){var L;if(null!=(L=n)&&L.content_type&&n.content_type!==o)return{success:!1,error:`Content type mismatch: "${t.entrypoint.name}" contains "${o}" but "${n.content_type}" was requested.`};C.content_type=o}}try{const e=await async function(e){var t,n,o,i,a;if(!e||"function"!=typeof e.slice||"number"!=typeof e.size)return null;const s=Math.min(e.size,65536);if(s<=0)return null;let r;try{const t=await e.slice(0,s).arrayBuffer();r=new Uint8Array(t)}catch{return null}return null!=(t=null!=(n=null!=(o=null!=(i=null!=(a=function(e){if(e.length<24)return null;if(137!==e[0]||80!==e[1]||78!==e[2]||71!==e[3])return null;if(13!==e[4]||10!==e[5]||26!==e[6]||10!==e[7])return null;const t=new DataView(e.buffer,e.byteOffset),n=t.getUint32(16,!1),o=t.getUint32(20,!1);return n&&o?{width:n,height:o}:null}(r))?a:function(e){if(e.length<28)return null;const t=[171,75,84,88,32,50,48,187,13,10,26,10];for(let n=0;n<t.length;n++)if(e[n]!==t[n])return null;const n=new DataView(e.buffer,e.byteOffset),o=n.getUint32(20,!0),i=n.getUint32(24,!0);return o&&i?{width:o,height:i}:null}(r))?i:function(e){if(e.length<16)return null;if(118!==e[0]||47!==e[1]||49!==e[2]||1!==e[3])return null;const t=new DataView(e.buffer,e.byteOffset);let n=8;for(;n<e.length;){const o=Ac(e,n);if(null===o)return null;if(0===o.length)return null;n+=o.length+1;const i=Ac(e,n);if(null===i)return null;if(n+=i.length+1,n+4>e.length)return null;const a=t.getInt32(n,!0);if(n+=4,a<0||n+a>e.length)return null;if("dataWindow"===o&&"box2i"===i&&16===a){const e=t.getInt32(n,!0),o=t.getInt32(n+4,!0),i=t.getInt32(n+8,!0)-e+1,a=t.getInt32(n+12,!0)-o+1;return i<=0||a<=0?null:{width:i,height:a}}n+=a}return null}(r))?o:function(e){if(e.length<30)return null;if(82!==e[0]||73!==e[1]||70!==e[2]||70!==e[3])return null;if(87!==e[8]||69!==e[9]||66!==e[10]||80!==e[11])return null;const t=String.fromCharCode(e[12],e[13],e[14],e[15]);if("VP8 "===t){const t=16383&(e[26]|e[27]<<8),n=16383&(e[28]|e[29]<<8);return t&&n?{width:t,height:n}:null}return"VP8L"===t?47!==e[20]?null:{width:1+(16383&(e[21]|e[22]<<8)),height:1+(16383&(e[22]>>6|e[23]<<2|(15&e[24])<<10))}:"VP8X"===t?{width:1+(e[24]|e[25]<<8|e[26]<<16),height:1+(e[27]|e[28]<<8|e[29]<<16)}:null}(r))?n:function(e){if(e.length<4)return null;if(255!==e[0]||216!==e[1])return null;let t=2;for(;t<e.length-8;){for(;t<e.length&&255===e[t];)t++;if(t>=e.length)return null;const n=e[t++];if(1===n||n>=208&&n<=217)continue;if(t+2>e.length)return null;const o=e[t]<<8|e[t+1];if(o<2||t+o>e.length)return null;if(n>=192&&n<=207&&196!==n&&200!==n&&204!==n){if(t+7>e.length)return null;const n=e[t+3]<<8|e[t+4],o=e[t+5]<<8|e[t+6];return o&&n?{width:o,height:n}:null}t+=o}return null}(r))?t:function(e){if(e.length<10)return null;if(35!==e[0]||63!==e[1])return null;const t=new TextDecoder("latin1").decode(e.subarray(0,Math.min(e.length,4096))).match(/[+-]Y\s+(\d+)\s+[+-]X\s+(\d+)/);if(!t)return null;const n=parseInt(t[1],10),o=parseInt(t[2],10);return o&&n?{width:o,height:n}:null}(r)}(t.entrypoint);e&&(C.width=e.width,C.height=e.height)}catch(e){"debug"===j&&console.warn("readImageResolution failed; uploading without dimensions",e)}const F=await fetch($+Le.upload.request,{...De,method:"POST",headers:A,body:JSON.stringify(N)}).catch(e=>"fetch failed"==e.message||"Failed to fetch"==e.message?`Network error. Make sure you are connected to the internet and ${$} is reachable.`:(console.error("Failed to begin upload\n",e),null));if(null===F||"string"==typeof F)return{success:!1,error:F||"Failed to begin upload"};if(!F.ok){const e=await F.text();if(e.startsWith("{")){const t=JSON.parse(e);if("error"in t)return{success:!1,status:F.status,error:t.error}}return"none"!=j&&console.error("Failed to begin upload\n",F.status,e),{success:!1,status:F.status,error:`${e}`}}const D=await F.json();"debug"===j&&console.debug("BeginResponse",D);const q=k.reduce((e,t)=>e+t.size,0);var B;if("exists"===D.type)return"none"!=j&&console.log("Upload already exists",D.id),null!=(B=n)&&B.onStart&&n.onStart(D.id,D.content_id),{success:!0,uploadSkipped:!0,id:D.id,type:D.job_type,content_id:D.content_id,filesUploaded:k.length,totalSize:q,url:D.url,edit_url:D.edit_url};const M=t.entrypoint.webkitRelativePath||t.entrypoint.name;let W=0;null==(y=n)||null==(y=y.abort)||y.addEventListener("abort",async()=>{console.log("Upload aborted: Cancelling upload"),await fetch($+Le.upload.cancel,{...De,method:"POST",headers:{authorization:R,id:D.id}})});let G=!1,H=Date.now();function J(t,n,o=!1){if(!o&&Date.now()-H<1e3)return!1;if(G&&"completed"!==n)return void("none"!=j&&console.warn("Invalid status update..."));H=Date.now();const i=Math.floor(W/q*100);return"debug"===j&&console.log("SET STATUS: "+n,t,i),Br({identifier:D.id,status:n,status_message:t,progress:i},e),!0}null!=(w=n)&&w.onStart&&n.onStart(D.id,D.content_id);const V=Date.now(),K=new Dc(k.length,q/1024/1024),Y=new Array,Z=function(e){let t=0;for(const n of e)Number.isFinite(n)&&n>=0&&(t=Math.max(t,n));return t>=ic?2:t>=Hc?4:10}(C.files.map(e=>e.content_length));"debug"===j&&console.debug(`Upload file concurrency: ${Z}`);let X=!1;const Q=[...k],ee=k.length,te=function(e,t=25e3){let n=!1;const o=setInterval(()=>{if(!n)try{const t=e();t&&"function"==typeof t.then&&t.catch(e=>{console.warn("[upload] heartbeat tick failed:",e)})}catch(e){console.warn("[upload] heartbeat tick threw:",e)}},t);return o&&"function"==typeof o.unref&&o.unref(),function(){n||(n=!0,clearInterval(o))}}(()=>J("Upload in progress","running",!0));try{var ne;for(let o=0;o<Q.length;o++){var oe;if(!(X||null!=(oe=n)&&null!=(oe=oe.abort)&&oe.aborted)){if(Y.length<Z){console.debug(`Uploading file ${o}/${k.length}: ${k[o].name}`);let i=0,a=0;const s=C.files[o],r=s.filename,c=P[o],l=s.content_length,p=s.content_type,u=k[o],d=u.name.endsWith(".gz")?"gzip":u.name.endsWith(".br")?"br":void 0,m=al({uploadId:D.id,uploadRequestPUTUrl:D.request_put_url,entrypointPath:M,file:k[o],fileName:r,fileMd5:s.content_md5,fileBuffer:c,fileType:p,content_encoding:d,fileSize:l,fileIndex:o,fileNumber:o+1,fileCount:ee,loglevel:j,experimental:t.experimental,args:e,options:n,onProgress:e=>{var t;const s=e.progress||0;i=k[o].size*s;const c=i-a;if(a=i,W+=c,null!=(t=n)&&t.progress){const e=W/q,t=k.length,i=k[o].size,a=(Date.now()-V)/1e3,c=K.updateProgress(W/1024/1024);n.progress({uploadedBytes:W,totalBytes:q,progress01:e,fileName:k[o].name,fileSize:i,fileProgress01:s,fileIndex:o,totalFiles:t,estimatedTimeLeftDisplay:c.estimatedTimeRemainingString,estimatedTimeLeft:c.estimatedTimeRemaining,elapsedTime:a}),J(`Uploading file ${o+1}/${t} (${r}): ${(100*s).toFixed(0)}% of ${jc(q)}. Finished in approx. ${c.estimatedTimeRemainingString}`,"running",!1)}}}).then(e=>{if(!0!==e)return e;for(let e=Y.length-1;e>=0;e--)Y[e]===m&&Y.splice(e,1);J(`Uploaded ${jc(W)+" of "+jc(q)} for ${k[o].name}`,"running")}).catch(e=>{var t;null!=(t=n)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),X=!0)});Y.push(m)}Y.length>=Z&&await Promise.race(Y)}}null!=(ne=n)&&null!=(ne=ne.abort)&&ne.aborted?console.debug("Upload aborted"):X&&console.debug("Upload failed"),await Promise.all(Y).catch(e=>{var t;null!=(t=n)&&null!=(t=t.abort)&&t.aborted?console.warn("Upload aborted"):(console.error(e.message),X=!0)})}finally{te()}if(X)return await Br({identifier:D.id,status:"failed",error:"Failed to upload files"},e),{success:!1,error:"Failed to upload files"};if(null!=(_=n)&&null!=(_=_.abort)&&_.aborted)return await Br({identifier:D.id,status:"canceled",status_message:"Upload aborted",error:"Upload aborted"},e),{success:!1,error:"Upload aborted"};G=!0,console.log(`Upload Done: All files uploaded to ${D.id}`);const ie={...Fe(e),id:D.id};"none"!=j&&console.log("Completing upload - notify server");let ae=null;for(let e=0;e<5;e++){var se;await Cc(1e3*e);const t=AbortSignal.timeout(6e4+5e3*e);if(ae=await fetch($+Le.upload.done,{...De,method:"POST",headers:ie,signal:t}).catch(t=>(console.error(`Failed to complete upload (${e+1} / 5)`,t.message),null)),!0===(null==(se=ae)?void 0:se.ok))break;if(ae&&ae.status>=400&&ae.status<500)break;var re;"none"!=j&&e<4&&console.warn(`Failed to complete upload (${(null==(re=ae)?void 0:re.status)||"no status"}): will retry in 1 second`)}if(!ae)return console.error("Failed to complete upload"),{success:!1,error:"Failed to complete upload"};if(!ae.ok){if(524===ae.status)return console.error("Failed to complete upload: Gateway Timeout"),{success:!1,error:"Failed to complete upload: Gateway Timeout"};{const e=await ae.text().catch(()=>"");return console.error(`Failed to complete upload (${ae.status}): ${e}`),{success:!1,error:`Failed to complete upload: ${e?e.substring(0,300):`status ${ae.status}`}`}}}"none"!=j&&console.log("Upload complete");const ce=await ae.json();return{success:!0,type:ce.type,uploadSkipped:!1,id:ce.id,content_id:ce.content_id,url:ce.url,edit_url:ce.edit_url,filesUploaded:k.length,totalSize:q}}(e,t,n);return await o.finally(()=>{})}const Vc=[".html",".js",".css"],Kc=[".gz",".br"];function Yc(e){return"path"in e&&e.path?e.path:e.name}function Zc(e){var t;const n=null==e||null==(t=e.config)?void 0:t.url;if(!n)return null;try{return new URL(n).host}catch{return null}}const Xc=400,Qc=255;function el(e){const t="string"==typeof e?e:String(null!=e?e:"");return t.length<=Qc?t:t.slice(0,Qc-1)+"…"}const tl={ECONNRESET:"connection reset before the upload completed",ECONNREFUSED:"connection refused by the storage host",ECONNABORTED:"connection aborted — timed out or closed mid-request",ENOTFOUND:"DNS lookup failed for the storage host",EAI_AGAIN:"DNS lookup failed temporarily — resolver unavailable",ETIMEDOUT:"connection timed out",EPIPE:"connection closed while sending the file",EHOSTUNREACH:"storage host unreachable from this network",ENETUNREACH:"network unreachable",EPROTO:"TLS or protocol error",ERR_NETWORK:"network error — the request never reached the storage host",CERT_HAS_EXPIRED:"the TLS certificate for the storage host has expired",UNABLE_TO_VERIFY_LEAF_SIGNATURE:"the TLS certificate for the storage host could not be verified",DEPTH_ZERO_SELF_SIGNED_CERT:"a self-signed TLS certificate was presented for the storage host",SELF_SIGNED_CERT_IN_CHAIN:"a self-signed TLS certificate was presented for the storage host"};function nl(e){if(!e)return"unknown upload error";const t=[];try{const i=e.response,a=null==i?void 0:i.status,s=null==i?void 0:i.statusText;a&&t.push(`HTTP ${a}${s?" "+s:""}`);const r=null==i?void 0:i.data;if(null!=r){var n,o;let i;if("string"==typeof r)i=r;else try{i=JSON.stringify(r)}catch{i=String(r)}const a=null==(n=i.match(/<Code>([^<]+)<\/Code>/))?void 0:n[1],s=null==(o=i.match(/<Message>([^<]+)<\/Message>/))?void 0:o[1];if(a)t.push(`S3 ${a}${s?": "+s:""}`);else if(function(e){return/^\s*(<!DOCTYPE\s+html|<html[\s>])/i.test(e)}(i)){const n=Zc(e);t.push("blocked by a network filter or proxy"+(n?` before it reached ${n}`:"")+" — ask your network administrator to allow this host")}else i&&t.push(i.slice(0,200))}let c=null;if(!i&&(c=function(e){var t,n;const o=null!=(t=null==e?void 0:e.code)?t:null==e||null==(n=e.cause)?void 0:n.code;return"string"==typeof o&&o.length?o:null}(e),c)){const n=tl[c];t.push(n?`${c} (${n})`:c);const o=Zc(e);o&&t.push(`while uploading to ${o}`)}const l=e.message?String(e.message):"",p=a&&/^Request failed with status code \d+$/.test(l)||null!==c&&l.includes(c);l&&!p&&t.push(l)}catch{}return 0===t.length&&e.message&&t.push(String(e.message)),t.length?t.join(" — "):"unknown upload error"}const ol=12e4;function il(e,t){let n=null,o=!1;const i=()=>{n&&(clearTimeout(n),n=null)};return{reset:()=>{o||(i(),n=setTimeout(()=>{o=!0,n=null,t()},e))},cancel:i}}async function al(e){if(e.fileSize>=ic)return async function(e){const{uploadId:t,entrypointPath:n,file:o,fileName:i,fileMd5:a,fileType:s,content_encoding:r,fileSize:c,args:l,options:p,onProgress:u,partSize:d,concurrency:m,maxRetries:f,retryDelayMs:h,putPart:g}=e,{baseUrl:v}=l,x=()=>({...Fe(l),"Content-Type":"application/json",org:l.org,job_id:t}),b={...x(),filesize:c.toString()},y=JSON.stringify({filename:i,entrypoint:n,"content-type":s,"content-md5":a,"content-encoding":r,output_index:0});async function w(e,t,n){const o=await fetch(e,{...De,method:"POST",headers:t,body:JSON.stringify(n)});if(!o.ok)throw new Error(`${e} ${o.status}: ${await o.text().catch(()=>"")}`);return o.json()}return await async function(e){const{size:t,slice:n,partSize:o=oc,concurrency:i=4,maxRetries:a=5,retryDelayMs:s=1e3,createUpload:r,getPartUrls:c,putPart:l,completeUpload:p,abortUpload:u,onProgress:d,signal:m,checkCancelled:f}=e,h=async()=>{if(m&&m.aborted)return!0;if(f)try{return!!await f()}catch{return!1}return!1};if(await h())throw new Error("Upload aborted");const g=function(e,t=oc){if(!Number.isFinite(e)||e<=0)return[];let n=Math.max(t,tc,Math.ceil(e/nc));const o=[];let i=0,a=1;for(;i<e;){const t=Math.min(i+n,e);o.push({partNumber:a,start:i,end:t,size:t-i}),i=t,a++}return o}(t,o);if(0===g.length)throw new Error("Nothing to upload (size <= 0)");const{upload_id:v,key:x}=await r(),b=await c(v,x,g.map(e=>e.partNumber)),y=new Map(b.map(e=>[e.part_number,e.url])),w=[];let _=0,k=null;const S=async e=>{const t=y.get(e.partNumber);if(!t)throw new Error(`Missing presigned url for part ${e.partNumber}`);let o=!1;const i=await Qr(async()=>{if(await h())throw o=!0,new Error("Upload aborted");try{const o=n(e.start,e.end),i=await l({url:t,payload:o,partNumber:e.partNumber,size:e.size,signal:m});if(!i)throw new Error(`No ETag returned for part ${e.partNumber}`);return i}catch(e){throw await h()&&(o=!0),e}},{maxAttempts:a+1,baseMs:s,isRetryable:e=>!o&&Zr(e),...s>0?{}:{sleep:async()=>{}}});if(!i.ok)throw i.error||new Error(`Failed to upload part ${e.partNumber}`);w.push({part_number:e.partNumber,etag:i.value}),_+=e.size,d&&d(_)},j=[...g],T=Math.max(1,Math.min(i,g.length));if(await Promise.all(Array.from({length:T},()=>(async()=>{for(;j.length>0;){if(k||await h())return;const e=j.shift();if(!e)return;try{await S(e)}catch(e){return void(k=k||e)}}})())),k||await h())throw await u(v,x).catch(()=>{}),k||new Error("Upload aborted");return w.sort((e,t)=>e.part_number-t.part_number),await p(v,x,w),{ok:!0,key:x,upload_id:v,parts:g.length}}({size:c,partSize:d,concurrency:m,maxRetries:f,retryDelayMs:h,slice:(e,t)=>o.slice(e,t),signal:null==p?void 0:p.abort,onProgress:e=>{u&&u({loaded:e,total:c,progress:c?e/c:0})},createUpload:async()=>{const e=await fetch(v+Le.upload.multipart_create,{...De,method:"POST",headers:b,body:y});if(!e.ok)throw new Error(`multipart/create ${e.status}: ${await e.text().catch(()=>"")}`);const t=await e.json();return{upload_id:t.upload_id,key:t.key}},getPartUrls:async(e,t,n)=>(await w(v+Le.upload.multipart_part_urls,x(),{key:t,upload_id:e,part_numbers:n})).urls,putPart:g||(({url:e,payload:t,partNumber:n,signal:o})=>async function({url:e,payload:t,partNumber:n,contentType:o,signal:i}){const a=i,s=new AbortController;let r=!1;const c=()=>s.abort();a&&(a.aborted?s.abort():a.addEventListener("abort",c,{once:!0}));const l=il(ol,()=>{r=!0,s.abort()});l.reset();try{var p,u;const n=await Fr.put(e,t,{...De,...await Wc(),withCredentials:!1,signal:s.signal,headers:{"Content-Type":o},onUploadProgress:()=>l.reset()});if(200!==n.status)throw new Error(nl({response:n}));const i=(null==(p=n.headers)?void 0:p.etag)||(null==(u=n.headers)?void 0:u.ETag);if(!i)throw new Error("part PUT returned no ETag (is the bucket's CORS exposeHeaders:etag set?)");return i}catch(e){if(null!=a&&a.aborted)throw e;if(r)throw new Error(`Part ${n} stalled: no progress for ${ol/1e3}s`);throw new Error(nl(e))}finally{l.cancel(),a&&a.removeEventListener("abort",c)}}({url:e,payload:t,partNumber:n,signal:o,contentType:s})),completeUpload:async(e,t,n)=>w(v+Le.upload.multipart_complete,x(),{key:t,upload_id:e,parts:n}),abortUpload:async(e,t)=>{await fetch(v+Le.upload.multipart_abort,{...De,method:"POST",headers:x(),body:JSON.stringify({key:t,upload_id:e})}).catch(()=>{})}}),!0}(e);const{uploadId:t,uploadRequestPUTUrl:n,entrypointPath:o,file:i,fileName:a,fileBuffer:s,fileMd5:r,fileSize:c,fileType:l,content_encoding:p,fileIndex:u,fileNumber:d,fileCount:m,loglevel:f,args:h,options:g,experimental:v}=e;"info"===f&&console.log(`Uploading file "${i.name}" type=${l} (${c}) ${i.type} with hash ${r}`);const x={...Fe(h),"Content-Type":"application/json",org:h.org,job_id:t,filesize:c.toString(),progress:(u/m*100).toFixed(0)},b={filename:a,entrypoint:o,"content-type":l,"content-md5":r,"content-encoding":p,output_index:0};"debug"===f&&console.debug("Requesting presigned URL with headers",x);const y=JSON.stringify(b);let w=null,_="";const k=await Qr(async()=>{var e;if(null!=g&&null!=(e=g.abort)&&e.aborted)throw new Dr("Upload aborted");const t=await fetch(n,{...De,method:"POST",headers:x,body:y});if(!t.ok){const e=await t.text().catch(()=>"");throw _=e,{response:{status:t.status,statusText:t.statusText,data:e}}}return await t.json()},{baseMs:500,onRetry:({attempt:e,waitMs:t,error:n})=>{console.warn(`Failed to get presigned url for "${a}" "${l}": ${nl(n)}\n→ Retry #${e} in ${t}ms`)}});if(k.ok)w=k.value;else if(k.error instanceof Dr)throw k.error;if(null==w){const e=_||nl(k.error);throw new Error(`Failed to get presigned url for "${a}" "${l}" \n${e}`)}const S=w.presigned_url;var j=!1;let T=null;const E=[];let $=0;const O=await Qr(async t=>{var n;if(null!=g&&null!=(n=g.abort)&&n.aborted)throw new Dr("Upload aborted");const o={"Content-Type":l,"Content-MD5":r};v&&(o["Content-Length"]=c.toString()),p&&(o["Content-Encoding"]=p),1===t&&"none"!=f&&console.log(`Uploading file ${d}/${m}: ${a}`),"debug"===f&&console.debug("PUT with headers",o);const i=new AbortController;let u=!1;const h=()=>i.abort();null!=g&&g.abort&&(g.abort.aborted?i.abort():g.abort.addEventListener("abort",h,{once:!0}));const x=il(ol,()=>{u=!0,i.abort()});x.reset();try{const t=await Fr.put(S,s,{...De,...await Wc(),withCredentials:!1,signal:i.signal,headers:o,onUploadProgress:t=>{x.reset(),e.onProgress(t)}});if(200!==t.status)throw{response:t};return t}catch(e){var b;if(null!=g&&null!=(b=g.abort)&&b.aborted)throw new Dr("Upload aborted");if(u)throw T=`stalled: no upload progress for ${ol/1e3}s`,E.push(T),"none"!==f&&console.error(`Upload stalled (PUT) (${d}, ${a}) after ${ol/1e3}s with no progress`),new Error(T);throw T=nl(e),E.push(T),e instanceof Dr||("none"!==f&&console.error(`Failed to upload file (PUT) (${d}, ${a}) "${T}"`),"debug"===f&&(console.log(o,{fileSize:c}),e.response?console.debug(e.response):console.debug(e))),e}finally{x.cancel(),null!=g&&g.abort&&g.abort.removeEventListener("abort",h)}},{onRetry:({attempt:e,waitMs:t})=>{"none"!==f&&console.log(`Retry PUT #${e} for file ${a} in ${t}ms`)}});if($=O.attempts,O.ok)j=!0,"info"===f&&console.log(`Uploaded file ${d}/${m} "${a}" (${l}, ${jc(c)})`);else if(O.error instanceof Dr)throw O.error;if(!j){var R;const e=null!=(R=function(e){if(!Array.isArray(e))return null;const t=[];for(const n of e){if("string"!=typeof n)continue;const e=n.trim();e&&!t.includes(e)&&t.push(e)}return t.length?t.join("; "):null}(E))?R:T,n=function(e,t,n){const o="string"==typeof t?t.trim():"",i="number"==typeof n&&n>1?` after ${n} attempts`:"";return o?`Failed to upload file ${e}${i}: ${o.length>Xc?o.slice(0,Xc)+"…":o}`:`Failed to upload file ${e}${i}`}(a,e,$);throw console.error(n),await Br({identifier:t,status:"failed",status_message:el(n),error:"Failed to upload file "+a},h),new Error(n)}return!0}async function sl(e,t,n){const o=e.baseUrl+Le.jobs.presigned_url,i=await fetch(o,{...De,method:"POST",headers:{...Fe(e),job_id:t},body:JSON.stringify(n)}).catch(e=>(console.error(e),null));return i&&i.ok?await i.text():(console.error("Failed to get presigned download URL",null==i?void 0:i.status),null)}async function rl(e,t){const n=e.baseUrl+Le.jobs.create,o={...Fe(e),"content-type":"application/json"},i={type:"ai-material",triggered_by:e.trigger_type,parameters:{...t}},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request texture generation (${a.status}): ${e}`),{error:e||`Request failed (${a.status})`}}return await a.json().catch(e=>(console.error(e),null))}async function cl(e,t={}){const n=new URL(e.baseUrl+Le.content.root);t.content_type&&n.searchParams.set("content_type",t.content_type),t.content_format&&n.searchParams.set("content_format",t.content_format),t.search&&n.searchParams.set("search",t.search),t.tags&&n.searchParams.set("tags",t.tags),t.types&&n.searchParams.set("types",t.types),t.trash&&n.searchParams.set("trash","true"),t.is_public&&n.searchParams.set("is_public","true"),t.page&&n.searchParams.set("page",String(t.page)),t.limit&&n.searchParams.set("limit",String(t.limit)),t.collection_id&&n.searchParams.set("collection_id",t.collection_id),t.offset&&n.searchParams.set("offset",String(t.offset));const o=Fe(e),i=await fetch(n,{...De,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to list content (${i.status}): ${e}`)}return await i.json()}async function ll(e,t){const n=`${e.baseUrl}${Le.content.root}/${t}`,o=Fe(e),i=await fetch(n,{...De,method:"GET",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to get content (${i.status}): ${e}`)}return await i.json()}async function pl(e,t){const n=`${e.baseUrl}${Le.content.root}/${t}`,o=Fe(e),i=await fetch(n,{...De,method:"DELETE",headers:o});if(!i.ok){const e=await i.text();throw new Error(`Failed to delete content (${i.status}): ${e}`)}return await i.json()}const ul={schema:{name:"load_needle_engine_skill",description:'Load the Needle Engine skill: authoritative coding guidelines, component patterns, the Unity/Blender-to-web export workflow, and reference docs. Load this BEFORE answering ANY Needle Engine coding or workflow question — do NOT answer from prior knowledge, which is frequently wrong about how Needle actually works (for example: the relationship between Unity C# scripts and TypeScript components, and what the editor export does — Needle does NOT auto-convert C# logic to TypeScript). ALWAYS load first when the user: shares or asks about Unity C# code (a MonoBehaviour, the Needle.Engine.* namespace) or Blender scripts in a Needle context; asks how a Unity or Blender component maps to, converts to, ports to, or works in Needle Engine or TypeScript; asks about components, lifecycle, serialization, XR, networking, deployment, or the export/codegen pipeline; or reports a Needle Engine bug or error. Do NOT load for greetings or small talk that contains no technical question — wait for the actual question first. Without arguments loads the main skill file. Use the "file" parameter to load specific reference files (e.g. "references/api.md", "references/components.md"). Call without arguments first to discover available references.',inputSchema:{type:"object",properties:{file:{type:"string",description:'File to load relative to the skill root, e.g. "references/api.md". Defaults to the main skill file.'}},additionalProperties:!1,required:[]}},async execute(e){const t=(null==e?void 0:e.file)||"SKILL.md";if(t.includes("..")||t.startsWith("/"))return{error:"Invalid file path."};try{const e="https://raw.githubusercontent.com/needle-tools/ai/main/providers/claude/plugin/skills/needle-engine/"+encodeURI(t),n=new AbortController,o=setTimeout(()=>n.abort(),5e3),i=await fetch(e,{signal:n.signal,redirect:"follow"});return clearTimeout(o),i.ok?{content:await i.text()}:{error:`Could not fetch '${t}' (HTTP ${i.status})`}}catch(e){return{error:`Error fetching skill: ${e.message}`}}}};function dl(e){let t,n=null,o="";for(const i of e.split("\n"))i.startsWith("event: ")?n=i.slice(7).trim():i.startsWith("data: ")?o=i.slice(6):i.startsWith("id: ")&&(t=parseInt(i.slice(4).trim(),10));if(!n)return null;let i=null;switch(n){case"delta":i={type:"delta",content:decodeURIComponent(o)};break;case"message":i={type:"message",content:decodeURIComponent(o)};break;case"status":i={type:"status",message:decodeURIComponent(o)};break;case"error":i={type:"error",message:decodeURIComponent(o)};break;case"notice":i={type:"notice",message:decodeURIComponent(o)};break;case"stopped":i={type:"stopped"};break;case"tool_call":i={type:"tool_call",...JSON.parse(o)};break;case"tool_result":i={type:"tool_result",...JSON.parse(o)};break;case"message_inserted":i={type:"message_inserted",...JSON.parse(o)};break;case"elicitation":i={type:"elicitation",...JSON.parse(o)};break;case"done":{const e=JSON.parse(o),{chat_url:t,...n}=e;i={type:"done",token_usage:n},t&&(i.chat_url=t);break}case"message_id":i={type:"message_id",message_id:decodeURIComponent(o)};break;case"chat_id":i={type:"chat_id",chat_id:decodeURIComponent(o)}}return i&&void 0!==t&&(i.id=t),i}function ml(e,t){const n=Fe(e);return null!=t&&t.personal&&(n["x-needle-ai-chat"]="personal"),null!=t&&t.instanceId&&(n["x-needle-instance-id"]=t.instanceId),n}function fl(e,t){return t.stream?async function*(e,t){const n=new URL(e.baseUrl+Le.ai.chat),o=ml(e,t);o["Content-Type"]="application/json";const i={type:"new_message",slug:t.slug,message:t.message,stream:!0,source:t.source,full_url:t.full_url,pathname:t.pathname,context:t.context,disabled_tools:t.disabled_tools},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to stream chat message (${a.status}): ${e}`)}if(!a.body)throw new Error("Response body is null — streaming not supported in this environment");yield*async function*(e){const t=e.getReader(),n=new TextDecoder;let o="";try{for(;;){const{done:e,value:i}=await t.read();if(e)break;o+=n.decode(i,{stream:!0});const a=o.split("\n\n");o=a.pop()||"";for(const e of a){const t=dl(e);t&&(yield t)}}if(o.trim()){const e=dl(o);e&&(yield e)}}finally{t.releaseLock()}}(a.body)}(e,t):async function(e,t){const n=new URL(e.baseUrl+Le.ai.chat),o=ml(e,t);o["Content-Type"]="application/json";const i={type:"new_message",slug:t.slug,message:t.message,stream:!1,source:t.source,full_url:t.full_url,pathname:t.pathname,context:t.context,disabled_tools:t.disabled_tools},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();throw new Error(`Failed to send chat message (${a.status}): ${e}`)}return await a.json()}(e,t)}const hl=200,gl=["github.com","gitlab.com","bitbucket.org"],vl=/[\w.+-]+@[\w-]+\.[\w.]+/;function xl(e){if(e)return vl.test(e)?void 0:e}function bl(e,t){return String(g("git",e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],...t?{cwd:t}:{}})||"").trim()}function yl(e,t){try{return bl(e,t)}catch{return""}}function wl(e){try{const t=bl(["rev-parse","HEAD"],e);if(!t)return null;const n=yl(["rev-parse","--abbrev-ref","HEAD"],e),o=yl(["log","-1","--pretty=%s"],e),i=xl(yl(["log","-1","--pretty=%an"],e)),a=yl(["status","--porcelain"],e).length>0,s=yl(["remote","get-url","origin"],e),r=t.slice(0,7),{repository:c,url:l}=function(e,t){if(!e)return{};const n=/^(?:https?:\/\/(?:[^@/]+@)?([^/]+)\/|git@([^:]+):)(.+?)(?:\.git)?$/.exec(e.trim());if(!n)return{};const o=(n[1]||n[2]||"").toLowerCase(),i=n[3];return i?gl.includes(o)?{repository:i,url:`https://${o}/${i}/${"bitbucket.org"===o?"commits":"commit"}/${t}`}:{repository:i}:{}}(s,t),p={type:"git",id:t,label:`${n||r}@${r}${a?" (dirty)":""}`};return n&&(p.branch=n),i&&(p.author=i),o&&(p.message=o.slice(0,hl)),a&&(p.dirty=!0),c&&(p.repository=c),l&&(p.url=l),p}catch{return null}}function _l(e){if("string"==typeof e)return e.trim()||void 0}const kl=()=>"https://cloud.needle.tools/account",Sl=()=>"https://cloud.needle.tools/edit";function jl(e){return v(e)}const Tl=["node_modules",".git",".vscode",".vercel",".github",".idea"];function El(e,t,n=null,o="",i=0){if(null===n){if(i>0)throw new Error("result must be provided if level > 0. Did you forget to pass it?");n={files:[],total_size:0}}if(0===i){if(!r(t))throw new Error(`Directory or file "${t}" does not exist.`);if(c(t).isFile()){const e=xc(t,l(t));return e.path=e.name,n.files.push(e),n.entrypoint=e,n}}else if(i>20)throw new Error("Recursion depth too high. Are you sure you are providing the correct directory?");const a=p(t,{withFileTypes:!0});for(const i of a)if(0==i.isDirectory()){if("optimization"===e&&0==((s=(s=i.name).toLowerCase()).endsWith(".glb")||s.endsWith(".gltf")||s.endsWith(".vrm")||s.endsWith(".usdz")||s.endsWith(".usd")||s.endsWith(".fbx")))continue;const a=xc(o+i.name,l(t+"/"+i.name));if(n.files.push(a),n.total_size+=a.size,n.total_size>1073741824)throw new Error(`Collected filesize exceeds ${1024..toFixed(0)} MB. Are you sure you are providing the correct directory?`);if(n.files.length>1e4)throw new Error(`Too many files (${n.files.length}): The maximum filecount is 10,000.`)}var s;for(const s of a)if(s.isDirectory()){if(Tl.includes(s.name))continue;El(e,t+"/"+s.name,n,o+s.name+"/",i+1)}return n}const $l=new RegExp("\\beyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\b","g"),Ol=new RegExp("\\b[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\b","gi"),Rl=new RegExp("(Authorization:\\s*)([^\\s,;\"']+(?:\\s+[^\\s,;\"']+)?)","gi"),Al=new RegExp("\\bBearer\\s+([A-Za-z0-9._\\-=]+)","g"),Cl=new RegExp("([?&]token=)([^&\\s\"'<>]+)","g"),Nl=new RegExp("<redacted:\\d+ch>","g");function Pl(e){if("string"!=typeof e)return e;if(0===e.length)return e;if(Nl.test(e)&&(Nl.lastIndex=0,!function(e){$l.lastIndex=0,Ol.lastIndex=0,Rl.lastIndex=0,Al.lastIndex=0,Cl.lastIndex=0;const t=$l.test(e)||Ol.test(e)||Rl.test(e)||Al.test(e)||Cl.test(e);return $l.lastIndex=0,Ol.lastIndex=0,Rl.lastIndex=0,Al.lastIndex=0,Cl.lastIndex=0,t}(e.replace(Nl,""))))return e;Nl.lastIndex=0;let t=e;return t=t.replace(Rl,(e,t,n)=>`${t}<redacted:${n.length}ch>`),t=t.replace(Cl,(e,t,n)=>`${t}<redacted:${n.length}ch>`),t=t.replace(Al,(e,t)=>`<redacted:${("Bearer "+t).length}ch>`),t=t.replace($l,e=>`<redacted:${e.length}ch>`),t=t.replace(Ol,e=>`<redacted:${e.length}ch>`),t}const Il=["cli.log","cli.prev.log"],Ul=M.join(q.homedir(),".needle","cli","logs");E(Ul,{recursive:!0});try{!function(e,t){const n={migrated:[],skipped:[]};if(!e||!t)return n;if(M.resolve(e)===M.resolve(t))return n;if(!T(e))return n;for(const o of Il){const i=M.join(e,o);if(T(i))try{E(t,{recursive:!0});const e=M.join(t,o);if(T(e)){const e=M.join(t,o.replace(/\.log$/,"")+".legacy.log");$(i,e),n.skipped.push(o)}else $(i,e),n.migrated.push(o)}catch(e){console.error(`[needle-cloud] Failed to migrate legacy log ${o}: ${e instanceof Error?e.message:e}`)}}}(M.join(O(q.tmpdir()),"Needle","Cloud","logs"),Ul)}catch(e){console.error(`[needle-cloud] legacy log migration check failed: ${e instanceof Error?e.message:e}`)}const zl=M.resolve(Ul,"cli.log");if(T(zl)){const e=R(zl),t=e.mtimeMs;if(Date.now()-t>432e5||e.size>52428800){const e=Fl();A(zl,e,t=>{t?console.error(`Failed to rename log file: ${t.message}`):console.log(`Log file renamed to ${e}`)})}}function Ll(){return zl}function Fl(){return M.resolve(Ul,"cli.prev.log")}function Dl(e,t){try{let n=Pl(String(null!=e?e:""));return n=`[${(new Date).toISOString()}] ${n}`,null!=t&&t.emptyLineBefore&&(n="\n"+n),C(zl,n+"\n"),!0}catch(e){return console.error(`Failed to write to log file: ${e instanceof Error?e.message:e}`),!1}}async function ql(e,t){return e=Pl(e),e=`[${(new Date).toISOString()}] ${e}`,null!=t&&t.emptyLineBefore&&(e="\n"+e),D(zl,e+"\n",{flag:"a"}).then(()=>!0).catch(e=>(console.error(`Failed to write to log file: ${e.message}`),!1))}var Bl={__proto__:null,getLogFilePath:Ll,getPrevLogsFilePath:Fl,getPipelineLogFilePath:function(){return M.join(q.homedir(),".needle","optimization-pipeline","logs","pipeline.log")},writeToLogFileSync:Dl,writeToLogFile:ql};function Ml(e,t,n){process.env.GITHUB_ACTIONS&&(process.env.GITHUB_OUTPUT?u(process.env.GITHUB_OUTPUT,`${e}=${t}\n`):null==n||n.logger.warn("GITHUB_OUTPUT environment variable is not set. Cannot set output variables."))}async function Wl(e){var t;e.directory=x.resolve(e.directory);let{files:n,entrypoint:o}=El("deployment",e.directory);if(e.entrypoint&&(o=n.find(t=>t.path===e.entrypoint),!o))return process.exitCode=1,void j().fail(`Entrypoint "${e.entrypoint}" not found. Please make sure you provide a valid entrypoint.`);if(!o){const e=Uc(n);if("error"in e)return process.exitCode=1,ql(`[Deployment] Error determining entrypoint: ${e.error}`),void j().fail(`Error: ${e.error}`);o=e}if(!(n.length>0&&o&&(o.name.toLowerCase().endsWith(".html")||o.name.toLowerCase().endsWith(".html.gz")||o.name.toLowerCase().endsWith(".html.br"))))return process.exitCode=1,ql("[Deployment] Deployment is not valid: No .html file found."),void j().fail("Deployment is not valid: No .html file found.");if(!o)return process.exitCode=1,ql("[Deployment] No entrypoint found. Please provide an index.html file in your project."),void j().fail("No entrypoint found. Please provide an index.html file in your project.");const i=null!=(t=e.endpoint)&&t.length?e.endpoint:"https://cloud.needle.tools/api";let a=e.name;a||(a=Gl(e.directory)||void 0);let s=null==i?void 0:i.includes("localhost");const r=a?` of "${a}"`:"",c=j().start(`Begin deployment${r} ${s?"(local)":""} of ${n.length} files...`);c.spinner="earth",await Cc(50);let l=-1,p=null;const u=e.noProvenance?null:function(e=process.env,t,n){try{return function(e=process.env,t){try{if(_l(e.NEEDLE_CLOUD_NO_PROVENANCE))return null;let n=wl(t);_l(e.GITHUB_ACTIONS)&&(n=function(e,t){var n,o;const i=_l(t.GITHUB_SHA),a=_l(t.GITHUB_REF_NAME),s=_l(t.GITHUB_REPOSITORY),r=null!=(n=_l(t.GITHUB_SERVER_URL))?n:"https://github.com";if(!i&&!a)return e;const c={type:"git",...null!=e?e:{}};i&&(c.id=i),a&&(c.branch=a),s&&(c.repository=s),s&&i&&(c.url=`${r}/${s}/commit/${i}`);const l=String(null!=(o=c.id)?o:"").slice(0,7);return l&&(c.label=`${a||l}@${l}${c.dirty?" (dirty)":""}`),c}(n,e));const o=function(e=process.env){var t;if(!_l(e.CI))return{type:"local"};if(!_l(e.GITHUB_ACTIONS))return{type:"ci"};const n={type:"github-actions"},o=_l(e.GITHUB_RUN_ID),i=_l(e.GITHUB_REPOSITORY),a=null!=(t=_l(e.GITHUB_SERVER_URL))?t:"https://github.com";o&&(n.id=o);const s=xl(_l(e.GITHUB_ACTOR));return s&&(n.actor=s),_l(e.GITHUB_EVENT_NAME)&&(n.event=_l(e.GITHUB_EVENT_NAME)),o&&i&&(n.url=`${a}/${i}/actions/runs/${o}`),n}(e);return n||"local"!==o.type?{...n?{source:n}:{},runner:o,client:{name:"needle-cloud-cli"}}:null}catch(e){var n;return console.warn(`[provenance] Could not determine provenance: ${null!=(n=null==e?void 0:e.message)?n:e}`),null}}(e,t&&wl(t)?t:n)}catch(e){var o;return console.warn(`[provenance] Could not determine provenance: ${null!=(o=null==e?void 0:e.message)?o:e}`),null}}(process.env,e.directory);if(null!=u&&u.source){var d;const{label:e,author:t}=u.source;ql(`[provenance] ${e}${t?` by ${t}`:""} (${null==(d=u.runner)?void 0:d.type})`)}ql(`Deployment started${r} ${s?"(local)":""} of ${n.length} files...`);const m=await Jc({baseUrl:i,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:n,entrypoint:o,experimental:e.experimental,raw:e.raw,...u?{metadata:u}:{}},{name:a,type:"deployment",loglevel:e.verbose?"debug":"none",progress:e=>{if(e.fileIndex!==l){l=e.fileIndex;const t=e.totalBytes/1024/1024;c.text=`Uploading file ${e.fileIndex+1} of ${e.totalFiles} files: ${(e.uploadedBytes/1024/1024).toFixed(1)} / ${t.toFixed(1)} MB. Total progress: ${(100*e.progress01).toFixed(1)} %. Time passed: ${e.elapsedTime.toFixed(0)}sec. About ${e.estimatedTimeLeftDisplay} until complete.`}}}).catch(e=>(p=e instanceof Error?e.message:String(e),null));if(null!=m&&!0===m.success){c.succeed(`🚀 Deployment${r} successful (${m.content_id}/${m.id})`);let t="";t=m.url?m.url:"https://cloud.needle.tools/view/"+m.content_id+"/"+m.id,console.log("🔗 View the deployment at: "+t),e.open&&jl(t);try{Ml("deployment_url",t,{logger:e.logger}),Ml("edit_id",m.content_id,{logger:e.logger})}catch(t){e.logger.error("Error writing output for CI: "+t)}}else{process.exitCode=1;const e=p||(null==m?void 0:m.error)||"Deployment failed";ql(`[Deployment] Failed: ${e}`),c.fail(e)}}function Gl(e,t=0){if(t>10)return null;const n=x.join(e,"needle.config.json");if(r(n)){const t=x.join(e,"package.json");if(r(t)){var o;const e=l(t,"utf8"),n=JSON.parse(e);if(null!=(o=n.name)&&o.length)return n.name}return x.basename(e)}const i=x.dirname(e);return i===e?null:Gl(i,t+1)}async function Hl(e,t={}){const n=t.purposeLabel?` ${t.purposeLabel}`:"";if(!r(e.fileOrDirectory))return j().fail(`File not found: ${e.fileOrDirectory}`),{error:"File not found"};if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${kl()}`};if(void 0!==e.name&&e.name&&(e.name.length<=0||"true"===e.name||"false"===e.name))return{error:`Name is not valid: "${e.name}". Please provide a valid name`};e.fileOrDirectory=b(e.fileOrDirectory);const o=j(`Gathering files ${e.fileOrDirectory}`).start();let i=null;try{i=El("optimization",e.fileOrDirectory)}catch(t){return j().fail(`${t.message||`Failed to collect files in ${e.fileOrDirectory}`}`),{error:"Failed to collect files"}}o.text=`Uploading ${i.files.length} files${n}:\n- ${i.files.map(e=>e.path||e.name).join("\n -")}`;const a="https://cloud.needle.tools/api";e.verbose&&console.log("Using endpoint:",a);const s=function(e){var t,n;if(function(e){return e.some(e=>{let t=e.name.toLowerCase();return!!(t.endsWith(".html")||t.endsWith(".htm")||t.endsWith(".html.gz")||t.endsWith(".html.br"))||"mimetype"in e&&"text/html"===e.mimetype})}(e))return{kind:"deployment",contentType:void 0,uploadType:"deployment",canOptimize:!1,canConvertToGLB:!1};if(function(e){if(null==e||!e.length)return!1;const t=e.filter(e=>wc(e.name)||_c(e.name)||kc(e.name));return 1===t.length&&Uc(e)===t[0]}(e))return{kind:"environment-texture",contentType:"hdri",uploadType:void 0,canOptimize:!1,canConvertToGLB:!1};const o=null!=(t=null==(n=e[0])||null==(n=n.name.split(".").pop())?void 0:n.toLowerCase())?t:"";return{kind:"asset",contentType:"3d-asset",uploadType:void 0,canOptimize:e.some(e=>{var t;const n=null==(t=e.name.split(".").pop())?void 0:t.toLowerCase();return null!=n&&zc.has(n)}),canConvertToGLB:Lc.has(o)}}(i.files),c="asset"===s.kind?void 0:s.contentType,l=await Jc({baseUrl:a,authToken:e.token,org:e.org_id},{triggered_by:"cli",files:i.files,entrypoint:i.entrypoint},{type:s.uploadType||"upload",name:e.name,content_type:c,...!1===t.optimizations?{optimizations:!1}:{},loglevel:e.verbose?"debug":"none",progress:e=>{o.text=`Uploading ${e.fileName} - finished in approx. ${e.estimatedTimeLeftDisplay}, ${100*e.progress01}%`}});if(0==l.success){const e=`${l.error||"Unknown error: could not start upload"}`;return o.fail(e),{error:e,noprint:!0}}const p=l.edit_url||`${Sl()}/${l.content_id}?select_team=1`;return o.succeed(l.uploadSkipped?`Files have already been uploaded to ${p}`:`Uploaded ${i.files.length} files${n} to ${p}`),{res:l,editUrl:p}}async function Jl(e){if(!e.outDir)throw new Error("Output directory is required");const t=j("Downloading results...").start(),n=await async function(e){const t=await async function(e){if(!e.identifier)return null;const t={...Fe(e)},n={job_id:e.identifier,fields:e.fields,content_format:e.content_format},o=e.baseUrl+Le.jobs.query,i=await fetch(o,{...De,method:"POST",headers:t,body:JSON.stringify(n)}).catch(e=>(console.error(e),null));if(null==i)return null;if(!i.ok)return console.error("Failed to get job",i.status,await i.text()),null;const a=await i.json().catch(e=>(console.error(e),null));return null==a?null:a.job}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,fields:["results"],content_format:e.content_format});if(null==t||!t.results)return{error:`Job ${e.identifier} did not produce any result files`};const n=t.results;if(!n.bucket||!n.directory)return{error:`Job ${e.identifier} has incomplete result data`};const o=[];for(const t of n.files){if((i=t.filename).startsWith(".extras/")||i.startsWith(".extras\\")||i.endsWith("screenshot.needle.webp")||qr.test(i)||i.endsWith(".needle.log"))continue;const a=`${n.directory}/${t.filename}`,s=await sl(e,e.identifier,{bucket:n.bucket,key:a});if(!s){console.error(`Failed to get presigned URL for: ${t.filename}`);continue}const r=await fetch(s).catch(e=>(console.error(e),null));if(!r||!r.ok){console.error(`Failed to download (${null==r?void 0:r.status} | ${null==r?void 0:r.statusText}): ${t.filename}`);continue}const c=await r.arrayBuffer().catch(e=>(console.error(e),null));if(!c)return{error:`Failed to read downloaded file: ${t.filename}`};o.push({filename:t.filename,data:c})}var i;return{files:o}}({baseUrl:e.baseUrl,authToken:e.authToken,org:e.org,identifier:e.identifier,content_format:e.content_format});if("error"in n)return t.fail(n.error),{error:n.error};const o=[];for(const i of n.files){t.text=`Downloading ${i.filename}`,r(e.outDir)||d(e.outDir,{recursive:!0});let a=i.filename;if(e.filename){const t=i.filename.substring(i.filename.lastIndexOf("."));if(1===n.files.length)a=e.filename.includes(".")?e.filename:e.filename+t;else{const t=i.filename.substring(i.filename.lastIndexOf(".")),n=i.filename.substring(0,i.filename.lastIndexOf("."));a=e.filename+"-"+n+t}}const s=e.outDir+"/"+a,c=s.split("/").slice(0,-1).join("/");r(c)||d(c,{recursive:!0}),e.verbose&&console.log(`Writing ${i.filename} (${(i.data.byteLength/1024).toFixed(2)} KB) to "${s}"`),m(s,Buffer.from(i.data)),o.push(s)}return t.succeed(`Downloaded ${o.length} ${1===o.length?"file":"files"}: ${o.join(", ")}`),e.verbose&&console.log("Downloaded files:\n",o),{success:!0,paths:o}}async function Vl(e){const{token:t,org_id:n,slug:o,message:i,stream:a}=e;if(a){const e=fl({baseUrl:"https://cloud.needle.tools/api",authToken:t,org:n},{slug:o,message:i,stream:!0,source:"cli"});for await(const t of e)switch(t.type){case"delta":process.stdout.write(t.content);break;case"message":break;case"status":process.stdout.write(`[${t.message}]\n`);break;case"error":return void j().fail(t.message);case"tool_call":process.stdout.write(`[tool: ${t.name}]\n`);break;case"done":process.stdout.write("\n")}}else{const e=j("Thinking...").start(),a=await fl({baseUrl:"https://cloud.needle.tools/api",authToken:t,org:n},{slug:o,message:i,stream:!1,source:"cli"});e.stop(),console.log(a.content)}}async function Kl(e,t=pl){if(!e.identifier)throw new Error("A content identifier is required");return t({baseUrl:e.endpoint,authToken:e.authToken,org:e.org},e.identifier)}async function Yl(e){const t=new URL((e.endpoint||"https://cloud.needle.tools/api")+Le.get.deployments);t.searchParams.append("offset",e.offset.toString()),t.searchParams.append("limit",e.limit.toString()),e.names&&t.searchParams.append("name",e.names.map(e=>e.trim()).join(","));const n=await fetch(t,{method:"GET",headers:{...Fe({authToken:e.authToken,org:e.org})}});return n.ok?await n.json():{status:n.status,error:await n.text()}}const Zl=["#e06c75","#d19a66","#e5c07b","#98c379","#7ec8a4","#56b6c2","#61afef","#528bff","#c678dd","#e88de4","#be5046","#d4976c","#b5cea8","#4ec9b0","#9cdcfe","#c8ae9d"];function Xl(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;const[n,o,i]=function(e){const t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,255&t]}(Zl[Math.abs(t)%Zl.length]);return`[38;2;${n};${o};${i}m${e}`}function Ql(e){return`${e}`}const ep=8424,tp="http://localhost:8424",np=/^\[(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\]\s?(.*)$/,op=/^(\d{4}-\d{2}-\d{2}) (\d{2}:\d{2}:\d{2}):\s*(.*)$/,ip=[[/^\[MCP\]|^MCP (New session|websocket server|Request|SSE|Bridge)|^Unknown MCP/,"mcp"],[/^Needle Cloud connection:|^Cloud tool (request|result|error):/,"cloud"],[/^Denied:/,"denial"],[/^Local (server|token)|^Starting Needle CLI server|^Restarting auth server|^Server is running|^Running server uses different/,"server"],[/^OIDC:|^Sign in|^Sign out|^User logged in|^Logged in successfully|^Token refresh failed|^Failed to validate (login|logout)|^Getting access token|^No access token|^ERR: Missing NEEDLE_CLOUD_TOKEN|^Too many logins|^WARN: You do not have a default organization|^User signed in|^Error during sign in/,"auth"],[/^Settings(:| changed)/,"settings"],[/^\[Deployment\]|^Deployment started/,"deployment"],[/^\[generate-material\]/,"ai"],[/^Active project changed|^Error saving project info/,"project"]],ap=[[/^ERR:|^ERROR:|^Error\b|^Failed\b/,"error"],[/\bconnection: error\b|\bFailed to\b|\b(Token refresh failed)\b|\b(rejected|terminating|pong timeout)\b/i,"error"],[/^WARN:|^WARNING:|^Warning\b/,"warn"]];function sp(e){for(const[t,n]of ip)if(t.test(e))return n;return"general"}function rp(e){for(const[t,n]of ap)if(t.test(e))return n;return"info"}const cp=new RegExp("\\b([A-Z][A-Z0-9_]*(?:_KEY|_TOKEN|_SECRET|_PASSWORD))=([^\\s,;\"']+)","g"),lp=new RegExp("\\b(User(?:name)?:\\s*)([A-Za-z0-9._\\-]{1,64})","g"),pp=new RegExp("\\b[A-Za-z0-9._%+\\-]+@[A-Za-z0-9.\\-]+\\.[A-Za-z]{2,}\\b","g"),up=52428800;function dp(e,t){if(!T(e))return null;if(t<=0)return"";const{size:n}=R(e);if(0===n)return"";const o=n>t?n-t:0,i=n-o,a=Buffer.allocUnsafe(i),s=N(e,"r");try{let e=0;for(;e<i;){const t=P(s,a,e,i-e,o+e);if(0===t)break;e+=t}}finally{I(s)}if(o>0){const e=a.indexOf(10);return-1===e?"":a.slice(e+1).toString("utf8")}return a.toString("utf8")}async function*mp(e){const t=fe({input:U(e,{encoding:"utf8"}),crlfDelay:Infinity});for await(const e of t)yield e}function fp(e,t,n,o){var i,a;if(0===e.length)return[];const s=function(e){if("string"!=typeof e)return{ts:null,level:"info",source:"general",message:""};let t=null,n=e,o=e.match(np);if(o)t=o[1],n=o[2];else if(o=e.match(op),o){const e=new Date(`${o[1]}T${o[2]}`);Number.isNaN(e.getTime())||(t=e.toISOString(),n=o[3])}return{ts:t,level:rp(n),source:sp(n),message:n}}(e),r=null!=(i=null!=(a=s.ts)?a:n)?i:null,c=s.level,l=null!=t?t:s.source;return function(e){if("string"!=typeof e)return[e];if(e.length<=16384)return[e];const t=e.length,n=Math.max(1,16344),o=Math.ceil(t/n),i=[];for(let a=0;a<o;a++){const s=a*n,r=e.slice(s,s+n);i.push(`${r} [chunk ${a+1}/${o} of ${t} bytes]`)}return i}(function(e,t){if("string"!=typeof e)return e;if(0===e.length)return e;let n=Pl(e);return n=function(e,t){if(!t)return e;const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\\/g,"\\\\+"),o=new RegExp(n,"gi");return e.replace(o,"~")}(n,null==t?void 0:t.homeDir),n=function(e){return e.replace(cp,(e,t,n)=>`${t}=<redacted:${n.length}ch>`)}(n),n=function(e){return e.replace(lp,(e,t,n)=>`${t}<redacted:${n.length}ch>`)}(n),n=function(e){return e.replace(pp,e=>`<redacted:${e.length}ch>`)}(n),n}(s.message,o)).map(e=>({ts:r,level:c,source:l,message:e}))}const hp="https://haystack.needle.tools/api/ingest/logs",gp="https://haystack.needle.tools";async function vp(e){try{return await e.json()}catch{return null}}async function xp(e){try{return await e.text()}catch{return""}}function bp(e){const t=e instanceof Error?e.message:String(e),n=e&&"object"==typeof e?e.cause:void 0;let o=t;if(n){const e=n instanceof Error?n.message:String(n),t="object"==typeof n&&null!==n?n.code:void 0;o=t?`${e} (${t})`:e}return`Network error reaching ${hp}: ${o}`}var yp,wp={__proto__:null,HAYSTACK_RESOURCE:gp,runSendLogs:async function(e,t){var n;let o=await t.getAccessToken();if(!o&&t.recoverAuth)try{t.stdout.write("Updating sign-in (your stored permissions need a one-time refresh)...\n"),o=await t.recoverAuth()}catch{o=null}if(!o)return{ok:!1,error:"Not signed in. Run `needle-cloud login` first, then retry."};const i={type:"meta",...t.meta,mode:e.mode,...e.note?{note:e.note}:{}},a=t.findActiveEditorLog(),s=function(e){const t=he.from(async function*(e){if(yield JSON.stringify(e.meta)+"\n",e.prevLogPath&&T(e.prevLogPath)){let t=null;for await(const n of mp(e.prevLogPath)){const o=fp(n,null,t,e.redactOpts);for(const e of o)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}if(e.cliLogPath&&T(e.cliLogPath)){let t=null;for await(const n of mp(e.cliLogPath)){const o=fp(n,null,t,e.redactOpts);for(const e of o)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}if(e.editor){var t,n;const o=null!=(t=e.editor.tailBytes)?t:up,i=null!=(n=e.editor.paths)?n:e.editor.path?[e.editor.path]:[];for(const t of i){const n=dp(t,o);if(!n)continue;let i=null;try{i=R(t).mtime.toISOString()}catch{}for(const t of n.split("\n")){const n=fp(t,e.editor.editor,i,e.redactOpts);for(const e of n)e.ts&&(i=e.ts),yield JSON.stringify(e)+"\n"}}}if(e.pipelineLogPath&&T(e.pipelineLogPath)){var o;const t=null!=(o=e.pipelineTailBytes)?o:up,n=dp(e.pipelineLogPath,t);if(n){let t=null;try{t=R(e.pipelineLogPath).mtime.toISOString()}catch{}for(const o of n.split("\n")){const n=fp(o,"gltf-build-pipeline",t,e.redactOpts);for(const e of n)e.ts&&(t=e.ts),yield JSON.stringify(e)+"\n"}}}}(e),{objectMode:!1});return t.pipe(ge())}({meta:i,cliLogPath:t.paths.cliLogPath,prevLogPath:t.paths.prevLogPath,editor:a,pipelineLogPath:null!=(n=t.paths.pipelineLogPath)?n:null,redactOpts:{homeDir:t.paths.homeDir}});if(e.dryRun){const{gunzipSync:e}=await import("node:zlib"),n=[];for await(const e of s)n.push(e);const o=e(Buffer.concat(n)).toString("utf8");return t.stdout.write(o),{ok:!0}}let r,c;try{const e=[];for await(const t of s)e.push(t);r=Buffer.concat(e)}catch(e){return{ok:!1,error:`Failed to build upload payload: ${e instanceof Error?e.message:String(e)}`}}try{c=await t.fetch(hp,{method:"POST",body:r,headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}catch(e){return{ok:!1,error:bp(e)}}if(401===c.status){const e=await xp(c);return{ok:!1,error:`401 Unauthorized from ${hp}: ${e&&e.length>0?e:"no reason given"} (try \`needle-cloud login\` if your sign-in expired; if you're already signed in, the server may not accept this token's issuer/audience)`}}if(429===c.status){const e=await xp(c);return{ok:!1,error:`429 Rate-limited: ${e&&e.length>0?e:"no reason given"}. You've hit the upload quota for this account; try again later.`}}if(413===c.status){const e=await vp(c);return{ok:!0,refId:null==e?void 0:e.ref_id,truncated:!0}}if(!c.ok){const e=await xp(c);return(400===(l=c.status)||l>=500)&&await async function({token:e,fetch:t,baseMeta:n,status:o,bodyText:i}){const{gzipSync:a}=await import("node:zlib"),s={type:"meta",...n,mode:"crash",note:"send-logs upload error follow-up"},r={ts:(new Date).toISOString(),level:"error",source:"send-logs",message:`Upload failed: status=${o} body=${(null!=i?i:"").slice(0,1024)}`},c=JSON.stringify(s)+"\n"+JSON.stringify(r)+"\n",l=a(Buffer.from(c,"utf8"));await t(hp,{method:"POST",body:l,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/x-ndjson","Content-Encoding":"gzip"}})}({token:o,fetch:t.fetch,baseMeta:t.meta,status:c.status,bodyText:e}).catch(()=>{}),{ok:!1,error:`Server returned ${c.status}: ${e}`}}var l;const p=await vp(c);return{ok:!0,refId:null==p?void 0:p.ref_id,truncated:Boolean(null==p?void 0:p.truncated)}}};const _p={appId:"2stnsoa6a1b0gwc7lra55",appSecret:"seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",endpoint:"https://auth.needle.tools",resources:["https://cloud.needle.tools/api",gp],scopes:["openid","profile","email","roles","urn:logto:scope:organizations","urn:logto:scope:organization_roles","identities","custom_data","all","read","write","delete","upload","download","invite","editor","cli:logs:write"]},kp={getAccessToken:!0,fetchUserInfo:!0,resource:null==(yp=_p.resources)?void 0:yp[0],resources:_p.resources||[],scopes:_p.scopes||[]};function Sp(e="default"){return null==e?`${tp}/?signed-out=1`:"too-many-logins"===e?`${tp}/?too-many-logins=1`:"error"===e?`${tp}/?error=1`:`${tp}/?signed-out=1`}var jp;function Tp(){$p.clear(),s.existsSync(Ap)&&s.rmSync(Ap,{recursive:!0}),s.existsSync(Cp)&&s.rmSync(Cp,{recursive:!0})}const Ep=process.argv.includes("--debug-auth"),$p=new Map;let Op=null==(jp=_p.resources)?void 0:jp[0];if(Op)try{Op=new URL(Op).hostname}catch(e){Ep&&console.error("Invalid resource URL",Op)}let Rp=Op||"-";Rp=Rp.replace(/[^a-zA-Z0-9\.\-]/g,"");const Ap=x.join(ae(),".needle",".auth",Rp),Cp=`${se()}/Needle/Cloud/.auth/${Rp}`;!function(){if(s.existsSync(Cp)){Ep&&console.debug("Migrating auth data from legacy location",Cp,"→",Ap);try{s.existsSync(Ap)||s.mkdirSync(Ap,{recursive:!0,mode:448});for(const e of s.readdirSync(Cp)){const t=x.join(Cp,e),n=x.join(Ap,e);s.statSync(t).isFile()&&!s.existsSync(n)&&(s.copyFileSync(t,n),s.chmodSync(n,384))}s.rmSync(Cp,{recursive:!0}),Ep&&console.debug("Legacy auth data migrated successfully")}catch(e){Ep&&console.error("Failed to migrate legacy auth data",e)}}}();const Np={accessToken:`${Ap}/accessToken`,refreshToken:`${Ap}/refreshToken`,idToken:`${Ap}/idToken`,signInSession:`${Ap}/signInSession`};function Pp(e){return Np[e]||`${Ap}/${e}`}const Ip=new class{constructor(){this.basePath=Ap}async setItem(e,t){Ep&&console.debug("\n- SET ITEM",e,t),s.existsSync(this.basePath)||s.mkdirSync(this.basePath,{recursive:!0,mode:448});const n=Pp(e);n&&s.writeFileSync(n,t,{mode:384}),$p.set(e,t)}async getItem(e){Ep&&console.debug("\n- GET ITEM",e);const t=$p.get(e);if(void 0===t){const t=Pp(e);if(t){if(s.existsSync(t)){const n=s.readFileSync(t,"utf8");return $p.set(e,n),n}}else console.error(`Unknown token name: ${e}`);return null}return String(t)}async removeItem(e){Ep&&console.debug("\n- REMOVE ITEM",e),$p.delete(e);const t=Pp(e);if(t&&s.existsSync(t)){try{const e=s.statSync(t).size;e>0&&s.writeFileSync(t,Buffer.alloc(e,0),{mode:384})}catch{}s.rmSync(t)}}};let Up=null;function zp(){return Up||(Up=new me(_p,{storage:Ip,navigate:()=>{}})),Up}function Lp(){Up=null}let Fp=Promise.resolve();function Dp(e){const t=Fp.then(e,e);return Fp=t.then(()=>{},()=>{}),t}async function qp(e){return Bp(zp(),e)}async function Bp(e,t){try{const n=await Dp(()=>e.getAccessToken(t));return null!=n?n:null}catch(e){return function(e){return Boolean(e)&&"object"==typeof e&&"not_authenticated"===e.code}(e)||(ql(`Token refresh failed for resource ${t}: ${e instanceof Error?e.message:e}`),Mp(e)&&(ql(`Token refresh: clearing dead grant for resource ${t}`),Tp(),Up=null)),null}}function Mp(e){return function(e){var t,n;if(!e||"object"!=typeof e)return!1;const o=e,i=e=>{if("string"!=typeof e)return!1;const t=e.replace(/^oidc\./,"");return"invalid_grant"===t||"invalid_target"===t};return i(o.code)||i(null==(t=o.data)?void 0:t.error)||i(null==(n=o.data)?void 0:n.code)}(e)}async function Wp(){return qp(kp.resource)}function Gp(){return Vp(zp())}async function Hp(e){var t;if(!e)return{status:401,error:"Not authenticated"};const n=null==(t=e.userInfo)?void 0:t.custom_data;return n?n.default_org?n.default_org:(console.warn("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),ql("WARN: You do not have a default organization set. Please visit your Needle Cloud account settings and then try again."),null):null}function Jp(e){return new me(_p,{storage:Ip,navigate:t=>{if(null==e.navigate)throw new Error("Can not navigate");e.navigate(t)}})}function Vp(e){return function(e,t){return Dp(()=>e.getContext(t))}(e,kp).then(t=>{const n=t;return n.client=e,n}).catch(async e=>{const t=e instanceof Error?e.message:String(e);return"oidc.invalid_token"==e.code||"oidc.invalid_grant"==e.code?(ql(`OIDC: ${e.code} – token refresh failed, clearing stale tokens`),Tp(),Up=null,console.error("Session expired – please log in again: npx needle-cloud login")):e.code?(console.error(e.code),ql(`OIDC: ${e.code} – ${t}`)):ql(`OIDC: getContext failed – ${t}`),null})}var Kp={__proto__:null,resetSharedClient:Lp,tryGetFreshAccessTokenForResource:qp,acquireAccessToken:Bp,shouldClearAuthOnError:Mp,tryGetFreshAccessToken:Wp,tryGetUser:Gp,tryGetDefaultOrgId:Hp,createNodeClient:Jp,getUserFromClient:Vp};let Yp=null;function Zp(e){var t;const n=null==(t=e.userInfo)?void 0:t.custom_data;if(!n)return[];const o=n.machines;return o?o.map(e=>e.name):[]}let Xp=Date.now();async function Qp(e){var t;const n=Date.now();n-Xp>3e4&&"client"in e&&(Xp=n,await e.client.fetchUserInfo().catch(console.error));const o=null==(t=e.userInfo)?void 0:t.custom_data;if(!o)return!1;if(Yp||await eu(),!Yp)return console.error("Failed to get machine id"),!0;const i=o.machines;if(!i)return!1;const a=i.some(e=>e.id===Yp);return a}async function eu(){return Yp||await import("node-machine-id").then(async e=>{const t=await e.default.machineId(!1);Yp=t}),Yp}function tu(){return ie.userInfo().username+"@"+ie.hostname()}async function nu(e,t={signout:!1}){if(e.accessToken){const o={machine_id:await eu(),machine_name:tu(),platform:ie.platform(),arch:ie.arch()},i=await fetch("https://cloud.needle.tools/api"+Le.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify(o)}).catch(e=>{var t,n;const o=(null==e||null==(t=e.cause)?void 0:t.code)||(null==e||null==(n=e.cause)?void 0:n.message)||(null==e?void 0:e.message)||"connection refused";return console.error(`Failed to validate login: ${o} - Make sure https://cloud.needle.tools/api is reachable`),ql(`Failed to validate login: "${o}" - Make sure https://cloud.needle.tools/api is reachable.`),{status:502,error:`Failed to validate login at 'https://cloud.needle.tools/api' (${o}) - make sure this URL is reachable.`}});if(!i)return!1;if("error"in i)return i;let a=!0;if(403===i.status){const e=await i.text();if(e.trimStart().startsWith("{")){const t=JSON.parse(e);t.logins&&(a=!1,ql("Too many logins from different machines"),j().fail("You have reached the maximum number of allowed logins\n"),j().warn(`Please logout from one of the following machines:\n- ${t.logins.join("\n- ")}\n`))}}var n;return!!a||(t.signout&&(Tp(),"client"in e&&(null==(n=e.client)||n.signOut(Sp("too-many-logins")))),!1)}return!0}let ou=null;function iu(){if(ou)return ou;{const e=ru();return ou=e,e}}const au="projects.json";function su(){const e=process.env.HOME||process.env.USERPROFILE||process.cwd(),t=y(e,".needle");return r(t)||d(t,{recursive:!0}),y(t,au)}function ru(){const e=su();if(!r(e))return{entries:[]};const t=l(e,"utf-8");try{const e=JSON.parse(t);return ou=e,e}catch(e){return console.error("Failed to parse project info file:",e),{entries:[]}}}const cu=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8"));function lu(){return cu.version}const pu=process.env.NEEDLE_SEARCH_ENDPOINT||"https://search.needle.tools",uu=process.env.NEEDLE_SEARCH_API_KEY||"da5737c00d6822c32a1b9e3b5dab094bfc17e205aef2f7f3e1a0fd4ebc77b79f",du=[{name:"needle_cloud_me",description:"Get current Needle Cloud user information",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},{name:"needle_search",description:"Search Needle Engine documentation, forum posts, and community discussions. Returns relevant content ranked by semantic similarity. Use this to find information about Needle Engine features, APIs, components, workflows, and troubleshooting.\n\nIMPORTANT: If search results seem irrelevant or low-quality (scores below 0.6, or results don't match the topic), retry with different search terms — up to 3 total attempts. Try varying your query: use specific class/method names, try shorter keyword-based queries, or rephrase the question. Do NOT guess or fabricate answers based on poor search results.",inputSchema:{type:"object",properties:{query:{type:"string",description:'What to search for, e.g. "how to add physics components" or "WebXR hand tracking" or "deploy to vercel"'},limit:{type:"number",description:"Maximum number of results to return (1-20, default 5)"}},additionalProperties:!1,required:["query"]}}],mu={needle_cloud_me:async function(e){try{const e=await Gp(),t=null==e?void 0:e.userInfo;return t?JSON.stringify({id:t.sub,name:t.name||t.preferred_username,email:t.email,profile_picture:t.picture}):"No user is currently logged in."}catch(e){return"Error retrieving user: "+(e instanceof Error?e.message:String(e))}},needle_search:async function(t){const n=t.query;if(!n||"string"!=typeof n)return{content:[{type:"text",text:"Error: query parameter is required."}]};const o=Math.min(Math.max(Number(t.limit)||5,1),20),i=`${pu}/api/semantic-search?q=${encodeURIComponent(n)}&limit=${o}`,a={Accept:"application/json"};uu&&(a.Authorization=`Bearer ${uu}`);try{const t=await e(i,{headers:a,signal:AbortSignal.timeout(15e3)});if(!t.ok){const e=await t.text().catch(()=>"");return{content:[{type:"text",text:`Search API error (${t.status}): ${e}`}]}}const o=await t.json();if(!o.results||0===o.results.length)return{content:[{type:"text",text:`No results found for: "${n}"`}]};const s=o.results.map((e,t)=>`## [${t+1}] ${e.title} (score: ${e.score})\nSource: ${e.source}${e.url?` — ${e.url}`:""}\n\n`+e.content+(e.truncated?`\n\n> Content truncated (${e.content.length} of ${e.contentLength} chars shown).${e.url?` Full content: ${e.url}`:""}`:"")).join("\n\n---\n\n");return{content:[{type:"text",text:`Found ${o.results.length} results for "${n}" (${o.durationMs}ms):\n\n${s}`}]}}catch(e){return{content:[{type:"text",text:`Search failed: ${e instanceof Error?e.message:String(e)}`}]}}}},fu=new Map;function hu(e,t){const n=du.findIndex(t=>t.name===e);-1!==n&&(du.splice(n,1),delete mu[e],t())}function gu(e,t,n,o){const i=du.findIndex(t=>t.name===e.name);if(-1!==i&&du.splice(i,1),du.push(e),mu[e.name]=t,vu.delete(e.name),null!=n&&n.source){const t=fu.get(n.source)||new Set;t.add(e.name),fu.set(n.source,t)}o()}const vu=new Map;async function xu(e,t){const n=mu[e];if(!n){const t=vu.get(e);if(t)return{isError:!0,content:[{type:"text",text:`This tool is currently unavailable because "${t}" disconnected. Please reconnect (e.g. reopen the browser tab) and try again. You should also call tools/list to refresh your available tools.`}]};throw new Error(`Tool "${e}" is not registered.`)}const o=await n(t);if("string"==typeof o)return{content:[{type:"text",text:o}]};if("object"==typeof o)return Array.isArray(o.content)?o:{content:[{type:"text",text:JSON.stringify(o)}]};throw new Error(`Invalid tool result type for tool "${e}".`)}const bu=200,yu=2e3,wu=new RegExp("^[A-Za-z0-9_./*?\\[\\]{},\\-]+$");function _u({pattern:e,glob:t,root:n,maxResults:o}){if("string"!=typeof e)throw new Error("invalid pattern: must be a string");if(e.length>yu)throw new Error(`invalid pattern: exceeds ${yu} characters`);if(null!=t&&""!==t){if("string"!=typeof t)throw new Error("invalid glob: must be a string");if(t.length>bu)throw new Error(`invalid glob: exceeds ${bu} characters`);if(!wu.test(t))throw new Error("invalid glob: contains disallowed characters")}const i=["-rn"];return t&&i.push(`--include=${t}`),i.push(`--max-count=${o}`,"-E",e,n),i}const ku=new Set;async function Su(e,t=ye){const n={check:"typescript",diagnostics:[]};if(!e)return{...n,status:"unavailable",message:"No connected web project. Open your project in the editor first."};const o=W(e),i=G(o,"tsconfig.json"),a=G(o,"node_modules/typescript/lib/tsc.js");if(!T(i))return{...n,status:"unavailable",message:"The connected web project has no tsconfig.json."};if(!T(a))return{...n,status:"unavailable",message:"TypeScript is not installed in the connected web project. Install the project dependencies first."};if(ku.has(o))return{...n,status:"error",message:"A check is already running for this project."};ku.add(o);try{const e={...process.env};delete e.NODE_OPTIONS,delete e.NODE_PATH;const{error:s,stdout:r,stderr:c}=await new Promise(n=>{t(process.execPath,[a,"--project",i,"--noEmit","--incremental","false","--pretty","false"],{cwd:o,shell:!1,timeout:1e4,maxBuffer:262144,windowsHide:!0,encoding:"utf8",env:e},(e,t,o)=>n({error:e,stdout:t,stderr:o}))});if(s&&(s.killed||"number"!=typeof s.code))return{...n,status:"error",message:s.killed?"Type checking exceeded the 10 second limit.":`Could not finish type checking: ${s.code||s.message}`,output:String(c||r).slice(0,4e3)};const l=[],p=[];for(const e of String(r).split(/\r?\n/)){const t=/^(?:(.+)\((\d+),(\d+)\): )?error (TS\d+): (.*)$/.exec(e);t?l.push({...t[1]?{file:t[1],line:Number(t[2]),column:Number(t[3])}:{},code:t[4],severity:"error",message:t[5]}):e.trim()&&(/^\s/.test(e)&&l.length?l[l.length-1].message+="\n"+e:p.push(e))}const u=Boolean(c||p.length||s&&!l.length);return{check:"typescript",project:o,status:u?"error":l.length?"failed":"passed",diagnostics:l.slice(0,100),totalDiagnostics:l.length,truncated:l.length>100,...u?{message:"The compiler did not return a complete diagnostic result.",output:[c,...p].join("\n").slice(0,4e3)}:{}}}finally{ku.delete(o)}}const ju=(e,t)=>String(null!=e?e:"").slice(0,t);function Tu(e){try{const t=new RegExp(e,"i");return{test:e=>t.test(e),mode:"regex"}}catch{const t=e.toLowerCase();return{test:e=>e.toLowerCase().includes(t),mode:"literal"}}}const Eu=function(e,t=Su,n=Date.now){let o;return async(i={})=>{var a,s,r,c;const l={status:"error",message:"Use mode check, results or error; file/code filters, nonnegative integer offset/index. No paths or commands can be selected."};if(!i||"object"!=typeof i||Array.isArray(i))return l;if(Object.keys(i).some(e=>!["mode","file","code","offset","index"].includes(e)))return l;const p=null!=(a=i.mode)?a:"check";if(!["check","results","error"].includes(p))return l;for(const e of[i.file,i.code])if(void 0!==e&&("string"!=typeof e||e.length>250))return l;for(const e of[i.offset,i.index])if(void 0!==e&&(!Number.isSafeInteger(e)||e<0))return l;const u=e();if(o&&o.project!==u&&(o=void 0),"check"===p&&(o={project:u,result:await t(u),time:n()}),!o)return{status:"unavailable",message:"No saved check for this local project. Run files_check_project with mode check first."};const d=o.result,m=null!=(s=d.diagnostics)?s:[],f=m.map((e,t)=>({...e,index:t})).filter(e=>{var t;return(!i.file||(null!=(t=e.file)?t:"").toLowerCase().includes(i.file.toLowerCase()))&&(!i.code||e.code===i.code)}),h=null!=(r=i.offset)?r:0,g="error"===p?f.filter(e=>{var t,n;return e.index===(null!=(t=i.index)?t:null==(n=f.at(-1))?void 0:n.index)}):f.slice(h,h+5);if("error"===p&&!g.length)return{status:"unavailable",message:"No matching error in the latest check. Use mode results to list available error indexes."};const v="error"===p?2e3:300;return{status:d.status,check:"typescript",checkedAt:new Date(o.time).toISOString(),cached:"check"!==p,project:ju(u,300),totalDiagnostics:null!=(c=d.totalDiagnostics)?c:m.length,retainedDiagnostics:m.length,matchingDiagnostics:f.length,truncated:Boolean(d.truncated),diagnostics:g.map(e=>({...e,...e.file?{file:ju(e.file,300)}:{},message:ju(e.message,v),messageTruncated:e.message.length>v})),..."error"!==p&&h+g.length<f.length?{nextOffset:h+g.length}:{},...d.message?{message:ju(d.message,500)}:{},...d.output?{output:ju(d.output,"error"===p?2e3:500),outputTruncated:d.output.length>("error"===p?2e3:500)}:{}}}}(()=>{var e;return null==(e=Ou())?void 0:e.web_location});function $u(e={}){gu({name:"files_editor_log_path",description:"Get the filepath to the editor log file on disk (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];if(null!=e&&e.log_location){const n=c(e.log_location).mtime;t.content.push({type:"text",text:`${e.log_location} (last modified: ${n.toLocaleString()})`})}else{let n="No recent project with known log location known.";e&&(n+=" Recent project is "+(null==e?void 0:e.project_location)),t.content.push({type:"text",text:n})}}return t},{source:"cli"},()=>{}),gu({name:"files_editor_project_path",description:"Get the filepath to the currently opened project in the editor (this may be Unity or Blender)",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.content.push(null!=e&&e.project_location?{type:"text",text:e.project_location}:{type:"text",text:"No recent project with known project location known."})}return t},{source:"cli"},()=>{}),gu({name:"files_editor_scene_path",description:"Get the filepath to the currently opened scene in the editor (Unity or Blender). Use this to find out which scene the user is working on.",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.content.push(null!=e&&e.scene_location?{type:"text",text:e.scene_location}:{type:"text",text:"No recent project with known scene location known."})}return t},{source:"cli"},()=>{}),gu({name:"files_web_project_path",description:"Get the filepath to the web project directory (the Needle Engine web frontend project).",inputSchema:{type:"object",properties:{},additionalProperties:!1,required:[]}},async e=>{const t={content:[]},n=iu();if(n){const e=null==n?void 0:n.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0];t.content.push(null!=e&&e.web_location?{type:"text",text:e.web_location}:{type:"text",text:"No recent project with known web project location known."})}return t},{source:"cli"},()=>{}),gu({name:"files_read",description:"Read a file from the user's local project on disk (editor project or web project). The path must be relative to the project root or an absolute path inside the project. Returns the file contents (or a portion if offset/limit are specified). Use 'filter' to search for specific terms within the file.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path (relative to project root, or absolute within the project)"},offset:{type:"number",description:"Line number to start reading from (1-based, default: 1). In filter mode: number of matches to skip."},limit:{type:"number",description:"Maximum number of lines to return (default: 200, max: 1000). In filter mode: max matches to return."},filter:{type:"string",description:'Regex to search for in the file (case-insensitive, e.g. "error|warning"). Falls back to a literal substring match if the pattern isn\'t valid regex. Returns matching lines with line numbers instead of sequential content.'}},additionalProperties:!1,required:["path"]}},async e=>{const t=Cu(e.path);if(!t)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};try{const n=c(t.resolved).mtime.toISOString(),o=l(t.resolved,"utf-8").split("\n");if(e.filter){const i=Tu(e.filter),a=[];for(let e=0;e<o.length;e++)i.test(o[e])&&a.push(`${e+1}: ${o[e]}`);const s=a.length,r=Math.max(0,e.offset||0),c=Math.min(Math.max(e.limit||200,1),1e3),l=a.slice(r,r+c);return{content:[{type:"text",text:`File: ${t.resolved} (modified: ${n}) — filter="${e.filter}" (${i.mode}) → ${s} matches (showing ${r+1}-${r+l.length}) in ${o.length} lines\n`+l.join("\n")}]}}const i=Math.max(1,e.offset||1),a=Math.min(e.limit||200,1e3),s=o.slice(i-1,i-1+a),r=s.map((e,t)=>`${i+t}: ${e}`).join("\n");return{content:[{type:"text",text:`File: ${t.resolved} (${o.length} lines, modified: ${n}, showing ${i}-${i+s.length-1})\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading file: ${e.message}`}]}}},{source:"cli"},()=>{}),gu({name:"files_grep",description:"Search for a pattern in the user's local project files on disk (editor project and web project) using grep. Returns matching lines with file paths and line numbers. Note: runtime-only things (e.g. node-material shaders) have no source files — read those with the inspector_* tools instead.",inputSchema:{type:"object",properties:{pattern:{type:"string",description:"Search pattern (regular expression)"},glob:{type:"string",description:"File glob filter, e.g. '*.ts' or '*.cs' (optional)"},max_results:{type:"number",description:"Maximum number of matching lines to return (default: 50)"}},additionalProperties:!1,required:["pattern"]}},async e=>{const t=Au();if(0===t.length)return{content:[{type:"text",text:"Error: no active project found."}]};const n=Math.min(e.max_results||50,200),o=[];try{_u({pattern:e.pattern,glob:e.glob,root:".",maxResults:n})}catch(e){return{content:[{type:"text",text:`Error: ${e.message}`}]}}for(const a of t)try{const t=_u({pattern:e.pattern,glob:e.glob,root:a,maxResults:n});let s="";try{s=g("grep",t,{encoding:"utf-8",maxBuffer:1048576,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch(e){if(1!==(null==e?void 0:e.status))throw e;var i;s=(null==(i=e.stdout)||null==i.toString?void 0:i.toString())||""}if(s.trim()){const e=s.trim().split("\n").map(e=>e.startsWith(a)?e.substring(a.length+1):e);o.push(...e)}}catch{}if(0===o.length){const n=t.length>0?`\nSearched in:\n${t.join("\n")}`:"\nNo project directories available to search.";return{content:[{type:"text",text:`No matches found for pattern: ${e.pattern}${n}`}]}}const a=o.slice(0,n);return{content:[{type:"text",text:`Found ${o.length} matches${o.length>n?` (showing first ${n})`:""}:\n`+a.join("\n")}]}},{source:"cli"},()=>{}),gu({name:"files_list",description:"List files in the user's local project directories on disk matching an optional glob pattern. By default searches both the editor project (Unity/Blender) and the web project. Use the 'project' parameter to target a specific one. Results are prefixed with <web_project>/..., <unity>/..., or <blender>/... so you know which root each file belongs to.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Subdirectory to list (relative to the selected project root, default: root)"},pattern:{type:"string",description:"Glob pattern to filter files, e.g. '*.ts' or '*.glb'. Supports multiple patterns separated by '|', e.g. '*.gltf|*.glb' (optional)"},recursive:{type:"boolean",description:"Whether to list files recursively (default: false)"},project:{type:"string",enum:["web","editor"],description:"Which project root to search: 'web' for the Needle Engine web project (use this for exported assets, source files, node_modules), 'editor' for the Unity/Blender project. Omit to search both."}},additionalProperties:!1,required:[]}},async e=>{const t=Ou();if(!t)return{content:[{type:"text",text:"Error: no active project found."}]};const n="blender"===t.editor?"<blender>":"unity"===t.editor?"<unity>":"<editor_project>",o=[];if(e.project&&"editor"!==e.project||!t.project_location||o.push({root:b(t.project_location),label:n}),e.project&&"web"!==e.project||!t.web_location||o.push({root:b(t.web_location),label:"<web_project>"}),0===o.length)return{content:[{type:"text",text:"Error: no active project found."}]};const i=[];for(const{root:t,label:n}of o){const o=e.path?Ru(e.path,t):t;if(o)try{var a;const s=Pu(o,t,null!=(a=e.recursive)&&a,e.pattern,0);i.push(...s.map(e=>({file:e,root:t,label:n})))}catch{}}if(0===i.length)return{content:[{type:"text",text:"No files found."+(o.length>0?`\nSearched in:\n${o.map(e=>`${e.label} → ${e.root}`).join("\n")}`:"\nNo project directories available to search.")}]};const s=i.slice(0,500).map(e=>`${e.label}/${w(e.root,e.file)}`);return{content:[{type:"text",text:`Found ${i.length} files${i.length>500?" (showing first 500)":""}:\n`+s.join("\n")}]}},{source:"cli"},()=>{}),gu({name:"files_read_editor_log",description:"Read or search the Unity or Blender editor log file. By default reads the last N lines. Use the 'filter' parameter to search for specific terms (e.g. error messages, warnings, component names) across the entire log.",inputSchema:{type:"object",properties:{lines:{type:"number",description:"Number of lines to read from the end of the log (default: 100, max: 500). Ignored when filter is set."},filter:{type:"string",description:'Regex to search for in the log (case-insensitive, e.g. "error|exception|warning"). Falls back to a literal substring match if the pattern isn\'t valid regex. Returns all matching lines from the entire log instead of just the tail.'},offset:{type:"number",description:"Number of matching results to skip from the start (default: 0). Only used with filter."},limit:{type:"number",description:"Maximum number of matching results to return (default: 200, max: 500). Only used with filter."}},additionalProperties:!1,required:[]}},async e=>{const t=Ou();var n;if(null==t||!t.log_location)return ql(`read_editor_log: no editor log file known (project: ${null!=(n=null==t?void 0:t.project_location)?n:"none"})`),{content:[{type:"text",text:"Error: no editor log file known. Is a Unity or Blender project open?"}]};try{const n=l(t.log_location,"utf-8").split("\n");let o,i;if(e.filter){const t=Tu(e.filter);o=[];for(let e=0;e<n.length;e++)t.test(n[e])&&o.push(`L${e+1}: ${n[e]}`);const a=o.length,s=Math.max(0,e.offset||0),r=Math.min(Math.max(e.limit||200,1),500);o=o.slice(s,s+r),i=`filter="${e.filter}" (${t.mode}) → ${a} matches (showing ${s+1}-${s+o.length}) in ${n.length} total lines`}else{const t=Math.min(Math.max(e.lines||100,1),500);o=n.slice(-t),i=`last ${t} of ${n.length} lines`}const a="unity"===t.editor?function(e){const t=[],n=new Map;let o=!1,i=0;for(const a of e){if(/^\s+at\s/.test(a)||/^\s*(UnityEngine\.|System\.|Unity\.)/.test(a)||/^\s+\w+[\w.<>]+\s*\(/.test(a)){o||(o=!0,i=0),i++,i<=3?t.push(a):4===i&&t.push(" ... (stack trace truncated)");continue}if(o=!1,i=0,!a.trim())continue;const e=n.get(a)||0;if(n.set(a,e+1),0===e)t.push(a);else if(1===e)t.push(` [repeated ${e+1}x] ${a}`);else{const n=t.length-1;n>=0&&t[n].startsWith(" [repeated")&&(t[n]=` [repeated ${e+1}x] ${a}`)}}return t}(o):o,s=5e4;let r=a.join("\n"),c="";if(r.length>s){r=r.substring(r.length-s);const e=r.indexOf("\n");e>0&&(r=r.substring(e+1)),c=" (output truncated to last ~50KB)"}return{content:[{type:"text",text:`Editor log: ${t.log_location} (${i}, ${a.length} after processing, editor: ${t.editor})${c}:\n`+r}]}}catch(e){return{content:[{type:"text",text:`Error reading log: ${e.message}`}]}}},{source:"cli"},()=>{}),gu({name:"files_read_gltf",description:"Read and summarize a glTF or GLB file from the user's local project on disk. Without a query, returns a structured summary including nodes, meshes, materials, animations, extensions, and compression/optimization hints. Use 'query' to drill into specific parts using JSON pointer paths. Use '*' as a wildcard for array indices or object keys. For GLB files, extracts the JSON chunk and skips binary data.",inputSchema:{type:"object",properties:{path:{type:"string",description:"File path to a .gltf or .glb file (relative to project root, or absolute path)"},query:{type:"string",description:"JSON pointer path to extract a specific part of the glTF, e.g. '/nodes/0', '/materials', '/extensions/NEEDLE_progressive', '/materials/*/extensions'. Use '*' as a wildcard for array indices or object keys."}},additionalProperties:!1,required:["path"]}},async e=>{let t=Cu(e.path);if(!t)return{content:[{type:"text",text:"Error: path is outside the project directory."}]};if(!r(t.resolved))return{content:[{type:"text",text:`Error: file not found: ${t.resolved}`}]};try{const n=function(e){const t=e.toLowerCase();if(t.endsWith(".gltf")){const t=l(e,"utf-8");return JSON.parse(t)}if(t.endsWith(".glb")){const t=l(e);if(t.length<20)return null;if(1179937895!==t.readUInt32LE(0))return null;const n=t.readUInt32LE(12);if(1313821514!==t.readUInt32LE(16))return null;const o=t.toString("utf-8",20,20+n);return JSON.parse(o)}return null}(t.resolved);if(!n)return{content:[{type:"text",text:"Error: could not parse glTF/GLB file."}]};const o=5e4;if(e.query){const i=Nu(n,e.query.replace(/^\//,"").split("/"));if(void 0===i)return{content:[{type:"text",text:`No data found at pointer: ${e.query}`}]};let a=JSON.stringify(i),s=!1;return a.length>o&&(a=a.substring(0,o),s=!0),{content:[{type:"text",text:`${e.query} in ${t.resolved}`+(s?` (truncated to ${o} chars)`:"")+"\n"+a}]}}let i=function(e,t){var n,o,i,a,s,r,c,l,p,u,d,m,f;const h=[`glTF: ${t}`];if(e.asset){const t=[];e.asset.version&&t.push(`v${e.asset.version}`),e.asset.generator&&t.push(e.asset.generator),h.push(`Asset: ${t.join(", ")}`)}if(null!=(n=e.extensionsUsed)&&n.length&&h.push(`Extensions used: ${e.extensionsUsed.join(", ")}`),null!=(o=e.extensionsRequired)&&o.length&&h.push(`Extensions required: ${e.extensionsRequired.join(", ")}`),null!=(i=e.scenes)&&i.length&&h.push(`Scenes: ${e.scenes.length}${void 0!==e.scene?` (default: ${e.scene})`:""}`),null!=(a=e.nodes)&&a.length){var g,v,x;h.push(`\nNodes (${e.nodes.length}):`);const t=null!=(g=null==(v=e.scenes)||null==(v=v[null!=(x=e.scene)?x:0])?void 0:v.nodes)?g:[],n=new Set,o=(t,i)=>{if(i>6||n.has(t))return;n.add(t);const a=e.nodes[t];if(!a)return;const s=" ".repeat(i),r=[];if(void 0!==a.mesh&&r.push(`mesh:${a.mesh}`),void 0!==a.camera&&r.push(`camera:${a.camera}`),void 0!==a.skin&&r.push(`skin:${a.skin}`),a.extensions&&r.push(`ext:[${Object.keys(a.extensions).join(",")}]`),h.push(`${s}- ${a.name||`node_${t}`}${r.length?` (${r.join(", ")})`:""}`),a.children)for(const e of a.children)o(e,i+1)};for(const e of t)o(e,1);n.size<e.nodes.length&&n.size>0&&h.push(` ... and ${e.nodes.length-n.size} more nodes`)}if(null!=(s=e.meshes)&&s.length){h.push(`\nMeshes (${e.meshes.length}):`);for(const t of e.meshes.slice(0,30)){var b,y;const e=null!=(b=null==(y=t.primitives)?void 0:y.length)?b:0;h.push(` - ${t.name||"(unnamed)"} (${e} primitive${1!==e?"s":""})`)}e.meshes.length>30&&h.push(` ... and ${e.meshes.length-30} more`)}if(null!=(r=e.materials)&&r.length){h.push(`\nMaterials (${e.materials.length}):`);for(const t of e.materials.slice(0,30)){const e=t.name||"(unnamed)",n=[];t.pbrMetallicRoughness&&n.push("PBR"),t.alphaMode&&"OPAQUE"!==t.alphaMode&&n.push(t.alphaMode),t.doubleSided&&n.push("doubleSided"),t.extensions&&n.push(`ext:[${Object.keys(t.extensions).join(",")}]`),h.push(` - ${e}${n.length?` (${n.join(", ")})`:""}`)}e.materials.length>30&&h.push(` ... and ${e.materials.length-30} more`)}if(null!=(c=e.textures)&&c.length&&h.push(`Textures: ${e.textures.length}`),null!=(l=e.images)&&l.length&&h.push(`Images: ${e.images.length}`),null!=(p=e.animations)&&p.length){h.push(`\nAnimations (${e.animations.length}):`);for(const t of e.animations.slice(0,20)){var w,_;const e=null!=(w=null==(_=t.channels)?void 0:_.length)?w:0;h.push(` - ${t.name||"(unnamed)"} (${e} channel${1!==e?"s":""})`)}e.animations.length>20&&h.push(` ... and ${e.animations.length-20} more`)}if(null!=(u=e.skins)&&u.length){h.push(`\nSkins (${e.skins.length}):`);for(const t of e.skins.slice(0,10)){var k,S;h.push(` - ${t.name||"(unnamed)"} (${null!=(k=null==(S=t.joints)?void 0:S.length)?k:0} joints)`)}}if(null!=(d=e.cameras)&&d.length){h.push(`\nCameras (${e.cameras.length}):`);for(const t of e.cameras)h.push(` - ${t.name||"(unnamed)"} (${t.type})`)}if(null!=(m=e.buffers)&&m.length){const t=e.buffers.reduce((e,t)=>e+(t.byteLength||0),0);h.push(`\nBuffers: ${e.buffers.length} (${(t/1024/1024).toFixed(1)} MB total)`)}return null!=(f=e.accessors)&&f.length&&h.push(`Accessors: ${e.accessors.length}`),h.join("\n")}(n,t.resolved);return i.length>o&&(i=i.substring(0,o)+"\n... (truncated)"),{content:[{type:"text",text:i}]}}catch(e){return{content:[{type:"text",text:`Error reading glTF: ${e.message}`}]}}},{source:"cli"},()=>{}),gu(ul.schema,async e=>{const t=await ul.execute(e);return"error"in t?{content:[{type:"text",text:t.error}]}:{content:[{type:"text",text:t.content}]}},{source:"cli"},()=>{}),gu({name:"files_check_project",description:"Check the connected local web project for TypeScript errors without emitting files or applying fixes. Default mode check runs its installed compiler (10 second limit) and returns up to 5 short diagnostics. Use mode results with file/code filters and offset to browse the latest check without rerunning. Use mode error with an index for details; omit index for the last matching error. Results are timestamped snapshots, retained until another check or project change, or CLI exit: run check again after edits. Retains at most 100 diagnostics. Reports current errors, not whether they predate edits. Not a linter or Unity/Blender compiler.",inputSchema:{type:"object",properties:{mode:{type:"string",enum:["check","results","error"],description:"Run a new check, browse cached results, or inspect one cached error."},file:{type:"string",maxLength:250,description:"Filter diagnostic filenames by case-insensitive substring; does not select a project or restrict compiler inputs."},code:{type:"string",maxLength:250,description:"Exact diagnostic code, e.g. TS2322."},offset:{type:"integer",minimum:0,description:"Offset within filtered results; 5 errors per page."},index:{type:"integer",minimum:0,description:"Diagnostic index from the latest check for mode error; defaults to the last matching error."}},additionalProperties:!1,required:[]}},async e=>{const t=await Eu(e);return{content:[{type:"text",text:JSON.stringify(t)}],isError:"error"===t.status||"unavailable"===t.status}},{source:"cli"},()=>{}),null!=e&&e.logToolCount&&ql(`[MCP] registered ${du.length} built-in tools: ${du.map(e=>e.name).join(", ")}`)}function Ou(){var e;const t=iu();return null!=t&&null!=(e=t.entries)&&e.length?t.entries.sort((e,t)=>t.last_accessed-e.last_accessed)[0]:null}function Ru(e,t){const n=b(t,e),o=b(t);return n.startsWith(o+_)||n===o?n:null}function Au(){const e=Ou();if(!e)return[];const t=[];return e.project_location&&t.push(b(e.project_location)),e.web_location&&t.push(b(e.web_location)),t}function Cu(e){const t=Au();for(const n of t){const t=Ru(e,n);if(t&&r(t))return{resolved:t,root:n}}for(const n of t){const t=Ru(e,n);if(t)return{resolved:t,root:n}}const n=b(e);for(const e of t)if(n.startsWith(e+_)||n===e)return{resolved:n,root:e};return null}function Nu(e,t){if(0===t.length||null==e)return e;const[n,...o]=t;if("*"!==n)return Nu(e[/^\d+$/.test(n)?Number(n):n],o);if(Array.isArray(e)){const t=e.map(e=>Nu(e,o)).filter(e=>void 0!==e);return t.length>0?t:void 0}if("object"==typeof e){const t={};for(const n of Object.keys(e)){const i=Nu(e[n],o);void 0!==i&&(t[n]=i)}return Object.keys(t).length>0?t:void 0}}function Pu(e,t,n,o,i){if(i>10)return[];const a=[],s=p(e,{withFileTypes:!0}),r="node_modules"===(e.split("/").pop()||e.split("\\").pop()||"");for(const c of s){if(r){if(".needle"!==c.name&&".vite"!==c.name)continue}else{if("Library"===c.name)continue;if(c.name.startsWith(".")||"node_modules"===c.name){if(!n)continue;if(c.name.startsWith("."))continue}}const s=y(e,c.name);if(c.isDirectory())n&&a.push(...Pu(s,t,!0,o,i+1));else{if(o&&!o.split("|").map(e=>(e=e.trim()).startsWith(".")&&!e.startsWith("*.")?"*"+e:e).filter(Boolean).some(e=>_e(c.name,e,{nocase:!0})))continue;a.push(s)}}return a}const Iu="settings.json";function Uu(){return G(B(),".needle")}function zu(e){const t=G(null!=e?e:Uu(),Iu);if(!T(t))return{};try{const e=JSON.parse(z(t,"utf-8"));return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}catch{return{}}}function Lu(e){return"disabled"===zu(e).remote_ai_tools}function Fu(e,t){if(!T(e))try{E(e,{recursive:!0})}catch{}let n=null,o=null;try{n=F(e,{persistent:!1},(e,n)=>{n&&n.toString()!==Iu||(o&&clearTimeout(o),o=setTimeout(()=>{o=null;try{t()}catch{}},50))}),null==n.on||n.on("error",()=>{})}catch{}return()=>{o&&(clearTimeout(o),o=null);try{var e;null==(e=n)||e.close()}catch{}n=null}}var Du={__proto__:null,KNOWN_SETTINGS:{remote_ai_tools:{displayName:"Remote AI tools",default:"enabled",description:"Allow Needle Cloud AI chat to dispatch tool calls (file reads, search, etc.) to this machine.",command:"needle-cloud settings remote-ai-tools <true|false>"}},defaultSettingsDir:Uu,readSettings:zu,writeSetting:function(e,t,n){const o=zu(e);null===n?delete o[t]:o[t]=n,E(e,{recursive:!0}),L(G(e,Iu),JSON.stringify(o,null,2)+"\n","utf-8")},areRemoteAiToolsDisabled:Lu,watchSettings:Fu};const qu=2e3,Bu=6e4,Mu=25e3,Wu=1e4,Gu=o();let Hu=null,Ju=null,Vu=null,Ku=null,Yu=qu,Zu=!1,Xu=!1;function Qu(){Hu||(Lu()?ql("Needle Cloud connection: skipped (remote_ai_tools disabled in settings)"):(Zu=!1,Ju&&(clearTimeout(Ju),Ju=null),Yu=qu,td()))}function ed(e){Zu=!0,nd(),Ju&&(clearTimeout(Ju),Ju=null),Hu?(ql(`Needle Cloud connection: closing (reason: ${null!=e?e:"shutdown"})`),Hu.close(1e3,null!=e?e:"shutdown"),Hu=null):e&&ql(`Needle Cloud connection: disconnect requested (reason: ${e}) — no active connection`)}async function td(){let e=await Wp();if(e||(e=function(){const e=Pp("accessToken");if(s.existsSync(e)){const t=s.readFileSync(e,"utf8");if(t){const e=JSON.parse(t),n=null==e?void 0:e["@https://cloud.needle.tools/api"];return null==n?void 0:n.token}}return null}(),e&&ql("Needle Cloud connection: using cached token (refresh failed)")),!e)return Xu||(ql("Needle Cloud connection: skipped (not logged in)"),Xu=!0),void od(!0);Xu=!1;const t="https://cloud.needle.tools/api".replace(/^http/,"ws")+"/v1/cli/ws?token="+encodeURIComponent(e)+"&instance="+encodeURIComponent(Gu);ql("Needle Cloud connection: connecting...");const n=`needle-cloud/${lu()} Node/${process.versions.node}`;Hu=new xe(t,{headers:{"User-Agent":n,Origin:"cli://needle-cloud"}}),Hu.on("open",()=>{Yu=qu,ql("Needle Cloud connection: established"),function(){var e,t,n,o,i;if(!Hu||Hu.readyState!==xe.OPEN)return;const a=iu(),s=null==a||null==(e=a.entries)||null==(e=e.sort((e,t)=>t.last_accessed-e.last_accessed))?void 0:e[0],r={type:"presence",editor:null!=(t=null==s?void 0:s.editor)?t:"unknown",project:null!=(n=null==s?void 0:s.project_location)?n:null,scene:null!=(o=null==s?void 0:s.scene_location)?o:null,web_project:null!=(i=null==s?void 0:s.web_location)?i:null,cli_version:lu()};Hu.send(JSON.stringify(r))}(),function(){if(!Hu||Hu.readyState!==xe.OPEN)return;try{$u()}catch(e){ql(`Needle Cloud connection: registerServerTools failed: ${e}`)}const e=du.map(e=>e.name);var t;ql(`Needle Cloud connection: sending ${e.length} tools: ${e.join(", ")}`),Hu.send(JSON.stringify({type:"tools",tools:(t=du,t.map(e=>{var t;return{name:e.name,description:e.description,inputSchema:e.inputSchema,capability:null!=(t=e.capability)?t:"local"}}))}))}(),nd(),Vu=setInterval(()=>{Hu&&Hu.readyState===xe.OPEN&&(Hu.ping(),Ku=setTimeout(()=>{ql("Needle Cloud connection: pong timeout, terminating"),Hu&&Hu.terminate()},Wu))},Mu)}),Hu.on("pong",()=>{Ku&&(clearTimeout(Ku),Ku=null)}),Hu.on("message",e=>{try{const n=JSON.parse(e.toString());var t;"execute_tool"===n.type&&n.requestId&&n.toolName&&async function(e,t,n){ql(`Cloud tool request: ${t}(${Object.keys(n).length>0?" "+Object.entries(n).map(([e,t])=>`${e}=${JSON.stringify(t)}`).join(", "):""}) [${e}]`);const o=Date.now();try{var i,a;const s=await xu(t,n);ql(`Cloud tool result: ${t} → ${null!=(i=null==s||null==(a=s.content)?void 0:a.reduce((e,t)=>{var n;return e+((null==(n=t.text)?void 0:n.length)||0)},0))?i:0} chars in ${Date.now()-o}ms [${e}]`),Hu&&Hu.readyState===xe.OPEN&&Hu.send(JSON.stringify({type:"tool_result",requestId:e,result:s}))}catch(n){const i=n instanceof Error?n.message:String(n);ql(`Cloud tool error: ${t} → ${i} in ${Date.now()-o}ms [${e}]`),Hu&&Hu.readyState===xe.OPEN&&Hu.send(JSON.stringify({type:"tool_result",requestId:e,error:i}))}}(n.requestId,n.toolName,null!=(t=n.args)?t:{})}catch{}}),Hu.on("close",(e,t)=>{const n=(null==t?void 0:t.toString())||"";ql(`Needle Cloud connection: closed (code=${e}${n?" "+n:""})`),nd(),Hu=null,Zu||od()}),Hu.on("error",e=>{ql(`Needle Cloud connection: error - ${e.message||"connection refused"} (is https://cloud.needle.tools/api reachable?)`)})}function nd(){Vu&&(clearInterval(Vu),Vu=null),Ku&&(clearTimeout(Ku),Ku=null)}function od(e=!1){Zu||Ju||(e||ql(`Needle Cloud connection: reconnecting in ${Yu/1e3}s`),Ju=setTimeout(()=>{Ju=null,td()},Yu),Yu=Math.min(2*Yu,Bu))}const id=e=>{const t=ve();return t.use("/:action",async(t,n,o)=>{const{action:i}=t.params,a=Jp({navigate:e=>{n.redirect(e)}});switch(i){case"sign-in":e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,ql("Sign in..."),await a.clearAllTokens(),Lp();try{await a.signIn(`${tp}/auth-callback`)}catch(e){const t=null==e?void 0:e.cause,o=`Sign-in failed: ${null!=t&&t.code?`${t.code}${t.address?` (${t.address}:${t.port})`:""}`:(null==e?void 0:e.message)||"unknown error"}`;return ql(o),console.error(o),n.status(502).send(o)}break;case"sign-out":{var s,r;const t=await Gp(),n=(null==t||null==(s=t.userInfo)?void 0:s.sub)||(null==t||null==(r=t.claims)?void 0:r.sub),o=null==t?void 0:t.accessToken;ql(`Sign out... (${n})`),n&&o&&await async function(e){return!e.accessToken||import("node-machine-id").then(async t=>{const n=await eu();return Yp=n,await fetch("https://cloud.needle.tools/api"+Le.account.post_machine,{method:"POST",headers:{Authorization:"Bearer "+e.accessToken,"Content-Type":"application/json"},body:JSON.stringify({action:"logout",machine_id:n,machine_name:tu()})}).catch(e=>{ql(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`),console.error(`Failed to validate logout: ${e.message} - Make sure https://cloud.needle.tools/api is reachable`)}),!0})}({userId:n,accessToken:o}).catch(e=>{console.error(e),ql(`Failed to validate logout: ${e}`)}),e.invalid_login=!1,e.invalid_login_type=null,e.error=void 0,console.log("User signed out"+(n?`: ${n}`:"")),await a.signOut(Sp()),Lp();break}case"auth-callback":if(t.url){const o=await a.handleSignInCallback(`${tp}${t.originalUrl}`).catch(e=>({error:e}));if(Lp(),o&&"error"in o){ql(`Error during sign in: ${o.error}`);const e=o.error instanceof Error?o.error.message:String(o.error);n.redirect(tp+"?cancelled&message="+encodeURIComponent(e))}else{var c,l,p,u;const t=await Gp();if(null!=t&&t.isAuthenticated){var d,m;e.invalid_login=!1,e.user_email=(null==(d=t.claims)?void 0:d.email)||(null==(m=t.userInfo)?void 0:m.email)||null,e.logged_in_machine_names=[...Zp(t)];const o=await nu(t,{signout:!0});if(!o)return e.invalid_login=!0,e.invalid_login_type="too-many-logins",n.redirect(Sp("too-many-logins"));if("object"==typeof o&&"error"in o)return e.invalid_login=!0,e.invalid_login_type="error",e.error=o.error,n.redirect(Sp("error"));Lp()}console.log(`User logged in: ${(null==t||null==(c=t.userInfo)?void 0:c.sub)||(null==t||null==(l=t.claims)?void 0:l.sub)}`),ql(`User logged in: ${(null==t||null==(p=t.userInfo)?void 0:p.sub)||(null==t||null==(u=t.claims)?void 0:u.sub)}`),Qu(),n.redirect(tp)}}break;default:o()}}),t};function ad(e){var t,n,o,i;if(!e)return"";let a=(null==(t=e.claims)?void 0:t.name)||(null==(n=e.userInfo)?void 0:n.name)||(null==(o=e.claims)?void 0:o.username)||"";var s;return(!a||a.length<=0)&&null!=(i=e.claims)&&i.email?function(e){return e?(e=(e=(e=(e=e.split("@")[0]).replace(/[^a-zA-Z0-9]/g," ")).replace(/\s+/g," ")).split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),e):e}(null==(s=e.claims)?void 0:s.email):a}async function sd(e,t=null){var n,o;if(!e)return{status:500,error:"User is not provided"};if(!e.isAuthenticated)return{status:403,error:"User is not authenticated"};const i=(null==(n=e.claims)?void 0:n.sub)||(null==(o=e.userInfo)?void 0:o.sub);t===i&&(t=null);let a=null;if(null==t)a=e.accessToken;else if(null!=t){var s;let n=null==e||null==(s=e.userInfo)||null==(s=s.organization_data)?void 0:s.find(e=>e.id===t);if(!n){var r;const o=t.toLowerCase();n=null==e||null==(r=e.userInfo)||null==(r=r.organization_data)?void 0:r.find(e=>e.name.toLowerCase()===o)}if(!n)return{status:403,error:`User is not part of team "${t}"`};t=n.id,a=await e.client.getOrganizationToken(n.id).catch(e=>{var o;return console.error(`Error getting organization token for "${null==(o=n)?void 0:o.name}" (${t}): ${e.message}`),null})}return a?{authToken:a,org:t}:{status:403,error:"No access token found"}}const rd=function(){return async(e,t,n)=>{const o=await Gp();Object.defineProperty(e,"user",{enumerable:!0,get:()=>o}),n()}},cd=`${tp}/mcp`,ld="2025-06-18",pd={name:"Needle Cloud MCP",version:"1.0.0"};function ud(e){return{jsonrpc:"2.0",id:e,result:{protocolVersion:ld,capabilities:{tools:{listChanged:!0}},serverInfo:pd}}}async function dd(e,t){const n=!0===(null==t?void 0:t.proxy),{method:o,params:i,id:a}=e;if("initialize"===o)return ud(null!=a?a:0);if("ping"===o)return{jsonrpc:"2.0",id:a,result:{}};if("notifications/initialized"===o||"notifications/cancelled"===o)return null;if("tools/list"===o){try{$u()}catch{}let e=du;if(n){const t=await async function(){try{var e,t;const n=await fetch(cd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/list"}),signal:AbortSignal.timeout(2e3)});return n.ok&&null!=(e=null==(t=(await n.json()).result)?void 0:t.tools)?e:[]}catch{return[]}}();if(t.length>0){const n=new Set(du.map(e=>e.name));e=[...du,...t.filter(e=>!n.has(e.name))]}}return{jsonrpc:"2.0",id:a,result:{tools:e}}}if("tools/call"===o){const e=null==i?void 0:i.name;try{$u()}catch{}try{return{jsonrpc:"2.0",id:a,result:await xu(e,(null==i?void 0:i.arguments)||{})}}catch(t){if(n)try{const t=await async function(e,t){const n=await fetch(cd,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:e,arguments:t}}),signal:AbortSignal.timeout(35e3)}),o=await n.json();if(o.error)throw new Error(o.error.message);return o.result}(e,(null==i?void 0:i.arguments)||{});return{jsonrpc:"2.0",id:a,result:t}}catch{}return{jsonrpc:"2.0",id:a,error:{code:-32603,message:`Tool execution failed: ${t.message}`}}}}return{jsonrpc:"2.0",id:null!=a?a:null,error:{code:-32601,message:`Method '${o}' not found`}}}function md(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}let fd=!1;const hd=ve(),gd=new Set,vd=new Map;let xd=0;function bd(){const e=[];for(const[t,{connectedAt:n,userAgent:o}]of vd)e.push({id:t,connectedAt:n,userAgent:o});return e}function yd(e,t,n){if((t.headers.accept||"").includes("text/event-stream")){n.setHeader("Content-Type","text/event-stream"),n.setHeader("Cache-Control","no-cache"),n.setHeader("Connection","keep-alive"),n.setHeader("Access-Control-Allow-Origin","*"),n.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),n.flushHeaders(),n.write(": connected\n\n");const o=t.headers["user-agent"]||"";return vd.set(e,{id:e,client:n,connectedAt:Date.now(),userAgent:o}),console.log(`[MCP] SSE client connected (ID: ${e}) ${o}. Total clients: ${vd.size}`),ql(`MCP SSE client connected (ID: ${e}) ${o}. Total clients: ${vd.size}`),t.on("close",()=>{console.log(`[MCP] SSE client disconnected (ID: ${e}): ${o}`),ql(`MCP SSE client disconnected (ID: ${e}): ${o}`),vd.delete(e)}),!0}return!1}function wd(e){if(!Array.isArray(e))return console.error("Invalid input: paths should be an array of strings."),null;for(const t of e)if(!1!==r(t))try{const e=_d(t);if(e)return e}catch(e){}}function _d(e){const t=y(e,".git");if(r(t)){const e=function(e){const t=f(e);if(t.isDirectory())return y(e,"config");if(t.isFile()){const t=l(e,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(t){let n=t[1].trim();k(n)||(n=b(S(e),n));const o=y(n,"config");if(r(o))return o;const i=y(n,"commondir");if(r(i)){let e=l(i,"utf-8").trim();return k(e)||(e=b(n,e)),y(e,"config")}}}return null}(t);if(e&&r(e)){const t=function(e){const t=l(e,"utf-8"),n=/\[remote\s+"(?<name>.+?)"\].+?url\s*=\s*(?<url>.+?)$/gms,o=[];let i;for(;null!==(i=n.exec(t));)if(i.groups){const e=i.groups.name,t=i.groups.url.trim();t.length&&o.push({name:e,url:t})}const a=o.find(e=>"origin"===e.name)||o.find(e=>"upstream"===e.name)||o[0];return a?a.url:null}(e);if(t)return t}}const n=y(e,".plastic");if(r(n)){const e=y(n,"replicas.db");if(r(e)){const t=l(e,"utf-8").split("\n");for(const e of t){const t=e.split("=");if(2===t.length&&"repo"===t[0].trim()){const e=t[1].trim();if(e.length)return e}}}}const o=y(e,"..");return o===e?null:_d(o)}hd.get("/mcp",async(e,t)=>{if(yd(xd++,e,t))return;const n=function(e){const t=[...du].sort((e,t)=>e.name.localeCompare(t.name)),n=t.map(e=>`\n <div class="tool">\n <span class="tool-name">${md(e.name)}</span>\n <span class="tool-desc">${md(function(e){const t=e.indexOf("\n");return-1===t?e:e.slice(0,t)}(e.description))}</span>\n </div>`).join("\n");return`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Needle MCP Server</title>\n <style>\n * { box-sizing: border-box; }\n body {\n background: #f0f4ef;\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.6;\n padding: 20px 24px;\n max-width: 960px;\n margin: 0 auto;\n color: #1a1a1a;\n }\n header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 8px;\n }\n h2 {\n margin-top: 1.2em;\n margin-bottom: 0.4em;\n }\n a { color: inherit; }\n img.logo {\n height: 2em;\n width: auto;\n }\n .badge {\n font-size: 0.75em;\n background: #d0d4cf;\n padding: 2px 8px;\n border-radius: 10px;\n vertical-align: middle;\n font-weight: normal;\n }\n .tools-info {\n color: #555;\n font-size: 0.9rem;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n /* Tool items */\n .tool {\n background: #fff;\n border: 1px solid #d8dcd7;\n border-radius: 6px;\n margin-bottom: 6px;\n padding: 10px 14px;\n display: flex;\n align-items: baseline;\n gap: 10px;\n }\n .tool-name {\n font-weight: 600;\n white-space: nowrap;\n }\n .tool-desc {\n color: #555;\n font-size: 0.9rem;\n }\n</style>\n</head>\n<body>\n <header>\n <img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" />\n <strong>Needle MCP Server</strong>\n </header>\n\n <p>The Needle MCP server is alive and running.</p>\n\n <h2>Usage</h2>\n <p><a href="https://fwd.needle.tools/mcp">Open Documentation</a></p>\n\n <h2>Available Tools <span class="badge">${t.length}</span></h2>\n <p class="tools-info">These tools are available to AI agents connected via the Model Context Protocol (MCP).</p>\n ${n}\n</body>\n</html>`}();t.status(200).header("Content-Type","text/html; charset=utf-8").send(n)}),hd.post("/mcp",async(e,t)=>{const n=e.headers.accept||"",o=e.headers["user-agent"]||"",{method:i,id:a}=e.body;console.log(`[MCP] Received request from ${o} (${i}) (ID: ${a})`),t.setHeader("Content-Type","application/json"),t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id");try{if("initialize"===i&&n.includes("text/event-stream")){const n=void 0!==a?a:xd++;if(yd(n,e,t)){fd=!0;const e=ud(n);return void t.write(`data: ${JSON.stringify(e)}\n\n`)}}const r=await dd(e.body);if("initialize"===i){fd=!0;const e=Q();gd.add(e),t.setHeader("Mcp-Session-Id",e),console.log(`[MCP] New session created: ${e} for ${o}`),ql(`MCP New session: ${e} for ${o}`)}if(null===r)return t.status(204).end();if(ql(`MCP Request: ${i}`),"tools/list"===i){var s;const e=(null==(s=r.result)||null==(s=s.tools)?void 0:s.map(e=>e.name))||[];console.log(`[MCP] Sending tools/list: ${e.length} tools [${e.join(", ")}]`)}else{const e=JSON.stringify(r);console.log(`[MCP] Sending response for ${i}:`,e.length>500?e.substring(0,500)+" [...]":e)}t.json(r)}catch(e){console.error("[MCP] Error processing request:",e);const n={jsonrpc:"2.0",error:{code:-32603,message:"Internal server error",data:"development"===process.env.NODE_ENV?e.stack:void 0},id:a||null};t.json(n)}}),hd.options("/mcp",(e,t)=>{t.setHeader("Access-Control-Allow-Origin","*"),t.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS, DELETE"),t.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Mcp-Session-Id"),t.setHeader("Access-Control-Expose-Headers","Mcp-Session-Id"),t.status(204).end()});let kd=!1;function Sd(e,t={}){kd&&process.stdout.write(JSON.stringify({jsonrpc:"2.0",method:e,params:t})+"\n")}var jd={__proto__:null,sendStdioNotification:Sd,startStdio:function(){kd=!0,process.stdin.resume();const e=fe({input:process.stdin,terminal:!1});e.on("line",async e=>{const t=e.trim();if(!t)return;let n;try{n=JSON.parse(t)}catch{return void process.stdout.write(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}})+"\n")}const o=await dd(n,{proxy:!0});null!==o&&process.stdout.write(JSON.stringify(o)+"\n")}),e.on("close",()=>{kd=!1,process.exit(0)})}};let Td=null;function Ed(){Td&&clearTimeout(Td),Td=setTimeout(()=>{!function(e,t={}){if(0===vd.size)return;const n=`data: ${JSON.stringify({jsonrpc:"2.0",method:"notifications/tools/list_changed",params:t})}\n\n`;for(const[e,{client:t}]of vd)try{t.write(n)}catch(t){console.error(`[MCP] Error sending notification to client (${e}):`,t),vd.delete(e)}}(),Sd("notifications/tools/list_changed")},10)}const $d=new Set(["https://cloud.needle.tools","https://needle.tools","https://engine.needle.tools","https://docs.needle.tools","chrome-extension://kjcepmifiddcepiocokclhibpkgcdomk","chrome-extension://jonplpbnhmanoekkgcepnedhghflblmo"]),Od=new Set(["localhost","127.0.0.1","[::1]","::1"]);function Rd(e){if("string"!=typeof e||0===e.length)return!1;if($d.has(e))return!0;let t;try{t=new URL(e)}catch{return!1}if("/"!==t.pathname&&""!==t.pathname)return!1;if(""!==t.search||""!==t.hash)return!1;if("http:"!==t.protocol&&"https:"!==t.protocol)return!1;const n=t.hostname.toLowerCase();return!!Od.has(n)||"::1"===n}const Ad="[MCP]",Cd=new Array,Nd="2026-09-29T16:43:16.195Z";var Pd={__proto__:null,BUILD_TIME:Nd};const{json:Id}=ke;function Ud(e){const t=null==e?void 0:e.cause;return null!=t&&t.code?`${t.code}${t.address?` (${t.address}:${t.port})`:""}`:null!=t&&t.message?t.message:null!=e&&e.code?e.code:null!=e&&e.message&&"fetch failed"!==e.message?e.message:"connection refused or network unreachable"}async function zd(t={restart:!1}){const n=await e(tp).catch(e=>({ok:!1})),i="/sign-in",a="/api/authenticated",s="/api/projects",c="/api/content",l={baseUrl:tp,port:ep,isHost:!1,auth_endpoints:{"sign-in":`${tp}${i}`,"sign-out":`${tp}/sign-out`,"is-authenticated":`${tp}${a}`}};let p=n.ok;if(p){var u;const f=await e(`${tp}/api/info`).catch(()=>null);if(null!=f&&f.ok){const g=await f.json().catch(()=>null);null!=g&&g.api_endpoint&&"https://cloud.needle.tools/api"!==g.api_endpoint&&(ql(`Running server uses different API endpoint (${g.api_endpoint} vs https://cloud.needle.tools/api), restarting...`),t||(t={}),t.restart=!0)}if(!0===(null==(u=t)?void 0:u.restart)){ql("Restarting auth server...");const v=`${tp}/restart`;t.ora&&(t.ora.text="Sending restart request to server");const x=new AbortController;setTimeout(()=>x.abort(),1e4);let b={};try{const _=y(ae(),".needle","local-server-token"),k=JSON.parse((await import("fs")).readFileSync(_,"utf-8"));k.token&&(b={Authorization:`Bearer ${k.token}`})}catch{}const w=await e(v,{method:"post",signal:x.signal,headers:b}).catch(e=>({ok:!1,status:400,error:e}));if(w.ok)return await Cc(300),zd({restart:!1});console.error("Failed to restart server",w.status),ql(`Failed to restart server: ${w.status}`)}}if(!p){process.title="Needle CLI server";const S=await import("express").catch(e=>{throw console.error("Error starting the auth server (express not found)",e),ql("Error starting the auth server"),new Error("Failed to load express module")});if(!S)throw ql("Error loading auth server module"),new Error("Failed to load express module");ql(`Starting Needle CLI server ${lu()} (built ${Nd})... (Using api at https://cloud.needle.tools/api)`,{emptyLineBefore:!0}),l.isHost=!0;let j=null;const $={invalid_login:!1,invalid_login_type:null,user_email:null,logged_in_machine_names:[]};let O=S.default();O.use(Id({limit:"10mb"}));const R=y(ae(),".needle"),A=function(e,t){var n;const i=G(e,"local-server-token"),a=null!=(n=function(e){if(!T(e))return null;try{const t=z(e,"utf-8");if(0===t.length)return null;const n=JSON.parse(t);if(n&&"string"==typeof n.token&&n.token.length>0)return n.token}catch{}return null}(i))?n:o();E(e,{recursive:!0});const s=JSON.stringify({token:a,pid:process.pid,port:t},null,2);if(L(i,s,{encoding:"utf-8",mode:384}),"win32"===process.platform)try{const e=process.env.USERNAME||process.env.USER||"";e&&we("icacls",[i,"/inheritance:r","/grant:r",`${e}:(F)`],{stdio:"ignore",timeout:5e3})}catch{}return a}(R,ep);ql(`Local token written to ${y(R,"local-server-token")}`);const C=function(e,t=5e3){const n=new Map,o=Math.max(1,Math.round(t/1e3));return(i,a)=>{const s=Date.now(),r=n.get(i);if(!r||s-r.lastLog>t){var c;const t=null!=(c=null==r?void 0:r.suppressed)?c:0;e(t>0?`${a} [+${t} similar in last ${o}s]`:a),n.set(i,{lastLog:s,suppressed:0})}else r.suppressed++}}(e=>ql(`Denied: ${e}`),5e3);O.use(function(e){const t=null==e?void 0:e.onDenied;return(e,n,o)=>{var i,a;if("OPTIONS"===e.method)return o();const s=null==(i=e.headers)?void 0:i.origin,r=null==(a=e.headers)?void 0:a["sec-fetch-site"];if("none"===r||"same-origin"===r)return o();if(s){if(Rd(s))return o();if(t)try{var c,l,p,u;const n=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown",o=null!=(p=null!=(u=e.path)?u:e.url)?p:"?";t(`origin|${s}|${o}`,`denied origin=${s} path=${o} ua="${n}"`)}catch{}return n.status(403).send("Forbidden: origin not allowed")}return o()}}({onDenied:C}));const N=new Set(["/","/sign-in","/sign-out","/auth-callback","/api/info","/api/authenticated","/api/public_key","/mcp","/register"]),P="needle_local";O.use((e,t,n)=>{var o,i,a;if("OPTIONS"===e.method)return n();if(N.has(e.path))return n();if(e.path.startsWith("/mcp/"))return n();if(e.path.startsWith("/.well-known/"))return n();const s=null==(o=e.headers)?void 0:o.authorization;if(s){const e=s.split(" ");if(2===e.length&&"Bearer"===e[0]&&e[1]===A)return n()}if((null==(i=e.query)?void 0:i.token)===A)return n();const r=((null==(a=e.headers)?void 0:a.cookie)||"").split(";").map(e=>e.trim()).find(e=>e.startsWith(P+"="));if(r&&r.split("=")[1]===A)return n();try{var c,l;const t=null!=(c=null==(l=e.headers)?void 0:l["user-agent"])?c:"unknown";C(`token|${t}|${e.path}`,`path=${e.path} ua="${t}" — no valid token or cookie`)}catch{}return t.status(401).send("Unauthorized: token required")}),O.use(id($)),t.ora?(t.ora.start("Starting MCP server..."),t.ora.succeed(`MCP server available at ${tp}/mcp`)):console.log(`\nMCP server available at ${tp}/mcp .`),O.use(hd);const I="\n <title>Needle Cloud</title>\n <link rel=\"icon\" href=\"https://cdn.needle.tools/static/branding/favicon.ico\" type=\"image/x-icon\">\n <style>\n body { \n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 18px;\n padding: 2rem;\n background: #f0f4ef;\n }\n a {\n color: rgb(120, 76, 223);\n }\n .main_panel {\n display: flex;\n flex-direction: column;\n gap: .5rem;\n justify-content: flex-start;\n align-items: center;\n width: min(80ch, 90vw);\n margin: 0 auto;\n\n height: 100%;\n\n & img.logo {\n height: 3rem;\n margin-bottom: 1rem;\n }\n }\n .secondary {\n color: rgba(0, 0, 0, .5);\n }\n .error-details {\n font-size: 12px;\n color: rgba(0, 0, 0, .5);\n }\n .error-details a {\n color: inherit;\n }\n </style>",U=`<div class="main_panel"><img class="logo" src="https://cdn.needle.tools/static/branding/logo_needle.png" alt="Needle Logo" title="Needle Logo (${lu()})"/>`,F="</div>";let D="";O.get("/",rd(),async(e,t)=>{var n,o;if(null!=(n=e.user)&&n.isAuthenticated?t.cookie(P,A,{httpOnly:!0,sameSite:"strict",path:"/"}):t.clearCookie(P,{path:"/"}),t.set({"Content-Type":"text/html; charset=utf-8"}),t.write(I),null!=e.query.cancelled)return t.end("Login cancelled. You can close this window now."),void ql("Login cancelled by user");if(null!=e.query["too-many-logins"]&&$.logged_in_machine_names.length){var a;const e=kl();let n="<div>";return n+="<strong>You have reached the maximum number of allowed device logins!</strong><br/><br/>",n+=(null==(a=$.logged_in_machine_names)?void 0:a.map(e=>`• ${e}`).join("<br/>"))+"<br/><br/>",n+=`1) Go to <a href="${e}#device-logins" target="_blank">Needle Cloud device logins</a> and logout one of your devices.<br/>\n 2) Then <a href="${i}">sign-in on this machine</a>.<br/><br/>`,n+="</div>",t.status(406),t.end(U+n+F),void ql(`Login failed: Too many logins from different machines: [${$.logged_in_machine_names.join(", ")}]`)}if(null!=e.query.error)return t.status(500),void t.end(`${U}\n <div>\n <strong>An error occurred</strong>: Please make sure <i>https://cloud.needle.tools/api</i> and <i>https://auth.needle.tools</i> are reachable and not blocked by your firewall or network. After that please try to <a href="${i}">sign-in</a> again.\n <br/><span class="error-details">If the issue persists, please contact support and include the log file: <a title="Link to local log file. Please copy this url and open it in your file explorer or terminal" href="file://${Ll()}" target="_blank">${Ll()}</a></span>\n </div>\n ${F}`);if(null!=(o=e.user)&&o.isAuthenticated){var s;if(!await Qp(e.user)){if($.invalid_login=!0,$.logged_in_machine_names=[...Zp(e.user)],Tp(),ql("Cleared stored auth data"),"client"in e.user){const t=e.user;await t.client.clearAccessToken(),await t.client.clearAllTokens(),ql("Cleared all tokens")}return t.end(`${U}<div>You have been logged out from this machine. You can close this window now or try to <a href="${i}">sign in</a> again</div>${F}`)}$.invalid_login=!1,t.end(`${U}\n <div>\n Hi ${ad(e.user)} — you logged in successfully. You can close this window now.\n </div>\n ${F}`);const n=`Logged in successfully as ${ad(e.user)} (${null==(s=e.user.userInfo)?void 0:s.sub})`;return void(D!==n&&(D=n,ql(D)))}let r=`<span><a href="${i}">Sign in</a> to your Needle account</span>`;"1"===e.query["signed-out"]&&(r=`<span class="secondary">You have been signed out successfully.</span>${r}`),t.write(U+r+F),t.end()}),O.post("/restart",(e,n)=>{var o;t.ora&&(t.ora.text="Received restart event. This instance will close"),null==(o=j)||o.close(e=>{e&&console.error(e)}),setTimeout(()=>{process.exit(0)},100),n.status(200).end("Server is restarting"),ql("Server is restarting\n")}),O.get("/api/logs",async(e,t)=>{const n=Ll();r(n)?h(n,"utf-8",(e,o)=>{if(e)return console.error(e),void t.status(500).end("Failed to read log file");t.set({"Content-Type":"text/plain; charset=utf-8"});const i=o.split("\n").filter(e=>e.length>0).reverse().join("\n");let a=`--- Needle CLI v${lu()} (built ${Nd}) Log File (newest first) ---\n${n}\n\n`;a+=i,t.status(200).end(a)}):t.status(404).end("Log file not found")}),O.get("/api/info",(e,t)=>{t.json({api_endpoint:"https://cloud.needle.tools/api",version:lu()})}),O.get(a,rd(),async(e,t)=>{var n;if(!0===$.invalid_login){const e=Ld($);return t.status(e.status).json(e)}$.invalid_login=!1,t.status(null!=(n=e.user)&&n.isAuthenticated?200:400).send()}),O.get("/api/user",rd(),async(e,t)=>{var n;const o=e.user;if(null==o||!o.isAuthenticated){if(!0===$.invalid_login){const e=Ld($);return t.status(e.status).json(e)}return t.status(401).json({error:"Not authenticated"})}if($.invalid_login=!1,!await Qp(o))return Tp(),t.status(403).json({error:"You have been logged out from this machine"});if(null==o||!o.claims)return t.status(400).json({error:"User claims not found"});if(null==o||!o.userInfo)return t.status(400).json({error:"User info not found"});const i=null==o||null==(n=o.claims)?void 0:n.organization_roles,a=null==o?void 0:o.userInfo.custom_data,s={authenticated:o.isAuthenticated,id:o.userInfo.sub,name:ad(o),email:o.claims.email||o.userInfo.email||"",profile_picture:o.userInfo.picture||"",default_org_id:(null==a?void 0:a.default_org)||"none",orgs:[]},r=["manage","owner","member","developer"];o.userInfo.organization_data&&(s.orgs=o.userInfo.organization_data.map(e=>{var t;const n={id:e.id,name:e.name,roles:(null==i?void 0:i.filter(t=>t.startsWith(e.id)).map(e=>e.split(":")[1]))||[],canWrite:!1};return n.canWrite=null==(t=n.roles)?void 0:t.some(e=>r.includes(e)),n}).sort((e,t)=>e.id===s.default_org_id?-1:t.id===s.default_org_id?1:e.name.localeCompare(t.name))),t.json(s)}),O.get("/api/license",rd(),async(t,n)=>{var o,i,a;const s=null==(o=t.query.token)?void 0:o.toString(),r=null==(i=t.query.org)?void 0:i.toString();let c=null;if(s)c={authToken:s};else{const e=await Gp();if(!e||!e.isAuthenticated)return n.status(401).json({error:"Not authenticated",code:"not_authenticated"});if(!await Qp(e))return Tp(),n.status(403).json({error:"Invalid login"});c=await sd(e,r||null).catch(e=>({status:500,error:e.message}))}if(!c)return n.status(500).json({error:"Failed to fetch licenses (Missing auth)"});if("error"in c)return n.status(c.status).json({error:c.error});const l=Fe(c),p=null==(a=t.query.integration)?void 0:a.toLocaleString(),u={...l,"x-needle":"cli","x-needle-integration":null!=p&&p.length?p:"unknown"},d=await e(`https://cloud.needle.tools/api${Le.account.get_licenses}`,{method:"GET",headers:u}).catch(e=>{const t=Ud(e);return console.error("Failed to fetch licenses:",t),ql(`Failed to fetch licenses: "${t}" - is https://cloud.needle.tools/api reachable?`),null});if(!d)return n.status(502).json({error:"Failed to fetch licenses: upstream API unreachable"});if(d.ok){const e=await d.json();return void 0===e.can_use_editor&&(e.can_use_editor=!0),n.json(e)}return n.status(d.status).json({error:d.statusText})}),O.get("/api/deployments",rd(),async(e,t)=>{var n;const o=await Gp();if(!o||!o.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const i=null==(n=e.query.org)?void 0:n.toString(),a=await sd(o,i).catch(e=>({status:500,error:e.message}));if("error"in a)return t.status(a.status).json({error:a.error});if(i&&!a.org)return t.status(400).json({error:"Organization not found"});const s=await Yl({endpoint:"https://cloud.needle.tools/api",authToken:a.authToken,org:a.org||void 0,limit:20,offset:0,names:void 0}).catch(e=>(console.error("List Deployments error: "+e.message),{status:502,error:"Failed to list deployments: upstream API unreachable"}));if("error"in s)return t.status(s.status).json({error:s.error});for(const e of s.deployments)e.editUrl=`${Sl()}/${e.id}`;const r={...s};return t.json(r)}),O.get(c,rd(),async(e,t)=>{var n,o,i,a,s,r,c,l;const p=await Gp();if(!p||!p.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const u=(null==(n=e.query.org)?void 0:n.toString())||(null==(o=p.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,d=await sd(p,u).catch(e=>({status:500,error:e.message}));if("error"in d)return t.status(d.status).json({error:d.error});const m={content_type:(null==(i=e.query.content_type)?void 0:i.toString())||void 0,content_format:(null==(a=e.query.content_format)?void 0:a.toString())||void 0,search:(null==(s=e.query.search)?void 0:s.toString())||void 0,tags:(null==(r=e.query.tags)?void 0:r.toString())||void 0,types:(null==(c=e.query.types)?void 0:c.toString())||void 0,trash:"true"===e.query.trash||void 0,collection_id:(null==(l=e.query.collection_id)?void 0:l.toString())||void 0,limit:e.query.limit?parseInt(e.query.limit.toString()):void 0,page:e.query.page?parseInt(e.query.page.toString()):void 0,offset:e.query.offset?parseInt(e.query.offset.toString()):void 0},f=await cl({baseUrl:"https://cloud.needle.tools/api",authToken:d.authToken,org:d.org||void 0},m).catch(e=>(console.error("List content error: "+e.message),{status:502,error:"Failed to list content: upstream API unreachable"}));return"error"in f?t.status(f.status).json({error:f.error}):t.json(f)}),O.get(c+"/:identifier",rd(),async(e,t)=>{var n,o;const i=await Gp();if(!i||!i.isAuthenticated)return t.status(401).json({error:"Not authenticated"});const a=(null==(n=e.query.org)?void 0:n.toString())||(null==(o=i.userInfo)||null==(o=o.custom_data)?void 0:o.default_org)||void 0,s=await sd(i,a).catch(e=>({status:500,error:e.message}));if("error"in s)return t.status(s.status).json({error:s.error});const r=await ll({baseUrl:"https://cloud.needle.tools/api",authToken:s.authToken,org:s.org||void 0},e.params.identifier).catch(e=>(console.error("Get content error: "+e.message),{status:502,error:"Failed to get content: upstream API unreachable"}));return"error"in r?t.status(r.status).json({error:r.error}):t.json(r)}),O.get(s,rd(),async(t,n)=>{const o=await Gp();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i=`https://cloud.needle.tools/api${Le.local_projects.get.user}`,a=await e(i,{method:"GET",headers:{Authorization:`Bearer ${o.accessToken}`}}).catch(e=>(console.error("Failed to fetch projects:",Ud(e)),null));if(!a)return n.status(502).json({error:"Failed to fetch projects: upstream API unreachable"});if(!a.ok)return n.status(a.status).json({error:a.statusText});const s=await a.json().catch(e=>console.error(e));return n.json(s)}),O.get(s+"/:id",rd(),async(t,n)=>{var o;const i=await Gp();if(!i||!i.isAuthenticated)return n.status(401).json({error:"Not authenticated"});let a=null==(o=t.query.org)?void 0:o.toString();const s=await sd(i,a).catch(e=>({status:500,error:e.message}));if(!s)return n.status(500).json({error:"Failed to fetch projects"});if("error"in s)return n.status(s.status).json({error:s.error});const r=Fe(s),c=`https://cloud.needle.tools/api${Le.local_projects.get.by_id}${encodeURIComponent(t.params.id)}`,l=await e(c,{method:"GET",headers:{...r}}).catch(e=>(console.error("Failed to fetch project:",Ud(e)),null));if(!l)return n.status(502).json({error:"Failed to fetch project: upstream API unreachable. Please try again later or contact hi@needle.tools"});if(!l.ok)return n.status(l.status).json({error:l.statusText});const p=await l.json().catch(e=>(console.error(e),null));return p?n.json(p):n.status(500).json({error:"Failed to parse data. Please try again later or contact hi@needle.tools"})}),O.post("/api/projects",rd(),async(t,n)=>{const o=await Gp();if(!o||!o.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const i="string"==typeof t.body?JSON.parse(t.body):t.body,a={machine_id:await eu(),project_id:i.project_id,project_name:i.project_name,scene_name:i.scene_name,web_project_path:i.web_project_path,editor_name:i.editor_name,editor_version:i.editor_version};if(!a.project_id||!a.project_name)return n.status(400).json({error:"Invalid request"});const s=`https://cloud.needle.tools/api${Le.local_projects.post}`,r=await e(s,{method:"POST",headers:{Authorization:`Bearer ${o.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(a)}).catch(e=>(console.error("Failed to upsert project:",Ud(e)),null));return r?r.ok?n.send("OK"):n.status(r.status).json({error:r.statusText}):n.status(502).json({error:"Failed to upsert project: upstream API unreachable"})}),O.get("/api/public_key",rd(),async(t,n)=>{var o,i;const a=await Gp();if(!a||!a.isAuthenticated)return n.status(401).json({error:"Not authenticated"});const s=null==(o=t.query.org)?void 0:o.toString(),r=await sd(a,s).catch(e=>({error:e.message,status:500}));if(!r)return n.status(500).json({error:"Failed to fetch public key"});if("error"in r)return n.status(r.status).json({error:r.error});const c={project_id:(null==(i=t.query.project_id)?void 0:i.toString())||void 0,machine_id:await eu()},l=await e(`https://cloud.needle.tools/api${Le.account.public_key}`,{method:"POST",headers:{...Fe(r),"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(e=>(console.error("Failed to fetch public key:",Ud(e)),null));if(!l)return n.status(502).json({error:"Failed to fetch public key: upstream API unreachable"});if(l.ok){const e=await l.json().catch(console.error);return null!=e&&e.public_key?n.json(e):n.status(500).json({error:"Failed to fetch public key"})}return n.status(l.status).json({error:l.statusText})}),O.get("/api/local_project_id",async(e,t)=>{const n=e.query.paths;if(!n)return t.status(400).json({error:"Missing paths"});let o=[];"string"==typeof n?o=n.split(",").map(e=>e.trim()).filter(e=>e.length>0):Array.isArray(n)&&(o=n.map(e=>e.toString().trim()).filter(e=>e.length>0));const i=wd(o);return i?t.json({project_id:i}):t.status(404).json({error:"Project ID not found"})}),O.post("/api/project/info",rd(),async(e,t)=>{(function(e){try{!function(e){var t,n,o,i;const a={last_accessed:Date.now(),editor:null!=(t=e.scene_path)&&t.endsWith(".unity")?"unity":null!=(n=e.scene_path)&&n.endsWith(".blend")?"blender":"unknown",editor_version:e.editor_version,editor_installation_path:e.editor_installation_path,log_location:e.editor_log_path,project_location:e.unity_project_path||e.blender_project_path||e.scene_path,scene_location:e.scene_path,web_location:e.web_project_path,needle_engine_integration_location:e.needle_sourcecode_location},s=su();let r=ru();const c=r.entries.findIndex(e=>e.project_location===a.project_location),l=null==(o=r.entries[0])?void 0:o.project_location;-1!==c?r.entries[c]=a:r.entries.push(a),r.entries.sort((e,t)=>t.last_accessed-e.last_accessed),r.entries.length>30&&(r.entries=r.entries.slice(0,30));const p=null==(i=r.entries[0])?void 0:i.project_location;p&&p!==l&&ql(`Active project changed: ${l||"(none)"} → ${p}`);try{ou=r;const e=JSON.stringify(r);m(s,e,"utf-8")}catch(e){console.error("Failed to save project info:",e)}}(e)}catch(e){ql("Error saving project info: "+e)}})("string"==typeof e.body?JSON.parse(e.body):e.body),t.send("OK")});let q=null;const B=new Promise(e=>q=e);let M=!1;if(j=O.listen(ep,()=>{null==q||q()}),j.on("error",e=>{if("EADDRINUSE"===(null==e?void 0:e.code))return ql(`License server port ${ep} already in use — a server is already running; not starting a second one.`),M=!0,l.isHost=!1,void(null==q||q());console.error("[needle] License server failed to start:",(null==e?void 0:e.message)||e),ql(`License server failed to start: ${(null==e?void 0:e.message)||e}`),process.exit(1)}),function(e,t){e.on("connection",e=>{const n=e.remoteAddress;if(!function(e){if(!e)return!1;const t=e.includes("%")?e.slice(0,e.indexOf("%")):e;return"127.0.0.1"===t||"::1"===t||"::ffff:127.0.0.1"===t}(n)){try{null==t||t(`Local server: rejected non-loopback connection from ${n||"unknown"}`)}catch{}e.destroy()}})}(j,ql),j.on("close",d),process.on("exit",d),process.on("SIGINT",()=>{d(),process.exit(0)}),await B.catch(e=>{console.error(e),ql(`Error starting the auth server (promise failed): ${e.message}`)}),M)return l;function d(){ql("Cleaning up auth server...")}(function(e,t){const n=new be({server:e,path:"/mcp/ws",verifyClient:({req:e},t)=>{var n;const o=null==(n=e.headers)?void 0:n.origin;if(o&&!Rd(o))return ql(`${Ad} rejected WS upgrade: disallowed origin ${o}`),void t(!1,403,"Forbidden: origin not allowed");t(!0)}});ql("MCP websocket server created.");let o=0,i=new Map;n.on("connection",e=>{const t=++o;Cd.push(e),console.log(`${Ad} client connected (#${t})`),ql(`${Ad} client connected (#${t})`),e.on("close",()=>{const n=Cd.indexOf(e);-1!==n&&Cd.splice(n,1);const o=i.get(t);if(o){for(const e of o)hu(e,Ed);i.delete(t)}console.log(`${Ad} client disconnected (#${t})`),ql(`${Ad} client disconnected (#${t})`)});const n=new Map;e.on("message",o=>{try{const a=o.toString(),s=JSON.parse(a);switch(s.command){default:console.log(`${Ad} Unknown command: ${s.command}`),ql(`Unknown MCP websocket command received: ${s.command}`);break;case"get_connected_clients":!function(t,n){const o={clients:[...bd()],command:"mcp_server_response",messageId:"messageId"in t?t.messageId:void 0};e.send(JSON.stringify(o))}(s);break;case"register_tools":{const o=s.tools,a=s.source;a&&function(e,t){const n=fu.get(e);if(n&&n.size>0){console.log(`[MCP] Removing ${n.size} tools registered from ${e}`);let o=!1;for(const t of n){const n=du.findIndex(e=>e.name===t);-1!==n&&(du.splice(n,1),delete mu[t],vu.set(t,e),o=!0)}fu.delete(e),o&&t()}}(a,Ed);const r=a||"unknown";console.log(`${Ad} ${r} registered ${o.length} tool${1===o.length?"":"s"}`),ql(`${Ad} ${r} registered ${o.length} tool${1===o.length?"":"s"}`);const c=i.get(t)||new Set;i.set(t,c);for(const t of o)c.add(t.name),gu(t,async o=>{console.log(`Tool ${t.name} executed via WebSocket with args:`,o);const i=`${t.name}-${Date.now()}-${Math.random()}`;return await new Promise((a,s)=>{const r=setTimeout(()=>{n.has(i)&&(console.error(`${Ad} Tool execution timed out for tool: ${t.name}`),n.delete(i),s(new Error(`Tool execution timed out for tool: ${t.name}`)))},3e4);n.set(i,{resolve:e=>{a(e),clearTimeout(r)},reject:s}),e.send(JSON.stringify({command:"execute_tool",toolName:t.name,args:o,requestId:i}))})},{source:a},Ed);break}case"tool_result":{const e=s.requestId,t=s.result;if(console.log(`${Ad} Received tool result for requestId: ${e}`,t),n.has(e)){const o=n.get(e);null==o||o.resolve(t),n.delete(e)}else console.error(`${Ad} No pending tool execution found for requestId: ${e}`);break}}}catch(e){console.error(`${Ad} Error processing WebSocket message:`,e)}})})})(j),$u({logToolCount:!0}),Qu();const W=Fu(R,()=>{Lu()?(ql("Settings changed: remote_ai_tools disabled — closing cloud connection"),ed("remote_ai_tools setting disabled")):(ql("Settings changed: remote_ai_tools enabled — opening cloud connection"),Qu())});process.on("exit",()=>{W(),ed("process exit")})}return l}function Ld(e){let t="";return t=e.error?e.error:e.logged_in_machine_names.length>0?`You're already authenticated on ${e.logged_in_machine_names.length} other machine(s)${e.user_email?` with ${e.user_email}`:""}. Please logout from other machines first on ${kl()}. You're currently logged in on: ${e.logged_in_machine_names.join(", ")}`:"An unknown error occured.",{status:403,error:t}}async function Fd(e={headless:!1,silent:!1,clearAuthData:!1}){return!0===e.clearAuthData&&await Tp(),qd("sign-in",{...e})}function Dd(e={}){return qd("sign-out",{...e})}function qd(t,n){return new Promise(async(o,i)=>{let a=!1;if("sign-in"==t){const e=await Gp();if(null!=e&&e.isAuthenticated&&e.accessToken)return await nu(e)?(a=!0,n.ora&&(n.ora.text=`Authorized as ${ad(e)}`),"gotoAccountPage"in n&&!0===n.gotoAccountPage&&(n.ora&&(n.ora.text="Opening account page in the browser"),jl(kl()),await new Promise(e=>setTimeout(e,2e3))),o(e)):o(null);if(!0===n.headless)return o(null)}else if("sign-out"==t&&!0===n.headless){a=!0,Tp();const t=await zd(),n=await e(t.auth_endpoints["sign-out"],{follow:2});return o(n.ok)}const s=await zd();switch(n.timeout||(n.timeout=6e5),"number"==typeof n.timeout&&n.timeout>0&&setTimeout(()=>{a||(n.ora&&n.ora.fail('Timeout "'+t+'"'),o(null))},n.timeout),t){case"sign-in":const e=s.auth_endpoints["sign-in"];setTimeout(()=>jl(e),300),n.ora&&(n.ora.text=`Please authenticate in the browser: ${e}`),setTimeout(l,2e3);break;case"sign-out":Tp(),jl(s.auth_endpoints["sign-out"]),setTimeout(l,2e3)}let r=0;const c=10;function l(){e(s.auth_endpoints["is-authenticated"]).then(async e=>{if(200===e.status||400===e.status||403===e.status)switch(t){case"sign-in":if(200===e.status){const e=await Gp();return e&&!await nu(e)?o(null):(a=!0,n.ora&&e&&(n.ora.text="User is authenticated"),o(e))}if(403===e.status){n.ora&&n.ora.fail("Authentication failed");const t=await e.text();if(t.startsWith("{")){const e=JSON.parse(t);if("logged_in_machine_names"in e&&Array.isArray(e.logged_in_machine_names)){const t=e.logged_in_machine_names;j().fail(`You're already authenticated on ${t.length} other machine(s). Please logout from other machines first. You're currently logged in on: ${t.join(", ")}`)}}return o(null)}break;case"sign-out":if(400===e.status)return a=!0,Tp(),n.ora&&(n.ora.text="User is signed-out"),o(!0)}else if(r++,r>c)return n.ora?n.ora.fail(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`):n.silent||console.error(`Failed to complete auth flow. Please try again. Make sure that port ${s.port} is not blocked`),o(null);setTimeout(l,1e3)}).catch(e=>{r>=10&&console.debug("Error polling auth status: "+e.message)})}})}const Bd=/token|secret|password|authorization|api[-_]?key|access[-_]?key|private[-_]?key|client[-_]?secret/i;function Md(e,t){return async function(n){const o=function(e,t){const n=[];if(e&&Object.keys(e).length>0&&n.push(`args=${Wd(e)}`),t&&Object.keys(t).length>0){const e=Object.fromEntries(Object.entries(t).map(([e,t])=>Bd.test(e)?[e,"<redacted>"]:[e,t]));n.push(`options=${Wd(e)}`)}return n.join(" ")}(null==n?void 0:n.args,null==n?void 0:n.options);ql(`CLI action: ${e}${o?" "+o:""}`);const i=Date.now();try{const o=await t(n);return ql(`CLI action: ${e} succeeded in ${Date.now()-i}ms`),o}catch(t){const n=t instanceof Error?t.message:String(t);throw Dl(`CLI action: ${e} failed in ${Date.now()-i}ms: ${n}`),t}}}function Wd(e){try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():"function"==typeof t?"<fn>":t)}catch{return"<unserializable>"}}globalThis.fetch||(globalThis.fetch=e),globalThis.File||(globalThis.File=t),globalThis.crypto||(globalThis.crypto=n.webcrypto),function(e={}){var t,n,o;const i=null!=(t=e.proc)?t:process,a=null!=(n=e.log)?n:Dl,s=null!=(o=e.error)?o:e=>console.error(e),r=(e,t)=>{const n=t instanceof Error&&t.message||String(t);try{const o=t instanceof Error&&t.stack?`\n${t.stack}`:"";a(`CLI crashed (${e}): ${n}${o}`)}catch{}try{s(`error: ${n}`)}catch{}try{i.exit(1)}catch{}};i.on("unhandledRejection",e=>r("unhandled rejection",e)),i.on("uncaughtException",e=>r("uncaught exception",e))}();const Gd=process.argv.includes("--silent"),Hd=JSON.parse(l(new URL("../package.json",import.meta.url),"utf-8")),Jd="The access token to use. Use the login command or get a token from https://cloud.needle.tools. You can pass the access token with your command or set the environment variable NEEDLE_CLOUD_TOKEN";async function Vd(e,t=null,n=!0){let o,i=null==e?void 0:e.toString();var a;if(i||(de.config(),process.env.NEEDLE_CLOUD_TOKEN&&(i=process.env.NEEDLE_CLOUD_TOKEN,null!=(a=i)&&a.length&&console.log("Using NEEDLE_CLOUD_TOKEN token from env"))),""===i||"true"===i){const e=(await import("node:readline")).createInterface({input:process.stdin}),t=10;let n,i="",a=!1;return new Promise(s=>{const r="Paste your https://cloud.needle.tools/team#token access token here:",c=j({text:r,interval:200,spinner:"moon"}).start();process.stdin.setRawMode(!0),process.stdin.on("data",l=>{const p=l.toString();""===p&&process.exit();const u="\n"===p||"\r"===p;if(!u&&"\n"!==p&&"\r"!==p){""===p||"\b"===p?i=i.slice(0,-1):i+=p;const e=i.replace(/./g,"*");c.text=`${r} ${e}`}clearTimeout(n),n=setTimeout(()=>{if(!a&&(u||i.trim().length>t)){process.stdin.setRawMode(!1),e.close(),a=!0;const t=i.trim();if(t.length>0){const e=t.slice(3,-3).replace(/./g,"*");c.succeed("Access token received: "+e)}else c.fail("No access token provided");s({accessToken:t,org_id:o})}},150)})})}if(!i){let e;await async function(){const e=await Gp();return null==e?void 0:e.isAuthenticated}()||(e=Gd?void 0:j("No access token found. Please sign in to authenticate...").start()),ql("No access token provided, attempting login. Org: "+t);const a=Fd({headless:!n,ora:e,timeout:12e4}),d=await a;var s;if(d&&!await Qp(d)?(null==(s=e)||s.fail("You are not logged in from this machine. Please login again."),await Dd({headless:!0}),process.exit(1)):e&&(ql("User logged in via getAccessToken "+(null==d?void 0:d.isAuthenticated)),d?e.succeed("Logged in"):e.fail("Login failed")),null!=d&&d.isAuthenticated){var r;if(null==t){const e=await Hp(d);"string"==typeof e&&(t=e)}else t===(null==(r=d.userInfo)?void 0:r.sub)&&(t=null);if(t){var c,l,p;if(o=null==(c=d.userInfo)||null==(c=c.organization_data)||null==(c=c.find(e=>e.id===t))?void 0:c.id,o||(t=null==(l=t.toString())?void 0:l.toLowerCase(),null!=o||(o=null==(p=d.userInfo)||null==(p=p.organization_data)||null==(p=p.find(e=>e.name.toLowerCase()===t))?void 0:p.id)),!o)throw new Error(`ERR: You (${ad(d)}) are not a member of the team "${t}" or the team does not exist. Please check the team name/id and try again.`);i=await(null==d?void 0:d.client.getOrganizationToken(o)),ql("Getting access token for org "+o+", "+i.substring(0,8)+"...")}else{var u;ql("Getting access token for user "+(null==(u=d.userInfo)?void 0:u.sub)),i=null==d?void 0:d.accessToken}}}return i||(console.error("ERR: Missing NEEDLE_CLOUD_TOKEN token. Please provide the access token argument or set the environment variable NEEDLE_CLOUD_TOKEN. Get an access token for your team at https://cloud.needle.tools/team"),ql("ERR: Missing NEEDLE_CLOUD_TOKEN token. Org: "+o),process.exit(403)),{accessToken:i,org_id:o}}function Kd(e){return null!=e.org&&console.warn("Warning: --org is deprecated. Use --team instead."),e.team||e.org}const Yd=ze.program;async function Zd(){const{spawn:e}=await import("node:child_process");e(process.execPath,[process.argv[1],"start","--integration","cli-login"],{stdio:"inherit",env:{...process.env,NEEDLE_CLOUD_TOKEN:process.env.NEEDLE_CLOUD_TOKEN||""}}),await new Promise(e=>setTimeout(e,1e3))}Yd.version(Hd.version).description("Command-line interface (CLI) for Needle Cloud"),Yd.command("version","Print the CLI version").configure({visible:!1}).action(()=>{Gd||console.log(`☁ Needle CLI — ${Hd.version}, Node ${process.version}`)}),Yd.command("start","Starts the Needle Auth server").alias("start-server").configure({visible:!1,strictOptions:!1}).help("Start the local server for Needle Cloud. This is required to authenticate with Needle Cloud and access your account and data.").option("--restart <restart>","Restarts the server",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--integration <integration>","Hint for the process which integration triggered this command",{required:!1,validator:Yd.STRING}).action(async({options:e})=>{const t=e.integration,n=Gd?void 0:j("Starting Needle License server "+(t?`(from ${t})`:"")).start();zd({ora:n,restart:e.restart}).catch(e=>{console.error("Failed to start server:",e),null==n||n.fail("Failed to start server: "+e.message),process.exit(1)}).then(e=>{null!=e&&e.baseUrl&&e.isHost?null==n||n.succeed(`Server started on ${e.baseUrl} (v${lu()}, built ${function(e){if("string"!=typeof Nd||0===Nd.length)return"unknown";const t=new Date(Nd);if(Number.isNaN(t.getTime()))return"unknown";const n=e=>String(e).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}()})`):!1===(null==e?void 0:e.isHost)?(t||null==n||n.warn(`Server is running on ${e.baseUrl||e.port}`),process.exit(0)):(null==n||n.fail("Failed to start server"),process.exit(1))})}),Yd.command("settings","Show current Needle CLI settings").action(async()=>{const{readSettings:e,KNOWN_SETTINGS:t}=await Promise.resolve().then(function(){return Du}),n=e();for(const[e,o]of Object.entries(t)){const t=n[e],i=void 0!==t?String(t):o.default;console.log(`\n ${"enabled"===i?"[x]":"[ ]"} ${o.displayName}: ${i}${void 0===t?" (default)":""}`),console.log(` ${o.description}`),console.log(` Change: ${o.command}`)}console.log("")}),Yd.command("settings remote-ai-tools","Enable or disable cloud AI tool dispatch to this machine").help("When disabled, the CLI does NOT connect to the Needle Cloud AI tool dispatcher (wss://cloud.needle.tools/v1/cli/ws), so cloud-side AI chats cannot invoke tools (file reads, grep, etc.) on this machine. The local /mcp/ws endpoint used by Unity/Blender stays available. Setting persists in ~/.needle/settings.json.").argument("<enabled>","true to enable, false to disable",{validator:Yd.BOOLEAN}).action(Md("settings remote-ai-tools",async({args:e})=>{const{writeSetting:t,defaultSettingsDir:n}=await Promise.resolve().then(function(){return Du}),o=e.enabled,i=n();o?(t(i,"remote_ai_tools",null),console.log("Remote AI tools enabled (default)."),ql("Settings: remote_ai_tools set to enabled (default) via CLI command")):(t(i,"remote_ai_tools","disabled"),console.log("Remote AI tools disabled. The cloud AI chat will not be able to dispatch tools to this machine."),ql("Settings: remote_ai_tools set to disabled via CLI command"))})),Yd.command("mcp","Start MCP server for AI agents (stdio transport)").help('Start the Needle Cloud MCP server using stdio transport.\nThis is the standard way to connect AI agents (Claude Desktop, Cursor, VS Code, etc.).\n\nAdd to your MCP client config:\n{\n "mcpServers": {\n "needle": {\n "command": "npx",\n "args": ["-y", "needle-cloud", "mcp"]\n }\n }\n}').action(Md("mcp",async()=>{const{startStdio:e}=await Promise.resolve().then(function(){return jd});e()})),Yd.command("get-project-id","Gets the project id for a local project").configure({visible:!1,strictOptions:!1}).argument("<paths...>","The path to the local project (web project directory)").action(async({args:e})=>{const t=wd(e.paths);t?console.log(`Found project ID: "${t}"`):console.log("No project ID found.")}),Yd.command("send-logs","Upload CLI, editor, and optimization-pipeline logs to Needle (secrets and sensitive info redacted)").help("Stream the current and previous CLI log, the most recent editor log (Unity or Blender), and the optimization-pipeline log to Needle for support diagnosis. Before upload, tokens, Bearer/Authorization values, UUIDs, home-directory paths, email addresses, Username/User fields, and *_KEY / *_TOKEN / *_SECRET / *_PASSWORD env-var values are redacted (replaced with <redacted:Nch> so the length is preserved for debugging). Returns a reference ID to paste into your bug report. Requires sign-in; the upload is tagged with your Needle account.").option("--crash <crash>","Mark this upload as a crash report (uses the crash-mode daily quota)",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--note <note>","One-line note attached to the upload",{required:!1}).option("--dry-run <dryRun>","Print the redacted payload without uploading",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("send-logs",async({options:e})=>{var t,n,o,i,a,s,r;const{runSendLogs:c,HAYSTACK_RESOURCE:l}=await Promise.resolve().then(function(){return wp}),{tryGetFreshAccessTokenForResource:p}=await Promise.resolve().then(function(){return Kp}),{findActiveEditorLog:u}=await import("./cli.send-logs.discovery-09ad5542.js"),{getLogFilePath:d,getPrevLogsFilePath:m,getPipelineLogFilePath:f}=await Promise.resolve().then(function(){return Bl}),{homedir:h,platform:g}=await import("os"),{existsSync:v}=await import("fs"),{BUILD_TIME:x}=await Promise.resolve().then(function(){return Pd}),{getNodeVersion:b,getNpmVersion:y,getArch:w,getOsRelease:_,getCpuCount:k,getTotalMemoryMb:S,getTzOffsetMinutes:T,isCi:E,isTty:$}=await import("./cli.runtime-465aa7a3.js"),O=null!=(t=null!=(n=null==(o=e.crash)||null==o.valueOf?void 0:o.valueOf())?n:e.crash)&&t?"crash":"normal",R=e.note,A=null!=(i=null!=(a=null==(s=e.dryRun)||null==s.valueOf?void 0:s.valueOf())?a:e.dryRun)&&i,C=d(),N=m(),P=f(),I={getAccessToken:()=>p(l),fetch:globalThis.fetch,paths:{cliLogPath:v(C)?C:null,prevLogPath:v(N)?N:null,pipelineLogPath:v(P)?P:null,homeDir:h()},meta:{cli_version:lu(),build_time:x,os:g(),os_release:_(),arch:w(),node_version:b(),npm_version:null!=(r=y())?r:"unknown",cpu_count:k(),total_memory_mb:S(),tz_offset_minutes:T(),is_ci:E(),is_tty:$()},findActiveEditorLog:u,stdout:process.stdout,stderr:process.stderr},U=A?"Building payload (dry-run)":"Uploading logs",z=Gd?void 0:j(U).start();I.recoverAuth=async()=>{null==z||z.stop();try{await Zd();const e=await Fd({clearAuthData:!0,silent:Gd,ora:void 0});if(null==e||!e.isAuthenticated)return null}catch(e){return ql(`send-logs: auto-recovery login failed: ${e instanceof Error?e.message:e}`),null}finally{null==z||z.start(U)}return await p(l)};const L=await c({mode:O,note:R,dryRun:A},I);L.ok?A?null==z||z.succeed("Dry-run payload printed above. Nothing was uploaded."):L.truncated?(null==z||z.warn(`Uploaded (truncated at server cap). Reference: ${L.refId}`),console.log(`Share ${L.refId} in your bug report.`)):(null==z||z.succeed(`Uploaded. Reference: ${L.refId}`),console.log(`Share ${L.refId} in your bug report.`)):(null==z||z.fail(L.error||"Upload failed"),process.exitCode=1)})),Yd.command("login","Login to Needle Cloud").help("Login to Needle Cloud. If you are already logged in, this will refresh the access token.").option("--headless <headless>","The headless process will not open a browser window to login. If the user is not authorized then no auth flow can be started. Use this if you only want to **check** if the user is authenticated",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--clear <clear>","Refresh the access token",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(async({options:e})=>{await Zd();const t=e.headless.valueOf()||!1,n=e.clear.valueOf()||!1,o=Gd?void 0:j("Login").start();await Fd({headless:t,silent:Gd,clearAuthData:n,ora:o}).then(async e=>{null!=e&&e.isAuthenticated?null==o||o.succeed("Successfully logged in as "+ad(e)):0==t?null!=e&&e.claims||null!=e&&e.userInfo?null==o||o.warn(`You (${ad(e)}) are not authenticated...`):null==o||o.fail("Login failed"):Gd||null==o||o.warn("Not logged in"),process.exit(null!=e&&e.isAuthenticated?0:1)})}),Yd.command("logout","Logout of Needle Cloud").help("Logout of Needle Cloud (if you have logged in before).").option("--headless <headless>","Headless will not open a browser window to logout",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(async({options:e})=>{await Zd();const t=e.headless.valueOf()||!1;await Dd({headless:t}).then(e=>{e?j("Logged out").succeed():j("Logout failed").fail(),process.exit(e?0:1)})}),Yd.command("me","Prints your user information").help("Prints basic informaton about the logged in Needle Cloud account (your account)").action(async({})=>{const e=Gd?void 0:j("Query user data").start(),t=await Gp();if(null!=t&&t.isAuthenticated&&await Qp(t)){const a=t.userInfo||t.claims;var n,o,i;a?(null==e||e.succeed(`You are logged in as ${ad(t)}`),console.log(`- Name: ${ad(t)}`),console.log(`- ID: ${a.sub}`),a.email&&console.log(`- Email: ${a.email}`),a.phone_number&&console.log(`- Phone: ${a.phone_number}`),null!=(n=t.userInfo)&&n.organization_data&&console.log(`- Teams [${null==(o=t.userInfo)?void 0:o.organization_data.length}]: ${null==(i=t.userInfo)?void 0:i.organization_data.sort((e,t)=>e.name.localeCompare(t.name)).map(e=>e.name).join(", ")}`)):null==e||e.fail("Failed to get user data")}else null==e||e.warn("You are not logged in")}),Yd.command("get-pro","Start license flow for Needle Engine PRO").configure({visible:!1,strictArgsCount:!1,strictOptions:!1}).option("--team <team>","The team to purchase the license for",{validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{validator:Yd.STRING,hidden:!0}).action(Md("get-pro",async({options:e})=>{var t;let n=(null==(t=Kd(e))?void 0:t.toString())||null;const o=j().start("Start Needle Engine PRO purchase flow"),i=function(e){e=e||{};const t="undefined"!=typeof window?window.location:null;"current_page"===e.baseUrl&&(e.baseUrl=null==t?void 0:t.href);let n=e.pathname||(null==t?void 0:t.pathname),o=e.baseUrl||(null==t?void 0:t.href);if(!n||!o)return null;const i=new URL(n,o);return t&&(i.search=t.search),e.license||(e.license="needle-engine:pro"),i.searchParams.set("purchase_intent",e.license),e.account_id&&i.searchParams.set("account_id",e.account_id),e.return_url&&i.searchParams.set("return_url",e.return_url),e.checkout_if_possible&&i.searchParams.set("checkout_if_possible","true"),e.show_all_cards&&i.searchParams.set("show_all_cards","true"),e.affiliate_id&&i.searchParams.set("affiliate_id",e.affiliate_id),e.tracking_id&&i.searchParams.set("tracking_id",e.tracking_id),i}({baseUrl:"https://cloud.needle.tools",pathname:n?`/team/${n}`:"/account",account_id:n,license:"needle-engine:pro",return_url:null});if(!i)return void o.fail("Failed to get purchase url - please visit https://cloud.needle.tools");const a=i.toString();o.succeed(`Started Needle Engine PRO purchase flow: opening browser at ${a}`),jl(a)}));const Xd={account:{url:kl}},Qd=`"${Object.keys(Xd).join('", "')}"`;Yd.command("open",`Open a page in the default browser. Options are: ${Qd}`).argument("<page>",`The page to open. Options are: ${Qd}`,{validator:Yd.STRING}).configure({strictOptions:!1,strictArgsCount:!1,visible:!1}).help("").action(async({args:e,logger:t})=>{const n=e.page.toString(),o=Xd[n];o?"url"in o?jl(o.url()):t.error(`Unknown argument: ${n}`):t.error(`Unknown argument: ${n}. Options are: ${Qd}`)}),Yd.command("list-deployments","Get a list of deployed websites").configure({visible:!1}).help("").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).option("--limit <limit>","Limit the number of deployments to show (min: 0, max: 100)",{validator:Yd.NUMBER,default:10}).option("--offset <offset>","The offset for deployments (default: 0, min: 0)",{validator:Yd.NUMBER,default:0}).option("--format <format>","The output format. Options: cli (default), json",{validator:Yd.STRING,default:"cli",hidden:!0}).option("--name","Filter by one or multiple deployment names (separated by ;)",{validator:Yd.STRING}).action(async({options:e,logger:t})=>{var n,o,i;const{accessToken:a,org_id:s}=await Vd(e.token,Kd(e)),r=(null==(n=e.endpoint)?void 0:n.toString())||"https://cloud.needle.tools/api",c=e.limit.valueOf(),l=e.offset.valueOf(),p=(null==(o=e.format)?void 0:o.toString())||"cli",u=(null==(i=e.name)?void 0:i.toString())||void 0;if(c<0)return void t.error("The limit can not be negative");if(c>100)return void t.error("The limit can not be higher than 100");const d=j("Query deployments").start(),m=await Yl({endpoint:r,authToken:a,org:s,limit:c,offset:l,names:null==u?void 0:u.split(";")}).catch(e=>{t.error(e)});if(m&&"error"in m)d.fail(m.error+" (status: "+m.status+")");else if(m){if("json"===p){d.succeed(`Found ${m.deployments.length} deployments`);const e=JSON.stringify(m.deployments);return void console.log(e)}m.deployments.length>0?(d.succeed(`Found ${m.deployments.length} deployments`),m.deployments.forEach((e,n)=>{t.info(`${n+c*l}: ${e.name} – ${e.url}`)})):d.warn("No deployments found"),process.exit(0)}else d.fail("Failed to query deployments"),process.exit(1)}),Yd.command("list","List content items (3d assets, deployments, materials, etc.)").alias("list-content").help('List content items stored in Needle Cloud.\n\nUse --type to filter by content type (e.g. "material", "3d-asset", "deployment").\nUse --format to filter by output format (e.g. "glb", "textures").').option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).option("--type <type>","Filter by content type (e.g. material, 3d-asset, deployment)",{required:!1,validator:Yd.STRING}).option("--format <format>","Filter by output format (e.g. glb, textures)",{required:!1,validator:Yd.STRING}).option("--search <search>","Search by name, title or description",{required:!1,validator:Yd.STRING}).option("--limit <limit>","Max number of items to show (default: 20, max: 100)",{validator:Yd.NUMBER,default:20}).option("--offset <offset>","Offset for pagination (default: 0)",{validator:Yd.NUMBER,default:0}).option("--output <output>","Output style: cli (default), json",{validator:Yd.STRING,default:"cli"}).action(async({options:e,logger:t})=>{var n,o,i,a,s,r,c,l,p;const{accessToken:u,org_id:d}=await Vd(e.token,Kd(e)),m=(null==(n=e.endpoint)?void 0:n.toString())||"https://cloud.needle.tools/api",f=Math.min(null!=(o=null==(i=e.limit)?void 0:i.valueOf())?o:20,100),h=null!=(a=null==(s=e.offset)?void 0:s.valueOf())?a:0,g=(null==(r=e.output)?void 0:r.toString())||"cli",v=(null==(c=e.type)?void 0:c.toString())||void 0,x=(null==(l=e.format)?void 0:l.toString())||void 0,b=(null==(p=e.search)?void 0:p.toString())||void 0,y=j("Querying content...").start();try{const e=await cl({baseUrl:m,authToken:u,org:d},{content_type:v,content_format:x,search:b,limit:f,offset:h});if("json"===g)return y.succeed(`Found ${e.items.length} of ${e.total} items`),void console.log(JSON.stringify(e.items,null,2));0===e.items.length&&(y.warn("No content found"+(v?` (type: ${v})`:"")+(x?` (format: ${x})`:"")),process.exit(0)),y.succeed(`Found ${e.items.length} of ${e.total} items`);const n=e.items.map(e=>{var t;const n=e.title||"(untitled)";return{id:e.identifier,type:e.content_type||"?",formats:null!=(t=e.content_formats)&&t.length?e.content_formats.join(", "):"",name:n.length>20?n.slice(0,17)+"...":n,versions:String(e.version_count||0),date:e.created_at?Nc(new Date(e.created_at),new Date,{allowSimple:!0,limitInDays:2}):""}}),o={id:Math.max(2,...n.map(e=>e.id.length)),type:Math.max(4,...n.map(e=>e.type.length)),formats:Math.max(7,...n.map(e=>e.formats.length)),name:Math.max(4,...n.map(e=>e.name.length))},i=Ql(` ${"ID".padEnd(o.id)} ${"TYPE".padEnd(o.type)} ${"FORMATS".padEnd(o.formats)} ${"NAME".padEnd(o.name)} ${"#".padStart(3)} AGE`);t.info(i);for(const e of n){const n=Xl(e.type).padEnd(o.type+11),i=(e.formats?e.formats.split(", "):[]).map(e=>Xl(e)).join(", ")+" ".repeat(Math.max(0,o.formats-e.formats.length));t.info(` ${Ql(e.id.padEnd(o.id))} ${n} ${i} ${e.name.padEnd(o.name)} ${e.versions.padStart(3)} ${Ql(e.date)}`)}e.total>h+f&&t.info(` ... ${e.total-h-f} more (use --offset ${h+f})`),process.exit(0)}catch(e){y.fail(e.message),process.exit(1)}}),Yd.command("delete","Move a content item to the trash").help("Move a content item to the trash. This immediately frees total storage capacity but does not refund monthly usage. The item can be restored for 31 days if enough total storage is available.\n\nUsage:\n needle-cloud delete <identifier>").argument("<identifier>","Content item identifier",{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The Needle Cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).action(async({args:e,options:t})=>{var n;const{accessToken:o,org_id:i}=await Vd(t.token,Kd(t)),a=(null==(n=t.endpoint)?void 0:n.toString())||"https://cloud.needle.tools/api",s=e.identifier.toString(),r=j(`Deleting content "${s}"...`).start();try{const e=await Kl({identifier:s,endpoint:a,authToken:o,org:i});r.succeed(e.message||`Moved content "${s}" to the trash`),process.exit(0)}catch(e){r.fail(e.message),process.exit(1)}}),Yd.command("download","Download a content item by identifier").help('Download files from a content item.\n\nUse --format to select which output format to download (e.g. "glb", "textures").\n\nUsage:\n needle-cloud download <identifier> [directory]\n needle-cloud download abc123 --format glb').argument("<identifier>","Content item identifier",{validator:Yd.STRING}).argument("[directory]","Output directory (default: current directory)",{default:"."}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING}).option("--format <format>","Output format to download (e.g. glb, textures)",{required:!1,validator:Yd.STRING}).option("--name <name>","Output filename (without extension)",{required:!1,validator:Yd.STRING}).option("--verbose","Show detailed download info",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(async({args:e,options:t,logger:n})=>{var o,i,a,s,r,c;const{accessToken:l,org_id:p}=await Vd(t.token,Kd(t)),u=(null==(o=t.endpoint)?void 0:o.toString())||"https://cloud.needle.tools/api",d=e.identifier.toString(),m=(null==(i=e.directory)?void 0:i.toString())||".",f=(null==(a=t.name)?void 0:a.toString())||void 0,h=null!=(s=null==(r=t.verbose)?void 0:r.valueOf())&&s,g=(null==(c=t.format)?void 0:c.toString())||void 0,v=j("Looking up content...").start();try{var x;const e={baseUrl:u,authToken:l,org:p},t=await ll(e,d).catch(()=>null);if(!t)return void v.fail(`Content not found: "${d}". Use the exact content identifier (see list-content).`);const o=null==(x=t.versions)?void 0:x[0];if(!o)return void v.fail(`Content "${t.title||t.name}" has no versions`);let i=o.identifier;if(g){let e=!1;for(const n of t.versions){if(n.content_format===g){i=n.identifier,e=!0;break}const t=n.variants.find(e=>e.content_format===g);if(t){i=t.identifier,e=!0;break}}if(!e)return void v.fail(`No output with format "${g}" found for "${t.title||t.name}"`)}v.text=`Downloading "${t.title||t.name}"${g?` (format: ${g})`:""}...`,v.stop();const a=await Jl({baseUrl:u,authToken:l,org:p,identifier:i,outDir:m,filename:f,verbose:h,content_format:g});"error"in a&&n.error(a.error)}catch(e){v.fail(e.message)}}),Yd.command("deploy","Deploy a website to Needle").help("").argument("<directory>","The directory to deploy",{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to deploy to (not needed when using token/accesstoken)",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id to deloy to (not needed when using token/accesstoken)",{required:!1,validator:Yd.STRING,hidden:!0}).option("--name <name>","The project name. This name will also be used in your website URL",{required:!1,validator:Yd.STRING}).option("--entrypoint <entrypoint>",'The entrypoint file to use (e.g. "index.html"). This is useful if you want to deploy a folder with multiple HTML files and you want to configure which file to load initially or if you have multiple model files in one folder',{required:!1,validator:Yd.STRING,hidden:!0}).option("--endpoint <endpoint>","The needle cloud endpoint to use - e.g. https://cloud.needle.tools/api",{required:!1,validator:Yd.STRING,hidden:!0}).option("--open","Open the deployment in the default browser",{default:!0,validator:Yd.BOOLEAN}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Yd.BOOLEAN,default:!1,hidden:!0}).option("--experimental","Use the experimental upload API. Mostly used for debugging (default: false)",{required:!1,validator:Yd.BOOLEAN,default:!1,hidden:!0}).option("--raw","Use raw to disallow modifications like gzip compression on upload",{required:!1,validator:Yd.BOOLEAN,default:!1,hidden:!0}).option("--no-provenance","Do not record which commit and CI run this deployment came from",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("deploy",async({args:e,options:t,logger:n})=>{var o,i,a,s;const r=t.open,{accessToken:c,org_id:l}=await Vd(t.token,Kd(t)),p=t.verbose.valueOf(),u=t.experimental.valueOf()||!1,d=t.raw.valueOf()||!1,m=(null==(o=t.noProvenance)?void 0:o.valueOf())||!1;await Wl({logger:n,endpoint:(null==(i=t.endpoint)?void 0:i.toString())||void 0,token:c,org_id:l,directory:e.directory.toString(),name:(null==(a=t.name)?void 0:a.toString())||void 0,entrypoint:(null==(s=t.entrypoint)?void 0:s.toString())||void 0,open:r,verbose:p||!1,experimental:u||!1,raw:d||!1,noProvenance:m})})),Yd.command("upload","Upload files or a folder to Needle Cloud").help("Uploads your files and returns the link to manage them on Needle Cloud. Processing jobs (asset optimization and related derived formats) are scheduled automatically in the background — this command does not wait for them; use `optimize` to upload and wait for the optimized result. Use --no-optimize to store the files exactly as uploaded, with no jobs scheduled.").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Yd.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be uploaded",{validator:Yd.STRING}).option("--name <name>","The upload project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Yd.STRING}).option("--no-optimize","Do not schedule any processing jobs — store the files exactly as uploaded",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("upload",async({args:e,options:t})=>{var n,o,i;const a=(null==(n=t.verbose)?void 0:n.valueOf())||!1,{accessToken:s,org_id:r}=await Vd(t.token,Kd(t));if(s!=t.token){const e=await Gp();null!=e&&e.isAuthenticated?r||(j("Please provide an organization id to upload files...").fail(),process.exit(1)):(j("Please login to upload files...").fail(),process.exit(1))}const c=await async function(e){const t=await Hl({token:e.token,org_id:e.org_id,fileOrDirectory:e.fileOrDirectory,name:e.name,verbose:e.verbose},{optimizations:!e.noOptimize&&void 0});return"error"in t?t:(e.noOptimize&&j().info("No processing jobs were scheduled (--no-optimize)."),{success:!0,editUrl:t.editUrl})}({token:s,org_id:r,fileOrDirectory:e.path.toString(),name:(null==(o=t.name)?void 0:o.toString())||void 0,noOptimize:(null==(i=t.noOptimize)?void 0:i.valueOf())||!1,verbose:a}).catch(e=>{console.error(e),process.exit(1)});"error"in c&&(c.noprint||console.error(c.error),process.exit(1))})),Yd.command("optimize","Optimize glTF, GLB, VRM, FBX, USD files").help("").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to upload the file to",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id to upload the file to",{required:!1,validator:Yd.STRING,hidden:!0}).argument("<path>","The full path to a file or directory that should be optimized",{validator:Yd.STRING}).option("--outdir <outdir>","The output directory for the optimized file(s). If set your optimized asset files will automatically be downloaded to this directory.",{required:!1,validator:Yd.STRING}).option("--name <name>","The optimization project name / unique identifier. This can also be the view id of previous uploads.",{required:!1,validator:Yd.STRING}).option("--verbose <verbose>","Enables verbose output logs",{required:!1,validator:Yd.BOOLEAN,default:!1}).option("--progressive","Use Needle progressive loading",{required:!1,validator:Yd.BOOLEAN,default:!0}).option("--usecase <usecase>",'The use case for the optimization. This can be "product" (default) or "world".',{required:!1,validator:Yd.STRING,default:"product"}).action(Md("optimize",async({args:e,options:t,logger:n})=>{var o,i,a,s;const l=t.verbose.valueOf(),{accessToken:p,org_id:u}=await Vd(t.token,Kd(t));if(p!=t.token){const e=await Gp();null!=e&&e.isAuthenticated?u||(j("Please provide an organization id to optimize files...").fail(),process.exit(1)):(j("Please login to optimize files...").fail(),process.exit(1));const t=await async function(e,t){const n=e.baseUrl+Le.account.get_licenses,o={...{...t},...Fe(e)},i=await fetch(n,{...De,method:"GET",headers:o}).catch(e=>(console.error(e),null));return i?i.ok?(await i.json()).licenses:(console.error(i.statusText,await i.text()),[]):[]}({baseUrl:"https://cloud.needle.tools/api",authToken:p,org:u},{type:"org",org_id:u});(!t||t.length<=0||!t.find(e=>"Needle Engine"===e.type&&("pro"===e.license||"enterprise"===e.license)))&&(j("Update to Needle PRO or Enterprise required to optimize files via CLI. Visit https://cloud.needle.tools/get-pro").fail(),process.exit(1))}const d=(null==(o=t.progressive)?void 0:o.valueOf())||!0,m=(null==(i=t.usecase)?void 0:i.toString())||"product",f=await async function(e){if(e.outDir){var t;if((null==(t=e.outDir)?void 0:t.length)<=0){const e="Output Directory is invalid";return j().fail(e),{error:e}}if(r(e.outDir)&&c(e.outDir).isFile()){const e="The output directory is a file - it must be a directory";return j().fail(e),{error:e}}}const n=await Hl({token:e.token,org_id:e.org_id,fileOrDirectory:e.fileOrDirectory,name:e.name,verbose:e.verbose},{purposeLabel:"for optimization"});if("error"in n)return n;{const t=n.res,i="https://cloud.needle.tools/api",a=await async function(e,t={progressive:!0}){const n=e.baseUrl+Le.jobs.create,o={...Fe(e),"content-type":"application/json"},i={type:"optimization",job_id:e.id,triggered_by:e.trigger_type,parameters:{...t}},a=await fetch(n,{...De,method:"POST",headers:o,body:JSON.stringify(i)});if(!a.ok){const e=await a.text();return console.error(`Failed to request optimization (${a.status}): ${e} `),null}return await a.json().catch(e=>(console.error(e),null))}({baseUrl:i,authToken:e.token,org:e.org_id,id:t.id,trigger_type:"cli"},function(e){return e.progressive?{progressive:!0,usecase:e.usecase||"product"}:{progressive:!1}}(e));if(!a)return{error:"Failed to send optimization request"};if("error"in a){const e=`Failed to optimize: ${a.error}`;return console.error(e),{error:e}}{const t=a.job,n=j(`Optimization requested for ${t.name||t.identifier}`).start();let s=!1;n.color="gray";const r=Wr();for(;;){if("completed"===a.job.status){var o;s=!0,n.succeed(`${null!=(o=a.message)?o:"Optimization completed"}`);break}let c=2e3;const l=await Mr(t.identifier,{baseUrl:i,authToken:e.token,org:a.job.org}),p=r.record(l);if(p)return n.fail(p.reason),{error:p.reason};if("new"!==(null==l?void 0:l.status)&&"pending"!==(null==l?void 0:l.status)||(n.text="Your asset is queued - waiting for optimization to start",n.color="yellow",c=2e3),"running"===(null==l?void 0:l.status))n.text=`Your asset is being optimized: ${l.progress?`${l.progress}%`:""} ${l.status_message?`— ${l.status_message}`:""}`,n.color="cyan",c=1e3;else if("stalled"===(null==l?void 0:l.status))c=2500;else{if("completed"===(null==l?void 0:l.status)){s=!0,n.succeed(`Your asset has finished optimizing: ${l.status_message}`);break}if("canceled"===(null==l?void 0:l.status))return n.fail(`Optimization cancelled: ${l.error}`),{error:l.error||"Optimization cancelled"};if("failed"===(null==l?void 0:l.status))return n.fail(`Optimization failed: ${l.error}`),console.error(`Optimization failed: ${l.error}`),{error:l.error||"Optimization failed"}}await Cc(c)}if(s){if(e.outDir){const n=await Jl({baseUrl:i,authToken:e.token,org:e.org_id,identifier:t.identifier,outDir:e.outDir,verbose:e.verbose});if("error"in n)return{error:n.error}}else j().succeed(`Asset successfully optimized: https://cloud.needle.tools/edit/${t.content_id} (To download optimized files, use the --outdir option)`);return{success:!0}}}}return{error:"Unknown error"}}({logger:n,token:p,org_id:u,fileOrDirectory:e.path.toString(),name:(null==(a=t.name)?void 0:a.toString())||void 0,progressive:d,usecase:m,outDir:(null==(s=t.outdir)?void 0:s.toString())||void 0,verbose:l||!1}).catch(e=>{console.error(e),process.exit(1)});Array.isArray(f)?process.exit(0):"error"in f&&(f.noprint||console.error(f.error),process.exit(1))})),Yd.command("generate-material","Generate a PBR material from a text prompt").help("").argument("<prompt>","The text prompt describing the material to generate",{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Yd.STRING,hidden:!0}).option("--resolution <resolution>","The material texture resolution (256, 512, 1k, 2k, 4k)",{default:"512",required:!1,validator:Yd.STRING}).option("--name <name>","Output filename",{required:!1,validator:Yd.STRING}).option("--outdir <outdir>","Output directory to download the generated file(s) to. If not set, the job ID is printed instead.",{required:!1,validator:Yd.STRING}).action(Md("generate-material",async({args:e,options:t,logger:n})=>{var o,i,a;const{accessToken:s,org_id:r}=await Vd(t.token,Kd(t)),c=e.prompt.toString(),l=null==(o=t.resolution)?void 0:o.toString(),p=null==(i=t.outdir)?void 0:i.toString(),u=null==(a=t.name)?void 0:a.toString(),d=await async function(e){if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${kl()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const t="https://cloud.needle.tools/api";ql(`[generate-material] Starting request to ${t}, prompt="${e.prompt}", resolution=${e.resolution||512}`,{emptyLineBefore:!0});const n=j("Requesting material generation...").start(),o=await Promise.race([rl({baseUrl:t,authToken:e.token,org:e.org_id,trigger_type:"cli"},{prompt:e.prompt,resolution:e.resolution||512}).catch(e=>({error:e.message||"Request failed"})),new Promise(e=>setTimeout(()=>e({error:"Request timed out after 30s. Please try again."}),3e4))]);if("error"in o)return ql(`[generate-material] Request failed: ${o.error}`),n.fail(o.error),{error:o.error};const i=o.job;if(ql(`[generate-material] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return ql(`[generate-material] Job canceled: ${i.status_message||"quota exceeded"}`),n.fail(i.status_message||"Material generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};n.succeed(`Material generation requested: ${i.identifier}`);const a=j("Waiting for material generation...").start();a.color="gray";const s=Wr();for(;;){if("completed"===i.status){a.succeed("Material generation completed");break}let n=2e3;const o=await Mr(i.identifier,{baseUrl:t,authToken:e.token,org:i.org}),r=s.record(o);if(r)return a.fail(r.reason),{error:r.reason};if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your material is queued - waiting for generation to start",a.color="yellow",n=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating material: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",n=1e3;else{if("completed"===(null==o?void 0:o.status)){ql(`[generate-material] Job completed: ${i.identifier}`),a.succeed(`Material generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return ql(`[generate-material] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`Material generation canceled: ${o.error||""}`),{error:o.error||"Material generation canceled"};if("failed"===(null==o?void 0:o.status))return ql(`[generate-material] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`Material generation failed: ${o.error||""}`),{error:o.error||"Material generation failed"}}await Cc(n)}if(e.outDir){const n=await Jl({baseUrl:t,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in n)return{error:n.error}}return{success:!0,identifier:i.identifier}}({logger:n,token:s,org_id:r,prompt:c,resolution:l,outputName:u,outDir:p});"error"in d&&(d.error&&n.error(d.error),process.exit(1)),!p&&d.identifier&&console.log(d.identifier),process.exit(0)})),Yd.command("generate-3d","Generate a 3D model from a text prompt").help("").argument("<prompt>",'A description of the object to generate, e.g. "a weathered wooden crate with iron bands"',{validator:Yd.STRING}).option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id",{required:!1,validator:Yd.STRING}).option("--org <org>","The organization name or id",{required:!1,validator:Yd.STRING,hidden:!0}).option("--quality <quality>","Quality tier: standard (default, includes physically based material maps) or draft (faster and cheaper, base color only)",{default:"standard",required:!1,validator:Yd.STRING}).option("--face-count <faceCount>","Target polygon count (40000-1500000). Leave unset to let the generator choose.",{required:!1,validator:Yd.NUMBER}).option("--name <name>","Output filename",{required:!1,validator:Yd.STRING}).option("--outdir <outdir>","Output directory to download the generated file(s) to. If not set, the job ID is printed instead.",{required:!1,validator:Yd.STRING}).action(Md("generate-3d",async({args:e,options:t,logger:n})=>{var o,i,a;const{accessToken:s,org_id:r}=await Vd(t.token,Kd(t)),c=e.prompt.toString(),l=null==(o=t.quality)?void 0:o.toString(),p=null!=t.faceCount?Number(t.faceCount):void 0,u=null==(i=t.outdir)?void 0:i.toString(),d=null==(a=t.name)?void 0:a.toString(),m=await async function(e){if(!e.token||e.token.length<=1||"string"!=typeof e.token||"true"===e.token)return{error:`Missing access token. Create a token at ${kl()}`};if(!e.prompt||e.prompt.length<=0)return{error:"A prompt is required"};const t="https://cloud.needle.tools/api";ql(`[generate-3d] Starting request to ${t}, prompt="${e.prompt}", quality=${e.quality||"draft"}`,{emptyLineBefore:!0});const n=j("Requesting 3D generation...").start(),o=await async function(e,t){var n;if(null!=(n=e.signal)&&n.aborted)return{error:"The 3D generation request was cancelled"};const o=e.baseUrl+Le.jobs.create,i={...Fe(e),"content-type":"application/json"},a={type:"ai-3d-asset",triggered_by:e.trigger_type,parameters:{...t}},s=await fetch(o,{...De,method:"POST",headers:i,body:JSON.stringify(a),signal:e.signal}).catch(e=>function(e){return"AbortError"===(null==e?void 0:e.name)||"TimeoutError"===(null==e?void 0:e.name)}(e)?{__aborted:!0}:(console.error(`Failed to request 3D asset generation: ${null==e?void 0:e.message}`),{__failed:(null==e?void 0:e.message)||"Request failed"}));if("__aborted"in s)return{error:"The 3D generation request was cancelled"};if("__failed"in s)return{error:s.__failed};if(!s.ok){const e=await s.text();return console.error(`Failed to request 3D asset generation (${s.status}): ${e}`),{error:e||`Request failed (${s.status})`}}const r=await s.json().catch(e=>(console.error(e),null));return null!=r&&r.job?r:{error:"The server did not return a job"}}({baseUrl:t,authToken:e.token,org:e.org_id,trigger_type:"cli",signal:AbortSignal.timeout(3e4)},{prompt:e.prompt,...e.quality?{quality:e.quality}:{},...e.face_count?{face_count:e.face_count}:{}});if("error"in o)return ql(`[generate-3d] Request failed: ${o.error}`),n.fail(o.error),{error:o.error};const i=o.job;if(ql(`[generate-3d] Job created: ${i.identifier}, status=${i.status}`),"canceled"===i.status)return ql(`[generate-3d] Job canceled: ${i.status_message||"quota exceeded"}`),n.fail(i.status_message||"3D generation was canceled (quota exceeded)"),{error:i.status_message||"Quota exceeded"};n.succeed(`3D generation requested: ${i.identifier}`);const a=j("Waiting for the 3D model...").start();a.color="gray";const s=Wr();for(;;){if("completed"===i.status){a.succeed("3D generation completed");break}let n=2e3;const o=await Mr(i.identifier,{baseUrl:t,authToken:e.token,org:i.org}),r=s.record(o);if(r)return a.fail(r.reason),{error:r.reason};if("new"===(null==o?void 0:o.status)||"pending"===(null==o?void 0:o.status))a.text="Your model is queued - waiting for generation to start",a.color="yellow",n=2e3;else if("running"===(null==o?void 0:o.status))a.text=`Generating 3D model: ${o.progress?`${o.progress}%`:""} ${o.status_message?`— ${o.status_message}`:""}`,a.color="cyan",n=1e3;else{if("completed"===(null==o?void 0:o.status)){ql(`[generate-3d] Job completed: ${i.identifier}`),a.succeed(`3D generation completed: ${o.status_message||""}`);break}if("canceled"===(null==o?void 0:o.status))return ql(`[generate-3d] Job canceled: ${i.identifier}, error=${o.error}`),a.fail(`3D generation canceled: ${o.error||""}`),{error:o.error||"3D generation canceled"};if("failed"===(null==o?void 0:o.status))return ql(`[generate-3d] Job failed: ${i.identifier}, error=${o.error}`),a.fail(`3D generation failed: ${o.error||""}`),{error:o.error||"3D generation failed"}}await Cc(n)}if(e.outDir){const n=await Jl({baseUrl:t,authToken:e.token,org:e.org_id,identifier:i.identifier,outDir:e.outDir,filename:e.outputName});if("error"in n)return{error:n.error}}return{success:!0,identifier:i.identifier}}({logger:n,token:s,org_id:r,prompt:c,quality:l,face_count:p,outputName:d,outDir:u});"error"in m&&(m.error&&n.error(m.error),process.exit(1)),!u&&m.identifier&&console.log(m.identifier),process.exit(0)})),Yd.command("ask","Send a message to the Needle Cloud AI").help("Send a message to the Needle Cloud AI chat.\n\nWithout a message argument, starts an interactive session.\nBy default streams the response to the terminal. Use --no-stream for a single JSON response.\nUse --slug to continue an existing chat conversation.\nDefault slug is <your-user-id>-cli (persistent across sessions).").argument("[message...]","The message to send (omit for interactive mode)").option("--token <token>",Jd,{validator:Yd.STRING}).option("--team <team>","The team name or id to authenticate for",{required:!1,validator:Yd.STRING}).option("--org <org>","Legacy alias for --team",{required:!1,validator:Yd.STRING,hidden:!0}).option("--slug <slug>","Chat slug to continue an existing conversation",{required:!1,validator:Yd.STRING}).option("--no-stream","Disable streaming (returns full response at once)",{required:!1,validator:Yd.BOOLEAN,default:!1}).action(Md("ask",async({args:e,options:t})=>{var n,o;const{accessToken:i,org_id:a}=await Vd(t.token,Kd(t)),s=Array.isArray(e.message)?e.message:e.message?[e.message]:[],r=s.length?s.join(" "):void 0,c=(null==(n=t.slug)?void 0:n.toString())||void 0,l=(null==(o=t.noStream)?void 0:o.valueOf())||!1;await async function(e){const{token:t,org_id:n,message:o,slug:i,stream:a}=e,s=i||function(e){try{const t=e.split(".")[1],n=JSON.parse(Buffer.from(t,"base64url").toString());if(n.sub)return n.sub+"-cli"}catch{}return"cli-"+Math.random().toString(36).slice(2,10)}(t);await async function(e){const{token:t,org_id:n,slug:o,stream:i,initialMessage:a}=e,s=ue({input:process.stdin,output:process.stdout});console.log(`Needle Cloud AI (chat: ${o})`),console.log('Type your message. Press Ctrl+C or type "exit" to quit.\n');try{for(a&&(console.log(`> ${a}`),await Vl({token:t,org_id:n,slug:o,message:a,stream:i}),console.log(""));;){const e=(await s.question("> ")).trim();if(e){if("exit"===e||"quit"===e)break;await Vl({token:t,org_id:n,slug:o,message:e,stream:i}),console.log("")}}}finally{s.close()}}({token:t,org_id:n,slug:s,stream:a,initialMessage:o})}({token:i,org_id:a,message:r,slug:c,stream:!l}),process.exit(0)}));export{iu as g,Yd as p};