@http-forge/core 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- var kL=Object.create;var Yp=Object.defineProperty;var TL=Object.getOwnPropertyDescriptor;var AL=Object.getOwnPropertyNames;var qL=Object.getPrototypeOf,$L=Object.prototype.hasOwnProperty;var it=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var F=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},qs=(t,e)=>{for(var r in e)Yp(t,r,{get:e[r],enumerable:!0})},uE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of AL(e))!$L.call(t,i)&&i!==r&&Yp(t,i,{get:()=>e[i],enumerable:!(n=TL(e,i))||n.enumerable});return t};var _b=(t,e,r)=>(r=t!=null?kL(qL(t)):{},uE(e||!t||!t.__esModule?Yp(r,"default",{value:t,enumerable:!0}):r,t)),El=t=>uE(Yp({},"__esModule",{value:!0}),t);function It(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function dt(t){let e=Date.now().toString(36)+(ML++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${It(t)}_${e}`:e}function Rb(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function xu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),l=n[a];l&&delete r[l],n[a]=i,r[i]=s}return r}function NL(t){return JSON.parse(JSON.stringify(t))}function DL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function FL(t,e){try{return JSON.parse(t)}catch{return e}}function LL(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function jL(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var ML,bn=se(()=>{"use strict";ML=0});import*as Xe from"fs";import*as rn from"path";function Qp(t){if(!Xe.existsSync(t))return;let e={},r=rn.join(t,Kp.preRequest);Xe.existsSync(r)&&(e.preRequest=Xe.readFileSync(r,"utf-8"));let n=rn.join(t,Kp.postResponse);return Xe.existsSync(n)&&(e.postResponse=Xe.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function Zp(t,e){await Xe.promises.mkdir(t,{recursive:!0});let r=rn.join(t,Kp.preRequest);e.preRequest?await Xe.promises.writeFile(r,e.preRequest,"utf-8"):Xe.existsSync(r)&&await Xe.promises.unlink(r);let n=rn.join(t,Kp.postResponse);e.postResponse?await Xe.promises.writeFile(n,e.postResponse,"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n)}function dE(t){for(let[e,r]of Object.entries(fE)){let n=rn.join(t,e);if(Xe.existsSync(n))try{let i=Xe.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function pE(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function hE(t,e){for(let r of Object.keys(fE))if(r!==e){let n=rn.join(t,r);if(Xe.existsSync(n))try{await Xe.promises.unlink(n)}catch{}}}function mE(t){if(Xe.existsSync(t))try{let e=Xe.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function gE(t,e,r){let n=rn.join(t,Cu.responseSchema),i=rn.join(t,Cu.bodySchema);e?await Xe.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n),r?await Xe.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):Xe.existsSync(i)&&await Xe.promises.unlink(i)}function xb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=xb(r.items,e);if(n)return n}}}function Cb(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&Cb(n.items,e))return!0}return!1}function yE(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function Eb(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===nn)continue;if(n.name===e)return rn.join(t,n.name);let i=Eb(rn.join(t,n.name),e);if(i)return i}}function UL(t){for(let e of[xr.request,xr.folder]){let r=rn.join(t,e);if(Xe.existsSync(r))try{let n=Xe.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function Ob(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===nn)continue;let i=rn.join(t,n.name);if(UL(i)===e)return i;let s=Ob(i,e);if(s)return s}}function Sn(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let y of s){let S=parseInt(y.substring(1));S>a&&(a=S)}let l="";if(a>0)l=`t${a}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=f.split("-").filter(y=>y.length>0),m=[];i&&m.push(i),m.push(...d),l&&m.push(l);let g=m.join("-");if(g||(g="item"),e.includes(g)){let y=2;for(;e.includes(`${g}-${y}`);)y++;g=`${g}-${y}`}return g}var Kp,xr,fE,Cu,nn,Ho=se(()=>{"use strict";Kp={preRequest:"pre-request.js",postResponse:"post-response.js"},xr={collection:"collection.json",folder:"folder.json",request:"request.json"},fE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},Cu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},nn="scripts"});import*as xe from"fs";import*as Pe from"path";var $s,Xp=se(()=>{"use strict";bn();Ho();$s=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){xe.existsSync(this.collectionsDir)||xe.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=xe.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!xe.existsSync(this.collectionsDir))return[];let e=xe.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=Pe.join(this.collectionsDir,e),n=Pe.join(r,xr.collection);if(!xe.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Pe.join(r,nn)),a=this.loadItemsFromDir(r,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=xe.readdirSync(e,{withFileTypes:!0});for(let l of a){if(!l.isDirectory()||l.name===nn)continue;let f=Pe.join(e,l.name);if(xe.existsSync(Pe.join(f,xr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(xe.existsSync(Pe.join(f,xr.request))){let d=this.loadRequestFromDir(f,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let f=s.get(l);f&&(i.push(f),s.delete(l))}for(let l of s.values())i.push(l)}else for(let l of s.values())i.push(l);return i}loadFolderFromDir(e,r){let n=Pe.join(e,xr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=Pe.join(e,xr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=i.body,l=this.loadBodyFromDir(e);l&&(a=l);let f=this.loadSchemaFile(Pe.join(e,Cu.responseSchema)),d=this.loadSchemaFile(Pe.join(e,Cu.bodySchema)),m=Pe.join(e,"doc.md"),g=xe.existsSync(m)?xe.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:a,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,...g&&{doc:g},...f&&{responseSchema:f},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Qp(e)}loadBodyFromDir(e){return dE(e)}loadSchemaFile(e){return mE(e)}async saveSchemaFiles(e,r){return gE(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=dt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=xe.readdirSync(this.collectionsDir);r=Sn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Pe.join(this.collectionsDir,r),i=!xe.existsSync(n);await xe.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[a]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Pe.join(n,nn),e.scripts):Promise.resolve()]);a.length>0&&(s.order=a),await xe.promises.writeFile(Pe.join(n,xr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let a of r){let l=this.idToSlugMap.get(a.id);l||(l=Sn(a.name,i),this.idToSlugMap.set(a.id,l),this.slugToIdMap.set(l,a.id)),i.push(l),s.push({item:a,slug:l})}return await Promise.all(s.map(async({item:a,slug:l})=>{let f=Pe.join(e,l);await xe.promises.mkdir(f,{recursive:!0}),a.type==="folder"?await this.saveFolderToDir(f,a,n):await this.saveRequestToDir(f,a,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(Pe.join(e,nn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await xe.promises.writeFile(Pe.join(e,xr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),a={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}},l=[xe.promises.writeFile(Pe.join(e,xr.request),JSON.stringify(a,null,2),"utf-8")];s&&l.push(xe.promises.writeFile(Pe.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(xe.promises.writeFile(Pe.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Pe.join(e,nn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return pE(e)}async cleanupOldBodyFiles(e,r){return hE(e,r)}async saveScriptsToDir(e,r){return Zp(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=Pe.join(this.collectionsDir,r);if(!xe.existsSync(n))return!1;try{return await xe.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?xe.existsSync(Pe.join(this.collectionsDir,r,xr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Pe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||dt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(Pe.join(s,nn),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Pe.join(n,nn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=Pe.join(this.collectionsDir,i),a=Pe.join(s,xr.collection),l=xe.readFileSync(a,"utf-8"),d={...JSON.parse(l),...r,id:e};await xe.promises.writeFile(a,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let m=this.findItemPath(e,n);if(!m)throw new Error(`Parent folder ${n} not found`);a=m}else a=Pe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let m=xe.readdirSync(a).filter(g=>xe.statSync(Pe.join(a,g)).isDirectory()&&g!==nn);l=Sn(r.name,m),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Pe.join(a,l);await xe.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,r);else if(n){let m=this.findItemById(i.items,n);m&&m.type==="folder"&&(m.items=m.items||[],m.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!xe.existsSync(i))return!1;try{await xe.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:l,type:f,items:d,...m}=n;return Object.assign(a,m),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!xe.existsSync(a))return!1;let l;if(n){let m=this.findItemPath(e,n);if(!m)return!1;l=m}else l=Pe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let d=Pe.join(l,f);if(xe.existsSync(d))return!1;try{await xe.promises.rename(a,d);let m=this.findItemById(i.items,r);if(m){let g=m.type==="folder"?{...m,items:m.items?[...m.items]:[]}:{...m};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(g))}else i.items.push(g)}return!0}catch(m){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,m),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&a.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Pe.join(l,xr.folder),d=xe.readFileSync(f,"utf-8"),m=JSON.parse(d);m.order=a,await xe.promises.writeFile(f,JSON.stringify(m,null,2),"utf-8");let g=this.findItemById(i.items,r);g&&g.type==="folder"&&g.items&&(g.items=this.sortItemsByOrder(g.items,n))}else{let l=Pe.join(this.collectionsDir,s,xr.collection),f=xe.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=a,await xe.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return yE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Pe.join(this.collectionsDir,n),s=Ob(i,r);if(s)return s;let a=this.load(e);if(a){let f=this.buildSlugPath(a.items,r);if(f)return Pe.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Eb(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return xb(e,r)}deleteItemFromTree(e,r){return Cb(e,r)}}});var at,Bo=se(()=>{"use strict";at=class{static parseSetCookie(e,r){let n=e.split(";").map(m=>m.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let l=i.substring(0,a).trim(),f=i.substring(a+1).trim(),d={name:l,value:f,domain:r};for(let m of s){let g=m.indexOf("="),y=(g===-1?m:m.substring(0,g)).toLowerCase(),S=g===-1?"":m.substring(g+1);switch(y){case"domain":d.domain=S.startsWith(".")?S.substring(1):S;break;case"path":d.path=S;break;case"expires":d.expires=S;break;case"max-age":d.maxAge=parseInt(S,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=S;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let l=this.parseSetCookie(a,r);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}}});import*as Ms from"fs";import*as Vo from"path";function th(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Pu(t){if(!Ms.existsSync(t))return BL();let e=eh(Vo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Ms.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!th(d)),s={};for(let d of i){let m=eh(Vo.join(t,d))||{},g=Vo.basename(d,".json");s[g]={description:m.description,requiresConfirmation:m.requiresConfirmation,variables:m.variables||{},secretVariables:m.secretVariables}}let l=(eh(Vo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let m=Vo.join(t,`${d}.local.json`);if(Ms.existsSync(m)){let g=eh(m)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function BL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function eh(t){try{if(!Ms.existsSync(t))return null;let e=Ms.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var rh=se(()=>{"use strict"});var Vn,Il=se(()=>{"use strict";Vn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",l=e.indexOf("?");l!==-1&&(a=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,m=s.replace(d,(g,y,S)=>{let _=r[y];return _!==void 0&&_!==""?encodeURIComponent(_):S?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),g)});return m=m.replace(/([^:])\/+/g,"$1/"),m.length>1&&m.endsWith("/")&&(m=m.slice(0,-1)),`${n}${i}${m}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,d]=e.split("?");n=f,d&&new URLSearchParams(d).forEach((g,y)=>{i[y]=g})}let s={...i,...r},a=new URLSearchParams;for(let[f,d]of Object.entries(s))d!=null&&a.append(f,d);let l=a.toString();return l?`${n}?${l}`:n}}});function bE(t,e=0){return(Zt[t[e+0]]+Zt[t[e+1]]+Zt[t[e+2]]+Zt[t[e+3]]+"-"+Zt[t[e+4]]+Zt[t[e+5]]+"-"+Zt[t[e+6]]+Zt[t[e+7]]+"-"+Zt[t[e+8]]+Zt[t[e+9]]+"-"+Zt[t[e+10]]+Zt[t[e+11]]+Zt[t[e+12]]+Zt[t[e+13]]+Zt[t[e+14]]+Zt[t[e+15]]).toLowerCase()}var Zt,SE=se(()=>{Zt=[];for(let t=0;t<256;++t)Zt.push((t+256).toString(16).slice(1))});function kb(){return crypto.getRandomValues(VL)}var VL,wE=se(()=>{VL=new Uint8Array(16)});function WL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():zL(t,e,r)}function zL(t,e,r){t=t||{};let n=t.random??t.rng?.()??kb();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return bE(n)}var Pl,_E=se(()=>{wE();SE();Pl=WL});var Tb=se(()=>{_E()});function JL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function GL(){return Date.now()}function RE(){return Pl()}function YL(){return Pl()}function xE(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function KL(){let t=xE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function QL(){return Math.random()<.5}function ZL(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function XL(){return Math.floor(Date.now()/1e3)}function ej(){return new Date().toISOString()}function tj(){return new Date().toISOString().split("T")[0]}function rj(){return new Date().toISOString().split("T")[1].split(".")[0]}function nj(){return new Date().toISOString()}function ij(t=""){return Buffer.from(String(t)).toString("base64")}function sj(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function oj(t=""){return encodeURIComponent(String(t))}function aj(t=""){return decodeURIComponent(String(t))}function lj(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Ji(t,e){let r=CE[t];return r?e&&e.length>0?r(...e):r():null}function cj(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?lj(n):void 0,s=Ji(r,i);return s===null?e:String(s)}catch{return e}})}function Wo(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let l=Ji(a);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var CE,nh=se(()=>{"use strict";Tb();CE={randomInt:JL,timestamp:GL,guid:YL,uuid:RE,randomUUID:RE,randomString:xE,randomHexadecimal:ZL,randomEmail:KL,randomBoolean:QL,isoTimestamp:nj,timestamp_s:XL,datetime:ej,date:tj,time:rj,base64Encode:ij,base64Decode:sj,urlEncode:oj,urlDecode:aj}});import*as ih from"vm";function zo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Jo(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=ih.createContext(r);return ih.runInContext(t,n,{timeout:uj,displayErrors:!1})}catch{return}}var uj,sh=se(()=>{"use strict";uj=100});import*as oh from"crypto";function fj(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Tu(t){if(!t||!t.includes("|"))return null;let e=dj(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=pj(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function dj(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let l=t[a],f=a>0?t[a-1]:"",d=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function pj(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:hj(n)}}function hj(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function Pt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=fj(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Au(t,e,r={}){let n=t;for(let i of e)n=mj(n,i.name,i.args,r);return n}function mj(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=Pt(r[0],n),s=r[1]!==void 0?Pt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(Pt(r[0],n)):"",s=r[1]!==void 0?String(Pt(r[1],n)):"";return String(t).replace(new RegExp(yj(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Pt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Pt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(Pt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Pt(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Pt(r[0],n);return Number(t)+i}case"subtract":{let i=Pt(r[0],n);return Number(t)-i}case"multiply":{let i=Pt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?Pt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Pt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return oh.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Pt(r[0],n)):"",s=String(r[1]!==void 0?Pt(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Pt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return oh.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=Pt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Pt(r[0],n),s=r[1]!==void 0?Pt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:gj(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Pt(s,n)));return i.length===1?t.map(s=>ku(s,i[0])):t.map(s=>{let a={};for(let l of i){let f=ku(s,l);f!==void 0&&(a[l]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Pt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>ku(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?ku(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function gj(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,l=Pt(a,r);return t.filter(f=>{let d=ku(f,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function ku(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function yj(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ah=se(()=>{"use strict"});function EE(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function vj(t){return new Go(t)}var Go,Yo,qu=se(()=>{"use strict";nh();sh();ah();Go=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let a=this.resolveSinglePass(i,r,n);if(a===i)break;i=a}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,d)=>this.resolveTemplateContent(d.trim(),r,f));let i="",s=0,a=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=a.exec(e))!==null;){let f=l[1].trim(),d=this.resolveTemplateContent(f,r,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let m=this.getStringContext(e,l.index);i+=m?this.escapeForString(String(d),m):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=EE(i[2],r),f=Ji(i[1],l);return f!==null?String(f):n}let s=Tu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Au(l,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let l=a[1];if(r[l]!==void 0){let f=this.deserializeValue(r[l]),d=a[2],m=this.resolvePropertyAccess(f,d);if(m!==void 0)return typeof m=="object"?JSON.stringify(m):String(m)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(zo(e)){let l=this.deserializeVariables(r),f=Wo(e,l),d=Jo(e,f);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=EE(n[2],r),a=Ji(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(a,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(zo(e)){let s=this.deserializeVariables(r),a=Wo(e,s),l=Jo(e,a);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},Yo=class{interpolate(e,r){return!e||typeof e!="string"?e:new Go({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});import*as bj from"http";import*as $u from"https";import{URL as OE}from"url";import*as lh from"zlib";var Wn,Ko,Mu=se(()=>{"use strict";Wn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Ko=class{settings;version;constructor(e){this.settings={...Wn,...e};try{this.version=it("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new OE(e.url),l=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(g=>g.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let m={hostname:a.hostname,port:a.port||(l?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(m.headers["Accept-Encoding"]="gzip, deflate"),l&&(m.rejectUnauthorized=r.strictSSL,r.strictSSL?m.agent=$u.globalAgent:m.agent=new $u.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let R=new Error("Request cancelled");R.name="AbortError",y(R);return}let _=(l?$u:bj).request(m,async R=>{let P=R.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(P)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let U=R.headers.location;if(!U){y(new Error("Redirect response missing Location header"));return}let B=new OE(U,e.url).toString(),V=e.method;!r.followOriginalMethod&&[301,302,303].includes(P)&&(V="GET");let W={...e.headers};r.followAuthHeader||(delete W.authorization,delete W.Authorization);try{let X=await this.executeInternal({...e,url:B,method:V,headers:W,body:V==="GET"?void 0:e.body},r,n+1,i),T=Date.now();X.time=T-s,g(X)}catch(X){y(X)}return}let A=[];R.on("data",U=>A.push(U)),R.on("end",()=>{let U=Date.now(),B=Buffer.concat(A),V=R.headers["content-encoding"];if(r.decompress&&V)try{V==="gzip"?B=lh.gunzipSync(B):V==="deflate"&&(B=lh.inflateSync(B))}catch(x){console.warn("[NodeHttpClient] Decompression failed:",x)}let W=B.toString("utf-8"),X={};for(let[x,k]of Object.entries(R.headers))(typeof k=="string"||Array.isArray(k))&&(X[x]=k);let T=this.parseCookies(R.headers["set-cookie"],a.hostname);g({status:R.statusCode||0,statusText:R.statusMessage||"",headers:X,cookies:T,body:W,time:U-s,size:B.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let R=new Error("Request cancelled");R.name="AbortError",y(R)}),_.on("error",R=>{y(R)}),_.on("timeout",()=>{_.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let R=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(R)}_.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(m=>m.trim()),[s,...a]=i,[l,f]=s.split("="),d={name:l.trim(),value:f?.trim()||"",domain:r};for(let m of a){let[g,y]=m.split("=");switch(g.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});function Ab(t){return{timeout:t?.timeout??Wn.timeout,followRedirects:t?.followRedirects??Wn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Wn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Wn.followAuthHeader,maxRedirects:t?.maxRedirects??Wn.maxRedirects,strictSSL:t?.strictSSL??Wn.strictSSL,decompress:t?.decompress??Wn.decompress,includeCookies:t?.includeCookies??Wn.includeCookies}}var qb=se(()=>{"use strict";Mu()});var Gi,Nu=se(()=>{"use strict";qb();Gi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=Ab(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var Yi,$b,Mb,Nb,Du=se(()=>{"use strict";Yi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},$b=class{name="logging";priority=1e3;intercept(e,r){return e}},Mb=class{name="timing";priority=1;intercept(e,r,n){return e}},Nb=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var IE=F((kl,Fu)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",m=1,g=2,y=4,S=1,_=2,R=1,P=2,A=4,U=8,B=16,V=32,W=64,X=128,T=256,x=512,k=30,N="...",j=800,$=16,G=1,K=2,ne=3,pe=1/0,et=9007199254740991,_e=17976931348623157e292,he=NaN,Ce=4294967295,vt=Ce-1,Et=Ce>>>1,ce=[["ary",X],["bind",R],["bindKey",P],["curry",U],["curryRight",B],["flip",x],["partial",V],["partialRight",W],["rearg",T]],hr="[object Arguments]",ui="[object Array]",Rt="[object AsyncFunction]",Gr="[object Boolean]",Ir="[object Date]",ht="[object DOMException]",mt="[object Error]",ln="[object Function]",uo="[object GeneratorFunction]",Jt="[object Map]",fo="[object Number]",oy="[object Null]",kn="[object Object]",$d="[object Promise]",Md="[object Proxy]",Gt="[object RegExp]",mr="[object Set]",po="[object String]",Da="[object Symbol]",Nd="[object Undefined]",Ut="[object WeakMap]",Dd="[object WeakSet]",ki="[object ArrayBuffer]",Tn="[object DataView]",ot="[object Float32Array]",Fa="[object Float64Array]",La="[object Int8Array]",ds="[object Int16Array]",ho="[object Int32Array]",ps="[object Uint8Array]",fi="[object Uint8ClampedArray]",hs="[object Uint16Array]",Hc="[object Uint32Array]",ja=/\b__p \+= '';/g,ay=/\b(__p \+=) '' \+/g,mo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ti=/&(?:amp|lt|gt|quot|#39);/g,Ua=/[&<>"']/g,Ha=RegExp(Ti.source),le=RegExp(Ua.source),ly=/<%-([\s\S]+?)%>/g,cy=/<%([\s\S]+?)%>/g,cn=/<%=([\s\S]+?)%>/g,Pr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,Bc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,go=RegExp(Ke.source),Vc=/^\s+/,Ba=/\s/,Yt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,An=/\{\n\/\* \[wrapped with (.+)\] \*/,un=/,? & /,At=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kr=/[()=,{}\[\]\/\s]/,qn=/\\(\\)?/g,Ai=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fd=/\w*$/,uy=/^[-+]0x[0-9a-f]+$/i,yo=/^0b[01]+$/i,Ld=/^\[object .+?Constructor\]$/,fy=/^0o[0-7]+$/i,ms=/^(?:0|[1-9]\d*)$/,vo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bo=/($^)/,dy=/['\n\r\u2028\u2029\\]/g,Va="\\ud800-\\udfff",py="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",Wc="\\u20d0-\\u20ff",jd=py+xt+Wc,zc="\\u2700-\\u27bf",Jc="a-z\\xdf-\\xf6\\xf8-\\xff",hy="\\xac\\xb1\\xd7\\xf7",my="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gy="\\u2000-\\u206f",yy=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ud="A-Z\\xc0-\\xd6\\xd8-\\xde",Hd="\\ufe0e\\ufe0f",Gc=hy+my+gy+yy,Wa="['\u2019]",vy="["+Va+"]",Bd="["+Gc+"]",za="["+jd+"]",Yc="\\d+",by="["+zc+"]",gs="["+Jc+"]",So="[^"+Va+Gc+Yc+zc+Jc+Ud+"]",Ja="\\ud83c[\\udffb-\\udfff]",wo="(?:"+za+"|"+Ja+")",fn="[^"+Va+"]",Kc="(?:\\ud83c[\\udde6-\\uddff]){2}",Qc="[\\ud800-\\udbff][\\udc00-\\udfff]",ys="["+Ud+"]",Vd="\\u200d",Wd="(?:"+gs+"|"+So+")",Sy="(?:"+ys+"|"+So+")",zd="(?:"+Wa+"(?:d|ll|m|re|s|t|ve))?",Jd="(?:"+Wa+"(?:D|LL|M|RE|S|T|VE))?",Ga=wo+"?",Gd="["+Hd+"]?",Yd="(?:"+Vd+"(?:"+[fn,Kc,Qc].join("|")+")"+Gd+Ga+")*",wy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_y="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kd=Gd+Ga+Yd,Ry="(?:"+[by,Kc,Qc].join("|")+")"+Kd,xy="(?:"+[fn+za+"?",za,Kc,Qc,vy].join("|")+")",Cy=RegExp(Wa,"g"),Ey=RegExp(za,"g"),Zc=RegExp(Ja+"(?="+Ja+")|"+xy+Kd,"g"),Oy=RegExp([ys+"?"+gs+"+"+zd+"(?="+[Bd,ys,"$"].join("|")+")",Sy+"+"+Jd+"(?="+[Bd,ys+Wd,"$"].join("|")+")",ys+"?"+Wd+"+"+zd,ys+"+"+Jd,_y,wy,Yc,Ry].join("|"),"g"),Iy=RegExp("["+Vd+Va+jd+Hd+"]"),Py=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ky=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ty=-1,ft={};ft[ot]=ft[Fa]=ft[La]=ft[ds]=ft[ho]=ft[ps]=ft[fi]=ft[hs]=ft[Hc]=!0,ft[hr]=ft[ui]=ft[ki]=ft[Gr]=ft[Tn]=ft[Ir]=ft[mt]=ft[ln]=ft[Jt]=ft[fo]=ft[kn]=ft[Gt]=ft[mr]=ft[po]=ft[Ut]=!1;var lt={};lt[hr]=lt[ui]=lt[ki]=lt[Tn]=lt[Gr]=lt[Ir]=lt[ot]=lt[Fa]=lt[La]=lt[ds]=lt[ho]=lt[Jt]=lt[fo]=lt[kn]=lt[Gt]=lt[mr]=lt[po]=lt[Da]=lt[ps]=lt[fi]=lt[hs]=lt[Hc]=!0,lt[mt]=lt[ln]=lt[Ut]=!1;var Xc={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},eu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ay={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Qd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zd=parseFloat,qy=parseInt,Xd=typeof global=="object"&&global&&global.Object===Object&&global,$y=typeof self=="object"&&self&&self.Object===Object&&self,Nt=Xd||$y||Function("return this")(),Ya=typeof kl=="object"&&kl&&!kl.nodeType&&kl,Qe=Ya&&typeof Fu=="object"&&Fu&&!Fu.nodeType&&Fu,vs=Qe&&Qe.exports===Ya,qi=vs&&Xd.process,Tr=(function(){try{var L=Qe&&Qe.require&&Qe.require("util").types;return L||qi&&qi.binding&&qi.binding("util")}catch{}})(),tu=Tr&&Tr.isArrayBuffer,ep=Tr&&Tr.isDate,tp=Tr&&Tr.isMap,_o=Tr&&Tr.isRegExp,$n=Tr&&Tr.isSet,Ka=Tr&&Tr.isTypedArray;function gr(L,Y,z){switch(z.length){case 0:return L.call(Y);case 1:return L.call(Y,z[0]);case 2:return L.call(Y,z[0],z[1]);case 3:return L.call(Y,z[0],z[1],z[2])}return L.apply(Y,z)}function Mn(L,Y,z,ae){for(var be=-1,Ge=L==null?0:L.length;++be<Ge;){var rt=L[be];Y(ae,rt,z(rt),L)}return ae}function yr(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae&&Y(L[z],z,L)!==!1;);return L}function ru(L,Y){for(var z=L==null?0:L.length;z--&&Y(L[z],z,L)!==!1;);return L}function rp(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(!Y(L[z],z,L))return!1;return!0}function di(L,Y){for(var z=-1,ae=L==null?0:L.length,be=0,Ge=[];++z<ae;){var rt=L[z];Y(rt,z,L)&&(Ge[be++]=rt)}return Ge}function Qa(L,Y){var z=L==null?0:L.length;return!!z&&$i(L,Y,0)>-1}function bs(L,Y,z){for(var ae=-1,be=L==null?0:L.length;++ae<be;)if(z(Y,L[ae]))return!0;return!1}function ct(L,Y){for(var z=-1,ae=L==null?0:L.length,be=Array(ae);++z<ae;)be[z]=Y(L[z],z,L);return be}function pi(L,Y){for(var z=-1,ae=Y.length,be=L.length;++z<ae;)L[be+z]=Y[z];return L}function nu(L,Y,z,ae){var be=-1,Ge=L==null?0:L.length;for(ae&&Ge&&(z=L[++be]);++be<Ge;)z=Y(z,L[be],be,L);return z}function My(L,Y,z,ae){var be=L==null?0:L.length;for(ae&&be&&(z=L[--be]);be--;)z=Y(z,L[be],be,L);return z}function Za(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(Y(L[z],z,L))return!0;return!1}var Ny=Ro("length");function Dy(L){return L.split("")}function Fy(L){return L.match(At)||[]}function np(L,Y,z){var ae;return z(L,function(be,Ge,rt){if(Y(be,Ge,rt))return ae=Ge,!1}),ae}function Xa(L,Y,z,ae){for(var be=L.length,Ge=z+(ae?1:-1);ae?Ge--:++Ge<be;)if(Y(L[Ge],Ge,L))return Ge;return-1}function $i(L,Y,z){return Y===Y?Jy(L,Y,z):Xa(L,Mi,z)}function Ly(L,Y,z,ae){for(var be=z-1,Ge=L.length;++be<Ge;)if(ae(L[be],Y))return be;return-1}function Mi(L){return L!==L}function ip(L,Y){var z=L==null?0:L.length;return z?su(L,Y)/z:he}function Ro(L){return function(Y){return Y==null?t:Y[L]}}function iu(L){return function(Y){return L==null?t:L[Y]}}function el(L,Y,z,ae,be){return be(L,function(Ge,rt,Ue){z=ae?(ae=!1,Ge):Y(z,Ge,rt,Ue)}),z}function jy(L,Y){var z=L.length;for(L.sort(Y);z--;)L[z]=L[z].value;return L}function su(L,Y){for(var z,ae=-1,be=L.length;++ae<be;){var Ge=Y(L[ae]);Ge!==t&&(z=z===t?Ge:z+Ge)}return z}function ou(L,Y){for(var z=-1,ae=Array(L);++z<L;)ae[z]=Y(z);return ae}function Uy(L,Y){return ct(Y,function(z){return[z,L[z]]})}function au(L){return L&&L.slice(0,cp(L)+1).replace(Vc,"")}function vr(L){return function(Y){return L(Y)}}function tl(L,Y){return ct(Y,function(z){return L[z]})}function tt(L,Y){return L.has(Y)}function sp(L,Y){for(var z=-1,ae=L.length;++z<ae&&$i(Y,L[z],0)>-1;);return z}function op(L,Y){for(var z=L.length;z--&&$i(Y,L[z],0)>-1;);return z}function ap(L,Y){for(var z=L.length,ae=0;z--;)L[z]===Y&&++ae;return ae}var Hy=iu(Xc),By=iu(eu);function Vy(L){return"\\"+Qd[L]}function xo(L,Y){return L==null?t:L[Y]}function Ss(L){return Iy.test(L)}function Wy(L){return Py.test(L)}function zy(L){for(var Y,z=[];!(Y=L.next()).done;)z.push(Y.value);return z}function ws(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae,be){z[++Y]=[be,ae]}),z}function Co(L,Y){return function(z){return L(Y(z))}}function dn(L,Y){for(var z=-1,ae=L.length,be=0,Ge=[];++z<ae;){var rt=L[z];(rt===Y||rt===d)&&(L[z]=d,Ge[be++]=z)}return Ge}function rl(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=ae}),z}function lp(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=[ae,ae]}),z}function Jy(L,Y,z){for(var ae=z-1,be=L.length;++ae<be;)if(L[ae]===Y)return ae;return-1}function lu(L,Y,z){for(var ae=z+1;ae--;)if(L[ae]===Y)return ae;return ae}function hi(L){return Ss(L)?Yy(L):Ny(L)}function br(L){return Ss(L)?Ky(L):Dy(L)}function cp(L){for(var Y=L.length;Y--&&Ba.test(L.charAt(Y)););return Y}var Gy=iu(Ay);function Yy(L){for(var Y=Zc.lastIndex=0;Zc.test(L);)++Y;return Y}function Ky(L){return L.match(Zc)||[]}function Qy(L){return L.match(Oy)||[]}var Zy=(function L(Y){Y=Y==null?Nt:mi.defaults(Nt.Object(),Y,mi.pick(Nt,ky));var z=Y.Array,ae=Y.Date,be=Y.Error,Ge=Y.Function,rt=Y.Math,Ue=Y.Object,nl=Y.RegExp,Xy=Y.String,Sr=Y.TypeError,Eo=z.prototype,ev=Ge.prototype,_s=Ue.prototype,Oo=Y["__core-js_shared__"],il=ev.toString,Ze=_s.hasOwnProperty,tv=0,up=(function(){var o=/[^.]+$/.exec(Oo&&Oo.keys&&Oo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),sl=_s.toString,rv=il.call(Ue),nv=Nt._,iv=nl("^"+il.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ol=vs?Y.Buffer:t,gi=Y.Symbol,al=Y.Uint8Array,fp=ol?ol.allocUnsafe:t,ll=Co(Ue.getPrototypeOf,Ue),dp=Ue.create,Io=_s.propertyIsEnumerable,cl=Eo.splice,pp=gi?gi.isConcatSpreadable:t,Po=gi?gi.iterator:t,Ni=gi?gi.toStringTag:t,ul=(function(){try{var o=Lo(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),sv=Y.clearTimeout!==Nt.clearTimeout&&Y.clearTimeout,ov=ae&&ae.now!==Nt.Date.now&&ae.now,av=Y.setTimeout!==Nt.setTimeout&&Y.setTimeout,ko=rt.ceil,To=rt.floor,fl=Ue.getOwnPropertySymbols,dl=ol?ol.isBuffer:t,Di=Y.isFinite,pl=Eo.join,hp=Co(Ue.keys,Ue),gt=rt.max,Ht=rt.min,mp=ae.now,lv=Y.parseInt,gp=rt.random,cv=Eo.reverse,cu=Lo(Y,"DataView"),Ao=Lo(Y,"Map"),uu=Lo(Y,"Promise"),Rs=Lo(Y,"Set"),qo=Lo(Y,"WeakMap"),$o=Lo(Ue,"create"),hl=qo&&new qo,xs={},uv=jo(cu),fv=jo(Ao),dv=jo(uu),pv=jo(Rs),hv=jo(qo),ml=gi?gi.prototype:t,Mo=ml?ml.valueOf:t,yp=ml?ml.toString:t;function O(o){if(Ot(o)&&!Re(o)&&!(o instanceof $e)){if(o instanceof ir)return o;if(Ze.call(o,"__wrapped__"))return IC(o)}return new ir(o)}var Cs=(function(){function o(){}return function(c){if(!Ct(c))return{};if(dp)return dp(c);o.prototype=c;var p=new o;return o.prototype=t,p}})();function gl(){}function ir(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=t}O.templateSettings={escape:ly,evaluate:cy,interpolate:cn,variable:"",imports:{_:O}},O.prototype=gl.prototype,O.prototype.constructor=O,ir.prototype=Cs(gl.prototype),ir.prototype.constructor=ir;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ce,this.__views__=[]}function mv(){var o=new $e(this.__wrapped__);return o.__actions__=Ar(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Ar(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Ar(this.__views__),o}function gv(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function fu(){var o=this.__wrapped__.value(),c=this.__dir__,p=Re(o),v=c<0,C=p?o.length:0,I=iM(0,C,this.__views__),q=I.start,D=I.end,H=D-q,Q=v?D:q-1,Z=this.__iteratees__,ee=Z.length,ie=0,ue=Ht(H,this.__takeCount__);if(!p||!v&&C==H&&ue==H)return Qx(o,this.__actions__);var ye=[];e:for(;H--&&ie<ue;){Q+=c;for(var Ie=-1,me=o[Q];++Ie<ee;){var Le=Z[Ie],He=Le.iteratee,en=Le.type,Rr=He(me);if(en==K)me=Rr;else if(!Rr){if(en==G)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=Cs(gl.prototype),$e.prototype.constructor=$e;function pn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function yv(){this.__data__=$o?$o(null):{},this.size=0}function vv(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function bv(o){var c=this.__data__;if($o){var p=c[o];return p===l?t:p}return Ze.call(c,o)?c[o]:t}function Sv(o){var c=this.__data__;return $o?c[o]!==t:Ze.call(c,o)}function wv(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=$o&&c===t?l:c,this}pn.prototype.clear=yv,pn.prototype.delete=vv,pn.prototype.get=bv,pn.prototype.has=Sv,pn.prototype.set=wv;function Nn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function vp(){this.__data__=[],this.size=0}function _v(o){var c=this.__data__,p=vl(c,o);if(p<0)return!1;var v=c.length-1;return p==v?c.pop():cl.call(c,p,1),--this.size,!0}function Rv(o){var c=this.__data__,p=vl(c,o);return p<0?t:c[p][1]}function bp(o){return vl(this.__data__,o)>-1}function xv(o,c){var p=this.__data__,v=vl(p,o);return v<0?(++this.size,p.push([o,c])):p[v][1]=c,this}Nn.prototype.clear=vp,Nn.prototype.delete=_v,Nn.prototype.get=Rv,Nn.prototype.has=bp,Nn.prototype.set=xv;function Dn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function Cv(){this.size=0,this.__data__={hash:new pn,map:new(Ao||Nn),string:new pn}}function yi(o){var c=jp(this,o).delete(o);return this.size-=c?1:0,c}function Sp(o){return jp(this,o).get(o)}function Ev(o){return jp(this,o).has(o)}function Ov(o,c){var p=jp(this,o),v=p.size;return p.set(o,c),this.size+=p.size==v?0:1,this}Dn.prototype.clear=Cv,Dn.prototype.delete=yi,Dn.prototype.get=Sp,Dn.prototype.has=Ev,Dn.prototype.set=Ov;function Fi(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new Dn;++c<p;)this.add(o[c])}function te(o){return this.__data__.set(o,l),this}function Iv(o){return this.__data__.has(o)}Fi.prototype.add=Fi.prototype.push=te,Fi.prototype.has=Iv;function Yr(o){var c=this.__data__=new Nn(o);this.size=c.size}function wp(){this.__data__=new Nn,this.size=0}function Ve(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function yl(o){return this.__data__.get(o)}function _p(o){return this.__data__.has(o)}function du(o,c){var p=this.__data__;if(p instanceof Nn){var v=p.__data__;if(!Ao||v.length<r-1)return v.push([o,c]),this.size=++p.size,this;p=this.__data__=new Dn(v)}return p.set(o,c),this.size=p.size,this}Yr.prototype.clear=wp,Yr.prototype.delete=Ve,Yr.prototype.get=yl,Yr.prototype.has=_p,Yr.prototype.set=du;function Rp(o,c){var p=Re(o),v=!p&&Uo(o),C=!p&&!v&&As(o),I=!p&&!v&&!C&&xl(o),q=p||v||C||I,D=q?ou(o.length,Xy):[],H=D.length;for(var Q in o)(c||Ze.call(o,Q))&&!(q&&(Q=="length"||C&&(Q=="offset"||Q=="parent")||I&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Hi(Q,H)))&&D.push(Q);return D}function xp(o){var c=o.length;return c?o[Uv(0,c-1)]:t}function Pv(o,c){return Up(Ar(o),vi(c,0,o.length))}function kv(o){return Up(Ar(o))}function pu(o,c,p){(p!==t&&!Hn(o[c],p)||p===t&&!(c in o))&&Kr(o,c,p)}function wr(o,c,p){var v=o[c];(!(Ze.call(o,c)&&Hn(v,p))||p===t&&!(c in o))&&Kr(o,c,p)}function vl(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function Cp(o,c,p,v){return bi(o,function(C,I,q){c(v,C,p(C),q)}),v}function Ep(o,c){return o&&Si(c,Kt(c),o)}function Tv(o,c){return o&&Si(c,$r(c),o)}function Kr(o,c,p){c=="__proto__"&&ul?ul(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function hu(o,c){for(var p=-1,v=c.length,C=z(v),I=o==null;++p<v;)C[p]=I?t:pb(o,c[p]);return C}function vi(o,c,p){return o===o&&(p!==t&&(o=o<=p?o:p),c!==t&&(o=o>=c?o:c)),o}function sr(o,c,p,v,C,I){var q,D=c&m,H=c&g,Q=c&y;if(p&&(q=C?p(o,v,C,I):p(o)),q!==t)return q;if(!Ct(o))return o;var Z=Re(o);if(Z){if(q=oM(o),!D)return Ar(o,q)}else{var ee=or(o),ie=ee==ln||ee==uo;if(As(o))return eC(o,D);if(ee==kn||ee==hr||ie&&!C){if(q=H||ie?{}:bC(o),!D)return H?Y$(o,Tv(q,o)):G$(o,Ep(q,o))}else{if(!lt[ee])return C?o:{};q=aM(o,ee,D)}}I||(I=new Yr);var ue=I.get(o);if(ue)return ue;I.set(o,q),GC(o)?o.forEach(function(me){q.add(sr(me,c,p,me,o,I))}):zC(o)&&o.forEach(function(me,Le){q.set(Le,sr(me,c,p,Le,o,I))});var ye=Q?H?Zv:Qv:H?$r:Kt,Ie=Z?t:ye(o);return yr(Ie||o,function(me,Le){Ie&&(Le=me,me=o[Le]),wr(q,Le,sr(me,c,p,Le,o,I))}),q}function Av(o){var c=Kt(o);return function(p){return hn(p,o,c)}}function hn(o,c,p){var v=p.length;if(o==null)return!v;for(o=Ue(o);v--;){var C=p[v],I=c[C],q=o[C];if(q===t&&!(C in o)||!I(q))return!1}return!0}function mu(o,c,p){if(typeof o!="function")throw new Sr(i);return _u(function(){o.apply(t,p)},c)}function No(o,c,p,v){var C=-1,I=Qa,q=!0,D=o.length,H=[],Q=c.length;if(!D)return H;p&&(c=ct(c,vr(p))),v?(I=bs,q=!1):c.length>=r&&(I=tt,q=!1,c=new Fi(c));e:for(;++C<D;){var Z=o[C],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,q&&ee===ee){for(var ie=Q;ie--;)if(c[ie]===ee)continue e;H.push(Z)}else I(c,ee,v)||H.push(Z)}return H}var bi=sC(mn),Op=sC(Fn,!0);function qv(o,c){var p=!0;return bi(o,function(v,C,I){return p=!!c(v,C,I),p}),p}function bl(o,c,p){for(var v=-1,C=o.length;++v<C;){var I=o[v],q=c(I);if(q!=null&&(D===t?q===q&&!Xr(q):p(q,D)))var D=q,H=I}return H}function $v(o,c,p,v){var C=o.length;for(p=Ee(p),p<0&&(p=-p>C?0:C+p),v=v===t||v>C?C:Ee(v),v<0&&(v+=C),v=p>v?0:KC(v);p<v;)o[p++]=c;return o}function Ip(o,c){var p=[];return bi(o,function(v,C,I){c(v,C,I)&&p.push(v)}),p}function Bt(o,c,p,v,C){var I=-1,q=o.length;for(p||(p=cM),C||(C=[]);++I<q;){var D=o[I];c>0&&p(D)?c>1?Bt(D,c-1,p,v,C):pi(C,D):v||(C[C.length]=D)}return C}var gu=oC(),Pp=oC(!0);function mn(o,c){return o&&gu(o,c,Kt)}function Fn(o,c){return o&&Pp(o,c,Kt)}function Sl(o,c){return di(c,function(p){return Bi(o[p])})}function Li(o,c){c=ks(c,o);for(var p=0,v=c.length;o!=null&&p<v;)o=o[Un(c[p++])];return p&&p==v?o:t}function kp(o,c,p){var v=c(o);return Re(o)?v:pi(v,p(o))}function Qt(o){return o==null?o===t?Nd:oy:Ni&&Ni in Ue(o)?nM(o):gM(o)}function yu(o,c){return o>c}function Mv(o,c){return o!=null&&Ze.call(o,c)}function Nv(o,c){return o!=null&&c in Ue(o)}function Dv(o,c,p){return o>=Ht(c,p)&&o<gt(c,p)}function Qr(o,c,p){for(var v=p?bs:Qa,C=o[0].length,I=o.length,q=I,D=z(I),H=1/0,Q=[];q--;){var Z=o[q];q&&c&&(Z=ct(Z,vr(c))),H=Ht(Z.length,H),D[q]=!p&&(c||C>=120&&Z.length>=120)?new Fi(q&&Z):t}Z=o[0];var ee=-1,ie=D[0];e:for(;++ee<C&&Q.length<H;){var ue=Z[ee],ye=c?c(ue):ue;if(ue=p||ue!==0?ue:0,!(ie?tt(ie,ye):v(Q,ye,p))){for(q=I;--q;){var Ie=D[q];if(!(Ie?tt(Ie,ye):v(o[q],ye,p)))continue e}ie&&ie.push(ye),Q.push(ue)}}return Q}function Es(o,c,p,v){return mn(o,function(C,I,q){c(v,p(C),I,q)}),v}function Do(o,c,p){c=ks(c,o),o=RC(o,c);var v=o==null?o:o[Un(yn(c))];return v==null?t:gr(v,o,p)}function Tp(o){return Ot(o)&&Qt(o)==hr}function Fv(o){return Ot(o)&&Qt(o)==ki}function Lv(o){return Ot(o)&&Qt(o)==Ir}function Fo(o,c,p,v,C){return o===c?!0:o==null||c==null||!Ot(o)&&!Ot(c)?o!==o&&c!==c:vu(o,c,p,v,Fo,C)}function vu(o,c,p,v,C,I){var q=Re(o),D=Re(c),H=q?ui:or(o),Q=D?ui:or(c);H=H==hr?kn:H,Q=Q==hr?kn:Q;var Z=H==kn,ee=Q==kn,ie=H==Q;if(ie&&As(o)){if(!As(c))return!1;q=!0,Z=!1}if(ie&&!Z)return I||(I=new Yr),q||xl(o)?gC(o,c,p,v,C,I):tM(o,c,H,p,v,C,I);if(!(p&S)){var ue=Z&&Ze.call(o,"__wrapped__"),ye=ee&&Ze.call(c,"__wrapped__");if(ue||ye){var Ie=ue?o.value():o,me=ye?c.value():c;return I||(I=new Yr),C(Ie,me,p,v,I)}}return ie?(I||(I=new Yr),rM(o,c,p,v,C,I)):!1}function Os(o){return Ot(o)&&or(o)==Jt}function Is(o,c,p,v){var C=p.length,I=C,q=!v;if(o==null)return!I;for(o=Ue(o);C--;){var D=p[C];if(q&&D[2]?D[1]!==o[D[0]]:!(D[0]in o))return!1}for(;++C<I;){D=p[C];var H=D[0],Q=o[H],Z=D[1];if(q&&D[2]){if(Q===t&&!(H in o))return!1}else{var ee=new Yr;if(v)var ie=v(Q,Z,H,o,c,ee);if(!(ie===t?Fo(Z,Q,S|_,v,ee):ie))return!1}}return!0}function Fe(o){if(!Ct(o)||fM(o))return!1;var c=Bi(o)?iv:Ld;return c.test(jo(o))}function u(o){return Ot(o)&&Qt(o)==Gt}function h(o){return Ot(o)&&or(o)==mr}function b(o){return Ot(o)&&Jp(o.length)&&!!ft[Qt(o)]}function w(o){return typeof o=="function"?o:o==null?Mr:typeof o=="object"?Re(o)?Me(o[0],o[1]):ve(o):lE(o)}function E(o){if(!wu(o))return hp(o);var c=[];for(var p in Ue(o))Ze.call(o,p)&&p!="constructor"&&c.push(p);return c}function M(o){if(!Ct(o))return mM(o);var c=wu(o),p=[];for(var v in o)v=="constructor"&&(c||!Ze.call(o,v))||p.push(v);return p}function J(o,c){return o<c}function oe(o,c){var p=-1,v=qr(o)?z(o.length):[];return bi(o,function(C,I,q){v[++p]=c(C,I,q)}),v}function ve(o){var c=eb(o);return c.length==1&&c[0][2]?wC(c[0][0],c[0][1]):function(p){return p===o||Is(p,o,c)}}function Me(o,c){return rb(o)&&SC(c)?wC(Un(o),c):function(p){var v=pb(p,o);return v===t&&v===c?hb(p,o):Fo(c,v,S|_)}}function Dt(o,c,p,v,C){o!==c&&gu(c,function(I,q){if(C||(C=new Yr),Ct(I))Ln(o,c,q,p,Dt,v,C);else{var D=v?v(ib(o,q),I,q+"",o,c,C):t;D===t&&(D=I),pu(o,q,D)}},$r)}function Ln(o,c,p,v,C,I,q){var D=ib(o,p),H=ib(c,p),Q=q.get(H);if(Q){pu(o,p,Q);return}var Z=I?I(D,H,p+"",o,c,q):t,ee=Z===t;if(ee){var ie=Re(H),ue=!ie&&As(H),ye=!ie&&!ue&&xl(H);Z=H,ie||ue||ye?Re(D)?Z=D:qt(D)?Z=Ar(D):ue?(ee=!1,Z=eC(H,!0)):ye?(ee=!1,Z=tC(H,!0)):Z=[]:Ru(H)||Uo(H)?(Z=D,Uo(D)?Z=QC(D):(!Ct(D)||Bi(D))&&(Z=bC(H))):ee=!1}ee&&(q.set(H,Z),C(Z,H,v,I,q),q.delete(H)),pu(o,p,Z)}function jn(o,c){var p=o.length;if(p)return c+=c<0?p:0,Hi(c,p)?o[c]:t}function Vx(o,c,p){c.length?c=ct(c,function(I){return Re(I)?function(q){return Li(q,I.length===1?I[0]:I)}:I}):c=[Mr];var v=-1;c=ct(c,vr(ge()));var C=oe(o,function(I,q,D){var H=ct(c,function(Q){return Q(I)});return{criteria:H,index:++v,value:I}});return jy(C,function(I,q){return J$(I,q,p)})}function M$(o,c){return Wx(o,c,function(p,v){return hb(o,v)})}function Wx(o,c,p){for(var v=-1,C=c.length,I={};++v<C;){var q=c[v],D=Li(o,q);p(D,q)&&bu(I,ks(q,o),D)}return I}function N$(o){return function(c){return Li(c,o)}}function jv(o,c,p,v){var C=v?Ly:$i,I=-1,q=c.length,D=o;for(o===c&&(c=Ar(c)),p&&(D=ct(o,vr(p)));++I<q;)for(var H=0,Q=c[I],Z=p?p(Q):Q;(H=C(D,Z,H,v))>-1;)D!==o&&cl.call(D,H,1),cl.call(o,H,1);return o}function zx(o,c){for(var p=o?c.length:0,v=p-1;p--;){var C=c[p];if(p==v||C!==I){var I=C;Hi(C)?cl.call(o,C,1):Vv(o,C)}}return o}function Uv(o,c){return o+To(gp()*(c-o+1))}function D$(o,c,p,v){for(var C=-1,I=gt(ko((c-o)/(p||1)),0),q=z(I);I--;)q[v?I:++C]=o,o+=p;return q}function Hv(o,c){var p="";if(!o||c<1||c>et)return p;do c%2&&(p+=o),c=To(c/2),c&&(o+=o);while(c);return p}function Te(o,c){return sb(_C(o,c,Mr),o+"")}function F$(o){return xp(Cl(o))}function L$(o,c){var p=Cl(o);return Up(p,vi(c,0,p.length))}function bu(o,c,p,v){if(!Ct(o))return o;c=ks(c,o);for(var C=-1,I=c.length,q=I-1,D=o;D!=null&&++C<I;){var H=Un(c[C]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(C!=q){var Z=D[H];Q=v?v(Z,H,D):t,Q===t&&(Q=Ct(Z)?Z:Hi(c[C+1])?[]:{})}wr(D,H,Q),D=D[H]}return o}var Jx=hl?function(o,c){return hl.set(o,c),o}:Mr,j$=ul?function(o,c){return ul(o,"toString",{configurable:!0,enumerable:!1,value:gb(c),writable:!0})}:Mr;function U$(o){return Up(Cl(o))}function gn(o,c,p){var v=-1,C=o.length;c<0&&(c=-c>C?0:C+c),p=p>C?C:p,p<0&&(p+=C),C=c>p?0:p-c>>>0,c>>>=0;for(var I=z(C);++v<C;)I[v]=o[v+c];return I}function H$(o,c){var p;return bi(o,function(v,C,I){return p=c(v,C,I),!p}),!!p}function Ap(o,c,p){var v=0,C=o==null?v:o.length;if(typeof c=="number"&&c===c&&C<=Et){for(;v<C;){var I=v+C>>>1,q=o[I];q!==null&&!Xr(q)&&(p?q<=c:q<c)?v=I+1:C=I}return C}return Bv(o,c,Mr,p)}function Bv(o,c,p,v){var C=0,I=o==null?0:o.length;if(I===0)return 0;c=p(c);for(var q=c!==c,D=c===null,H=Xr(c),Q=c===t;C<I;){var Z=To((C+I)/2),ee=p(o[Z]),ie=ee!==t,ue=ee===null,ye=ee===ee,Ie=Xr(ee);if(q)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!ue):H?me=ye&&ie&&!ue&&(v||!Ie):ue||Ie?me=!1:me=v?ee<=c:ee<c;me?C=Z+1:I=Z}return Ht(I,vt)}function Gx(o,c){for(var p=-1,v=o.length,C=0,I=[];++p<v;){var q=o[p],D=c?c(q):q;if(!p||!Hn(D,H)){var H=D;I[C++]=q===0?0:q}}return I}function Yx(o){return typeof o=="number"?o:Xr(o)?he:+o}function Zr(o){if(typeof o=="string")return o;if(Re(o))return ct(o,Zr)+"";if(Xr(o))return yp?yp.call(o):"";var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function Ps(o,c,p){var v=-1,C=Qa,I=o.length,q=!0,D=[],H=D;if(p)q=!1,C=bs;else if(I>=r){var Q=c?null:X$(o);if(Q)return rl(Q);q=!1,C=tt,H=new Fi}else H=c?[]:D;e:for(;++v<I;){var Z=o[v],ee=c?c(Z):Z;if(Z=p||Z!==0?Z:0,q&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;c&&H.push(ee),D.push(Z)}else C(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function Vv(o,c){c=ks(c,o);var p=-1,v=c.length;if(!v)return!0;for(;++p<v;){var C=Un(c[p]);if(C==="__proto__"&&!Ze.call(o,"__proto__")||(C==="constructor"||C==="prototype")&&p<v-1)return!1}var I=RC(o,c);return I==null||delete I[Un(yn(c))]}function Kx(o,c,p,v){return bu(o,c,p(Li(o,c)),v)}function qp(o,c,p,v){for(var C=o.length,I=v?C:-1;(v?I--:++I<C)&&c(o[I],I,o););return p?gn(o,v?0:I,v?I+1:C):gn(o,v?I+1:0,v?C:I)}function Qx(o,c){var p=o;return p instanceof $e&&(p=p.value()),nu(c,function(v,C){return C.func.apply(C.thisArg,pi([v],C.args))},p)}function Wv(o,c,p){var v=o.length;if(v<2)return v?Ps(o[0]):[];for(var C=-1,I=z(v);++C<v;)for(var q=o[C],D=-1;++D<v;)D!=C&&(I[C]=No(I[C]||q,o[D],c,p));return Ps(Bt(I,1),c,p)}function Zx(o,c,p){for(var v=-1,C=o.length,I=c.length,q={};++v<C;){var D=v<I?c[v]:t;p(q,o[v],D)}return q}function zv(o){return qt(o)?o:[]}function Jv(o){return typeof o=="function"?o:Mr}function ks(o,c){return Re(o)?o:rb(o,c)?[o]:OC(nt(o))}var B$=Te;function Ts(o,c,p){var v=o.length;return p=p===t?v:p,!c&&p>=v?o:gn(o,c,p)}var Xx=sv||function(o){return Nt.clearTimeout(o)};function eC(o,c){if(c)return o.slice();var p=o.length,v=fp?fp(p):new o.constructor(p);return o.copy(v),v}function Gv(o){var c=new o.constructor(o.byteLength);return new al(c).set(new al(o)),c}function V$(o,c){var p=c?Gv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function W$(o){var c=new o.constructor(o.source,Fd.exec(o));return c.lastIndex=o.lastIndex,c}function z$(o){return Mo?Ue(Mo.call(o)):{}}function tC(o,c){var p=c?Gv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function rC(o,c){if(o!==c){var p=o!==t,v=o===null,C=o===o,I=Xr(o),q=c!==t,D=c===null,H=c===c,Q=Xr(c);if(!D&&!Q&&!I&&o>c||I&&q&&H&&!D&&!Q||v&&q&&H||!p&&H||!C)return 1;if(!v&&!I&&!Q&&o<c||Q&&p&&C&&!v&&!I||D&&p&&C||!q&&C||!H)return-1}return 0}function J$(o,c,p){for(var v=-1,C=o.criteria,I=c.criteria,q=C.length,D=p.length;++v<q;){var H=rC(C[v],I[v]);if(H){if(v>=D)return H;var Q=p[v];return H*(Q=="desc"?-1:1)}}return o.index-c.index}function nC(o,c,p,v){for(var C=-1,I=o.length,q=p.length,D=-1,H=c.length,Q=gt(I-q,0),Z=z(H+Q),ee=!v;++D<H;)Z[D]=c[D];for(;++C<q;)(ee||C<I)&&(Z[p[C]]=o[C]);for(;Q--;)Z[D++]=o[C++];return Z}function iC(o,c,p,v){for(var C=-1,I=o.length,q=-1,D=p.length,H=-1,Q=c.length,Z=gt(I-D,0),ee=z(Z+Q),ie=!v;++C<Z;)ee[C]=o[C];for(var ue=C;++H<Q;)ee[ue+H]=c[H];for(;++q<D;)(ie||C<I)&&(ee[ue+p[q]]=o[C++]);return ee}function Ar(o,c){var p=-1,v=o.length;for(c||(c=z(v));++p<v;)c[p]=o[p];return c}function Si(o,c,p,v){var C=!p;p||(p={});for(var I=-1,q=c.length;++I<q;){var D=c[I],H=v?v(p[D],o[D],D,p,o):t;H===t&&(H=o[D]),C?Kr(p,D,H):wr(p,D,H)}return p}function G$(o,c){return Si(o,tb(o),c)}function Y$(o,c){return Si(o,yC(o),c)}function $p(o,c){return function(p,v){var C=Re(p)?Mn:Cp,I=c?c():{};return C(p,o,ge(v,2),I)}}function wl(o){return Te(function(c,p){var v=-1,C=p.length,I=C>1?p[C-1]:t,q=C>2?p[2]:t;for(I=o.length>3&&typeof I=="function"?(C--,I):t,q&&_r(p[0],p[1],q)&&(I=C<3?t:I,C=1),c=Ue(c);++v<C;){var D=p[v];D&&o(c,D,v,I)}return c})}function sC(o,c){return function(p,v){if(p==null)return p;if(!qr(p))return o(p,v);for(var C=p.length,I=c?C:-1,q=Ue(p);(c?I--:++I<C)&&v(q[I],I,q)!==!1;);return p}}function oC(o){return function(c,p,v){for(var C=-1,I=Ue(c),q=v(c),D=q.length;D--;){var H=q[o?D:++C];if(p(I[H],H,I)===!1)break}return c}}function K$(o,c,p){var v=c&R,C=Su(o);function I(){var q=this&&this!==Nt&&this instanceof I?C:o;return q.apply(v?p:this,arguments)}return I}function aC(o){return function(c){c=nt(c);var p=Ss(c)?br(c):t,v=p?p[0]:c.charAt(0),C=p?Ts(p,1).join(""):c.slice(1);return v[o]()+C}}function _l(o){return function(c){return nu(oE(sE(c).replace(Cy,"")),o,"")}}function Su(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Cs(o.prototype),v=o.apply(p,c);return Ct(v)?v:p}}function Q$(o,c,p){var v=Su(o);function C(){for(var I=arguments.length,q=z(I),D=I,H=Rl(C);D--;)q[D]=arguments[D];var Q=I<3&&q[0]!==H&&q[I-1]!==H?[]:dn(q,H);if(I-=Q.length,I<p)return dC(o,c,Mp,C.placeholder,t,q,Q,t,t,p-I);var Z=this&&this!==Nt&&this instanceof C?v:o;return gr(Z,this,q)}return C}function lC(o){return function(c,p,v){var C=Ue(c);if(!qr(c)){var I=ge(p,3);c=Kt(c),p=function(D){return I(C[D],D,C)}}var q=o(c,p,v);return q>-1?C[I?c[q]:q]:t}}function cC(o){return Ui(function(c){var p=c.length,v=p,C=ir.prototype.thru;for(o&&c.reverse();v--;){var I=c[v];if(typeof I!="function")throw new Sr(i);if(C&&!q&&Lp(I)=="wrapper")var q=new ir([],!0)}for(v=q?v:p;++v<p;){I=c[v];var D=Lp(I),H=D=="wrapper"?Xv(I):t;H&&nb(H[0])&&H[1]==(X|U|V|T)&&!H[4].length&&H[9]==1?q=q[Lp(H[0])].apply(q,H[3]):q=I.length==1&&nb(I)?q[D]():q.thru(I)}return function(){var Q=arguments,Z=Q[0];if(q&&Q.length==1&&Re(Z))return q.plant(Z).value();for(var ee=0,ie=p?c[ee].apply(this,Q):Z;++ee<p;)ie=c[ee].call(this,ie);return ie}})}function Mp(o,c,p,v,C,I,q,D,H,Q){var Z=c&X,ee=c&R,ie=c&P,ue=c&(U|B),ye=c&x,Ie=ie?t:Su(o);function me(){for(var Le=arguments.length,He=z(Le),en=Le;en--;)He[en]=arguments[en];if(ue)var Rr=Rl(me),tn=ap(He,Rr);if(v&&(He=nC(He,v,C,ue)),I&&(He=iC(He,I,q,ue)),Le-=tn,ue&&Le<Q){var $t=dn(He,Rr);return dC(o,c,Mp,me.placeholder,p,He,$t,D,H,Q-Le)}var Bn=ee?p:this,Wi=ie?Bn[o]:o;return Le=He.length,D?He=yM(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Nt&&this instanceof me&&(Wi=Ie||Su(Wi)),Wi.apply(Bn,He)}return me}function uC(o,c){return function(p,v){return Es(p,o,c(v),{})}}function Np(o,c){return function(p,v){var C;if(p===t&&v===t)return c;if(p!==t&&(C=p),v!==t){if(C===t)return v;typeof p=="string"||typeof v=="string"?(p=Zr(p),v=Zr(v)):(p=Yx(p),v=Yx(v)),C=o(p,v)}return C}}function Yv(o){return Ui(function(c){return c=ct(c,vr(ge())),Te(function(p){var v=this;return o(c,function(C){return gr(C,v,p)})})})}function Dp(o,c){c=c===t?" ":Zr(c);var p=c.length;if(p<2)return p?Hv(c,o):c;var v=Hv(c,ko(o/hi(c)));return Ss(c)?Ts(br(v),0,o).join(""):v.slice(0,o)}function Z$(o,c,p,v){var C=c&R,I=Su(o);function q(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=z(Z+H),ie=this&&this!==Nt&&this instanceof q?I:o;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return gr(ie,C?p:this,ee)}return q}function fC(o){return function(c,p,v){return v&&typeof v!="number"&&_r(c,p,v)&&(p=v=t),c=Vi(c),p===t?(p=c,c=0):p=Vi(p),v=v===t?c<p?1:-1:Vi(v),D$(c,p,v,o)}}function Fp(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=vn(c),p=vn(p)),o(c,p)}}function dC(o,c,p,v,C,I,q,D,H,Q){var Z=c&U,ee=Z?q:t,ie=Z?t:q,ue=Z?I:t,ye=Z?t:I;c|=Z?V:W,c&=~(Z?W:V),c&A||(c&=~(R|P));var Ie=[o,c,C,ue,ee,ye,ie,D,H,Q],me=p.apply(t,Ie);return nb(o)&&xC(me,Ie),me.placeholder=v,CC(me,o,c)}function Kv(o){var c=rt[o];return function(p,v){if(p=vn(p),v=v==null?0:Ht(Ee(v),292),v&&Di(p)){var C=(nt(p)+"e").split("e"),I=c(C[0]+"e"+(+C[1]+v));return C=(nt(I)+"e").split("e"),+(C[0]+"e"+(+C[1]-v))}return c(p)}}var X$=Rs&&1/rl(new Rs([,-0]))[1]==pe?function(o){return new Rs(o)}:bb;function pC(o){return function(c){var p=or(c);return p==Jt?ws(c):p==mr?lp(c):Uy(c,o(c))}}function ji(o,c,p,v,C,I,q,D){var H=c&P;if(!H&&typeof o!="function")throw new Sr(i);var Q=v?v.length:0;if(Q||(c&=~(V|W),v=C=t),q=q===t?q:gt(Ee(q),0),D=D===t?D:Ee(D),Q-=C?C.length:0,c&W){var Z=v,ee=C;v=C=t}var ie=H?t:Xv(o),ue=[o,c,p,v,C,Z,ee,I,q,D];if(ie&&hM(ue,ie),o=ue[0],c=ue[1],p=ue[2],v=ue[3],C=ue[4],D=ue[9]=ue[9]===t?H?0:o.length:gt(ue[9]-Q,0),!D&&c&(U|B)&&(c&=~(U|B)),!c||c==R)var ye=K$(o,c,p);else c==U||c==B?ye=Q$(o,c,D):(c==V||c==(R|V))&&!C.length?ye=Z$(o,c,p,v):ye=Mp.apply(t,ue);var Ie=ie?Jx:xC;return CC(Ie(ye,ue),o,c)}function hC(o,c,p,v){return o===t||Hn(o,_s[p])&&!Ze.call(v,p)?c:o}function mC(o,c,p,v,C,I){return Ct(o)&&Ct(c)&&(I.set(c,o),Dt(o,c,t,mC,I),I.delete(c)),o}function eM(o){return Ru(o)?t:o}function gC(o,c,p,v,C,I){var q=p&S,D=o.length,H=c.length;if(D!=H&&!(q&&H>D))return!1;var Q=I.get(o),Z=I.get(c);if(Q&&Z)return Q==c&&Z==o;var ee=-1,ie=!0,ue=p&_?new Fi:t;for(I.set(o,c),I.set(c,o);++ee<D;){var ye=o[ee],Ie=c[ee];if(v)var me=q?v(Ie,ye,ee,c,o,I):v(ye,Ie,ee,o,c,I);if(me!==t){if(me)continue;ie=!1;break}if(ue){if(!Za(c,function(Le,He){if(!tt(ue,He)&&(ye===Le||C(ye,Le,p,v,I)))return ue.push(He)})){ie=!1;break}}else if(!(ye===Ie||C(ye,Ie,p,v,I))){ie=!1;break}}return I.delete(o),I.delete(c),ie}function tM(o,c,p,v,C,I,q){switch(p){case Tn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case ki:return!(o.byteLength!=c.byteLength||!I(new al(o),new al(c)));case Gr:case Ir:case fo:return Hn(+o,+c);case mt:return o.name==c.name&&o.message==c.message;case Gt:case po:return o==c+"";case Jt:var D=ws;case mr:var H=v&S;if(D||(D=rl),o.size!=c.size&&!H)return!1;var Q=q.get(o);if(Q)return Q==c;v|=_,q.set(o,c);var Z=gC(D(o),D(c),v,C,I,q);return q.delete(o),Z;case Da:if(Mo)return Mo.call(o)==Mo.call(c)}return!1}function rM(o,c,p,v,C,I){var q=p&S,D=Qv(o),H=D.length,Q=Qv(c),Z=Q.length;if(H!=Z&&!q)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(q?ie in c:Ze.call(c,ie)))return!1}var ue=I.get(o),ye=I.get(c);if(ue&&ye)return ue==c&&ye==o;var Ie=!0;I.set(o,c),I.set(c,o);for(var me=q;++ee<H;){ie=D[ee];var Le=o[ie],He=c[ie];if(v)var en=q?v(He,Le,ie,c,o,I):v(Le,He,ie,o,c,I);if(!(en===t?Le===He||C(Le,He,p,v,I):en)){Ie=!1;break}me||(me=ie=="constructor")}if(Ie&&!me){var Rr=o.constructor,tn=c.constructor;Rr!=tn&&"constructor"in o&&"constructor"in c&&!(typeof Rr=="function"&&Rr instanceof Rr&&typeof tn=="function"&&tn instanceof tn)&&(Ie=!1)}return I.delete(o),I.delete(c),Ie}function Ui(o){return sb(_C(o,t,TC),o+"")}function Qv(o){return kp(o,Kt,tb)}function Zv(o){return kp(o,$r,yC)}var Xv=hl?function(o){return hl.get(o)}:bb;function Lp(o){for(var c=o.name+"",p=xs[c],v=Ze.call(xs,c)?p.length:0;v--;){var C=p[v],I=C.func;if(I==null||I==o)return C.name}return c}function Rl(o){var c=Ze.call(O,"placeholder")?O:o;return c.placeholder}function ge(){var o=O.iteratee||yb;return o=o===yb?w:o,arguments.length?o(arguments[0],arguments[1]):o}function jp(o,c){var p=o.__data__;return uM(c)?p[typeof c=="string"?"string":"hash"]:p.map}function eb(o){for(var c=Kt(o),p=c.length;p--;){var v=c[p],C=o[v];c[p]=[v,C,SC(C)]}return c}function Lo(o,c){var p=xo(o,c);return Fe(p)?p:t}function nM(o){var c=Ze.call(o,Ni),p=o[Ni];try{o[Ni]=t;var v=!0}catch{}var C=sl.call(o);return v&&(c?o[Ni]=p:delete o[Ni]),C}var tb=fl?function(o){return o==null?[]:(o=Ue(o),di(fl(o),function(c){return Io.call(o,c)}))}:Sb,yC=fl?function(o){for(var c=[];o;)pi(c,tb(o)),o=ll(o);return c}:Sb,or=Qt;(cu&&or(new cu(new ArrayBuffer(1)))!=Tn||Ao&&or(new Ao)!=Jt||uu&&or(uu.resolve())!=$d||Rs&&or(new Rs)!=mr||qo&&or(new qo)!=Ut)&&(or=function(o){var c=Qt(o),p=c==kn?o.constructor:t,v=p?jo(p):"";if(v)switch(v){case uv:return Tn;case fv:return Jt;case dv:return $d;case pv:return mr;case hv:return Ut}return c});function iM(o,c,p){for(var v=-1,C=p.length;++v<C;){var I=p[v],q=I.size;switch(I.type){case"drop":o+=q;break;case"dropRight":c-=q;break;case"take":c=Ht(c,o+q);break;case"takeRight":o=gt(o,c-q);break}}return{start:o,end:c}}function sM(o){var c=o.match(An);return c?c[1].split(un):[]}function vC(o,c,p){c=ks(c,o);for(var v=-1,C=c.length,I=!1;++v<C;){var q=Un(c[v]);if(!(I=o!=null&&p(o,q)))break;o=o[q]}return I||++v!=C?I:(C=o==null?0:o.length,!!C&&Jp(C)&&Hi(q,C)&&(Re(o)||Uo(o)))}function oM(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Ze.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function bC(o){return typeof o.constructor=="function"&&!wu(o)?Cs(ll(o)):{}}function aM(o,c,p){var v=o.constructor;switch(c){case ki:return Gv(o);case Gr:case Ir:return new v(+o);case Tn:return V$(o,p);case ot:case Fa:case La:case ds:case ho:case ps:case fi:case hs:case Hc:return tC(o,p);case Jt:return new v;case fo:case po:return new v(o);case Gt:return W$(o);case mr:return new v;case Da:return z$(o)}}function lM(o,c){var p=c.length;if(!p)return o;var v=p-1;return c[v]=(p>1?"& ":"")+c[v],c=c.join(p>2?", ":" "),o.replace(Yt,`{
1
+ var TL=Object.create;var Qp=Object.defineProperty;var AL=Object.getOwnPropertyDescriptor;var qL=Object.getOwnPropertyNames;var $L=Object.getPrototypeOf,ML=Object.prototype.hasOwnProperty;var it=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var F=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},qs=(t,e)=>{for(var r in e)Qp(t,r,{get:e[r],enumerable:!0})},fE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qL(e))!ML.call(t,i)&&i!==r&&Qp(t,i,{get:()=>e[i],enumerable:!(n=AL(e,i))||n.enumerable});return t};var _b=(t,e,r)=>(r=t!=null?TL($L(t)):{},fE(e||!t||!t.__esModule?Qp(r,"default",{value:t,enumerable:!0}):r,t)),El=t=>fE(Qp({},"__esModule",{value:!0}),t);function It(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function dt(t){let e=Date.now().toString(36)+(NL++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${It(t)}_${e}`:e}function Rb(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function xu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),l=n[a];l&&delete r[l],n[a]=i,r[i]=s}return r}function DL(t){return JSON.parse(JSON.stringify(t))}function FL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function LL(t,e){try{return JSON.parse(t)}catch{return e}}function jL(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function UL(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var NL,bn=se(()=>{"use strict";NL=0});import*as Xe from"fs";import*as rn from"path";function Xp(t){if(!Xe.existsSync(t))return;let e={},r=rn.join(t,Zp.preRequest);Xe.existsSync(r)&&(e.preRequest=Xe.readFileSync(r,"utf-8"));let n=rn.join(t,Zp.postResponse);return Xe.existsSync(n)&&(e.postResponse=Xe.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function eh(t,e){await Xe.promises.mkdir(t,{recursive:!0});let r=rn.join(t,Zp.preRequest);e.preRequest?await Xe.promises.writeFile(r,e.preRequest,"utf-8"):Xe.existsSync(r)&&await Xe.promises.unlink(r);let n=rn.join(t,Zp.postResponse);e.postResponse?await Xe.promises.writeFile(n,e.postResponse,"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n)}function pE(t){for(let[e,r]of Object.entries(dE)){let n=rn.join(t,e);if(Xe.existsSync(n))try{let i=Xe.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function hE(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function mE(t,e){for(let r of Object.keys(dE))if(r!==e){let n=rn.join(t,r);if(Xe.existsSync(n))try{await Xe.promises.unlink(n)}catch{}}}function gE(t){if(Xe.existsSync(t))try{let e=Xe.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function yE(t,e,r){let n=rn.join(t,Cu.responseSchema),i=rn.join(t,Cu.bodySchema);e?await Xe.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n),r?await Xe.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):Xe.existsSync(i)&&await Xe.promises.unlink(i)}function xb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=xb(r.items,e);if(n)return n}}}function Cb(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&Cb(n.items,e))return!0}return!1}function vE(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function Eb(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===nn)continue;if(n.name===e)return rn.join(t,n.name);let i=Eb(rn.join(t,n.name),e);if(i)return i}}function HL(t){for(let e of[xr.request,xr.folder]){let r=rn.join(t,e);if(Xe.existsSync(r))try{let n=Xe.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function Ob(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===nn)continue;let i=rn.join(t,n.name);if(HL(i)===e)return i;let s=Ob(i,e);if(s)return s}}function Sn(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let y of s){let S=parseInt(y.substring(1));S>a&&(a=S)}let l="";if(a>0)l=`t${a}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=f.split("-").filter(y=>y.length>0),m=[];i&&m.push(i),m.push(...d),l&&m.push(l);let g=m.join("-");if(g||(g="item"),e.includes(g)){let y=2;for(;e.includes(`${g}-${y}`);)y++;g=`${g}-${y}`}return g}var Zp,xr,dE,Cu,nn,Bo=se(()=>{"use strict";Zp={preRequest:"pre-request.js",postResponse:"post-response.js"},xr={collection:"collection.json",folder:"folder.json",request:"request.json"},dE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},Cu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},nn="scripts"});import*as xe from"fs";import*as Pe from"path";var $s,th=se(()=>{"use strict";bn();Bo();$s=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){xe.existsSync(this.collectionsDir)||xe.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=xe.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!xe.existsSync(this.collectionsDir))return[];let e=xe.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=Pe.join(this.collectionsDir,e),n=Pe.join(r,xr.collection);if(!xe.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Pe.join(r,nn)),a=this.loadItemsFromDir(r,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=xe.readdirSync(e,{withFileTypes:!0});for(let l of a){if(!l.isDirectory()||l.name===nn)continue;let f=Pe.join(e,l.name);if(xe.existsSync(Pe.join(f,xr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(xe.existsSync(Pe.join(f,xr.request))){let d=this.loadRequestFromDir(f,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let f=s.get(l);f&&(i.push(f),s.delete(l))}for(let l of s.values())i.push(l)}else for(let l of s.values())i.push(l);return i}loadFolderFromDir(e,r){let n=Pe.join(e,xr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:a}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=Pe.join(e,xr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,nn)),a=i.body,l=this.loadBodyFromDir(e);l&&(a=l);let f=this.loadSchemaFile(Pe.join(e,Cu.responseSchema)),d=this.loadSchemaFile(Pe.join(e,Cu.bodySchema)),m=Pe.join(e,"doc.md"),g=xe.existsSync(m)?xe.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:a,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,...g&&{doc:g},...f&&{responseSchema:f},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Xp(e)}loadBodyFromDir(e){return pE(e)}loadSchemaFile(e){return gE(e)}async saveSchemaFiles(e,r){return yE(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=dt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=xe.readdirSync(this.collectionsDir);r=Sn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Pe.join(this.collectionsDir,r),i=!xe.existsSync(n);await xe.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[a]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Pe.join(n,nn),e.scripts):Promise.resolve()]);a.length>0&&(s.order=a),await xe.promises.writeFile(Pe.join(n,xr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let a of r){let l=this.idToSlugMap.get(a.id);l||(l=Sn(a.name,i),this.idToSlugMap.set(a.id,l),this.slugToIdMap.set(l,a.id)),i.push(l),s.push({item:a,slug:l})}return await Promise.all(s.map(async({item:a,slug:l})=>{let f=Pe.join(e,l);await xe.promises.mkdir(f,{recursive:!0}),a.type==="folder"?await this.saveFolderToDir(f,a,n):await this.saveRequestToDir(f,a,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(Pe.join(e,nn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await xe.promises.writeFile(Pe.join(e,xr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),a={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}},l=[xe.promises.writeFile(Pe.join(e,xr.request),JSON.stringify(a,null,2),"utf-8")];s&&l.push(xe.promises.writeFile(Pe.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(xe.promises.writeFile(Pe.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Pe.join(e,nn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return hE(e)}async cleanupOldBodyFiles(e,r){return mE(e,r)}async saveScriptsToDir(e,r){return eh(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=Pe.join(this.collectionsDir,r);if(!xe.existsSync(n))return!1;try{return await xe.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?xe.existsSync(Pe.join(this.collectionsDir,r,xr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Pe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||dt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(Pe.join(s,nn),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Pe.join(n,nn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=Pe.join(this.collectionsDir,i),a=Pe.join(s,xr.collection),l=xe.readFileSync(a,"utf-8"),d={...JSON.parse(l),...r,id:e};await xe.promises.writeFile(a,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let m=this.findItemPath(e,n);if(!m)throw new Error(`Parent folder ${n} not found`);a=m}else a=Pe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let m=xe.readdirSync(a).filter(g=>xe.statSync(Pe.join(a,g)).isDirectory()&&g!==nn);l=Sn(r.name,m),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Pe.join(a,l);await xe.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,r);else if(n){let m=this.findItemById(i.items,n);m&&m.type==="folder"&&(m.items=m.items||[],m.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!xe.existsSync(i))return!1;try{await xe.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:l,type:f,items:d,...m}=n;return Object.assign(a,m),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!xe.existsSync(a))return!1;let l;if(n){let m=this.findItemPath(e,n);if(!m)return!1;l=m}else l=Pe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let d=Pe.join(l,f);if(xe.existsSync(d))return!1;try{await xe.promises.rename(a,d);let m=this.findItemById(i.items,r);if(m){let g=m.type==="folder"?{...m,items:m.items?[...m.items]:[]}:{...m};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(g))}else i.items.push(g)}return!0}catch(m){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,m),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&a.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Pe.join(l,xr.folder),d=xe.readFileSync(f,"utf-8"),m=JSON.parse(d);m.order=a,await xe.promises.writeFile(f,JSON.stringify(m,null,2),"utf-8");let g=this.findItemById(i.items,r);g&&g.type==="folder"&&g.items&&(g.items=this.sortItemsByOrder(g.items,n))}else{let l=Pe.join(this.collectionsDir,s,xr.collection),f=xe.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=a,await xe.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return vE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Pe.join(this.collectionsDir,n),s=Ob(i,r);if(s)return s;let a=this.load(e);if(a){let f=this.buildSlugPath(a.items,r);if(f)return Pe.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Eb(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return xb(e,r)}deleteItemFromTree(e,r){return Cb(e,r)}}});var at,Vo=se(()=>{"use strict";at=class{static parseSetCookie(e,r){let n=e.split(";").map(m=>m.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let l=i.substring(0,a).trim(),f=i.substring(a+1).trim(),d={name:l,value:f,domain:r};for(let m of s){let g=m.indexOf("="),y=(g===-1?m:m.substring(0,g)).toLowerCase(),S=g===-1?"":m.substring(g+1);switch(y){case"domain":d.domain=S.startsWith(".")?S.substring(1):S;break;case"path":d.path=S;break;case"expires":d.expires=S;break;case"max-age":d.maxAge=parseInt(S,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=S;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let l=this.parseSetCookie(a,r);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}}});import*as Ms from"fs";import*as Wo from"path";function nh(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Pu(t){if(!Ms.existsSync(t))return VL();let e=rh(Wo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Ms.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!nh(d)),s={};for(let d of i){let m=rh(Wo.join(t,d))||{},g=Wo.basename(d,".json");s[g]={description:m.description,requiresConfirmation:m.requiresConfirmation,variables:m.variables||{},secretVariables:m.secretVariables}}let l=(rh(Wo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let m=Wo.join(t,`${d}.local.json`);if(Ms.existsSync(m)){let g=rh(m)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function VL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function rh(t){try{if(!Ms.existsSync(t))return null;let e=Ms.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var ih=se(()=>{"use strict"});var Vn,Il=se(()=>{"use strict";Vn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",l=e.indexOf("?");l!==-1&&(a=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,m=s.replace(d,(g,y,S)=>{let _=r[y];return _!==void 0&&_!==""?encodeURIComponent(_):S?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),g)});return m=m.replace(/([^:])\/+/g,"$1/"),m.length>1&&m.endsWith("/")&&(m=m.slice(0,-1)),`${n}${i}${m}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,d]=e.split("?");n=f,d&&new URLSearchParams(d).forEach((g,y)=>{i[y]=g})}let s={...i,...r},a=new URLSearchParams;for(let[f,d]of Object.entries(s))d!=null&&a.append(f,d);let l=a.toString();return l?`${n}?${l}`:n}}});function SE(t,e=0){return(Zt[t[e+0]]+Zt[t[e+1]]+Zt[t[e+2]]+Zt[t[e+3]]+"-"+Zt[t[e+4]]+Zt[t[e+5]]+"-"+Zt[t[e+6]]+Zt[t[e+7]]+"-"+Zt[t[e+8]]+Zt[t[e+9]]+"-"+Zt[t[e+10]]+Zt[t[e+11]]+Zt[t[e+12]]+Zt[t[e+13]]+Zt[t[e+14]]+Zt[t[e+15]]).toLowerCase()}var Zt,wE=se(()=>{Zt=[];for(let t=0;t<256;++t)Zt.push((t+256).toString(16).slice(1))});function kb(){return crypto.getRandomValues(WL)}var WL,_E=se(()=>{WL=new Uint8Array(16)});function zL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():JL(t,e,r)}function JL(t,e,r){t=t||{};let n=t.random??t.rng?.()??kb();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return SE(n)}var Pl,RE=se(()=>{_E();wE();Pl=zL});var Tb=se(()=>{RE()});function GL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function YL(){return Date.now()}function xE(){return Pl()}function KL(){return Pl()}function CE(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function QL(){let t=CE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function ZL(){return Math.random()<.5}function XL(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function ej(){return Math.floor(Date.now()/1e3)}function tj(){return new Date().toISOString()}function rj(){return new Date().toISOString().split("T")[0]}function nj(){return new Date().toISOString().split("T")[1].split(".")[0]}function ij(){return new Date().toISOString()}function sj(t=""){return Buffer.from(String(t)).toString("base64")}function oj(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function aj(t=""){return encodeURIComponent(String(t))}function lj(t=""){return decodeURIComponent(String(t))}function cj(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Ji(t,e){let r=EE[t];return r?e&&e.length>0?r(...e):r():null}function uj(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?cj(n):void 0,s=Ji(r,i);return s===null?e:String(s)}catch{return e}})}function zo(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let l=Ji(a);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var EE,sh=se(()=>{"use strict";Tb();EE={randomInt:GL,timestamp:YL,guid:KL,uuid:xE,randomUUID:xE,randomString:CE,randomHexadecimal:XL,randomEmail:QL,randomBoolean:ZL,isoTimestamp:ij,timestamp_s:ej,datetime:tj,date:rj,time:nj,base64Encode:sj,base64Decode:oj,urlEncode:aj,urlDecode:lj}});import*as oh from"vm";function Jo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Go(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=oh.createContext(r);return oh.runInContext(t,n,{timeout:fj,displayErrors:!1})}catch{return}}var fj,ah=se(()=>{"use strict";fj=100});import*as lh from"crypto";function dj(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Tu(t){if(!t||!t.includes("|"))return null;let e=pj(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=hj(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function pj(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let l=t[a],f=a>0?t[a-1]:"",d=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function hj(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:mj(n)}}function mj(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function Pt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=dj(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Au(t,e,r={}){let n=t;for(let i of e)n=gj(n,i.name,i.args,r);return n}function gj(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=Pt(r[0],n),s=r[1]!==void 0?Pt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(Pt(r[0],n)):"",s=r[1]!==void 0?String(Pt(r[1],n)):"";return String(t).replace(new RegExp(vj(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Pt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Pt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(Pt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Pt(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Pt(r[0],n);return Number(t)+i}case"subtract":{let i=Pt(r[0],n);return Number(t)-i}case"multiply":{let i=Pt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?Pt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Pt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return lh.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Pt(r[0],n)):"",s=String(r[1]!==void 0?Pt(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Pt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return lh.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=Pt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Pt(r[0],n),s=r[1]!==void 0?Pt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:yj(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Pt(s,n)));return i.length===1?t.map(s=>ku(s,i[0])):t.map(s=>{let a={};for(let l of i){let f=ku(s,l);f!==void 0&&(a[l]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Pt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>ku(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?ku(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function yj(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,l=Pt(a,r);return t.filter(f=>{let d=ku(f,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function ku(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function vj(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ch=se(()=>{"use strict"});function OE(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function bj(t){return new Yo(t)}var Yo,Ko,qu=se(()=>{"use strict";sh();ah();ch();Yo=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let a=this.resolveSinglePass(i,r,n);if(a===i)break;i=a}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,d)=>this.resolveTemplateContent(d.trim(),r,f));let i="",s=0,a=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=a.exec(e))!==null;){let f=l[1].trim(),d=this.resolveTemplateContent(f,r,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let m=this.getStringContext(e,l.index);i+=m?this.escapeForString(String(d),m):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=OE(i[2],r),f=Ji(i[1],l);return f!==null?String(f):n}let s=Tu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Au(l,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let l=a[1];if(r[l]!==void 0){let f=this.deserializeValue(r[l]),d=a[2],m=this.resolvePropertyAccess(f,d);if(m!==void 0)return typeof m=="object"?JSON.stringify(m):String(m)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(Jo(e)){let l=this.deserializeVariables(r),f=zo(e,l),d=Go(e,f);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=OE(n[2],r),a=Ji(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(a,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(Jo(e)){let s=this.deserializeVariables(r),a=zo(e,s),l=Go(e,a);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},Ko=class{interpolate(e,r){return!e||typeof e!="string"?e:new Yo({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});import*as Sj from"http";import*as $u from"https";import{URL as IE}from"url";import*as uh from"zlib";var Wn,Qo,Mu=se(()=>{"use strict";Wn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Qo=class{settings;version;constructor(e){this.settings={...Wn,...e};try{this.version=it("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new IE(e.url),l=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(g=>g.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let m={hostname:a.hostname,port:a.port||(l?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(m.headers["Accept-Encoding"]="gzip, deflate"),l&&(m.rejectUnauthorized=r.strictSSL,r.strictSSL?m.agent=$u.globalAgent:m.agent=new $u.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let R=new Error("Request cancelled");R.name="AbortError",y(R);return}let _=(l?$u:Sj).request(m,async R=>{let P=R.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(P)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let U=R.headers.location;if(!U){y(new Error("Redirect response missing Location header"));return}let B=new IE(U,e.url).toString(),V=e.method;!r.followOriginalMethod&&[301,302,303].includes(P)&&(V="GET");let W={...e.headers};r.followAuthHeader||(delete W.authorization,delete W.Authorization);try{let X=await this.executeInternal({...e,url:B,method:V,headers:W,body:V==="GET"?void 0:e.body},r,n+1,i),T=Date.now();X.time=T-s,g(X)}catch(X){y(X)}return}let A=[];R.on("data",U=>A.push(U)),R.on("end",()=>{let U=Date.now(),B=Buffer.concat(A),V=R.headers["content-encoding"];if(r.decompress&&V)try{V==="gzip"?B=uh.gunzipSync(B):V==="deflate"&&(B=uh.inflateSync(B))}catch(x){console.warn("[NodeHttpClient] Decompression failed:",x)}let W=B.toString("utf-8"),X={};for(let[x,k]of Object.entries(R.headers))(typeof k=="string"||Array.isArray(k))&&(X[x]=k);let T=this.parseCookies(R.headers["set-cookie"],a.hostname);g({status:R.statusCode||0,statusText:R.statusMessage||"",headers:X,cookies:T,body:W,time:U-s,size:B.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let R=new Error("Request cancelled");R.name="AbortError",y(R)}),_.on("error",R=>{y(R)}),_.on("timeout",()=>{_.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let R=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(R)}_.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(m=>m.trim()),[s,...a]=i,[l,f]=s.split("="),d={name:l.trim(),value:f?.trim()||"",domain:r};for(let m of a){let[g,y]=m.split("=");switch(g.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});function Ab(t){return{timeout:t?.timeout??Wn.timeout,followRedirects:t?.followRedirects??Wn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Wn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Wn.followAuthHeader,maxRedirects:t?.maxRedirects??Wn.maxRedirects,strictSSL:t?.strictSSL??Wn.strictSSL,decompress:t?.decompress??Wn.decompress,includeCookies:t?.includeCookies??Wn.includeCookies}}var qb=se(()=>{"use strict";Mu()});var Gi,Nu=se(()=>{"use strict";qb();Gi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=Ab(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var Yi,$b,Mb,Nb,Du=se(()=>{"use strict";Yi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},$b=class{name="logging";priority=1e3;intercept(e,r){return e}},Mb=class{name="timing";priority=1;intercept(e,r,n){return e}},Nb=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var PE=F((kl,Fu)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",m=1,g=2,y=4,S=1,_=2,R=1,P=2,A=4,U=8,B=16,V=32,W=64,X=128,T=256,x=512,k=30,N="...",j=800,$=16,G=1,K=2,ne=3,pe=1/0,et=9007199254740991,_e=17976931348623157e292,he=NaN,Ce=4294967295,vt=Ce-1,Et=Ce>>>1,ce=[["ary",X],["bind",R],["bindKey",P],["curry",U],["curryRight",B],["flip",x],["partial",V],["partialRight",W],["rearg",T]],hr="[object Arguments]",ui="[object Array]",Rt="[object AsyncFunction]",Gr="[object Boolean]",Ir="[object Date]",ht="[object DOMException]",mt="[object Error]",ln="[object Function]",fo="[object GeneratorFunction]",Jt="[object Map]",po="[object Number]",oy="[object Null]",kn="[object Object]",Nd="[object Promise]",Dd="[object Proxy]",Gt="[object RegExp]",mr="[object Set]",ho="[object String]",Da="[object Symbol]",Fd="[object Undefined]",Ut="[object WeakMap]",Ld="[object WeakSet]",ki="[object ArrayBuffer]",Tn="[object DataView]",ot="[object Float32Array]",Fa="[object Float64Array]",La="[object Int8Array]",ds="[object Int16Array]",mo="[object Int32Array]",ps="[object Uint8Array]",fi="[object Uint8ClampedArray]",hs="[object Uint16Array]",Hc="[object Uint32Array]",ja=/\b__p \+= '';/g,ay=/\b(__p \+=) '' \+/g,go=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ti=/&(?:amp|lt|gt|quot|#39);/g,Ua=/[&<>"']/g,Ha=RegExp(Ti.source),le=RegExp(Ua.source),ly=/<%-([\s\S]+?)%>/g,cy=/<%([\s\S]+?)%>/g,cn=/<%=([\s\S]+?)%>/g,Pr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,Bc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,yo=RegExp(Ke.source),Vc=/^\s+/,Ba=/\s/,Yt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,An=/\{\n\/\* \[wrapped with (.+)\] \*/,un=/,? & /,At=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kr=/[()=,{}\[\]\/\s]/,qn=/\\(\\)?/g,Ai=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jd=/\w*$/,uy=/^[-+]0x[0-9a-f]+$/i,vo=/^0b[01]+$/i,Ud=/^\[object .+?Constructor\]$/,fy=/^0o[0-7]+$/i,ms=/^(?:0|[1-9]\d*)$/,bo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,So=/($^)/,dy=/['\n\r\u2028\u2029\\]/g,Va="\\ud800-\\udfff",py="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",Wc="\\u20d0-\\u20ff",Hd=py+xt+Wc,zc="\\u2700-\\u27bf",Jc="a-z\\xdf-\\xf6\\xf8-\\xff",hy="\\xac\\xb1\\xd7\\xf7",my="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",gy="\\u2000-\\u206f",yy=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Bd="A-Z\\xc0-\\xd6\\xd8-\\xde",Vd="\\ufe0e\\ufe0f",Gc=hy+my+gy+yy,Wa="['\u2019]",vy="["+Va+"]",Wd="["+Gc+"]",za="["+Hd+"]",Yc="\\d+",by="["+zc+"]",gs="["+Jc+"]",wo="[^"+Va+Gc+Yc+zc+Jc+Bd+"]",Ja="\\ud83c[\\udffb-\\udfff]",_o="(?:"+za+"|"+Ja+")",fn="[^"+Va+"]",Kc="(?:\\ud83c[\\udde6-\\uddff]){2}",Qc="[\\ud800-\\udbff][\\udc00-\\udfff]",ys="["+Bd+"]",zd="\\u200d",Jd="(?:"+gs+"|"+wo+")",Sy="(?:"+ys+"|"+wo+")",Gd="(?:"+Wa+"(?:d|ll|m|re|s|t|ve))?",Yd="(?:"+Wa+"(?:D|LL|M|RE|S|T|VE))?",Ga=_o+"?",Kd="["+Vd+"]?",Qd="(?:"+zd+"(?:"+[fn,Kc,Qc].join("|")+")"+Kd+Ga+")*",wy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_y="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Zd=Kd+Ga+Qd,Ry="(?:"+[by,Kc,Qc].join("|")+")"+Zd,xy="(?:"+[fn+za+"?",za,Kc,Qc,vy].join("|")+")",Cy=RegExp(Wa,"g"),Ey=RegExp(za,"g"),Zc=RegExp(Ja+"(?="+Ja+")|"+xy+Zd,"g"),Oy=RegExp([ys+"?"+gs+"+"+Gd+"(?="+[Wd,ys,"$"].join("|")+")",Sy+"+"+Yd+"(?="+[Wd,ys+Jd,"$"].join("|")+")",ys+"?"+Jd+"+"+Gd,ys+"+"+Yd,_y,wy,Yc,Ry].join("|"),"g"),Iy=RegExp("["+zd+Va+Hd+Vd+"]"),Py=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ky=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ty=-1,ft={};ft[ot]=ft[Fa]=ft[La]=ft[ds]=ft[mo]=ft[ps]=ft[fi]=ft[hs]=ft[Hc]=!0,ft[hr]=ft[ui]=ft[ki]=ft[Gr]=ft[Tn]=ft[Ir]=ft[mt]=ft[ln]=ft[Jt]=ft[po]=ft[kn]=ft[Gt]=ft[mr]=ft[ho]=ft[Ut]=!1;var lt={};lt[hr]=lt[ui]=lt[ki]=lt[Tn]=lt[Gr]=lt[Ir]=lt[ot]=lt[Fa]=lt[La]=lt[ds]=lt[mo]=lt[Jt]=lt[po]=lt[kn]=lt[Gt]=lt[mr]=lt[ho]=lt[Da]=lt[ps]=lt[fi]=lt[hs]=lt[Hc]=!0,lt[mt]=lt[ln]=lt[Ut]=!1;var Xc={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},eu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ay={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Xd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ep=parseFloat,qy=parseInt,tp=typeof global=="object"&&global&&global.Object===Object&&global,$y=typeof self=="object"&&self&&self.Object===Object&&self,Nt=tp||$y||Function("return this")(),Ya=typeof kl=="object"&&kl&&!kl.nodeType&&kl,Qe=Ya&&typeof Fu=="object"&&Fu&&!Fu.nodeType&&Fu,vs=Qe&&Qe.exports===Ya,qi=vs&&tp.process,Tr=(function(){try{var L=Qe&&Qe.require&&Qe.require("util").types;return L||qi&&qi.binding&&qi.binding("util")}catch{}})(),tu=Tr&&Tr.isArrayBuffer,rp=Tr&&Tr.isDate,np=Tr&&Tr.isMap,Ro=Tr&&Tr.isRegExp,$n=Tr&&Tr.isSet,Ka=Tr&&Tr.isTypedArray;function gr(L,Y,z){switch(z.length){case 0:return L.call(Y);case 1:return L.call(Y,z[0]);case 2:return L.call(Y,z[0],z[1]);case 3:return L.call(Y,z[0],z[1],z[2])}return L.apply(Y,z)}function Mn(L,Y,z,ae){for(var be=-1,Ge=L==null?0:L.length;++be<Ge;){var rt=L[be];Y(ae,rt,z(rt),L)}return ae}function yr(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae&&Y(L[z],z,L)!==!1;);return L}function ru(L,Y){for(var z=L==null?0:L.length;z--&&Y(L[z],z,L)!==!1;);return L}function ip(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(!Y(L[z],z,L))return!1;return!0}function di(L,Y){for(var z=-1,ae=L==null?0:L.length,be=0,Ge=[];++z<ae;){var rt=L[z];Y(rt,z,L)&&(Ge[be++]=rt)}return Ge}function Qa(L,Y){var z=L==null?0:L.length;return!!z&&$i(L,Y,0)>-1}function bs(L,Y,z){for(var ae=-1,be=L==null?0:L.length;++ae<be;)if(z(Y,L[ae]))return!0;return!1}function ct(L,Y){for(var z=-1,ae=L==null?0:L.length,be=Array(ae);++z<ae;)be[z]=Y(L[z],z,L);return be}function pi(L,Y){for(var z=-1,ae=Y.length,be=L.length;++z<ae;)L[be+z]=Y[z];return L}function nu(L,Y,z,ae){var be=-1,Ge=L==null?0:L.length;for(ae&&Ge&&(z=L[++be]);++be<Ge;)z=Y(z,L[be],be,L);return z}function My(L,Y,z,ae){var be=L==null?0:L.length;for(ae&&be&&(z=L[--be]);be--;)z=Y(z,L[be],be,L);return z}function Za(L,Y){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(Y(L[z],z,L))return!0;return!1}var Ny=xo("length");function Dy(L){return L.split("")}function Fy(L){return L.match(At)||[]}function sp(L,Y,z){var ae;return z(L,function(be,Ge,rt){if(Y(be,Ge,rt))return ae=Ge,!1}),ae}function Xa(L,Y,z,ae){for(var be=L.length,Ge=z+(ae?1:-1);ae?Ge--:++Ge<be;)if(Y(L[Ge],Ge,L))return Ge;return-1}function $i(L,Y,z){return Y===Y?Jy(L,Y,z):Xa(L,Mi,z)}function Ly(L,Y,z,ae){for(var be=z-1,Ge=L.length;++be<Ge;)if(ae(L[be],Y))return be;return-1}function Mi(L){return L!==L}function op(L,Y){var z=L==null?0:L.length;return z?su(L,Y)/z:he}function xo(L){return function(Y){return Y==null?t:Y[L]}}function iu(L){return function(Y){return L==null?t:L[Y]}}function el(L,Y,z,ae,be){return be(L,function(Ge,rt,Ue){z=ae?(ae=!1,Ge):Y(z,Ge,rt,Ue)}),z}function jy(L,Y){var z=L.length;for(L.sort(Y);z--;)L[z]=L[z].value;return L}function su(L,Y){for(var z,ae=-1,be=L.length;++ae<be;){var Ge=Y(L[ae]);Ge!==t&&(z=z===t?Ge:z+Ge)}return z}function ou(L,Y){for(var z=-1,ae=Array(L);++z<L;)ae[z]=Y(z);return ae}function Uy(L,Y){return ct(Y,function(z){return[z,L[z]]})}function au(L){return L&&L.slice(0,fp(L)+1).replace(Vc,"")}function vr(L){return function(Y){return L(Y)}}function tl(L,Y){return ct(Y,function(z){return L[z]})}function tt(L,Y){return L.has(Y)}function ap(L,Y){for(var z=-1,ae=L.length;++z<ae&&$i(Y,L[z],0)>-1;);return z}function lp(L,Y){for(var z=L.length;z--&&$i(Y,L[z],0)>-1;);return z}function cp(L,Y){for(var z=L.length,ae=0;z--;)L[z]===Y&&++ae;return ae}var Hy=iu(Xc),By=iu(eu);function Vy(L){return"\\"+Xd[L]}function Co(L,Y){return L==null?t:L[Y]}function Ss(L){return Iy.test(L)}function Wy(L){return Py.test(L)}function zy(L){for(var Y,z=[];!(Y=L.next()).done;)z.push(Y.value);return z}function ws(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae,be){z[++Y]=[be,ae]}),z}function Eo(L,Y){return function(z){return L(Y(z))}}function dn(L,Y){for(var z=-1,ae=L.length,be=0,Ge=[];++z<ae;){var rt=L[z];(rt===Y||rt===d)&&(L[z]=d,Ge[be++]=z)}return Ge}function rl(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=ae}),z}function up(L){var Y=-1,z=Array(L.size);return L.forEach(function(ae){z[++Y]=[ae,ae]}),z}function Jy(L,Y,z){for(var ae=z-1,be=L.length;++ae<be;)if(L[ae]===Y)return ae;return-1}function lu(L,Y,z){for(var ae=z+1;ae--;)if(L[ae]===Y)return ae;return ae}function hi(L){return Ss(L)?Yy(L):Ny(L)}function br(L){return Ss(L)?Ky(L):Dy(L)}function fp(L){for(var Y=L.length;Y--&&Ba.test(L.charAt(Y)););return Y}var Gy=iu(Ay);function Yy(L){for(var Y=Zc.lastIndex=0;Zc.test(L);)++Y;return Y}function Ky(L){return L.match(Zc)||[]}function Qy(L){return L.match(Oy)||[]}var Zy=(function L(Y){Y=Y==null?Nt:mi.defaults(Nt.Object(),Y,mi.pick(Nt,ky));var z=Y.Array,ae=Y.Date,be=Y.Error,Ge=Y.Function,rt=Y.Math,Ue=Y.Object,nl=Y.RegExp,Xy=Y.String,Sr=Y.TypeError,Oo=z.prototype,ev=Ge.prototype,_s=Ue.prototype,Io=Y["__core-js_shared__"],il=ev.toString,Ze=_s.hasOwnProperty,tv=0,dp=(function(){var o=/[^.]+$/.exec(Io&&Io.keys&&Io.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),sl=_s.toString,rv=il.call(Ue),nv=Nt._,iv=nl("^"+il.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ol=vs?Y.Buffer:t,gi=Y.Symbol,al=Y.Uint8Array,pp=ol?ol.allocUnsafe:t,ll=Eo(Ue.getPrototypeOf,Ue),hp=Ue.create,Po=_s.propertyIsEnumerable,cl=Oo.splice,mp=gi?gi.isConcatSpreadable:t,ko=gi?gi.iterator:t,Ni=gi?gi.toStringTag:t,ul=(function(){try{var o=jo(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),sv=Y.clearTimeout!==Nt.clearTimeout&&Y.clearTimeout,ov=ae&&ae.now!==Nt.Date.now&&ae.now,av=Y.setTimeout!==Nt.setTimeout&&Y.setTimeout,To=rt.ceil,Ao=rt.floor,fl=Ue.getOwnPropertySymbols,dl=ol?ol.isBuffer:t,Di=Y.isFinite,pl=Oo.join,gp=Eo(Ue.keys,Ue),gt=rt.max,Ht=rt.min,yp=ae.now,lv=Y.parseInt,vp=rt.random,cv=Oo.reverse,cu=jo(Y,"DataView"),qo=jo(Y,"Map"),uu=jo(Y,"Promise"),Rs=jo(Y,"Set"),$o=jo(Y,"WeakMap"),Mo=jo(Ue,"create"),hl=$o&&new $o,xs={},uv=Uo(cu),fv=Uo(qo),dv=Uo(uu),pv=Uo(Rs),hv=Uo($o),ml=gi?gi.prototype:t,No=ml?ml.valueOf:t,bp=ml?ml.toString:t;function O(o){if(Ot(o)&&!Re(o)&&!(o instanceof $e)){if(o instanceof ir)return o;if(Ze.call(o,"__wrapped__"))return PC(o)}return new ir(o)}var Cs=(function(){function o(){}return function(c){if(!Ct(c))return{};if(hp)return hp(c);o.prototype=c;var p=new o;return o.prototype=t,p}})();function gl(){}function ir(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=t}O.templateSettings={escape:ly,evaluate:cy,interpolate:cn,variable:"",imports:{_:O}},O.prototype=gl.prototype,O.prototype.constructor=O,ir.prototype=Cs(gl.prototype),ir.prototype.constructor=ir;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ce,this.__views__=[]}function mv(){var o=new $e(this.__wrapped__);return o.__actions__=Ar(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Ar(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Ar(this.__views__),o}function gv(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function fu(){var o=this.__wrapped__.value(),c=this.__dir__,p=Re(o),v=c<0,C=p?o.length:0,I=sM(0,C,this.__views__),q=I.start,D=I.end,H=D-q,Q=v?D:q-1,Z=this.__iteratees__,ee=Z.length,ie=0,ue=Ht(H,this.__takeCount__);if(!p||!v&&C==H&&ue==H)return Zx(o,this.__actions__);var ye=[];e:for(;H--&&ie<ue;){Q+=c;for(var Ie=-1,me=o[Q];++Ie<ee;){var Le=Z[Ie],He=Le.iteratee,en=Le.type,Rr=He(me);if(en==K)me=Rr;else if(!Rr){if(en==G)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=Cs(gl.prototype),$e.prototype.constructor=$e;function pn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function yv(){this.__data__=Mo?Mo(null):{},this.size=0}function vv(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function bv(o){var c=this.__data__;if(Mo){var p=c[o];return p===l?t:p}return Ze.call(c,o)?c[o]:t}function Sv(o){var c=this.__data__;return Mo?c[o]!==t:Ze.call(c,o)}function wv(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=Mo&&c===t?l:c,this}pn.prototype.clear=yv,pn.prototype.delete=vv,pn.prototype.get=bv,pn.prototype.has=Sv,pn.prototype.set=wv;function Nn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function Sp(){this.__data__=[],this.size=0}function _v(o){var c=this.__data__,p=vl(c,o);if(p<0)return!1;var v=c.length-1;return p==v?c.pop():cl.call(c,p,1),--this.size,!0}function Rv(o){var c=this.__data__,p=vl(c,o);return p<0?t:c[p][1]}function wp(o){return vl(this.__data__,o)>-1}function xv(o,c){var p=this.__data__,v=vl(p,o);return v<0?(++this.size,p.push([o,c])):p[v][1]=c,this}Nn.prototype.clear=Sp,Nn.prototype.delete=_v,Nn.prototype.get=Rv,Nn.prototype.has=wp,Nn.prototype.set=xv;function Dn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function Cv(){this.size=0,this.__data__={hash:new pn,map:new(qo||Nn),string:new pn}}function yi(o){var c=Hp(this,o).delete(o);return this.size-=c?1:0,c}function _p(o){return Hp(this,o).get(o)}function Ev(o){return Hp(this,o).has(o)}function Ov(o,c){var p=Hp(this,o),v=p.size;return p.set(o,c),this.size+=p.size==v?0:1,this}Dn.prototype.clear=Cv,Dn.prototype.delete=yi,Dn.prototype.get=_p,Dn.prototype.has=Ev,Dn.prototype.set=Ov;function Fi(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new Dn;++c<p;)this.add(o[c])}function te(o){return this.__data__.set(o,l),this}function Iv(o){return this.__data__.has(o)}Fi.prototype.add=Fi.prototype.push=te,Fi.prototype.has=Iv;function Yr(o){var c=this.__data__=new Nn(o);this.size=c.size}function Rp(){this.__data__=new Nn,this.size=0}function Ve(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function yl(o){return this.__data__.get(o)}function xp(o){return this.__data__.has(o)}function du(o,c){var p=this.__data__;if(p instanceof Nn){var v=p.__data__;if(!qo||v.length<r-1)return v.push([o,c]),this.size=++p.size,this;p=this.__data__=new Dn(v)}return p.set(o,c),this.size=p.size,this}Yr.prototype.clear=Rp,Yr.prototype.delete=Ve,Yr.prototype.get=yl,Yr.prototype.has=xp,Yr.prototype.set=du;function Cp(o,c){var p=Re(o),v=!p&&Ho(o),C=!p&&!v&&As(o),I=!p&&!v&&!C&&xl(o),q=p||v||C||I,D=q?ou(o.length,Xy):[],H=D.length;for(var Q in o)(c||Ze.call(o,Q))&&!(q&&(Q=="length"||C&&(Q=="offset"||Q=="parent")||I&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Hi(Q,H)))&&D.push(Q);return D}function Ep(o){var c=o.length;return c?o[Uv(0,c-1)]:t}function Pv(o,c){return Bp(Ar(o),vi(c,0,o.length))}function kv(o){return Bp(Ar(o))}function pu(o,c,p){(p!==t&&!Hn(o[c],p)||p===t&&!(c in o))&&Kr(o,c,p)}function wr(o,c,p){var v=o[c];(!(Ze.call(o,c)&&Hn(v,p))||p===t&&!(c in o))&&Kr(o,c,p)}function vl(o,c){for(var p=o.length;p--;)if(Hn(o[p][0],c))return p;return-1}function Op(o,c,p,v){return bi(o,function(C,I,q){c(v,C,p(C),q)}),v}function Ip(o,c){return o&&Si(c,Kt(c),o)}function Tv(o,c){return o&&Si(c,$r(c),o)}function Kr(o,c,p){c=="__proto__"&&ul?ul(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function hu(o,c){for(var p=-1,v=c.length,C=z(v),I=o==null;++p<v;)C[p]=I?t:pb(o,c[p]);return C}function vi(o,c,p){return o===o&&(p!==t&&(o=o<=p?o:p),c!==t&&(o=o>=c?o:c)),o}function sr(o,c,p,v,C,I){var q,D=c&m,H=c&g,Q=c&y;if(p&&(q=C?p(o,v,C,I):p(o)),q!==t)return q;if(!Ct(o))return o;var Z=Re(o);if(Z){if(q=aM(o),!D)return Ar(o,q)}else{var ee=or(o),ie=ee==ln||ee==fo;if(As(o))return tC(o,D);if(ee==kn||ee==hr||ie&&!C){if(q=H||ie?{}:SC(o),!D)return H?K$(o,Tv(q,o)):Y$(o,Ip(q,o))}else{if(!lt[ee])return C?o:{};q=lM(o,ee,D)}}I||(I=new Yr);var ue=I.get(o);if(ue)return ue;I.set(o,q),YC(o)?o.forEach(function(me){q.add(sr(me,c,p,me,o,I))}):JC(o)&&o.forEach(function(me,Le){q.set(Le,sr(me,c,p,Le,o,I))});var ye=Q?H?Zv:Qv:H?$r:Kt,Ie=Z?t:ye(o);return yr(Ie||o,function(me,Le){Ie&&(Le=me,me=o[Le]),wr(q,Le,sr(me,c,p,Le,o,I))}),q}function Av(o){var c=Kt(o);return function(p){return hn(p,o,c)}}function hn(o,c,p){var v=p.length;if(o==null)return!v;for(o=Ue(o);v--;){var C=p[v],I=c[C],q=o[C];if(q===t&&!(C in o)||!I(q))return!1}return!0}function mu(o,c,p){if(typeof o!="function")throw new Sr(i);return _u(function(){o.apply(t,p)},c)}function Do(o,c,p,v){var C=-1,I=Qa,q=!0,D=o.length,H=[],Q=c.length;if(!D)return H;p&&(c=ct(c,vr(p))),v?(I=bs,q=!1):c.length>=r&&(I=tt,q=!1,c=new Fi(c));e:for(;++C<D;){var Z=o[C],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,q&&ee===ee){for(var ie=Q;ie--;)if(c[ie]===ee)continue e;H.push(Z)}else I(c,ee,v)||H.push(Z)}return H}var bi=oC(mn),Pp=oC(Fn,!0);function qv(o,c){var p=!0;return bi(o,function(v,C,I){return p=!!c(v,C,I),p}),p}function bl(o,c,p){for(var v=-1,C=o.length;++v<C;){var I=o[v],q=c(I);if(q!=null&&(D===t?q===q&&!Xr(q):p(q,D)))var D=q,H=I}return H}function $v(o,c,p,v){var C=o.length;for(p=Ee(p),p<0&&(p=-p>C?0:C+p),v=v===t||v>C?C:Ee(v),v<0&&(v+=C),v=p>v?0:QC(v);p<v;)o[p++]=c;return o}function kp(o,c){var p=[];return bi(o,function(v,C,I){c(v,C,I)&&p.push(v)}),p}function Bt(o,c,p,v,C){var I=-1,q=o.length;for(p||(p=uM),C||(C=[]);++I<q;){var D=o[I];c>0&&p(D)?c>1?Bt(D,c-1,p,v,C):pi(C,D):v||(C[C.length]=D)}return C}var gu=aC(),Tp=aC(!0);function mn(o,c){return o&&gu(o,c,Kt)}function Fn(o,c){return o&&Tp(o,c,Kt)}function Sl(o,c){return di(c,function(p){return Bi(o[p])})}function Li(o,c){c=ks(c,o);for(var p=0,v=c.length;o!=null&&p<v;)o=o[Un(c[p++])];return p&&p==v?o:t}function Ap(o,c,p){var v=c(o);return Re(o)?v:pi(v,p(o))}function Qt(o){return o==null?o===t?Fd:oy:Ni&&Ni in Ue(o)?iM(o):yM(o)}function yu(o,c){return o>c}function Mv(o,c){return o!=null&&Ze.call(o,c)}function Nv(o,c){return o!=null&&c in Ue(o)}function Dv(o,c,p){return o>=Ht(c,p)&&o<gt(c,p)}function Qr(o,c,p){for(var v=p?bs:Qa,C=o[0].length,I=o.length,q=I,D=z(I),H=1/0,Q=[];q--;){var Z=o[q];q&&c&&(Z=ct(Z,vr(c))),H=Ht(Z.length,H),D[q]=!p&&(c||C>=120&&Z.length>=120)?new Fi(q&&Z):t}Z=o[0];var ee=-1,ie=D[0];e:for(;++ee<C&&Q.length<H;){var ue=Z[ee],ye=c?c(ue):ue;if(ue=p||ue!==0?ue:0,!(ie?tt(ie,ye):v(Q,ye,p))){for(q=I;--q;){var Ie=D[q];if(!(Ie?tt(Ie,ye):v(o[q],ye,p)))continue e}ie&&ie.push(ye),Q.push(ue)}}return Q}function Es(o,c,p,v){return mn(o,function(C,I,q){c(v,p(C),I,q)}),v}function Fo(o,c,p){c=ks(c,o),o=xC(o,c);var v=o==null?o:o[Un(yn(c))];return v==null?t:gr(v,o,p)}function qp(o){return Ot(o)&&Qt(o)==hr}function Fv(o){return Ot(o)&&Qt(o)==ki}function Lv(o){return Ot(o)&&Qt(o)==Ir}function Lo(o,c,p,v,C){return o===c?!0:o==null||c==null||!Ot(o)&&!Ot(c)?o!==o&&c!==c:vu(o,c,p,v,Lo,C)}function vu(o,c,p,v,C,I){var q=Re(o),D=Re(c),H=q?ui:or(o),Q=D?ui:or(c);H=H==hr?kn:H,Q=Q==hr?kn:Q;var Z=H==kn,ee=Q==kn,ie=H==Q;if(ie&&As(o)){if(!As(c))return!1;q=!0,Z=!1}if(ie&&!Z)return I||(I=new Yr),q||xl(o)?yC(o,c,p,v,C,I):rM(o,c,H,p,v,C,I);if(!(p&S)){var ue=Z&&Ze.call(o,"__wrapped__"),ye=ee&&Ze.call(c,"__wrapped__");if(ue||ye){var Ie=ue?o.value():o,me=ye?c.value():c;return I||(I=new Yr),C(Ie,me,p,v,I)}}return ie?(I||(I=new Yr),nM(o,c,p,v,C,I)):!1}function Os(o){return Ot(o)&&or(o)==Jt}function Is(o,c,p,v){var C=p.length,I=C,q=!v;if(o==null)return!I;for(o=Ue(o);C--;){var D=p[C];if(q&&D[2]?D[1]!==o[D[0]]:!(D[0]in o))return!1}for(;++C<I;){D=p[C];var H=D[0],Q=o[H],Z=D[1];if(q&&D[2]){if(Q===t&&!(H in o))return!1}else{var ee=new Yr;if(v)var ie=v(Q,Z,H,o,c,ee);if(!(ie===t?Lo(Z,Q,S|_,v,ee):ie))return!1}}return!0}function Fe(o){if(!Ct(o)||dM(o))return!1;var c=Bi(o)?iv:Ud;return c.test(Uo(o))}function u(o){return Ot(o)&&Qt(o)==Gt}function h(o){return Ot(o)&&or(o)==mr}function b(o){return Ot(o)&&Yp(o.length)&&!!ft[Qt(o)]}function w(o){return typeof o=="function"?o:o==null?Mr:typeof o=="object"?Re(o)?Me(o[0],o[1]):ve(o):cE(o)}function E(o){if(!wu(o))return gp(o);var c=[];for(var p in Ue(o))Ze.call(o,p)&&p!="constructor"&&c.push(p);return c}function M(o){if(!Ct(o))return gM(o);var c=wu(o),p=[];for(var v in o)v=="constructor"&&(c||!Ze.call(o,v))||p.push(v);return p}function J(o,c){return o<c}function oe(o,c){var p=-1,v=qr(o)?z(o.length):[];return bi(o,function(C,I,q){v[++p]=c(C,I,q)}),v}function ve(o){var c=eb(o);return c.length==1&&c[0][2]?_C(c[0][0],c[0][1]):function(p){return p===o||Is(p,o,c)}}function Me(o,c){return rb(o)&&wC(c)?_C(Un(o),c):function(p){var v=pb(p,o);return v===t&&v===c?hb(p,o):Lo(c,v,S|_)}}function Dt(o,c,p,v,C){o!==c&&gu(c,function(I,q){if(C||(C=new Yr),Ct(I))Ln(o,c,q,p,Dt,v,C);else{var D=v?v(ib(o,q),I,q+"",o,c,C):t;D===t&&(D=I),pu(o,q,D)}},$r)}function Ln(o,c,p,v,C,I,q){var D=ib(o,p),H=ib(c,p),Q=q.get(H);if(Q){pu(o,p,Q);return}var Z=I?I(D,H,p+"",o,c,q):t,ee=Z===t;if(ee){var ie=Re(H),ue=!ie&&As(H),ye=!ie&&!ue&&xl(H);Z=H,ie||ue||ye?Re(D)?Z=D:qt(D)?Z=Ar(D):ue?(ee=!1,Z=tC(H,!0)):ye?(ee=!1,Z=rC(H,!0)):Z=[]:Ru(H)||Ho(H)?(Z=D,Ho(D)?Z=ZC(D):(!Ct(D)||Bi(D))&&(Z=SC(H))):ee=!1}ee&&(q.set(H,Z),C(Z,H,v,I,q),q.delete(H)),pu(o,p,Z)}function jn(o,c){var p=o.length;if(p)return c+=c<0?p:0,Hi(c,p)?o[c]:t}function Wx(o,c,p){c.length?c=ct(c,function(I){return Re(I)?function(q){return Li(q,I.length===1?I[0]:I)}:I}):c=[Mr];var v=-1;c=ct(c,vr(ge()));var C=oe(o,function(I,q,D){var H=ct(c,function(Q){return Q(I)});return{criteria:H,index:++v,value:I}});return jy(C,function(I,q){return G$(I,q,p)})}function N$(o,c){return zx(o,c,function(p,v){return hb(o,v)})}function zx(o,c,p){for(var v=-1,C=c.length,I={};++v<C;){var q=c[v],D=Li(o,q);p(D,q)&&bu(I,ks(q,o),D)}return I}function D$(o){return function(c){return Li(c,o)}}function jv(o,c,p,v){var C=v?Ly:$i,I=-1,q=c.length,D=o;for(o===c&&(c=Ar(c)),p&&(D=ct(o,vr(p)));++I<q;)for(var H=0,Q=c[I],Z=p?p(Q):Q;(H=C(D,Z,H,v))>-1;)D!==o&&cl.call(D,H,1),cl.call(o,H,1);return o}function Jx(o,c){for(var p=o?c.length:0,v=p-1;p--;){var C=c[p];if(p==v||C!==I){var I=C;Hi(C)?cl.call(o,C,1):Vv(o,C)}}return o}function Uv(o,c){return o+Ao(vp()*(c-o+1))}function F$(o,c,p,v){for(var C=-1,I=gt(To((c-o)/(p||1)),0),q=z(I);I--;)q[v?I:++C]=o,o+=p;return q}function Hv(o,c){var p="";if(!o||c<1||c>et)return p;do c%2&&(p+=o),c=Ao(c/2),c&&(o+=o);while(c);return p}function Te(o,c){return sb(RC(o,c,Mr),o+"")}function L$(o){return Ep(Cl(o))}function j$(o,c){var p=Cl(o);return Bp(p,vi(c,0,p.length))}function bu(o,c,p,v){if(!Ct(o))return o;c=ks(c,o);for(var C=-1,I=c.length,q=I-1,D=o;D!=null&&++C<I;){var H=Un(c[C]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(C!=q){var Z=D[H];Q=v?v(Z,H,D):t,Q===t&&(Q=Ct(Z)?Z:Hi(c[C+1])?[]:{})}wr(D,H,Q),D=D[H]}return o}var Gx=hl?function(o,c){return hl.set(o,c),o}:Mr,U$=ul?function(o,c){return ul(o,"toString",{configurable:!0,enumerable:!1,value:gb(c),writable:!0})}:Mr;function H$(o){return Bp(Cl(o))}function gn(o,c,p){var v=-1,C=o.length;c<0&&(c=-c>C?0:C+c),p=p>C?C:p,p<0&&(p+=C),C=c>p?0:p-c>>>0,c>>>=0;for(var I=z(C);++v<C;)I[v]=o[v+c];return I}function B$(o,c){var p;return bi(o,function(v,C,I){return p=c(v,C,I),!p}),!!p}function $p(o,c,p){var v=0,C=o==null?v:o.length;if(typeof c=="number"&&c===c&&C<=Et){for(;v<C;){var I=v+C>>>1,q=o[I];q!==null&&!Xr(q)&&(p?q<=c:q<c)?v=I+1:C=I}return C}return Bv(o,c,Mr,p)}function Bv(o,c,p,v){var C=0,I=o==null?0:o.length;if(I===0)return 0;c=p(c);for(var q=c!==c,D=c===null,H=Xr(c),Q=c===t;C<I;){var Z=Ao((C+I)/2),ee=p(o[Z]),ie=ee!==t,ue=ee===null,ye=ee===ee,Ie=Xr(ee);if(q)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!ue):H?me=ye&&ie&&!ue&&(v||!Ie):ue||Ie?me=!1:me=v?ee<=c:ee<c;me?C=Z+1:I=Z}return Ht(I,vt)}function Yx(o,c){for(var p=-1,v=o.length,C=0,I=[];++p<v;){var q=o[p],D=c?c(q):q;if(!p||!Hn(D,H)){var H=D;I[C++]=q===0?0:q}}return I}function Kx(o){return typeof o=="number"?o:Xr(o)?he:+o}function Zr(o){if(typeof o=="string")return o;if(Re(o))return ct(o,Zr)+"";if(Xr(o))return bp?bp.call(o):"";var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function Ps(o,c,p){var v=-1,C=Qa,I=o.length,q=!0,D=[],H=D;if(p)q=!1,C=bs;else if(I>=r){var Q=c?null:eM(o);if(Q)return rl(Q);q=!1,C=tt,H=new Fi}else H=c?[]:D;e:for(;++v<I;){var Z=o[v],ee=c?c(Z):Z;if(Z=p||Z!==0?Z:0,q&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;c&&H.push(ee),D.push(Z)}else C(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function Vv(o,c){c=ks(c,o);var p=-1,v=c.length;if(!v)return!0;for(;++p<v;){var C=Un(c[p]);if(C==="__proto__"&&!Ze.call(o,"__proto__")||(C==="constructor"||C==="prototype")&&p<v-1)return!1}var I=xC(o,c);return I==null||delete I[Un(yn(c))]}function Qx(o,c,p,v){return bu(o,c,p(Li(o,c)),v)}function Mp(o,c,p,v){for(var C=o.length,I=v?C:-1;(v?I--:++I<C)&&c(o[I],I,o););return p?gn(o,v?0:I,v?I+1:C):gn(o,v?I+1:0,v?C:I)}function Zx(o,c){var p=o;return p instanceof $e&&(p=p.value()),nu(c,function(v,C){return C.func.apply(C.thisArg,pi([v],C.args))},p)}function Wv(o,c,p){var v=o.length;if(v<2)return v?Ps(o[0]):[];for(var C=-1,I=z(v);++C<v;)for(var q=o[C],D=-1;++D<v;)D!=C&&(I[C]=Do(I[C]||q,o[D],c,p));return Ps(Bt(I,1),c,p)}function Xx(o,c,p){for(var v=-1,C=o.length,I=c.length,q={};++v<C;){var D=v<I?c[v]:t;p(q,o[v],D)}return q}function zv(o){return qt(o)?o:[]}function Jv(o){return typeof o=="function"?o:Mr}function ks(o,c){return Re(o)?o:rb(o,c)?[o]:IC(nt(o))}var V$=Te;function Ts(o,c,p){var v=o.length;return p=p===t?v:p,!c&&p>=v?o:gn(o,c,p)}var eC=sv||function(o){return Nt.clearTimeout(o)};function tC(o,c){if(c)return o.slice();var p=o.length,v=pp?pp(p):new o.constructor(p);return o.copy(v),v}function Gv(o){var c=new o.constructor(o.byteLength);return new al(c).set(new al(o)),c}function W$(o,c){var p=c?Gv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function z$(o){var c=new o.constructor(o.source,jd.exec(o));return c.lastIndex=o.lastIndex,c}function J$(o){return No?Ue(No.call(o)):{}}function rC(o,c){var p=c?Gv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function nC(o,c){if(o!==c){var p=o!==t,v=o===null,C=o===o,I=Xr(o),q=c!==t,D=c===null,H=c===c,Q=Xr(c);if(!D&&!Q&&!I&&o>c||I&&q&&H&&!D&&!Q||v&&q&&H||!p&&H||!C)return 1;if(!v&&!I&&!Q&&o<c||Q&&p&&C&&!v&&!I||D&&p&&C||!q&&C||!H)return-1}return 0}function G$(o,c,p){for(var v=-1,C=o.criteria,I=c.criteria,q=C.length,D=p.length;++v<q;){var H=nC(C[v],I[v]);if(H){if(v>=D)return H;var Q=p[v];return H*(Q=="desc"?-1:1)}}return o.index-c.index}function iC(o,c,p,v){for(var C=-1,I=o.length,q=p.length,D=-1,H=c.length,Q=gt(I-q,0),Z=z(H+Q),ee=!v;++D<H;)Z[D]=c[D];for(;++C<q;)(ee||C<I)&&(Z[p[C]]=o[C]);for(;Q--;)Z[D++]=o[C++];return Z}function sC(o,c,p,v){for(var C=-1,I=o.length,q=-1,D=p.length,H=-1,Q=c.length,Z=gt(I-D,0),ee=z(Z+Q),ie=!v;++C<Z;)ee[C]=o[C];for(var ue=C;++H<Q;)ee[ue+H]=c[H];for(;++q<D;)(ie||C<I)&&(ee[ue+p[q]]=o[C++]);return ee}function Ar(o,c){var p=-1,v=o.length;for(c||(c=z(v));++p<v;)c[p]=o[p];return c}function Si(o,c,p,v){var C=!p;p||(p={});for(var I=-1,q=c.length;++I<q;){var D=c[I],H=v?v(p[D],o[D],D,p,o):t;H===t&&(H=o[D]),C?Kr(p,D,H):wr(p,D,H)}return p}function Y$(o,c){return Si(o,tb(o),c)}function K$(o,c){return Si(o,vC(o),c)}function Np(o,c){return function(p,v){var C=Re(p)?Mn:Op,I=c?c():{};return C(p,o,ge(v,2),I)}}function wl(o){return Te(function(c,p){var v=-1,C=p.length,I=C>1?p[C-1]:t,q=C>2?p[2]:t;for(I=o.length>3&&typeof I=="function"?(C--,I):t,q&&_r(p[0],p[1],q)&&(I=C<3?t:I,C=1),c=Ue(c);++v<C;){var D=p[v];D&&o(c,D,v,I)}return c})}function oC(o,c){return function(p,v){if(p==null)return p;if(!qr(p))return o(p,v);for(var C=p.length,I=c?C:-1,q=Ue(p);(c?I--:++I<C)&&v(q[I],I,q)!==!1;);return p}}function aC(o){return function(c,p,v){for(var C=-1,I=Ue(c),q=v(c),D=q.length;D--;){var H=q[o?D:++C];if(p(I[H],H,I)===!1)break}return c}}function Q$(o,c,p){var v=c&R,C=Su(o);function I(){var q=this&&this!==Nt&&this instanceof I?C:o;return q.apply(v?p:this,arguments)}return I}function lC(o){return function(c){c=nt(c);var p=Ss(c)?br(c):t,v=p?p[0]:c.charAt(0),C=p?Ts(p,1).join(""):c.slice(1);return v[o]()+C}}function _l(o){return function(c){return nu(aE(oE(c).replace(Cy,"")),o,"")}}function Su(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Cs(o.prototype),v=o.apply(p,c);return Ct(v)?v:p}}function Z$(o,c,p){var v=Su(o);function C(){for(var I=arguments.length,q=z(I),D=I,H=Rl(C);D--;)q[D]=arguments[D];var Q=I<3&&q[0]!==H&&q[I-1]!==H?[]:dn(q,H);if(I-=Q.length,I<p)return pC(o,c,Dp,C.placeholder,t,q,Q,t,t,p-I);var Z=this&&this!==Nt&&this instanceof C?v:o;return gr(Z,this,q)}return C}function cC(o){return function(c,p,v){var C=Ue(c);if(!qr(c)){var I=ge(p,3);c=Kt(c),p=function(D){return I(C[D],D,C)}}var q=o(c,p,v);return q>-1?C[I?c[q]:q]:t}}function uC(o){return Ui(function(c){var p=c.length,v=p,C=ir.prototype.thru;for(o&&c.reverse();v--;){var I=c[v];if(typeof I!="function")throw new Sr(i);if(C&&!q&&Up(I)=="wrapper")var q=new ir([],!0)}for(v=q?v:p;++v<p;){I=c[v];var D=Up(I),H=D=="wrapper"?Xv(I):t;H&&nb(H[0])&&H[1]==(X|U|V|T)&&!H[4].length&&H[9]==1?q=q[Up(H[0])].apply(q,H[3]):q=I.length==1&&nb(I)?q[D]():q.thru(I)}return function(){var Q=arguments,Z=Q[0];if(q&&Q.length==1&&Re(Z))return q.plant(Z).value();for(var ee=0,ie=p?c[ee].apply(this,Q):Z;++ee<p;)ie=c[ee].call(this,ie);return ie}})}function Dp(o,c,p,v,C,I,q,D,H,Q){var Z=c&X,ee=c&R,ie=c&P,ue=c&(U|B),ye=c&x,Ie=ie?t:Su(o);function me(){for(var Le=arguments.length,He=z(Le),en=Le;en--;)He[en]=arguments[en];if(ue)var Rr=Rl(me),tn=cp(He,Rr);if(v&&(He=iC(He,v,C,ue)),I&&(He=sC(He,I,q,ue)),Le-=tn,ue&&Le<Q){var $t=dn(He,Rr);return pC(o,c,Dp,me.placeholder,p,He,$t,D,H,Q-Le)}var Bn=ee?p:this,Wi=ie?Bn[o]:o;return Le=He.length,D?He=vM(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Nt&&this instanceof me&&(Wi=Ie||Su(Wi)),Wi.apply(Bn,He)}return me}function fC(o,c){return function(p,v){return Es(p,o,c(v),{})}}function Fp(o,c){return function(p,v){var C;if(p===t&&v===t)return c;if(p!==t&&(C=p),v!==t){if(C===t)return v;typeof p=="string"||typeof v=="string"?(p=Zr(p),v=Zr(v)):(p=Kx(p),v=Kx(v)),C=o(p,v)}return C}}function Yv(o){return Ui(function(c){return c=ct(c,vr(ge())),Te(function(p){var v=this;return o(c,function(C){return gr(C,v,p)})})})}function Lp(o,c){c=c===t?" ":Zr(c);var p=c.length;if(p<2)return p?Hv(c,o):c;var v=Hv(c,To(o/hi(c)));return Ss(c)?Ts(br(v),0,o).join(""):v.slice(0,o)}function X$(o,c,p,v){var C=c&R,I=Su(o);function q(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=z(Z+H),ie=this&&this!==Nt&&this instanceof q?I:o;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return gr(ie,C?p:this,ee)}return q}function dC(o){return function(c,p,v){return v&&typeof v!="number"&&_r(c,p,v)&&(p=v=t),c=Vi(c),p===t?(p=c,c=0):p=Vi(p),v=v===t?c<p?1:-1:Vi(v),F$(c,p,v,o)}}function jp(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=vn(c),p=vn(p)),o(c,p)}}function pC(o,c,p,v,C,I,q,D,H,Q){var Z=c&U,ee=Z?q:t,ie=Z?t:q,ue=Z?I:t,ye=Z?t:I;c|=Z?V:W,c&=~(Z?W:V),c&A||(c&=~(R|P));var Ie=[o,c,C,ue,ee,ye,ie,D,H,Q],me=p.apply(t,Ie);return nb(o)&&CC(me,Ie),me.placeholder=v,EC(me,o,c)}function Kv(o){var c=rt[o];return function(p,v){if(p=vn(p),v=v==null?0:Ht(Ee(v),292),v&&Di(p)){var C=(nt(p)+"e").split("e"),I=c(C[0]+"e"+(+C[1]+v));return C=(nt(I)+"e").split("e"),+(C[0]+"e"+(+C[1]-v))}return c(p)}}var eM=Rs&&1/rl(new Rs([,-0]))[1]==pe?function(o){return new Rs(o)}:bb;function hC(o){return function(c){var p=or(c);return p==Jt?ws(c):p==mr?up(c):Uy(c,o(c))}}function ji(o,c,p,v,C,I,q,D){var H=c&P;if(!H&&typeof o!="function")throw new Sr(i);var Q=v?v.length:0;if(Q||(c&=~(V|W),v=C=t),q=q===t?q:gt(Ee(q),0),D=D===t?D:Ee(D),Q-=C?C.length:0,c&W){var Z=v,ee=C;v=C=t}var ie=H?t:Xv(o),ue=[o,c,p,v,C,Z,ee,I,q,D];if(ie&&mM(ue,ie),o=ue[0],c=ue[1],p=ue[2],v=ue[3],C=ue[4],D=ue[9]=ue[9]===t?H?0:o.length:gt(ue[9]-Q,0),!D&&c&(U|B)&&(c&=~(U|B)),!c||c==R)var ye=Q$(o,c,p);else c==U||c==B?ye=Z$(o,c,D):(c==V||c==(R|V))&&!C.length?ye=X$(o,c,p,v):ye=Dp.apply(t,ue);var Ie=ie?Gx:CC;return EC(Ie(ye,ue),o,c)}function mC(o,c,p,v){return o===t||Hn(o,_s[p])&&!Ze.call(v,p)?c:o}function gC(o,c,p,v,C,I){return Ct(o)&&Ct(c)&&(I.set(c,o),Dt(o,c,t,gC,I),I.delete(c)),o}function tM(o){return Ru(o)?t:o}function yC(o,c,p,v,C,I){var q=p&S,D=o.length,H=c.length;if(D!=H&&!(q&&H>D))return!1;var Q=I.get(o),Z=I.get(c);if(Q&&Z)return Q==c&&Z==o;var ee=-1,ie=!0,ue=p&_?new Fi:t;for(I.set(o,c),I.set(c,o);++ee<D;){var ye=o[ee],Ie=c[ee];if(v)var me=q?v(Ie,ye,ee,c,o,I):v(ye,Ie,ee,o,c,I);if(me!==t){if(me)continue;ie=!1;break}if(ue){if(!Za(c,function(Le,He){if(!tt(ue,He)&&(ye===Le||C(ye,Le,p,v,I)))return ue.push(He)})){ie=!1;break}}else if(!(ye===Ie||C(ye,Ie,p,v,I))){ie=!1;break}}return I.delete(o),I.delete(c),ie}function rM(o,c,p,v,C,I,q){switch(p){case Tn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case ki:return!(o.byteLength!=c.byteLength||!I(new al(o),new al(c)));case Gr:case Ir:case po:return Hn(+o,+c);case mt:return o.name==c.name&&o.message==c.message;case Gt:case ho:return o==c+"";case Jt:var D=ws;case mr:var H=v&S;if(D||(D=rl),o.size!=c.size&&!H)return!1;var Q=q.get(o);if(Q)return Q==c;v|=_,q.set(o,c);var Z=yC(D(o),D(c),v,C,I,q);return q.delete(o),Z;case Da:if(No)return No.call(o)==No.call(c)}return!1}function nM(o,c,p,v,C,I){var q=p&S,D=Qv(o),H=D.length,Q=Qv(c),Z=Q.length;if(H!=Z&&!q)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(q?ie in c:Ze.call(c,ie)))return!1}var ue=I.get(o),ye=I.get(c);if(ue&&ye)return ue==c&&ye==o;var Ie=!0;I.set(o,c),I.set(c,o);for(var me=q;++ee<H;){ie=D[ee];var Le=o[ie],He=c[ie];if(v)var en=q?v(He,Le,ie,c,o,I):v(Le,He,ie,o,c,I);if(!(en===t?Le===He||C(Le,He,p,v,I):en)){Ie=!1;break}me||(me=ie=="constructor")}if(Ie&&!me){var Rr=o.constructor,tn=c.constructor;Rr!=tn&&"constructor"in o&&"constructor"in c&&!(typeof Rr=="function"&&Rr instanceof Rr&&typeof tn=="function"&&tn instanceof tn)&&(Ie=!1)}return I.delete(o),I.delete(c),Ie}function Ui(o){return sb(RC(o,t,AC),o+"")}function Qv(o){return Ap(o,Kt,tb)}function Zv(o){return Ap(o,$r,vC)}var Xv=hl?function(o){return hl.get(o)}:bb;function Up(o){for(var c=o.name+"",p=xs[c],v=Ze.call(xs,c)?p.length:0;v--;){var C=p[v],I=C.func;if(I==null||I==o)return C.name}return c}function Rl(o){var c=Ze.call(O,"placeholder")?O:o;return c.placeholder}function ge(){var o=O.iteratee||yb;return o=o===yb?w:o,arguments.length?o(arguments[0],arguments[1]):o}function Hp(o,c){var p=o.__data__;return fM(c)?p[typeof c=="string"?"string":"hash"]:p.map}function eb(o){for(var c=Kt(o),p=c.length;p--;){var v=c[p],C=o[v];c[p]=[v,C,wC(C)]}return c}function jo(o,c){var p=Co(o,c);return Fe(p)?p:t}function iM(o){var c=Ze.call(o,Ni),p=o[Ni];try{o[Ni]=t;var v=!0}catch{}var C=sl.call(o);return v&&(c?o[Ni]=p:delete o[Ni]),C}var tb=fl?function(o){return o==null?[]:(o=Ue(o),di(fl(o),function(c){return Po.call(o,c)}))}:Sb,vC=fl?function(o){for(var c=[];o;)pi(c,tb(o)),o=ll(o);return c}:Sb,or=Qt;(cu&&or(new cu(new ArrayBuffer(1)))!=Tn||qo&&or(new qo)!=Jt||uu&&or(uu.resolve())!=Nd||Rs&&or(new Rs)!=mr||$o&&or(new $o)!=Ut)&&(or=function(o){var c=Qt(o),p=c==kn?o.constructor:t,v=p?Uo(p):"";if(v)switch(v){case uv:return Tn;case fv:return Jt;case dv:return Nd;case pv:return mr;case hv:return Ut}return c});function sM(o,c,p){for(var v=-1,C=p.length;++v<C;){var I=p[v],q=I.size;switch(I.type){case"drop":o+=q;break;case"dropRight":c-=q;break;case"take":c=Ht(c,o+q);break;case"takeRight":o=gt(o,c-q);break}}return{start:o,end:c}}function oM(o){var c=o.match(An);return c?c[1].split(un):[]}function bC(o,c,p){c=ks(c,o);for(var v=-1,C=c.length,I=!1;++v<C;){var q=Un(c[v]);if(!(I=o!=null&&p(o,q)))break;o=o[q]}return I||++v!=C?I:(C=o==null?0:o.length,!!C&&Yp(C)&&Hi(q,C)&&(Re(o)||Ho(o)))}function aM(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Ze.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function SC(o){return typeof o.constructor=="function"&&!wu(o)?Cs(ll(o)):{}}function lM(o,c,p){var v=o.constructor;switch(c){case ki:return Gv(o);case Gr:case Ir:return new v(+o);case Tn:return W$(o,p);case ot:case Fa:case La:case ds:case mo:case ps:case fi:case hs:case Hc:return rC(o,p);case Jt:return new v;case po:case ho:return new v(o);case Gt:return z$(o);case mr:return new v;case Da:return J$(o)}}function cM(o,c){var p=c.length;if(!p)return o;var v=p-1;return c[v]=(p>1?"& ":"")+c[v],c=c.join(p>2?", ":" "),o.replace(Yt,`{
2
2
  /* [wrapped with `+c+`] */
3
- `)}function cM(o){return Re(o)||Uo(o)||!!(pp&&o&&o[pp])}function Hi(o,c){var p=typeof o;return c=c??et,!!c&&(p=="number"||p!="symbol"&&ms.test(o))&&o>-1&&o%1==0&&o<c}function _r(o,c,p){if(!Ct(p))return!1;var v=typeof c;return(v=="number"?qr(p)&&Hi(c,p.length):v=="string"&&c in p)?Hn(p[c],o):!1}function rb(o,c){if(Re(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Xr(o)?!0:qe.test(o)||!Pr.test(o)||c!=null&&o in Ue(c)}function uM(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function nb(o){var c=Lp(o),p=O[c];if(typeof p!="function"||!(c in $e.prototype))return!1;if(o===p)return!0;var v=Xv(p);return!!v&&o===v[0]}function fM(o){return!!up&&up in o}var dM=Oo?Bi:wb;function wu(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||_s;return o===p}function SC(o){return o===o&&!Ct(o)}function wC(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==t||o in Ue(p))}}function pM(o){var c=Wp(o,function(v){return p.size===f&&p.clear(),v}),p=c.cache;return c}function hM(o,c){var p=o[1],v=c[1],C=p|v,I=C<(R|P|X),q=v==X&&p==U||v==X&&p==T&&o[7].length<=c[8]||v==(X|T)&&c[7].length<=c[8]&&p==U;if(!(I||q))return o;v&R&&(o[2]=c[2],C|=p&R?0:A);var D=c[3];if(D){var H=o[3];o[3]=H?nC(H,D,c[4]):D,o[4]=H?dn(o[3],d):c[4]}return D=c[5],D&&(H=o[5],o[5]=H?iC(H,D,c[6]):D,o[6]=H?dn(o[5],d):c[6]),D=c[7],D&&(o[7]=D),v&X&&(o[8]=o[8]==null?c[8]:Ht(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=C,o}function mM(o){var c=[];if(o!=null)for(var p in Ue(o))c.push(p);return c}function gM(o){return sl.call(o)}function _C(o,c,p){return c=gt(c===t?o.length-1:c,0),function(){for(var v=arguments,C=-1,I=gt(v.length-c,0),q=z(I);++C<I;)q[C]=v[c+C];C=-1;for(var D=z(c+1);++C<c;)D[C]=v[C];return D[c]=p(q),gr(o,this,D)}}function RC(o,c){return c.length<2?o:Li(o,gn(c,0,-1))}function yM(o,c){for(var p=o.length,v=Ht(c.length,p),C=Ar(o);v--;){var I=c[v];o[v]=Hi(I,p)?C[I]:t}return o}function ib(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var xC=EC(Jx),_u=av||function(o,c){return Nt.setTimeout(o,c)},sb=EC(j$);function CC(o,c,p){var v=c+"";return sb(o,lM(v,vM(sM(v),p)))}function EC(o){var c=0,p=0;return function(){var v=mp(),C=$-(v-p);if(p=v,C>0){if(++c>=j)return arguments[0]}else c=0;return o.apply(t,arguments)}}function Up(o,c){var p=-1,v=o.length,C=v-1;for(c=c===t?v:c;++p<c;){var I=Uv(p,C),q=o[I];o[I]=o[p],o[p]=q}return o.length=c,o}var OC=pM(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Bc,function(p,v,C,I){c.push(C?I.replace(qn,"$1"):v||p)}),c});function Un(o){if(typeof o=="string"||Xr(o))return o;var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function jo(o){if(o!=null){try{return il.call(o)}catch{}try{return o+""}catch{}}return""}function vM(o,c){return yr(ce,function(p){var v="_."+p[0];c&p[1]&&!Qa(o,v)&&o.push(v)}),o.sort()}function IC(o){if(o instanceof $e)return o.clone();var c=new ir(o.__wrapped__,o.__chain__);return c.__actions__=Ar(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function bM(o,c,p){(p?_r(o,c,p):c===t)?c=1:c=gt(Ee(c),0);var v=o==null?0:o.length;if(!v||c<1)return[];for(var C=0,I=0,q=z(ko(v/c));C<v;)q[I++]=gn(o,C,C+=c);return q}function SM(o){for(var c=-1,p=o==null?0:o.length,v=0,C=[];++c<p;){var I=o[c];I&&(C[v++]=I)}return C}function wM(){var o=arguments.length;if(!o)return[];for(var c=z(o-1),p=arguments[0],v=o;v--;)c[v-1]=arguments[v];return pi(Re(p)?Ar(p):[p],Bt(c,1))}var _M=Te(function(o,c){return qt(o)?No(o,Bt(c,1,qt,!0)):[]}),RM=Te(function(o,c){var p=yn(c);return qt(p)&&(p=t),qt(o)?No(o,Bt(c,1,qt,!0),ge(p,2)):[]}),xM=Te(function(o,c){var p=yn(c);return qt(p)&&(p=t),qt(o)?No(o,Bt(c,1,qt,!0),t,p):[]});function CM(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),gn(o,c<0?0:c,v)):[]}function EM(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),c=v-c,gn(o,0,c<0?0:c)):[]}function OM(o,c){return o&&o.length?qp(o,ge(c,3),!0,!0):[]}function IM(o,c){return o&&o.length?qp(o,ge(c,3),!0):[]}function PM(o,c,p,v){var C=o==null?0:o.length;return C?(p&&typeof p!="number"&&_r(o,c,p)&&(p=0,v=C),$v(o,c,p,v)):[]}function PC(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=p==null?0:Ee(p);return C<0&&(C=gt(v+C,0)),Xa(o,ge(c,3),C)}function kC(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=v-1;return p!==t&&(C=Ee(p),C=p<0?gt(v+C,0):Ht(C,v-1)),Xa(o,ge(c,3),C,!0)}function TC(o){var c=o==null?0:o.length;return c?Bt(o,1):[]}function kM(o){var c=o==null?0:o.length;return c?Bt(o,pe):[]}function TM(o,c){var p=o==null?0:o.length;return p?(c=c===t?1:Ee(c),Bt(o,c)):[]}function AM(o){for(var c=-1,p=o==null?0:o.length,v={};++c<p;){var C=o[c];Kr(v,C[0],C[1])}return v}function AC(o){return o&&o.length?o[0]:t}function qM(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=p==null?0:Ee(p);return C<0&&(C=gt(v+C,0)),$i(o,c,C)}function $M(o){var c=o==null?0:o.length;return c?gn(o,0,-1):[]}var MM=Te(function(o){var c=ct(o,zv);return c.length&&c[0]===o[0]?Qr(c):[]}),NM=Te(function(o){var c=yn(o),p=ct(o,zv);return c===yn(p)?c=t:p.pop(),p.length&&p[0]===o[0]?Qr(p,ge(c,2)):[]}),DM=Te(function(o){var c=yn(o),p=ct(o,zv);return c=typeof c=="function"?c:t,c&&p.pop(),p.length&&p[0]===o[0]?Qr(p,t,c):[]});function FM(o,c){return o==null?"":pl.call(o,c)}function yn(o){var c=o==null?0:o.length;return c?o[c-1]:t}function LM(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=v;return p!==t&&(C=Ee(p),C=C<0?gt(v+C,0):Ht(C,v-1)),c===c?lu(o,c,C):Xa(o,Mi,C,!0)}function jM(o,c){return o&&o.length?jn(o,Ee(c)):t}var UM=Te(qC);function qC(o,c){return o&&o.length&&c&&c.length?jv(o,c):o}function HM(o,c,p){return o&&o.length&&c&&c.length?jv(o,c,ge(p,2)):o}function BM(o,c,p){return o&&o.length&&c&&c.length?jv(o,c,t,p):o}var VM=Ui(function(o,c){var p=o==null?0:o.length,v=hu(o,c);return zx(o,ct(c,function(C){return Hi(C,p)?+C:C}).sort(rC)),v});function WM(o,c){var p=[];if(!(o&&o.length))return p;var v=-1,C=[],I=o.length;for(c=ge(c,3);++v<I;){var q=o[v];c(q,v,o)&&(p.push(q),C.push(v))}return zx(o,C),p}function ob(o){return o==null?o:cv.call(o)}function zM(o,c,p){var v=o==null?0:o.length;return v?(p&&typeof p!="number"&&_r(o,c,p)?(c=0,p=v):(c=c==null?0:Ee(c),p=p===t?v:Ee(p)),gn(o,c,p)):[]}function JM(o,c){return Ap(o,c)}function GM(o,c,p){return Bv(o,c,ge(p,2))}function YM(o,c){var p=o==null?0:o.length;if(p){var v=Ap(o,c);if(v<p&&Hn(o[v],c))return v}return-1}function KM(o,c){return Ap(o,c,!0)}function QM(o,c,p){return Bv(o,c,ge(p,2),!0)}function ZM(o,c){var p=o==null?0:o.length;if(p){var v=Ap(o,c,!0)-1;if(Hn(o[v],c))return v}return-1}function XM(o){return o&&o.length?Gx(o):[]}function eN(o,c){return o&&o.length?Gx(o,ge(c,2)):[]}function tN(o){var c=o==null?0:o.length;return c?gn(o,1,c):[]}function rN(o,c,p){return o&&o.length?(c=p||c===t?1:Ee(c),gn(o,0,c<0?0:c)):[]}function nN(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),c=v-c,gn(o,c<0?0:c,v)):[]}function iN(o,c){return o&&o.length?qp(o,ge(c,3),!1,!0):[]}function sN(o,c){return o&&o.length?qp(o,ge(c,3)):[]}var oN=Te(function(o){return Ps(Bt(o,1,qt,!0))}),aN=Te(function(o){var c=yn(o);return qt(c)&&(c=t),Ps(Bt(o,1,qt,!0),ge(c,2))}),lN=Te(function(o){var c=yn(o);return c=typeof c=="function"?c:t,Ps(Bt(o,1,qt,!0),t,c)});function cN(o){return o&&o.length?Ps(o):[]}function uN(o,c){return o&&o.length?Ps(o,ge(c,2)):[]}function fN(o,c){return c=typeof c=="function"?c:t,o&&o.length?Ps(o,t,c):[]}function ab(o){if(!(o&&o.length))return[];var c=0;return o=di(o,function(p){if(qt(p))return c=gt(p.length,c),!0}),ou(c,function(p){return ct(o,Ro(p))})}function $C(o,c){if(!(o&&o.length))return[];var p=ab(o);return c==null?p:ct(p,function(v){return gr(c,t,v)})}var dN=Te(function(o,c){return qt(o)?No(o,c):[]}),pN=Te(function(o){return Wv(di(o,qt))}),hN=Te(function(o){var c=yn(o);return qt(c)&&(c=t),Wv(di(o,qt),ge(c,2))}),mN=Te(function(o){var c=yn(o);return c=typeof c=="function"?c:t,Wv(di(o,qt),t,c)}),gN=Te(ab);function yN(o,c){return Zx(o||[],c||[],wr)}function vN(o,c){return Zx(o||[],c||[],bu)}var bN=Te(function(o){var c=o.length,p=c>1?o[c-1]:t;return p=typeof p=="function"?(o.pop(),p):t,$C(o,p)});function MC(o){var c=O(o);return c.__chain__=!0,c}function SN(o,c){return c(o),o}function Hp(o,c){return c(o)}var wN=Ui(function(o){var c=o.length,p=c?o[0]:0,v=this.__wrapped__,C=function(I){return hu(I,o)};return c>1||this.__actions__.length||!(v instanceof $e)||!Hi(p)?this.thru(C):(v=v.slice(p,+p+(c?1:0)),v.__actions__.push({func:Hp,args:[C],thisArg:t}),new ir(v,this.__chain__).thru(function(I){return c&&!I.length&&I.push(t),I}))});function _N(){return MC(this)}function RN(){return new ir(this.value(),this.__chain__)}function xN(){this.__values__===t&&(this.__values__=YC(this.value()));var o=this.__index__>=this.__values__.length,c=o?t:this.__values__[this.__index__++];return{done:o,value:c}}function CN(){return this}function EN(o){for(var c,p=this;p instanceof gl;){var v=IC(p);v.__index__=0,v.__values__=t,c?C.__wrapped__=v:c=v;var C=v;p=p.__wrapped__}return C.__wrapped__=o,c}function ON(){var o=this.__wrapped__;if(o instanceof $e){var c=o;return this.__actions__.length&&(c=new $e(this)),c=c.reverse(),c.__actions__.push({func:Hp,args:[ob],thisArg:t}),new ir(c,this.__chain__)}return this.thru(ob)}function IN(){return Qx(this.__wrapped__,this.__actions__)}var PN=$p(function(o,c,p){Ze.call(o,p)?++o[p]:Kr(o,p,1)});function kN(o,c,p){var v=Re(o)?rp:qv;return p&&_r(o,c,p)&&(c=t),v(o,ge(c,3))}function TN(o,c){var p=Re(o)?di:Ip;return p(o,ge(c,3))}var AN=lC(PC),qN=lC(kC);function $N(o,c){return Bt(Bp(o,c),1)}function MN(o,c){return Bt(Bp(o,c),pe)}function NN(o,c,p){return p=p===t?1:Ee(p),Bt(Bp(o,c),p)}function NC(o,c){var p=Re(o)?yr:bi;return p(o,ge(c,3))}function DC(o,c){var p=Re(o)?ru:Op;return p(o,ge(c,3))}var DN=$p(function(o,c,p){Ze.call(o,p)?o[p].push(c):Kr(o,p,[c])});function FN(o,c,p,v){o=qr(o)?o:Cl(o),p=p&&!v?Ee(p):0;var C=o.length;return p<0&&(p=gt(C+p,0)),Gp(o)?p<=C&&o.indexOf(c,p)>-1:!!C&&$i(o,c,p)>-1}var LN=Te(function(o,c,p){var v=-1,C=typeof c=="function",I=qr(o)?z(o.length):[];return bi(o,function(q){I[++v]=C?gr(c,q,p):Do(q,c,p)}),I}),jN=$p(function(o,c,p){Kr(o,p,c)});function Bp(o,c){var p=Re(o)?ct:oe;return p(o,ge(c,3))}function UN(o,c,p,v){return o==null?[]:(Re(c)||(c=c==null?[]:[c]),p=v?t:p,Re(p)||(p=p==null?[]:[p]),Vx(o,c,p))}var HN=$p(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function BN(o,c,p){var v=Re(o)?nu:el,C=arguments.length<3;return v(o,ge(c,4),p,C,bi)}function VN(o,c,p){var v=Re(o)?My:el,C=arguments.length<3;return v(o,ge(c,4),p,C,Op)}function WN(o,c){var p=Re(o)?di:Ip;return p(o,zp(ge(c,3)))}function zN(o){var c=Re(o)?xp:F$;return c(o)}function JN(o,c,p){(p?_r(o,c,p):c===t)?c=1:c=Ee(c);var v=Re(o)?Pv:L$;return v(o,c)}function GN(o){var c=Re(o)?kv:U$;return c(o)}function YN(o){if(o==null)return 0;if(qr(o))return Gp(o)?hi(o):o.length;var c=or(o);return c==Jt||c==mr?o.size:E(o).length}function KN(o,c,p){var v=Re(o)?Za:H$;return p&&_r(o,c,p)&&(c=t),v(o,ge(c,3))}var QN=Te(function(o,c){if(o==null)return[];var p=c.length;return p>1&&_r(o,c[0],c[1])?c=[]:p>2&&_r(c[0],c[1],c[2])&&(c=[c[0]]),Vx(o,Bt(c,1),[])}),Vp=ov||function(){return Nt.Date.now()};function ZN(o,c){if(typeof c!="function")throw new Sr(i);return o=Ee(o),function(){if(--o<1)return c.apply(this,arguments)}}function FC(o,c,p){return c=p?t:c,c=o&&c==null?o.length:c,ji(o,X,t,t,t,t,c)}function LC(o,c){var p;if(typeof c!="function")throw new Sr(i);return o=Ee(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=t),p}}var lb=Te(function(o,c,p){var v=R;if(p.length){var C=dn(p,Rl(lb));v|=V}return ji(o,v,c,p,C)}),jC=Te(function(o,c,p){var v=R|P;if(p.length){var C=dn(p,Rl(jC));v|=V}return ji(c,v,o,p,C)});function UC(o,c,p){c=p?t:c;var v=ji(o,U,t,t,t,t,t,c);return v.placeholder=UC.placeholder,v}function HC(o,c,p){c=p?t:c;var v=ji(o,B,t,t,t,t,t,c);return v.placeholder=HC.placeholder,v}function BC(o,c,p){var v,C,I,q,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof o!="function")throw new Sr(i);c=vn(c)||0,Ct(p)&&(Z=!!p.leading,ee="maxWait"in p,I=ee?gt(vn(p.maxWait)||0,c):I,ie="trailing"in p?!!p.trailing:ie);function ue($t){var Bn=v,Wi=C;return v=C=t,Q=$t,q=o.apply(Wi,Bn),q}function ye($t){return Q=$t,D=_u(Le,c),Z?ue($t):q}function Ie($t){var Bn=$t-H,Wi=$t-Q,cE=c-Bn;return ee?Ht(cE,I-Wi):cE}function me($t){var Bn=$t-H,Wi=$t-Q;return H===t||Bn>=c||Bn<0||ee&&Wi>=I}function Le(){var $t=Vp();if(me($t))return He($t);D=_u(Le,Ie($t))}function He($t){return D=t,ie&&v?ue($t):(v=C=t,q)}function en(){D!==t&&Xx(D),Q=0,v=H=C=D=t}function Rr(){return D===t?q:He(Vp())}function tn(){var $t=Vp(),Bn=me($t);if(v=arguments,C=this,H=$t,Bn){if(D===t)return ye(H);if(ee)return Xx(D),D=_u(Le,c),ue(H)}return D===t&&(D=_u(Le,c)),q}return tn.cancel=en,tn.flush=Rr,tn}var XN=Te(function(o,c){return mu(o,1,c)}),eD=Te(function(o,c,p){return mu(o,vn(c)||0,p)});function tD(o){return ji(o,x)}function Wp(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Sr(i);var p=function(){var v=arguments,C=c?c.apply(this,v):v[0],I=p.cache;if(I.has(C))return I.get(C);var q=o.apply(this,v);return p.cache=I.set(C,q)||I,q};return p.cache=new(Wp.Cache||Dn),p}Wp.Cache=Dn;function zp(o){if(typeof o!="function")throw new Sr(i);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function rD(o){return LC(2,o)}var nD=B$(function(o,c){c=c.length==1&&Re(c[0])?ct(c[0],vr(ge())):ct(Bt(c,1),vr(ge()));var p=c.length;return Te(function(v){for(var C=-1,I=Ht(v.length,p);++C<I;)v[C]=c[C].call(this,v[C]);return gr(o,this,v)})}),cb=Te(function(o,c){var p=dn(c,Rl(cb));return ji(o,V,t,c,p)}),VC=Te(function(o,c){var p=dn(c,Rl(VC));return ji(o,W,t,c,p)}),iD=Ui(function(o,c){return ji(o,T,t,t,t,c)});function sD(o,c){if(typeof o!="function")throw new Sr(i);return c=c===t?c:Ee(c),Te(o,c)}function oD(o,c){if(typeof o!="function")throw new Sr(i);return c=c==null?0:gt(Ee(c),0),Te(function(p){var v=p[c],C=Ts(p,0,c);return v&&pi(C,v),gr(o,this,C)})}function aD(o,c,p){var v=!0,C=!0;if(typeof o!="function")throw new Sr(i);return Ct(p)&&(v="leading"in p?!!p.leading:v,C="trailing"in p?!!p.trailing:C),BC(o,c,{leading:v,maxWait:c,trailing:C})}function lD(o){return FC(o,1)}function cD(o,c){return cb(Jv(c),o)}function uD(){if(!arguments.length)return[];var o=arguments[0];return Re(o)?o:[o]}function fD(o){return sr(o,y)}function dD(o,c){return c=typeof c=="function"?c:t,sr(o,y,c)}function pD(o){return sr(o,m|y)}function hD(o,c){return c=typeof c=="function"?c:t,sr(o,m|y,c)}function mD(o,c){return c==null||hn(o,c,Kt(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var gD=Fp(yu),yD=Fp(function(o,c){return o>=c}),Uo=Tp((function(){return arguments})())?Tp:function(o){return Ot(o)&&Ze.call(o,"callee")&&!Io.call(o,"callee")},Re=z.isArray,vD=tu?vr(tu):Fv;function qr(o){return o!=null&&Jp(o.length)&&!Bi(o)}function qt(o){return Ot(o)&&qr(o)}function bD(o){return o===!0||o===!1||Ot(o)&&Qt(o)==Gr}var As=dl||wb,SD=ep?vr(ep):Lv;function wD(o){return Ot(o)&&o.nodeType===1&&!Ru(o)}function _D(o){if(o==null)return!0;if(qr(o)&&(Re(o)||typeof o=="string"||typeof o.splice=="function"||As(o)||xl(o)||Uo(o)))return!o.length;var c=or(o);if(c==Jt||c==mr)return!o.size;if(wu(o))return!E(o).length;for(var p in o)if(Ze.call(o,p))return!1;return!0}function RD(o,c){return Fo(o,c)}function xD(o,c,p){p=typeof p=="function"?p:t;var v=p?p(o,c):t;return v===t?Fo(o,c,t,p):!!v}function ub(o){if(!Ot(o))return!1;var c=Qt(o);return c==mt||c==ht||typeof o.message=="string"&&typeof o.name=="string"&&!Ru(o)}function CD(o){return typeof o=="number"&&Di(o)}function Bi(o){if(!Ct(o))return!1;var c=Qt(o);return c==ln||c==uo||c==Rt||c==Md}function WC(o){return typeof o=="number"&&o==Ee(o)}function Jp(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=et}function Ct(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function Ot(o){return o!=null&&typeof o=="object"}var zC=tp?vr(tp):Os;function ED(o,c){return o===c||Is(o,c,eb(c))}function OD(o,c,p){return p=typeof p=="function"?p:t,Is(o,c,eb(c),p)}function ID(o){return JC(o)&&o!=+o}function PD(o){if(dM(o))throw new be(n);return Fe(o)}function kD(o){return o===null}function TD(o){return o==null}function JC(o){return typeof o=="number"||Ot(o)&&Qt(o)==fo}function Ru(o){if(!Ot(o)||Qt(o)!=kn)return!1;var c=ll(o);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&il.call(p)==rv}var fb=_o?vr(_o):u;function AD(o){return WC(o)&&o>=-et&&o<=et}var GC=$n?vr($n):h;function Gp(o){return typeof o=="string"||!Re(o)&&Ot(o)&&Qt(o)==po}function Xr(o){return typeof o=="symbol"||Ot(o)&&Qt(o)==Da}var xl=Ka?vr(Ka):b;function qD(o){return o===t}function $D(o){return Ot(o)&&or(o)==Ut}function MD(o){return Ot(o)&&Qt(o)==Dd}var ND=Fp(J),DD=Fp(function(o,c){return o<=c});function YC(o){if(!o)return[];if(qr(o))return Gp(o)?br(o):Ar(o);if(Po&&o[Po])return zy(o[Po]());var c=or(o),p=c==Jt?ws:c==mr?rl:Cl;return p(o)}function Vi(o){if(!o)return o===0?o:0;if(o=vn(o),o===pe||o===-pe){var c=o<0?-1:1;return c*_e}return o===o?o:0}function Ee(o){var c=Vi(o),p=c%1;return c===c?p?c-p:c:0}function KC(o){return o?vi(Ee(o),0,Ce):0}function vn(o){if(typeof o=="number")return o;if(Xr(o))return he;if(Ct(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=Ct(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=au(o);var p=yo.test(o);return p||fy.test(o)?qy(o.slice(2),p?2:8):uy.test(o)?he:+o}function QC(o){return Si(o,$r(o))}function FD(o){return o?vi(Ee(o),-et,et):o===0?o:0}function nt(o){return o==null?"":Zr(o)}var LD=wl(function(o,c){if(wu(c)||qr(c)){Si(c,Kt(c),o);return}for(var p in c)Ze.call(c,p)&&wr(o,p,c[p])}),ZC=wl(function(o,c){Si(c,$r(c),o)}),XC=wl(function(o,c,p,v){Si(c,$r(c),o,v)}),db=wl(function(o,c,p,v){Si(c,Kt(c),o,v)}),jD=Ui(hu);function UD(o,c){var p=Cs(o);return c==null?p:Ep(p,c)}var HD=Te(function(o,c){o=Ue(o);var p=-1,v=c.length,C=v>2?c[2]:t;for(C&&_r(c[0],c[1],C)&&(v=1);++p<v;)for(var I=c[p],q=$r(I),D=-1,H=q.length;++D<H;){var Q=q[D],Z=o[Q];(Z===t||Hn(Z,_s[Q])&&!Ze.call(o,Q))&&(o[Q]=I[Q])}return o}),BD=Te(function(o){return o.push(t,mC),gr(eE,t,o)});function VD(o,c){return np(o,ge(c,3),mn)}function WD(o,c){return np(o,ge(c,3),Fn)}function zD(o,c){return o==null?o:gu(o,ge(c,3),$r)}function JD(o,c){return o==null?o:Pp(o,ge(c,3),$r)}function GD(o,c){return o&&mn(o,ge(c,3))}function YD(o,c){return o&&Fn(o,ge(c,3))}function KD(o){return o==null?[]:Sl(o,Kt(o))}function QD(o){return o==null?[]:Sl(o,$r(o))}function pb(o,c,p){var v=o==null?t:Li(o,c);return v===t?p:v}function ZD(o,c){return o!=null&&vC(o,c,Mv)}function hb(o,c){return o!=null&&vC(o,c,Nv)}var XD=uC(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=sl.call(c)),o[c]=p},gb(Mr)),eF=uC(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=sl.call(c)),Ze.call(o,c)?o[c].push(p):o[c]=[p]},ge),tF=Te(Do);function Kt(o){return qr(o)?Rp(o):E(o)}function $r(o){return qr(o)?Rp(o,!0):M(o)}function rF(o,c){var p={};return c=ge(c,3),mn(o,function(v,C,I){Kr(p,c(v,C,I),v)}),p}function nF(o,c){var p={};return c=ge(c,3),mn(o,function(v,C,I){Kr(p,C,c(v,C,I))}),p}var iF=wl(function(o,c,p){Dt(o,c,p)}),eE=wl(function(o,c,p,v){Dt(o,c,p,v)}),sF=Ui(function(o,c){var p={};if(o==null)return p;var v=!1;c=ct(c,function(I){return I=ks(I,o),v||(v=I.length>1),I}),Si(o,Zv(o),p),v&&(p=sr(p,m|g|y,eM));for(var C=c.length;C--;)Vv(p,c[C]);return p});function oF(o,c){return tE(o,zp(ge(c)))}var aF=Ui(function(o,c){return o==null?{}:M$(o,c)});function tE(o,c){if(o==null)return{};var p=ct(Zv(o),function(v){return[v]});return c=ge(c),Wx(o,p,function(v,C){return c(v,C[0])})}function lF(o,c,p){c=ks(c,o);var v=-1,C=c.length;for(C||(C=1,o=t);++v<C;){var I=o==null?t:o[Un(c[v])];I===t&&(v=C,I=p),o=Bi(I)?I.call(o):I}return o}function cF(o,c,p){return o==null?o:bu(o,c,p)}function uF(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:bu(o,c,p,v)}var rE=pC(Kt),nE=pC($r);function fF(o,c,p){var v=Re(o),C=v||As(o)||xl(o);if(c=ge(c,4),p==null){var I=o&&o.constructor;C?p=v?new I:[]:Ct(o)?p=Bi(I)?Cs(ll(o)):{}:p={}}return(C?yr:mn)(o,function(q,D,H){return c(p,q,D,H)}),p}function dF(o,c){return o==null?!0:Vv(o,c)}function pF(o,c,p){return o==null?o:Kx(o,c,Jv(p))}function hF(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:Kx(o,c,Jv(p),v)}function Cl(o){return o==null?[]:tl(o,Kt(o))}function mF(o){return o==null?[]:tl(o,$r(o))}function gF(o,c,p){return p===t&&(p=c,c=t),p!==t&&(p=vn(p),p=p===p?p:0),c!==t&&(c=vn(c),c=c===c?c:0),vi(vn(o),c,p)}function yF(o,c,p){return c=Vi(c),p===t?(p=c,c=0):p=Vi(p),o=vn(o),Dv(o,c,p)}function vF(o,c,p){if(p&&typeof p!="boolean"&&_r(o,c,p)&&(c=p=t),p===t&&(typeof c=="boolean"?(p=c,c=t):typeof o=="boolean"&&(p=o,o=t)),o===t&&c===t?(o=0,c=1):(o=Vi(o),c===t?(c=o,o=0):c=Vi(c)),o>c){var v=o;o=c,c=v}if(p||o%1||c%1){var C=gp();return Ht(o+C*(c-o+Zd("1e-"+((C+"").length-1))),c)}return Uv(o,c)}var bF=_l(function(o,c,p){return c=c.toLowerCase(),o+(p?iE(c):c)});function iE(o){return mb(nt(o).toLowerCase())}function sE(o){return o=nt(o),o&&o.replace(vo,Hy).replace(Ey,"")}function SF(o,c,p){o=nt(o),c=Zr(c);var v=o.length;p=p===t?v:vi(Ee(p),0,v);var C=p;return p-=c.length,p>=0&&o.slice(p,C)==c}function wF(o){return o=nt(o),o&&le.test(o)?o.replace(Ua,By):o}function _F(o){return o=nt(o),o&&go.test(o)?o.replace(Ke,"\\$&"):o}var RF=_l(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),xF=_l(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),CF=aC("toLowerCase");function EF(o,c,p){o=nt(o),c=Ee(c);var v=c?hi(o):0;if(!c||v>=c)return o;var C=(c-v)/2;return Dp(To(C),p)+o+Dp(ko(C),p)}function OF(o,c,p){o=nt(o),c=Ee(c);var v=c?hi(o):0;return c&&v<c?o+Dp(c-v,p):o}function IF(o,c,p){o=nt(o),c=Ee(c);var v=c?hi(o):0;return c&&v<c?Dp(c-v,p)+o:o}function PF(o,c,p){return p||c==null?c=0:c&&(c=+c),lv(nt(o).replace(Vc,""),c||0)}function kF(o,c,p){return(p?_r(o,c,p):c===t)?c=1:c=Ee(c),Hv(nt(o),c)}function TF(){var o=arguments,c=nt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var AF=_l(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function qF(o,c,p){return p&&typeof p!="number"&&_r(o,c,p)&&(c=p=t),p=p===t?Ce:p>>>0,p?(o=nt(o),o&&(typeof c=="string"||c!=null&&!fb(c))&&(c=Zr(c),!c&&Ss(o))?Ts(br(o),0,p):o.split(c,p)):[]}var $F=_l(function(o,c,p){return o+(p?" ":"")+mb(c)});function MF(o,c,p){return o=nt(o),p=p==null?0:vi(Ee(p),0,o.length),c=Zr(c),o.slice(p,p+c.length)==c}function NF(o,c,p){var v=O.templateSettings;p&&_r(o,c,p)&&(c=t),o=nt(o),c=db({},c,v,hC);var C=db({},c.imports,v.imports,hC),I=Kt(C),q=tl(C,I);yr(I,function(me){if(kr.test(me))throw new be(a)});var D,H,Q=0,Z=c.interpolate||bo,ee="__p += '",ie=nl((c.escape||bo).source+"|"+Z.source+"|"+(Z===cn?Ai:bo).source+"|"+(c.evaluate||bo).source+"|$","g"),ue="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ty+"]")+`
3
+ `)}function uM(o){return Re(o)||Ho(o)||!!(mp&&o&&o[mp])}function Hi(o,c){var p=typeof o;return c=c??et,!!c&&(p=="number"||p!="symbol"&&ms.test(o))&&o>-1&&o%1==0&&o<c}function _r(o,c,p){if(!Ct(p))return!1;var v=typeof c;return(v=="number"?qr(p)&&Hi(c,p.length):v=="string"&&c in p)?Hn(p[c],o):!1}function rb(o,c){if(Re(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Xr(o)?!0:qe.test(o)||!Pr.test(o)||c!=null&&o in Ue(c)}function fM(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function nb(o){var c=Up(o),p=O[c];if(typeof p!="function"||!(c in $e.prototype))return!1;if(o===p)return!0;var v=Xv(p);return!!v&&o===v[0]}function dM(o){return!!dp&&dp in o}var pM=Io?Bi:wb;function wu(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||_s;return o===p}function wC(o){return o===o&&!Ct(o)}function _C(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==t||o in Ue(p))}}function hM(o){var c=Jp(o,function(v){return p.size===f&&p.clear(),v}),p=c.cache;return c}function mM(o,c){var p=o[1],v=c[1],C=p|v,I=C<(R|P|X),q=v==X&&p==U||v==X&&p==T&&o[7].length<=c[8]||v==(X|T)&&c[7].length<=c[8]&&p==U;if(!(I||q))return o;v&R&&(o[2]=c[2],C|=p&R?0:A);var D=c[3];if(D){var H=o[3];o[3]=H?iC(H,D,c[4]):D,o[4]=H?dn(o[3],d):c[4]}return D=c[5],D&&(H=o[5],o[5]=H?sC(H,D,c[6]):D,o[6]=H?dn(o[5],d):c[6]),D=c[7],D&&(o[7]=D),v&X&&(o[8]=o[8]==null?c[8]:Ht(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=C,o}function gM(o){var c=[];if(o!=null)for(var p in Ue(o))c.push(p);return c}function yM(o){return sl.call(o)}function RC(o,c,p){return c=gt(c===t?o.length-1:c,0),function(){for(var v=arguments,C=-1,I=gt(v.length-c,0),q=z(I);++C<I;)q[C]=v[c+C];C=-1;for(var D=z(c+1);++C<c;)D[C]=v[C];return D[c]=p(q),gr(o,this,D)}}function xC(o,c){return c.length<2?o:Li(o,gn(c,0,-1))}function vM(o,c){for(var p=o.length,v=Ht(c.length,p),C=Ar(o);v--;){var I=c[v];o[v]=Hi(I,p)?C[I]:t}return o}function ib(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var CC=OC(Gx),_u=av||function(o,c){return Nt.setTimeout(o,c)},sb=OC(U$);function EC(o,c,p){var v=c+"";return sb(o,cM(v,bM(oM(v),p)))}function OC(o){var c=0,p=0;return function(){var v=yp(),C=$-(v-p);if(p=v,C>0){if(++c>=j)return arguments[0]}else c=0;return o.apply(t,arguments)}}function Bp(o,c){var p=-1,v=o.length,C=v-1;for(c=c===t?v:c;++p<c;){var I=Uv(p,C),q=o[I];o[I]=o[p],o[p]=q}return o.length=c,o}var IC=hM(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Bc,function(p,v,C,I){c.push(C?I.replace(qn,"$1"):v||p)}),c});function Un(o){if(typeof o=="string"||Xr(o))return o;var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function Uo(o){if(o!=null){try{return il.call(o)}catch{}try{return o+""}catch{}}return""}function bM(o,c){return yr(ce,function(p){var v="_."+p[0];c&p[1]&&!Qa(o,v)&&o.push(v)}),o.sort()}function PC(o){if(o instanceof $e)return o.clone();var c=new ir(o.__wrapped__,o.__chain__);return c.__actions__=Ar(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function SM(o,c,p){(p?_r(o,c,p):c===t)?c=1:c=gt(Ee(c),0);var v=o==null?0:o.length;if(!v||c<1)return[];for(var C=0,I=0,q=z(To(v/c));C<v;)q[I++]=gn(o,C,C+=c);return q}function wM(o){for(var c=-1,p=o==null?0:o.length,v=0,C=[];++c<p;){var I=o[c];I&&(C[v++]=I)}return C}function _M(){var o=arguments.length;if(!o)return[];for(var c=z(o-1),p=arguments[0],v=o;v--;)c[v-1]=arguments[v];return pi(Re(p)?Ar(p):[p],Bt(c,1))}var RM=Te(function(o,c){return qt(o)?Do(o,Bt(c,1,qt,!0)):[]}),xM=Te(function(o,c){var p=yn(c);return qt(p)&&(p=t),qt(o)?Do(o,Bt(c,1,qt,!0),ge(p,2)):[]}),CM=Te(function(o,c){var p=yn(c);return qt(p)&&(p=t),qt(o)?Do(o,Bt(c,1,qt,!0),t,p):[]});function EM(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),gn(o,c<0?0:c,v)):[]}function OM(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),c=v-c,gn(o,0,c<0?0:c)):[]}function IM(o,c){return o&&o.length?Mp(o,ge(c,3),!0,!0):[]}function PM(o,c){return o&&o.length?Mp(o,ge(c,3),!0):[]}function kM(o,c,p,v){var C=o==null?0:o.length;return C?(p&&typeof p!="number"&&_r(o,c,p)&&(p=0,v=C),$v(o,c,p,v)):[]}function kC(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=p==null?0:Ee(p);return C<0&&(C=gt(v+C,0)),Xa(o,ge(c,3),C)}function TC(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=v-1;return p!==t&&(C=Ee(p),C=p<0?gt(v+C,0):Ht(C,v-1)),Xa(o,ge(c,3),C,!0)}function AC(o){var c=o==null?0:o.length;return c?Bt(o,1):[]}function TM(o){var c=o==null?0:o.length;return c?Bt(o,pe):[]}function AM(o,c){var p=o==null?0:o.length;return p?(c=c===t?1:Ee(c),Bt(o,c)):[]}function qM(o){for(var c=-1,p=o==null?0:o.length,v={};++c<p;){var C=o[c];Kr(v,C[0],C[1])}return v}function qC(o){return o&&o.length?o[0]:t}function $M(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=p==null?0:Ee(p);return C<0&&(C=gt(v+C,0)),$i(o,c,C)}function MM(o){var c=o==null?0:o.length;return c?gn(o,0,-1):[]}var NM=Te(function(o){var c=ct(o,zv);return c.length&&c[0]===o[0]?Qr(c):[]}),DM=Te(function(o){var c=yn(o),p=ct(o,zv);return c===yn(p)?c=t:p.pop(),p.length&&p[0]===o[0]?Qr(p,ge(c,2)):[]}),FM=Te(function(o){var c=yn(o),p=ct(o,zv);return c=typeof c=="function"?c:t,c&&p.pop(),p.length&&p[0]===o[0]?Qr(p,t,c):[]});function LM(o,c){return o==null?"":pl.call(o,c)}function yn(o){var c=o==null?0:o.length;return c?o[c-1]:t}function jM(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var C=v;return p!==t&&(C=Ee(p),C=C<0?gt(v+C,0):Ht(C,v-1)),c===c?lu(o,c,C):Xa(o,Mi,C,!0)}function UM(o,c){return o&&o.length?jn(o,Ee(c)):t}var HM=Te($C);function $C(o,c){return o&&o.length&&c&&c.length?jv(o,c):o}function BM(o,c,p){return o&&o.length&&c&&c.length?jv(o,c,ge(p,2)):o}function VM(o,c,p){return o&&o.length&&c&&c.length?jv(o,c,t,p):o}var WM=Ui(function(o,c){var p=o==null?0:o.length,v=hu(o,c);return Jx(o,ct(c,function(C){return Hi(C,p)?+C:C}).sort(nC)),v});function zM(o,c){var p=[];if(!(o&&o.length))return p;var v=-1,C=[],I=o.length;for(c=ge(c,3);++v<I;){var q=o[v];c(q,v,o)&&(p.push(q),C.push(v))}return Jx(o,C),p}function ob(o){return o==null?o:cv.call(o)}function JM(o,c,p){var v=o==null?0:o.length;return v?(p&&typeof p!="number"&&_r(o,c,p)?(c=0,p=v):(c=c==null?0:Ee(c),p=p===t?v:Ee(p)),gn(o,c,p)):[]}function GM(o,c){return $p(o,c)}function YM(o,c,p){return Bv(o,c,ge(p,2))}function KM(o,c){var p=o==null?0:o.length;if(p){var v=$p(o,c);if(v<p&&Hn(o[v],c))return v}return-1}function QM(o,c){return $p(o,c,!0)}function ZM(o,c,p){return Bv(o,c,ge(p,2),!0)}function XM(o,c){var p=o==null?0:o.length;if(p){var v=$p(o,c,!0)-1;if(Hn(o[v],c))return v}return-1}function eN(o){return o&&o.length?Yx(o):[]}function tN(o,c){return o&&o.length?Yx(o,ge(c,2)):[]}function rN(o){var c=o==null?0:o.length;return c?gn(o,1,c):[]}function nN(o,c,p){return o&&o.length?(c=p||c===t?1:Ee(c),gn(o,0,c<0?0:c)):[]}function iN(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),c=v-c,gn(o,c<0?0:c,v)):[]}function sN(o,c){return o&&o.length?Mp(o,ge(c,3),!1,!0):[]}function oN(o,c){return o&&o.length?Mp(o,ge(c,3)):[]}var aN=Te(function(o){return Ps(Bt(o,1,qt,!0))}),lN=Te(function(o){var c=yn(o);return qt(c)&&(c=t),Ps(Bt(o,1,qt,!0),ge(c,2))}),cN=Te(function(o){var c=yn(o);return c=typeof c=="function"?c:t,Ps(Bt(o,1,qt,!0),t,c)});function uN(o){return o&&o.length?Ps(o):[]}function fN(o,c){return o&&o.length?Ps(o,ge(c,2)):[]}function dN(o,c){return c=typeof c=="function"?c:t,o&&o.length?Ps(o,t,c):[]}function ab(o){if(!(o&&o.length))return[];var c=0;return o=di(o,function(p){if(qt(p))return c=gt(p.length,c),!0}),ou(c,function(p){return ct(o,xo(p))})}function MC(o,c){if(!(o&&o.length))return[];var p=ab(o);return c==null?p:ct(p,function(v){return gr(c,t,v)})}var pN=Te(function(o,c){return qt(o)?Do(o,c):[]}),hN=Te(function(o){return Wv(di(o,qt))}),mN=Te(function(o){var c=yn(o);return qt(c)&&(c=t),Wv(di(o,qt),ge(c,2))}),gN=Te(function(o){var c=yn(o);return c=typeof c=="function"?c:t,Wv(di(o,qt),t,c)}),yN=Te(ab);function vN(o,c){return Xx(o||[],c||[],wr)}function bN(o,c){return Xx(o||[],c||[],bu)}var SN=Te(function(o){var c=o.length,p=c>1?o[c-1]:t;return p=typeof p=="function"?(o.pop(),p):t,MC(o,p)});function NC(o){var c=O(o);return c.__chain__=!0,c}function wN(o,c){return c(o),o}function Vp(o,c){return c(o)}var _N=Ui(function(o){var c=o.length,p=c?o[0]:0,v=this.__wrapped__,C=function(I){return hu(I,o)};return c>1||this.__actions__.length||!(v instanceof $e)||!Hi(p)?this.thru(C):(v=v.slice(p,+p+(c?1:0)),v.__actions__.push({func:Vp,args:[C],thisArg:t}),new ir(v,this.__chain__).thru(function(I){return c&&!I.length&&I.push(t),I}))});function RN(){return NC(this)}function xN(){return new ir(this.value(),this.__chain__)}function CN(){this.__values__===t&&(this.__values__=KC(this.value()));var o=this.__index__>=this.__values__.length,c=o?t:this.__values__[this.__index__++];return{done:o,value:c}}function EN(){return this}function ON(o){for(var c,p=this;p instanceof gl;){var v=PC(p);v.__index__=0,v.__values__=t,c?C.__wrapped__=v:c=v;var C=v;p=p.__wrapped__}return C.__wrapped__=o,c}function IN(){var o=this.__wrapped__;if(o instanceof $e){var c=o;return this.__actions__.length&&(c=new $e(this)),c=c.reverse(),c.__actions__.push({func:Vp,args:[ob],thisArg:t}),new ir(c,this.__chain__)}return this.thru(ob)}function PN(){return Zx(this.__wrapped__,this.__actions__)}var kN=Np(function(o,c,p){Ze.call(o,p)?++o[p]:Kr(o,p,1)});function TN(o,c,p){var v=Re(o)?ip:qv;return p&&_r(o,c,p)&&(c=t),v(o,ge(c,3))}function AN(o,c){var p=Re(o)?di:kp;return p(o,ge(c,3))}var qN=cC(kC),$N=cC(TC);function MN(o,c){return Bt(Wp(o,c),1)}function NN(o,c){return Bt(Wp(o,c),pe)}function DN(o,c,p){return p=p===t?1:Ee(p),Bt(Wp(o,c),p)}function DC(o,c){var p=Re(o)?yr:bi;return p(o,ge(c,3))}function FC(o,c){var p=Re(o)?ru:Pp;return p(o,ge(c,3))}var FN=Np(function(o,c,p){Ze.call(o,p)?o[p].push(c):Kr(o,p,[c])});function LN(o,c,p,v){o=qr(o)?o:Cl(o),p=p&&!v?Ee(p):0;var C=o.length;return p<0&&(p=gt(C+p,0)),Kp(o)?p<=C&&o.indexOf(c,p)>-1:!!C&&$i(o,c,p)>-1}var jN=Te(function(o,c,p){var v=-1,C=typeof c=="function",I=qr(o)?z(o.length):[];return bi(o,function(q){I[++v]=C?gr(c,q,p):Fo(q,c,p)}),I}),UN=Np(function(o,c,p){Kr(o,p,c)});function Wp(o,c){var p=Re(o)?ct:oe;return p(o,ge(c,3))}function HN(o,c,p,v){return o==null?[]:(Re(c)||(c=c==null?[]:[c]),p=v?t:p,Re(p)||(p=p==null?[]:[p]),Wx(o,c,p))}var BN=Np(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function VN(o,c,p){var v=Re(o)?nu:el,C=arguments.length<3;return v(o,ge(c,4),p,C,bi)}function WN(o,c,p){var v=Re(o)?My:el,C=arguments.length<3;return v(o,ge(c,4),p,C,Pp)}function zN(o,c){var p=Re(o)?di:kp;return p(o,Gp(ge(c,3)))}function JN(o){var c=Re(o)?Ep:L$;return c(o)}function GN(o,c,p){(p?_r(o,c,p):c===t)?c=1:c=Ee(c);var v=Re(o)?Pv:j$;return v(o,c)}function YN(o){var c=Re(o)?kv:H$;return c(o)}function KN(o){if(o==null)return 0;if(qr(o))return Kp(o)?hi(o):o.length;var c=or(o);return c==Jt||c==mr?o.size:E(o).length}function QN(o,c,p){var v=Re(o)?Za:B$;return p&&_r(o,c,p)&&(c=t),v(o,ge(c,3))}var ZN=Te(function(o,c){if(o==null)return[];var p=c.length;return p>1&&_r(o,c[0],c[1])?c=[]:p>2&&_r(c[0],c[1],c[2])&&(c=[c[0]]),Wx(o,Bt(c,1),[])}),zp=ov||function(){return Nt.Date.now()};function XN(o,c){if(typeof c!="function")throw new Sr(i);return o=Ee(o),function(){if(--o<1)return c.apply(this,arguments)}}function LC(o,c,p){return c=p?t:c,c=o&&c==null?o.length:c,ji(o,X,t,t,t,t,c)}function jC(o,c){var p;if(typeof c!="function")throw new Sr(i);return o=Ee(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=t),p}}var lb=Te(function(o,c,p){var v=R;if(p.length){var C=dn(p,Rl(lb));v|=V}return ji(o,v,c,p,C)}),UC=Te(function(o,c,p){var v=R|P;if(p.length){var C=dn(p,Rl(UC));v|=V}return ji(c,v,o,p,C)});function HC(o,c,p){c=p?t:c;var v=ji(o,U,t,t,t,t,t,c);return v.placeholder=HC.placeholder,v}function BC(o,c,p){c=p?t:c;var v=ji(o,B,t,t,t,t,t,c);return v.placeholder=BC.placeholder,v}function VC(o,c,p){var v,C,I,q,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof o!="function")throw new Sr(i);c=vn(c)||0,Ct(p)&&(Z=!!p.leading,ee="maxWait"in p,I=ee?gt(vn(p.maxWait)||0,c):I,ie="trailing"in p?!!p.trailing:ie);function ue($t){var Bn=v,Wi=C;return v=C=t,Q=$t,q=o.apply(Wi,Bn),q}function ye($t){return Q=$t,D=_u(Le,c),Z?ue($t):q}function Ie($t){var Bn=$t-H,Wi=$t-Q,uE=c-Bn;return ee?Ht(uE,I-Wi):uE}function me($t){var Bn=$t-H,Wi=$t-Q;return H===t||Bn>=c||Bn<0||ee&&Wi>=I}function Le(){var $t=zp();if(me($t))return He($t);D=_u(Le,Ie($t))}function He($t){return D=t,ie&&v?ue($t):(v=C=t,q)}function en(){D!==t&&eC(D),Q=0,v=H=C=D=t}function Rr(){return D===t?q:He(zp())}function tn(){var $t=zp(),Bn=me($t);if(v=arguments,C=this,H=$t,Bn){if(D===t)return ye(H);if(ee)return eC(D),D=_u(Le,c),ue(H)}return D===t&&(D=_u(Le,c)),q}return tn.cancel=en,tn.flush=Rr,tn}var eD=Te(function(o,c){return mu(o,1,c)}),tD=Te(function(o,c,p){return mu(o,vn(c)||0,p)});function rD(o){return ji(o,x)}function Jp(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new Sr(i);var p=function(){var v=arguments,C=c?c.apply(this,v):v[0],I=p.cache;if(I.has(C))return I.get(C);var q=o.apply(this,v);return p.cache=I.set(C,q)||I,q};return p.cache=new(Jp.Cache||Dn),p}Jp.Cache=Dn;function Gp(o){if(typeof o!="function")throw new Sr(i);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function nD(o){return jC(2,o)}var iD=V$(function(o,c){c=c.length==1&&Re(c[0])?ct(c[0],vr(ge())):ct(Bt(c,1),vr(ge()));var p=c.length;return Te(function(v){for(var C=-1,I=Ht(v.length,p);++C<I;)v[C]=c[C].call(this,v[C]);return gr(o,this,v)})}),cb=Te(function(o,c){var p=dn(c,Rl(cb));return ji(o,V,t,c,p)}),WC=Te(function(o,c){var p=dn(c,Rl(WC));return ji(o,W,t,c,p)}),sD=Ui(function(o,c){return ji(o,T,t,t,t,c)});function oD(o,c){if(typeof o!="function")throw new Sr(i);return c=c===t?c:Ee(c),Te(o,c)}function aD(o,c){if(typeof o!="function")throw new Sr(i);return c=c==null?0:gt(Ee(c),0),Te(function(p){var v=p[c],C=Ts(p,0,c);return v&&pi(C,v),gr(o,this,C)})}function lD(o,c,p){var v=!0,C=!0;if(typeof o!="function")throw new Sr(i);return Ct(p)&&(v="leading"in p?!!p.leading:v,C="trailing"in p?!!p.trailing:C),VC(o,c,{leading:v,maxWait:c,trailing:C})}function cD(o){return LC(o,1)}function uD(o,c){return cb(Jv(c),o)}function fD(){if(!arguments.length)return[];var o=arguments[0];return Re(o)?o:[o]}function dD(o){return sr(o,y)}function pD(o,c){return c=typeof c=="function"?c:t,sr(o,y,c)}function hD(o){return sr(o,m|y)}function mD(o,c){return c=typeof c=="function"?c:t,sr(o,m|y,c)}function gD(o,c){return c==null||hn(o,c,Kt(c))}function Hn(o,c){return o===c||o!==o&&c!==c}var yD=jp(yu),vD=jp(function(o,c){return o>=c}),Ho=qp((function(){return arguments})())?qp:function(o){return Ot(o)&&Ze.call(o,"callee")&&!Po.call(o,"callee")},Re=z.isArray,bD=tu?vr(tu):Fv;function qr(o){return o!=null&&Yp(o.length)&&!Bi(o)}function qt(o){return Ot(o)&&qr(o)}function SD(o){return o===!0||o===!1||Ot(o)&&Qt(o)==Gr}var As=dl||wb,wD=rp?vr(rp):Lv;function _D(o){return Ot(o)&&o.nodeType===1&&!Ru(o)}function RD(o){if(o==null)return!0;if(qr(o)&&(Re(o)||typeof o=="string"||typeof o.splice=="function"||As(o)||xl(o)||Ho(o)))return!o.length;var c=or(o);if(c==Jt||c==mr)return!o.size;if(wu(o))return!E(o).length;for(var p in o)if(Ze.call(o,p))return!1;return!0}function xD(o,c){return Lo(o,c)}function CD(o,c,p){p=typeof p=="function"?p:t;var v=p?p(o,c):t;return v===t?Lo(o,c,t,p):!!v}function ub(o){if(!Ot(o))return!1;var c=Qt(o);return c==mt||c==ht||typeof o.message=="string"&&typeof o.name=="string"&&!Ru(o)}function ED(o){return typeof o=="number"&&Di(o)}function Bi(o){if(!Ct(o))return!1;var c=Qt(o);return c==ln||c==fo||c==Rt||c==Dd}function zC(o){return typeof o=="number"&&o==Ee(o)}function Yp(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=et}function Ct(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function Ot(o){return o!=null&&typeof o=="object"}var JC=np?vr(np):Os;function OD(o,c){return o===c||Is(o,c,eb(c))}function ID(o,c,p){return p=typeof p=="function"?p:t,Is(o,c,eb(c),p)}function PD(o){return GC(o)&&o!=+o}function kD(o){if(pM(o))throw new be(n);return Fe(o)}function TD(o){return o===null}function AD(o){return o==null}function GC(o){return typeof o=="number"||Ot(o)&&Qt(o)==po}function Ru(o){if(!Ot(o)||Qt(o)!=kn)return!1;var c=ll(o);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&il.call(p)==rv}var fb=Ro?vr(Ro):u;function qD(o){return zC(o)&&o>=-et&&o<=et}var YC=$n?vr($n):h;function Kp(o){return typeof o=="string"||!Re(o)&&Ot(o)&&Qt(o)==ho}function Xr(o){return typeof o=="symbol"||Ot(o)&&Qt(o)==Da}var xl=Ka?vr(Ka):b;function $D(o){return o===t}function MD(o){return Ot(o)&&or(o)==Ut}function ND(o){return Ot(o)&&Qt(o)==Ld}var DD=jp(J),FD=jp(function(o,c){return o<=c});function KC(o){if(!o)return[];if(qr(o))return Kp(o)?br(o):Ar(o);if(ko&&o[ko])return zy(o[ko]());var c=or(o),p=c==Jt?ws:c==mr?rl:Cl;return p(o)}function Vi(o){if(!o)return o===0?o:0;if(o=vn(o),o===pe||o===-pe){var c=o<0?-1:1;return c*_e}return o===o?o:0}function Ee(o){var c=Vi(o),p=c%1;return c===c?p?c-p:c:0}function QC(o){return o?vi(Ee(o),0,Ce):0}function vn(o){if(typeof o=="number")return o;if(Xr(o))return he;if(Ct(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=Ct(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=au(o);var p=vo.test(o);return p||fy.test(o)?qy(o.slice(2),p?2:8):uy.test(o)?he:+o}function ZC(o){return Si(o,$r(o))}function LD(o){return o?vi(Ee(o),-et,et):o===0?o:0}function nt(o){return o==null?"":Zr(o)}var jD=wl(function(o,c){if(wu(c)||qr(c)){Si(c,Kt(c),o);return}for(var p in c)Ze.call(c,p)&&wr(o,p,c[p])}),XC=wl(function(o,c){Si(c,$r(c),o)}),eE=wl(function(o,c,p,v){Si(c,$r(c),o,v)}),db=wl(function(o,c,p,v){Si(c,Kt(c),o,v)}),UD=Ui(hu);function HD(o,c){var p=Cs(o);return c==null?p:Ip(p,c)}var BD=Te(function(o,c){o=Ue(o);var p=-1,v=c.length,C=v>2?c[2]:t;for(C&&_r(c[0],c[1],C)&&(v=1);++p<v;)for(var I=c[p],q=$r(I),D=-1,H=q.length;++D<H;){var Q=q[D],Z=o[Q];(Z===t||Hn(Z,_s[Q])&&!Ze.call(o,Q))&&(o[Q]=I[Q])}return o}),VD=Te(function(o){return o.push(t,gC),gr(tE,t,o)});function WD(o,c){return sp(o,ge(c,3),mn)}function zD(o,c){return sp(o,ge(c,3),Fn)}function JD(o,c){return o==null?o:gu(o,ge(c,3),$r)}function GD(o,c){return o==null?o:Tp(o,ge(c,3),$r)}function YD(o,c){return o&&mn(o,ge(c,3))}function KD(o,c){return o&&Fn(o,ge(c,3))}function QD(o){return o==null?[]:Sl(o,Kt(o))}function ZD(o){return o==null?[]:Sl(o,$r(o))}function pb(o,c,p){var v=o==null?t:Li(o,c);return v===t?p:v}function XD(o,c){return o!=null&&bC(o,c,Mv)}function hb(o,c){return o!=null&&bC(o,c,Nv)}var eF=fC(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=sl.call(c)),o[c]=p},gb(Mr)),tF=fC(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=sl.call(c)),Ze.call(o,c)?o[c].push(p):o[c]=[p]},ge),rF=Te(Fo);function Kt(o){return qr(o)?Cp(o):E(o)}function $r(o){return qr(o)?Cp(o,!0):M(o)}function nF(o,c){var p={};return c=ge(c,3),mn(o,function(v,C,I){Kr(p,c(v,C,I),v)}),p}function iF(o,c){var p={};return c=ge(c,3),mn(o,function(v,C,I){Kr(p,C,c(v,C,I))}),p}var sF=wl(function(o,c,p){Dt(o,c,p)}),tE=wl(function(o,c,p,v){Dt(o,c,p,v)}),oF=Ui(function(o,c){var p={};if(o==null)return p;var v=!1;c=ct(c,function(I){return I=ks(I,o),v||(v=I.length>1),I}),Si(o,Zv(o),p),v&&(p=sr(p,m|g|y,tM));for(var C=c.length;C--;)Vv(p,c[C]);return p});function aF(o,c){return rE(o,Gp(ge(c)))}var lF=Ui(function(o,c){return o==null?{}:N$(o,c)});function rE(o,c){if(o==null)return{};var p=ct(Zv(o),function(v){return[v]});return c=ge(c),zx(o,p,function(v,C){return c(v,C[0])})}function cF(o,c,p){c=ks(c,o);var v=-1,C=c.length;for(C||(C=1,o=t);++v<C;){var I=o==null?t:o[Un(c[v])];I===t&&(v=C,I=p),o=Bi(I)?I.call(o):I}return o}function uF(o,c,p){return o==null?o:bu(o,c,p)}function fF(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:bu(o,c,p,v)}var nE=hC(Kt),iE=hC($r);function dF(o,c,p){var v=Re(o),C=v||As(o)||xl(o);if(c=ge(c,4),p==null){var I=o&&o.constructor;C?p=v?new I:[]:Ct(o)?p=Bi(I)?Cs(ll(o)):{}:p={}}return(C?yr:mn)(o,function(q,D,H){return c(p,q,D,H)}),p}function pF(o,c){return o==null?!0:Vv(o,c)}function hF(o,c,p){return o==null?o:Qx(o,c,Jv(p))}function mF(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:Qx(o,c,Jv(p),v)}function Cl(o){return o==null?[]:tl(o,Kt(o))}function gF(o){return o==null?[]:tl(o,$r(o))}function yF(o,c,p){return p===t&&(p=c,c=t),p!==t&&(p=vn(p),p=p===p?p:0),c!==t&&(c=vn(c),c=c===c?c:0),vi(vn(o),c,p)}function vF(o,c,p){return c=Vi(c),p===t?(p=c,c=0):p=Vi(p),o=vn(o),Dv(o,c,p)}function bF(o,c,p){if(p&&typeof p!="boolean"&&_r(o,c,p)&&(c=p=t),p===t&&(typeof c=="boolean"?(p=c,c=t):typeof o=="boolean"&&(p=o,o=t)),o===t&&c===t?(o=0,c=1):(o=Vi(o),c===t?(c=o,o=0):c=Vi(c)),o>c){var v=o;o=c,c=v}if(p||o%1||c%1){var C=vp();return Ht(o+C*(c-o+ep("1e-"+((C+"").length-1))),c)}return Uv(o,c)}var SF=_l(function(o,c,p){return c=c.toLowerCase(),o+(p?sE(c):c)});function sE(o){return mb(nt(o).toLowerCase())}function oE(o){return o=nt(o),o&&o.replace(bo,Hy).replace(Ey,"")}function wF(o,c,p){o=nt(o),c=Zr(c);var v=o.length;p=p===t?v:vi(Ee(p),0,v);var C=p;return p-=c.length,p>=0&&o.slice(p,C)==c}function _F(o){return o=nt(o),o&&le.test(o)?o.replace(Ua,By):o}function RF(o){return o=nt(o),o&&yo.test(o)?o.replace(Ke,"\\$&"):o}var xF=_l(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),CF=_l(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),EF=lC("toLowerCase");function OF(o,c,p){o=nt(o),c=Ee(c);var v=c?hi(o):0;if(!c||v>=c)return o;var C=(c-v)/2;return Lp(Ao(C),p)+o+Lp(To(C),p)}function IF(o,c,p){o=nt(o),c=Ee(c);var v=c?hi(o):0;return c&&v<c?o+Lp(c-v,p):o}function PF(o,c,p){o=nt(o),c=Ee(c);var v=c?hi(o):0;return c&&v<c?Lp(c-v,p)+o:o}function kF(o,c,p){return p||c==null?c=0:c&&(c=+c),lv(nt(o).replace(Vc,""),c||0)}function TF(o,c,p){return(p?_r(o,c,p):c===t)?c=1:c=Ee(c),Hv(nt(o),c)}function AF(){var o=arguments,c=nt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var qF=_l(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function $F(o,c,p){return p&&typeof p!="number"&&_r(o,c,p)&&(c=p=t),p=p===t?Ce:p>>>0,p?(o=nt(o),o&&(typeof c=="string"||c!=null&&!fb(c))&&(c=Zr(c),!c&&Ss(o))?Ts(br(o),0,p):o.split(c,p)):[]}var MF=_l(function(o,c,p){return o+(p?" ":"")+mb(c)});function NF(o,c,p){return o=nt(o),p=p==null?0:vi(Ee(p),0,o.length),c=Zr(c),o.slice(p,p+c.length)==c}function DF(o,c,p){var v=O.templateSettings;p&&_r(o,c,p)&&(c=t),o=nt(o),c=db({},c,v,mC);var C=db({},c.imports,v.imports,mC),I=Kt(C),q=tl(C,I);yr(I,function(me){if(kr.test(me))throw new be(a)});var D,H,Q=0,Z=c.interpolate||So,ee="__p += '",ie=nl((c.escape||So).source+"|"+Z.source+"|"+(Z===cn?Ai:So).source+"|"+(c.evaluate||So).source+"|$","g"),ue="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ty+"]")+`
4
4
  `;o.replace(ie,function(me,Le,He,en,Rr,tn){return He||(He=en),ee+=o.slice(Q,tn).replace(dy,Vy),Le&&(D=!0,ee+=`' +
5
5
  __e(`+Le+`) +
6
6
  '`),Rr&&(H=!0,ee+=`';
@@ -11,33 +11,33 @@ __p += '`),He&&(ee+=`' +
11
11
  `;var ye=Ze.call(c,"variable")&&c.variable;if(!ye)ee=`with (obj) {
12
12
  `+ee+`
13
13
  }
14
- `;else if(kr.test(ye))throw new be(s);ee=(H?ee.replace(ja,""):ee).replace(ay,"$1").replace(mo,"$1;"),ee="function("+(ye||"obj")+`) {
14
+ `;else if(kr.test(ye))throw new be(s);ee=(H?ee.replace(ja,""):ee).replace(ay,"$1").replace(go,"$1;"),ee="function("+(ye||"obj")+`) {
15
15
  `+(ye?"":`obj || (obj = {});
16
16
  `)+"var __t, __p = ''"+(D?", __e = _.escape":"")+(H?`, __j = Array.prototype.join;
17
17
  function print() { __p += __j.call(arguments, '') }
18
18
  `:`;
19
19
  `)+ee+`return __p
20
- }`;var Ie=aE(function(){return Ge(I,ue+"return "+ee).apply(t,q)});if(Ie.source=ee,ub(Ie))throw Ie;return Ie}function DF(o){return nt(o).toLowerCase()}function FF(o){return nt(o).toUpperCase()}function LF(o,c,p){if(o=nt(o),o&&(p||c===t))return au(o);if(!o||!(c=Zr(c)))return o;var v=br(o),C=br(c),I=sp(v,C),q=op(v,C)+1;return Ts(v,I,q).join("")}function jF(o,c,p){if(o=nt(o),o&&(p||c===t))return o.slice(0,cp(o)+1);if(!o||!(c=Zr(c)))return o;var v=br(o),C=op(v,br(c))+1;return Ts(v,0,C).join("")}function UF(o,c,p){if(o=nt(o),o&&(p||c===t))return o.replace(Vc,"");if(!o||!(c=Zr(c)))return o;var v=br(o),C=sp(v,br(c));return Ts(v,C).join("")}function HF(o,c){var p=k,v=N;if(Ct(c)){var C="separator"in c?c.separator:C;p="length"in c?Ee(c.length):p,v="omission"in c?Zr(c.omission):v}o=nt(o);var I=o.length;if(Ss(o)){var q=br(o);I=q.length}if(p>=I)return o;var D=p-hi(v);if(D<1)return v;var H=q?Ts(q,0,D).join(""):o.slice(0,D);if(C===t)return H+v;if(q&&(D+=H.length-D),fb(C)){if(o.slice(D).search(C)){var Q,Z=H;for(C.global||(C=nl(C.source,nt(Fd.exec(C))+"g")),C.lastIndex=0;Q=C.exec(Z);)var ee=Q.index;H=H.slice(0,ee===t?D:ee)}}else if(o.indexOf(Zr(C),D)!=D){var ie=H.lastIndexOf(C);ie>-1&&(H=H.slice(0,ie))}return H+v}function BF(o){return o=nt(o),o&&Ha.test(o)?o.replace(Ti,Gy):o}var VF=_l(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),mb=aC("toUpperCase");function oE(o,c,p){return o=nt(o),c=p?t:c,c===t?Wy(o)?Qy(o):Fy(o):o.match(c)||[]}var aE=Te(function(o,c){try{return gr(o,t,c)}catch(p){return ub(p)?p:new be(p)}}),WF=Ui(function(o,c){return yr(c,function(p){p=Un(p),Kr(o,p,lb(o[p],o))}),o});function zF(o){var c=o==null?0:o.length,p=ge();return o=c?ct(o,function(v){if(typeof v[1]!="function")throw new Sr(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var C=-1;++C<c;){var I=o[C];if(gr(I[0],this,v))return gr(I[1],this,v)}})}function JF(o){return Av(sr(o,m))}function gb(o){return function(){return o}}function GF(o,c){return o==null||o!==o?c:o}var YF=cC(),KF=cC(!0);function Mr(o){return o}function yb(o){return w(typeof o=="function"?o:sr(o,m))}function QF(o){return ve(sr(o,m))}function ZF(o,c){return Me(o,sr(c,m))}var XF=Te(function(o,c){return function(p){return Do(p,o,c)}}),eL=Te(function(o,c){return function(p){return Do(o,p,c)}});function vb(o,c,p){var v=Kt(c),C=Sl(c,v);p==null&&!(Ct(c)&&(C.length||!v.length))&&(p=c,c=o,o=this,C=Sl(c,Kt(c)));var I=!(Ct(p)&&"chain"in p)||!!p.chain,q=Bi(o);return yr(C,function(D){var H=c[D];o[D]=H,q&&(o.prototype[D]=function(){var Q=this.__chain__;if(I||Q){var Z=o(this.__wrapped__),ee=Z.__actions__=Ar(this.__actions__);return ee.push({func:H,args:arguments,thisArg:o}),Z.__chain__=Q,Z}return H.apply(o,pi([this.value()],arguments))})}),o}function tL(){return Nt._===this&&(Nt._=nv),this}function bb(){}function rL(o){return o=Ee(o),Te(function(c){return jn(c,o)})}var nL=Yv(ct),iL=Yv(rp),sL=Yv(Za);function lE(o){return rb(o)?Ro(Un(o)):N$(o)}function oL(o){return function(c){return o==null?t:Li(o,c)}}var aL=fC(),lL=fC(!0);function Sb(){return[]}function wb(){return!1}function cL(){return{}}function uL(){return""}function fL(){return!0}function dL(o,c){if(o=Ee(o),o<1||o>et)return[];var p=Ce,v=Ht(o,Ce);c=ge(c),o-=Ce;for(var C=ou(v,c);++p<o;)c(p);return C}function pL(o){return Re(o)?ct(o,Un):Xr(o)?[o]:Ar(OC(nt(o)))}function hL(o){var c=++tv;return nt(o)+c}var mL=Np(function(o,c){return o+c},0),gL=Kv("ceil"),yL=Np(function(o,c){return o/c},1),vL=Kv("floor");function bL(o){return o&&o.length?bl(o,Mr,yu):t}function SL(o,c){return o&&o.length?bl(o,ge(c,2),yu):t}function wL(o){return ip(o,Mr)}function _L(o,c){return ip(o,ge(c,2))}function RL(o){return o&&o.length?bl(o,Mr,J):t}function xL(o,c){return o&&o.length?bl(o,ge(c,2),J):t}var CL=Np(function(o,c){return o*c},1),EL=Kv("round"),OL=Np(function(o,c){return o-c},0);function IL(o){return o&&o.length?su(o,Mr):0}function PL(o,c){return o&&o.length?su(o,ge(c,2)):0}return O.after=ZN,O.ary=FC,O.assign=LD,O.assignIn=ZC,O.assignInWith=XC,O.assignWith=db,O.at=jD,O.before=LC,O.bind=lb,O.bindAll=WF,O.bindKey=jC,O.castArray=uD,O.chain=MC,O.chunk=bM,O.compact=SM,O.concat=wM,O.cond=zF,O.conforms=JF,O.constant=gb,O.countBy=PN,O.create=UD,O.curry=UC,O.curryRight=HC,O.debounce=BC,O.defaults=HD,O.defaultsDeep=BD,O.defer=XN,O.delay=eD,O.difference=_M,O.differenceBy=RM,O.differenceWith=xM,O.drop=CM,O.dropRight=EM,O.dropRightWhile=OM,O.dropWhile=IM,O.fill=PM,O.filter=TN,O.flatMap=$N,O.flatMapDeep=MN,O.flatMapDepth=NN,O.flatten=TC,O.flattenDeep=kM,O.flattenDepth=TM,O.flip=tD,O.flow=YF,O.flowRight=KF,O.fromPairs=AM,O.functions=KD,O.functionsIn=QD,O.groupBy=DN,O.initial=$M,O.intersection=MM,O.intersectionBy=NM,O.intersectionWith=DM,O.invert=XD,O.invertBy=eF,O.invokeMap=LN,O.iteratee=yb,O.keyBy=jN,O.keys=Kt,O.keysIn=$r,O.map=Bp,O.mapKeys=rF,O.mapValues=nF,O.matches=QF,O.matchesProperty=ZF,O.memoize=Wp,O.merge=iF,O.mergeWith=eE,O.method=XF,O.methodOf=eL,O.mixin=vb,O.negate=zp,O.nthArg=rL,O.omit=sF,O.omitBy=oF,O.once=rD,O.orderBy=UN,O.over=nL,O.overArgs=nD,O.overEvery=iL,O.overSome=sL,O.partial=cb,O.partialRight=VC,O.partition=HN,O.pick=aF,O.pickBy=tE,O.property=lE,O.propertyOf=oL,O.pull=UM,O.pullAll=qC,O.pullAllBy=HM,O.pullAllWith=BM,O.pullAt=VM,O.range=aL,O.rangeRight=lL,O.rearg=iD,O.reject=WN,O.remove=WM,O.rest=sD,O.reverse=ob,O.sampleSize=JN,O.set=cF,O.setWith=uF,O.shuffle=GN,O.slice=zM,O.sortBy=QN,O.sortedUniq=XM,O.sortedUniqBy=eN,O.split=qF,O.spread=oD,O.tail=tN,O.take=rN,O.takeRight=nN,O.takeRightWhile=iN,O.takeWhile=sN,O.tap=SN,O.throttle=aD,O.thru=Hp,O.toArray=YC,O.toPairs=rE,O.toPairsIn=nE,O.toPath=pL,O.toPlainObject=QC,O.transform=fF,O.unary=lD,O.union=oN,O.unionBy=aN,O.unionWith=lN,O.uniq=cN,O.uniqBy=uN,O.uniqWith=fN,O.unset=dF,O.unzip=ab,O.unzipWith=$C,O.update=pF,O.updateWith=hF,O.values=Cl,O.valuesIn=mF,O.without=dN,O.words=oE,O.wrap=cD,O.xor=pN,O.xorBy=hN,O.xorWith=mN,O.zip=gN,O.zipObject=yN,O.zipObjectDeep=vN,O.zipWith=bN,O.entries=rE,O.entriesIn=nE,O.extend=ZC,O.extendWith=XC,vb(O,O),O.add=mL,O.attempt=aE,O.camelCase=bF,O.capitalize=iE,O.ceil=gL,O.clamp=gF,O.clone=fD,O.cloneDeep=pD,O.cloneDeepWith=hD,O.cloneWith=dD,O.conformsTo=mD,O.deburr=sE,O.defaultTo=GF,O.divide=yL,O.endsWith=SF,O.eq=Hn,O.escape=wF,O.escapeRegExp=_F,O.every=kN,O.find=AN,O.findIndex=PC,O.findKey=VD,O.findLast=qN,O.findLastIndex=kC,O.findLastKey=WD,O.floor=vL,O.forEach=NC,O.forEachRight=DC,O.forIn=zD,O.forInRight=JD,O.forOwn=GD,O.forOwnRight=YD,O.get=pb,O.gt=gD,O.gte=yD,O.has=ZD,O.hasIn=hb,O.head=AC,O.identity=Mr,O.includes=FN,O.indexOf=qM,O.inRange=yF,O.invoke=tF,O.isArguments=Uo,O.isArray=Re,O.isArrayBuffer=vD,O.isArrayLike=qr,O.isArrayLikeObject=qt,O.isBoolean=bD,O.isBuffer=As,O.isDate=SD,O.isElement=wD,O.isEmpty=_D,O.isEqual=RD,O.isEqualWith=xD,O.isError=ub,O.isFinite=CD,O.isFunction=Bi,O.isInteger=WC,O.isLength=Jp,O.isMap=zC,O.isMatch=ED,O.isMatchWith=OD,O.isNaN=ID,O.isNative=PD,O.isNil=TD,O.isNull=kD,O.isNumber=JC,O.isObject=Ct,O.isObjectLike=Ot,O.isPlainObject=Ru,O.isRegExp=fb,O.isSafeInteger=AD,O.isSet=GC,O.isString=Gp,O.isSymbol=Xr,O.isTypedArray=xl,O.isUndefined=qD,O.isWeakMap=$D,O.isWeakSet=MD,O.join=FM,O.kebabCase=RF,O.last=yn,O.lastIndexOf=LM,O.lowerCase=xF,O.lowerFirst=CF,O.lt=ND,O.lte=DD,O.max=bL,O.maxBy=SL,O.mean=wL,O.meanBy=_L,O.min=RL,O.minBy=xL,O.stubArray=Sb,O.stubFalse=wb,O.stubObject=cL,O.stubString=uL,O.stubTrue=fL,O.multiply=CL,O.nth=jM,O.noConflict=tL,O.noop=bb,O.now=Vp,O.pad=EF,O.padEnd=OF,O.padStart=IF,O.parseInt=PF,O.random=vF,O.reduce=BN,O.reduceRight=VN,O.repeat=kF,O.replace=TF,O.result=lF,O.round=EL,O.runInContext=L,O.sample=zN,O.size=YN,O.snakeCase=AF,O.some=KN,O.sortedIndex=JM,O.sortedIndexBy=GM,O.sortedIndexOf=YM,O.sortedLastIndex=KM,O.sortedLastIndexBy=QM,O.sortedLastIndexOf=ZM,O.startCase=$F,O.startsWith=MF,O.subtract=OL,O.sum=IL,O.sumBy=PL,O.template=NF,O.times=dL,O.toFinite=Vi,O.toInteger=Ee,O.toLength=KC,O.toLower=DF,O.toNumber=vn,O.toSafeInteger=FD,O.toString=nt,O.toUpper=FF,O.trim=LF,O.trimEnd=jF,O.trimStart=UF,O.truncate=HF,O.unescape=BF,O.uniqueId=hL,O.upperCase=VF,O.upperFirst=mb,O.each=NC,O.eachRight=DC,O.first=AC,vb(O,(function(){var o={};return mn(O,function(c,p){Ze.call(O.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),O.VERSION=e,yr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),yr(["drop","take"],function(o,c){$e.prototype[o]=function(p){p=p===t?1:gt(Ee(p),0);var v=this.__filtered__&&!c?new $e(this):this.clone();return v.__filtered__?v.__takeCount__=Ht(p,v.__takeCount__):v.__views__.push({size:Ht(p,Ce),type:o+(v.__dir__<0?"Right":"")}),v},$e.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),yr(["filter","map","takeWhile"],function(o,c){var p=c+1,v=p==G||p==ne;$e.prototype[o]=function(C){var I=this.clone();return I.__iteratees__.push({iteratee:ge(C,3),type:p}),I.__filtered__=I.__filtered__||v,I}}),yr(["head","last"],function(o,c){var p="take"+(c?"Right":"");$e.prototype[o]=function(){return this[p](1).value()[0]}}),yr(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");$e.prototype[o]=function(){return this.__filtered__?new $e(this):this[p](1)}}),$e.prototype.compact=function(){return this.filter(Mr)},$e.prototype.find=function(o){return this.filter(o).head()},$e.prototype.findLast=function(o){return this.reverse().find(o)},$e.prototype.invokeMap=Te(function(o,c){return typeof o=="function"?new $e(this):this.map(function(p){return Do(p,o,c)})}),$e.prototype.reject=function(o){return this.filter(zp(ge(o)))},$e.prototype.slice=function(o,c){o=Ee(o);var p=this;return p.__filtered__&&(o>0||c<0)?new $e(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==t&&(c=Ee(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},$e.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},$e.prototype.toArray=function(){return this.take(Ce)},mn($e.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),v=/^(?:head|last)$/.test(c),C=O[v?"take"+(c=="last"?"Right":""):c],I=v||/^find/.test(c);C&&(O.prototype[c]=function(){var q=this.__wrapped__,D=v?[1]:arguments,H=q instanceof $e,Q=D[0],Z=H||Re(q),ee=function(Le){var He=C.apply(O,pi([Le],D));return v&&ie?He[0]:He};Z&&p&&typeof Q=="function"&&Q.length!=1&&(H=Z=!1);var ie=this.__chain__,ue=!!this.__actions__.length,ye=I&&!ie,Ie=H&&!ue;if(!I&&Z){q=Ie?q:new $e(this);var me=o.apply(q,D);return me.__actions__.push({func:Hp,args:[ee],thisArg:t}),new ir(me,ie)}return ye&&Ie?o.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),yr(["pop","push","shift","sort","splice","unshift"],function(o){var c=Eo[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var C=arguments;if(v&&!this.__chain__){var I=this.value();return c.apply(Re(I)?I:[],C)}return this[p](function(q){return c.apply(Re(q)?q:[],C)})}}),mn($e.prototype,function(o,c){var p=O[c];if(p){var v=p.name+"";Ze.call(xs,v)||(xs[v]=[]),xs[v].push({name:c,func:p})}}),xs[Mp(t,P).name]=[{name:"wrapper",func:t}],$e.prototype.clone=mv,$e.prototype.reverse=gv,$e.prototype.value=fu,O.prototype.at=wN,O.prototype.chain=_N,O.prototype.commit=RN,O.prototype.next=xN,O.prototype.plant=EN,O.prototype.reverse=ON,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=IN,O.prototype.first=O.prototype.head,Po&&(O.prototype[Po]=CN),O}),mi=Zy();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=mi,define(function(){return mi})):Qe?((Qe.exports=mi)._=mi,Ya._=mi):Nt._=mi}).call(kl)});var PE=F((Db,Tl)=>{(function(t,e){typeof Db=="object"&&typeof Tl<"u"?Tl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(Db,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(u){t=u}function n(u){return u instanceof Array||Object.prototype.toString.call(u)==="[object Array]"}function i(u){return u!=null&&Object.prototype.toString.call(u)==="[object Object]"}function s(u,h){return Object.prototype.hasOwnProperty.call(u,h)}function a(u){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(u).length===0;var h;for(h in u)if(s(u,h))return!1;return!0}function l(u){return u===void 0}function f(u){return typeof u=="number"||Object.prototype.toString.call(u)==="[object Number]"}function d(u){return u instanceof Date||Object.prototype.toString.call(u)==="[object Date]"}function m(u,h){var b=[],w,E=u.length;for(w=0;w<E;++w)b.push(h(u[w],w));return b}function g(u,h){for(var b in h)s(h,b)&&(u[b]=h[b]);return s(h,"toString")&&(u.toString=h.toString),s(h,"valueOf")&&(u.valueOf=h.valueOf),u}function y(u,h,b,w){return tl(u,h,b,w,!0).utc()}function S(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function _(u){return u._pf==null&&(u._pf=S()),u._pf}var R;Array.prototype.some?R=Array.prototype.some:R=function(u){var h=Object(this),b=h.length>>>0,w;for(w=0;w<b;w++)if(w in h&&u.call(this,h[w],w,h))return!0;return!1};function P(u){var h=null,b=!1,w=u._d&&!isNaN(u._d.getTime());if(w&&(h=_(u),b=R.call(h.parsedDateParts,function(E){return E!=null}),w=h.overflow<0&&!h.empty&&!h.invalidEra&&!h.invalidMonth&&!h.invalidWeekday&&!h.weekdayMismatch&&!h.nullInput&&!h.invalidFormat&&!h.userInvalidated&&(!h.meridiem||h.meridiem&&b),u._strict&&(w=w&&h.charsLeftOver===0&&h.unusedTokens.length===0&&h.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(u))u._isValid=w;else return w;return u._isValid}function A(u){var h=y(NaN);return u!=null?g(_(h),u):_(h).userInvalidated=!0,h}var U=e.momentProperties=[],B=!1;function V(u,h){var b,w,E,M=U.length;if(l(h._isAMomentObject)||(u._isAMomentObject=h._isAMomentObject),l(h._i)||(u._i=h._i),l(h._f)||(u._f=h._f),l(h._l)||(u._l=h._l),l(h._strict)||(u._strict=h._strict),l(h._tzm)||(u._tzm=h._tzm),l(h._isUTC)||(u._isUTC=h._isUTC),l(h._offset)||(u._offset=h._offset),l(h._pf)||(u._pf=_(h)),l(h._locale)||(u._locale=h._locale),M>0)for(b=0;b<M;b++)w=U[b],E=h[w],l(E)||(u[w]=E);return u}function W(u){V(this,u),this._d=new Date(u._d!=null?u._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),B===!1&&(B=!0,e.updateOffset(this),B=!1)}function X(u){return u instanceof W||u!=null&&u._isAMomentObject!=null}function T(u){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+u)}function x(u,h){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,u),b){var w=[],E,M,J,oe=arguments.length;for(M=0;M<oe;M++){if(E="",typeof arguments[M]=="object"){E+=`
20
+ }`;var Ie=lE(function(){return Ge(I,ue+"return "+ee).apply(t,q)});if(Ie.source=ee,ub(Ie))throw Ie;return Ie}function FF(o){return nt(o).toLowerCase()}function LF(o){return nt(o).toUpperCase()}function jF(o,c,p){if(o=nt(o),o&&(p||c===t))return au(o);if(!o||!(c=Zr(c)))return o;var v=br(o),C=br(c),I=ap(v,C),q=lp(v,C)+1;return Ts(v,I,q).join("")}function UF(o,c,p){if(o=nt(o),o&&(p||c===t))return o.slice(0,fp(o)+1);if(!o||!(c=Zr(c)))return o;var v=br(o),C=lp(v,br(c))+1;return Ts(v,0,C).join("")}function HF(o,c,p){if(o=nt(o),o&&(p||c===t))return o.replace(Vc,"");if(!o||!(c=Zr(c)))return o;var v=br(o),C=ap(v,br(c));return Ts(v,C).join("")}function BF(o,c){var p=k,v=N;if(Ct(c)){var C="separator"in c?c.separator:C;p="length"in c?Ee(c.length):p,v="omission"in c?Zr(c.omission):v}o=nt(o);var I=o.length;if(Ss(o)){var q=br(o);I=q.length}if(p>=I)return o;var D=p-hi(v);if(D<1)return v;var H=q?Ts(q,0,D).join(""):o.slice(0,D);if(C===t)return H+v;if(q&&(D+=H.length-D),fb(C)){if(o.slice(D).search(C)){var Q,Z=H;for(C.global||(C=nl(C.source,nt(jd.exec(C))+"g")),C.lastIndex=0;Q=C.exec(Z);)var ee=Q.index;H=H.slice(0,ee===t?D:ee)}}else if(o.indexOf(Zr(C),D)!=D){var ie=H.lastIndexOf(C);ie>-1&&(H=H.slice(0,ie))}return H+v}function VF(o){return o=nt(o),o&&Ha.test(o)?o.replace(Ti,Gy):o}var WF=_l(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),mb=lC("toUpperCase");function aE(o,c,p){return o=nt(o),c=p?t:c,c===t?Wy(o)?Qy(o):Fy(o):o.match(c)||[]}var lE=Te(function(o,c){try{return gr(o,t,c)}catch(p){return ub(p)?p:new be(p)}}),zF=Ui(function(o,c){return yr(c,function(p){p=Un(p),Kr(o,p,lb(o[p],o))}),o});function JF(o){var c=o==null?0:o.length,p=ge();return o=c?ct(o,function(v){if(typeof v[1]!="function")throw new Sr(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var C=-1;++C<c;){var I=o[C];if(gr(I[0],this,v))return gr(I[1],this,v)}})}function GF(o){return Av(sr(o,m))}function gb(o){return function(){return o}}function YF(o,c){return o==null||o!==o?c:o}var KF=uC(),QF=uC(!0);function Mr(o){return o}function yb(o){return w(typeof o=="function"?o:sr(o,m))}function ZF(o){return ve(sr(o,m))}function XF(o,c){return Me(o,sr(c,m))}var eL=Te(function(o,c){return function(p){return Fo(p,o,c)}}),tL=Te(function(o,c){return function(p){return Fo(o,p,c)}});function vb(o,c,p){var v=Kt(c),C=Sl(c,v);p==null&&!(Ct(c)&&(C.length||!v.length))&&(p=c,c=o,o=this,C=Sl(c,Kt(c)));var I=!(Ct(p)&&"chain"in p)||!!p.chain,q=Bi(o);return yr(C,function(D){var H=c[D];o[D]=H,q&&(o.prototype[D]=function(){var Q=this.__chain__;if(I||Q){var Z=o(this.__wrapped__),ee=Z.__actions__=Ar(this.__actions__);return ee.push({func:H,args:arguments,thisArg:o}),Z.__chain__=Q,Z}return H.apply(o,pi([this.value()],arguments))})}),o}function rL(){return Nt._===this&&(Nt._=nv),this}function bb(){}function nL(o){return o=Ee(o),Te(function(c){return jn(c,o)})}var iL=Yv(ct),sL=Yv(ip),oL=Yv(Za);function cE(o){return rb(o)?xo(Un(o)):D$(o)}function aL(o){return function(c){return o==null?t:Li(o,c)}}var lL=dC(),cL=dC(!0);function Sb(){return[]}function wb(){return!1}function uL(){return{}}function fL(){return""}function dL(){return!0}function pL(o,c){if(o=Ee(o),o<1||o>et)return[];var p=Ce,v=Ht(o,Ce);c=ge(c),o-=Ce;for(var C=ou(v,c);++p<o;)c(p);return C}function hL(o){return Re(o)?ct(o,Un):Xr(o)?[o]:Ar(IC(nt(o)))}function mL(o){var c=++tv;return nt(o)+c}var gL=Fp(function(o,c){return o+c},0),yL=Kv("ceil"),vL=Fp(function(o,c){return o/c},1),bL=Kv("floor");function SL(o){return o&&o.length?bl(o,Mr,yu):t}function wL(o,c){return o&&o.length?bl(o,ge(c,2),yu):t}function _L(o){return op(o,Mr)}function RL(o,c){return op(o,ge(c,2))}function xL(o){return o&&o.length?bl(o,Mr,J):t}function CL(o,c){return o&&o.length?bl(o,ge(c,2),J):t}var EL=Fp(function(o,c){return o*c},1),OL=Kv("round"),IL=Fp(function(o,c){return o-c},0);function PL(o){return o&&o.length?su(o,Mr):0}function kL(o,c){return o&&o.length?su(o,ge(c,2)):0}return O.after=XN,O.ary=LC,O.assign=jD,O.assignIn=XC,O.assignInWith=eE,O.assignWith=db,O.at=UD,O.before=jC,O.bind=lb,O.bindAll=zF,O.bindKey=UC,O.castArray=fD,O.chain=NC,O.chunk=SM,O.compact=wM,O.concat=_M,O.cond=JF,O.conforms=GF,O.constant=gb,O.countBy=kN,O.create=HD,O.curry=HC,O.curryRight=BC,O.debounce=VC,O.defaults=BD,O.defaultsDeep=VD,O.defer=eD,O.delay=tD,O.difference=RM,O.differenceBy=xM,O.differenceWith=CM,O.drop=EM,O.dropRight=OM,O.dropRightWhile=IM,O.dropWhile=PM,O.fill=kM,O.filter=AN,O.flatMap=MN,O.flatMapDeep=NN,O.flatMapDepth=DN,O.flatten=AC,O.flattenDeep=TM,O.flattenDepth=AM,O.flip=rD,O.flow=KF,O.flowRight=QF,O.fromPairs=qM,O.functions=QD,O.functionsIn=ZD,O.groupBy=FN,O.initial=MM,O.intersection=NM,O.intersectionBy=DM,O.intersectionWith=FM,O.invert=eF,O.invertBy=tF,O.invokeMap=jN,O.iteratee=yb,O.keyBy=UN,O.keys=Kt,O.keysIn=$r,O.map=Wp,O.mapKeys=nF,O.mapValues=iF,O.matches=ZF,O.matchesProperty=XF,O.memoize=Jp,O.merge=sF,O.mergeWith=tE,O.method=eL,O.methodOf=tL,O.mixin=vb,O.negate=Gp,O.nthArg=nL,O.omit=oF,O.omitBy=aF,O.once=nD,O.orderBy=HN,O.over=iL,O.overArgs=iD,O.overEvery=sL,O.overSome=oL,O.partial=cb,O.partialRight=WC,O.partition=BN,O.pick=lF,O.pickBy=rE,O.property=cE,O.propertyOf=aL,O.pull=HM,O.pullAll=$C,O.pullAllBy=BM,O.pullAllWith=VM,O.pullAt=WM,O.range=lL,O.rangeRight=cL,O.rearg=sD,O.reject=zN,O.remove=zM,O.rest=oD,O.reverse=ob,O.sampleSize=GN,O.set=uF,O.setWith=fF,O.shuffle=YN,O.slice=JM,O.sortBy=ZN,O.sortedUniq=eN,O.sortedUniqBy=tN,O.split=$F,O.spread=aD,O.tail=rN,O.take=nN,O.takeRight=iN,O.takeRightWhile=sN,O.takeWhile=oN,O.tap=wN,O.throttle=lD,O.thru=Vp,O.toArray=KC,O.toPairs=nE,O.toPairsIn=iE,O.toPath=hL,O.toPlainObject=ZC,O.transform=dF,O.unary=cD,O.union=aN,O.unionBy=lN,O.unionWith=cN,O.uniq=uN,O.uniqBy=fN,O.uniqWith=dN,O.unset=pF,O.unzip=ab,O.unzipWith=MC,O.update=hF,O.updateWith=mF,O.values=Cl,O.valuesIn=gF,O.without=pN,O.words=aE,O.wrap=uD,O.xor=hN,O.xorBy=mN,O.xorWith=gN,O.zip=yN,O.zipObject=vN,O.zipObjectDeep=bN,O.zipWith=SN,O.entries=nE,O.entriesIn=iE,O.extend=XC,O.extendWith=eE,vb(O,O),O.add=gL,O.attempt=lE,O.camelCase=SF,O.capitalize=sE,O.ceil=yL,O.clamp=yF,O.clone=dD,O.cloneDeep=hD,O.cloneDeepWith=mD,O.cloneWith=pD,O.conformsTo=gD,O.deburr=oE,O.defaultTo=YF,O.divide=vL,O.endsWith=wF,O.eq=Hn,O.escape=_F,O.escapeRegExp=RF,O.every=TN,O.find=qN,O.findIndex=kC,O.findKey=WD,O.findLast=$N,O.findLastIndex=TC,O.findLastKey=zD,O.floor=bL,O.forEach=DC,O.forEachRight=FC,O.forIn=JD,O.forInRight=GD,O.forOwn=YD,O.forOwnRight=KD,O.get=pb,O.gt=yD,O.gte=vD,O.has=XD,O.hasIn=hb,O.head=qC,O.identity=Mr,O.includes=LN,O.indexOf=$M,O.inRange=vF,O.invoke=rF,O.isArguments=Ho,O.isArray=Re,O.isArrayBuffer=bD,O.isArrayLike=qr,O.isArrayLikeObject=qt,O.isBoolean=SD,O.isBuffer=As,O.isDate=wD,O.isElement=_D,O.isEmpty=RD,O.isEqual=xD,O.isEqualWith=CD,O.isError=ub,O.isFinite=ED,O.isFunction=Bi,O.isInteger=zC,O.isLength=Yp,O.isMap=JC,O.isMatch=OD,O.isMatchWith=ID,O.isNaN=PD,O.isNative=kD,O.isNil=AD,O.isNull=TD,O.isNumber=GC,O.isObject=Ct,O.isObjectLike=Ot,O.isPlainObject=Ru,O.isRegExp=fb,O.isSafeInteger=qD,O.isSet=YC,O.isString=Kp,O.isSymbol=Xr,O.isTypedArray=xl,O.isUndefined=$D,O.isWeakMap=MD,O.isWeakSet=ND,O.join=LM,O.kebabCase=xF,O.last=yn,O.lastIndexOf=jM,O.lowerCase=CF,O.lowerFirst=EF,O.lt=DD,O.lte=FD,O.max=SL,O.maxBy=wL,O.mean=_L,O.meanBy=RL,O.min=xL,O.minBy=CL,O.stubArray=Sb,O.stubFalse=wb,O.stubObject=uL,O.stubString=fL,O.stubTrue=dL,O.multiply=EL,O.nth=UM,O.noConflict=rL,O.noop=bb,O.now=zp,O.pad=OF,O.padEnd=IF,O.padStart=PF,O.parseInt=kF,O.random=bF,O.reduce=VN,O.reduceRight=WN,O.repeat=TF,O.replace=AF,O.result=cF,O.round=OL,O.runInContext=L,O.sample=JN,O.size=KN,O.snakeCase=qF,O.some=QN,O.sortedIndex=GM,O.sortedIndexBy=YM,O.sortedIndexOf=KM,O.sortedLastIndex=QM,O.sortedLastIndexBy=ZM,O.sortedLastIndexOf=XM,O.startCase=MF,O.startsWith=NF,O.subtract=IL,O.sum=PL,O.sumBy=kL,O.template=DF,O.times=pL,O.toFinite=Vi,O.toInteger=Ee,O.toLength=QC,O.toLower=FF,O.toNumber=vn,O.toSafeInteger=LD,O.toString=nt,O.toUpper=LF,O.trim=jF,O.trimEnd=UF,O.trimStart=HF,O.truncate=BF,O.unescape=VF,O.uniqueId=mL,O.upperCase=WF,O.upperFirst=mb,O.each=DC,O.eachRight=FC,O.first=qC,vb(O,(function(){var o={};return mn(O,function(c,p){Ze.call(O.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),O.VERSION=e,yr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),yr(["drop","take"],function(o,c){$e.prototype[o]=function(p){p=p===t?1:gt(Ee(p),0);var v=this.__filtered__&&!c?new $e(this):this.clone();return v.__filtered__?v.__takeCount__=Ht(p,v.__takeCount__):v.__views__.push({size:Ht(p,Ce),type:o+(v.__dir__<0?"Right":"")}),v},$e.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),yr(["filter","map","takeWhile"],function(o,c){var p=c+1,v=p==G||p==ne;$e.prototype[o]=function(C){var I=this.clone();return I.__iteratees__.push({iteratee:ge(C,3),type:p}),I.__filtered__=I.__filtered__||v,I}}),yr(["head","last"],function(o,c){var p="take"+(c?"Right":"");$e.prototype[o]=function(){return this[p](1).value()[0]}}),yr(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");$e.prototype[o]=function(){return this.__filtered__?new $e(this):this[p](1)}}),$e.prototype.compact=function(){return this.filter(Mr)},$e.prototype.find=function(o){return this.filter(o).head()},$e.prototype.findLast=function(o){return this.reverse().find(o)},$e.prototype.invokeMap=Te(function(o,c){return typeof o=="function"?new $e(this):this.map(function(p){return Fo(p,o,c)})}),$e.prototype.reject=function(o){return this.filter(Gp(ge(o)))},$e.prototype.slice=function(o,c){o=Ee(o);var p=this;return p.__filtered__&&(o>0||c<0)?new $e(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==t&&(c=Ee(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},$e.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},$e.prototype.toArray=function(){return this.take(Ce)},mn($e.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),v=/^(?:head|last)$/.test(c),C=O[v?"take"+(c=="last"?"Right":""):c],I=v||/^find/.test(c);C&&(O.prototype[c]=function(){var q=this.__wrapped__,D=v?[1]:arguments,H=q instanceof $e,Q=D[0],Z=H||Re(q),ee=function(Le){var He=C.apply(O,pi([Le],D));return v&&ie?He[0]:He};Z&&p&&typeof Q=="function"&&Q.length!=1&&(H=Z=!1);var ie=this.__chain__,ue=!!this.__actions__.length,ye=I&&!ie,Ie=H&&!ue;if(!I&&Z){q=Ie?q:new $e(this);var me=o.apply(q,D);return me.__actions__.push({func:Vp,args:[ee],thisArg:t}),new ir(me,ie)}return ye&&Ie?o.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),yr(["pop","push","shift","sort","splice","unshift"],function(o){var c=Oo[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var C=arguments;if(v&&!this.__chain__){var I=this.value();return c.apply(Re(I)?I:[],C)}return this[p](function(q){return c.apply(Re(q)?q:[],C)})}}),mn($e.prototype,function(o,c){var p=O[c];if(p){var v=p.name+"";Ze.call(xs,v)||(xs[v]=[]),xs[v].push({name:c,func:p})}}),xs[Dp(t,P).name]=[{name:"wrapper",func:t}],$e.prototype.clone=mv,$e.prototype.reverse=gv,$e.prototype.value=fu,O.prototype.at=_N,O.prototype.chain=RN,O.prototype.commit=xN,O.prototype.next=CN,O.prototype.plant=ON,O.prototype.reverse=IN,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=PN,O.prototype.first=O.prototype.head,ko&&(O.prototype[ko]=EN),O}),mi=Zy();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=mi,define(function(){return mi})):Qe?((Qe.exports=mi)._=mi,Ya._=mi):Nt._=mi}).call(kl)});var kE=F((Db,Tl)=>{(function(t,e){typeof Db=="object"&&typeof Tl<"u"?Tl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(Db,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(u){t=u}function n(u){return u instanceof Array||Object.prototype.toString.call(u)==="[object Array]"}function i(u){return u!=null&&Object.prototype.toString.call(u)==="[object Object]"}function s(u,h){return Object.prototype.hasOwnProperty.call(u,h)}function a(u){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(u).length===0;var h;for(h in u)if(s(u,h))return!1;return!0}function l(u){return u===void 0}function f(u){return typeof u=="number"||Object.prototype.toString.call(u)==="[object Number]"}function d(u){return u instanceof Date||Object.prototype.toString.call(u)==="[object Date]"}function m(u,h){var b=[],w,E=u.length;for(w=0;w<E;++w)b.push(h(u[w],w));return b}function g(u,h){for(var b in h)s(h,b)&&(u[b]=h[b]);return s(h,"toString")&&(u.toString=h.toString),s(h,"valueOf")&&(u.valueOf=h.valueOf),u}function y(u,h,b,w){return tl(u,h,b,w,!0).utc()}function S(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function _(u){return u._pf==null&&(u._pf=S()),u._pf}var R;Array.prototype.some?R=Array.prototype.some:R=function(u){var h=Object(this),b=h.length>>>0,w;for(w=0;w<b;w++)if(w in h&&u.call(this,h[w],w,h))return!0;return!1};function P(u){var h=null,b=!1,w=u._d&&!isNaN(u._d.getTime());if(w&&(h=_(u),b=R.call(h.parsedDateParts,function(E){return E!=null}),w=h.overflow<0&&!h.empty&&!h.invalidEra&&!h.invalidMonth&&!h.invalidWeekday&&!h.weekdayMismatch&&!h.nullInput&&!h.invalidFormat&&!h.userInvalidated&&(!h.meridiem||h.meridiem&&b),u._strict&&(w=w&&h.charsLeftOver===0&&h.unusedTokens.length===0&&h.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(u))u._isValid=w;else return w;return u._isValid}function A(u){var h=y(NaN);return u!=null?g(_(h),u):_(h).userInvalidated=!0,h}var U=e.momentProperties=[],B=!1;function V(u,h){var b,w,E,M=U.length;if(l(h._isAMomentObject)||(u._isAMomentObject=h._isAMomentObject),l(h._i)||(u._i=h._i),l(h._f)||(u._f=h._f),l(h._l)||(u._l=h._l),l(h._strict)||(u._strict=h._strict),l(h._tzm)||(u._tzm=h._tzm),l(h._isUTC)||(u._isUTC=h._isUTC),l(h._offset)||(u._offset=h._offset),l(h._pf)||(u._pf=_(h)),l(h._locale)||(u._locale=h._locale),M>0)for(b=0;b<M;b++)w=U[b],E=h[w],l(E)||(u[w]=E);return u}function W(u){V(this,u),this._d=new Date(u._d!=null?u._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),B===!1&&(B=!0,e.updateOffset(this),B=!1)}function X(u){return u instanceof W||u!=null&&u._isAMomentObject!=null}function T(u){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+u)}function x(u,h){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,u),b){var w=[],E,M,J,oe=arguments.length;for(M=0;M<oe;M++){if(E="",typeof arguments[M]=="object"){E+=`
21
21
  [`+M+"] ";for(J in arguments[0])s(arguments[0],J)&&(E+=J+": "+arguments[0][J]+", ");E=E.slice(0,-2)}else E=arguments[M];w.push(E)}T(u+`
22
22
  Arguments: `+Array.prototype.slice.call(w).join("")+`
23
- `+new Error().stack),b=!1}return h.apply(this,arguments)},h)}var k={};function N(u,h){e.deprecationHandler!=null&&e.deprecationHandler(u,h),k[u]||(T(h),k[u]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function j(u){return typeof Function<"u"&&u instanceof Function||Object.prototype.toString.call(u)==="[object Function]"}function $(u){var h,b;for(b in u)s(u,b)&&(h=u[b],j(h)?this[b]=h:this["_"+b]=h);this._config=u,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function G(u,h){var b=g({},u),w;for(w in h)s(h,w)&&(i(u[w])&&i(h[w])?(b[w]={},g(b[w],u[w]),g(b[w],h[w])):h[w]!=null?b[w]=h[w]:delete b[w]);for(w in u)s(u,w)&&!s(h,w)&&i(u[w])&&(b[w]=g({},b[w]));return b}function K(u){u!=null&&this.set(u)}var ne;Object.keys?ne=Object.keys:ne=function(u){var h,b=[];for(h in u)s(u,h)&&b.push(h);return b};var pe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function et(u,h,b){var w=this._calendar[u]||this._calendar.sameElse;return j(w)?w.call(h,b):w}function _e(u,h,b){var w=""+Math.abs(u),E=h-w.length,M=u>=0;return(M?b?"+":"":"-")+Math.pow(10,Math.max(0,E)).toString().substr(1)+w}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ce=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vt={},Et={};function ce(u,h,b,w){var E=w;typeof w=="string"&&(E=function(){return this[w]()}),u&&(Et[u]=E),h&&(Et[h[0]]=function(){return _e(E.apply(this,arguments),h[1],h[2])}),b&&(Et[b]=function(){return this.localeData().ordinal(E.apply(this,arguments),u)})}function hr(u){return u.match(/\[[\s\S]/)?u.replace(/^\[|\]$/g,""):u.replace(/\\/g,"")}function ui(u){var h=u.match(he),b,w;for(b=0,w=h.length;b<w;b++)Et[h[b]]?h[b]=Et[h[b]]:h[b]=hr(h[b]);return function(E){var M="",J;for(J=0;J<w;J++)M+=j(h[J])?h[J].call(E,u):h[J];return M}}function Rt(u,h){return u.isValid()?(h=Gr(h,u.localeData()),vt[h]=vt[h]||ui(h),vt[h](u)):u.localeData().invalidDate()}function Gr(u,h){var b=5;function w(E){return h.longDateFormat(E)||E}for(Ce.lastIndex=0;b>=0&&Ce.test(u);)u=u.replace(Ce,w),Ce.lastIndex=0,b-=1;return u}var Ir={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ht(u){var h=this._longDateFormat[u],b=this._longDateFormat[u.toUpperCase()];return h||!b?h:(this._longDateFormat[u]=b.match(he).map(function(w){return w==="MMMM"||w==="MM"||w==="DD"||w==="dddd"?w.slice(1):w}).join(""),this._longDateFormat[u])}var mt="Invalid date";function ln(){return this._invalidDate}var uo="%d",Jt=/\d{1,2}/;function fo(u){return this._ordinal.replace("%d",u)}var oy={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function kn(u,h,b,w){var E=this._relativeTime[b];return j(E)?E(u,h,b,w):E.replace(/%d/i,u)}function $d(u,h){var b=this._relativeTime[u>0?"future":"past"];return j(b)?b(h):b.replace(/%s/i,h)}var Md={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Gt(u){return typeof u=="string"?Md[u]||Md[u.toLowerCase()]:void 0}function mr(u){var h={},b,w;for(w in u)s(u,w)&&(b=Gt(w),b&&(h[b]=u[w]));return h}var po={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Da(u){var h=[],b;for(b in u)s(u,b)&&h.push({unit:b,priority:po[b]});return h.sort(function(w,E){return w.priority-E.priority}),h}var Nd=/\d/,Ut=/\d\d/,Dd=/\d{3}/,ki=/\d{4}/,Tn=/[+-]?\d{6}/,ot=/\d\d?/,Fa=/\d\d\d\d?/,La=/\d\d\d\d\d\d?/,ds=/\d{1,3}/,ho=/\d{1,4}/,ps=/[+-]?\d{1,6}/,fi=/\d+/,hs=/[+-]?\d+/,Hc=/Z|[+-]\d\d:?\d\d/gi,ja=/Z|[+-]\d\d(?::?\d\d)?/gi,ay=/[+-]?\d+(\.\d{1,3})?/,mo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ti=/^[1-9]\d?/,Ua=/^([1-9]\d|\d)/,Ha;Ha={};function le(u,h,b){Ha[u]=j(h)?h:function(w,E){return w&&b?b:h}}function ly(u,h){return s(Ha,u)?Ha[u](h._strict,h._locale):new RegExp(cy(u))}function cy(u){return cn(u.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(h,b,w,E,M){return b||w||E||M}))}function cn(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Pr(u){return u<0?Math.ceil(u)||0:Math.floor(u)}function qe(u){var h=+u,b=0;return h!==0&&isFinite(h)&&(b=Pr(h)),b}var Bc={};function Ke(u,h){var b,w=h,E;for(typeof u=="string"&&(u=[u]),f(h)&&(w=function(M,J){J[h]=qe(M)}),E=u.length,b=0;b<E;b++)Bc[u[b]]=w}function go(u,h){Ke(u,function(b,w,E,M){E._w=E._w||{},h(b,E._w,E,M)})}function Vc(u,h,b){h!=null&&s(Bc,u)&&Bc[u](h,b._a,b,u)}function Ba(u){return u%4===0&&u%100!==0||u%400===0}var Yt=0,An=1,un=2,At=3,kr=4,qn=5,Ai=6,Fd=7,uy=8;ce("Y",0,0,function(){var u=this.year();return u<=9999?_e(u,4):"+"+u}),ce(0,["YY",2],0,function(){return this.year()%100}),ce(0,["YYYY",4],0,"year"),ce(0,["YYYYY",5],0,"year"),ce(0,["YYYYYY",6,!0],0,"year"),le("Y",hs),le("YY",ot,Ut),le("YYYY",ho,ki),le("YYYYY",ps,Tn),le("YYYYYY",ps,Tn),Ke(["YYYYY","YYYYYY"],Yt),Ke("YYYY",function(u,h){h[Yt]=u.length===2?e.parseTwoDigitYear(u):qe(u)}),Ke("YY",function(u,h){h[Yt]=e.parseTwoDigitYear(u)}),Ke("Y",function(u,h){h[Yt]=parseInt(u,10)});function yo(u){return Ba(u)?366:365}e.parseTwoDigitYear=function(u){return qe(u)+(qe(u)>68?1900:2e3)};var Ld=ms("FullYear",!0);function fy(){return Ba(this.year())}function ms(u,h){return function(b){return b!=null?(bo(this,u,b),e.updateOffset(this,h),this):vo(this,u)}}function vo(u,h){if(!u.isValid())return NaN;var b=u._d,w=u._isUTC;switch(h){case"Milliseconds":return w?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return w?b.getUTCSeconds():b.getSeconds();case"Minutes":return w?b.getUTCMinutes():b.getMinutes();case"Hours":return w?b.getUTCHours():b.getHours();case"Date":return w?b.getUTCDate():b.getDate();case"Day":return w?b.getUTCDay():b.getDay();case"Month":return w?b.getUTCMonth():b.getMonth();case"FullYear":return w?b.getUTCFullYear():b.getFullYear();default:return NaN}}function bo(u,h,b){var w,E,M,J,oe;if(!(!u.isValid()||isNaN(b))){switch(w=u._d,E=u._isUTC,h){case"Milliseconds":return void(E?w.setUTCMilliseconds(b):w.setMilliseconds(b));case"Seconds":return void(E?w.setUTCSeconds(b):w.setSeconds(b));case"Minutes":return void(E?w.setUTCMinutes(b):w.setMinutes(b));case"Hours":return void(E?w.setUTCHours(b):w.setHours(b));case"Date":return void(E?w.setUTCDate(b):w.setDate(b));case"FullYear":break;default:return}M=b,J=u.month(),oe=u.date(),oe=oe===29&&J===1&&!Ba(M)?28:oe,E?w.setUTCFullYear(M,J,oe):w.setFullYear(M,J,oe)}}function dy(u){return u=Gt(u),j(this[u])?this[u]():this}function Va(u,h){if(typeof u=="object"){u=mr(u);var b=Da(u),w,E=b.length;for(w=0;w<E;w++)this[b[w].unit](u[b[w].unit])}else if(u=Gt(u),j(this[u]))return this[u](h);return this}function py(u,h){return(u%h+h)%h}var xt;Array.prototype.indexOf?xt=Array.prototype.indexOf:xt=function(u){var h;for(h=0;h<this.length;++h)if(this[h]===u)return h;return-1};function Wc(u,h){if(isNaN(u)||isNaN(h))return NaN;var b=py(h,12);return u+=(h-b)/12,b===1?Ba(u)?29:28:31-b%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(u){return this.localeData().monthsShort(this,u)}),ce("MMMM",0,0,function(u){return this.localeData().months(this,u)}),le("M",ot,Ti),le("MM",ot,Ut),le("MMM",function(u,h){return h.monthsShortRegex(u)}),le("MMMM",function(u,h){return h.monthsRegex(u)}),Ke(["M","MM"],function(u,h){h[An]=qe(u)-1}),Ke(["MMM","MMMM"],function(u,h,b,w){var E=b._locale.monthsParse(u,w,b._strict);E!=null?h[An]=E:_(b).invalidMonth=u});var jd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),zc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Jc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,hy=mo,my=mo;function gy(u,h){return u?n(this._months)?this._months[u.month()]:this._months[(this._months.isFormat||Jc).test(h)?"format":"standalone"][u.month()]:n(this._months)?this._months:this._months.standalone}function yy(u,h){return u?n(this._monthsShort)?this._monthsShort[u.month()]:this._monthsShort[Jc.test(h)?"format":"standalone"][u.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ud(u,h,b){var w,E,M,J=u.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],w=0;w<12;++w)M=y([2e3,w]),this._shortMonthsParse[w]=this.monthsShort(M,"").toLocaleLowerCase(),this._longMonthsParse[w]=this.months(M,"").toLocaleLowerCase();return b?h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null):(E=xt.call(this._longMonthsParse,J),E!==-1?E:null):h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:(E=xt.call(this._longMonthsParse,J),E!==-1?E:null)):(E=xt.call(this._longMonthsParse,J),E!==-1?E:(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null))}function Hd(u,h,b){var w,E,M;if(this._monthsParseExact)return Ud.call(this,u,h,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),w=0;w<12;w++){if(E=y([2e3,w]),b&&!this._longMonthsParse[w]&&(this._longMonthsParse[w]=new RegExp("^"+this.months(E,"").replace(".","")+"$","i"),this._shortMonthsParse[w]=new RegExp("^"+this.monthsShort(E,"").replace(".","")+"$","i")),!b&&!this._monthsParse[w]&&(M="^"+this.months(E,"")+"|^"+this.monthsShort(E,""),this._monthsParse[w]=new RegExp(M.replace(".",""),"i")),b&&h==="MMMM"&&this._longMonthsParse[w].test(u))return w;if(b&&h==="MMM"&&this._shortMonthsParse[w].test(u))return w;if(!b&&this._monthsParse[w].test(u))return w}}function Gc(u,h){if(!u.isValid())return u;if(typeof h=="string"){if(/^\d+$/.test(h))h=qe(h);else if(h=u.localeData().monthsParse(h),!f(h))return u}var b=h,w=u.date();return w=w<29?w:Math.min(w,Wc(u.year(),b)),u._isUTC?u._d.setUTCMonth(b,w):u._d.setMonth(b,w),u}function Wa(u){return u!=null?(Gc(this,u),e.updateOffset(this,!0),this):vo(this,"Month")}function vy(){return Wc(this.year(),this.month())}function Bd(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Yc.call(this),u?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=hy),this._monthsShortStrictRegex&&u?this._monthsShortStrictRegex:this._monthsShortRegex)}function za(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Yc.call(this),u?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=my),this._monthsStrictRegex&&u?this._monthsStrictRegex:this._monthsRegex)}function Yc(){function u(ve,Me){return Me.length-ve.length}var h=[],b=[],w=[],E,M,J,oe;for(E=0;E<12;E++)M=y([2e3,E]),J=cn(this.monthsShort(M,"")),oe=cn(this.months(M,"")),h.push(J),b.push(oe),w.push(oe),w.push(J);h.sort(u),b.sort(u),w.sort(u),this._monthsRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+h.join("|")+")","i")}function by(u,h,b,w,E,M,J){var oe;return u<100&&u>=0?(oe=new Date(u+400,h,b,w,E,M,J),isFinite(oe.getFullYear())&&oe.setFullYear(u)):oe=new Date(u,h,b,w,E,M,J),oe}function gs(u){var h,b;return u<100&&u>=0?(b=Array.prototype.slice.call(arguments),b[0]=u+400,h=new Date(Date.UTC.apply(null,b)),isFinite(h.getUTCFullYear())&&h.setUTCFullYear(u)):h=new Date(Date.UTC.apply(null,arguments)),h}function So(u,h,b){var w=7+h-b,E=(7+gs(u,0,w).getUTCDay()-h)%7;return-E+w-1}function Ja(u,h,b,w,E){var M=(7+b-w)%7,J=So(u,w,E),oe=1+7*(h-1)+M+J,ve,Me;return oe<=0?(ve=u-1,Me=yo(ve)+oe):oe>yo(u)?(ve=u+1,Me=oe-yo(u)):(ve=u,Me=oe),{year:ve,dayOfYear:Me}}function wo(u,h,b){var w=So(u.year(),h,b),E=Math.floor((u.dayOfYear()-w-1)/7)+1,M,J;return E<1?(J=u.year()-1,M=E+fn(J,h,b)):E>fn(u.year(),h,b)?(M=E-fn(u.year(),h,b),J=u.year()+1):(J=u.year(),M=E),{week:M,year:J}}function fn(u,h,b){var w=So(u,h,b),E=So(u+1,h,b);return(yo(u)-w+E)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),le("w",ot,Ti),le("ww",ot,Ut),le("W",ot,Ti),le("WW",ot,Ut),go(["w","ww","W","WW"],function(u,h,b,w){h[w.substr(0,1)]=qe(u)});function Kc(u){return wo(u,this._week.dow,this._week.doy).week}var Qc={dow:0,doy:6};function ys(){return this._week.dow}function Vd(){return this._week.doy}function Wd(u){var h=this.localeData().week(this);return u==null?h:this.add((u-h)*7,"d")}function Sy(u){var h=wo(this,1,4).week;return u==null?h:this.add((u-h)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(u){return this.localeData().weekdaysMin(this,u)}),ce("ddd",0,0,function(u){return this.localeData().weekdaysShort(this,u)}),ce("dddd",0,0,function(u){return this.localeData().weekdays(this,u)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),le("d",ot),le("e",ot),le("E",ot),le("dd",function(u,h){return h.weekdaysMinRegex(u)}),le("ddd",function(u,h){return h.weekdaysShortRegex(u)}),le("dddd",function(u,h){return h.weekdaysRegex(u)}),go(["dd","ddd","dddd"],function(u,h,b,w){var E=b._locale.weekdaysParse(u,w,b._strict);E!=null?h.d=E:_(b).invalidWeekday=u}),go(["d","e","E"],function(u,h,b,w){h[w]=qe(u)});function zd(u,h){return typeof u!="string"?u:isNaN(u)?(u=h.weekdaysParse(u),typeof u=="number"?u:null):parseInt(u,10)}function Jd(u,h){return typeof u=="string"?h.weekdaysParse(u)%7||7:isNaN(u)?null:u}function Ga(u,h){return u.slice(h,7).concat(u.slice(0,h))}var Gd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),_y=mo,Kd=mo,Ry=mo;function xy(u,h){var b=n(this._weekdays)?this._weekdays:this._weekdays[u&&u!==!0&&this._weekdays.isFormat.test(h)?"format":"standalone"];return u===!0?Ga(b,this._week.dow):u?b[u.day()]:b}function Cy(u){return u===!0?Ga(this._weekdaysShort,this._week.dow):u?this._weekdaysShort[u.day()]:this._weekdaysShort}function Ey(u){return u===!0?Ga(this._weekdaysMin,this._week.dow):u?this._weekdaysMin[u.day()]:this._weekdaysMin}function Zc(u,h,b){var w,E,M,J=u.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],w=0;w<7;++w)M=y([2e3,1]).day(w),this._minWeekdaysParse[w]=this.weekdaysMin(M,"").toLocaleLowerCase(),this._shortWeekdaysParse[w]=this.weekdaysShort(M,"").toLocaleLowerCase(),this._weekdaysParse[w]=this.weekdays(M,"").toLocaleLowerCase();return b?h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1?E:null):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null):(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null):h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1||(E=xt.call(this._shortWeekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):(E=xt.call(this._minWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null))}function Oy(u,h,b){var w,E,M;if(this._weekdaysParseExact)return Zc.call(this,u,h,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),w=0;w<7;w++){if(E=y([2e3,1]).day(w),b&&!this._fullWeekdaysParse[w]&&(this._fullWeekdaysParse[w]=new RegExp("^"+this.weekdays(E,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[w]=new RegExp("^"+this.weekdaysShort(E,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[w]=new RegExp("^"+this.weekdaysMin(E,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[w]||(M="^"+this.weekdays(E,"")+"|^"+this.weekdaysShort(E,"")+"|^"+this.weekdaysMin(E,""),this._weekdaysParse[w]=new RegExp(M.replace(".",""),"i")),b&&h==="dddd"&&this._fullWeekdaysParse[w].test(u))return w;if(b&&h==="ddd"&&this._shortWeekdaysParse[w].test(u))return w;if(b&&h==="dd"&&this._minWeekdaysParse[w].test(u))return w;if(!b&&this._weekdaysParse[w].test(u))return w}}function Iy(u){if(!this.isValid())return u!=null?this:NaN;var h=vo(this,"Day");return u!=null?(u=zd(u,this.localeData()),this.add(u-h,"d")):h}function Py(u){if(!this.isValid())return u!=null?this:NaN;var h=(this.day()+7-this.localeData()._week.dow)%7;return u==null?h:this.add(u-h,"d")}function ky(u){if(!this.isValid())return u!=null?this:NaN;if(u!=null){var h=Jd(u,this.localeData());return this.day(this.day()%7?h:h-7)}else return this.day()||7}function Ty(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xc.call(this),u?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=_y),this._weekdaysStrictRegex&&u?this._weekdaysStrictRegex:this._weekdaysRegex)}function ft(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xc.call(this),u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Kd),this._weekdaysShortStrictRegex&&u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function lt(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xc.call(this),u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ry),this._weekdaysMinStrictRegex&&u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xc(){function u(Dt,Ln){return Ln.length-Dt.length}var h=[],b=[],w=[],E=[],M,J,oe,ve,Me;for(M=0;M<7;M++)J=y([2e3,1]).day(M),oe=cn(this.weekdaysMin(J,"")),ve=cn(this.weekdaysShort(J,"")),Me=cn(this.weekdays(J,"")),h.push(oe),b.push(ve),w.push(Me),E.push(oe),E.push(ve),E.push(Me);h.sort(u),b.sort(u),w.sort(u),E.sort(u),this._weekdaysRegex=new RegExp("^("+E.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function eu(){return this.hours()%12||12}function Ay(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,eu),ce("k",["kk",2],0,Ay),ce("hmm",0,0,function(){return""+eu.apply(this)+_e(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+eu.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function Qd(u,h){ce(u,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),h)})}Qd("a",!0),Qd("A",!1);function Zd(u,h){return h._meridiemParse}le("a",Zd),le("A",Zd),le("H",ot,Ua),le("h",ot,Ti),le("k",ot,Ti),le("HH",ot,Ut),le("hh",ot,Ut),le("kk",ot,Ut),le("hmm",Fa),le("hmmss",La),le("Hmm",Fa),le("Hmmss",La),Ke(["H","HH"],At),Ke(["k","kk"],function(u,h,b){var w=qe(u);h[At]=w===24?0:w}),Ke(["a","A"],function(u,h,b){b._isPm=b._locale.isPM(u),b._meridiem=u}),Ke(["h","hh"],function(u,h,b){h[At]=qe(u),_(b).bigHour=!0}),Ke("hmm",function(u,h,b){var w=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w)),_(b).bigHour=!0}),Ke("hmmss",function(u,h,b){var w=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w,2)),h[qn]=qe(u.substr(E)),_(b).bigHour=!0}),Ke("Hmm",function(u,h,b){var w=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w))}),Ke("Hmmss",function(u,h,b){var w=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w,2)),h[qn]=qe(u.substr(E))});function qy(u){return(u+"").toLowerCase().charAt(0)==="p"}var Xd=/[ap]\.?m?\.?/i,$y=ms("Hours",!0);function Nt(u,h,b){return u>11?b?"pm":"PM":b?"am":"AM"}var Ya={calendar:pe,longDateFormat:Ir,invalidDate:mt,ordinal:uo,dayOfMonthOrdinalParse:Jt,relativeTime:oy,months:jd,monthsShort:zc,week:Qc,weekdays:Gd,weekdaysMin:wy,weekdaysShort:Yd,meridiemParse:Xd},Qe={},vs={},qi;function Tr(u,h){var b,w=Math.min(u.length,h.length);for(b=0;b<w;b+=1)if(u[b]!==h[b])return b;return w}function tu(u){return u&&u.toLowerCase().replace("_","-")}function ep(u){for(var h=0,b,w,E,M;h<u.length;){for(M=tu(u[h]).split("-"),b=M.length,w=tu(u[h+1]),w=w?w.split("-"):null;b>0;){if(E=_o(M.slice(0,b).join("-")),E)return E;if(w&&w.length>=b&&Tr(M,w)>=b-1)break;b--}h++}return qi}function tp(u){return!!(u&&u.match("^[^/\\\\]*$"))}function _o(u){var h=null,b;if(Qe[u]===void 0&&typeof Tl<"u"&&Tl&&Tl.exports&&tp(u))try{h=qi._abbr,b=it,b("./locale/"+u),$n(h)}catch{Qe[u]=null}return Qe[u]}function $n(u,h){var b;return u&&(l(h)?b=Mn(u):b=Ka(u,h),b?qi=b:typeof console<"u"&&console.warn&&console.warn("Locale "+u+" not found. Did you forget to load it?")),qi._abbr}function Ka(u,h){if(h!==null){var b,w=Ya;if(h.abbr=u,Qe[u]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),w=Qe[u]._config;else if(h.parentLocale!=null)if(Qe[h.parentLocale]!=null)w=Qe[h.parentLocale]._config;else if(b=_o(h.parentLocale),b!=null)w=b._config;else return vs[h.parentLocale]||(vs[h.parentLocale]=[]),vs[h.parentLocale].push({name:u,config:h}),null;return Qe[u]=new K(G(w,h)),vs[u]&&vs[u].forEach(function(E){Ka(E.name,E.config)}),$n(u),Qe[u]}else return delete Qe[u],null}function gr(u,h){if(h!=null){var b,w,E=Ya;Qe[u]!=null&&Qe[u].parentLocale!=null?Qe[u].set(G(Qe[u]._config,h)):(w=_o(u),w!=null&&(E=w._config),h=G(E,h),w==null&&(h.abbr=u),b=new K(h),b.parentLocale=Qe[u],Qe[u]=b),$n(u)}else Qe[u]!=null&&(Qe[u].parentLocale!=null?(Qe[u]=Qe[u].parentLocale,u===$n()&&$n(u)):Qe[u]!=null&&delete Qe[u]);return Qe[u]}function Mn(u){var h;if(u&&u._locale&&u._locale._abbr&&(u=u._locale._abbr),!u)return qi;if(!n(u)){if(h=_o(u),h)return h;u=[u]}return ep(u)}function yr(){return ne(Qe)}function ru(u){var h,b=u._a;return b&&_(u).overflow===-2&&(h=b[An]<0||b[An]>11?An:b[un]<1||b[un]>Wc(b[Yt],b[An])?un:b[At]<0||b[At]>24||b[At]===24&&(b[kr]!==0||b[qn]!==0||b[Ai]!==0)?At:b[kr]<0||b[kr]>59?kr:b[qn]<0||b[qn]>59?qn:b[Ai]<0||b[Ai]>999?Ai:-1,_(u)._overflowDayOfYear&&(h<Yt||h>un)&&(h=un),_(u)._overflowWeeks&&h===-1&&(h=Fd),_(u)._overflowWeekday&&h===-1&&(h=uy),_(u).overflow=h),u}var rp=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,di=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Qa=/Z|[+-]\d\d(?::?\d\d)?/,bs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ct=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pi=/^\/?Date\((-?\d+)/i,nu=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,My={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Za(u){var h,b,w=u._i,E=rp.exec(w)||di.exec(w),M,J,oe,ve,Me=bs.length,Dt=ct.length;if(E){for(_(u).iso=!0,h=0,b=Me;h<b;h++)if(bs[h][1].exec(E[1])){J=bs[h][0],M=bs[h][2]!==!1;break}if(J==null){u._isValid=!1;return}if(E[3]){for(h=0,b=Dt;h<b;h++)if(ct[h][1].exec(E[3])){oe=(E[2]||" ")+ct[h][0];break}if(oe==null){u._isValid=!1;return}}if(!M&&oe!=null){u._isValid=!1;return}if(E[4])if(Qa.exec(E[4]))ve="Z";else{u._isValid=!1;return}u._f=J+(oe||"")+(ve||""),el(u)}else u._isValid=!1}function Ny(u,h,b,w,E,M){var J=[Dy(u),zc.indexOf(h),parseInt(b,10),parseInt(w,10),parseInt(E,10)];return M&&J.push(parseInt(M,10)),J}function Dy(u){var h=parseInt(u,10);return h<=49?2e3+h:h<=999?1900+h:h}function Fy(u){return u.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function np(u,h,b){if(u){var w=Yd.indexOf(u),E=new Date(h[0],h[1],h[2]).getDay();if(w!==E)return _(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Xa(u,h,b){if(u)return My[u];if(h)return 0;var w=parseInt(b,10),E=w%100,M=(w-E)/100;return M*60+E}function $i(u){var h=nu.exec(Fy(u._i)),b;if(h){if(b=Ny(h[4],h[3],h[2],h[5],h[6],h[7]),!np(h[1],b,u))return;u._a=b,u._tzm=Xa(h[8],h[9],h[10]),u._d=gs.apply(null,u._a),u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),_(u).rfc2822=!0}else u._isValid=!1}function Ly(u){var h=pi.exec(u._i);if(h!==null){u._d=new Date(+h[1]);return}if(Za(u),u._isValid===!1)delete u._isValid;else return;if($i(u),u._isValid===!1)delete u._isValid;else return;u._strict?u._isValid=!1:e.createFromInputFallback(u)}e.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(u){u._d=new Date(u._i+(u._useUTC?" UTC":""))});function Mi(u,h,b){return u??h??b}function ip(u){var h=new Date(e.now());return u._useUTC?[h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()]:[h.getFullYear(),h.getMonth(),h.getDate()]}function Ro(u){var h,b,w=[],E,M,J;if(!u._d){for(E=ip(u),u._w&&u._a[un]==null&&u._a[An]==null&&iu(u),u._dayOfYear!=null&&(J=Mi(u._a[Yt],E[Yt]),(u._dayOfYear>yo(J)||u._dayOfYear===0)&&(_(u)._overflowDayOfYear=!0),b=gs(J,0,u._dayOfYear),u._a[An]=b.getUTCMonth(),u._a[un]=b.getUTCDate()),h=0;h<3&&u._a[h]==null;++h)u._a[h]=w[h]=E[h];for(;h<7;h++)u._a[h]=w[h]=u._a[h]==null?h===2?1:0:u._a[h];u._a[At]===24&&u._a[kr]===0&&u._a[qn]===0&&u._a[Ai]===0&&(u._nextDay=!0,u._a[At]=0),u._d=(u._useUTC?gs:by).apply(null,w),M=u._useUTC?u._d.getUTCDay():u._d.getDay(),u._tzm!=null&&u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),u._nextDay&&(u._a[At]=24),u._w&&typeof u._w.d<"u"&&u._w.d!==M&&(_(u).weekdayMismatch=!0)}}function iu(u){var h,b,w,E,M,J,oe,ve,Me;h=u._w,h.GG!=null||h.W!=null||h.E!=null?(M=1,J=4,b=Mi(h.GG,u._a[Yt],wo(tt(),1,4).year),w=Mi(h.W,1),E=Mi(h.E,1),(E<1||E>7)&&(ve=!0)):(M=u._locale._week.dow,J=u._locale._week.doy,Me=wo(tt(),M,J),b=Mi(h.gg,u._a[Yt],Me.year),w=Mi(h.w,Me.week),h.d!=null?(E=h.d,(E<0||E>6)&&(ve=!0)):h.e!=null?(E=h.e+M,(h.e<0||h.e>6)&&(ve=!0)):E=M),w<1||w>fn(b,M,J)?_(u)._overflowWeeks=!0:ve!=null?_(u)._overflowWeekday=!0:(oe=Ja(b,w,E,M,J),u._a[Yt]=oe.year,u._dayOfYear=oe.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function el(u){if(u._f===e.ISO_8601){Za(u);return}if(u._f===e.RFC_2822){$i(u);return}u._a=[],_(u).empty=!0;var h=""+u._i,b,w,E,M,J,oe=h.length,ve=0,Me,Dt;for(E=Gr(u._f,u._locale).match(he)||[],Dt=E.length,b=0;b<Dt;b++)M=E[b],w=(h.match(ly(M,u))||[])[0],w&&(J=h.substr(0,h.indexOf(w)),J.length>0&&_(u).unusedInput.push(J),h=h.slice(h.indexOf(w)+w.length),ve+=w.length),Et[M]?(w?_(u).empty=!1:_(u).unusedTokens.push(M),Vc(M,w,u)):u._strict&&!w&&_(u).unusedTokens.push(M);_(u).charsLeftOver=oe-ve,h.length>0&&_(u).unusedInput.push(h),u._a[At]<=12&&_(u).bigHour===!0&&u._a[At]>0&&(_(u).bigHour=void 0),_(u).parsedDateParts=u._a.slice(0),_(u).meridiem=u._meridiem,u._a[At]=jy(u._locale,u._a[At],u._meridiem),Me=_(u).era,Me!==null&&(u._a[Yt]=u._locale.erasConvertYear(Me,u._a[Yt])),Ro(u),ru(u)}function jy(u,h,b){var w;return b==null?h:u.meridiemHour!=null?u.meridiemHour(h,b):(u.isPM!=null&&(w=u.isPM(b),w&&h<12&&(h+=12),!w&&h===12&&(h=0)),h)}function su(u){var h,b,w,E,M,J,oe=!1,ve=u._f.length;if(ve===0){_(u).invalidFormat=!0,u._d=new Date(NaN);return}for(E=0;E<ve;E++)M=0,J=!1,h=V({},u),u._useUTC!=null&&(h._useUTC=u._useUTC),h._f=u._f[E],el(h),P(h)&&(J=!0),M+=_(h).charsLeftOver,M+=_(h).unusedTokens.length*10,_(h).score=M,oe?M<w&&(w=M,b=h):(w==null||M<w||J)&&(w=M,b=h,J&&(oe=!0));g(u,b||h)}function ou(u){if(!u._d){var h=mr(u._i),b=h.day===void 0?h.date:h.day;u._a=m([h.year,h.month,b,h.hour,h.minute,h.second,h.millisecond],function(w){return w&&parseInt(w,10)}),Ro(u)}}function Uy(u){var h=new W(ru(au(u)));return h._nextDay&&(h.add(1,"d"),h._nextDay=void 0),h}function au(u){var h=u._i,b=u._f;return u._locale=u._locale||Mn(u._l),h===null||b===void 0&&h===""?A({nullInput:!0}):(typeof h=="string"&&(u._i=h=u._locale.preparse(h)),X(h)?new W(ru(h)):(d(h)?u._d=h:n(b)?su(u):b?el(u):vr(u),P(u)||(u._d=null),u))}function vr(u){var h=u._i;l(h)?u._d=new Date(e.now()):d(h)?u._d=new Date(h.valueOf()):typeof h=="string"?Ly(u):n(h)?(u._a=m(h.slice(0),function(b){return parseInt(b,10)}),Ro(u)):i(h)?ou(u):f(h)?u._d=new Date(h):e.createFromInputFallback(u)}function tl(u,h,b,w,E){var M={};return(h===!0||h===!1)&&(w=h,h=void 0),(b===!0||b===!1)&&(w=b,b=void 0),(i(u)&&a(u)||n(u)&&u.length===0)&&(u=void 0),M._isAMomentObject=!0,M._useUTC=M._isUTC=E,M._l=b,M._i=u,M._f=h,M._strict=w,Uy(M)}function tt(u,h,b,w){return tl(u,h,b,w,!1)}var sp=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u<this?this:u:A()}),op=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u>this?this:u:A()});function ap(u,h){var b,w;if(h.length===1&&n(h[0])&&(h=h[0]),!h.length)return tt();for(b=h[0],w=1;w<h.length;++w)(!h[w].isValid()||h[w][u](b))&&(b=h[w]);return b}function Hy(){var u=[].slice.call(arguments,0);return ap("isBefore",u)}function By(){var u=[].slice.call(arguments,0);return ap("isAfter",u)}var Vy=function(){return Date.now?Date.now():+new Date},xo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ss(u){var h,b=!1,w,E=xo.length;for(h in u)if(s(u,h)&&!(xt.call(xo,h)!==-1&&(u[h]==null||!isNaN(u[h]))))return!1;for(w=0;w<E;++w)if(u[xo[w]]){if(b)return!1;parseFloat(u[xo[w]])!==qe(u[xo[w]])&&(b=!0)}return!0}function Wy(){return this._isValid}function zy(){return rt(NaN)}function ws(u){var h=mr(u),b=h.year||0,w=h.quarter||0,E=h.month||0,M=h.week||h.isoWeek||0,J=h.day||0,oe=h.hour||0,ve=h.minute||0,Me=h.second||0,Dt=h.millisecond||0;this._isValid=Ss(h),this._milliseconds=+Dt+Me*1e3+ve*6e4+oe*1e3*60*60,this._days=+J+M*7,this._months=+E+w*3+b*12,this._data={},this._locale=Mn(),this._bubble()}function Co(u){return u instanceof ws}function dn(u){return u<0?Math.round(-1*u)*-1:Math.round(u)}function rl(u,h,b){var w=Math.min(u.length,h.length),E=Math.abs(u.length-h.length),M=0,J;for(J=0;J<w;J++)(b&&u[J]!==h[J]||!b&&qe(u[J])!==qe(h[J]))&&M++;return M+E}function lp(u,h){ce(u,0,0,function(){var b=this.utcOffset(),w="+";return b<0&&(b=-b,w="-"),w+_e(~~(b/60),2)+h+_e(~~b%60,2)})}lp("Z",":"),lp("ZZ",""),le("Z",ja),le("ZZ",ja),Ke(["Z","ZZ"],function(u,h,b){b._useUTC=!0,b._tzm=lu(ja,u)});var Jy=/([\+\-]|\d\d)/gi;function lu(u,h){var b=(h||"").match(u),w,E,M;return b===null?null:(w=b[b.length-1]||[],E=(w+"").match(Jy)||["-",0,0],M=+(E[1]*60)+qe(E[2]),M===0?0:E[0]==="+"?M:-M)}function hi(u,h){var b,w;return h._isUTC?(b=h.clone(),w=(X(u)||d(u)?u.valueOf():tt(u).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+w),e.updateOffset(b,!1),b):tt(u).local()}function br(u){return-Math.round(u._d.getTimezoneOffset())}e.updateOffset=function(){};function cp(u,h,b){var w=this._offset||0,E;if(!this.isValid())return u!=null?this:NaN;if(u!=null){if(typeof u=="string"){if(u=lu(ja,u),u===null)return this}else Math.abs(u)<16&&!b&&(u=u*60);return!this._isUTC&&h&&(E=br(this)),this._offset=u,this._isUTC=!0,E!=null&&this.add(E,"m"),w!==u&&(!h||this._changeInProgress?Eo(this,rt(u-w,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?w:br(this)}function Gy(u,h){return u!=null?(typeof u!="string"&&(u=-u),this.utcOffset(u,h),this):-this.utcOffset()}function Yy(u){return this.utcOffset(0,u)}function Ky(u){return this._isUTC&&(this.utcOffset(0,u),this._isUTC=!1,u&&this.subtract(br(this),"m")),this}function Qy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var u=lu(Hc,this._i);u!=null?this.utcOffset(u):this.utcOffset(0,!0)}return this}function Zy(u){return this.isValid()?(u=u?tt(u).utcOffset():0,(this.utcOffset()-u)%60===0):!1}function mi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function L(){if(!l(this._isDSTShifted))return this._isDSTShifted;var u={},h;return V(u,this),u=au(u),u._a?(h=u._isUTC?y(u._a):tt(u._a),this._isDSTShifted=this.isValid()&&rl(u._a,h.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Y(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ae(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ge=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function rt(u,h){var b=u,w=null,E,M,J;return Co(u)?b={ms:u._milliseconds,d:u._days,M:u._months}:f(u)||!isNaN(+u)?(b={},h?b[h]=+u:b.milliseconds=+u):(w=be.exec(u))?(E=w[1]==="-"?-1:1,b={y:0,d:qe(w[un])*E,h:qe(w[At])*E,m:qe(w[kr])*E,s:qe(w[qn])*E,ms:qe(dn(w[Ai]*1e3))*E}):(w=Ge.exec(u))?(E=w[1]==="-"?-1:1,b={y:Ue(w[2],E),M:Ue(w[3],E),w:Ue(w[4],E),d:Ue(w[5],E),h:Ue(w[6],E),m:Ue(w[7],E),s:Ue(w[8],E)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(J=Xy(tt(b.from),tt(b.to)),b={},b.ms=J.milliseconds,b.M=J.months),M=new ws(b),Co(u)&&s(u,"_locale")&&(M._locale=u._locale),Co(u)&&s(u,"_isValid")&&(M._isValid=u._isValid),M}rt.fn=ws.prototype,rt.invalid=zy;function Ue(u,h){var b=u&&parseFloat(u.replace(",","."));return(isNaN(b)?0:b)*h}function nl(u,h){var b={};return b.months=h.month()-u.month()+(h.year()-u.year())*12,u.clone().add(b.months,"M").isAfter(h)&&--b.months,b.milliseconds=+h-+u.clone().add(b.months,"M"),b}function Xy(u,h){var b;return u.isValid()&&h.isValid()?(h=hi(h,u),u.isBefore(h)?b=nl(u,h):(b=nl(h,u),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function Sr(u,h){return function(b,w){var E,M;return w!==null&&!isNaN(+w)&&(N(h,"moment()."+h+"(period, number) is deprecated. Please use moment()."+h+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),M=b,b=w,w=M),E=rt(b,w),Eo(this,E,u),this}}function Eo(u,h,b,w){var E=h._milliseconds,M=dn(h._days),J=dn(h._months);u.isValid()&&(w=w??!0,J&&Gc(u,vo(u,"Month")+J*b),M&&bo(u,"Date",vo(u,"Date")+M*b),E&&u._d.setTime(u._d.valueOf()+E*b),w&&e.updateOffset(u,M||J))}var ev=Sr(1,"add"),_s=Sr(-1,"subtract");function Oo(u){return typeof u=="string"||u instanceof String}function il(u){return X(u)||d(u)||Oo(u)||f(u)||tv(u)||Ze(u)||u===null||u===void 0}function Ze(u){var h=i(u)&&!a(u),b=!1,w=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],E,M,J=w.length;for(E=0;E<J;E+=1)M=w[E],b=b||s(u,M);return h&&b}function tv(u){var h=n(u),b=!1;return h&&(b=u.filter(function(w){return!f(w)&&Oo(u)}).length===0),h&&b}function up(u){var h=i(u)&&!a(u),b=!1,w=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],E,M;for(E=0;E<w.length;E+=1)M=w[E],b=b||s(u,M);return h&&b}function sl(u,h){var b=u.diff(h,"days",!0);return b<-6?"sameElse":b<-1?"lastWeek":b<0?"lastDay":b<1?"sameDay":b<2?"nextDay":b<7?"nextWeek":"sameElse"}function rv(u,h){arguments.length===1&&(arguments[0]?il(arguments[0])?(u=arguments[0],h=void 0):up(arguments[0])&&(h=arguments[0],u=void 0):(u=void 0,h=void 0));var b=u||tt(),w=hi(b,this).startOf("day"),E=e.calendarFormat(this,w)||"sameElse",M=h&&(j(h[E])?h[E].call(this,b):h[E]);return this.format(M||this.localeData().calendar(E,this,tt(b)))}function nv(){return new W(this)}function iv(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Gt(h)||"millisecond",h==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(h).valueOf()):!1}function ol(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Gt(h)||"millisecond",h==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(h).valueOf()<b.valueOf()):!1}function gi(u,h,b,w){var E=X(u)?u:tt(u),M=X(h)?h:tt(h);return this.isValid()&&E.isValid()&&M.isValid()?(w=w||"()",(w[0]==="("?this.isAfter(E,b):!this.isBefore(E,b))&&(w[1]===")"?this.isBefore(M,b):!this.isAfter(M,b))):!1}function al(u,h){var b=X(u)?u:tt(u),w;return this.isValid()&&b.isValid()?(h=Gt(h)||"millisecond",h==="millisecond"?this.valueOf()===b.valueOf():(w=b.valueOf(),this.clone().startOf(h).valueOf()<=w&&w<=this.clone().endOf(h).valueOf())):!1}function fp(u,h){return this.isSame(u,h)||this.isAfter(u,h)}function ll(u,h){return this.isSame(u,h)||this.isBefore(u,h)}function dp(u,h,b){var w,E,M;if(!this.isValid())return NaN;if(w=hi(u,this),!w.isValid())return NaN;switch(E=(w.utcOffset()-this.utcOffset())*6e4,h=Gt(h),h){case"year":M=Io(this,w)/12;break;case"month":M=Io(this,w);break;case"quarter":M=Io(this,w)/3;break;case"second":M=(this-w)/1e3;break;case"minute":M=(this-w)/6e4;break;case"hour":M=(this-w)/36e5;break;case"day":M=(this-w-E)/864e5;break;case"week":M=(this-w-E)/6048e5;break;default:M=this-w}return b?M:Pr(M)}function Io(u,h){if(u.date()<h.date())return-Io(h,u);var b=(h.year()-u.year())*12+(h.month()-u.month()),w=u.clone().add(b,"months"),E,M;return h-w<0?(E=u.clone().add(b-1,"months"),M=(h-w)/(w-E)):(E=u.clone().add(b+1,"months"),M=(h-w)/(E-w)),-(b+M)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function cl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function pp(u){if(!this.isValid())return null;var h=u!==!0,b=h?this.clone().utc():this;return b.year()<0||b.year()>9999?Rt(b,h?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?h?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rt(b,"Z")):Rt(b,h?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Po(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var u="moment",h="",b,w,E,M;return this.isLocal()||(u=this.utcOffset()===0?"moment.utc":"moment.parseZone",h="Z"),b="["+u+'("]',w=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",E="-MM-DD[T]HH:mm:ss.SSS",M=h+'[")]',this.format(b+w+E+M)}function Ni(u){u||(u=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var h=Rt(this,u);return this.localeData().postformat(h)}function ul(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({to:this,from:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function sv(u){return this.from(tt(),u)}function ov(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({from:this,to:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function av(u){return this.to(tt(),u)}function ko(u){var h;return u===void 0?this._locale._abbr:(h=Mn(u),h!=null&&(this._locale=h),this)}var To=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(u){return u===void 0?this.localeData():this.locale(u)});function fl(){return this._locale}var dl=1e3,Di=60*dl,pl=60*Di,hp=(365*400+97)*24*pl;function gt(u,h){return(u%h+h)%h}function Ht(u,h,b){return u<100&&u>=0?new Date(u+400,h,b)-hp:new Date(u,h,b).valueOf()}function mp(u,h,b){return u<100&&u>=0?Date.UTC(u+400,h,b)-hp:Date.UTC(u,h,b)}function lv(u){var h,b;if(u=Gt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?mp:Ht,u){case"year":h=b(this.year(),0,1);break;case"quarter":h=b(this.year(),this.month()-this.month()%3,1);break;case"month":h=b(this.year(),this.month(),1);break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":h=b(this.year(),this.month(),this.date());break;case"hour":h=this._d.valueOf(),h-=gt(h+(this._isUTC?0:this.utcOffset()*Di),pl);break;case"minute":h=this._d.valueOf(),h-=gt(h,Di);break;case"second":h=this._d.valueOf(),h-=gt(h,dl);break}return this._d.setTime(h),e.updateOffset(this,!0),this}function gp(u){var h,b;if(u=Gt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?mp:Ht,u){case"year":h=b(this.year()+1,0,1)-1;break;case"quarter":h=b(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":h=b(this.year(),this.month()+1,1)-1;break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":h=b(this.year(),this.month(),this.date()+1)-1;break;case"hour":h=this._d.valueOf(),h+=pl-gt(h+(this._isUTC?0:this.utcOffset()*Di),pl)-1;break;case"minute":h=this._d.valueOf(),h+=Di-gt(h,Di)-1;break;case"second":h=this._d.valueOf(),h+=dl-gt(h,dl)-1;break}return this._d.setTime(h),e.updateOffset(this,!0),this}function cv(){return this._d.valueOf()-(this._offset||0)*6e4}function cu(){return Math.floor(this.valueOf()/1e3)}function Ao(){return new Date(this.valueOf())}function uu(){var u=this;return[u.year(),u.month(),u.date(),u.hour(),u.minute(),u.second(),u.millisecond()]}function Rs(){var u=this;return{years:u.year(),months:u.month(),date:u.date(),hours:u.hours(),minutes:u.minutes(),seconds:u.seconds(),milliseconds:u.milliseconds()}}function qo(){return this.isValid()?this.toISOString():null}function $o(){return P(this)}function hl(){return g({},_(this))}function xs(){return _(this).overflow}function uv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ce("N",0,0,"eraAbbr"),ce("NN",0,0,"eraAbbr"),ce("NNN",0,0,"eraAbbr"),ce("NNNN",0,0,"eraName"),ce("NNNNN",0,0,"eraNarrow"),ce("y",["y",1],"yo","eraYear"),ce("y",["yy",2],0,"eraYear"),ce("y",["yyy",3],0,"eraYear"),ce("y",["yyyy",4],0,"eraYear"),le("N",ir),le("NN",ir),le("NNN",ir),le("NNNN",$e),le("NNNNN",mv),Ke(["N","NN","NNN","NNNN","NNNNN"],function(u,h,b,w){var E=b._locale.erasParse(u,w,b._strict);E?_(b).era=E:_(b).invalidEra=u}),le("y",fi),le("yy",fi),le("yyy",fi),le("yyyy",fi),le("yo",gv),Ke(["y","yy","yyy","yyyy"],Yt),Ke(["yo"],function(u,h,b,w){var E;b._locale._eraYearOrdinalRegex&&(E=u.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?h[Yt]=b._locale.eraYearOrdinalParse(u,E):h[Yt]=parseInt(u,10)});function fv(u,h){var b,w,E,M=this._eras||Mn("en")._eras;for(b=0,w=M.length;b<w;++b)switch(typeof M[b].since==="string"&&(E=e(M[b].since).startOf("day"),M[b].since=E.valueOf()),typeof M[b].until){case"undefined":M[b].until=1/0;break;case"string":E=e(M[b].until).startOf("day").valueOf(),M[b].until=E.valueOf();break}return M}function dv(u,h,b){var w,E,M=this.eras(),J,oe,ve;for(u=u.toUpperCase(),w=0,E=M.length;w<E;++w)if(J=M[w].name.toUpperCase(),oe=M[w].abbr.toUpperCase(),ve=M[w].narrow.toUpperCase(),b)switch(h){case"N":case"NN":case"NNN":if(oe===u)return M[w];break;case"NNNN":if(J===u)return M[w];break;case"NNNNN":if(ve===u)return M[w];break}else if([J,oe,ve].indexOf(u)>=0)return M[w]}function pv(u,h){var b=u.since<=u.until?1:-1;return h===void 0?e(u.since).year():e(u.since).year()+(h-u.offset)*b}function hv(){var u,h,b,w=this.localeData().eras();for(u=0,h=w.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),w[u].since<=b&&b<=w[u].until||w[u].until<=b&&b<=w[u].since)return w[u].name;return""}function ml(){var u,h,b,w=this.localeData().eras();for(u=0,h=w.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),w[u].since<=b&&b<=w[u].until||w[u].until<=b&&b<=w[u].since)return w[u].narrow;return""}function Mo(){var u,h,b,w=this.localeData().eras();for(u=0,h=w.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),w[u].since<=b&&b<=w[u].until||w[u].until<=b&&b<=w[u].since)return w[u].abbr;return""}function yp(){var u,h,b,w,E=this.localeData().eras();for(u=0,h=E.length;u<h;++u)if(b=E[u].since<=E[u].until?1:-1,w=this.clone().startOf("day").valueOf(),E[u].since<=w&&w<=E[u].until||E[u].until<=w&&w<=E[u].since)return(this.year()-e(E[u].since).year())*b+E[u].offset;return this.year()}function O(u){return s(this,"_erasNameRegex")||fu.call(this),u?this._erasNameRegex:this._erasRegex}function Cs(u){return s(this,"_erasAbbrRegex")||fu.call(this),u?this._erasAbbrRegex:this._erasRegex}function gl(u){return s(this,"_erasNarrowRegex")||fu.call(this),u?this._erasNarrowRegex:this._erasRegex}function ir(u,h){return h.erasAbbrRegex(u)}function $e(u,h){return h.erasNameRegex(u)}function mv(u,h){return h.erasNarrowRegex(u)}function gv(u,h){return h._eraYearOrdinalRegex||fi}function fu(){var u=[],h=[],b=[],w=[],E,M,J,oe,ve,Me=this.eras();for(E=0,M=Me.length;E<M;++E)J=cn(Me[E].name),oe=cn(Me[E].abbr),ve=cn(Me[E].narrow),h.push(J),u.push(oe),b.push(ve),w.push(J),w.push(oe),w.push(ve);this._erasRegex=new RegExp("^("+w.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+h.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+b.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function pn(u,h){ce(0,[u,u.length],0,h)}pn("gggg","weekYear"),pn("ggggg","weekYear"),pn("GGGG","isoWeekYear"),pn("GGGGG","isoWeekYear"),le("G",hs),le("g",hs),le("GG",ot,Ut),le("gg",ot,Ut),le("GGGG",ho,ki),le("gggg",ho,ki),le("GGGGG",ps,Tn),le("ggggg",ps,Tn),go(["gggg","ggggg","GGGG","GGGGG"],function(u,h,b,w){h[w.substr(0,2)]=qe(u)}),go(["gg","GG"],function(u,h,b,w){h[w]=e.parseTwoDigitYear(u)});function yv(u){return vp.call(this,u,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function vv(u){return vp.call(this,u,this.isoWeek(),this.isoWeekday(),1,4)}function bv(){return fn(this.year(),1,4)}function Sv(){return fn(this.isoWeekYear(),1,4)}function wv(){var u=this.localeData()._week;return fn(this.year(),u.dow,u.doy)}function Nn(){var u=this.localeData()._week;return fn(this.weekYear(),u.dow,u.doy)}function vp(u,h,b,w,E){var M;return u==null?wo(this,w,E).year:(M=fn(u,w,E),h>M&&(h=M),_v.call(this,u,h,b,w,E))}function _v(u,h,b,w,E){var M=Ja(u,h,b,w,E),J=gs(M.year,0,M.dayOfYear);return this.year(J.getUTCFullYear()),this.month(J.getUTCMonth()),this.date(J.getUTCDate()),this}ce("Q",0,"Qo","quarter"),le("Q",Nd),Ke("Q",function(u,h){h[An]=(qe(u)-1)*3});function Rv(u){return u==null?Math.ceil((this.month()+1)/3):this.month((u-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),le("D",ot,Ti),le("DD",ot,Ut),le("Do",function(u,h){return u?h._dayOfMonthOrdinalParse||h._ordinalParse:h._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],un),Ke("Do",function(u,h){h[un]=qe(u.match(ot)[0])});var bp=ms("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",ds),le("DDDD",Dd),Ke(["DDD","DDDD"],function(u,h,b){b._dayOfYear=qe(u)});function xv(u){var h=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return u==null?h:this.add(u-h,"d")}ce("m",["mm",2],0,"minute"),le("m",ot,Ua),le("mm",ot,Ut),Ke(["m","mm"],kr);var Dn=ms("Minutes",!1);ce("s",["ss",2],0,"second"),le("s",ot,Ua),le("ss",ot,Ut),Ke(["s","ss"],qn);var Cv=ms("Seconds",!1);ce("S",0,0,function(){return~~(this.millisecond()/100)}),ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ce(0,["SSS",3],0,"millisecond"),ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),le("S",ds,Nd),le("SS",ds,Ut),le("SSS",ds,Dd);var yi,Sp;for(yi="SSSS";yi.length<=9;yi+="S")le(yi,fi);function Ev(u,h){h[Ai]=qe(("0."+u)*1e3)}for(yi="S";yi.length<=9;yi+="S")Ke(yi,Ev);Sp=ms("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function Ov(){return this._isUTC?"UTC":""}function Fi(){return this._isUTC?"Coordinated Universal Time":""}var te=W.prototype;te.add=ev,te.calendar=rv,te.clone=nv,te.diff=dp,te.endOf=gp,te.format=Ni,te.from=ul,te.fromNow=sv,te.to=ov,te.toNow=av,te.get=dy,te.invalidAt=xs,te.isAfter=iv,te.isBefore=ol,te.isBetween=gi,te.isSame=al,te.isSameOrAfter=fp,te.isSameOrBefore=ll,te.isValid=$o,te.lang=To,te.locale=ko,te.localeData=fl,te.max=op,te.min=sp,te.parsingFlags=hl,te.set=Va,te.startOf=lv,te.subtract=_s,te.toArray=uu,te.toObject=Rs,te.toDate=Ao,te.toISOString=pp,te.inspect=Po,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=qo,te.toString=cl,te.unix=cu,te.valueOf=cv,te.creationData=uv,te.eraName=hv,te.eraNarrow=ml,te.eraAbbr=Mo,te.eraYear=yp,te.year=Ld,te.isLeapYear=fy,te.weekYear=yv,te.isoWeekYear=vv,te.quarter=te.quarters=Rv,te.month=Wa,te.daysInMonth=vy,te.week=te.weeks=Wd,te.isoWeek=te.isoWeeks=Sy,te.weeksInYear=wv,te.weeksInWeekYear=Nn,te.isoWeeksInYear=bv,te.isoWeeksInISOWeekYear=Sv,te.date=bp,te.day=te.days=Iy,te.weekday=Py,te.isoWeekday=ky,te.dayOfYear=xv,te.hour=te.hours=$y,te.minute=te.minutes=Dn,te.second=te.seconds=Cv,te.millisecond=te.milliseconds=Sp,te.utcOffset=cp,te.utc=Yy,te.local=Ky,te.parseZone=Qy,te.hasAlignedHourOffset=Zy,te.isDST=mi,te.isLocal=Y,te.isUtcOffset=z,te.isUtc=ae,te.isUTC=ae,te.zoneAbbr=Ov,te.zoneName=Fi,te.dates=x("dates accessor is deprecated. Use date instead.",bp),te.months=x("months accessor is deprecated. Use month instead",Wa),te.years=x("years accessor is deprecated. Use year instead",Ld),te.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Gy),te.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",L);function Iv(u){return tt(u*1e3)}function Yr(){return tt.apply(null,arguments).parseZone()}function wp(u){return u}var Ve=K.prototype;Ve.calendar=et,Ve.longDateFormat=ht,Ve.invalidDate=ln,Ve.ordinal=fo,Ve.preparse=wp,Ve.postformat=wp,Ve.relativeTime=kn,Ve.pastFuture=$d,Ve.set=$,Ve.eras=fv,Ve.erasParse=dv,Ve.erasConvertYear=pv,Ve.erasAbbrRegex=Cs,Ve.erasNameRegex=O,Ve.erasNarrowRegex=gl,Ve.months=gy,Ve.monthsShort=yy,Ve.monthsParse=Hd,Ve.monthsRegex=za,Ve.monthsShortRegex=Bd,Ve.week=Kc,Ve.firstDayOfYear=Vd,Ve.firstDayOfWeek=ys,Ve.weekdays=xy,Ve.weekdaysMin=Ey,Ve.weekdaysShort=Cy,Ve.weekdaysParse=Oy,Ve.weekdaysRegex=Ty,Ve.weekdaysShortRegex=ft,Ve.weekdaysMinRegex=lt,Ve.isPM=qy,Ve.meridiem=Nt;function yl(u,h,b,w){var E=Mn(),M=y().set(w,h);return E[b](M,u)}function _p(u,h,b){if(f(u)&&(h=u,u=void 0),u=u||"",h!=null)return yl(u,h,b,"month");var w,E=[];for(w=0;w<12;w++)E[w]=yl(u,w,b,"month");return E}function du(u,h,b,w){typeof u=="boolean"?(f(h)&&(b=h,h=void 0),h=h||""):(h=u,b=h,u=!1,f(h)&&(b=h,h=void 0),h=h||"");var E=Mn(),M=u?E._week.dow:0,J,oe=[];if(b!=null)return yl(h,(b+M)%7,w,"day");for(J=0;J<7;J++)oe[J]=yl(h,(J+M)%7,w,"day");return oe}function Rp(u,h){return _p(u,h,"months")}function xp(u,h){return _p(u,h,"monthsShort")}function Pv(u,h,b){return du(u,h,b,"weekdays")}function kv(u,h,b){return du(u,h,b,"weekdaysShort")}function pu(u,h,b){return du(u,h,b,"weekdaysMin")}$n("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(u){var h=u%10,b=qe(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th";return u+b}}),e.lang=x("moment.lang is deprecated. Use moment.locale instead.",$n),e.langData=x("moment.langData is deprecated. Use moment.localeData instead.",Mn);var wr=Math.abs;function vl(){var u=this._data;return this._milliseconds=wr(this._milliseconds),this._days=wr(this._days),this._months=wr(this._months),u.milliseconds=wr(u.milliseconds),u.seconds=wr(u.seconds),u.minutes=wr(u.minutes),u.hours=wr(u.hours),u.months=wr(u.months),u.years=wr(u.years),this}function Cp(u,h,b,w){var E=rt(h,b);return u._milliseconds+=w*E._milliseconds,u._days+=w*E._days,u._months+=w*E._months,u._bubble()}function Ep(u,h){return Cp(this,u,h,1)}function Tv(u,h){return Cp(this,u,h,-1)}function Kr(u){return u<0?Math.floor(u):Math.ceil(u)}function hu(){var u=this._milliseconds,h=this._days,b=this._months,w=this._data,E,M,J,oe,ve;return u>=0&&h>=0&&b>=0||u<=0&&h<=0&&b<=0||(u+=Kr(sr(b)+h)*864e5,h=0,b=0),w.milliseconds=u%1e3,E=Pr(u/1e3),w.seconds=E%60,M=Pr(E/60),w.minutes=M%60,J=Pr(M/60),w.hours=J%24,h+=Pr(J/24),ve=Pr(vi(h)),b+=ve,h-=Kr(sr(ve)),oe=Pr(b/12),b%=12,w.days=h,w.months=b,w.years=oe,this}function vi(u){return u*4800/146097}function sr(u){return u*146097/4800}function Av(u){if(!this.isValid())return NaN;var h,b,w=this._milliseconds;if(u=Gt(u),u==="month"||u==="quarter"||u==="year")switch(h=this._days+w/864e5,b=this._months+vi(h),u){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(h=this._days+Math.round(sr(this._months)),u){case"week":return h/7+w/6048e5;case"day":return h+w/864e5;case"hour":return h*24+w/36e5;case"minute":return h*1440+w/6e4;case"second":return h*86400+w/1e3;case"millisecond":return Math.floor(h*864e5)+w;default:throw new Error("Unknown unit "+u)}}function hn(u){return function(){return this.as(u)}}var mu=hn("ms"),No=hn("s"),bi=hn("m"),Op=hn("h"),qv=hn("d"),bl=hn("w"),$v=hn("M"),Ip=hn("Q"),Bt=hn("y"),gu=mu;function Pp(){return rt(this)}function mn(u){return u=Gt(u),this.isValid()?this[u+"s"]():NaN}function Fn(u){return function(){return this.isValid()?this._data[u]:NaN}}var Sl=Fn("milliseconds"),Li=Fn("seconds"),kp=Fn("minutes"),Qt=Fn("hours"),yu=Fn("days"),Mv=Fn("months"),Nv=Fn("years");function Dv(){return Pr(this.days()/7)}var Qr=Math.round,Es={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Do(u,h,b,w,E){return E.relativeTime(h||1,!!b,u,w)}function Tp(u,h,b,w){var E=rt(u).abs(),M=Qr(E.as("s")),J=Qr(E.as("m")),oe=Qr(E.as("h")),ve=Qr(E.as("d")),Me=Qr(E.as("M")),Dt=Qr(E.as("w")),Ln=Qr(E.as("y")),jn=M<=b.ss&&["s",M]||M<b.s&&["ss",M]||J<=1&&["m"]||J<b.m&&["mm",J]||oe<=1&&["h"]||oe<b.h&&["hh",oe]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(jn=jn||Dt<=1&&["w"]||Dt<b.w&&["ww",Dt]),jn=jn||Me<=1&&["M"]||Me<b.M&&["MM",Me]||Ln<=1&&["y"]||["yy",Ln],jn[2]=h,jn[3]=+u>0,jn[4]=w,Do.apply(null,jn)}function Fv(u){return u===void 0?Qr:typeof u=="function"?(Qr=u,!0):!1}function Lv(u,h){return Es[u]===void 0?!1:h===void 0?Es[u]:(Es[u]=h,u==="s"&&(Es.ss=h-1),!0)}function Fo(u,h){if(!this.isValid())return this.localeData().invalidDate();var b=!1,w=Es,E,M;return typeof u=="object"&&(h=u,u=!1),typeof u=="boolean"&&(b=u),typeof h=="object"&&(w=Object.assign({},Es,h),h.s!=null&&h.ss==null&&(w.ss=h.s-1)),E=this.localeData(),M=Tp(this,!b,w,E),b&&(M=E.pastFuture(+this,M)),E.postformat(M)}var vu=Math.abs;function Os(u){return(u>0)-(u<0)||+u}function Is(){if(!this.isValid())return this.localeData().invalidDate();var u=vu(this._milliseconds)/1e3,h=vu(this._days),b=vu(this._months),w,E,M,J,oe=this.asSeconds(),ve,Me,Dt,Ln;return oe?(w=Pr(u/60),E=Pr(w/60),u%=60,w%=60,M=Pr(b/12),b%=12,J=u?u.toFixed(3).replace(/\.?0+$/,""):"",ve=oe<0?"-":"",Me=Os(this._months)!==Os(oe)?"-":"",Dt=Os(this._days)!==Os(oe)?"-":"",Ln=Os(this._milliseconds)!==Os(oe)?"-":"",ve+"P"+(M?Me+M+"Y":"")+(b?Me+b+"M":"")+(h?Dt+h+"D":"")+(E||w||u?"T":"")+(E?Ln+E+"H":"")+(w?Ln+w+"M":"")+(u?Ln+J+"S":"")):"P0D"}var Fe=ws.prototype;Fe.isValid=Wy,Fe.abs=vl,Fe.add=Ep,Fe.subtract=Tv,Fe.as=Av,Fe.asMilliseconds=mu,Fe.asSeconds=No,Fe.asMinutes=bi,Fe.asHours=Op,Fe.asDays=qv,Fe.asWeeks=bl,Fe.asMonths=$v,Fe.asQuarters=Ip,Fe.asYears=Bt,Fe.valueOf=gu,Fe._bubble=hu,Fe.clone=Pp,Fe.get=mn,Fe.milliseconds=Sl,Fe.seconds=Li,Fe.minutes=kp,Fe.hours=Qt,Fe.days=yu,Fe.weeks=Dv,Fe.months=Mv,Fe.years=Nv,Fe.humanize=Fo,Fe.toISOString=Is,Fe.toString=Is,Fe.toJSON=Is,Fe.locale=ko,Fe.localeData=fl,Fe.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Is),Fe.lang=To,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),le("x",hs),le("X",ay),Ke("X",function(u,h,b){b._d=new Date(parseFloat(u)*1e3)}),Ke("x",function(u,h,b){b._d=new Date(qe(u))});return e.version="2.30.1",r(tt),e.fn=te,e.min=Hy,e.max=By,e.now=Vy,e.utc=y,e.unix=Iv,e.months=Rp,e.isDate=d,e.locale=$n,e.invalid=A,e.duration=rt,e.isMoment=X,e.weekdays=Pv,e.parseZone=Yr,e.localeData=Mn,e.isDuration=Co,e.monthsShort=xp,e.weekdaysMin=pu,e.defineLocale=Ka,e.updateLocale=gr,e.locales=yr,e.weekdaysShort=kv,e.normalizeUnits=Gt,e.relativeTimeRounding=Fv,e.relativeTimeThreshold=Lv,e.calendarFormat=sl,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var TE=F((kE,ch)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof ch<"u"&&ch.exports?ch.exports=e():t.tv4=e()})(kE,function(){Object.keys||(Object.keys=(function(){var T=Object.prototype.hasOwnProperty,x=!{toString:null}.propertyIsEnumerable("toString"),k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=k.length;return function(j){if(typeof j!="object"&&typeof j!="function"||j===null)throw new TypeError("Object.keys called on non-object");var $=[];for(var G in j)T.call(j,G)&&$.push(G);if(x)for(var K=0;K<N;K++)T.call(j,k[K])&&$.push(k[K]);return $}})()),Object.create||(Object.create=(function(){function T(){}return function(x){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return T.prototype=x,new T}})()),Array.isArray||(Array.isArray=function(T){return Object.prototype.toString.call(T)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(T){if(this===null)throw new TypeError;var x=Object(this),k=x.length>>>0;if(k===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=k)return-1;for(var j=N>=0?N:Math.max(k-Math.abs(N),0);j<k;j++)if(j in x&&x[j]===T)return j;return-1}),Object.isFrozen||(Object.isFrozen=function(T){for(var x="tv4_test_frozen_key";T.hasOwnProperty(x);)x+=Math.random();try{return T[x]=!0,delete T[x],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(T){return encodeURI(T).replace(/%25[0-9][0-9]/g,function(x){return"%"+x.substring(3)})}function n(T){var x="";t[T.charAt(0)]&&(x=T.charAt(0),T=T.substring(1));var k="",N="",j=!0,$=!1,G=!1;x==="+"?j=!1:x==="."?(N=".",k="."):x==="/"?(N="/",k="/"):x==="#"?(N="#",j=!1):x===";"?(N=";",k=";",$=!0,G=!0):x==="?"?(N="?",k="&",$=!0):x==="&"&&(N="&",k="&",$=!0);for(var K=[],ne=T.split(","),pe=[],et={},_e=0;_e<ne.length;_e++){var he=ne[_e],Ce=null;if(he.indexOf(":")!==-1){var vt=he.split(":");he=vt[0],Ce=parseInt(vt[1],10)}for(var Et={};e[he.charAt(he.length-1)];)Et[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ce={truncate:Ce,name:he,suffices:Et};pe.push(ce),et[he]=ce,K.push(he)}var hr=function(ui){for(var Rt="",Gr=0,Ir=0;Ir<pe.length;Ir++){var ht=pe[Ir],mt=ui(ht.name);if(mt==null||Array.isArray(mt)&&mt.length===0||typeof mt=="object"&&Object.keys(mt).length===0){Gr++;continue}if(Ir===Gr?Rt+=N:Rt+=k||",",Array.isArray(mt)){$&&(Rt+=ht.name+"=");for(var ln=0;ln<mt.length;ln++)ln>0&&(Rt+=ht.suffices["*"]&&k||",",ht.suffices["*"]&&$&&(Rt+=ht.name+"=")),Rt+=j?encodeURIComponent(mt[ln]).replace(/!/g,"%21"):r(mt[ln])}else if(typeof mt=="object"){$&&!ht.suffices["*"]&&(Rt+=ht.name+"=");var uo=!0;for(var Jt in mt)uo||(Rt+=ht.suffices["*"]&&k||","),uo=!1,Rt+=j?encodeURIComponent(Jt).replace(/!/g,"%21"):r(Jt),Rt+=ht.suffices["*"]?"=":",",Rt+=j?encodeURIComponent(mt[Jt]).replace(/!/g,"%21"):r(mt[Jt])}else $&&(Rt+=ht.name,(!G||mt!=="")&&(Rt+="=")),ht.truncate!=null&&(mt=mt.substring(0,ht.truncate)),Rt+=j?encodeURIComponent(mt).replace(/!/g,"%21"):r(mt)}return Rt};return hr.varNames=K,{prefix:N,substitution:hr}}function i(T){if(!(this instanceof i))return new i(T);for(var x=T.split("{"),k=[x.shift()],N=[],j=[],$=[];x.length>0;){var G=x.shift(),K=G.split("}")[0],ne=G.substring(K.length+1),pe=n(K);j.push(pe.substitution),N.push(pe.prefix),k.push(ne),$=$.concat(pe.substitution.varNames)}this.fill=function(et){for(var _e=k[0],he=0;he<j.length;he++){var Ce=j[he];_e+=Ce(et),_e+=k[he+1]}return _e},this.varNames=$,this.template=T}i.prototype={toString:function(){return this.template},fillFromObject:function(T){return this.fill(function(x){return T[x]})}};var s=function(x,k,N,j,$){if(this.missing=[],this.missingMap={},this.formatValidators=x?Object.create(x.formatValidators):{},this.schemas=x?Object.create(x.schemas):{},this.collectMultiple=k,this.errors=[],this.handleError=k?this.collectError:this.returnError,j&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),$&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||S("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},x)for(var G in x.definedKeywords)this.definedKeywords[G]=x.definedKeywords[G].slice(0)};s.prototype.defineKeyword=function(T,x){this.definedKeywords[T]=this.definedKeywords[T]||[],this.definedKeywords[T].push(x)},s.prototype.createError=function(T,x,k,N,j,$,G){var K=new U(T,x,k,N,j);return K.message=this.errorReporter(K,$,G),K},s.prototype.returnError=function(T){return T},s.prototype.collectError=function(T){return T&&this.errors.push(T),null},s.prototype.prefixErrors=function(T,x,k){for(var N=T;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(x,k);return this},s.prototype.banUnknownProperties=function(T,x){for(var k in this.unknownPropertyPaths){var N=this.createError(_.UNKNOWN_PROPERTY,{path:k},k,"",null,T,x),j=this.handleError(N);if(j)return j}return null},s.prototype.addFormat=function(T,x){if(typeof T=="object"){for(var k in T)this.addFormat(k,T[k]);return this}this.formatValidators[T]=x},s.prototype.resolveRefs=function(T,x){if(T.$ref!==void 0){if(x=x||{},x[T.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(x).join(", ")},"","",null,void 0,T);x[T.$ref]=!0,T=this.getSchema(T.$ref,x)}return T},s.prototype.getSchema=function(T,x){var k;if(this.schemas[T]!==void 0)return k=this.schemas[T],this.resolveRefs(k,x);var N=T,j="";if(T.indexOf("#")!==-1&&(j=T.substring(T.indexOf("#")+1),N=T.substring(0,T.indexOf("#"))),typeof this.schemas[N]=="object"){k=this.schemas[N];var $=decodeURIComponent(j);if($==="")return this.resolveRefs(k,x);if($.charAt(0)!=="/")return;for(var G=$.split("/").slice(1),K=0;K<G.length;K++){var ne=G[K].replace(/~1/g,"/").replace(/~0/g,"~");if(k[ne]===void 0){k=void 0;break}k=k[ne]}if(k!==void 0)return this.resolveRefs(k,x)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(T,x){if(Array.isArray(T))for(var k=0;k<T.length;k++)this.searchSchemas(T[k],x);else if(T&&typeof T=="object"){typeof T.id=="string"&&B(x,T.id)&&this.schemas[T.id]===void 0&&(this.schemas[T.id]=T);for(var N in T)if(N!=="enum"){if(typeof T[N]=="object")this.searchSchemas(T[N],x);else if(N==="$ref"){var j=g(T[N]);j&&this.schemas[j]===void 0&&this.missingMap[j]===void 0&&(this.missingMap[j]=j)}}}},s.prototype.addSchema=function(T,x){if(typeof T!="string"||typeof x>"u")if(typeof T=="object"&&typeof T.id=="string")x=T,T=x.id;else return;T===g(T)+"#"&&(T=g(T)),this.schemas[T]=x,delete this.missingMap[T],y(x,T),this.searchSchemas(x,T)},s.prototype.getSchemaMap=function(){var T={};for(var x in this.schemas)T[x]=this.schemas[x];return T},s.prototype.getSchemaUris=function(T){var x=[];for(var k in this.schemas)(!T||T.test(k))&&x.push(k);return x},s.prototype.getMissingUris=function(T){var x=[];for(var k in this.missingMap)(!T||T.test(k))&&x.push(k);return x},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(T,x,k,N,j){var $;if(x=this.resolveRefs(x),x){if(x instanceof U)return this.errors.push(x),x}else return null;var G=this.errors.length,K,ne=null,pe=null;if(this.checkRecursive&&T&&typeof T=="object"){if($=!this.scanned.length,T[this.validatedSchemasKey]){var et=T[this.validatedSchemasKey].indexOf(x);if(et!==-1)return this.errors=this.errors.concat(T[this.validationErrorsKey][et]),null}if(Object.isFrozen(T)&&(K=this.scannedFrozen.indexOf(T),K!==-1)){var _e=this.scannedFrozenSchemas[K].indexOf(x);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[K][_e]),null}if(this.scanned.push(T),Object.isFrozen(T))K===-1&&(K=this.scannedFrozen.length,this.scannedFrozen.push(T),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[K].length,this.scannedFrozenSchemas[K][ne]=x,this.scannedFrozenValidationErrors[K][ne]=[];else{if(!T[this.validatedSchemasKey])try{Object.defineProperty(T,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(T,this.validationErrorsKey,{value:[],configurable:!0})}catch{T[this.validatedSchemasKey]=[],T[this.validationErrorsKey]=[]}pe=T[this.validatedSchemasKey].length,T[this.validatedSchemasKey][pe]=x,T[this.validationErrorsKey][pe]=[]}}var he=this.errors.length,Ce=this.validateBasic(T,x,j)||this.validateNumeric(T,x,j)||this.validateString(T,x,j)||this.validateArray(T,x,j)||this.validateObject(T,x,j)||this.validateCombinations(T,x,j)||this.validateHypermedia(T,x,j)||this.validateFormat(T,x,j)||this.validateDefinedKeywords(T,x,j)||null;if($){for(;this.scanned.length;){var vt=this.scanned.pop();delete vt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ce||he!==this.errors.length)for(;k&&k.length||N&&N.length;){var Et=k&&k.length?""+k.pop():null,ce=N&&N.length?""+N.pop():null;Ce&&(Ce=Ce.prefixWith(Et,ce)),this.prefixErrors(he,Et,ce)}return ne!==null?this.scannedFrozenValidationErrors[K][ne]=this.errors.slice(G):pe!==null&&(T[this.validationErrorsKey][pe]=this.errors.slice(G)),this.handleError(Ce)},s.prototype.validateFormat=function(T,x){if(typeof x.format!="string"||!this.formatValidators[x.format])return null;var k=this.formatValidators[x.format].call(null,T,x);return typeof k=="string"||typeof k=="number"?this.createError(_.FORMAT_CUSTOM,{message:k},"","/format",null,T,x):k&&typeof k=="object"?this.createError(_.FORMAT_CUSTOM,{message:k.message||"?"},k.dataPath||"",k.schemaPath||"/format",null,T,x):null},s.prototype.validateDefinedKeywords=function(T,x,k){for(var N in this.definedKeywords)if(!(typeof x[N]>"u"))for(var j=this.definedKeywords[N],$=0;$<j.length;$++){var G=j[$],K=G(T,x[N],x,k);if(typeof K=="string"||typeof K=="number")return this.createError(_.KEYWORD_CUSTOM,{key:N,message:K},"","",null,T,x).prefixWith(null,N);if(K&&typeof K=="object"){var ne=K.code;if(typeof ne=="string"){if(!_[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=_[ne]}else typeof ne!="number"&&(ne=_.KEYWORD_CUSTOM);var pe=typeof K.message=="object"?K.message:{key:N,message:K.message||"?"},et=K.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,pe,K.dataPath||null,et,null,T,x)}}return null};function a(T,x){if(T===x)return!0;if(T&&x&&typeof T=="object"&&typeof x=="object"){if(Array.isArray(T)!==Array.isArray(x))return!1;if(Array.isArray(T)){if(T.length!==x.length)return!1;for(var k=0;k<T.length;k++)if(!a(T[k],x[k]))return!1}else{var N;for(N in T)if(x[N]===void 0&&T[N]!==void 0)return!1;for(N in x)if(T[N]===void 0&&x[N]!==void 0)return!1;for(N in T)if(!a(T[N],x[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(x,k,N){var j;return(j=this.validateType(x,k,N))||(j=this.validateEnum(x,k,N))?j.prefixWith(null,"type"):null},s.prototype.validateType=function(x,k){if(k.type===void 0)return null;var N=typeof x;x===null?N="null":Array.isArray(x)&&(N="array");var j=k.type;Array.isArray(j)||(j=[j]);for(var $=0;$<j.length;$++){var G=j[$];if(G===N||G==="integer"&&N==="number"&&x%1===0)return null}return this.createError(_.INVALID_TYPE,{type:N,expected:j.join("/")},"","",null,x,k)},s.prototype.validateEnum=function(x,k){if(k.enum===void 0)return null;for(var N=0;N<k.enum.length;N++){var j=k.enum[N];if(a(x,j))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(x):x},"","",null,x,k)},s.prototype.validateNumeric=function(x,k,N){return this.validateMultipleOf(x,k,N)||this.validateMinMax(x,k,N)||this.validateNaN(x,k,N)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(x,k){var N=k.multipleOf||k.divisibleBy;if(N===void 0)return null;if(typeof x=="number"){var j=x/N%1;if(j>=l&&j<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:x,multipleOf:N},"","",null,x,k)}return null},s.prototype.validateMinMax=function(x,k){if(typeof x!="number")return null;if(k.minimum!==void 0){if(x<k.minimum)return this.createError(_.NUMBER_MINIMUM,{value:x,minimum:k.minimum},"","/minimum",null,x,k);if(k.exclusiveMinimum&&x===k.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:x,minimum:k.minimum},"","/exclusiveMinimum",null,x,k)}if(k.maximum!==void 0){if(x>k.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:x,maximum:k.maximum},"","/maximum",null,x,k);if(k.exclusiveMaximum&&x===k.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:x,maximum:k.maximum},"","/exclusiveMaximum",null,x,k)}return null},s.prototype.validateNaN=function(x,k){return typeof x!="number"?null:isNaN(x)===!0||x===1/0||x===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:x},"","/type",null,x,k):null},s.prototype.validateString=function(x,k,N){return this.validateStringLength(x,k,N)||this.validateStringPattern(x,k,N)||null},s.prototype.validateStringLength=function(x,k){return typeof x!="string"?null:k.minLength!==void 0&&x.length<k.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:x.length,minimum:k.minLength},"","/minLength",null,x,k):k.maxLength!==void 0&&x.length>k.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:x.length,maximum:k.maxLength},"","/maxLength",null,x,k):null},s.prototype.validateStringPattern=function(x,k){if(typeof x!="string"||typeof k.pattern!="string"&&!(k.pattern instanceof RegExp))return null;var N;if(k.pattern instanceof RegExp)N=k.pattern;else{var j,$="",G=k.pattern.match(/^\/(.+)\/([img]*)$/);G?(j=G[1],$=G[2]):j=k.pattern,N=new RegExp(j,$)}return N.test(x)?null:this.createError(_.STRING_PATTERN,{pattern:k.pattern},"","/pattern",null,x,k)},s.prototype.validateArray=function(x,k,N){return Array.isArray(x)&&(this.validateArrayLength(x,k,N)||this.validateArrayUniqueItems(x,k,N)||this.validateArrayItems(x,k,N))||null},s.prototype.validateArrayLength=function(x,k){var N;return k.minItems!==void 0&&x.length<k.minItems&&(N=this.createError(_.ARRAY_LENGTH_SHORT,{length:x.length,minimum:k.minItems},"","/minItems",null,x,k),this.handleError(N))||k.maxItems!==void 0&&x.length>k.maxItems&&(N=this.createError(_.ARRAY_LENGTH_LONG,{length:x.length,maximum:k.maxItems},"","/maxItems",null,x,k),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(x,k){if(k.uniqueItems){for(var N=0;N<x.length;N++)for(var j=N+1;j<x.length;j++)if(a(x[N],x[j])){var $=this.createError(_.ARRAY_UNIQUE,{match1:N,match2:j},"","/uniqueItems",null,x,k);if(this.handleError($))return $}}return null},s.prototype.validateArrayItems=function(x,k,N){if(k.items===void 0)return null;var j,$;if(Array.isArray(k.items)){for($=0;$<x.length;$++)if($<k.items.length){if(j=this.validateAll(x[$],k.items[$],[$],["items",$],N+"/"+$))return j}else if(k.additionalItems!==void 0){if(typeof k.additionalItems=="boolean"){if(!k.additionalItems&&(j=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+$,"/additionalItems",null,x,k),this.handleError(j)))return j}else if(j=this.validateAll(x[$],k.additionalItems,[$],["additionalItems"],N+"/"+$))return j}}else for($=0;$<x.length;$++)if(j=this.validateAll(x[$],k.items,[$],["items"],N+"/"+$))return j;return null},s.prototype.validateObject=function(x,k,N){return typeof x!="object"||x===null||Array.isArray(x)?null:this.validateObjectMinMaxProperties(x,k,N)||this.validateObjectRequiredProperties(x,k,N)||this.validateObjectProperties(x,k,N)||this.validateObjectDependencies(x,k,N)||null},s.prototype.validateObjectMinMaxProperties=function(x,k){var N=Object.keys(x),j;return k.minProperties!==void 0&&N.length<k.minProperties&&(j=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:k.minProperties},"","/minProperties",null,x,k),this.handleError(j))||k.maxProperties!==void 0&&N.length>k.maxProperties&&(j=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:k.maxProperties},"","/maxProperties",null,x,k),this.handleError(j))?j:null},s.prototype.validateObjectRequiredProperties=function(x,k){if(k.required!==void 0)for(var N=0;N<k.required.length;N++){var j=k.required[N];if(x[j]===void 0){var $=this.createError(_.OBJECT_REQUIRED,{key:j},"","/required/"+N,null,x,k);if(this.handleError($))return $}}return null},s.prototype.validateObjectProperties=function(x,k,N){var j;for(var $ in x){var G=N+"/"+$.replace(/~/g,"~0").replace(/\//g,"~1"),K=!1;if(k.properties!==void 0&&k.properties[$]!==void 0&&(K=!0,j=this.validateAll(x[$],k.properties[$],[$],["properties",$],G)))return j;if(k.patternProperties!==void 0)for(var ne in k.patternProperties){var pe=new RegExp(ne);if(pe.test($)&&(K=!0,j=this.validateAll(x[$],k.patternProperties[ne],[$],["patternProperties",ne],G)))return j}if(K)this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]);else if(k.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]),typeof k.additionalProperties=="boolean"){if(!k.additionalProperties&&(j=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:$},"","/additionalProperties",null,x,k).prefixWith($,null),this.handleError(j)))return j}else if(j=this.validateAll(x[$],k.additionalProperties,[$],["additionalProperties"],G))return j}else this.trackUnknownProperties&&!this.knownPropertyPaths[G]&&(this.unknownPropertyPaths[G]=!0)}return null},s.prototype.validateObjectDependencies=function(x,k,N){var j;if(k.dependencies!==void 0){for(var $ in k.dependencies)if(x[$]!==void 0){var G=k.dependencies[$];if(typeof G=="string"){if(x[G]===void 0&&(j=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:G},"","",null,x,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(Array.isArray(G))for(var K=0;K<G.length;K++){var ne=G[K];if(x[ne]===void 0&&(j=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:ne},"","/"+K,null,x,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(j=this.validateAll(x,G,[],["dependencies",$],N))return j}}return null},s.prototype.validateCombinations=function(x,k,N){return this.validateAllOf(x,k,N)||this.validateAnyOf(x,k,N)||this.validateOneOf(x,k,N)||this.validateNot(x,k,N)||null},s.prototype.validateAllOf=function(x,k,N){if(k.allOf===void 0)return null;for(var j,$=0;$<k.allOf.length;$++){var G=k.allOf[$];if(j=this.validateAll(x,G,[],["allOf",$],N))return j}return null},s.prototype.validateAnyOf=function(x,k,N){if(k.anyOf===void 0)return null;var j=[],$=this.errors.length,G,K;this.trackUnknownProperties&&(G=this.unknownPropertyPaths,K=this.knownPropertyPaths);for(var ne=!0,pe=0;pe<k.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.anyOf[pe],_e=this.errors.length,he=this.validateAll(x,et,[],["anyOf",pe],N);if(he===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,$),this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)K[Ce]=!0,delete G[Ce];for(var vt in this.unknownPropertyPaths)K[vt]||(G[vt]=!0);ne=!1;continue}return null}he&&j.push(he.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=G,this.knownPropertyPaths=K),ne)return j=j.concat(this.errors.slice($)),this.errors=this.errors.slice(0,$),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",j,x,k)},s.prototype.validateOneOf=function(x,k,N){if(k.oneOf===void 0)return null;var j=null,$=[],G=this.errors.length,K,ne;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var pe=0;pe<k.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.oneOf[pe],_e=this.errors.length,he=this.validateAll(x,et,[],["oneOf",pe],N);if(he===null&&_e===this.errors.length){if(j===null)j=pe;else return this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MULTIPLE,{index1:j,index2:pe},"","/oneOf",null,x,k);if(this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)ne[Ce]=!0,delete K[Ce];for(var vt in this.unknownPropertyPaths)ne[vt]||(K[vt]=!0)}}else he&&$.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ne),j===null?($=$.concat(this.errors.slice(G)),this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",$,x,k)):(this.errors=this.errors.slice(0,G),null)},s.prototype.validateNot=function(x,k,N){if(k.not===void 0)return null;var j=this.errors.length,$,G;this.trackUnknownProperties&&($=this.unknownPropertyPaths,G=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var K=this.validateAll(x,k.not,null,null,N),ne=this.errors.slice(j);return this.errors=this.errors.slice(0,j),this.trackUnknownProperties&&(this.unknownPropertyPaths=$,this.knownPropertyPaths=G),K===null&&ne.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,x,k):null},s.prototype.validateHypermedia=function(x,k,N){if(!k.links)return null;for(var j,$=0;$<k.links.length;$++){var G=k.links[$];if(G.rel==="describedby"){for(var K=new i(G.href),ne=!0,pe=0;pe<K.varNames.length;pe++)if(!(K.varNames[pe]in x)){ne=!1;break}if(ne){var et=K.fillFromObject(x),_e={$ref:et};if(j=this.validateAll(x,_e,[],["links",$],N))return j}}}};function d(T){var x=String(T).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return x?{href:x[0]||"",protocol:x[1]||"",authority:x[2]||"",host:x[3]||"",hostname:x[4]||"",port:x[5]||"",pathname:x[6]||"",search:x[7]||"",hash:x[8]||""}:null}function m(T,x){function k(N){var j=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function($){$==="/.."?j.pop():j.push($)}),j.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return x=d(x||""),T=d(T||""),!x||!T?null:(x.protocol||T.protocol)+(x.protocol||x.authority?x.authority:T.authority)+k(x.protocol||x.authority||x.pathname.charAt(0)==="/"?x.pathname:x.pathname?(T.authority&&!T.pathname?"/":"")+T.pathname.slice(0,T.pathname.lastIndexOf("/")+1)+x.pathname:T.pathname)+(x.protocol||x.authority||x.pathname?x.search:x.search||T.search)+x.hash}function g(T){return T.split("#")[0]}function y(T,x){if(T&&typeof T=="object")if(x===void 0?x=T.id:typeof T.id=="string"&&(x=m(x,T.id),T.id=x),Array.isArray(T))for(var k=0;k<T.length;k++)y(T[k],x);else{typeof T.$ref=="string"&&(T.$ref=m(x,T.$ref));for(var N in T)N!=="enum"&&y(T[N],x)}}function S(T){T=T||"en";var x=V[T];return function(k){var N=x[k.code]||A[k.code];if(typeof N!="string")return"Unknown error code "+k.code+": "+JSON.stringify(k.messageParams);var j=k.params;return N.replace(/\{([^{}]*)\}/g,function($,G){var K=j[G];return typeof K=="string"||typeof K=="number"?K:$})}}var _={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},R={};for(var P in _)R[_[P]]=P;var A={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function U(T,x,k,N,j){if(Error.call(this),T===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=x,this.code=T,this.dataPath=k||"",this.schemaPath=N||"",this.subErrors=j||null;var $=new Error(this.message);if(this.stack=$.stack||$.stacktrace,!this.stack)try{throw $}catch(G){this.stack=G.stack||G.stacktrace}}U.prototype=Object.create(Error.prototype),U.prototype.constructor=U,U.prototype.name="ValidationError",U.prototype.prefixWith=function(T,x){if(T!==null&&(T=T.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+T+this.dataPath),x!==null&&(x=x.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+x+this.schemaPath),this.subErrors!==null)for(var k=0;k<this.subErrors.length;k++)this.subErrors[k].prefixWith(T,x);return this};function B(T,x){if(x.substring(0,T.length)===T){var k=x.substring(T.length);if(x.length>0&&x.charAt(T.length-1)==="/"||k.charAt(0)==="#"||k.charAt(0)==="?")return!0}return!1}var V={};function W(T){var x=new s,k,N,j={setErrorReporter:function($){return typeof $=="string"?this.language($):(N=$,!0)},addFormat:function(){x.addFormat.apply(x,arguments)},language:function($){return $?(V[$]||($=$.split("-")[0]),V[$]?(k=$,$):!1):k},addLanguage:function($,G){var K;for(K in _)G[K]&&!G[_[K]]&&(G[_[K]]=G[K]);var ne=$.split("-")[0];if(!V[ne])V[$]=G,V[ne]=G;else{V[$]=Object.create(V[ne]);for(K in G)typeof V[ne][K]>"u"&&(V[ne][K]=G[K]),V[$][K]=G[K]}return this},freshApi:function($){var G=W();return $&&G.language($),G},validate:function($,G,K,ne){var pe=S(k),et=N?function(Ce,vt,Et){return N(Ce,vt,Et)||pe(Ce,vt,Et)}:pe,_e=new s(x,!1,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G);var he=_e.validateAll($,G,null,null,"");return!he&&ne&&(he=_e.banUnknownProperties($,G)),this.error=he,this.missing=_e.missing,this.valid=he===null,this.valid},validateResult:function(){var $={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply($,arguments),$},validateMultiple:function($,G,K,ne){var pe=S(k),et=N?function(Ce,vt,Et){return N(Ce,vt,Et)||pe(Ce,vt,Et)}:pe,_e=new s(x,!0,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G),_e.validateAll($,G,null,null,""),ne&&_e.banUnknownProperties($,G);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=_e.errors,he.missing=_e.missing,he.valid=he.errors.length===0,he},addSchema:function(){return x.addSchema.apply(x,arguments)},getSchema:function(){return x.getSchema.apply(x,arguments)},getSchemaMap:function(){return x.getSchemaMap.apply(x,arguments)},getSchemaUris:function(){return x.getSchemaUris.apply(x,arguments)},getMissingUris:function(){return x.getMissingUris.apply(x,arguments)},dropSchemas:function(){x.dropSchemas.apply(x,arguments)},defineKeyword:function(){x.defineKeyword.apply(x,arguments)},defineError:function($,G,K){if(typeof $!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test($))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof G!="number"||G%1!==0||G<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[$]<"u")throw new Error("Error already defined: "+$+" as "+_[$]);if(typeof R[G]<"u")throw new Error("Error code already used: "+R[G]+" as "+G);_[$]=G,R[G]=$,A[$]=A[G]=K;for(var ne in V){var pe=V[ne];pe[$]&&(pe[G]=pe[G]||pe[$])}},reset:function(){x.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:m,getDocumentUri:g,errorCodes:_};return j.language(T||"en"),j}var X=W();return X.addLanguage("en-gb",A),X.tv4=X,X})});var Uu=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.regexpCode=Ye.getEsmExportName=Ye.getProperty=Ye.safeStringify=Ye.stringify=Ye.strConcat=Ye.addCodeArg=Ye.str=Ye._=Ye.nil=Ye._Code=Ye.Name=Ye.IDENTIFIER=Ye._CodeOrName=void 0;var Lu=class{};Ye._CodeOrName=Lu;Ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Qo=class extends Lu{constructor(e){if(super(),!Ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ye.Name=Qo;var wn=class extends Lu{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Qo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ye._Code=wn;Ye.nil=new wn("");function AE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Lb(r,e[n]),r.push(t[++n]);return new wn(r)}Ye._=AE;var Fb=new wn("+");function qE(t,...e){let r=[ju(t[0])],n=0;for(;n<e.length;)r.push(Fb),Lb(r,e[n]),r.push(Fb,ju(t[++n]));return Sj(r),new wn(r)}Ye.str=qE;function Lb(t,e){e instanceof wn?t.push(...e._items):e instanceof Qo?t.push(e):t.push(Rj(e))}Ye.addCodeArg=Lb;function Sj(t){let e=1;for(;e<t.length-1;){if(t[e]===Fb){let r=wj(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function wj(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Qo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Qo))return`"${t}${e.slice(1)}`}function _j(t,e){return e.emptyStr()?t:t.emptyStr()?e:qE`${t}${e}`}Ye.strConcat=_j;function Rj(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ju(Array.isArray(t)?t.join(","):t)}function xj(t){return new wn(ju(t))}Ye.stringify=xj;function ju(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ye.safeStringify=ju;function Cj(t){return typeof t=="string"&&Ye.IDENTIFIER.test(t)?new wn(`.${t}`):AE`[${t}]`}Ye.getProperty=Cj;function Ej(t){if(typeof t=="string"&&Ye.IDENTIFIER.test(t))return new wn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ye.getEsmExportName=Ej;function Oj(t){return new wn(t.toString())}Ye.regexpCode=Oj});var Hb=F(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ValueScope=Dr.ValueScopeName=Dr.Scope=Dr.varKinds=Dr.UsedValueState=void 0;var Nr=Uu(),jb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},uh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(uh||(Dr.UsedValueState=uh={}));Dr.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};var fh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Nr.Name?e:this.name(e)}name(e){return new Nr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Dr.Scope=fh;var dh=class extends Nr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Nr._)`.${new Nr.Name(r)}[${n}]`}};Dr.ValueScopeName=dh;var Ij=(0,Nr._)`\n`,Ub=class extends fh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Ij:Nr.nil}}get(){return this._scope}name(e){return new dh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let m=l.get(a);if(m)return m}else l=this._values[s]=new Map;l.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),d=f.length;return f[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Nr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Nr.nil;for(let a in e){let l=e[a];if(!l)continue;let f=n[a]=n[a]||new Map;l.forEach(d=>{if(f.has(d))return;f.set(d,uh.Started);let m=r(d);if(m){let g=this.opts.es5?Dr.varKinds.var:Dr.varKinds.const;s=(0,Nr._)`${s}${g} ${d} = ${m};${this.opts._n}`}else if(m=i?.(d))s=(0,Nr._)`${s}${m}${this.opts._n}`;else throw new jb(d);f.set(d,uh.Completed)})}return s}};Dr.ValueScope=Ub});var Ne=F(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.or=Ae.and=Ae.not=Ae.CodeGen=Ae.operators=Ae.varKinds=Ae.ValueScopeName=Ae.ValueScope=Ae.Scope=Ae.Name=Ae.regexpCode=Ae.stringify=Ae.getProperty=Ae.nil=Ae.strConcat=Ae.str=Ae._=void 0;var Be=Uu(),zn=Hb(),Ds=Uu();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return Ds._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return Ds.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return Ds.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return Ds.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return Ds.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return Ds.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return Ds.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return Ds.Name}});var gh=Hb();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return gh.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return gh.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return gh.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return gh.varKinds}});Ae.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Ki=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Bb=class extends Ki{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?zn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ql(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},ph=class extends Ki{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ql(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return mh(e,this.rhs)}},Vb=class extends ph{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Wb=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},zb=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Jb=class extends Ki{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Gb=class extends Ki{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ql(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Hu=class extends Ki{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(Pj(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ea(e,r.names),{})}},Qi=class extends Hu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Yb=class extends Hu{},Al=class extends Qi{};Al.kind="else";var Zo=class t extends Qi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Al(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t($E(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ql(this.condition,e,r),this}get names(){let e=super.names;return mh(e,this.condition),this.else&&ea(e,this.else.names),e}};Zo.kind="if";var Xo=class extends Qi{};Xo.kind="for";var Kb=class extends Xo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ql(this.iteration,e,r),this}get names(){return ea(super.names,this.iteration.names)}},Qb=class extends Xo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?zn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=mh(super.names,this.from);return mh(e,this.to)}},hh=class extends Xo{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ql(this.iterable,e,r),this}get names(){return ea(super.names,this.iterable.names)}},Bu=class extends Qi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Bu.kind="func";var Vu=class extends Hu{render(e){return"return "+super.render(e)}};Vu.kind="return";var Zb=class extends Qi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ea(e,this.catch.names),this.finally&&ea(e,this.finally.names),e}},Wu=class extends Qi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Wu.kind="catch";var zu=class extends Qi{render(e){return"finally"+super.render(e)}};zu.kind="finally";var Xb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
24
- `:""},this._extScope=e,this._scope=new zn.Scope({parent:e}),this._nodes=[new Yb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Bb(e,s,n)),s}const(e,r,n){return this._def(zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new ph(e,r,n))}add(e,r){return this._leafNode(new Vb(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Gb(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Be.addCodeArg)(r,i));return r.push("}"),new Be._Code(r)}if(e,r,n){if(this._blockNode(new Zo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Zo(e))}else(){return this._elseNode(new Al)}endIf(){return this._endBlockNode(Zo,Al)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Kb(e),r)}forRange(e,r,n,i,s=this.opts.es5?zn.varKinds.var:zn.varKinds.let){let a=this._scope.toName(e);return this._for(new Qb(s,a,r,n),()=>i(a))}forOf(e,r,n,i=zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Be.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Be._)`${a}.length`,l=>{this.var(s,(0,Be._)`${a}[${l}]`),n(s)})}return this._for(new hh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?zn.varKinds.var:zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new hh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Xo)}label(e){return this._leafNode(new Wb(e))}break(e){return this._leafNode(new zb(e))}return(e){let r=new Vu;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Vu)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Zb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Wu(s),r(s)}return n&&(this._currNode=i.finally=new zu,this.code(n)),this._endBlockNode(Wu,zu)}throw(e){return this._leafNode(new Jb(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Be.nil,n,i){return this._blockNode(new Bu(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Bu)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Zo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ae.CodeGen=Xb;function ea(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function mh(t,e){return e instanceof Be._CodeOrName?ea(t,e.names):t}function ql(t,e,r){if(t instanceof Be.Name)return n(t);if(!i(t))return t;return new Be._Code(t._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function Pj(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function $E(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${eS(t)}`}Ae.not=$E;var kj=ME(Ae.operators.AND);function Tj(...t){return t.reduce(kj)}Ae.and=Tj;var Aj=ME(Ae.operators.OR);function qj(...t){return t.reduce(Aj)}Ae.or=qj;function ME(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${eS(e)} ${t} ${eS(r)}`}function eS(t){return t instanceof Be.Name?t:(0,Be._)`(${t})`}});var We=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var pt=Ne(),$j=Uu();function Mj(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=Mj;function Nj(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(FE(t,e),!LE(e,t.self.RULES.all))}De.alwaysValidSchema=Nj;function FE(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||HE(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=FE;function LE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=LE;function Dj(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}De.schemaHasRulesButRef=Dj;function Fj({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pt._)`${r}`}return(0,pt._)`${t}${e}${(0,pt.getProperty)(n)}`}De.schemaRefOrVal=Fj;function Lj(t){return jE(decodeURIComponent(t))}De.unescapeFragment=Lj;function jj(t){return encodeURIComponent(rS(t))}De.escapeFragment=jj;function rS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=rS;function jE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=jE;function Uj(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=Uj;function NE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,l)=>{let f=a===void 0?s:a instanceof pt.Name?(s instanceof pt.Name?t(i,s,a):e(i,s,a),a):s instanceof pt.Name?(e(i,a,s),s):r(s,a);return l===pt.Name&&!(f instanceof pt.Name)?n(i,f):f}}De.mergeEvaluated={props:NE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,pt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,pt._)`${r} || {}`).code((0,pt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,pt._)`${r} || {}`),nS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:UE}),items:NE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,pt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,pt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function UE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,pt._)`{}`);return e!==void 0&&nS(t,r,e),r}De.evaluatedPropsToName=UE;function nS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,pt._)`${e}${(0,pt.getProperty)(n)}`,!0))}De.setEvaluated=nS;var DE={};function Hj(t,e){return t.scopeValue("func",{ref:e,code:DE[e.code]||(DE[e.code]=new $j._Code(e.code))})}De.useFunc=Hj;var tS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(tS||(De.Type=tS={}));function Bj(t,e,r){if(t instanceof pt.Name){let n=e===tS.Num;return r?n?(0,pt._)`"[" + ${t} + "]"`:(0,pt._)`"['" + ${t} + "']"`:n?(0,pt._)`"/" + ${t}`:(0,pt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,pt.getProperty)(t).toString():"/"+rS(t)}De.getErrorPath=Bj;function HE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}De.checkStrictMode=HE});var Zi=F(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var ar=Ne(),Vj={data:new ar.Name("data"),valCxt:new ar.Name("valCxt"),instancePath:new ar.Name("instancePath"),parentData:new ar.Name("parentData"),parentDataProperty:new ar.Name("parentDataProperty"),rootData:new ar.Name("rootData"),dynamicAnchors:new ar.Name("dynamicAnchors"),vErrors:new ar.Name("vErrors"),errors:new ar.Name("errors"),this:new ar.Name("this"),self:new ar.Name("self"),scope:new ar.Name("scope"),json:new ar.Name("json"),jsonPos:new ar.Name("jsonPos"),jsonLen:new ar.Name("jsonLen"),jsonPart:new ar.Name("jsonPart")};iS.default=Vj});var Ju=F(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.extendErrors=lr.resetErrorsCount=lr.reportExtraError=lr.reportError=lr.keyword$DataError=lr.keywordError=void 0;var ze=Ne(),yh=We(),Cr=Zi();lr.keywordError={message:({keyword:t})=>(0,ze.str)`must pass "${t}" keyword validation`};lr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ze.str)`"${t}" keyword must be ${e} ($data)`:(0,ze.str)`"${t}" keyword is invalid ($data)`};function Wj(t,e=lr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:l}=i,f=WE(t,e,r);n??(a||l)?BE(s,f):VE(i,(0,ze._)`[${f}]`)}lr.reportError=Wj;function zj(t,e=lr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,l=WE(t,e,r);BE(i,l),s||a||VE(n,Cr.default.vErrors)}lr.reportExtraError=zj;function Jj(t,e){t.assign(Cr.default.errors,e),t.if((0,ze._)`${Cr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ze._)`${Cr.default.vErrors}.length`,e),()=>t.assign(Cr.default.vErrors,null)))}lr.resetErrorsCount=Jj;function Gj({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,Cr.default.errors,l=>{t.const(a,(0,ze._)`${Cr.default.vErrors}[${l}]`),t.if((0,ze._)`${a}.instancePath === undefined`,()=>t.assign((0,ze._)`${a}.instancePath`,(0,ze.strConcat)(Cr.default.instancePath,s.errorPath))),t.assign((0,ze._)`${a}.schemaPath`,(0,ze.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,ze._)`${a}.schema`,r),t.assign((0,ze._)`${a}.data`,n))})}lr.extendErrors=Gj;function BE(t,e){let r=t.const("err",e);t.if((0,ze._)`${Cr.default.vErrors} === null`,()=>t.assign(Cr.default.vErrors,(0,ze._)`[${r}]`),(0,ze._)`${Cr.default.vErrors}.push(${r})`),t.code((0,ze._)`${Cr.default.errors}++`)}function VE(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ze._)`new ${t.ValidationError}(${e})`):(r.assign((0,ze._)`${n}.errors`,e),r.return(!1))}var ta={keyword:new ze.Name("keyword"),schemaPath:new ze.Name("schemaPath"),params:new ze.Name("params"),propertyName:new ze.Name("propertyName"),message:new ze.Name("message"),schema:new ze.Name("schema"),parentSchema:new ze.Name("parentSchema")};function WE(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ze._)`{}`:Yj(t,e,r)}function Yj(t,e,r={}){let{gen:n,it:i}=t,s=[Kj(i,r),Qj(t,r)];return Zj(t,e,s),n.object(...s)}function Kj({errorPath:t},{instancePath:e}){let r=e?(0,ze.str)`${t}${(0,yh.getErrorPath)(e,yh.Type.Str)}`:t;return[Cr.default.instancePath,(0,ze.strConcat)(Cr.default.instancePath,r)]}function Qj({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ze.str)`${e}/${t}`;return r&&(i=(0,ze.str)`${i}${(0,yh.getErrorPath)(r,yh.Type.Str)}`),[ta.schemaPath,i]}function Zj(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:l}=t,{opts:f,propertyName:d,topSchemaRef:m,schemaPath:g}=l;n.push([ta.keyword,i],[ta.params,typeof e=="function"?e(t):e||(0,ze._)`{}`]),f.messages&&n.push([ta.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([ta.schema,a],[ta.parentSchema,(0,ze._)`${m}${g}`],[Cr.default.data,s]),d&&n.push([ta.propertyName,d])}});var JE=F($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.boolOrEmptySchema=$l.topBoolOrEmptySchema=void 0;var Xj=Ju(),e2=Ne(),t2=Zi(),r2={message:"boolean schema is false"};function n2(t){let{gen:e,schema:r,validateName:n}=t;r===!1?zE(t,!1):typeof r=="object"&&r.$async===!0?e.return(t2.default.data):(e.assign((0,e2._)`${n}.errors`,null),e.return(!0))}$l.topBoolOrEmptySchema=n2;function i2(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),zE(t)):r.var(e,!0)}$l.boolOrEmptySchema=i2;function zE(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Xj.reportError)(i,r2,void 0,e)}});var sS=F(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.getRules=Ml.isJSONType=void 0;var s2=["string","number","integer","boolean","null","object","array"],o2=new Set(s2);function a2(t){return typeof t=="string"&&o2.has(t)}Ml.isJSONType=a2;function l2(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Ml.getRules=l2});var oS=F(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.shouldUseRule=Fs.shouldUseGroup=Fs.schemaHasRulesForType=void 0;function c2({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&GE(t,n)}Fs.schemaHasRulesForType=c2;function GE(t,e){return e.rules.some(r=>YE(t,r))}Fs.shouldUseGroup=GE;function YE(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Fs.shouldUseRule=YE});var Gu=F(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.reportTypeError=cr.checkDataTypes=cr.checkDataType=cr.coerceAndCheckDataType=cr.getJSONTypes=cr.getSchemaTypes=cr.DataType=void 0;var u2=sS(),f2=oS(),d2=Ju(),Oe=Ne(),KE=We(),Nl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Nl||(cr.DataType=Nl={}));function p2(t){let e=QE(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}cr.getSchemaTypes=p2;function QE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(u2.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}cr.getJSONTypes=QE;function h2(t,e){let{gen:r,data:n,opts:i}=t,s=m2(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,f2.schemaHasRulesForType)(t,e[0]));if(a){let l=lS(e,n,i.strictNumbers,Nl.Wrong);r.if(l,()=>{s.length?g2(t,e,s):cS(t)})}return a}cr.coerceAndCheckDataType=h2;var ZE=new Set(["string","number","integer","boolean","null"]);function m2(t,e){return e?t.filter(r=>ZE.has(r)||e==="array"&&r==="array"):[]}function g2(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Oe._)`typeof ${i}`),l=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(a,(0,Oe._)`typeof ${i}`).if(lS(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Oe._)`${l} !== undefined`);for(let d of r)(ZE.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),cS(t),n.endIf(),n.if((0,Oe._)`${l} !== undefined`,()=>{n.assign(i,l),y2(t,l)});function f(d){switch(d){case"string":n.elseIf((0,Oe._)`${a} == "number" || ${a} == "boolean"`).assign(l,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(l,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${a} == "boolean" || ${i} === null
23
+ `+new Error().stack),b=!1}return h.apply(this,arguments)},h)}var k={};function N(u,h){e.deprecationHandler!=null&&e.deprecationHandler(u,h),k[u]||(T(h),k[u]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function j(u){return typeof Function<"u"&&u instanceof Function||Object.prototype.toString.call(u)==="[object Function]"}function $(u){var h,b;for(b in u)s(u,b)&&(h=u[b],j(h)?this[b]=h:this["_"+b]=h);this._config=u,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function G(u,h){var b=g({},u),w;for(w in h)s(h,w)&&(i(u[w])&&i(h[w])?(b[w]={},g(b[w],u[w]),g(b[w],h[w])):h[w]!=null?b[w]=h[w]:delete b[w]);for(w in u)s(u,w)&&!s(h,w)&&i(u[w])&&(b[w]=g({},b[w]));return b}function K(u){u!=null&&this.set(u)}var ne;Object.keys?ne=Object.keys:ne=function(u){var h,b=[];for(h in u)s(u,h)&&b.push(h);return b};var pe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function et(u,h,b){var w=this._calendar[u]||this._calendar.sameElse;return j(w)?w.call(h,b):w}function _e(u,h,b){var w=""+Math.abs(u),E=h-w.length,M=u>=0;return(M?b?"+":"":"-")+Math.pow(10,Math.max(0,E)).toString().substr(1)+w}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ce=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vt={},Et={};function ce(u,h,b,w){var E=w;typeof w=="string"&&(E=function(){return this[w]()}),u&&(Et[u]=E),h&&(Et[h[0]]=function(){return _e(E.apply(this,arguments),h[1],h[2])}),b&&(Et[b]=function(){return this.localeData().ordinal(E.apply(this,arguments),u)})}function hr(u){return u.match(/\[[\s\S]/)?u.replace(/^\[|\]$/g,""):u.replace(/\\/g,"")}function ui(u){var h=u.match(he),b,w;for(b=0,w=h.length;b<w;b++)Et[h[b]]?h[b]=Et[h[b]]:h[b]=hr(h[b]);return function(E){var M="",J;for(J=0;J<w;J++)M+=j(h[J])?h[J].call(E,u):h[J];return M}}function Rt(u,h){return u.isValid()?(h=Gr(h,u.localeData()),vt[h]=vt[h]||ui(h),vt[h](u)):u.localeData().invalidDate()}function Gr(u,h){var b=5;function w(E){return h.longDateFormat(E)||E}for(Ce.lastIndex=0;b>=0&&Ce.test(u);)u=u.replace(Ce,w),Ce.lastIndex=0,b-=1;return u}var Ir={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function ht(u){var h=this._longDateFormat[u],b=this._longDateFormat[u.toUpperCase()];return h||!b?h:(this._longDateFormat[u]=b.match(he).map(function(w){return w==="MMMM"||w==="MM"||w==="DD"||w==="dddd"?w.slice(1):w}).join(""),this._longDateFormat[u])}var mt="Invalid date";function ln(){return this._invalidDate}var fo="%d",Jt=/\d{1,2}/;function po(u){return this._ordinal.replace("%d",u)}var oy={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function kn(u,h,b,w){var E=this._relativeTime[b];return j(E)?E(u,h,b,w):E.replace(/%d/i,u)}function Nd(u,h){var b=this._relativeTime[u>0?"future":"past"];return j(b)?b(h):b.replace(/%s/i,h)}var Dd={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Gt(u){return typeof u=="string"?Dd[u]||Dd[u.toLowerCase()]:void 0}function mr(u){var h={},b,w;for(w in u)s(u,w)&&(b=Gt(w),b&&(h[b]=u[w]));return h}var ho={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Da(u){var h=[],b;for(b in u)s(u,b)&&h.push({unit:b,priority:ho[b]});return h.sort(function(w,E){return w.priority-E.priority}),h}var Fd=/\d/,Ut=/\d\d/,Ld=/\d{3}/,ki=/\d{4}/,Tn=/[+-]?\d{6}/,ot=/\d\d?/,Fa=/\d\d\d\d?/,La=/\d\d\d\d\d\d?/,ds=/\d{1,3}/,mo=/\d{1,4}/,ps=/[+-]?\d{1,6}/,fi=/\d+/,hs=/[+-]?\d+/,Hc=/Z|[+-]\d\d:?\d\d/gi,ja=/Z|[+-]\d\d(?::?\d\d)?/gi,ay=/[+-]?\d+(\.\d{1,3})?/,go=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ti=/^[1-9]\d?/,Ua=/^([1-9]\d|\d)/,Ha;Ha={};function le(u,h,b){Ha[u]=j(h)?h:function(w,E){return w&&b?b:h}}function ly(u,h){return s(Ha,u)?Ha[u](h._strict,h._locale):new RegExp(cy(u))}function cy(u){return cn(u.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(h,b,w,E,M){return b||w||E||M}))}function cn(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Pr(u){return u<0?Math.ceil(u)||0:Math.floor(u)}function qe(u){var h=+u,b=0;return h!==0&&isFinite(h)&&(b=Pr(h)),b}var Bc={};function Ke(u,h){var b,w=h,E;for(typeof u=="string"&&(u=[u]),f(h)&&(w=function(M,J){J[h]=qe(M)}),E=u.length,b=0;b<E;b++)Bc[u[b]]=w}function yo(u,h){Ke(u,function(b,w,E,M){E._w=E._w||{},h(b,E._w,E,M)})}function Vc(u,h,b){h!=null&&s(Bc,u)&&Bc[u](h,b._a,b,u)}function Ba(u){return u%4===0&&u%100!==0||u%400===0}var Yt=0,An=1,un=2,At=3,kr=4,qn=5,Ai=6,jd=7,uy=8;ce("Y",0,0,function(){var u=this.year();return u<=9999?_e(u,4):"+"+u}),ce(0,["YY",2],0,function(){return this.year()%100}),ce(0,["YYYY",4],0,"year"),ce(0,["YYYYY",5],0,"year"),ce(0,["YYYYYY",6,!0],0,"year"),le("Y",hs),le("YY",ot,Ut),le("YYYY",mo,ki),le("YYYYY",ps,Tn),le("YYYYYY",ps,Tn),Ke(["YYYYY","YYYYYY"],Yt),Ke("YYYY",function(u,h){h[Yt]=u.length===2?e.parseTwoDigitYear(u):qe(u)}),Ke("YY",function(u,h){h[Yt]=e.parseTwoDigitYear(u)}),Ke("Y",function(u,h){h[Yt]=parseInt(u,10)});function vo(u){return Ba(u)?366:365}e.parseTwoDigitYear=function(u){return qe(u)+(qe(u)>68?1900:2e3)};var Ud=ms("FullYear",!0);function fy(){return Ba(this.year())}function ms(u,h){return function(b){return b!=null?(So(this,u,b),e.updateOffset(this,h),this):bo(this,u)}}function bo(u,h){if(!u.isValid())return NaN;var b=u._d,w=u._isUTC;switch(h){case"Milliseconds":return w?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return w?b.getUTCSeconds():b.getSeconds();case"Minutes":return w?b.getUTCMinutes():b.getMinutes();case"Hours":return w?b.getUTCHours():b.getHours();case"Date":return w?b.getUTCDate():b.getDate();case"Day":return w?b.getUTCDay():b.getDay();case"Month":return w?b.getUTCMonth():b.getMonth();case"FullYear":return w?b.getUTCFullYear():b.getFullYear();default:return NaN}}function So(u,h,b){var w,E,M,J,oe;if(!(!u.isValid()||isNaN(b))){switch(w=u._d,E=u._isUTC,h){case"Milliseconds":return void(E?w.setUTCMilliseconds(b):w.setMilliseconds(b));case"Seconds":return void(E?w.setUTCSeconds(b):w.setSeconds(b));case"Minutes":return void(E?w.setUTCMinutes(b):w.setMinutes(b));case"Hours":return void(E?w.setUTCHours(b):w.setHours(b));case"Date":return void(E?w.setUTCDate(b):w.setDate(b));case"FullYear":break;default:return}M=b,J=u.month(),oe=u.date(),oe=oe===29&&J===1&&!Ba(M)?28:oe,E?w.setUTCFullYear(M,J,oe):w.setFullYear(M,J,oe)}}function dy(u){return u=Gt(u),j(this[u])?this[u]():this}function Va(u,h){if(typeof u=="object"){u=mr(u);var b=Da(u),w,E=b.length;for(w=0;w<E;w++)this[b[w].unit](u[b[w].unit])}else if(u=Gt(u),j(this[u]))return this[u](h);return this}function py(u,h){return(u%h+h)%h}var xt;Array.prototype.indexOf?xt=Array.prototype.indexOf:xt=function(u){var h;for(h=0;h<this.length;++h)if(this[h]===u)return h;return-1};function Wc(u,h){if(isNaN(u)||isNaN(h))return NaN;var b=py(h,12);return u+=(h-b)/12,b===1?Ba(u)?29:28:31-b%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(u){return this.localeData().monthsShort(this,u)}),ce("MMMM",0,0,function(u){return this.localeData().months(this,u)}),le("M",ot,Ti),le("MM",ot,Ut),le("MMM",function(u,h){return h.monthsShortRegex(u)}),le("MMMM",function(u,h){return h.monthsRegex(u)}),Ke(["M","MM"],function(u,h){h[An]=qe(u)-1}),Ke(["MMM","MMMM"],function(u,h,b,w){var E=b._locale.monthsParse(u,w,b._strict);E!=null?h[An]=E:_(b).invalidMonth=u});var Hd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),zc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Jc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,hy=go,my=go;function gy(u,h){return u?n(this._months)?this._months[u.month()]:this._months[(this._months.isFormat||Jc).test(h)?"format":"standalone"][u.month()]:n(this._months)?this._months:this._months.standalone}function yy(u,h){return u?n(this._monthsShort)?this._monthsShort[u.month()]:this._monthsShort[Jc.test(h)?"format":"standalone"][u.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bd(u,h,b){var w,E,M,J=u.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],w=0;w<12;++w)M=y([2e3,w]),this._shortMonthsParse[w]=this.monthsShort(M,"").toLocaleLowerCase(),this._longMonthsParse[w]=this.months(M,"").toLocaleLowerCase();return b?h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null):(E=xt.call(this._longMonthsParse,J),E!==-1?E:null):h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:(E=xt.call(this._longMonthsParse,J),E!==-1?E:null)):(E=xt.call(this._longMonthsParse,J),E!==-1?E:(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null))}function Vd(u,h,b){var w,E,M;if(this._monthsParseExact)return Bd.call(this,u,h,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),w=0;w<12;w++){if(E=y([2e3,w]),b&&!this._longMonthsParse[w]&&(this._longMonthsParse[w]=new RegExp("^"+this.months(E,"").replace(".","")+"$","i"),this._shortMonthsParse[w]=new RegExp("^"+this.monthsShort(E,"").replace(".","")+"$","i")),!b&&!this._monthsParse[w]&&(M="^"+this.months(E,"")+"|^"+this.monthsShort(E,""),this._monthsParse[w]=new RegExp(M.replace(".",""),"i")),b&&h==="MMMM"&&this._longMonthsParse[w].test(u))return w;if(b&&h==="MMM"&&this._shortMonthsParse[w].test(u))return w;if(!b&&this._monthsParse[w].test(u))return w}}function Gc(u,h){if(!u.isValid())return u;if(typeof h=="string"){if(/^\d+$/.test(h))h=qe(h);else if(h=u.localeData().monthsParse(h),!f(h))return u}var b=h,w=u.date();return w=w<29?w:Math.min(w,Wc(u.year(),b)),u._isUTC?u._d.setUTCMonth(b,w):u._d.setMonth(b,w),u}function Wa(u){return u!=null?(Gc(this,u),e.updateOffset(this,!0),this):bo(this,"Month")}function vy(){return Wc(this.year(),this.month())}function Wd(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Yc.call(this),u?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=hy),this._monthsShortStrictRegex&&u?this._monthsShortStrictRegex:this._monthsShortRegex)}function za(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Yc.call(this),u?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=my),this._monthsStrictRegex&&u?this._monthsStrictRegex:this._monthsRegex)}function Yc(){function u(ve,Me){return Me.length-ve.length}var h=[],b=[],w=[],E,M,J,oe;for(E=0;E<12;E++)M=y([2e3,E]),J=cn(this.monthsShort(M,"")),oe=cn(this.months(M,"")),h.push(J),b.push(oe),w.push(oe),w.push(J);h.sort(u),b.sort(u),w.sort(u),this._monthsRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+h.join("|")+")","i")}function by(u,h,b,w,E,M,J){var oe;return u<100&&u>=0?(oe=new Date(u+400,h,b,w,E,M,J),isFinite(oe.getFullYear())&&oe.setFullYear(u)):oe=new Date(u,h,b,w,E,M,J),oe}function gs(u){var h,b;return u<100&&u>=0?(b=Array.prototype.slice.call(arguments),b[0]=u+400,h=new Date(Date.UTC.apply(null,b)),isFinite(h.getUTCFullYear())&&h.setUTCFullYear(u)):h=new Date(Date.UTC.apply(null,arguments)),h}function wo(u,h,b){var w=7+h-b,E=(7+gs(u,0,w).getUTCDay()-h)%7;return-E+w-1}function Ja(u,h,b,w,E){var M=(7+b-w)%7,J=wo(u,w,E),oe=1+7*(h-1)+M+J,ve,Me;return oe<=0?(ve=u-1,Me=vo(ve)+oe):oe>vo(u)?(ve=u+1,Me=oe-vo(u)):(ve=u,Me=oe),{year:ve,dayOfYear:Me}}function _o(u,h,b){var w=wo(u.year(),h,b),E=Math.floor((u.dayOfYear()-w-1)/7)+1,M,J;return E<1?(J=u.year()-1,M=E+fn(J,h,b)):E>fn(u.year(),h,b)?(M=E-fn(u.year(),h,b),J=u.year()+1):(J=u.year(),M=E),{week:M,year:J}}function fn(u,h,b){var w=wo(u,h,b),E=wo(u+1,h,b);return(vo(u)-w+E)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),le("w",ot,Ti),le("ww",ot,Ut),le("W",ot,Ti),le("WW",ot,Ut),yo(["w","ww","W","WW"],function(u,h,b,w){h[w.substr(0,1)]=qe(u)});function Kc(u){return _o(u,this._week.dow,this._week.doy).week}var Qc={dow:0,doy:6};function ys(){return this._week.dow}function zd(){return this._week.doy}function Jd(u){var h=this.localeData().week(this);return u==null?h:this.add((u-h)*7,"d")}function Sy(u){var h=_o(this,1,4).week;return u==null?h:this.add((u-h)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(u){return this.localeData().weekdaysMin(this,u)}),ce("ddd",0,0,function(u){return this.localeData().weekdaysShort(this,u)}),ce("dddd",0,0,function(u){return this.localeData().weekdays(this,u)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),le("d",ot),le("e",ot),le("E",ot),le("dd",function(u,h){return h.weekdaysMinRegex(u)}),le("ddd",function(u,h){return h.weekdaysShortRegex(u)}),le("dddd",function(u,h){return h.weekdaysRegex(u)}),yo(["dd","ddd","dddd"],function(u,h,b,w){var E=b._locale.weekdaysParse(u,w,b._strict);E!=null?h.d=E:_(b).invalidWeekday=u}),yo(["d","e","E"],function(u,h,b,w){h[w]=qe(u)});function Gd(u,h){return typeof u!="string"?u:isNaN(u)?(u=h.weekdaysParse(u),typeof u=="number"?u:null):parseInt(u,10)}function Yd(u,h){return typeof u=="string"?h.weekdaysParse(u)%7||7:isNaN(u)?null:u}function Ga(u,h){return u.slice(h,7).concat(u.slice(0,h))}var Kd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),_y=go,Zd=go,Ry=go;function xy(u,h){var b=n(this._weekdays)?this._weekdays:this._weekdays[u&&u!==!0&&this._weekdays.isFormat.test(h)?"format":"standalone"];return u===!0?Ga(b,this._week.dow):u?b[u.day()]:b}function Cy(u){return u===!0?Ga(this._weekdaysShort,this._week.dow):u?this._weekdaysShort[u.day()]:this._weekdaysShort}function Ey(u){return u===!0?Ga(this._weekdaysMin,this._week.dow):u?this._weekdaysMin[u.day()]:this._weekdaysMin}function Zc(u,h,b){var w,E,M,J=u.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],w=0;w<7;++w)M=y([2e3,1]).day(w),this._minWeekdaysParse[w]=this.weekdaysMin(M,"").toLocaleLowerCase(),this._shortWeekdaysParse[w]=this.weekdaysShort(M,"").toLocaleLowerCase(),this._weekdaysParse[w]=this.weekdays(M,"").toLocaleLowerCase();return b?h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1?E:null):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null):(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null):h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1||(E=xt.call(this._shortWeekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):(E=xt.call(this._minWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null))}function Oy(u,h,b){var w,E,M;if(this._weekdaysParseExact)return Zc.call(this,u,h,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),w=0;w<7;w++){if(E=y([2e3,1]).day(w),b&&!this._fullWeekdaysParse[w]&&(this._fullWeekdaysParse[w]=new RegExp("^"+this.weekdays(E,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[w]=new RegExp("^"+this.weekdaysShort(E,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[w]=new RegExp("^"+this.weekdaysMin(E,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[w]||(M="^"+this.weekdays(E,"")+"|^"+this.weekdaysShort(E,"")+"|^"+this.weekdaysMin(E,""),this._weekdaysParse[w]=new RegExp(M.replace(".",""),"i")),b&&h==="dddd"&&this._fullWeekdaysParse[w].test(u))return w;if(b&&h==="ddd"&&this._shortWeekdaysParse[w].test(u))return w;if(b&&h==="dd"&&this._minWeekdaysParse[w].test(u))return w;if(!b&&this._weekdaysParse[w].test(u))return w}}function Iy(u){if(!this.isValid())return u!=null?this:NaN;var h=bo(this,"Day");return u!=null?(u=Gd(u,this.localeData()),this.add(u-h,"d")):h}function Py(u){if(!this.isValid())return u!=null?this:NaN;var h=(this.day()+7-this.localeData()._week.dow)%7;return u==null?h:this.add(u-h,"d")}function ky(u){if(!this.isValid())return u!=null?this:NaN;if(u!=null){var h=Yd(u,this.localeData());return this.day(this.day()%7?h:h-7)}else return this.day()||7}function Ty(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xc.call(this),u?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=_y),this._weekdaysStrictRegex&&u?this._weekdaysStrictRegex:this._weekdaysRegex)}function ft(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xc.call(this),u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Zd),this._weekdaysShortStrictRegex&&u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function lt(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xc.call(this),u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ry),this._weekdaysMinStrictRegex&&u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xc(){function u(Dt,Ln){return Ln.length-Dt.length}var h=[],b=[],w=[],E=[],M,J,oe,ve,Me;for(M=0;M<7;M++)J=y([2e3,1]).day(M),oe=cn(this.weekdaysMin(J,"")),ve=cn(this.weekdaysShort(J,"")),Me=cn(this.weekdays(J,"")),h.push(oe),b.push(ve),w.push(Me),E.push(oe),E.push(ve),E.push(Me);h.sort(u),b.sort(u),w.sort(u),E.sort(u),this._weekdaysRegex=new RegExp("^("+E.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function eu(){return this.hours()%12||12}function Ay(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,eu),ce("k",["kk",2],0,Ay),ce("hmm",0,0,function(){return""+eu.apply(this)+_e(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+eu.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function Xd(u,h){ce(u,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),h)})}Xd("a",!0),Xd("A",!1);function ep(u,h){return h._meridiemParse}le("a",ep),le("A",ep),le("H",ot,Ua),le("h",ot,Ti),le("k",ot,Ti),le("HH",ot,Ut),le("hh",ot,Ut),le("kk",ot,Ut),le("hmm",Fa),le("hmmss",La),le("Hmm",Fa),le("Hmmss",La),Ke(["H","HH"],At),Ke(["k","kk"],function(u,h,b){var w=qe(u);h[At]=w===24?0:w}),Ke(["a","A"],function(u,h,b){b._isPm=b._locale.isPM(u),b._meridiem=u}),Ke(["h","hh"],function(u,h,b){h[At]=qe(u),_(b).bigHour=!0}),Ke("hmm",function(u,h,b){var w=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w)),_(b).bigHour=!0}),Ke("hmmss",function(u,h,b){var w=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w,2)),h[qn]=qe(u.substr(E)),_(b).bigHour=!0}),Ke("Hmm",function(u,h,b){var w=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w))}),Ke("Hmmss",function(u,h,b){var w=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,w)),h[kr]=qe(u.substr(w,2)),h[qn]=qe(u.substr(E))});function qy(u){return(u+"").toLowerCase().charAt(0)==="p"}var tp=/[ap]\.?m?\.?/i,$y=ms("Hours",!0);function Nt(u,h,b){return u>11?b?"pm":"PM":b?"am":"AM"}var Ya={calendar:pe,longDateFormat:Ir,invalidDate:mt,ordinal:fo,dayOfMonthOrdinalParse:Jt,relativeTime:oy,months:Hd,monthsShort:zc,week:Qc,weekdays:Kd,weekdaysMin:wy,weekdaysShort:Qd,meridiemParse:tp},Qe={},vs={},qi;function Tr(u,h){var b,w=Math.min(u.length,h.length);for(b=0;b<w;b+=1)if(u[b]!==h[b])return b;return w}function tu(u){return u&&u.toLowerCase().replace("_","-")}function rp(u){for(var h=0,b,w,E,M;h<u.length;){for(M=tu(u[h]).split("-"),b=M.length,w=tu(u[h+1]),w=w?w.split("-"):null;b>0;){if(E=Ro(M.slice(0,b).join("-")),E)return E;if(w&&w.length>=b&&Tr(M,w)>=b-1)break;b--}h++}return qi}function np(u){return!!(u&&u.match("^[^/\\\\]*$"))}function Ro(u){var h=null,b;if(Qe[u]===void 0&&typeof Tl<"u"&&Tl&&Tl.exports&&np(u))try{h=qi._abbr,b=it,b("./locale/"+u),$n(h)}catch{Qe[u]=null}return Qe[u]}function $n(u,h){var b;return u&&(l(h)?b=Mn(u):b=Ka(u,h),b?qi=b:typeof console<"u"&&console.warn&&console.warn("Locale "+u+" not found. Did you forget to load it?")),qi._abbr}function Ka(u,h){if(h!==null){var b,w=Ya;if(h.abbr=u,Qe[u]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),w=Qe[u]._config;else if(h.parentLocale!=null)if(Qe[h.parentLocale]!=null)w=Qe[h.parentLocale]._config;else if(b=Ro(h.parentLocale),b!=null)w=b._config;else return vs[h.parentLocale]||(vs[h.parentLocale]=[]),vs[h.parentLocale].push({name:u,config:h}),null;return Qe[u]=new K(G(w,h)),vs[u]&&vs[u].forEach(function(E){Ka(E.name,E.config)}),$n(u),Qe[u]}else return delete Qe[u],null}function gr(u,h){if(h!=null){var b,w,E=Ya;Qe[u]!=null&&Qe[u].parentLocale!=null?Qe[u].set(G(Qe[u]._config,h)):(w=Ro(u),w!=null&&(E=w._config),h=G(E,h),w==null&&(h.abbr=u),b=new K(h),b.parentLocale=Qe[u],Qe[u]=b),$n(u)}else Qe[u]!=null&&(Qe[u].parentLocale!=null?(Qe[u]=Qe[u].parentLocale,u===$n()&&$n(u)):Qe[u]!=null&&delete Qe[u]);return Qe[u]}function Mn(u){var h;if(u&&u._locale&&u._locale._abbr&&(u=u._locale._abbr),!u)return qi;if(!n(u)){if(h=Ro(u),h)return h;u=[u]}return rp(u)}function yr(){return ne(Qe)}function ru(u){var h,b=u._a;return b&&_(u).overflow===-2&&(h=b[An]<0||b[An]>11?An:b[un]<1||b[un]>Wc(b[Yt],b[An])?un:b[At]<0||b[At]>24||b[At]===24&&(b[kr]!==0||b[qn]!==0||b[Ai]!==0)?At:b[kr]<0||b[kr]>59?kr:b[qn]<0||b[qn]>59?qn:b[Ai]<0||b[Ai]>999?Ai:-1,_(u)._overflowDayOfYear&&(h<Yt||h>un)&&(h=un),_(u)._overflowWeeks&&h===-1&&(h=jd),_(u)._overflowWeekday&&h===-1&&(h=uy),_(u).overflow=h),u}var ip=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,di=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Qa=/Z|[+-]\d\d(?::?\d\d)?/,bs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ct=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pi=/^\/?Date\((-?\d+)/i,nu=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,My={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Za(u){var h,b,w=u._i,E=ip.exec(w)||di.exec(w),M,J,oe,ve,Me=bs.length,Dt=ct.length;if(E){for(_(u).iso=!0,h=0,b=Me;h<b;h++)if(bs[h][1].exec(E[1])){J=bs[h][0],M=bs[h][2]!==!1;break}if(J==null){u._isValid=!1;return}if(E[3]){for(h=0,b=Dt;h<b;h++)if(ct[h][1].exec(E[3])){oe=(E[2]||" ")+ct[h][0];break}if(oe==null){u._isValid=!1;return}}if(!M&&oe!=null){u._isValid=!1;return}if(E[4])if(Qa.exec(E[4]))ve="Z";else{u._isValid=!1;return}u._f=J+(oe||"")+(ve||""),el(u)}else u._isValid=!1}function Ny(u,h,b,w,E,M){var J=[Dy(u),zc.indexOf(h),parseInt(b,10),parseInt(w,10),parseInt(E,10)];return M&&J.push(parseInt(M,10)),J}function Dy(u){var h=parseInt(u,10);return h<=49?2e3+h:h<=999?1900+h:h}function Fy(u){return u.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function sp(u,h,b){if(u){var w=Qd.indexOf(u),E=new Date(h[0],h[1],h[2]).getDay();if(w!==E)return _(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Xa(u,h,b){if(u)return My[u];if(h)return 0;var w=parseInt(b,10),E=w%100,M=(w-E)/100;return M*60+E}function $i(u){var h=nu.exec(Fy(u._i)),b;if(h){if(b=Ny(h[4],h[3],h[2],h[5],h[6],h[7]),!sp(h[1],b,u))return;u._a=b,u._tzm=Xa(h[8],h[9],h[10]),u._d=gs.apply(null,u._a),u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),_(u).rfc2822=!0}else u._isValid=!1}function Ly(u){var h=pi.exec(u._i);if(h!==null){u._d=new Date(+h[1]);return}if(Za(u),u._isValid===!1)delete u._isValid;else return;if($i(u),u._isValid===!1)delete u._isValid;else return;u._strict?u._isValid=!1:e.createFromInputFallback(u)}e.createFromInputFallback=x("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(u){u._d=new Date(u._i+(u._useUTC?" UTC":""))});function Mi(u,h,b){return u??h??b}function op(u){var h=new Date(e.now());return u._useUTC?[h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()]:[h.getFullYear(),h.getMonth(),h.getDate()]}function xo(u){var h,b,w=[],E,M,J;if(!u._d){for(E=op(u),u._w&&u._a[un]==null&&u._a[An]==null&&iu(u),u._dayOfYear!=null&&(J=Mi(u._a[Yt],E[Yt]),(u._dayOfYear>vo(J)||u._dayOfYear===0)&&(_(u)._overflowDayOfYear=!0),b=gs(J,0,u._dayOfYear),u._a[An]=b.getUTCMonth(),u._a[un]=b.getUTCDate()),h=0;h<3&&u._a[h]==null;++h)u._a[h]=w[h]=E[h];for(;h<7;h++)u._a[h]=w[h]=u._a[h]==null?h===2?1:0:u._a[h];u._a[At]===24&&u._a[kr]===0&&u._a[qn]===0&&u._a[Ai]===0&&(u._nextDay=!0,u._a[At]=0),u._d=(u._useUTC?gs:by).apply(null,w),M=u._useUTC?u._d.getUTCDay():u._d.getDay(),u._tzm!=null&&u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),u._nextDay&&(u._a[At]=24),u._w&&typeof u._w.d<"u"&&u._w.d!==M&&(_(u).weekdayMismatch=!0)}}function iu(u){var h,b,w,E,M,J,oe,ve,Me;h=u._w,h.GG!=null||h.W!=null||h.E!=null?(M=1,J=4,b=Mi(h.GG,u._a[Yt],_o(tt(),1,4).year),w=Mi(h.W,1),E=Mi(h.E,1),(E<1||E>7)&&(ve=!0)):(M=u._locale._week.dow,J=u._locale._week.doy,Me=_o(tt(),M,J),b=Mi(h.gg,u._a[Yt],Me.year),w=Mi(h.w,Me.week),h.d!=null?(E=h.d,(E<0||E>6)&&(ve=!0)):h.e!=null?(E=h.e+M,(h.e<0||h.e>6)&&(ve=!0)):E=M),w<1||w>fn(b,M,J)?_(u)._overflowWeeks=!0:ve!=null?_(u)._overflowWeekday=!0:(oe=Ja(b,w,E,M,J),u._a[Yt]=oe.year,u._dayOfYear=oe.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function el(u){if(u._f===e.ISO_8601){Za(u);return}if(u._f===e.RFC_2822){$i(u);return}u._a=[],_(u).empty=!0;var h=""+u._i,b,w,E,M,J,oe=h.length,ve=0,Me,Dt;for(E=Gr(u._f,u._locale).match(he)||[],Dt=E.length,b=0;b<Dt;b++)M=E[b],w=(h.match(ly(M,u))||[])[0],w&&(J=h.substr(0,h.indexOf(w)),J.length>0&&_(u).unusedInput.push(J),h=h.slice(h.indexOf(w)+w.length),ve+=w.length),Et[M]?(w?_(u).empty=!1:_(u).unusedTokens.push(M),Vc(M,w,u)):u._strict&&!w&&_(u).unusedTokens.push(M);_(u).charsLeftOver=oe-ve,h.length>0&&_(u).unusedInput.push(h),u._a[At]<=12&&_(u).bigHour===!0&&u._a[At]>0&&(_(u).bigHour=void 0),_(u).parsedDateParts=u._a.slice(0),_(u).meridiem=u._meridiem,u._a[At]=jy(u._locale,u._a[At],u._meridiem),Me=_(u).era,Me!==null&&(u._a[Yt]=u._locale.erasConvertYear(Me,u._a[Yt])),xo(u),ru(u)}function jy(u,h,b){var w;return b==null?h:u.meridiemHour!=null?u.meridiemHour(h,b):(u.isPM!=null&&(w=u.isPM(b),w&&h<12&&(h+=12),!w&&h===12&&(h=0)),h)}function su(u){var h,b,w,E,M,J,oe=!1,ve=u._f.length;if(ve===0){_(u).invalidFormat=!0,u._d=new Date(NaN);return}for(E=0;E<ve;E++)M=0,J=!1,h=V({},u),u._useUTC!=null&&(h._useUTC=u._useUTC),h._f=u._f[E],el(h),P(h)&&(J=!0),M+=_(h).charsLeftOver,M+=_(h).unusedTokens.length*10,_(h).score=M,oe?M<w&&(w=M,b=h):(w==null||M<w||J)&&(w=M,b=h,J&&(oe=!0));g(u,b||h)}function ou(u){if(!u._d){var h=mr(u._i),b=h.day===void 0?h.date:h.day;u._a=m([h.year,h.month,b,h.hour,h.minute,h.second,h.millisecond],function(w){return w&&parseInt(w,10)}),xo(u)}}function Uy(u){var h=new W(ru(au(u)));return h._nextDay&&(h.add(1,"d"),h._nextDay=void 0),h}function au(u){var h=u._i,b=u._f;return u._locale=u._locale||Mn(u._l),h===null||b===void 0&&h===""?A({nullInput:!0}):(typeof h=="string"&&(u._i=h=u._locale.preparse(h)),X(h)?new W(ru(h)):(d(h)?u._d=h:n(b)?su(u):b?el(u):vr(u),P(u)||(u._d=null),u))}function vr(u){var h=u._i;l(h)?u._d=new Date(e.now()):d(h)?u._d=new Date(h.valueOf()):typeof h=="string"?Ly(u):n(h)?(u._a=m(h.slice(0),function(b){return parseInt(b,10)}),xo(u)):i(h)?ou(u):f(h)?u._d=new Date(h):e.createFromInputFallback(u)}function tl(u,h,b,w,E){var M={};return(h===!0||h===!1)&&(w=h,h=void 0),(b===!0||b===!1)&&(w=b,b=void 0),(i(u)&&a(u)||n(u)&&u.length===0)&&(u=void 0),M._isAMomentObject=!0,M._useUTC=M._isUTC=E,M._l=b,M._i=u,M._f=h,M._strict=w,Uy(M)}function tt(u,h,b,w){return tl(u,h,b,w,!1)}var ap=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u<this?this:u:A()}),lp=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u>this?this:u:A()});function cp(u,h){var b,w;if(h.length===1&&n(h[0])&&(h=h[0]),!h.length)return tt();for(b=h[0],w=1;w<h.length;++w)(!h[w].isValid()||h[w][u](b))&&(b=h[w]);return b}function Hy(){var u=[].slice.call(arguments,0);return cp("isBefore",u)}function By(){var u=[].slice.call(arguments,0);return cp("isAfter",u)}var Vy=function(){return Date.now?Date.now():+new Date},Co=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ss(u){var h,b=!1,w,E=Co.length;for(h in u)if(s(u,h)&&!(xt.call(Co,h)!==-1&&(u[h]==null||!isNaN(u[h]))))return!1;for(w=0;w<E;++w)if(u[Co[w]]){if(b)return!1;parseFloat(u[Co[w]])!==qe(u[Co[w]])&&(b=!0)}return!0}function Wy(){return this._isValid}function zy(){return rt(NaN)}function ws(u){var h=mr(u),b=h.year||0,w=h.quarter||0,E=h.month||0,M=h.week||h.isoWeek||0,J=h.day||0,oe=h.hour||0,ve=h.minute||0,Me=h.second||0,Dt=h.millisecond||0;this._isValid=Ss(h),this._milliseconds=+Dt+Me*1e3+ve*6e4+oe*1e3*60*60,this._days=+J+M*7,this._months=+E+w*3+b*12,this._data={},this._locale=Mn(),this._bubble()}function Eo(u){return u instanceof ws}function dn(u){return u<0?Math.round(-1*u)*-1:Math.round(u)}function rl(u,h,b){var w=Math.min(u.length,h.length),E=Math.abs(u.length-h.length),M=0,J;for(J=0;J<w;J++)(b&&u[J]!==h[J]||!b&&qe(u[J])!==qe(h[J]))&&M++;return M+E}function up(u,h){ce(u,0,0,function(){var b=this.utcOffset(),w="+";return b<0&&(b=-b,w="-"),w+_e(~~(b/60),2)+h+_e(~~b%60,2)})}up("Z",":"),up("ZZ",""),le("Z",ja),le("ZZ",ja),Ke(["Z","ZZ"],function(u,h,b){b._useUTC=!0,b._tzm=lu(ja,u)});var Jy=/([\+\-]|\d\d)/gi;function lu(u,h){var b=(h||"").match(u),w,E,M;return b===null?null:(w=b[b.length-1]||[],E=(w+"").match(Jy)||["-",0,0],M=+(E[1]*60)+qe(E[2]),M===0?0:E[0]==="+"?M:-M)}function hi(u,h){var b,w;return h._isUTC?(b=h.clone(),w=(X(u)||d(u)?u.valueOf():tt(u).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+w),e.updateOffset(b,!1),b):tt(u).local()}function br(u){return-Math.round(u._d.getTimezoneOffset())}e.updateOffset=function(){};function fp(u,h,b){var w=this._offset||0,E;if(!this.isValid())return u!=null?this:NaN;if(u!=null){if(typeof u=="string"){if(u=lu(ja,u),u===null)return this}else Math.abs(u)<16&&!b&&(u=u*60);return!this._isUTC&&h&&(E=br(this)),this._offset=u,this._isUTC=!0,E!=null&&this.add(E,"m"),w!==u&&(!h||this._changeInProgress?Oo(this,rt(u-w,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?w:br(this)}function Gy(u,h){return u!=null?(typeof u!="string"&&(u=-u),this.utcOffset(u,h),this):-this.utcOffset()}function Yy(u){return this.utcOffset(0,u)}function Ky(u){return this._isUTC&&(this.utcOffset(0,u),this._isUTC=!1,u&&this.subtract(br(this),"m")),this}function Qy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var u=lu(Hc,this._i);u!=null?this.utcOffset(u):this.utcOffset(0,!0)}return this}function Zy(u){return this.isValid()?(u=u?tt(u).utcOffset():0,(this.utcOffset()-u)%60===0):!1}function mi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function L(){if(!l(this._isDSTShifted))return this._isDSTShifted;var u={},h;return V(u,this),u=au(u),u._a?(h=u._isUTC?y(u._a):tt(u._a),this._isDSTShifted=this.isValid()&&rl(u._a,h.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Y(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ae(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ge=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function rt(u,h){var b=u,w=null,E,M,J;return Eo(u)?b={ms:u._milliseconds,d:u._days,M:u._months}:f(u)||!isNaN(+u)?(b={},h?b[h]=+u:b.milliseconds=+u):(w=be.exec(u))?(E=w[1]==="-"?-1:1,b={y:0,d:qe(w[un])*E,h:qe(w[At])*E,m:qe(w[kr])*E,s:qe(w[qn])*E,ms:qe(dn(w[Ai]*1e3))*E}):(w=Ge.exec(u))?(E=w[1]==="-"?-1:1,b={y:Ue(w[2],E),M:Ue(w[3],E),w:Ue(w[4],E),d:Ue(w[5],E),h:Ue(w[6],E),m:Ue(w[7],E),s:Ue(w[8],E)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(J=Xy(tt(b.from),tt(b.to)),b={},b.ms=J.milliseconds,b.M=J.months),M=new ws(b),Eo(u)&&s(u,"_locale")&&(M._locale=u._locale),Eo(u)&&s(u,"_isValid")&&(M._isValid=u._isValid),M}rt.fn=ws.prototype,rt.invalid=zy;function Ue(u,h){var b=u&&parseFloat(u.replace(",","."));return(isNaN(b)?0:b)*h}function nl(u,h){var b={};return b.months=h.month()-u.month()+(h.year()-u.year())*12,u.clone().add(b.months,"M").isAfter(h)&&--b.months,b.milliseconds=+h-+u.clone().add(b.months,"M"),b}function Xy(u,h){var b;return u.isValid()&&h.isValid()?(h=hi(h,u),u.isBefore(h)?b=nl(u,h):(b=nl(h,u),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function Sr(u,h){return function(b,w){var E,M;return w!==null&&!isNaN(+w)&&(N(h,"moment()."+h+"(period, number) is deprecated. Please use moment()."+h+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),M=b,b=w,w=M),E=rt(b,w),Oo(this,E,u),this}}function Oo(u,h,b,w){var E=h._milliseconds,M=dn(h._days),J=dn(h._months);u.isValid()&&(w=w??!0,J&&Gc(u,bo(u,"Month")+J*b),M&&So(u,"Date",bo(u,"Date")+M*b),E&&u._d.setTime(u._d.valueOf()+E*b),w&&e.updateOffset(u,M||J))}var ev=Sr(1,"add"),_s=Sr(-1,"subtract");function Io(u){return typeof u=="string"||u instanceof String}function il(u){return X(u)||d(u)||Io(u)||f(u)||tv(u)||Ze(u)||u===null||u===void 0}function Ze(u){var h=i(u)&&!a(u),b=!1,w=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],E,M,J=w.length;for(E=0;E<J;E+=1)M=w[E],b=b||s(u,M);return h&&b}function tv(u){var h=n(u),b=!1;return h&&(b=u.filter(function(w){return!f(w)&&Io(u)}).length===0),h&&b}function dp(u){var h=i(u)&&!a(u),b=!1,w=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],E,M;for(E=0;E<w.length;E+=1)M=w[E],b=b||s(u,M);return h&&b}function sl(u,h){var b=u.diff(h,"days",!0);return b<-6?"sameElse":b<-1?"lastWeek":b<0?"lastDay":b<1?"sameDay":b<2?"nextDay":b<7?"nextWeek":"sameElse"}function rv(u,h){arguments.length===1&&(arguments[0]?il(arguments[0])?(u=arguments[0],h=void 0):dp(arguments[0])&&(h=arguments[0],u=void 0):(u=void 0,h=void 0));var b=u||tt(),w=hi(b,this).startOf("day"),E=e.calendarFormat(this,w)||"sameElse",M=h&&(j(h[E])?h[E].call(this,b):h[E]);return this.format(M||this.localeData().calendar(E,this,tt(b)))}function nv(){return new W(this)}function iv(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Gt(h)||"millisecond",h==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(h).valueOf()):!1}function ol(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Gt(h)||"millisecond",h==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(h).valueOf()<b.valueOf()):!1}function gi(u,h,b,w){var E=X(u)?u:tt(u),M=X(h)?h:tt(h);return this.isValid()&&E.isValid()&&M.isValid()?(w=w||"()",(w[0]==="("?this.isAfter(E,b):!this.isBefore(E,b))&&(w[1]===")"?this.isBefore(M,b):!this.isAfter(M,b))):!1}function al(u,h){var b=X(u)?u:tt(u),w;return this.isValid()&&b.isValid()?(h=Gt(h)||"millisecond",h==="millisecond"?this.valueOf()===b.valueOf():(w=b.valueOf(),this.clone().startOf(h).valueOf()<=w&&w<=this.clone().endOf(h).valueOf())):!1}function pp(u,h){return this.isSame(u,h)||this.isAfter(u,h)}function ll(u,h){return this.isSame(u,h)||this.isBefore(u,h)}function hp(u,h,b){var w,E,M;if(!this.isValid())return NaN;if(w=hi(u,this),!w.isValid())return NaN;switch(E=(w.utcOffset()-this.utcOffset())*6e4,h=Gt(h),h){case"year":M=Po(this,w)/12;break;case"month":M=Po(this,w);break;case"quarter":M=Po(this,w)/3;break;case"second":M=(this-w)/1e3;break;case"minute":M=(this-w)/6e4;break;case"hour":M=(this-w)/36e5;break;case"day":M=(this-w-E)/864e5;break;case"week":M=(this-w-E)/6048e5;break;default:M=this-w}return b?M:Pr(M)}function Po(u,h){if(u.date()<h.date())return-Po(h,u);var b=(h.year()-u.year())*12+(h.month()-u.month()),w=u.clone().add(b,"months"),E,M;return h-w<0?(E=u.clone().add(b-1,"months"),M=(h-w)/(w-E)):(E=u.clone().add(b+1,"months"),M=(h-w)/(E-w)),-(b+M)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function cl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function mp(u){if(!this.isValid())return null;var h=u!==!0,b=h?this.clone().utc():this;return b.year()<0||b.year()>9999?Rt(b,h?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?h?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rt(b,"Z")):Rt(b,h?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ko(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var u="moment",h="",b,w,E,M;return this.isLocal()||(u=this.utcOffset()===0?"moment.utc":"moment.parseZone",h="Z"),b="["+u+'("]',w=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",E="-MM-DD[T]HH:mm:ss.SSS",M=h+'[")]',this.format(b+w+E+M)}function Ni(u){u||(u=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var h=Rt(this,u);return this.localeData().postformat(h)}function ul(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({to:this,from:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function sv(u){return this.from(tt(),u)}function ov(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({from:this,to:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function av(u){return this.to(tt(),u)}function To(u){var h;return u===void 0?this._locale._abbr:(h=Mn(u),h!=null&&(this._locale=h),this)}var Ao=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(u){return u===void 0?this.localeData():this.locale(u)});function fl(){return this._locale}var dl=1e3,Di=60*dl,pl=60*Di,gp=(365*400+97)*24*pl;function gt(u,h){return(u%h+h)%h}function Ht(u,h,b){return u<100&&u>=0?new Date(u+400,h,b)-gp:new Date(u,h,b).valueOf()}function yp(u,h,b){return u<100&&u>=0?Date.UTC(u+400,h,b)-gp:Date.UTC(u,h,b)}function lv(u){var h,b;if(u=Gt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?yp:Ht,u){case"year":h=b(this.year(),0,1);break;case"quarter":h=b(this.year(),this.month()-this.month()%3,1);break;case"month":h=b(this.year(),this.month(),1);break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":h=b(this.year(),this.month(),this.date());break;case"hour":h=this._d.valueOf(),h-=gt(h+(this._isUTC?0:this.utcOffset()*Di),pl);break;case"minute":h=this._d.valueOf(),h-=gt(h,Di);break;case"second":h=this._d.valueOf(),h-=gt(h,dl);break}return this._d.setTime(h),e.updateOffset(this,!0),this}function vp(u){var h,b;if(u=Gt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?yp:Ht,u){case"year":h=b(this.year()+1,0,1)-1;break;case"quarter":h=b(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":h=b(this.year(),this.month()+1,1)-1;break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":h=b(this.year(),this.month(),this.date()+1)-1;break;case"hour":h=this._d.valueOf(),h+=pl-gt(h+(this._isUTC?0:this.utcOffset()*Di),pl)-1;break;case"minute":h=this._d.valueOf(),h+=Di-gt(h,Di)-1;break;case"second":h=this._d.valueOf(),h+=dl-gt(h,dl)-1;break}return this._d.setTime(h),e.updateOffset(this,!0),this}function cv(){return this._d.valueOf()-(this._offset||0)*6e4}function cu(){return Math.floor(this.valueOf()/1e3)}function qo(){return new Date(this.valueOf())}function uu(){var u=this;return[u.year(),u.month(),u.date(),u.hour(),u.minute(),u.second(),u.millisecond()]}function Rs(){var u=this;return{years:u.year(),months:u.month(),date:u.date(),hours:u.hours(),minutes:u.minutes(),seconds:u.seconds(),milliseconds:u.milliseconds()}}function $o(){return this.isValid()?this.toISOString():null}function Mo(){return P(this)}function hl(){return g({},_(this))}function xs(){return _(this).overflow}function uv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ce("N",0,0,"eraAbbr"),ce("NN",0,0,"eraAbbr"),ce("NNN",0,0,"eraAbbr"),ce("NNNN",0,0,"eraName"),ce("NNNNN",0,0,"eraNarrow"),ce("y",["y",1],"yo","eraYear"),ce("y",["yy",2],0,"eraYear"),ce("y",["yyy",3],0,"eraYear"),ce("y",["yyyy",4],0,"eraYear"),le("N",ir),le("NN",ir),le("NNN",ir),le("NNNN",$e),le("NNNNN",mv),Ke(["N","NN","NNN","NNNN","NNNNN"],function(u,h,b,w){var E=b._locale.erasParse(u,w,b._strict);E?_(b).era=E:_(b).invalidEra=u}),le("y",fi),le("yy",fi),le("yyy",fi),le("yyyy",fi),le("yo",gv),Ke(["y","yy","yyy","yyyy"],Yt),Ke(["yo"],function(u,h,b,w){var E;b._locale._eraYearOrdinalRegex&&(E=u.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?h[Yt]=b._locale.eraYearOrdinalParse(u,E):h[Yt]=parseInt(u,10)});function fv(u,h){var b,w,E,M=this._eras||Mn("en")._eras;for(b=0,w=M.length;b<w;++b)switch(typeof M[b].since==="string"&&(E=e(M[b].since).startOf("day"),M[b].since=E.valueOf()),typeof M[b].until){case"undefined":M[b].until=1/0;break;case"string":E=e(M[b].until).startOf("day").valueOf(),M[b].until=E.valueOf();break}return M}function dv(u,h,b){var w,E,M=this.eras(),J,oe,ve;for(u=u.toUpperCase(),w=0,E=M.length;w<E;++w)if(J=M[w].name.toUpperCase(),oe=M[w].abbr.toUpperCase(),ve=M[w].narrow.toUpperCase(),b)switch(h){case"N":case"NN":case"NNN":if(oe===u)return M[w];break;case"NNNN":if(J===u)return M[w];break;case"NNNNN":if(ve===u)return M[w];break}else if([J,oe,ve].indexOf(u)>=0)return M[w]}function pv(u,h){var b=u.since<=u.until?1:-1;return h===void 0?e(u.since).year():e(u.since).year()+(h-u.offset)*b}function hv(){var u,h,b,w=this.localeData().eras();for(u=0,h=w.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),w[u].since<=b&&b<=w[u].until||w[u].until<=b&&b<=w[u].since)return w[u].name;return""}function ml(){var u,h,b,w=this.localeData().eras();for(u=0,h=w.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),w[u].since<=b&&b<=w[u].until||w[u].until<=b&&b<=w[u].since)return w[u].narrow;return""}function No(){var u,h,b,w=this.localeData().eras();for(u=0,h=w.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),w[u].since<=b&&b<=w[u].until||w[u].until<=b&&b<=w[u].since)return w[u].abbr;return""}function bp(){var u,h,b,w,E=this.localeData().eras();for(u=0,h=E.length;u<h;++u)if(b=E[u].since<=E[u].until?1:-1,w=this.clone().startOf("day").valueOf(),E[u].since<=w&&w<=E[u].until||E[u].until<=w&&w<=E[u].since)return(this.year()-e(E[u].since).year())*b+E[u].offset;return this.year()}function O(u){return s(this,"_erasNameRegex")||fu.call(this),u?this._erasNameRegex:this._erasRegex}function Cs(u){return s(this,"_erasAbbrRegex")||fu.call(this),u?this._erasAbbrRegex:this._erasRegex}function gl(u){return s(this,"_erasNarrowRegex")||fu.call(this),u?this._erasNarrowRegex:this._erasRegex}function ir(u,h){return h.erasAbbrRegex(u)}function $e(u,h){return h.erasNameRegex(u)}function mv(u,h){return h.erasNarrowRegex(u)}function gv(u,h){return h._eraYearOrdinalRegex||fi}function fu(){var u=[],h=[],b=[],w=[],E,M,J,oe,ve,Me=this.eras();for(E=0,M=Me.length;E<M;++E)J=cn(Me[E].name),oe=cn(Me[E].abbr),ve=cn(Me[E].narrow),h.push(J),u.push(oe),b.push(ve),w.push(J),w.push(oe),w.push(ve);this._erasRegex=new RegExp("^("+w.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+h.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+b.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function pn(u,h){ce(0,[u,u.length],0,h)}pn("gggg","weekYear"),pn("ggggg","weekYear"),pn("GGGG","isoWeekYear"),pn("GGGGG","isoWeekYear"),le("G",hs),le("g",hs),le("GG",ot,Ut),le("gg",ot,Ut),le("GGGG",mo,ki),le("gggg",mo,ki),le("GGGGG",ps,Tn),le("ggggg",ps,Tn),yo(["gggg","ggggg","GGGG","GGGGG"],function(u,h,b,w){h[w.substr(0,2)]=qe(u)}),yo(["gg","GG"],function(u,h,b,w){h[w]=e.parseTwoDigitYear(u)});function yv(u){return Sp.call(this,u,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function vv(u){return Sp.call(this,u,this.isoWeek(),this.isoWeekday(),1,4)}function bv(){return fn(this.year(),1,4)}function Sv(){return fn(this.isoWeekYear(),1,4)}function wv(){var u=this.localeData()._week;return fn(this.year(),u.dow,u.doy)}function Nn(){var u=this.localeData()._week;return fn(this.weekYear(),u.dow,u.doy)}function Sp(u,h,b,w,E){var M;return u==null?_o(this,w,E).year:(M=fn(u,w,E),h>M&&(h=M),_v.call(this,u,h,b,w,E))}function _v(u,h,b,w,E){var M=Ja(u,h,b,w,E),J=gs(M.year,0,M.dayOfYear);return this.year(J.getUTCFullYear()),this.month(J.getUTCMonth()),this.date(J.getUTCDate()),this}ce("Q",0,"Qo","quarter"),le("Q",Fd),Ke("Q",function(u,h){h[An]=(qe(u)-1)*3});function Rv(u){return u==null?Math.ceil((this.month()+1)/3):this.month((u-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),le("D",ot,Ti),le("DD",ot,Ut),le("Do",function(u,h){return u?h._dayOfMonthOrdinalParse||h._ordinalParse:h._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],un),Ke("Do",function(u,h){h[un]=qe(u.match(ot)[0])});var wp=ms("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",ds),le("DDDD",Ld),Ke(["DDD","DDDD"],function(u,h,b){b._dayOfYear=qe(u)});function xv(u){var h=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return u==null?h:this.add(u-h,"d")}ce("m",["mm",2],0,"minute"),le("m",ot,Ua),le("mm",ot,Ut),Ke(["m","mm"],kr);var Dn=ms("Minutes",!1);ce("s",["ss",2],0,"second"),le("s",ot,Ua),le("ss",ot,Ut),Ke(["s","ss"],qn);var Cv=ms("Seconds",!1);ce("S",0,0,function(){return~~(this.millisecond()/100)}),ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ce(0,["SSS",3],0,"millisecond"),ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),le("S",ds,Fd),le("SS",ds,Ut),le("SSS",ds,Ld);var yi,_p;for(yi="SSSS";yi.length<=9;yi+="S")le(yi,fi);function Ev(u,h){h[Ai]=qe(("0."+u)*1e3)}for(yi="S";yi.length<=9;yi+="S")Ke(yi,Ev);_p=ms("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function Ov(){return this._isUTC?"UTC":""}function Fi(){return this._isUTC?"Coordinated Universal Time":""}var te=W.prototype;te.add=ev,te.calendar=rv,te.clone=nv,te.diff=hp,te.endOf=vp,te.format=Ni,te.from=ul,te.fromNow=sv,te.to=ov,te.toNow=av,te.get=dy,te.invalidAt=xs,te.isAfter=iv,te.isBefore=ol,te.isBetween=gi,te.isSame=al,te.isSameOrAfter=pp,te.isSameOrBefore=ll,te.isValid=Mo,te.lang=Ao,te.locale=To,te.localeData=fl,te.max=lp,te.min=ap,te.parsingFlags=hl,te.set=Va,te.startOf=lv,te.subtract=_s,te.toArray=uu,te.toObject=Rs,te.toDate=qo,te.toISOString=mp,te.inspect=ko,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=$o,te.toString=cl,te.unix=cu,te.valueOf=cv,te.creationData=uv,te.eraName=hv,te.eraNarrow=ml,te.eraAbbr=No,te.eraYear=bp,te.year=Ud,te.isLeapYear=fy,te.weekYear=yv,te.isoWeekYear=vv,te.quarter=te.quarters=Rv,te.month=Wa,te.daysInMonth=vy,te.week=te.weeks=Jd,te.isoWeek=te.isoWeeks=Sy,te.weeksInYear=wv,te.weeksInWeekYear=Nn,te.isoWeeksInYear=bv,te.isoWeeksInISOWeekYear=Sv,te.date=wp,te.day=te.days=Iy,te.weekday=Py,te.isoWeekday=ky,te.dayOfYear=xv,te.hour=te.hours=$y,te.minute=te.minutes=Dn,te.second=te.seconds=Cv,te.millisecond=te.milliseconds=_p,te.utcOffset=fp,te.utc=Yy,te.local=Ky,te.parseZone=Qy,te.hasAlignedHourOffset=Zy,te.isDST=mi,te.isLocal=Y,te.isUtcOffset=z,te.isUtc=ae,te.isUTC=ae,te.zoneAbbr=Ov,te.zoneName=Fi,te.dates=x("dates accessor is deprecated. Use date instead.",wp),te.months=x("months accessor is deprecated. Use month instead",Wa),te.years=x("years accessor is deprecated. Use year instead",Ud),te.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Gy),te.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",L);function Iv(u){return tt(u*1e3)}function Yr(){return tt.apply(null,arguments).parseZone()}function Rp(u){return u}var Ve=K.prototype;Ve.calendar=et,Ve.longDateFormat=ht,Ve.invalidDate=ln,Ve.ordinal=po,Ve.preparse=Rp,Ve.postformat=Rp,Ve.relativeTime=kn,Ve.pastFuture=Nd,Ve.set=$,Ve.eras=fv,Ve.erasParse=dv,Ve.erasConvertYear=pv,Ve.erasAbbrRegex=Cs,Ve.erasNameRegex=O,Ve.erasNarrowRegex=gl,Ve.months=gy,Ve.monthsShort=yy,Ve.monthsParse=Vd,Ve.monthsRegex=za,Ve.monthsShortRegex=Wd,Ve.week=Kc,Ve.firstDayOfYear=zd,Ve.firstDayOfWeek=ys,Ve.weekdays=xy,Ve.weekdaysMin=Ey,Ve.weekdaysShort=Cy,Ve.weekdaysParse=Oy,Ve.weekdaysRegex=Ty,Ve.weekdaysShortRegex=ft,Ve.weekdaysMinRegex=lt,Ve.isPM=qy,Ve.meridiem=Nt;function yl(u,h,b,w){var E=Mn(),M=y().set(w,h);return E[b](M,u)}function xp(u,h,b){if(f(u)&&(h=u,u=void 0),u=u||"",h!=null)return yl(u,h,b,"month");var w,E=[];for(w=0;w<12;w++)E[w]=yl(u,w,b,"month");return E}function du(u,h,b,w){typeof u=="boolean"?(f(h)&&(b=h,h=void 0),h=h||""):(h=u,b=h,u=!1,f(h)&&(b=h,h=void 0),h=h||"");var E=Mn(),M=u?E._week.dow:0,J,oe=[];if(b!=null)return yl(h,(b+M)%7,w,"day");for(J=0;J<7;J++)oe[J]=yl(h,(J+M)%7,w,"day");return oe}function Cp(u,h){return xp(u,h,"months")}function Ep(u,h){return xp(u,h,"monthsShort")}function Pv(u,h,b){return du(u,h,b,"weekdays")}function kv(u,h,b){return du(u,h,b,"weekdaysShort")}function pu(u,h,b){return du(u,h,b,"weekdaysMin")}$n("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(u){var h=u%10,b=qe(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th";return u+b}}),e.lang=x("moment.lang is deprecated. Use moment.locale instead.",$n),e.langData=x("moment.langData is deprecated. Use moment.localeData instead.",Mn);var wr=Math.abs;function vl(){var u=this._data;return this._milliseconds=wr(this._milliseconds),this._days=wr(this._days),this._months=wr(this._months),u.milliseconds=wr(u.milliseconds),u.seconds=wr(u.seconds),u.minutes=wr(u.minutes),u.hours=wr(u.hours),u.months=wr(u.months),u.years=wr(u.years),this}function Op(u,h,b,w){var E=rt(h,b);return u._milliseconds+=w*E._milliseconds,u._days+=w*E._days,u._months+=w*E._months,u._bubble()}function Ip(u,h){return Op(this,u,h,1)}function Tv(u,h){return Op(this,u,h,-1)}function Kr(u){return u<0?Math.floor(u):Math.ceil(u)}function hu(){var u=this._milliseconds,h=this._days,b=this._months,w=this._data,E,M,J,oe,ve;return u>=0&&h>=0&&b>=0||u<=0&&h<=0&&b<=0||(u+=Kr(sr(b)+h)*864e5,h=0,b=0),w.milliseconds=u%1e3,E=Pr(u/1e3),w.seconds=E%60,M=Pr(E/60),w.minutes=M%60,J=Pr(M/60),w.hours=J%24,h+=Pr(J/24),ve=Pr(vi(h)),b+=ve,h-=Kr(sr(ve)),oe=Pr(b/12),b%=12,w.days=h,w.months=b,w.years=oe,this}function vi(u){return u*4800/146097}function sr(u){return u*146097/4800}function Av(u){if(!this.isValid())return NaN;var h,b,w=this._milliseconds;if(u=Gt(u),u==="month"||u==="quarter"||u==="year")switch(h=this._days+w/864e5,b=this._months+vi(h),u){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(h=this._days+Math.round(sr(this._months)),u){case"week":return h/7+w/6048e5;case"day":return h+w/864e5;case"hour":return h*24+w/36e5;case"minute":return h*1440+w/6e4;case"second":return h*86400+w/1e3;case"millisecond":return Math.floor(h*864e5)+w;default:throw new Error("Unknown unit "+u)}}function hn(u){return function(){return this.as(u)}}var mu=hn("ms"),Do=hn("s"),bi=hn("m"),Pp=hn("h"),qv=hn("d"),bl=hn("w"),$v=hn("M"),kp=hn("Q"),Bt=hn("y"),gu=mu;function Tp(){return rt(this)}function mn(u){return u=Gt(u),this.isValid()?this[u+"s"]():NaN}function Fn(u){return function(){return this.isValid()?this._data[u]:NaN}}var Sl=Fn("milliseconds"),Li=Fn("seconds"),Ap=Fn("minutes"),Qt=Fn("hours"),yu=Fn("days"),Mv=Fn("months"),Nv=Fn("years");function Dv(){return Pr(this.days()/7)}var Qr=Math.round,Es={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Fo(u,h,b,w,E){return E.relativeTime(h||1,!!b,u,w)}function qp(u,h,b,w){var E=rt(u).abs(),M=Qr(E.as("s")),J=Qr(E.as("m")),oe=Qr(E.as("h")),ve=Qr(E.as("d")),Me=Qr(E.as("M")),Dt=Qr(E.as("w")),Ln=Qr(E.as("y")),jn=M<=b.ss&&["s",M]||M<b.s&&["ss",M]||J<=1&&["m"]||J<b.m&&["mm",J]||oe<=1&&["h"]||oe<b.h&&["hh",oe]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(jn=jn||Dt<=1&&["w"]||Dt<b.w&&["ww",Dt]),jn=jn||Me<=1&&["M"]||Me<b.M&&["MM",Me]||Ln<=1&&["y"]||["yy",Ln],jn[2]=h,jn[3]=+u>0,jn[4]=w,Fo.apply(null,jn)}function Fv(u){return u===void 0?Qr:typeof u=="function"?(Qr=u,!0):!1}function Lv(u,h){return Es[u]===void 0?!1:h===void 0?Es[u]:(Es[u]=h,u==="s"&&(Es.ss=h-1),!0)}function Lo(u,h){if(!this.isValid())return this.localeData().invalidDate();var b=!1,w=Es,E,M;return typeof u=="object"&&(h=u,u=!1),typeof u=="boolean"&&(b=u),typeof h=="object"&&(w=Object.assign({},Es,h),h.s!=null&&h.ss==null&&(w.ss=h.s-1)),E=this.localeData(),M=qp(this,!b,w,E),b&&(M=E.pastFuture(+this,M)),E.postformat(M)}var vu=Math.abs;function Os(u){return(u>0)-(u<0)||+u}function Is(){if(!this.isValid())return this.localeData().invalidDate();var u=vu(this._milliseconds)/1e3,h=vu(this._days),b=vu(this._months),w,E,M,J,oe=this.asSeconds(),ve,Me,Dt,Ln;return oe?(w=Pr(u/60),E=Pr(w/60),u%=60,w%=60,M=Pr(b/12),b%=12,J=u?u.toFixed(3).replace(/\.?0+$/,""):"",ve=oe<0?"-":"",Me=Os(this._months)!==Os(oe)?"-":"",Dt=Os(this._days)!==Os(oe)?"-":"",Ln=Os(this._milliseconds)!==Os(oe)?"-":"",ve+"P"+(M?Me+M+"Y":"")+(b?Me+b+"M":"")+(h?Dt+h+"D":"")+(E||w||u?"T":"")+(E?Ln+E+"H":"")+(w?Ln+w+"M":"")+(u?Ln+J+"S":"")):"P0D"}var Fe=ws.prototype;Fe.isValid=Wy,Fe.abs=vl,Fe.add=Ip,Fe.subtract=Tv,Fe.as=Av,Fe.asMilliseconds=mu,Fe.asSeconds=Do,Fe.asMinutes=bi,Fe.asHours=Pp,Fe.asDays=qv,Fe.asWeeks=bl,Fe.asMonths=$v,Fe.asQuarters=kp,Fe.asYears=Bt,Fe.valueOf=gu,Fe._bubble=hu,Fe.clone=Tp,Fe.get=mn,Fe.milliseconds=Sl,Fe.seconds=Li,Fe.minutes=Ap,Fe.hours=Qt,Fe.days=yu,Fe.weeks=Dv,Fe.months=Mv,Fe.years=Nv,Fe.humanize=Lo,Fe.toISOString=Is,Fe.toString=Is,Fe.toJSON=Is,Fe.locale=To,Fe.localeData=fl,Fe.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Is),Fe.lang=Ao,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),le("x",hs),le("X",ay),Ke("X",function(u,h,b){b._d=new Date(parseFloat(u)*1e3)}),Ke("x",function(u,h,b){b._d=new Date(qe(u))});return e.version="2.30.1",r(tt),e.fn=te,e.min=Hy,e.max=By,e.now=Vy,e.utc=y,e.unix=Iv,e.months=Cp,e.isDate=d,e.locale=$n,e.invalid=A,e.duration=rt,e.isMoment=X,e.weekdays=Pv,e.parseZone=Yr,e.localeData=Mn,e.isDuration=Eo,e.monthsShort=Ep,e.weekdaysMin=pu,e.defineLocale=Ka,e.updateLocale=gr,e.locales=yr,e.weekdaysShort=kv,e.normalizeUnits=Gt,e.relativeTimeRounding=Fv,e.relativeTimeThreshold=Lv,e.calendarFormat=sl,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var AE=F((TE,fh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof fh<"u"&&fh.exports?fh.exports=e():t.tv4=e()})(TE,function(){Object.keys||(Object.keys=(function(){var T=Object.prototype.hasOwnProperty,x=!{toString:null}.propertyIsEnumerable("toString"),k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=k.length;return function(j){if(typeof j!="object"&&typeof j!="function"||j===null)throw new TypeError("Object.keys called on non-object");var $=[];for(var G in j)T.call(j,G)&&$.push(G);if(x)for(var K=0;K<N;K++)T.call(j,k[K])&&$.push(k[K]);return $}})()),Object.create||(Object.create=(function(){function T(){}return function(x){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return T.prototype=x,new T}})()),Array.isArray||(Array.isArray=function(T){return Object.prototype.toString.call(T)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(T){if(this===null)throw new TypeError;var x=Object(this),k=x.length>>>0;if(k===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=k)return-1;for(var j=N>=0?N:Math.max(k-Math.abs(N),0);j<k;j++)if(j in x&&x[j]===T)return j;return-1}),Object.isFrozen||(Object.isFrozen=function(T){for(var x="tv4_test_frozen_key";T.hasOwnProperty(x);)x+=Math.random();try{return T[x]=!0,delete T[x],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(T){return encodeURI(T).replace(/%25[0-9][0-9]/g,function(x){return"%"+x.substring(3)})}function n(T){var x="";t[T.charAt(0)]&&(x=T.charAt(0),T=T.substring(1));var k="",N="",j=!0,$=!1,G=!1;x==="+"?j=!1:x==="."?(N=".",k="."):x==="/"?(N="/",k="/"):x==="#"?(N="#",j=!1):x===";"?(N=";",k=";",$=!0,G=!0):x==="?"?(N="?",k="&",$=!0):x==="&"&&(N="&",k="&",$=!0);for(var K=[],ne=T.split(","),pe=[],et={},_e=0;_e<ne.length;_e++){var he=ne[_e],Ce=null;if(he.indexOf(":")!==-1){var vt=he.split(":");he=vt[0],Ce=parseInt(vt[1],10)}for(var Et={};e[he.charAt(he.length-1)];)Et[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ce={truncate:Ce,name:he,suffices:Et};pe.push(ce),et[he]=ce,K.push(he)}var hr=function(ui){for(var Rt="",Gr=0,Ir=0;Ir<pe.length;Ir++){var ht=pe[Ir],mt=ui(ht.name);if(mt==null||Array.isArray(mt)&&mt.length===0||typeof mt=="object"&&Object.keys(mt).length===0){Gr++;continue}if(Ir===Gr?Rt+=N:Rt+=k||",",Array.isArray(mt)){$&&(Rt+=ht.name+"=");for(var ln=0;ln<mt.length;ln++)ln>0&&(Rt+=ht.suffices["*"]&&k||",",ht.suffices["*"]&&$&&(Rt+=ht.name+"=")),Rt+=j?encodeURIComponent(mt[ln]).replace(/!/g,"%21"):r(mt[ln])}else if(typeof mt=="object"){$&&!ht.suffices["*"]&&(Rt+=ht.name+"=");var fo=!0;for(var Jt in mt)fo||(Rt+=ht.suffices["*"]&&k||","),fo=!1,Rt+=j?encodeURIComponent(Jt).replace(/!/g,"%21"):r(Jt),Rt+=ht.suffices["*"]?"=":",",Rt+=j?encodeURIComponent(mt[Jt]).replace(/!/g,"%21"):r(mt[Jt])}else $&&(Rt+=ht.name,(!G||mt!=="")&&(Rt+="=")),ht.truncate!=null&&(mt=mt.substring(0,ht.truncate)),Rt+=j?encodeURIComponent(mt).replace(/!/g,"%21"):r(mt)}return Rt};return hr.varNames=K,{prefix:N,substitution:hr}}function i(T){if(!(this instanceof i))return new i(T);for(var x=T.split("{"),k=[x.shift()],N=[],j=[],$=[];x.length>0;){var G=x.shift(),K=G.split("}")[0],ne=G.substring(K.length+1),pe=n(K);j.push(pe.substitution),N.push(pe.prefix),k.push(ne),$=$.concat(pe.substitution.varNames)}this.fill=function(et){for(var _e=k[0],he=0;he<j.length;he++){var Ce=j[he];_e+=Ce(et),_e+=k[he+1]}return _e},this.varNames=$,this.template=T}i.prototype={toString:function(){return this.template},fillFromObject:function(T){return this.fill(function(x){return T[x]})}};var s=function(x,k,N,j,$){if(this.missing=[],this.missingMap={},this.formatValidators=x?Object.create(x.formatValidators):{},this.schemas=x?Object.create(x.schemas):{},this.collectMultiple=k,this.errors=[],this.handleError=k?this.collectError:this.returnError,j&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),$&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||S("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},x)for(var G in x.definedKeywords)this.definedKeywords[G]=x.definedKeywords[G].slice(0)};s.prototype.defineKeyword=function(T,x){this.definedKeywords[T]=this.definedKeywords[T]||[],this.definedKeywords[T].push(x)},s.prototype.createError=function(T,x,k,N,j,$,G){var K=new U(T,x,k,N,j);return K.message=this.errorReporter(K,$,G),K},s.prototype.returnError=function(T){return T},s.prototype.collectError=function(T){return T&&this.errors.push(T),null},s.prototype.prefixErrors=function(T,x,k){for(var N=T;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(x,k);return this},s.prototype.banUnknownProperties=function(T,x){for(var k in this.unknownPropertyPaths){var N=this.createError(_.UNKNOWN_PROPERTY,{path:k},k,"",null,T,x),j=this.handleError(N);if(j)return j}return null},s.prototype.addFormat=function(T,x){if(typeof T=="object"){for(var k in T)this.addFormat(k,T[k]);return this}this.formatValidators[T]=x},s.prototype.resolveRefs=function(T,x){if(T.$ref!==void 0){if(x=x||{},x[T.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(x).join(", ")},"","",null,void 0,T);x[T.$ref]=!0,T=this.getSchema(T.$ref,x)}return T},s.prototype.getSchema=function(T,x){var k;if(this.schemas[T]!==void 0)return k=this.schemas[T],this.resolveRefs(k,x);var N=T,j="";if(T.indexOf("#")!==-1&&(j=T.substring(T.indexOf("#")+1),N=T.substring(0,T.indexOf("#"))),typeof this.schemas[N]=="object"){k=this.schemas[N];var $=decodeURIComponent(j);if($==="")return this.resolveRefs(k,x);if($.charAt(0)!=="/")return;for(var G=$.split("/").slice(1),K=0;K<G.length;K++){var ne=G[K].replace(/~1/g,"/").replace(/~0/g,"~");if(k[ne]===void 0){k=void 0;break}k=k[ne]}if(k!==void 0)return this.resolveRefs(k,x)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(T,x){if(Array.isArray(T))for(var k=0;k<T.length;k++)this.searchSchemas(T[k],x);else if(T&&typeof T=="object"){typeof T.id=="string"&&B(x,T.id)&&this.schemas[T.id]===void 0&&(this.schemas[T.id]=T);for(var N in T)if(N!=="enum"){if(typeof T[N]=="object")this.searchSchemas(T[N],x);else if(N==="$ref"){var j=g(T[N]);j&&this.schemas[j]===void 0&&this.missingMap[j]===void 0&&(this.missingMap[j]=j)}}}},s.prototype.addSchema=function(T,x){if(typeof T!="string"||typeof x>"u")if(typeof T=="object"&&typeof T.id=="string")x=T,T=x.id;else return;T===g(T)+"#"&&(T=g(T)),this.schemas[T]=x,delete this.missingMap[T],y(x,T),this.searchSchemas(x,T)},s.prototype.getSchemaMap=function(){var T={};for(var x in this.schemas)T[x]=this.schemas[x];return T},s.prototype.getSchemaUris=function(T){var x=[];for(var k in this.schemas)(!T||T.test(k))&&x.push(k);return x},s.prototype.getMissingUris=function(T){var x=[];for(var k in this.missingMap)(!T||T.test(k))&&x.push(k);return x},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(T,x,k,N,j){var $;if(x=this.resolveRefs(x),x){if(x instanceof U)return this.errors.push(x),x}else return null;var G=this.errors.length,K,ne=null,pe=null;if(this.checkRecursive&&T&&typeof T=="object"){if($=!this.scanned.length,T[this.validatedSchemasKey]){var et=T[this.validatedSchemasKey].indexOf(x);if(et!==-1)return this.errors=this.errors.concat(T[this.validationErrorsKey][et]),null}if(Object.isFrozen(T)&&(K=this.scannedFrozen.indexOf(T),K!==-1)){var _e=this.scannedFrozenSchemas[K].indexOf(x);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[K][_e]),null}if(this.scanned.push(T),Object.isFrozen(T))K===-1&&(K=this.scannedFrozen.length,this.scannedFrozen.push(T),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[K].length,this.scannedFrozenSchemas[K][ne]=x,this.scannedFrozenValidationErrors[K][ne]=[];else{if(!T[this.validatedSchemasKey])try{Object.defineProperty(T,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(T,this.validationErrorsKey,{value:[],configurable:!0})}catch{T[this.validatedSchemasKey]=[],T[this.validationErrorsKey]=[]}pe=T[this.validatedSchemasKey].length,T[this.validatedSchemasKey][pe]=x,T[this.validationErrorsKey][pe]=[]}}var he=this.errors.length,Ce=this.validateBasic(T,x,j)||this.validateNumeric(T,x,j)||this.validateString(T,x,j)||this.validateArray(T,x,j)||this.validateObject(T,x,j)||this.validateCombinations(T,x,j)||this.validateHypermedia(T,x,j)||this.validateFormat(T,x,j)||this.validateDefinedKeywords(T,x,j)||null;if($){for(;this.scanned.length;){var vt=this.scanned.pop();delete vt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ce||he!==this.errors.length)for(;k&&k.length||N&&N.length;){var Et=k&&k.length?""+k.pop():null,ce=N&&N.length?""+N.pop():null;Ce&&(Ce=Ce.prefixWith(Et,ce)),this.prefixErrors(he,Et,ce)}return ne!==null?this.scannedFrozenValidationErrors[K][ne]=this.errors.slice(G):pe!==null&&(T[this.validationErrorsKey][pe]=this.errors.slice(G)),this.handleError(Ce)},s.prototype.validateFormat=function(T,x){if(typeof x.format!="string"||!this.formatValidators[x.format])return null;var k=this.formatValidators[x.format].call(null,T,x);return typeof k=="string"||typeof k=="number"?this.createError(_.FORMAT_CUSTOM,{message:k},"","/format",null,T,x):k&&typeof k=="object"?this.createError(_.FORMAT_CUSTOM,{message:k.message||"?"},k.dataPath||"",k.schemaPath||"/format",null,T,x):null},s.prototype.validateDefinedKeywords=function(T,x,k){for(var N in this.definedKeywords)if(!(typeof x[N]>"u"))for(var j=this.definedKeywords[N],$=0;$<j.length;$++){var G=j[$],K=G(T,x[N],x,k);if(typeof K=="string"||typeof K=="number")return this.createError(_.KEYWORD_CUSTOM,{key:N,message:K},"","",null,T,x).prefixWith(null,N);if(K&&typeof K=="object"){var ne=K.code;if(typeof ne=="string"){if(!_[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=_[ne]}else typeof ne!="number"&&(ne=_.KEYWORD_CUSTOM);var pe=typeof K.message=="object"?K.message:{key:N,message:K.message||"?"},et=K.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,pe,K.dataPath||null,et,null,T,x)}}return null};function a(T,x){if(T===x)return!0;if(T&&x&&typeof T=="object"&&typeof x=="object"){if(Array.isArray(T)!==Array.isArray(x))return!1;if(Array.isArray(T)){if(T.length!==x.length)return!1;for(var k=0;k<T.length;k++)if(!a(T[k],x[k]))return!1}else{var N;for(N in T)if(x[N]===void 0&&T[N]!==void 0)return!1;for(N in x)if(T[N]===void 0&&x[N]!==void 0)return!1;for(N in T)if(!a(T[N],x[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(x,k,N){var j;return(j=this.validateType(x,k,N))||(j=this.validateEnum(x,k,N))?j.prefixWith(null,"type"):null},s.prototype.validateType=function(x,k){if(k.type===void 0)return null;var N=typeof x;x===null?N="null":Array.isArray(x)&&(N="array");var j=k.type;Array.isArray(j)||(j=[j]);for(var $=0;$<j.length;$++){var G=j[$];if(G===N||G==="integer"&&N==="number"&&x%1===0)return null}return this.createError(_.INVALID_TYPE,{type:N,expected:j.join("/")},"","",null,x,k)},s.prototype.validateEnum=function(x,k){if(k.enum===void 0)return null;for(var N=0;N<k.enum.length;N++){var j=k.enum[N];if(a(x,j))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(x):x},"","",null,x,k)},s.prototype.validateNumeric=function(x,k,N){return this.validateMultipleOf(x,k,N)||this.validateMinMax(x,k,N)||this.validateNaN(x,k,N)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(x,k){var N=k.multipleOf||k.divisibleBy;if(N===void 0)return null;if(typeof x=="number"){var j=x/N%1;if(j>=l&&j<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:x,multipleOf:N},"","",null,x,k)}return null},s.prototype.validateMinMax=function(x,k){if(typeof x!="number")return null;if(k.minimum!==void 0){if(x<k.minimum)return this.createError(_.NUMBER_MINIMUM,{value:x,minimum:k.minimum},"","/minimum",null,x,k);if(k.exclusiveMinimum&&x===k.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:x,minimum:k.minimum},"","/exclusiveMinimum",null,x,k)}if(k.maximum!==void 0){if(x>k.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:x,maximum:k.maximum},"","/maximum",null,x,k);if(k.exclusiveMaximum&&x===k.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:x,maximum:k.maximum},"","/exclusiveMaximum",null,x,k)}return null},s.prototype.validateNaN=function(x,k){return typeof x!="number"?null:isNaN(x)===!0||x===1/0||x===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:x},"","/type",null,x,k):null},s.prototype.validateString=function(x,k,N){return this.validateStringLength(x,k,N)||this.validateStringPattern(x,k,N)||null},s.prototype.validateStringLength=function(x,k){return typeof x!="string"?null:k.minLength!==void 0&&x.length<k.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:x.length,minimum:k.minLength},"","/minLength",null,x,k):k.maxLength!==void 0&&x.length>k.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:x.length,maximum:k.maxLength},"","/maxLength",null,x,k):null},s.prototype.validateStringPattern=function(x,k){if(typeof x!="string"||typeof k.pattern!="string"&&!(k.pattern instanceof RegExp))return null;var N;if(k.pattern instanceof RegExp)N=k.pattern;else{var j,$="",G=k.pattern.match(/^\/(.+)\/([img]*)$/);G?(j=G[1],$=G[2]):j=k.pattern,N=new RegExp(j,$)}return N.test(x)?null:this.createError(_.STRING_PATTERN,{pattern:k.pattern},"","/pattern",null,x,k)},s.prototype.validateArray=function(x,k,N){return Array.isArray(x)&&(this.validateArrayLength(x,k,N)||this.validateArrayUniqueItems(x,k,N)||this.validateArrayItems(x,k,N))||null},s.prototype.validateArrayLength=function(x,k){var N;return k.minItems!==void 0&&x.length<k.minItems&&(N=this.createError(_.ARRAY_LENGTH_SHORT,{length:x.length,minimum:k.minItems},"","/minItems",null,x,k),this.handleError(N))||k.maxItems!==void 0&&x.length>k.maxItems&&(N=this.createError(_.ARRAY_LENGTH_LONG,{length:x.length,maximum:k.maxItems},"","/maxItems",null,x,k),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(x,k){if(k.uniqueItems){for(var N=0;N<x.length;N++)for(var j=N+1;j<x.length;j++)if(a(x[N],x[j])){var $=this.createError(_.ARRAY_UNIQUE,{match1:N,match2:j},"","/uniqueItems",null,x,k);if(this.handleError($))return $}}return null},s.prototype.validateArrayItems=function(x,k,N){if(k.items===void 0)return null;var j,$;if(Array.isArray(k.items)){for($=0;$<x.length;$++)if($<k.items.length){if(j=this.validateAll(x[$],k.items[$],[$],["items",$],N+"/"+$))return j}else if(k.additionalItems!==void 0){if(typeof k.additionalItems=="boolean"){if(!k.additionalItems&&(j=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+$,"/additionalItems",null,x,k),this.handleError(j)))return j}else if(j=this.validateAll(x[$],k.additionalItems,[$],["additionalItems"],N+"/"+$))return j}}else for($=0;$<x.length;$++)if(j=this.validateAll(x[$],k.items,[$],["items"],N+"/"+$))return j;return null},s.prototype.validateObject=function(x,k,N){return typeof x!="object"||x===null||Array.isArray(x)?null:this.validateObjectMinMaxProperties(x,k,N)||this.validateObjectRequiredProperties(x,k,N)||this.validateObjectProperties(x,k,N)||this.validateObjectDependencies(x,k,N)||null},s.prototype.validateObjectMinMaxProperties=function(x,k){var N=Object.keys(x),j;return k.minProperties!==void 0&&N.length<k.minProperties&&(j=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:k.minProperties},"","/minProperties",null,x,k),this.handleError(j))||k.maxProperties!==void 0&&N.length>k.maxProperties&&(j=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:k.maxProperties},"","/maxProperties",null,x,k),this.handleError(j))?j:null},s.prototype.validateObjectRequiredProperties=function(x,k){if(k.required!==void 0)for(var N=0;N<k.required.length;N++){var j=k.required[N];if(x[j]===void 0){var $=this.createError(_.OBJECT_REQUIRED,{key:j},"","/required/"+N,null,x,k);if(this.handleError($))return $}}return null},s.prototype.validateObjectProperties=function(x,k,N){var j;for(var $ in x){var G=N+"/"+$.replace(/~/g,"~0").replace(/\//g,"~1"),K=!1;if(k.properties!==void 0&&k.properties[$]!==void 0&&(K=!0,j=this.validateAll(x[$],k.properties[$],[$],["properties",$],G)))return j;if(k.patternProperties!==void 0)for(var ne in k.patternProperties){var pe=new RegExp(ne);if(pe.test($)&&(K=!0,j=this.validateAll(x[$],k.patternProperties[ne],[$],["patternProperties",ne],G)))return j}if(K)this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]);else if(k.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[G]=!0,delete this.unknownPropertyPaths[G]),typeof k.additionalProperties=="boolean"){if(!k.additionalProperties&&(j=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:$},"","/additionalProperties",null,x,k).prefixWith($,null),this.handleError(j)))return j}else if(j=this.validateAll(x[$],k.additionalProperties,[$],["additionalProperties"],G))return j}else this.trackUnknownProperties&&!this.knownPropertyPaths[G]&&(this.unknownPropertyPaths[G]=!0)}return null},s.prototype.validateObjectDependencies=function(x,k,N){var j;if(k.dependencies!==void 0){for(var $ in k.dependencies)if(x[$]!==void 0){var G=k.dependencies[$];if(typeof G=="string"){if(x[G]===void 0&&(j=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:G},"","",null,x,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(Array.isArray(G))for(var K=0;K<G.length;K++){var ne=G[K];if(x[ne]===void 0&&(j=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:$,missing:ne},"","/"+K,null,x,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(j=this.validateAll(x,G,[],["dependencies",$],N))return j}}return null},s.prototype.validateCombinations=function(x,k,N){return this.validateAllOf(x,k,N)||this.validateAnyOf(x,k,N)||this.validateOneOf(x,k,N)||this.validateNot(x,k,N)||null},s.prototype.validateAllOf=function(x,k,N){if(k.allOf===void 0)return null;for(var j,$=0;$<k.allOf.length;$++){var G=k.allOf[$];if(j=this.validateAll(x,G,[],["allOf",$],N))return j}return null},s.prototype.validateAnyOf=function(x,k,N){if(k.anyOf===void 0)return null;var j=[],$=this.errors.length,G,K;this.trackUnknownProperties&&(G=this.unknownPropertyPaths,K=this.knownPropertyPaths);for(var ne=!0,pe=0;pe<k.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.anyOf[pe],_e=this.errors.length,he=this.validateAll(x,et,[],["anyOf",pe],N);if(he===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,$),this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)K[Ce]=!0,delete G[Ce];for(var vt in this.unknownPropertyPaths)K[vt]||(G[vt]=!0);ne=!1;continue}return null}he&&j.push(he.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=G,this.knownPropertyPaths=K),ne)return j=j.concat(this.errors.slice($)),this.errors=this.errors.slice(0,$),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",j,x,k)},s.prototype.validateOneOf=function(x,k,N){if(k.oneOf===void 0)return null;var j=null,$=[],G=this.errors.length,K,ne;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var pe=0;pe<k.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.oneOf[pe],_e=this.errors.length,he=this.validateAll(x,et,[],["oneOf",pe],N);if(he===null&&_e===this.errors.length){if(j===null)j=pe;else return this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MULTIPLE,{index1:j,index2:pe},"","/oneOf",null,x,k);if(this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)ne[Ce]=!0,delete K[Ce];for(var vt in this.unknownPropertyPaths)ne[vt]||(K[vt]=!0)}}else he&&$.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ne),j===null?($=$.concat(this.errors.slice(G)),this.errors=this.errors.slice(0,G),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",$,x,k)):(this.errors=this.errors.slice(0,G),null)},s.prototype.validateNot=function(x,k,N){if(k.not===void 0)return null;var j=this.errors.length,$,G;this.trackUnknownProperties&&($=this.unknownPropertyPaths,G=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var K=this.validateAll(x,k.not,null,null,N),ne=this.errors.slice(j);return this.errors=this.errors.slice(0,j),this.trackUnknownProperties&&(this.unknownPropertyPaths=$,this.knownPropertyPaths=G),K===null&&ne.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,x,k):null},s.prototype.validateHypermedia=function(x,k,N){if(!k.links)return null;for(var j,$=0;$<k.links.length;$++){var G=k.links[$];if(G.rel==="describedby"){for(var K=new i(G.href),ne=!0,pe=0;pe<K.varNames.length;pe++)if(!(K.varNames[pe]in x)){ne=!1;break}if(ne){var et=K.fillFromObject(x),_e={$ref:et};if(j=this.validateAll(x,_e,[],["links",$],N))return j}}}};function d(T){var x=String(T).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return x?{href:x[0]||"",protocol:x[1]||"",authority:x[2]||"",host:x[3]||"",hostname:x[4]||"",port:x[5]||"",pathname:x[6]||"",search:x[7]||"",hash:x[8]||""}:null}function m(T,x){function k(N){var j=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function($){$==="/.."?j.pop():j.push($)}),j.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return x=d(x||""),T=d(T||""),!x||!T?null:(x.protocol||T.protocol)+(x.protocol||x.authority?x.authority:T.authority)+k(x.protocol||x.authority||x.pathname.charAt(0)==="/"?x.pathname:x.pathname?(T.authority&&!T.pathname?"/":"")+T.pathname.slice(0,T.pathname.lastIndexOf("/")+1)+x.pathname:T.pathname)+(x.protocol||x.authority||x.pathname?x.search:x.search||T.search)+x.hash}function g(T){return T.split("#")[0]}function y(T,x){if(T&&typeof T=="object")if(x===void 0?x=T.id:typeof T.id=="string"&&(x=m(x,T.id),T.id=x),Array.isArray(T))for(var k=0;k<T.length;k++)y(T[k],x);else{typeof T.$ref=="string"&&(T.$ref=m(x,T.$ref));for(var N in T)N!=="enum"&&y(T[N],x)}}function S(T){T=T||"en";var x=V[T];return function(k){var N=x[k.code]||A[k.code];if(typeof N!="string")return"Unknown error code "+k.code+": "+JSON.stringify(k.messageParams);var j=k.params;return N.replace(/\{([^{}]*)\}/g,function($,G){var K=j[G];return typeof K=="string"||typeof K=="number"?K:$})}}var _={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},R={};for(var P in _)R[_[P]]=P;var A={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function U(T,x,k,N,j){if(Error.call(this),T===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=x,this.code=T,this.dataPath=k||"",this.schemaPath=N||"",this.subErrors=j||null;var $=new Error(this.message);if(this.stack=$.stack||$.stacktrace,!this.stack)try{throw $}catch(G){this.stack=G.stack||G.stacktrace}}U.prototype=Object.create(Error.prototype),U.prototype.constructor=U,U.prototype.name="ValidationError",U.prototype.prefixWith=function(T,x){if(T!==null&&(T=T.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+T+this.dataPath),x!==null&&(x=x.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+x+this.schemaPath),this.subErrors!==null)for(var k=0;k<this.subErrors.length;k++)this.subErrors[k].prefixWith(T,x);return this};function B(T,x){if(x.substring(0,T.length)===T){var k=x.substring(T.length);if(x.length>0&&x.charAt(T.length-1)==="/"||k.charAt(0)==="#"||k.charAt(0)==="?")return!0}return!1}var V={};function W(T){var x=new s,k,N,j={setErrorReporter:function($){return typeof $=="string"?this.language($):(N=$,!0)},addFormat:function(){x.addFormat.apply(x,arguments)},language:function($){return $?(V[$]||($=$.split("-")[0]),V[$]?(k=$,$):!1):k},addLanguage:function($,G){var K;for(K in _)G[K]&&!G[_[K]]&&(G[_[K]]=G[K]);var ne=$.split("-")[0];if(!V[ne])V[$]=G,V[ne]=G;else{V[$]=Object.create(V[ne]);for(K in G)typeof V[ne][K]>"u"&&(V[ne][K]=G[K]),V[$][K]=G[K]}return this},freshApi:function($){var G=W();return $&&G.language($),G},validate:function($,G,K,ne){var pe=S(k),et=N?function(Ce,vt,Et){return N(Ce,vt,Et)||pe(Ce,vt,Et)}:pe,_e=new s(x,!1,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G);var he=_e.validateAll($,G,null,null,"");return!he&&ne&&(he=_e.banUnknownProperties($,G)),this.error=he,this.missing=_e.missing,this.valid=he===null,this.valid},validateResult:function(){var $={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply($,arguments),$},validateMultiple:function($,G,K,ne){var pe=S(k),et=N?function(Ce,vt,Et){return N(Ce,vt,Et)||pe(Ce,vt,Et)}:pe,_e=new s(x,!0,et,K,ne);typeof G=="string"&&(G={$ref:G}),_e.addSchema("",G),_e.validateAll($,G,null,null,""),ne&&_e.banUnknownProperties($,G);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=_e.errors,he.missing=_e.missing,he.valid=he.errors.length===0,he},addSchema:function(){return x.addSchema.apply(x,arguments)},getSchema:function(){return x.getSchema.apply(x,arguments)},getSchemaMap:function(){return x.getSchemaMap.apply(x,arguments)},getSchemaUris:function(){return x.getSchemaUris.apply(x,arguments)},getMissingUris:function(){return x.getMissingUris.apply(x,arguments)},dropSchemas:function(){x.dropSchemas.apply(x,arguments)},defineKeyword:function(){x.defineKeyword.apply(x,arguments)},defineError:function($,G,K){if(typeof $!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test($))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof G!="number"||G%1!==0||G<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[$]<"u")throw new Error("Error already defined: "+$+" as "+_[$]);if(typeof R[G]<"u")throw new Error("Error code already used: "+R[G]+" as "+G);_[$]=G,R[G]=$,A[$]=A[G]=K;for(var ne in V){var pe=V[ne];pe[$]&&(pe[G]=pe[G]||pe[$])}},reset:function(){x.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:m,getDocumentUri:g,errorCodes:_};return j.language(T||"en"),j}var X=W();return X.addLanguage("en-gb",A),X.tv4=X,X})});var Uu=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.regexpCode=Ye.getEsmExportName=Ye.getProperty=Ye.safeStringify=Ye.stringify=Ye.strConcat=Ye.addCodeArg=Ye.str=Ye._=Ye.nil=Ye._Code=Ye.Name=Ye.IDENTIFIER=Ye._CodeOrName=void 0;var Lu=class{};Ye._CodeOrName=Lu;Ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Zo=class extends Lu{constructor(e){if(super(),!Ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ye.Name=Zo;var wn=class extends Lu{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Zo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ye._Code=wn;Ye.nil=new wn("");function qE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Lb(r,e[n]),r.push(t[++n]);return new wn(r)}Ye._=qE;var Fb=new wn("+");function $E(t,...e){let r=[ju(t[0])],n=0;for(;n<e.length;)r.push(Fb),Lb(r,e[n]),r.push(Fb,ju(t[++n]));return wj(r),new wn(r)}Ye.str=$E;function Lb(t,e){e instanceof wn?t.push(...e._items):e instanceof Zo?t.push(e):t.push(xj(e))}Ye.addCodeArg=Lb;function wj(t){let e=1;for(;e<t.length-1;){if(t[e]===Fb){let r=_j(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function _j(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Zo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Zo))return`"${t}${e.slice(1)}`}function Rj(t,e){return e.emptyStr()?t:t.emptyStr()?e:$E`${t}${e}`}Ye.strConcat=Rj;function xj(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ju(Array.isArray(t)?t.join(","):t)}function Cj(t){return new wn(ju(t))}Ye.stringify=Cj;function ju(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ye.safeStringify=ju;function Ej(t){return typeof t=="string"&&Ye.IDENTIFIER.test(t)?new wn(`.${t}`):qE`[${t}]`}Ye.getProperty=Ej;function Oj(t){if(typeof t=="string"&&Ye.IDENTIFIER.test(t))return new wn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ye.getEsmExportName=Oj;function Ij(t){return new wn(t.toString())}Ye.regexpCode=Ij});var Hb=F(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.ValueScope=Dr.ValueScopeName=Dr.Scope=Dr.varKinds=Dr.UsedValueState=void 0;var Nr=Uu(),jb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},dh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(dh||(Dr.UsedValueState=dh={}));Dr.varKinds={const:new Nr.Name("const"),let:new Nr.Name("let"),var:new Nr.Name("var")};var ph=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Nr.Name?e:this.name(e)}name(e){return new Nr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Dr.Scope=ph;var hh=class extends Nr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Nr._)`.${new Nr.Name(r)}[${n}]`}};Dr.ValueScopeName=hh;var Pj=(0,Nr._)`\n`,Ub=class extends ph{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Pj:Nr.nil}}get(){return this._scope}name(e){return new hh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let m=l.get(a);if(m)return m}else l=this._values[s]=new Map;l.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),d=f.length;return f[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Nr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Nr.nil;for(let a in e){let l=e[a];if(!l)continue;let f=n[a]=n[a]||new Map;l.forEach(d=>{if(f.has(d))return;f.set(d,dh.Started);let m=r(d);if(m){let g=this.opts.es5?Dr.varKinds.var:Dr.varKinds.const;s=(0,Nr._)`${s}${g} ${d} = ${m};${this.opts._n}`}else if(m=i?.(d))s=(0,Nr._)`${s}${m}${this.opts._n}`;else throw new jb(d);f.set(d,dh.Completed)})}return s}};Dr.ValueScope=Ub});var Ne=F(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.or=Ae.and=Ae.not=Ae.CodeGen=Ae.operators=Ae.varKinds=Ae.ValueScopeName=Ae.ValueScope=Ae.Scope=Ae.Name=Ae.regexpCode=Ae.stringify=Ae.getProperty=Ae.nil=Ae.strConcat=Ae.str=Ae._=void 0;var Be=Uu(),zn=Hb(),Ds=Uu();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return Ds._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return Ds.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return Ds.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return Ds.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return Ds.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return Ds.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return Ds.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return Ds.Name}});var vh=Hb();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return vh.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return vh.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return vh.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return vh.varKinds}});Ae.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Ki=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Bb=class extends Ki{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?zn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=ql(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},mh=class extends Ki{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=ql(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return yh(e,this.rhs)}},Vb=class extends mh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Wb=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},zb=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Jb=class extends Ki{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Gb=class extends Ki{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=ql(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Hu=class extends Ki{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(kj(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ta(e,r.names),{})}},Qi=class extends Hu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Yb=class extends Hu{},Al=class extends Qi{};Al.kind="else";var Xo=class t extends Qi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Al(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(ME(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=ql(this.condition,e,r),this}get names(){let e=super.names;return yh(e,this.condition),this.else&&ta(e,this.else.names),e}};Xo.kind="if";var ea=class extends Qi{};ea.kind="for";var Kb=class extends ea{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=ql(this.iteration,e,r),this}get names(){return ta(super.names,this.iteration.names)}},Qb=class extends ea{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?zn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=yh(super.names,this.from);return yh(e,this.to)}},gh=class extends ea{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=ql(this.iterable,e,r),this}get names(){return ta(super.names,this.iterable.names)}},Bu=class extends Qi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Bu.kind="func";var Vu=class extends Hu{render(e){return"return "+super.render(e)}};Vu.kind="return";var Zb=class extends Qi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&ta(e,this.catch.names),this.finally&&ta(e,this.finally.names),e}},Wu=class extends Qi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Wu.kind="catch";var zu=class extends Qi{render(e){return"finally"+super.render(e)}};zu.kind="finally";var Xb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
24
+ `:""},this._extScope=e,this._scope=new zn.Scope({parent:e}),this._nodes=[new Yb]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new Bb(e,s,n)),s}const(e,r,n){return this._def(zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new mh(e,r,n))}add(e,r){return this._leafNode(new Vb(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Gb(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Be.addCodeArg)(r,i));return r.push("}"),new Be._Code(r)}if(e,r,n){if(this._blockNode(new Xo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Xo(e))}else(){return this._elseNode(new Al)}endIf(){return this._endBlockNode(Xo,Al)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Kb(e),r)}forRange(e,r,n,i,s=this.opts.es5?zn.varKinds.var:zn.varKinds.let){let a=this._scope.toName(e);return this._for(new Qb(s,a,r,n),()=>i(a))}forOf(e,r,n,i=zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Be.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Be._)`${a}.length`,l=>{this.var(s,(0,Be._)`${a}[${l}]`),n(s)})}return this._for(new gh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?zn.varKinds.var:zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new gh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ea)}label(e){return this._leafNode(new Wb(e))}break(e){return this._leafNode(new zb(e))}return(e){let r=new Vu;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Vu)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Zb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Wu(s),r(s)}return n&&(this._currNode=i.finally=new zu,this.code(n)),this._endBlockNode(Wu,zu)}throw(e){return this._leafNode(new Jb(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Be.nil,n,i){return this._blockNode(new Bu(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Bu)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Xo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ae.CodeGen=Xb;function ta(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function yh(t,e){return e instanceof Be._CodeOrName?ta(t,e.names):t}function ql(t,e,r){if(t instanceof Be.Name)return n(t);if(!i(t))return t;return new Be._Code(t._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function kj(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function ME(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${eS(t)}`}Ae.not=ME;var Tj=NE(Ae.operators.AND);function Aj(...t){return t.reduce(Tj)}Ae.and=Aj;var qj=NE(Ae.operators.OR);function $j(...t){return t.reduce(qj)}Ae.or=$j;function NE(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${eS(e)} ${t} ${eS(r)}`}function eS(t){return t instanceof Be.Name?t:(0,Be._)`(${t})`}});var We=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var pt=Ne(),Mj=Uu();function Nj(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=Nj;function Dj(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(LE(t,e),!jE(e,t.self.RULES.all))}De.alwaysValidSchema=Dj;function LE(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||BE(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=LE;function jE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=jE;function Fj(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}De.schemaHasRulesButRef=Fj;function Lj({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pt._)`${r}`}return(0,pt._)`${t}${e}${(0,pt.getProperty)(n)}`}De.schemaRefOrVal=Lj;function jj(t){return UE(decodeURIComponent(t))}De.unescapeFragment=jj;function Uj(t){return encodeURIComponent(rS(t))}De.escapeFragment=Uj;function rS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=rS;function UE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=UE;function Hj(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=Hj;function DE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,l)=>{let f=a===void 0?s:a instanceof pt.Name?(s instanceof pt.Name?t(i,s,a):e(i,s,a),a):s instanceof pt.Name?(e(i,a,s),s):r(s,a);return l===pt.Name&&!(f instanceof pt.Name)?n(i,f):f}}De.mergeEvaluated={props:DE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,pt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,pt._)`${r} || {}`).code((0,pt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,pt._)`${r} || {}`),nS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:HE}),items:DE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,pt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,pt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function HE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,pt._)`{}`);return e!==void 0&&nS(t,r,e),r}De.evaluatedPropsToName=HE;function nS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,pt._)`${e}${(0,pt.getProperty)(n)}`,!0))}De.setEvaluated=nS;var FE={};function Bj(t,e){return t.scopeValue("func",{ref:e,code:FE[e.code]||(FE[e.code]=new Mj._Code(e.code))})}De.useFunc=Bj;var tS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(tS||(De.Type=tS={}));function Vj(t,e,r){if(t instanceof pt.Name){let n=e===tS.Num;return r?n?(0,pt._)`"[" + ${t} + "]"`:(0,pt._)`"['" + ${t} + "']"`:n?(0,pt._)`"/" + ${t}`:(0,pt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,pt.getProperty)(t).toString():"/"+rS(t)}De.getErrorPath=Vj;function BE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}De.checkStrictMode=BE});var Zi=F(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var ar=Ne(),Wj={data:new ar.Name("data"),valCxt:new ar.Name("valCxt"),instancePath:new ar.Name("instancePath"),parentData:new ar.Name("parentData"),parentDataProperty:new ar.Name("parentDataProperty"),rootData:new ar.Name("rootData"),dynamicAnchors:new ar.Name("dynamicAnchors"),vErrors:new ar.Name("vErrors"),errors:new ar.Name("errors"),this:new ar.Name("this"),self:new ar.Name("self"),scope:new ar.Name("scope"),json:new ar.Name("json"),jsonPos:new ar.Name("jsonPos"),jsonLen:new ar.Name("jsonLen"),jsonPart:new ar.Name("jsonPart")};iS.default=Wj});var Ju=F(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.extendErrors=lr.resetErrorsCount=lr.reportExtraError=lr.reportError=lr.keyword$DataError=lr.keywordError=void 0;var ze=Ne(),bh=We(),Cr=Zi();lr.keywordError={message:({keyword:t})=>(0,ze.str)`must pass "${t}" keyword validation`};lr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ze.str)`"${t}" keyword must be ${e} ($data)`:(0,ze.str)`"${t}" keyword is invalid ($data)`};function zj(t,e=lr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:l}=i,f=zE(t,e,r);n??(a||l)?VE(s,f):WE(i,(0,ze._)`[${f}]`)}lr.reportError=zj;function Jj(t,e=lr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,l=zE(t,e,r);VE(i,l),s||a||WE(n,Cr.default.vErrors)}lr.reportExtraError=Jj;function Gj(t,e){t.assign(Cr.default.errors,e),t.if((0,ze._)`${Cr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ze._)`${Cr.default.vErrors}.length`,e),()=>t.assign(Cr.default.vErrors,null)))}lr.resetErrorsCount=Gj;function Yj({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,Cr.default.errors,l=>{t.const(a,(0,ze._)`${Cr.default.vErrors}[${l}]`),t.if((0,ze._)`${a}.instancePath === undefined`,()=>t.assign((0,ze._)`${a}.instancePath`,(0,ze.strConcat)(Cr.default.instancePath,s.errorPath))),t.assign((0,ze._)`${a}.schemaPath`,(0,ze.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,ze._)`${a}.schema`,r),t.assign((0,ze._)`${a}.data`,n))})}lr.extendErrors=Yj;function VE(t,e){let r=t.const("err",e);t.if((0,ze._)`${Cr.default.vErrors} === null`,()=>t.assign(Cr.default.vErrors,(0,ze._)`[${r}]`),(0,ze._)`${Cr.default.vErrors}.push(${r})`),t.code((0,ze._)`${Cr.default.errors}++`)}function WE(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ze._)`new ${t.ValidationError}(${e})`):(r.assign((0,ze._)`${n}.errors`,e),r.return(!1))}var ra={keyword:new ze.Name("keyword"),schemaPath:new ze.Name("schemaPath"),params:new ze.Name("params"),propertyName:new ze.Name("propertyName"),message:new ze.Name("message"),schema:new ze.Name("schema"),parentSchema:new ze.Name("parentSchema")};function zE(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ze._)`{}`:Kj(t,e,r)}function Kj(t,e,r={}){let{gen:n,it:i}=t,s=[Qj(i,r),Zj(t,r)];return Xj(t,e,s),n.object(...s)}function Qj({errorPath:t},{instancePath:e}){let r=e?(0,ze.str)`${t}${(0,bh.getErrorPath)(e,bh.Type.Str)}`:t;return[Cr.default.instancePath,(0,ze.strConcat)(Cr.default.instancePath,r)]}function Zj({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ze.str)`${e}/${t}`;return r&&(i=(0,ze.str)`${i}${(0,bh.getErrorPath)(r,bh.Type.Str)}`),[ra.schemaPath,i]}function Xj(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:l}=t,{opts:f,propertyName:d,topSchemaRef:m,schemaPath:g}=l;n.push([ra.keyword,i],[ra.params,typeof e=="function"?e(t):e||(0,ze._)`{}`]),f.messages&&n.push([ra.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([ra.schema,a],[ra.parentSchema,(0,ze._)`${m}${g}`],[Cr.default.data,s]),d&&n.push([ra.propertyName,d])}});var GE=F($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.boolOrEmptySchema=$l.topBoolOrEmptySchema=void 0;var e2=Ju(),t2=Ne(),r2=Zi(),n2={message:"boolean schema is false"};function i2(t){let{gen:e,schema:r,validateName:n}=t;r===!1?JE(t,!1):typeof r=="object"&&r.$async===!0?e.return(r2.default.data):(e.assign((0,t2._)`${n}.errors`,null),e.return(!0))}$l.topBoolOrEmptySchema=i2;function s2(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),JE(t)):r.var(e,!0)}$l.boolOrEmptySchema=s2;function JE(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,e2.reportError)(i,n2,void 0,e)}});var sS=F(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.getRules=Ml.isJSONType=void 0;var o2=["string","number","integer","boolean","null","object","array"],a2=new Set(o2);function l2(t){return typeof t=="string"&&a2.has(t)}Ml.isJSONType=l2;function c2(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Ml.getRules=c2});var oS=F(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.shouldUseRule=Fs.shouldUseGroup=Fs.schemaHasRulesForType=void 0;function u2({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&YE(t,n)}Fs.schemaHasRulesForType=u2;function YE(t,e){return e.rules.some(r=>KE(t,r))}Fs.shouldUseGroup=YE;function KE(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Fs.shouldUseRule=KE});var Gu=F(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.reportTypeError=cr.checkDataTypes=cr.checkDataType=cr.coerceAndCheckDataType=cr.getJSONTypes=cr.getSchemaTypes=cr.DataType=void 0;var f2=sS(),d2=oS(),p2=Ju(),Oe=Ne(),QE=We(),Nl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Nl||(cr.DataType=Nl={}));function h2(t){let e=ZE(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}cr.getSchemaTypes=h2;function ZE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(f2.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}cr.getJSONTypes=ZE;function m2(t,e){let{gen:r,data:n,opts:i}=t,s=g2(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,d2.schemaHasRulesForType)(t,e[0]));if(a){let l=lS(e,n,i.strictNumbers,Nl.Wrong);r.if(l,()=>{s.length?y2(t,e,s):cS(t)})}return a}cr.coerceAndCheckDataType=m2;var XE=new Set(["string","number","integer","boolean","null"]);function g2(t,e){return e?t.filter(r=>XE.has(r)||e==="array"&&r==="array"):[]}function y2(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Oe._)`typeof ${i}`),l=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(a,(0,Oe._)`typeof ${i}`).if(lS(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Oe._)`${l} !== undefined`);for(let d of r)(XE.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),cS(t),n.endIf(),n.if((0,Oe._)`${l} !== undefined`,()=>{n.assign(i,l),v2(t,l)});function f(d){switch(d){case"string":n.elseIf((0,Oe._)`${a} == "number" || ${a} == "boolean"`).assign(l,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(l,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${a} == "boolean" || ${i} === null
25
25
  || (${a} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,Oe._)`+${i}`);return;case"integer":n.elseIf((0,Oe._)`${a} === "boolean" || ${i} === null
26
26
  || (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,Oe._)`+${i}`);return;case"boolean":n.elseIf((0,Oe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,Oe._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,Oe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,Oe._)`${a} === "string" || ${a} === "number"
27
- || ${a} === "boolean" || ${i} === null`).assign(l,(0,Oe._)`[${i}]`)}}}function y2({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Oe._)`${e} !== undefined`,()=>t.assign((0,Oe._)`${e}[${r}]`,n))}function aS(t,e,r,n=Nl.Correct){let i=n===Nl.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(t){case"null":return(0,Oe._)`${e} ${i} null`;case"array":s=(0,Oe._)`Array.isArray(${e})`;break;case"object":s=(0,Oe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Oe._)`typeof ${e} ${i} ${t}`}return n===Nl.Correct?s:(0,Oe.not)(s);function a(l=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,l,r?(0,Oe._)`isFinite(${e})`:Oe.nil)}}cr.checkDataType=aS;function lS(t,e,r,n){if(t.length===1)return aS(t[0],e,r,n);let i,s=(0,KE.toHash)(t);if(s.array&&s.object){let a=(0,Oe._)`typeof ${e} != "object"`;i=s.null?a:(0,Oe._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let a in s)i=(0,Oe.and)(i,aS(a,e,r,n));return i}cr.checkDataTypes=lS;var v2={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Oe._)`{type: ${t}}`:(0,Oe._)`{type: ${e}}`};function cS(t){let e=b2(t);(0,d2.reportError)(e,v2)}cr.reportTypeError=cS;function b2(t){let{gen:e,data:r,schema:n}=t,i=(0,KE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var eO=F(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.assignDefaults=void 0;var Dl=Ne(),S2=We();function w2(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)XE(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>XE(t,s,i.default))}vh.assignDefaults=w2;function XE(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let l=(0,Dl._)`${s}${(0,Dl.getProperty)(e)}`;if(i){(0,S2.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Dl._)`${l} === undefined`;a.useDefaults==="empty"&&(f=(0,Dl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Dl._)`${l} = ${(0,Dl.stringify)(r)}`)}});var _n=F(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.validateUnion=ut.validateArray=ut.usePattern=ut.callValidateCode=ut.schemaProperties=ut.allSchemaProperties=ut.noPropertyInData=ut.propertyInData=ut.isOwnProperty=ut.hasPropFunc=ut.reportMissingProp=ut.checkMissingProp=ut.checkReportMissingProp=void 0;var bt=Ne(),uS=We(),Ls=Zi(),_2=We();function R2(t,e){let{gen:r,data:n,it:i}=t;r.if(dS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,bt._)`${e}`},!0),t.error()})}ut.checkReportMissingProp=R2;function x2({gen:t,data:e,it:{opts:r}},n,i){return(0,bt.or)(...n.map(s=>(0,bt.and)(dS(t,e,s,r.ownProperties),(0,bt._)`${i} = ${s}`)))}ut.checkMissingProp=x2;function C2(t,e){t.setParams({missingProperty:e},!0),t.error()}ut.reportMissingProp=C2;function tO(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,bt._)`Object.prototype.hasOwnProperty`})}ut.hasPropFunc=tO;function fS(t,e,r){return(0,bt._)`${tO(t)}.call(${e}, ${r})`}ut.isOwnProperty=fS;function E2(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} !== undefined`;return n?(0,bt._)`${i} && ${fS(t,e,r)}`:i}ut.propertyInData=E2;function dS(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} === undefined`;return n?(0,bt.or)(i,(0,bt.not)(fS(t,e,r))):i}ut.noPropertyInData=dS;function rO(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ut.allSchemaProperties=rO;function O2(t,e){return rO(e).filter(r=>!(0,uS.alwaysValidSchema)(t,e[r]))}ut.schemaProperties=O2;function I2({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},l,f,d){let m=d?(0,bt._)`${t}, ${e}, ${n}${i}`:e,g=[[Ls.default.instancePath,(0,bt.strConcat)(Ls.default.instancePath,s)],[Ls.default.parentData,a.parentData],[Ls.default.parentDataProperty,a.parentDataProperty],[Ls.default.rootData,Ls.default.rootData]];a.opts.dynamicRef&&g.push([Ls.default.dynamicAnchors,Ls.default.dynamicAnchors]);let y=(0,bt._)`${m}, ${r.object(...g)}`;return f!==bt.nil?(0,bt._)`${l}.call(${f}, ${y})`:(0,bt._)`${l}(${y})`}ut.callValidateCode=I2;var P2=(0,bt._)`new RegExp`;function k2({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,bt._)`${i.code==="new RegExp"?P2:(0,_2.useFunc)(t,i)}(${r}, ${n})`})}ut.usePattern=k2;function T2(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return a(()=>e.assign(l,!1)),l}return e.var(s,!0),a(()=>e.break()),s;function a(l){let f=e.const("len",(0,bt._)`${r}.length`);e.forRange("i",0,f,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:uS.Type.Num},s),e.if((0,bt.not)(s),l)})}}ut.validateArray=T2;function A2(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,uS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,d)=>{let m=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(a,(0,bt._)`${a} || ${l}`),t.mergeValidEvaluated(m,l)||e.if((0,bt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}ut.validateUnion=A2});var sO=F(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.validateKeywordUsage=wi.validSchemaType=wi.funcKeywordCode=wi.macroKeywordCode=void 0;var Er=Ne(),ra=Zi(),q2=_n(),$2=Ju();function M2(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,l=e.macro.call(a.self,i,s,a),f=iO(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Er.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}wi.macroKeywordCode=M2;function N2(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:l,it:f}=t;F2(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,a,f):e.validate,m=iO(n,i,d),g=n.let("valid");t.block$data(g,y),t.ok((r=e.valid)!==null&&r!==void 0?r:g);function y(){if(e.errors===!1)R(),e.modifying&&nO(t),P(()=>t.error());else{let A=e.async?S():_();e.modifying&&nO(t),P(()=>D2(t,A))}}function S(){let A=n.let("ruleErrs",null);return n.try(()=>R((0,Er._)`await `),U=>n.assign(g,!1).if((0,Er._)`${U} instanceof ${f.ValidationError}`,()=>n.assign(A,(0,Er._)`${U}.errors`),()=>n.throw(U))),A}function _(){let A=(0,Er._)`${m}.errors`;return n.assign(A,null),R(Er.nil),A}function R(A=e.async?(0,Er._)`await `:Er.nil){let U=f.opts.passContext?ra.default.this:ra.default.self,B=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Er._)`${A}${(0,q2.callValidateCode)(t,m,U,B)}`,e.modifying)}function P(A){var U;n.if((0,Er.not)((U=e.valid)!==null&&U!==void 0?U:g),A)}}wi.funcKeywordCode=N2;function nO(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Er._)`${n.parentData}[${n.parentDataProperty}]`))}function D2(t,e){let{gen:r}=t;r.if((0,Er._)`Array.isArray(${e})`,()=>{r.assign(ra.default.vErrors,(0,Er._)`${ra.default.vErrors} === null ? ${e} : ${ra.default.vErrors}.concat(${e})`).assign(ra.default.errors,(0,Er._)`${ra.default.vErrors}.length`),(0,$2.extendErrors)(t)},()=>t.error())}function F2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function iO(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Er.stringify)(r)})}function L2(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}wi.validSchemaType=L2;function j2({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}wi.validateKeywordUsage=j2});var aO=F(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.extendSubschemaMode=js.extendSubschemaData=js.getSubschema=void 0;var _i=Ne(),oO=We();function U2(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,_i._)`${t.schemaPath}${(0,_i.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,_i._)`${t.schemaPath}${(0,_i.getProperty)(e)}${(0,_i.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,oO.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}js.getSubschema=U2;function H2(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:m,opts:g}=e,y=l.let("data",(0,_i._)`${e.data}${(0,_i.getProperty)(r)}`,!0);f(y),t.errorPath=(0,_i.str)`${d}${(0,oO.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,_i._)`${r}`,t.dataPathArr=[...m,t.parentDataProperty]}if(i!==void 0){let d=i instanceof _i.Name?i:l.let("data",i,!0);f(d),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}js.extendSubschemaData=H2;function B2(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}js.extendSubschemaMode=B2});var pS=F((l7,lO)=>{"use strict";lO.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var uO=F((c7,cO)=>{"use strict";var Us=cO.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};bh(e,n,i,t,"",t)};Us.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Us.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Us.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Us.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function bh(t,e,r,n,i,s,a,l,f,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,l,f,d);for(var m in n){var g=n[m];if(Array.isArray(g)){if(m in Us.arrayKeywords)for(var y=0;y<g.length;y++)bh(t,e,r,g[y],i+"/"+m+"/"+y,s,i,m,n,y)}else if(m in Us.propsKeywords){if(g&&typeof g=="object")for(var S in g)bh(t,e,r,g[S],i+"/"+m+"/"+V2(S),s,i,m,n,S)}else(m in Us.keywords||t.allKeys&&!(m in Us.skipKeywords))&&bh(t,e,r,g,i+"/"+m,s,i,m,n)}r(n,i,s,a,l,f,d)}}function V2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Yu=F(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getSchemaRefs=Fr.resolveUrl=Fr.normalizeId=Fr._getFullPath=Fr.getFullPath=Fr.inlineRef=void 0;var W2=We(),z2=pS(),J2=uO(),G2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Y2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!hS(t):e?fO(t)<=e:!1}Fr.inlineRef=Y2;var K2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hS(t){for(let e in t){if(K2.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(hS)||typeof r=="object"&&hS(r))return!0}return!1}function fO(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!G2.has(r)&&(typeof t[r]=="object"&&(0,W2.eachItem)(t[r],n=>e+=fO(n)),e===1/0))return 1/0}return e}function dO(t,e="",r){r!==!1&&(e=Fl(e));let n=t.parse(e);return pO(t,n)}Fr.getFullPath=dO;function pO(t,e){return t.serialize(e).split("#")[0]+"#"}Fr._getFullPath=pO;var Q2=/#\/?$/;function Fl(t){return t?t.replace(Q2,""):""}Fr.normalizeId=Fl;function Z2(t,e,r){return r=Fl(r),t.resolve(e,r)}Fr.resolveUrl=Z2;var X2=/^[a-z_][-a-z0-9._]*$/i;function eU(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Fl(t[r]||e),s={"":i},a=dO(n,i,!1),l={},f=new Set;return J2(t,{allKeys:!0},(g,y,S,_)=>{if(_===void 0)return;let R=a+y,P=s[_];typeof g[r]=="string"&&(P=A.call(this,g[r])),U.call(this,g.$anchor),U.call(this,g.$dynamicAnchor),s[y]=P;function A(B){let V=this.opts.uriResolver.resolve;if(B=Fl(P?V(P,B):B),f.has(B))throw m(B);f.add(B);let W=this.refs[B];return typeof W=="string"&&(W=this.refs[W]),typeof W=="object"?d(g,W.schema,B):B!==Fl(R)&&(B[0]==="#"?(d(g,l[B],B),l[B]=g):this.refs[B]=R),B}function U(B){if(typeof B=="string"){if(!X2.test(B))throw new Error(`invalid anchor "${B}"`);A.call(this,`#${B}`)}}}),l;function d(g,y,S){if(y!==void 0&&!z2(g,y))throw m(S)}function m(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Fr.getSchemaRefs=eU});var Zu=F(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.getData=Hs.KeywordCxt=Hs.validateFunctionCode=void 0;var vO=JE(),hO=Gu(),gS=oS(),Sh=Gu(),tU=eO(),Qu=sO(),mS=aO(),de=Ne(),Se=Zi(),rU=Yu(),Xi=We(),Ku=Ju();function nU(t){if(wO(t)&&(_O(t),SO(t))){oU(t);return}bO(t,()=>(0,vO.topBoolOrEmptySchema)(t))}Hs.validateFunctionCode=nU;function bO({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,de._)`${Se.default.data}, ${Se.default.valCxt}`,n.$async,()=>{t.code((0,de._)`"use strict"; ${mO(r,i)}`),sU(t,i),t.code(s)}):t.func(e,(0,de._)`${Se.default.data}, ${iU(i)}`,n.$async,()=>t.code(mO(r,i)).code(s))}function iU(t){return(0,de._)`{${Se.default.instancePath}="", ${Se.default.parentData}, ${Se.default.parentDataProperty}, ${Se.default.rootData}=${Se.default.data}${t.dynamicRef?(0,de._)`, ${Se.default.dynamicAnchors}={}`:de.nil}}={}`}function sU(t,e){t.if(Se.default.valCxt,()=>{t.var(Se.default.instancePath,(0,de._)`${Se.default.valCxt}.${Se.default.instancePath}`),t.var(Se.default.parentData,(0,de._)`${Se.default.valCxt}.${Se.default.parentData}`),t.var(Se.default.parentDataProperty,(0,de._)`${Se.default.valCxt}.${Se.default.parentDataProperty}`),t.var(Se.default.rootData,(0,de._)`${Se.default.valCxt}.${Se.default.rootData}`),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,de._)`${Se.default.valCxt}.${Se.default.dynamicAnchors}`)},()=>{t.var(Se.default.instancePath,(0,de._)`""`),t.var(Se.default.parentData,(0,de._)`undefined`),t.var(Se.default.parentDataProperty,(0,de._)`undefined`),t.var(Se.default.rootData,Se.default.data),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,de._)`{}`)})}function oU(t){let{schema:e,opts:r,gen:n}=t;bO(t,()=>{r.$comment&&e.$comment&&xO(t),fU(t),n.let(Se.default.vErrors,null),n.let(Se.default.errors,0),r.unevaluated&&aU(t),RO(t),hU(t)})}function aU(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,de._)`${r}.evaluated`),e.if((0,de._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,de._)`${t.evaluated}.props`,(0,de._)`undefined`)),e.if((0,de._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,de._)`${t.evaluated}.items`,(0,de._)`undefined`))}function mO(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,de._)`/*# sourceURL=${r} */`:de.nil}function lU(t,e){if(wO(t)&&(_O(t),SO(t))){cU(t,e);return}(0,vO.boolOrEmptySchema)(t,e)}function SO({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function wO(t){return typeof t.schema!="boolean"}function cU(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&xO(t),dU(t),pU(t);let s=n.const("_errs",Se.default.errors);RO(t,s),n.var(e,(0,de._)`${s} === ${Se.default.errors}`)}function _O(t){(0,Xi.checkUnknownRules)(t),uU(t)}function RO(t,e){if(t.opts.jtd)return gO(t,[],!1,e);let r=(0,hO.getSchemaTypes)(t.schema),n=(0,hO.coerceAndCheckDataType)(t,r);gO(t,r,!n,e)}function uU(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Xi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function fU(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Xi.checkStrictMode)(t,"default is ignored in the schema root")}function dU(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,rU.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function pU(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function xO({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,de._)`${Se.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,de.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,de._)`${Se.default.self}.opts.$comment(${s}, ${a}, ${l}.schema)`)}}function hU(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,de._)`${Se.default.errors} === 0`,()=>e.return(Se.default.data),()=>e.throw((0,de._)`new ${i}(${Se.default.vErrors})`)):(e.assign((0,de._)`${n}.errors`,Se.default.vErrors),s.unevaluated&&mU(t),e.return((0,de._)`${Se.default.errors} === 0`))}function mU({gen:t,evaluated:e,props:r,items:n}){r instanceof de.Name&&t.assign((0,de._)`${e}.props`,r),n instanceof de.Name&&t.assign((0,de._)`${e}.items`,n)}function gO(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:l,opts:f,self:d}=t,{RULES:m}=d;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Xi.schemaHasRulesButRef)(s,m))){i.block(()=>EO(t,"$ref",m.all.$ref.definition));return}f.jtd||gU(t,e),i.block(()=>{for(let y of m.rules)g(y);g(m.post)});function g(y){(0,gS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,Sh.checkDataType)(y.type,a,f.strictNumbers)),yO(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,Sh.reportTypeError)(t)),i.endIf()):yO(t,y),l||i.if((0,de._)`${Se.default.errors} === ${n||0}`))}}function yO(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,tU.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,gS.shouldUseRule)(n,s)&&EO(t,s.keyword,s.definition,e.type)})}function gU(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(yU(t,e),t.opts.allowUnionTypes||vU(t,e),bU(t,t.dataTypes))}function yU(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{CO(t.dataTypes,r)||yS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),wU(t,e)}}function vU(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&yS(t,"use allowUnionTypes to allow union type keyword")}function bU(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,gS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>SU(e,a))&&yS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function SU(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function CO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function wU(t,e){let r=[];for(let n of t.dataTypes)CO(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function yS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Xi.checkStrictMode)(t,e,t.opts.strictTypes)}var wh=class{constructor(e,r,n){if((0,Qu.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Xi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",OO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qu.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Se.default.errors))}result(e,r,n){this.failResult((0,de.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,de.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,de._)`${r} !== undefined && (${(0,de.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ku.reportExtraError:Ku.reportError)(this,this.def.error,r)}$dataError(){(0,Ku.reportError)(this,this.def.$dataError||Ku.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ku.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=de.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=de.nil,r=de.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,de.or)((0,de._)`${i} === undefined`,r)),e!==de.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==de.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,de.or)(a(),l());function a(){if(n.length){if(!(r instanceof de.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,de._)`${(0,Sh.checkDataTypes)(f,r,s.opts.strictNumbers,Sh.DataType.Wrong)}`}return de.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,de._)`!${f}(${r})`}return de.nil}}subschema(e,r){let n=(0,mS.getSubschema)(this.it,e);(0,mS.extendSubschemaData)(n,this.it,e),(0,mS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return lU(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Xi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Xi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,de.Name)),!0}};Hs.KeywordCxt=wh;function EO(t,e,r,n){let i=new wh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Qu.funcKeywordCode)(i,r):"macro"in r?(0,Qu.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Qu.funcKeywordCode)(i,r)}var _U=/^\/(?:[^~]|~0|~1)*$/,RU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function OO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Se.default.rootData;if(t[0]==="/"){if(!_U.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Se.default.rootData}else{let d=RU.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let m=+d[1];if(i=d[2],i==="#"){if(m>=e)throw new Error(f("property/index",m));return n[e-m]}if(m>e)throw new Error(f("data",m));if(s=r[e-m],!i)return s}let a=s,l=i.split("/");for(let d of l)d&&(s=(0,de._)`${s}${(0,de.getProperty)((0,Xi.unescapeJsonPointer)(d))}`,a=(0,de._)`${a} && ${s}`);return a;function f(d,m){return`Cannot access ${d} ${m} levels up, current level is ${e}`}}Hs.getData=OO});var _h=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var vS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};bS.default=vS});var Xu=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var SS=Yu(),wS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,SS.resolveUrl)(e,r,n),this.missingSchema=(0,SS.normalizeId)((0,SS.getFullPath)(e,this.missingRef))}};_S.default=wS});var xh=F(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.resolveSchema=Rn.getCompilingSchema=Rn.resolveRef=Rn.compileSchema=Rn.SchemaEnv=void 0;var Jn=Ne(),xU=_h(),na=Zi(),Gn=Yu(),IO=We(),CU=Zu(),Ll=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Gn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Rn.SchemaEnv=Ll;function xS(t){let e=PO.call(this,t);if(e)return e;let r=(0,Gn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=a.scopeValue("Error",{ref:xU.default,code:(0,Jn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let d={gen:a,allErrors:this.opts.allErrors,data:na.default.data,parentData:na.default.parentData,parentDataProperty:na.default.parentDataProperty,dataNames:[na.default.data],dataPathArr:[Jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Jn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Jn._)`""`,opts:this.opts,self:this},m;try{this._compilations.add(t),(0,CU.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let g=a.toString();m=`${a.scopeRefs(na.default.scope)}return ${g}`,this.opts.code.process&&(m=this.opts.code.process(m,t));let S=new Function(`${na.default.self}`,`${na.default.scope}`,m)(this,this.scope.get());if(this.scope.value(f,{ref:S}),S.errors=null,S.schema=t.schema,S.schemaEnv=t,t.$async&&(S.$async=!0),this.opts.code.source===!0&&(S.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:_,items:R}=d;S.evaluated={props:_ instanceof Jn.Name?void 0:_,items:R instanceof Jn.Name?void 0:R,dynamicProps:_ instanceof Jn.Name,dynamicItems:R instanceof Jn.Name},S.source&&(S.source.evaluated=(0,Jn.stringify)(S.evaluated))}return t.validate=S,t}catch(g){throw delete t.validate,delete t.validateName,m&&this.logger.error("Error compiling schema, function code:",m),g}finally{this._compilations.delete(t)}}Rn.compileSchema=xS;function EU(t,e,r){var n;r=(0,Gn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=PU.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(s=new Ll({schema:a,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=OU.call(this,s)}Rn.resolveRef=EU;function OU(t){return(0,Gn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:xS.call(this,t)}function PO(t){for(let e of this._compilations)if(IU(e,t))return e}Rn.getCompilingSchema=PO;function IU(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function PU(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Rh.call(this,t,e)}function Rh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Gn._getFullPath)(this.opts.uriResolver,r),i=(0,Gn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return RS.call(this,r,t);let s=(0,Gn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let l=Rh.call(this,t,a);return typeof l?.schema!="object"?void 0:RS.call(this,r,l)}if(typeof a?.schema=="object"){if(a.validate||xS.call(this,a),s===(0,Gn.normalizeId)(e)){let{schema:l}=a,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,Gn.resolveUrl)(this.opts.uriResolver,i,d)),new Ll({schema:l,schemaId:f,root:t,baseId:i})}return RS.call(this,r,a)}}Rn.resolveSchema=Rh;var kU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function RS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,IO.unescapeFragment)(l)];if(f===void 0)return;r=f;let d=typeof r=="object"&&r[this.opts.schemaId];!kU.has(l)&&d&&(e=(0,Gn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,IO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,Gn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Rh.call(this,n,l)}let{schemaId:a}=this.opts;if(s=s||new Ll({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var kO=F((m7,TU)=>{TU.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var OS=F((g7,NO)=>{"use strict";var AU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),AO=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),CS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),qO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),qU=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ES(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var $U=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function TO(t){return t.length=0,!0}function MU(t,e,r){if(t.length){let n=ES(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function NU(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,l=MU;for(let f=0;f<t.length;f++){let d=t[f];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(a=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,r))break;l=TO}else{i.push(d);continue}}return i.length&&(l===TO?r.zone=i.join(""):a?n.push(i.join("")):n.push(ES(i))),r.address=n.join(""),r}function $O(t){if(DU(t,":")<2)return{host:t,isIPV6:!1};let e=NU(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function DU(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function FU(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var LU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},jU=/[@/?#:]/g,UU=/[@/?#]/g;function MO(t,e){let r=e?UU:jU;return r.lastIndex=0,t.replace(r,n=>LU[n])}function HU(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(CS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&qO(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function BU(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(CS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&qO(s)?e+=s:e+="%"+i,r+=2;continue}}qU(t[r])?e+=t[r]:e+=escape(t[r])}return e}function VU(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(CS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function WU(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!AO(r)){let n=$O(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=MO(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}NO.exports={nonSimpleDomain:$U,recomposeAuthority:WU,reescapeHostDelimiters:MO,normalizePercentEncoding:HU,normalizePathEncoding:BU,escapePreservingEscapes:VU,removeDotSegments:FU,isIPv4:AO,isUUID:AU,normalizeIPv6:$O,stringArrayToHexStripped:ES}});var UO=F((y7,jO)=>{"use strict";var{isUUID:zU}=OS(),JU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,GU=["http","https","ws","wss","urn","urn:uuid"];function YU(t){return GU.indexOf(t)!==-1}function IS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function DO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function FO(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function KU(t){return t.secure=IS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function QU(t){if((t.port===(IS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function ZU(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(JU);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=PS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function XU(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=PS(i);s&&(t=s.serialize(t,e));let a=t,l=t.nss;return a.path=`${n||e.nid}:${l}`,e.skipEscape=!0,a}function eH(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!zU(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function tH(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var LO={scheme:"http",domainHost:!0,parse:DO,serialize:FO},rH={scheme:"https",domainHost:LO.domainHost,parse:DO,serialize:FO},Ch={scheme:"ws",domainHost:!0,parse:KU,serialize:QU},nH={scheme:"wss",domainHost:Ch.domainHost,parse:Ch.parse,serialize:Ch.serialize},iH={scheme:"urn",parse:ZU,serialize:XU,skipNormalize:!0},sH={scheme:"urn:uuid",parse:eH,serialize:tH,skipNormalize:!0},Eh={http:LO,https:rH,ws:Ch,wss:nH,urn:iH,"urn:uuid":sH};Object.setPrototypeOf(Eh,null);function PS(t){return t&&(Eh[t]||Eh[t.toLowerCase()])||void 0}jO.exports={wsIsSecure:IS,SCHEMES:Eh,isValidSchemeName:YU,getSchemeHandler:PS}});var JO=F((v7,Oh)=>{"use strict";var{normalizeIPv6:oH,removeDotSegments:ef,recomposeAuthority:aH,normalizePercentEncoding:lH,normalizePathEncoding:cH,escapePreservingEscapes:uH,reescapeHostDelimiters:fH,isIPv4:dH,nonSimpleDomain:pH}=OS(),{SCHEMES:hH,getSchemeHandler:BO}=UO();function mH(t,e){return typeof t=="string"?t=SH(t,e):typeof t=="object"&&(t=jl(ia(t,e),e)),t}function gH(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=VO(jl(t,n),jl(e,n),n,!0);return n.skipEscape=!0,ia(i,n)}function VO(t,e,r,n){let i={};return n||(t=jl(ia(t,r),r),e=jl(ia(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=ef(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=ef(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=ef(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=ef(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function yH(t,e,r){let n=HO(t,r),i=HO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function ia(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=BO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=lH(r.path):(r.path=uH(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=aH(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=ef(l)),a===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var vH=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function bH(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function WO(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let a=t.match(vH);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let l=bH(n,a);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(dH(n.host)===!1){let m=oH(n.host);n.host=m.host.toLowerCase(),s=m.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let f=BO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&pH(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=fH(unescape(n.host),s))),n.path&&(n.path=cH(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function jl(t,e){return WO(t,e).parsed}function SH(t,e){return zO(t,e).normalized}function zO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=WO(t,e);return{normalized:n?t:ia(r,e),malformedAuthorityOrPort:n}}function HO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=zO(t,e);return n?void 0:r}if(typeof t=="object")return ia(t,e)}var kS={SCHEMES:hH,normalize:mH,resolve:gH,resolveComponent:VO,equal:yH,serialize:ia,parse:jl};Oh.exports=kS;Oh.exports.default=kS;Oh.exports.fastUri=kS});var YO=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var GO=JO();GO.code='require("ajv/dist/runtime/uri").default';TS.default=GO});var nI=F(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.CodeGen=Xt.Name=Xt.nil=Xt.stringify=Xt.str=Xt._=Xt.KeywordCxt=void 0;var wH=Zu();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return wH.KeywordCxt}});var Ul=Ne();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return Ul._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return Ul.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return Ul.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return Ul.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return Ul.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return Ul.CodeGen}});var _H=_h(),eI=Xu(),RH=sS(),tf=xh(),xH=Ne(),rf=Yu(),Ih=Gu(),qS=We(),KO=kO(),CH=YO(),tI=(t,e)=>new RegExp(t,e);tI.code="new RegExp";var EH=["removeAdditional","useDefaults","coerceTypes"],OH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),IH={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},PH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},QO=200;function kH(t){var e,r,n,i,s,a,l,f,d,m,g,y,S,_,R,P,A,U,B,V,W,X,T,x,k;let N=t.strict,j=(e=t.code)===null||e===void 0?void 0:e.optimize,$=j===!0||j===void 0?1:j||0,G=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:tI,K=(i=t.uriResolver)!==null&&i!==void 0?i:CH.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&f!==void 0?f:!0,strictTypes:(m=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&m!==void 0?m:"log",strictTuples:(y=(g=t.strictTuples)!==null&&g!==void 0?g:N)!==null&&y!==void 0?y:"log",strictRequired:(_=(S=t.strictRequired)!==null&&S!==void 0?S:N)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:$,regExp:G}:{optimize:$,regExp:G},loopRequired:(R=t.loopRequired)!==null&&R!==void 0?R:QO,loopEnum:(P=t.loopEnum)!==null&&P!==void 0?P:QO,meta:(A=t.meta)!==null&&A!==void 0?A:!0,messages:(U=t.messages)!==null&&U!==void 0?U:!0,inlineRefs:(B=t.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(V=t.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(W=t.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(x=t.unicodeRegExp)!==null&&x!==void 0?x:!0,int32range:(k=t.int32range)!==null&&k!==void 0?k:!0,uriResolver:K}}var nf=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...kH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new xH.ValueScope({scope:{},prefixes:OH,es5:r,lines:n}),this.logger=NH(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,RH.getRules)(),ZO.call(this,IH,e,"NOT SUPPORTED"),ZO.call(this,PH,e,"DEPRECATED","warn"),this._metaOpts=$H.call(this),e.formats&&AH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&qH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),TH.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=KO;n==="id"&&(i={...KO},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(m,g){await s.call(this,m.$schema);let y=this._addSchema(m,g);return y.validate||a.call(this,y)}async function s(m){m&&!this.getSchema(m)&&await i.call(this,{$ref:m},!0)}async function a(m){try{return this._compileSchemaEnv(m)}catch(g){if(!(g instanceof eI.default))throw g;return l.call(this,g),await f.call(this,g.missingSchema),a.call(this,m)}}function l({missingSchema:m,missingRef:g}){if(this.refs[m])throw new Error(`AnySchema ${m} is loaded but ${g} cannot be resolved`)}async function f(m){let g=await d.call(this,m);this.refs[m]||await s.call(this,g.$schema),this.refs[m]||this.addSchema(g,m,r)}async function d(m){let g=this._loading[m];if(g)return g;try{return await(this._loading[m]=n(m))}finally{delete this._loading[m]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,rf.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=XO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new tf.SchemaEnv({schema:{},schemaId:n});if(r=tf.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=XO.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,rf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(FH.call(this,n,r),!r)return(0,qS.eachItem)(n,s=>AS.call(this,s)),this;jH.call(this,r);let i={...r,type:(0,Ih.getJSONTypes)(r.type),schemaType:(0,Ih.getJSONTypes)(r.schemaType)};return(0,qS.eachItem)(n,i.type.length===0?s=>AS.call(this,s,i):s=>i.type.forEach(a=>AS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let l of s)a=a[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:d}=f.definition,m=a[l];d&&m&&(a[l]=rI(m))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:l}=this.opts;if(typeof e=="object")a=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,rf.normalizeId)(a||n);let d=rf.getSchemaRefs.call(this,e,n);return f=new tf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):tf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{tf.compileSchema.call(this,e)}finally{this.opts=r}}};nf.ValidationError=_H.default;nf.MissingRefError=eI.default;Xt.default=nf;function ZO(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function XO(t){return t=(0,rf.normalizeId)(t),this.schemas[t]||this.refs[t]}function TH(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function AH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function qH(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function $H(){let t={...this.opts};for(let e of EH)delete t[e];return t}var MH={log(){},warn(){},error(){}};function NH(t){if(t===!1)return MH;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var DH=/^[a-z_$][a-z0-9_$:-]*$/i;function FH(t,e){let{RULES:r}=this;if((0,qS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!DH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function AS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,Ih.getJSONTypes)(e.type),schemaType:(0,Ih.getJSONTypes)(e.schemaType)}};e.before?LH.call(this,a,l,e.before):a.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function LH(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function jH(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=rI(e)),t.validateSchema=this.compile(e,!0))}var UH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function rI(t){return{anyOf:[t,UH]}}});var iI=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var HH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$S.default=HH});var lI=F(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.callRef=sa.getValidate=void 0;var BH=Xu(),sI=_n(),Lr=Ne(),Hl=Zi(),oI=xh(),Ph=We(),VH={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:l,self:f}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return g();let m=oI.resolveRef.call(f,d,i,r);if(m===void 0)throw new BH.default(n.opts.uriResolver,i,r);if(m instanceof oI.SchemaEnv)return y(m);return S(m);function g(){if(s===d)return kh(t,a,s,s.$async);let _=e.scopeValue("root",{ref:d});return kh(t,(0,Lr._)`${_}.validate`,d,d.$async)}function y(_){let R=aI(t,_);kh(t,R,_,_.$async)}function S(_){let R=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,Lr.stringify)(_)}:{ref:_}),P=e.name("valid"),A=t.subschema({schema:_,dataTypes:[],schemaPath:Lr.nil,topSchemaRef:R,errSchemaPath:r},P);t.mergeEvaluated(A),t.ok(P)}}};function aI(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Lr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}sa.getValidate=aI;function kh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:l,opts:f}=s,d=f.passContext?Hl.default.this:Lr.nil;n?m():g();function m(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,Lr._)`await ${(0,sI.callValidateCode)(t,e,d)}`),S(e),a||i.assign(_,!0)},R=>{i.if((0,Lr._)`!(${R} instanceof ${s.ValidationError})`,()=>i.throw(R)),y(R),a||i.assign(_,!1)}),t.ok(_)}function g(){t.result((0,sI.callValidateCode)(t,e,d),()=>S(e),()=>y(e))}function y(_){let R=(0,Lr._)`${_}.errors`;i.assign(Hl.default.vErrors,(0,Lr._)`${Hl.default.vErrors} === null ? ${R} : ${Hl.default.vErrors}.concat(${R})`),i.assign(Hl.default.errors,(0,Lr._)`${Hl.default.vErrors}.length`)}function S(_){var R;if(!s.opts.unevaluated)return;let P=(R=r?.validate)===null||R===void 0?void 0:R.evaluated;if(s.props!==!0)if(P&&!P.dynamicProps)P.props!==void 0&&(s.props=Ph.mergeEvaluated.props(i,P.props,s.props));else{let A=i.var("props",(0,Lr._)`${_}.evaluated.props`);s.props=Ph.mergeEvaluated.props(i,A,s.props,Lr.Name)}if(s.items!==!0)if(P&&!P.dynamicItems)P.items!==void 0&&(s.items=Ph.mergeEvaluated.items(i,P.items,s.items));else{let A=i.var("items",(0,Lr._)`${_}.evaluated.items`);s.items=Ph.mergeEvaluated.items(i,A,s.items,Lr.Name)}}}sa.callRef=kh;sa.default=VH});var cI=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var WH=iI(),zH=lI(),JH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",WH.default,zH.default];MS.default=JH});var uI=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var Th=Ne(),Bs=Th.operators,Ah={maximum:{okStr:"<=",ok:Bs.LTE,fail:Bs.GT},minimum:{okStr:">=",ok:Bs.GTE,fail:Bs.LT},exclusiveMaximum:{okStr:"<",ok:Bs.LT,fail:Bs.GTE},exclusiveMinimum:{okStr:">",ok:Bs.GT,fail:Bs.LTE}},GH={message:({keyword:t,schemaCode:e})=>(0,Th.str)`must be ${Ah[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Th._)`{comparison: ${Ah[t].okStr}, limit: ${e}}`},YH={keyword:Object.keys(Ah),type:"number",schemaType:"number",$data:!0,error:GH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Th._)`${r} ${Ah[e].fail} ${n} || isNaN(${r})`)}};NS.default=YH});var fI=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var sf=Ne(),KH={message:({schemaCode:t})=>(0,sf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,sf._)`{multipleOf: ${t}}`},QH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:KH,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),l=s?(0,sf._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,sf._)`${a} !== parseInt(${a})`;t.fail$data((0,sf._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};DS.default=QH});var pI=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});function dI(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}FS.default=dI;dI.code='require("ajv/dist/runtime/ucs2length").default'});var hI=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var oa=Ne(),ZH=We(),XH=pI(),eB={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,oa.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,oa._)`{limit: ${t}}`},tB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:eB,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?oa.operators.GT:oa.operators.LT,a=i.opts.unicode===!1?(0,oa._)`${r}.length`:(0,oa._)`${(0,ZH.useFunc)(t.gen,XH.default)}(${r})`;t.fail$data((0,oa._)`${a} ${s} ${n}`)}};LS.default=tB});var mI=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var rB=_n(),nB=We(),Bl=Ne(),iB={message:({schemaCode:t})=>(0,Bl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Bl._)`{pattern: ${t}}`},sB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:iB,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t,l=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=a.opts.code,d=f.code==="new RegExp"?(0,Bl._)`new RegExp`:(0,nB.useFunc)(e,f),m=e.let("valid");e.try(()=>e.assign(m,(0,Bl._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(m,!1)),t.fail$data((0,Bl._)`!${m}`)}else{let f=(0,rB.usePattern)(t,i);t.fail$data((0,Bl._)`!${f}.test(${r})`)}}};jS.default=sB});var gI=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var of=Ne(),oB={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,of.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,of._)`{limit: ${t}}`},aB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:oB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?of.operators.GT:of.operators.LT;t.fail$data((0,of._)`Object.keys(${r}).length ${i} ${n}`)}};US.default=aB});var yI=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var af=_n(),lf=Ne(),lB=We(),cB={message:({params:{missingProperty:t}})=>(0,lf.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,lf._)`{missingProperty: ${t}}`},uB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:cB,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:l}=a;if(!s&&r.length===0)return;let f=r.length>=l.loopRequired;if(a.allErrors?d():m(),l.strictRequired){let S=t.parentSchema.properties,{definedProperties:_}=t.it;for(let R of r)if(S?.[R]===void 0&&!_.has(R)){let P=a.schemaEnv.baseId+a.errSchemaPath,A=`required property "${R}" is not defined at "${P}" (strictRequired)`;(0,lB.checkStrictMode)(a,A,a.opts.strictRequired)}}function d(){if(f||s)t.block$data(lf.nil,g);else for(let S of r)(0,af.checkReportMissingProp)(t,S)}function m(){let S=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>y(S,_)),t.ok(_)}else e.if((0,af.checkMissingProp)(t,r,S)),(0,af.reportMissingProp)(t,S),e.else()}function g(){e.forOf("prop",n,S=>{t.setParams({missingProperty:S}),e.if((0,af.noPropertyInData)(e,i,S,l.ownProperties),()=>t.error())})}function y(S,_){t.setParams({missingProperty:S}),e.forOf(S,n,()=>{e.assign(_,(0,af.propertyInData)(e,i,S,l.ownProperties)),e.if((0,lf.not)(_),()=>{t.error(),e.break()})},lf.nil)}}};HS.default=uB});var vI=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var cf=Ne(),fB={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,cf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,cf._)`{limit: ${t}}`},dB={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:fB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?cf.operators.GT:cf.operators.LT;t.fail$data((0,cf._)`${r}.length ${i} ${n}`)}};BS.default=dB});var qh=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var bI=pS();bI.code='require("ajv/dist/runtime/equal").default';VS.default=bI});var SI=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var WS=Gu(),er=Ne(),pB=We(),hB=qh(),mB={message:({params:{i:t,j:e}})=>(0,er.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,er._)`{i: ${t}, j: ${e}}`},gB={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:mB,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:l}=t;if(!n&&!i)return;let f=e.let("valid"),d=s.items?(0,WS.getSchemaTypes)(s.items):[];t.block$data(f,m,(0,er._)`${a} === false`),t.ok(f);function m(){let _=e.let("i",(0,er._)`${r}.length`),R=e.let("j");t.setParams({i:_,j:R}),e.assign(f,!0),e.if((0,er._)`${_} > 1`,()=>(g()?y:S)(_,R))}function g(){return d.length>0&&!d.some(_=>_==="object"||_==="array")}function y(_,R){let P=e.name("item"),A=(0,WS.checkDataTypes)(d,P,l.opts.strictNumbers,WS.DataType.Wrong),U=e.const("indices",(0,er._)`{}`);e.for((0,er._)`;${_}--;`,()=>{e.let(P,(0,er._)`${r}[${_}]`),e.if(A,(0,er._)`continue`),d.length>1&&e.if((0,er._)`typeof ${P} == "string"`,(0,er._)`${P} += "_"`),e.if((0,er._)`typeof ${U}[${P}] == "number"`,()=>{e.assign(R,(0,er._)`${U}[${P}]`),t.error(),e.assign(f,!1).break()}).code((0,er._)`${U}[${P}] = ${_}`)})}function S(_,R){let P=(0,pB.useFunc)(e,hB.default),A=e.name("outer");e.label(A).for((0,er._)`;${_}--;`,()=>e.for((0,er._)`${R} = ${_}; ${R}--;`,()=>e.if((0,er._)`${P}(${r}[${_}], ${r}[${R}])`,()=>{t.error(),e.assign(f,!1).break(A)})))}}};zS.default=gB});var wI=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var JS=Ne(),yB=We(),vB=qh(),bB={message:"must be equal to constant",params:({schemaCode:t})=>(0,JS._)`{allowedValue: ${t}}`},SB={keyword:"const",$data:!0,error:bB,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,JS._)`!${(0,yB.useFunc)(e,vB.default)}(${r}, ${i})`):t.fail((0,JS._)`${s} !== ${r}`)}};GS.default=SB});var _I=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var uf=Ne(),wB=We(),_B=qh(),RB={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,uf._)`{allowedValues: ${t}}`},xB={keyword:"enum",schemaType:"array",$data:!0,error:RB,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=a.opts.loopEnum,f,d=()=>f??(f=(0,wB.useFunc)(e,_B.default)),m;if(l||n)m=e.let("valid"),t.block$data(m,g);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let S=e.const("vSchema",s);m=(0,uf.or)(...i.map((_,R)=>y(S,R)))}t.pass(m);function g(){e.assign(m,!1),e.forOf("v",s,S=>e.if((0,uf._)`${d()}(${r}, ${S})`,()=>e.assign(m,!0).break()))}function y(S,_){let R=i[_];return typeof R=="object"&&R!==null?(0,uf._)`${d()}(${r}, ${S}[${_}])`:(0,uf._)`${r} === ${R}`}}};YS.default=xB});var RI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var CB=uI(),EB=fI(),OB=hI(),IB=mI(),PB=gI(),kB=yI(),TB=vI(),AB=SI(),qB=wI(),$B=_I(),MB=[CB.default,EB.default,OB.default,IB.default,PB.default,kB.default,TB.default,AB.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},qB.default,$B.default];KS.default=MB});var ZS=F(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.validateAdditionalItems=void 0;var aa=Ne(),QS=We(),NB={message:({params:{len:t}})=>(0,aa.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,aa._)`{limit: ${t}}`},DB={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:NB,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,QS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}xI(t,n)}};function xI(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let l=r.const("len",(0,aa._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,aa._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,QS.alwaysValidSchema)(a,n)){let d=r.var("valid",(0,aa._)`${l} <= ${e.length}`);r.if((0,aa.not)(d),()=>f(d)),t.ok(d)}function f(d){r.forRange("i",e.length,l,m=>{t.subschema({keyword:s,dataProp:m,dataPropType:QS.Type.Num},d),a.allErrors||r.if((0,aa.not)(d),()=>r.break())})}}ff.validateAdditionalItems=xI;ff.default=DB});var XS=F(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.validateTuple=void 0;var CI=Ne(),$h=We(),FB=_n(),LB={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return EI(t,"additionalItems",e);r.items=!0,!(0,$h.alwaysValidSchema)(r,e)&&t.ok((0,FB.validateArray)(t))}};function EI(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:l}=t;m(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=$h.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),d=n.const("len",(0,CI._)`${s}.length`);r.forEach((g,y)=>{(0,$h.alwaysValidSchema)(l,g)||(n.if((0,CI._)`${d} > ${y}`,()=>t.subschema({keyword:a,schemaProp:y,dataProp:y},f)),t.ok(f))});function m(g){let{opts:y,errSchemaPath:S}=l,_=r.length,R=_===g.minItems&&(_===g.maxItems||g[e]===!1);if(y.strictTuples&&!R){let P=`"${a}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${S}"`;(0,$h.checkStrictMode)(l,P,y.strictTuples)}}}df.validateTuple=EI;df.default=LB});var OI=F(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var jB=XS(),UB={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,jB.validateTuple)(t,"items")};e0.default=UB});var PI=F(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var II=Ne(),HB=We(),BB=_n(),VB=ZS(),WB={message:({params:{len:t}})=>(0,II.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,II._)`{limit: ${t}}`},zB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:WB,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,HB.alwaysValidSchema)(n,e)&&(i?(0,VB.validateAdditionalItems)(t,i):t.ok((0,BB.validateArray)(t)))}};t0.default=zB});var kI=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var xn=Ne(),Mh=We(),JB={message:({params:{min:t,max:e}})=>e===void 0?(0,xn.str)`must contain at least ${t} valid item(s)`:(0,xn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,xn._)`{minContains: ${t}}`:(0,xn._)`{minContains: ${t}, maxContains: ${e}}`},GB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:JB,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,l,{minContains:f,maxContains:d}=n;s.opts.next?(a=f===void 0?1:f,l=d):a=1;let m=e.const("len",(0,xn._)`${i}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,Mh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Mh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Mh.alwaysValidSchema)(s,r)){let R=(0,xn._)`${m} >= ${a}`;l!==void 0&&(R=(0,xn._)`${R} && ${m} <= ${l}`),t.pass(R);return}s.items=!0;let g=e.name("valid");l===void 0&&a===1?S(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,xn._)`${i}.length > 0`,y)):(e.let(g,!1),y()),t.result(g,()=>t.reset());function y(){let R=e.name("_valid"),P=e.let("count",0);S(R,()=>e.if(R,()=>_(P)))}function S(R,P){e.forRange("i",0,m,A=>{t.subschema({keyword:"contains",dataProp:A,dataPropType:Mh.Type.Num,compositeRule:!0},R),P()})}function _(R){e.code((0,xn._)`${R}++`),l===void 0?e.if((0,xn._)`${R} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,xn._)`${R} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,xn._)`${R} >= ${a}`,()=>e.assign(g,!0)))}}};r0.default=GB});var qI=F(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.validateSchemaDeps=Ri.validatePropertyDeps=Ri.error=void 0;var n0=Ne(),YB=We(),pf=_n();Ri.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,n0.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,n0._)`{property: ${t},
27
+ || ${a} === "boolean" || ${i} === null`).assign(l,(0,Oe._)`[${i}]`)}}}function v2({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Oe._)`${e} !== undefined`,()=>t.assign((0,Oe._)`${e}[${r}]`,n))}function aS(t,e,r,n=Nl.Correct){let i=n===Nl.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(t){case"null":return(0,Oe._)`${e} ${i} null`;case"array":s=(0,Oe._)`Array.isArray(${e})`;break;case"object":s=(0,Oe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Oe._)`typeof ${e} ${i} ${t}`}return n===Nl.Correct?s:(0,Oe.not)(s);function a(l=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,l,r?(0,Oe._)`isFinite(${e})`:Oe.nil)}}cr.checkDataType=aS;function lS(t,e,r,n){if(t.length===1)return aS(t[0],e,r,n);let i,s=(0,QE.toHash)(t);if(s.array&&s.object){let a=(0,Oe._)`typeof ${e} != "object"`;i=s.null?a:(0,Oe._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let a in s)i=(0,Oe.and)(i,aS(a,e,r,n));return i}cr.checkDataTypes=lS;var b2={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Oe._)`{type: ${t}}`:(0,Oe._)`{type: ${e}}`};function cS(t){let e=S2(t);(0,p2.reportError)(e,b2)}cr.reportTypeError=cS;function S2(t){let{gen:e,data:r,schema:n}=t,i=(0,QE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var tO=F(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.assignDefaults=void 0;var Dl=Ne(),w2=We();function _2(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)eO(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>eO(t,s,i.default))}Sh.assignDefaults=_2;function eO(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let l=(0,Dl._)`${s}${(0,Dl.getProperty)(e)}`;if(i){(0,w2.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Dl._)`${l} === undefined`;a.useDefaults==="empty"&&(f=(0,Dl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Dl._)`${l} = ${(0,Dl.stringify)(r)}`)}});var _n=F(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.validateUnion=ut.validateArray=ut.usePattern=ut.callValidateCode=ut.schemaProperties=ut.allSchemaProperties=ut.noPropertyInData=ut.propertyInData=ut.isOwnProperty=ut.hasPropFunc=ut.reportMissingProp=ut.checkMissingProp=ut.checkReportMissingProp=void 0;var bt=Ne(),uS=We(),Ls=Zi(),R2=We();function x2(t,e){let{gen:r,data:n,it:i}=t;r.if(dS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,bt._)`${e}`},!0),t.error()})}ut.checkReportMissingProp=x2;function C2({gen:t,data:e,it:{opts:r}},n,i){return(0,bt.or)(...n.map(s=>(0,bt.and)(dS(t,e,s,r.ownProperties),(0,bt._)`${i} = ${s}`)))}ut.checkMissingProp=C2;function E2(t,e){t.setParams({missingProperty:e},!0),t.error()}ut.reportMissingProp=E2;function rO(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,bt._)`Object.prototype.hasOwnProperty`})}ut.hasPropFunc=rO;function fS(t,e,r){return(0,bt._)`${rO(t)}.call(${e}, ${r})`}ut.isOwnProperty=fS;function O2(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} !== undefined`;return n?(0,bt._)`${i} && ${fS(t,e,r)}`:i}ut.propertyInData=O2;function dS(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} === undefined`;return n?(0,bt.or)(i,(0,bt.not)(fS(t,e,r))):i}ut.noPropertyInData=dS;function nO(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ut.allSchemaProperties=nO;function I2(t,e){return nO(e).filter(r=>!(0,uS.alwaysValidSchema)(t,e[r]))}ut.schemaProperties=I2;function P2({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},l,f,d){let m=d?(0,bt._)`${t}, ${e}, ${n}${i}`:e,g=[[Ls.default.instancePath,(0,bt.strConcat)(Ls.default.instancePath,s)],[Ls.default.parentData,a.parentData],[Ls.default.parentDataProperty,a.parentDataProperty],[Ls.default.rootData,Ls.default.rootData]];a.opts.dynamicRef&&g.push([Ls.default.dynamicAnchors,Ls.default.dynamicAnchors]);let y=(0,bt._)`${m}, ${r.object(...g)}`;return f!==bt.nil?(0,bt._)`${l}.call(${f}, ${y})`:(0,bt._)`${l}(${y})`}ut.callValidateCode=P2;var k2=(0,bt._)`new RegExp`;function T2({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,bt._)`${i.code==="new RegExp"?k2:(0,R2.useFunc)(t,i)}(${r}, ${n})`})}ut.usePattern=T2;function A2(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return a(()=>e.assign(l,!1)),l}return e.var(s,!0),a(()=>e.break()),s;function a(l){let f=e.const("len",(0,bt._)`${r}.length`);e.forRange("i",0,f,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:uS.Type.Num},s),e.if((0,bt.not)(s),l)})}}ut.validateArray=A2;function q2(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,uS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,d)=>{let m=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(a,(0,bt._)`${a} || ${l}`),t.mergeValidEvaluated(m,l)||e.if((0,bt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}ut.validateUnion=q2});var oO=F(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.validateKeywordUsage=wi.validSchemaType=wi.funcKeywordCode=wi.macroKeywordCode=void 0;var Er=Ne(),na=Zi(),$2=_n(),M2=Ju();function N2(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,l=e.macro.call(a.self,i,s,a),f=sO(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Er.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}wi.macroKeywordCode=N2;function D2(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:l,it:f}=t;L2(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,a,f):e.validate,m=sO(n,i,d),g=n.let("valid");t.block$data(g,y),t.ok((r=e.valid)!==null&&r!==void 0?r:g);function y(){if(e.errors===!1)R(),e.modifying&&iO(t),P(()=>t.error());else{let A=e.async?S():_();e.modifying&&iO(t),P(()=>F2(t,A))}}function S(){let A=n.let("ruleErrs",null);return n.try(()=>R((0,Er._)`await `),U=>n.assign(g,!1).if((0,Er._)`${U} instanceof ${f.ValidationError}`,()=>n.assign(A,(0,Er._)`${U}.errors`),()=>n.throw(U))),A}function _(){let A=(0,Er._)`${m}.errors`;return n.assign(A,null),R(Er.nil),A}function R(A=e.async?(0,Er._)`await `:Er.nil){let U=f.opts.passContext?na.default.this:na.default.self,B=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Er._)`${A}${(0,$2.callValidateCode)(t,m,U,B)}`,e.modifying)}function P(A){var U;n.if((0,Er.not)((U=e.valid)!==null&&U!==void 0?U:g),A)}}wi.funcKeywordCode=D2;function iO(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Er._)`${n.parentData}[${n.parentDataProperty}]`))}function F2(t,e){let{gen:r}=t;r.if((0,Er._)`Array.isArray(${e})`,()=>{r.assign(na.default.vErrors,(0,Er._)`${na.default.vErrors} === null ? ${e} : ${na.default.vErrors}.concat(${e})`).assign(na.default.errors,(0,Er._)`${na.default.vErrors}.length`),(0,M2.extendErrors)(t)},()=>t.error())}function L2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function sO(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Er.stringify)(r)})}function j2(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}wi.validSchemaType=j2;function U2({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}wi.validateKeywordUsage=U2});var lO=F(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.extendSubschemaMode=js.extendSubschemaData=js.getSubschema=void 0;var _i=Ne(),aO=We();function H2(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,_i._)`${t.schemaPath}${(0,_i.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,_i._)`${t.schemaPath}${(0,_i.getProperty)(e)}${(0,_i.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,aO.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}js.getSubschema=H2;function B2(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:m,opts:g}=e,y=l.let("data",(0,_i._)`${e.data}${(0,_i.getProperty)(r)}`,!0);f(y),t.errorPath=(0,_i.str)`${d}${(0,aO.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,_i._)`${r}`,t.dataPathArr=[...m,t.parentDataProperty]}if(i!==void 0){let d=i instanceof _i.Name?i:l.let("data",i,!0);f(d),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}js.extendSubschemaData=B2;function V2(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}js.extendSubschemaMode=V2});var pS=F((c7,cO)=>{"use strict";cO.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var fO=F((u7,uO)=>{"use strict";var Us=uO.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};wh(e,n,i,t,"",t)};Us.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Us.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Us.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Us.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function wh(t,e,r,n,i,s,a,l,f,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,l,f,d);for(var m in n){var g=n[m];if(Array.isArray(g)){if(m in Us.arrayKeywords)for(var y=0;y<g.length;y++)wh(t,e,r,g[y],i+"/"+m+"/"+y,s,i,m,n,y)}else if(m in Us.propsKeywords){if(g&&typeof g=="object")for(var S in g)wh(t,e,r,g[S],i+"/"+m+"/"+W2(S),s,i,m,n,S)}else(m in Us.keywords||t.allKeys&&!(m in Us.skipKeywords))&&wh(t,e,r,g,i+"/"+m,s,i,m,n)}r(n,i,s,a,l,f,d)}}function W2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Yu=F(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getSchemaRefs=Fr.resolveUrl=Fr.normalizeId=Fr._getFullPath=Fr.getFullPath=Fr.inlineRef=void 0;var z2=We(),J2=pS(),G2=fO(),Y2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function K2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!hS(t):e?dO(t)<=e:!1}Fr.inlineRef=K2;var Q2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hS(t){for(let e in t){if(Q2.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(hS)||typeof r=="object"&&hS(r))return!0}return!1}function dO(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Y2.has(r)&&(typeof t[r]=="object"&&(0,z2.eachItem)(t[r],n=>e+=dO(n)),e===1/0))return 1/0}return e}function pO(t,e="",r){r!==!1&&(e=Fl(e));let n=t.parse(e);return hO(t,n)}Fr.getFullPath=pO;function hO(t,e){return t.serialize(e).split("#")[0]+"#"}Fr._getFullPath=hO;var Z2=/#\/?$/;function Fl(t){return t?t.replace(Z2,""):""}Fr.normalizeId=Fl;function X2(t,e,r){return r=Fl(r),t.resolve(e,r)}Fr.resolveUrl=X2;var eU=/^[a-z_][-a-z0-9._]*$/i;function tU(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Fl(t[r]||e),s={"":i},a=pO(n,i,!1),l={},f=new Set;return G2(t,{allKeys:!0},(g,y,S,_)=>{if(_===void 0)return;let R=a+y,P=s[_];typeof g[r]=="string"&&(P=A.call(this,g[r])),U.call(this,g.$anchor),U.call(this,g.$dynamicAnchor),s[y]=P;function A(B){let V=this.opts.uriResolver.resolve;if(B=Fl(P?V(P,B):B),f.has(B))throw m(B);f.add(B);let W=this.refs[B];return typeof W=="string"&&(W=this.refs[W]),typeof W=="object"?d(g,W.schema,B):B!==Fl(R)&&(B[0]==="#"?(d(g,l[B],B),l[B]=g):this.refs[B]=R),B}function U(B){if(typeof B=="string"){if(!eU.test(B))throw new Error(`invalid anchor "${B}"`);A.call(this,`#${B}`)}}}),l;function d(g,y,S){if(y!==void 0&&!J2(g,y))throw m(S)}function m(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Fr.getSchemaRefs=tU});var Zu=F(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.getData=Hs.KeywordCxt=Hs.validateFunctionCode=void 0;var bO=GE(),mO=Gu(),gS=oS(),_h=Gu(),rU=tO(),Qu=oO(),mS=lO(),de=Ne(),Se=Zi(),nU=Yu(),Xi=We(),Ku=Ju();function iU(t){if(_O(t)&&(RO(t),wO(t))){aU(t);return}SO(t,()=>(0,bO.topBoolOrEmptySchema)(t))}Hs.validateFunctionCode=iU;function SO({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,de._)`${Se.default.data}, ${Se.default.valCxt}`,n.$async,()=>{t.code((0,de._)`"use strict"; ${gO(r,i)}`),oU(t,i),t.code(s)}):t.func(e,(0,de._)`${Se.default.data}, ${sU(i)}`,n.$async,()=>t.code(gO(r,i)).code(s))}function sU(t){return(0,de._)`{${Se.default.instancePath}="", ${Se.default.parentData}, ${Se.default.parentDataProperty}, ${Se.default.rootData}=${Se.default.data}${t.dynamicRef?(0,de._)`, ${Se.default.dynamicAnchors}={}`:de.nil}}={}`}function oU(t,e){t.if(Se.default.valCxt,()=>{t.var(Se.default.instancePath,(0,de._)`${Se.default.valCxt}.${Se.default.instancePath}`),t.var(Se.default.parentData,(0,de._)`${Se.default.valCxt}.${Se.default.parentData}`),t.var(Se.default.parentDataProperty,(0,de._)`${Se.default.valCxt}.${Se.default.parentDataProperty}`),t.var(Se.default.rootData,(0,de._)`${Se.default.valCxt}.${Se.default.rootData}`),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,de._)`${Se.default.valCxt}.${Se.default.dynamicAnchors}`)},()=>{t.var(Se.default.instancePath,(0,de._)`""`),t.var(Se.default.parentData,(0,de._)`undefined`),t.var(Se.default.parentDataProperty,(0,de._)`undefined`),t.var(Se.default.rootData,Se.default.data),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,de._)`{}`)})}function aU(t){let{schema:e,opts:r,gen:n}=t;SO(t,()=>{r.$comment&&e.$comment&&CO(t),dU(t),n.let(Se.default.vErrors,null),n.let(Se.default.errors,0),r.unevaluated&&lU(t),xO(t),mU(t)})}function lU(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,de._)`${r}.evaluated`),e.if((0,de._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,de._)`${t.evaluated}.props`,(0,de._)`undefined`)),e.if((0,de._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,de._)`${t.evaluated}.items`,(0,de._)`undefined`))}function gO(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,de._)`/*# sourceURL=${r} */`:de.nil}function cU(t,e){if(_O(t)&&(RO(t),wO(t))){uU(t,e);return}(0,bO.boolOrEmptySchema)(t,e)}function wO({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function _O(t){return typeof t.schema!="boolean"}function uU(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&CO(t),pU(t),hU(t);let s=n.const("_errs",Se.default.errors);xO(t,s),n.var(e,(0,de._)`${s} === ${Se.default.errors}`)}function RO(t){(0,Xi.checkUnknownRules)(t),fU(t)}function xO(t,e){if(t.opts.jtd)return yO(t,[],!1,e);let r=(0,mO.getSchemaTypes)(t.schema),n=(0,mO.coerceAndCheckDataType)(t,r);yO(t,r,!n,e)}function fU(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Xi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function dU(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Xi.checkStrictMode)(t,"default is ignored in the schema root")}function pU(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,nU.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function hU(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function CO({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,de._)`${Se.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,de.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,de._)`${Se.default.self}.opts.$comment(${s}, ${a}, ${l}.schema)`)}}function mU(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,de._)`${Se.default.errors} === 0`,()=>e.return(Se.default.data),()=>e.throw((0,de._)`new ${i}(${Se.default.vErrors})`)):(e.assign((0,de._)`${n}.errors`,Se.default.vErrors),s.unevaluated&&gU(t),e.return((0,de._)`${Se.default.errors} === 0`))}function gU({gen:t,evaluated:e,props:r,items:n}){r instanceof de.Name&&t.assign((0,de._)`${e}.props`,r),n instanceof de.Name&&t.assign((0,de._)`${e}.items`,n)}function yO(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:l,opts:f,self:d}=t,{RULES:m}=d;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Xi.schemaHasRulesButRef)(s,m))){i.block(()=>OO(t,"$ref",m.all.$ref.definition));return}f.jtd||yU(t,e),i.block(()=>{for(let y of m.rules)g(y);g(m.post)});function g(y){(0,gS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,_h.checkDataType)(y.type,a,f.strictNumbers)),vO(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,_h.reportTypeError)(t)),i.endIf()):vO(t,y),l||i.if((0,de._)`${Se.default.errors} === ${n||0}`))}}function vO(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,rU.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,gS.shouldUseRule)(n,s)&&OO(t,s.keyword,s.definition,e.type)})}function yU(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(vU(t,e),t.opts.allowUnionTypes||bU(t,e),SU(t,t.dataTypes))}function vU(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{EO(t.dataTypes,r)||yS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),_U(t,e)}}function bU(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&yS(t,"use allowUnionTypes to allow union type keyword")}function SU(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,gS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>wU(e,a))&&yS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function wU(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function EO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function _U(t,e){let r=[];for(let n of t.dataTypes)EO(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function yS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Xi.checkStrictMode)(t,e,t.opts.strictTypes)}var Rh=class{constructor(e,r,n){if((0,Qu.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Xi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",IO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qu.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Se.default.errors))}result(e,r,n){this.failResult((0,de.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,de.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,de._)`${r} !== undefined && (${(0,de.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Ku.reportExtraError:Ku.reportError)(this,this.def.error,r)}$dataError(){(0,Ku.reportError)(this,this.def.$dataError||Ku.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Ku.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=de.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=de.nil,r=de.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,de.or)((0,de._)`${i} === undefined`,r)),e!==de.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==de.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,de.or)(a(),l());function a(){if(n.length){if(!(r instanceof de.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,de._)`${(0,_h.checkDataTypes)(f,r,s.opts.strictNumbers,_h.DataType.Wrong)}`}return de.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,de._)`!${f}(${r})`}return de.nil}}subschema(e,r){let n=(0,mS.getSubschema)(this.it,e);(0,mS.extendSubschemaData)(n,this.it,e),(0,mS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return cU(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Xi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Xi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,de.Name)),!0}};Hs.KeywordCxt=Rh;function OO(t,e,r,n){let i=new Rh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Qu.funcKeywordCode)(i,r):"macro"in r?(0,Qu.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Qu.funcKeywordCode)(i,r)}var RU=/^\/(?:[^~]|~0|~1)*$/,xU=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function IO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Se.default.rootData;if(t[0]==="/"){if(!RU.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Se.default.rootData}else{let d=xU.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let m=+d[1];if(i=d[2],i==="#"){if(m>=e)throw new Error(f("property/index",m));return n[e-m]}if(m>e)throw new Error(f("data",m));if(s=r[e-m],!i)return s}let a=s,l=i.split("/");for(let d of l)d&&(s=(0,de._)`${s}${(0,de.getProperty)((0,Xi.unescapeJsonPointer)(d))}`,a=(0,de._)`${a} && ${s}`);return a;function f(d,m){return`Cannot access ${d} ${m} levels up, current level is ${e}`}}Hs.getData=IO});var xh=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var vS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};bS.default=vS});var Xu=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var SS=Yu(),wS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,SS.resolveUrl)(e,r,n),this.missingSchema=(0,SS.normalizeId)((0,SS.getFullPath)(e,this.missingRef))}};_S.default=wS});var Eh=F(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.resolveSchema=Rn.getCompilingSchema=Rn.resolveRef=Rn.compileSchema=Rn.SchemaEnv=void 0;var Jn=Ne(),CU=xh(),ia=Zi(),Gn=Yu(),PO=We(),EU=Zu(),Ll=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Gn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Rn.SchemaEnv=Ll;function xS(t){let e=kO.call(this,t);if(e)return e;let r=(0,Gn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=a.scopeValue("Error",{ref:CU.default,code:(0,Jn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let d={gen:a,allErrors:this.opts.allErrors,data:ia.default.data,parentData:ia.default.parentData,parentDataProperty:ia.default.parentDataProperty,dataNames:[ia.default.data],dataPathArr:[Jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Jn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Jn._)`""`,opts:this.opts,self:this},m;try{this._compilations.add(t),(0,EU.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let g=a.toString();m=`${a.scopeRefs(ia.default.scope)}return ${g}`,this.opts.code.process&&(m=this.opts.code.process(m,t));let S=new Function(`${ia.default.self}`,`${ia.default.scope}`,m)(this,this.scope.get());if(this.scope.value(f,{ref:S}),S.errors=null,S.schema=t.schema,S.schemaEnv=t,t.$async&&(S.$async=!0),this.opts.code.source===!0&&(S.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:_,items:R}=d;S.evaluated={props:_ instanceof Jn.Name?void 0:_,items:R instanceof Jn.Name?void 0:R,dynamicProps:_ instanceof Jn.Name,dynamicItems:R instanceof Jn.Name},S.source&&(S.source.evaluated=(0,Jn.stringify)(S.evaluated))}return t.validate=S,t}catch(g){throw delete t.validate,delete t.validateName,m&&this.logger.error("Error compiling schema, function code:",m),g}finally{this._compilations.delete(t)}}Rn.compileSchema=xS;function OU(t,e,r){var n;r=(0,Gn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=kU.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(s=new Ll({schema:a,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=IU.call(this,s)}Rn.resolveRef=OU;function IU(t){return(0,Gn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:xS.call(this,t)}function kO(t){for(let e of this._compilations)if(PU(e,t))return e}Rn.getCompilingSchema=kO;function PU(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function kU(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Ch.call(this,t,e)}function Ch(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Gn._getFullPath)(this.opts.uriResolver,r),i=(0,Gn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return RS.call(this,r,t);let s=(0,Gn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let l=Ch.call(this,t,a);return typeof l?.schema!="object"?void 0:RS.call(this,r,l)}if(typeof a?.schema=="object"){if(a.validate||xS.call(this,a),s===(0,Gn.normalizeId)(e)){let{schema:l}=a,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,Gn.resolveUrl)(this.opts.uriResolver,i,d)),new Ll({schema:l,schemaId:f,root:t,baseId:i})}return RS.call(this,r,a)}}Rn.resolveSchema=Ch;var TU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function RS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,PO.unescapeFragment)(l)];if(f===void 0)return;r=f;let d=typeof r=="object"&&r[this.opts.schemaId];!TU.has(l)&&d&&(e=(0,Gn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,PO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,Gn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Ch.call(this,n,l)}let{schemaId:a}=this.opts;if(s=s||new Ll({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var TO=F((g7,AU)=>{AU.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var OS=F((y7,DO)=>{"use strict";var qU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qO=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),CS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),$O=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),$U=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ES(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var MU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function AO(t){return t.length=0,!0}function NU(t,e,r){if(t.length){let n=ES(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function DU(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,l=NU;for(let f=0;f<t.length;f++){let d=t[f];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(a=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,r))break;l=AO}else{i.push(d);continue}}return i.length&&(l===AO?r.zone=i.join(""):a?n.push(i.join("")):n.push(ES(i))),r.address=n.join(""),r}function MO(t){if(FU(t,":")<2)return{host:t,isIPV6:!1};let e=DU(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function FU(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function LU(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var jU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},UU=/[@/?#:]/g,HU=/[@/?#]/g;function NO(t,e){let r=e?HU:UU;return r.lastIndex=0,t.replace(r,n=>jU[n])}function BU(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(CS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&$O(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function VU(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(CS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&$O(s)?e+=s:e+="%"+i,r+=2;continue}}$U(t[r])?e+=t[r]:e+=escape(t[r])}return e}function WU(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(CS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function zU(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!qO(r)){let n=MO(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=NO(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}DO.exports={nonSimpleDomain:MU,recomposeAuthority:zU,reescapeHostDelimiters:NO,normalizePercentEncoding:BU,normalizePathEncoding:VU,escapePreservingEscapes:WU,removeDotSegments:LU,isIPv4:qO,isUUID:qU,normalizeIPv6:MO,stringArrayToHexStripped:ES}});var HO=F((v7,UO)=>{"use strict";var{isUUID:JU}=OS(),GU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,YU=["http","https","ws","wss","urn","urn:uuid"];function KU(t){return YU.indexOf(t)!==-1}function IS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function FO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function LO(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function QU(t){return t.secure=IS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ZU(t){if((t.port===(IS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function XU(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(GU);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=PS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function eH(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=PS(i);s&&(t=s.serialize(t,e));let a=t,l=t.nss;return a.path=`${n||e.nid}:${l}`,e.skipEscape=!0,a}function tH(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!JU(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function rH(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var jO={scheme:"http",domainHost:!0,parse:FO,serialize:LO},nH={scheme:"https",domainHost:jO.domainHost,parse:FO,serialize:LO},Oh={scheme:"ws",domainHost:!0,parse:QU,serialize:ZU},iH={scheme:"wss",domainHost:Oh.domainHost,parse:Oh.parse,serialize:Oh.serialize},sH={scheme:"urn",parse:XU,serialize:eH,skipNormalize:!0},oH={scheme:"urn:uuid",parse:tH,serialize:rH,skipNormalize:!0},Ih={http:jO,https:nH,ws:Oh,wss:iH,urn:sH,"urn:uuid":oH};Object.setPrototypeOf(Ih,null);function PS(t){return t&&(Ih[t]||Ih[t.toLowerCase()])||void 0}UO.exports={wsIsSecure:IS,SCHEMES:Ih,isValidSchemeName:KU,getSchemeHandler:PS}});var GO=F((b7,Ph)=>{"use strict";var{normalizeIPv6:aH,removeDotSegments:ef,recomposeAuthority:lH,normalizePercentEncoding:cH,normalizePathEncoding:uH,escapePreservingEscapes:fH,reescapeHostDelimiters:dH,isIPv4:pH,nonSimpleDomain:hH}=OS(),{SCHEMES:mH,getSchemeHandler:VO}=HO();function gH(t,e){return typeof t=="string"?t=wH(t,e):typeof t=="object"&&(t=jl(sa(t,e),e)),t}function yH(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=WO(jl(t,n),jl(e,n),n,!0);return n.skipEscape=!0,sa(i,n)}function WO(t,e,r,n){let i={};return n||(t=jl(sa(t,r),r),e=jl(sa(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=ef(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=ef(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=ef(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=ef(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function vH(t,e,r){let n=BO(t,r),i=BO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function sa(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=VO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=cH(r.path):(r.path=fH(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=lH(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=ef(l)),a===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var bH=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function SH(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function zO(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let a=t.match(bH);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let l=SH(n,a);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(pH(n.host)===!1){let m=aH(n.host);n.host=m.host.toLowerCase(),s=m.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let f=VO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&hH(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=dH(unescape(n.host),s))),n.path&&(n.path=uH(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function jl(t,e){return zO(t,e).parsed}function wH(t,e){return JO(t,e).normalized}function JO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=zO(t,e);return{normalized:n?t:sa(r,e),malformedAuthorityOrPort:n}}function BO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=JO(t,e);return n?void 0:r}if(typeof t=="object")return sa(t,e)}var kS={SCHEMES:mH,normalize:gH,resolve:yH,resolveComponent:WO,equal:vH,serialize:sa,parse:jl};Ph.exports=kS;Ph.exports.default=kS;Ph.exports.fastUri=kS});var KO=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var YO=GO();YO.code='require("ajv/dist/runtime/uri").default';TS.default=YO});var iI=F(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.CodeGen=Xt.Name=Xt.nil=Xt.stringify=Xt.str=Xt._=Xt.KeywordCxt=void 0;var _H=Zu();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return _H.KeywordCxt}});var Ul=Ne();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return Ul._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return Ul.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return Ul.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return Ul.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return Ul.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return Ul.CodeGen}});var RH=xh(),tI=Xu(),xH=sS(),tf=Eh(),CH=Ne(),rf=Yu(),kh=Gu(),qS=We(),QO=TO(),EH=KO(),rI=(t,e)=>new RegExp(t,e);rI.code="new RegExp";var OH=["removeAdditional","useDefaults","coerceTypes"],IH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),PH={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},kH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ZO=200;function TH(t){var e,r,n,i,s,a,l,f,d,m,g,y,S,_,R,P,A,U,B,V,W,X,T,x,k;let N=t.strict,j=(e=t.code)===null||e===void 0?void 0:e.optimize,$=j===!0||j===void 0?1:j||0,G=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:rI,K=(i=t.uriResolver)!==null&&i!==void 0?i:EH.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&f!==void 0?f:!0,strictTypes:(m=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&m!==void 0?m:"log",strictTuples:(y=(g=t.strictTuples)!==null&&g!==void 0?g:N)!==null&&y!==void 0?y:"log",strictRequired:(_=(S=t.strictRequired)!==null&&S!==void 0?S:N)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:$,regExp:G}:{optimize:$,regExp:G},loopRequired:(R=t.loopRequired)!==null&&R!==void 0?R:ZO,loopEnum:(P=t.loopEnum)!==null&&P!==void 0?P:ZO,meta:(A=t.meta)!==null&&A!==void 0?A:!0,messages:(U=t.messages)!==null&&U!==void 0?U:!0,inlineRefs:(B=t.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(V=t.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(W=t.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(x=t.unicodeRegExp)!==null&&x!==void 0?x:!0,int32range:(k=t.int32range)!==null&&k!==void 0?k:!0,uriResolver:K}}var nf=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...TH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new CH.ValueScope({scope:{},prefixes:IH,es5:r,lines:n}),this.logger=DH(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,xH.getRules)(),XO.call(this,PH,e,"NOT SUPPORTED"),XO.call(this,kH,e,"DEPRECATED","warn"),this._metaOpts=MH.call(this),e.formats&&qH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&$H.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),AH.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=QO;n==="id"&&(i={...QO},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(m,g){await s.call(this,m.$schema);let y=this._addSchema(m,g);return y.validate||a.call(this,y)}async function s(m){m&&!this.getSchema(m)&&await i.call(this,{$ref:m},!0)}async function a(m){try{return this._compileSchemaEnv(m)}catch(g){if(!(g instanceof tI.default))throw g;return l.call(this,g),await f.call(this,g.missingSchema),a.call(this,m)}}function l({missingSchema:m,missingRef:g}){if(this.refs[m])throw new Error(`AnySchema ${m} is loaded but ${g} cannot be resolved`)}async function f(m){let g=await d.call(this,m);this.refs[m]||await s.call(this,g.$schema),this.refs[m]||this.addSchema(g,m,r)}async function d(m){let g=this._loading[m];if(g)return g;try{return await(this._loading[m]=n(m))}finally{delete this._loading[m]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,rf.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=eI.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new tf.SchemaEnv({schema:{},schemaId:n});if(r=tf.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=eI.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,rf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(LH.call(this,n,r),!r)return(0,qS.eachItem)(n,s=>AS.call(this,s)),this;UH.call(this,r);let i={...r,type:(0,kh.getJSONTypes)(r.type),schemaType:(0,kh.getJSONTypes)(r.schemaType)};return(0,qS.eachItem)(n,i.type.length===0?s=>AS.call(this,s,i):s=>i.type.forEach(a=>AS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let l of s)a=a[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:d}=f.definition,m=a[l];d&&m&&(a[l]=nI(m))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:l}=this.opts;if(typeof e=="object")a=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,rf.normalizeId)(a||n);let d=rf.getSchemaRefs.call(this,e,n);return f=new tf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):tf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{tf.compileSchema.call(this,e)}finally{this.opts=r}}};nf.ValidationError=RH.default;nf.MissingRefError=tI.default;Xt.default=nf;function XO(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function eI(t){return t=(0,rf.normalizeId)(t),this.schemas[t]||this.refs[t]}function AH(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function qH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function $H(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function MH(){let t={...this.opts};for(let e of OH)delete t[e];return t}var NH={log(){},warn(){},error(){}};function DH(t){if(t===!1)return NH;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var FH=/^[a-z_$][a-z0-9_$:-]*$/i;function LH(t,e){let{RULES:r}=this;if((0,qS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!FH.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function AS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,kh.getJSONTypes)(e.type),schemaType:(0,kh.getJSONTypes)(e.schemaType)}};e.before?jH.call(this,a,l,e.before):a.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function jH(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function UH(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=nI(e)),t.validateSchema=this.compile(e,!0))}var HH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function nI(t){return{anyOf:[t,HH]}}});var sI=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var BH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};$S.default=BH});var cI=F(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.callRef=oa.getValidate=void 0;var VH=Xu(),oI=_n(),Lr=Ne(),Hl=Zi(),aI=Eh(),Th=We(),WH={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:l,self:f}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return g();let m=aI.resolveRef.call(f,d,i,r);if(m===void 0)throw new VH.default(n.opts.uriResolver,i,r);if(m instanceof aI.SchemaEnv)return y(m);return S(m);function g(){if(s===d)return Ah(t,a,s,s.$async);let _=e.scopeValue("root",{ref:d});return Ah(t,(0,Lr._)`${_}.validate`,d,d.$async)}function y(_){let R=lI(t,_);Ah(t,R,_,_.$async)}function S(_){let R=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,Lr.stringify)(_)}:{ref:_}),P=e.name("valid"),A=t.subschema({schema:_,dataTypes:[],schemaPath:Lr.nil,topSchemaRef:R,errSchemaPath:r},P);t.mergeEvaluated(A),t.ok(P)}}};function lI(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Lr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}oa.getValidate=lI;function Ah(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:l,opts:f}=s,d=f.passContext?Hl.default.this:Lr.nil;n?m():g();function m(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,Lr._)`await ${(0,oI.callValidateCode)(t,e,d)}`),S(e),a||i.assign(_,!0)},R=>{i.if((0,Lr._)`!(${R} instanceof ${s.ValidationError})`,()=>i.throw(R)),y(R),a||i.assign(_,!1)}),t.ok(_)}function g(){t.result((0,oI.callValidateCode)(t,e,d),()=>S(e),()=>y(e))}function y(_){let R=(0,Lr._)`${_}.errors`;i.assign(Hl.default.vErrors,(0,Lr._)`${Hl.default.vErrors} === null ? ${R} : ${Hl.default.vErrors}.concat(${R})`),i.assign(Hl.default.errors,(0,Lr._)`${Hl.default.vErrors}.length`)}function S(_){var R;if(!s.opts.unevaluated)return;let P=(R=r?.validate)===null||R===void 0?void 0:R.evaluated;if(s.props!==!0)if(P&&!P.dynamicProps)P.props!==void 0&&(s.props=Th.mergeEvaluated.props(i,P.props,s.props));else{let A=i.var("props",(0,Lr._)`${_}.evaluated.props`);s.props=Th.mergeEvaluated.props(i,A,s.props,Lr.Name)}if(s.items!==!0)if(P&&!P.dynamicItems)P.items!==void 0&&(s.items=Th.mergeEvaluated.items(i,P.items,s.items));else{let A=i.var("items",(0,Lr._)`${_}.evaluated.items`);s.items=Th.mergeEvaluated.items(i,A,s.items,Lr.Name)}}}oa.callRef=Ah;oa.default=WH});var uI=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var zH=sI(),JH=cI(),GH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",zH.default,JH.default];MS.default=GH});var fI=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var qh=Ne(),Bs=qh.operators,$h={maximum:{okStr:"<=",ok:Bs.LTE,fail:Bs.GT},minimum:{okStr:">=",ok:Bs.GTE,fail:Bs.LT},exclusiveMaximum:{okStr:"<",ok:Bs.LT,fail:Bs.GTE},exclusiveMinimum:{okStr:">",ok:Bs.GT,fail:Bs.LTE}},YH={message:({keyword:t,schemaCode:e})=>(0,qh.str)`must be ${$h[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,qh._)`{comparison: ${$h[t].okStr}, limit: ${e}}`},KH={keyword:Object.keys($h),type:"number",schemaType:"number",$data:!0,error:YH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,qh._)`${r} ${$h[e].fail} ${n} || isNaN(${r})`)}};NS.default=KH});var dI=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var sf=Ne(),QH={message:({schemaCode:t})=>(0,sf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,sf._)`{multipleOf: ${t}}`},ZH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:QH,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),l=s?(0,sf._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,sf._)`${a} !== parseInt(${a})`;t.fail$data((0,sf._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};DS.default=ZH});var hI=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});function pI(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}FS.default=pI;pI.code='require("ajv/dist/runtime/ucs2length").default'});var mI=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var aa=Ne(),XH=We(),eB=hI(),tB={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,aa.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,aa._)`{limit: ${t}}`},rB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:tB,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?aa.operators.GT:aa.operators.LT,a=i.opts.unicode===!1?(0,aa._)`${r}.length`:(0,aa._)`${(0,XH.useFunc)(t.gen,eB.default)}(${r})`;t.fail$data((0,aa._)`${a} ${s} ${n}`)}};LS.default=rB});var gI=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var nB=_n(),iB=We(),Bl=Ne(),sB={message:({schemaCode:t})=>(0,Bl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Bl._)`{pattern: ${t}}`},oB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:sB,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t,l=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=a.opts.code,d=f.code==="new RegExp"?(0,Bl._)`new RegExp`:(0,iB.useFunc)(e,f),m=e.let("valid");e.try(()=>e.assign(m,(0,Bl._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(m,!1)),t.fail$data((0,Bl._)`!${m}`)}else{let f=(0,nB.usePattern)(t,i);t.fail$data((0,Bl._)`!${f}.test(${r})`)}}};jS.default=oB});var yI=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var of=Ne(),aB={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,of.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,of._)`{limit: ${t}}`},lB={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:aB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?of.operators.GT:of.operators.LT;t.fail$data((0,of._)`Object.keys(${r}).length ${i} ${n}`)}};US.default=lB});var vI=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var af=_n(),lf=Ne(),cB=We(),uB={message:({params:{missingProperty:t}})=>(0,lf.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,lf._)`{missingProperty: ${t}}`},fB={keyword:"required",type:"object",schemaType:"array",$data:!0,error:uB,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:l}=a;if(!s&&r.length===0)return;let f=r.length>=l.loopRequired;if(a.allErrors?d():m(),l.strictRequired){let S=t.parentSchema.properties,{definedProperties:_}=t.it;for(let R of r)if(S?.[R]===void 0&&!_.has(R)){let P=a.schemaEnv.baseId+a.errSchemaPath,A=`required property "${R}" is not defined at "${P}" (strictRequired)`;(0,cB.checkStrictMode)(a,A,a.opts.strictRequired)}}function d(){if(f||s)t.block$data(lf.nil,g);else for(let S of r)(0,af.checkReportMissingProp)(t,S)}function m(){let S=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>y(S,_)),t.ok(_)}else e.if((0,af.checkMissingProp)(t,r,S)),(0,af.reportMissingProp)(t,S),e.else()}function g(){e.forOf("prop",n,S=>{t.setParams({missingProperty:S}),e.if((0,af.noPropertyInData)(e,i,S,l.ownProperties),()=>t.error())})}function y(S,_){t.setParams({missingProperty:S}),e.forOf(S,n,()=>{e.assign(_,(0,af.propertyInData)(e,i,S,l.ownProperties)),e.if((0,lf.not)(_),()=>{t.error(),e.break()})},lf.nil)}}};HS.default=fB});var bI=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var cf=Ne(),dB={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,cf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,cf._)`{limit: ${t}}`},pB={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:dB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?cf.operators.GT:cf.operators.LT;t.fail$data((0,cf._)`${r}.length ${i} ${n}`)}};BS.default=pB});var Mh=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var SI=pS();SI.code='require("ajv/dist/runtime/equal").default';VS.default=SI});var wI=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var WS=Gu(),er=Ne(),hB=We(),mB=Mh(),gB={message:({params:{i:t,j:e}})=>(0,er.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,er._)`{i: ${t}, j: ${e}}`},yB={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:gB,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:l}=t;if(!n&&!i)return;let f=e.let("valid"),d=s.items?(0,WS.getSchemaTypes)(s.items):[];t.block$data(f,m,(0,er._)`${a} === false`),t.ok(f);function m(){let _=e.let("i",(0,er._)`${r}.length`),R=e.let("j");t.setParams({i:_,j:R}),e.assign(f,!0),e.if((0,er._)`${_} > 1`,()=>(g()?y:S)(_,R))}function g(){return d.length>0&&!d.some(_=>_==="object"||_==="array")}function y(_,R){let P=e.name("item"),A=(0,WS.checkDataTypes)(d,P,l.opts.strictNumbers,WS.DataType.Wrong),U=e.const("indices",(0,er._)`{}`);e.for((0,er._)`;${_}--;`,()=>{e.let(P,(0,er._)`${r}[${_}]`),e.if(A,(0,er._)`continue`),d.length>1&&e.if((0,er._)`typeof ${P} == "string"`,(0,er._)`${P} += "_"`),e.if((0,er._)`typeof ${U}[${P}] == "number"`,()=>{e.assign(R,(0,er._)`${U}[${P}]`),t.error(),e.assign(f,!1).break()}).code((0,er._)`${U}[${P}] = ${_}`)})}function S(_,R){let P=(0,hB.useFunc)(e,mB.default),A=e.name("outer");e.label(A).for((0,er._)`;${_}--;`,()=>e.for((0,er._)`${R} = ${_}; ${R}--;`,()=>e.if((0,er._)`${P}(${r}[${_}], ${r}[${R}])`,()=>{t.error(),e.assign(f,!1).break(A)})))}}};zS.default=yB});var _I=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var JS=Ne(),vB=We(),bB=Mh(),SB={message:"must be equal to constant",params:({schemaCode:t})=>(0,JS._)`{allowedValue: ${t}}`},wB={keyword:"const",$data:!0,error:SB,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,JS._)`!${(0,vB.useFunc)(e,bB.default)}(${r}, ${i})`):t.fail((0,JS._)`${s} !== ${r}`)}};GS.default=wB});var RI=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var uf=Ne(),_B=We(),RB=Mh(),xB={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,uf._)`{allowedValues: ${t}}`},CB={keyword:"enum",schemaType:"array",$data:!0,error:xB,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=a.opts.loopEnum,f,d=()=>f??(f=(0,_B.useFunc)(e,RB.default)),m;if(l||n)m=e.let("valid"),t.block$data(m,g);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let S=e.const("vSchema",s);m=(0,uf.or)(...i.map((_,R)=>y(S,R)))}t.pass(m);function g(){e.assign(m,!1),e.forOf("v",s,S=>e.if((0,uf._)`${d()}(${r}, ${S})`,()=>e.assign(m,!0).break()))}function y(S,_){let R=i[_];return typeof R=="object"&&R!==null?(0,uf._)`${d()}(${r}, ${S}[${_}])`:(0,uf._)`${r} === ${R}`}}};YS.default=CB});var xI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var EB=fI(),OB=dI(),IB=mI(),PB=gI(),kB=yI(),TB=vI(),AB=bI(),qB=wI(),$B=_I(),MB=RI(),NB=[EB.default,OB.default,IB.default,PB.default,kB.default,TB.default,AB.default,qB.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$B.default,MB.default];KS.default=NB});var ZS=F(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.validateAdditionalItems=void 0;var la=Ne(),QS=We(),DB={message:({params:{len:t}})=>(0,la.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,la._)`{limit: ${t}}`},FB={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:DB,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,QS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}CI(t,n)}};function CI(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let l=r.const("len",(0,la._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,la._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,QS.alwaysValidSchema)(a,n)){let d=r.var("valid",(0,la._)`${l} <= ${e.length}`);r.if((0,la.not)(d),()=>f(d)),t.ok(d)}function f(d){r.forRange("i",e.length,l,m=>{t.subschema({keyword:s,dataProp:m,dataPropType:QS.Type.Num},d),a.allErrors||r.if((0,la.not)(d),()=>r.break())})}}ff.validateAdditionalItems=CI;ff.default=FB});var XS=F(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.validateTuple=void 0;var EI=Ne(),Nh=We(),LB=_n(),jB={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return OI(t,"additionalItems",e);r.items=!0,!(0,Nh.alwaysValidSchema)(r,e)&&t.ok((0,LB.validateArray)(t))}};function OI(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:l}=t;m(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Nh.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),d=n.const("len",(0,EI._)`${s}.length`);r.forEach((g,y)=>{(0,Nh.alwaysValidSchema)(l,g)||(n.if((0,EI._)`${d} > ${y}`,()=>t.subschema({keyword:a,schemaProp:y,dataProp:y},f)),t.ok(f))});function m(g){let{opts:y,errSchemaPath:S}=l,_=r.length,R=_===g.minItems&&(_===g.maxItems||g[e]===!1);if(y.strictTuples&&!R){let P=`"${a}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${S}"`;(0,Nh.checkStrictMode)(l,P,y.strictTuples)}}}df.validateTuple=OI;df.default=jB});var II=F(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var UB=XS(),HB={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,UB.validateTuple)(t,"items")};e0.default=HB});var kI=F(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var PI=Ne(),BB=We(),VB=_n(),WB=ZS(),zB={message:({params:{len:t}})=>(0,PI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,PI._)`{limit: ${t}}`},JB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:zB,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,BB.alwaysValidSchema)(n,e)&&(i?(0,WB.validateAdditionalItems)(t,i):t.ok((0,VB.validateArray)(t)))}};t0.default=JB});var TI=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var xn=Ne(),Dh=We(),GB={message:({params:{min:t,max:e}})=>e===void 0?(0,xn.str)`must contain at least ${t} valid item(s)`:(0,xn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,xn._)`{minContains: ${t}}`:(0,xn._)`{minContains: ${t}, maxContains: ${e}}`},YB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:GB,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,l,{minContains:f,maxContains:d}=n;s.opts.next?(a=f===void 0?1:f,l=d):a=1;let m=e.const("len",(0,xn._)`${i}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,Dh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Dh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Dh.alwaysValidSchema)(s,r)){let R=(0,xn._)`${m} >= ${a}`;l!==void 0&&(R=(0,xn._)`${R} && ${m} <= ${l}`),t.pass(R);return}s.items=!0;let g=e.name("valid");l===void 0&&a===1?S(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,xn._)`${i}.length > 0`,y)):(e.let(g,!1),y()),t.result(g,()=>t.reset());function y(){let R=e.name("_valid"),P=e.let("count",0);S(R,()=>e.if(R,()=>_(P)))}function S(R,P){e.forRange("i",0,m,A=>{t.subschema({keyword:"contains",dataProp:A,dataPropType:Dh.Type.Num,compositeRule:!0},R),P()})}function _(R){e.code((0,xn._)`${R}++`),l===void 0?e.if((0,xn._)`${R} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,xn._)`${R} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,xn._)`${R} >= ${a}`,()=>e.assign(g,!0)))}}};r0.default=YB});var $I=F(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.validateSchemaDeps=Ri.validatePropertyDeps=Ri.error=void 0;var n0=Ne(),KB=We(),pf=_n();Ri.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,n0.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,n0._)`{property: ${t},
28
28
  missingProperty: ${n},
29
29
  depsCount: ${e},
30
- deps: ${r}}`};var KB={keyword:"dependencies",type:"object",schemaType:"object",error:Ri.error,code(t){let[e,r]=QB(t);TI(t,e),AI(t,r)}};function QB({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function TI(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let l=e[a];if(l.length===0)continue;let f=(0,pf.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let d of l)(0,pf.checkReportMissingProp)(t,d)}):(r.if((0,n0._)`${f} && (${(0,pf.checkMissingProp)(t,l,s)})`),(0,pf.reportMissingProp)(t,s),r.else())}}Ri.validatePropertyDeps=TI;function AI(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let l in e)(0,YB.alwaysValidSchema)(s,e[l])||(r.if((0,pf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}Ri.validateSchemaDeps=AI;Ri.default=KB});var MI=F(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var $I=Ne(),ZB=We(),XB={message:"property name must be valid",params:({params:t})=>(0,$I._)`{propertyName: ${t.propertyName}}`},eV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:XB,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,ZB.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,$I.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};i0.default=eV});var o0=F(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});var Nh=_n(),Yn=Ne(),tV=Zi(),Dh=We(),rV={message:"must NOT have additional properties",params:({params:t})=>(0,Yn._)`{additionalProperty: ${t.additionalProperty}}`},nV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:rV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,Dh.alwaysValidSchema)(a,r))return;let d=(0,Nh.allSchemaProperties)(n.properties),m=(0,Nh.allSchemaProperties)(n.patternProperties);g(),t.ok((0,Yn._)`${s} === ${tV.default.errors}`);function g(){e.forIn("key",i,P=>{!d.length&&!m.length?_(P):e.if(y(P),()=>_(P))})}function y(P){let A;if(d.length>8){let U=(0,Dh.schemaRefOrVal)(a,n.properties,"properties");A=(0,Nh.isOwnProperty)(e,U,P)}else d.length?A=(0,Yn.or)(...d.map(U=>(0,Yn._)`${P} === ${U}`)):A=Yn.nil;return m.length&&(A=(0,Yn.or)(A,...m.map(U=>(0,Yn._)`${(0,Nh.usePattern)(t,U)}.test(${P})`))),(0,Yn.not)(A)}function S(P){e.code((0,Yn._)`delete ${i}[${P}]`)}function _(P){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){S(P);return}if(r===!1){t.setParams({additionalProperty:P}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Dh.alwaysValidSchema)(a,r)){let A=e.name("valid");f.removeAdditional==="failing"?(R(P,A,!1),e.if((0,Yn.not)(A),()=>{t.reset(),S(P)})):(R(P,A),l||e.if((0,Yn.not)(A),()=>e.break()))}}function R(P,A,U){let B={keyword:"additionalProperties",dataProp:P,dataPropType:Dh.Type.Str};U===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(B,A)}}};s0.default=nV});var FI=F(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});var iV=Zu(),NI=_n(),a0=We(),DI=o0(),sV={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&DI.default.code(new iV.KeywordCxt(s,DI.default,"additionalProperties"));let a=(0,NI.allSchemaProperties)(r);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=a0.mergeEvaluated.props(e,(0,a0.toHash)(a),s.props));let l=a.filter(g=>!(0,a0.alwaysValidSchema)(s,r[g]));if(l.length===0)return;let f=e.name("valid");for(let g of l)d(g)?m(g):(e.if((0,NI.propertyInData)(e,i,g,s.opts.ownProperties)),m(g),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(g),t.ok(f);function d(g){return s.opts.useDefaults&&!s.compositeRule&&r[g].default!==void 0}function m(g){t.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};l0.default=sV});var HI=F(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var LI=_n(),Fh=Ne(),jI=We(),UI=We(),oV={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,l=(0,LI.allSchemaProperties)(r),f=l.filter(R=>(0,jI.alwaysValidSchema)(s,r[R]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&i.properties,m=e.name("valid");s.props!==!0&&!(s.props instanceof Fh.Name)&&(s.props=(0,UI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let R of l)d&&S(R),s.allErrors?_(R):(e.var(m,!0),_(R),e.if(m))}function S(R){for(let P in d)new RegExp(R).test(P)&&(0,jI.checkStrictMode)(s,`property ${P} matches pattern ${R} (use allowMatchingProperties)`)}function _(R){e.forIn("key",n,P=>{e.if((0,Fh._)`${(0,LI.usePattern)(t,R)}.test(${P})`,()=>{let A=f.includes(R);A||t.subschema({keyword:"patternProperties",schemaProp:R,dataProp:P,dataPropType:UI.Type.Str},m),s.opts.unevaluated&&g!==!0?e.assign((0,Fh._)`${g}[${P}]`,!0):!A&&!s.allErrors&&e.if((0,Fh.not)(m),()=>e.break())})})}}};c0.default=oV});var BI=F(u0=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var aV=We(),lV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,aV.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};u0.default=lV});var VI=F(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});var cV=_n(),uV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cV.validateUnion,error:{message:"must match a schema in anyOf"}};f0.default=uV});var WI=F(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});var Lh=Ne(),fV=We(),dV={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Lh._)`{passingSchemas: ${t.passing}}`},pV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:dV,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(a,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((m,g)=>{let y;(0,fV.alwaysValidSchema)(i,m)?e.var(f,!0):y=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,Lh._)`${f} && ${a}`).assign(a,!1).assign(l,(0,Lh._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(l,g),y&&t.mergeEvaluated(y,Lh.Name)})})}}};d0.default=pV});var zI=F(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});var hV=We(),mV={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,hV.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(l)})}};p0.default=mV});var YI=F(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var jh=Ne(),GI=We(),gV={message:({params:t})=>(0,jh.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,jh._)`{failingKeyword: ${t.ifClause}}`},yV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:gV,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,GI.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=JI(n,"then"),s=JI(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let m=e.let("ifClause");t.setParams({ifClause:m}),e.if(l,d("then",m),d("else",m))}else i?e.if(l,d("then")):e.if((0,jh.not)(l),d("else"));t.pass(a,()=>t.error(!0));function f(){let m=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(m)}function d(m,g){return()=>{let y=t.subschema({keyword:m},l);e.assign(a,l),t.mergeValidEvaluated(y,a),g?e.assign(g,(0,jh._)`${m}`):t.setParams({ifClause:m})}}}};function JI(t,e){let r=t.schema[e];return r!==void 0&&!(0,GI.alwaysValidSchema)(t,r)}h0.default=yV});var KI=F(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var vV=We(),bV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,vV.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};m0.default=bV});var QI=F(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var SV=ZS(),wV=OI(),_V=XS(),RV=PI(),xV=kI(),CV=qI(),EV=MI(),OV=o0(),IV=FI(),PV=HI(),kV=BI(),TV=VI(),AV=WI(),qV=zI(),$V=YI(),MV=KI();function NV(t=!1){let e=[kV.default,TV.default,AV.default,qV.default,$V.default,MV.default,EV.default,OV.default,CV.default,IV.default,PV.default];return t?e.push(wV.default,RV.default):e.push(SV.default,_V.default),e.push(xV.default),e}g0.default=NV});var ZI=F(y0=>{"use strict";Object.defineProperty(y0,"__esModule",{value:!0});var Mt=Ne(),DV={message:({schemaCode:t})=>(0,Mt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Mt._)`{format: ${t}}`},FV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:DV,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:l}=t,{opts:f,errSchemaPath:d,schemaEnv:m,self:g}=l;if(!f.validateFormats)return;i?y():S();function y(){let _=r.scopeValue("formats",{ref:g.formats,code:f.code.formats}),R=r.const("fDef",(0,Mt._)`${_}[${a}]`),P=r.let("fType"),A=r.let("format");r.if((0,Mt._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>r.assign(P,(0,Mt._)`${R}.type || "string"`).assign(A,(0,Mt._)`${R}.validate`),()=>r.assign(P,(0,Mt._)`"string"`).assign(A,R)),t.fail$data((0,Mt.or)(U(),B()));function U(){return f.strictSchema===!1?Mt.nil:(0,Mt._)`${a} && !${A}`}function B(){let V=m.$async?(0,Mt._)`(${R}.async ? await ${A}(${n}) : ${A}(${n}))`:(0,Mt._)`${A}(${n})`,W=(0,Mt._)`(typeof ${A} == "function" ? ${V} : ${A}.test(${n}))`;return(0,Mt._)`${A} && ${A} !== true && ${P} === ${e} && !${W}`}}function S(){let _=g.formats[s];if(!_){U();return}if(_===!0)return;let[R,P,A]=B(_);R===e&&t.pass(V());function U(){if(f.strictSchema===!1){g.logger.warn(W());return}throw new Error(W());function W(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function B(W){let X=W instanceof RegExp?(0,Mt.regexpCode)(W):f.code.formats?(0,Mt._)`${f.code.formats}${(0,Mt.getProperty)(s)}`:void 0,T=r.scopeValue("formats",{key:s,ref:W,code:X});return typeof W=="object"&&!(W instanceof RegExp)?[W.type||"string",W.validate,(0,Mt._)`${T}.validate`]:["string",W,T]}function V(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!m.$async)throw new Error("async format in sync schema");return(0,Mt._)`await ${A}(${n})`}return typeof P=="function"?(0,Mt._)`${A}(${n})`:(0,Mt._)`${A}.test(${n})`}}}};y0.default=FV});var XI=F(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var LV=ZI(),jV=[LV.default];v0.default=jV});var eP=F(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.contentVocabulary=Vl.metadataVocabulary=void 0;Vl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var rP=F(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var UV=cI(),HV=RI(),BV=QI(),VV=XI(),tP=eP(),WV=[UV.default,HV.default,(0,BV.default)(),VV.default,tP.metadataVocabulary,tP.contentVocabulary];b0.default=WV});var iP=F(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.DiscrError=void 0;var nP;(function(t){t.Tag="tag",t.Mapping="mapping"})(nP||(Uh.DiscrError=nP={}))});var oP=F(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});var Wl=Ne(),S0=iP(),sP=xh(),zV=Xu(),JV=We(),GV={message:({params:{discrError:t,tagName:e}})=>t===S0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Wl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},YV={keyword:"discriminator",type:"object",schemaType:"object",error:GV,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),d=e.const("tag",(0,Wl._)`${r}${(0,Wl.getProperty)(l)}`);e.if((0,Wl._)`typeof ${d} == "string"`,()=>m(),()=>t.error(!1,{discrError:S0.DiscrError.Tag,tag:d,tagName:l})),t.ok(f);function m(){let S=y();e.if(!1);for(let _ in S)e.elseIf((0,Wl._)`${d} === ${_}`),e.assign(f,g(S[_]));e.else(),t.error(!1,{discrError:S0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(S){let _=e.name("valid"),R=t.subschema({keyword:"oneOf",schemaProp:S},_);return t.mergeEvaluated(R,Wl.Name),_}function y(){var S;let _={},R=A(i),P=!0;for(let V=0;V<a.length;V++){let W=a[V];if(W?.$ref&&!(0,JV.schemaHasRulesButRef)(W,s.self.RULES)){let T=W.$ref;if(W=sP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,T),W instanceof sP.SchemaEnv&&(W=W.schema),W===void 0)throw new zV.default(s.opts.uriResolver,s.baseId,T)}let X=(S=W?.properties)===null||S===void 0?void 0:S[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);P=P&&(R||A(W)),U(X,V)}if(!P)throw new Error(`discriminator: "${l}" must be required`);return _;function A({required:V}){return Array.isArray(V)&&V.includes(l)}function U(V,W){if(V.const)B(V.const,W);else if(V.enum)for(let X of V.enum)B(X,W);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function B(V,W){if(typeof V!="string"||V in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[V]=W}}}};w0.default=YV});var aP=F((oQ,KV)=>{KV.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var cP=F((St,_0)=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.MissingRefError=St.ValidationError=St.CodeGen=St.Name=St.nil=St.stringify=St.str=St._=St.KeywordCxt=St.Ajv=void 0;var QV=nI(),ZV=rP(),XV=oP(),lP=aP(),eW=["/properties"],Hh="http://json-schema.org/draft-07/schema",zl=class extends QV.default{_addVocabularies(){super._addVocabularies(),ZV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(XV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(lP,eW):lP;this.addMetaSchema(e,Hh,!1),this.refs["http://json-schema.org/schema"]=Hh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Hh)?Hh:void 0)}};St.Ajv=zl;_0.exports=St=zl;_0.exports.Ajv=zl;Object.defineProperty(St,"__esModule",{value:!0});St.default=zl;var tW=Zu();Object.defineProperty(St,"KeywordCxt",{enumerable:!0,get:function(){return tW.KeywordCxt}});var Jl=Ne();Object.defineProperty(St,"_",{enumerable:!0,get:function(){return Jl._}});Object.defineProperty(St,"str",{enumerable:!0,get:function(){return Jl.str}});Object.defineProperty(St,"stringify",{enumerable:!0,get:function(){return Jl.stringify}});Object.defineProperty(St,"nil",{enumerable:!0,get:function(){return Jl.nil}});Object.defineProperty(St,"Name",{enumerable:!0,get:function(){return Jl.Name}});Object.defineProperty(St,"CodeGen",{enumerable:!0,get:function(){return Jl.CodeGen}});var rW=_h();Object.defineProperty(St,"ValidationError",{enumerable:!0,get:function(){return rW.default}});var nW=Xu();Object.defineProperty(St,"MissingRefError",{enumerable:!0,get:function(){return nW.default}})});import*as iW from"crypto";import*as la from"fs";import{createRequire as sW}from"module";import*as Kn from"path";function Vh(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function uP(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}function R0(t,e){return new Bh(t,e)}var Bh,x0=se(()=>{"use strict";Tb();Bh=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Pl}),crypto:()=>iW,path:()=>Kn,querystring:()=>it("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>IE(),uP),moment:()=>this.loadOptionalModule("moment",()=>PE(),Vh),tv4:()=>this.loadOptionalModule("tv4",()=>TE()),ajv:()=>this.loadOptionalModule("ajv",()=>cP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>it("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=Kn.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
30
+ deps: ${r}}`};var QB={keyword:"dependencies",type:"object",schemaType:"object",error:Ri.error,code(t){let[e,r]=ZB(t);AI(t,e),qI(t,r)}};function ZB({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function AI(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let l=e[a];if(l.length===0)continue;let f=(0,pf.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let d of l)(0,pf.checkReportMissingProp)(t,d)}):(r.if((0,n0._)`${f} && (${(0,pf.checkMissingProp)(t,l,s)})`),(0,pf.reportMissingProp)(t,s),r.else())}}Ri.validatePropertyDeps=AI;function qI(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let l in e)(0,KB.alwaysValidSchema)(s,e[l])||(r.if((0,pf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}Ri.validateSchemaDeps=qI;Ri.default=QB});var NI=F(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var MI=Ne(),XB=We(),eV={message:"property name must be valid",params:({params:t})=>(0,MI._)`{propertyName: ${t.propertyName}}`},tV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:eV,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,XB.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,MI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};i0.default=tV});var o0=F(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});var Fh=_n(),Yn=Ne(),rV=Zi(),Lh=We(),nV={message:"must NOT have additional properties",params:({params:t})=>(0,Yn._)`{additionalProperty: ${t.additionalProperty}}`},iV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,Lh.alwaysValidSchema)(a,r))return;let d=(0,Fh.allSchemaProperties)(n.properties),m=(0,Fh.allSchemaProperties)(n.patternProperties);g(),t.ok((0,Yn._)`${s} === ${rV.default.errors}`);function g(){e.forIn("key",i,P=>{!d.length&&!m.length?_(P):e.if(y(P),()=>_(P))})}function y(P){let A;if(d.length>8){let U=(0,Lh.schemaRefOrVal)(a,n.properties,"properties");A=(0,Fh.isOwnProperty)(e,U,P)}else d.length?A=(0,Yn.or)(...d.map(U=>(0,Yn._)`${P} === ${U}`)):A=Yn.nil;return m.length&&(A=(0,Yn.or)(A,...m.map(U=>(0,Yn._)`${(0,Fh.usePattern)(t,U)}.test(${P})`))),(0,Yn.not)(A)}function S(P){e.code((0,Yn._)`delete ${i}[${P}]`)}function _(P){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){S(P);return}if(r===!1){t.setParams({additionalProperty:P}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Lh.alwaysValidSchema)(a,r)){let A=e.name("valid");f.removeAdditional==="failing"?(R(P,A,!1),e.if((0,Yn.not)(A),()=>{t.reset(),S(P)})):(R(P,A),l||e.if((0,Yn.not)(A),()=>e.break()))}}function R(P,A,U){let B={keyword:"additionalProperties",dataProp:P,dataPropType:Lh.Type.Str};U===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(B,A)}}};s0.default=iV});var LI=F(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});var sV=Zu(),DI=_n(),a0=We(),FI=o0(),oV={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&FI.default.code(new sV.KeywordCxt(s,FI.default,"additionalProperties"));let a=(0,DI.allSchemaProperties)(r);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=a0.mergeEvaluated.props(e,(0,a0.toHash)(a),s.props));let l=a.filter(g=>!(0,a0.alwaysValidSchema)(s,r[g]));if(l.length===0)return;let f=e.name("valid");for(let g of l)d(g)?m(g):(e.if((0,DI.propertyInData)(e,i,g,s.opts.ownProperties)),m(g),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(g),t.ok(f);function d(g){return s.opts.useDefaults&&!s.compositeRule&&r[g].default!==void 0}function m(g){t.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};l0.default=oV});var BI=F(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var jI=_n(),jh=Ne(),UI=We(),HI=We(),aV={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,l=(0,jI.allSchemaProperties)(r),f=l.filter(R=>(0,UI.alwaysValidSchema)(s,r[R]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&i.properties,m=e.name("valid");s.props!==!0&&!(s.props instanceof jh.Name)&&(s.props=(0,HI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let R of l)d&&S(R),s.allErrors?_(R):(e.var(m,!0),_(R),e.if(m))}function S(R){for(let P in d)new RegExp(R).test(P)&&(0,UI.checkStrictMode)(s,`property ${P} matches pattern ${R} (use allowMatchingProperties)`)}function _(R){e.forIn("key",n,P=>{e.if((0,jh._)`${(0,jI.usePattern)(t,R)}.test(${P})`,()=>{let A=f.includes(R);A||t.subschema({keyword:"patternProperties",schemaProp:R,dataProp:P,dataPropType:HI.Type.Str},m),s.opts.unevaluated&&g!==!0?e.assign((0,jh._)`${g}[${P}]`,!0):!A&&!s.allErrors&&e.if((0,jh.not)(m),()=>e.break())})})}}};c0.default=aV});var VI=F(u0=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var lV=We(),cV={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,lV.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};u0.default=cV});var WI=F(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});var uV=_n(),fV={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:uV.validateUnion,error:{message:"must match a schema in anyOf"}};f0.default=fV});var zI=F(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});var Uh=Ne(),dV=We(),pV={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Uh._)`{passingSchemas: ${t.passing}}`},hV={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:pV,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(a,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((m,g)=>{let y;(0,dV.alwaysValidSchema)(i,m)?e.var(f,!0):y=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,Uh._)`${f} && ${a}`).assign(a,!1).assign(l,(0,Uh._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(l,g),y&&t.mergeEvaluated(y,Uh.Name)})})}}};d0.default=hV});var JI=F(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});var mV=We(),gV={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,mV.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(l)})}};p0.default=gV});var KI=F(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var Hh=Ne(),YI=We(),yV={message:({params:t})=>(0,Hh.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Hh._)`{failingKeyword: ${t.ifClause}}`},vV={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:yV,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,YI.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=GI(n,"then"),s=GI(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let m=e.let("ifClause");t.setParams({ifClause:m}),e.if(l,d("then",m),d("else",m))}else i?e.if(l,d("then")):e.if((0,Hh.not)(l),d("else"));t.pass(a,()=>t.error(!0));function f(){let m=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(m)}function d(m,g){return()=>{let y=t.subschema({keyword:m},l);e.assign(a,l),t.mergeValidEvaluated(y,a),g?e.assign(g,(0,Hh._)`${m}`):t.setParams({ifClause:m})}}}};function GI(t,e){let r=t.schema[e];return r!==void 0&&!(0,YI.alwaysValidSchema)(t,r)}h0.default=vV});var QI=F(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var bV=We(),SV={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,bV.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};m0.default=SV});var ZI=F(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var wV=ZS(),_V=II(),RV=XS(),xV=kI(),CV=TI(),EV=$I(),OV=NI(),IV=o0(),PV=LI(),kV=BI(),TV=VI(),AV=WI(),qV=zI(),$V=JI(),MV=KI(),NV=QI();function DV(t=!1){let e=[TV.default,AV.default,qV.default,$V.default,MV.default,NV.default,OV.default,IV.default,EV.default,PV.default,kV.default];return t?e.push(_V.default,xV.default):e.push(wV.default,RV.default),e.push(CV.default),e}g0.default=DV});var XI=F(y0=>{"use strict";Object.defineProperty(y0,"__esModule",{value:!0});var Mt=Ne(),FV={message:({schemaCode:t})=>(0,Mt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Mt._)`{format: ${t}}`},LV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:FV,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:l}=t,{opts:f,errSchemaPath:d,schemaEnv:m,self:g}=l;if(!f.validateFormats)return;i?y():S();function y(){let _=r.scopeValue("formats",{ref:g.formats,code:f.code.formats}),R=r.const("fDef",(0,Mt._)`${_}[${a}]`),P=r.let("fType"),A=r.let("format");r.if((0,Mt._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>r.assign(P,(0,Mt._)`${R}.type || "string"`).assign(A,(0,Mt._)`${R}.validate`),()=>r.assign(P,(0,Mt._)`"string"`).assign(A,R)),t.fail$data((0,Mt.or)(U(),B()));function U(){return f.strictSchema===!1?Mt.nil:(0,Mt._)`${a} && !${A}`}function B(){let V=m.$async?(0,Mt._)`(${R}.async ? await ${A}(${n}) : ${A}(${n}))`:(0,Mt._)`${A}(${n})`,W=(0,Mt._)`(typeof ${A} == "function" ? ${V} : ${A}.test(${n}))`;return(0,Mt._)`${A} && ${A} !== true && ${P} === ${e} && !${W}`}}function S(){let _=g.formats[s];if(!_){U();return}if(_===!0)return;let[R,P,A]=B(_);R===e&&t.pass(V());function U(){if(f.strictSchema===!1){g.logger.warn(W());return}throw new Error(W());function W(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function B(W){let X=W instanceof RegExp?(0,Mt.regexpCode)(W):f.code.formats?(0,Mt._)`${f.code.formats}${(0,Mt.getProperty)(s)}`:void 0,T=r.scopeValue("formats",{key:s,ref:W,code:X});return typeof W=="object"&&!(W instanceof RegExp)?[W.type||"string",W.validate,(0,Mt._)`${T}.validate`]:["string",W,T]}function V(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!m.$async)throw new Error("async format in sync schema");return(0,Mt._)`await ${A}(${n})`}return typeof P=="function"?(0,Mt._)`${A}(${n})`:(0,Mt._)`${A}.test(${n})`}}}};y0.default=LV});var eP=F(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var jV=XI(),UV=[jV.default];v0.default=UV});var tP=F(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.contentVocabulary=Vl.metadataVocabulary=void 0;Vl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Vl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var nP=F(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var HV=uI(),BV=xI(),VV=ZI(),WV=eP(),rP=tP(),zV=[HV.default,BV.default,(0,VV.default)(),WV.default,rP.metadataVocabulary,rP.contentVocabulary];b0.default=zV});var sP=F(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.DiscrError=void 0;var iP;(function(t){t.Tag="tag",t.Mapping="mapping"})(iP||(Bh.DiscrError=iP={}))});var aP=F(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});var Wl=Ne(),S0=sP(),oP=Eh(),JV=Xu(),GV=We(),YV={message:({params:{discrError:t,tagName:e}})=>t===S0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Wl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},KV={keyword:"discriminator",type:"object",schemaType:"object",error:YV,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),d=e.const("tag",(0,Wl._)`${r}${(0,Wl.getProperty)(l)}`);e.if((0,Wl._)`typeof ${d} == "string"`,()=>m(),()=>t.error(!1,{discrError:S0.DiscrError.Tag,tag:d,tagName:l})),t.ok(f);function m(){let S=y();e.if(!1);for(let _ in S)e.elseIf((0,Wl._)`${d} === ${_}`),e.assign(f,g(S[_]));e.else(),t.error(!1,{discrError:S0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(S){let _=e.name("valid"),R=t.subschema({keyword:"oneOf",schemaProp:S},_);return t.mergeEvaluated(R,Wl.Name),_}function y(){var S;let _={},R=A(i),P=!0;for(let V=0;V<a.length;V++){let W=a[V];if(W?.$ref&&!(0,GV.schemaHasRulesButRef)(W,s.self.RULES)){let T=W.$ref;if(W=oP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,T),W instanceof oP.SchemaEnv&&(W=W.schema),W===void 0)throw new JV.default(s.opts.uriResolver,s.baseId,T)}let X=(S=W?.properties)===null||S===void 0?void 0:S[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);P=P&&(R||A(W)),U(X,V)}if(!P)throw new Error(`discriminator: "${l}" must be required`);return _;function A({required:V}){return Array.isArray(V)&&V.includes(l)}function U(V,W){if(V.const)B(V.const,W);else if(V.enum)for(let X of V.enum)B(X,W);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function B(V,W){if(typeof V!="string"||V in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[V]=W}}}};w0.default=KV});var lP=F((aQ,QV)=>{QV.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var uP=F((St,_0)=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.MissingRefError=St.ValidationError=St.CodeGen=St.Name=St.nil=St.stringify=St.str=St._=St.KeywordCxt=St.Ajv=void 0;var ZV=iI(),XV=nP(),eW=aP(),cP=lP(),tW=["/properties"],Vh="http://json-schema.org/draft-07/schema",zl=class extends ZV.default{_addVocabularies(){super._addVocabularies(),XV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(eW.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(cP,tW):cP;this.addMetaSchema(e,Vh,!1),this.refs["http://json-schema.org/schema"]=Vh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Vh)?Vh:void 0)}};St.Ajv=zl;_0.exports=St=zl;_0.exports.Ajv=zl;Object.defineProperty(St,"__esModule",{value:!0});St.default=zl;var rW=Zu();Object.defineProperty(St,"KeywordCxt",{enumerable:!0,get:function(){return rW.KeywordCxt}});var Jl=Ne();Object.defineProperty(St,"_",{enumerable:!0,get:function(){return Jl._}});Object.defineProperty(St,"str",{enumerable:!0,get:function(){return Jl.str}});Object.defineProperty(St,"stringify",{enumerable:!0,get:function(){return Jl.stringify}});Object.defineProperty(St,"nil",{enumerable:!0,get:function(){return Jl.nil}});Object.defineProperty(St,"Name",{enumerable:!0,get:function(){return Jl.Name}});Object.defineProperty(St,"CodeGen",{enumerable:!0,get:function(){return Jl.CodeGen}});var nW=xh();Object.defineProperty(St,"ValidationError",{enumerable:!0,get:function(){return nW.default}});var iW=Xu();Object.defineProperty(St,"MissingRefError",{enumerable:!0,get:function(){return iW.default}})});import*as sW from"crypto";import*as ca from"fs";import{createRequire as oW}from"module";import*as Kn from"path";function zh(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function fP(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}function R0(t,e){return new Wh(t,e)}var Wh,x0=se(()=>{"use strict";Tb();Wh=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Pl}),crypto:()=>sW,path:()=>Kn,querystring:()=>it("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>PE(),fP),moment:()=>this.loadOptionalModule("moment",()=>kE(),zh),tv4:()=>this.loadOptionalModule("tv4",()=>AE()),ajv:()=>this.loadOptionalModule("ajv",()=>uP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>it("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=Kn.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
31
31
  ${this.getModuleInstallInstructions(e)}`)}getModuleInstallInstructions(e){let n={moment:"^2.30.1",lodash:"^4.17.21",tv4:"^1.3.0",ajv:"^8.17.1"}[e]||"latest";return`To use ${e}, add it to http-forge/modules/package.json:
32
32
  {
33
33
  "dependencies": {
34
34
  "${e}": "${n}"
35
35
  }
36
36
  }
37
- Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=Kn.resolve(e,"package.json");if(!la.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=la.realpathSync(r);return this.customModulesRequire=sW(n),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0}catch(r){return console.error("Failed to initialize modules:",r),!1}}loadAvailableModules(e){try{let r=Kn.join(e,"package.json"),n=la.readFileSync(r,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},a=i.devDependencies||{};if(typeof s!="object"||typeof a!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),Object.keys(a).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(r){let n=`Failed to load workspace modules from package.json: ${r instanceof Error?r.message:r}`;this.logError(n)}}loadGlobalSetup(e){let r=Kn.join(e,"global-setup.js");if(la.existsSync(r))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let r=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let a=this.builtinModules[e]();return this.cacheModule(e,a,"builtin",Date.now()-r),a}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create http-forge-assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create http-forge-assets/modules/package.json first.`);let a=Kn.resolve(this.modulesPath,e),l=Kn.normalize(a),f=Kn.normalize(this.modulesPath);if(!l.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let d=this.customModulesRequire(e);return this.cacheModule(e,d,"relative",Date.now()-r),d}catch(d){throw new Error(`Failed to load local module '${e}': ${d.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let a=this.customModulesRequire(e);return this.cacheModule(e,a,"workspace",Date.now()-r),a}catch(a){throw new Error(`Module '${e}' is in package.json but failed to load: ${a.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
38
- Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}}});function fP(t){let e=new Set,r=new Set,n=(m,g)=>{try{m(...g)}catch(y){try{t(y)}catch{}}},i={setTimeout:(m,g,...y)=>{if(typeof m!="function")return setTimeout(()=>{},g);let S=setTimeout(()=>{e.delete(S),n(m,y)},g);return e.add(S),S},clearTimeout:m=>{m!=null&&(e.delete(m),clearTimeout(m))},setInterval:(m,g,...y)=>{if(typeof m!="function")return setInterval(()=>{},g);let S=setInterval(()=>{n(m,y)},g);return r.add(S),S},clearInterval:m=>{m!=null&&(r.delete(m),clearInterval(m))}},s=()=>e.size+r.size,a=()=>{for(let m of e)clearTimeout(m);for(let m of r)clearInterval(m);e.clear(),r.clear()},l=m=>new Promise(g=>setTimeout(g,m)),f=async m=>{let g=Date.now();for(await l(0);s()>0;){let y=Date.now()-g;if(y>=m)return a(),{timedOut:!0,elapsedMs:Date.now()-g};let S=m-y;await l(Math.min(15,S))}return await l(0),s()>0?d(g,m):{timedOut:!1,elapsedMs:Date.now()-g}},d=async(m,g)=>{for(;s()>0;){let y=Date.now()-m;if(y>=g)return a(),{timedOut:!0,elapsedMs:Date.now()-m};let S=g-y;await l(Math.min(15,S))}return{timedOut:!1,elapsedMs:Date.now()-m}};return{timers:i,pendingCount:s,clearAll:a,drain:f}}var dP=se(()=>{"use strict"});function C0(t,e,r="$"){let n=[];if(e===null||typeof e!="object")return n;let i=s=>s===null?"null":Array.isArray(s)?"array":Number.isInteger(s)?"integer":typeof s;if(e.type!==void 0){let s=Array.isArray(e.type)?e.type:[e.type],a=i(t);if(!s.some(f=>f===a||f==="number"&&a==="integer"))return n.push(`${r}: expected type ${s.join("|")} but got ${a}`),n}if(Array.isArray(e.enum)&&!e.enum.some(s=>JSON.stringify(s)===JSON.stringify(t))&&n.push(`${r}: value ${JSON.stringify(t)} is not in enum ${JSON.stringify(e.enum)}`),typeof t=="number"&&(typeof e.minimum=="number"&&t<e.minimum&&n.push(`${r}: ${t} is below minimum ${e.minimum}`),typeof e.maximum=="number"&&t>e.maximum&&n.push(`${r}: ${t} is above maximum ${e.maximum}`)),typeof t=="string"&&(typeof e.minLength=="number"&&t.length<e.minLength&&n.push(`${r}: string length ${t.length} is below minLength ${e.minLength}`),typeof e.maxLength=="number"&&t.length>e.maxLength&&n.push(`${r}: string length ${t.length} is above maxLength ${e.maxLength}`),typeof e.pattern=="string"&&!new RegExp(e.pattern).test(t)&&n.push(`${r}: string does not match pattern ${e.pattern}`)),i(t)==="object"){if(Array.isArray(e.required))for(let s of e.required)s in t||n.push(`${r}: missing required property "${s}"`);if(e.properties&&typeof e.properties=="object")for(let[s,a]of Object.entries(e.properties))s in t&&n.push(...C0(t[s],a,`${r}.${s}`));if(e.additionalProperties===!1&&e.properties){let s=new Set(Object.keys(e.properties));for(let a of Object.keys(t))s.has(a)||n.push(`${r}: additional property "${a}" is not allowed`)}}return Array.isArray(t)&&e.items&&typeof e.items=="object"&&t.forEach((s,a)=>{n.push(...C0(s,e.items,`${r}[${a}]`))}),n}function oW(t){let e=t.httpOnly??!1,r=t.secure??!1,n=t.expires==null&&t.maxAge==null;return{name:t.name,value:t.value,domain:t.domain,path:t.path,expires:t.expires,maxAge:t.maxAge,httpOnly:e,secure:r,session:n,hostOnly:!1,sameSite:t.sameSite,valueOf(){return t.value},toString(){let i=[`${t.name}=${t.value}`];return t.expires&&i.push(`Expires=${t.expires}`),t.maxAge!=null&&i.push(`Max-Age=${t.maxAge}`),t.domain&&i.push(`Domain=${t.domain}`),t.path&&i.push(`Path=${t.path}`),r&&i.push("Secure"),e&&i.push("HttpOnly"),t.sameSite&&i.push(`SameSite=${t.sameSite}`),i.join("; ")}}}function aW(t){let e=t.map(oW),r=n=>e.find(i=>i.name===n);return e.get=n=>r(n)?.value,e.one=n=>r(n),e.has=n=>e.some(i=>i.name===n),e.toObject=()=>{let n={};for(let i of e)n[i.name]=i.value;return n},e.all=()=>[...e],e.each=n=>{for(let i of e)n(i)},e.count=()=>e.length,e.idx=n=>e[n],e}function lW(t){let e={...t};return e.get=r=>{let n=r.toLowerCase();for(let[i,s]of Object.entries(t))if(i.toLowerCase()===n)return s},e.has=r=>{let n=r.toLowerCase();return Object.keys(t).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...t}),e.each=r=>{for(let[n,i]of Object.entries(t))r({key:n,value:i})},e}function Wh(t){let e=lW(t.headers),r=aW(t.cookies||[]);return{status:t.statusText,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:r,responseTime:t.responseTime,responseSize:t.responseSize,reason(){return this.statusText},json(){if(typeof this.body=="object")return this.body;try{return JSON.parse(this.body)}catch{return null}},text(){return typeof this.body=="string"?this.body:JSON.stringify(this.body)},to:{have:{status(n){if(t.status!==n)throw new Error(`Expected status ${n} but got ${t.status}`)},header(n,i){let s=t.headers[n]||t.headers[n.toLowerCase()];if(!s)throw new Error(`Expected header "${n}" to exist`);if(i!==void 0&&s!==i)throw new Error(`Expected header "${n}" to be "${i}" but got "${s}"`)},body(n){let i=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(n!==void 0&&i!==n)throw new Error(`Expected body to be "${n}" but got "${i}"`)},jsonBody(n){let i=typeof t.body=="object"?t.body:JSON.parse(t.body);if(n!==void 0&&JSON.stringify(i)!==JSON.stringify(n))throw new Error("Expected JSON body to match")},jsonSchema(n){let i=typeof t.body=="object"?t.body:JSON.parse(t.body),s=C0(i,n);if(s.length>0)throw new Error(`Expected response body to match JSON schema:
37
+ Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=Kn.resolve(e,"package.json");if(!ca.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=ca.realpathSync(r);return this.customModulesRequire=oW(n),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0}catch(r){return console.error("Failed to initialize modules:",r),!1}}loadAvailableModules(e){try{let r=Kn.join(e,"package.json"),n=ca.readFileSync(r,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},a=i.devDependencies||{};if(typeof s!="object"||typeof a!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),Object.keys(a).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(r){let n=`Failed to load workspace modules from package.json: ${r instanceof Error?r.message:r}`;this.logError(n)}}loadGlobalSetup(e){let r=Kn.join(e,"global-setup.js");if(ca.existsSync(r))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let r=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let a=this.builtinModules[e]();return this.cacheModule(e,a,"builtin",Date.now()-r),a}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create http-forge-assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create http-forge-assets/modules/package.json first.`);let a=Kn.resolve(this.modulesPath,e),l=Kn.normalize(a),f=Kn.normalize(this.modulesPath);if(!l.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let d=this.customModulesRequire(e);return this.cacheModule(e,d,"relative",Date.now()-r),d}catch(d){throw new Error(`Failed to load local module '${e}': ${d.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let a=this.customModulesRequire(e);return this.cacheModule(e,a,"workspace",Date.now()-r),a}catch(a){throw new Error(`Module '${e}' is in package.json but failed to load: ${a.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
38
+ Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}}});function dP(t){let e=new Set,r=new Set,n=(m,g)=>{try{m(...g)}catch(y){try{t(y)}catch{}}},i={setTimeout:(m,g,...y)=>{if(typeof m!="function")return setTimeout(()=>{},g);let S=setTimeout(()=>{e.delete(S),n(m,y)},g);return e.add(S),S},clearTimeout:m=>{m!=null&&(e.delete(m),clearTimeout(m))},setInterval:(m,g,...y)=>{if(typeof m!="function")return setInterval(()=>{},g);let S=setInterval(()=>{n(m,y)},g);return r.add(S),S},clearInterval:m=>{m!=null&&(r.delete(m),clearInterval(m))}},s=()=>e.size+r.size,a=()=>{for(let m of e)clearTimeout(m);for(let m of r)clearInterval(m);e.clear(),r.clear()},l=m=>new Promise(g=>setTimeout(g,m)),f=async m=>{let g=Date.now();for(await l(0);s()>0;){let y=Date.now()-g;if(y>=m)return a(),{timedOut:!0,elapsedMs:Date.now()-g};let S=m-y;await l(Math.min(15,S))}return await l(0),s()>0?d(g,m):{timedOut:!1,elapsedMs:Date.now()-g}},d=async(m,g)=>{for(;s()>0;){let y=Date.now()-m;if(y>=g)return a(),{timedOut:!0,elapsedMs:Date.now()-m};let S=g-y;await l(Math.min(15,S))}return{timedOut:!1,elapsedMs:Date.now()-m}};return{timers:i,pendingCount:s,clearAll:a,drain:f}}var pP=se(()=>{"use strict"});function C0(t,e,r="$"){let n=[];if(e===null||typeof e!="object")return n;let i=s=>s===null?"null":Array.isArray(s)?"array":Number.isInteger(s)?"integer":typeof s;if(e.type!==void 0){let s=Array.isArray(e.type)?e.type:[e.type],a=i(t);if(!s.some(f=>f===a||f==="number"&&a==="integer"))return n.push(`${r}: expected type ${s.join("|")} but got ${a}`),n}if(Array.isArray(e.enum)&&!e.enum.some(s=>JSON.stringify(s)===JSON.stringify(t))&&n.push(`${r}: value ${JSON.stringify(t)} is not in enum ${JSON.stringify(e.enum)}`),typeof t=="number"&&(typeof e.minimum=="number"&&t<e.minimum&&n.push(`${r}: ${t} is below minimum ${e.minimum}`),typeof e.maximum=="number"&&t>e.maximum&&n.push(`${r}: ${t} is above maximum ${e.maximum}`)),typeof t=="string"&&(typeof e.minLength=="number"&&t.length<e.minLength&&n.push(`${r}: string length ${t.length} is below minLength ${e.minLength}`),typeof e.maxLength=="number"&&t.length>e.maxLength&&n.push(`${r}: string length ${t.length} is above maxLength ${e.maxLength}`),typeof e.pattern=="string"&&!new RegExp(e.pattern).test(t)&&n.push(`${r}: string does not match pattern ${e.pattern}`)),i(t)==="object"){if(Array.isArray(e.required))for(let s of e.required)s in t||n.push(`${r}: missing required property "${s}"`);if(e.properties&&typeof e.properties=="object")for(let[s,a]of Object.entries(e.properties))s in t&&n.push(...C0(t[s],a,`${r}.${s}`));if(e.additionalProperties===!1&&e.properties){let s=new Set(Object.keys(e.properties));for(let a of Object.keys(t))s.has(a)||n.push(`${r}: additional property "${a}" is not allowed`)}}return Array.isArray(t)&&e.items&&typeof e.items=="object"&&t.forEach((s,a)=>{n.push(...C0(s,e.items,`${r}[${a}]`))}),n}function aW(t){let e=t.httpOnly??!1,r=t.secure??!1,n=t.expires==null&&t.maxAge==null;return{name:t.name,value:t.value,domain:t.domain,path:t.path,expires:t.expires,maxAge:t.maxAge,httpOnly:e,secure:r,session:n,hostOnly:!1,sameSite:t.sameSite,valueOf(){return t.value},toString(){let i=[`${t.name}=${t.value}`];return t.expires&&i.push(`Expires=${t.expires}`),t.maxAge!=null&&i.push(`Max-Age=${t.maxAge}`),t.domain&&i.push(`Domain=${t.domain}`),t.path&&i.push(`Path=${t.path}`),r&&i.push("Secure"),e&&i.push("HttpOnly"),t.sameSite&&i.push(`SameSite=${t.sameSite}`),i.join("; ")}}}function lW(t){let e=t.map(aW),r=n=>e.find(i=>i.name===n);return e.get=n=>r(n)?.value,e.one=n=>r(n),e.has=n=>e.some(i=>i.name===n),e.toObject=()=>{let n={};for(let i of e)n[i.name]=i.value;return n},e.all=()=>[...e],e.each=n=>{for(let i of e)n(i)},e.count=()=>e.length,e.idx=n=>e[n],e}function cW(t){let e={...t};return e.get=r=>{let n=r.toLowerCase();for(let[i,s]of Object.entries(t))if(i.toLowerCase()===n)return s},e.has=r=>{let n=r.toLowerCase();return Object.keys(t).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...t}),e.each=r=>{for(let[n,i]of Object.entries(t))r({key:n,value:i})},e}function Jh(t){let e=cW(t.headers),r=lW(t.cookies||[]);return{status:t.statusText,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:r,responseTime:t.responseTime,responseSize:t.responseSize,reason(){return this.statusText},json(){if(typeof this.body=="object")return this.body;try{return JSON.parse(this.body)}catch{return null}},text(){return typeof this.body=="string"?this.body:JSON.stringify(this.body)},to:{have:{status(n){if(t.status!==n)throw new Error(`Expected status ${n} but got ${t.status}`)},header(n,i){let s=t.headers[n]||t.headers[n.toLowerCase()];if(!s)throw new Error(`Expected header "${n}" to exist`);if(i!==void 0&&s!==i)throw new Error(`Expected header "${n}" to be "${i}" but got "${s}"`)},body(n){let i=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(n!==void 0&&i!==n)throw new Error(`Expected body to be "${n}" but got "${i}"`)},jsonBody(n){let i=typeof t.body=="object"?t.body:JSON.parse(t.body);if(n!==void 0&&JSON.stringify(i)!==JSON.stringify(n))throw new Error("Expected JSON body to match")},jsonSchema(n){let i=typeof t.body=="object"?t.body:JSON.parse(t.body),s=C0(i,n);if(s.length>0)throw new Error(`Expected response body to match JSON schema:
39
39
  - ${s.join(`
40
- - `)}`)}},be:{get ok(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${t.status}`);return(()=>{})},get success(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${t.status}`);return(()=>{})},get error(){if(t.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${t.status}`);return(()=>{})},get clientError(){if(t.status<400||t.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${t.status}`);return(()=>{})},get serverError(){if(t.status<500||t.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${t.status}`);return(()=>{})}}}}}function hf(t){return{_value:t,_negated:!1,_deep:!1,get not(){return this._negated=!this._negated,this},get to(){return this},get be(){return this},get have(){return this},get deep(){return this._deep=!0,this},get and(){return this},get that(){return this},get which(){return this},get is(){return this},get been(){return this},get has(){return this},get with(){return this},get at(){return this},get of(){return this},get same(){return this},get but(){return this},get does(){return this},get still(){return this},get also(){return this},_assert(r,n){if(!(this._negated?!r:r))throw new Error(n)},equal(r){return this._deep?(this._deep=!1,this.eql(r)):(this._assert(this._value===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}equal ${JSON.stringify(r)}`),this)},eql(r){let n=JSON.stringify(this._value)===JSON.stringify(r);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}deeply equal ${JSON.stringify(r)}`),this},property(r,n){let i=typeof this._value=="object"&&this._value!==null&&r in this._value;return n!==void 0?this._assert(i&&this._value[r]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}"`),this},get ok(){return this._assert(!!this._value,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be truthy`),this},get exist(){return this._assert(this._value!==null&&this._value!==void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}exist`),this},include(r){let n=!1;return typeof this._value=="string"?n=this._value.includes(r):Array.isArray(this._value)?n=this._value.includes(r):typeof this._value=="object"&&this._value!==null&&(n=r in this._value),this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}include ${JSON.stringify(r)}`),this},contain(r){return this.include(r)},oneOf(r){let n=Array.isArray(r)&&r.includes(this._value);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be one of ${JSON.stringify(r)}`),this},match(r){let n=r.test(String(this._value));return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}match ${r}`),this},above(r){return this._assert(Number(this._value)>r,`Expected ${this._value} to ${this._negated?"not ":""}be above ${r}`),this},below(r){return this._assert(Number(this._value)<r,`Expected ${this._value} to ${this._negated?"not ":""}be below ${r}`),this},greaterThan(r){return this.above(r)},lessThan(r){return this.below(r)},within(r,n){let i=Number(this._value);return this._assert(i>=r&&i<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${r}..${n}`),this},get true(){return this._assert(this._value===!0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be true`),this},get false(){return this._assert(this._value===!1,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be false`),this},get null(){return this._assert(this._value===null,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be null`),this},get undefined(){return this._assert(this._value===void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be undefined`),this},get empty(){let r=!1;return this._value===null||this._value===void 0?r=!0:typeof this._value=="string"||Array.isArray(this._value)?r=this._value.length===0:typeof this._value=="object"&&(r=Object.keys(this._value).length===0),this._assert(r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be empty`),this},length(r){let n=Array.isArray(this._value)||typeof this._value=="string"?this._value.length:Object.keys(this._value||{}).length;return this._assert(n===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have length ${r}`),this},lengthOf(r){return this.length(r)},a(r){let n=Array.isArray(this._value)?"array":typeof this._value;return this._assert(n===r.toLowerCase(),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be a(n) ${r} (got ${n})`),this},an(r){return this.a(r)},members(r){let n=this._value,i=Array.isArray(n)&&Array.isArray(r)&&r.every(s=>n.some(a=>JSON.stringify(a)===JSON.stringify(s)));return this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have members ${JSON.stringify(r)}`),this},keys(...r){let n=Array.isArray(r[0])?r[0]:r,i=Object.keys(this._value||{}),s=n.every(a=>i.includes(a));return this._assert(s,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have keys ${JSON.stringify(n)}`),this},string(r){return this._assert(typeof this._value=="string"&&this._value.includes(r),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}contain string "${r}"`),this}}}var zh=se(()=>{"use strict"});function Jh(t,e=!1){let r=(typeof t=="string"?[t]:t).filter(i=>i&&i.trim());return r.length===0?"":e?`(async () => {
40
+ - `)}`)}},be:{get ok(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${t.status}`);return(()=>{})},get success(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${t.status}`);return(()=>{})},get error(){if(t.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${t.status}`);return(()=>{})},get clientError(){if(t.status<400||t.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${t.status}`);return(()=>{})},get serverError(){if(t.status<500||t.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${t.status}`);return(()=>{})}}}}}function hf(t){return{_value:t,_negated:!1,_deep:!1,get not(){return this._negated=!this._negated,this},get to(){return this},get be(){return this},get have(){return this},get deep(){return this._deep=!0,this},get and(){return this},get that(){return this},get which(){return this},get is(){return this},get been(){return this},get has(){return this},get with(){return this},get at(){return this},get of(){return this},get same(){return this},get but(){return this},get does(){return this},get still(){return this},get also(){return this},_assert(r,n){if(!(this._negated?!r:r))throw new Error(n)},equal(r){return this._deep?(this._deep=!1,this.eql(r)):(this._assert(this._value===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}equal ${JSON.stringify(r)}`),this)},eql(r){let n=JSON.stringify(this._value)===JSON.stringify(r);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}deeply equal ${JSON.stringify(r)}`),this},property(r,n){let i=typeof this._value=="object"&&this._value!==null&&r in this._value;return n!==void 0?this._assert(i&&this._value[r]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}"`),this},get ok(){return this._assert(!!this._value,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be truthy`),this},get exist(){return this._assert(this._value!==null&&this._value!==void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}exist`),this},include(r){let n=!1;return typeof this._value=="string"?n=this._value.includes(r):Array.isArray(this._value)?n=this._value.includes(r):typeof this._value=="object"&&this._value!==null&&(n=r in this._value),this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}include ${JSON.stringify(r)}`),this},contain(r){return this.include(r)},oneOf(r){let n=Array.isArray(r)&&r.includes(this._value);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be one of ${JSON.stringify(r)}`),this},match(r){let n=r.test(String(this._value));return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}match ${r}`),this},above(r){return this._assert(Number(this._value)>r,`Expected ${this._value} to ${this._negated?"not ":""}be above ${r}`),this},below(r){return this._assert(Number(this._value)<r,`Expected ${this._value} to ${this._negated?"not ":""}be below ${r}`),this},greaterThan(r){return this.above(r)},lessThan(r){return this.below(r)},within(r,n){let i=Number(this._value);return this._assert(i>=r&&i<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${r}..${n}`),this},get true(){return this._assert(this._value===!0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be true`),this},get false(){return this._assert(this._value===!1,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be false`),this},get null(){return this._assert(this._value===null,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be null`),this},get undefined(){return this._assert(this._value===void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be undefined`),this},get empty(){let r=!1;return this._value===null||this._value===void 0?r=!0:typeof this._value=="string"||Array.isArray(this._value)?r=this._value.length===0:typeof this._value=="object"&&(r=Object.keys(this._value).length===0),this._assert(r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be empty`),this},length(r){let n=Array.isArray(this._value)||typeof this._value=="string"?this._value.length:Object.keys(this._value||{}).length;return this._assert(n===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have length ${r}`),this},lengthOf(r){return this.length(r)},a(r){let n=Array.isArray(this._value)?"array":typeof this._value;return this._assert(n===r.toLowerCase(),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be a(n) ${r} (got ${n})`),this},an(r){return this.a(r)},members(r){let n=this._value,i=Array.isArray(n)&&Array.isArray(r)&&r.every(s=>n.some(a=>JSON.stringify(a)===JSON.stringify(s)));return this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have members ${JSON.stringify(r)}`),this},keys(...r){let n=Array.isArray(r[0])?r[0]:r,i=Object.keys(this._value||{}),s=n.every(a=>i.includes(a));return this._assert(s,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have keys ${JSON.stringify(n)}`),this},string(r){return this._assert(typeof this._value=="string"&&this._value.includes(r),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}contain string "${r}"`),this}}}var Gh=se(()=>{"use strict"});function Yh(t,e=!1){let r=(typeof t=="string"?[t]:t).filter(i=>i&&i.trim());return r.length===0?"":e?`(async () => {
41
41
  ${r.map((i,s)=>`await (async () => {
42
42
  /* --- script unit ${s+1} --- */
43
43
  ${i}
@@ -47,10 +47,10 @@ ${i}
47
47
 
48
48
  // --- Next Script ---
49
49
 
50
- `)}function mf(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Gl(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function cW(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function E0(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(a)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r.skip=(n,i)=>{t.push({name:n,passed:!0,skipped:!0})},r.fail=n=>{t.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},r.index=()=>t.length,r._pendingTests=e,r}function O0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function Gh(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=at.parseCookieHeaders(t||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var gf=se(()=>{"use strict";Bo()});import*as I0 from"vm";function uW(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var yf,P0=se(()=>{"use strict";dP();zh();gf();yf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=fP(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),f={};for(let d of l)f[d.name]=d.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,d){try{if(!l){d(null,[]);return}let m=l.getAll(f).map(g=>({name:g.name,value:g.value,domain:g.domain,path:g.path,httpOnly:g.httpOnly,secure:g.secure}));d(null,m)}catch(m){d(m,[])}},get(f,d,m){try{if(!l){m(null,void 0);return}let g=l.get(d,f);m(null,g?{name:g.name,value:g.value,domain:g.domain}:void 0)}catch(g){m(g,void 0)}},set(f,d,m,g){try{if(!l){(g||m)?.(null);return}typeof d=="string"&&typeof m=="string"?(l.set({name:d,value:m,domain:f}),g?.(null)):typeof d=="object"&&(l.set({...d,domain:f}),m?.(null))}catch(y){(g||m)?.(y)}},unset(f,d,m){try{if(!l){m?.(null);return}l.delete(d,f),m?.(null)}catch(g){m?.(g)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(d){f?.(d)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:E0(this.assertions),expect:hf,cookies:s,execution:{setNextRequest(l){a._nextRequest=l},skipRequest(){a._skipRequest=!0},runRequest(l,f){let m=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let g=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(g),S=Array.isArray(y?.cookies)?y.cookies.filter(P=>P?.name):[],_=y?.body,R=0;if(typeof _=="string")R=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))R=_.length;else if(_!=null)try{R=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return Wh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:_,cookies:S,responseTime:y?.time,responseSize:R})})();if(typeof f=="function"){m.then(g=>f(null,g),g=>f(g));return}return m},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){a._nextRequest=l},visualizer:{set(l,f){a._visualizerData={template:l,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:l=>{l&&l.key&&(e.headers[l.key]=l.value||"")},get:l=>{for(let[f,d]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase()){delete e.headers[f];break}},update:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&(l[f]=d);return l},each:l=>{for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&l({key:f,value:d})}},a={get mode(){return n(e.body?.type)},set mode(l){let f=i(l);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let l=e.body?.content;return typeof l=="string"?l:l&&typeof l=="object"?JSON.stringify(l):""},set raw(l){e.body?(e.body.type="raw",e.body.content=l):e.body={type:"raw",content:l}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return uW(e.url)},set url(l){e.url=typeof l=="string"?l:String(l)},get method(){return e.method},set method(l){e.method=l},headers:s,get body(){return a},set body(l){if(l==null)e.body=null;else if(typeof l=="string")e.body={type:"raw",content:l};else if(typeof l=="object")if(l.type||l.mode||l.content!==void 0){let f=l.mode?i(l.mode):l.type||"raw";e.body={type:f,format:l.format,content:l.content}}else e.body={type:"raw",content:l}},get params(){return e.params||{}},set params(l){e.params=l||{}},get query(){return e.query||{}},set query(l){e.query=l||{}},get auth(){return r.request?.auth||null},set auth(l){r.request&&(r.request.auth=l)},get certificate(){return r.request?.certificate||null},set certificate(l){r.request&&(r.request.certificate=l)},get description(){return r.request?.description||null},set description(l){r.request&&(r.request.description=l)},get name(){return r.request?.name||null},set name(l){r.request&&(r.request.name=l)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(l){r.request&&(r.request.disabled=l)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(l){let f={};for(let[d,m]of Object.entries(e.headers))typeof m=="string"&&(f[d]=m);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[d,m]of f)e.query||(e.query={}),e.query[d]=m}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(f=>{let d=typeof f=="string"?f:f.key;d&&delete e.query[d]}))},authorizeUsing(l,f){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,f&&(r.request.auth.parameters=f)):typeof l=="object"&&(r.request.auth=l))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(l,f){r.request&&(r.request.description={content:l,type:f||"text/plain"})},setHeader(l,f){e.headers[l]=f},addHeader(l,f){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=f},removeHeader(l){delete e.headers[l]},setBody(l,f,d){e.body={type:f||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,a={};for(let[S,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(a[S]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:a,data:f},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!r)return;let m=r.body;n.responseBody=m==null?"":typeof m=="string"?m:JSON.stringify(m);let g=r.statusText||"";n.responseCode={code:r.status,name:g,detail:g},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(S=>({...S}));let y=this;n.tests=new Proxy({},{set(S,_,R){return y.assertions.push({name:String(_),passed:!!R,message:R?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=Jh(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=I0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Gl(this.consoleMessages),f=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:mf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:mf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:mf(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Gl(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=Jh(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=Wh(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,a=I0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&a&&typeof a.then=="function"&&await a,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let f=Gl(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Gl(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as tr from"crypto";import*as fW from"querystring";import*as hP from"vm";function mP(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function gP(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function dW(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=mP(r[2],e),i=Ji(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return gP(e[t]);if(zo(t)){let n=Wo(t,e),i=Jo(t,n);if(i!==void 0)return i}}function pP(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=tr.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function k0(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,a){let l=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=tr.randomBytes(8),{key:d,iv:m}=pP(s,e,r,f),g=tr.createCipheriv(n(e),d,m),y=Buffer.concat([g.update(l),g.final()]),S=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:_=>_?_.stringify(new je(S)):S.toString("base64")}}else{let f=s.toBuffer(),d=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),m=tr.createCipheriv(n(f.length),f,d);a?.padding===!1&&m.setAutoPadding(!1);let g=Buffer.concat([m.update(l),m.final()]);return{ciphertext:new je(g),toString:y=>y?y.stringify(new je(g)):g.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),f=l.subarray(16)):(d=Buffer.alloc(0),f=l);let{key:m,iv:g}=pP(s,e,r,d),y=tr.createDecipheriv(n(e),m,g);return new je(Buffer.concat([y.update(f),y.final()]))}else{let l=s.toBuffer(),f=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),m=tr.createDecipheriv(n(l.length),l,f);return a?.padding===!1&&m.setAutoPadding(!1),new je(Buffer.concat([m.update(d),m.final()]))}}}}function pW(){let t=r=>n=>{let i=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8");return new je(tr.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");return new je(tr.createHmac(r,a).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:k0("aes",32,16),DES:k0("des",8,8),TripleDES:k0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof je?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new je(tr.pbkdf2Sync(s,a,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>je.fromBase64(r)},Utf8:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>je.fromUtf8(r)},Hex:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>je.fromHex(r)},Latin1:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new je(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new je(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new je(r):new je(Buffer.from(String(r))):new je(Buffer.alloc(0)),random:r=>new je(tr.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var je,es,vf=se(()=>{"use strict";nh();sh();ah();x0();P0();zh();je=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};es=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=R0(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new yf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let a={ctx:e,hf:e,pm:e,console:r,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:tr,_:s("lodash"),require:s,moment:Vh(),querystring:fW,CryptoJS:pW(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let d of f)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,f,d)=>JSON.stringify(l,f,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),d;return f.parseString(l,{explicitArray:!1},(m,g)=>{if(m)throw m;d=g}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return hP.createContext(a)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),m=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(_,R)=>{let P=this.serializeValue(R);g.set(_,P),n[_]=P},unset(_){g.unset(_),delete n[_]},clear(){g.clear();for(let _ of Object.keys(a))delete n[_]}};return d.replaceIn=f.replaceIn,m.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:m,variables:f,environment:y,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:hf,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,a)=>{r&&r(i,s,a)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let a=this.serializeValue(s);e[i]=a,n("set",i,a)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let a={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in r?this.deserializeValue(r[l]):l in n?this.deserializeValue(n[l]):this.deserializeValue(i[l]),set:(l,f)=>{e[l]=this.serializeValue(f)},has(l){return l in e||l in s||l in r||l in r||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=a.toObject(),d=20,m=y=>y.replace(/\{\{([^}]+)\}\}/g,(S,_)=>{let R=_.trim(),P=R.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(P)try{let B=mP(P[2],f),V=Ji(P[1],B);return V!==null?String(V):S}catch{return S}let A=Tu(R);if(A){let B=dW(A.input,f);if(B!==void 0){let V=Au(B,A.filters,f);return V!==void 0?String(V):S}return S}let U=a.get(R);if(U!==void 0)return String(U);if(zo(R)){let B={};for(let[X,T]of Object.entries(f))B[X]=gP(T);let V=Wo(R,B),W=Jo(R,V);if(W!==void 0)return String(W)}return S}),g=l;for(let y=0;y<d;y++){let S=m(g);if(S===g)break;g=S}return g}};return a}createEnvironmentScope(e,r,n,i){let s=(a,l,f)=>{n&&(i?n(a,l,f):n(l||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,l)=>{let f=this.serializeValue(l);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,r=()=>{throw new Error("pm.vault is read-only in HTTP Forge. Use environment variables or {{secret:provider/path}} tokens to manage secrets.")};return{async get(n){if(!e)throw new Error('pm.vault is not available \u2014 no secret providers are configured. Configure a provider under "secrets.providers" to use pm.vault.get().');let i=`secret:${n}`;return(await e.resolveSecretTokens(`{{${i}}}`))[i]},set:r,unset:r}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}}});var T0,ca,Yh=se(()=>{"use strict";T0={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},ca=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{return e}if(typeof e=="object"&&e!==null&&e.query){let r=e.variables;if(typeof r=="string")try{r=r.trim()?JSON.parse(r):void 0}catch{r=void 0}return JSON.stringify({query:e.query,...r!=null?{variables:r}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=T0["x-www-form-urlencoded"];break;case"raw":s=r.format?T0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=T0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var fa,Kh=se(()=>{"use strict";fa=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let a=this.parseCsvLine(r[s]),l={};n.forEach((f,d)=>{l[f]=a[d]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=e[s+1];a==='"'?i&&l==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}}});import*as Ql from"crypto";var mW,_f,q0=se(()=>{"use strict";mW=3e4,_f=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,a,n);let d=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),m=this.parseTokenResponse(d.body,e);m.refreshToken||(m.refreshToken=r);let g=this.buildCacheKeyString(e);return this.tokenCache.set(g,m),m.refreshToken&&await this.storeRefreshToken(g,m.refreshToken),m}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,d,m,g;if(f){d=this.generateCodeVerifier();let X=e.pkceMethod||"S256";m=X==="S256"?this.generateCodeChallengeS256(d):d,g=X}let y=e.state||Ql.randomBytes(16).toString("hex"),S=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",S),l&&_.searchParams.set("scope",l),_.searchParams.set("state",y),m&&(_.searchParams.set("code_challenge",m),_.searchParams.set("code_challenge_method",g)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,T]of Object.entries(e.extraParams))_.searchParams.set(X,this.resolve(T,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let R=new Promise((X,T)=>{this.pendingAuthCallback={resolve:X,reject:T,state:y}});await this.browserService.openExternal(_.toString());let P;try{P=await Promise.race([R,new Promise((X,T)=>setTimeout(()=>{this.pendingAuthCallback=null,T(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(P.state&&P.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let A=new URLSearchParams;A.append("grant_type","authorization_code"),A.append("code",P.code),A.append("redirect_uri",S),d&&A.append("code_verifier",d);let U={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,U,A,s,a,r);let B=await this.httpService.execute({method:"POST",url:i,headers:U,body:A.toString()}),V=this.parseTokenResponse(B.body,e),W=this.buildCacheKeyString(e);return this.tokenCache.set(W,V),V.refreshToken&&await this.storeRefreshToken(W,V.refreshToken),V}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||Ql.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",l),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[S,_]of Object.entries(e.extraParams))f.searchParams.set(S,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((S,_)=>{this.pendingImplicitCallback={resolve:S,reject:_,state:a}});await this.browserService.openExternal(f.toString());let m;try{m=await Promise.race([d,new Promise((S,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(m.state&&m.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let g={accessToken:m.accessToken,tokenType:m.tokenType||e.tokenPrefix||"Bearer",expiresAt:m.expiresIn?Date.now()+m.expiresIn*1e3:void 0,raw:{access_token:m.accessToken,token_type:m.tokenType,expires_in:m.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,g),g}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let g=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!g)throw new Error("OAuth2 password grant requires username");f.append("username",g),f.append("password",y)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[g,y]of Object.entries(e.extraParams))f.append(g,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,f,s,a,r);let m=await this.httpService.execute({method:"POST",url:i,headers:d,body:f.toString()});return this.parseTokenResponse(m.body,e)}applyClientAuth(e,r,n,i,s,a){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=r.tokenField||"access_token",a=i[s];if(!a)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:a,tokenType:i.token_type||r.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-mW:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return Ql.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ql.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as da from"fs";import*as Vs from"path";function Zl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&da.writeFileSync(t,r.join(`
51
- `),"utf-8")}function Rf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&da.writeFileSync(Vs.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&da.writeFileSync(Vs.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function gW(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Vs.isAbsolute(n)?n:Vs.join(t,n)}async function yW(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Qh(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Vs.join(e,It(n.name));da.mkdirSync(i,{recursive:!0}),Rf(i,It(n.name),n.scripts),Qh(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=It(i.name)+".http",a=Vs.join(e,s),l=vW(i,r);da.writeFileSync(a,l,"utf-8"),Rf(e,It(i.name),i.scripts)}})}function vW(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${It(e.name)}.env`),r.push(`# request scripts: ${It(t.name)}.pre.js and .post.js`);let n=bW(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
52
- `)}function bW(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var Zh=se(()=>{"use strict";bn()});import*as ur from"fs";import*as $0 from"path";var Xl,M0=se(()=>{"use strict";bn();Xl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){ur.existsSync(this.collectionsDir)||ur.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!ur.existsSync(this.collectionsDir))return[];let e=ur.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=$0.join(this.collectionsDir,n),s=ur.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(ur.existsSync(r))try{let n=ur.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=dt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await ur.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!ur.existsSync(r))return!1;try{return await ur.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return ur.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return $0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||dt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:l,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let d=a.get(f);d&&(l.push(d),a.delete(f))}for(let f of a.values())l.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=l)}else i.items=l;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}}});var xf,N0=se(()=>{"use strict";Xp();M0();xf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new $s(n):new Xl(n)}static createForFormat(e,r){return e==="folder"?new $s(r):new Xl(r)}}});import*as wt from"fs";import*as Qn from"path";function yP(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function SW(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>vP(e)),event:D0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function vP(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(vP):[],event:D0(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(wW),url:_W(e),body:RW(e),auth:xW(e.auth),description:e.description},event:D0(e.scripts),protocolProfileBehavior:CW(e.settings)}}}function wW(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function _W(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let d=a[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let m={key:d.key,value:d.value};return d.enabled===!1&&(m.disabled=!0),m});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(g=>{let[y,...S]=g.split("=");return{key:y,value:S.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([d,m])=>({key:d,value:String(m)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:l&&l.length>0?l:void 0,variable:f&&f.length>0?f:void 0}}function RW(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=yP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||yP(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function xW(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function CW(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function D0(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Cf,F0=se(()=>{"use strict";bn();Zh();N0();Cf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=xf.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){wt.existsSync(this.collectionsDir)||wt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadCollections(),this.onCollectionsChanged?.()},200)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=dt(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:l,type:f,...d}=n;Object.assign(a,d)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=dt(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:dt(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=dt(r),s=this.loader.getCollectionPath(e),a=Qn.join(this.collectionsDir,i);if(!wt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let l=Qn.join(a,"collection.json");if(wt.existsSync(l)){let d=JSON.parse(wt.readFileSync(l,"utf-8"));d.id=i,d.name=r,wt.writeFileSync(l,JSON.stringify(d,null,2))}else wt.writeFileSync(l,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:dt(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!wt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Qn.dirname(s),l=dt(n),f=Qn.join(a,l);this.copyDirRecursive(s,f);let d=Qn.join(f,"folder.json");if(wt.existsSync(d)){let y=JSON.parse(wt.readFileSync(d,"utf-8"));y.id=l,y.name=n,wt.writeFileSync(d,JSON.stringify(y,null,2))}else wt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));let m=this.loader.load(e);m&&this.collections.set(e,m);let g=this.findItemById(m?.items||[],l);return g||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||dt(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){wt.existsSync(r)||wt.mkdirSync(r,{recursive:!0});for(let n of wt.readdirSync(e,{withFileTypes:!0})){let i=Qn.join(e,n.name),s=Qn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):wt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=wt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||dt(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=d=>{if(!d)return;switch(d.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:d.bearer?.find(A=>A.key==="token")?.value||""};case"basic":let y=d.basic?.find(A=>A.key==="username"),S=d.basic?.find(A=>A.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:S?.value||""}};case"apikey":let _=d.apikey?.find(A=>A.key==="key"),R=d.apikey?.find(A=>A.key==="value"),P=d.apikey?.find(A=>A.key==="in");return{type:"apikey",apikey:{key:_?.value||"",value:R?.value||"",in:P?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=d=>{if(!Array.isArray(d)||d.length===0)return;let m={};for(let g of d){let y=g.script?.exec;if(!y)continue;let S=Array.isArray(y)?y.join(`
53
- `):y;g.listen==="prerequest"?m.preRequest=S:g.listen==="test"&&(m.postResponse=S)}return m.preRequest||m.postResponse?m:void 0},i=d=>{if(!d||typeof d!="object")return;let m={};return d.followRedirects===!1&&(m.followRedirects=!1),d.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),d.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),d.maxRedirects!==void 0&&(m.maxRedirects=d.maxRedirects),d.requestTimeout!==void 0&&(m.timeout=d.requestTimeout),Object.keys(m).length>0?m:void 0},s=d=>{if(!d||typeof d=="string")return;let m=d.query;if(!(!Array.isArray(m)||m.length===0))return m.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0}))},a=d=>{if(typeof d=="string")return d;if(!d)return"";let m=new Set;if(Array.isArray(d.variable))for(let y of d.variable)y.key&&m.add(y.key);if(m.size===0&&d.raw)return d.raw;let g="";if(d.protocol&&(g+=d.protocol+"://"),d.host&&(g+=Array.isArray(d.host)?d.host.join("."):d.host),d.port&&(g+=":"+d.port),d.path){let S=(Array.isArray(d.path)?d.path:[d.path]).map(_=>{let R=_.startsWith(":")?_.substring(1):_;return m.has(R)?":"+R:(_.startsWith(":"),_)});g+="/"+S.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(m=>{if(m.item)return{id:dt(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:l(m.item)};{let g=m.request||{};return{id:dt(m.name),type:"request",name:m.name,description:m.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:a(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(y=>({key:y.key||y.name||"",value:y.value||y.value||"",enabled:y.disabled!==!0})):[],body:(()=>{let y=g.body;if(y){if(y.mode==="raw"&&y.raw){let S=y.options?.raw?.language;return{type:"raw",format:S==="xml"?"xml":S==="html"?"html":S==="javascript"?"javascript":S==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(S=>({key:S.key||"",value:S.value||"",enabled:S.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(S=>({key:S.key||"",value:S.value||"",type:S.type||"text",enabled:S.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let S;if(y.graphql.variables)try{S=JSON.parse(y.graphql.variables)}catch{S=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:S}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior)}}}),f={id:dt(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:l(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=SW(n),s=JSON.stringify(i,null,2);wt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Qn.join(r,It(n.name));wt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Zl(Qn.join(i,`${It(n.name)}.env`),s),Rf(i,It(n.name),n.scripts),Qh(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Vt,ec,pa,L0=se(()=>{"use strict";Vt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,toolMode:"flat",drilldownThreshold:200,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},ec={config:"http-forge.config.json"},pa={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as jr from"fs";import*as Cn from"path";var tc,j0=se(()=>{"use strict";L0();tc=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=Cn.join(e,ec.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!jr.existsSync(this.configPath))return{...Vt};try{let e=jr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${ec.config}. Using default configuration.`),{...Vt}}}mergeWithDefaults(e){return{version:e.version??Vt.version,storage:{...Vt.storage,...e.storage},request:{...Vt.request,...e.request},scripts:{...Vt.scripts,...e.scripts},runner:{...Vt.runner,...e.runner},environments:{...Vt.environments,...e.environments},restClientExport:{...Vt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Vt.proxy,mcp:{...Vt.mcp,...e.mcp,cors:{...Vt.mcp.cors,...e.mcp?.cors}},secrets:{...Vt.secrets,...e.secrets,providers:{...Vt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,ec.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return Cn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??Vt.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return Cn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return Cn.join(this.getRootPath(),pa.collections)}getEnvironmentsPath(){return Cn.join(this.getRootPath(),pa.environments)}getFlowsPath(){return Cn.join(this.getRootPath(),pa.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return Cn.join(this.getRootPath(),pa.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return jr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Vt,null,2);await jr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)jr.existsSync(i)||await jr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)jr.existsSync(i)||await jr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await jr.promises.writeFile(Cn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await jr.promises.writeFile(Cn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await jr.promises.writeFile(Cn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var EW,Ef,U0=se(()=>{"use strict";Bo();EW="httpForge.cookies",Ef=class{constructor(e,r=EW){this.store=e;this.storeKey=r;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return at.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return at.parseCookieHeaders(e,r)}isExpired(e){return at.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return at.domainMatches(e,r)}get count(){return this.cookies.size}}});var Of,H0=se(()=>{"use strict";Bo();Of=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(at.isExpired(s)||s.domain&&!at.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return at.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}}});function Xh(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let f=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;f&&d!==!1&&(s[f]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,f]of Object.entries(i))s[l]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function OW(t,e){try{let r=await e.readFile(t);return Xh(r)}catch{return null}}var B0=se(()=>{"use strict"});import*as Wt from"fs";import*as on from"path";var If,Pf,V0=se(()=>{"use strict";bn();B0();Zh();rh();qu();If={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Pf=class{constructor(e,r,n,i,s){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;let a=n.getEnvironmentsPath();this.environmentsPath=a,this.sharedConfigPath=on.join(a,"_global.json"),this.localConfigPath=on.join(a,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(If.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Wt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Wt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${If.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],l=i?.variables||{},f=a?.variables||{},d=a&&a.headers||{},m=xu(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},S={...n.globalVariables||{},...s.variables||{},...l,...f,...g,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:m,variables:S}}async getSecretVariable(e,r){return this.secretStore?.get(`${e}:${r}`)}async setSecretVariable(e,r,n){await this.secretStore?.store(`${e}:${r}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[r]=n}async deleteSecretVariable(e,r){await this.secretStore?.delete(`${e}:${r}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[r]}async loadSecretVariables(e){if(!this.secretStore)return;let r=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[r]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let a=await this.secretStore.get(`${r}:${s}`);a!==void 0&&(i[s]=a)})),this.secretValuesCache.set(r,i)}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=on.join(e,"globals.env");Zl(a,s)}n.forEach(a=>{let l=i?.environments?.[a];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let d=on.join(e,`${It(a)}.env`);Zl(d,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return on.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Wt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Wt.readFileSync(e,"utf-8"),n=Xh(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return on.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Pu(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...r||{}};return new Go({globals:{},collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Wt.existsSync(this.environmentsPath)||Wt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Wt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!th(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=on.basename(s,".json");if(!i.has(a))try{Wt.unlinkSync(on.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let l={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(on.join(this.environmentsPath,`${s}.json`),l)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Wt.existsSync(e))return null;let r=Wt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=on.dirname(e);Wt.existsSync(n)||Wt.mkdirSync(n,{recursive:!0}),Wt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var Ws,em=se(()=>{"use strict";gf();Ws=class t{constructor(e,r,n,i,s,a,l,f,d,m,g,y){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=d;this.collectionName=m;this.iteration=g;this.iterationCount=y}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let f=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...f},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_,this.environment):y==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setGlobalVariable(S,_):y==="unset"&&S?this.envConfigService.deleteGlobalVariable(S):y==="clear"&&this.envConfigService.clearGlobalVariables()}},m=this.scriptExecutor.createRequestSession(d),g=null;try{let y={...r},S={...e},_;if(s.length>0){let $=await m.executePreRequest(s);if($.consoleOutput&&$.consoleOutput.length>0&&this.onConsoleOutput?.($.consoleOutput),$.nextRequest!==void 0&&(_=$.nextRequest),$.skipRequest){let G={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:G,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:_}}$.success&&($.modifiedRequest&&($.modifiedRequest.url&&(S.url=$.modifiedRequest.url),$.modifiedRequest.headers&&(S.headers=$.modifiedRequest.headers),$.modifiedRequest.params&&(S.params=$.modifiedRequest.params),$.modifiedRequest.query&&(S.query=$.modifiedRequest.query),$.modifiedRequest.body!==void 0&&(S.body=$.modifiedRequest.body)),$.modifiedVariables&&(y=$.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,l,y);let{url:R,headers:P,body:A,method:U}=g,B={};for(let $ in P)Object.prototype.hasOwnProperty.call(P,$)&&(B[$.toUpperCase()]=P[$]);if(!B.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let G=this.cookieJar.getCookieHeader(R);G&&(B.COOKIE=G)}let V={method:U,url:R,headers:B,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},W=await this.httpService.execute(V);this.cookieJar&&W.headers&&await this.cookieJar.setCookiesFromResponse(R,W.headers);let X=Date.now()-i,T=[],x={},k;if(a.length>0){let $=0;if(W.body)if(typeof W.body=="string")$=Buffer.byteLength(W.body,"utf8");else if(Buffer.isBuffer(W.body))$=W.body.length;else try{$=Buffer.byteLength(JSON.stringify(W.body),"utf8")}catch{$=0}let G=Gh(W.headers,W.cookies,g.url),K={executedRequest:g,status:W.status,statusText:W.statusText,headers:O0(W.headers||{}),body:W.body,cookies:G,responseTime:W.time,responseSize:$},ne=await m.executePostResponse(a,K);T=ne.testResults,x=ne.modifiedEnvironmentVariables||{},k=ne.visualizerData,ne.nextRequest!==void 0&&(_=ne.nextRequest),ne.consoleOutput&&ne.consoleOutput.length>0&&this.onConsoleOutput?.(ne.consoleOutput)}let N=T.length===0||T.every($=>$.passed),j=T.length>0?N:W.status>=200&&W.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:W.status,statusText:W.statusText,headers:W.headers||{},body:W.body,time:W.time||X,cookies:W.cookies||[]},duration:X,timestamp:Date.now(),passed:j,assertions:T,modifiedVariables:y,modifiedEnvironmentVariables:x,nextRequest:_,visualizerData:k}}catch(y){return this.handleError(e,g,y,i)}finally{m.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",m=this.errorBodyFormat,g,y;m==="html"||m==="both"?(g=t.formatErrorAsHtml(f,d),y={"content-type":"text/html; charset=utf-8"}):(g=f,y={});let S={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:a||"GET",headers:r?.headers||{},body:r?.body||S,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:g,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");return`<!doctype html>
50
+ `)}function mf(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Gl(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function uW(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function E0(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(a)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r.skip=(n,i)=>{t.push({name:n,passed:!0,skipped:!0})},r.fail=n=>{t.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},r.index=()=>t.length,r._pendingTests=e,r}function O0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function Kh(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=at.parseCookieHeaders(t||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var gf=se(()=>{"use strict";Vo()});import*as I0 from"vm";function fW(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var yf,P0=se(()=>{"use strict";pP();Gh();gf();yf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=dP(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),f={};for(let d of l)f[d.name]=d.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,d){try{if(!l){d(null,[]);return}let m=l.getAll(f).map(g=>({name:g.name,value:g.value,domain:g.domain,path:g.path,httpOnly:g.httpOnly,secure:g.secure}));d(null,m)}catch(m){d(m,[])}},get(f,d,m){try{if(!l){m(null,void 0);return}let g=l.get(d,f);m(null,g?{name:g.name,value:g.value,domain:g.domain}:void 0)}catch(g){m(g,void 0)}},set(f,d,m,g){try{if(!l){(g||m)?.(null);return}typeof d=="string"&&typeof m=="string"?(l.set({name:d,value:m,domain:f}),g?.(null)):typeof d=="object"&&(l.set({...d,domain:f}),m?.(null))}catch(y){(g||m)?.(y)}},unset(f,d,m){try{if(!l){m?.(null);return}l.delete(d,f),m?.(null)}catch(g){m?.(g)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(d){f?.(d)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:E0(this.assertions),expect:hf,cookies:s,execution:{setNextRequest(l){a._nextRequest=l},skipRequest(){a._skipRequest=!0},runRequest(l,f){let m=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let g=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(g),S=Array.isArray(y?.cookies)?y.cookies.filter(P=>P?.name):[],_=y?.body,R=0;if(typeof _=="string")R=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))R=_.length;else if(_!=null)try{R=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return Jh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:_,cookies:S,responseTime:y?.time,responseSize:R})})();if(typeof f=="function"){m.then(g=>f(null,g),g=>f(g));return}return m},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){a._nextRequest=l},visualizer:{set(l,f){a._visualizerData={template:l,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:l=>{l&&l.key&&(e.headers[l.key]=l.value||"")},get:l=>{for(let[f,d]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase()){delete e.headers[f];break}},update:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&(l[f]=d);return l},each:l=>{for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&l({key:f,value:d})}},a={get mode(){return n(e.body?.type)},set mode(l){let f=i(l);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let l=e.body?.content;return typeof l=="string"?l:l&&typeof l=="object"?JSON.stringify(l):""},set raw(l){e.body?(e.body.type="raw",e.body.content=l):e.body={type:"raw",content:l}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return fW(e.url)},set url(l){e.url=typeof l=="string"?l:String(l)},get method(){return e.method},set method(l){e.method=l},headers:s,get body(){return a},set body(l){if(l==null)e.body=null;else if(typeof l=="string")e.body={type:"raw",content:l};else if(typeof l=="object")if(l.type||l.mode||l.content!==void 0){let f=l.mode?i(l.mode):l.type||"raw";e.body={type:f,format:l.format,content:l.content}}else e.body={type:"raw",content:l}},get params(){return e.params||{}},set params(l){e.params=l||{}},get query(){return e.query||{}},set query(l){e.query=l||{}},get auth(){return r.request?.auth||null},set auth(l){r.request&&(r.request.auth=l)},get certificate(){return r.request?.certificate||null},set certificate(l){r.request&&(r.request.certificate=l)},get description(){return r.request?.description||null},set description(l){r.request&&(r.request.description=l)},get name(){return r.request?.name||null},set name(l){r.request&&(r.request.name=l)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(l){r.request&&(r.request.disabled=l)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(l){let f={};for(let[d,m]of Object.entries(e.headers))typeof m=="string"&&(f[d]=m);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[d,m]of f)e.query||(e.query={}),e.query[d]=m}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(f=>{let d=typeof f=="string"?f:f.key;d&&delete e.query[d]}))},authorizeUsing(l,f){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,f&&(r.request.auth.parameters=f)):typeof l=="object"&&(r.request.auth=l))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(l,f){r.request&&(r.request.description={content:l,type:f||"text/plain"})},setHeader(l,f){e.headers[l]=f},addHeader(l,f){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=f},removeHeader(l){delete e.headers[l]},setBody(l,f,d){e.body={type:f||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,a={};for(let[S,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(a[S]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:a,data:f},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!r)return;let m=r.body;n.responseBody=m==null?"":typeof m=="string"?m:JSON.stringify(m);let g=r.statusText||"";n.responseCode={code:r.status,name:g,detail:g},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(S=>({...S}));let y=this;n.tests=new Proxy({},{set(S,_,R){return y.assertions.push({name:String(_),passed:!!R,message:R?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=Yh(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=I0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Gl(this.consoleMessages),f=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:mf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:mf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:mf(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Gl(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=Yh(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=Jh(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,a=I0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&a&&typeof a.then=="function"&&await a,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let f=Gl(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Gl(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as tr from"crypto";import*as dW from"querystring";import*as mP from"vm";function gP(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function yP(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function pW(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=gP(r[2],e),i=Ji(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return yP(e[t]);if(Jo(t)){let n=zo(t,e),i=Go(t,n);if(i!==void 0)return i}}function hP(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=tr.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function k0(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,a){let l=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=tr.randomBytes(8),{key:d,iv:m}=hP(s,e,r,f),g=tr.createCipheriv(n(e),d,m),y=Buffer.concat([g.update(l),g.final()]),S=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:_=>_?_.stringify(new je(S)):S.toString("base64")}}else{let f=s.toBuffer(),d=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),m=tr.createCipheriv(n(f.length),f,d);a?.padding===!1&&m.setAutoPadding(!1);let g=Buffer.concat([m.update(l),m.final()]);return{ciphertext:new je(g),toString:y=>y?y.stringify(new je(g)):g.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),f=l.subarray(16)):(d=Buffer.alloc(0),f=l);let{key:m,iv:g}=hP(s,e,r,d),y=tr.createDecipheriv(n(e),m,g);return new je(Buffer.concat([y.update(f),y.final()]))}else{let l=s.toBuffer(),f=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),m=tr.createDecipheriv(n(l.length),l,f);return a?.padding===!1&&m.setAutoPadding(!1),new je(Buffer.concat([m.update(d),m.final()]))}}}}function hW(){let t=r=>n=>{let i=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8");return new je(tr.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");return new je(tr.createHmac(r,a).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:k0("aes",32,16),DES:k0("des",8,8),TripleDES:k0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof je?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new je(tr.pbkdf2Sync(s,a,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>je.fromBase64(r)},Utf8:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>je.fromUtf8(r)},Hex:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>je.fromHex(r)},Latin1:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new je(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new je(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new je(r):new je(Buffer.from(String(r))):new je(Buffer.alloc(0)),random:r=>new je(tr.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var je,es,vf=se(()=>{"use strict";sh();ah();ch();x0();P0();Gh();je=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};es=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=R0(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new yf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let a={ctx:e,hf:e,pm:e,console:r,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:tr,_:s("lodash"),require:s,moment:zh(),querystring:dW,CryptoJS:hW(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let d of f)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,f,d)=>JSON.stringify(l,f,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),d;return f.parseString(l,{explicitArray:!1},(m,g)=>{if(m)throw m;d=g}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return mP.createContext(a)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),m=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(_,R)=>{let P=this.serializeValue(R);g.set(_,P),n[_]=P},unset(_){g.unset(_),delete n[_]},clear(){g.clear();for(let _ of Object.keys(a))delete n[_]}};return d.replaceIn=f.replaceIn,m.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:m,variables:f,environment:y,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:hf,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,a)=>{r&&r(i,s,a)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let a=this.serializeValue(s);e[i]=a,n("set",i,a)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let a={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in r?this.deserializeValue(r[l]):l in n?this.deserializeValue(n[l]):this.deserializeValue(i[l]),set:(l,f)=>{e[l]=this.serializeValue(f)},has(l){return l in e||l in s||l in r||l in r||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=a.toObject(),d=20,m=y=>y.replace(/\{\{([^}]+)\}\}/g,(S,_)=>{let R=_.trim(),P=R.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(P)try{let B=gP(P[2],f),V=Ji(P[1],B);return V!==null?String(V):S}catch{return S}let A=Tu(R);if(A){let B=pW(A.input,f);if(B!==void 0){let V=Au(B,A.filters,f);return V!==void 0?String(V):S}return S}let U=a.get(R);if(U!==void 0)return String(U);if(Jo(R)){let B={};for(let[X,T]of Object.entries(f))B[X]=yP(T);let V=zo(R,B),W=Go(R,V);if(W!==void 0)return String(W)}return S}),g=l;for(let y=0;y<d;y++){let S=m(g);if(S===g)break;g=S}return g}};return a}createEnvironmentScope(e,r,n,i){let s=(a,l,f)=>{n&&(i?n(a,l,f):n(l||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,l)=>{let f=this.serializeValue(l);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,r=()=>{throw new Error("pm.vault is read-only in HTTP Forge. Use environment variables or {{secret:provider/path}} tokens to manage secrets.")};return{async get(n){if(!e)throw new Error('pm.vault is not available \u2014 no secret providers are configured. Configure a provider under "secrets.providers" to use pm.vault.get().');let i=`secret:${n}`;return(await e.resolveSecretTokens(`{{${i}}}`))[i]},set:r,unset:r}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}}});var T0,ua,Qh=se(()=>{"use strict";T0={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},ua=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{return e}if(typeof e=="object"&&e!==null&&e.query){let r=e.variables;if(typeof r=="string")try{r=r.trim()?JSON.parse(r):void 0}catch{r=void 0}return JSON.stringify({query:e.query,...r!=null?{variables:r}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=T0["x-www-form-urlencoded"];break;case"raw":s=r.format?T0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=T0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var da,Zh=se(()=>{"use strict";da=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let a=this.parseCsvLine(r[s]),l={};n.forEach((f,d)=>{l[f]=a[d]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=e[s+1];a==='"'?i&&l==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}}});import*as Ql from"crypto";var gW,_f,q0=se(()=>{"use strict";gW=3e4,_f=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,a,n);let d=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),m=this.parseTokenResponse(d.body,e);m.refreshToken||(m.refreshToken=r);let g=this.buildCacheKeyString(e);return this.tokenCache.set(g,m),m.refreshToken&&await this.storeRefreshToken(g,m.refreshToken),m}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,d,m,g;if(f){d=this.generateCodeVerifier();let X=e.pkceMethod||"S256";m=X==="S256"?this.generateCodeChallengeS256(d):d,g=X}let y=e.state||Ql.randomBytes(16).toString("hex"),S=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",S),l&&_.searchParams.set("scope",l),_.searchParams.set("state",y),m&&(_.searchParams.set("code_challenge",m),_.searchParams.set("code_challenge_method",g)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,T]of Object.entries(e.extraParams))_.searchParams.set(X,this.resolve(T,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let R=new Promise((X,T)=>{this.pendingAuthCallback={resolve:X,reject:T,state:y}});await this.browserService.openExternal(_.toString());let P;try{P=await Promise.race([R,new Promise((X,T)=>setTimeout(()=>{this.pendingAuthCallback=null,T(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(P.state&&P.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let A=new URLSearchParams;A.append("grant_type","authorization_code"),A.append("code",P.code),A.append("redirect_uri",S),d&&A.append("code_verifier",d);let U={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,U,A,s,a,r);let B=await this.httpService.execute({method:"POST",url:i,headers:U,body:A.toString()}),V=this.parseTokenResponse(B.body,e),W=this.buildCacheKeyString(e);return this.tokenCache.set(W,V),V.refreshToken&&await this.storeRefreshToken(W,V.refreshToken),V}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||Ql.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",l),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[S,_]of Object.entries(e.extraParams))f.searchParams.set(S,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((S,_)=>{this.pendingImplicitCallback={resolve:S,reject:_,state:a}});await this.browserService.openExternal(f.toString());let m;try{m=await Promise.race([d,new Promise((S,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(m.state&&m.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let g={accessToken:m.accessToken,tokenType:m.tokenType||e.tokenPrefix||"Bearer",expiresAt:m.expiresIn?Date.now()+m.expiresIn*1e3:void 0,raw:{access_token:m.accessToken,token_type:m.tokenType,expires_in:m.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,g),g}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let g=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!g)throw new Error("OAuth2 password grant requires username");f.append("username",g),f.append("password",y)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[g,y]of Object.entries(e.extraParams))f.append(g,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,f,s,a,r);let m=await this.httpService.execute({method:"POST",url:i,headers:d,body:f.toString()});return this.parseTokenResponse(m.body,e)}applyClientAuth(e,r,n,i,s,a){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=r.tokenField||"access_token",a=i[s];if(!a)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:a,tokenType:i.token_type||r.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-gW:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return Ql.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ql.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as pa from"fs";import*as Vs from"path";function Zl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&pa.writeFileSync(t,r.join(`
51
+ `),"utf-8")}function Rf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&pa.writeFileSync(Vs.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&pa.writeFileSync(Vs.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function yW(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Vs.isAbsolute(n)?n:Vs.join(t,n)}async function vW(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Xh(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Vs.join(e,It(n.name));pa.mkdirSync(i,{recursive:!0}),Rf(i,It(n.name),n.scripts),Xh(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=It(i.name)+".http",a=Vs.join(e,s),l=bW(i,r);pa.writeFileSync(a,l,"utf-8"),Rf(e,It(i.name),i.scripts)}})}function bW(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${It(e.name)}.env`),r.push(`# request scripts: ${It(t.name)}.pre.js and .post.js`);let n=SW(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
52
+ `)}function SW(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var em=se(()=>{"use strict";bn()});import*as ur from"fs";import*as $0 from"path";var Xl,M0=se(()=>{"use strict";bn();Xl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){ur.existsSync(this.collectionsDir)||ur.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!ur.existsSync(this.collectionsDir))return[];let e=ur.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=$0.join(this.collectionsDir,n),s=ur.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(ur.existsSync(r))try{let n=ur.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=dt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await ur.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!ur.existsSync(r))return!1;try{return await ur.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return ur.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return $0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||dt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:l,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let d=a.get(f);d&&(l.push(d),a.delete(f))}for(let f of a.values())l.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=l)}else i.items=l;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}}});var xf,N0=se(()=>{"use strict";th();M0();xf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new $s(n):new Xl(n)}static createForFormat(e,r){return e==="folder"?new $s(r):new Xl(r)}}});import*as wt from"fs";import*as Qn from"path";function vP(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function wW(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>bP(e)),event:D0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function bP(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(bP):[],event:D0(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(_W),url:RW(e),body:xW(e),auth:CW(e.auth),description:e.description},event:D0(e.scripts),protocolProfileBehavior:EW(e.settings)}}}function _W(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function RW(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let d=a[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let m={key:d.key,value:d.value};return d.enabled===!1&&(m.disabled=!0),m});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(g=>{let[y,...S]=g.split("=");return{key:y,value:S.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([d,m])=>({key:d,value:String(m)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:l&&l.length>0?l:void 0,variable:f&&f.length>0?f:void 0}}function xW(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=vP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||vP(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function CW(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function EW(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function D0(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Cf,F0=se(()=>{"use strict";bn();em();N0();Cf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=xf.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){wt.existsSync(this.collectionsDir)||wt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null;let r=this.selfWritePending;this.selfWritePending=!1,r||this.loadCollections(),this.onCollectionsChanged?.()},300)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=dt(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:l,type:f,...d}=n;Object.assign(a,d)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=dt(r.name)),this.selfWritePending=!0;try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:dt(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=dt(r),s=this.loader.getCollectionPath(e),a=Qn.join(this.collectionsDir,i);if(!wt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let l=Qn.join(a,"collection.json");if(wt.existsSync(l)){let d=JSON.parse(wt.readFileSync(l,"utf-8"));d.id=i,d.name=r,wt.writeFileSync(l,JSON.stringify(d,null,2))}else wt.writeFileSync(l,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){let r=this.collections.get(e.collectionId);if(!r)throw new Error("Collection not found");this.selfWritePending=!0;let n={id:dt(e.name),type:"folder",name:e.name,items:[]};if(await this.loader.saveItem(e.collectionId,n,e.parentId),e.parentId){let i=this.findItemById(r.items,e.parentId);i&&i.type==="folder"&&(i.items=i.items||[],i.items.push(n))}else r.items.push(n);return n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!wt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Qn.dirname(s),l=dt(n),f=Qn.join(a,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let d=Qn.join(f,"folder.json");if(wt.existsSync(d)){let y=JSON.parse(wt.readFileSync(d,"utf-8"));y.id=l,y.name=n,wt.writeFileSync(d,JSON.stringify(y,null,2))}else wt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let m=this.collections.get(e),g=m?this.findItemById(m.items,l):void 0;return g||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){let r=this.collections.get(e.collectionId);if(!r)throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||dt(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};if(await this.loader.saveItem(e.collectionId,n,e.parentId),e.parentId){let i=this.findItemById(r.items,e.parentId);i&&i.type==="folder"&&(i.items=i.items||[],i.items.push(n))}else r.items.push(n);return n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){wt.existsSync(r)||wt.mkdirSync(r,{recursive:!0});for(let n of wt.readdirSync(e,{withFileTypes:!0})){let i=Qn.join(e,n.name),s=Qn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):wt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=wt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||dt(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=d=>{if(!d)return;switch(d.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:d.bearer?.find(A=>A.key==="token")?.value||""};case"basic":let y=d.basic?.find(A=>A.key==="username"),S=d.basic?.find(A=>A.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:S?.value||""}};case"apikey":let _=d.apikey?.find(A=>A.key==="key"),R=d.apikey?.find(A=>A.key==="value"),P=d.apikey?.find(A=>A.key==="in");return{type:"apikey",apikey:{key:_?.value||"",value:R?.value||"",in:P?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=d=>{if(!Array.isArray(d)||d.length===0)return;let m={};for(let g of d){let y=g.script?.exec;if(!y)continue;let S=Array.isArray(y)?y.join(`
53
+ `):y;g.listen==="prerequest"?m.preRequest=S:g.listen==="test"&&(m.postResponse=S)}return m.preRequest||m.postResponse?m:void 0},i=d=>{if(!d||typeof d!="object")return;let m={};return d.followRedirects===!1&&(m.followRedirects=!1),d.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),d.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),d.maxRedirects!==void 0&&(m.maxRedirects=d.maxRedirects),d.requestTimeout!==void 0&&(m.timeout=d.requestTimeout),Object.keys(m).length>0?m:void 0},s=d=>{if(!d||typeof d=="string")return;let m=d.query;if(!(!Array.isArray(m)||m.length===0))return m.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0}))},a=d=>{if(typeof d=="string")return d;if(!d)return"";let m=new Set;if(Array.isArray(d.variable))for(let y of d.variable)y.key&&m.add(y.key);if(m.size===0&&d.raw)return d.raw;let g="";if(d.protocol&&(g+=d.protocol+"://"),d.host&&(g+=Array.isArray(d.host)?d.host.join("."):d.host),d.port&&(g+=":"+d.port),d.path){let S=(Array.isArray(d.path)?d.path:[d.path]).map(_=>{let R=_.startsWith(":")?_.substring(1):_;return m.has(R)?":"+R:(_.startsWith(":"),_)});g+="/"+S.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(m=>{if(m.item)return{id:dt(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:l(m.item)};{let g=m.request||{};return{id:dt(m.name),type:"request",name:m.name,description:m.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:a(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(y=>({key:y.key||y.name||"",value:y.value||y.value||"",enabled:y.disabled!==!0})):[],body:(()=>{let y=g.body;if(y){if(y.mode==="raw"&&y.raw){let S=y.options?.raw?.language;return{type:"raw",format:S==="xml"?"xml":S==="html"?"html":S==="javascript"?"javascript":S==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(S=>({key:S.key||"",value:S.value||"",enabled:S.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(S=>({key:S.key||"",value:S.value||"",type:S.type||"text",enabled:S.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let S;if(y.graphql.variables)try{S=JSON.parse(y.graphql.variables)}catch{S=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:S}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior)}}}),f={id:dt(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:l(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=wW(n),s=JSON.stringify(i,null,2);wt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Qn.join(r,It(n.name));wt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Zl(Qn.join(i,`${It(n.name)}.env`),s),Rf(i,It(n.name),n.scripts),Xh(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Vt,ec,ha,L0=se(()=>{"use strict";Vt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,toolMode:"flat",drilldownThreshold:200,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},ec={config:"http-forge.config.json"},ha={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as jr from"fs";import*as Cn from"path";var tc,j0=se(()=>{"use strict";L0();tc=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=Cn.join(e,ec.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!jr.existsSync(this.configPath))return{...Vt};try{let e=jr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${ec.config}. Using default configuration.`),{...Vt}}}mergeWithDefaults(e){return{version:e.version??Vt.version,storage:{...Vt.storage,...e.storage},request:{...Vt.request,...e.request},scripts:{...Vt.scripts,...e.scripts},runner:{...Vt.runner,...e.runner},environments:{...Vt.environments,...e.environments},restClientExport:{...Vt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Vt.proxy,mcp:{...Vt.mcp,...e.mcp,cors:{...Vt.mcp.cors,...e.mcp?.cors}},secrets:{...Vt.secrets,...e.secrets,providers:{...Vt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,ec.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return Cn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??Vt.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return Cn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return Cn.join(this.getRootPath(),ha.collections)}getEnvironmentsPath(){return Cn.join(this.getRootPath(),ha.environments)}getFlowsPath(){return Cn.join(this.getRootPath(),ha.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return Cn.join(this.getRootPath(),ha.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return jr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Vt,null,2);await jr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)jr.existsSync(i)||await jr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)jr.existsSync(i)||await jr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await jr.promises.writeFile(Cn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await jr.promises.writeFile(Cn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await jr.promises.writeFile(Cn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var OW,Ef,U0=se(()=>{"use strict";Vo();OW="httpForge.cookies",Ef=class{constructor(e,r=OW){this.store=e;this.storeKey=r;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return at.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return at.parseCookieHeaders(e,r)}isExpired(e){return at.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return at.domainMatches(e,r)}get count(){return this.cookies.size}}});var Of,H0=se(()=>{"use strict";Vo();Of=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(at.isExpired(s)||s.domain&&!at.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return at.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}}});function tm(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let f=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;f&&d!==!1&&(s[f]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,f]of Object.entries(i))s[l]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function IW(t,e){try{let r=await e.readFile(t);return tm(r)}catch{return null}}var B0=se(()=>{"use strict"});import*as Wt from"fs";import*as on from"path";var If,Pf,V0=se(()=>{"use strict";bn();B0();em();ih();qu();If={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Pf=class{constructor(e,r,n,i,s){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;let a=n.getEnvironmentsPath();this.environmentsPath=a,this.sharedConfigPath=on.join(a,"_global.json"),this.localConfigPath=on.join(a,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(If.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Wt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Wt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${If.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.getLocalConfig()?.variables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],l=i?.variables||{},f=a?.variables||{},d=a&&a.headers||{},m=xu(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},S={...s.variables||{},...f,...g,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:m,variables:S}}async getSecretVariable(e,r){return this.secretStore?.get(`${e}:${r}`)}async setSecretVariable(e,r,n){await this.secretStore?.store(`${e}:${r}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[r]=n}async deleteSecretVariable(e,r){await this.secretStore?.delete(`${e}:${r}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[r]}async loadSecretVariables(e){if(!this.secretStore)return;let r=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[r]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let a=await this.secretStore.get(`${r}:${s}`);a!==void 0&&(i[s]=a)})),this.secretValuesCache.set(r,i)}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=on.join(e,"globals.env");Zl(a,s)}n.forEach(a=>{let l=i?.environments?.[a];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let d=on.join(e,`${It(a)}.env`);Zl(d,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return on.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Wt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Wt.readFileSync(e,"utf-8"),n=tm(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return on.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Pu(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...r||{}},a=this.getGlobalVariables();return new Yo({globals:a,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Wt.existsSync(this.environmentsPath)||Wt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Wt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!nh(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=on.basename(s,".json");if(!i.has(a))try{Wt.unlinkSync(on.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let l={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(on.join(this.environmentsPath,`${s}.json`),l)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(If.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Wt.existsSync(e))return null;let r=Wt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=on.dirname(e);Wt.existsSync(n)||Wt.mkdirSync(n,{recursive:!0}),Wt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var Ws,rm=se(()=>{"use strict";gf();Ws=class t{constructor(e,r,n,i,s,a,l,f,d,m,g,y){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=d;this.collectionName=m;this.iteration=g;this.iterationCount=y}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let f=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...f},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_,this.environment):y==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,S,_)=>{y==="set"&&S&&_!==void 0?this.envConfigService.setGlobalVariable(S,_):y==="unset"&&S?this.envConfigService.deleteGlobalVariable(S):y==="clear"&&this.envConfigService.clearGlobalVariables()}},m=this.scriptExecutor.createRequestSession(d),g=null;try{let y={...r},S={...e},_;if(s.length>0){let $=await m.executePreRequest(s);if($.consoleOutput&&$.consoleOutput.length>0&&this.onConsoleOutput?.($.consoleOutput),$.nextRequest!==void 0&&(_=$.nextRequest),$.skipRequest){let G={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:G,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:_}}$.success&&($.modifiedRequest&&($.modifiedRequest.url&&(S.url=$.modifiedRequest.url),$.modifiedRequest.headers&&(S.headers=$.modifiedRequest.headers),$.modifiedRequest.params&&(S.params=$.modifiedRequest.params),$.modifiedRequest.query&&(S.query=$.modifiedRequest.query),$.modifiedRequest.body!==void 0&&(S.body=$.modifiedRequest.body)),$.modifiedVariables&&(y=$.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,l,y);let{url:R,headers:P,body:A,method:U}=g,B={};for(let $ in P)Object.prototype.hasOwnProperty.call(P,$)&&(B[$.toUpperCase()]=P[$]);if(!B.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let G=this.cookieJar.getCookieHeader(R);G&&(B.COOKIE=G)}let V={method:U,url:R,headers:B,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},W=await this.httpService.execute(V);this.cookieJar&&W.headers&&await this.cookieJar.setCookiesFromResponse(R,W.headers);let X=Date.now()-i,T=[],x={},k;if(a.length>0){let $=0;if(W.body)if(typeof W.body=="string")$=Buffer.byteLength(W.body,"utf8");else if(Buffer.isBuffer(W.body))$=W.body.length;else try{$=Buffer.byteLength(JSON.stringify(W.body),"utf8")}catch{$=0}let G=Kh(W.headers,W.cookies,g.url),K={executedRequest:g,status:W.status,statusText:W.statusText,headers:O0(W.headers||{}),body:W.body,cookies:G,responseTime:W.time,responseSize:$},ne=await m.executePostResponse(a,K);T=ne.testResults,x=ne.modifiedEnvironmentVariables||{},k=ne.visualizerData,ne.nextRequest!==void 0&&(_=ne.nextRequest),ne.consoleOutput&&ne.consoleOutput.length>0&&this.onConsoleOutput?.(ne.consoleOutput)}let N=T.length===0||T.every($=>$.passed),j=T.length>0?N:W.status>=200&&W.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:W.status,statusText:W.statusText,headers:W.headers||{},body:W.body,time:W.time||X,cookies:W.cookies||[]},duration:X,timestamp:Date.now(),passed:j,assertions:T,modifiedVariables:y,modifiedEnvironmentVariables:x,nextRequest:_,visualizerData:k}}catch(y){return this.handleError(e,g,y,i)}finally{m.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",m=this.errorBodyFormat,g,y;m==="html"||m==="both"?(g=t.formatErrorAsHtml(f,d),y={"content-type":"text/html; charset=utf-8"}):(g=f,y={});let S={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:a||"GET",headers:r?.headers||{},body:r?.body||S,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:g,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");return`<!doctype html>
54
54
  <html>
55
55
  <body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
56
56
  <h2 style="margin-top:0;color:#a94442">Request Error</h2>
@@ -59,7 +59,7 @@ ${i}
59
59
  ${n(r)}
60
60
  </pre>`:""}
61
61
  </body>
62
- </html>`}}});var kf,W0=se(()=>{"use strict";bn();kf=class{constructor(e,r,n,i,s,a){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=a}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,r,n,i){if(this.secretRegistry?.hasProviders){let A=await this.secretRegistry.resolveSecretTokens(e);Object.keys(A).length>0&&(i={...A,...i??{}})}let s=i&&Object.keys(i).length>0,a=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),l=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),f=xu(n?.headers||{},e.headers||{}),d=s?this.envConfigService.resolveVariablesInObjectWithExtra(f,i,r):this.envConfigService.resolveVariablesInObject(f,r);if(d=this.preprocessor.sanitizeHeaders(d),!Object.keys(d).some(A=>A.toLowerCase()==="user-agent")){let A=this.appInfo?.version||"0.0.0",U=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${U}/${A}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let A=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);d.Authorization=`Bearer ${A}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let A=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),U=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),B=Buffer.from(`${A}:${U}`).toString("base64");d.Authorization=`Basic ${B}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,d,l,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,d,r);let g=null;if(e.body&&e.body.type!=="none"){let A=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof A=="string")try{A=JSON.parse(A)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let U={type:e.body.type,format:e.body.format,content:A};g=this.preprocessor.encodeBody(U)}this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",S=e.url||"",_=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(S,i,r):this.envConfigService.resolveVariables(S,r),R=this.httpService.buildUrl(_,a,l),P={type:e.body?.type||"none",format:e.body?.format,content:g};return{url:R,method:y,headers:d,body:P,params:a,query:l}}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),a=e.tokenPrefix||"Bearer";r.Authorization=`${a} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let a=s&&Object.keys(s).length>0,l=a?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),f=a?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[l]=f:r[l]=f}}});var IW,Tf,z0=se(()=>{"use strict";IW=`
62
+ </html>`}}});var kf,W0=se(()=>{"use strict";bn();kf=class{constructor(e,r,n,i,s,a){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=a}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,r,n,i){if(this.secretRegistry?.hasProviders){let A=await this.secretRegistry.resolveSecretTokens(e);Object.keys(A).length>0&&(i={...A,...i??{}})}let s=i&&Object.keys(i).length>0,a=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),l=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),f=xu(n?.headers||{},e.headers||{}),d=s?this.envConfigService.resolveVariablesInObjectWithExtra(f,i,r):this.envConfigService.resolveVariablesInObject(f,r);if(d=this.preprocessor.sanitizeHeaders(d),!Object.keys(d).some(A=>A.toLowerCase()==="user-agent")){let A=this.appInfo?.version||"0.0.0",U=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${U}/${A}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let A=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);d.Authorization=`Bearer ${A}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let A=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),U=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),B=Buffer.from(`${A}:${U}`).toString("base64");d.Authorization=`Basic ${B}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,d,l,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,d,r);let g=null;if(e.body&&e.body.type!=="none"){let A=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof A=="string")try{A=JSON.parse(A)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let U={type:e.body.type,format:e.body.format,content:A};g=this.preprocessor.encodeBody(U)}this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",S=e.url||"",_=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(S,i,r):this.envConfigService.resolveVariables(S,r),R=this.httpService.buildUrl(_,a,l),P={type:e.body?.type||"none",format:e.body?.format,content:g};return{url:R,method:y,headers:d,body:P,params:a,query:l}}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),a=e.tokenPrefix||"Bearer";r.Authorization=`${a} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let a=s&&Object.keys(s).length>0,l=a?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),f=a?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[l]=f:r[l]=f}}});var PW,Tf,z0=se(()=>{"use strict";PW=`
63
63
  query IntrospectionQuery {
64
64
  __schema {
65
65
  queryType { name }
@@ -87,80 +87,80 @@ fragment TypeRef on __Type {
87
87
  kind name
88
88
  ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }
89
89
  }
90
- `.trim(),Tf=class{constructor(e){this.httpClient=e}httpClient;schemaCache=new Map;async fetchSchema(e,r){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...r||{}},body:JSON.stringify({query:IW,operationName:"IntrospectionQuery"})},i=await this.httpClient.send(n);if(i.status<200||i.status>=300)throw new Error(`Introspection query failed with status ${i.status}: ${i.statusText}`);let s=typeof i.body=="string"?JSON.parse(i.body):i.body;if(s.errors&&s.errors.length>0){let l=s.errors.map(f=>f.message).join("; ");throw new Error(`Introspection query returned errors: ${l}`)}if(!s.data?.__schema)throw new Error("Invalid introspection response: missing __schema");let a=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,a),a}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let r=[],n=e.split(`
91
- `),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&r.push({type:a[1],name:a[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(l=>this.parseField(l)),inputFields:(s.inputFields||[]).map(l=>this.parseArg(l)),enumValues:(s.enumValues||[]).map(l=>({name:l.name,description:l.description||void 0,isDeprecated:l.isDeprecated||!1,deprecationReason:l.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(l=>this.renderTypeRef(l)),possibleTypes:(s.possibleTypes||[]).map(l=>this.renderTypeRef(l))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}}});function ts(t){let e={};for(let[r,n]of Object.entries(t))J0.test(r)?e[r]=Array.isArray(n)?n.map(()=>ma):ma:e[r]=n;return e}function G0(t=[]){return t.map(e=>e&&typeof e=="object"&&e.name&&an.test(e.name)?{...e,value:ma}:e)}function nm(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)an.test(n)&&(e.searchParams.set(n,ma),r=!0);return r?e.toString():t}catch{return t}}function im(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>im(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t))an.test(r)?e[r]=ma:typeof n=="object"&&n!==null?e[r]=im(n):e[r]=n;return e}function PW(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)an.test(n)&&(e.set(n,ma),r=!0);return r?e.toString():t}catch{return t}}function Y0(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return im(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=im(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
92
- `))return PW(e)}return t}function K0(t){return{...t,sentRequest:{...t.sentRequest,url:nm(t.sentRequest.url),headers:ts(t.sentRequest.headers),body:t.sentRequest.body!=null?Y0(t.sentRequest.body):t.sentRequest.body}}}function Q0(t){return{...t,headers:ts(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&an.test(e.name)?{...e,value:ma}:e)}}function Z0(t){return{...t,url:nm(t.url),request:{...t.request,url:nm(t.request.url),headers:ts(t.request.headers),query:ts(t.request.query),params:ts(t.request.params),body:t.request.body!=null?Y0(t.request.body):t.request.body},response:{headers:ts(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?G0(t.response.cookies):t.response.cookies}}}function fr(t){return typeof t=="string"&&kW.test(t)}function TW(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)an.test(n)&&i&&!fr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)J0.test(n)&&i&&!fr(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)an.test(n)&&i&&!fr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!fr(r.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),r.basicAuth&&r.basicAuth.password&&!fr(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!fr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&tm(r,e)}return e}function tm(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{tm(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
93
- `)){try{let n=new URLSearchParams(r);for(let[i,s]of n)an.test(i)&&s&&!fr(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(t)){t.forEach(r=>tm(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))an.test(r)&&n&&typeof n=="string"&&!fr(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&tm(n,e)}}function ha(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function AW(t){let e=[],r=new Set;function n(i){let s=i,a=2;for(;r.has(s);)s=`${i}_${a++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,a]of i.searchParams)an.test(s)&&a&&!fr(a)&&e.push({location:"url",field:s,value:a,variableName:n(ha(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,a]of i)J0.test(s)&&a&&!fr(a)&&e.push({location:"header",field:s,value:a,variableName:n(ha(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,a]of i)an.test(s)&&a&&!fr(a)&&e.push({location:"query",field:s,value:a,variableName:n(ha(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!fr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!fr(i.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",value:i.basicAuth.password,variableName:n("basic_auth_password")}),i.apikey||i.apiKey){let s=i.apikey||i.apiKey;s.value&&!fr(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&rm(i,e,r,"")}return e}function rm(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{rm(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
94
- `)){try{let s=new URLSearchParams(i);for(let[a,l]of s)if(an.test(a)&&l&&!fr(l)){let f=ha(a),d=2;for(;r.has(f);)f=`${ha(a)}_${d++}`;r.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>rm(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let a=n?`${n}.${i}`:i;if(an.test(i)&&s&&typeof s=="string"&&!fr(s)){let l=ha(i),f=2;for(;r.has(l);)l=`${ha(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:a,value:s,variableName:l})}else typeof s=="object"&&s!==null&&rm(s,e,r,a)}}}function qW(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${MW(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":$W(r,n.field,n.path,n.value,i);break}}return r}function $W(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,a=s?s.content:t.body;if(a){if(typeof a=="string"){let l=a.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);bP(f,e,r||e,n,i);let d=JSON.stringify(f,null,2);s?s.content=d:t.body=d}catch{}return}if(l.includes("=")&&!l.includes(`
95
- `)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let d=f.toString();s?s.content=d:t.body=d}return}return}typeof a=="object"&&a!==null&&bP(a,e,r||e,n,i)}}function bP(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let d=s[f],m=d.match(/^(.+)\[(\d+)\]$/);if(m?a=a?.[m[1]]?.[parseInt(m[2])]:a=a?.[d],a==null)return}let l=s[s.length-1];a&&a[l]===n&&(a[l]=i)}function MW(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ma,J0,an,kW,Af=se(()=>{"use strict";ma="***",J0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,an=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;kW=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as Ur from"path";var qf,X0=se(()=>{"use strict";bn();Af();qf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Ur.join(this.historyPath,It(e))}getCollectionHistoryPath(e,r){return Ur.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Ur.join(this.getCollectionHistoryPath(e,r),It(n))}getSharedEnvironmentHistoryPath(e){return Ur.join(this.sharedHistoryPath,It(e))}getSharedCollectionHistoryPath(e,r){return Ur.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Ur.join(this.getSharedCollectionHistoryPath(e,r),It(n))}getHistoryFilePath(e,r,n){return Ur.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Ur.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Ur.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Ur.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=K0({...s,method:i,id:Rb(),timestamp:Date.now()});return a.requests.unshift(l),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(S=>S.id===i);if(f===-1)return!1;let[d]=l.requests.splice(f,1);this.saveHistory(l);let m=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!m.requests.some(S=>S.id===i)){let S={...d,ticket:null,branch:a};m.requests.unshift(S),m.requests.length>100&&(m.requests=m.requests.slice(0,100)),this.saveSharedHistory(m)}let g=this.getResponseFilePath(e,r,n,i),y=this.getSharedResponseFilePath(e,r,n,i);if(ke.existsSync(g)){let S=Ur.dirname(y);ke.existsSync(S)||ke.mkdirSync(S,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(R){return console.error(`Failed to copy full response from ${g} to ${y}:`,R),!0}try{ke.unlinkSync(g)}catch(R){console.warn(`Failed to remove original full response after copy: ${g}`,R)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(d=>d.id===i?(f=!0,{...d,ticket:null,branch:a}):d),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),l=(s||"").trim();if(!a||!l||a===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let d=!1;return f.requests=f.requests.map(m=>!m.ticket&&m.branch===a?(d=!0,{...m,branch:l}):m),d?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync(Ur.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=Q0(s);ke.writeFileSync(l,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}}});var rc,ew=se(()=>{"use strict";rc=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let d=f.slice(0,s),m=new Map;for(let y of d){let S=this.historyService.loadFullResponse(i,e,r,y.id);if(S||(S=this.historyService.loadSharedFullResponse(i,e,r,y.id)),S){let _=S.status;m.has(_)||m.set(_,[]),m.get(_).push(S)}}let g={};for(let[y,S]of m){let _=this.buildResponseDefinition(S);g[String(y)]=_}return{responses:g}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(r.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let l of e)for(let[f,d]of Object.entries(l.headers)){let m=f.toLowerCase();r.has(m)||(n.set(m,(n.get(m)||0)+1),i.has(m)||i.set(m,Array.isArray(d)?d.join(", "):d))}let s=Math.ceil(e.length/2),a={};for(let[l,f]of n)if(f>=s){let d=i.get(l);a[l]={schema:this.inferHeaderSchema(d)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Je=F(rr=>{"use strict";var tw=Symbol.for("yaml.alias"),SP=Symbol.for("yaml.document"),sm=Symbol.for("yaml.map"),wP=Symbol.for("yaml.pair"),rw=Symbol.for("yaml.scalar"),om=Symbol.for("yaml.seq"),rs=Symbol.for("yaml.node.type"),NW=t=>!!t&&typeof t=="object"&&t[rs]===tw,DW=t=>!!t&&typeof t=="object"&&t[rs]===SP,FW=t=>!!t&&typeof t=="object"&&t[rs]===sm,LW=t=>!!t&&typeof t=="object"&&t[rs]===wP,_P=t=>!!t&&typeof t=="object"&&t[rs]===rw,jW=t=>!!t&&typeof t=="object"&&t[rs]===om;function RP(t){if(t&&typeof t=="object")switch(t[rs]){case sm:case om:return!0}return!1}function UW(t){if(t&&typeof t=="object")switch(t[rs]){case tw:case sm:case rw:case om:return!0}return!1}var HW=t=>(_P(t)||RP(t))&&!!t.anchor;rr.ALIAS=tw;rr.DOC=SP;rr.MAP=sm;rr.NODE_TYPE=rs;rr.PAIR=wP;rr.SCALAR=rw;rr.SEQ=om;rr.hasAnchor=HW;rr.isAlias=NW;rr.isCollection=RP;rr.isDocument=DW;rr.isMap=FW;rr.isNode=UW;rr.isPair=LW;rr.isScalar=_P;rr.isSeq=jW});var $f=F(nw=>{"use strict";var zt=Je(),Hr=Symbol("break visit"),xP=Symbol("skip children"),xi=Symbol("remove node");function am(t,e){let r=CP(e);zt.isDocument(t)?nc(null,t.contents,r,Object.freeze([t]))===xi&&(t.contents=null):nc(null,t,r,Object.freeze([]))}am.BREAK=Hr;am.SKIP=xP;am.REMOVE=xi;function nc(t,e,r,n){let i=EP(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return OP(t,n,i),nc(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=nc(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Hr)return Hr;a===xi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=nc("key",e.key,r,n);if(s===Hr)return Hr;s===xi&&(e.key=null);let a=nc("value",e.value,r,n);if(a===Hr)return Hr;a===xi&&(e.value=null)}}return i}async function lm(t,e){let r=CP(e);zt.isDocument(t)?await ic(null,t.contents,r,Object.freeze([t]))===xi&&(t.contents=null):await ic(null,t,r,Object.freeze([]))}lm.BREAK=Hr;lm.SKIP=xP;lm.REMOVE=xi;async function ic(t,e,r,n){let i=await EP(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return OP(t,n,i),ic(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await ic(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Hr)return Hr;a===xi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=await ic("key",e.key,r,n);if(s===Hr)return Hr;s===xi&&(e.key=null);let a=await ic("value",e.value,r,n);if(a===Hr)return Hr;a===xi&&(e.value=null)}}return i}function CP(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function EP(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(zt.isMap(e))return r.Map?.(t,e,n);if(zt.isSeq(e))return r.Seq?.(t,e,n);if(zt.isPair(e))return r.Pair?.(t,e,n);if(zt.isScalar(e))return r.Scalar?.(t,e,n);if(zt.isAlias(e))return r.Alias?.(t,e,n)}function OP(t,e,r){let n=e[e.length-1];if(zt.isCollection(n))n.items[t]=r;else if(zt.isPair(n))t==="key"?n.key=r:n.value=r;else if(zt.isDocument(n))n.contents=r;else{let i=zt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}nw.visit=am;nw.visitAsync=lm});var iw=F(PP=>{"use strict";var IP=Je(),BW=$f(),VW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},WW=t=>t.replace(/[!,[\]{}]/g,e=>VW[e]),Mf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return r(String(a)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+WW(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&IP.isNode(e.contents)){let s={};BW.visit(e.contents,(a,l)=>{IP.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
96
- `)}};Mf.defaultYaml={explicit:!1,version:"1.2"};Mf.defaultTags={"!!":"tag:yaml.org,2002:"};PP.Directives=Mf});var cm=F(Nf=>{"use strict";var kP=Je(),zW=$f();function JW(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function TP(t){let e=new Set;return zW.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function AP(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function GW(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=TP(t));let a=AP(e,i);return i.add(a),a},setAnchors:()=>{for(let s of r){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(kP.isScalar(a.node)||kP.isCollection(a.node)))a.node.anchor=a.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}Nf.anchorIsValid=JW;Nf.anchorNames=TP;Nf.createNodeAnchors=GW;Nf.findNewAnchor=AP});var sw=F(qP=>{"use strict";function Df(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let a=n[i],l=Df(t,n,String(i),a);l===void 0?delete n[i]:l!==a&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),a=Df(t,n,i,s);a===void 0?n.delete(i):a!==s&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let s=Df(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let a=Df(t,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return t.call(e,r,n)}qP.applyReviver=Df});var zs=F(MP=>{"use strict";var YW=Je();function $P(t,e,r){if(Array.isArray(t))return t.map((n,i)=>$P(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!YW.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}MP.toJS=$P});var um=F(DP=>{"use strict";var KW=sw(),NP=Je(),QW=zs(),ow=class{constructor(e){Object.defineProperty(this,NP.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!NP.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=QW.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:d}of a.anchors.values())i(d,f);return typeof s=="function"?KW.applyReviver(s,{"":l},"",l):l}};DP.NodeBase=ow});var Ff=F(FP=>{"use strict";var ZW=cm(),XW=$f(),sc=Je(),ez=um(),tz=zs(),aw=class extends ez.NodeBase{constructor(e){super(sc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],XW.visit(e,{Node:(s,a)=>{(sc.isAlias(a)||sc.hasAnchor(a))&&n.push(a)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,a=this.resolve(i,r);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(a);if(l||(tz.toJS(a,null,r),l=n.get(a)),l?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=fm(i,a,n)),l.count*l.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return l.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(ZW.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function fm(t,e,r){if(sc.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(sc.isCollection(e)){let n=0;for(let i of e.items){let s=fm(t,i,r);s>n&&(n=s)}return n}else if(sc.isPair(e)){let n=fm(t,e.key,r),i=fm(t,e.value,r);return Math.max(n,i)}return 1}FP.Alias=aw});var Ft=F(lw=>{"use strict";var rz=Je(),nz=um(),iz=zs(),sz=t=>!t||typeof t!="function"&&typeof t!="object",Js=class extends nz.NodeBase{constructor(e){super(rz.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:iz.toJS(this.value,e,r)}toString(){return String(this.value)}};Js.BLOCK_FOLDED="BLOCK_FOLDED";Js.BLOCK_LITERAL="BLOCK_LITERAL";Js.PLAIN="PLAIN";Js.QUOTE_DOUBLE="QUOTE_DOUBLE";Js.QUOTE_SINGLE="QUOTE_SINGLE";lw.Scalar=Js;lw.isScalarValue=sz});var Lf=F(jP=>{"use strict";var oz=Ff(),ga=Je(),LP=Ft(),az="tag:yaml.org,2002:";function lz(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function cz(t,e,r){if(ga.isDocument(t)&&(t=t.contents),ga.isNode(t))return t;if(ga.isPair(t)){let g=r.schema[ga.MAP].createNode?.(r.schema,null,r);return g.items.push(t),g}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:l}=r,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new oz.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=az+e.slice(2));let d=lz(t,e,a.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let g=new LP.Scalar(t);return f&&(f.node=g),g}d=t instanceof Map?a[ga.MAP]:Symbol.iterator in Object(t)?a[ga.SEQ]:a[ga.MAP]}s&&(s(d),delete r.onTagObj);let m=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new LP.Scalar(t);return e?m.tag=e:d.default||(m.tag=d.tag),f&&(f.node=m),m}jP.createNode=cz});var pm=F(dm=>{"use strict";var uz=Lf(),Ci=Je(),fz=um();function cw(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return uz.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var UP=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,uw=class extends fz.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ci.isNode(n)||Ci.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(UP(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Ci.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,cw(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ci.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&Ci.isScalar(s)?s.value:s:Ci.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ci.isPair(r))return!1;let n=r.value;return n==null||e&&Ci.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ci.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Ci.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,cw(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};dm.Collection=uw;dm.collectionFromPath=cw;dm.isEmptyPath=UP});var jf=F(hm=>{"use strict";var dz=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function fw(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var pz=(t,e,r)=>t.endsWith(`
90
+ `.trim(),Tf=class{constructor(e){this.httpClient=e}httpClient;schemaCache=new Map;async fetchSchema(e,r){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...r||{}},body:JSON.stringify({query:PW,operationName:"IntrospectionQuery"})},i=await this.httpClient.send(n);if(i.status<200||i.status>=300)throw new Error(`Introspection query failed with status ${i.status}: ${i.statusText}`);let s=typeof i.body=="string"?JSON.parse(i.body):i.body;if(s.errors&&s.errors.length>0){let l=s.errors.map(f=>f.message).join("; ");throw new Error(`Introspection query returned errors: ${l}`)}if(!s.data?.__schema)throw new Error("Invalid introspection response: missing __schema");let a=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,a),a}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let r=[],n=e.split(`
91
+ `),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&r.push({type:a[1],name:a[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(l=>this.parseField(l)),inputFields:(s.inputFields||[]).map(l=>this.parseArg(l)),enumValues:(s.enumValues||[]).map(l=>({name:l.name,description:l.description||void 0,isDeprecated:l.isDeprecated||!1,deprecationReason:l.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(l=>this.renderTypeRef(l)),possibleTypes:(s.possibleTypes||[]).map(l=>this.renderTypeRef(l))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}}});function ts(t){let e={};for(let[r,n]of Object.entries(t))J0.test(r)?e[r]=Array.isArray(n)?n.map(()=>zs):zs:e[r]=n;return e}function G0(t=[]){return t.map(e=>e&&typeof e=="object"&&e.name&&an.test(e.name)?{...e,value:zs}:e)}function sm(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)an.test(n)&&(e.searchParams.set(n,zs),r=!0);return r?e.toString():t}catch{return t}}function Af(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>Af(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t)){let i=an.test(r);n===null||typeof n!="object"?e[r]=i?zs:n:i&&Array.isArray(n)?e[r]=n.map(s=>s===null||typeof s!="object"?zs:Af(s)):e[r]=Af(n)}return e}function kW(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)an.test(n)&&(e.set(n,zs),r=!0);return r?e.toString():t}catch{return t}}function Y0(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return Af(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=Af(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
92
+ `))return kW(e)}return t}function K0(t){return{...t,sentRequest:{...t.sentRequest,url:sm(t.sentRequest.url),headers:ts(t.sentRequest.headers),body:t.sentRequest.body!=null?Y0(t.sentRequest.body):t.sentRequest.body}}}function Q0(t){return{...t,headers:ts(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&an.test(e.name)?{...e,value:zs}:e)}}function Z0(t){return{...t,url:sm(t.url),request:{...t.request,url:sm(t.request.url),headers:ts(t.request.headers),query:ts(t.request.query),params:ts(t.request.params),body:t.request.body!=null?Y0(t.request.body):t.request.body},response:{headers:ts(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?G0(t.response.cookies):t.response.cookies}}}function fr(t){return typeof t=="string"&&TW.test(t)}function AW(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)an.test(n)&&i&&!fr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)J0.test(n)&&i&&!fr(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)an.test(n)&&i&&!fr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!fr(r.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),r.basicAuth&&r.basicAuth.password&&!fr(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!fr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&nm(r,e)}return e}function nm(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{nm(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
93
+ `)){try{let n=new URLSearchParams(r);for(let[i,s]of n)an.test(i)&&s&&!fr(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(t)){t.forEach(r=>nm(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))an.test(r)&&n&&typeof n=="string"&&!fr(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&nm(n,e)}}function ma(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function qW(t){let e=[],r=new Set;function n(i){let s=i,a=2;for(;r.has(s);)s=`${i}_${a++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,a]of i.searchParams)an.test(s)&&a&&!fr(a)&&e.push({location:"url",field:s,value:a,variableName:n(ma(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,a]of i)J0.test(s)&&a&&!fr(a)&&e.push({location:"header",field:s,value:a,variableName:n(ma(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,a]of i)an.test(s)&&a&&!fr(a)&&e.push({location:"query",field:s,value:a,variableName:n(ma(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!fr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!fr(i.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",value:i.basicAuth.password,variableName:n("basic_auth_password")}),i.apikey||i.apiKey){let s=i.apikey||i.apiKey;s.value&&!fr(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&im(i,e,r,"")}return e}function im(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{im(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
94
+ `)){try{let s=new URLSearchParams(i);for(let[a,l]of s)if(an.test(a)&&l&&!fr(l)){let f=ma(a),d=2;for(;r.has(f);)f=`${ma(a)}_${d++}`;r.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>im(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let a=n?`${n}.${i}`:i;if(an.test(i)&&s&&typeof s=="string"&&!fr(s)){let l=ma(i),f=2;for(;r.has(l);)l=`${ma(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:a,value:s,variableName:l})}else typeof s=="object"&&s!==null&&im(s,e,r,a)}}}function $W(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${NW(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":MW(r,n.field,n.path,n.value,i);break}}return r}function MW(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,a=s?s.content:t.body;if(a){if(typeof a=="string"){let l=a.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);SP(f,e,r||e,n,i);let d=JSON.stringify(f,null,2);s?s.content=d:t.body=d}catch{}return}if(l.includes("=")&&!l.includes(`
95
+ `)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let d=f.toString();s?s.content=d:t.body=d}return}return}typeof a=="object"&&a!==null&&SP(a,e,r||e,n,i)}}function SP(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let d=s[f],m=d.match(/^(.+)\[(\d+)\]$/);if(m?a=a?.[m[1]]?.[parseInt(m[2])]:a=a?.[d],a==null)return}let l=s[s.length-1];a&&a[l]===n&&(a[l]=i)}function NW(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var zs,J0,an,TW,qf=se(()=>{"use strict";zs="***",J0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,an=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;TW=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as Ur from"path";var $f,X0=se(()=>{"use strict";bn();qf();$f=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Ur.join(this.historyPath,It(e))}getCollectionHistoryPath(e,r){return Ur.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Ur.join(this.getCollectionHistoryPath(e,r),It(n))}getSharedEnvironmentHistoryPath(e){return Ur.join(this.sharedHistoryPath,It(e))}getSharedCollectionHistoryPath(e,r){return Ur.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Ur.join(this.getSharedCollectionHistoryPath(e,r),It(n))}getHistoryFilePath(e,r,n){return Ur.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Ur.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Ur.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Ur.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=K0({...s,method:i,id:Rb(),timestamp:Date.now()});return a.requests.unshift(l),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(S=>S.id===i);if(f===-1)return!1;let[d]=l.requests.splice(f,1);this.saveHistory(l);let m=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!m.requests.some(S=>S.id===i)){let S={...d,ticket:null,branch:a};m.requests.unshift(S),m.requests.length>100&&(m.requests=m.requests.slice(0,100)),this.saveSharedHistory(m)}let g=this.getResponseFilePath(e,r,n,i),y=this.getSharedResponseFilePath(e,r,n,i);if(ke.existsSync(g)){let S=Ur.dirname(y);ke.existsSync(S)||ke.mkdirSync(S,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(R){return console.error(`Failed to copy full response from ${g} to ${y}:`,R),!0}try{ke.unlinkSync(g)}catch(R){console.warn(`Failed to remove original full response after copy: ${g}`,R)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(d=>d.id===i?(f=!0,{...d,ticket:null,branch:a}):d),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),l=(s||"").trim();if(!a||!l||a===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let d=!1;return f.requests=f.requests.map(m=>!m.ticket&&m.branch===a?(d=!0,{...m,branch:l}):m),d?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync(Ur.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=Q0(s);ke.writeFileSync(l,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}}});var rc,ew=se(()=>{"use strict";rc=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let d=f.slice(0,s),m=new Map;for(let y of d){let S=this.historyService.loadFullResponse(i,e,r,y.id);if(S||(S=this.historyService.loadSharedFullResponse(i,e,r,y.id)),S){let _=S.status;m.has(_)||m.set(_,[]),m.get(_).push(S)}}let g={};for(let[y,S]of m){let _=this.buildResponseDefinition(S);g[String(y)]=_}return{responses:g}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(r.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let l of e)for(let[f,d]of Object.entries(l.headers)){let m=f.toLowerCase();r.has(m)||(n.set(m,(n.get(m)||0)+1),i.has(m)||i.set(m,Array.isArray(d)?d.join(", "):d))}let s=Math.ceil(e.length/2),a={};for(let[l,f]of n)if(f>=s){let d=i.get(l);a[l]={schema:this.inferHeaderSchema(d)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Je=F(rr=>{"use strict";var tw=Symbol.for("yaml.alias"),wP=Symbol.for("yaml.document"),om=Symbol.for("yaml.map"),_P=Symbol.for("yaml.pair"),rw=Symbol.for("yaml.scalar"),am=Symbol.for("yaml.seq"),rs=Symbol.for("yaml.node.type"),DW=t=>!!t&&typeof t=="object"&&t[rs]===tw,FW=t=>!!t&&typeof t=="object"&&t[rs]===wP,LW=t=>!!t&&typeof t=="object"&&t[rs]===om,jW=t=>!!t&&typeof t=="object"&&t[rs]===_P,RP=t=>!!t&&typeof t=="object"&&t[rs]===rw,UW=t=>!!t&&typeof t=="object"&&t[rs]===am;function xP(t){if(t&&typeof t=="object")switch(t[rs]){case om:case am:return!0}return!1}function HW(t){if(t&&typeof t=="object")switch(t[rs]){case tw:case om:case rw:case am:return!0}return!1}var BW=t=>(RP(t)||xP(t))&&!!t.anchor;rr.ALIAS=tw;rr.DOC=wP;rr.MAP=om;rr.NODE_TYPE=rs;rr.PAIR=_P;rr.SCALAR=rw;rr.SEQ=am;rr.hasAnchor=BW;rr.isAlias=DW;rr.isCollection=xP;rr.isDocument=FW;rr.isMap=LW;rr.isNode=HW;rr.isPair=jW;rr.isScalar=RP;rr.isSeq=UW});var Mf=F(nw=>{"use strict";var zt=Je(),Hr=Symbol("break visit"),CP=Symbol("skip children"),xi=Symbol("remove node");function lm(t,e){let r=EP(e);zt.isDocument(t)?nc(null,t.contents,r,Object.freeze([t]))===xi&&(t.contents=null):nc(null,t,r,Object.freeze([]))}lm.BREAK=Hr;lm.SKIP=CP;lm.REMOVE=xi;function nc(t,e,r,n){let i=OP(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return IP(t,n,i),nc(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=nc(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Hr)return Hr;a===xi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=nc("key",e.key,r,n);if(s===Hr)return Hr;s===xi&&(e.key=null);let a=nc("value",e.value,r,n);if(a===Hr)return Hr;a===xi&&(e.value=null)}}return i}async function cm(t,e){let r=EP(e);zt.isDocument(t)?await ic(null,t.contents,r,Object.freeze([t]))===xi&&(t.contents=null):await ic(null,t,r,Object.freeze([]))}cm.BREAK=Hr;cm.SKIP=CP;cm.REMOVE=xi;async function ic(t,e,r,n){let i=await OP(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return IP(t,n,i),ic(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await ic(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Hr)return Hr;a===xi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=await ic("key",e.key,r,n);if(s===Hr)return Hr;s===xi&&(e.key=null);let a=await ic("value",e.value,r,n);if(a===Hr)return Hr;a===xi&&(e.value=null)}}return i}function EP(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function OP(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(zt.isMap(e))return r.Map?.(t,e,n);if(zt.isSeq(e))return r.Seq?.(t,e,n);if(zt.isPair(e))return r.Pair?.(t,e,n);if(zt.isScalar(e))return r.Scalar?.(t,e,n);if(zt.isAlias(e))return r.Alias?.(t,e,n)}function IP(t,e,r){let n=e[e.length-1];if(zt.isCollection(n))n.items[t]=r;else if(zt.isPair(n))t==="key"?n.key=r:n.value=r;else if(zt.isDocument(n))n.contents=r;else{let i=zt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}nw.visit=lm;nw.visitAsync=cm});var iw=F(kP=>{"use strict";var PP=Je(),VW=Mf(),WW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},zW=t=>t.replace(/[!,[\]{}]/g,e=>WW[e]),Nf=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return r(String(a)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+zW(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&PP.isNode(e.contents)){let s={};VW.visit(e.contents,(a,l)=>{PP.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
96
+ `)}};Nf.defaultYaml={explicit:!1,version:"1.2"};Nf.defaultTags={"!!":"tag:yaml.org,2002:"};kP.Directives=Nf});var um=F(Df=>{"use strict";var TP=Je(),JW=Mf();function GW(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function AP(t){let e=new Set;return JW.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function qP(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function YW(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=AP(t));let a=qP(e,i);return i.add(a),a},setAnchors:()=>{for(let s of r){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(TP.isScalar(a.node)||TP.isCollection(a.node)))a.node.anchor=a.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}Df.anchorIsValid=GW;Df.anchorNames=AP;Df.createNodeAnchors=YW;Df.findNewAnchor=qP});var sw=F($P=>{"use strict";function Ff(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let a=n[i],l=Ff(t,n,String(i),a);l===void 0?delete n[i]:l!==a&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),a=Ff(t,n,i,s);a===void 0?n.delete(i):a!==s&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let s=Ff(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let a=Ff(t,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return t.call(e,r,n)}$P.applyReviver=Ff});var Js=F(NP=>{"use strict";var KW=Je();function MP(t,e,r){if(Array.isArray(t))return t.map((n,i)=>MP(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!KW.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}NP.toJS=MP});var fm=F(FP=>{"use strict";var QW=sw(),DP=Je(),ZW=Js(),ow=class{constructor(e){Object.defineProperty(this,DP.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!DP.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=ZW.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:d}of a.anchors.values())i(d,f);return typeof s=="function"?QW.applyReviver(s,{"":l},"",l):l}};FP.NodeBase=ow});var Lf=F(LP=>{"use strict";var XW=um(),ez=Mf(),sc=Je(),tz=fm(),rz=Js(),aw=class extends tz.NodeBase{constructor(e){super(sc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],ez.visit(e,{Node:(s,a)=>{(sc.isAlias(a)||sc.hasAnchor(a))&&n.push(a)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,a=this.resolve(i,r);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(a);if(l||(rz.toJS(a,null,r),l=n.get(a)),l?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=dm(i,a,n)),l.count*l.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return l.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(XW.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function dm(t,e,r){if(sc.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(sc.isCollection(e)){let n=0;for(let i of e.items){let s=dm(t,i,r);s>n&&(n=s)}return n}else if(sc.isPair(e)){let n=dm(t,e.key,r),i=dm(t,e.value,r);return Math.max(n,i)}return 1}LP.Alias=aw});var Ft=F(lw=>{"use strict";var nz=Je(),iz=fm(),sz=Js(),oz=t=>!t||typeof t!="function"&&typeof t!="object",Gs=class extends iz.NodeBase{constructor(e){super(nz.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:sz.toJS(this.value,e,r)}toString(){return String(this.value)}};Gs.BLOCK_FOLDED="BLOCK_FOLDED";Gs.BLOCK_LITERAL="BLOCK_LITERAL";Gs.PLAIN="PLAIN";Gs.QUOTE_DOUBLE="QUOTE_DOUBLE";Gs.QUOTE_SINGLE="QUOTE_SINGLE";lw.Scalar=Gs;lw.isScalarValue=oz});var jf=F(UP=>{"use strict";var az=Lf(),ga=Je(),jP=Ft(),lz="tag:yaml.org,2002:";function cz(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function uz(t,e,r){if(ga.isDocument(t)&&(t=t.contents),ga.isNode(t))return t;if(ga.isPair(t)){let g=r.schema[ga.MAP].createNode?.(r.schema,null,r);return g.items.push(t),g}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:l}=r,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new az.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=lz+e.slice(2));let d=cz(t,e,a.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let g=new jP.Scalar(t);return f&&(f.node=g),g}d=t instanceof Map?a[ga.MAP]:Symbol.iterator in Object(t)?a[ga.SEQ]:a[ga.MAP]}s&&(s(d),delete r.onTagObj);let m=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new jP.Scalar(t);return e?m.tag=e:d.default||(m.tag=d.tag),f&&(f.node=m),m}UP.createNode=uz});var hm=F(pm=>{"use strict";var fz=jf(),Ci=Je(),dz=fm();function cw(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return fz.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var HP=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,uw=class extends dz.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Ci.isNode(n)||Ci.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(HP(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Ci.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,cw(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Ci.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&Ci.isScalar(s)?s.value:s:Ci.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ci.isPair(r))return!1;let n=r.value;return n==null||e&&Ci.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Ci.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Ci.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,cw(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};pm.Collection=uw;pm.collectionFromPath=cw;pm.isEmptyPath=HP});var Uf=F(mm=>{"use strict";var pz=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function fw(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var hz=(t,e,r)=>t.endsWith(`
97
97
  `)?fw(r,e):r.includes(`
98
98
  `)?`
99
- `+fw(r,e):(t.endsWith(" ")?"":" ")+r;hm.indentComment=fw;hm.lineComment=pz;hm.stringifyComment=dz});var BP=F(Uf=>{"use strict";var hz="flow",dw="block",mm="quoted";function mz(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!i||i<0)return t;i<s&&(s=0);let f=Math.max(1+s,1+i-e.length);if(t.length<=f)return t;let d=[],m={},g=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):g=i-n);let y,S,_=!1,R=-1,P=-1,A=-1;r===dw&&(R=HP(t,R,e.length),R!==-1&&(g=R+f));for(let B;B=t[R+=1];){if(r===mm&&B==="\\"){switch(P=R,t[R+1]){case"x":R+=3;break;case"u":R+=5;break;case"U":R+=9;break;default:R+=1}A=R}if(B===`
100
- `)r===dw&&(R=HP(t,R,e.length)),g=R+e.length+f,y=void 0;else{if(B===" "&&S&&S!==" "&&S!==`
99
+ `+fw(r,e):(t.endsWith(" ")?"":" ")+r;mm.indentComment=fw;mm.lineComment=hz;mm.stringifyComment=pz});var VP=F(Hf=>{"use strict";var mz="flow",dw="block",gm="quoted";function gz(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!i||i<0)return t;i<s&&(s=0);let f=Math.max(1+s,1+i-e.length);if(t.length<=f)return t;let d=[],m={},g=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):g=i-n);let y,S,_=!1,R=-1,P=-1,A=-1;r===dw&&(R=BP(t,R,e.length),R!==-1&&(g=R+f));for(let B;B=t[R+=1];){if(r===gm&&B==="\\"){switch(P=R,t[R+1]){case"x":R+=3;break;case"u":R+=5;break;case"U":R+=9;break;default:R+=1}A=R}if(B===`
100
+ `)r===dw&&(R=BP(t,R,e.length)),g=R+e.length+f,y=void 0;else{if(B===" "&&S&&S!==" "&&S!==`
101
101
  `&&S!==" "){let V=t[R+1];V&&V!==" "&&V!==`
102
- `&&V!==" "&&(y=R)}if(R>=g)if(y)d.push(y),g=y+f,y=void 0;else if(r===mm){for(;S===" "||S===" ";)S=B,B=t[R+=1],_=!0;let V=R>A+1?R-2:P-1;if(m[V])return t;d.push(V),m[V]=!0,g=V+f,y=void 0}else _=!0}S=B}if(_&&l&&l(),d.length===0)return t;a&&a();let U=t.slice(0,d[0]);for(let B=0;B<d.length;++B){let V=d[B],W=d[B+1]||t.length;V===0?U=`
103
- ${e}${t.slice(0,W)}`:(r===mm&&m[V]&&(U+=`${t[V]}\\`),U+=`
104
- ${e}${t.slice(V+1,W)}`)}return U}function HP(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
105
- `);n=e,i=e+1,s=t[i]}return n}Uf.FOLD_BLOCK=dw;Uf.FOLD_FLOW=hz;Uf.FOLD_QUOTED=mm;Uf.foldFlowLines=mz});var Bf=F(VP=>{"use strict";var Zn=Ft(),Gs=BP(),ym=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),vm=t=>/^(%|---|\.\.\.)/m.test(t);function gz(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,a=0;s<i;++s)if(t[s]===`
106
- `){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function Hf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(vm(t)?" ":""),a="",l=0;for(let f=0,d=r[f];d;d=r[++f])if(d===" "&&r[f+1]==="\\"&&r[f+2]==="n"&&(a+=r.slice(l,f)+"\\ ",f+=1,l=f,d="\\"),d==="\\")switch(r[f+1]){case"u":{a+=r.slice(l,f);let m=r.substr(f+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=r.substr(f,6)}f+=5,l=f+1}break;case"n":if(n||r[f+2]==='"'||r.length<i)f+=1;else{for(a+=r.slice(l,f)+`
102
+ `&&V!==" "&&(y=R)}if(R>=g)if(y)d.push(y),g=y+f,y=void 0;else if(r===gm){for(;S===" "||S===" ";)S=B,B=t[R+=1],_=!0;let V=R>A+1?R-2:P-1;if(m[V])return t;d.push(V),m[V]=!0,g=V+f,y=void 0}else _=!0}S=B}if(_&&l&&l(),d.length===0)return t;a&&a();let U=t.slice(0,d[0]);for(let B=0;B<d.length;++B){let V=d[B],W=d[B+1]||t.length;V===0?U=`
103
+ ${e}${t.slice(0,W)}`:(r===gm&&m[V]&&(U+=`${t[V]}\\`),U+=`
104
+ ${e}${t.slice(V+1,W)}`)}return U}function BP(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
105
+ `);n=e,i=e+1,s=t[i]}return n}Hf.FOLD_BLOCK=dw;Hf.FOLD_FLOW=mz;Hf.FOLD_QUOTED=gm;Hf.foldFlowLines=gz});var Vf=F(WP=>{"use strict";var Zn=Ft(),Ys=VP(),vm=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),bm=t=>/^(%|---|\.\.\.)/m.test(t);function yz(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,a=0;s<i;++s)if(t[s]===`
106
+ `){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function Bf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(bm(t)?" ":""),a="",l=0;for(let f=0,d=r[f];d;d=r[++f])if(d===" "&&r[f+1]==="\\"&&r[f+2]==="n"&&(a+=r.slice(l,f)+"\\ ",f+=1,l=f,d="\\"),d==="\\")switch(r[f+1]){case"u":{a+=r.slice(l,f);let m=r.substr(f+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=r.substr(f,6)}f+=5,l=f+1}break;case"n":if(n||r[f+2]==='"'||r.length<i)f+=1;else{for(a+=r.slice(l,f)+`
107
107
 
108
108
  `;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)a+=`
109
- `,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,l=f+1}break;default:f+=1}return a=l?a+r.slice(l):r,n?a:Gs.foldFlowLines(a,s,Gs.FOLD_QUOTED,ym(e,!1))}function pw(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
110
- `)||/[ \t]\n|\n[ \t]/.test(t))return Hf(t,e);let r=e.indent||(vm(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
111
- ${r}`)+"'";return e.implicitKey?n:Gs.foldFlowLines(n,r,Gs.FOLD_FLOW,ym(e,!1))}function oc(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=Hf;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=pw:s&&!i?n=Hf:n=r?pw:Hf}return n(t,e)}var hw;try{hw=new RegExp(`(^|(?<!
109
+ `,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,l=f+1}break;default:f+=1}return a=l?a+r.slice(l):r,n?a:Ys.foldFlowLines(a,s,Ys.FOLD_QUOTED,vm(e,!1))}function pw(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
110
+ `)||/[ \t]\n|\n[ \t]/.test(t))return Bf(t,e);let r=e.indent||(bm(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
111
+ ${r}`)+"'";return e.implicitKey?n:Ys.foldFlowLines(n,r,Ys.FOLD_FLOW,vm(e,!1))}function oc(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=Bf;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=pw:s&&!i?n=Bf:n=r?pw:Bf}return n(t,e)}var hw;try{hw=new RegExp(`(^|(?<!
112
112
  ))
113
113
  +(?!
114
- |$)`,"g")}catch{hw=/\n+(?!\n|$)/g}function gm({comment:t,type:e,value:r},n,i,s){let{blockQuote:a,commentString:l,lineWidth:f}=n.options;if(!a||/\n[\t ]+$/.test(r))return oc(r,n);let d=n.indent||(n.forceBlockIndent||vm(r)?" ":""),m=a==="literal"?!0:a==="folded"||e===Zn.Scalar.BLOCK_FOLDED?!1:e===Zn.Scalar.BLOCK_LITERAL?!0:!gz(r,f,d.length);if(!r)return m?`|
114
+ |$)`,"g")}catch{hw=/\n+(?!\n|$)/g}function ym({comment:t,type:e,value:r},n,i,s){let{blockQuote:a,commentString:l,lineWidth:f}=n.options;if(!a||/\n[\t ]+$/.test(r))return oc(r,n);let d=n.indent||(n.forceBlockIndent||bm(r)?" ":""),m=a==="literal"?!0:a==="folded"||e===Zn.Scalar.BLOCK_FOLDED?!1:e===Zn.Scalar.BLOCK_LITERAL?!0:!yz(r,f,d.length);if(!r)return m?`|
115
115
  `:`>
116
116
  `;let g,y;for(y=r.length;y>0;--y){let W=r[y-1];if(W!==`
117
117
  `&&W!==" "&&W!==" ")break}let S=r.substring(y),_=S.indexOf(`
118
118
  `);_===-1?g="-":r===S||_!==S.length-1?(g="+",s&&s()):g="",S&&(r=r.slice(0,-S.length),S[S.length-1]===`
119
119
  `&&(S=S.slice(0,-1)),S=S.replace(hw,`$&${d}`));let R=!1,P,A=-1;for(P=0;P<r.length;++P){let W=r[P];if(W===" ")R=!0;else if(W===`
120
120
  `)A=P;else break}let U=r.substring(0,A<P?A+1:P);U&&(r=r.substring(U.length),U=U.replace(/\n+/g,`$&${d}`));let V=(R?d?"2":"1":"")+g;if(t&&(V+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){let W=r.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,T=ym(n,!0);a!=="folded"&&e!==Zn.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{X=!0});let x=Gs.foldFlowLines(`${U}${W}${S}`,d,Gs.FOLD_BLOCK,T);if(!X)return`>${V}
121
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,T=vm(n,!0);a!=="folded"&&e!==Zn.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{X=!0});let x=Ys.foldFlowLines(`${U}${W}${S}`,d,Ys.FOLD_BLOCK,T);if(!X)return`>${V}
122
122
  ${d}${x}`}return r=r.replace(/\n+/g,`$&${d}`),`|${V}
123
- ${d}${U}${r}${S}`}function yz(t,e,r,n){let{type:i,value:s}=t,{actualString:a,implicitKey:l,indent:f,indentStep:d,inFlow:m}=e;if(l&&s.includes(`
123
+ ${d}${U}${r}${S}`}function vz(t,e,r,n){let{type:i,value:s}=t,{actualString:a,implicitKey:l,indent:f,indentStep:d,inFlow:m}=e;if(l&&s.includes(`
124
124
  `)||m&&/[[\]{},]/.test(s))return oc(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||m||!s.includes(`
125
- `)?oc(s,e):gm(t,e,r,n);if(!l&&!m&&i!==Zn.Scalar.PLAIN&&s.includes(`
126
- `))return gm(t,e,r,n);if(vm(s)){if(f==="")return e.forceBlockIndent=!0,gm(t,e,r,n);if(l&&f===d)return oc(s,e)}let g=s.replace(/\n+/g,`$&
127
- ${f}`);if(a){let y=R=>R.default&&R.tag!=="tag:yaml.org,2002:str"&&R.test?.test(g),{compat:S,tags:_}=e.doc.schema;if(_.some(y)||S?.some(y))return oc(s,e)}return l?g:Gs.foldFlowLines(g,f,Gs.FOLD_FLOW,ym(e,!1))}function vz(t,e,r,n){let{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==Zn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Zn.Scalar.QUOTE_DOUBLE);let f=m=>{switch(m){case Zn.Scalar.BLOCK_FOLDED:case Zn.Scalar.BLOCK_LITERAL:return i||s?oc(a.value,e):gm(a,e,r,n);case Zn.Scalar.QUOTE_DOUBLE:return Hf(a.value,e);case Zn.Scalar.QUOTE_SINGLE:return pw(a.value,e);case Zn.Scalar.PLAIN:return yz(a,e,r,n);default:return null}},d=f(l);if(d===null){let{defaultKeyType:m,defaultStringType:g}=e.options,y=i&&m||g;if(d=f(y),d===null)throw new Error(`Unsupported default string type ${y}`)}return d}VP.stringifyString=vz});var Vf=F(mw=>{"use strict";var bz=cm(),Ys=Je(),Sz=jf(),wz=Bf();function _z(t,e){let r=Object.assign({blockQuote:!0,commentString:Sz.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Rz(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(Ys.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function xz(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(Ys.isScalar(t)||Ys.isCollection(t))&&t.anchor;s&&bz.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let a=t.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function Cz(t,e,r,n){if(Ys.isPair(t))return t.toString(e,r,n);if(Ys.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=Ys.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=Rz(e.doc.schema.tags,s));let a=xz(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let l=typeof i.stringify=="function"?i.stringify(s,e,r,n):Ys.isScalar(s)?wz.stringifyString(s,e,r,n):s.toString(e,r,n);return a?Ys.isScalar(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
128
- ${e.indent}${l}`:l}mw.createStringifyContext=_z;mw.stringify=Cz});var GP=F(JP=>{"use strict";var ns=Je(),WP=Ft(),zP=Vf(),Wf=jf();function Ez({key:t,value:e},r,n,i){let{allNullValues:s,doc:a,indent:l,indentStep:f,options:{commentString:d,indentSeq:m,simpleKeys:g}}=r,y=ns.isNode(t)&&t.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(ns.isCollection(t)||!ns.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let S=!g&&(!t||y&&e==null&&!r.inFlow||ns.isCollection(t)||(ns.isScalar(t)?t.type===WP.Scalar.BLOCK_FOLDED||t.type===WP.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!S&&(g||!s),indent:l+f});let _=!1,R=!1,P=zP.stringify(t,r,()=>_=!0,()=>R=!0);if(!S&&!r.inFlow&&P.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(r.inFlow){if(s||e==null)return _&&n&&n(),P===""?"?":S?`? ${P}`:P}else if(s&&!g||e==null&&S)return P=`? ${P}`,y&&!_?P+=Wf.lineComment(P,r.indent,d(y)):R&&i&&i(),P;_&&(y=null),S?(y&&(P+=Wf.lineComment(P,r.indent,d(y))),P=`? ${P}
129
- ${l}:`):(P=`${P}:`,y&&(P+=Wf.lineComment(P,r.indent,d(y))));let A,U,B;ns.isNode(e)?(A=!!e.spaceBefore,U=e.commentBefore,B=e.comment):(A=!1,U=null,B=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!S&&!y&&ns.isScalar(e)&&(r.indentAtStart=P.length+1),R=!1,!m&&f.length>=2&&!r.inFlow&&!S&&ns.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let V=!1,W=zP.stringify(e,r,()=>V=!0,()=>R=!0),X=" ";if(y||A||U){if(X=A?`
125
+ `)?oc(s,e):ym(t,e,r,n);if(!l&&!m&&i!==Zn.Scalar.PLAIN&&s.includes(`
126
+ `))return ym(t,e,r,n);if(bm(s)){if(f==="")return e.forceBlockIndent=!0,ym(t,e,r,n);if(l&&f===d)return oc(s,e)}let g=s.replace(/\n+/g,`$&
127
+ ${f}`);if(a){let y=R=>R.default&&R.tag!=="tag:yaml.org,2002:str"&&R.test?.test(g),{compat:S,tags:_}=e.doc.schema;if(_.some(y)||S?.some(y))return oc(s,e)}return l?g:Ys.foldFlowLines(g,f,Ys.FOLD_FLOW,vm(e,!1))}function bz(t,e,r,n){let{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==Zn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Zn.Scalar.QUOTE_DOUBLE);let f=m=>{switch(m){case Zn.Scalar.BLOCK_FOLDED:case Zn.Scalar.BLOCK_LITERAL:return i||s?oc(a.value,e):ym(a,e,r,n);case Zn.Scalar.QUOTE_DOUBLE:return Bf(a.value,e);case Zn.Scalar.QUOTE_SINGLE:return pw(a.value,e);case Zn.Scalar.PLAIN:return vz(a,e,r,n);default:return null}},d=f(l);if(d===null){let{defaultKeyType:m,defaultStringType:g}=e.options,y=i&&m||g;if(d=f(y),d===null)throw new Error(`Unsupported default string type ${y}`)}return d}WP.stringifyString=bz});var Wf=F(mw=>{"use strict";var Sz=um(),Ks=Je(),wz=Uf(),_z=Vf();function Rz(t,e){let r=Object.assign({blockQuote:!0,commentString:wz.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function xz(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(Ks.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Cz(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(Ks.isScalar(t)||Ks.isCollection(t))&&t.anchor;s&&Sz.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let a=t.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function Ez(t,e,r,n){if(Ks.isPair(t))return t.toString(e,r,n);if(Ks.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=Ks.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=xz(e.doc.schema.tags,s));let a=Cz(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let l=typeof i.stringify=="function"?i.stringify(s,e,r,n):Ks.isScalar(s)?_z.stringifyString(s,e,r,n):s.toString(e,r,n);return a?Ks.isScalar(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
128
+ ${e.indent}${l}`:l}mw.createStringifyContext=Rz;mw.stringify=Ez});var YP=F(GP=>{"use strict";var ns=Je(),zP=Ft(),JP=Wf(),zf=Uf();function Oz({key:t,value:e},r,n,i){let{allNullValues:s,doc:a,indent:l,indentStep:f,options:{commentString:d,indentSeq:m,simpleKeys:g}}=r,y=ns.isNode(t)&&t.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(ns.isCollection(t)||!ns.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let S=!g&&(!t||y&&e==null&&!r.inFlow||ns.isCollection(t)||(ns.isScalar(t)?t.type===zP.Scalar.BLOCK_FOLDED||t.type===zP.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!S&&(g||!s),indent:l+f});let _=!1,R=!1,P=JP.stringify(t,r,()=>_=!0,()=>R=!0);if(!S&&!r.inFlow&&P.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(r.inFlow){if(s||e==null)return _&&n&&n(),P===""?"?":S?`? ${P}`:P}else if(s&&!g||e==null&&S)return P=`? ${P}`,y&&!_?P+=zf.lineComment(P,r.indent,d(y)):R&&i&&i(),P;_&&(y=null),S?(y&&(P+=zf.lineComment(P,r.indent,d(y))),P=`? ${P}
129
+ ${l}:`):(P=`${P}:`,y&&(P+=zf.lineComment(P,r.indent,d(y))));let A,U,B;ns.isNode(e)?(A=!!e.spaceBefore,U=e.commentBefore,B=e.comment):(A=!1,U=null,B=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!S&&!y&&ns.isScalar(e)&&(r.indentAtStart=P.length+1),R=!1,!m&&f.length>=2&&!r.inFlow&&!S&&ns.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let V=!1,W=JP.stringify(e,r,()=>V=!0,()=>R=!0),X=" ";if(y||A||U){if(X=A?`
130
130
  `:"",U){let T=d(U);X+=`
131
- ${Wf.indentComment(T,r.indent)}`}W===""&&!r.inFlow?X===`
131
+ ${zf.indentComment(T,r.indent)}`}W===""&&!r.inFlow?X===`
132
132
  `&&B&&(X=`
133
133
 
134
134
  `):X+=`
135
135
  ${r.indent}`}else if(!S&&ns.isCollection(e)){let T=W[0],x=W.indexOf(`
136
136
  `),k=x!==-1,N=r.inFlow??e.flow??e.items.length===0;if(k||!N){let j=!1;if(k&&(T==="&"||T==="!")){let $=W.indexOf(" ");T==="&"&&$!==-1&&$<x&&W[$+1]==="!"&&($=W.indexOf(" ",$+1)),($===-1||x<$)&&(j=!0)}j||(X=`
137
137
  ${r.indent}`)}}else(W===""||W[0]===`
138
- `)&&(X="");return P+=X+W,r.inFlow?V&&n&&n():B&&!V?P+=Wf.lineComment(P,r.indent,d(B)):R&&i&&i(),P}JP.stringifyPair=Ez});var yw=F(gw=>{"use strict";var YP=it("process");function Oz(t,...e){t==="debug"&&console.log(...e)}function Iz(t,e){(t==="debug"||t==="warn")&&(typeof YP.emitWarning=="function"?YP.emitWarning(e):console.warn(e))}gw.debug=Oz;gw.warn=Iz});var Rm=F(_m=>{"use strict";var wm=Je(),KP=Ft(),bm="<<",Sm={identify:t=>t===bm||typeof t=="symbol"&&t.description===bm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new KP.Scalar(Symbol(bm)),{addToJSMap:QP}),stringify:()=>bm},Pz=(t,e)=>(Sm.identify(e)||wm.isScalar(e)&&(!e.type||e.type===KP.Scalar.PLAIN)&&Sm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Sm.tag&&r.default);function QP(t,e,r){let n=ZP(t,r);if(wm.isSeq(n))for(let i of n.items)vw(t,e,i);else if(Array.isArray(n))for(let i of n)vw(t,e,i);else vw(t,e,n)}function vw(t,e,r){let n=ZP(t,r);if(!wm.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function ZP(t,e){return t&&wm.isAlias(e)?e.resolve(t.doc,t):e}_m.addMergeToJSMap=QP;_m.isMergeKey=Pz;_m.merge=Sm});var Sw=F(tk=>{"use strict";var kz=yw(),XP=Rm(),Tz=Vf(),ek=Je(),bw=zs();function Az(t,e,{key:r,value:n}){if(ek.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(XP.isMergeKey(t,r))XP.addMergeToJSMap(t,e,n);else{let i=bw.toJS(r,"",t);if(e instanceof Map)e.set(i,bw.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=qz(r,i,t),a=bw.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function qz(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(ek.isNode(t)&&r?.doc){let n=Tz.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),kz.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}tk.addPairToJSMap=Az});var Ks=F(ww=>{"use strict";var rk=Lf(),$z=GP(),Mz=Sw(),xm=Je();function Nz(t,e,r){let n=rk.createNode(t,void 0,r),i=rk.createNode(e,void 0,r);return new Cm(n,i)}var Cm=class t{constructor(e,r=null){Object.defineProperty(this,xm.NODE_TYPE,{value:xm.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return xm.isNode(r)&&(r=r.clone(e)),xm.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Mz.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?$z.stringifyPair(this,e,r,n):JSON.stringify(this)}};ww.Pair=Cm;ww.createPair=Nz});var _w=F(ik=>{"use strict";var ya=Je(),nk=Vf(),Em=jf();function Dz(t,e,r){return(e.inFlow??t.flow?Lz:Fz)(t,e,r)}function Fz({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:l}){let{indent:f,options:{commentString:d}}=r,m=Object.assign({},r,{indent:s,type:null}),g=!1,y=[];for(let _=0;_<e.length;++_){let R=e[_],P=null;if(ya.isNode(R))!g&&R.spaceBefore&&y.push(""),Om(r,y,R.commentBefore,g),R.comment&&(P=R.comment);else if(ya.isPair(R)){let U=ya.isNode(R.key)?R.key:null;U&&(!g&&U.spaceBefore&&y.push(""),Om(r,y,U.commentBefore,g))}g=!1;let A=nk.stringify(R,m,()=>P=null,()=>g=!0);P&&(A+=Em.lineComment(A,s,d(P))),g&&P&&(g=!1),y.push(n+A)}let S;if(y.length===0)S=i.start+i.end;else{S=y[0];for(let _=1;_<y.length;++_){let R=y[_];S+=R?`
138
+ `)&&(X="");return P+=X+W,r.inFlow?V&&n&&n():B&&!V?P+=zf.lineComment(P,r.indent,d(B)):R&&i&&i(),P}GP.stringifyPair=Oz});var yw=F(gw=>{"use strict";var KP=it("process");function Iz(t,...e){t==="debug"&&console.log(...e)}function Pz(t,e){(t==="debug"||t==="warn")&&(typeof KP.emitWarning=="function"?KP.emitWarning(e):console.warn(e))}gw.debug=Iz;gw.warn=Pz});var xm=F(Rm=>{"use strict";var _m=Je(),QP=Ft(),Sm="<<",wm={identify:t=>t===Sm||typeof t=="symbol"&&t.description===Sm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new QP.Scalar(Symbol(Sm)),{addToJSMap:ZP}),stringify:()=>Sm},kz=(t,e)=>(wm.identify(e)||_m.isScalar(e)&&(!e.type||e.type===QP.Scalar.PLAIN)&&wm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===wm.tag&&r.default);function ZP(t,e,r){let n=XP(t,r);if(_m.isSeq(n))for(let i of n.items)vw(t,e,i);else if(Array.isArray(n))for(let i of n)vw(t,e,i);else vw(t,e,n)}function vw(t,e,r){let n=XP(t,r);if(!_m.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function XP(t,e){return t&&_m.isAlias(e)?e.resolve(t.doc,t):e}Rm.addMergeToJSMap=ZP;Rm.isMergeKey=kz;Rm.merge=wm});var Sw=F(rk=>{"use strict";var Tz=yw(),ek=xm(),Az=Wf(),tk=Je(),bw=Js();function qz(t,e,{key:r,value:n}){if(tk.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(ek.isMergeKey(t,r))ek.addMergeToJSMap(t,e,n);else{let i=bw.toJS(r,"",t);if(e instanceof Map)e.set(i,bw.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=$z(r,i,t),a=bw.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function $z(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(tk.isNode(t)&&r?.doc){let n=Az.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),Tz.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}rk.addPairToJSMap=qz});var Qs=F(ww=>{"use strict";var nk=jf(),Mz=YP(),Nz=Sw(),Cm=Je();function Dz(t,e,r){let n=nk.createNode(t,void 0,r),i=nk.createNode(e,void 0,r);return new Em(n,i)}var Em=class t{constructor(e,r=null){Object.defineProperty(this,Cm.NODE_TYPE,{value:Cm.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Cm.isNode(r)&&(r=r.clone(e)),Cm.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Nz.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Mz.stringifyPair(this,e,r,n):JSON.stringify(this)}};ww.Pair=Em;ww.createPair=Dz});var _w=F(sk=>{"use strict";var ya=Je(),ik=Wf(),Om=Uf();function Fz(t,e,r){return(e.inFlow??t.flow?jz:Lz)(t,e,r)}function Lz({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:l}){let{indent:f,options:{commentString:d}}=r,m=Object.assign({},r,{indent:s,type:null}),g=!1,y=[];for(let _=0;_<e.length;++_){let R=e[_],P=null;if(ya.isNode(R))!g&&R.spaceBefore&&y.push(""),Im(r,y,R.commentBefore,g),R.comment&&(P=R.comment);else if(ya.isPair(R)){let U=ya.isNode(R.key)?R.key:null;U&&(!g&&U.spaceBefore&&y.push(""),Im(r,y,U.commentBefore,g))}g=!1;let A=ik.stringify(R,m,()=>P=null,()=>g=!0);P&&(A+=Om.lineComment(A,s,d(P))),g&&P&&(g=!1),y.push(n+A)}let S;if(y.length===0)S=i.start+i.end;else{S=y[0];for(let _=1;_<y.length;++_){let R=y[_];S+=R?`
139
139
  ${f}${R}`:`
140
140
  `}}return t?(S+=`
141
- `+Em.indentComment(d(t),f),l&&l()):g&&a&&a(),S}function Lz({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,m=0,g=[];for(let _=0;_<t.length;++_){let R=t[_],P=null;if(ya.isNode(R))R.spaceBefore&&g.push(""),Om(e,g,R.commentBefore,!1),R.comment&&(P=R.comment);else if(ya.isPair(R)){let U=ya.isNode(R.key)?R.key:null;U&&(U.spaceBefore&&g.push(""),Om(e,g,U.commentBefore,!1),U.comment&&(d=!0));let B=ya.isNode(R.value)?R.value:null;B?(B.comment&&(P=B.comment),B.commentBefore&&(d=!0)):R.value==null&&U?.comment&&(P=U.comment)}P&&(d=!0);let A=nk.stringify(R,f,()=>P=null);d||(d=g.length>m||A.includes(`
142
- `)),_<t.length-1?A+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((U,B)=>U+B.length+2,2)+(A.length+2)>e.options.lineWidth)),d&&(A+=",")),P&&(A+=Em.lineComment(A,n,l(P))),g.push(A),m=g.length}let{start:y,end:S}=r;if(g.length===0)return y+S;if(!d){let _=g.reduce((R,P)=>R+P.length+2,2);d=e.options.lineWidth>0&&_>e.options.lineWidth}if(d){let _=y;for(let R of g)_+=R?`
141
+ `+Om.indentComment(d(t),f),l&&l()):g&&a&&a(),S}function jz({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,m=0,g=[];for(let _=0;_<t.length;++_){let R=t[_],P=null;if(ya.isNode(R))R.spaceBefore&&g.push(""),Im(e,g,R.commentBefore,!1),R.comment&&(P=R.comment);else if(ya.isPair(R)){let U=ya.isNode(R.key)?R.key:null;U&&(U.spaceBefore&&g.push(""),Im(e,g,U.commentBefore,!1),U.comment&&(d=!0));let B=ya.isNode(R.value)?R.value:null;B?(B.comment&&(P=B.comment),B.commentBefore&&(d=!0)):R.value==null&&U?.comment&&(P=U.comment)}P&&(d=!0);let A=ik.stringify(R,f,()=>P=null);d||(d=g.length>m||A.includes(`
142
+ `)),_<t.length-1?A+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((U,B)=>U+B.length+2,2)+(A.length+2)>e.options.lineWidth)),d&&(A+=",")),P&&(A+=Om.lineComment(A,n,l(P))),g.push(A),m=g.length}let{start:y,end:S}=r;if(g.length===0)return y+S;if(!d){let _=g.reduce((R,P)=>R+P.length+2,2);d=e.options.lineWidth>0&&_>e.options.lineWidth}if(d){let _=y;for(let R of g)_+=R?`
143
143
  ${s}${i}${R}`:`
144
144
  `;return`${_}
145
- ${i}${S}`}else return`${y}${a}${g.join(" ")}${a}${S}`}function Om({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Em.indentComment(e(n),t);r.push(s.trimStart())}}ik.stringifyCollection=Dz});var Zs=F(xw=>{"use strict";var jz=_w(),Uz=Sw(),Hz=pm(),Qs=Je(),Im=Ks(),Bz=Ft();function zf(t,e){let r=Qs.isScalar(e)?e.value:e;for(let n of t)if(Qs.isPair(n)&&(n.key===e||n.key===r||Qs.isScalar(n.key)&&n.key.value===r))return n}var Rw=class extends Hz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Qs.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),l=(f,d)=>{if(typeof s=="function")d=s.call(r,f,d);else if(Array.isArray(s)&&!s.includes(f))return;(d!==void 0||i)&&a.items.push(Im.createPair(f,d,n))};if(r instanceof Map)for(let[f,d]of r)l(f,d);else if(r&&typeof r=="object")for(let f of Object.keys(r))l(f,r[f]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){let n;Qs.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Im.Pair(e,e?.value):n=new Im.Pair(e.key,e.value);let i=zf(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Qs.isScalar(i.value)&&Bz.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let a=this.items.findIndex(l=>s(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let r=zf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=zf(this.items,e)?.value;return(!r&&Qs.isScalar(i)?i.value:i)??void 0}has(e){return!!zf(this.items,e)}set(e,r){this.add(new Im.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)Uz.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Qs.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),jz.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};xw.YAMLMap=Rw;xw.findPair=zf});var ac=F(ok=>{"use strict";var Vz=Je(),sk=Zs(),Wz={collection:"map",default:!0,nodeClass:sk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Vz.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>sk.YAMLMap.from(t,e,r)};ok.map=Wz});var Xs=F(ak=>{"use strict";var zz=Lf(),Jz=_w(),Gz=pm(),km=Je(),Yz=Ft(),Kz=zs(),Cw=class extends Gz.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(km.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Pm(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Pm(e);if(typeof n!="number")return;let i=this.items[n];return!r&&km.isScalar(i)?i.value:i}has(e){let r=Pm(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=Pm(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];km.isScalar(i)&&Yz.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(Kz.toJS(s,String(i++),r));return n}toString(e,r,n){return e?Jz.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let a=0;for(let l of r){if(typeof i=="function"){let f=r instanceof Set?l:String(a++);l=i.call(r,f,l)}s.items.push(zz.createNode(l,void 0,n))}}return s}};function Pm(t){let e=km.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ak.YAMLSeq=Cw});var lc=F(ck=>{"use strict";var Qz=Je(),lk=Xs(),Zz={collection:"seq",default:!0,nodeClass:lk.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Qz.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>lk.YAMLSeq.from(t,e,r)};ck.seq=Zz});var Jf=F(uk=>{"use strict";var Xz=Bf(),eJ={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Xz.stringifyString(t,e,r,n)}};uk.string=eJ});var Tm=F(pk=>{"use strict";var fk=Ft(),dk={identify:t=>t==null,createNode:()=>new fk.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new fk.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&dk.test.test(t)?t:e.options.nullStr};pk.nullTag=dk});var Ew=F(mk=>{"use strict";var tJ=Ft(),hk={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new tJ.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&hk.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};mk.boolTag=hk});var cc=F(gk=>{"use strict";function rJ({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=e-(s.length-a-1);for(;l-- >0;)s+="0"}return s}gk.stringifyNumber=rJ});var Iw=F(Am=>{"use strict";var nJ=Ft(),Ow=cc(),iJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ow.stringifyNumber},sJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Ow.stringifyNumber(t)}},oJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new nJ.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Ow.stringifyNumber};Am.float=oJ;Am.floatExp=sJ;Am.floatNaN=iJ});var kw=F($m=>{"use strict";var yk=cc(),qm=t=>typeof t=="bigint"||Number.isInteger(t),Pw=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function vk(t,e,r){let{value:n}=t;return qm(n)&&n>=0?r+n.toString(e):yk.stringifyNumber(t)}var aJ={identify:t=>qm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Pw(t,2,8,r),stringify:t=>vk(t,8,"0o")},lJ={identify:qm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Pw(t,0,10,r),stringify:yk.stringifyNumber},cJ={identify:t=>qm(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Pw(t,2,16,r),stringify:t=>vk(t,16,"0x")};$m.int=lJ;$m.intHex=cJ;$m.intOct=aJ});var Sk=F(bk=>{"use strict";var uJ=ac(),fJ=Tm(),dJ=lc(),pJ=Jf(),hJ=Ew(),Tw=Iw(),Aw=kw(),mJ=[uJ.map,dJ.seq,pJ.string,fJ.nullTag,hJ.boolTag,Aw.intOct,Aw.int,Aw.intHex,Tw.floatNaN,Tw.floatExp,Tw.float];bk.schema=mJ});var Rk=F(_k=>{"use strict";var gJ=Ft(),yJ=ac(),vJ=lc();function wk(t){return typeof t=="bigint"||Number.isInteger(t)}var Mm=({value:t})=>JSON.stringify(t),bJ=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Mm},{identify:t=>t==null,createNode:()=>new gJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Mm},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Mm},{identify:wk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>wk(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Mm}],SJ={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},wJ=[yJ.map,vJ.seq].concat(bJ,SJ);_k.schema=wJ});var $w=F(xk=>{"use strict";var Gf=it("buffer"),qw=Ft(),_J=Bf(),RJ={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Gf.Buffer=="function")return Gf.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){if(!r)return"";let a=r,l;if(typeof Gf.Buffer=="function")l=a instanceof Gf.Buffer?a.toString("base64"):Gf.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let d=0;d<a.length;++d)f+=String.fromCharCode(a[d]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=qw.Scalar.BLOCK_LITERAL),e!==qw.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),d=Math.ceil(l.length/f),m=new Array(d);for(let g=0,y=0;g<d;++g,y+=f)m[g]=l.substr(y,f);l=m.join(e===qw.Scalar.BLOCK_LITERAL?`
146
- `:" ")}return _J.stringifyString({comment:t,type:e,value:l},n,i,s)}};xk.binary=RJ});var Fm=F(Dm=>{"use strict";var Nm=Je(),Mw=Ks(),xJ=Ft(),CJ=Xs();function Ck(t,e){if(Nm.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Nm.isPair(n)){if(Nm.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Mw.Pair(new xJ.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
145
+ ${i}${S}`}else return`${y}${a}${g.join(" ")}${a}${S}`}function Im({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Om.indentComment(e(n),t);r.push(s.trimStart())}}sk.stringifyCollection=Fz});var Xs=F(xw=>{"use strict";var Uz=_w(),Hz=Sw(),Bz=hm(),Zs=Je(),Pm=Qs(),Vz=Ft();function Jf(t,e){let r=Zs.isScalar(e)?e.value:e;for(let n of t)if(Zs.isPair(n)&&(n.key===e||n.key===r||Zs.isScalar(n.key)&&n.key.value===r))return n}var Rw=class extends Bz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Zs.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),l=(f,d)=>{if(typeof s=="function")d=s.call(r,f,d);else if(Array.isArray(s)&&!s.includes(f))return;(d!==void 0||i)&&a.items.push(Pm.createPair(f,d,n))};if(r instanceof Map)for(let[f,d]of r)l(f,d);else if(r&&typeof r=="object")for(let f of Object.keys(r))l(f,r[f]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){let n;Zs.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Pm.Pair(e,e?.value):n=new Pm.Pair(e.key,e.value);let i=Jf(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Zs.isScalar(i.value)&&Vz.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let a=this.items.findIndex(l=>s(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let r=Jf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Jf(this.items,e)?.value;return(!r&&Zs.isScalar(i)?i.value:i)??void 0}has(e){return!!Jf(this.items,e)}set(e,r){this.add(new Pm.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)Hz.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Zs.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Uz.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};xw.YAMLMap=Rw;xw.findPair=Jf});var ac=F(ak=>{"use strict";var Wz=Je(),ok=Xs(),zz={collection:"map",default:!0,nodeClass:ok.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Wz.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>ok.YAMLMap.from(t,e,r)};ak.map=zz});var eo=F(lk=>{"use strict";var Jz=jf(),Gz=_w(),Yz=hm(),Tm=Je(),Kz=Ft(),Qz=Js(),Cw=class extends Yz.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Tm.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=km(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=km(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Tm.isScalar(i)?i.value:i}has(e){let r=km(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=km(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Tm.isScalar(i)&&Kz.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(Qz.toJS(s,String(i++),r));return n}toString(e,r,n){return e?Gz.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let a=0;for(let l of r){if(typeof i=="function"){let f=r instanceof Set?l:String(a++);l=i.call(r,f,l)}s.items.push(Jz.createNode(l,void 0,n))}}return s}};function km(t){let e=Tm.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}lk.YAMLSeq=Cw});var lc=F(uk=>{"use strict";var Zz=Je(),ck=eo(),Xz={collection:"seq",default:!0,nodeClass:ck.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Zz.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>ck.YAMLSeq.from(t,e,r)};uk.seq=Xz});var Gf=F(fk=>{"use strict";var eJ=Vf(),tJ={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),eJ.stringifyString(t,e,r,n)}};fk.string=tJ});var Am=F(hk=>{"use strict";var dk=Ft(),pk={identify:t=>t==null,createNode:()=>new dk.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new dk.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&pk.test.test(t)?t:e.options.nullStr};hk.nullTag=pk});var Ew=F(gk=>{"use strict";var rJ=Ft(),mk={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new rJ.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&mk.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};gk.boolTag=mk});var cc=F(yk=>{"use strict";function nJ({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=e-(s.length-a-1);for(;l-- >0;)s+="0"}return s}yk.stringifyNumber=nJ});var Iw=F(qm=>{"use strict";var iJ=Ft(),Ow=cc(),sJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ow.stringifyNumber},oJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Ow.stringifyNumber(t)}},aJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new iJ.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Ow.stringifyNumber};qm.float=aJ;qm.floatExp=oJ;qm.floatNaN=sJ});var kw=F(Mm=>{"use strict";var vk=cc(),$m=t=>typeof t=="bigint"||Number.isInteger(t),Pw=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function bk(t,e,r){let{value:n}=t;return $m(n)&&n>=0?r+n.toString(e):vk.stringifyNumber(t)}var lJ={identify:t=>$m(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Pw(t,2,8,r),stringify:t=>bk(t,8,"0o")},cJ={identify:$m,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Pw(t,0,10,r),stringify:vk.stringifyNumber},uJ={identify:t=>$m(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Pw(t,2,16,r),stringify:t=>bk(t,16,"0x")};Mm.int=cJ;Mm.intHex=uJ;Mm.intOct=lJ});var wk=F(Sk=>{"use strict";var fJ=ac(),dJ=Am(),pJ=lc(),hJ=Gf(),mJ=Ew(),Tw=Iw(),Aw=kw(),gJ=[fJ.map,pJ.seq,hJ.string,dJ.nullTag,mJ.boolTag,Aw.intOct,Aw.int,Aw.intHex,Tw.floatNaN,Tw.floatExp,Tw.float];Sk.schema=gJ});var xk=F(Rk=>{"use strict";var yJ=Ft(),vJ=ac(),bJ=lc();function _k(t){return typeof t=="bigint"||Number.isInteger(t)}var Nm=({value:t})=>JSON.stringify(t),SJ=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Nm},{identify:t=>t==null,createNode:()=>new yJ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nm},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Nm},{identify:_k,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>_k(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Nm}],wJ={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},_J=[vJ.map,bJ.seq].concat(SJ,wJ);Rk.schema=_J});var $w=F(Ck=>{"use strict";var Yf=it("buffer"),qw=Ft(),RJ=Vf(),xJ={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Yf.Buffer=="function")return Yf.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){if(!r)return"";let a=r,l;if(typeof Yf.Buffer=="function")l=a instanceof Yf.Buffer?a.toString("base64"):Yf.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let d=0;d<a.length;++d)f+=String.fromCharCode(a[d]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=qw.Scalar.BLOCK_LITERAL),e!==qw.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),d=Math.ceil(l.length/f),m=new Array(d);for(let g=0,y=0;g<d;++g,y+=f)m[g]=l.substr(y,f);l=m.join(e===qw.Scalar.BLOCK_LITERAL?`
146
+ `:" ")}return RJ.stringifyString({comment:t,type:e,value:l},n,i,s)}};Ck.binary=xJ});var Lm=F(Fm=>{"use strict";var Dm=Je(),Mw=Qs(),CJ=Ft(),EJ=eo();function Ek(t,e){if(Dm.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Dm.isPair(n)){if(Dm.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Mw.Pair(new CJ.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
147
147
  ${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
148
- ${s.comment}`:n.comment}n=i}t.items[r]=Nm.isPair(n)?n:new Mw.Pair(n)}}else e("Expected a sequence for this tag");return t}function Ek(t,e,r){let{replacer:n}=r,i=new CJ.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let l,f;if(Array.isArray(a))if(a.length===2)l=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let d=Object.keys(a);if(d.length===1)l=d[0],f=a[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=a;i.items.push(Mw.createPair(l,f,r))}return i}var EJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ck,createNode:Ek};Dm.createPairs=Ek;Dm.pairs=EJ;Dm.resolvePairs=Ck});var Fw=F(Dw=>{"use strict";var Ok=Je(),Nw=zs(),Yf=Zs(),OJ=Xs(),Ik=Fm(),va=class t extends OJ.YAMLSeq{constructor(){super(),this.add=Yf.YAMLMap.prototype.add.bind(this),this.delete=Yf.YAMLMap.prototype.delete.bind(this),this.get=Yf.YAMLMap.prototype.get.bind(this),this.has=Yf.YAMLMap.prototype.has.bind(this),this.set=Yf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,a;if(Ok.isPair(i)?(s=Nw.toJS(i.key,"",r),a=Nw.toJS(i.value,s,r)):s=Nw.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=Ik.createPairs(e,r,n),s=new this;return s.items=i.items,s}};va.tag="tag:yaml.org,2002:omap";var IJ={collection:"seq",identify:t=>t instanceof Map,nodeClass:va,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ik.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Ok.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new va,r)},createNode:(t,e,r)=>va.from(t,e,r)};Dw.YAMLOMap=va;Dw.omap=IJ});var qk=F(Lw=>{"use strict";var Pk=Ft();function kk({value:t,source:e},r){return e&&(t?Tk:Ak).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Tk={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Pk.Scalar(!0),stringify:kk},Ak={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Pk.Scalar(!1),stringify:kk};Lw.falseTag=Ak;Lw.trueTag=Tk});var $k=F(Lm=>{"use strict";var PJ=Ft(),jw=cc(),kJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jw.stringifyNumber},TJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():jw.stringifyNumber(t)}},AJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new PJ.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:jw.stringifyNumber};Lm.float=AJ;Lm.floatExp=TJ;Lm.floatNaN=kJ});var Nk=F(Qf=>{"use strict";var Mk=cc(),Kf=t=>typeof t=="bigint"||Number.isInteger(t);function jm(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function Uw(t,e,r){let{value:n}=t;if(Kf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Mk.stringifyNumber(t)}var qJ={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>jm(t,2,2,r),stringify:t=>Uw(t,2,"0b")},$J={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>jm(t,1,8,r),stringify:t=>Uw(t,8,"0")},MJ={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>jm(t,0,10,r),stringify:Mk.stringifyNumber},NJ={identify:Kf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>jm(t,2,16,r),stringify:t=>Uw(t,16,"0x")};Qf.int=MJ;Qf.intBin=qJ;Qf.intHex=NJ;Qf.intOct=$J});var Bw=F(Hw=>{"use strict";var Bm=Je(),Um=Ks(),Hm=Zs(),ba=class t extends Hm.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Bm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Um.Pair(e.key,null):r=new Um.Pair(e,null),Hm.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Hm.findPair(this.items,e);return!r&&Bm.isPair(n)?Bm.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Hm.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Um.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(Um.createPair(a,null,n));return s}};ba.tag="tag:yaml.org,2002:set";var DJ={collection:"map",identify:t=>t instanceof Set,nodeClass:ba,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ba.from(t,e,r),resolve(t,e){if(Bm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ba,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Hw.YAMLSet=ba;Hw.set=DJ});var Ww=F(Vm=>{"use strict";var FJ=cc();function Vw(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,l)=>a*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function Dk(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return FJ.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var LJ={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>Vw(t,r),stringify:Dk},jJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Vw(t,!1),stringify:Dk},Fk={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Fk.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,i,s||0,a||0,l||0,f),m=e[8];if(m&&m!=="Z"){let g=Vw(m,!1);Math.abs(g)<30&&(g*=60),d-=6e4*g}return new Date(d)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Vm.floatTime=jJ;Vm.intTime=LJ;Vm.timestamp=Fk});var Uk=F(jk=>{"use strict";var UJ=ac(),HJ=Tm(),BJ=lc(),VJ=Jf(),WJ=$w(),Lk=qk(),zw=$k(),Wm=Nk(),zJ=Rm(),JJ=Fw(),GJ=Fm(),YJ=Bw(),Jw=Ww(),KJ=[UJ.map,BJ.seq,VJ.string,HJ.nullTag,Lk.trueTag,Lk.falseTag,Wm.intBin,Wm.intOct,Wm.int,Wm.intHex,zw.floatNaN,zw.floatExp,zw.float,WJ.binary,zJ.merge,JJ.omap,GJ.pairs,YJ.set,Jw.intTime,Jw.floatTime,Jw.timestamp];jk.schema=KJ});var Qk=F(Kw=>{"use strict";var Wk=ac(),QJ=Tm(),zk=lc(),ZJ=Jf(),XJ=Ew(),Gw=Iw(),Yw=kw(),eG=Sk(),tG=Rk(),Jk=$w(),Zf=Rm(),Gk=Fw(),Yk=Fm(),Hk=Uk(),Kk=Bw(),zm=Ww(),Bk=new Map([["core",eG.schema],["failsafe",[Wk.map,zk.seq,ZJ.string]],["json",tG.schema],["yaml11",Hk.schema],["yaml-1.1",Hk.schema]]),Vk={binary:Jk.binary,bool:XJ.boolTag,float:Gw.float,floatExp:Gw.floatExp,floatNaN:Gw.floatNaN,floatTime:zm.floatTime,int:Yw.int,intHex:Yw.intHex,intOct:Yw.intOct,intTime:zm.intTime,map:Wk.map,merge:Zf.merge,null:QJ.nullTag,omap:Gk.omap,pairs:Yk.pairs,seq:zk.seq,set:Kk.set,timestamp:zm.timestamp},rG={"tag:yaml.org,2002:binary":Jk.binary,"tag:yaml.org,2002:merge":Zf.merge,"tag:yaml.org,2002:omap":Gk.omap,"tag:yaml.org,2002:pairs":Yk.pairs,"tag:yaml.org,2002:set":Kk.set,"tag:yaml.org,2002:timestamp":zm.timestamp};function nG(t,e,r){let n=Bk.get(e);if(n&&!t)return r&&!n.includes(Zf.merge)?n.concat(Zf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(Bk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Zf.merge)),i.reduce((s,a)=>{let l=typeof a=="string"?Vk[a]:a;if(!l){let f=JSON.stringify(a),d=Object.keys(Vk).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}Kw.coreKnownTags=rG;Kw.getTags=nG});var Xw=F(Zk=>{"use strict";var Qw=Je(),iG=ac(),sG=lc(),oG=Jf(),Jm=Qk(),aG=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Zw=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Jm.getTags(e,"compat"):e?Jm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Jm.coreKnownTags:{},this.tags=Jm.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Qw.MAP,{value:iG.map}),Object.defineProperty(this,Qw.SCALAR,{value:oG.string}),Object.defineProperty(this,Qw.SEQ,{value:sG.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?aG:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Zk.Schema=Zw});var eT=F(Xk=>{"use strict";var lG=Je(),e_=Vf(),Xf=jf();function cG(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=e_.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Xf.indentComment(f,""))}let a=!1,l=null;if(t.contents){if(lG.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let m=s(t.contents.commentBefore);r.push(Xf.indentComment(m,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>a=!0,d=e_.stringify(t.contents,i,()=>l=null,f);l&&(d+=Xf.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(e_.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
149
- `)?(r.push("..."),r.push(Xf.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||l)&&r[r.length-1]!==""&&r.push(""),r.push(Xf.indentComment(s(f),"")))}return r.join(`
148
+ ${s.comment}`:n.comment}n=i}t.items[r]=Dm.isPair(n)?n:new Mw.Pair(n)}}else e("Expected a sequence for this tag");return t}function Ok(t,e,r){let{replacer:n}=r,i=new EJ.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let l,f;if(Array.isArray(a))if(a.length===2)l=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let d=Object.keys(a);if(d.length===1)l=d[0],f=a[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=a;i.items.push(Mw.createPair(l,f,r))}return i}var OJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ek,createNode:Ok};Fm.createPairs=Ok;Fm.pairs=OJ;Fm.resolvePairs=Ek});var Fw=F(Dw=>{"use strict";var Ik=Je(),Nw=Js(),Kf=Xs(),IJ=eo(),Pk=Lm(),va=class t extends IJ.YAMLSeq{constructor(){super(),this.add=Kf.YAMLMap.prototype.add.bind(this),this.delete=Kf.YAMLMap.prototype.delete.bind(this),this.get=Kf.YAMLMap.prototype.get.bind(this),this.has=Kf.YAMLMap.prototype.has.bind(this),this.set=Kf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,a;if(Ik.isPair(i)?(s=Nw.toJS(i.key,"",r),a=Nw.toJS(i.value,s,r)):s=Nw.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=Pk.createPairs(e,r,n),s=new this;return s.items=i.items,s}};va.tag="tag:yaml.org,2002:omap";var PJ={collection:"seq",identify:t=>t instanceof Map,nodeClass:va,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Pk.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Ik.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new va,r)},createNode:(t,e,r)=>va.from(t,e,r)};Dw.YAMLOMap=va;Dw.omap=PJ});var $k=F(Lw=>{"use strict";var kk=Ft();function Tk({value:t,source:e},r){return e&&(t?Ak:qk).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Ak={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new kk.Scalar(!0),stringify:Tk},qk={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new kk.Scalar(!1),stringify:Tk};Lw.falseTag=qk;Lw.trueTag=Ak});var Mk=F(jm=>{"use strict";var kJ=Ft(),jw=cc(),TJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:jw.stringifyNumber},AJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():jw.stringifyNumber(t)}},qJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new kJ.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:jw.stringifyNumber};jm.float=qJ;jm.floatExp=AJ;jm.floatNaN=TJ});var Dk=F(Zf=>{"use strict";var Nk=cc(),Qf=t=>typeof t=="bigint"||Number.isInteger(t);function Um(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function Uw(t,e,r){let{value:n}=t;if(Qf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Nk.stringifyNumber(t)}var $J={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Um(t,2,2,r),stringify:t=>Uw(t,2,"0b")},MJ={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Um(t,1,8,r),stringify:t=>Uw(t,8,"0")},NJ={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Um(t,0,10,r),stringify:Nk.stringifyNumber},DJ={identify:Qf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Um(t,2,16,r),stringify:t=>Uw(t,16,"0x")};Zf.int=NJ;Zf.intBin=$J;Zf.intHex=DJ;Zf.intOct=MJ});var Bw=F(Hw=>{"use strict";var Vm=Je(),Hm=Qs(),Bm=Xs(),ba=class t extends Bm.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Vm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Hm.Pair(e.key,null):r=new Hm.Pair(e,null),Bm.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Bm.findPair(this.items,e);return!r&&Vm.isPair(n)?Vm.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Bm.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Hm.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(Hm.createPair(a,null,n));return s}};ba.tag="tag:yaml.org,2002:set";var FJ={collection:"map",identify:t=>t instanceof Set,nodeClass:ba,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ba.from(t,e,r),resolve(t,e){if(Vm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ba,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Hw.YAMLSet=ba;Hw.set=FJ});var Ww=F(Wm=>{"use strict";var LJ=cc();function Vw(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,l)=>a*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function Fk(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return LJ.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var jJ={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>Vw(t,r),stringify:Fk},UJ={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Vw(t,!1),stringify:Fk},Lk={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Lk.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,i,s||0,a||0,l||0,f),m=e[8];if(m&&m!=="Z"){let g=Vw(m,!1);Math.abs(g)<30&&(g*=60),d-=6e4*g}return new Date(d)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Wm.floatTime=UJ;Wm.intTime=jJ;Wm.timestamp=Lk});var Hk=F(Uk=>{"use strict";var HJ=ac(),BJ=Am(),VJ=lc(),WJ=Gf(),zJ=$w(),jk=$k(),zw=Mk(),zm=Dk(),JJ=xm(),GJ=Fw(),YJ=Lm(),KJ=Bw(),Jw=Ww(),QJ=[HJ.map,VJ.seq,WJ.string,BJ.nullTag,jk.trueTag,jk.falseTag,zm.intBin,zm.intOct,zm.int,zm.intHex,zw.floatNaN,zw.floatExp,zw.float,zJ.binary,JJ.merge,GJ.omap,YJ.pairs,KJ.set,Jw.intTime,Jw.floatTime,Jw.timestamp];Uk.schema=QJ});var Zk=F(Kw=>{"use strict";var zk=ac(),ZJ=Am(),Jk=lc(),XJ=Gf(),eG=Ew(),Gw=Iw(),Yw=kw(),tG=wk(),rG=xk(),Gk=$w(),Xf=xm(),Yk=Fw(),Kk=Lm(),Bk=Hk(),Qk=Bw(),Jm=Ww(),Vk=new Map([["core",tG.schema],["failsafe",[zk.map,Jk.seq,XJ.string]],["json",rG.schema],["yaml11",Bk.schema],["yaml-1.1",Bk.schema]]),Wk={binary:Gk.binary,bool:eG.boolTag,float:Gw.float,floatExp:Gw.floatExp,floatNaN:Gw.floatNaN,floatTime:Jm.floatTime,int:Yw.int,intHex:Yw.intHex,intOct:Yw.intOct,intTime:Jm.intTime,map:zk.map,merge:Xf.merge,null:ZJ.nullTag,omap:Yk.omap,pairs:Kk.pairs,seq:Jk.seq,set:Qk.set,timestamp:Jm.timestamp},nG={"tag:yaml.org,2002:binary":Gk.binary,"tag:yaml.org,2002:merge":Xf.merge,"tag:yaml.org,2002:omap":Yk.omap,"tag:yaml.org,2002:pairs":Kk.pairs,"tag:yaml.org,2002:set":Qk.set,"tag:yaml.org,2002:timestamp":Jm.timestamp};function iG(t,e,r){let n=Vk.get(e);if(n&&!t)return r&&!n.includes(Xf.merge)?n.concat(Xf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(Vk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Xf.merge)),i.reduce((s,a)=>{let l=typeof a=="string"?Wk[a]:a;if(!l){let f=JSON.stringify(a),d=Object.keys(Wk).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}Kw.coreKnownTags=nG;Kw.getTags=iG});var Xw=F(Xk=>{"use strict";var Qw=Je(),sG=ac(),oG=lc(),aG=Gf(),Gm=Zk(),lG=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Zw=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Gm.getTags(e,"compat"):e?Gm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Gm.coreKnownTags:{},this.tags=Gm.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Qw.MAP,{value:sG.map}),Object.defineProperty(this,Qw.SCALAR,{value:aG.string}),Object.defineProperty(this,Qw.SEQ,{value:oG.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?lG:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Xk.Schema=Zw});var tT=F(eT=>{"use strict";var cG=Je(),e_=Wf(),ed=Uf();function uG(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=e_.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(ed.indentComment(f,""))}let a=!1,l=null;if(t.contents){if(cG.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let m=s(t.contents.commentBefore);r.push(ed.indentComment(m,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>a=!0,d=e_.stringify(t.contents,i,()=>l=null,f);l&&(d+=ed.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(e_.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
149
+ `)?(r.push("..."),r.push(ed.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||l)&&r[r.length-1]!==""&&r.push(""),r.push(ed.indentComment(s(f),"")))}return r.join(`
150
150
  `)+`
151
- `}Xk.stringifyDocument=cG});var ed=F(tT=>{"use strict";var uG=Ff(),uc=pm(),En=Je(),fG=Ks(),dG=zs(),pG=Xw(),hG=eT(),t_=cm(),mG=sw(),gG=Lf(),r_=iw(),n_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:a}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new r_.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){fc(this.contents)&&this.contents.add(e)}addIn(e,r){fc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=t_.anchorNames(this);e.anchor=!r||n.has(r)?t_.findNewAnchor(r||"a",n):r}return new uG.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let P=U=>typeof U=="number"||U instanceof String||U instanceof Number,A=r.filter(P).map(String);A.length>0&&(r=r.concat(A)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:f,onTagObj:d,tag:m}=n??{},{onAnchor:g,setAnchors:y,sourceObjects:S}=t_.createNodeAnchors(this,a||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:S},R=gG.createNode(e,m,_);return l&&En.isCollection(R)&&(R.flow=!0),y(),R}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new fG.Pair(i,s)}delete(e){return fc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return uc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):fc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return En.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return uc.isEmptyPath(e)?!r&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return uc.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=uc.collectionFromPath(this.schema,[e],r):fc(this.contents)&&this.contents.set(e,r)}setIn(e,r){uc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=uc.collectionFromPath(this.schema,Array.from(e),r):fc(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new r_.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new r_.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new pG.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:a}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=dG.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:m}of l.anchors.values())s(m,d);return typeof a=="function"?mG.applyReviver(a,{"":f},"",f):f}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return hG.stringifyDocument(this,e)}};function fc(t){if(En.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}tT.Document=n_});var nd=F(rd=>{"use strict";var td=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},i_=class extends td{constructor(e,r,n){super("YAMLParseError",e,r,n)}},s_=class extends td{constructor(e,r,n){super("YAMLWarning",e,r,n)}},yG=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,a=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let l=Math.min(s-39,a.length-79);a="\u2026"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
151
+ `}eT.stringifyDocument=uG});var td=F(rT=>{"use strict";var fG=Lf(),uc=hm(),En=Je(),dG=Qs(),pG=Js(),hG=Xw(),mG=tT(),t_=um(),gG=sw(),yG=jf(),r_=iw(),n_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,En.NODE_TYPE,{value:En.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:a}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new r_.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[En.NODE_TYPE]:{value:En.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=En.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){fc(this.contents)&&this.contents.add(e)}addIn(e,r){fc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=t_.anchorNames(this);e.anchor=!r||n.has(r)?t_.findNewAnchor(r||"a",n):r}return new fG.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let P=U=>typeof U=="number"||U instanceof String||U instanceof Number,A=r.filter(P).map(String);A.length>0&&(r=r.concat(A)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:f,onTagObj:d,tag:m}=n??{},{onAnchor:g,setAnchors:y,sourceObjects:S}=t_.createNodeAnchors(this,a||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:S},R=yG.createNode(e,m,_);return l&&En.isCollection(R)&&(R.flow=!0),y(),R}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new dG.Pair(i,s)}delete(e){return fc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return uc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):fc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return En.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return uc.isEmptyPath(e)?!r&&En.isScalar(this.contents)?this.contents.value:this.contents:En.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return En.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return uc.isEmptyPath(e)?this.contents!==void 0:En.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=uc.collectionFromPath(this.schema,[e],r):fc(this.contents)&&this.contents.set(e,r)}setIn(e,r){uc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=uc.collectionFromPath(this.schema,Array.from(e),r):fc(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new r_.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new r_.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new hG.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:a}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=pG.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:m}of l.anchors.values())s(m,d);return typeof a=="function"?gG.applyReviver(a,{"":f},"",f):f}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return mG.stringifyDocument(this,e)}};function fc(t){if(En.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}rT.Document=n_});var id=F(nd=>{"use strict";var rd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},i_=class extends rd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},s_=class extends rd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},vG=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,a=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let l=Math.min(s-39,a.length-79);a="\u2026"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
152
152
  `),a=l+a}if(/[^ ]/.test(a)){let l=1,f=r.linePos[1];f?.line===n&&f.col>i&&(l=Math.max(1,Math.min(f.col-i,80-s)));let d=" ".repeat(s)+"^".repeat(l);r.message+=`:
153
153
 
154
154
  ${a}
155
155
  ${d}
156
- `}};rd.YAMLError=td;rd.YAMLParseError=i_;rd.YAMLWarning=s_;rd.prettifyError=yG});var id=F(rT=>{"use strict";function vG(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:l}){let f=!1,d=l,m=l,g="",y="",S=!1,_=!1,R=null,P=null,A=null,U=null,B=null,V=null,W=null;for(let x of t)switch(_&&(x.type!=="space"&&x.type!=="newline"&&x.type!=="comma"&&s(x.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),R&&(d&&x.type!=="comment"&&x.type!=="newline"&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),R=null),x.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&x.source.includes(" ")&&(R=x),m=!0;break;case"comment":{m||s(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let k=x.source.substring(1)||" ";g?g+=y+k:g=k,y="",d=!1;break}case"newline":d?g?g+=x.source:(!V||r!=="seq-item-ind")&&(f=!0):y+=x.source,d=!0,S=!0,(P||A)&&(U=x),m=!0;break;case"anchor":P&&s(x,"MULTIPLE_ANCHORS","A node can have at most one anchor"),x.source.endsWith(":")&&s(x.offset+x.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),P=x,W??(W=x.offset),d=!1,m=!1,_=!0;break;case"tag":{A&&s(x,"MULTIPLE_TAGS","A node can have at most one tag"),A=x,W??(W=x.offset),d=!1,m=!1,_=!0;break}case r:(P||A)&&s(x,"BAD_PROP_ORDER",`Anchors and tags must be after the ${x.source} indicator`),V&&s(x,"UNEXPECTED_TOKEN",`Unexpected ${x.source} in ${e??"collection"}`),V=x,d=r==="seq-item-ind"||r==="explicit-key-ind",m=!1;break;case"comma":if(e){B&&s(x,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),B=x,d=!1,m=!1;break}default:s(x,"UNEXPECTED_TOKEN",`Unexpected ${x.type} token`),d=!1,m=!1}let X=t[t.length-1],T=X?X.offset+X.source.length:i;return _&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),R&&(d&&R.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:B,found:V,spaceBefore:f,comment:g,hasNewline:S,anchor:P,tag:A,newlineAfterProp:U,end:T,start:W??T}}rT.resolveProps=vG});var Gm=F(nT=>{"use strict";function o_(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
157
- `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(o_(e.key)||o_(e.value))return!0}return!1;default:return!0}}nT.containsNewline=o_});var a_=F(iT=>{"use strict";var bG=Gm();function SG(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&bG.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}iT.flowIndentCheck=SG});var l_=F(oT=>{"use strict";var sT=Je();function wG(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||sT.isScalar(s)&&sT.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,r))}oT.mapIncludes=wG});var dT=F(fT=>{"use strict";var aT=Ks(),_G=Zs(),lT=id(),RG=Gm(),cT=a_(),xG=l_(),uT="All mapping items must start at the same column";function CG({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??_G.YAMLMap,l=new a(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,d=null;for(let m of n.items){let{start:g,key:y,sep:S,value:_}=m,R=lT.resolveProps(g,{indicator:"explicit-key-ind",next:y??S?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),P=!R.found;if(P){if(y&&(y.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(f,"BAD_INDENT",uT)),!R.anchor&&!R.tag&&!S){d=R.end,R.comment&&(l.comment?l.comment+=`
158
- `+R.comment:l.comment=R.comment);continue}(R.newlineAfterProp||RG.containsNewline(y))&&i(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else R.found?.indent!==n.indent&&i(f,"BAD_INDENT",uT);r.atKey=!0;let A=R.end,U=y?t(r,y,R,i):e(r,A,g,null,R,i);r.schema.compat&&cT.flowIndentCheck(n.indent,y,i),r.atKey=!1,xG.mapIncludes(r,l.items,U)&&i(A,"DUPLICATE_KEY","Map keys must be unique");let B=lT.resolveProps(S??[],{indicator:"map-value-ind",next:_,offset:U.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(f=B.end,B.found){P&&(_?.type==="block-map"&&!B.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&R.start<B.found.offset-1024&&i(U.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let V=_?t(r,_,B,i):e(r,f,S,null,B,i);r.schema.compat&&cT.flowIndentCheck(n.indent,_,i),f=V.range[2];let W=new aT.Pair(U,V);r.options.keepSourceTokens&&(W.srcToken=m),l.items.push(W)}else{P&&i(U.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),B.comment&&(U.comment?U.comment+=`
159
- `+B.comment:U.comment=B.comment);let V=new aT.Pair(U);r.options.keepSourceTokens&&(V.srcToken=m),l.items.push(V)}}return d&&d<f&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,d??f],l}fT.resolveBlockMap=CG});var hT=F(pT=>{"use strict";var EG=Xs(),OG=id(),IG=a_();function PG({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??EG.YAMLSeq,l=new a(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,d=null;for(let{start:m,value:g}of n.items){let y=OG.resolveProps(m,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let S=g?t(r,g,y,i):e(r,y.end,m,null,y,i);r.schema.compat&&IG.flowIndentCheck(n.indent,g,i),f=S.range[2],l.items.push(S)}return l.range=[n.offset,f,d??f],l}pT.resolveBlockSeq=PG});var dc=F(mT=>{"use strict";function kG(t,e,r,n){let i="";if(t){let s=!1,a="";for(let l of t){let{source:f,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=f.substring(1)||" ";i?i+=a+m:i=m,a="";break}case"newline":i&&(a+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=f.length}}return{comment:i,offset:e}}mT.resolveEnd=kG});var bT=F(vT=>{"use strict";var TG=Je(),AG=Ks(),gT=Zs(),qG=Xs(),$G=dc(),yT=id(),MG=Gm(),NG=l_(),c_="Block collections are not allowed within flow collections",u_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function DG({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=n.start.source==="{",l=a?"flow map":"flow sequence",f=s?.nodeClass??(a?gT.YAMLMap:qG.YAMLSeq),d=new f(r.schema);d.flow=!0;let m=r.atRoot;m&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let g=n.offset+n.start.source.length;for(let P=0;P<n.items.length;++P){let A=n.items[P],{start:U,key:B,sep:V,value:W}=A,X=yT.resolveProps(U,{flow:l,indicator:"explicit-key-ind",next:B??V?.[0],offset:g,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!V&&!W){P===0&&X.comma?i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):P<n.items.length-1&&i(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),X.comment&&(d.comment?d.comment+=`
160
- `+X.comment:d.comment=X.comment),g=X.end;continue}!a&&r.options.strict&&MG.containsNewline(B)&&i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(P===0)X.comma&&i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(X.comma||i(X.start,"MISSING_CHAR",`Missing , between ${l} items`),X.comment){let T="";e:for(let x of U)switch(x.type){case"comma":case"space":break;case"comment":T=x.source.substring(1);break e;default:break e}if(T){let x=d.items[d.items.length-1];TG.isPair(x)&&(x=x.value??x.key),x.comment?x.comment+=`
161
- `+T:x.comment=T,X.comment=X.comment.substring(T.length+1)}}if(!a&&!V&&!X.found){let T=W?t(r,W,X,i):e(r,X.end,V,null,X,i);d.items.push(T),g=T.range[2],u_(W)&&i(T.range,"BLOCK_IN_FLOW",c_)}else{r.atKey=!0;let T=X.end,x=B?t(r,B,X,i):e(r,T,U,null,X,i);u_(B)&&i(x.range,"BLOCK_IN_FLOW",c_),r.atKey=!1;let k=yT.resolveProps(V??[],{flow:l,indicator:"map-value-ind",next:W,offset:x.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(k.found){if(!a&&!X.found&&r.options.strict){if(V)for(let $ of V){if($===k.found)break;if($.type==="newline"){i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<k.found.offset-1024&&i(k.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else W&&("source"in W&&W.source?.[0]===":"?i(W,"MISSING_CHAR",`Missing space after : in ${l}`):i(k.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let N=W?t(r,W,k,i):k.found?e(r,k.end,V,null,k,i):null;N?u_(W)&&i(N.range,"BLOCK_IN_FLOW",c_):k.comment&&(x.comment?x.comment+=`
162
- `+k.comment:x.comment=k.comment);let j=new AG.Pair(x,N);if(r.options.keepSourceTokens&&(j.srcToken=A),a){let $=d;NG.mapIncludes(r,$.items,x)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(j)}else{let $=new gT.YAMLMap(r.schema);$.flow=!0,$.items.push(j);let G=(N??x).range;$.range=[x.range[0],G[1],G[2]],d.items.push($)}g=N?N.range[2]:k.end}}let y=a?"}":"]",[S,..._]=n.end,R=g;if(S?.source===y)R=S.offset+S.source.length;else{let P=l[0].toUpperCase()+l.substring(1),A=m?`${P} must end with a ${y}`:`${P} in block collection must be sufficiently indented and end with a ${y}`;i(g,m?"MISSING_CHAR":"BAD_INDENT",A),S&&S.source.length!==1&&_.unshift(S)}if(_.length>0){let P=$G.resolveEnd(_,R,r.options.strict,i);P.comment&&(d.comment?d.comment+=`
163
- `+P.comment:d.comment=P.comment),d.range=[n.offset,R,P.offset]}else d.range=[n.offset,R,R];return d}vT.resolveFlowCollection=DG});var wT=F(ST=>{"use strict";var FG=Je(),LG=Ft(),jG=Zs(),UG=Xs(),HG=dT(),BG=hT(),VG=bT();function f_(t,e,r,n,i,s){let a=r.type==="block-map"?HG.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?BG.resolveBlockSeq(t,e,r,n,s):VG.resolveFlowCollection(t,e,r,n,s),l=a.constructor;return i==="!"||i===l.tagName?(a.tag=l.tagName,a):(i&&(a.tag=i),a)}function WG(t,e,r,n,i){let s=n.tag,a=s?e.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(r.type==="block-seq"){let{anchor:y,newlineAfterProp:S}=n,_=y&&s?y.offset>s.offset?y:s:y??s;_&&(!S||S.offset<_.offset)&&i(_,"MISSING_CHAR","Missing newline after block sequence props")}let l=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===jG.YAMLMap.tagName&&l==="map"||a===UG.YAMLSeq.tagName&&l==="seq")return f_(t,e,r,i,a);let f=e.schema.tags.find(y=>y.tag===a&&y.collection===l);if(!f){let y=e.schema.knownTags[a];if(y?.collection===l)e.schema.tags.push(Object.assign({},y,{default:!1})),f=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),f_(t,e,r,i,a)}let d=f_(t,e,r,i,a,f),m=f.resolve?.(d,y=>i(s,"TAG_RESOLVE_FAILED",y),e.options)??d,g=FG.isNode(m)?m:new LG.Scalar(m);return g.range=d.range,g.tag=a,f?.format&&(g.format=f.format),g}ST.composeCollection=WG});var p_=F(_T=>{"use strict";var d_=Ft();function zG(t,e,r){let n=e.offset,i=JG(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?d_.Scalar.BLOCK_FOLDED:d_.Scalar.BLOCK_LITERAL,a=e.source?GG(e.source):[],l=a.length;for(let R=a.length-1;R>=0;--R){let P=a[R][1];if(P===""||P==="\r")l=R;else break}if(l===0){let R=i.chomp==="+"&&a.length>0?`
156
+ `}};nd.YAMLError=rd;nd.YAMLParseError=i_;nd.YAMLWarning=s_;nd.prettifyError=vG});var sd=F(nT=>{"use strict";function bG(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:l}){let f=!1,d=l,m=l,g="",y="",S=!1,_=!1,R=null,P=null,A=null,U=null,B=null,V=null,W=null;for(let x of t)switch(_&&(x.type!=="space"&&x.type!=="newline"&&x.type!=="comma"&&s(x.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),R&&(d&&x.type!=="comment"&&x.type!=="newline"&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),R=null),x.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&x.source.includes(" ")&&(R=x),m=!0;break;case"comment":{m||s(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let k=x.source.substring(1)||" ";g?g+=y+k:g=k,y="",d=!1;break}case"newline":d?g?g+=x.source:(!V||r!=="seq-item-ind")&&(f=!0):y+=x.source,d=!0,S=!0,(P||A)&&(U=x),m=!0;break;case"anchor":P&&s(x,"MULTIPLE_ANCHORS","A node can have at most one anchor"),x.source.endsWith(":")&&s(x.offset+x.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),P=x,W??(W=x.offset),d=!1,m=!1,_=!0;break;case"tag":{A&&s(x,"MULTIPLE_TAGS","A node can have at most one tag"),A=x,W??(W=x.offset),d=!1,m=!1,_=!0;break}case r:(P||A)&&s(x,"BAD_PROP_ORDER",`Anchors and tags must be after the ${x.source} indicator`),V&&s(x,"UNEXPECTED_TOKEN",`Unexpected ${x.source} in ${e??"collection"}`),V=x,d=r==="seq-item-ind"||r==="explicit-key-ind",m=!1;break;case"comma":if(e){B&&s(x,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),B=x,d=!1,m=!1;break}default:s(x,"UNEXPECTED_TOKEN",`Unexpected ${x.type} token`),d=!1,m=!1}let X=t[t.length-1],T=X?X.offset+X.source.length:i;return _&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),R&&(d&&R.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:B,found:V,spaceBefore:f,comment:g,hasNewline:S,anchor:P,tag:A,newlineAfterProp:U,end:T,start:W??T}}nT.resolveProps=bG});var Ym=F(iT=>{"use strict";function o_(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
157
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(o_(e.key)||o_(e.value))return!0}return!1;default:return!0}}iT.containsNewline=o_});var a_=F(sT=>{"use strict";var SG=Ym();function wG(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&SG.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}sT.flowIndentCheck=wG});var l_=F(aT=>{"use strict";var oT=Je();function _G(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||oT.isScalar(s)&&oT.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,r))}aT.mapIncludes=_G});var pT=F(dT=>{"use strict";var lT=Qs(),RG=Xs(),cT=sd(),xG=Ym(),uT=a_(),CG=l_(),fT="All mapping items must start at the same column";function EG({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??RG.YAMLMap,l=new a(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,d=null;for(let m of n.items){let{start:g,key:y,sep:S,value:_}=m,R=cT.resolveProps(g,{indicator:"explicit-key-ind",next:y??S?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),P=!R.found;if(P){if(y&&(y.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(f,"BAD_INDENT",fT)),!R.anchor&&!R.tag&&!S){d=R.end,R.comment&&(l.comment?l.comment+=`
158
+ `+R.comment:l.comment=R.comment);continue}(R.newlineAfterProp||xG.containsNewline(y))&&i(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else R.found?.indent!==n.indent&&i(f,"BAD_INDENT",fT);r.atKey=!0;let A=R.end,U=y?t(r,y,R,i):e(r,A,g,null,R,i);r.schema.compat&&uT.flowIndentCheck(n.indent,y,i),r.atKey=!1,CG.mapIncludes(r,l.items,U)&&i(A,"DUPLICATE_KEY","Map keys must be unique");let B=cT.resolveProps(S??[],{indicator:"map-value-ind",next:_,offset:U.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(f=B.end,B.found){P&&(_?.type==="block-map"&&!B.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&R.start<B.found.offset-1024&&i(U.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let V=_?t(r,_,B,i):e(r,f,S,null,B,i);r.schema.compat&&uT.flowIndentCheck(n.indent,_,i),f=V.range[2];let W=new lT.Pair(U,V);r.options.keepSourceTokens&&(W.srcToken=m),l.items.push(W)}else{P&&i(U.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),B.comment&&(U.comment?U.comment+=`
159
+ `+B.comment:U.comment=B.comment);let V=new lT.Pair(U);r.options.keepSourceTokens&&(V.srcToken=m),l.items.push(V)}}return d&&d<f&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,d??f],l}dT.resolveBlockMap=EG});var mT=F(hT=>{"use strict";var OG=eo(),IG=sd(),PG=a_();function kG({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??OG.YAMLSeq,l=new a(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,d=null;for(let{start:m,value:g}of n.items){let y=IG.resolveProps(m,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let S=g?t(r,g,y,i):e(r,y.end,m,null,y,i);r.schema.compat&&PG.flowIndentCheck(n.indent,g,i),f=S.range[2],l.items.push(S)}return l.range=[n.offset,f,d??f],l}hT.resolveBlockSeq=kG});var dc=F(gT=>{"use strict";function TG(t,e,r,n){let i="";if(t){let s=!1,a="";for(let l of t){let{source:f,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=f.substring(1)||" ";i?i+=a+m:i=m,a="";break}case"newline":i&&(a+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=f.length}}return{comment:i,offset:e}}gT.resolveEnd=TG});var ST=F(bT=>{"use strict";var AG=Je(),qG=Qs(),yT=Xs(),$G=eo(),MG=dc(),vT=sd(),NG=Ym(),DG=l_(),c_="Block collections are not allowed within flow collections",u_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function FG({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=n.start.source==="{",l=a?"flow map":"flow sequence",f=s?.nodeClass??(a?yT.YAMLMap:$G.YAMLSeq),d=new f(r.schema);d.flow=!0;let m=r.atRoot;m&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let g=n.offset+n.start.source.length;for(let P=0;P<n.items.length;++P){let A=n.items[P],{start:U,key:B,sep:V,value:W}=A,X=vT.resolveProps(U,{flow:l,indicator:"explicit-key-ind",next:B??V?.[0],offset:g,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!V&&!W){P===0&&X.comma?i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):P<n.items.length-1&&i(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),X.comment&&(d.comment?d.comment+=`
160
+ `+X.comment:d.comment=X.comment),g=X.end;continue}!a&&r.options.strict&&NG.containsNewline(B)&&i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(P===0)X.comma&&i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(X.comma||i(X.start,"MISSING_CHAR",`Missing , between ${l} items`),X.comment){let T="";e:for(let x of U)switch(x.type){case"comma":case"space":break;case"comment":T=x.source.substring(1);break e;default:break e}if(T){let x=d.items[d.items.length-1];AG.isPair(x)&&(x=x.value??x.key),x.comment?x.comment+=`
161
+ `+T:x.comment=T,X.comment=X.comment.substring(T.length+1)}}if(!a&&!V&&!X.found){let T=W?t(r,W,X,i):e(r,X.end,V,null,X,i);d.items.push(T),g=T.range[2],u_(W)&&i(T.range,"BLOCK_IN_FLOW",c_)}else{r.atKey=!0;let T=X.end,x=B?t(r,B,X,i):e(r,T,U,null,X,i);u_(B)&&i(x.range,"BLOCK_IN_FLOW",c_),r.atKey=!1;let k=vT.resolveProps(V??[],{flow:l,indicator:"map-value-ind",next:W,offset:x.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(k.found){if(!a&&!X.found&&r.options.strict){if(V)for(let $ of V){if($===k.found)break;if($.type==="newline"){i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<k.found.offset-1024&&i(k.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else W&&("source"in W&&W.source?.[0]===":"?i(W,"MISSING_CHAR",`Missing space after : in ${l}`):i(k.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let N=W?t(r,W,k,i):k.found?e(r,k.end,V,null,k,i):null;N?u_(W)&&i(N.range,"BLOCK_IN_FLOW",c_):k.comment&&(x.comment?x.comment+=`
162
+ `+k.comment:x.comment=k.comment);let j=new qG.Pair(x,N);if(r.options.keepSourceTokens&&(j.srcToken=A),a){let $=d;DG.mapIncludes(r,$.items,x)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(j)}else{let $=new yT.YAMLMap(r.schema);$.flow=!0,$.items.push(j);let G=(N??x).range;$.range=[x.range[0],G[1],G[2]],d.items.push($)}g=N?N.range[2]:k.end}}let y=a?"}":"]",[S,..._]=n.end,R=g;if(S?.source===y)R=S.offset+S.source.length;else{let P=l[0].toUpperCase()+l.substring(1),A=m?`${P} must end with a ${y}`:`${P} in block collection must be sufficiently indented and end with a ${y}`;i(g,m?"MISSING_CHAR":"BAD_INDENT",A),S&&S.source.length!==1&&_.unshift(S)}if(_.length>0){let P=MG.resolveEnd(_,R,r.options.strict,i);P.comment&&(d.comment?d.comment+=`
163
+ `+P.comment:d.comment=P.comment),d.range=[n.offset,R,P.offset]}else d.range=[n.offset,R,R];return d}bT.resolveFlowCollection=FG});var _T=F(wT=>{"use strict";var LG=Je(),jG=Ft(),UG=Xs(),HG=eo(),BG=pT(),VG=mT(),WG=ST();function f_(t,e,r,n,i,s){let a=r.type==="block-map"?BG.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?VG.resolveBlockSeq(t,e,r,n,s):WG.resolveFlowCollection(t,e,r,n,s),l=a.constructor;return i==="!"||i===l.tagName?(a.tag=l.tagName,a):(i&&(a.tag=i),a)}function zG(t,e,r,n,i){let s=n.tag,a=s?e.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(r.type==="block-seq"){let{anchor:y,newlineAfterProp:S}=n,_=y&&s?y.offset>s.offset?y:s:y??s;_&&(!S||S.offset<_.offset)&&i(_,"MISSING_CHAR","Missing newline after block sequence props")}let l=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===UG.YAMLMap.tagName&&l==="map"||a===HG.YAMLSeq.tagName&&l==="seq")return f_(t,e,r,i,a);let f=e.schema.tags.find(y=>y.tag===a&&y.collection===l);if(!f){let y=e.schema.knownTags[a];if(y?.collection===l)e.schema.tags.push(Object.assign({},y,{default:!1})),f=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),f_(t,e,r,i,a)}let d=f_(t,e,r,i,a,f),m=f.resolve?.(d,y=>i(s,"TAG_RESOLVE_FAILED",y),e.options)??d,g=LG.isNode(m)?m:new jG.Scalar(m);return g.range=d.range,g.tag=a,f?.format&&(g.format=f.format),g}wT.composeCollection=zG});var p_=F(RT=>{"use strict";var d_=Ft();function JG(t,e,r){let n=e.offset,i=GG(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?d_.Scalar.BLOCK_FOLDED:d_.Scalar.BLOCK_LITERAL,a=e.source?YG(e.source):[],l=a.length;for(let R=a.length-1;R>=0;--R){let P=a[R][1];if(P===""||P==="\r")l=R;else break}if(l===0){let R=i.chomp==="+"&&a.length>0?`
164
164
  `.repeat(Math.max(1,a.length-1)):"",P=n+i.length;return e.source&&(P+=e.source.length),{value:R,type:s,comment:i.comment,range:[n,P,P]}}let f=e.indent+i.indent,d=e.offset+i.length,m=0;for(let R=0;R<l;++R){let[P,A]=a[R];if(A===""||A==="\r")i.indent===0&&P.length>f&&(f=P.length);else{P.length<f&&r(d+P.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=P.length),m=R,f===0&&!t.atRoot&&r(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=P.length+A.length+1}for(let R=a.length-1;R>=l;--R)a[R][0].length>f&&(l=R+1);let g="",y="",S=!1;for(let R=0;R<m;++R)g+=a[R][0].slice(f)+`
165
165
  `;for(let R=m;R<l;++R){let[P,A]=a[R];d+=P.length+A.length+1;let U=A[A.length-1]==="\r";if(U&&(A=A.slice(0,-1)),A&&P.length<f){let V=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(d-A.length-(U?2:1),"BAD_INDENT",V),P=""}s===d_.Scalar.BLOCK_LITERAL?(g+=y+P.slice(f)+A,y=`
166
166
  `):P.length>f||A[0]===" "?(y===" "?y=`
@@ -175,114 +175,114 @@ ${d}
175
175
  `+a[R][0].slice(f);g[g.length-1]!==`
176
176
  `&&(g+=`
177
177
  `);break;default:g+=`
178
- `}let _=n+i.length+e.source.length;return{value:g,type:s,comment:i.comment,range:[n,_,_]}}function JG({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],a=0,l="",f=-1;for(let y=1;y<i.length;++y){let S=i[y];if(!l&&(S==="-"||S==="+"))l=S;else{let _=Number(S);!a&&_?a=_:f===-1&&(f=t+y)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let d=!1,m="",g=i.length;for(let y=1;y<e.length;++y){let S=e[y];switch(S.type){case"space":d=!0;case"newline":g+=S.source.length;break;case"comment":r&&!d&&n(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=S.source.length,m=S.source.substring(1);break;case"error":n(S,"UNEXPECTED_TOKEN",S.message),g+=S.source.length;break;default:{let _=`Unexpected token in block scalar header: ${S.type}`;n(S,"UNEXPECTED_TOKEN",_);let R=S.source;R&&typeof R=="string"&&(g+=R.length)}}}return{mode:s,indent:a,chomp:l,comment:m,length:g}}function GG(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}_T.resolveBlockScalar=zG});var m_=F(xT=>{"use strict";var h_=Ft(),YG=dc();function KG(t,e,r){let{offset:n,type:i,source:s,end:a}=t,l,f,d=(y,S,_)=>r(n+y,S,_);switch(i){case"scalar":l=h_.Scalar.PLAIN,f=QG(s,d);break;case"single-quoted-scalar":l=h_.Scalar.QUOTE_SINGLE,f=ZG(s,d);break;case"double-quoted-scalar":l=h_.Scalar.QUOTE_DOUBLE,f=XG(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let m=n+s.length,g=YG.resolveEnd(a,m,e,r);return{value:f,type:l,comment:g.comment,range:[n,m,g.offset]}}function QG(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),RT(t)}function ZG(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),RT(t.slice(1,-1)).replace(/''/g,"'")}function RT(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
178
+ `}let _=n+i.length+e.source.length;return{value:g,type:s,comment:i.comment,range:[n,_,_]}}function GG({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],a=0,l="",f=-1;for(let y=1;y<i.length;++y){let S=i[y];if(!l&&(S==="-"||S==="+"))l=S;else{let _=Number(S);!a&&_?a=_:f===-1&&(f=t+y)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let d=!1,m="",g=i.length;for(let y=1;y<e.length;++y){let S=e[y];switch(S.type){case"space":d=!0;case"newline":g+=S.source.length;break;case"comment":r&&!d&&n(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=S.source.length,m=S.source.substring(1);break;case"error":n(S,"UNEXPECTED_TOKEN",S.message),g+=S.source.length;break;default:{let _=`Unexpected token in block scalar header: ${S.type}`;n(S,"UNEXPECTED_TOKEN",_);let R=S.source;R&&typeof R=="string"&&(g+=R.length)}}}return{mode:s,indent:a,chomp:l,comment:m,length:g}}function YG(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}RT.resolveBlockScalar=JG});var m_=F(CT=>{"use strict";var h_=Ft(),KG=dc();function QG(t,e,r){let{offset:n,type:i,source:s,end:a}=t,l,f,d=(y,S,_)=>r(n+y,S,_);switch(i){case"scalar":l=h_.Scalar.PLAIN,f=ZG(s,d);break;case"single-quoted-scalar":l=h_.Scalar.QUOTE_SINGLE,f=XG(s,d);break;case"double-quoted-scalar":l=h_.Scalar.QUOTE_DOUBLE,f=eY(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let m=n+s.length,g=KG.resolveEnd(a,m,e,r);return{value:f,type:l,comment:g.comment,range:[n,m,g.offset]}}function ZG(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),xT(t)}function XG(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),xT(t.slice(1,-1)).replace(/''/g,"'")}function xT(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
179
179
  `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
180
180
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",a=e.lastIndex;for(r.lastIndex=a;n=r.exec(t);)n[1]===""?s===`
181
181
  `?i+=s:s=`
182
- `:(i+=s+n[1],s=" "),a=r.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+s+(n?.[1]??"")}function XG(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
182
+ `:(i+=s+n[1],s=" "),a=r.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+s+(n?.[1]??"")}function eY(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
183
183
  `))if(i===`
184
- `){let{fold:s,offset:a}=eY(t,n);r+=s,n=a}else if(i==="\\"){let s=t[++n],a=tY[s];if(a)r+=a;else if(s===`
184
+ `){let{fold:s,offset:a}=tY(t,n);r+=s,n=a}else if(i==="\\"){let s=t[++n],a=rY[s];if(a)r+=a;else if(s===`
185
185
  `)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
186
- `)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;r+=rY(t,n+1,l,e),n+=l}else{let l=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),r+=l}}else if(i===" "||i===" "){let s=n,a=t[n+1];for(;a===" "||a===" ";)a=t[++n+1];a!==`
186
+ `)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;r+=nY(t,n+1,l,e),n+=l}else{let l=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),r+=l}}else if(i===" "||i===" "){let s=n,a=t[n+1];for(;a===" "||a===" ";)a=t[++n+1];a!==`
187
187
  `&&!(a==="\r"&&t[n+2]===`
188
- `)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function eY(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
188
+ `)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function tY(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
189
189
  `||n==="\r")&&!(n==="\r"&&t[e+2]!==`
190
190
  `);)n===`
191
191
  `&&(r+=`
192
- `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var tY={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function rY(t,e,r,n){let i=t.substr(e,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}xT.resolveFlowScalar=KG});var OT=F(ET=>{"use strict";var Sa=Je(),CT=Ft(),nY=p_(),iY=m_();function sY(t,e,r,n){let{value:i,type:s,comment:a,range:l}=e.type==="block-scalar"?nY.resolveBlockScalar(t,e,n):iY.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,g=>n(r,"TAG_RESOLVE_FAILED",g)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[Sa.SCALAR]:f?d=oY(t.schema,i,f,r,n):e.type==="scalar"?d=aY(t,i,e,n):d=t.schema[Sa.SCALAR];let m;try{let g=d.resolve(i,y=>n(r??e,"TAG_RESOLVE_FAILED",y),t.options);m=Sa.isScalar(g)?g:new CT.Scalar(g)}catch(g){let y=g instanceof Error?g.message:String(g);n(r??e,"TAG_RESOLVE_FAILED",y),m=new CT.Scalar(i)}return m.range=l,m.source=i,s&&(m.type=s),f&&(m.tag=f),d.format&&(m.format=d.format),a&&(m.comment=a),m}function oY(t,e,r,n,i){if(r==="!")return t[Sa.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Sa.SCALAR])}function aY({atKey:t,directives:e,schema:r},n,i,s){let a=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[Sa.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[Sa.SCALAR];if(a.tag!==l.tag){let f=e.tagString(a.tag),d=e.tagString(l.tag),m=`Value may be parsed as either ${f} or ${d}`;s(i,"TAG_RESOLVE_FAILED",m,!0)}}return a}ET.composeScalar=sY});var PT=F(IT=>{"use strict";function lY(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}IT.emptyScalarPosition=lY});var AT=F(y_=>{"use strict";var cY=Ff(),uY=Je(),fY=wT(),kT=OT(),dY=dc(),pY=PT(),hY={composeNode:TT,composeEmptyNode:g_};function TT(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:a,anchor:l,tag:f}=r,d,m=!0;switch(e.type){case"alias":d=mY(t,e,n),(l||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=kT.composeScalar(t,e,f,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=fY.composeCollection(hY,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(g){let y=g instanceof Error?g.message:String(g);n(e,"RESOURCE_EXHAUSTION",y)}break;default:{let g=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",g),m=!1}}return d??(d=g_(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!uY.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?d.comment=a:d.commentBefore=a),t.options.keepSourceTokens&&m&&(d.srcToken=e),d}function g_(t,e,r,n,{spaceBefore:i,comment:s,anchor:a,tag:l,end:f},d){let m={type:"scalar",offset:pY.emptyScalarPosition(e,r,n),indent:-1,source:""},g=kT.composeScalar(t,m,l,d);return a&&(g.anchor=a.source.substring(1),g.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function mY({options:t},{offset:e,source:r,end:n},i){let s=new cY.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+r.length,l=dY.resolveEnd(n,a,t.strict,i);return s.range=[e,a,l.offset],l.comment&&(s.comment=l.comment),s}y_.composeEmptyNode=g_;y_.composeNode=TT});var MT=F($T=>{"use strict";var gY=ed(),qT=AT(),yY=dc(),vY=id();function bY(t,e,{offset:r,start:n,value:i,end:s},a){let l=Object.assign({_directives:e},t),f=new gY.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=vY.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&a(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?qT.composeNode(d,i,m,a):qT.composeEmptyNode(d,m.end,n,null,m,a);let g=f.contents.range[2],y=yY.resolveEnd(s,g,!1,a);return y.comment&&(f.comment=y.comment),f.range=[r,g,y.offset],f}$T.composeDoc=bY});var b_=F(FT=>{"use strict";var SY=it("process"),wY=iw(),_Y=ed(),sd=nd(),NT=Je(),RY=MT(),xY=dc();function od(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function DT(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
192
+ `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var rY={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function nY(t,e,r,n){let i=t.substr(e,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}CT.resolveFlowScalar=QG});var IT=F(OT=>{"use strict";var Sa=Je(),ET=Ft(),iY=p_(),sY=m_();function oY(t,e,r,n){let{value:i,type:s,comment:a,range:l}=e.type==="block-scalar"?iY.resolveBlockScalar(t,e,n):sY.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,g=>n(r,"TAG_RESOLVE_FAILED",g)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[Sa.SCALAR]:f?d=aY(t.schema,i,f,r,n):e.type==="scalar"?d=lY(t,i,e,n):d=t.schema[Sa.SCALAR];let m;try{let g=d.resolve(i,y=>n(r??e,"TAG_RESOLVE_FAILED",y),t.options);m=Sa.isScalar(g)?g:new ET.Scalar(g)}catch(g){let y=g instanceof Error?g.message:String(g);n(r??e,"TAG_RESOLVE_FAILED",y),m=new ET.Scalar(i)}return m.range=l,m.source=i,s&&(m.type=s),f&&(m.tag=f),d.format&&(m.format=d.format),a&&(m.comment=a),m}function aY(t,e,r,n,i){if(r==="!")return t[Sa.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Sa.SCALAR])}function lY({atKey:t,directives:e,schema:r},n,i,s){let a=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[Sa.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[Sa.SCALAR];if(a.tag!==l.tag){let f=e.tagString(a.tag),d=e.tagString(l.tag),m=`Value may be parsed as either ${f} or ${d}`;s(i,"TAG_RESOLVE_FAILED",m,!0)}}return a}OT.composeScalar=oY});var kT=F(PT=>{"use strict";function cY(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}PT.emptyScalarPosition=cY});var qT=F(y_=>{"use strict";var uY=Lf(),fY=Je(),dY=_T(),TT=IT(),pY=dc(),hY=kT(),mY={composeNode:AT,composeEmptyNode:g_};function AT(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:a,anchor:l,tag:f}=r,d,m=!0;switch(e.type){case"alias":d=gY(t,e,n),(l||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=TT.composeScalar(t,e,f,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=dY.composeCollection(mY,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(g){let y=g instanceof Error?g.message:String(g);n(e,"RESOURCE_EXHAUSTION",y)}break;default:{let g=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",g),m=!1}}return d??(d=g_(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!fY.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?d.comment=a:d.commentBefore=a),t.options.keepSourceTokens&&m&&(d.srcToken=e),d}function g_(t,e,r,n,{spaceBefore:i,comment:s,anchor:a,tag:l,end:f},d){let m={type:"scalar",offset:hY.emptyScalarPosition(e,r,n),indent:-1,source:""},g=TT.composeScalar(t,m,l,d);return a&&(g.anchor=a.source.substring(1),g.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function gY({options:t},{offset:e,source:r,end:n},i){let s=new uY.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+r.length,l=pY.resolveEnd(n,a,t.strict,i);return s.range=[e,a,l.offset],l.comment&&(s.comment=l.comment),s}y_.composeEmptyNode=g_;y_.composeNode=AT});var NT=F(MT=>{"use strict";var yY=td(),$T=qT(),vY=dc(),bY=sd();function SY(t,e,{offset:r,start:n,value:i,end:s},a){let l=Object.assign({_directives:e},t),f=new yY.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=bY.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&a(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?$T.composeNode(d,i,m,a):$T.composeEmptyNode(d,m.end,n,null,m,a);let g=f.contents.range[2],y=vY.resolveEnd(s,g,!1,a);return y.comment&&(f.comment=y.comment),f.range=[r,g,y.offset],f}MT.composeDoc=SY});var b_=F(LT=>{"use strict";var wY=it("process"),_Y=iw(),RY=td(),od=id(),DT=Je(),xY=NT(),CY=dc();function ad(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function FT(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
194
194
 
195
195
  `:`
196
- `)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var v_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let a=od(r);s?this.warnings.push(new sd.YAMLWarning(a,n,i)):this.errors.push(new sd.YAMLParseError(a,n,i))},this.directives=new wY.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=DT(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
197
- ${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(NT.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];NT.isPair(a)&&(a=a.key);let l=a.commentBefore;a.commentBefore=l?`${n}
196
+ `)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var v_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let a=ad(r);s?this.warnings.push(new od.YAMLWarning(a,n,i)):this.errors.push(new od.YAMLParseError(a,n,i))},this.directives=new _Y.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=FT(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
197
+ ${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(DT.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];DT.isPair(a)&&(a=a.key);let l=a.commentBefore;a.commentBefore=l?`${n}
198
198
  ${l}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n}
199
- ${a}`:n}}if(r){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:DT(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(SY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=od(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=RY.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new sd.YAMLParseError(od(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new sd.YAMLParseError(od(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=xY.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
200
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new sd.YAMLParseError(od(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new _Y.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};FT.Composer=v_});var UT=F(Ym=>{"use strict";var CY=p_(),EY=m_(),OY=nd(),LT=Bf();function IY(t,e=!0,r){if(t){let n=(i,s,a)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(l,s,a);else throw new OY.YAMLParseError([l,l+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return EY.resolveFlowScalar(t,e,n);case"block-scalar":return CY.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function PY(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,l=LT.stringifyString({type:a,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
199
+ ${a}`:n}}if(r){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:FT(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(wY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=ad(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=xY.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new od.YAMLParseError(ad(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new od.YAMLParseError(ad(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=CY.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
200
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new od.YAMLParseError(ad(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new RY.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};LT.Composer=v_});var HT=F(Km=>{"use strict";var EY=p_(),OY=m_(),IY=id(),jT=Vf();function PY(t,e=!0,r){if(t){let n=(i,s,a)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(l,s,a);else throw new IY.YAMLParseError([l,l+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return OY.resolveFlowScalar(t,e,n);case"block-scalar":return EY.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function kY(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,l=jT.stringifyString({type:a,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
201
201
  `}];switch(l[0]){case"|":case">":{let d=l.indexOf(`
202
202
  `),m=l.substring(0,d),g=l.substring(d+1)+`
203
- `,y=[{type:"block-scalar-header",offset:s,indent:n,source:m}];return jT(y,f)||y.push({type:"newline",offset:-1,indent:n,source:`
204
- `}),{type:"block-scalar",offset:s,indent:n,props:y,source:g}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:f};default:return{type:"scalar",offset:s,indent:n,source:l,end:f}}}function kY(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let f=LT.stringifyString({type:a,value:e},{implicitKey:i||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":TY(t,f);break;case'"':S_(t,f,"double-quoted-scalar");break;case"'":S_(t,f,"single-quoted-scalar");break;default:S_(t,f,"scalar")}}function TY(t,e){let r=e.indexOf(`
203
+ `,y=[{type:"block-scalar-header",offset:s,indent:n,source:m}];return UT(y,f)||y.push({type:"newline",offset:-1,indent:n,source:`
204
+ `}),{type:"block-scalar",offset:s,indent:n,props:y,source:g}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:f};default:return{type:"scalar",offset:s,indent:n,source:l,end:f}}}function TY(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let f=jT.stringifyString({type:a,value:e},{implicitKey:i||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":AY(t,f);break;case'"':S_(t,f,"double-quoted-scalar");break;case"'":S_(t,f,"single-quoted-scalar");break;default:S_(t,f,"scalar")}}function AY(t,e){let r=e.indexOf(`
205
205
  `),n=e.substring(0,r),i=e.substring(r+1)+`
206
- `;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:a,source:n}];jT(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:a,source:`
207
- `});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:l,source:i})}}function jT(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function S_(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
208
- `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Ym.createScalarToken=PY;Ym.resolveAsScalar=IY;Ym.setScalarValue=kY});var BT=F(HT=>{"use strict";var AY=t=>"type"in t?Qm(t):Km(t);function Qm(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Qm(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Km(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Km(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Km(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Km({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Qm(e)),r)for(let s of r)i+=s.source;return n&&(i+=Qm(n)),i}HT.stringify=AY});var JT=F(zT=>{"use strict";var w_=Symbol("break visit"),qY=Symbol("skip children"),VT=Symbol("remove item");function wa(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),WT(Object.freeze([]),t,e)}wa.BREAK=w_;wa.SKIP=qY;wa.REMOVE=VT;wa.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};wa.parentCollection=(t,e)=>{let r=wa.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function WT(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let l=WT(Object.freeze(t.concat([[i,a]])),s.items[a],r);if(typeof l=="number")a=l-1;else{if(l===w_)return w_;l===VT&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}zT.visit=wa});var Zm=F(Br=>{"use strict";var __=UT(),$Y=BT(),MY=JT(),R_="\uFEFF",x_="",C_="",E_="",NY=t=>!!t&&"items"in t,DY=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function FY(t){switch(t){case R_:return"<BOM>";case x_:return"<DOC>";case C_:return"<FLOW_END>";case E_:return"<SCALAR>";default:return JSON.stringify(t)}}function LY(t){switch(t){case R_:return"byte-order-mark";case x_:return"doc-mode";case C_:return"flow-error-end";case E_:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
206
+ `;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:a,source:n}];UT(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:a,source:`
207
+ `});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:l,source:i})}}function UT(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function S_(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
208
+ `};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Km.createScalarToken=kY;Km.resolveAsScalar=PY;Km.setScalarValue=TY});var VT=F(BT=>{"use strict";var qY=t=>"type"in t?Zm(t):Qm(t);function Zm(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Zm(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Qm(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Qm(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Qm(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Qm({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Zm(e)),r)for(let s of r)i+=s.source;return n&&(i+=Zm(n)),i}BT.stringify=qY});var GT=F(JT=>{"use strict";var w_=Symbol("break visit"),$Y=Symbol("skip children"),WT=Symbol("remove item");function wa(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),zT(Object.freeze([]),t,e)}wa.BREAK=w_;wa.SKIP=$Y;wa.REMOVE=WT;wa.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};wa.parentCollection=(t,e)=>{let r=wa.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function zT(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let l=zT(Object.freeze(t.concat([[i,a]])),s.items[a],r);if(typeof l=="number")a=l-1;else{if(l===w_)return w_;l===WT&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}JT.visit=wa});var Xm=F(Br=>{"use strict";var __=HT(),MY=VT(),NY=GT(),R_="\uFEFF",x_="",C_="",E_="",DY=t=>!!t&&"items"in t,FY=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function LY(t){switch(t){case R_:return"<BOM>";case x_:return"<DOC>";case C_:return"<FLOW_END>";case E_:return"<SCALAR>";default:return JSON.stringify(t)}}function jY(t){switch(t){case R_:return"byte-order-mark";case x_:return"doc-mode";case C_:return"flow-error-end";case E_:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
209
209
  `:case`\r
210
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Br.createScalarToken=__.createScalarToken;Br.resolveAsScalar=__.resolveAsScalar;Br.setScalarValue=__.setScalarValue;Br.stringify=$Y.stringify;Br.visit=MY.visit;Br.BOM=R_;Br.DOCUMENT=x_;Br.FLOW_END=C_;Br.SCALAR=E_;Br.isCollection=NY;Br.isScalar=DY;Br.prettyToken=FY;Br.tokenType=LY});var P_=F(YT=>{"use strict";var ad=Zm();function Xn(t){switch(t){case void 0:case" ":case`
211
- `:case"\r":case" ":return!0;default:return!1}}var GT=new Set("0123456789ABCDEFabcdef"),jY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xm=new Set(",[]{}"),UY=new Set(` ,[]{}
212
- \r `),O_=t=>!t||UY.has(t),I_=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
210
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Br.createScalarToken=__.createScalarToken;Br.resolveAsScalar=__.resolveAsScalar;Br.setScalarValue=__.setScalarValue;Br.stringify=MY.stringify;Br.visit=NY.visit;Br.BOM=R_;Br.DOCUMENT=x_;Br.FLOW_END=C_;Br.SCALAR=E_;Br.isCollection=DY;Br.isScalar=FY;Br.prettyToken=LY;Br.tokenType=jY});var P_=F(KT=>{"use strict";var ld=Xm();function Xn(t){switch(t){case void 0:case" ":case`
211
+ `:case"\r":case" ":return!0;default:return!1}}var YT=new Set("0123456789ABCDEFabcdef"),UY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),eg=new Set(",[]{}"),HY=new Set(` ,[]{}
212
+ \r `),O_=t=>!t||HY.has(t),I_=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
213
213
  `?!0:r==="\r"?this.buffer[e+1]===`
214
214
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
215
215
  `||!i&&!this.atEnd)return e+n+1}return r===`
216
216
  `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Xn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
217
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ad.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield ad.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Xn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Xn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Xn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(O_),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Xn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ad.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(O_),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Xn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
217
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ld.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield ld.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Xn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Xn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Xn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(O_),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Xn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ld.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(O_),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Xn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
218
218
  `,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
219
219
  `,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Xn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
220
220
  `:e=s,r=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
221
221
  `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
222
222
  `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
223
223
  `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let l=s;for(;a===" ";)a=this.buffer[--s];if(a===`
224
- `&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield ad.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Xn(s)||e&&Xm.has(s))break;r=n}else if(Xn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
224
+ `&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield ld.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Xn(s)||e&&eg.has(s))break;r=n}else if(Xn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
225
225
  `?(n+=1,i=`
226
- `,s=this.buffer[n+1]):r=n),s==="#"||e&&Xm.has(s))break;if(i===`
227
- `){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&Xm.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ad.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(O_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Xn(n)||r&&Xm.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Xn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(jY.has(r))r=this.buffer[++e];else if(r==="%"&&GT.has(this.buffer[e+1])&&GT.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
226
+ `,s=this.buffer[n+1]):r=n),s==="#"||e&&eg.has(s))break;if(i===`
227
+ `){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&eg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ld.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(O_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Xn(n)||r&&eg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Xn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(UY.has(r))r=this.buffer[++e];else if(r==="%"&&YT.has(this.buffer[e+1])&&YT.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
228
228
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
229
- `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};YT.Lexer=I_});var T_=F(KT=>{"use strict";var k_=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};KT.LineCounter=k_});var q_=F(t1=>{"use strict";var HY=it("process"),QT=Zm(),BY=P_();function eo(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function ZT(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function e1(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function eg(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function pc(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function tg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function XT(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!eo(e.start,"explicit-key-ind")&&!eo(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,e1(e.value)?e.value.end?tg(e.value.end,e.sep):e.value.end=e.sep:tg(e.start,e.sep),delete e.sep)}var A_=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new BY.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,HY.env.LOG_TOKENS&&console.log("|",QT.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=QT.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&XT(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&ZT(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{ZT(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=eg(this.peek(2)),n=pc(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
229
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};KT.Lexer=I_});var T_=F(QT=>{"use strict";var k_=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};QT.LineCounter=k_});var q_=F(r1=>{"use strict";var BY=it("process"),ZT=Xm(),VY=P_();function to(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function XT(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function t1(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tg(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function pc(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function rg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function e1(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!to(e.start,"explicit-key-ind")&&!to(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,t1(e.value)?e.value.end?rg(e.value.end,e.sep):e.value.end=e.sep:rg(e.start,e.sep),delete e.sep)}var A_=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new VY.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,BY.env.LOG_TOKENS&&console.log("|",ZT.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=ZT.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&e1(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&XT(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{XT(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=tg(this.peek(2)),n=pc(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
230
230
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
231
- `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){tg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let a=[];for(let l=0;l<r.sep.length;++l){let f=r.sep[l];switch(f.type){case"newline":a.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=r.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(eo(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(e1(r.key)&&!eo(r.sep,"newline")){let a=pc(r.start),l=r.key,f=r.sep;f.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(eo(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=pc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):eo(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(a):(Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!r.explicitKey&&r.sep&&!eo(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){tg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||eo(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=eg(n),s=pc(i);XT(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
231
+ `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){rg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let a=[];for(let l=0;l<r.sep.length;++l){let f=r.sep[l];switch(f.type){case"newline":a.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=r.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(to(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(t1(r.key)&&!to(r.sep,"newline")){let a=pc(r.start),l=r.key,f=r.sep;f.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(to(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=pc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):to(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(a):(Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!r.explicitKey&&r.sep&&!to(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){rg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||to(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=tg(n),s=pc(i);e1(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
232
232
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
233
- `,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=eg(e),n=pc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=eg(e),n=pc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};t1.Parser=A_});var o1=F(cd=>{"use strict";var r1=b_(),VY=ed(),ld=nd(),WY=yw(),zY=Je(),JY=T_(),n1=q_();function i1(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new JY.LineCounter||null,prettyErrors:e}}function GY(t,e={}){let{lineCounter:r,prettyErrors:n}=i1(e),i=new n1.Parser(r?.addNewLine),s=new r1.Composer(e),a=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of a)l.errors.forEach(ld.prettifyError(t,r)),l.warnings.forEach(ld.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function s1(t,e={}){let{lineCounter:r,prettyErrors:n}=i1(e),i=new n1.Parser(r?.addNewLine),s=new r1.Composer(e),a=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new ld.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(a.errors.forEach(ld.prettifyError(t,r)),a.warnings.forEach(ld.prettifyError(t,r))),a}function YY(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=s1(t,r);if(!i)return null;if(i.warnings.forEach(s=>WY.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function KY(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return zY.isDocument(t)&&!n?t.toString(r):new VY.Document(t,n,r).toString(r)}cd.parse=YY;cd.parseAllDocuments=GY;cd.parseDocument=s1;cd.stringify=KY});var M_=F(st=>{"use strict";var QY=b_(),ZY=ed(),XY=Xw(),$_=nd(),eK=Ff(),to=Je(),tK=Ks(),rK=Ft(),nK=Zs(),iK=Xs(),sK=Zm(),oK=P_(),aK=T_(),lK=q_(),rg=o1(),a1=$f();st.Composer=QY.Composer;st.Document=ZY.Document;st.Schema=XY.Schema;st.YAMLError=$_.YAMLError;st.YAMLParseError=$_.YAMLParseError;st.YAMLWarning=$_.YAMLWarning;st.Alias=eK.Alias;st.isAlias=to.isAlias;st.isCollection=to.isCollection;st.isDocument=to.isDocument;st.isMap=to.isMap;st.isNode=to.isNode;st.isPair=to.isPair;st.isScalar=to.isScalar;st.isSeq=to.isSeq;st.Pair=tK.Pair;st.Scalar=rK.Scalar;st.YAMLMap=nK.YAMLMap;st.YAMLSeq=iK.YAMLSeq;st.CST=sK;st.Lexer=oK.Lexer;st.LineCounter=aK.LineCounter;st.Parser=lK.Parser;st.parse=rg.parse;st.parseAllDocuments=rg.parseAllDocuments;st.parseDocument=rg.parseDocument;st.stringify=rg.stringify;st.visit=a1.visit;st.visitAsync=a1.visitAsync});var cK,uK,fK,dK,pK,hK,mK,ro,ng=se(()=>{"use strict";cK=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,uK=/^\d{4}-\d{2}-\d{2}$/,fK=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,dK=/^https?:\/\/[^\s]+$/,pK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,hK=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,mK=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,ro=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(cK.test(e))return"date-time";if(uK.test(e))return"date";if(fK.test(e))return"email";if(pK.test(e))return"uuid";if(dK.test(e))return"uri";if(hK.test(e))return"ipv4";if(mK.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(a)]);for(let g of l)s[g]&&a[g]?i.properties[g]=this.mergeSchemas(s[g],a[g]):s[g]?i.properties[g]={...s[g]}:i.properties[g]={...a[g]};let f=new Set(e.required||Object.keys(s)),d=new Set(r.required||Object.keys(a)),m=[...l].filter(g=>f.has(g)&&d.has(g));return m.length>0&&(i.required=m),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}}});var l1,gK,hc,N_=se(()=>{"use strict";l1=_b(M_());ng();gK=new Set(["content-type","authorization","accept","cookie","host","content-length"]),hc=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new ro}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:d,scheme:m,requirement:g}=f;s.set(d,m),i.security=[g]}}let a=new Set,l=new Set;if(await this.processItems(n.items,i,s,a,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[f,d]of s)i.components.securitySchemes[f]=d;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?l1.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,l,f){for(let d of e)if(d.type==="folder"){let m=d,g=a||m.name;i.add(g),m.items&&await this.processItems(m.items,r,n,i,s,g,l,f)}else{let m=d;await this.processRequest(m,r,n,i,s,a,l,f)}}async processRequest(e,r,n,i,s,a,l,f){let{path:d,hostVar:m}=this.normalizeUrl(e.url);m&&s.add(m);let g=(e.method||"GET").toLowerCase();r.paths[d]||(r.paths[d]={});let y={};y.operationId=this.generateOperationId(e,g,d,r),y.summary=this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(y.tags=[a]);let S=this.buildParameters(e);S.length>0&&(y.parameters=S);let _=await this.buildRequestBody(e,f);_&&(y.requestBody=_);let R=await this.buildResponses(e,l.id,f);y.responses=R;let P=this.buildOperationSecurity(e,l,n);P!==void 0&&(y.security=P);let A=r.paths[d][g];A?this.mergeOperation(A,y,e.name):r.paths[d][g]=y}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
234
-
235
- Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),l=this.getConstraintKind(s);if(a==="none"&&l==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(a===l)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(d=>JSON.stringify(d)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),d=this.buildVariantSchema(s);i.oneOf=[f,d]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let l=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+l.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||gK.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:l})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[g,y]of Object.entries(e.bodySchema.content)){let S={};y.schema&&(S.schema=y.schema),y.examples&&(S.examples=y.examples),y.encoding&&(S.encoding=y.encoding),i.content[g]=S}let m=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(m&&n.content){let g=this.tryParseBodyContent(n);g!==void 0&&i.content[m]&&(i.content[m].example=g)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,l=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let m=this.tryParseBodyContent(n);m!==void 0?(a=this.inferrer.inferFromValue(m),l=m):a={type:"string"}}else a={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let d={};return a&&(d.schema=a),l!==void 0&&(d.example=l),f&&(d.encoding=f),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let l={description:a.description||`Status ${s}`};if(a.content){l.content={};for(let[f,d]of Object.entries(a.content)){let m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),l.content[f]=m}}else if(a.schema){let f=a.contentType||"application/json",d={schema:a.schema};a.examples&&(d.examples=a.examples),l.content={[f]:d}}if(a.headers){l.headers={};for(let[f,d]of Object.entries(a.headers))l.headers[f]={...d.description&&{description:d.description},schema:d.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:l}=i;return n.set(s,a),[l]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,l]of Object.entries(s)){let f=l;if(f.responses){for(let[d,m]of Object.entries(f.responses))if(m.content)for(let g of Object.values(m.content))g.schema&&this.trackSchema(g.schema,`${a}${i}Response${d}`,r,n)}if(f.requestBody?.content)for(let d of Object.values(f.requestBody.content))d.schema&&this.trackSchema(d.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let l=this.sanitizeComponentName(s.name);e.components.schemas[l]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${l}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let l of Object.values(a.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let l of Object.values(a.requestBody.content))l.schema&&JSON.stringify(l.schema)===i&&(l.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let l=`{{${a}}}`,f=!1;for(let d of s){let m=this.envConfigService.resolveVariables(l,d);m&&m!==l&&!i.has(m)&&(r.push({url:m,description:d}),i.add(m),f=!0)}if(!f){let d=`{${a}}`;i.has(d)||(r.push({url:d,variables:{[a]:{default:""}}}),i.add(d))}}}}});var mc,D_=se(()=>{"use strict";mc=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let l=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;l.properties&&Object.assign(i.properties,l.properties),l.required&&(i.required=[...i.required||[],...l.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}}});var ig=F(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.getDeepKeys=gc.toJSON=void 0;var yK=["function","symbol","undefined"],vK=["constructor","prototype","__proto__"],bK=Object.getPrototypeOf({});function SK(){let t={},e=this;for(let r of c1(e))if(typeof r=="string"){let n=e[r],i=typeof n;yK.includes(i)||(t[r]=n)}return t}gc.toJSON=SK;function c1(t,e=[]){let r=[];for(;t&&t!==bK;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(vK))n.delete(i);return n}gc.getDeepKeys=c1});var F_=F(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.addInspectMethod=yc.format=void 0;var u1=it("util"),wK=ig(),f1=u1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");yc.format=u1.format;function _K(t){t[f1]=RK}yc.addInspectMethod=_K;function RK(){let t={},e=this;for(let r of wK.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[f1],t}});var h1=F(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.lazyJoinStacks=Ei.joinStacks=Ei.isWritableStack=Ei.isLazyStack=void 0;var xK=/\r?\n/,CK=/\bono[ @]/;function EK(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ei.isLazyStack=EK;function OK(t){return!!(!t||t.writable||typeof t.set=="function")}Ei.isWritableStack=OK;function d1(t,e){let r=p1(t.stack),n=e?e.stack:void 0;return r&&n?r+`
236
-
237
- `+n:r||n}Ei.joinStacks=d1;function IK(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return d1({stack:n},r)},enumerable:!1,configurable:!0}):PK(e,t)}Ei.lazyJoinStacks=IK;function p1(t){if(t){let e=t.split(xK),r;for(let n=0;n<e.length;n++){let i=e[n];if(CK.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
238
- `)}return t}function PK(t,e){Object.defineProperty(t,"stack",{get:()=>p1(e.get.apply(t)),enumerable:!1,configurable:!0})}});var y1=F(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});og.extendError=void 0;var m1=F_(),sg=h1(),g1=ig(),kK=["name","message","stack"];function TK(t,e,r){let n=t;return AK(n,e),e&&typeof e=="object"&&qK(n,e),n.toJSON=g1.toJSON,m1.addInspectMethod&&m1.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}og.extendError=TK;function AK(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");sg.isLazyStack(r)?sg.lazyJoinStacks(r,t,e):sg.isWritableStack(r)&&(t.stack=sg.joinStacks(t,e))}function qK(t,e){let r=g1.getDeepKeys(e,kK),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var v1=F(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.normalizeArgs=vc.normalizeOptions=void 0;var $K=F_();function MK(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?$K.format:typeof t.format=="function"?t.format:!1}}vc.normalizeOptions=MK;function NK(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
239
- `:"")+r.message),{originalError:r,props:n,message:s}}vc.normalizeArgs=NK});var j_=F(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.Ono=void 0;var ag=y1(),b1=v1(),DK=ig(),FK=L_;lg.Ono=FK;function L_(t,e){e=b1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=b1.normalizeArgs(n,e),l=new t(a);return ag.extendError(l,i,s)}return r[Symbol.species]=t,r}L_.toJSON=function(e){return DK.toJSON.call(e)};L_.extend=function(e,r,n){return n||r instanceof Error?ag.extendError(e,r,n):r?ag.extendError(e,void 0,r):ag.extendError(e)}});var S1=F(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.ono=void 0;var _a=j_(),LK=Oi;cg.ono=LK;Oi.error=new _a.Ono(Error);Oi.eval=new _a.Ono(EvalError);Oi.range=new _a.Ono(RangeError);Oi.reference=new _a.Ono(ReferenceError);Oi.syntax=new _a.Ono(SyntaxError);Oi.type=new _a.Ono(TypeError);Oi.uri=new _a.Ono(URIError);var jK=Oi;function Oi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(jK))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return Oi.error.apply(void 0,t)}});var _1=F(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});var Pee=it("util")});var no=F((ei,bc)=>{"use strict";var UK=ei&&ei.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HK=ei&&ei.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&UK(e,t,r)};Object.defineProperty(ei,"__esModule",{value:!0});ei.ono=void 0;var R1=S1();Object.defineProperty(ei,"ono",{enumerable:!0,get:function(){return R1.ono}});var BK=j_();Object.defineProperty(ei,"Ono",{enumerable:!0,get:function(){return BK.Ono}});HK(_1(),ei);ei.default=R1.ono;typeof bc=="object"&&typeof bc.exports=="object"&&(bc.exports=Object.assign(bc.exports.default,bc.exports))});var U_=F(ud=>{"use strict";var VK=ud&&ud.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ud,"__esModule",{value:!0});ud.default=WK;var x1=VK(it("path"));function WK(t){return t.startsWith("\\\\?\\")?t:t.split(x1.default?.win32?.sep).join(x1.default?.posix?.sep??"/")}});var C1=F(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.isWindows=void 0;var zK=/^win/.test(globalThis.process?globalThis.process.platform:""),JK=()=>zK;ug.isWindows=JK});var On=F(_t=>{"use strict";var GK=_t&&_t.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YK=_t&&_t.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),KK=_t&&_t.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&GK(r,e,n[i]);return YK(r,e),r}})(),QK=_t&&_t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_t,"__esModule",{value:!0});_t.parse=void 0;_t.resolve=E1;_t.cwd=O1;_t.getProtocol=z_;_t.getExtension=s6;_t.stripQuery=I1;_t.getHash=P1;_t.stripHash=V_;_t.isHttp=o6;_t.isFileSystemPath=W_;_t.fromFileSystemPath=a6;_t.toFileSystemPath=l6;_t.safePointerToPath=c6;_t.relative=u6;var dg=QK(U_()),B_=KK(it("path")),ZK=/\//g,XK=/^(\w{2,}):\/\//i,e6=/~1/g,t6=/~0/g,r6=it("path"),fg=C1(),n6=[[/\?/g,"%3F"],[/#/g,"%23"]],H_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],i6=t=>new URL(t);_t.parse=i6;function E1(t,e){let r=new URL((0,dg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,dg.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:l}=n;return s+a+l+i}return n.toString()+i}function O1(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function z_(t){let e=XK.exec(t||"");if(e)return e[1].toLowerCase()}function s6(t){let e=t.lastIndexOf(".");return e>=0?I1(t.substr(e).toLowerCase()):""}function I1(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function P1(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function V_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function o6(t){let e=z_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function W_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=z_(t);return e===void 0||e==="file"}function a6(t){if((0,fg.isWindows)()){let e=O1(),r=t.toUpperCase(),i=(0,dg.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),l=B_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||l)&&!e.startsWith("http")&&(t=(0,r6.join)(e,t)),t=(0,dg.default)(t)}t=encodeURI(t);for(let e of n6)t=t.replace(e[0],e[1]);return t}function l6(t,e){t=decodeURI(t);for(let n=0;n<H_.length;n+=2)t=t.replace(H_[n],H_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,fg.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,fg.isWindows)()?t:"/"+t)),(0,fg.isWindows)()&&!r&&(t=t.replace(ZK,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function c6(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(e6,"/").replace(t6,"~"))}function u6(t,e){if(!W_(t)||!W_(e))return E1(t,e);let r=B_.default.dirname(V_(t)),n=V_(e);return B_.default.relative(r,n)+P1(e)}});var In=F(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.InvalidPointerError=kt.TimeoutError=kt.MissingPointerError=kt.UnmatchedResolverError=kt.ResolverError=kt.UnmatchedParserError=kt.ParserError=kt.JSONParserErrorGroup=kt.JSONParserError=void 0;kt.isHandledError=f6;kt.normalizeError=d6;var k1=no(),pg=On(),ti=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,k1.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};kt.JSONParserError=ti;var hg=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,pg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,k1.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};kt.JSONParserErrorGroup=hg;var J_=class extends ti{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};kt.ParserError=J_;var G_=class extends ti{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};kt.UnmatchedParserError=G_;var Y_=class extends ti{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};kt.ResolverError=Y_;var K_=class extends ti{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};kt.UnmatchedResolverError=K_;var Q_=class extends ti{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,pg.getHash)(r)}". Token "${e}" does not exist.`,(0,pg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};kt.MissingPointerError=Q_;var Z_=class extends ti{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};kt.TimeoutError=Z_;var X_=class extends ti{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,pg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};kt.InvalidPointerError=X_;function f6(t){return t instanceof ti||t instanceof hg}function d6(t){return t.path===null&&(t.path=[]),t}});var fd=F(Vr=>{"use strict";var p6=Vr&&Vr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h6=Vr&&Vr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),m6=Vr&&Vr.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&p6(r,e,n[i]);return h6(r,e),r}})(),g6=Vr&&Vr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.nullSymbol=void 0;var eR=g6(Sc()),tR=m6(On()),gg=In();Vr.nullSymbol=Symbol("null");var y6=/\//g,v6=/~/g,b6=/~1/g,S6=/~0/g,w6=t=>{try{return decodeURIComponent(t)}catch{return t}},yg=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=A1(e);for(let a=0;a<i.length;a++){if(mg(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!q1(n)&&"$ref"in this.value)return this;let l=i[a];if(this.value[l]===void 0||this.value[l]===null&&a===i.length-1){let f=!1;for(let S=i.length-1;S>a;S--){let _=i.slice(a,S+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],a=S,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Vr.nullSymbol;continue}this.value=null;let d=this.$ref.path||"",m=this.path.replace(d,""),g=t.join("",s),y=n?.replace(d,"");throw new gg.MissingPointerError(l,decodeURI(this.originalPath),m,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&tR.resolve(this.path,this.value.$ref)!==n)&&mg(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=A1(e);for(let a=0;a<i.length-1;a++)mg(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=T1(this,s,{});return mg(this,n),s=i[i.length-1],T1(this,s,r),e}static parse(e,r){let n=tR.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=w6(i[s].replace(b6,"/").replace(S6,"~"));if(i[0]!=="")throw new gg.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(v6,"~0").replace(y6,"~1"))}return e}};function mg(t,e,r){if(eR.default.isAllowed$Ref(t.value,e)){let n=tR.resolve(t.path,t.value.$ref);if(n===t.path&&!q1(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,eR.default.isExtended$Ref(t.value)?(t.value=eR.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Vr.default=yg;function T1(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new gg.JSONParserError(`Error assigning $ref pointer "${t.path}".
240
- Cannot set "${e}" of a non-object.`);return r}function A1(t){if((0,gg.isHandledError)(t))throw t;return t}function q1(t){return typeof t=="string"&&yg.parse(t).length==0}});var Sc=F(is=>{"use strict";var _6=is&&is.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),R6=is&&is.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),x6=is&&is.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&_6(r,e,n[i]);return R6(r,e),r}})();Object.defineProperty(is,"__esModule",{value:!0});var vg=x6(fd()),bg=In(),rR=On(),nR=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(bg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,bg.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new vg.default(this,e,n);try{let a=s.resolve(this.value,r,i);return a.value===vg.nullSymbol&&(a.value=null),a}catch(a){if(!r||!r.continueOnError||!(0,bg.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,rR.safePointerToPath)((0,rR.getHash)(i))),a instanceof bg.InvalidPointerError&&(a.source=decodeURI((0,rR.stripHash)(i))),this.addError(a),null}}set(e,r){let n=new vg.default(this,e);this.value=n.set(this.value,r),this.value===vg.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};is.default=nR});var F1=F(ri=>{"use strict";var C6=ri&&ri.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E6=ri&&ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),O6=ri&&ri.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&C6(r,e,n[i]);return E6(r,e),r}})(),D1=ri&&ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ri,"__esModule",{value:!0});var $1=no(),I6=D1(Sc()),io=O6(On()),M1=D1(U_()),iR=class{paths(...e){return N1(this._$refs,e.flat()).map(n=>(0,M1.default)(n.decoded))}values(...e){let r=this._$refs;return N1(r,e.flat()).reduce((i,s)=>(i[(0,M1.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=io.resolve(this._root$Ref.path,e),i=io.stripHash(n),s=this._$refs[i];if(!s)throw(0,$1.ono)(`Error resolving $ref pointer "${e}".
241
- "${i}" not found.`);s.set(n,r)}_get$Ref(e){e=io.resolve(this._root$Ref.path,e);let r=io.stripHash(e);return this._$refs[r]}_add(e){let r=io.stripHash(e),n=new I6.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=io.resolve(this._root$Ref.path,e),s=io.stripHash(i),a=this._$refs[s];if(!a)throw(0,$1.ono)(`Error resolving $ref pointer "${e}".
242
- "${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};ri.default=iR;function N1(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?io.toFileSystemPath(n,!0):n}))}});var j1=F(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.all=P6;wc.filter=k6;wc.sort=T6;wc.run=A6;function P6(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function k6(t,e,r){return t.filter(n=>!!L1(n,e,r))}function T6(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function A6(t,e,r,n){let i,s,a=0;return new Promise((l,f)=>{d();function d(){if(i=t[a++],!i)return f(s);try{let S=L1(i,e,r,m,n);if(S&&typeof S.then=="function")S.then(g,y);else if(S!==void 0)g(S);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(S){y(S)}}function m(S,_){S?y(S):g(_)}function g(S){l({plugin:i,result:S})}function y(S){s={plugin:i,error:S},d()}})}function L1(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var oR=F(ss=>{"use strict";var q6=ss&&ss.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$6=ss&&ss.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U1=ss&&ss.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&q6(r,e,n[i]);return $6(r,e),r}})();Object.defineProperty(ss,"__esModule",{value:!0});var sR=no(),M6=U1(On()),so=U1(j1()),Ra=In();async function N6(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),a={url:t,hash:i,extension:M6.getExtension(t)};try{let l=await D6(a,r,e);s.pathType=l.plugin.name,a.data=l.result;let f=await F6(a,r,e);return s.value=f.result,f.result}catch(l){throw(0,Ra.isHandledError)(l)&&(s.value=l),l}}async function D6(t,e,r){let n=so.all(e.resolve);n=so.filter(n,"canRead",t),so.sort(n);try{return await so.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new Ra.UnmatchedResolverError(t.url):!i||!("error"in i)?sR.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof Ra.ResolverError?i.error:new Ra.ResolverError(i,t.url)}}async function F6(t,e,r){let n=so.all(e.parse),i=so.filter(n,"canParse",t),s=i.length>0?i:n;so.sort(s);try{let a=await so.run(s,"parse",t,r);if(!a.plugin.allowEmpty&&L6(a.result))throw sR.ono.syntax(`Error parsing "${t.url}" as ${a.plugin.name}.
243
- Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new Ra.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?sR.ono.syntax(`Unable to parse ${t.url}`):a.error instanceof Ra.ParserError?a.error:new Ra.ParserError(a.error.message,t.url)}}function L6(t){return t===void 0||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0||Buffer.isBuffer(t)&&t.length===0}ss.default=N6});var B1=F(aR=>{"use strict";Object.defineProperty(aR,"__esModule",{value:!0});var H1=In();aR.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(r){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new H1.ParserError(n.message,t.url)}throw new H1.ParserError(r.message,t.url)}}else return e}}});var _c=F((Uee,xa)=>{"use strict";function V1(t){return typeof t>"u"||t===null}function j6(t){return typeof t=="object"&&t!==null}function U6(t){return Array.isArray(t)?t:V1(t)?[]:[t]}function H6(t,e){if(e){let r=Object.keys(e);for(let n=0,i=r.length;n<i;n+=1){let s=r[n];t[s]=e[s]}}return t}function B6(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function V6(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}xa.exports.isNothing=V1;xa.exports.isObject=j6;xa.exports.toArray=U6;xa.exports.repeat=B6;xa.exports.isNegativeZero=V6;xa.exports.extend=H6});var Rc=F((Hee,z1)=>{"use strict";function W1(t,e){let r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
244
-
245
- `+t.mark.snippet),n+" "+r):n}function dd(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=W1(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}dd.prototype=Object.create(Error.prototype);dd.prototype.constructor=dd;dd.prototype.toString=function(e){return this.name+": "+W1(this,e)};z1.exports=dd});var G1=F((Bee,J1)=>{"use strict";var pd=_c();function lR(t,e,r,n,i){let s="",a="",l=Math.floor(i/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),r-n>l&&(a=" ...",r=n+l-a.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+a,pos:n-e+s.length}}function cR(t,e){return pd.repeat(" ",e-t.length)+t}function W6(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);let r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);let l="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(let g=1;g<=e.linesBefore&&!(a-g<0);g++){let y=lR(t.buffer,n[a-g],i[a-g],t.position-(n[a]-n[a-g]),d);l=pd.repeat(" ",e.indent)+cR((t.line-g+1).toString(),f)+" | "+y.str+`
246
- `+l}let m=lR(t.buffer,n[a],i[a],t.position,d);l+=pd.repeat(" ",e.indent)+cR((t.line+1).toString(),f)+" | "+m.str+`
247
- `,l+=pd.repeat("-",e.indent+f+3+m.pos)+`^
248
- `;for(let g=1;g<=e.linesAfter&&!(a+g>=i.length);g++){let y=lR(t.buffer,n[a+g],i[a+g],t.position-(n[a]-n[a+g]),d);l+=pd.repeat(" ",e.indent)+cR((t.line+g+1).toString(),f)+" | "+y.str+`
249
- `}return l.replace(/\n$/,"")}J1.exports=W6});var dr=F((Vee,K1)=>{"use strict";var Y1=Rc(),z6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],J6=["scalar","sequence","mapping"];function G6(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function Y6(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(z6.indexOf(r)===-1)throw new Y1('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=G6(e.styleAliases||null),J6.indexOf(this.kind)===-1)throw new Y1('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}K1.exports=Y6});var dR=F((Wee,Z1)=>{"use strict";var hd=Rc(),uR=dr();function Q1(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}function K6(){let t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(let r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(e);return t}function fR(t){return this.extend(t)}fR.prototype.extend=function(e){let r=[],n=[];if(e instanceof uR)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new hd("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof uR))throw new hd("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new hd("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new hd("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof uR))throw new hd("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(fR.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Q1(i,"implicit"),i.compiledExplicit=Q1(i,"explicit"),i.compiledTypeMap=K6(i.compiledImplicit,i.compiledExplicit),i};Z1.exports=fR});var pR=F((zee,X1)=>{"use strict";var Q6=dr();X1.exports=new Q6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var hR=F((Jee,eA)=>{"use strict";var Z6=dr();eA.exports=new Z6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var mR=F((Gee,tA)=>{"use strict";var X6=dr();tA.exports=new X6("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var gR=F((Yee,rA)=>{"use strict";var e4=dR();rA.exports=new e4({explicit:[pR(),hR(),mR()]})});var yR=F((Kee,nA)=>{"use strict";var t4=dr();function r4(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function n4(){return null}function i4(t){return t===null}nA.exports=new t4("tag:yaml.org,2002:null",{kind:"scalar",resolve:r4,construct:n4,predicate:i4,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var vR=F((Qee,iA)=>{"use strict";var s4=dr();function o4(t){if(t===null)return!1;let e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function a4(t){return t==="true"||t==="True"||t==="TRUE"}function l4(t){return Object.prototype.toString.call(t)==="[object Boolean]"}iA.exports=new s4("tag:yaml.org,2002:bool",{kind:"scalar",resolve:o4,construct:a4,predicate:l4,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var bR=F((Zee,sA)=>{"use strict";var c4=_c(),u4=dr();function f4(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function d4(t){return t>=48&&t<=55}function p4(t){return t>=48&&t<=57}function h4(t){if(t===null)return!1;let e=t.length,r=0,n=!1;if(!e)return!1;let i=t[r];if((i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++){if(i=t[r],i!=="0"&&i!=="1")return!1;n=!0}return n&&Number.isFinite(md(t))}if(i==="x"){for(r++;r<e;r++){if(!f4(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(md(t))}if(i==="o"){for(r++;r<e;r++){if(!d4(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(md(t))}}for(;r<e;r++){if(!p4(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(md(t)):!1}function md(t){let e=t,r=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function m4(t){return md(t)}function g4(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!c4.isNegativeZero(t)}sA.exports=new u4("tag:yaml.org,2002:int",{kind:"scalar",resolve:h4,construct:m4,predicate:g4,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var SR=F((Xee,aA)=>{"use strict";var oA=_c(),y4=dr(),v4=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),b4=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function S4(t){return t===null||!v4.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:b4.test(t)}function w4(t){let e=t.toLowerCase(),r=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var _4=/^[-+]?[0-9]+e/;function R4(t,e){if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(oA.isNegativeZero(t))return"-0.0";let r=t.toString(10);return _4.test(r)?r.replace("e",".e"):r}function x4(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||oA.isNegativeZero(t))}aA.exports=new y4("tag:yaml.org,2002:float",{kind:"scalar",resolve:S4,construct:w4,predicate:x4,represent:R4,defaultStyle:"lowercase"})});var wR=F((ete,lA)=>{"use strict";lA.exports=gR().extend({implicit:[yR(),vR(),bR(),SR()]})});var _R=F((tte,cA)=>{"use strict";cA.exports=wR()});var RR=F((rte,dA)=>{"use strict";var C4=dr(),uA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),fA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function E4(t){return t===null?!1:uA.exec(t)!==null||fA.exec(t)!==null}function O4(t){let e=0,r=null,n=uA.exec(t);if(n===null&&(n=fA.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,a=+n[3];if(!n[4])return new Date(Date.UTC(i,s,a));let l=+n[4],f=+n[5],d=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let g=+n[10],y=+(n[11]||0);r=(g*60+y)*6e4,n[9]==="-"&&(r=-r)}let m=new Date(Date.UTC(i,s,a,l,f,d,e));return r&&m.setTime(m.getTime()-r),m}function I4(t){return t.toISOString()}dA.exports=new C4("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:E4,construct:O4,instanceOf:Date,represent:I4})});var xR=F((nte,pA)=>{"use strict";var P4=dr();function k4(t){return t==="<<"||t===null}pA.exports=new P4("tag:yaml.org,2002:merge",{kind:"scalar",resolve:k4})});var ER=F((ite,hA)=>{"use strict";var T4=dr(),CR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
250
- \r`;function A4(t){if(t===null)return!1;let e=0,r=t.length,n=CR;for(let i=0;i<r;i++){let s=n.indexOf(t.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function q4(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=CR,i=0,s=[];for(let l=0;l<r;l++)l%4===0&&l&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(l));let a=r%4*6;return a===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):a===18?(s.push(i>>10&255),s.push(i>>2&255)):a===12&&s.push(i>>4&255),new Uint8Array(s)}function $4(t){let e="",r=0,n=t.length,i=CR;for(let a=0;a<n;a++)a%3===0&&a&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[a];let s=n%3;return s===0?(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]):s===2?(e+=i[r>>10&63],e+=i[r>>4&63],e+=i[r<<2&63],e+=i[64]):s===1&&(e+=i[r>>2&63],e+=i[r<<4&63],e+=i[64],e+=i[64]),e}function M4(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}hA.exports=new T4("tag:yaml.org,2002:binary",{kind:"scalar",resolve:A4,construct:q4,predicate:M4,represent:$4})});var OR=F((ste,mA)=>{"use strict";var N4=dr(),D4=Object.prototype.hasOwnProperty,F4=Object.prototype.toString;function L4(t){if(t===null)return!0;let e=[],r=t;for(let n=0,i=r.length;n<i;n+=1){let s=r[n],a=!1;if(F4.call(s)!=="[object Object]")return!1;let l;for(l in s)if(D4.call(s,l))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function j4(t){return t!==null?t:[]}mA.exports=new N4("tag:yaml.org,2002:omap",{kind:"sequence",resolve:L4,construct:j4})});var IR=F((ote,gA)=>{"use strict";var U4=dr(),H4=Object.prototype.toString;function B4(t){if(t===null)return!0;let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(H4.call(s)!=="[object Object]")return!1;let a=Object.keys(s);if(a.length!==1)return!1;r[n]=[a[0],s[a[0]]]}return!0}function V4(t){if(t===null)return[];let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],a=Object.keys(s);r[n]=[a[0],s[a[0]]]}return r}gA.exports=new U4("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:B4,construct:V4})});var PR=F((ate,yA)=>{"use strict";var W4=dr(),z4=Object.prototype.hasOwnProperty;function J4(t){if(t===null)return!0;let e=t;for(let r in e)if(z4.call(e,r)&&e[r]!==null)return!1;return!0}function G4(t){return t!==null?t:{}}yA.exports=new W4("tag:yaml.org,2002:set",{kind:"mapping",resolve:J4,construct:G4})});var Sg=F((lte,vA)=>{"use strict";vA.exports=_R().extend({implicit:[RR(),xR()],explicit:[ER(),OR(),IR(),PR()]})});var FA=F((cte,qR)=>{"use strict";var Ca=_c(),EA=Rc(),Y4=G1(),K4=Sg(),ni=Object.prototype.hasOwnProperty,wg=1,OA=2,IA=3,_g=4,kR=1,Q4=2,bA=3,Z4=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,X4=/[\x85\u2028\u2029]/,e3=/[,\[\]{}]/,PA=/^(?:!|!!|![0-9A-Za-z-]+!)$/,kA=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function SA(t){return Object.prototype.toString.call(t)}function Ii(t){return t===10||t===13}function os(t){return t===9||t===32}function Wr(t){return t===9||t===32||t===10||t===13}function xc(t){return t===44||t===91||t===93||t===123||t===125}function t3(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function r3(t){return t===120?2:t===117?4:t===85?8:0}function n3(t){return t>=48&&t<=57?t-48:-1}function wA(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
251
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function i3(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function TA(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var AA=new Array(256),qA=new Array(256);for(let t=0;t<256;t++)AA[t]=wA(t)?1:0,qA[t]=wA(t);function s3(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||K4,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function $A(t,e){let r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=Y4(r),new EA(e,r)}function fe(t,e){throw $A(t,e)}function Rg(t,e){t.onWarning&&t.onWarning.call(null,$A(t,e))}function Ea(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ni.call(i,e)||(i[e]={existed:ni.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function o3(t){t.anchorMapTransactions.push(Object.create(null))}function a3(t){let e=t.anchorMapTransactions.pop(),r=t.anchorMapTransactions;if(r.length===0)return;let n=r[r.length-1],i=Object.keys(e);for(let s=0,a=i.length;s<a;s+=1){let l=i[s];ni.call(n,l)||(n[l]=e[l])}}function l3(t){let e=t.anchorMapTransactions.pop(),r=Object.keys(e);for(let n=r.length-1;n>=0;n-=1){let i=e[r[n]];i.existed?t.anchorMap[r[n]]=i.value:delete t.anchorMap[r[n]]}}function MA(t){return{position:t.position,line:t.line,lineStart:t.lineStart,lineIndent:t.lineIndent,firstTabInLine:t.firstTabInLine,tag:t.tag,anchor:t.anchor,kind:t.kind,result:t.result}}function _A(t,e){t.position=e.position,t.line=e.line,t.lineStart=e.lineStart,t.lineIndent=e.lineIndent,t.firstTabInLine=e.firstTabInLine,t.tag=e.tag,t.anchor=e.anchor,t.kind=e.kind,t.result=e.result}var RA={YAML:function(e,r,n){e.version!==null&&fe(e,"duplication of %YAML directive"),n.length!==1&&fe(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&fe(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),a=parseInt(i[2],10);s!==1&&fe(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&Rg(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&fe(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],PA.test(s)||fe(e,"ill-formed tag handle (first argument) of the TAG directive"),ni.call(e.tagMap,s)&&fe(e,'there is a previously declared suffix for "'+s+'" tag handle'),kA.test(i)||fe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{fe(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function oo(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,a=i.length;s<a;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||fe(t,"expected valid JSON character")}else Z4.test(i)&&fe(t,"the stream contains non-printable characters");t.result+=i}}function xA(t,e,r,n){Ca.isObject(r)||fe(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,a=i.length;s<a;s+=1){let l=i[s];ni.call(e,l)||(TA(e,l,r[l]),n[l]=!0)}}function Cc(t,e,r,n,i,s,a,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let d=0,m=i.length;d<m;d+=1)Array.isArray(i[d])&&fe(t,"nested arrays are not supported inside keys"),typeof i=="object"&&SA(i[d])==="[object Object]"&&(i[d]="[object Object]")}if(typeof i=="object"&&SA(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s)){s.length>t.maxMergeSeqLength&&fe(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let d=new Set;for(let m=0,g=s.length;m<g;m+=1){let y=s[m];d.has(y)||(d.add(y),xA(t,e,y,r))}}else xA(t,e,s,r);else!t.json&&!ni.call(r,i)&&ni.call(e,i)&&(t.line=a||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,fe(t,"duplicated mapping key")),TA(e,i,s),delete r[i];return e}function TR(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):fe(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Lt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;os(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(Ii(i))for(TR(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&Rg(t,"deficient indentation"),n}function xg(t){let e=t.position,r=t.input.charCodeAt(e);return!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Wr(r)))}function AR(t,e){e===1?t.result+=" ":e>1&&(t.result+=Ca.repeat(`
252
- `,e-1))}function c3(t,e,r){let n,i,s,a,l,f,d=t.kind,m=t.result,g=t.input.charCodeAt(t.position);if(Wr(g)||xc(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96)return!1;if(g===63||g===45){let y=t.input.charCodeAt(t.position+1);if(Wr(y)||r&&xc(y))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;g!==0;){if(g===58){let y=t.input.charCodeAt(t.position+1);if(Wr(y)||r&&xc(y))break}else if(g===35){let y=t.input.charCodeAt(t.position-1);if(Wr(y))break}else{if(t.position===t.lineStart&&xg(t)||r&&xc(g))break;if(Ii(g))if(a=t.line,l=t.lineStart,f=t.lineIndent,Lt(t,!1,-1),t.lineIndent>=e){s=!0,g=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=a,t.lineStart=l,t.lineIndent=f;break}}s&&(oo(t,n,i,!1),AR(t,t.line-a),n=i=t.position,s=!1),os(g)||(i=t.position+1),g=t.input.charCodeAt(++t.position)}return oo(t,n,i,!1),t.result?!0:(t.kind=d,t.result=m,!1)}function u3(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(oo(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else Ii(i)?(oo(t,r,n,!0),AR(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&xg(t)?fe(t,"unexpected end of the document within a single quoted scalar"):(t.position++,os(i)||(n=t.position));fe(t,"unexpected end of the stream within a single quoted scalar")}function f3(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return oo(t,r,t.position,!0),t.position++,!0;if(s===92){if(oo(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ii(s))Lt(t,!1,e);else if(s<256&&AA[s])t.result+=qA[s],t.position++;else if((i=r3(s))>0){let a=i,l=0;for(;a>0;a--)s=t.input.charCodeAt(++t.position),(i=t3(s))>=0?l=(l<<4)+i:fe(t,"expected hexadecimal character");t.result+=i3(l),t.position++}else fe(t,"unknown escape sequence");r=n=t.position}else Ii(s)?(oo(t,r,n,!0),AR(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&xg(t)?fe(t,"unexpected end of the document within a double quoted scalar"):(t.position++,os(s)||(n=t.position))}fe(t,"unexpected end of the stream within a double quoted scalar")}function d3(t,e){let r=!0,n,i,s,a=t.tag,l,f=t.anchor,d,m,g,y,S=Object.create(null),_,R,P,A=t.input.charCodeAt(t.position);if(A===91)d=93,y=!1,l=[];else if(A===123)d=125,y=!0,l={};else return!1;for(t.anchor!==null&&Ea(t,t.anchor,l),A=t.input.charCodeAt(++t.position);A!==0;){if(Lt(t,!0,e),A=t.input.charCodeAt(t.position),A===d)return t.position++,t.tag=a,t.anchor=f,t.kind=y?"mapping":"sequence",t.result=l,!0;if(r?A===44&&fe(t,"expected the node content, but found ','"):fe(t,"missed comma between flow collection entries"),R=_=P=null,m=g=!1,A===63){let U=t.input.charCodeAt(t.position+1);Wr(U)&&(m=g=!0,t.position++,Lt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Ec(t,e,wg,!1,!0),R=t.tag,_=t.result,Lt(t,!0,e),A=t.input.charCodeAt(t.position),(g||t.line===n)&&A===58&&(m=!0,A=t.input.charCodeAt(++t.position),Lt(t,!0,e),Ec(t,e,wg,!1,!0),P=t.result),y?Cc(t,l,S,R,_,P,n,i,s):m?l.push(Cc(t,null,S,R,_,P,n,i,s)):l.push(_),Lt(t,!0,e),A=t.input.charCodeAt(t.position),A===44?(r=!0,A=t.input.charCodeAt(++t.position)):r=!1}fe(t,"unexpected end of the stream within a flow collection")}function p3(t,e){let r,n=kR,i=!1,s=!1,a=e,l=0,f=!1,d,m=t.input.charCodeAt(t.position);if(m===124)r=!1;else if(m===62)r=!0;else return!1;for(t.kind="scalar",t.result="";m!==0;)if(m=t.input.charCodeAt(++t.position),m===43||m===45)kR===n?n=m===43?bA:Q4:fe(t,"repeat of a chomping mode identifier");else if((d=n3(m))>=0)d===0?fe(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?fe(t,"repeat of an indentation width identifier"):(a=e+d-1,s=!0);else break;if(os(m)){do m=t.input.charCodeAt(++t.position);while(os(m));if(m===35)do m=t.input.charCodeAt(++t.position);while(!Ii(m)&&m!==0)}for(;m!==0;){for(TR(t),t.lineIndent=0,m=t.input.charCodeAt(t.position);(!s||t.lineIndent<a)&&m===32;)t.lineIndent++,m=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>a&&(a=t.lineIndent),Ii(m)){l++;continue}if(!s&&a===0&&fe(t,"missing indentation for block scalar"),t.lineIndent<a){n===bA?t.result+=Ca.repeat(`
233
+ `,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=tg(e),n=pc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=tg(e),n=pc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};r1.Parser=A_});var a1=F(ud=>{"use strict";var n1=b_(),WY=td(),cd=id(),zY=yw(),JY=Je(),GY=T_(),i1=q_();function s1(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new GY.LineCounter||null,prettyErrors:e}}function YY(t,e={}){let{lineCounter:r,prettyErrors:n}=s1(e),i=new i1.Parser(r?.addNewLine),s=new n1.Composer(e),a=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of a)l.errors.forEach(cd.prettifyError(t,r)),l.warnings.forEach(cd.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function o1(t,e={}){let{lineCounter:r,prettyErrors:n}=s1(e),i=new i1.Parser(r?.addNewLine),s=new n1.Composer(e),a=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new cd.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(a.errors.forEach(cd.prettifyError(t,r)),a.warnings.forEach(cd.prettifyError(t,r))),a}function KY(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=o1(t,r);if(!i)return null;if(i.warnings.forEach(s=>zY.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function QY(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return JY.isDocument(t)&&!n?t.toString(r):new WY.Document(t,n,r).toString(r)}ud.parse=KY;ud.parseAllDocuments=YY;ud.parseDocument=o1;ud.stringify=QY});var M_=F(st=>{"use strict";var ZY=b_(),XY=td(),eK=Xw(),$_=id(),tK=Lf(),ro=Je(),rK=Qs(),nK=Ft(),iK=Xs(),sK=eo(),oK=Xm(),aK=P_(),lK=T_(),cK=q_(),ng=a1(),l1=Mf();st.Composer=ZY.Composer;st.Document=XY.Document;st.Schema=eK.Schema;st.YAMLError=$_.YAMLError;st.YAMLParseError=$_.YAMLParseError;st.YAMLWarning=$_.YAMLWarning;st.Alias=tK.Alias;st.isAlias=ro.isAlias;st.isCollection=ro.isCollection;st.isDocument=ro.isDocument;st.isMap=ro.isMap;st.isNode=ro.isNode;st.isPair=ro.isPair;st.isScalar=ro.isScalar;st.isSeq=ro.isSeq;st.Pair=rK.Pair;st.Scalar=nK.Scalar;st.YAMLMap=iK.YAMLMap;st.YAMLSeq=sK.YAMLSeq;st.CST=oK;st.Lexer=aK.Lexer;st.LineCounter=lK.LineCounter;st.Parser=cK.Parser;st.parse=ng.parse;st.parseAllDocuments=ng.parseAllDocuments;st.parseDocument=ng.parseDocument;st.stringify=ng.stringify;st.visit=l1.visit;st.visitAsync=l1.visitAsync});var uK,fK,dK,pK,hK,mK,gK,no,ig=se(()=>{"use strict";uK=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,fK=/^\d{4}-\d{2}-\d{2}$/,dK=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,pK=/^https?:\/\/[^\s]+$/,hK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,mK=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,gK=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,no=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(uK.test(e))return"date-time";if(fK.test(e))return"date";if(dK.test(e))return"email";if(hK.test(e))return"uuid";if(pK.test(e))return"uri";if(mK.test(e))return"ipv4";if(gK.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(a)]);for(let g of l)s[g]&&a[g]?i.properties[g]=this.mergeSchemas(s[g],a[g]):s[g]?i.properties[g]={...s[g]}:i.properties[g]={...a[g]};let f=new Set(e.required||Object.keys(s)),d=new Set(r.required||Object.keys(a)),m=[...l].filter(g=>f.has(g)&&d.has(g));return m.length>0&&(i.required=m),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}}});var c1,yK,hc,N_=se(()=>{"use strict";c1=_b(M_());ig();yK=new Set(["content-type","authorization","accept","cookie","host","content-length"]),hc=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new no}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:d,scheme:m,requirement:g}=f;s.set(d,m),i.security=[g]}}let a=new Set,l=new Set;if(await this.processItems(n.items,i,s,a,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[f,d]of s)i.components.securitySchemes[f]=d;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?c1.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,l,f){for(let d of e)if(d.type==="folder"){let m=d,g=a||m.name;i.add(g),m.items&&await this.processItems(m.items,r,n,i,s,g,l,f)}else{let m=d;await this.processRequest(m,r,n,i,s,a,l,f)}}async processRequest(e,r,n,i,s,a,l,f){let{path:d,hostVar:m}=this.normalizeUrl(e.url);m&&s.add(m);let g=(e.method||"GET").toLowerCase();r.paths[d]||(r.paths[d]={});let y={};y.operationId=this.generateOperationId(e,g,d,r),y.summary=this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(y.tags=[a]);let S=this.buildParameters(e);S.length>0&&(y.parameters=S);let _=await this.buildRequestBody(e,f);_&&(y.requestBody=_);let R=await this.buildResponses(e,l.id,f);y.responses=R;let P=this.buildOperationSecurity(e,l,n);P!==void 0&&(y.security=P);let A=r.paths[d][g];A?this.mergeOperation(A,y,e.name):r.paths[d][g]=y}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
234
+
235
+ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),l=this.getConstraintKind(s);if(a==="none"&&l==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(a===l)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(d=>JSON.stringify(d)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),d=this.buildVariantSchema(s);i.oneOf=[f,d]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let l=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+l.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||yK.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:l})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[g,y]of Object.entries(e.bodySchema.content)){let S={};y.schema&&(S.schema=y.schema),y.examples&&(S.examples=y.examples),y.encoding&&(S.encoding=y.encoding),i.content[g]=S}let m=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(m&&n.content){let g=this.tryParseBodyContent(n);g!==void 0&&i.content[m]&&(i.content[m].example=g)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,l=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let m=this.tryParseBodyContent(n);m!==void 0?(a=this.inferrer.inferFromValue(m),l=m):a={type:"string"}}else a={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let d={};return a&&(d.schema=a),l!==void 0&&(d.example=l),f&&(d.encoding=f),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let l={description:a.description||`Status ${s}`};if(a.content){l.content={};for(let[f,d]of Object.entries(a.content)){let m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),l.content[f]=m}}else if(a.schema){let f=a.contentType||"application/json",d={schema:a.schema};a.examples&&(d.examples=a.examples),l.content={[f]:d}}if(a.headers){l.headers={};for(let[f,d]of Object.entries(a.headers))l.headers[f]={...d.description&&{description:d.description},schema:d.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:l}=i;return n.set(s,a),[l]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,l]of Object.entries(s)){let f=l;if(f.responses){for(let[d,m]of Object.entries(f.responses))if(m.content)for(let g of Object.values(m.content))g.schema&&this.trackSchema(g.schema,`${a}${i}Response${d}`,r,n)}if(f.requestBody?.content)for(let d of Object.values(f.requestBody.content))d.schema&&this.trackSchema(d.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let l=this.sanitizeComponentName(s.name);e.components.schemas[l]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${l}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let l of Object.values(a.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let l of Object.values(a.requestBody.content))l.schema&&JSON.stringify(l.schema)===i&&(l.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let l=`{{${a}}}`,f=!1;for(let d of s){let m=this.envConfigService.resolveVariables(l,d);m&&m!==l&&!i.has(m)&&(r.push({url:m,description:d}),i.add(m),f=!0)}if(!f){let d=`{${a}}`;i.has(d)||(r.push({url:d,variables:{[a]:{default:""}}}),i.add(d))}}}}});var mc,D_=se(()=>{"use strict";mc=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let l=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;l.properties&&Object.assign(i.properties,l.properties),l.required&&(i.required=[...i.required||[],...l.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}}});var sg=F(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.getDeepKeys=gc.toJSON=void 0;var vK=["function","symbol","undefined"],bK=["constructor","prototype","__proto__"],SK=Object.getPrototypeOf({});function wK(){let t={},e=this;for(let r of u1(e))if(typeof r=="string"){let n=e[r],i=typeof n;vK.includes(i)||(t[r]=n)}return t}gc.toJSON=wK;function u1(t,e=[]){let r=[];for(;t&&t!==SK;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(bK))n.delete(i);return n}gc.getDeepKeys=u1});var F_=F(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.addInspectMethod=yc.format=void 0;var f1=it("util"),_K=sg(),d1=f1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");yc.format=f1.format;function RK(t){t[d1]=xK}yc.addInspectMethod=RK;function xK(){let t={},e=this;for(let r of _K.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[d1],t}});var m1=F(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.lazyJoinStacks=Ei.joinStacks=Ei.isWritableStack=Ei.isLazyStack=void 0;var CK=/\r?\n/,EK=/\bono[ @]/;function OK(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ei.isLazyStack=OK;function IK(t){return!!(!t||t.writable||typeof t.set=="function")}Ei.isWritableStack=IK;function p1(t,e){let r=h1(t.stack),n=e?e.stack:void 0;return r&&n?r+`
236
+
237
+ `+n:r||n}Ei.joinStacks=p1;function PK(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return p1({stack:n},r)},enumerable:!1,configurable:!0}):kK(e,t)}Ei.lazyJoinStacks=PK;function h1(t){if(t){let e=t.split(CK),r;for(let n=0;n<e.length;n++){let i=e[n];if(EK.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
238
+ `)}return t}function kK(t,e){Object.defineProperty(t,"stack",{get:()=>h1(e.get.apply(t)),enumerable:!1,configurable:!0})}});var v1=F(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.extendError=void 0;var g1=F_(),og=m1(),y1=sg(),TK=["name","message","stack"];function AK(t,e,r){let n=t;return qK(n,e),e&&typeof e=="object"&&$K(n,e),n.toJSON=y1.toJSON,g1.addInspectMethod&&g1.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}ag.extendError=AK;function qK(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");og.isLazyStack(r)?og.lazyJoinStacks(r,t,e):og.isWritableStack(r)&&(t.stack=og.joinStacks(t,e))}function $K(t,e){let r=y1.getDeepKeys(e,TK),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var b1=F(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.normalizeArgs=vc.normalizeOptions=void 0;var MK=F_();function NK(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?MK.format:typeof t.format=="function"?t.format:!1}}vc.normalizeOptions=NK;function DK(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
239
+ `:"")+r.message),{originalError:r,props:n,message:s}}vc.normalizeArgs=DK});var j_=F(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.Ono=void 0;var lg=v1(),S1=b1(),FK=sg(),LK=L_;cg.Ono=LK;function L_(t,e){e=S1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=S1.normalizeArgs(n,e),l=new t(a);return lg.extendError(l,i,s)}return r[Symbol.species]=t,r}L_.toJSON=function(e){return FK.toJSON.call(e)};L_.extend=function(e,r,n){return n||r instanceof Error?lg.extendError(e,r,n):r?lg.extendError(e,void 0,r):lg.extendError(e)}});var w1=F(ug=>{"use strict";Object.defineProperty(ug,"__esModule",{value:!0});ug.ono=void 0;var _a=j_(),jK=Oi;ug.ono=jK;Oi.error=new _a.Ono(Error);Oi.eval=new _a.Ono(EvalError);Oi.range=new _a.Ono(RangeError);Oi.reference=new _a.Ono(ReferenceError);Oi.syntax=new _a.Ono(SyntaxError);Oi.type=new _a.Ono(TypeError);Oi.uri=new _a.Ono(URIError);var UK=Oi;function Oi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(UK))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return Oi.error.apply(void 0,t)}});var R1=F(_1=>{"use strict";Object.defineProperty(_1,"__esModule",{value:!0});var kee=it("util")});var io=F((ei,bc)=>{"use strict";var HK=ei&&ei.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BK=ei&&ei.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&HK(e,t,r)};Object.defineProperty(ei,"__esModule",{value:!0});ei.ono=void 0;var x1=w1();Object.defineProperty(ei,"ono",{enumerable:!0,get:function(){return x1.ono}});var VK=j_();Object.defineProperty(ei,"Ono",{enumerable:!0,get:function(){return VK.Ono}});BK(R1(),ei);ei.default=x1.ono;typeof bc=="object"&&typeof bc.exports=="object"&&(bc.exports=Object.assign(bc.exports.default,bc.exports))});var U_=F(fd=>{"use strict";var WK=fd&&fd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fd,"__esModule",{value:!0});fd.default=zK;var C1=WK(it("path"));function zK(t){return t.startsWith("\\\\?\\")?t:t.split(C1.default?.win32?.sep).join(C1.default?.posix?.sep??"/")}});var E1=F(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});fg.isWindows=void 0;var JK=/^win/.test(globalThis.process?globalThis.process.platform:""),GK=()=>JK;fg.isWindows=GK});var On=F(_t=>{"use strict";var YK=_t&&_t.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KK=_t&&_t.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QK=_t&&_t.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&YK(r,e,n[i]);return KK(r,e),r}})(),ZK=_t&&_t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_t,"__esModule",{value:!0});_t.parse=void 0;_t.resolve=O1;_t.cwd=I1;_t.getProtocol=z_;_t.getExtension=o6;_t.stripQuery=P1;_t.getHash=k1;_t.stripHash=V_;_t.isHttp=a6;_t.isFileSystemPath=W_;_t.fromFileSystemPath=l6;_t.toFileSystemPath=c6;_t.safePointerToPath=u6;_t.relative=f6;var pg=ZK(U_()),B_=QK(it("path")),XK=/\//g,e6=/^(\w{2,}):\/\//i,t6=/~1/g,r6=/~0/g,n6=it("path"),dg=E1(),i6=[[/\?/g,"%3F"],[/#/g,"%23"]],H_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],s6=t=>new URL(t);_t.parse=s6;function O1(t,e){let r=new URL((0,pg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,pg.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:l}=n;return s+a+l+i}return n.toString()+i}function I1(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function z_(t){let e=e6.exec(t||"");if(e)return e[1].toLowerCase()}function o6(t){let e=t.lastIndexOf(".");return e>=0?P1(t.substr(e).toLowerCase()):""}function P1(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function k1(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function V_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function a6(t){let e=z_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function W_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=z_(t);return e===void 0||e==="file"}function l6(t){if((0,dg.isWindows)()){let e=I1(),r=t.toUpperCase(),i=(0,pg.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),l=B_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||l)&&!e.startsWith("http")&&(t=(0,n6.join)(e,t)),t=(0,pg.default)(t)}t=encodeURI(t);for(let e of i6)t=t.replace(e[0],e[1]);return t}function c6(t,e){t=decodeURI(t);for(let n=0;n<H_.length;n+=2)t=t.replace(H_[n],H_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,dg.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,dg.isWindows)()?t:"/"+t)),(0,dg.isWindows)()&&!r&&(t=t.replace(XK,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function u6(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(t6,"/").replace(r6,"~"))}function f6(t,e){if(!W_(t)||!W_(e))return O1(t,e);let r=B_.default.dirname(V_(t)),n=V_(e);return B_.default.relative(r,n)+k1(e)}});var In=F(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.InvalidPointerError=kt.TimeoutError=kt.MissingPointerError=kt.UnmatchedResolverError=kt.ResolverError=kt.UnmatchedParserError=kt.ParserError=kt.JSONParserErrorGroup=kt.JSONParserError=void 0;kt.isHandledError=d6;kt.normalizeError=p6;var T1=io(),hg=On(),ti=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,T1.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};kt.JSONParserError=ti;var mg=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,hg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,T1.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};kt.JSONParserErrorGroup=mg;var J_=class extends ti{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};kt.ParserError=J_;var G_=class extends ti{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};kt.UnmatchedParserError=G_;var Y_=class extends ti{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};kt.ResolverError=Y_;var K_=class extends ti{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};kt.UnmatchedResolverError=K_;var Q_=class extends ti{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,hg.getHash)(r)}". Token "${e}" does not exist.`,(0,hg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};kt.MissingPointerError=Q_;var Z_=class extends ti{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};kt.TimeoutError=Z_;var X_=class extends ti{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,hg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};kt.InvalidPointerError=X_;function d6(t){return t instanceof ti||t instanceof mg}function p6(t){return t.path===null&&(t.path=[]),t}});var dd=F(Vr=>{"use strict";var h6=Vr&&Vr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m6=Vr&&Vr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),g6=Vr&&Vr.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&h6(r,e,n[i]);return m6(r,e),r}})(),y6=Vr&&Vr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.nullSymbol=void 0;var eR=y6(Sc()),tR=g6(On()),yg=In();Vr.nullSymbol=Symbol("null");var v6=/\//g,b6=/~/g,S6=/~1/g,w6=/~0/g,_6=t=>{try{return decodeURIComponent(t)}catch{return t}},vg=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=q1(e);for(let a=0;a<i.length;a++){if(gg(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!$1(n)&&"$ref"in this.value)return this;let l=i[a];if(this.value[l]===void 0||this.value[l]===null&&a===i.length-1){let f=!1;for(let S=i.length-1;S>a;S--){let _=i.slice(a,S+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],a=S,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Vr.nullSymbol;continue}this.value=null;let d=this.$ref.path||"",m=this.path.replace(d,""),g=t.join("",s),y=n?.replace(d,"");throw new yg.MissingPointerError(l,decodeURI(this.originalPath),m,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&tR.resolve(this.path,this.value.$ref)!==n)&&gg(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=q1(e);for(let a=0;a<i.length-1;a++)gg(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=A1(this,s,{});return gg(this,n),s=i[i.length-1],A1(this,s,r),e}static parse(e,r){let n=tR.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=_6(i[s].replace(S6,"/").replace(w6,"~"));if(i[0]!=="")throw new yg.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(b6,"~0").replace(v6,"~1"))}return e}};function gg(t,e,r){if(eR.default.isAllowed$Ref(t.value,e)){let n=tR.resolve(t.path,t.value.$ref);if(n===t.path&&!$1(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,eR.default.isExtended$Ref(t.value)?(t.value=eR.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Vr.default=vg;function A1(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new yg.JSONParserError(`Error assigning $ref pointer "${t.path}".
240
+ Cannot set "${e}" of a non-object.`);return r}function q1(t){if((0,yg.isHandledError)(t))throw t;return t}function $1(t){return typeof t=="string"&&vg.parse(t).length==0}});var Sc=F(is=>{"use strict";var R6=is&&is.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x6=is&&is.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C6=is&&is.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&R6(r,e,n[i]);return x6(r,e),r}})();Object.defineProperty(is,"__esModule",{value:!0});var bg=C6(dd()),Sg=In(),rR=On(),nR=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(Sg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,Sg.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new bg.default(this,e,n);try{let a=s.resolve(this.value,r,i);return a.value===bg.nullSymbol&&(a.value=null),a}catch(a){if(!r||!r.continueOnError||!(0,Sg.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,rR.safePointerToPath)((0,rR.getHash)(i))),a instanceof Sg.InvalidPointerError&&(a.source=decodeURI((0,rR.stripHash)(i))),this.addError(a),null}}set(e,r){let n=new bg.default(this,e);this.value=n.set(this.value,r),this.value===bg.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};is.default=nR});var L1=F(ri=>{"use strict";var E6=ri&&ri.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),O6=ri&&ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I6=ri&&ri.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&E6(r,e,n[i]);return O6(r,e),r}})(),F1=ri&&ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ri,"__esModule",{value:!0});var M1=io(),P6=F1(Sc()),so=I6(On()),N1=F1(U_()),iR=class{paths(...e){return D1(this._$refs,e.flat()).map(n=>(0,N1.default)(n.decoded))}values(...e){let r=this._$refs;return D1(r,e.flat()).reduce((i,s)=>(i[(0,N1.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=so.resolve(this._root$Ref.path,e),i=so.stripHash(n),s=this._$refs[i];if(!s)throw(0,M1.ono)(`Error resolving $ref pointer "${e}".
241
+ "${i}" not found.`);s.set(n,r)}_get$Ref(e){e=so.resolve(this._root$Ref.path,e);let r=so.stripHash(e);return this._$refs[r]}_add(e){let r=so.stripHash(e),n=new P6.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=so.resolve(this._root$Ref.path,e),s=so.stripHash(i),a=this._$refs[s];if(!a)throw(0,M1.ono)(`Error resolving $ref pointer "${e}".
242
+ "${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};ri.default=iR;function D1(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?so.toFileSystemPath(n,!0):n}))}});var U1=F(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.all=k6;wc.filter=T6;wc.sort=A6;wc.run=q6;function k6(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function T6(t,e,r){return t.filter(n=>!!j1(n,e,r))}function A6(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function q6(t,e,r,n){let i,s,a=0;return new Promise((l,f)=>{d();function d(){if(i=t[a++],!i)return f(s);try{let S=j1(i,e,r,m,n);if(S&&typeof S.then=="function")S.then(g,y);else if(S!==void 0)g(S);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(S){y(S)}}function m(S,_){S?y(S):g(_)}function g(S){l({plugin:i,result:S})}function y(S){s={plugin:i,error:S},d()}})}function j1(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var oR=F(ss=>{"use strict";var $6=ss&&ss.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M6=ss&&ss.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),H1=ss&&ss.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&$6(r,e,n[i]);return M6(r,e),r}})();Object.defineProperty(ss,"__esModule",{value:!0});var sR=io(),N6=H1(On()),oo=H1(U1()),Ra=In();async function D6(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),a={url:t,hash:i,extension:N6.getExtension(t)};try{let l=await F6(a,r,e);s.pathType=l.plugin.name,a.data=l.result;let f=await L6(a,r,e);return s.value=f.result,f.result}catch(l){throw(0,Ra.isHandledError)(l)&&(s.value=l),l}}async function F6(t,e,r){let n=oo.all(e.resolve);n=oo.filter(n,"canRead",t),oo.sort(n);try{return await oo.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new Ra.UnmatchedResolverError(t.url):!i||!("error"in i)?sR.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof Ra.ResolverError?i.error:new Ra.ResolverError(i,t.url)}}async function L6(t,e,r){let n=oo.all(e.parse),i=oo.filter(n,"canParse",t),s=i.length>0?i:n;oo.sort(s);try{let a=await oo.run(s,"parse",t,r);if(!a.plugin.allowEmpty&&j6(a.result))throw sR.ono.syntax(`Error parsing "${t.url}" as ${a.plugin.name}.
243
+ Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new Ra.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?sR.ono.syntax(`Unable to parse ${t.url}`):a.error instanceof Ra.ParserError?a.error:new Ra.ParserError(a.error.message,t.url)}}function j6(t){return t===void 0||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0||Buffer.isBuffer(t)&&t.length===0}ss.default=D6});var V1=F(aR=>{"use strict";Object.defineProperty(aR,"__esModule",{value:!0});var B1=In();aR.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(r){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new B1.ParserError(n.message,t.url)}throw new B1.ParserError(r.message,t.url)}}else return e}}});var _c=F((Hee,xa)=>{"use strict";function W1(t){return typeof t>"u"||t===null}function U6(t){return typeof t=="object"&&t!==null}function H6(t){return Array.isArray(t)?t:W1(t)?[]:[t]}function B6(t,e){if(e){let r=Object.keys(e);for(let n=0,i=r.length;n<i;n+=1){let s=r[n];t[s]=e[s]}}return t}function V6(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function W6(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}xa.exports.isNothing=W1;xa.exports.isObject=U6;xa.exports.toArray=H6;xa.exports.repeat=V6;xa.exports.isNegativeZero=W6;xa.exports.extend=B6});var Rc=F((Bee,J1)=>{"use strict";function z1(t,e){let r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
244
+
245
+ `+t.mark.snippet),n+" "+r):n}function pd(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=z1(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}pd.prototype=Object.create(Error.prototype);pd.prototype.constructor=pd;pd.prototype.toString=function(e){return this.name+": "+z1(this,e)};J1.exports=pd});var Y1=F((Vee,G1)=>{"use strict";var hd=_c();function lR(t,e,r,n,i){let s="",a="",l=Math.floor(i/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),r-n>l&&(a=" ...",r=n+l-a.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+a,pos:n-e+s.length}}function cR(t,e){return hd.repeat(" ",e-t.length)+t}function z6(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);let r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);let l="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(let g=1;g<=e.linesBefore&&!(a-g<0);g++){let y=lR(t.buffer,n[a-g],i[a-g],t.position-(n[a]-n[a-g]),d);l=hd.repeat(" ",e.indent)+cR((t.line-g+1).toString(),f)+" | "+y.str+`
246
+ `+l}let m=lR(t.buffer,n[a],i[a],t.position,d);l+=hd.repeat(" ",e.indent)+cR((t.line+1).toString(),f)+" | "+m.str+`
247
+ `,l+=hd.repeat("-",e.indent+f+3+m.pos)+`^
248
+ `;for(let g=1;g<=e.linesAfter&&!(a+g>=i.length);g++){let y=lR(t.buffer,n[a+g],i[a+g],t.position-(n[a]-n[a+g]),d);l+=hd.repeat(" ",e.indent)+cR((t.line+g+1).toString(),f)+" | "+y.str+`
249
+ `}return l.replace(/\n$/,"")}G1.exports=z6});var dr=F((Wee,Q1)=>{"use strict";var K1=Rc(),J6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],G6=["scalar","sequence","mapping"];function Y6(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function K6(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(J6.indexOf(r)===-1)throw new K1('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=Y6(e.styleAliases||null),G6.indexOf(this.kind)===-1)throw new K1('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}Q1.exports=K6});var dR=F((zee,X1)=>{"use strict";var md=Rc(),uR=dr();function Z1(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}function Q6(){let t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(let r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(e);return t}function fR(t){return this.extend(t)}fR.prototype.extend=function(e){let r=[],n=[];if(e instanceof uR)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new md("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof uR))throw new md("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new md("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new md("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof uR))throw new md("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(fR.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Z1(i,"implicit"),i.compiledExplicit=Z1(i,"explicit"),i.compiledTypeMap=Q6(i.compiledImplicit,i.compiledExplicit),i};X1.exports=fR});var pR=F((Jee,eA)=>{"use strict";var Z6=dr();eA.exports=new Z6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var hR=F((Gee,tA)=>{"use strict";var X6=dr();tA.exports=new X6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var mR=F((Yee,rA)=>{"use strict";var e4=dr();rA.exports=new e4("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var gR=F((Kee,nA)=>{"use strict";var t4=dR();nA.exports=new t4({explicit:[pR(),hR(),mR()]})});var yR=F((Qee,iA)=>{"use strict";var r4=dr();function n4(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function i4(){return null}function s4(t){return t===null}iA.exports=new r4("tag:yaml.org,2002:null",{kind:"scalar",resolve:n4,construct:i4,predicate:s4,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var vR=F((Zee,sA)=>{"use strict";var o4=dr();function a4(t){if(t===null)return!1;let e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function l4(t){return t==="true"||t==="True"||t==="TRUE"}function c4(t){return Object.prototype.toString.call(t)==="[object Boolean]"}sA.exports=new o4("tag:yaml.org,2002:bool",{kind:"scalar",resolve:a4,construct:l4,predicate:c4,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var bR=F((Xee,oA)=>{"use strict";var u4=_c(),f4=dr();function d4(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function p4(t){return t>=48&&t<=55}function h4(t){return t>=48&&t<=57}function m4(t){if(t===null)return!1;let e=t.length,r=0,n=!1;if(!e)return!1;let i=t[r];if((i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++){if(i=t[r],i!=="0"&&i!=="1")return!1;n=!0}return n&&Number.isFinite(gd(t))}if(i==="x"){for(r++;r<e;r++){if(!d4(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(gd(t))}if(i==="o"){for(r++;r<e;r++){if(!p4(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(gd(t))}}for(;r<e;r++){if(!h4(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(gd(t)):!1}function gd(t){let e=t,r=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function g4(t){return gd(t)}function y4(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!u4.isNegativeZero(t)}oA.exports=new f4("tag:yaml.org,2002:int",{kind:"scalar",resolve:m4,construct:g4,predicate:y4,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var SR=F((ete,lA)=>{"use strict";var aA=_c(),v4=dr(),b4=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),S4=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function w4(t){return t===null||!b4.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:S4.test(t)}function _4(t){let e=t.toLowerCase(),r=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var R4=/^[-+]?[0-9]+e/;function x4(t,e){if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(aA.isNegativeZero(t))return"-0.0";let r=t.toString(10);return R4.test(r)?r.replace("e",".e"):r}function C4(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||aA.isNegativeZero(t))}lA.exports=new v4("tag:yaml.org,2002:float",{kind:"scalar",resolve:w4,construct:_4,predicate:C4,represent:x4,defaultStyle:"lowercase"})});var wR=F((tte,cA)=>{"use strict";cA.exports=gR().extend({implicit:[yR(),vR(),bR(),SR()]})});var _R=F((rte,uA)=>{"use strict";uA.exports=wR()});var RR=F((nte,pA)=>{"use strict";var E4=dr(),fA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),dA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function O4(t){return t===null?!1:fA.exec(t)!==null||dA.exec(t)!==null}function I4(t){let e=0,r=null,n=fA.exec(t);if(n===null&&(n=dA.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,a=+n[3];if(!n[4])return new Date(Date.UTC(i,s,a));let l=+n[4],f=+n[5],d=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let g=+n[10],y=+(n[11]||0);r=(g*60+y)*6e4,n[9]==="-"&&(r=-r)}let m=new Date(Date.UTC(i,s,a,l,f,d,e));return r&&m.setTime(m.getTime()-r),m}function P4(t){return t.toISOString()}pA.exports=new E4("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:O4,construct:I4,instanceOf:Date,represent:P4})});var xR=F((ite,hA)=>{"use strict";var k4=dr();function T4(t){return t==="<<"||t===null}hA.exports=new k4("tag:yaml.org,2002:merge",{kind:"scalar",resolve:T4})});var ER=F((ste,mA)=>{"use strict";var A4=dr(),CR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
250
+ \r`;function q4(t){if(t===null)return!1;let e=0,r=t.length,n=CR;for(let i=0;i<r;i++){let s=n.indexOf(t.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function $4(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=CR,i=0,s=[];for(let l=0;l<r;l++)l%4===0&&l&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(l));let a=r%4*6;return a===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):a===18?(s.push(i>>10&255),s.push(i>>2&255)):a===12&&s.push(i>>4&255),new Uint8Array(s)}function M4(t){let e="",r=0,n=t.length,i=CR;for(let a=0;a<n;a++)a%3===0&&a&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[a];let s=n%3;return s===0?(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]):s===2?(e+=i[r>>10&63],e+=i[r>>4&63],e+=i[r<<2&63],e+=i[64]):s===1&&(e+=i[r>>2&63],e+=i[r<<4&63],e+=i[64],e+=i[64]),e}function N4(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}mA.exports=new A4("tag:yaml.org,2002:binary",{kind:"scalar",resolve:q4,construct:$4,predicate:N4,represent:M4})});var OR=F((ote,gA)=>{"use strict";var D4=dr(),F4=Object.prototype.hasOwnProperty,L4=Object.prototype.toString;function j4(t){if(t===null)return!0;let e=[],r=t;for(let n=0,i=r.length;n<i;n+=1){let s=r[n],a=!1;if(L4.call(s)!=="[object Object]")return!1;let l;for(l in s)if(F4.call(s,l))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function U4(t){return t!==null?t:[]}gA.exports=new D4("tag:yaml.org,2002:omap",{kind:"sequence",resolve:j4,construct:U4})});var IR=F((ate,yA)=>{"use strict";var H4=dr(),B4=Object.prototype.toString;function V4(t){if(t===null)return!0;let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(B4.call(s)!=="[object Object]")return!1;let a=Object.keys(s);if(a.length!==1)return!1;r[n]=[a[0],s[a[0]]]}return!0}function W4(t){if(t===null)return[];let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],a=Object.keys(s);r[n]=[a[0],s[a[0]]]}return r}yA.exports=new H4("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:V4,construct:W4})});var PR=F((lte,vA)=>{"use strict";var z4=dr(),J4=Object.prototype.hasOwnProperty;function G4(t){if(t===null)return!0;let e=t;for(let r in e)if(J4.call(e,r)&&e[r]!==null)return!1;return!0}function Y4(t){return t!==null?t:{}}vA.exports=new z4("tag:yaml.org,2002:set",{kind:"mapping",resolve:G4,construct:Y4})});var wg=F((cte,bA)=>{"use strict";bA.exports=_R().extend({implicit:[RR(),xR()],explicit:[ER(),OR(),IR(),PR()]})});var LA=F((ute,qR)=>{"use strict";var Ca=_c(),OA=Rc(),K4=Y1(),Q4=wg(),ni=Object.prototype.hasOwnProperty,_g=1,IA=2,PA=3,Rg=4,kR=1,Z4=2,SA=3,X4=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,e3=/[\x85\u2028\u2029]/,t3=/[,\[\]{}]/,kA=/^(?:!|!!|![0-9A-Za-z-]+!)$/,TA=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function wA(t){return Object.prototype.toString.call(t)}function Ii(t){return t===10||t===13}function os(t){return t===9||t===32}function Wr(t){return t===9||t===32||t===10||t===13}function xc(t){return t===44||t===91||t===93||t===123||t===125}function r3(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function n3(t){return t===120?2:t===117?4:t===85?8:0}function i3(t){return t>=48&&t<=57?t-48:-1}function _A(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
251
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function s3(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function AA(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var qA=new Array(256),$A=new Array(256);for(let t=0;t<256;t++)qA[t]=_A(t)?1:0,$A[t]=_A(t);function o3(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Q4,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function MA(t,e){let r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=K4(r),new OA(e,r)}function fe(t,e){throw MA(t,e)}function xg(t,e){t.onWarning&&t.onWarning.call(null,MA(t,e))}function Ea(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ni.call(i,e)||(i[e]={existed:ni.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function a3(t){t.anchorMapTransactions.push(Object.create(null))}function l3(t){let e=t.anchorMapTransactions.pop(),r=t.anchorMapTransactions;if(r.length===0)return;let n=r[r.length-1],i=Object.keys(e);for(let s=0,a=i.length;s<a;s+=1){let l=i[s];ni.call(n,l)||(n[l]=e[l])}}function c3(t){let e=t.anchorMapTransactions.pop(),r=Object.keys(e);for(let n=r.length-1;n>=0;n-=1){let i=e[r[n]];i.existed?t.anchorMap[r[n]]=i.value:delete t.anchorMap[r[n]]}}function NA(t){return{position:t.position,line:t.line,lineStart:t.lineStart,lineIndent:t.lineIndent,firstTabInLine:t.firstTabInLine,tag:t.tag,anchor:t.anchor,kind:t.kind,result:t.result}}function RA(t,e){t.position=e.position,t.line=e.line,t.lineStart=e.lineStart,t.lineIndent=e.lineIndent,t.firstTabInLine=e.firstTabInLine,t.tag=e.tag,t.anchor=e.anchor,t.kind=e.kind,t.result=e.result}var xA={YAML:function(e,r,n){e.version!==null&&fe(e,"duplication of %YAML directive"),n.length!==1&&fe(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&fe(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),a=parseInt(i[2],10);s!==1&&fe(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&xg(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&fe(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],kA.test(s)||fe(e,"ill-formed tag handle (first argument) of the TAG directive"),ni.call(e.tagMap,s)&&fe(e,'there is a previously declared suffix for "'+s+'" tag handle'),TA.test(i)||fe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{fe(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function ao(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,a=i.length;s<a;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||fe(t,"expected valid JSON character")}else X4.test(i)&&fe(t,"the stream contains non-printable characters");t.result+=i}}function CA(t,e,r,n){Ca.isObject(r)||fe(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,a=i.length;s<a;s+=1){let l=i[s];ni.call(e,l)||(AA(e,l,r[l]),n[l]=!0)}}function Cc(t,e,r,n,i,s,a,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let d=0,m=i.length;d<m;d+=1)Array.isArray(i[d])&&fe(t,"nested arrays are not supported inside keys"),typeof i=="object"&&wA(i[d])==="[object Object]"&&(i[d]="[object Object]")}if(typeof i=="object"&&wA(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s)){s.length>t.maxMergeSeqLength&&fe(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let d=new Set;for(let m=0,g=s.length;m<g;m+=1){let y=s[m];d.has(y)||(d.add(y),CA(t,e,y,r))}}else CA(t,e,s,r);else!t.json&&!ni.call(r,i)&&ni.call(e,i)&&(t.line=a||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,fe(t,"duplicated mapping key")),AA(e,i,s),delete r[i];return e}function TR(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):fe(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Lt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;os(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(Ii(i))for(TR(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&xg(t,"deficient indentation"),n}function Cg(t){let e=t.position,r=t.input.charCodeAt(e);return!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Wr(r)))}function AR(t,e){e===1?t.result+=" ":e>1&&(t.result+=Ca.repeat(`
252
+ `,e-1))}function u3(t,e,r){let n,i,s,a,l,f,d=t.kind,m=t.result,g=t.input.charCodeAt(t.position);if(Wr(g)||xc(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96)return!1;if(g===63||g===45){let y=t.input.charCodeAt(t.position+1);if(Wr(y)||r&&xc(y))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;g!==0;){if(g===58){let y=t.input.charCodeAt(t.position+1);if(Wr(y)||r&&xc(y))break}else if(g===35){let y=t.input.charCodeAt(t.position-1);if(Wr(y))break}else{if(t.position===t.lineStart&&Cg(t)||r&&xc(g))break;if(Ii(g))if(a=t.line,l=t.lineStart,f=t.lineIndent,Lt(t,!1,-1),t.lineIndent>=e){s=!0,g=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=a,t.lineStart=l,t.lineIndent=f;break}}s&&(ao(t,n,i,!1),AR(t,t.line-a),n=i=t.position,s=!1),os(g)||(i=t.position+1),g=t.input.charCodeAt(++t.position)}return ao(t,n,i,!1),t.result?!0:(t.kind=d,t.result=m,!1)}function f3(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(ao(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else Ii(i)?(ao(t,r,n,!0),AR(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Cg(t)?fe(t,"unexpected end of the document within a single quoted scalar"):(t.position++,os(i)||(n=t.position));fe(t,"unexpected end of the stream within a single quoted scalar")}function d3(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return ao(t,r,t.position,!0),t.position++,!0;if(s===92){if(ao(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ii(s))Lt(t,!1,e);else if(s<256&&qA[s])t.result+=$A[s],t.position++;else if((i=n3(s))>0){let a=i,l=0;for(;a>0;a--)s=t.input.charCodeAt(++t.position),(i=r3(s))>=0?l=(l<<4)+i:fe(t,"expected hexadecimal character");t.result+=s3(l),t.position++}else fe(t,"unknown escape sequence");r=n=t.position}else Ii(s)?(ao(t,r,n,!0),AR(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Cg(t)?fe(t,"unexpected end of the document within a double quoted scalar"):(t.position++,os(s)||(n=t.position))}fe(t,"unexpected end of the stream within a double quoted scalar")}function p3(t,e){let r=!0,n,i,s,a=t.tag,l,f=t.anchor,d,m,g,y,S=Object.create(null),_,R,P,A=t.input.charCodeAt(t.position);if(A===91)d=93,y=!1,l=[];else if(A===123)d=125,y=!0,l={};else return!1;for(t.anchor!==null&&Ea(t,t.anchor,l),A=t.input.charCodeAt(++t.position);A!==0;){if(Lt(t,!0,e),A=t.input.charCodeAt(t.position),A===d)return t.position++,t.tag=a,t.anchor=f,t.kind=y?"mapping":"sequence",t.result=l,!0;if(r?A===44&&fe(t,"expected the node content, but found ','"):fe(t,"missed comma between flow collection entries"),R=_=P=null,m=g=!1,A===63){let U=t.input.charCodeAt(t.position+1);Wr(U)&&(m=g=!0,t.position++,Lt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Ec(t,e,_g,!1,!0),R=t.tag,_=t.result,Lt(t,!0,e),A=t.input.charCodeAt(t.position),(g||t.line===n)&&A===58&&(m=!0,A=t.input.charCodeAt(++t.position),Lt(t,!0,e),Ec(t,e,_g,!1,!0),P=t.result),y?Cc(t,l,S,R,_,P,n,i,s):m?l.push(Cc(t,null,S,R,_,P,n,i,s)):l.push(_),Lt(t,!0,e),A=t.input.charCodeAt(t.position),A===44?(r=!0,A=t.input.charCodeAt(++t.position)):r=!1}fe(t,"unexpected end of the stream within a flow collection")}function h3(t,e){let r,n=kR,i=!1,s=!1,a=e,l=0,f=!1,d,m=t.input.charCodeAt(t.position);if(m===124)r=!1;else if(m===62)r=!0;else return!1;for(t.kind="scalar",t.result="";m!==0;)if(m=t.input.charCodeAt(++t.position),m===43||m===45)kR===n?n=m===43?SA:Z4:fe(t,"repeat of a chomping mode identifier");else if((d=i3(m))>=0)d===0?fe(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?fe(t,"repeat of an indentation width identifier"):(a=e+d-1,s=!0);else break;if(os(m)){do m=t.input.charCodeAt(++t.position);while(os(m));if(m===35)do m=t.input.charCodeAt(++t.position);while(!Ii(m)&&m!==0)}for(;m!==0;){for(TR(t),t.lineIndent=0,m=t.input.charCodeAt(t.position);(!s||t.lineIndent<a)&&m===32;)t.lineIndent++,m=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>a&&(a=t.lineIndent),Ii(m)){l++;continue}if(!s&&a===0&&fe(t,"missing indentation for block scalar"),t.lineIndent<a){n===SA?t.result+=Ca.repeat(`
253
253
  `,i?1+l:l):n===kR&&i&&(t.result+=`
254
254
  `);break}r?os(m)?(f=!0,t.result+=Ca.repeat(`
255
255
  `,i?1+l:l)):f?(f=!1,t.result+=Ca.repeat(`
256
256
  `,l+1)):l===0?i&&(t.result+=" "):t.result+=Ca.repeat(`
257
257
  `,l):t.result+=Ca.repeat(`
258
- `,i?1+l:l),i=!0,s=!0,l=0;let g=t.position;for(;!Ii(m)&&m!==0;)m=t.input.charCodeAt(++t.position);oo(t,g,t.position,!1)}return!0}function CA(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ea(t,t.anchor,i);let a=t.input.charCodeAt(t.position);for(;a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,fe(t,"tab characters must not be used in indentation")),a===45);){let l=t.input.charCodeAt(t.position+1);if(!Wr(l))break;if(s=!0,t.position++,Lt(t,!0,-1)&&t.lineIndent<=e){i.push(null),a=t.input.charCodeAt(t.position);continue}let f=t.line;if(Ec(t,e,IA,!1,!0),i.push(t.result),Lt(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&a!==0)fe(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=r,t.anchor=n,t.kind="sequence",t.result=i,!0):!1}function NA(t,e,r){let n,i,s,a,l=t.tag,f=t.anchor,d={},m=Object.create(null),g=null,y=null,S=null,_=!1,R=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ea(t,t.anchor,d);let P=t.input.charCodeAt(t.position);for(;P!==0;){!_&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,fe(t,"tab characters must not be used in indentation"));let A=t.input.charCodeAt(t.position+1),U=t.line;if((P===63||P===58)&&Wr(A))P===63?(_&&(Cc(t,d,m,g,y,null,i,s,a),g=y=S=null),R=!0,_=!0,n=!0):_?(_=!1,n=!0):fe(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,P=A;else{if(i=t.line,s=t.lineStart,a=t.position,!Ec(t,r,OA,!1,!0))break;if(t.line===U){for(P=t.input.charCodeAt(t.position);os(P);)P=t.input.charCodeAt(++t.position);if(P===58)P=t.input.charCodeAt(++t.position),Wr(P)||fe(t,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(Cc(t,d,m,g,y,null,i,s,a),g=y=S=null),R=!0,_=!1,n=!1,g=t.tag,y=t.result;else if(R)fe(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(R)fe(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=f,!0}if((t.line===U||t.lineIndent>e)&&(_&&(i=t.line,s=t.lineStart,a=t.position),Ec(t,e,_g,!0,n)&&(_?y=t.result:S=t.result),_||(Cc(t,d,m,g,y,S,i,s,a),g=y=S=null),Lt(t,!0,-1),P=t.input.charCodeAt(t.position)),(t.line===U||t.lineIndent>e)&&P!==0)fe(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return _&&Cc(t,d,m,g,y,null,i,s,a),R&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=d),R}function h3(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&fe(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(e=!0,s=t.input.charCodeAt(++t.position)):s===33?(r=!0,n="!!",s=t.input.charCodeAt(++t.position)):n="!";let a=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(a,t.position),s=t.input.charCodeAt(++t.position)):fe(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Wr(s);)s===33&&(r?fe(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(a-1,t.position+1),PA.test(n)||fe(t,"named tag handle cannot contain such characters"),r=!0,a=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(a,t.position),e3.test(i)&&fe(t,"tag suffix cannot contain flow indicator characters")}i&&!kA.test(i)&&fe(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{fe(t,"tag name is malformed: "+i)}return e?t.tag=i:ni.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:fe(t,'undeclared tag handle "'+n+'"'),!0}function m3(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&fe(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Wr(e)&&!xc(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&fe(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function g3(t){let e=t.input.charCodeAt(t.position);if(e!==42)return!1;e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Wr(e)&&!xc(e);)e=t.input.charCodeAt(++t.position);t.position===r&&fe(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ni.call(t.anchorMap,n)||fe(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Lt(t,!0,-1),!0}function y3(t,e,r,n){let i=MA(t);return o3(t),_A(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,NA(t,r,n)&&t.kind==="mapping"?(a3(t),!0):(l3(t),_A(t,i),!1)}function Ec(t,e,r,n,i){let s,a,l=1,f=!1,d=!1,m=null,g,y,S;t.depth>=t.maxDepth&&fe(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let _=s=a=_g===r||IA===r;if(n&&Lt(t,!0,-1)&&(f=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let R=t.input.charCodeAt(t.position),P=MA(t);if(f&&(R===33&&t.tag!==null||R===38&&t.anchor!==null)||!h3(t)&&!m3(t))break;m===null&&(m=P),Lt(t,!0,-1)?(f=!0,a=_,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):a=!1}if(a&&(a=f||i),l===1||_g===r)if(wg===r||OA===r?y=e:y=e+1,S=t.position-t.lineStart,l===1)if(a&&(CA(t,S)||NA(t,S,y))||d3(t,y))d=!0;else{let R=t.input.charCodeAt(t.position);m!==null&&_&&!a&&R!==124&&R!==62&&y3(t,m,m.position-m.lineStart,y)||s&&p3(t,y)||u3(t,y)||f3(t,y)?d=!0:g3(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&fe(t,"alias node should not have any properties")):c3(t,y,wg===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&Ea(t,t.anchor,t.result)}else l===0&&(d=a&&CA(t,S));if(t.tag===null)t.anchor!==null&&Ea(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&fe(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let R=0,P=t.implicitTypes.length;R<P;R+=1)if(g=t.implicitTypes[R],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&Ea(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ni.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else{g=null;let R=t.typeMap.multi[t.kind||"fallback"];for(let P=0,A=R.length;P<A;P+=1)if(t.tag.slice(0,R[P].tag.length)===R[P].tag){g=R[P];break}}g||fe(t,"unknown tag !<"+t.tag+">"),t.result!==null&&g.kind!==t.kind&&fe(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&Ea(t,t.anchor,t.result)):fe(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||d}function v3(t){let e=t.position,r=!1,n;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(n=t.input.charCodeAt(t.position))!==0&&(Lt(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||n!==37));){r=!0,n=t.input.charCodeAt(++t.position);let i=t.position;for(;n!==0&&!Wr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),a=[];for(s.length<1&&fe(t,"directive name must not be less than one character in length");n!==0;){for(;os(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ii(n));break}if(Ii(n))break;for(i=t.position;n!==0&&!Wr(n);)n=t.input.charCodeAt(++t.position);a.push(t.input.slice(i,t.position))}n!==0&&TR(t),ni.call(RA,s)?RA[s](t,s,a):Rg(t,'unknown document directive "'+s+'"')}if(Lt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Lt(t,!0,-1)):r&&fe(t,"directives end mark is expected"),Ec(t,t.lineIndent-1,_g,!1,!0),Lt(t,!0,-1),t.checkLineBreaks&&X4.test(t.input.slice(e,t.position))&&Rg(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&xg(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Lt(t,!0,-1));return}t.position<t.length-1&&fe(t,"end of the stream or a document separator is expected")}function DA(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
259
- `),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new s3(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,fe(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)v3(r);return r.documents}function b3(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=DA(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function S3(t,e){let r=DA(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new EA("expected a single document in the stream, but found more")}}qR.exports.loadAll=b3;qR.exports.load=S3});var sq=F((ute,iq)=>{"use strict";var Og=_c(),Sd=Rc(),w3=Sg(),JA=Object.prototype.toString,GA=Object.prototype.hasOwnProperty,FR=65279,_3=9,yd=10,R3=13,x3=32,C3=33,E3=34,$R=35,O3=37,I3=38,P3=39,k3=42,YA=44,T3=45,Cg=58,A3=61,q3=62,$3=63,M3=64,KA=91,QA=93,N3=96,ZA=123,D3=124,XA=125,pr={};pr[0]="\\0";pr[7]="\\a";pr[8]="\\b";pr[9]="\\t";pr[10]="\\n";pr[11]="\\v";pr[12]="\\f";pr[13]="\\r";pr[27]="\\e";pr[34]='\\"';pr[92]="\\\\";pr[133]="\\N";pr[160]="\\_";pr[8232]="\\L";pr[8233]="\\P";var F3=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],L3=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function j3(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let a=n[i],l=String(e[a]);a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2));let f=t.compiledTypeMap.fallback[a];f&&GA.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[a]=l}return r}function U3(t){let e,r,n=t.toString(16).toUpperCase();if(t<=255)e="x",r=2;else if(t<=65535)e="u",r=4;else if(t<=4294967295)e="U",r=8;else throw new Sd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Og.repeat("0",r-n.length)+n}var H3=1,vd=2;function B3(t){this.schema=t.schema||w3,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Og.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=j3(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?vd:H3,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function LA(t,e){let r=Og.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let a,l=t.indexOf(`
258
+ `,i?1+l:l),i=!0,s=!0,l=0;let g=t.position;for(;!Ii(m)&&m!==0;)m=t.input.charCodeAt(++t.position);ao(t,g,t.position,!1)}return!0}function EA(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ea(t,t.anchor,i);let a=t.input.charCodeAt(t.position);for(;a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,fe(t,"tab characters must not be used in indentation")),a===45);){let l=t.input.charCodeAt(t.position+1);if(!Wr(l))break;if(s=!0,t.position++,Lt(t,!0,-1)&&t.lineIndent<=e){i.push(null),a=t.input.charCodeAt(t.position);continue}let f=t.line;if(Ec(t,e,PA,!1,!0),i.push(t.result),Lt(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&a!==0)fe(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=r,t.anchor=n,t.kind="sequence",t.result=i,!0):!1}function DA(t,e,r){let n,i,s,a,l=t.tag,f=t.anchor,d={},m=Object.create(null),g=null,y=null,S=null,_=!1,R=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ea(t,t.anchor,d);let P=t.input.charCodeAt(t.position);for(;P!==0;){!_&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,fe(t,"tab characters must not be used in indentation"));let A=t.input.charCodeAt(t.position+1),U=t.line;if((P===63||P===58)&&Wr(A))P===63?(_&&(Cc(t,d,m,g,y,null,i,s,a),g=y=S=null),R=!0,_=!0,n=!0):_?(_=!1,n=!0):fe(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,P=A;else{if(i=t.line,s=t.lineStart,a=t.position,!Ec(t,r,IA,!1,!0))break;if(t.line===U){for(P=t.input.charCodeAt(t.position);os(P);)P=t.input.charCodeAt(++t.position);if(P===58)P=t.input.charCodeAt(++t.position),Wr(P)||fe(t,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(Cc(t,d,m,g,y,null,i,s,a),g=y=S=null),R=!0,_=!1,n=!1,g=t.tag,y=t.result;else if(R)fe(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(R)fe(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=f,!0}if((t.line===U||t.lineIndent>e)&&(_&&(i=t.line,s=t.lineStart,a=t.position),Ec(t,e,Rg,!0,n)&&(_?y=t.result:S=t.result),_||(Cc(t,d,m,g,y,S,i,s,a),g=y=S=null),Lt(t,!0,-1),P=t.input.charCodeAt(t.position)),(t.line===U||t.lineIndent>e)&&P!==0)fe(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return _&&Cc(t,d,m,g,y,null,i,s,a),R&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=d),R}function m3(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&fe(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(e=!0,s=t.input.charCodeAt(++t.position)):s===33?(r=!0,n="!!",s=t.input.charCodeAt(++t.position)):n="!";let a=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(a,t.position),s=t.input.charCodeAt(++t.position)):fe(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Wr(s);)s===33&&(r?fe(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(a-1,t.position+1),kA.test(n)||fe(t,"named tag handle cannot contain such characters"),r=!0,a=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(a,t.position),t3.test(i)&&fe(t,"tag suffix cannot contain flow indicator characters")}i&&!TA.test(i)&&fe(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{fe(t,"tag name is malformed: "+i)}return e?t.tag=i:ni.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:fe(t,'undeclared tag handle "'+n+'"'),!0}function g3(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&fe(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Wr(e)&&!xc(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&fe(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function y3(t){let e=t.input.charCodeAt(t.position);if(e!==42)return!1;e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Wr(e)&&!xc(e);)e=t.input.charCodeAt(++t.position);t.position===r&&fe(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ni.call(t.anchorMap,n)||fe(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Lt(t,!0,-1),!0}function v3(t,e,r,n){let i=NA(t);return a3(t),RA(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,DA(t,r,n)&&t.kind==="mapping"?(l3(t),!0):(c3(t),RA(t,i),!1)}function Ec(t,e,r,n,i){let s,a,l=1,f=!1,d=!1,m=null,g,y,S;t.depth>=t.maxDepth&&fe(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let _=s=a=Rg===r||PA===r;if(n&&Lt(t,!0,-1)&&(f=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let R=t.input.charCodeAt(t.position),P=NA(t);if(f&&(R===33&&t.tag!==null||R===38&&t.anchor!==null)||!m3(t)&&!g3(t))break;m===null&&(m=P),Lt(t,!0,-1)?(f=!0,a=_,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):a=!1}if(a&&(a=f||i),l===1||Rg===r)if(_g===r||IA===r?y=e:y=e+1,S=t.position-t.lineStart,l===1)if(a&&(EA(t,S)||DA(t,S,y))||p3(t,y))d=!0;else{let R=t.input.charCodeAt(t.position);m!==null&&_&&!a&&R!==124&&R!==62&&v3(t,m,m.position-m.lineStart,y)||s&&h3(t,y)||f3(t,y)||d3(t,y)?d=!0:y3(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&fe(t,"alias node should not have any properties")):u3(t,y,_g===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&Ea(t,t.anchor,t.result)}else l===0&&(d=a&&EA(t,S));if(t.tag===null)t.anchor!==null&&Ea(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&fe(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let R=0,P=t.implicitTypes.length;R<P;R+=1)if(g=t.implicitTypes[R],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&Ea(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ni.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else{g=null;let R=t.typeMap.multi[t.kind||"fallback"];for(let P=0,A=R.length;P<A;P+=1)if(t.tag.slice(0,R[P].tag.length)===R[P].tag){g=R[P];break}}g||fe(t,"unknown tag !<"+t.tag+">"),t.result!==null&&g.kind!==t.kind&&fe(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&Ea(t,t.anchor,t.result)):fe(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||d}function b3(t){let e=t.position,r=!1,n;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(n=t.input.charCodeAt(t.position))!==0&&(Lt(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||n!==37));){r=!0,n=t.input.charCodeAt(++t.position);let i=t.position;for(;n!==0&&!Wr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),a=[];for(s.length<1&&fe(t,"directive name must not be less than one character in length");n!==0;){for(;os(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ii(n));break}if(Ii(n))break;for(i=t.position;n!==0&&!Wr(n);)n=t.input.charCodeAt(++t.position);a.push(t.input.slice(i,t.position))}n!==0&&TR(t),ni.call(xA,s)?xA[s](t,s,a):xg(t,'unknown document directive "'+s+'"')}if(Lt(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Lt(t,!0,-1)):r&&fe(t,"directives end mark is expected"),Ec(t,t.lineIndent-1,Rg,!1,!0),Lt(t,!0,-1),t.checkLineBreaks&&e3.test(t.input.slice(e,t.position))&&xg(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Cg(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Lt(t,!0,-1));return}t.position<t.length-1&&fe(t,"end of the stream or a document separator is expected")}function FA(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
259
+ `),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new o3(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,fe(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)b3(r);return r.documents}function S3(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=FA(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function w3(t,e){let r=FA(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new OA("expected a single document in the stream, but found more")}}qR.exports.loadAll=S3;qR.exports.load=w3});var oq=F((fte,sq)=>{"use strict";var Ig=_c(),wd=Rc(),_3=wg(),GA=Object.prototype.toString,YA=Object.prototype.hasOwnProperty,FR=65279,R3=9,vd=10,x3=13,C3=32,E3=33,O3=34,$R=35,I3=37,P3=38,k3=39,T3=42,KA=44,A3=45,Eg=58,q3=61,$3=62,M3=63,N3=64,QA=91,ZA=93,D3=96,XA=123,F3=124,eq=125,pr={};pr[0]="\\0";pr[7]="\\a";pr[8]="\\b";pr[9]="\\t";pr[10]="\\n";pr[11]="\\v";pr[12]="\\f";pr[13]="\\r";pr[27]="\\e";pr[34]='\\"';pr[92]="\\\\";pr[133]="\\N";pr[160]="\\_";pr[8232]="\\L";pr[8233]="\\P";var L3=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],j3=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function U3(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let a=n[i],l=String(e[a]);a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2));let f=t.compiledTypeMap.fallback[a];f&&YA.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[a]=l}return r}function H3(t){let e,r,n=t.toString(16).toUpperCase();if(t<=255)e="x",r=2;else if(t<=65535)e="u",r=4;else if(t<=4294967295)e="U",r=8;else throw new wd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Ig.repeat("0",r-n.length)+n}var B3=1,bd=2;function V3(t){this.schema=t.schema||_3,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Ig.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=U3(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?bd:B3,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function jA(t,e){let r=Ig.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let a,l=t.indexOf(`
260
260
  `,n);l===-1?(a=t.slice(n),n=s):(a=t.slice(n,l+1),n=l+1),a.length&&a!==`
261
261
  `&&(i+=r),i+=a}return i}function MR(t,e){return`
262
- `+Og.repeat(" ",t.indent*e)}function V3(t,e){for(let r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Eg(t){return t===x3||t===_3}function bd(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==FR||t>=65536&&t<=1114111}function jA(t){return bd(t)&&t!==FR&&t!==R3&&t!==yd}function UA(t,e,r){let n=jA(t),i=n&&!Eg(t);return(r?n:n&&t!==YA&&t!==KA&&t!==QA&&t!==ZA&&t!==XA)&&t!==$R&&!(e===Cg&&!i)||jA(e)&&!Eg(e)&&t===$R||e===Cg&&i}function W3(t){return bd(t)&&t!==FR&&!Eg(t)&&t!==T3&&t!==$3&&t!==Cg&&t!==YA&&t!==KA&&t!==QA&&t!==ZA&&t!==XA&&t!==$R&&t!==I3&&t!==k3&&t!==C3&&t!==D3&&t!==A3&&t!==q3&&t!==P3&&t!==E3&&t!==O3&&t!==M3&&t!==N3}function z3(t){return!Eg(t)&&t!==Cg}function gd(t,e){let r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function eq(t){return/^\n* /.test(t)}var tq=1,NR=2,rq=3,nq=4,Oc=5;function J3(t,e,r,n,i,s,a,l){let f,d=0,m=null,g=!1,y=!1,S=n!==-1,_=-1,R=W3(gd(t,0))&&z3(gd(t,t.length-1));if(e||a)for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=gd(t,f),!bd(d))return Oc;R=R&&UA(d,m,l),m=d}else{for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=gd(t,f),d===yd)g=!0,S&&(y=y||f-_-1>n&&t[_+1]!==" ",_=f);else if(!bd(d))return Oc;R=R&&UA(d,m,l),m=d}y=y||S&&f-_-1>n&&t[_+1]!==" "}return!g&&!y?R&&!a&&!i(t)?tq:s===vd?Oc:NR:r>9&&eq(t)?Oc:a?s===vd?Oc:NR:y?nq:rq}function G3(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===vd?'""':"''";if(!t.noCompatMode&&(F3.indexOf(e)!==-1||L3.test(e)))return t.quotingType===vd?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function f(d){return V3(t,d)}switch(J3(e,l,t.indent,a,f,t.quotingType,t.forceQuotes&&!n,i)){case tq:return e;case NR:return"'"+e.replace(/'/g,"''")+"'";case rq:return"|"+HA(e,t.indent)+BA(LA(e,s));case nq:return">"+HA(e,t.indent)+BA(LA(Y3(e,a),s));case Oc:return'"'+K3(e,a)+'"';default:throw new Sd("impossible error: invalid scalar style")}})()}function HA(t,e){let r=eq(t)?String(e):"",n=t[t.length-1]===`
262
+ `+Ig.repeat(" ",t.indent*e)}function W3(t,e){for(let r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function Og(t){return t===C3||t===R3}function Sd(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==FR||t>=65536&&t<=1114111}function UA(t){return Sd(t)&&t!==FR&&t!==x3&&t!==vd}function HA(t,e,r){let n=UA(t),i=n&&!Og(t);return(r?n:n&&t!==KA&&t!==QA&&t!==ZA&&t!==XA&&t!==eq)&&t!==$R&&!(e===Eg&&!i)||UA(e)&&!Og(e)&&t===$R||e===Eg&&i}function z3(t){return Sd(t)&&t!==FR&&!Og(t)&&t!==A3&&t!==M3&&t!==Eg&&t!==KA&&t!==QA&&t!==ZA&&t!==XA&&t!==eq&&t!==$R&&t!==P3&&t!==T3&&t!==E3&&t!==F3&&t!==q3&&t!==$3&&t!==k3&&t!==O3&&t!==I3&&t!==N3&&t!==D3}function J3(t){return!Og(t)&&t!==Eg}function yd(t,e){let r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function tq(t){return/^\n* /.test(t)}var rq=1,NR=2,nq=3,iq=4,Oc=5;function G3(t,e,r,n,i,s,a,l){let f,d=0,m=null,g=!1,y=!1,S=n!==-1,_=-1,R=z3(yd(t,0))&&J3(yd(t,t.length-1));if(e||a)for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=yd(t,f),!Sd(d))return Oc;R=R&&HA(d,m,l),m=d}else{for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=yd(t,f),d===vd)g=!0,S&&(y=y||f-_-1>n&&t[_+1]!==" ",_=f);else if(!Sd(d))return Oc;R=R&&HA(d,m,l),m=d}y=y||S&&f-_-1>n&&t[_+1]!==" "}return!g&&!y?R&&!a&&!i(t)?rq:s===bd?Oc:NR:r>9&&tq(t)?Oc:a?s===bd?Oc:NR:y?iq:nq}function Y3(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===bd?'""':"''";if(!t.noCompatMode&&(L3.indexOf(e)!==-1||j3.test(e)))return t.quotingType===bd?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function f(d){return W3(t,d)}switch(G3(e,l,t.indent,a,f,t.quotingType,t.forceQuotes&&!n,i)){case rq:return e;case NR:return"'"+e.replace(/'/g,"''")+"'";case nq:return"|"+BA(e,t.indent)+VA(jA(e,s));case iq:return">"+BA(e,t.indent)+VA(jA(K3(e,a),s));case Oc:return'"'+Q3(e,a)+'"';default:throw new wd("impossible error: invalid scalar style")}})()}function BA(t,e){let r=tq(t)?String(e):"",n=t[t.length-1]===`
263
263
  `,s=n&&(t[t.length-2]===`
264
264
  `||t===`
265
265
  `)?"+":n?"":"-";return r+s+`
266
- `}function BA(t){return t[t.length-1]===`
267
- `?t.slice(0,-1):t}function Y3(t,e){let r=/(\n+)([^\n]*)/g,n=(function(){let l=t.indexOf(`
268
- `);return l=l!==-1?l:t.length,r.lastIndex=l,VA(t.slice(0,l),e)})(),i=t[0]===`
266
+ `}function VA(t){return t[t.length-1]===`
267
+ `?t.slice(0,-1):t}function K3(t,e){let r=/(\n+)([^\n]*)/g,n=(function(){let l=t.indexOf(`
268
+ `);return l=l!==-1?l:t.length,r.lastIndex=l,WA(t.slice(0,l),e)})(),i=t[0]===`
269
269
  `||t[0]===" ",s,a;for(;a=r.exec(t);){let l=a[1],f=a[2];s=f[0]===" ",n+=l+(!i&&!s&&f!==""?`
270
- `:"")+VA(f,e),i=s}return n}function VA(t,e){if(t===""||t[0]===" ")return t;let r=/ [^ ]/g,n,i=0,s,a=0,l=0,f="";for(;n=r.exec(t);)l=n.index,l-i>e&&(s=a>i?a:l,f+=`
270
+ `:"")+WA(f,e),i=s}return n}function WA(t,e){if(t===""||t[0]===" ")return t;let r=/ [^ ]/g,n,i=0,s,a=0,l=0,f="";for(;n=r.exec(t);)l=n.index,l-i>e&&(s=a>i?a:l,f+=`
271
271
  `+t.slice(i,s),i=s+1),a=l;return f+=`
272
272
  `,t.length-i>e&&a>i?f+=t.slice(i,a)+`
273
- `+t.slice(a+1):f+=t.slice(i),f.slice(1)}function K3(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=gd(t,n);let i=pr[r];!i&&bd(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||U3(r)}return e}function Q3(t,e,r){let n="",i=t.tag;for(let s=0,a=r.length;s<a;s+=1){let l=r[s];t.replacer&&(l=t.replacer.call(r,String(s),l)),(as(t,e,l,!1,!1)||typeof l>"u"&&as(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function WA(t,e,r,n){let i="",s=t.tag;for(let a=0,l=r.length;a<l;a+=1){let f=r[a];t.replacer&&(f=t.replacer.call(r,String(a),f)),(as(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&as(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=MR(t,e)),t.dump&&yd===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function Z3(t,e,r){let n="",i=t.tag,s=Object.keys(r);for(let a=0,l=s.length;a<l;a+=1){let f="";n!==""&&(f+=", "),t.condenseFlow&&(f+='"');let d=s[a],m=r[d];t.replacer&&(m=t.replacer.call(r,d,m)),as(t,e,d,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),as(t,e,m,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function X3(t,e,r,n){let i="",s=t.tag,a=Object.keys(r);if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new Sd("sortKeys must be a boolean or a function");for(let l=0,f=a.length;l<f;l+=1){let d="";(!n||i!=="")&&(d+=MR(t,e));let m=a[l],g=r[m];if(t.replacer&&(g=t.replacer.call(r,m,g)),!as(t,e+1,m,!0,!0,!0))continue;let y=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;y&&(t.dump&&yd===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,y&&(d+=MR(t,e)),as(t,e+1,g,!0,y)&&(t.dump&&yd===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d)}t.tag=s,t.dump=i||"{}"}function zA(t,e,r){let n=r?t.explicitTypes:t.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let a=n[i];if((a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){let l=t.styleMap[a.tag]||a.defaultStyle,f;if(JA.call(a.represent)==="[object Function]")f=a.represent(e,l);else if(GA.call(a.represent,l))f=a.represent[l](e,l);else throw new Sd("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=f}return!0}}return!1}function as(t,e,r,n,i,s,a){t.tag=null,t.dump=r,zA(t,r,!1)||zA(t,r,!0);let l=JA.call(t.dump),f=n;n&&(n=t.flowLevel<0||t.flowLevel>e);let d=l==="[object Object]"||l==="[object Array]",m,g;if(d&&(m=t.duplicates.indexOf(r),g=m!==-1),(t.tag!==null&&t.tag!=="?"||g||t.indent!==2&&e>0)&&(i=!1),g&&t.usedDuplicates[m])t.dump="*ref_"+m;else{if(d&&g&&!t.usedDuplicates[m]&&(t.usedDuplicates[m]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(X3(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(Z3(t,e,t.dump),g&&(t.dump="&ref_"+m+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?WA(t,e-1,t.dump,i):WA(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(Q3(t,e,t.dump),g&&(t.dump="&ref_"+m+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&G3(t,t.dump,e,s,f);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Sd("unacceptable kind of an object to dump "+l)}if(t.tag!==null&&t.tag!=="?"){let y=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?y="!"+y:y.slice(0,18)==="tag:yaml.org,2002:"?y="!!"+y.slice(18):y="!<"+y+">",t.dump=y+" "+t.dump}}return!0}function e9(t,e){let r=[],n=[];DR(t,r,n);let i=n.length;for(let s=0;s<i;s+=1)e.duplicates.push(r[n[s]]);e.usedDuplicates=new Array(i)}function DR(t,e,r){if(t!==null&&typeof t=="object"){let n=e.indexOf(t);if(n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(let i=0,s=t.length;i<s;i+=1)DR(t[i],e,r);else{let i=Object.keys(t);for(let s=0,a=i.length;s<a;s+=1)DR(t[i[s]],e,r)}}}function t9(t,e){e=e||{};let r=new B3(e);r.noRefs||e9(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),as(r,0,n,!0,!0)?r.dump+`
274
- `:""}iq.exports.dump=t9});var jR=F((fte,Or)=>{"use strict";var oq=FA(),r9=sq();function LR(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Or.exports.Type=dr();Or.exports.Schema=dR();Or.exports.FAILSAFE_SCHEMA=gR();Or.exports.JSON_SCHEMA=wR();Or.exports.CORE_SCHEMA=_R();Or.exports.DEFAULT_SCHEMA=Sg();Or.exports.load=oq.load;Or.exports.loadAll=oq.loadAll;Or.exports.dump=r9.dump;Or.exports.YAMLException=Rc();Or.exports.types={binary:ER(),float:SR(),map:mR(),null:yR(),pairs:IR(),set:PR(),timestamp:RR(),bool:vR(),int:bR(),merge:xR(),omap:OR(),seq:hR(),str:pR()};Or.exports.safeLoad=LR("safeLoad","load");Or.exports.safeLoadAll=LR("safeLoadAll","loadAll");Or.exports.safeDump=LR("safeDump","dump")});var aq=F(wd=>{"use strict";var n9=wd&&wd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wd,"__esModule",{value:!0});var i9=In(),s9=n9(jR()),o9=jR();wd.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return s9.default.load(e,{schema:o9.JSON_SCHEMA})}catch(r){throw new i9.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var lq=F(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0});var a9=In(),l9=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;UR.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&l9.test(t.url)},parse(t){if(typeof t.data=="string")return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new a9.ParserError("data is not text",t.url)}}});var cq=F(HR=>{"use strict";Object.defineProperty(HR,"__esModule",{value:!0});var c9=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;HR.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&c9.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var pq=F(ii=>{"use strict";var u9=ii&&ii.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),f9=ii&&ii.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),d9=ii&&ii.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&u9(r,e,n[i]);return f9(r,e),r}})(),p9=ii&&ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ii,"__esModule",{value:!0});var h9=p9(it("fs")),uq=no(),fq=d9(On()),dq=In();ii.default={order:100,canRead(t){return fq.isFileSystemPath(t.url)},async read(t){let e;try{e=fq.toFileSystemPath(t.url)}catch(r){throw new dq.ResolverError(uq.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await h9.default.promises.readFile(e)}catch(r){throw new dq.ResolverError((0,uq.ono)(r,`Error opening file "${e}"`),e)}}}});var gq=F(ls=>{"use strict";var m9=ls&&ls.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g9=ls&&ls.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),y9=ls&&ls.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&m9(r,e,n[i]);return g9(r,e),r}})();Object.defineProperty(ls,"__esModule",{value:!0});var Ig=no(),_d=y9(On()),hq=In();ls.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return _d.isHttp(t.url)},read(t){let e=_d.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=_d.parse(location.href).protocol),mq(e,this)}};async function mq(t,e,r){t=_d.parse(t);let n=r||[];n.push(t.href);try{let i=await v9(t,e);if(i.status>=400)throw(0,Ig.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new hq.ResolverError((0,Ig.ono)({status:i.status},`Error downloading ${n[0]}.
273
+ `+t.slice(a+1):f+=t.slice(i),f.slice(1)}function Q3(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=yd(t,n);let i=pr[r];!i&&Sd(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||H3(r)}return e}function Z3(t,e,r){let n="",i=t.tag;for(let s=0,a=r.length;s<a;s+=1){let l=r[s];t.replacer&&(l=t.replacer.call(r,String(s),l)),(as(t,e,l,!1,!1)||typeof l>"u"&&as(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function zA(t,e,r,n){let i="",s=t.tag;for(let a=0,l=r.length;a<l;a+=1){let f=r[a];t.replacer&&(f=t.replacer.call(r,String(a),f)),(as(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&as(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=MR(t,e)),t.dump&&vd===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function X3(t,e,r){let n="",i=t.tag,s=Object.keys(r);for(let a=0,l=s.length;a<l;a+=1){let f="";n!==""&&(f+=", "),t.condenseFlow&&(f+='"');let d=s[a],m=r[d];t.replacer&&(m=t.replacer.call(r,d,m)),as(t,e,d,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),as(t,e,m,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function e9(t,e,r,n){let i="",s=t.tag,a=Object.keys(r);if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new wd("sortKeys must be a boolean or a function");for(let l=0,f=a.length;l<f;l+=1){let d="";(!n||i!=="")&&(d+=MR(t,e));let m=a[l],g=r[m];if(t.replacer&&(g=t.replacer.call(r,m,g)),!as(t,e+1,m,!0,!0,!0))continue;let y=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;y&&(t.dump&&vd===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,y&&(d+=MR(t,e)),as(t,e+1,g,!0,y)&&(t.dump&&vd===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d)}t.tag=s,t.dump=i||"{}"}function JA(t,e,r){let n=r?t.explicitTypes:t.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let a=n[i];if((a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){let l=t.styleMap[a.tag]||a.defaultStyle,f;if(GA.call(a.represent)==="[object Function]")f=a.represent(e,l);else if(YA.call(a.represent,l))f=a.represent[l](e,l);else throw new wd("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=f}return!0}}return!1}function as(t,e,r,n,i,s,a){t.tag=null,t.dump=r,JA(t,r,!1)||JA(t,r,!0);let l=GA.call(t.dump),f=n;n&&(n=t.flowLevel<0||t.flowLevel>e);let d=l==="[object Object]"||l==="[object Array]",m,g;if(d&&(m=t.duplicates.indexOf(r),g=m!==-1),(t.tag!==null&&t.tag!=="?"||g||t.indent!==2&&e>0)&&(i=!1),g&&t.usedDuplicates[m])t.dump="*ref_"+m;else{if(d&&g&&!t.usedDuplicates[m]&&(t.usedDuplicates[m]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(e9(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(X3(t,e,t.dump),g&&(t.dump="&ref_"+m+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?zA(t,e-1,t.dump,i):zA(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(Z3(t,e,t.dump),g&&(t.dump="&ref_"+m+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&Y3(t,t.dump,e,s,f);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new wd("unacceptable kind of an object to dump "+l)}if(t.tag!==null&&t.tag!=="?"){let y=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?y="!"+y:y.slice(0,18)==="tag:yaml.org,2002:"?y="!!"+y.slice(18):y="!<"+y+">",t.dump=y+" "+t.dump}}return!0}function t9(t,e){let r=[],n=[];DR(t,r,n);let i=n.length;for(let s=0;s<i;s+=1)e.duplicates.push(r[n[s]]);e.usedDuplicates=new Array(i)}function DR(t,e,r){if(t!==null&&typeof t=="object"){let n=e.indexOf(t);if(n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(let i=0,s=t.length;i<s;i+=1)DR(t[i],e,r);else{let i=Object.keys(t);for(let s=0,a=i.length;s<a;s+=1)DR(t[i[s]],e,r)}}}function r9(t,e){e=e||{};let r=new V3(e);r.noRefs||t9(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),as(r,0,n,!0,!0)?r.dump+`
274
+ `:""}sq.exports.dump=r9});var jR=F((dte,Or)=>{"use strict";var aq=LA(),n9=oq();function LR(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Or.exports.Type=dr();Or.exports.Schema=dR();Or.exports.FAILSAFE_SCHEMA=gR();Or.exports.JSON_SCHEMA=wR();Or.exports.CORE_SCHEMA=_R();Or.exports.DEFAULT_SCHEMA=wg();Or.exports.load=aq.load;Or.exports.loadAll=aq.loadAll;Or.exports.dump=n9.dump;Or.exports.YAMLException=Rc();Or.exports.types={binary:ER(),float:SR(),map:mR(),null:yR(),pairs:IR(),set:PR(),timestamp:RR(),bool:vR(),int:bR(),merge:xR(),omap:OR(),seq:hR(),str:pR()};Or.exports.safeLoad=LR("safeLoad","load");Or.exports.safeLoadAll=LR("safeLoadAll","loadAll");Or.exports.safeDump=LR("safeDump","dump")});var lq=F(_d=>{"use strict";var i9=_d&&_d.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_d,"__esModule",{value:!0});var s9=In(),o9=i9(jR()),a9=jR();_d.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return o9.default.load(e,{schema:a9.JSON_SCHEMA})}catch(r){throw new s9.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var cq=F(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0});var l9=In(),c9=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;UR.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&c9.test(t.url)},parse(t){if(typeof t.data=="string")return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new l9.ParserError("data is not text",t.url)}}});var uq=F(HR=>{"use strict";Object.defineProperty(HR,"__esModule",{value:!0});var u9=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;HR.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&u9.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var hq=F(ii=>{"use strict";var f9=ii&&ii.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d9=ii&&ii.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),p9=ii&&ii.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&f9(r,e,n[i]);return d9(r,e),r}})(),h9=ii&&ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ii,"__esModule",{value:!0});var m9=h9(it("fs")),fq=io(),dq=p9(On()),pq=In();ii.default={order:100,canRead(t){return dq.isFileSystemPath(t.url)},async read(t){let e;try{e=dq.toFileSystemPath(t.url)}catch(r){throw new pq.ResolverError(fq.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await m9.default.promises.readFile(e)}catch(r){throw new pq.ResolverError((0,fq.ono)(r,`Error opening file "${e}"`),e)}}}});var yq=F(ls=>{"use strict";var g9=ls&&ls.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y9=ls&&ls.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v9=ls&&ls.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&g9(r,e,n[i]);return y9(r,e),r}})();Object.defineProperty(ls,"__esModule",{value:!0});var Pg=io(),Rd=v9(On()),mq=In();ls.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Rd.isHttp(t.url)},read(t){let e=Rd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Rd.parse(location.href).protocol),gq(e,this)}};async function gq(t,e,r){t=Rd.parse(t);let n=r||[];n.push(t.href);try{let i=await b9(t,e);if(i.status>=400)throw(0,Pg.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new mq.ResolverError((0,Pg.ono)({status:i.status},`Error downloading ${n[0]}.
275
275
  Too many redirects:
276
276
  ${n.join(`
277
- `)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Ig.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=_d.resolve(t.href,i.headers.location);return mq(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new hq.ResolverError((0,Ig.ono)(i,`Error downloading ${t.href}`),t.href)}}async function v9(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var BR=F(cs=>{"use strict";var Ic=cs&&cs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cs,"__esModule",{value:!0});cs.getNewOptions=cs.getJsonSchemaRefParserDefaultOptions=void 0;var b9=Ic(B1()),S9=Ic(aq()),w9=Ic(lq()),_9=Ic(cq()),R9=Ic(pq()),x9=Ic(gq()),C9=()=>({parse:{json:{...b9.default},yaml:{...S9.default},text:{...w9.default},binary:{..._9.default}},resolve:{file:{...R9.default},http:{...x9.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});cs.getJsonSchemaRefParserDefaultOptions=C9;var E9=t=>{let e=(0,cs.getJsonSchemaRefParserDefaultOptions)();return t&&vq(e,t),e};cs.getNewOptions=E9;function vq(t,e){if(yq(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];yq(s)?t[i]=vq(a||{},s):s!==void 0&&(t[i]=s)}}return t}function yq(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var Sq=F(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.normalizeArgs=bq;var O9=BR();function bq(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,O9.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Pg.default=bq});var wq=F(si=>{"use strict";var I9=si&&si.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P9=si&&si.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),k9=si&&si.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&I9(r,e,n[i]);return P9(r,e),r}})(),VR=si&&si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(si,"__esModule",{value:!0});var T9=VR(Sc()),A9=VR(fd()),q9=VR(oR()),Pc=k9(On()),$9=In();function M9(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=WR(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function WR(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),T9.default.isExternal$Ref(t)&&a.push(N9(t,e,r,n));let l=Object.keys(t);for(let f of l){let d=A9.default.join(e,f),m=t[f];a=a.concat(WR(m,d,r,n,i,s))}}return a}async function N9(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Pc.resolve(i?Pc.cwd():e,t.$ref),a=Pc.stripHash(s),l=r._$refs[a];if(l)return Promise.resolve(l.value);try{let f=await(0,q9.default)(s,r,n),d=WR(f,a+"#",r,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,$9.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Pc.stripHash(e)),f.path=Pc.safePointerToPath(Pc.getHash(e))),[]}}si.default=M9});var xq=F(oi=>{"use strict";var D9=oi&&oi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F9=oi&&oi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L9=oi&&oi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&D9(r,e,n[i]);return F9(r,e),r}})(),Rq=oi&&oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oi,"__esModule",{value:!0});var kg=Rq(Sc()),Rd=Rq(fd()),zR=L9(On());function j9(t,e){let r=[];JR(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),U9(r)}function JR(t,e,r,n,i,s,a,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(kg.default.isAllowed$Ref(f))_q(t,e,r,n,i,s,a,l);else{let d=Object.keys(f).sort((m,g)=>m==="definitions"?-1:g==="definitions"?1:m.length-g.length);for(let m of d){let g=Rd.default.join(r,m),y=Rd.default.join(n,m),S=f[m];kg.default.isAllowed$Ref(S)?_q(f,m,r,y,i,s,a,l):JR(f,m,g,y,i,s,a,l)}}}function _q(t,e,r,n,i,s,a,l){let f=e===null?t:t[e],d=zR.resolve(r,f.$ref),m=a._resolve(d,n,l);if(m===null)return;let y=Rd.default.parse(n).length,S=zR.stripHash(m.path),_=zR.getHash(m.path),R=S!==a._root$Ref.path,P=kg.default.isExtended$Ref(f);i+=m.indirections;let A=H9(s,t,e);if(A)if(y<A.depth||i<A.indirections)B9(s,A);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:y,file:S,hash:_,value:m.value,circular:m.circular,extended:P,external:R,indirections:i}),(!A||R)&&JR(m.value,null,m.path,n,i+1,s,a,l)}function U9(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return a!==l?l-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=Rd.default.join(n,Rd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=kg.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function H9(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function B9(t,e){let r=t.indexOf(e);t.splice(r,1)}oi.default=j9});var kq=F(ai=>{"use strict";var V9=ai&&ai.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W9=ai&&ai.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),z9=ai&&ai.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&V9(r,e,n[i]);return W9(r,e),r}})(),Iq=ai&&ai.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ai,"__esModule",{value:!0});var Tg=Iq(Sc()),Cq=Iq(fd()),J9=no(),Eq=z9(On()),G9=In();ai.default=Y9;function Y9(t,e){let r=Date.now(),n=GR(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function GR(t,e,r,n,i,s,a,l,f){let d,m={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new G9.TimeoutError(l.timeoutMs);let g=l.dereference||{},y=g.excludedPathMatcher||(()=>!1);if((g?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),Tg.default.isAllowed$Ref(t,l))d=Oq(t,e,r,n,i,s,a,l,f),m.circular=d.circular,m.value=d.value;else for(let S of Object.keys(t)){let _=Cq.default.join(e,S),R=Cq.default.join(r,S);if(y(R))continue;let P=t[S],A=!1;if(Tg.default.isAllowed$Ref(P,l)){if(d=Oq(P,_,R,n,i,s,a,l,f),A=d.circular,t[S]!==d.value){let U=new Map;g?.preservedProperties&&typeof t[S]=="object"&&!Array.isArray(t[S])&&g?.preservedProperties.forEach(B=>{B in t[S]&&U.set(B,t[S][B])}),t[S]=d.value,g?.preservedProperties&&U.size&&typeof t[S]=="object"&&!Array.isArray(t[S])&&U.forEach((B,V)=>{t[S][V]=B}),g?.onDereference?.(P.$ref,t[S],t,S)}}else n.has(P)?A=Pq(_,a,l):(d=GR(P,_,R,n,i,s,a,l,f),A=d.circular,t[S]!==d.value&&(t[S]=d.value));m.circular=m.circular||A}n.delete(t)}return m}function Oq(t,e,r,n,i,s,a,l,f){let m=Tg.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",g=Eq.resolve(m?Eq.cwd():e,t.$ref),y=s.get(g);if(y&&!y.circular){let U=Object.keys(t);if(U.length>1){let B={};for(let V of U)V!=="$ref"&&!(V in y.value)&&(B[V]=t[V]);return{circular:y.circular,value:Object.assign({},y.value,B)}}return y}let S=a._resolve(g,e,l);if(S===null)return{circular:!1,value:null};let _=S.circular,R=_||n.has(S.value);R&&Pq(e,a,l);let P=Tg.default.dereference(t,S.value);if(!R){let U=GR(P,S.path,r,n,i,s,a,l,f);R=U.circular,P=U.value}R&&!_&&l.dereference?.circular==="ignore"&&(P=t),_&&(P.$ref=r);let A={circular:R,value:P};return Object.keys(t).length===1&&s.set(g,A),A}function Pq(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw J9.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var Tq=F(YR=>{"use strict";Object.defineProperty(YR,"__esModule",{value:!0});function K9(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}YR.default=K9()});var qq=F(xd=>{"use strict";var Q9=xd&&xd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xd,"__esModule",{value:!0});xd.default=Z9;var Aq=Q9(Tq());function Z9(t,e){if(t){e.then(function(r){(0,Aq.default)(function(){t(null,r)})},function(r){(0,Aq.default)(function(){t(r)})});return}else return e}});var Dq=F(we=>{"use strict";var X9=we&&we.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e8=we&&we.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),t8=we&&we.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&X9(r,e,n[i]);return e8(r,e),r}})(),Ia=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var $q=Ia(F1()),r8=Ia(oR()),Cd=Ia(Sq());we.jsonSchemaParserNormalizeArgs=Cd.default;var n8=Ia(wq()),i8=Ia(xq()),Nq=Ia(kq());we.dereferenceInternal=Nq.default;var Oa=t8(On()),Pn=In();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return Pn.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return Pn.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return Pn.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return Pn.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return Pn.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return Pn.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return Pn.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return Pn.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Pn.JSONParserErrorGroup}});var Mq=no(),li=Ia(qq()),s8=BR();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return s8.getJsonSchemaRefParserDefaultOptions}});var ao=class t{constructor(){this.schema=null,this.$refs=new $q.default}async parse(){let e=(0,Cd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,Mq.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,li.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new $q.default;let n="http";if(Oa.isFileSystemPath(e.path))e.path=Oa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Oa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Oa.resolve(Oa.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,r8.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,li.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,li.default)(e.callback,Promise.resolve(this.schema));throw Mq.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Pn.isHandledError)(i)?(0,li.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Oa.stripHash(e.path)]&&this.$refs._$refs[Oa.stripHash(e.path)].addError(i),(0,li.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Cd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,n8.default)(this,e.options),KR(this),(0,li.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,li.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Cd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,i8.default)(this,e.options),KR(this),(0,li.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,li.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Cd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Nq.default)(this,e.options),KR(this),(0,li.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,li.default)(e.callback,Promise.reject(r))}}};we.$RefParser=ao;we.default=ao;function KR(t){if(Pn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Pn.JSONParserErrorGroup(t)}we.parse=ao.parse;we.resolve=ao.resolve;we.bundle=ao.bundle;we.dereference=ao.dereference});var Ag,kc,QR=se(()=>{"use strict";Ag=_b(Dq()),kc=class{async resolve(e){try{return await Ag.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await Ag.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Ag.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as Fq from"fs";var Lq,o8,Tc,ZR=se(()=>{"use strict";Lq=_b(M_());bn();D_();QR();o8=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Tc=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new mc,this.refResolver=new kc}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await Fq.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=Lq.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:dt(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let g=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);g&&(f.auth=g)}let d=new Map;if(i.tags)for(let g of i.tags){let y={type:"folder",id:dt(g.name),name:g.name,description:g.description,items:[]};d.set(g.name,y),f.items.push(y)}if(i.paths)for(let[g,y]of Object.entries(i.paths))for(let S of["get","post","put","patch","delete","head","options","trace"]){let _=y[S];if(!_)continue;let R=this.processOperation(S,g,_,y,i,s),P=_.tags?.[0];if(P&&d.has(P))d.get(P).items.push(R);else if(P){let A={type:"folder",id:dt(P),name:P,items:[R]};d.set(P,A),f.items.push(A)}else f.items.push(R)}await this.collectionService.saveCollection(f);let m;return r?.environmentName&&i.servers&&(m=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:m}}processOperation(e,r,n,i,s,a){let l=dt(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,m=n.deprecated===!0;m&&(d=`[DEPRECATED] ${d}`);let g={type:"request",id:l,name:d,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:m},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(g,y,a),n.requestBody&&this.processRequestBody(g,n.requestBody,a),n.responses&&(g.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)g.auth={type:"none"};else if(n.security&&n.security.length>0){let S=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);S&&(g.auth=S)}}return g}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},l=[];for(let f of r){let d=f.name,m=f.in,g=f.schema||{},y=f.example!==void 0?String(f.example):this.generateExampleForParam(g,n),S=f.deprecated===!0;switch(m){case"path":{if(f.description||g.type||g.format||g.enum||S||g.pattern||g.minimum!==void 0||g.maximum!==void 0||g.minLength!==void 0||g.maxLength!==void 0||g.multipleOf!==void 0||g.minItems!==void 0||g.maxItems!==void 0||g.uniqueItems||g.nullable||g.oneOf){let R={value:y};g.oneOf?(R.oneOf=g.oneOf,this.applyOneOfHints(R,g.oneOf)):(g.type&&(R.type=g.type),g.format&&(R.format=g.format),g.enum&&(R.enum=g.enum.map(String)),g.pattern&&(R.pattern=g.pattern),g.minimum!==void 0&&(R.minimum=g.minimum),g.maximum!==void 0&&(R.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(R.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(R.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(R.multipleOf=g.multipleOf),g.minLength!==void 0&&(R.minLength=g.minLength),g.maxLength!==void 0&&(R.maxLength=g.maxLength),g.minItems!==void 0&&(R.minItems=g.minItems),g.maxItems!==void 0&&(R.maxItems=g.maxItems),g.uniqueItems&&(R.uniqueItems=!0),g.nullable&&(R.nullable=!0)),f.description&&(R.description=f.description),S&&(R.deprecated=!0),a[d]=R}else a[d]=y;break}case"query":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),s.push(_);break}case"header":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),i.push(_);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},a){let m=this.generateBodyContent(a,s,n);m!==void 0&&(e.body.content=typeof m=="string"?m:JSON.stringify(m,null,2)),l==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),l==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of o8)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,l]of Object.entries(i)){let f=l,d=f.type==="string"&&f.format==="binary",m={key:a,value:d?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:d?"file":"text",enabled:!0};n.push(m)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let d=e.content[f],m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),d.encoding&&(m.encoding=d.encoding),a.content[f]=m}}s.encoding&&(a.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(a.components=l),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let l=a,f={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let m=d[0],g=l.content[m];f.contentType=m,g.schema&&(f.schema=g.schema),g.examples&&(f.examples=g.examples),g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}else{f.content={};for(let m of d){let g=l.content[m],y={};g.schema&&(y.schema=g.schema),g.examples&&(y.examples=g.examples),f.content[m]=y,g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}}}if(l.headers){f.headers={};for(let[d,m]of Object.entries(l.headers)){let g=m;f.headers[d]={...g.description&&{description:g.description},schema:g.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},l="client_credentials";return s.authorizationCode?l="authorization_code":s.password?l="password":s.implicit&&(l="implicit"),{type:"oauth2",oauth2:{grantType:l,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var Ac,XR=se(()=>{"use strict";Ac=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,l;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),l="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:l,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),l=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,d=r.slice(1);if(!e.properties[l])if(a)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let m=n.typeHints[f];e.properties[l]={type:m||"string"};return}if(d.length>0){let m=a?e.properties[l].items:e.properties[l];m&&this.ensureFieldPath(m,d,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}}});var jq,qg,Uq,Hq,Bq,Vq,Wq,qc,ex=se(()=>{"use strict";jq=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,qg="(?:pm|hf|ctx)",Uq=new RegExp(`${qg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),Hq=new RegExp(`${qg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),Bq=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,Vq=new RegExp(`${qg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),Wq=new RegExp(`${qg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),qc=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(jq.source,jq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(Uq.source,Uq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(Hq.source,Hq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let l=this.parseAssertionValue(a);l!==void 0&&(r.valueHints[s]=l,typeof l=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof l=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(Vq.source,Vq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(Wq.source,Wq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(Bq.source,Bq.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var zq={};qs(zq,{AwsSecretResolver:()=>$g});var $g,tx=se(()=>{"use strict";$g=class{providerName="aws";region;moduleRequire;constructor(e,r){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=r??(n=>it(n))}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:a}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new a({SecretId:n})),d=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let m=JSON.parse(d);return m[i]!==void 0?String(m[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var Jq={};qs(Jq,{AzureKeyVaultResolver:()=>Mg});var Mg,rx=se(()=>{"use strict";Mg=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,r){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=r??(i=>it(i))}async resolve(e){if(!this.vaultUrl)throw new Error("[HTTP Forge] Azure Key Vault resolver: no vault URL configured. Set secrets.providers.<alias>.vaultUrl or the AZURE_KEYVAULT_URL env var.");let r=e.split("/"),n=r[0],i=r[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:a}=this.moduleRequire("@azure/identity"),l=new a;return(await new s(this.vaultUrl,l).getSecret(n,i?{version:i}:{})).value}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] Azure Key Vault resolver requires @azure/keyvault-secrets and @azure/identity. Install them: npm install @azure/keyvault-secrets @azure/identity"):s}}}});var Gq={};qs(Gq,{HashiCorpVaultResolver:()=>Ng});var Ng,nx=se(()=>{"use strict";Ng=class{providerName="vault";address;mountPath;namespace;constructor(e){this.address=(e.address??process.env.VAULT_ADDR??"http://127.0.0.1:8200").replace(/\/$/,""),this.mountPath=e.mountPath??"secret",this.namespace=e.namespace??process.env.VAULT_NAMESPACE}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0,s=process.env.VAULT_TOKEN;if(!s)throw new Error("[HTTP Forge] HashiCorp Vault resolver requires VAULT_TOKEN environment variable to be set.");let a=`${this.address}/v1/${this.mountPath}/data/${n}`,l={"X-Vault-Token":s};this.namespace&&(l["X-Vault-Namespace"]=this.namespace);let f;try{f=await fetch(a,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let m=(await f.json())?.data?.data;if(!m)return;if(i)return m[i]!==void 0?String(m[i]):void 0;if("value"in m)return String(m.value);let g=Object.keys(m);return g.length===1?String(m[g[0]]):void 0}}});var Yq={};qs(Yq,{OnePasswordResolver:()=>Dg});import{execFile as a8}from"child_process";import{promisify as l8}from"util";var c8,Dg,ix=se(()=>{"use strict";c8=l8(a8),Dg=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let r=e.split("/"),n,i,s;if(this.defaultVault){if(r.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=r.slice(0,r.length-1).join("/"),s=r[r.length-1]}else{if(r.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=r[0],i=r.slice(1,r.length-1).join("/"),s=r[r.length-1]}let a=await this.tryResolveSdk(n,i,s);return a!==null?a:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,r,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=it("@1password/sdk"),a=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await a.secrets.resolve(l)}catch(s){if(s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND")return null;throw new Error(`[HTTP Forge] 1Password SDK error for "${e}/${r}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,r,n){try{let{stdout:i}=await c8("op",["item","get",r,"--vault",e,"--field",n,"--format","json"],{env:{...process.env},timeout:1e4}),s=JSON.parse(i.trim());return typeof s=="string"?s:s&&typeof s.value=="string"?s.value:void 0}catch(i){if(i?.code==="ENOENT")throw new Error("[HTTP Forge] 1Password resolver requires either the @1password/sdk npm package or the `op` CLI to be installed.\n Service Account: set OP_SERVICE_ACCOUNT_TOKEN and install @1password/sdk\n CLI: install 1Password CLI and run `op signin`");if(i?.stderr?.includes("not found")||i?.code===1)return;throw new Error(`[HTTP Forge] 1Password CLI error: ${i?.message??i}`)}}}});var Kq={};qs(Kq,{GcpSecretResolver:()=>Fg});var Fg,sx=se(()=>{"use strict";Fg=class{providerName="gcp";projectId;moduleRequire;constructor(e,r){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=r??(n=>it(n))}async resolve(e){let r=e.split("/"),n=r[0],i=r[1]==="versions"&&r[2]?r[2]:"latest";if(!this.projectId)throw new Error("[HTTP Forge] GCP secret resolver: no projectId configured and GOOGLE_CLOUD_PROJECT env var is not set.");try{let{SecretManagerServiceClient:s}=this.moduleRequire("@google-cloud/secret-manager"),a=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await a.accessSecretVersion({name:l}),d=f.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var Zq={};qs(Zq,{DopplerResolver:()=>Lg});import*as Qq from"https";var Lg,ox=se(()=>{"use strict";Lg=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let r=e.trim().toUpperCase(),n=this.token;if(!n)throw new Error("[HTTP Forge] Doppler secret resolver: no service token found. Set DOPPLER_TOKEN env var or add serviceToken to config.");let i=`https://api.doppler.com/v3/configs/config/secret?name=${encodeURIComponent(r)}`;return new Promise((s,a)=>{let l=Qq.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let d=[];f.on("data",m=>d.push(m)),f.on("end",()=>{let m=Buffer.concat(d).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){a(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${m}`));return}try{let y=JSON.parse(m)?.value?.computed;s(y!=null?String(y):void 0)}catch{a(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",a),l.end()})}}});import*as jg from"fs";import{createRequire as u8}from"module";import*as Xq from"path";var Ed,ax=se(()=>{"use strict";Ed=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let r;try{r=e.getConfig().secrets}catch{return}if(!(!r?.providers||typeof r.providers!="object"))for(let[n,i]of Object.entries(r.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,r){let n=r??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async a=>{if(n.has(a))return;let l=a.slice(7),f=l.indexOf("/");if(f<0)return;let d=l.slice(0,f),m=l.slice(f+1),g=this.resolvers.get(d);if(g)try{let y=await g.resolve(m);y!==void 0&&n.set(a,y)}catch(y){let S=y?.message??String(y);console.warn(`[HTTP Forge] {{${a}}} could not be resolved: ${S}`)}}));let s={};for(let[a,l]of n.entries())s[a]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,r){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)r.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,r)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,r))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:r}=(tx(),El(zq));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(rx(),El(Jq));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(nx(),El(Gq));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(ix(),El(Yq));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(sx(),El(Kq));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(ox(),El(Zq));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>it(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=Xq.resolve(i,"package.json");if(jg.existsSync(s)){let a=jg.realpathSync(s),l=u8(a);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});var Od,lx=se(()=>{"use strict";Od={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Tt from"fs";import*as lo from"path";var Id,cx=se(()=>{"use strict";bn();lx();Id=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Tt.existsSync(this.suitesDir)||Tt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Tt.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!Tt.existsSync(this.suitesDir))return;let e=Tt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=lo.join(this.suitesDir,r),i=Tt.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:dt(e),name:e,requests:r,config:{...Od},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=lo.join(this.suitesDir,e),a=lo.join(this.suitesDir,i.id);return Tt.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Tt.existsSync(r)||Tt.mkdirSync(r,{recursive:!0});for(let n of Tt.readdirSync(e,{withFileTypes:!0})){let i=lo.join(e,n.name),s=lo.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Tt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=lo.join(this.suitesDir,n);try{return Tt.existsSync(i)&&Tt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Od},isTemporary:!0,createdAt:i,updatedAt:i}}async createTempSuiteFromFolder(e,r,n=!0){let i=this.collectionService.getCollection(e);if(!i){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let s=[];this.extractRequestsFromCollection(i,e,i.name,"",s);let a=r.replace(/\/+$/,""),l=s.filter(m=>n?m.folderPath===a||m.folderPath.startsWith(`${a}/`):m.folderPath===a);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(a)}`,name:`${i.name} / ${a}`,requests:l,config:{...Od},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:dt(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=lo.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Tt.writeFileSync(n,i,"utf-8")}}});var re,Ug=se(()=>{"use strict";re={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});import*as e$ from"path";function Hg(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:l,browserService:f,applicationInfo:d,consoleService:m}=e;t.registerValue(re.WorkspaceFolder,r),t.registerSingleton(re.Config,()=>new tc(r,n,i)),t.registerSingleton(re.Console,()=>m??f8),t.registerSingleton(re.EnvironmentConfig,y=>new Pf(r,s,y.resolve(re.Config),n,l)),t.registerSingleton(re.Cookie,()=>new Ef(a)),t.registerSingleton(re.Collection,y=>new Cf(r,y.resolve(re.Config),n)),t.registerSingleton(re.TestSuite,y=>new Id(y.resolve(re.Collection),y.resolve(re.Config))),t.registerSingleton(re.HttpClient,()=>new Ko),t.registerSingleton(re.UrlBuilder,()=>new Vn),t.registerSingleton(re.InterceptorChain,()=>new Yi),t.registerSingleton(re.HttpRequest,y=>new Gi(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),t.registerSingleton(re.RequestPreprocessor,()=>new ca),t.registerSingleton(re.RequestHistory,y=>{let S=y.resolve(re.EnvironmentConfig);return new qf(S.getHistoriesPath(),e$.join(S.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(re.OAuth2TokenManager,y=>new _f(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),t.registerSingleton(re.GraphQLSchemaService,y=>new Tf(y.resolve(re.HttpClient))),t.registerSingleton(re.SecretResolverRegistry,y=>new Ed(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(re.RequestPreparer,y=>new kf(y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest),y.resolve(re.RequestPreprocessor),y.has(re.OAuth2TokenManager)?y.resolve(re.OAuth2TokenManager):void 0,g,y.resolve(re.SecretResolverRegistry))),t.registerSingleton(re.ScriptExecutor,y=>{let S=y.resolve(re.Config);return new es(y.resolve(re.HttpRequest),S.getModulePaths(),y.resolve(re.SecretResolverRegistry),S.getScriptScope(),S.getScriptTimeout())}),t.registerSingleton(re.DataFileParser,()=>new fa),t.registerSingleton(re.CollectionRequestExecutor,y=>new Ws(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),t.registerSingleton(re.PersistentCookieJar,y=>new Of(y.resolve(re.Cookie))),t.registerSingleton(re.SchemaInferrer,()=>new ro),t.registerSingleton(re.HistoryAnalyzer,y=>new rc(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.ScriptAnalyzer,()=>new qc),t.registerSingleton(re.SchemaInferenceService,y=>new Ac(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.OpenApiExporter,y=>new hc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),t.registerSingleton(re.OpenApiImporter,y=>new Tc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var f8,ux=se(()=>{"use strict";q0();F0();j0();U0();H0();V0();em();W0();z0();X0();Nu();Du();Mu();Yh();Il();ew();N_();ZR();XR();ng();ex();Kh();vf();ax();cx();Ug();f8={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function t$(){return Pa.instance}var Pa,fx=se(()=>{"use strict";Ug();Pa=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(re.Config)}get console(){return this.resolve(re.Console)}get environmentConfig(){return this.resolve(re.EnvironmentConfig)}get collection(){return this.resolve(re.Collection)}get httpRequest(){return this.resolve(re.HttpRequest)}get httpClient(){return this.resolve(re.HttpClient)}get cookie(){return this.resolve(re.Cookie)}get requestHistory(){return this.resolve(re.RequestHistory)}get dataFileParser(){return this.resolve(re.DataFileParser)}get scriptExecutor(){return this.resolve(re.ScriptExecutor)}get requestPreparer(){return this.resolve(re.RequestPreparer)}get persistentCookieJar(){return this.resolve(re.PersistentCookieJar)}get oauth2TokenManager(){return this.has(re.OAuth2TokenManager)?this.resolve(re.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(re.GraphQLSchemaService)}get testSuite(){return this.resolve(re.TestSuite)}}});import{createHash as d8}from"crypto";function us(t,e=40){let r=d8("sha256").update(t,"utf8").digest("hex").slice(0,p8);return t.substring(0,e)+"_"+r}function m8(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function ka(t,e=h8){return m8(t,e)?t:us(t,e-20)}function dx(t,e,r){let n=`${t}request__${ka(e)}__${ka(r)}`;return n.length<=Bg?n:`${t}request__${us(e)}__${us(r)}`}function px(t,e){let r=`${t}collection__${ka(e,100)}`;return r.length<=Bg?r:`${t}collection__${us(e,80)}`}function hx(t,e,r){let n=`${t}folder__${ka(e)}__${ka(r)}`;return n.length<=Bg?n:`${t}folder__${us(e)}__${us(r)}`}function mx(t,e){let r=`${t}suite__${ka(e,100)}`;return r.length<=Bg?r:`${t}suite__${us(e,80)}`}function gx(t){for(let e of["request","collection","folder","suite"]){let r=`${e}__`;if(t.startsWith(r))return{kind:e,tokens:t.slice(r.length).split("__")}}throw new Error(`Unknown MCP tool name: ${t}`)}function $c(t,e){for(let r of e)if(us(r)===t)return r;for(let r of e)if(r===t)return r}function yx(t,e){let r=$c(t,e);if(r!==void 0)return r;try{let n=Buffer.from(t,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function vx(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function bx(t,e){return`Run all ${e} requests in the "${t}" collection.`}function Sx(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function wx(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var p8,h8,Bg,_x=se(()=>{"use strict";p8=12,h8=60,Bg=126});function r$(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Rx(t,e,r){let n=i=>r$("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${zr.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_requests or run_* tools.",inputSchema:{type:"object",properties:{}}},{name:`${t}${zr.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'}},required:["collection"]}},{name:`${t}${zr.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests if unsure of the exact name."},...Vg.properties},required:["collection","request"]}},{name:`${t}${zr.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...zg.properties},required:["collection","folder"]}},{name:`${t}${zr.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Wg.properties},required:["collection"]}},{name:`${t}${zr.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:r$("Name of the test suite to run.",r),...Jg.properties},required:["suite"]}}]}var Vg,Wg,zg,Jg,zr,xx=se(()=>{"use strict";Vg={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},Wg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}},zg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},recursive:{type:"boolean",description:"Include requests in nested subfolders (default: true)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}},Jg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},zr={listCollections:"list_collections",listRequests:"list_requests",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite"}});var Mc,Cx=se(()=>{"use strict";Bo();Mc=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())at.isExpired(n)||(!n.domain||at.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!at.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())at.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=at.extractDomain(e),i=at.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=at.extractDomain(e),n=at.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return at.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Gg(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function g8(t){return{index:t.i,iteration:t.it,name:t.n,method:Nc[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Gg(t.i,t.it,t.r),error:t.e}}var Ex,Nc,Yg=se(()=>{"use strict";Ex={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Nc={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Fc from"fs/promises";import*as Dc from"path";function yt(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ta(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function Ox(t){try{return new Date(t).toLocaleString()}catch{return t}}function Kg(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function y8(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function s$(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}function n$(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${Object.entries(t).map(([r,n])=>{let i=Array.isArray(n)?n.join(", "):String(n??"");return`<tr><td class="kv-key">${yt(r)}</td><td class="kv-val">${yt(i)}</td></tr>`}).join("")}</table>`}function v8(t){return t==null||t===""?'<span class="dim">\u2014</span>':typeof t=="string"?yt(t):typeof t=="number"||typeof t=="boolean"?yt(String(t)):`<pre class="code">${yt(s$(t))}</pre>`}function Ix(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table meta-table">${Object.entries(t).map(([r,n])=>`
277
+ `)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Pg.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Rd.resolve(t.href,i.headers.location);return gq(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new mq.ResolverError((0,Pg.ono)(i,`Error downloading ${t.href}`),t.href)}}async function b9(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var BR=F(cs=>{"use strict";var Ic=cs&&cs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cs,"__esModule",{value:!0});cs.getNewOptions=cs.getJsonSchemaRefParserDefaultOptions=void 0;var S9=Ic(V1()),w9=Ic(lq()),_9=Ic(cq()),R9=Ic(uq()),x9=Ic(hq()),C9=Ic(yq()),E9=()=>({parse:{json:{...S9.default},yaml:{...w9.default},text:{..._9.default},binary:{...R9.default}},resolve:{file:{...x9.default},http:{...C9.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});cs.getJsonSchemaRefParserDefaultOptions=E9;var O9=t=>{let e=(0,cs.getJsonSchemaRefParserDefaultOptions)();return t&&bq(e,t),e};cs.getNewOptions=O9;function bq(t,e){if(vq(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];vq(s)?t[i]=bq(a||{},s):s!==void 0&&(t[i]=s)}}return t}function vq(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var wq=F(kg=>{"use strict";Object.defineProperty(kg,"__esModule",{value:!0});kg.normalizeArgs=Sq;var I9=BR();function Sq(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,I9.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}kg.default=Sq});var _q=F(si=>{"use strict";var P9=si&&si.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),k9=si&&si.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T9=si&&si.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&P9(r,e,n[i]);return k9(r,e),r}})(),VR=si&&si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(si,"__esModule",{value:!0});var A9=VR(Sc()),q9=VR(dd()),$9=VR(oR()),Pc=T9(On()),M9=In();function N9(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=WR(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function WR(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),A9.default.isExternal$Ref(t)&&a.push(D9(t,e,r,n));let l=Object.keys(t);for(let f of l){let d=q9.default.join(e,f),m=t[f];a=a.concat(WR(m,d,r,n,i,s))}}return a}async function D9(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Pc.resolve(i?Pc.cwd():e,t.$ref),a=Pc.stripHash(s),l=r._$refs[a];if(l)return Promise.resolve(l.value);try{let f=await(0,$9.default)(s,r,n),d=WR(f,a+"#",r,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,M9.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Pc.stripHash(e)),f.path=Pc.safePointerToPath(Pc.getHash(e))),[]}}si.default=N9});var Cq=F(oi=>{"use strict";var F9=oi&&oi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L9=oi&&oi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),j9=oi&&oi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&F9(r,e,n[i]);return L9(r,e),r}})(),xq=oi&&oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oi,"__esModule",{value:!0});var Tg=xq(Sc()),xd=xq(dd()),zR=j9(On());function U9(t,e){let r=[];JR(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),H9(r)}function JR(t,e,r,n,i,s,a,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Tg.default.isAllowed$Ref(f))Rq(t,e,r,n,i,s,a,l);else{let d=Object.keys(f).sort((m,g)=>m==="definitions"?-1:g==="definitions"?1:m.length-g.length);for(let m of d){let g=xd.default.join(r,m),y=xd.default.join(n,m),S=f[m];Tg.default.isAllowed$Ref(S)?Rq(f,m,r,y,i,s,a,l):JR(f,m,g,y,i,s,a,l)}}}function Rq(t,e,r,n,i,s,a,l){let f=e===null?t:t[e],d=zR.resolve(r,f.$ref),m=a._resolve(d,n,l);if(m===null)return;let y=xd.default.parse(n).length,S=zR.stripHash(m.path),_=zR.getHash(m.path),R=S!==a._root$Ref.path,P=Tg.default.isExtended$Ref(f);i+=m.indirections;let A=B9(s,t,e);if(A)if(y<A.depth||i<A.indirections)V9(s,A);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:y,file:S,hash:_,value:m.value,circular:m.circular,extended:P,external:R,indirections:i}),(!A||R)&&JR(m.value,null,m.path,n,i+1,s,a,l)}function H9(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return a!==l?l-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=xd.default.join(n,xd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Tg.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function B9(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function V9(t,e){let r=t.indexOf(e);t.splice(r,1)}oi.default=U9});var Tq=F(ai=>{"use strict";var W9=ai&&ai.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),z9=ai&&ai.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),J9=ai&&ai.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&W9(r,e,n[i]);return z9(r,e),r}})(),Pq=ai&&ai.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ai,"__esModule",{value:!0});var Ag=Pq(Sc()),Eq=Pq(dd()),G9=io(),Oq=J9(On()),Y9=In();ai.default=K9;function K9(t,e){let r=Date.now(),n=GR(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function GR(t,e,r,n,i,s,a,l,f){let d,m={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new Y9.TimeoutError(l.timeoutMs);let g=l.dereference||{},y=g.excludedPathMatcher||(()=>!1);if((g?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),Ag.default.isAllowed$Ref(t,l))d=Iq(t,e,r,n,i,s,a,l,f),m.circular=d.circular,m.value=d.value;else for(let S of Object.keys(t)){let _=Eq.default.join(e,S),R=Eq.default.join(r,S);if(y(R))continue;let P=t[S],A=!1;if(Ag.default.isAllowed$Ref(P,l)){if(d=Iq(P,_,R,n,i,s,a,l,f),A=d.circular,t[S]!==d.value){let U=new Map;g?.preservedProperties&&typeof t[S]=="object"&&!Array.isArray(t[S])&&g?.preservedProperties.forEach(B=>{B in t[S]&&U.set(B,t[S][B])}),t[S]=d.value,g?.preservedProperties&&U.size&&typeof t[S]=="object"&&!Array.isArray(t[S])&&U.forEach((B,V)=>{t[S][V]=B}),g?.onDereference?.(P.$ref,t[S],t,S)}}else n.has(P)?A=kq(_,a,l):(d=GR(P,_,R,n,i,s,a,l,f),A=d.circular,t[S]!==d.value&&(t[S]=d.value));m.circular=m.circular||A}n.delete(t)}return m}function Iq(t,e,r,n,i,s,a,l,f){let m=Ag.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",g=Oq.resolve(m?Oq.cwd():e,t.$ref),y=s.get(g);if(y&&!y.circular){let U=Object.keys(t);if(U.length>1){let B={};for(let V of U)V!=="$ref"&&!(V in y.value)&&(B[V]=t[V]);return{circular:y.circular,value:Object.assign({},y.value,B)}}return y}let S=a._resolve(g,e,l);if(S===null)return{circular:!1,value:null};let _=S.circular,R=_||n.has(S.value);R&&kq(e,a,l);let P=Ag.default.dereference(t,S.value);if(!R){let U=GR(P,S.path,r,n,i,s,a,l,f);R=U.circular,P=U.value}R&&!_&&l.dereference?.circular==="ignore"&&(P=t),_&&(P.$ref=r);let A={circular:R,value:P};return Object.keys(t).length===1&&s.set(g,A),A}function kq(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw G9.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var Aq=F(YR=>{"use strict";Object.defineProperty(YR,"__esModule",{value:!0});function Q9(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}YR.default=Q9()});var $q=F(Cd=>{"use strict";var Z9=Cd&&Cd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cd,"__esModule",{value:!0});Cd.default=X9;var qq=Z9(Aq());function X9(t,e){if(t){e.then(function(r){(0,qq.default)(function(){t(null,r)})},function(r){(0,qq.default)(function(){t(r)})});return}else return e}});var Fq=F(we=>{"use strict";var e8=we&&we.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),t8=we&&we.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),r8=we&&we.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&e8(r,e,n[i]);return t8(r,e),r}})(),Ia=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var Mq=Ia(L1()),n8=Ia(oR()),Ed=Ia(wq());we.jsonSchemaParserNormalizeArgs=Ed.default;var i8=Ia(_q()),s8=Ia(Cq()),Dq=Ia(Tq());we.dereferenceInternal=Dq.default;var Oa=r8(On()),Pn=In();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return Pn.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return Pn.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return Pn.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return Pn.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return Pn.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return Pn.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return Pn.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return Pn.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Pn.JSONParserErrorGroup}});var Nq=io(),li=Ia($q()),o8=BR();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return o8.getJsonSchemaRefParserDefaultOptions}});var lo=class t{constructor(){this.schema=null,this.$refs=new Mq.default}async parse(){let e=(0,Ed.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,Nq.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,li.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new Mq.default;let n="http";if(Oa.isFileSystemPath(e.path))e.path=Oa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Oa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Oa.resolve(Oa.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,n8.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,li.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,li.default)(e.callback,Promise.resolve(this.schema));throw Nq.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Pn.isHandledError)(i)?(0,li.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Oa.stripHash(e.path)]&&this.$refs._$refs[Oa.stripHash(e.path)].addError(i),(0,li.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Ed.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,i8.default)(this,e.options),KR(this),(0,li.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,li.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Ed.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,s8.default)(this,e.options),KR(this),(0,li.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,li.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Ed.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Dq.default)(this,e.options),KR(this),(0,li.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,li.default)(e.callback,Promise.reject(r))}}};we.$RefParser=lo;we.default=lo;function KR(t){if(Pn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Pn.JSONParserErrorGroup(t)}we.parse=lo.parse;we.resolve=lo.resolve;we.bundle=lo.bundle;we.dereference=lo.dereference});var qg,kc,QR=se(()=>{"use strict";qg=_b(Fq()),kc=class{async resolve(e){try{return await qg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await qg.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await qg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as Lq from"fs";var jq,a8,Tc,ZR=se(()=>{"use strict";jq=_b(M_());bn();D_();QR();a8=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Tc=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new mc,this.refResolver=new kc}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await Lq.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=jq.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:dt(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let g=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);g&&(f.auth=g)}let d=new Map;if(i.tags)for(let g of i.tags){let y={type:"folder",id:dt(g.name),name:g.name,description:g.description,items:[]};d.set(g.name,y),f.items.push(y)}if(i.paths)for(let[g,y]of Object.entries(i.paths))for(let S of["get","post","put","patch","delete","head","options","trace"]){let _=y[S];if(!_)continue;let R=this.processOperation(S,g,_,y,i,s),P=_.tags?.[0];if(P&&d.has(P))d.get(P).items.push(R);else if(P){let A={type:"folder",id:dt(P),name:P,items:[R]};d.set(P,A),f.items.push(A)}else f.items.push(R)}await this.collectionService.saveCollection(f);let m;return r?.environmentName&&i.servers&&(m=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:m}}processOperation(e,r,n,i,s,a){let l=dt(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,m=n.deprecated===!0;m&&(d=`[DEPRECATED] ${d}`);let g={type:"request",id:l,name:d,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:m},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(g,y,a),n.requestBody&&this.processRequestBody(g,n.requestBody,a),n.responses&&(g.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)g.auth={type:"none"};else if(n.security&&n.security.length>0){let S=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);S&&(g.auth=S)}}return g}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},l=[];for(let f of r){let d=f.name,m=f.in,g=f.schema||{},y=f.example!==void 0?String(f.example):this.generateExampleForParam(g,n),S=f.deprecated===!0;switch(m){case"path":{if(f.description||g.type||g.format||g.enum||S||g.pattern||g.minimum!==void 0||g.maximum!==void 0||g.minLength!==void 0||g.maxLength!==void 0||g.multipleOf!==void 0||g.minItems!==void 0||g.maxItems!==void 0||g.uniqueItems||g.nullable||g.oneOf){let R={value:y};g.oneOf?(R.oneOf=g.oneOf,this.applyOneOfHints(R,g.oneOf)):(g.type&&(R.type=g.type),g.format&&(R.format=g.format),g.enum&&(R.enum=g.enum.map(String)),g.pattern&&(R.pattern=g.pattern),g.minimum!==void 0&&(R.minimum=g.minimum),g.maximum!==void 0&&(R.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(R.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(R.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(R.multipleOf=g.multipleOf),g.minLength!==void 0&&(R.minLength=g.minLength),g.maxLength!==void 0&&(R.maxLength=g.maxLength),g.minItems!==void 0&&(R.minItems=g.minItems),g.maxItems!==void 0&&(R.maxItems=g.maxItems),g.uniqueItems&&(R.uniqueItems=!0),g.nullable&&(R.nullable=!0)),f.description&&(R.description=f.description),S&&(R.deprecated=!0),a[d]=R}else a[d]=y;break}case"query":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),s.push(_);break}case"header":{let _={key:d,value:y};this.applySchemaConstraints(_,g,f,S),i.push(_);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},a){let m=this.generateBodyContent(a,s,n);m!==void 0&&(e.body.content=typeof m=="string"?m:JSON.stringify(m,null,2)),l==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),l==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of a8)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,l]of Object.entries(i)){let f=l,d=f.type==="string"&&f.format==="binary",m={key:a,value:d?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:d?"file":"text",enabled:!0};n.push(m)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let d=e.content[f],m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),d.encoding&&(m.encoding=d.encoding),a.content[f]=m}}s.encoding&&(a.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(a.components=l),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let l=a,f={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let m=d[0],g=l.content[m];f.contentType=m,g.schema&&(f.schema=g.schema),g.examples&&(f.examples=g.examples),g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}else{f.content={};for(let m of d){let g=l.content[m],y={};g.schema&&(y.schema=g.schema),g.examples&&(y.examples=g.examples),f.content[m]=y,g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}}}if(l.headers){f.headers={};for(let[d,m]of Object.entries(l.headers)){let g=m;f.headers[d]={...g.description&&{description:g.description},schema:g.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},l="client_credentials";return s.authorizationCode?l="authorization_code":s.password?l="password":s.implicit&&(l="implicit"),{type:"oauth2",oauth2:{grantType:l,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var Ac,XR=se(()=>{"use strict";Ac=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,l;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),l="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:l,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),l=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,d=r.slice(1);if(!e.properties[l])if(a)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let m=n.typeHints[f];e.properties[l]={type:m||"string"};return}if(d.length>0){let m=a?e.properties[l].items:e.properties[l];m&&this.ensureFieldPath(m,d,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}}});var Uq,$g,Hq,Bq,Vq,Wq,zq,qc,ex=se(()=>{"use strict";Uq=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,$g="(?:pm|hf|ctx)",Hq=new RegExp(`${$g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),Bq=new RegExp(`${$g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),Vq=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,Wq=new RegExp(`${$g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),zq=new RegExp(`${$g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),qc=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(Uq.source,Uq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(Hq.source,Hq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(Bq.source,Bq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let l=this.parseAssertionValue(a);l!==void 0&&(r.valueHints[s]=l,typeof l=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof l=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(Wq.source,Wq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(zq.source,zq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(Vq.source,Vq.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var Jq={};qs(Jq,{AwsSecretResolver:()=>Mg});var Mg,tx=se(()=>{"use strict";Mg=class{providerName="aws";region;moduleRequire;constructor(e,r){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=r??(n=>it(n))}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:a}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new a({SecretId:n})),d=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let m=JSON.parse(d);return m[i]!==void 0?String(m[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var Gq={};qs(Gq,{AzureKeyVaultResolver:()=>Ng});var Ng,rx=se(()=>{"use strict";Ng=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,r){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=r??(i=>it(i))}async resolve(e){if(!this.vaultUrl)throw new Error("[HTTP Forge] Azure Key Vault resolver: no vault URL configured. Set secrets.providers.<alias>.vaultUrl or the AZURE_KEYVAULT_URL env var.");let r=e.split("/"),n=r[0],i=r[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:a}=this.moduleRequire("@azure/identity"),l=new a;return(await new s(this.vaultUrl,l).getSecret(n,i?{version:i}:{})).value}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] Azure Key Vault resolver requires @azure/keyvault-secrets and @azure/identity. Install them: npm install @azure/keyvault-secrets @azure/identity"):s}}}});var Yq={};qs(Yq,{HashiCorpVaultResolver:()=>Dg});var Dg,nx=se(()=>{"use strict";Dg=class{providerName="vault";address;mountPath;namespace;constructor(e){this.address=(e.address??process.env.VAULT_ADDR??"http://127.0.0.1:8200").replace(/\/$/,""),this.mountPath=e.mountPath??"secret",this.namespace=e.namespace??process.env.VAULT_NAMESPACE}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0,s=process.env.VAULT_TOKEN;if(!s)throw new Error("[HTTP Forge] HashiCorp Vault resolver requires VAULT_TOKEN environment variable to be set.");let a=`${this.address}/v1/${this.mountPath}/data/${n}`,l={"X-Vault-Token":s};this.namespace&&(l["X-Vault-Namespace"]=this.namespace);let f;try{f=await fetch(a,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let m=(await f.json())?.data?.data;if(!m)return;if(i)return m[i]!==void 0?String(m[i]):void 0;if("value"in m)return String(m.value);let g=Object.keys(m);return g.length===1?String(m[g[0]]):void 0}}});var Kq={};qs(Kq,{OnePasswordResolver:()=>Fg});import{execFile as l8}from"child_process";import{promisify as c8}from"util";var u8,Fg,ix=se(()=>{"use strict";u8=c8(l8),Fg=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let r=e.split("/"),n,i,s;if(this.defaultVault){if(r.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=r.slice(0,r.length-1).join("/"),s=r[r.length-1]}else{if(r.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=r[0],i=r.slice(1,r.length-1).join("/"),s=r[r.length-1]}let a=await this.tryResolveSdk(n,i,s);return a!==null?a:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,r,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=it("@1password/sdk"),a=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await a.secrets.resolve(l)}catch(s){if(s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND")return null;throw new Error(`[HTTP Forge] 1Password SDK error for "${e}/${r}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,r,n){try{let{stdout:i}=await u8("op",["item","get",r,"--vault",e,"--field",n,"--format","json"],{env:{...process.env},timeout:1e4}),s=JSON.parse(i.trim());return typeof s=="string"?s:s&&typeof s.value=="string"?s.value:void 0}catch(i){if(i?.code==="ENOENT")throw new Error("[HTTP Forge] 1Password resolver requires either the @1password/sdk npm package or the `op` CLI to be installed.\n Service Account: set OP_SERVICE_ACCOUNT_TOKEN and install @1password/sdk\n CLI: install 1Password CLI and run `op signin`");if(i?.stderr?.includes("not found")||i?.code===1)return;throw new Error(`[HTTP Forge] 1Password CLI error: ${i?.message??i}`)}}}});var Qq={};qs(Qq,{GcpSecretResolver:()=>Lg});var Lg,sx=se(()=>{"use strict";Lg=class{providerName="gcp";projectId;moduleRequire;constructor(e,r){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=r??(n=>it(n))}async resolve(e){let r=e.split("/"),n=r[0],i=r[1]==="versions"&&r[2]?r[2]:"latest";if(!this.projectId)throw new Error("[HTTP Forge] GCP secret resolver: no projectId configured and GOOGLE_CLOUD_PROJECT env var is not set.");try{let{SecretManagerServiceClient:s}=this.moduleRequire("@google-cloud/secret-manager"),a=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await a.accessSecretVersion({name:l}),d=f.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var Xq={};qs(Xq,{DopplerResolver:()=>jg});import*as Zq from"https";var jg,ox=se(()=>{"use strict";jg=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let r=e.trim().toUpperCase(),n=this.token;if(!n)throw new Error("[HTTP Forge] Doppler secret resolver: no service token found. Set DOPPLER_TOKEN env var or add serviceToken to config.");let i=`https://api.doppler.com/v3/configs/config/secret?name=${encodeURIComponent(r)}`;return new Promise((s,a)=>{let l=Zq.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let d=[];f.on("data",m=>d.push(m)),f.on("end",()=>{let m=Buffer.concat(d).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){a(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${m}`));return}try{let y=JSON.parse(m)?.value?.computed;s(y!=null?String(y):void 0)}catch{a(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",a),l.end()})}}});import*as Ug from"fs";import{createRequire as f8}from"module";import*as e$ from"path";var Od,ax=se(()=>{"use strict";Od=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let r;try{r=e.getConfig().secrets}catch{return}if(!(!r?.providers||typeof r.providers!="object"))for(let[n,i]of Object.entries(r.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,r){let n=r??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async a=>{if(n.has(a))return;let l=a.slice(7),f=l.indexOf("/");if(f<0)return;let d=l.slice(0,f),m=l.slice(f+1),g=this.resolvers.get(d);if(g)try{let y=await g.resolve(m);y!==void 0&&n.set(a,y)}catch(y){let S=y?.message??String(y);console.warn(`[HTTP Forge] {{${a}}} could not be resolved: ${S}`)}}));let s={};for(let[a,l]of n.entries())s[a]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,r){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)r.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,r)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,r))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:r}=(tx(),El(Jq));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(rx(),El(Gq));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(nx(),El(Yq));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(ix(),El(Kq));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(sx(),El(Qq));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(ox(),El(Xq));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>it(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=e$.resolve(i,"package.json");if(Ug.existsSync(s)){let a=Ug.realpathSync(s),l=f8(a);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});var Id,lx=se(()=>{"use strict";Id={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Tt from"fs";import*as co from"path";var Pd,cx=se(()=>{"use strict";bn();lx();Pd=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Tt.existsSync(this.suitesDir)||Tt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Tt.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!Tt.existsSync(this.suitesDir))return;let e=Tt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=co.join(this.suitesDir,r),i=Tt.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:dt(e),name:e,requests:r,config:{...Id},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=co.join(this.suitesDir,e),a=co.join(this.suitesDir,i.id);return Tt.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Tt.existsSync(r)||Tt.mkdirSync(r,{recursive:!0});for(let n of Tt.readdirSync(e,{withFileTypes:!0})){let i=co.join(e,n.name),s=co.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Tt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=co.join(this.suitesDir,n);try{return Tt.existsSync(i)&&Tt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Id},isTemporary:!0,createdAt:i,updatedAt:i}}async createTempSuiteFromFolder(e,r,n=!0){let i=this.collectionService.getCollection(e);if(!i){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let s=[];this.extractRequestsFromCollection(i,e,i.name,"",s);let a=r.replace(/\/+$/,""),l=s.filter(m=>n?m.folderPath===a||m.folderPath.startsWith(`${a}/`):m.folderPath===a);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(a)}`,name:`${i.name} / ${a}`,requests:l,config:{...Id},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:dt(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=co.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Tt.writeFileSync(n,i,"utf-8")}}});var re,Hg=se(()=>{"use strict";re={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});import*as t$ from"path";function Bg(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:l,browserService:f,applicationInfo:d,consoleService:m}=e;t.registerValue(re.WorkspaceFolder,r),t.registerSingleton(re.Config,()=>new tc(r,n,i)),t.registerSingleton(re.Console,()=>m??d8),t.registerSingleton(re.EnvironmentConfig,y=>new Pf(r,s,y.resolve(re.Config),n,l)),t.registerSingleton(re.Cookie,()=>new Ef(a)),t.registerSingleton(re.Collection,y=>new Cf(r,y.resolve(re.Config),n)),t.registerSingleton(re.TestSuite,y=>new Pd(y.resolve(re.Collection),y.resolve(re.Config))),t.registerSingleton(re.HttpClient,()=>new Qo),t.registerSingleton(re.UrlBuilder,()=>new Vn),t.registerSingleton(re.InterceptorChain,()=>new Yi),t.registerSingleton(re.HttpRequest,y=>new Gi(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),t.registerSingleton(re.RequestPreprocessor,()=>new ua),t.registerSingleton(re.RequestHistory,y=>{let S=y.resolve(re.EnvironmentConfig);return new $f(S.getHistoriesPath(),t$.join(S.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(re.OAuth2TokenManager,y=>new _f(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),t.registerSingleton(re.GraphQLSchemaService,y=>new Tf(y.resolve(re.HttpClient))),t.registerSingleton(re.SecretResolverRegistry,y=>new Od(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(re.RequestPreparer,y=>new kf(y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest),y.resolve(re.RequestPreprocessor),y.has(re.OAuth2TokenManager)?y.resolve(re.OAuth2TokenManager):void 0,g,y.resolve(re.SecretResolverRegistry))),t.registerSingleton(re.ScriptExecutor,y=>{let S=y.resolve(re.Config);return new es(y.resolve(re.HttpRequest),S.getModulePaths(),y.resolve(re.SecretResolverRegistry),S.getScriptScope(),S.getScriptTimeout())}),t.registerSingleton(re.DataFileParser,()=>new da),t.registerSingleton(re.CollectionRequestExecutor,y=>new Ws(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),t.registerSingleton(re.PersistentCookieJar,y=>new Of(y.resolve(re.Cookie))),t.registerSingleton(re.SchemaInferrer,()=>new no),t.registerSingleton(re.HistoryAnalyzer,y=>new rc(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.ScriptAnalyzer,()=>new qc),t.registerSingleton(re.SchemaInferenceService,y=>new Ac(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.OpenApiExporter,y=>new hc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),t.registerSingleton(re.OpenApiImporter,y=>new Tc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var d8,ux=se(()=>{"use strict";q0();F0();j0();U0();H0();V0();rm();W0();z0();X0();Nu();Du();Mu();Qh();Il();ew();N_();ZR();XR();ig();ex();Zh();vf();ax();cx();Hg();d8={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function r$(){return Pa.instance}var Pa,fx=se(()=>{"use strict";Hg();Pa=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static createFresh(){return new t}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(re.Config)}get console(){return this.resolve(re.Console)}get environmentConfig(){return this.resolve(re.EnvironmentConfig)}get collection(){return this.resolve(re.Collection)}get httpRequest(){return this.resolve(re.HttpRequest)}get httpClient(){return this.resolve(re.HttpClient)}get cookie(){return this.resolve(re.Cookie)}get requestHistory(){return this.resolve(re.RequestHistory)}get dataFileParser(){return this.resolve(re.DataFileParser)}get scriptExecutor(){return this.resolve(re.ScriptExecutor)}get requestPreparer(){return this.resolve(re.RequestPreparer)}get persistentCookieJar(){return this.resolve(re.PersistentCookieJar)}get oauth2TokenManager(){return this.has(re.OAuth2TokenManager)?this.resolve(re.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(re.GraphQLSchemaService)}get testSuite(){return this.resolve(re.TestSuite)}}});import{createHash as p8}from"crypto";function us(t,e=40){let r=p8("sha256").update(t,"utf8").digest("hex").slice(0,h8);return t.substring(0,e)+"_"+r}function g8(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function ka(t,e=m8){return g8(t,e)?t:us(t,e-20)}function dx(t,e,r){let n=`${t}request__${ka(e)}__${ka(r)}`;return n.length<=Vg?n:`${t}request__${us(e)}__${us(r)}`}function px(t,e){let r=`${t}collection__${ka(e,100)}`;return r.length<=Vg?r:`${t}collection__${us(e,80)}`}function hx(t,e,r){let n=`${t}folder__${ka(e)}__${ka(r)}`;return n.length<=Vg?n:`${t}folder__${us(e)}__${us(r)}`}function mx(t,e){let r=`${t}suite__${ka(e,100)}`;return r.length<=Vg?r:`${t}suite__${us(e,80)}`}function gx(t){for(let e of["request","collection","folder","suite"]){let r=`${e}__`;if(t.startsWith(r))return{kind:e,tokens:t.slice(r.length).split("__")}}throw new Error(`Unknown MCP tool name: ${t}`)}function $c(t,e){for(let r of e)if(us(r)===t)return r;for(let r of e)if(r===t)return r}function yx(t,e){let r=$c(t,e);if(r!==void 0)return r;try{let n=Buffer.from(t,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function vx(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function bx(t,e){return`Run all ${e} requests in the "${t}" collection.`}function Sx(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function wx(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var h8,m8,Vg,_x=se(()=>{"use strict";h8=12,m8=60,Vg=126});function n$(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Rx(t,e,r){let n=i=>n$("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${zr.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_requests or run_* tools.",inputSchema:{type:"object",properties:{}}},{name:`${t}${zr.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'}},required:["collection"]}},{name:`${t}${zr.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests if unsure of the exact name."},...Wg.properties},required:["collection","request"]}},{name:`${t}${zr.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...Jg.properties},required:["collection","folder"]}},{name:`${t}${zr.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...zg.properties},required:["collection"]}},{name:`${t}${zr.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:n$("Name of the test suite to run.",r),...Gg.properties},required:["suite"]}}]}var Wg,zg,Jg,Gg,zr,xx=se(()=>{"use strict";Wg={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},zg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}},Jg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},recursive:{type:"boolean",description:"Include requests in nested subfolders (default: true)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}},Gg={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},zr={listCollections:"list_collections",listRequests:"list_requests",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite"}});var Mc,Cx=se(()=>{"use strict";Vo();Mc=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())at.isExpired(n)||(!n.domain||at.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!at.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())at.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=at.extractDomain(e),i=at.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=at.extractDomain(e),n=at.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return at.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Yg(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function y8(t){return{index:t.i,iteration:t.it,name:t.n,method:Nc[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Yg(t.i,t.it,t.r),error:t.e}}var Ex,Nc,Kg=se(()=>{"use strict";Ex={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Nc={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Fc from"fs/promises";import*as Dc from"path";function yt(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ta(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function Ox(t){try{return new Date(t).toLocaleString()}catch{return t}}function Qg(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function v8(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function o$(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}function i$(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${Object.entries(t).map(([r,n])=>{let i=Array.isArray(n)?n.join(", "):String(n??"");return`<tr><td class="kv-key">${yt(r)}</td><td class="kv-val">${yt(i)}</td></tr>`}).join("")}</table>`}function b8(t){return t==null||t===""?'<span class="dim">\u2014</span>':typeof t=="string"?yt(t):typeof t=="number"||typeof t=="boolean"?yt(String(t)):`<pre class="code">${yt(o$(t))}</pre>`}function Ix(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table meta-table">${Object.entries(t).map(([r,n])=>`
278
278
  <tr>
279
279
  <td class="kv-key">${yt(r)}</td>
280
- <td class="kv-val">${v8(n)}</td>
281
- </tr>`).join("")}</table>`}function b8(t){return!t||t.length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${t.map(r=>`
280
+ <td class="kv-val">${b8(n)}</td>
281
+ </tr>`).join("")}</table>`}function S8(t){return!t||t.length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${t.map(r=>`
282
282
  <tr>
283
283
  <td class="kv-key">${yt(r.name??"(unnamed)")}</td>
284
284
  <td class="kv-val">${yt(r.value??"")}</td>
285
- </tr>`).join("")}</table>`}function i$(t,e){if(t==null||t==="")return'<span class="dim">\u2014 empty \u2014</span>';let r=s$(t);return`<pre class="code">${yt(r)}</pre>`}var Pd,Px=se(()=>{"use strict";Yg();Pd=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Dc.join(this.basePath,e,r),i=JSON.parse(await Fc.readFile(Dc.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),a=await this.loadAllDetails(n,s),l=this.buildHtml(i,s,a),f=Dc.join(n,"report.html");return await Fc.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Dc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let a=JSON.parse(await Fc.readFile(s,"utf-8"));n.push(...a.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=Gg(i.i,i.it,i.r),a=`${i.i}-${i.it}`;try{let l=JSON.parse(await Fc.readFile(Dc.join(e,"results",s),"utf-8"));n.set(a,l)}catch{}}return n}groupByIterCollectionFolder(e){let r=[],n=new Map;for(let i of e){n.has(i.it)||(n.set(i.it,{order:[],map:new Map}),r.push(i.it));let s=n.get(i.it),a=i.cn||"",l=i.fp||"",f=`${a}\0${l}`;s.map.has(f)||(s.map.set(f,{cn:a,fp:l,items:[]}),s.order.push(f)),s.map.get(f).items.push(i)}return r.map(i=>{let s=n.get(i);return{it:i,groups:s.order.map(a=>s.map.get(a))}})}groupLabel(e,r,n){let i=String(n).padStart(2,"0"),s=e?yt(e):"";if(r){let a=r.split("/").map(l=>yt(l.replace(/^\s*\d+\s*-\s*/,""))).join("/");s=s?`${s}: ${a}`:a}return s||(s="(root)"),`${i} - ${s}`}renderGroupedDetails(e,r,n){let i=r.config.iterations>1;return this.groupByIterCollectionFolder(e).map(s=>{let a=s.groups.map((d,m)=>{let g=d.items.filter(R=>R.p).length,y=d.items.length,S=g<y,_=d.items.map(n).join("");return`
285
+ </tr>`).join("")}</table>`}function s$(t,e){if(t==null||t==="")return'<span class="dim">\u2014 empty \u2014</span>';let r=o$(t);return`<pre class="code">${yt(r)}</pre>`}var kd,Px=se(()=>{"use strict";Kg();kd=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Dc.join(this.basePath,e,r),i=JSON.parse(await Fc.readFile(Dc.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),a=await this.loadAllDetails(n,s),l=this.buildHtml(i,s,a),f=Dc.join(n,"report.html");return await Fc.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Dc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let a=JSON.parse(await Fc.readFile(s,"utf-8"));n.push(...a.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=Yg(i.i,i.it,i.r),a=`${i.i}-${i.it}`;try{let l=JSON.parse(await Fc.readFile(Dc.join(e,"results",s),"utf-8"));n.set(a,l)}catch{}}return n}groupByIterCollectionFolder(e){let r=[],n=new Map;for(let i of e){n.has(i.it)||(n.set(i.it,{order:[],map:new Map}),r.push(i.it));let s=n.get(i.it),a=i.cn||"",l=i.fp||"",f=`${a}\0${l}`;s.map.has(f)||(s.map.set(f,{cn:a,fp:l,items:[]}),s.order.push(f)),s.map.get(f).items.push(i)}return r.map(i=>{let s=n.get(i);return{it:i,groups:s.order.map(a=>s.map.get(a))}})}groupLabel(e,r,n){let i=String(n).padStart(2,"0"),s=e?yt(e):"";if(r){let a=r.split("/").map(l=>yt(l.replace(/^\s*\d+\s*-\s*/,""))).join("/");s=s?`${s}: ${a}`:a}return s||(s="(root)"),`${i} - ${s}`}renderGroupedDetails(e,r,n){let i=r.config.iterations>1;return this.groupByIterCollectionFolder(e).map(s=>{let a=s.groups.map((d,m)=>{let g=d.items.filter(R=>R.p).length,y=d.items.length,S=g<y,_=d.items.map(n).join("");return`
286
286
  <details class="group-block${S?" group-fail":""}" open>
287
287
  <summary class="group-head">
288
288
  <span class="group-title">\u{1F4C1} ${this.groupLabel(d.cn,d.fp,m+1)}</span>
@@ -296,7 +296,7 @@ Too many redirects:
296
296
  <span class="dim iter-count">(${l}/${f} passed)</span>
297
297
  </summary>
298
298
  <div class="iter-body">${a}</div>
299
- </details>`}).join("")}renderGroupedTimeline(e,r,n){let i=r.config.iterations>1,s=8;return this.groupByIterCollectionFolder(e).map(a=>{let l="";return i&&(l+=`<tr class="group-row iter-row"><td colspan="${s}">Iteration ${a.it}</td></tr>`),a.groups.forEach((f,d)=>{l+=`<tr class="group-row folder-row"><td colspan="${s}">\u{1F4C1} ${this.groupLabel(f.cn,f.fp,d+1)}</td></tr>`,l+=f.items.map(n).join("")}),l}).join("")}buildHtml(e,r,n){let i=Ta(e.stats.totalDuration),s=e.stats.failed===0,a=Object.entries(e.requestStats).map(([,S])=>{let _=y8(S.passed,S.count);return`
299
+ </details>`}).join("")}renderGroupedTimeline(e,r,n){let i=r.config.iterations>1,s=8;return this.groupByIterCollectionFolder(e).map(a=>{let l="";return i&&(l+=`<tr class="group-row iter-row"><td colspan="${s}">Iteration ${a.it}</td></tr>`),a.groups.forEach((f,d)=>{l+=`<tr class="group-row folder-row"><td colspan="${s}">\u{1F4C1} ${this.groupLabel(f.cn,f.fp,d+1)}</td></tr>`,l+=f.items.map(n).join("")}),l}).join("")}buildHtml(e,r,n){let i=Ta(e.stats.totalDuration),s=e.stats.failed===0,a=Object.entries(e.requestStats).map(([,S])=>{let _=v8(S.passed,S.count);return`
300
300
  <tr${S.failed>0?' class="row-fail"':""}>
301
301
  <td>${yt(S.name)}</td>
302
302
  <td>${S.count}</td>
@@ -312,7 +312,7 @@ Too many redirects:
312
312
  <td>${S.it}</td>
313
313
  <td><span class="method method-${_.toLowerCase()}">${_}</span></td>
314
314
  <td><a href="#${U}" class="req-link">${yt(S.n)}</a></td>
315
- <td class="${Kg(S.s)}">${S.s}</td>
315
+ <td class="${Qg(S.s)}">${S.s}</td>
316
316
  <td>${Ta(S.d)}</td>
317
317
  <td><div class="bar-wrap"><div class="${P}" style="width:${R}%"></div></div></td>
318
318
  <td class="${S.p?"pass":"fail"}">${S.p?"\u2713":"\u2717"}</td>
@@ -321,7 +321,7 @@ Too many redirects:
321
321
  <span class="assert-icon">${ht.passed?"\u2713":"\u2717"}</span>
322
322
  ${yt(ht.name)}
323
323
  ${ht.message?`<span class="assert-msg"> \u2014 ${yt(ht.message)}</span>`:""}
324
- </li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',W=n$(R?.request?.headers),X=Ix(R?{method:R.request?.method,url:R.request?.url,query:R.request?.query,params:R.request?.params,bodyType:R.request?.body?.type,bodyFormat:R.request?.body?.format}:void 0),T=R?.request?.body,x=T&&typeof T=="object"?T.type:void 0,k=T&&typeof T=="object"&&"content"in T?T.content:T,N=x!=="none"&&!(k==null||k===""),j=N?i$(k):"",$=n$(R?.response?.headers),G=Ix(R?{status:R.status,statusText:R.statusText,durationMs:R.duration,responseTimeMs:R.response?.time,responseSizeBytes:R.response?.size}:void 0),K=R?.response?.body!==void 0&&R.response.body!==null?i$(R.response.body):'<span class="dim">\u2014 no body \u2014</span>',ne=b8(R?.response?.cookies),pe=Ix(R?{timestamp:R.timestamp?new Date(R.timestamp).toISOString():void 0,nextRequest:R.nextRequest,visualizerTemplate:R.visualizerData?.template,visualizerData:R.visualizerData?.data}:void 0),et=`
324
+ </li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',W=i$(R?.request?.headers),X=Ix(R?{method:R.request?.method,url:R.request?.url,query:R.request?.query,params:R.request?.params,bodyType:R.request?.body?.type,bodyFormat:R.request?.body?.format}:void 0),T=R?.request?.body,x=T&&typeof T=="object"?T.type:void 0,k=T&&typeof T=="object"&&"content"in T?T.content:T,N=x!=="none"&&!(k==null||k===""),j=N?s$(k):"",$=i$(R?.response?.headers),G=Ix(R?{status:R.status,statusText:R.statusText,durationMs:R.duration,responseTimeMs:R.response?.time,responseSizeBytes:R.response?.size}:void 0),K=R?.response?.body!==void 0&&R.response.body!==null?s$(R.response.body):'<span class="dim">\u2014 no body \u2014</span>',ne=S8(R?.response?.cookies),pe=Ix(R?{timestamp:R.timestamp?new Date(R.timestamp).toISOString():void 0,nextRequest:R.nextRequest,visualizerTemplate:R.visualizerData?.template,visualizerData:R.visualizerData?.data}:void 0),et=`
325
325
  <div class="detail-section">
326
326
  <div class="pane-section-title">Assertions
327
327
  <span class="assert-counts">
@@ -371,7 +371,7 @@ Too many redirects:
371
371
  <div class="pane-section-title">Body</div>
372
372
  ${K}
373
373
  </div>`,vt=he.length<=Ce.length,Et=vt?_e:"",ce=vt?"":_e,hr=R?.consoleOutput?.length?`<div class="console-block"><pre class="code console-code">${R.consoleOutput.map(ht=>yt(typeof ht=="string"?ht:JSON.stringify(ht))).join(`
374
- `)}</pre></div>`:"",ui=R?.error?`<div class="error-box">\u26A0 ${yt(R.error)}</div>`:"",Rt=R?`<span class="${Kg(R.status)} status-badge">${R.status} ${yt(R.statusText??"")}</span>`:"",Gr=`<span class="dur-badge">${Ta(S.d)}</span>`,Ir=e.config.iterations>1?`<span class="iter-badge">iter ${S.it}</span>`:"";return`
374
+ `)}</pre></div>`:"",ui=R?.error?`<div class="error-box">\u26A0 ${yt(R.error)}</div>`:"",Rt=R?`<span class="${Qg(R.status)} status-badge">${R.status} ${yt(R.statusText??"")}</span>`:"",Gr=`<span class="dur-badge">${Ta(S.d)}</span>`,Ir=e.config.iterations>1?`<span class="iter-badge">iter ${S.it}</span>`:"";return`
375
375
  <details class="req-detail ${U?"req-pass":"req-fail"}" id="${A}" style="--border:${B}">
376
376
  <summary class="req-summary">
377
377
  <span class="toggle-icon">\u25B6</span>
@@ -409,7 +409,7 @@ Too many redirects:
409
409
  <!-- Response column -->
410
410
  <div class="col-stack">
411
411
  <div class="col-pane">
412
- <div class="pane-title">Response <span class="${Kg(S.s)} status-badge">${S.s}</span></div>
412
+ <div class="pane-title">Response <span class="${Qg(S.s)} status-badge">${S.s}</span></div>
413
413
  ${Ce}
414
414
  </div>
415
415
  ${ce}
@@ -707,7 +707,7 @@ Too many redirects:
707
707
  border:1px solid #f8514940;border-radius:6px;padding:8px 12px">
708
708
  <span class="method method-${_.toLowerCase()}">${_}</span>
709
709
  <strong>${yt(S.n)}</strong>
710
- <span class="status-badge ${Kg(S.s)}">${S.s}</span>
710
+ <span class="status-badge ${Qg(S.s)}">${S.s}</span>
711
711
  <span class="dur-badge">${Ta(S.d)}</span>
712
712
  ${S.e?`<span class="dim" style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"> \u2014 ${yt(S.e)}</span>`:""}
713
713
  </a>
@@ -800,17 +800,17 @@ Too many redirects:
800
800
  });
801
801
  </script>
802
802
  </body>
803
- </html>`}}});import*as jt from"fs/promises";import*as Jr from"path";function Qg(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var Lc,kx=se(()=>{"use strict";bn();Af();Px();Yg();Lc=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}configService;basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Jr.join(this.basePath,e,s),await jt.mkdir(Jr.join(this.currentRunPath,"results"),{recursive:!0}),await jt.mkdir(Jr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=It(r.requestId),l=`result-${s}-iter-${i}-${a}.json`,f=Jr.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",collectionName:r.collectionName||"",status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{method:r.executedRequest.method,url:r.executedRequest.url,headers:r.executedRequest.headers,query:r.executedRequest.query,params:r.executedRequest.params,body:r.executedRequest.body},response:{headers:r.response.headers,body:r.response.body,time:r.response.time,size:r.response.size,cookies:r.response.cookies},assertions:r.assertions.map(S=>({name:S.name,passed:S.passed,message:S.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await jt.writeFile(f,JSON.stringify(Z0(d),null,2),"utf-8");let m=r.assertions.filter(S=>S.passed).length,g=r.assertions.filter(S=>!S.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:Ex[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:m,af:g,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",r=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let l in this.currentManifest.requestStats){let f=this.currentManifest.requestStats[l],d=this.requestDurations[l]||[];f.count>0&&(f.avgDuration=Math.round(f.totalDuration/f.count)),f.minDuration===Number.MAX_SAFE_INTEGER&&(f.minDuration=0),d.length>0&&(d.sort((m,g)=>m-g),f.p50=Qg(d,50),f.p90=Qg(d,90),f.p95=Qg(d,95),f.p99=Qg(d,99))}this.requestDurations={},await this.saveManifest();let n=null,i=this.currentRunPath,s=this.currentSuiteId,a=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&s&&a&&i)try{n=await new Pd(this.basePath).generate(s,a)}catch(l){console.warn("[ResultStorage] HTML report generation failed:",l)}return n}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Jr.join(this.basePath,e,r,"results",n),s=await jt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Jr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await jt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Jr.join(this.basePath,e,r,"manifest.json"),i=await jt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Jr.join(this.basePath,e);try{let n=await jt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await jt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Jr.join(this.basePath,e,r);await jt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let l of a){let f=await this.listRuns(l);for(let d of f)if(new Date(d.startTime)<n){let m=Jr.join(this.basePath,l,d.runId),g=await this.getDirectorySize(m);await jt.rm(m,{recursive:!0,force:!0}),i++,s+=g}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Jr.join(this.currentRunPath,"manifest.json");await jt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Jr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await jt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await jt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Jr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await jt.stat(s);r+=a.size}}}catch{}return r}}});import*as Pi from"fs";import*as kd from"path";var Tx,Zg,Td,Xg,o$=se(()=>{"use strict";Tx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Pi.watch(n,{recursive:!0},(s,a)=>{if(a){let l=kd.join(n,a);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:kd.join(e,r.replace(/\*/g,""))}notifyChange(e){}onDidChange(e){return{dispose:()=>{}}}onDidCreate(e){return{dispose:()=>{}}}onDidDelete(e){return{dispose:()=>{}}}dispose(){for(let e of this.watchers)e.close();this.watchers=[]}},Zg=class{createFileWatcher(e,r){return new Tx(e,r)}},Td=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Pi.existsSync(this.storeFile)){let e=Pi.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=kd.dirname(this.storeFile);Pi.mkdirSync(e,{recursive:!0}),Pi.writeFileSync(this.storeFile,JSON.stringify(this.data,null,2),"utf-8")}catch{}}get(e,r){let n=this.data[e];return n!==void 0?n:r}async update(e,r){r===void 0?delete this.data[e]:this.data[e]=r,this.save()}},Xg=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as jc from"path";function a$(t){let e=jc.resolve(t.workspaceFolder),{appInfo:r}=t,n=Pa.instance;n.clear();let i=jc.join(e,".http-forge-cache","stores"),s=jc.join(i,"workspace-state.json"),a=jc.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new Zg,notificationService:new Xg,workspaceStore:new Td(s),globalStore:new Td(a),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"}};return Hg(n,l),n}function ci(t){return a$({workspaceFolder:t})}var ey=se(()=>{"use strict";ux();fx();o$()});function S8(t){let e=[];return t.map(r=>{let n=Sn(r,e);return e.push(n),n})}function l$(t,e,r,n){let i=t.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=S8(t.map(d=>d.name)),a=t.filter((d,m)=>s[m]===e);if(a.length===1)return{item:a[0],tier:"slug"};if(a.length>1)throw new Aa(r,e,a.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),f=t.filter(d=>d.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Aa(r,e,f.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function Ax(t,e){let{item:r,tier:n}=l$(t,e,"collection",()=>"");return{collection:r,tier:n}}function qx(t,e){let r=e.split("/").map(a=>a.trim()).filter(a=>a.length>0),n=t.items,i=[],s=[];for(let a of r){let l=n.filter(g=>g.type==="folder"),f=i.join("/"),{item:d,tier:m}=l$(l,a,"folder",g=>f?`${f}/${g.name}`:g.name);i.push(d.name),s.push(m),n=d.items??[]}return{folderPath:i.join("/"),tiers:s}}function c$(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=Sn(i.name,n);n.push(s),r.push({item:i,folderPath:e,slug:s})}for(let i of t)if(i.type==="folder"){let s=i,a=e?`${e}/${s.name}`:s.name;c$(s.items??[],a,r)}}function $x(t,e,r){let n=[];c$(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,a=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(y=>y.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Aa("request",e,f.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let d=e.toLowerCase(),m=s.filter(y=>y.item.name.toLowerCase()===d);if(m.length===1)return{request:m[0].item,tier:"name",folderPath:m[0].folderPath};if(m.length>1)throw new Aa("request",e,m.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let g=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${g}`)}var Aa,Mx=se(()=>{"use strict";Ho();Aa=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
803
+ </html>`}}});import*as jt from"fs/promises";import*as Jr from"path";function Zg(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var Lc,kx=se(()=>{"use strict";bn();qf();Px();Kg();Lc=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}configService;basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Jr.join(this.basePath,e,s),await jt.mkdir(Jr.join(this.currentRunPath,"results"),{recursive:!0}),await jt.mkdir(Jr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=It(r.requestId),l=`result-${s}-iter-${i}-${a}.json`,f=Jr.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",collectionName:r.collectionName||"",status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{method:r.executedRequest.method,url:r.executedRequest.url,headers:r.executedRequest.headers,query:r.executedRequest.query,params:r.executedRequest.params,body:r.executedRequest.body},response:{headers:r.response.headers,body:r.response.body,time:r.response.time,size:r.response.size,cookies:r.response.cookies},assertions:r.assertions.map(S=>({name:S.name,passed:S.passed,message:S.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await jt.writeFile(f,JSON.stringify(Z0(d),null,2),"utf-8");let m=r.assertions.filter(S=>S.passed).length,g=r.assertions.filter(S=>!S.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:Ex[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:m,af:g,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",r=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let l in this.currentManifest.requestStats){let f=this.currentManifest.requestStats[l],d=this.requestDurations[l]||[];f.count>0&&(f.avgDuration=Math.round(f.totalDuration/f.count)),f.minDuration===Number.MAX_SAFE_INTEGER&&(f.minDuration=0),d.length>0&&(d.sort((m,g)=>m-g),f.p50=Zg(d,50),f.p90=Zg(d,90),f.p95=Zg(d,95),f.p99=Zg(d,99))}this.requestDurations={},await this.saveManifest();let n=null,i=this.currentRunPath,s=this.currentSuiteId,a=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&s&&a&&i)try{n=await new kd(this.basePath).generate(s,a)}catch(l){console.warn("[ResultStorage] HTML report generation failed:",l)}return n}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Jr.join(this.basePath,e,r,"results",n),s=await jt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Jr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await jt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Jr.join(this.basePath,e,r,"manifest.json"),i=await jt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Jr.join(this.basePath,e);try{let n=await jt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await jt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Jr.join(this.basePath,e,r);await jt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let l of a){let f=await this.listRuns(l);for(let d of f)if(new Date(d.startTime)<n){let m=Jr.join(this.basePath,l,d.runId),g=await this.getDirectorySize(m);await jt.rm(m,{recursive:!0,force:!0}),i++,s+=g}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Jr.join(this.currentRunPath,"manifest.json");await jt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Jr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await jt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await jt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Jr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await jt.stat(s);r+=a.size}}}catch{}return r}}});import*as Pi from"fs";import*as Td from"path";var Tx,Xg,Ad,ey,a$=se(()=>{"use strict";Tx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Pi.watch(n,{recursive:!0},(s,a)=>{if(a){let l=Td.join(n,a);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:Td.join(e,r.replace(/\*/g,""))}notifyChange(e){}onDidChange(e){return{dispose:()=>{}}}onDidCreate(e){return{dispose:()=>{}}}onDidDelete(e){return{dispose:()=>{}}}dispose(){for(let e of this.watchers)e.close();this.watchers=[]}},Xg=class{createFileWatcher(e,r){return new Tx(e,r)}},Ad=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Pi.existsSync(this.storeFile)){let e=Pi.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=Td.dirname(this.storeFile);Pi.mkdirSync(e,{recursive:!0}),Pi.writeFileSync(this.storeFile,JSON.stringify(this.data,null,2),"utf-8")}catch{}}get(e,r){let n=this.data[e];return n!==void 0?n:r}async update(e,r){r===void 0?delete this.data[e]:this.data[e]=r,this.save()}},ey=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as jc from"path";function l$(t){let e=jc.resolve(t.workspaceFolder),{appInfo:r}=t,n=Pa.createFresh(),i=jc.join(e,".http-forge-cache","stores"),s=jc.join(i,"workspace-state.json"),a=jc.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new Xg,notificationService:new ey,workspaceStore:new Ad(s),globalStore:new Ad(a),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"}};return Bg(n,l),n}function ci(t){return l$({workspaceFolder:t})}var ty=se(()=>{"use strict";ux();fx();a$()});function w8(t){let e=[];return t.map(r=>{let n=Sn(r,e);return e.push(n),n})}function c$(t,e,r,n){let i=t.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=w8(t.map(d=>d.name)),a=t.filter((d,m)=>s[m]===e);if(a.length===1)return{item:a[0],tier:"slug"};if(a.length>1)throw new Aa(r,e,a.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),f=t.filter(d=>d.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Aa(r,e,f.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function Ax(t,e){let{item:r,tier:n}=c$(t,e,"collection",()=>"");return{collection:r,tier:n}}function qx(t,e){let r=e.split("/").map(a=>a.trim()).filter(a=>a.length>0),n=t.items,i=[],s=[];for(let a of r){let l=n.filter(g=>g.type==="folder"),f=i.join("/"),{item:d,tier:m}=c$(l,a,"folder",g=>f?`${f}/${g.name}`:g.name);i.push(d.name),s.push(m),n=d.items??[]}return{folderPath:i.join("/"),tiers:s}}function u$(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=Sn(i.name,n);n.push(s),r.push({item:i,folderPath:e,slug:s})}for(let i of t)if(i.type==="folder"){let s=i,a=e?`${e}/${s.name}`:s.name;u$(s.items??[],a,r)}}function $x(t,e,r){let n=[];u$(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,a=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(y=>y.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Aa("request",e,f.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let d=e.toLowerCase(),m=s.filter(y=>y.item.name.toLowerCase()===d);if(m.length===1)return{request:m[0].item,tier:"name",folderPath:m[0].folderPath};if(m.length>1)throw new Aa("request",e,m.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let g=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${g}`)}var Aa,Mx=se(()=>{"use strict";Bo();Aa=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
804
804
  `+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
805
805
  `)+`
806
- Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var Ad={};qs(Ad,{runCollection:()=>qa,runFolder:()=>E8,runRequest:()=>ty,runSuite:()=>ry});function Nx(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function f$(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function w8(){return f$(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function _8(){let t=process.env.HTTP_FORGE_MAX_REQUESTS;if(!t||t.trim()==="")return 50;let e=Number(t);if(!Number.isFinite(e)||e<=0)throw new Error("HTTP_FORGE_MAX_REQUESTS must be a positive number when provided");return Math.floor(e)}function d$(t){return f$(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:t.includes("report")}function p$(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function R8(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function h$(t){return ts(R8(t))}function m$(t){return G0((t??[]).map(e=>({name:e.name,value:e.value})))}function u$(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function g$(t){let e=["none","inherit","basic","bearer","apikey","oauth2"],r=t.auth?.type&&e.includes(t.auth.type)?t.auth.type:void 0;return{id:t.id,name:t.name,method:t.method,url:t.url,headers:Array.isArray(t.headers)?t.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.headers,query:Array.isArray(t.query)?t.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.query,params:t.params?Object.entries(t.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:t.body??null,scripts:t.scripts,settings:t.settings,auth:{type:r==="inherit"?"none":r,bearerToken:t.auth?.bearerToken,basicAuth:t.auth?.basicAuth,apikey:t.auth?.apikey,oauth2:t.auth?.oauth2}}}function y$(t,e){let r={...t};return e.headers&&(r.headers={...t.headers??{},...e.headers}),e.query&&(r.query=e.query),e.body!==void 0&&(r.body={type:"raw",raw:e.body,contentType:"application/json"}),r}function v$(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function Dx(t,e,r=t.items,n=[]){for(let i of r){if(i.type==="request"&&i.id===e)return{request:i,folderScriptsChain:[...n]};if(i.type==="folder"){let s=i,a=s.scripts?[...n,s.scripts]:[...n],l=Dx(t,e,s.items??[],a);if(l)return l}}}function b$(t,e=t.items,r=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...r],folderPath:n.join("/")});else{let a=s,l=a.scripts?[...r,a.scripts]:[...r],f=[...n,a.name];i.push(...b$(t,a.items??[],l,f))}return i}function x8(t,e,r=!0){if(!e)return t;let n=e.replace(/\/+$/,"");return t.filter(({folderPath:i})=>r?i===n||i.startsWith(`${n}/`):i===n)}function C8(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function S$(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=Ax(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function w$(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=qx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function _$(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,a=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,f=r.requestFilter,d=r.include??[],m=v$(r.variables),g=w8(),y=d$(d),S=e.requests.filter(x=>!(x.enabled===!1||f&&!f.some(k=>x.name.toLowerCase().includes(k.toLowerCase()))));if(g){let x=_8(),k=S.length*s;if(k>x)throw new Error(`Suite "${e.name}" would execute ${k} request calls (${S.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${x}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let _=new Lc(t.config);await _.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:a});let R=[],P=[],A=0,U=0,B=new AbortController,V=new Mc;for(let x=1;x<=s;x++){for(let k of S){let N=t.collection.getCollection(k.collectionId);if(!N)continue;let j=Dx(N,k.requestId);if(!j)continue;let $=new Ws(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,V,N.scripts,j.folderScriptsChain,void 0,N.name,x,s),G=y$(g$(j.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),K=await $.execute(G,m,B.signal);if(K.folderPath=k.folderPath??"",K.collectionName=N.name,await _.saveResult(x,K),K.passed?A++:U++,d.includes("perRequest")&&R.push({name:k.name,iteration:x,status:K.response?.status,ok:(K.response?.status??0)>=200&&(K.response?.status??0)<300,duration:`${K.duration}ms`,allPassed:K.passed,...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),!K.passed&&(P.push({name:k.name,iteration:x,status:K.response?.status,duration:`${K.duration}ms`,body:p$(K.response?.body),headers:h$(K.response?.headers),cookies:m$(K.response?.cookies),failedTests:K.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...K.error?{error:K.error}:{},...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),a)){B.abort();break}l>0&&!B.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(B.signal.aborted)break}let W=await _.finalizeRun("completed",y),T={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:A+U,passed:A,failed:U,...s>1?{iterations:s}:{},allPassed:U===0}};return(U>0||d.includes("failedOnly"))&&(T.failedRequests=P),d.includes("perRequest")&&(T.results=R),W!==null&&(T.report={uri:`file://${W}`,hint:"Click the URI to open the HTML report in your browser"}),T}async function ty(t){let e=ci(t.workspaceFolder),r=t.include??[],n=d$(r);try{let i=e.collection,s=S$(i,t),a=w$(s,t),l=t.requestId;if(!l){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let P=$x(s,t.requestRef,a);l=P.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:P.tier,id:l,path:P.folderPath?`${P.folderPath}/${P.request.name}`:P.request.name})}let f=Dx(s,l);if(!f)throw new Error(`Request "${l}" not found in collection "${s.name}"`);let d=t.environment||e.environmentConfig.getSelectedEnvironment(),m=y$(g$(f.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),y=await new Ws(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,d,new Mc,s.scripts,f.folderScriptsChain).execute(m,v$(t.variables)),S=null;if(n){let P=new Lc(e.config),A=`request-${u$(s.id)}-${u$(l)}`,U=`Request: ${f.request.name}`;await P.initializeRun(A,U,d,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await P.saveResult(1,y),S=await P.finalizeRun("completed")}let _=h$(y.response?.headers),R=m$(y.response?.cookies);return{request:f.request.name,status:y.response?.status||0,ok:(y.response?.status??0)>=200&&(y.response?.status??0)<300,duration:`${y.duration}ms`,body:p$(y.response?.body),allPassed:y.passed,assertions:y.assertions?.map(P=>({name:P.name,passed:P.passed,message:P.message})),...r.includes("headers")?{headers:_}:{},...r.includes("cookies")?{cookies:R}:{},...r.includes("tests")?{tests:y.assertions?.map(P=>({name:P.name,passed:P.passed,...P.message?{message:P.message}:{}}))}:{},...Object.keys(y.modifiedVariables??{}).length?{modifiedVariables:y.modifiedVariables}:{},...r.includes("consoleOutput")&&y.consoleOutput?.length?{consoleOutput:y.consoleOutput}:{},...S!==null?{report:{uri:`file://${S}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...y.error?{error:y.error}:{}}}catch(i){throw i}finally{Nx(e)}}async function qa(t){let e=ci(t.workspaceFolder);try{let r=e.collection,n=S$(r,t),i=w$(n,t),s=b$(n),a=x8(s,i,t.recursive);if(a.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=a.map(({request:d,folderPath:m})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:m,enabled:!0})),f={id:i?`temp-${n.id}-${C8(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return _$(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,variables:t.variables},"collection")}catch(r){throw r}finally{Nx(e)}}async function E8(t){return qa({recursive:!0,...t})}async function ry(t){let e=ci(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return _$(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,variables:t.variables},"suite")}catch(r){throw r}finally{Nx(e)}}var Uc=se(()=>{"use strict";Cx();em();Af();kx();ey();Mx()});var P$={};qs(P$,{createMcpRuntime:()=>L8});import*as O$ from"fs";import{createServer as O8}from"http";import*as qd from"path";async function co(t){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,r=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await t()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,r===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=r}}function Ma(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:r});else{let s=i,a=r?`${r} / ${s.name}`:s.name;n.push(...Ma(t,s.items??[],a))}return n}function ny(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,a=r?`${r}/${s.name}`:s.name;n.push({folderPath:a,requestCount:I$(s.items??[])}),n.push(...ny(t,s.items??[],a))}return n}function I$(t){let e=0;for(let r of t)r.type==="request"?e++:e+=I$(r.items??[]);return e}function iy(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function R$(t){let e=new Set,r=[];for(let n of t)e.has(n.name)||(e.add(n.name),r.push(n));return r}async function k8(t){let e=x$.get(t);if(e&&e.expiresAt>Date.now())return e.tools;let r=await T8(t);return x$.set(t,{tools:r,expiresAt:Date.now()+P8}),r}async function T8(t){let e=ci(t);try{let r=e.config.getMcpConfig(),n=r.toolPrefix??"",i=r.toolMode??"flat",s=r.drilldownThreshold??200,a=S=>{let _=r.excludedCollections;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},l=S=>{let _=r.excludedSuites;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},f=e.collection.getAllCollections().filter(S=>!a(S)),d=(await e.testSuite.getAllSuites()).filter(S=>!l(S)),m=0;for(let S of f)m+=Ma(S).length;if(i==="drilldown"||i==="auto"&&m>s){let S=Rx(n,f.map(_=>_.name),d.map(_=>_.name)).map(_=>({name:_.name,description:_.description,inputSchema:_.inputSchema}));return R$(S)}let y=[];for(let S of f){let _=Ma(S);for(let{request:R,folderPath:P}of _)y.push({name:dx(n,S.id,R.id),description:vx(R.method,R.name,S.name,P),inputSchema:Vg});y.push({name:px(n,S.id),description:bx(S.name,_.length),inputSchema:Wg});for(let{folderPath:R,requestCount:P}of ny(S))P!==0&&y.push({name:hx(n,S.id,R),description:Sx(R,S.name,P),inputSchema:zg})}for(let S of d)y.push({name:mx(n,S.id),description:wx(S.name,S.requests.length,S.config.iterations),inputSchema:Jg});return R$(y)}finally{iy(e)}}function A8(t,e){let r=ci(t),n;try{n=r.config.getMcpConfig().toolPrefix??""}finally{iy(r)}return n&&e.startsWith(n)?e.slice(n.length):e}function q8(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function C$(t,e,r,n){$a(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}async function $8(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"http-forge",version:"1.0.0"}};case"tools/list":return{tools:await k8(t.workspaceFolder)};case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Fx(t.workspaceFolder,n,i??{}),a=JSON.stringify(s,null,2);return{content:[{type:"text",text:q8(a,t.host,t.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function M8(t,e,r){let n=ci(t.workspaceFolder),i;try{i=n.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{iy(n)}let s=e.headers.origin??"",a=i.includes(s)?s:i[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",a),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function N8(t,e,r){let i=new URL(e.url,`http://${t.host}:${t.port}`).searchParams.get("path");if(!i){r.statusCode=400,r.end("Missing path parameter");return}let s=qd.resolve(i),a=qd.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(a+qd.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}O$.readFile(s,"utf-8",(l,f)=>{if(l){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(f)})}function nr(t){return new Error(`Bad request: ${t}`)}async function D8(t,e,r){let n=ci(t);try{let i=n.collection.getAllCollections(),s=d=>{if(typeof d!="string"||!d.trim())throw nr('the "collection" argument is required');let m=i.find(g=>g.id===d||g.name===d)??i.find(g=>g.name.toLowerCase()===d.toLowerCase());if(!m)throw nr(`collection not found: "${d}"`);return m};if(e===zr.listCollections)return{collections:i.map(d=>({name:d.name,id:d.id,description:d.description??"",requestCount:Ma(d).length}))};if(e===zr.listRequests){let d=s(r.collection),m=typeof r.folder=="string"?r.folder.toLowerCase():void 0,g=Ma(d).filter(({folderPath:y})=>!m||y.toLowerCase().includes(m)).map(({request:y,folderPath:S})=>({name:y.name,method:y.method,folder:S,description:y.description??""}));return{collection:d.name,requests:g}}if(e===zr.runRequest){let d=s(r.collection),m=r.request;if(typeof m!="string"||!m.trim())throw nr('the "request" argument is required');let g=Ma(d),y=g.find(S=>S.request.name===m)??g.find(S=>S.request.name.toLowerCase()===m.toLowerCase());if(!y)throw nr(`request "${m}" not found in collection "${d.name}"`);return co(()=>ty({workspaceFolder:t,collectionId:d.id,requestId:y.request.id,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(e===zr.runFolder){let d=s(r.collection),m=r.folder;if(typeof m!="string"||!m.trim())throw nr('the "folder" argument is required');let g=ny(d).map(S=>S.folderPath),y=g.find(S=>S===m)??g.find(S=>S.toLowerCase()===m.toLowerCase());if(!y)throw nr(`folder "${m}" not found in collection "${d.name}"`);return co(()=>qa({workspaceFolder:t,collectionId:d.id,folderPath:y,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(e===zr.runCollection){let d=s(r.collection);return co(()=>qa({workspaceFolder:t,collectionId:d.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let a=r.suite;if(typeof a!="string"||!a.trim())throw nr('the "suite" argument is required');let l=await n.testSuite.getAllSuites(),f=l.find(d=>d.id===a||d.name===a)??l.find(d=>d.name.toLowerCase()===a.toLowerCase());if(!f)throw nr(`test suite not found: "${a}"`);return co(()=>ry({workspaceFolder:t,suiteId:f.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{iy(n)}}async function Fx(t,e,r={}){let n=A8(t,e);if(Object.values(zr).includes(n))return D8(t,n,r);let i=gx(n),s=ci(t),a=s.collection.getAllCollections(),l=a.map(y=>y.id),f=y=>{let S=$c(y,l),_=S?a.find(R=>R.id===S):void 0;if(!_)throw nr(`collection not found for tool: ${e}`);return _};if(i.kind==="request"){let[y,S]=i.tokens;if(!y||!S)throw nr(`request tool must be request__<collection>__<request>, got: ${e}`);let _=f(y),R=Ma(_).map(A=>A.request.id),P=$c(S,R);if(!P)throw nr(`request not found in collection "${_.name}" for tool: ${e}`);return co(()=>ty({workspaceFolder:t,collectionId:_.id,requestId:P,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(i.kind==="collection"){let[y]=i.tokens;if(!y)throw nr(`collection tool must be collection__<collection>, got: ${e}`);let S=f(y);return co(()=>qa({workspaceFolder:t,collectionId:S.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(i.kind==="folder"){let[y,S]=i.tokens;if(!y||!S)throw nr(`folder tool must be folder__<collection>__<folder>, got: ${e}`);let _=f(y),R=ny(_).map(A=>A.folderPath),P=yx(S,R);if(!P)throw nr(`folder not found in collection "${_.name}" for tool: ${e}`);return co(()=>qa({workspaceFolder:t,collectionId:_.id,folderPath:P,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[d]=i.tokens;if(!d)throw nr(`suite tool must be suite__<suite>, got: ${e}`);let m=await s.testSuite.getAllSuites(),g=$c(d,m.map(y=>y.id));if(!g)throw nr(`test suite not found for tool: ${e}`);return co(()=>ry({workspaceFolder:t,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}function $a(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function E$(t){return new Promise((e,r)=>{let n="";t.on("data",i=>{n+=i,n.length>1024*1024&&r(new Error("Request body too large (max 1MB)"))}),t.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{r(nr("invalid JSON body"))}}),t.on("error",r)})}function F8(t){return O8(async(e,r)=>{try{if(M8(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){$a(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){N8(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await E$(e)}catch{C$(r,null,-32700,"Parse error");return}try{let i=await $8(t,n);$a(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){C$(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await E$(e);if(!n||typeof n.name!="string"||n.name.trim()===""){$a(r,400,{error:'Field "name" is required'});return}let i=await Fx(t.workspaceFolder,n.name,n.args??{});$a(r,200,{result:i});return}$a(r,405,{error:"Method not allowed"})}catch(n){$a(r,500,{error:n.message})}})}async function L8(t){let e=t.port||3100,r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1};return I8.set(n,i),{async start(){if(i.isRunning)return;let s=F8(i);await new Promise((a,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),a()})}),i.server=s,i.isRunning=!0},async stop(){if(!i.server){i.isRunning=!1;return}await new Promise((s,a)=>{i.server.close(l=>{if(l){a(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,a){return Fx(i.workspaceFolder,s,a??{})}}}var I8,P8,x$,k$=se(()=>{"use strict";Uc();_x();xx();ey();I8=new Map;P8=3e3,x$=new Map});var Ol=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};Xp();Ho();function Ib(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(vE),source:{format:"folder",filePath:e,version:t.version}}}function vE(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(vE)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function HL(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(Pb)}}function Pb(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(Pb)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var Eu=class{store;constructor(e){this.store=new $s(e)}loadAll(){return this.store.loadAll().map(r=>Ib(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return Ib(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return Ib(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(HL(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,Pb(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Ou=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};Bo();var Iu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return at.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return at.parseCookieHeaders(e,r)}isExpired(e){return at.isExpired(e)}domainMatches(e,r){return at.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};rh();var zi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};Il();qu();var Ns=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Yo,this.urlBuilder=new Vn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=zi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};qu();Nu();Du();Il();vf();gf();var Yl=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[it("path").join(s.forgeRoot,"modules")]:[],l=new Gi(new Vn,new Yi,e);this.scriptExecutor=new es(l,a,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},d=this.buildHttpRequest(e,n.overrides),m=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,m),y={request:{url:d.url,method:d.method,headers:{...d.headers},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:void 0},variables:l,collectionVariables:r.variables||{},globals:{...a},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(P,A,U)=>{P==="set"&&A&&U!==void 0?this.forgeEnv.setGlobal(A,U):P==="unset"&&A?this.forgeEnv.unsetGlobal(A):P==="clear"&&this.forgeEnv.clearGlobals()}},S=this.scriptExecutor.createRequestSession(y),_,R;try{if(!n.skipPreRequest&&g.preRequest.length>0){let B=await S.executePreRequest(g.preRequest);if(_={success:B.success,error:B.error,modifiedVariables:B.modifiedVariables,modifiedEnvironment:B.modifiedEnvironmentVariables,modifiedGlobals:B.modifiedGlobals,modifiedCollectionVariables:B.modifiedCollectionVariables,consoleOutput:B.consoleOutput,modifiedRequest:B.modifiedRequest?{url:B.modifiedRequest.url,method:B.modifiedRequest.method,headers:B.modifiedRequest.headers,body:B.modifiedRequest.body?.content}:void 0},B.modifiedVariables&&(l={...l,...B.modifiedVariables}),B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables}),B.modifiedRequest){let V=B.modifiedRequest;V.url&&(d.url=V.url),V.method&&(d.method=V.method),V.headers&&(d.headers={...d.headers,...V.headers}),V.body!==void 0&&(d.body=V.body?.content||V.body)}if(!B.success)throw new Error(`Pre-request script failed: ${B.error}`)}let P={...f,...l};d=this.interpolateRequest(d,P);let A=n.overrides?.body||e.body;if(this.preprocessor&&A&&typeof A!="string"&&A.type==="graphql"&&d.body!==void 0){let B=this.preprocessor.encodeBody({type:"graphql",content:d.body});B!=null&&(d.body=typeof B=="string"?B:JSON.stringify(B))}let U=await this.httpClient.send(d);if(!n.skipPostResponse&&g.postResponse.length>0){let B=await S.executePostResponse(g.postResponse,{status:U.status,statusText:U.statusText,headers:U.headers,body:U.body,cookies:Gh(U.headers,U.cookies,d.url),responseTime:U.time,responseSize:U.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:B.testResults,consoleOutput:B.consoleOutput,modifiedEnvironment:B.modifiedEnvironmentVariables},B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables})}return{response:U,preRequestResult:_,postResponseResult:R,totalTime:Date.now()-i,finalRequest:d,variables:{environment:f,local:l}}}finally{S.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let m=new URLSearchParams;for(let g of e.query)g.enabled!==!1&&m.append(g.key,g.value);n+=(n.includes("?")?"&":"?")+m.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let m of e.headers)m.enabled!==!1&&(a[m.key]=m.value);let l={...a,...r?.headers||{}},f,d=r?.body||e.body;if(d)if(typeof d=="string")f=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")f=typeof d.content=="string"?d.content:JSON.stringify(d.content);else{let m=this.preprocessor.encodeBody(d);f=m!=null?String(m):void 0}else d.content&&(f=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Ns.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,a)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...a),!0;if(l.type==="folder"){let f=[...a,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function hW(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var bf=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let a=hW(),l=Date.now(),f={id:a,timestamp:l,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let d=this.requestIndex.get(e)||[];for(d.unshift(a);d.length>this.maxEntriesPerRequest;){let m=d.pop();m&&(this.entries.delete(m),this.fullResponses.delete(m))}if(this.requestIndex.set(e,d),this.storeFullResponses){let m={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,m)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Sf=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let l=await fetch(e.url,a),f=Date.now(),d;try{d=await l.text()}catch{d=null}let m={};return l.headers.forEach((g,y)=>{let S=m[y];S!==void 0?m[y]=Array.isArray(S)?[...S,g]:[S,g]:m[y]=g}),{status:l.status,statusText:l.statusText,headers:m,cookies:[],body:d,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};Nu();Du();Mu();Yh();Il();var ua=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};Kh();import*as sn from"fs/promises";import*as Kl from"path";var wf=class{async readFile(e){return sn.readFile(e,"utf-8")}async writeFile(e,r){let n=Kl.dirname(e);await this.mkdir(n),await sn.writeFile(e,r,"utf-8")}async exists(e){try{return await sn.access(e),!0}catch{return!1}}async mkdir(e){await sn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Kl.basename(s);for(let l of e)if(this.matchPattern(a,l)){i.push(s);break}})}catch{}return i}async readDir(e){return sn.readdir(e)}async isDirectory(e){try{return(await sn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await sn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Kl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};vf();var A0=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new Yo,this.fileSystem=e.fileSystem||new wf,this.preprocessor=e.preprocessor||new ca,this.dataFileParser=e.dataFileParser||new fa,this.cookieJar=e.cookieJar||new Iu,e.enableHistory?this.requestHistory=e.requestHistory||new bf({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Ko(s)}else this.httpClient=new Sf;let r=e.forgeRoot?[it("path").join(e.forgeRoot,"modules")]:[],n=new Gi(new Vn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new es(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new Ou,this.parserRegistry.register("http-forge",new ua),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=it("path").join(e.forgeRoot,"collections");this.collectionLoader=new Eu(s)}else this.collectionLoader=new Ol(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new zi(e.environmentConfig):zi.fromVariables({}),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Yi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Ol)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new zi(e),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=it("path"),i=n.join(e,"environments"),s,a=Pu(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,d]of Object.entries(a.environments)){let m=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...d.variables,...m}}}}else{let f=it("fs"),d=n.join(i,"environments.json");if(f.existsSync(d))try{let m=f.readFileSync(d,"utf-8"),g=JSON.parse(m);if(s={globalVariables:g.globalVariables||{},environments:{},selectedEnvironment:g.selectedEnvironment},g.environments)for(let[y,S]of Object.entries(g.environments)){let _=S;s.environments[y]={name:_.name||y,variables:_.variables||{}}}}catch(m){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,m)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};ux();fx();Ug();_x();xx();async function j8(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(k$(),P$));return e(t)}async function U8(t){let{runRequest:e}=await Promise.resolve().then(()=>(Uc(),Ad));return e(t)}async function H8(t){let{runCollection:e}=await Promise.resolve().then(()=>(Uc(),Ad));return e(t)}async function B8(t){let{runFolder:e}=await Promise.resolve().then(()=>(Uc(),Ad));return e(t)}async function V8(t){let{runSuite:e}=await Promise.resolve().then(()=>(Uc(),Ad));return e(t)}ey();U0();Bo();Cx();H0();Nu();Du();qb();Mu();Yh();Il();x0();P0();vf();zh();gf();Af();N0();F0();Xp();Ho();Ho();M0();Mx();V0();rh();qu();em();W0();X0();q0();function W8(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=e5(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(t5(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=a.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&T$(a)){let g=Lx(a,r),y=g.length>0?g[g.length-1]:void 0,S=A$(a);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:S||void 0}}if(T$(a)){let g=Lx(a,r),y=g.length>0?g[g.length-1]:void 0,S=A$(a);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:S||void 0}}if(jx(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let m=Lx(a,r);return{contextType:"selection_set",fieldPath:m,parentType:m.length>0?m[m.length-1]:void 0,prefix:s}}function z8(t,e){switch(e.contextType){case"root":return J8(t,e.prefix);case"selection_set":return G8(t,e);case"argument":return Y8(t,e);case"argument_value":return K8(t,e);case"directive":return Q8(t,e.prefix);case"fragment_type":return Z8(t,e.prefix);case"variable_def":return X8(t,e.prefix);default:return[]}}function J8(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
806
+ Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var qd={};qs(qd,{runCollection:()=>qa,runFolder:()=>O8,runRequest:()=>ry,runSuite:()=>ny});function Nx(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function d$(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function _8(){return d$(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function R8(){let t=process.env.HTTP_FORGE_MAX_REQUESTS;if(!t||t.trim()==="")return 50;let e=Number(t);if(!Number.isFinite(e)||e<=0)throw new Error("HTTP_FORGE_MAX_REQUESTS must be a positive number when provided");return Math.floor(e)}function p$(t){return d$(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:t.includes("report")}function h$(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function x8(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function m$(t){return ts(x8(t))}function g$(t){return G0((t??[]).map(e=>({name:e.name,value:e.value})))}function f$(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function y$(t){let e=["none","inherit","basic","bearer","apikey","oauth2"],r=t.auth?.type&&e.includes(t.auth.type)?t.auth.type:void 0;return{id:t.id,name:t.name,method:t.method,url:t.url,headers:Array.isArray(t.headers)?t.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.headers,query:Array.isArray(t.query)?t.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.query,params:t.params?Object.entries(t.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:t.body??null,scripts:t.scripts,settings:t.settings,auth:{type:r==="inherit"?"none":r,bearerToken:t.auth?.bearerToken,basicAuth:t.auth?.basicAuth,apikey:t.auth?.apikey,oauth2:t.auth?.oauth2}}}function v$(t,e){let r={...t};return e.headers&&(r.headers={...t.headers??{},...e.headers}),e.query&&(r.query=e.query),e.body!==void 0&&(r.body={type:"raw",raw:e.body,contentType:"application/json"}),r}function b$(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function Dx(t,e,r=t.items,n=[]){for(let i of r){if(i.type==="request"&&i.id===e)return{request:i,folderScriptsChain:[...n]};if(i.type==="folder"){let s=i,a=s.scripts?[...n,s.scripts]:[...n],l=Dx(t,e,s.items??[],a);if(l)return l}}}function S$(t,e=t.items,r=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...r],folderPath:n.join("/")});else{let a=s,l=a.scripts?[...r,a.scripts]:[...r],f=[...n,a.name];i.push(...S$(t,a.items??[],l,f))}return i}function C8(t,e,r=!0){if(!e)return t;let n=e.replace(/\/+$/,"");return t.filter(({folderPath:i})=>r?i===n||i.startsWith(`${n}/`):i===n)}function E8(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function w$(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=Ax(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function _$(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=qx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function R$(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,a=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,f=r.requestFilter,d=r.include??[],m=b$(r.variables),g=_8(),y=p$(d),S=e.requests.filter(x=>!(x.enabled===!1||f&&!f.some(k=>x.name.toLowerCase().includes(k.toLowerCase()))));if(g){let x=R8(),k=S.length*s;if(k>x)throw new Error(`Suite "${e.name}" would execute ${k} request calls (${S.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${x}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let _=new Lc(t.config);await _.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:a});let R=[],P=[],A=0,U=0,B=new AbortController,V=new Mc;for(let x=1;x<=s;x++){for(let k of S){let N=t.collection.getCollection(k.collectionId);if(!N)continue;let j=Dx(N,k.requestId);if(!j)continue;let $=new Ws(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,V,N.scripts,j.folderScriptsChain,void 0,N.name,x,s),G=v$(y$(j.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),K=await $.execute(G,m,B.signal);if(K.folderPath=k.folderPath??"",K.collectionName=N.name,await _.saveResult(x,K),K.passed?A++:U++,d.includes("perRequest")&&R.push({name:k.name,iteration:x,status:K.response?.status,ok:(K.response?.status??0)>=200&&(K.response?.status??0)<300,duration:`${K.duration}ms`,allPassed:K.passed,...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),!K.passed&&(P.push({name:k.name,iteration:x,status:K.response?.status,duration:`${K.duration}ms`,body:h$(K.response?.body),headers:m$(K.response?.headers),cookies:g$(K.response?.cookies),failedTests:K.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...K.error?{error:K.error}:{},...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),a)){B.abort();break}l>0&&!B.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(B.signal.aborted)break}let W=await _.finalizeRun("completed",y),T={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:A+U,passed:A,failed:U,...s>1?{iterations:s}:{},allPassed:U===0}};return(U>0||d.includes("failedOnly"))&&(T.failedRequests=P),d.includes("perRequest")&&(T.results=R),W!==null&&(T.report={uri:`file://${W}`,hint:"Click the URI to open the HTML report in your browser"}),T}async function ry(t){let e=ci(t.workspaceFolder),r=t.include??[],n=p$(r);try{let i=e.collection,s=w$(i,t),a=_$(s,t),l=t.requestId;if(!l){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let P=$x(s,t.requestRef,a);l=P.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:P.tier,id:l,path:P.folderPath?`${P.folderPath}/${P.request.name}`:P.request.name})}let f=Dx(s,l);if(!f)throw new Error(`Request "${l}" not found in collection "${s.name}"`);let d=t.environment||e.environmentConfig.getSelectedEnvironment(),m=v$(y$(f.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),y=await new Ws(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,d,new Mc,s.scripts,f.folderScriptsChain).execute(m,b$(t.variables)),S=null;if(n){let P=new Lc(e.config),A=`request-${f$(s.id)}-${f$(l)}`,U=`Request: ${f.request.name}`;await P.initializeRun(A,U,d,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await P.saveResult(1,y),S=await P.finalizeRun("completed")}let _=m$(y.response?.headers),R=g$(y.response?.cookies);return{request:f.request.name,status:y.response?.status||0,ok:(y.response?.status??0)>=200&&(y.response?.status??0)<300,duration:`${y.duration}ms`,body:h$(y.response?.body),allPassed:y.passed,assertions:y.assertions?.map(P=>({name:P.name,passed:P.passed,message:P.message})),...r.includes("headers")?{headers:_}:{},...r.includes("cookies")?{cookies:R}:{},...r.includes("tests")?{tests:y.assertions?.map(P=>({name:P.name,passed:P.passed,...P.message?{message:P.message}:{}}))}:{},...Object.keys(y.modifiedVariables??{}).length?{modifiedVariables:y.modifiedVariables}:{},...r.includes("consoleOutput")&&y.consoleOutput?.length?{consoleOutput:y.consoleOutput}:{},...S!==null?{report:{uri:`file://${S}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...y.error?{error:y.error}:{}}}catch(i){throw i}finally{Nx(e)}}async function qa(t){let e=ci(t.workspaceFolder);try{let r=e.collection,n=w$(r,t),i=_$(n,t),s=S$(n),a=C8(s,i,t.recursive);if(a.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=a.map(({request:d,folderPath:m})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:m,enabled:!0})),f={id:i?`temp-${n.id}-${E8(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return R$(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,variables:t.variables},"collection")}catch(r){throw r}finally{Nx(e)}}async function O8(t){return qa({recursive:!0,...t})}async function ny(t){let e=ci(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return R$(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,variables:t.variables},"suite")}catch(r){throw r}finally{Nx(e)}}var Uc=se(()=>{"use strict";Cx();rm();qf();kx();ty();Mx()});var k$={};qs(k$,{createMcpRuntime:()=>j8});import*as I$ from"fs";import{createServer as I8}from"http";import*as $d from"path";async function uo(t){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,r=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await t()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,r===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=r}}function Ma(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:r});else{let s=i,a=r?`${r} / ${s.name}`:s.name;n.push(...Ma(t,s.items??[],a))}return n}function iy(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,a=r?`${r}/${s.name}`:s.name;n.push({folderPath:a,requestCount:P$(s.items??[])}),n.push(...iy(t,s.items??[],a))}return n}function P$(t){let e=0;for(let r of t)r.type==="request"?e++:e+=P$(r.items??[]);return e}function Md(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function x$(t){let e=new Set,r=[];for(let n of t)e.has(n.name)||(e.add(n.name),r.push(n));return r}async function T8(t){let e=C$.get(t);if(e&&e.expiresAt>Date.now())return e.tools;let r=Fx.get(t);if(r)return r;let n=A8(t).then(i=>(C$.set(t,{tools:i,expiresAt:Date.now()+k8}),i)).finally(()=>{Fx.delete(t)});return Fx.set(t,n),n}async function A8(t){let e=ci(t);try{let r=e.config.getMcpConfig(),n=r.toolPrefix??"",i=r.toolMode??"flat",s=r.drilldownThreshold??200,a=S=>{let _=r.excludedCollections;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},l=S=>{let _=r.excludedSuites;return!!_?.length&&(_.includes(S.id)||_.includes(S.name))},f=e.collection.getAllCollections().filter(S=>!a(S)),d=(await e.testSuite.getAllSuites()).filter(S=>!l(S)),m=0;for(let S of f)m+=Ma(S).length;if(i==="drilldown"||i==="auto"&&m>s){let S=Rx(n,f.map(_=>_.name),d.map(_=>_.name)).map(_=>({name:_.name,description:_.description,inputSchema:_.inputSchema}));return x$(S)}let y=[];for(let S of f){let _=Ma(S);for(let{request:R,folderPath:P}of _)y.push({name:dx(n,S.id,R.id),description:vx(R.method,R.name,S.name,P),inputSchema:Wg});y.push({name:px(n,S.id),description:bx(S.name,_.length),inputSchema:zg});for(let{folderPath:R,requestCount:P}of iy(S))P!==0&&y.push({name:hx(n,S.id,R),description:Sx(R,S.name,P),inputSchema:Jg})}for(let S of d)y.push({name:mx(n,S.id),description:wx(S.name,S.requests.length,S.config.iterations),inputSchema:Gg});return x$(y)}finally{Md(e)}}function q8(t,e){let r=ci(t),n;try{n=r.config.getMcpConfig().toolPrefix??""}finally{Md(r)}return n&&e.startsWith(n)?e.slice(n.length):e}function $8(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function E$(t,e,r,n){$a(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}async function M8(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"http-forge",version:"1.0.0"}};case"tools/list":return{tools:await T8(t.workspaceFolder)};case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Lx(t.workspaceFolder,n,i??{}),a=JSON.stringify(s,null,2);return{content:[{type:"text",text:$8(a,t.host,t.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function N8(t,e,r){let n=ci(t.workspaceFolder),i;try{i=n.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{Md(n)}let s=e.headers.origin??"",a=i.includes(s)?s:i[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",a),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function D8(t,e,r){let i=new URL(e.url,`http://${t.host}:${t.port}`).searchParams.get("path");if(!i){r.statusCode=400,r.end("Missing path parameter");return}let s=$d.resolve(i),a=$d.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(a+$d.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}I$.readFile(s,"utf-8",(l,f)=>{if(l){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(f)})}function nr(t){return new Error(`Bad request: ${t}`)}async function F8(t,e,r){let n=ci(t);try{let i=n.collection.getAllCollections(),s=d=>{if(typeof d!="string"||!d.trim())throw nr('the "collection" argument is required');let m=i.find(g=>g.id===d||g.name===d)??i.find(g=>g.name.toLowerCase()===d.toLowerCase());if(!m)throw nr(`collection not found: "${d}"`);return m};if(e===zr.listCollections)return{collections:i.map(d=>({name:d.name,id:d.id,description:d.description??"",requestCount:Ma(d).length}))};if(e===zr.listRequests){let d=s(r.collection),m=typeof r.folder=="string"?r.folder.toLowerCase():void 0,g=Ma(d).filter(({folderPath:y})=>!m||y.toLowerCase().includes(m)).map(({request:y,folderPath:S})=>({name:y.name,method:y.method,folder:S,description:y.description??""}));return{collection:d.name,requests:g}}if(e===zr.runRequest){let d=s(r.collection),m=r.request;if(typeof m!="string"||!m.trim())throw nr('the "request" argument is required');let g=Ma(d),y=g.find(S=>S.request.name===m)??g.find(S=>S.request.name.toLowerCase()===m.toLowerCase());if(!y)throw nr(`request "${m}" not found in collection "${d.name}"`);return uo(()=>ry({workspaceFolder:t,collectionId:d.id,requestId:y.request.id,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(e===zr.runFolder){let d=s(r.collection),m=r.folder;if(typeof m!="string"||!m.trim())throw nr('the "folder" argument is required');let g=iy(d).map(S=>S.folderPath),y=g.find(S=>S===m)??g.find(S=>S.toLowerCase()===m.toLowerCase());if(!y)throw nr(`folder "${m}" not found in collection "${d.name}"`);return uo(()=>qa({workspaceFolder:t,collectionId:d.id,folderPath:y,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(e===zr.runCollection){let d=s(r.collection);return uo(()=>qa({workspaceFolder:t,collectionId:d.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let a=r.suite;if(typeof a!="string"||!a.trim())throw nr('the "suite" argument is required');let l=await n.testSuite.getAllSuites(),f=l.find(d=>d.id===a||d.name===a)??l.find(d=>d.name.toLowerCase()===a.toLowerCase());if(!f)throw nr(`test suite not found: "${a}"`);return uo(()=>ny({workspaceFolder:t,suiteId:f.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{Md(n)}}async function Lx(t,e,r={}){let n=q8(t,e);if(Object.values(zr).includes(n))return F8(t,n,r);let i=gx(n),s=ci(t);try{let a=s.collection.getAllCollections(),l=a.map(y=>y.id),f=y=>{let S=$c(y,l),_=S?a.find(R=>R.id===S):void 0;if(!_)throw nr(`collection not found for tool: ${e}`);return _};if(i.kind==="request"){let[y,S]=i.tokens;if(!y||!S)throw nr(`request tool must be request__<collection>__<request>, got: ${e}`);let _=f(y),R=Ma(_).map(A=>A.request.id),P=$c(S,R);if(!P)throw nr(`request not found in collection "${_.name}" for tool: ${e}`);return uo(()=>ry({workspaceFolder:t,collectionId:_.id,requestId:P,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(i.kind==="collection"){let[y]=i.tokens;if(!y)throw nr(`collection tool must be collection__<collection>, got: ${e}`);let S=f(y);return uo(()=>qa({workspaceFolder:t,collectionId:S.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(i.kind==="folder"){let[y,S]=i.tokens;if(!y||!S)throw nr(`folder tool must be folder__<collection>__<folder>, got: ${e}`);let _=f(y),R=iy(_).map(A=>A.folderPath),P=yx(S,R);if(!P)throw nr(`folder not found in collection "${_.name}" for tool: ${e}`);return uo(()=>qa({workspaceFolder:t,collectionId:_.id,folderPath:P,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[d]=i.tokens;if(!d)throw nr(`suite tool must be suite__<suite>, got: ${e}`);let m=await s.testSuite.getAllSuites(),g=$c(d,m.map(y=>y.id));if(!g)throw nr(`test suite not found for tool: ${e}`);return uo(()=>ny({workspaceFolder:t,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{Md(s)}}function $a(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function O$(t){return new Promise((e,r)=>{let n="";t.on("data",i=>{n+=i,n.length>1024*1024&&r(new Error("Request body too large (max 1MB)"))}),t.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{r(nr("invalid JSON body"))}}),t.on("error",r)})}function L8(t){return I8(async(e,r)=>{try{if(N8(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){$a(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){D8(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await O$(e)}catch{E$(r,null,-32700,"Parse error");return}try{let i=await M8(t,n);$a(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){E$(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await O$(e);if(!n||typeof n.name!="string"||n.name.trim()===""){$a(r,400,{error:'Field "name" is required'});return}let i=await Lx(t.workspaceFolder,n.name,n.args??{});$a(r,200,{result:i});return}$a(r,405,{error:"Method not allowed"})}catch(n){$a(r,500,{error:n.message})}})}async function j8(t){let e=t.port||3100,r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1};return P8.set(n,i),{async start(){if(i.isRunning)return;let s=L8(i);await new Promise((a,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),a()})}),i.server=s,i.isRunning=!0},async stop(){if(!i.server){i.isRunning=!1;return}await new Promise((s,a)=>{i.server.close(l=>{if(l){a(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,a){return Lx(i.workspaceFolder,s,a??{})}}}var P8,k8,C$,Fx,T$=se(()=>{"use strict";Uc();_x();xx();ty();P8=new Map;k8=3e3,C$=new Map,Fx=new Map});var Ol=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};th();Bo();function Ib(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(bE),source:{format:"folder",filePath:e,version:t.version}}}function bE(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(bE)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function BL(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(Pb)}}function Pb(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(Pb)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var Eu=class{store;constructor(e){this.store=new $s(e)}loadAll(){return this.store.loadAll().map(r=>Ib(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return Ib(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return Ib(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(BL(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,Pb(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Ou=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};Vo();var Iu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return at.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return at.parseCookieHeaders(e,r)}isExpired(e){return at.isExpired(e)}domainMatches(e,r){return at.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};ih();var zi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};Il();qu();var Ns=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Ko,this.urlBuilder=new Vn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=zi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};qu();Nu();Du();Il();vf();gf();var Yl=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[it("path").join(s.forgeRoot,"modules")]:[],l=new Gi(new Vn,new Yi,e);this.scriptExecutor=new es(l,a,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},d=this.buildHttpRequest(e,n.overrides),m=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,m),y={request:{url:d.url,method:d.method,headers:{...d.headers},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:void 0},variables:l,collectionVariables:r.variables||{},globals:{...a},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(P,A,U)=>{P==="set"&&A&&U!==void 0?this.forgeEnv.setGlobal(A,U):P==="unset"&&A?this.forgeEnv.unsetGlobal(A):P==="clear"&&this.forgeEnv.clearGlobals()}},S=this.scriptExecutor.createRequestSession(y),_,R;try{if(!n.skipPreRequest&&g.preRequest.length>0){let B=await S.executePreRequest(g.preRequest);if(_={success:B.success,error:B.error,modifiedVariables:B.modifiedVariables,modifiedEnvironment:B.modifiedEnvironmentVariables,modifiedGlobals:B.modifiedGlobals,modifiedCollectionVariables:B.modifiedCollectionVariables,consoleOutput:B.consoleOutput,modifiedRequest:B.modifiedRequest?{url:B.modifiedRequest.url,method:B.modifiedRequest.method,headers:B.modifiedRequest.headers,body:B.modifiedRequest.body?.content}:void 0},B.modifiedVariables&&(l={...l,...B.modifiedVariables}),B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables}),B.modifiedRequest){let V=B.modifiedRequest;V.url&&(d.url=V.url),V.method&&(d.method=V.method),V.headers&&(d.headers={...d.headers,...V.headers}),V.body!==void 0&&(d.body=V.body?.content||V.body)}if(!B.success)throw new Error(`Pre-request script failed: ${B.error}`)}let P={...f,...l};d=this.interpolateRequest(d,P);let A=n.overrides?.body||e.body;if(this.preprocessor&&A&&typeof A!="string"&&A.type==="graphql"&&d.body!==void 0){let B=this.preprocessor.encodeBody({type:"graphql",content:d.body});B!=null&&(d.body=typeof B=="string"?B:JSON.stringify(B))}let U=await this.httpClient.send(d);if(!n.skipPostResponse&&g.postResponse.length>0){let B=await S.executePostResponse(g.postResponse,{status:U.status,statusText:U.statusText,headers:U.headers,body:U.body,cookies:Kh(U.headers,U.cookies,d.url),responseTime:U.time,responseSize:U.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:B.testResults,consoleOutput:B.consoleOutput,modifiedEnvironment:B.modifiedEnvironmentVariables},B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables})}return{response:U,preRequestResult:_,postResponseResult:R,totalTime:Date.now()-i,finalRequest:d,variables:{environment:f,local:l}}}finally{S.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let m=new URLSearchParams;for(let g of e.query)g.enabled!==!1&&m.append(g.key,g.value);n+=(n.includes("?")?"&":"?")+m.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let m of e.headers)m.enabled!==!1&&(a[m.key]=m.value);let l={...a,...r?.headers||{}},f,d=r?.body||e.body;if(d)if(typeof d=="string")f=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")f=typeof d.content=="string"?d.content:JSON.stringify(d.content);else{let m=this.preprocessor.encodeBody(d);f=m!=null?String(m):void 0}else d.content&&(f=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Ns.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,a)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...a),!0;if(l.type==="folder"){let f=[...a,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function mW(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var bf=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let a=mW(),l=Date.now(),f={id:a,timestamp:l,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let d=this.requestIndex.get(e)||[];for(d.unshift(a);d.length>this.maxEntriesPerRequest;){let m=d.pop();m&&(this.entries.delete(m),this.fullResponses.delete(m))}if(this.requestIndex.set(e,d),this.storeFullResponses){let m={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,m)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Sf=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let l=await fetch(e.url,a),f=Date.now(),d;try{d=await l.text()}catch{d=null}let m={};return l.headers.forEach((g,y)=>{let S=m[y];S!==void 0?m[y]=Array.isArray(S)?[...S,g]:[S,g]:m[y]=g}),{status:l.status,statusText:l.statusText,headers:m,cookies:[],body:d,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};Nu();Du();Mu();Qh();Il();var fa=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};Zh();import*as sn from"fs/promises";import*as Kl from"path";var wf=class{async readFile(e){return sn.readFile(e,"utf-8")}async writeFile(e,r){let n=Kl.dirname(e);await this.mkdir(n),await sn.writeFile(e,r,"utf-8")}async exists(e){try{return await sn.access(e),!0}catch{return!1}}async mkdir(e){await sn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Kl.basename(s);for(let l of e)if(this.matchPattern(a,l)){i.push(s);break}})}catch{}return i}async readDir(e){return sn.readdir(e)}async isDirectory(e){try{return(await sn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await sn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Kl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};vf();var A0=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new Ko,this.fileSystem=e.fileSystem||new wf,this.preprocessor=e.preprocessor||new ua,this.dataFileParser=e.dataFileParser||new da,this.cookieJar=e.cookieJar||new Iu,e.enableHistory?this.requestHistory=e.requestHistory||new bf({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Qo(s)}else this.httpClient=new Sf;let r=e.forgeRoot?[it("path").join(e.forgeRoot,"modules")]:[],n=new Gi(new Vn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new es(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new Ou,this.parserRegistry.register("http-forge",new fa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=it("path").join(e.forgeRoot,"collections");this.collectionLoader=new Eu(s)}else this.collectionLoader=new Ol(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new zi(e.environmentConfig):zi.fromVariables({}),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Yi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Ol)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new zi(e),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new Yl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=it("path"),i=n.join(e,"environments"),s,a=Pu(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,d]of Object.entries(a.environments)){let m=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...d.variables,...m}}}}else{let f=it("fs"),d=n.join(i,"environments.json");if(f.existsSync(d))try{let m=f.readFileSync(d,"utf-8"),g=JSON.parse(m);if(s={globalVariables:g.globalVariables||{},environments:{},selectedEnvironment:g.selectedEnvironment},g.environments)for(let[y,S]of Object.entries(g.environments)){let _=S;s.environments[y]={name:_.name||y,variables:_.variables||{}}}}catch(m){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,m)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};ux();fx();Hg();_x();xx();async function U8(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(T$(),k$));return e(t)}async function H8(t){let{runRequest:e}=await Promise.resolve().then(()=>(Uc(),qd));return e(t)}async function B8(t){let{runCollection:e}=await Promise.resolve().then(()=>(Uc(),qd));return e(t)}async function V8(t){let{runFolder:e}=await Promise.resolve().then(()=>(Uc(),qd));return e(t)}async function W8(t){let{runSuite:e}=await Promise.resolve().then(()=>(Uc(),qd));return e(t)}ty();U0();Vo();Cx();H0();Nu();Du();qb();Mu();Qh();Il();x0();P0();vf();Gh();gf();qf();N0();F0();th();Bo();Bo();M0();Mx();V0();ih();qu();rm();W0();X0();q0();function z8(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=t5(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(r5(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=a.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&A$(a)){let g=jx(a,r),y=g.length>0?g[g.length-1]:void 0,S=q$(a);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:S||void 0}}if(A$(a)){let g=jx(a,r),y=g.length>0?g[g.length-1]:void 0,S=q$(a);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:S||void 0}}if(Ux(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let m=jx(a,r);return{contextType:"selection_set",fieldPath:m,parentType:m.length>0?m[m.length-1]:void 0,prefix:s}}function J8(t,e){switch(e.contextType){case"root":return G8(t,e.prefix);case"selection_set":return Y8(t,e);case"argument":return K8(t,e);case"argument_value":return Q8(t,e);case"directive":return Z8(t,e.prefix);case"fragment_type":return X8(t,e.prefix);case"variable_def":return e5(t,e.prefix);default:return[]}}function G8(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
807
807
  $0
808
808
  }`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
809
809
  $0
810
810
  }`},{label:"subscription",detail:"Subscription operation",insertText:`subscription \${1:OperationName} {
811
811
  $0
812
- }`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(q$(s,1,t));return r}function G8(t,e){let r=[],n=e.parentType;if(!n)return r;let i=t.types.get(n);if(!i)return r;if(i.kind==="OBJECT"||i.kind==="INTERFACE"){for(let s of i.fields)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push(q$(s,0,t));(!e.prefix||"__typename".startsWith(e.prefix.toLowerCase()))&&r.push({label:"__typename",kind:"field",detail:"String!",description:"The name of the current object type",sortOrder:10})}if(i.kind==="UNION"||i.kind==="INTERFACE")for(let s of i.possibleTypes){let a=s.replace(/[!\[\]]/g,"");(!e.prefix||a.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:`... on ${a}`,kind:"snippet",detail:`Inline fragment on ${a}`,insertText:`... on ${a} {
812
+ }`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push($$(s,1,t));return r}function Y8(t,e){let r=[],n=e.parentType;if(!n)return r;let i=t.types.get(n);if(!i)return r;if(i.kind==="OBJECT"||i.kind==="INTERFACE"){for(let s of i.fields)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push($$(s,0,t));(!e.prefix||"__typename".startsWith(e.prefix.toLowerCase()))&&r.push({label:"__typename",kind:"field",detail:"String!",description:"The name of the current object type",sortOrder:10})}if(i.kind==="UNION"||i.kind==="INTERFACE")for(let s of i.possibleTypes){let a=s.replace(/[!\[\]]/g,"");(!e.prefix||a.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:`... on ${a}`,kind:"snippet",detail:`Inline fragment on ${a}`,insertText:`... on ${a} {
813
813
  $0
814
- }`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function Y8(t,e){if(!e.currentField||!e.parentType)return[];let r=t.types.get(e.parentType);if(!r)return[];let n=r.fields.find(s=>s.name===e.currentField);if(!n)return[];let i=[];for(let s of n.args)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&i.push({label:s.name,kind:"argument",detail:s.type,description:s.description,insertText:`${s.name}: `,sortOrder:0});return i}function K8(t,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let r=[],n=t.types.get(e.parentType);if(!n)return r;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return r;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return r;let a=s.type.replace(/[!\[\]]/g,""),l=t.types.get(a);if(l&&l.kind==="ENUM")for(let f of l.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:f.name,kind:"enum",detail:l.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(a==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&r.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return r}function Q8(t,e){let r=[];for(let n of t.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";r.push({label:`@${n.name}`,kind:"directive",detail:i||void 0,description:n.description,insertText:n.args.length>0?`@${n.name}($1)`:`@${n.name}`,sortOrder:0})}return r}function Z8(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function X8(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function q$(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let a=r.types.get(n);i=!!a&&(a.kind==="OBJECT"||a.kind==="INTERFACE"||a.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let a=t.args.filter(l=>l.type.endsWith("!"));if(a.length>0){let l=a.map((f,d)=>`${f.name}: \${${d+1}}`).join(", ");s=`${t.name}(${l})`}}return i&&(s+=` {
814
+ }`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function K8(t,e){if(!e.currentField||!e.parentType)return[];let r=t.types.get(e.parentType);if(!r)return[];let n=r.fields.find(s=>s.name===e.currentField);if(!n)return[];let i=[];for(let s of n.args)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&i.push({label:s.name,kind:"argument",detail:s.type,description:s.description,insertText:`${s.name}: `,sortOrder:0});return i}function Q8(t,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let r=[],n=t.types.get(e.parentType);if(!n)return r;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return r;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return r;let a=s.type.replace(/[!\[\]]/g,""),l=t.types.get(a);if(l&&l.kind==="ENUM")for(let f of l.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:f.name,kind:"enum",detail:l.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(a==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&r.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return r}function Z8(t,e){let r=[];for(let n of t.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";r.push({label:`@${n.name}`,kind:"directive",detail:i||void 0,description:n.description,insertText:n.args.length>0?`@${n.name}($1)`:`@${n.name}`,sortOrder:0})}return r}function X8(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function e5(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function $$(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let a=r.types.get(n);i=!!a&&(a.kind==="OBJECT"||a.kind==="INTERFACE"||a.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let a=t.args.filter(l=>l.type.endsWith("!"));if(a.length>0){let l=a.map((f,d)=>`${f.name}: \${${d+1}}`).join(", ");s=`${t.name}(${l})`}}return i&&(s+=` {
815
815
  $0
816
- }`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function e5(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function jx(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function T$(t){return jx(t,"(",")")>0}function t5(t){if(jx(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function A$(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function Lx(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=r5(t),a=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){r.pop(),a=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let d=l+1;if(s[d]==="("){let m=1;for(d++;d<s.length&&m>0;)s[d]==="("?m++:s[d]===")"&&m--,d++}if(d<s.length&&s[d]==="{"&&a){let m=a.fields.find(g=>g.name===f);if(m){let g=m.type.replace(/[!\[\]]/g,"");r.push(g),a=e.types.get(g)}}}}}return r}function r5(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}z0();D_();ew();QR();ng();ex();XR();N_();ZR();L0();j0();Px();lx();Yg();kx();function sy(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function Ux(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function $$(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=sy(e,50),t.p90=sy(e,90),t.p95=sy(e,95),t.p99=sy(e,99)}var Hx=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=Ux("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=Ux("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,Ux(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),$$(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),$$(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};cx();Ho();import*as fs from"fs";import*as Na from"path";var Bx=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=Na.join(this.suiteDir,e,"request.json");if(fs.existsSync(r))try{let n=JSON.parse(fs.readFileSync(r,"utf-8")),i=Na.join(this.suiteDir,e,"scripts"),s=Qp(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=Na.join(this.suiteDir,e);fs.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,fs.writeFileSync(Na.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Na.join(n,"scripts");Zp(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:fs.existsSync(Na.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let l=this.findRequestInCollection(n,e.requestId);l&&(a=l.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,l=this.searchItems(s.items||[],r,a);if(l)return l}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=Sn(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(a){let l=this.resolveRequest(a);l&&r.push(l)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Sn(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};B0();Zh();Kh();tx();rx();ox();sx();nx();ix();ax();nh();sh();ah();bn();export{Aa as AmbiguousRefError,$g as AwsSecretResolver,Mg as AzureKeyVaultResolver,fE as BODY_FILE_MAP,Wg as COLLECTION_INPUT_SCHEMA,ec as CONFIG_FILES,Ol as CollectionLoader,xf as CollectionLoaderFactory,Ws as CollectionRequestExecutor,Cf as CollectionService,tc as ConfigService,Iu as CookieJar,Ef as CookieService,at as CookieUtils,Vt as DEFAULT_CONFIG,Wn as DEFAULT_REQUEST_SETTINGS,Od as DEFAULT_SUITE_CONFIG,CE as DYNAMIC_VARIABLES,fa as DataFileParser,Lg as DopplerResolver,Pf as EnvironmentConfigService,zi as EnvironmentResolver,mc as ExampleGenerator,zg as FOLDER_INPUT_SCHEMA,Sf as FetchHttpClient,Eu as FolderCollectionLoader,$s as FolderCollectionStore,A0 as ForgeContainer,Ns as ForgeEnv,zr as GENERIC_TOOL_NAMES,Fg as GcpSecretResolver,Tf as GraphQLSchemaService,Ex as HTTP_METHOD_MAP,Nc as HTTP_METHOD_REVERSE,Ng as HashiCorpVaultResolver,rc as HistoryAnalyzer,Pd as HtmlReportGenerator,ua as HttpForgeParser,Gi as HttpRequestService,Mc as InMemoryCookieJar,Yi as InterceptorChain,Xl as JsonCollectionLoader,$b as LoggingRequestInterceptor,xr as METADATA_FILES,Bh as ModuleLoader,wf as NodeFileSystem,Ko as NodeHttpClient,_f as OAuth2TokenManager,Dg as OnePasswordResolver,hc as OpenApiExporter,Tc as OpenApiImporter,Ou as ParserRegistry,Of as PersistentCookieJar,Vg as REQUEST_INPUT_SCHEMA,pa as ROOT_DIRECTORIES,kc as RefResolver,Yl as RequestExecutor,qf as RequestHistoryService,bf as RequestHistoryStore,kf as RequestPreparer,ca as RequestPreprocessor,yf as RequestScriptSession,Lc as ResultStorageService,Nb as RetryErrorInterceptor,Cu as SCHEMA_FILES,nn as SCRIPTS_DIR,Kp as SCRIPT_FILES,Jg as SUITE_INPUT_SCHEMA,Ac as SchemaInferenceService,ro as SchemaInferrer,qc as ScriptAnalyzer,es as ScriptExecutor,Ed as SecretResolverRegistry,Pa as ServiceContainer,re as ServiceIdentifiers,Hx as StatisticsService,Id as TestSuiteService,Bx as TestSuiteStore,Mb as TimingResponseInterceptor,Vn as UrlBuilder,Yo as VariableInterpolator,Go as VariableResolver,qW as applyExtractionPlan,Au as applyFilterChain,Wo as augmentWithDynamicVars,a$ as bootstrapNodeRuntime,bx as buildCollectionToolDescription,px as buildCollectionToolName,AW as buildExtractionPlan,Sx as buildFolderToolDescription,hx as buildFolderToolName,Rx as buildGenericTools,vx as buildRequestToolDescription,dx as buildRequestToolName,Gg as buildResultFileName,wx as buildSuiteToolDescription,mx as buildSuiteToolName,hE as cleanupOldBodyFiles,Jh as concatenateScripts,hf as createExpectChain,uP as createLodashShim,j8 as createMcpRuntime,R0 as createModuleLoader,Vh as createMomentShim,ci as createNodeContainer,Wh as createResponseObject,cW as createScriptConsole,E0 as createTestFunction,vj as createVariableResolver,NL as deepClone,Cb as deleteItemFromTree,TW as detectSensitiveData,Jo as evaluateExpression,g8 as expandSummary,yW as exportCollectionToRestClient,xb as findItemById,LL as formatBytes,Gl as formatConsoleOutput,jL as formatDuration,dt as generateId,Sn as generateSlug,Rb as generateUUID,z8 as getCompletions,gW as getRestClientExportFolder,t$ as getServiceContainer,mf as hasChanged,zo as isExpression,DL as isPlainObject,th as isSystemEnvironmentFile,Pu as loadEnvironmentsFromFolder,ka as mcpToolSegment,us as mcpToolToken,xu as mergeHeadersCaseInsensitive,Ab as mergeRequestSettings,O0 as normalizeHeaders,Tu as parseFilterChain,gx as parseMcpToolName,Xh as parsePostmanEnvironment,OW as parsePostmanEnvironmentFile,W8 as parseQueryContext,pE as prepareBodyForSave,dE as readBodyFromDir,mE as readSchemaFile,Qp as readScriptsFromDir,Y0 as redactBody,Q0 as redactFullResponse,Z0 as redactFullResultDetails,ts as redactHeaders,K0 as redactHistoryEntry,nm as redactUrl,Hg as registerCoreServices,Ax as resolveCollectionRef,Ji as resolveDynamicVariable,cj as resolveDynamicVariablesInString,qx as resolveFolderRef,yx as resolveFolderToken,$x as resolveRequestRef,$c as resolveToken,H8 as runCollection,B8 as runFolder,U8 as runRequest,V8 as runSuite,FL as safeJsonParse,It as sanitizeName,Eb as searchForItemPath,Ob as searchForItemPathById,yE as sortItemsByOrder,Zl as writeEnvFile,Qh as writeFolderItems,gE as writeSchemaFiles,Rf as writeScriptFile,Zp as writeScriptsToDir};
816
+ }`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function t5(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function Ux(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function A$(t){return Ux(t,"(",")")>0}function r5(t){if(Ux(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function q$(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function jx(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=n5(t),a=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){r.pop(),a=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let d=l+1;if(s[d]==="("){let m=1;for(d++;d<s.length&&m>0;)s[d]==="("?m++:s[d]===")"&&m--,d++}if(d<s.length&&s[d]==="{"&&a){let m=a.fields.find(g=>g.name===f);if(m){let g=m.type.replace(/[!\[\]]/g,"");r.push(g),a=e.types.get(g)}}}}}return r}function n5(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}z0();D_();ew();QR();ig();ex();XR();N_();ZR();L0();j0();Px();lx();Kg();kx();function sy(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function Hx(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function M$(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=sy(e,50),t.p90=sy(e,90),t.p95=sy(e,95),t.p99=sy(e,99)}var Bx=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=Hx("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=Hx("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,Hx(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),M$(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),M$(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};cx();Bo();import*as fs from"fs";import*as Na from"path";var Vx=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=Na.join(this.suiteDir,e,"request.json");if(fs.existsSync(r))try{let n=JSON.parse(fs.readFileSync(r,"utf-8")),i=Na.join(this.suiteDir,e,"scripts"),s=Xp(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=Na.join(this.suiteDir,e);fs.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,fs.writeFileSync(Na.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Na.join(n,"scripts");eh(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:fs.existsSync(Na.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let l=this.findRequestInCollection(n,e.requestId);l&&(a=l.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,l=this.searchItems(s.items||[],r,a);if(l)return l}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=Sn(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(a){let l=this.resolveRequest(a);l&&r.push(l)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Sn(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};B0();em();Zh();tx();rx();ox();sx();nx();ix();ax();sh();ah();ch();bn();export{Aa as AmbiguousRefError,Mg as AwsSecretResolver,Ng as AzureKeyVaultResolver,dE as BODY_FILE_MAP,zg as COLLECTION_INPUT_SCHEMA,ec as CONFIG_FILES,Ol as CollectionLoader,xf as CollectionLoaderFactory,Ws as CollectionRequestExecutor,Cf as CollectionService,tc as ConfigService,Iu as CookieJar,Ef as CookieService,at as CookieUtils,Vt as DEFAULT_CONFIG,Wn as DEFAULT_REQUEST_SETTINGS,Id as DEFAULT_SUITE_CONFIG,EE as DYNAMIC_VARIABLES,da as DataFileParser,jg as DopplerResolver,Pf as EnvironmentConfigService,zi as EnvironmentResolver,mc as ExampleGenerator,Jg as FOLDER_INPUT_SCHEMA,Sf as FetchHttpClient,Eu as FolderCollectionLoader,$s as FolderCollectionStore,A0 as ForgeContainer,Ns as ForgeEnv,zr as GENERIC_TOOL_NAMES,Lg as GcpSecretResolver,Tf as GraphQLSchemaService,Ex as HTTP_METHOD_MAP,Nc as HTTP_METHOD_REVERSE,Dg as HashiCorpVaultResolver,rc as HistoryAnalyzer,kd as HtmlReportGenerator,fa as HttpForgeParser,Gi as HttpRequestService,Mc as InMemoryCookieJar,Yi as InterceptorChain,Xl as JsonCollectionLoader,$b as LoggingRequestInterceptor,xr as METADATA_FILES,Wh as ModuleLoader,wf as NodeFileSystem,Qo as NodeHttpClient,_f as OAuth2TokenManager,Fg as OnePasswordResolver,hc as OpenApiExporter,Tc as OpenApiImporter,Ou as ParserRegistry,Of as PersistentCookieJar,Wg as REQUEST_INPUT_SCHEMA,ha as ROOT_DIRECTORIES,kc as RefResolver,Yl as RequestExecutor,$f as RequestHistoryService,bf as RequestHistoryStore,kf as RequestPreparer,ua as RequestPreprocessor,yf as RequestScriptSession,Lc as ResultStorageService,Nb as RetryErrorInterceptor,Cu as SCHEMA_FILES,nn as SCRIPTS_DIR,Zp as SCRIPT_FILES,Gg as SUITE_INPUT_SCHEMA,Ac as SchemaInferenceService,no as SchemaInferrer,qc as ScriptAnalyzer,es as ScriptExecutor,Od as SecretResolverRegistry,Pa as ServiceContainer,re as ServiceIdentifiers,Bx as StatisticsService,Pd as TestSuiteService,Vx as TestSuiteStore,Mb as TimingResponseInterceptor,Vn as UrlBuilder,Ko as VariableInterpolator,Yo as VariableResolver,$W as applyExtractionPlan,Au as applyFilterChain,zo as augmentWithDynamicVars,l$ as bootstrapNodeRuntime,bx as buildCollectionToolDescription,px as buildCollectionToolName,qW as buildExtractionPlan,Sx as buildFolderToolDescription,hx as buildFolderToolName,Rx as buildGenericTools,vx as buildRequestToolDescription,dx as buildRequestToolName,Yg as buildResultFileName,wx as buildSuiteToolDescription,mx as buildSuiteToolName,mE as cleanupOldBodyFiles,Yh as concatenateScripts,hf as createExpectChain,fP as createLodashShim,U8 as createMcpRuntime,R0 as createModuleLoader,zh as createMomentShim,ci as createNodeContainer,Jh as createResponseObject,uW as createScriptConsole,E0 as createTestFunction,bj as createVariableResolver,DL as deepClone,Cb as deleteItemFromTree,AW as detectSensitiveData,Go as evaluateExpression,y8 as expandSummary,vW as exportCollectionToRestClient,xb as findItemById,jL as formatBytes,Gl as formatConsoleOutput,UL as formatDuration,dt as generateId,Sn as generateSlug,Rb as generateUUID,J8 as getCompletions,yW as getRestClientExportFolder,r$ as getServiceContainer,mf as hasChanged,Jo as isExpression,FL as isPlainObject,nh as isSystemEnvironmentFile,Pu as loadEnvironmentsFromFolder,ka as mcpToolSegment,us as mcpToolToken,xu as mergeHeadersCaseInsensitive,Ab as mergeRequestSettings,O0 as normalizeHeaders,Tu as parseFilterChain,gx as parseMcpToolName,tm as parsePostmanEnvironment,IW as parsePostmanEnvironmentFile,z8 as parseQueryContext,hE as prepareBodyForSave,pE as readBodyFromDir,gE as readSchemaFile,Xp as readScriptsFromDir,Y0 as redactBody,Q0 as redactFullResponse,Z0 as redactFullResultDetails,ts as redactHeaders,K0 as redactHistoryEntry,sm as redactUrl,Bg as registerCoreServices,Ax as resolveCollectionRef,Ji as resolveDynamicVariable,uj as resolveDynamicVariablesInString,qx as resolveFolderRef,yx as resolveFolderToken,$x as resolveRequestRef,$c as resolveToken,B8 as runCollection,V8 as runFolder,H8 as runRequest,W8 as runSuite,LL as safeJsonParse,It as sanitizeName,Eb as searchForItemPath,Ob as searchForItemPathById,vE as sortItemsByOrder,Zl as writeEnvFile,Xh as writeFolderItems,yE as writeSchemaFiles,Rf as writeScriptFile,eh as writeScriptsToDir};