@http-forge/core 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +126 -126
- package/dist/index.mjs +127 -127
- package/dist/infrastructure/test-suite/interfaces.d.ts +1 -0
- package/dist/infrastructure/test-suite/test-suite-service.d.ts +10 -0
- package/dist/runtime/direct-execution.d.ts +9 -0
- package/dist/runtime/runtime-contracts.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var BF=Object.create;var Dp=Object.defineProperty;var VF=Object.getOwnPropertyDescriptor;var WF=Object.getOwnPropertyNames;var zF=Object.getPrototypeOf,JF=Object.prototype.hasOwnProperty;var nt=(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 le=(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}},ks=(t,e)=>{for(var r in e)Dp(t,r,{get:e[r],enumerable:!0})},AE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of WF(e))!JF.call(t,i)&&i!==r&&Dp(t,i,{get:()=>e[i],enumerable:!(n=VF(e,i))||n.enumerable});return t};var ib=(t,e,r)=>(r=t!=null?BF(zF(t)):{},AE(e||!t||!t.__esModule?Dp(r,"default",{value:t,enumerable:!0}):r,t)),gl=t=>AE(Dp({},"__esModule",{value:!0}),t);function It(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function ft(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${It(t)}_${e}`:e}function sb(){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 pu(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 YF(t){return JSON.parse(JSON.stringify(t))}function GF(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function KF(t,e){try{return JSON.parse(t)}catch{return e}}function QF(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 ZF(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var mn=le(()=>{"use strict"});import*as ot from"fs";import*as jn from"path";function Lp(t){if(!ot.existsSync(t))return;let e={},r=jn.join(t,Fp.preRequest);ot.existsSync(r)&&(e.preRequest=ot.readFileSync(r,"utf-8"));let n=jn.join(t,Fp.postResponse);return ot.existsSync(n)&&(e.postResponse=ot.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function jp(t,e){await ot.promises.mkdir(t,{recursive:!0});let r=jn.join(t,Fp.preRequest);e.preRequest?await ot.promises.writeFile(r,e.preRequest,"utf-8"):ot.existsSync(r)&&await ot.promises.unlink(r);let n=jn.join(t,Fp.postResponse);e.postResponse?await ot.promises.writeFile(n,e.postResponse,"utf-8"):ot.existsSync(n)&&await ot.promises.unlink(n)}function $E(t){for(let[e,r]of Object.entries(qE)){let n=jn.join(t,e);if(ot.existsSync(n))try{let i=ot.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 ME(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 NE(t,e){for(let r of Object.keys(qE))if(r!==e){let n=jn.join(t,r);if(ot.existsSync(n))try{await ot.promises.unlink(n)}catch{}}}function DE(t){if(ot.existsSync(t))try{let e=ot.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function FE(t,e,r){let n=jn.join(t,hu.responseSchema),i=jn.join(t,hu.bodySchema);e?await ot.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):ot.existsSync(n)&&await ot.promises.unlink(n),r?await ot.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):ot.existsSync(i)&&await ot.promises.unlink(i)}function ob(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=ob(r.items,e);if(n)return n}}}function ab(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&&ab(n.items,e))return!0}return!1}function LE(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 lb(t,e){let r;try{r=ot.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===gn)continue;if(n.name===e)return jn.join(t,n.name);let i=lb(jn.join(t,n.name),e);if(i)return i}}function Hi(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 w=parseInt(y.substring(1));w>a&&(a=w)}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 Fp,xr,qE,hu,gn,vl=le(()=>{"use strict";Fp={preRequest:"pre-request.js",postResponse:"post-response.js"},xr={collection:"collection.json",folder:"folder.json",request:"request.json"},qE={"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"}},hu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},gn="scripts"});import*as Se from"fs";import*as Oe from"path";var Ts,Up=le(()=>{"use strict";mn();vl();Ts=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(){Se.existsSync(this.collectionsDir)||Se.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Se.existsSync(this.collectionsDir))return[];let e=Se.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=Oe.join(this.collectionsDir,e),n=Oe.join(r,xr.collection);if(Se.existsSync(n))try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Oe.join(r,gn)),l=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:l}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=Se.readdirSync(e,{withFileTypes:!0});for(let l of a){if(!l.isDirectory()||l.name===gn)continue;let f=Oe.join(e,l.name);if(Se.existsSync(Oe.join(f,xr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(Se.existsSync(Oe.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=Oe.join(e,xr.folder);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Oe.join(e,gn)),l=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:l}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=Oe.join(e,xr.request);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Oe.join(e,gn)),l=s.body,f=this.loadBodyFromDir(e);f&&(l=f);let d=this.loadSchemaFile(Oe.join(e,hu.responseSchema)),m=this.loadSchemaFile(Oe.join(e,hu.bodySchema)),g=Oe.join(e,"doc.md"),y=Se.existsSync(g)?Se.readFileSync(g,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:l,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...y&&{doc:y},...d&&{responseSchema:d},...m&&{bodySchema:m}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return Lp(e)}loadBodyFromDir(e){return $E(e)}loadSchemaFile(e){return DE(e)}async saveSchemaFiles(e,r){return FE(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=ft(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=Se.readdirSync(this.collectionsDir);r=Hi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Oe.join(this.collectionsDir,r);await Se.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await Se.promises.writeFile(Oe.join(n,xr.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(Oe.join(n,gn),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await Se.promises.writeFile(Oe.join(n,xr.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=Hi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=Oe.join(e,s);await Se.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await Se.promises.writeFile(Oe.join(e,xr.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(Oe.join(e,gn),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await Se.promises.writeFile(Oe.join(e,xr.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={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:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await Se.promises.writeFile(Oe.join(e,xr.request),JSON.stringify(s,null,2),"utf-8"),i&&await Se.promises.writeFile(Oe.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await Se.promises.writeFile(Oe.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(Oe.join(e,gn),r.scripts)}prepareBodyForSave(e){return ME(e)}async cleanupOldBodyFiles(e,r){return NE(e,r)}async saveScriptsToDir(e,r){return jp(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=Oe.join(this.collectionsDir,r);if(!Se.existsSync(n))return!1;try{return await Se.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?Se.existsSync(Oe.join(this.collectionsDir,r,xr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Oe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||ft(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(Oe.join(s,gn),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(Oe.join(n,gn))}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=Oe.join(this.collectionsDir,i),a=Oe.join(s,xr.collection),l=Se.readFileSync(a,"utf-8"),d={...JSON.parse(l),...r,id:e};await Se.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=Oe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let m=Se.readdirSync(a).filter(g=>Se.statSync(Oe.join(a,g)).isDirectory()&&g!==gn);l=Hi(r.name,m),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Oe.join(a,l);await Se.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||!Se.existsSync(i))return!1;try{await Se.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||!Se.existsSync(a))return!1;let l;if(n){let m=this.findItemPath(e,n);if(!m)return!1;l=m}else l=Oe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let d=Oe.join(l,f);if(Se.existsSync(d))return!1;try{await Se.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=Oe.join(l,xr.folder),d=Se.readFileSync(f,"utf-8"),m=JSON.parse(d);m.order=a,await Se.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=Oe.join(this.collectionsDir,s,xr.collection),f=Se.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=a,await Se.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 LE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return lb(Oe.join(this.collectionsDir,n),i)}findItemById(e,r){return ob(e,r)}deleteItemFromTree(e,r){return ab(e,r)}}});var dt,bl=le(()=>{"use strict";dt=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(),w=g===-1?"":m.substring(g+1);switch(y){case"domain":d.domain=w.startsWith(".")?w.substring(1):w;break;case"path":d.path=w;break;case"expires":d.expires=w;break;case"max-age":d.maxAge=parseInt(w,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=w;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 As from"fs";import*as Fo from"path";function Bp(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function vu(t){if(!As.existsSync(t))return eL();let e=Hp(Fo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=As.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!Bp(d)),s={};for(let d of i){let m=Hp(Fo.join(t,d))||{},g=Fo.basename(d,".json");s[g]={description:m.description,requiresConfirmation:m.requiresConfirmation,variables:m.variables||{},secretVariables:m.secretVariables}}let l=(Hp(Fo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let m=Fo.join(t,`${d}.local.json`);if(As.existsSync(m)){let g=Hp(m)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function eL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Hp(t){try{if(!As.existsSync(t))return null;let e=As.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 Vp=le(()=>{"use strict"});var Un,Sl=le(()=>{"use strict";Un=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,w)=>{let R=r[y];return R!==void 0&&R!==""?encodeURIComponent(R):w?"":(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 UE(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,HE=le(()=>{Zt=[];for(let t=0;t<256;++t)Zt.push((t+256).toString(16).slice(1))});function fb(){return crypto.getRandomValues(tL)}var tL,BE=le(()=>{tL=new Uint8Array(16)});function rL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():nL(t,e,r)}function nL(t,e,r){t=t||{};let n=t.random??t.rng?.()??fb();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 UE(n)}var wl,VE=le(()=>{BE();HE();wl=rL});var db=le(()=>{VE()});function iL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function sL(){return Date.now()}function WE(){return wl()}function oL(){return wl()}function zE(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 aL(){let t=zE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function lL(){return Math.random()<.5}function cL(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 uL(){return Math.floor(Date.now()/1e3)}function fL(){return new Date().toISOString()}function dL(){return new Date().toISOString().split("T")[0]}function pL(){return new Date().toISOString().split("T")[1].split(".")[0]}function hL(){return new Date().toISOString()}function mL(t=""){return Buffer.from(String(t)).toString("base64")}function gL(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function yL(t=""){return encodeURIComponent(String(t))}function vL(t=""){return decodeURIComponent(String(t))}function bL(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 Vi(t,e){let r=JE[t];return r?e&&e.length>0?r(...e):r():null}function SL(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?bL(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function Lo(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=Vi(a);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var JE,Wp=le(()=>{"use strict";db();JE={randomInt:iL,timestamp:sL,guid:oL,uuid:WE,randomUUID:WE,randomString:zE,randomHexadecimal:cL,randomEmail:aL,randomBoolean:lL,isoTimestamp:hL,timestamp_s:uL,datetime:fL,date:dL,time:pL,base64Encode:mL,base64Decode:gL,urlEncode:yL,urlDecode:vL}});import*as zp 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 Uo(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=zp.createContext(r);return zp.runInContext(t,n,{timeout:wL,displayErrors:!1})}catch{return}}var wL,Jp=le(()=>{"use strict";wL=100});import*as Yp from"crypto";function _L(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Su(t){if(!t||!t.includes("|"))return null;let e=xL(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=RL(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function xL(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 RL(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:EL(n)}}function EL(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=_L(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function wu(t,e,r={}){let n=t;for(let i of e)n=CL(n,i.name,i.args,r);return n}function CL(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(IL(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 Yp.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 Yp.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:OL(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=>bu(s,i[0])):t.map(s=>{let a={};for(let l of i){let f=bu(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=>bu(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?bu(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 OL(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=bu(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 bu(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function IL(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Gp=le(()=>{"use strict"});function YE(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 PL(t){return new Ho(t)}var Ho,Bo,_u=le(()=>{"use strict";Wp();Jp();Gp();Ho=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(l,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,l));let n="",i=0,s=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let l=a[1].trim(),f=this.resolveTemplateContent(l,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let d=this.getStringContext(e,a.index);n+=d?this.escapeForString(String(f),d):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(d,m)=>this.resolveTemplateContent(m.trim(),i,d));let s="",a=0,l=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,f;for(;(f=l.exec(e))!==null;){let d=f[1].trim(),m=this.resolveTemplateContent(d,i,f[0]);if(m!==f[0]){s+=e.slice(a,f.index);let g=this.getStringContext(e,f.index);s+=g?this.escapeForString(String(m),g):String(m)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}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=YE(i[2],r),f=Vi(i[1],l);return f!==null?String(f):n}let s=Su(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=wu(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=Lo(e,l),d=Uo(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=YE(n[2],r),a=Vi(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=Lo(e,s),l=Uo(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}},Bo=class{interpolate(e,r){return!e||typeof e!="string"?e:new Ho({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},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 kL from"http";import*as xu from"https";import{URL as GE}from"url";import*as Kp from"zlib";var Hn,Vo,Ru=le(()=>{"use strict";Hn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Vo=class{settings;version;constructor(e){this.settings={...Hn,...e};try{this.version=nt("../../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 GE(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=xu.globalAgent:m.agent=new xu.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",y(x);return}let R=(l?xu:kL).request(m,async x=>{let T=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(T)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let L=x.headers.location;if(!L){y(new Error("Redirect response missing Location header"));return}let V=new GE(L,e.url).toString(),B=e.method;!r.followOriginalMethod&&[301,302,303].includes(T)&&(B="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let X=await this.executeInternal({...e,url:V,method:B,headers:K,body:B==="GET"?void 0:e.body},r,n+1,i),k=Date.now();X.time=k-s,g(X)}catch(X){y(X)}return}let q=[];x.on("data",L=>q.push(L)),x.on("end",()=>{let L=Date.now(),V=Buffer.concat(q),B=x.headers["content-encoding"];if(r.decompress&&B)try{B==="gzip"?V=Kp.gunzipSync(V):B==="deflate"&&(V=Kp.inflateSync(V))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=V.toString("utf-8"),X;try{X=JSON.parse(K)}catch{X=K}let k={};for(let[P,$]of Object.entries(x.headers))(typeof $=="string"||Array.isArray($))&&(k[P]=$);let _=this.parseCookies(x.headers["set-cookie"],a.hostname);g({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:_,body:X,time:L-s,size:V.length})})});if(i&&i.addEventListener("abort",()=>{R.destroy();let x=new Error("Request cancelled");x.name="AbortError",y(x)}),R.on("error",x=>{y(x)}),R.on("timeout",()=>{R.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);R.write(x)}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 pb(t){return{timeout:t?.timeout??Hn.timeout,followRedirects:t?.followRedirects??Hn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Hn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Hn.followAuthHeader,maxRedirects:t?.maxRedirects??Hn.maxRedirects,strictSSL:t?.strictSSL??Hn.strictSSL,decompress:t?.decompress??Hn.decompress,includeCookies:t?.includeCookies??Hn.includeCookies}}var hb=le(()=>{"use strict";Ru()});var Wi,Eu=le(()=>{"use strict";hb();Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=pb(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 zi,mb,gb,yb,Cu=le(()=>{"use strict";zi=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))}},mb=class{name="logging";priority=1e3;intercept(e,r){return e}},gb=class{name="timing";priority=1;intercept(e,r,n){return e}},yb=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 KE=F((_l,Ou)=>{(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,w=1,R=2,x=1,T=2,q=4,L=8,V=16,B=32,K=64,X=128,k=256,_=512,P=30,$="...",N=800,j=16,Y=1,J=2,ne=3,pe=1/0,Xe=9007199254740991,xe=17976931348623157e292,he=NaN,Ee=4294967295,vt=Ee-1,Ct=Ee>>>1,ce=[["ary",X],["bind",x],["bindKey",T],["curry",L],["curryRight",V],["flip",_],["partial",B],["partialRight",K],["rearg",k]],pr="[object Arguments]",oi="[object Array]",xt="[object AsyncFunction]",zr="[object Boolean]",Or="[object Date]",ht="[object DOMException]",mt="[object Error]",nn="[object Function]",oo="[object GeneratorFunction]",Jt="[object Map]",ao="[object Number]",Hg="[object Null]",Cn="[object Object]",_d="[object Promise]",xd="[object Proxy]",Yt="[object RegExp]",hr="[object Set]",lo="[object String]",Oa="[object Symbol]",Rd="[object Undefined]",Ut="[object WeakMap]",Ed="[object WeakSet]",Ci="[object ArrayBuffer]",On="[object DataView]",st="[object Float32Array]",Ia="[object Float64Array]",Pa="[object Int8Array]",cs="[object Int16Array]",co="[object Int32Array]",us="[object Uint8Array]",ai="[object Uint8ClampedArray]",fs="[object Uint16Array]",Tc="[object Uint32Array]",ka=/\b__p \+= '';/g,Bg=/\b(__p \+=) '' \+/g,uo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oi=/&(?:amp|lt|gt|quot|#39);/g,Ta=/[&<>"']/g,Aa=RegExp(Oi.source),ae=RegExp(Ta.source),Vg=/<%-([\s\S]+?)%>/g,Wg=/<%([\s\S]+?)%>/g,sn=/<%=([\s\S]+?)%>/g,Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,Ac=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,fo=RegExp(Ke.source),qc=/^\s+/,qa=/\s/,Gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,In=/\{\n\/\* \[wrapped with (.+)\] \*/,on=/,? & /,At=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pr=/[()=,{}\[\]\/\s]/,Pn=/\\(\\)?/g,Ii=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cd=/\w*$/,zg=/^[-+]0x[0-9a-f]+$/i,po=/^0b[01]+$/i,Od=/^\[object .+?Constructor\]$/,Jg=/^0o[0-7]+$/i,ds=/^(?:0|[1-9]\d*)$/,ho=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mo=/($^)/,Yg=/['\n\r\u2028\u2029\\]/g,$a="\\ud800-\\udfff",Gg="\\u0300-\\u036f",Rt="\\ufe20-\\ufe2f",$c="\\u20d0-\\u20ff",Id=Gg+Rt+$c,Mc="\\u2700-\\u27bf",Nc="a-z\\xdf-\\xf6\\xf8-\\xff",Kg="\\xac\\xb1\\xd7\\xf7",Qg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Zg="\\u2000-\\u206f",Xg=" \\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",Pd="A-Z\\xc0-\\xd6\\xd8-\\xde",kd="\\ufe0e\\ufe0f",Dc=Kg+Qg+Zg+Xg,Ma="['\u2019]",ey="["+$a+"]",Td="["+Dc+"]",Na="["+Id+"]",Fc="\\d+",ty="["+Mc+"]",ps="["+Nc+"]",go="[^"+$a+Dc+Fc+Mc+Nc+Pd+"]",Da="\\ud83c[\\udffb-\\udfff]",yo="(?:"+Na+"|"+Da+")",an="[^"+$a+"]",Lc="(?:\\ud83c[\\udde6-\\uddff]){2}",jc="[\\ud800-\\udbff][\\udc00-\\udfff]",hs="["+Pd+"]",Ad="\\u200d",qd="(?:"+ps+"|"+go+")",ry="(?:"+hs+"|"+go+")",$d="(?:"+Ma+"(?:d|ll|m|re|s|t|ve))?",Md="(?:"+Ma+"(?:D|LL|M|RE|S|T|VE))?",Fa=yo+"?",Nd="["+kd+"]?",Dd="(?:"+Ad+"(?:"+[an,Lc,jc].join("|")+")"+Nd+Fa+")*",ny="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",iy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fd=Nd+Fa+Dd,sy="(?:"+[ty,Lc,jc].join("|")+")"+Fd,oy="(?:"+[an+Na+"?",Na,Lc,jc,ey].join("|")+")",ay=RegExp(Ma,"g"),ly=RegExp(Na,"g"),Uc=RegExp(Da+"(?="+Da+")|"+oy+Fd,"g"),cy=RegExp([hs+"?"+ps+"+"+$d+"(?="+[Td,hs,"$"].join("|")+")",ry+"+"+Md+"(?="+[Td,hs+qd,"$"].join("|")+")",hs+"?"+qd+"+"+$d,hs+"+"+Md,iy,ny,Fc,sy].join("|"),"g"),uy=RegExp("["+Ad+$a+Id+kd+"]"),fy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,dy=["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"],py=-1,ut={};ut[st]=ut[Ia]=ut[Pa]=ut[cs]=ut[co]=ut[us]=ut[ai]=ut[fs]=ut[Tc]=!0,ut[pr]=ut[oi]=ut[Ci]=ut[zr]=ut[On]=ut[Or]=ut[mt]=ut[nn]=ut[Jt]=ut[ao]=ut[Cn]=ut[Yt]=ut[hr]=ut[lo]=ut[Ut]=!1;var at={};at[pr]=at[oi]=at[Ci]=at[On]=at[zr]=at[Or]=at[st]=at[Ia]=at[Pa]=at[cs]=at[co]=at[Jt]=at[ao]=at[Cn]=at[Yt]=at[hr]=at[lo]=at[Oa]=at[us]=at[ai]=at[fs]=at[Tc]=!0,at[mt]=at[nn]=at[Ut]=!1;var Hc={\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"},Bc={"&":"&","<":"<",">":">",'"':""","'":"'"},hy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ld={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jd=parseFloat,my=parseInt,Ud=typeof global=="object"&&global&&global.Object===Object&&global,gy=typeof self=="object"&&self&&self.Object===Object&&self,Nt=Ud||gy||Function("return this")(),La=typeof _l=="object"&&_l&&!_l.nodeType&&_l,Qe=La&&typeof Ou=="object"&&Ou&&!Ou.nodeType&&Ou,ms=Qe&&Qe.exports===La,Pi=ms&&Ud.process,kr=(function(){try{var U=Qe&&Qe.require&&Qe.require("util").types;return U||Pi&&Pi.binding&&Pi.binding("util")}catch{}})(),Vc=kr&&kr.isArrayBuffer,Hd=kr&&kr.isDate,Bd=kr&&kr.isMap,vo=kr&&kr.isRegExp,kn=kr&&kr.isSet,ja=kr&&kr.isTypedArray;function mr(U,G,W){switch(W.length){case 0:return U.call(G);case 1:return U.call(G,W[0]);case 2:return U.call(G,W[0],W[1]);case 3:return U.call(G,W[0],W[1],W[2])}return U.apply(G,W)}function Tn(U,G,W,oe){for(var be=-1,Ye=U==null?0:U.length;++be<Ye;){var tt=U[be];G(oe,tt,W(tt),U)}return oe}function gr(U,G){for(var W=-1,oe=U==null?0:U.length;++W<oe&&G(U[W],W,U)!==!1;);return U}function Wc(U,G){for(var W=U==null?0:U.length;W--&&G(U[W],W,U)!==!1;);return U}function Vd(U,G){for(var W=-1,oe=U==null?0:U.length;++W<oe;)if(!G(U[W],W,U))return!1;return!0}function li(U,G){for(var W=-1,oe=U==null?0:U.length,be=0,Ye=[];++W<oe;){var tt=U[W];G(tt,W,U)&&(Ye[be++]=tt)}return Ye}function Ua(U,G){var W=U==null?0:U.length;return!!W&&ki(U,G,0)>-1}function gs(U,G,W){for(var oe=-1,be=U==null?0:U.length;++oe<be;)if(W(G,U[oe]))return!0;return!1}function lt(U,G){for(var W=-1,oe=U==null?0:U.length,be=Array(oe);++W<oe;)be[W]=G(U[W],W,U);return be}function ci(U,G){for(var W=-1,oe=G.length,be=U.length;++W<oe;)U[be+W]=G[W];return U}function zc(U,G,W,oe){var be=-1,Ye=U==null?0:U.length;for(oe&&Ye&&(W=U[++be]);++be<Ye;)W=G(W,U[be],be,U);return W}function yy(U,G,W,oe){var be=U==null?0:U.length;for(oe&&be&&(W=U[--be]);be--;)W=G(W,U[be],be,U);return W}function Ha(U,G){for(var W=-1,oe=U==null?0:U.length;++W<oe;)if(G(U[W],W,U))return!0;return!1}var vy=bo("length");function by(U){return U.split("")}function Sy(U){return U.match(At)||[]}function Wd(U,G,W){var oe;return W(U,function(be,Ye,tt){if(G(be,Ye,tt))return oe=Ye,!1}),oe}function Ba(U,G,W,oe){for(var be=U.length,Ye=W+(oe?1:-1);oe?Ye--:++Ye<be;)if(G(U[Ye],Ye,U))return Ye;return-1}function ki(U,G,W){return G===G?Py(U,G,W):Ba(U,Ti,W)}function wy(U,G,W,oe){for(var be=W-1,Ye=U.length;++be<Ye;)if(oe(U[be],G))return be;return-1}function Ti(U){return U!==U}function zd(U,G){var W=U==null?0:U.length;return W?Yc(U,G)/W:he}function bo(U){return function(G){return G==null?t:G[U]}}function Jc(U){return function(G){return U==null?t:U[G]}}function Va(U,G,W,oe,be){return be(U,function(Ye,tt,Ue){W=oe?(oe=!1,Ye):G(W,Ye,tt,Ue)}),W}function _y(U,G){var W=U.length;for(U.sort(G);W--;)U[W]=U[W].value;return U}function Yc(U,G){for(var W,oe=-1,be=U.length;++oe<be;){var Ye=G(U[oe]);Ye!==t&&(W=W===t?Ye:W+Ye)}return W}function Gc(U,G){for(var W=-1,oe=Array(U);++W<U;)oe[W]=G(W);return oe}function xy(U,G){return lt(G,function(W){return[W,U[W]]})}function Kc(U){return U&&U.slice(0,Qd(U)+1).replace(qc,"")}function yr(U){return function(G){return U(G)}}function Wa(U,G){return lt(G,function(W){return U[W]})}function et(U,G){return U.has(G)}function Jd(U,G){for(var W=-1,oe=U.length;++W<oe&&ki(G,U[W],0)>-1;);return W}function Yd(U,G){for(var W=U.length;W--&&ki(G,U[W],0)>-1;);return W}function Gd(U,G){for(var W=U.length,oe=0;W--;)U[W]===G&&++oe;return oe}var Ry=Jc(Hc),Ey=Jc(Bc);function Cy(U){return"\\"+Ld[U]}function So(U,G){return U==null?t:U[G]}function ys(U){return uy.test(U)}function Oy(U){return fy.test(U)}function Iy(U){for(var G,W=[];!(G=U.next()).done;)W.push(G.value);return W}function vs(U){var G=-1,W=Array(U.size);return U.forEach(function(oe,be){W[++G]=[be,oe]}),W}function wo(U,G){return function(W){return U(G(W))}}function ln(U,G){for(var W=-1,oe=U.length,be=0,Ye=[];++W<oe;){var tt=U[W];(tt===G||tt===d)&&(U[W]=d,Ye[be++]=W)}return Ye}function za(U){var G=-1,W=Array(U.size);return U.forEach(function(oe){W[++G]=oe}),W}function Kd(U){var G=-1,W=Array(U.size);return U.forEach(function(oe){W[++G]=[oe,oe]}),W}function Py(U,G,W){for(var oe=W-1,be=U.length;++oe<be;)if(U[oe]===G)return oe;return-1}function Qc(U,G,W){for(var oe=W+1;oe--;)if(U[oe]===G)return oe;return oe}function ui(U){return ys(U)?Ty(U):vy(U)}function vr(U){return ys(U)?Ay(U):by(U)}function Qd(U){for(var G=U.length;G--&&qa.test(U.charAt(G)););return G}var ky=Jc(hy);function Ty(U){for(var G=Uc.lastIndex=0;Uc.test(U);)++G;return G}function Ay(U){return U.match(Uc)||[]}function qy(U){return U.match(cy)||[]}var $y=(function U(G){G=G==null?Nt:fi.defaults(Nt.Object(),G,fi.pick(Nt,dy));var W=G.Array,oe=G.Date,be=G.Error,Ye=G.Function,tt=G.Math,Ue=G.Object,Ja=G.RegExp,My=G.String,br=G.TypeError,_o=W.prototype,Ny=Ye.prototype,bs=Ue.prototype,xo=G["__core-js_shared__"],Ya=Ny.toString,Ze=bs.hasOwnProperty,Dy=0,Zd=(function(){var o=/[^.]+$/.exec(xo&&xo.keys&&xo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Ga=bs.toString,Fy=Ya.call(Ue),Ly=Nt._,jy=Ja("^"+Ya.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ka=ms?G.Buffer:t,di=G.Symbol,Qa=G.Uint8Array,Xd=Ka?Ka.allocUnsafe:t,Za=wo(Ue.getPrototypeOf,Ue),ep=Ue.create,Ro=bs.propertyIsEnumerable,Xa=_o.splice,tp=di?di.isConcatSpreadable:t,Eo=di?di.iterator:t,Ai=di?di.toStringTag:t,el=(function(){try{var o=Mo(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),Uy=G.clearTimeout!==Nt.clearTimeout&&G.clearTimeout,Hy=oe&&oe.now!==Nt.Date.now&&oe.now,By=G.setTimeout!==Nt.setTimeout&&G.setTimeout,Co=tt.ceil,Oo=tt.floor,tl=Ue.getOwnPropertySymbols,rl=Ka?Ka.isBuffer:t,qi=G.isFinite,nl=_o.join,rp=wo(Ue.keys,Ue),gt=tt.max,Ht=tt.min,np=oe.now,Vy=G.parseInt,ip=tt.random,Wy=_o.reverse,Zc=Mo(G,"DataView"),Io=Mo(G,"Map"),Xc=Mo(G,"Promise"),Ss=Mo(G,"Set"),Po=Mo(G,"WeakMap"),ko=Mo(Ue,"create"),il=Po&&new Po,ws={},zy=No(Zc),Jy=No(Io),Yy=No(Xc),Gy=No(Ss),Ky=No(Po),sl=di?di.prototype:t,To=sl?sl.valueOf:t,sp=sl?sl.toString:t;function O(o){if(Ot(o)&&!Re(o)&&!(o instanceof $e)){if(o instanceof nr)return o;if(Ze.call(o,"__wrapped__"))return KR(o)}return new nr(o)}var _s=(function(){function o(){}return function(c){if(!Et(c))return{};if(ep)return ep(c);o.prototype=c;var p=new o;return o.prototype=t,p}})();function ol(){}function nr(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=t}O.templateSettings={escape:Vg,evaluate:Wg,interpolate:sn,variable:"",imports:{_:O}},O.prototype=ol.prototype,O.prototype.constructor=O,nr.prototype=_s(ol.prototype),nr.prototype.constructor=nr;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ee,this.__views__=[]}function Qy(){var o=new $e(this.__wrapped__);return o.__actions__=Tr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Tr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Tr(this.__views__),o}function Zy(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function eu(){var o=this.__wrapped__.value(),c=this.__dir__,p=Re(o),v=c<0,E=p?o.length:0,I=y$(0,E,this.__views__),A=I.start,D=I.end,H=D-A,Q=v?D:A-1,Z=this.__iteratees__,ee=Z.length,ie=0,ue=Ht(H,this.__takeCount__);if(!p||!v&&E==H&&ue==H)return bR(o,this.__actions__);var ye=[];e:for(;H--&&ie<ue;){Q+=c;for(var Pe=-1,me=o[Q];++Pe<ee;){var Le=Z[Pe],He=Le.iteratee,Zr=Le.type,_r=He(me);if(Zr==J)me=_r;else if(!_r){if(Zr==Y)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=_s(ol.prototype),$e.prototype.constructor=$e;function cn(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 Xy(){this.__data__=ko?ko(null):{},this.size=0}function ev(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function tv(o){var c=this.__data__;if(ko){var p=c[o];return p===l?t:p}return Ze.call(c,o)?c[o]:t}function rv(o){var c=this.__data__;return ko?c[o]!==t:Ze.call(c,o)}function nv(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=ko&&c===t?l:c,this}cn.prototype.clear=Xy,cn.prototype.delete=ev,cn.prototype.get=tv,cn.prototype.has=rv,cn.prototype.set=nv;function An(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 op(){this.__data__=[],this.size=0}function iv(o){var c=this.__data__,p=ll(c,o);if(p<0)return!1;var v=c.length-1;return p==v?c.pop():Xa.call(c,p,1),--this.size,!0}function sv(o){var c=this.__data__,p=ll(c,o);return p<0?t:c[p][1]}function ap(o){return ll(this.__data__,o)>-1}function ov(o,c){var p=this.__data__,v=ll(p,o);return v<0?(++this.size,p.push([o,c])):p[v][1]=c,this}An.prototype.clear=op,An.prototype.delete=iv,An.prototype.get=sv,An.prototype.has=ap,An.prototype.set=ov;function qn(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 av(){this.size=0,this.__data__={hash:new cn,map:new(Io||An),string:new cn}}function pi(o){var c=Ip(this,o).delete(o);return this.size-=c?1:0,c}function lp(o){return Ip(this,o).get(o)}function lv(o){return Ip(this,o).has(o)}function cv(o,c){var p=Ip(this,o),v=p.size;return p.set(o,c),this.size+=p.size==v?0:1,this}qn.prototype.clear=av,qn.prototype.delete=pi,qn.prototype.get=lp,qn.prototype.has=lv,qn.prototype.set=cv;function $i(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new qn;++c<p;)this.add(o[c])}function te(o){return this.__data__.set(o,l),this}function uv(o){return this.__data__.has(o)}$i.prototype.add=$i.prototype.push=te,$i.prototype.has=uv;function Jr(o){var c=this.__data__=new An(o);this.size=c.size}function cp(){this.__data__=new An,this.size=0}function Ve(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function al(o){return this.__data__.get(o)}function up(o){return this.__data__.has(o)}function tu(o,c){var p=this.__data__;if(p instanceof An){var v=p.__data__;if(!Io||v.length<r-1)return v.push([o,c]),this.size=++p.size,this;p=this.__data__=new qn(v)}return p.set(o,c),this.size=p.size,this}Jr.prototype.clear=cp,Jr.prototype.delete=Ve,Jr.prototype.get=al,Jr.prototype.has=up,Jr.prototype.set=tu;function fp(o,c){var p=Re(o),v=!p&&Do(o),E=!p&&!v&&Ps(o),I=!p&&!v&&!E&&hl(o),A=p||v||E||I,D=A?Gc(o.length,My):[],H=D.length;for(var Q in o)(c||Ze.call(o,Q))&&!(A&&(Q=="length"||E&&(Q=="offset"||Q=="parent")||I&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Fi(Q,H)))&&D.push(Q);return D}function dp(o){var c=o.length;return c?o[xv(0,c-1)]:t}function fv(o,c){return Pp(Tr(o),hi(c,0,o.length))}function dv(o){return Pp(Tr(o))}function ru(o,c,p){(p!==t&&!Fn(o[c],p)||p===t&&!(c in o))&&Yr(o,c,p)}function Sr(o,c,p){var v=o[c];(!(Ze.call(o,c)&&Fn(v,p))||p===t&&!(c in o))&&Yr(o,c,p)}function ll(o,c){for(var p=o.length;p--;)if(Fn(o[p][0],c))return p;return-1}function pp(o,c,p,v){return mi(o,function(E,I,A){c(v,E,p(E),A)}),v}function hp(o,c){return o&&gi(c,Kt(c),o)}function pv(o,c){return o&&gi(c,qr(c),o)}function Yr(o,c,p){c=="__proto__"&&el?el(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function nu(o,c){for(var p=-1,v=c.length,E=W(v),I=o==null;++p<v;)E[p]=I?t:Gv(o,c[p]);return E}function hi(o,c,p){return o===o&&(p!==t&&(o=o<=p?o:p),c!==t&&(o=o>=c?o:c)),o}function ir(o,c,p,v,E,I){var A,D=c&m,H=c&g,Q=c&y;if(p&&(A=E?p(o,v,E,I):p(o)),A!==t)return A;if(!Et(o))return o;var Z=Re(o);if(Z){if(A=b$(o),!D)return Tr(o,A)}else{var ee=sr(o),ie=ee==nn||ee==oo;if(Ps(o))return _R(o,D);if(ee==Cn||ee==pr||ie&&!E){if(A=H||ie?{}:UR(o),!D)return H?l$(o,pv(A,o)):a$(o,hp(A,o))}else{if(!at[ee])return E?o:{};A=S$(o,ee,D)}}I||(I=new Jr);var ue=I.get(o);if(ue)return ue;I.set(o,A),gE(o)?o.forEach(function(me){A.add(ir(me,c,p,me,o,I))}):hE(o)&&o.forEach(function(me,Le){A.set(Le,ir(me,c,p,Le,o,I))});var ye=Q?H?$v:qv:H?qr:Kt,Pe=Z?t:ye(o);return gr(Pe||o,function(me,Le){Pe&&(Le=me,me=o[Le]),Sr(A,Le,ir(me,c,p,Le,o,I))}),A}function hv(o){var c=Kt(o);return function(p){return un(p,o,c)}}function un(o,c,p){var v=p.length;if(o==null)return!v;for(o=Ue(o);v--;){var E=p[v],I=c[E],A=o[E];if(A===t&&!(E in o)||!I(A))return!1}return!0}function iu(o,c,p){if(typeof o!="function")throw new br(i);return fu(function(){o.apply(t,p)},c)}function Ao(o,c,p,v){var E=-1,I=Ua,A=!0,D=o.length,H=[],Q=c.length;if(!D)return H;p&&(c=lt(c,yr(p))),v?(I=gs,A=!1):c.length>=r&&(I=et,A=!1,c=new $i(c));e:for(;++E<D;){var Z=o[E],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,A&&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 mi=OR(fn),mp=OR($n,!0);function mv(o,c){var p=!0;return mi(o,function(v,E,I){return p=!!c(v,E,I),p}),p}function cl(o,c,p){for(var v=-1,E=o.length;++v<E;){var I=o[v],A=c(I);if(A!=null&&(D===t?A===A&&!Qr(A):p(A,D)))var D=A,H=I}return H}function gv(o,c,p,v){var E=o.length;for(p=Ce(p),p<0&&(p=-p>E?0:E+p),v=v===t||v>E?E:Ce(v),v<0&&(v+=E),v=p>v?0:vE(v);p<v;)o[p++]=c;return o}function gp(o,c){var p=[];return mi(o,function(v,E,I){c(v,E,I)&&p.push(v)}),p}function Bt(o,c,p,v,E){var I=-1,A=o.length;for(p||(p=_$),E||(E=[]);++I<A;){var D=o[I];c>0&&p(D)?c>1?Bt(D,c-1,p,v,E):ci(E,D):v||(E[E.length]=D)}return E}var su=IR(),yp=IR(!0);function fn(o,c){return o&&su(o,c,Kt)}function $n(o,c){return o&&yp(o,c,Kt)}function ul(o,c){return li(c,function(p){return Li(o[p])})}function Mi(o,c){c=Os(c,o);for(var p=0,v=c.length;o!=null&&p<v;)o=o[Dn(c[p++])];return p&&p==v?o:t}function vp(o,c,p){var v=c(o);return Re(o)?v:ci(v,p(o))}function Qt(o){return o==null?o===t?Rd:Hg:Ai&&Ai in Ue(o)?g$(o):P$(o)}function ou(o,c){return o>c}function yv(o,c){return o!=null&&Ze.call(o,c)}function vv(o,c){return o!=null&&c in Ue(o)}function bv(o,c,p){return o>=Ht(c,p)&&o<gt(c,p)}function Gr(o,c,p){for(var v=p?gs:Ua,E=o[0].length,I=o.length,A=I,D=W(I),H=1/0,Q=[];A--;){var Z=o[A];A&&c&&(Z=lt(Z,yr(c))),H=Ht(Z.length,H),D[A]=!p&&(c||E>=120&&Z.length>=120)?new $i(A&&Z):t}Z=o[0];var ee=-1,ie=D[0];e:for(;++ee<E&&Q.length<H;){var ue=Z[ee],ye=c?c(ue):ue;if(ue=p||ue!==0?ue:0,!(ie?et(ie,ye):v(Q,ye,p))){for(A=I;--A;){var Pe=D[A];if(!(Pe?et(Pe,ye):v(o[A],ye,p)))continue e}ie&&ie.push(ye),Q.push(ue)}}return Q}function xs(o,c,p,v){return fn(o,function(E,I,A){c(v,p(E),I,A)}),v}function qo(o,c,p){c=Os(c,o),o=WR(o,c);var v=o==null?o:o[Dn(pn(c))];return v==null?t:mr(v,o,p)}function bp(o){return Ot(o)&&Qt(o)==pr}function Sv(o){return Ot(o)&&Qt(o)==Ci}function wv(o){return Ot(o)&&Qt(o)==Or}function $o(o,c,p,v,E){return o===c?!0:o==null||c==null||!Ot(o)&&!Ot(c)?o!==o&&c!==c:au(o,c,p,v,$o,E)}function au(o,c,p,v,E,I){var A=Re(o),D=Re(c),H=A?oi:sr(o),Q=D?oi:sr(c);H=H==pr?Cn:H,Q=Q==pr?Cn:Q;var Z=H==Cn,ee=Q==Cn,ie=H==Q;if(ie&&Ps(o)){if(!Ps(c))return!1;A=!0,Z=!1}if(ie&&!Z)return I||(I=new Jr),A||hl(o)?FR(o,c,p,v,E,I):h$(o,c,H,p,v,E,I);if(!(p&w)){var ue=Z&&Ze.call(o,"__wrapped__"),ye=ee&&Ze.call(c,"__wrapped__");if(ue||ye){var Pe=ue?o.value():o,me=ye?c.value():c;return I||(I=new Jr),E(Pe,me,p,v,I)}}return ie?(I||(I=new Jr),m$(o,c,p,v,E,I)):!1}function Rs(o){return Ot(o)&&sr(o)==Jt}function Es(o,c,p,v){var E=p.length,I=E,A=!v;if(o==null)return!I;for(o=Ue(o);E--;){var D=p[E];if(A&&D[2]?D[1]!==o[D[0]]:!(D[0]in o))return!1}for(;++E<I;){D=p[E];var H=D[0],Q=o[H],Z=D[1];if(A&&D[2]){if(Q===t&&!(H in o))return!1}else{var ee=new Jr;if(v)var ie=v(Q,Z,H,o,c,ee);if(!(ie===t?$o(Z,Q,w|R,v,ee):ie))return!1}}return!0}function Fe(o){if(!Et(o)||R$(o))return!1;var c=Li(o)?jy:Od;return c.test(No(o))}function u(o){return Ot(o)&&Qt(o)==Yt}function h(o){return Ot(o)&&sr(o)==hr}function b(o){return Ot(o)&&Mp(o.length)&&!!ut[Qt(o)]}function S(o){return typeof o=="function"?o:o==null?$r:typeof o=="object"?Re(o)?Me(o[0],o[1]):ve(o):kE(o)}function C(o){if(!uu(o))return rp(o);var c=[];for(var p in Ue(o))Ze.call(o,p)&&p!="constructor"&&c.push(p);return c}function M(o){if(!Et(o))return I$(o);var c=uu(o),p=[];for(var v in o)v=="constructor"&&(c||!Ze.call(o,v))||p.push(v);return p}function z(o,c){return o<c}function se(o,c){var p=-1,v=Ar(o)?W(o.length):[];return mi(o,function(E,I,A){v[++p]=c(E,I,A)}),v}function ve(o){var c=Nv(o);return c.length==1&&c[0][2]?BR(c[0][0],c[0][1]):function(p){return p===o||Es(p,o,c)}}function Me(o,c){return Fv(o)&&HR(c)?BR(Dn(o),c):function(p){var v=Gv(p,o);return v===t&&v===c?Kv(p,o):$o(c,v,w|R)}}function Dt(o,c,p,v,E){o!==c&&su(c,function(I,A){if(E||(E=new Jr),Et(I))Mn(o,c,A,p,Dt,v,E);else{var D=v?v(jv(o,A),I,A+"",o,c,E):t;D===t&&(D=I),ru(o,A,D)}},qr)}function Mn(o,c,p,v,E,I,A){var D=jv(o,p),H=jv(c,p),Q=A.get(H);if(Q){ru(o,p,Q);return}var Z=I?I(D,H,p+"",o,c,A):t,ee=Z===t;if(ee){var ie=Re(H),ue=!ie&&Ps(H),ye=!ie&&!ue&&hl(H);Z=H,ie||ue||ye?Re(D)?Z=D:qt(D)?Z=Tr(D):ue?(ee=!1,Z=_R(H,!0)):ye?(ee=!1,Z=xR(H,!0)):Z=[]:du(H)||Do(H)?(Z=D,Do(D)?Z=bE(D):(!Et(D)||Li(D))&&(Z=UR(H))):ee=!1}ee&&(A.set(H,Z),E(Z,H,v,I,A),A.delete(H)),ru(o,p,Z)}function Nn(o,c){var p=o.length;if(p)return c+=c<0?p:0,Fi(c,p)?o[c]:t}function dR(o,c,p){c.length?c=lt(c,function(I){return Re(I)?function(A){return Mi(A,I.length===1?I[0]:I)}:I}):c=[$r];var v=-1;c=lt(c,yr(ge()));var E=se(o,function(I,A,D){var H=lt(c,function(Q){return Q(I)});return{criteria:H,index:++v,value:I}});return _y(E,function(I,A){return o$(I,A,p)})}function Yq(o,c){return pR(o,c,function(p,v){return Kv(o,v)})}function pR(o,c,p){for(var v=-1,E=c.length,I={};++v<E;){var A=c[v],D=Mi(o,A);p(D,A)&&lu(I,Os(A,o),D)}return I}function Gq(o){return function(c){return Mi(c,o)}}function _v(o,c,p,v){var E=v?wy:ki,I=-1,A=c.length,D=o;for(o===c&&(c=Tr(c)),p&&(D=lt(o,yr(p)));++I<A;)for(var H=0,Q=c[I],Z=p?p(Q):Q;(H=E(D,Z,H,v))>-1;)D!==o&&Xa.call(D,H,1),Xa.call(o,H,1);return o}function hR(o,c){for(var p=o?c.length:0,v=p-1;p--;){var E=c[p];if(p==v||E!==I){var I=E;Fi(E)?Xa.call(o,E,1):Cv(o,E)}}return o}function xv(o,c){return o+Oo(ip()*(c-o+1))}function Kq(o,c,p,v){for(var E=-1,I=gt(Co((c-o)/(p||1)),0),A=W(I);I--;)A[v?I:++E]=o,o+=p;return A}function Rv(o,c){var p="";if(!o||c<1||c>Xe)return p;do c%2&&(p+=o),c=Oo(c/2),c&&(o+=o);while(c);return p}function Te(o,c){return Uv(VR(o,c,$r),o+"")}function Qq(o){return dp(ml(o))}function Zq(o,c){var p=ml(o);return Pp(p,hi(c,0,p.length))}function lu(o,c,p,v){if(!Et(o))return o;c=Os(c,o);for(var E=-1,I=c.length,A=I-1,D=o;D!=null&&++E<I;){var H=Dn(c[E]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(E!=A){var Z=D[H];Q=v?v(Z,H,D):t,Q===t&&(Q=Et(Z)?Z:Fi(c[E+1])?[]:{})}Sr(D,H,Q),D=D[H]}return o}var mR=il?function(o,c){return il.set(o,c),o}:$r,Xq=el?function(o,c){return el(o,"toString",{configurable:!0,enumerable:!1,value:Zv(c),writable:!0})}:$r;function e$(o){return Pp(ml(o))}function dn(o,c,p){var v=-1,E=o.length;c<0&&(c=-c>E?0:E+c),p=p>E?E:p,p<0&&(p+=E),E=c>p?0:p-c>>>0,c>>>=0;for(var I=W(E);++v<E;)I[v]=o[v+c];return I}function t$(o,c){var p;return mi(o,function(v,E,I){return p=c(v,E,I),!p}),!!p}function Sp(o,c,p){var v=0,E=o==null?v:o.length;if(typeof c=="number"&&c===c&&E<=Ct){for(;v<E;){var I=v+E>>>1,A=o[I];A!==null&&!Qr(A)&&(p?A<=c:A<c)?v=I+1:E=I}return E}return Ev(o,c,$r,p)}function Ev(o,c,p,v){var E=0,I=o==null?0:o.length;if(I===0)return 0;c=p(c);for(var A=c!==c,D=c===null,H=Qr(c),Q=c===t;E<I;){var Z=Oo((E+I)/2),ee=p(o[Z]),ie=ee!==t,ue=ee===null,ye=ee===ee,Pe=Qr(ee);if(A)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!ue):H?me=ye&&ie&&!ue&&(v||!Pe):ue||Pe?me=!1:me=v?ee<=c:ee<c;me?E=Z+1:I=Z}return Ht(I,vt)}function gR(o,c){for(var p=-1,v=o.length,E=0,I=[];++p<v;){var A=o[p],D=c?c(A):A;if(!p||!Fn(D,H)){var H=D;I[E++]=A===0?0:A}}return I}function yR(o){return typeof o=="number"?o:Qr(o)?he:+o}function Kr(o){if(typeof o=="string")return o;if(Re(o))return lt(o,Kr)+"";if(Qr(o))return sp?sp.call(o):"";var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function Cs(o,c,p){var v=-1,E=Ua,I=o.length,A=!0,D=[],H=D;if(p)A=!1,E=gs;else if(I>=r){var Q=c?null:d$(o);if(Q)return za(Q);A=!1,E=et,H=new $i}else H=c?[]:D;e:for(;++v<I;){var Z=o[v],ee=c?c(Z):Z;if(Z=p||Z!==0?Z:0,A&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;c&&H.push(ee),D.push(Z)}else E(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function Cv(o,c){c=Os(c,o);var p=-1,v=c.length;if(!v)return!0;for(;++p<v;){var E=Dn(c[p]);if(E==="__proto__"&&!Ze.call(o,"__proto__")||(E==="constructor"||E==="prototype")&&p<v-1)return!1}var I=WR(o,c);return I==null||delete I[Dn(pn(c))]}function vR(o,c,p,v){return lu(o,c,p(Mi(o,c)),v)}function wp(o,c,p,v){for(var E=o.length,I=v?E:-1;(v?I--:++I<E)&&c(o[I],I,o););return p?dn(o,v?0:I,v?I+1:E):dn(o,v?I+1:0,v?E:I)}function bR(o,c){var p=o;return p instanceof $e&&(p=p.value()),zc(c,function(v,E){return E.func.apply(E.thisArg,ci([v],E.args))},p)}function Ov(o,c,p){var v=o.length;if(v<2)return v?Cs(o[0]):[];for(var E=-1,I=W(v);++E<v;)for(var A=o[E],D=-1;++D<v;)D!=E&&(I[E]=Ao(I[E]||A,o[D],c,p));return Cs(Bt(I,1),c,p)}function SR(o,c,p){for(var v=-1,E=o.length,I=c.length,A={};++v<E;){var D=v<I?c[v]:t;p(A,o[v],D)}return A}function Iv(o){return qt(o)?o:[]}function Pv(o){return typeof o=="function"?o:$r}function Os(o,c){return Re(o)?o:Fv(o,c)?[o]:GR(rt(o))}var r$=Te;function Is(o,c,p){var v=o.length;return p=p===t?v:p,!c&&p>=v?o:dn(o,c,p)}var wR=Uy||function(o){return Nt.clearTimeout(o)};function _R(o,c){if(c)return o.slice();var p=o.length,v=Xd?Xd(p):new o.constructor(p);return o.copy(v),v}function kv(o){var c=new o.constructor(o.byteLength);return new Qa(c).set(new Qa(o)),c}function n$(o,c){var p=c?kv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function i$(o){var c=new o.constructor(o.source,Cd.exec(o));return c.lastIndex=o.lastIndex,c}function s$(o){return To?Ue(To.call(o)):{}}function xR(o,c){var p=c?kv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function RR(o,c){if(o!==c){var p=o!==t,v=o===null,E=o===o,I=Qr(o),A=c!==t,D=c===null,H=c===c,Q=Qr(c);if(!D&&!Q&&!I&&o>c||I&&A&&H&&!D&&!Q||v&&A&&H||!p&&H||!E)return 1;if(!v&&!I&&!Q&&o<c||Q&&p&&E&&!v&&!I||D&&p&&E||!A&&E||!H)return-1}return 0}function o$(o,c,p){for(var v=-1,E=o.criteria,I=c.criteria,A=E.length,D=p.length;++v<A;){var H=RR(E[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 ER(o,c,p,v){for(var E=-1,I=o.length,A=p.length,D=-1,H=c.length,Q=gt(I-A,0),Z=W(H+Q),ee=!v;++D<H;)Z[D]=c[D];for(;++E<A;)(ee||E<I)&&(Z[p[E]]=o[E]);for(;Q--;)Z[D++]=o[E++];return Z}function CR(o,c,p,v){for(var E=-1,I=o.length,A=-1,D=p.length,H=-1,Q=c.length,Z=gt(I-D,0),ee=W(Z+Q),ie=!v;++E<Z;)ee[E]=o[E];for(var ue=E;++H<Q;)ee[ue+H]=c[H];for(;++A<D;)(ie||E<I)&&(ee[ue+p[A]]=o[E++]);return ee}function Tr(o,c){var p=-1,v=o.length;for(c||(c=W(v));++p<v;)c[p]=o[p];return c}function gi(o,c,p,v){var E=!p;p||(p={});for(var I=-1,A=c.length;++I<A;){var D=c[I],H=v?v(p[D],o[D],D,p,o):t;H===t&&(H=o[D]),E?Yr(p,D,H):Sr(p,D,H)}return p}function a$(o,c){return gi(o,Dv(o),c)}function l$(o,c){return gi(o,LR(o),c)}function _p(o,c){return function(p,v){var E=Re(p)?Tn:pp,I=c?c():{};return E(p,o,ge(v,2),I)}}function fl(o){return Te(function(c,p){var v=-1,E=p.length,I=E>1?p[E-1]:t,A=E>2?p[2]:t;for(I=o.length>3&&typeof I=="function"?(E--,I):t,A&&wr(p[0],p[1],A)&&(I=E<3?t:I,E=1),c=Ue(c);++v<E;){var D=p[v];D&&o(c,D,v,I)}return c})}function OR(o,c){return function(p,v){if(p==null)return p;if(!Ar(p))return o(p,v);for(var E=p.length,I=c?E:-1,A=Ue(p);(c?I--:++I<E)&&v(A[I],I,A)!==!1;);return p}}function IR(o){return function(c,p,v){for(var E=-1,I=Ue(c),A=v(c),D=A.length;D--;){var H=A[o?D:++E];if(p(I[H],H,I)===!1)break}return c}}function c$(o,c,p){var v=c&x,E=cu(o);function I(){var A=this&&this!==Nt&&this instanceof I?E:o;return A.apply(v?p:this,arguments)}return I}function PR(o){return function(c){c=rt(c);var p=ys(c)?vr(c):t,v=p?p[0]:c.charAt(0),E=p?Is(p,1).join(""):c.slice(1);return v[o]()+E}}function dl(o){return function(c){return zc(IE(OE(c).replace(ay,"")),o,"")}}function cu(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=_s(o.prototype),v=o.apply(p,c);return Et(v)?v:p}}function u$(o,c,p){var v=cu(o);function E(){for(var I=arguments.length,A=W(I),D=I,H=pl(E);D--;)A[D]=arguments[D];var Q=I<3&&A[0]!==H&&A[I-1]!==H?[]:ln(A,H);if(I-=Q.length,I<p)return $R(o,c,xp,E.placeholder,t,A,Q,t,t,p-I);var Z=this&&this!==Nt&&this instanceof E?v:o;return mr(Z,this,A)}return E}function kR(o){return function(c,p,v){var E=Ue(c);if(!Ar(c)){var I=ge(p,3);c=Kt(c),p=function(D){return I(E[D],D,E)}}var A=o(c,p,v);return A>-1?E[I?c[A]:A]:t}}function TR(o){return Di(function(c){var p=c.length,v=p,E=nr.prototype.thru;for(o&&c.reverse();v--;){var I=c[v];if(typeof I!="function")throw new br(i);if(E&&!A&&Op(I)=="wrapper")var A=new nr([],!0)}for(v=A?v:p;++v<p;){I=c[v];var D=Op(I),H=D=="wrapper"?Mv(I):t;H&&Lv(H[0])&&H[1]==(X|L|B|k)&&!H[4].length&&H[9]==1?A=A[Op(H[0])].apply(A,H[3]):A=I.length==1&&Lv(I)?A[D]():A.thru(I)}return function(){var Q=arguments,Z=Q[0];if(A&&Q.length==1&&Re(Z))return A.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 xp(o,c,p,v,E,I,A,D,H,Q){var Z=c&X,ee=c&x,ie=c&T,ue=c&(L|V),ye=c&_,Pe=ie?t:cu(o);function me(){for(var Le=arguments.length,He=W(Le),Zr=Le;Zr--;)He[Zr]=arguments[Zr];if(ue)var _r=pl(me),Xr=Gd(He,_r);if(v&&(He=ER(He,v,E,ue)),I&&(He=CR(He,I,A,ue)),Le-=Xr,ue&&Le<Q){var $t=ln(He,_r);return $R(o,c,xp,me.placeholder,p,He,$t,D,H,Q-Le)}var Ln=ee?p:this,Ui=ie?Ln[o]:o;return Le=He.length,D?He=k$(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Nt&&this instanceof me&&(Ui=Pe||cu(Ui)),Ui.apply(Ln,He)}return me}function AR(o,c){return function(p,v){return xs(p,o,c(v),{})}}function Rp(o,c){return function(p,v){var E;if(p===t&&v===t)return c;if(p!==t&&(E=p),v!==t){if(E===t)return v;typeof p=="string"||typeof v=="string"?(p=Kr(p),v=Kr(v)):(p=yR(p),v=yR(v)),E=o(p,v)}return E}}function Tv(o){return Di(function(c){return c=lt(c,yr(ge())),Te(function(p){var v=this;return o(c,function(E){return mr(E,v,p)})})})}function Ep(o,c){c=c===t?" ":Kr(c);var p=c.length;if(p<2)return p?Rv(c,o):c;var v=Rv(c,Co(o/ui(c)));return ys(c)?Is(vr(v),0,o).join(""):v.slice(0,o)}function f$(o,c,p,v){var E=c&x,I=cu(o);function A(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=W(Z+H),ie=this&&this!==Nt&&this instanceof A?I:o;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return mr(ie,E?p:this,ee)}return A}function qR(o){return function(c,p,v){return v&&typeof v!="number"&&wr(c,p,v)&&(p=v=t),c=ji(c),p===t?(p=c,c=0):p=ji(p),v=v===t?c<p?1:-1:ji(v),Kq(c,p,v,o)}}function Cp(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=hn(c),p=hn(p)),o(c,p)}}function $R(o,c,p,v,E,I,A,D,H,Q){var Z=c&L,ee=Z?A:t,ie=Z?t:A,ue=Z?I:t,ye=Z?t:I;c|=Z?B:K,c&=~(Z?K:B),c&q||(c&=~(x|T));var Pe=[o,c,E,ue,ee,ye,ie,D,H,Q],me=p.apply(t,Pe);return Lv(o)&&zR(me,Pe),me.placeholder=v,JR(me,o,c)}function Av(o){var c=tt[o];return function(p,v){if(p=hn(p),v=v==null?0:Ht(Ce(v),292),v&&qi(p)){var E=(rt(p)+"e").split("e"),I=c(E[0]+"e"+(+E[1]+v));return E=(rt(I)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return c(p)}}var d$=Ss&&1/za(new Ss([,-0]))[1]==pe?function(o){return new Ss(o)}:tb;function MR(o){return function(c){var p=sr(c);return p==Jt?vs(c):p==hr?Kd(c):xy(c,o(c))}}function Ni(o,c,p,v,E,I,A,D){var H=c&T;if(!H&&typeof o!="function")throw new br(i);var Q=v?v.length:0;if(Q||(c&=~(B|K),v=E=t),A=A===t?A:gt(Ce(A),0),D=D===t?D:Ce(D),Q-=E?E.length:0,c&K){var Z=v,ee=E;v=E=t}var ie=H?t:Mv(o),ue=[o,c,p,v,E,Z,ee,I,A,D];if(ie&&O$(ue,ie),o=ue[0],c=ue[1],p=ue[2],v=ue[3],E=ue[4],D=ue[9]=ue[9]===t?H?0:o.length:gt(ue[9]-Q,0),!D&&c&(L|V)&&(c&=~(L|V)),!c||c==x)var ye=c$(o,c,p);else c==L||c==V?ye=u$(o,c,D):(c==B||c==(x|B))&&!E.length?ye=f$(o,c,p,v):ye=xp.apply(t,ue);var Pe=ie?mR:zR;return JR(Pe(ye,ue),o,c)}function NR(o,c,p,v){return o===t||Fn(o,bs[p])&&!Ze.call(v,p)?c:o}function DR(o,c,p,v,E,I){return Et(o)&&Et(c)&&(I.set(c,o),Dt(o,c,t,DR,I),I.delete(c)),o}function p$(o){return du(o)?t:o}function FR(o,c,p,v,E,I){var A=p&w,D=o.length,H=c.length;if(D!=H&&!(A&&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&R?new $i:t;for(I.set(o,c),I.set(c,o);++ee<D;){var ye=o[ee],Pe=c[ee];if(v)var me=A?v(Pe,ye,ee,c,o,I):v(ye,Pe,ee,o,c,I);if(me!==t){if(me)continue;ie=!1;break}if(ue){if(!Ha(c,function(Le,He){if(!et(ue,He)&&(ye===Le||E(ye,Le,p,v,I)))return ue.push(He)})){ie=!1;break}}else if(!(ye===Pe||E(ye,Pe,p,v,I))){ie=!1;break}}return I.delete(o),I.delete(c),ie}function h$(o,c,p,v,E,I,A){switch(p){case On:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Ci:return!(o.byteLength!=c.byteLength||!I(new Qa(o),new Qa(c)));case zr:case Or:case ao:return Fn(+o,+c);case mt:return o.name==c.name&&o.message==c.message;case Yt:case lo:return o==c+"";case Jt:var D=vs;case hr:var H=v&w;if(D||(D=za),o.size!=c.size&&!H)return!1;var Q=A.get(o);if(Q)return Q==c;v|=R,A.set(o,c);var Z=FR(D(o),D(c),v,E,I,A);return A.delete(o),Z;case Oa:if(To)return To.call(o)==To.call(c)}return!1}function m$(o,c,p,v,E,I){var A=p&w,D=qv(o),H=D.length,Q=qv(c),Z=Q.length;if(H!=Z&&!A)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(A?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 Pe=!0;I.set(o,c),I.set(c,o);for(var me=A;++ee<H;){ie=D[ee];var Le=o[ie],He=c[ie];if(v)var Zr=A?v(He,Le,ie,c,o,I):v(Le,He,ie,o,c,I);if(!(Zr===t?Le===He||E(Le,He,p,v,I):Zr)){Pe=!1;break}me||(me=ie=="constructor")}if(Pe&&!me){var _r=o.constructor,Xr=c.constructor;_r!=Xr&&"constructor"in o&&"constructor"in c&&!(typeof _r=="function"&&_r instanceof _r&&typeof Xr=="function"&&Xr instanceof Xr)&&(Pe=!1)}return I.delete(o),I.delete(c),Pe}function Di(o){return Uv(VR(o,t,XR),o+"")}function qv(o){return vp(o,Kt,Dv)}function $v(o){return vp(o,qr,LR)}var Mv=il?function(o){return il.get(o)}:tb;function Op(o){for(var c=o.name+"",p=ws[c],v=Ze.call(ws,c)?p.length:0;v--;){var E=p[v],I=E.func;if(I==null||I==o)return E.name}return c}function pl(o){var c=Ze.call(O,"placeholder")?O:o;return c.placeholder}function ge(){var o=O.iteratee||Xv;return o=o===Xv?S:o,arguments.length?o(arguments[0],arguments[1]):o}function Ip(o,c){var p=o.__data__;return x$(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Nv(o){for(var c=Kt(o),p=c.length;p--;){var v=c[p],E=o[v];c[p]=[v,E,HR(E)]}return c}function Mo(o,c){var p=So(o,c);return Fe(p)?p:t}function g$(o){var c=Ze.call(o,Ai),p=o[Ai];try{o[Ai]=t;var v=!0}catch{}var E=Ga.call(o);return v&&(c?o[Ai]=p:delete o[Ai]),E}var Dv=tl?function(o){return o==null?[]:(o=Ue(o),li(tl(o),function(c){return Ro.call(o,c)}))}:rb,LR=tl?function(o){for(var c=[];o;)ci(c,Dv(o)),o=Za(o);return c}:rb,sr=Qt;(Zc&&sr(new Zc(new ArrayBuffer(1)))!=On||Io&&sr(new Io)!=Jt||Xc&&sr(Xc.resolve())!=_d||Ss&&sr(new Ss)!=hr||Po&&sr(new Po)!=Ut)&&(sr=function(o){var c=Qt(o),p=c==Cn?o.constructor:t,v=p?No(p):"";if(v)switch(v){case zy:return On;case Jy:return Jt;case Yy:return _d;case Gy:return hr;case Ky:return Ut}return c});function y$(o,c,p){for(var v=-1,E=p.length;++v<E;){var I=p[v],A=I.size;switch(I.type){case"drop":o+=A;break;case"dropRight":c-=A;break;case"take":c=Ht(c,o+A);break;case"takeRight":o=gt(o,c-A);break}}return{start:o,end:c}}function v$(o){var c=o.match(In);return c?c[1].split(on):[]}function jR(o,c,p){c=Os(c,o);for(var v=-1,E=c.length,I=!1;++v<E;){var A=Dn(c[v]);if(!(I=o!=null&&p(o,A)))break;o=o[A]}return I||++v!=E?I:(E=o==null?0:o.length,!!E&&Mp(E)&&Fi(A,E)&&(Re(o)||Do(o)))}function b$(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 UR(o){return typeof o.constructor=="function"&&!uu(o)?_s(Za(o)):{}}function S$(o,c,p){var v=o.constructor;switch(c){case Ci:return kv(o);case zr:case Or:return new v(+o);case On:return n$(o,p);case st:case Ia:case Pa:case cs:case co:case us:case ai:case fs:case Tc:return xR(o,p);case Jt:return new v;case ao:case lo:return new v(o);case Yt:return i$(o);case hr:return new v;case Oa:return s$(o)}}function w$(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(Gt,`{
|
|
1
|
+
var WF=Object.create;var jp=Object.defineProperty;var zF=Object.getOwnPropertyDescriptor;var JF=Object.getOwnPropertyNames;var YF=Object.getPrototypeOf,GF=Object.prototype.hasOwnProperty;var nt=(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 le=(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}},ks=(t,e)=>{for(var r in e)jp(t,r,{get:e[r],enumerable:!0})},AE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of JF(e))!GF.call(t,i)&&i!==r&&jp(t,i,{get:()=>e[i],enumerable:!(n=zF(e,i))||n.enumerable});return t};var ob=(t,e,r)=>(r=t!=null?WF(YF(t)):{},AE(e||!t||!t.__esModule?jp(r,"default",{value:t,enumerable:!0}):r,t)),gl=t=>AE(jp({},"__esModule",{value:!0}),t);function It(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function ft(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${It(t)}_${e}`:e}function ab(){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 mu(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 KF(t){return JSON.parse(JSON.stringify(t))}function QF(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function ZF(t,e){try{return JSON.parse(t)}catch{return e}}function XF(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 eL(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var mn=le(()=>{"use strict"});import*as ot from"fs";import*as jn from"path";function Hp(t){if(!ot.existsSync(t))return;let e={},r=jn.join(t,Up.preRequest);ot.existsSync(r)&&(e.preRequest=ot.readFileSync(r,"utf-8"));let n=jn.join(t,Up.postResponse);return ot.existsSync(n)&&(e.postResponse=ot.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function Bp(t,e){await ot.promises.mkdir(t,{recursive:!0});let r=jn.join(t,Up.preRequest);e.preRequest?await ot.promises.writeFile(r,e.preRequest,"utf-8"):ot.existsSync(r)&&await ot.promises.unlink(r);let n=jn.join(t,Up.postResponse);e.postResponse?await ot.promises.writeFile(n,e.postResponse,"utf-8"):ot.existsSync(n)&&await ot.promises.unlink(n)}function $E(t){for(let[e,r]of Object.entries(qE)){let n=jn.join(t,e);if(ot.existsSync(n))try{let i=ot.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 ME(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 NE(t,e){for(let r of Object.keys(qE))if(r!==e){let n=jn.join(t,r);if(ot.existsSync(n))try{await ot.promises.unlink(n)}catch{}}}function DE(t){if(ot.existsSync(t))try{let e=ot.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function FE(t,e,r){let n=jn.join(t,gu.responseSchema),i=jn.join(t,gu.bodySchema);e?await ot.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):ot.existsSync(n)&&await ot.promises.unlink(n),r?await ot.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):ot.existsSync(i)&&await ot.promises.unlink(i)}function lb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=lb(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 LE(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 ub(t,e){let r;try{r=ot.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===gn)continue;if(n.name===e)return jn.join(t,n.name);let i=ub(jn.join(t,n.name),e);if(i)return i}}function Hi(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 w=parseInt(y.substring(1));w>a&&(a=w)}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 Up,xr,qE,gu,gn,vl=le(()=>{"use strict";Up={preRequest:"pre-request.js",postResponse:"post-response.js"},xr={collection:"collection.json",folder:"folder.json",request:"request.json"},qE={"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"}},gu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},gn="scripts"});import*as Se from"fs";import*as Oe from"path";var Ts,Vp=le(()=>{"use strict";mn();vl();Ts=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(){Se.existsSync(this.collectionsDir)||Se.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Se.existsSync(this.collectionsDir))return[];let e=Se.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=Oe.join(this.collectionsDir,e),n=Oe.join(r,xr.collection);if(Se.existsSync(n))try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Oe.join(r,gn)),l=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:l}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=Se.readdirSync(e,{withFileTypes:!0});for(let l of a){if(!l.isDirectory()||l.name===gn)continue;let f=Oe.join(e,l.name);if(Se.existsSync(Oe.join(f,xr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(Se.existsSync(Oe.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=Oe.join(e,xr.folder);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Oe.join(e,gn)),l=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:l}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=Oe.join(e,xr.request);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Oe.join(e,gn)),l=s.body,f=this.loadBodyFromDir(e);f&&(l=f);let d=this.loadSchemaFile(Oe.join(e,gu.responseSchema)),m=this.loadSchemaFile(Oe.join(e,gu.bodySchema)),g=Oe.join(e,"doc.md"),y=Se.existsSync(g)?Se.readFileSync(g,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:l,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...y&&{doc:y},...d&&{responseSchema:d},...m&&{bodySchema:m}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return Hp(e)}loadBodyFromDir(e){return $E(e)}loadSchemaFile(e){return DE(e)}async saveSchemaFiles(e,r){return FE(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=ft(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=Se.readdirSync(this.collectionsDir);r=Hi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Oe.join(this.collectionsDir,r);await Se.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await Se.promises.writeFile(Oe.join(n,xr.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(Oe.join(n,gn),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await Se.promises.writeFile(Oe.join(n,xr.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=Hi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=Oe.join(e,s);await Se.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await Se.promises.writeFile(Oe.join(e,xr.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(Oe.join(e,gn),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await Se.promises.writeFile(Oe.join(e,xr.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={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:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await Se.promises.writeFile(Oe.join(e,xr.request),JSON.stringify(s,null,2),"utf-8"),i&&await Se.promises.writeFile(Oe.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await Se.promises.writeFile(Oe.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(Oe.join(e,gn),r.scripts)}prepareBodyForSave(e){return ME(e)}async cleanupOldBodyFiles(e,r){return NE(e,r)}async saveScriptsToDir(e,r){return Bp(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=Oe.join(this.collectionsDir,r);if(!Se.existsSync(n))return!1;try{return await Se.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?Se.existsSync(Oe.join(this.collectionsDir,r,xr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Oe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||ft(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(Oe.join(s,gn),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(Oe.join(n,gn))}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=Oe.join(this.collectionsDir,i),a=Oe.join(s,xr.collection),l=Se.readFileSync(a,"utf-8"),d={...JSON.parse(l),...r,id:e};await Se.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=Oe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let m=Se.readdirSync(a).filter(g=>Se.statSync(Oe.join(a,g)).isDirectory()&&g!==gn);l=Hi(r.name,m),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Oe.join(a,l);await Se.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||!Se.existsSync(i))return!1;try{await Se.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||!Se.existsSync(a))return!1;let l;if(n){let m=this.findItemPath(e,n);if(!m)return!1;l=m}else l=Oe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let d=Oe.join(l,f);if(Se.existsSync(d))return!1;try{await Se.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=Oe.join(l,xr.folder),d=Se.readFileSync(f,"utf-8"),m=JSON.parse(d);m.order=a,await Se.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=Oe.join(this.collectionsDir,s,xr.collection),f=Se.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=a,await Se.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 LE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return ub(Oe.join(this.collectionsDir,n),i)}findItemById(e,r){return lb(e,r)}deleteItemFromTree(e,r){return cb(e,r)}}});var dt,bl=le(()=>{"use strict";dt=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(),w=g===-1?"":m.substring(g+1);switch(y){case"domain":d.domain=w.startsWith(".")?w.substring(1):w;break;case"path":d.path=w;break;case"expires":d.expires=w;break;case"max-age":d.maxAge=parseInt(w,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=w;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 As from"fs";import*as Fo from"path";function zp(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Su(t){if(!As.existsSync(t))return rL();let e=Wp(Fo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=As.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!zp(d)),s={};for(let d of i){let m=Wp(Fo.join(t,d))||{},g=Fo.basename(d,".json");s[g]={description:m.description,requiresConfirmation:m.requiresConfirmation,variables:m.variables||{},secretVariables:m.secretVariables}}let l=(Wp(Fo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let m=Fo.join(t,`${d}.local.json`);if(As.existsSync(m)){let g=Wp(m)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function rL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Wp(t){try{if(!As.existsSync(t))return null;let e=As.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 Jp=le(()=>{"use strict"});var Un,Sl=le(()=>{"use strict";Un=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,w)=>{let R=r[y];return R!==void 0&&R!==""?encodeURIComponent(R):w?"":(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 UE(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,HE=le(()=>{Zt=[];for(let t=0;t<256;++t)Zt.push((t+256).toString(16).slice(1))});function pb(){return crypto.getRandomValues(nL)}var nL,BE=le(()=>{nL=new Uint8Array(16)});function iL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():sL(t,e,r)}function sL(t,e,r){t=t||{};let n=t.random??t.rng?.()??pb();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 UE(n)}var wl,VE=le(()=>{BE();HE();wl=iL});var hb=le(()=>{VE()});function oL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function aL(){return Date.now()}function WE(){return wl()}function lL(){return wl()}function zE(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 cL(){let t=zE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function uL(){return Math.random()<.5}function fL(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 dL(){return Math.floor(Date.now()/1e3)}function pL(){return new Date().toISOString()}function hL(){return new Date().toISOString().split("T")[0]}function mL(){return new Date().toISOString().split("T")[1].split(".")[0]}function gL(){return new Date().toISOString()}function yL(t=""){return Buffer.from(String(t)).toString("base64")}function vL(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function bL(t=""){return encodeURIComponent(String(t))}function SL(t=""){return decodeURIComponent(String(t))}function wL(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 Vi(t,e){let r=JE[t];return r?e&&e.length>0?r(...e):r():null}function _L(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?wL(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function Lo(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=Vi(a);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var JE,Yp=le(()=>{"use strict";hb();JE={randomInt:oL,timestamp:aL,guid:lL,uuid:WE,randomUUID:WE,randomString:zE,randomHexadecimal:fL,randomEmail:cL,randomBoolean:uL,isoTimestamp:gL,timestamp_s:dL,datetime:pL,date:hL,time:mL,base64Encode:yL,base64Decode:vL,urlEncode:bL,urlDecode:SL}});import*as Gp 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 Uo(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=Gp.createContext(r);return Gp.runInContext(t,n,{timeout:xL,displayErrors:!1})}catch{return}}var xL,Kp=le(()=>{"use strict";xL=100});import*as Qp from"crypto";function RL(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function _u(t){if(!t||!t.includes("|"))return null;let e=EL(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=CL(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function EL(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 CL(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:OL(n)}}function OL(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=RL(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function xu(t,e,r={}){let n=t;for(let i of e)n=IL(n,i.name,i.args,r);return n}function IL(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(kL(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 Qp.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 Qp.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:PL(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=>wu(s,i[0])):t.map(s=>{let a={};for(let l of i){let f=wu(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=>wu(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?wu(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 PL(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=wu(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 wu(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function kL(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Zp=le(()=>{"use strict"});function YE(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 TL(t){return new Ho(t)}var Ho,Bo,Ru=le(()=>{"use strict";Yp();Kp();Zp();Ho=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(l,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,l));let n="",i=0,s=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let l=a[1].trim(),f=this.resolveTemplateContent(l,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let d=this.getStringContext(e,a.index);n+=d?this.escapeForString(String(f),d):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(d,m)=>this.resolveTemplateContent(m.trim(),i,d));let s="",a=0,l=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,f;for(;(f=l.exec(e))!==null;){let d=f[1].trim(),m=this.resolveTemplateContent(d,i,f[0]);if(m!==f[0]){s+=e.slice(a,f.index);let g=this.getStringContext(e,f.index);s+=g?this.escapeForString(String(m),g):String(m)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}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=YE(i[2],r),f=Vi(i[1],l);return f!==null?String(f):n}let s=_u(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=xu(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=Lo(e,l),d=Uo(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=YE(n[2],r),a=Vi(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=Lo(e,s),l=Uo(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}},Bo=class{interpolate(e,r){return!e||typeof e!="string"?e:new Ho({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},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 AL from"http";import*as Eu from"https";import{URL as GE}from"url";import*as Xp from"zlib";var Hn,Vo,Cu=le(()=>{"use strict";Hn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Vo=class{settings;version;constructor(e){this.settings={...Hn,...e};try{this.version=nt("../../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 GE(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=Eu.globalAgent:m.agent=new Eu.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",y(x);return}let R=(l?Eu:AL).request(m,async x=>{let T=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(T)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let L=x.headers.location;if(!L){y(new Error("Redirect response missing Location header"));return}let V=new GE(L,e.url).toString(),B=e.method;!r.followOriginalMethod&&[301,302,303].includes(T)&&(B="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let X=await this.executeInternal({...e,url:V,method:B,headers:K,body:B==="GET"?void 0:e.body},r,n+1,i),k=Date.now();X.time=k-s,g(X)}catch(X){y(X)}return}let q=[];x.on("data",L=>q.push(L)),x.on("end",()=>{let L=Date.now(),V=Buffer.concat(q),B=x.headers["content-encoding"];if(r.decompress&&B)try{B==="gzip"?V=Xp.gunzipSync(V):B==="deflate"&&(V=Xp.inflateSync(V))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=V.toString("utf-8"),X;try{X=JSON.parse(K)}catch{X=K}let k={};for(let[P,$]of Object.entries(x.headers))(typeof $=="string"||Array.isArray($))&&(k[P]=$);let _=this.parseCookies(x.headers["set-cookie"],a.hostname);g({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:_,body:X,time:L-s,size:V.length})})});if(i&&i.addEventListener("abort",()=>{R.destroy();let x=new Error("Request cancelled");x.name="AbortError",y(x)}),R.on("error",x=>{y(x)}),R.on("timeout",()=>{R.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);R.write(x)}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 mb(t){return{timeout:t?.timeout??Hn.timeout,followRedirects:t?.followRedirects??Hn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Hn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Hn.followAuthHeader,maxRedirects:t?.maxRedirects??Hn.maxRedirects,strictSSL:t?.strictSSL??Hn.strictSSL,decompress:t?.decompress??Hn.decompress,includeCookies:t?.includeCookies??Hn.includeCookies}}var gb=le(()=>{"use strict";Cu()});var Wi,Ou=le(()=>{"use strict";gb();Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=mb(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 zi,yb,vb,bb,Iu=le(()=>{"use strict";zi=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))}},yb=class{name="logging";priority=1e3;intercept(e,r){return e}},vb=class{name="timing";priority=1;intercept(e,r,n){return e}},bb=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 KE=F((_l,Pu)=>{(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,w=1,R=2,x=1,T=2,q=4,L=8,V=16,B=32,K=64,X=128,k=256,_=512,P=30,$="...",N=800,j=16,Y=1,J=2,ne=3,pe=1/0,Xe=9007199254740991,xe=17976931348623157e292,he=NaN,Ee=4294967295,vt=Ee-1,Ct=Ee>>>1,ce=[["ary",X],["bind",x],["bindKey",T],["curry",L],["curryRight",V],["flip",_],["partial",B],["partialRight",K],["rearg",k]],pr="[object Arguments]",oi="[object Array]",xt="[object AsyncFunction]",zr="[object Boolean]",Or="[object Date]",ht="[object DOMException]",mt="[object Error]",nn="[object Function]",oo="[object GeneratorFunction]",Jt="[object Map]",ao="[object Number]",Vg="[object Null]",Cn="[object Object]",Ed="[object Promise]",Cd="[object Proxy]",Yt="[object RegExp]",hr="[object Set]",lo="[object String]",Oa="[object Symbol]",Od="[object Undefined]",Ut="[object WeakMap]",Id="[object WeakSet]",Ci="[object ArrayBuffer]",On="[object DataView]",st="[object Float32Array]",Ia="[object Float64Array]",Pa="[object Int8Array]",cs="[object Int16Array]",co="[object Int32Array]",us="[object Uint8Array]",ai="[object Uint8ClampedArray]",fs="[object Uint16Array]",qc="[object Uint32Array]",ka=/\b__p \+= '';/g,Wg=/\b(__p \+=) '' \+/g,uo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oi=/&(?:amp|lt|gt|quot|#39);/g,Ta=/[&<>"']/g,Aa=RegExp(Oi.source),ae=RegExp(Ta.source),zg=/<%-([\s\S]+?)%>/g,Jg=/<%([\s\S]+?)%>/g,sn=/<%=([\s\S]+?)%>/g,Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,$c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,fo=RegExp(Ke.source),Mc=/^\s+/,qa=/\s/,Gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,In=/\{\n\/\* \[wrapped with (.+)\] \*/,on=/,? & /,At=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pr=/[()=,{}\[\]\/\s]/,Pn=/\\(\\)?/g,Ii=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pd=/\w*$/,Yg=/^[-+]0x[0-9a-f]+$/i,po=/^0b[01]+$/i,kd=/^\[object .+?Constructor\]$/,Gg=/^0o[0-7]+$/i,ds=/^(?:0|[1-9]\d*)$/,ho=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mo=/($^)/,Kg=/['\n\r\u2028\u2029\\]/g,$a="\\ud800-\\udfff",Qg="\\u0300-\\u036f",Rt="\\ufe20-\\ufe2f",Nc="\\u20d0-\\u20ff",Td=Qg+Rt+Nc,Dc="\\u2700-\\u27bf",Fc="a-z\\xdf-\\xf6\\xf8-\\xff",Zg="\\xac\\xb1\\xd7\\xf7",Xg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ey="\\u2000-\\u206f",ty=" \\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",Ad="A-Z\\xc0-\\xd6\\xd8-\\xde",qd="\\ufe0e\\ufe0f",Lc=Zg+Xg+ey+ty,Ma="['\u2019]",ry="["+$a+"]",$d="["+Lc+"]",Na="["+Td+"]",jc="\\d+",ny="["+Dc+"]",ps="["+Fc+"]",go="[^"+$a+Lc+jc+Dc+Fc+Ad+"]",Da="\\ud83c[\\udffb-\\udfff]",yo="(?:"+Na+"|"+Da+")",an="[^"+$a+"]",Uc="(?:\\ud83c[\\udde6-\\uddff]){2}",Hc="[\\ud800-\\udbff][\\udc00-\\udfff]",hs="["+Ad+"]",Md="\\u200d",Nd="(?:"+ps+"|"+go+")",iy="(?:"+hs+"|"+go+")",Dd="(?:"+Ma+"(?:d|ll|m|re|s|t|ve))?",Fd="(?:"+Ma+"(?:D|LL|M|RE|S|T|VE))?",Fa=yo+"?",Ld="["+qd+"]?",jd="(?:"+Md+"(?:"+[an,Uc,Hc].join("|")+")"+Ld+Fa+")*",sy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oy="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ud=Ld+Fa+jd,ay="(?:"+[ny,Uc,Hc].join("|")+")"+Ud,ly="(?:"+[an+Na+"?",Na,Uc,Hc,ry].join("|")+")",cy=RegExp(Ma,"g"),uy=RegExp(Na,"g"),Bc=RegExp(Da+"(?="+Da+")|"+ly+Ud,"g"),fy=RegExp([hs+"?"+ps+"+"+Dd+"(?="+[$d,hs,"$"].join("|")+")",iy+"+"+Fd+"(?="+[$d,hs+Nd,"$"].join("|")+")",hs+"?"+Nd+"+"+Dd,hs+"+"+Fd,oy,sy,jc,ay].join("|"),"g"),dy=RegExp("["+Md+$a+Td+qd+"]"),py=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hy=["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"],my=-1,ut={};ut[st]=ut[Ia]=ut[Pa]=ut[cs]=ut[co]=ut[us]=ut[ai]=ut[fs]=ut[qc]=!0,ut[pr]=ut[oi]=ut[Ci]=ut[zr]=ut[On]=ut[Or]=ut[mt]=ut[nn]=ut[Jt]=ut[ao]=ut[Cn]=ut[Yt]=ut[hr]=ut[lo]=ut[Ut]=!1;var at={};at[pr]=at[oi]=at[Ci]=at[On]=at[zr]=at[Or]=at[st]=at[Ia]=at[Pa]=at[cs]=at[co]=at[Jt]=at[ao]=at[Cn]=at[Yt]=at[hr]=at[lo]=at[Oa]=at[us]=at[ai]=at[fs]=at[qc]=!0,at[mt]=at[nn]=at[Ut]=!1;var Vc={\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"},Wc={"&":"&","<":"<",">":">",'"':""","'":"'"},gy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Hd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bd=parseFloat,yy=parseInt,Vd=typeof global=="object"&&global&&global.Object===Object&&global,vy=typeof self=="object"&&self&&self.Object===Object&&self,Nt=Vd||vy||Function("return this")(),La=typeof _l=="object"&&_l&&!_l.nodeType&&_l,Qe=La&&typeof Pu=="object"&&Pu&&!Pu.nodeType&&Pu,ms=Qe&&Qe.exports===La,Pi=ms&&Vd.process,kr=(function(){try{var U=Qe&&Qe.require&&Qe.require("util").types;return U||Pi&&Pi.binding&&Pi.binding("util")}catch{}})(),zc=kr&&kr.isArrayBuffer,Wd=kr&&kr.isDate,zd=kr&&kr.isMap,vo=kr&&kr.isRegExp,kn=kr&&kr.isSet,ja=kr&&kr.isTypedArray;function mr(U,G,W){switch(W.length){case 0:return U.call(G);case 1:return U.call(G,W[0]);case 2:return U.call(G,W[0],W[1]);case 3:return U.call(G,W[0],W[1],W[2])}return U.apply(G,W)}function Tn(U,G,W,oe){for(var be=-1,Ye=U==null?0:U.length;++be<Ye;){var tt=U[be];G(oe,tt,W(tt),U)}return oe}function gr(U,G){for(var W=-1,oe=U==null?0:U.length;++W<oe&&G(U[W],W,U)!==!1;);return U}function Jc(U,G){for(var W=U==null?0:U.length;W--&&G(U[W],W,U)!==!1;);return U}function Jd(U,G){for(var W=-1,oe=U==null?0:U.length;++W<oe;)if(!G(U[W],W,U))return!1;return!0}function li(U,G){for(var W=-1,oe=U==null?0:U.length,be=0,Ye=[];++W<oe;){var tt=U[W];G(tt,W,U)&&(Ye[be++]=tt)}return Ye}function Ua(U,G){var W=U==null?0:U.length;return!!W&&ki(U,G,0)>-1}function gs(U,G,W){for(var oe=-1,be=U==null?0:U.length;++oe<be;)if(W(G,U[oe]))return!0;return!1}function lt(U,G){for(var W=-1,oe=U==null?0:U.length,be=Array(oe);++W<oe;)be[W]=G(U[W],W,U);return be}function ci(U,G){for(var W=-1,oe=G.length,be=U.length;++W<oe;)U[be+W]=G[W];return U}function Yc(U,G,W,oe){var be=-1,Ye=U==null?0:U.length;for(oe&&Ye&&(W=U[++be]);++be<Ye;)W=G(W,U[be],be,U);return W}function by(U,G,W,oe){var be=U==null?0:U.length;for(oe&&be&&(W=U[--be]);be--;)W=G(W,U[be],be,U);return W}function Ha(U,G){for(var W=-1,oe=U==null?0:U.length;++W<oe;)if(G(U[W],W,U))return!0;return!1}var Sy=bo("length");function wy(U){return U.split("")}function _y(U){return U.match(At)||[]}function Yd(U,G,W){var oe;return W(U,function(be,Ye,tt){if(G(be,Ye,tt))return oe=Ye,!1}),oe}function Ba(U,G,W,oe){for(var be=U.length,Ye=W+(oe?1:-1);oe?Ye--:++Ye<be;)if(G(U[Ye],Ye,U))return Ye;return-1}function ki(U,G,W){return G===G?Ty(U,G,W):Ba(U,Ti,W)}function xy(U,G,W,oe){for(var be=W-1,Ye=U.length;++be<Ye;)if(oe(U[be],G))return be;return-1}function Ti(U){return U!==U}function Gd(U,G){var W=U==null?0:U.length;return W?Kc(U,G)/W:he}function bo(U){return function(G){return G==null?t:G[U]}}function Gc(U){return function(G){return U==null?t:U[G]}}function Va(U,G,W,oe,be){return be(U,function(Ye,tt,Ue){W=oe?(oe=!1,Ye):G(W,Ye,tt,Ue)}),W}function Ry(U,G){var W=U.length;for(U.sort(G);W--;)U[W]=U[W].value;return U}function Kc(U,G){for(var W,oe=-1,be=U.length;++oe<be;){var Ye=G(U[oe]);Ye!==t&&(W=W===t?Ye:W+Ye)}return W}function Qc(U,G){for(var W=-1,oe=Array(U);++W<U;)oe[W]=G(W);return oe}function Ey(U,G){return lt(G,function(W){return[W,U[W]]})}function Zc(U){return U&&U.slice(0,ep(U)+1).replace(Mc,"")}function yr(U){return function(G){return U(G)}}function Wa(U,G){return lt(G,function(W){return U[W]})}function et(U,G){return U.has(G)}function Kd(U,G){for(var W=-1,oe=U.length;++W<oe&&ki(G,U[W],0)>-1;);return W}function Qd(U,G){for(var W=U.length;W--&&ki(G,U[W],0)>-1;);return W}function Zd(U,G){for(var W=U.length,oe=0;W--;)U[W]===G&&++oe;return oe}var Cy=Gc(Vc),Oy=Gc(Wc);function Iy(U){return"\\"+Hd[U]}function So(U,G){return U==null?t:U[G]}function ys(U){return dy.test(U)}function Py(U){return py.test(U)}function ky(U){for(var G,W=[];!(G=U.next()).done;)W.push(G.value);return W}function vs(U){var G=-1,W=Array(U.size);return U.forEach(function(oe,be){W[++G]=[be,oe]}),W}function wo(U,G){return function(W){return U(G(W))}}function ln(U,G){for(var W=-1,oe=U.length,be=0,Ye=[];++W<oe;){var tt=U[W];(tt===G||tt===d)&&(U[W]=d,Ye[be++]=W)}return Ye}function za(U){var G=-1,W=Array(U.size);return U.forEach(function(oe){W[++G]=oe}),W}function Xd(U){var G=-1,W=Array(U.size);return U.forEach(function(oe){W[++G]=[oe,oe]}),W}function Ty(U,G,W){for(var oe=W-1,be=U.length;++oe<be;)if(U[oe]===G)return oe;return-1}function Xc(U,G,W){for(var oe=W+1;oe--;)if(U[oe]===G)return oe;return oe}function ui(U){return ys(U)?qy(U):Sy(U)}function vr(U){return ys(U)?$y(U):wy(U)}function ep(U){for(var G=U.length;G--&&qa.test(U.charAt(G)););return G}var Ay=Gc(gy);function qy(U){for(var G=Bc.lastIndex=0;Bc.test(U);)++G;return G}function $y(U){return U.match(Bc)||[]}function My(U){return U.match(fy)||[]}var Ny=(function U(G){G=G==null?Nt:fi.defaults(Nt.Object(),G,fi.pick(Nt,hy));var W=G.Array,oe=G.Date,be=G.Error,Ye=G.Function,tt=G.Math,Ue=G.Object,Ja=G.RegExp,Dy=G.String,br=G.TypeError,_o=W.prototype,Fy=Ye.prototype,bs=Ue.prototype,xo=G["__core-js_shared__"],Ya=Fy.toString,Ze=bs.hasOwnProperty,Ly=0,tp=(function(){var o=/[^.]+$/.exec(xo&&xo.keys&&xo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Ga=bs.toString,jy=Ya.call(Ue),Uy=Nt._,Hy=Ja("^"+Ya.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ka=ms?G.Buffer:t,di=G.Symbol,Qa=G.Uint8Array,rp=Ka?Ka.allocUnsafe:t,Za=wo(Ue.getPrototypeOf,Ue),np=Ue.create,Ro=bs.propertyIsEnumerable,Xa=_o.splice,ip=di?di.isConcatSpreadable:t,Eo=di?di.iterator:t,Ai=di?di.toStringTag:t,el=(function(){try{var o=Mo(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),By=G.clearTimeout!==Nt.clearTimeout&&G.clearTimeout,Vy=oe&&oe.now!==Nt.Date.now&&oe.now,Wy=G.setTimeout!==Nt.setTimeout&&G.setTimeout,Co=tt.ceil,Oo=tt.floor,tl=Ue.getOwnPropertySymbols,rl=Ka?Ka.isBuffer:t,qi=G.isFinite,nl=_o.join,sp=wo(Ue.keys,Ue),gt=tt.max,Ht=tt.min,op=oe.now,zy=G.parseInt,ap=tt.random,Jy=_o.reverse,eu=Mo(G,"DataView"),Io=Mo(G,"Map"),tu=Mo(G,"Promise"),Ss=Mo(G,"Set"),Po=Mo(G,"WeakMap"),ko=Mo(Ue,"create"),il=Po&&new Po,ws={},Yy=No(eu),Gy=No(Io),Ky=No(tu),Qy=No(Ss),Zy=No(Po),sl=di?di.prototype:t,To=sl?sl.valueOf:t,lp=sl?sl.toString:t;function O(o){if(Ot(o)&&!Re(o)&&!(o instanceof $e)){if(o instanceof nr)return o;if(Ze.call(o,"__wrapped__"))return KR(o)}return new nr(o)}var _s=(function(){function o(){}return function(c){if(!Et(c))return{};if(np)return np(c);o.prototype=c;var p=new o;return o.prototype=t,p}})();function ol(){}function nr(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=t}O.templateSettings={escape:zg,evaluate:Jg,interpolate:sn,variable:"",imports:{_:O}},O.prototype=ol.prototype,O.prototype.constructor=O,nr.prototype=_s(ol.prototype),nr.prototype.constructor=nr;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ee,this.__views__=[]}function Xy(){var o=new $e(this.__wrapped__);return o.__actions__=Tr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Tr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Tr(this.__views__),o}function ev(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function ru(){var o=this.__wrapped__.value(),c=this.__dir__,p=Re(o),v=c<0,E=p?o.length:0,I=b$(0,E,this.__views__),A=I.start,D=I.end,H=D-A,Q=v?D:A-1,Z=this.__iteratees__,ee=Z.length,ie=0,ue=Ht(H,this.__takeCount__);if(!p||!v&&E==H&&ue==H)return bR(o,this.__actions__);var ye=[];e:for(;H--&&ie<ue;){Q+=c;for(var Pe=-1,me=o[Q];++Pe<ee;){var Le=Z[Pe],He=Le.iteratee,Zr=Le.type,_r=He(me);if(Zr==J)me=_r;else if(!_r){if(Zr==Y)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=_s(ol.prototype),$e.prototype.constructor=$e;function cn(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 tv(){this.__data__=ko?ko(null):{},this.size=0}function rv(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function nv(o){var c=this.__data__;if(ko){var p=c[o];return p===l?t:p}return Ze.call(c,o)?c[o]:t}function iv(o){var c=this.__data__;return ko?c[o]!==t:Ze.call(c,o)}function sv(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=ko&&c===t?l:c,this}cn.prototype.clear=tv,cn.prototype.delete=rv,cn.prototype.get=nv,cn.prototype.has=iv,cn.prototype.set=sv;function An(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 cp(){this.__data__=[],this.size=0}function ov(o){var c=this.__data__,p=ll(c,o);if(p<0)return!1;var v=c.length-1;return p==v?c.pop():Xa.call(c,p,1),--this.size,!0}function av(o){var c=this.__data__,p=ll(c,o);return p<0?t:c[p][1]}function up(o){return ll(this.__data__,o)>-1}function lv(o,c){var p=this.__data__,v=ll(p,o);return v<0?(++this.size,p.push([o,c])):p[v][1]=c,this}An.prototype.clear=cp,An.prototype.delete=ov,An.prototype.get=av,An.prototype.has=up,An.prototype.set=lv;function qn(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 cn,map:new(Io||An),string:new cn}}function pi(o){var c=Tp(this,o).delete(o);return this.size-=c?1:0,c}function fp(o){return Tp(this,o).get(o)}function uv(o){return Tp(this,o).has(o)}function fv(o,c){var p=Tp(this,o),v=p.size;return p.set(o,c),this.size+=p.size==v?0:1,this}qn.prototype.clear=cv,qn.prototype.delete=pi,qn.prototype.get=fp,qn.prototype.has=uv,qn.prototype.set=fv;function $i(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new qn;++c<p;)this.add(o[c])}function te(o){return this.__data__.set(o,l),this}function dv(o){return this.__data__.has(o)}$i.prototype.add=$i.prototype.push=te,$i.prototype.has=dv;function Jr(o){var c=this.__data__=new An(o);this.size=c.size}function dp(){this.__data__=new An,this.size=0}function Ve(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function al(o){return this.__data__.get(o)}function pp(o){return this.__data__.has(o)}function nu(o,c){var p=this.__data__;if(p instanceof An){var v=p.__data__;if(!Io||v.length<r-1)return v.push([o,c]),this.size=++p.size,this;p=this.__data__=new qn(v)}return p.set(o,c),this.size=p.size,this}Jr.prototype.clear=dp,Jr.prototype.delete=Ve,Jr.prototype.get=al,Jr.prototype.has=pp,Jr.prototype.set=nu;function hp(o,c){var p=Re(o),v=!p&&Do(o),E=!p&&!v&&Ps(o),I=!p&&!v&&!E&&hl(o),A=p||v||E||I,D=A?Qc(o.length,Dy):[],H=D.length;for(var Q in o)(c||Ze.call(o,Q))&&!(A&&(Q=="length"||E&&(Q=="offset"||Q=="parent")||I&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Fi(Q,H)))&&D.push(Q);return D}function mp(o){var c=o.length;return c?o[Ev(0,c-1)]:t}function pv(o,c){return Ap(Tr(o),hi(c,0,o.length))}function hv(o){return Ap(Tr(o))}function iu(o,c,p){(p!==t&&!Fn(o[c],p)||p===t&&!(c in o))&&Yr(o,c,p)}function Sr(o,c,p){var v=o[c];(!(Ze.call(o,c)&&Fn(v,p))||p===t&&!(c in o))&&Yr(o,c,p)}function ll(o,c){for(var p=o.length;p--;)if(Fn(o[p][0],c))return p;return-1}function gp(o,c,p,v){return mi(o,function(E,I,A){c(v,E,p(E),A)}),v}function yp(o,c){return o&&gi(c,Kt(c),o)}function mv(o,c){return o&&gi(c,qr(c),o)}function Yr(o,c,p){c=="__proto__"&&el?el(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function su(o,c){for(var p=-1,v=c.length,E=W(v),I=o==null;++p<v;)E[p]=I?t:Qv(o,c[p]);return E}function hi(o,c,p){return o===o&&(p!==t&&(o=o<=p?o:p),c!==t&&(o=o>=c?o:c)),o}function ir(o,c,p,v,E,I){var A,D=c&m,H=c&g,Q=c&y;if(p&&(A=E?p(o,v,E,I):p(o)),A!==t)return A;if(!Et(o))return o;var Z=Re(o);if(Z){if(A=w$(o),!D)return Tr(o,A)}else{var ee=sr(o),ie=ee==nn||ee==oo;if(Ps(o))return _R(o,D);if(ee==Cn||ee==pr||ie&&!E){if(A=H||ie?{}:UR(o),!D)return H?u$(o,mv(A,o)):c$(o,yp(A,o))}else{if(!at[ee])return E?o:{};A=_$(o,ee,D)}}I||(I=new Jr);var ue=I.get(o);if(ue)return ue;I.set(o,A),gE(o)?o.forEach(function(me){A.add(ir(me,c,p,me,o,I))}):hE(o)&&o.forEach(function(me,Le){A.set(Le,ir(me,c,p,Le,o,I))});var ye=Q?H?Nv:Mv:H?qr:Kt,Pe=Z?t:ye(o);return gr(Pe||o,function(me,Le){Pe&&(Le=me,me=o[Le]),Sr(A,Le,ir(me,c,p,Le,o,I))}),A}function gv(o){var c=Kt(o);return function(p){return un(p,o,c)}}function un(o,c,p){var v=p.length;if(o==null)return!v;for(o=Ue(o);v--;){var E=p[v],I=c[E],A=o[E];if(A===t&&!(E in o)||!I(A))return!1}return!0}function ou(o,c,p){if(typeof o!="function")throw new br(i);return pu(function(){o.apply(t,p)},c)}function Ao(o,c,p,v){var E=-1,I=Ua,A=!0,D=o.length,H=[],Q=c.length;if(!D)return H;p&&(c=lt(c,yr(p))),v?(I=gs,A=!1):c.length>=r&&(I=et,A=!1,c=new $i(c));e:for(;++E<D;){var Z=o[E],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,A&&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 mi=OR(fn),vp=OR($n,!0);function yv(o,c){var p=!0;return mi(o,function(v,E,I){return p=!!c(v,E,I),p}),p}function cl(o,c,p){for(var v=-1,E=o.length;++v<E;){var I=o[v],A=c(I);if(A!=null&&(D===t?A===A&&!Qr(A):p(A,D)))var D=A,H=I}return H}function vv(o,c,p,v){var E=o.length;for(p=Ce(p),p<0&&(p=-p>E?0:E+p),v=v===t||v>E?E:Ce(v),v<0&&(v+=E),v=p>v?0:vE(v);p<v;)o[p++]=c;return o}function bp(o,c){var p=[];return mi(o,function(v,E,I){c(v,E,I)&&p.push(v)}),p}function Bt(o,c,p,v,E){var I=-1,A=o.length;for(p||(p=R$),E||(E=[]);++I<A;){var D=o[I];c>0&&p(D)?c>1?Bt(D,c-1,p,v,E):ci(E,D):v||(E[E.length]=D)}return E}var au=IR(),Sp=IR(!0);function fn(o,c){return o&&au(o,c,Kt)}function $n(o,c){return o&&Sp(o,c,Kt)}function ul(o,c){return li(c,function(p){return Li(o[p])})}function Mi(o,c){c=Os(c,o);for(var p=0,v=c.length;o!=null&&p<v;)o=o[Dn(c[p++])];return p&&p==v?o:t}function wp(o,c,p){var v=c(o);return Re(o)?v:ci(v,p(o))}function Qt(o){return o==null?o===t?Od:Vg:Ai&&Ai in Ue(o)?v$(o):T$(o)}function lu(o,c){return o>c}function bv(o,c){return o!=null&&Ze.call(o,c)}function Sv(o,c){return o!=null&&c in Ue(o)}function wv(o,c,p){return o>=Ht(c,p)&&o<gt(c,p)}function Gr(o,c,p){for(var v=p?gs:Ua,E=o[0].length,I=o.length,A=I,D=W(I),H=1/0,Q=[];A--;){var Z=o[A];A&&c&&(Z=lt(Z,yr(c))),H=Ht(Z.length,H),D[A]=!p&&(c||E>=120&&Z.length>=120)?new $i(A&&Z):t}Z=o[0];var ee=-1,ie=D[0];e:for(;++ee<E&&Q.length<H;){var ue=Z[ee],ye=c?c(ue):ue;if(ue=p||ue!==0?ue:0,!(ie?et(ie,ye):v(Q,ye,p))){for(A=I;--A;){var Pe=D[A];if(!(Pe?et(Pe,ye):v(o[A],ye,p)))continue e}ie&&ie.push(ye),Q.push(ue)}}return Q}function xs(o,c,p,v){return fn(o,function(E,I,A){c(v,p(E),I,A)}),v}function qo(o,c,p){c=Os(c,o),o=WR(o,c);var v=o==null?o:o[Dn(pn(c))];return v==null?t:mr(v,o,p)}function _p(o){return Ot(o)&&Qt(o)==pr}function _v(o){return Ot(o)&&Qt(o)==Ci}function xv(o){return Ot(o)&&Qt(o)==Or}function $o(o,c,p,v,E){return o===c?!0:o==null||c==null||!Ot(o)&&!Ot(c)?o!==o&&c!==c:cu(o,c,p,v,$o,E)}function cu(o,c,p,v,E,I){var A=Re(o),D=Re(c),H=A?oi:sr(o),Q=D?oi:sr(c);H=H==pr?Cn:H,Q=Q==pr?Cn:Q;var Z=H==Cn,ee=Q==Cn,ie=H==Q;if(ie&&Ps(o)){if(!Ps(c))return!1;A=!0,Z=!1}if(ie&&!Z)return I||(I=new Jr),A||hl(o)?FR(o,c,p,v,E,I):g$(o,c,H,p,v,E,I);if(!(p&w)){var ue=Z&&Ze.call(o,"__wrapped__"),ye=ee&&Ze.call(c,"__wrapped__");if(ue||ye){var Pe=ue?o.value():o,me=ye?c.value():c;return I||(I=new Jr),E(Pe,me,p,v,I)}}return ie?(I||(I=new Jr),y$(o,c,p,v,E,I)):!1}function Rs(o){return Ot(o)&&sr(o)==Jt}function Es(o,c,p,v){var E=p.length,I=E,A=!v;if(o==null)return!I;for(o=Ue(o);E--;){var D=p[E];if(A&&D[2]?D[1]!==o[D[0]]:!(D[0]in o))return!1}for(;++E<I;){D=p[E];var H=D[0],Q=o[H],Z=D[1];if(A&&D[2]){if(Q===t&&!(H in o))return!1}else{var ee=new Jr;if(v)var ie=v(Q,Z,H,o,c,ee);if(!(ie===t?$o(Z,Q,w|R,v,ee):ie))return!1}}return!0}function Fe(o){if(!Et(o)||C$(o))return!1;var c=Li(o)?Hy:kd;return c.test(No(o))}function u(o){return Ot(o)&&Qt(o)==Yt}function h(o){return Ot(o)&&sr(o)==hr}function b(o){return Ot(o)&&Fp(o.length)&&!!ut[Qt(o)]}function S(o){return typeof o=="function"?o:o==null?$r:typeof o=="object"?Re(o)?Me(o[0],o[1]):ve(o):kE(o)}function C(o){if(!du(o))return sp(o);var c=[];for(var p in Ue(o))Ze.call(o,p)&&p!="constructor"&&c.push(p);return c}function M(o){if(!Et(o))return k$(o);var c=du(o),p=[];for(var v in o)v=="constructor"&&(c||!Ze.call(o,v))||p.push(v);return p}function z(o,c){return o<c}function se(o,c){var p=-1,v=Ar(o)?W(o.length):[];return mi(o,function(E,I,A){v[++p]=c(E,I,A)}),v}function ve(o){var c=Fv(o);return c.length==1&&c[0][2]?BR(c[0][0],c[0][1]):function(p){return p===o||Es(p,o,c)}}function Me(o,c){return jv(o)&&HR(c)?BR(Dn(o),c):function(p){var v=Qv(p,o);return v===t&&v===c?Zv(p,o):$o(c,v,w|R)}}function Dt(o,c,p,v,E){o!==c&&au(c,function(I,A){if(E||(E=new Jr),Et(I))Mn(o,c,A,p,Dt,v,E);else{var D=v?v(Hv(o,A),I,A+"",o,c,E):t;D===t&&(D=I),iu(o,A,D)}},qr)}function Mn(o,c,p,v,E,I,A){var D=Hv(o,p),H=Hv(c,p),Q=A.get(H);if(Q){iu(o,p,Q);return}var Z=I?I(D,H,p+"",o,c,A):t,ee=Z===t;if(ee){var ie=Re(H),ue=!ie&&Ps(H),ye=!ie&&!ue&&hl(H);Z=H,ie||ue||ye?Re(D)?Z=D:qt(D)?Z=Tr(D):ue?(ee=!1,Z=_R(H,!0)):ye?(ee=!1,Z=xR(H,!0)):Z=[]:hu(H)||Do(H)?(Z=D,Do(D)?Z=bE(D):(!Et(D)||Li(D))&&(Z=UR(H))):ee=!1}ee&&(A.set(H,Z),E(Z,H,v,I,A),A.delete(H)),iu(o,p,Z)}function Nn(o,c){var p=o.length;if(p)return c+=c<0?p:0,Fi(c,p)?o[c]:t}function dR(o,c,p){c.length?c=lt(c,function(I){return Re(I)?function(A){return Mi(A,I.length===1?I[0]:I)}:I}):c=[$r];var v=-1;c=lt(c,yr(ge()));var E=se(o,function(I,A,D){var H=lt(c,function(Q){return Q(I)});return{criteria:H,index:++v,value:I}});return Ry(E,function(I,A){return l$(I,A,p)})}function Kq(o,c){return pR(o,c,function(p,v){return Zv(o,v)})}function pR(o,c,p){for(var v=-1,E=c.length,I={};++v<E;){var A=c[v],D=Mi(o,A);p(D,A)&&uu(I,Os(A,o),D)}return I}function Qq(o){return function(c){return Mi(c,o)}}function Rv(o,c,p,v){var E=v?xy:ki,I=-1,A=c.length,D=o;for(o===c&&(c=Tr(c)),p&&(D=lt(o,yr(p)));++I<A;)for(var H=0,Q=c[I],Z=p?p(Q):Q;(H=E(D,Z,H,v))>-1;)D!==o&&Xa.call(D,H,1),Xa.call(o,H,1);return o}function hR(o,c){for(var p=o?c.length:0,v=p-1;p--;){var E=c[p];if(p==v||E!==I){var I=E;Fi(E)?Xa.call(o,E,1):Iv(o,E)}}return o}function Ev(o,c){return o+Oo(ap()*(c-o+1))}function Zq(o,c,p,v){for(var E=-1,I=gt(Co((c-o)/(p||1)),0),A=W(I);I--;)A[v?I:++E]=o,o+=p;return A}function Cv(o,c){var p="";if(!o||c<1||c>Xe)return p;do c%2&&(p+=o),c=Oo(c/2),c&&(o+=o);while(c);return p}function Te(o,c){return Bv(VR(o,c,$r),o+"")}function Xq(o){return mp(ml(o))}function e$(o,c){var p=ml(o);return Ap(p,hi(c,0,p.length))}function uu(o,c,p,v){if(!Et(o))return o;c=Os(c,o);for(var E=-1,I=c.length,A=I-1,D=o;D!=null&&++E<I;){var H=Dn(c[E]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(E!=A){var Z=D[H];Q=v?v(Z,H,D):t,Q===t&&(Q=Et(Z)?Z:Fi(c[E+1])?[]:{})}Sr(D,H,Q),D=D[H]}return o}var mR=il?function(o,c){return il.set(o,c),o}:$r,t$=el?function(o,c){return el(o,"toString",{configurable:!0,enumerable:!1,value:eb(c),writable:!0})}:$r;function r$(o){return Ap(ml(o))}function dn(o,c,p){var v=-1,E=o.length;c<0&&(c=-c>E?0:E+c),p=p>E?E:p,p<0&&(p+=E),E=c>p?0:p-c>>>0,c>>>=0;for(var I=W(E);++v<E;)I[v]=o[v+c];return I}function n$(o,c){var p;return mi(o,function(v,E,I){return p=c(v,E,I),!p}),!!p}function xp(o,c,p){var v=0,E=o==null?v:o.length;if(typeof c=="number"&&c===c&&E<=Ct){for(;v<E;){var I=v+E>>>1,A=o[I];A!==null&&!Qr(A)&&(p?A<=c:A<c)?v=I+1:E=I}return E}return Ov(o,c,$r,p)}function Ov(o,c,p,v){var E=0,I=o==null?0:o.length;if(I===0)return 0;c=p(c);for(var A=c!==c,D=c===null,H=Qr(c),Q=c===t;E<I;){var Z=Oo((E+I)/2),ee=p(o[Z]),ie=ee!==t,ue=ee===null,ye=ee===ee,Pe=Qr(ee);if(A)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!ue):H?me=ye&&ie&&!ue&&(v||!Pe):ue||Pe?me=!1:me=v?ee<=c:ee<c;me?E=Z+1:I=Z}return Ht(I,vt)}function gR(o,c){for(var p=-1,v=o.length,E=0,I=[];++p<v;){var A=o[p],D=c?c(A):A;if(!p||!Fn(D,H)){var H=D;I[E++]=A===0?0:A}}return I}function yR(o){return typeof o=="number"?o:Qr(o)?he:+o}function Kr(o){if(typeof o=="string")return o;if(Re(o))return lt(o,Kr)+"";if(Qr(o))return lp?lp.call(o):"";var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function Cs(o,c,p){var v=-1,E=Ua,I=o.length,A=!0,D=[],H=D;if(p)A=!1,E=gs;else if(I>=r){var Q=c?null:h$(o);if(Q)return za(Q);A=!1,E=et,H=new $i}else H=c?[]:D;e:for(;++v<I;){var Z=o[v],ee=c?c(Z):Z;if(Z=p||Z!==0?Z:0,A&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;c&&H.push(ee),D.push(Z)}else E(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function Iv(o,c){c=Os(c,o);var p=-1,v=c.length;if(!v)return!0;for(;++p<v;){var E=Dn(c[p]);if(E==="__proto__"&&!Ze.call(o,"__proto__")||(E==="constructor"||E==="prototype")&&p<v-1)return!1}var I=WR(o,c);return I==null||delete I[Dn(pn(c))]}function vR(o,c,p,v){return uu(o,c,p(Mi(o,c)),v)}function Rp(o,c,p,v){for(var E=o.length,I=v?E:-1;(v?I--:++I<E)&&c(o[I],I,o););return p?dn(o,v?0:I,v?I+1:E):dn(o,v?I+1:0,v?E:I)}function bR(o,c){var p=o;return p instanceof $e&&(p=p.value()),Yc(c,function(v,E){return E.func.apply(E.thisArg,ci([v],E.args))},p)}function Pv(o,c,p){var v=o.length;if(v<2)return v?Cs(o[0]):[];for(var E=-1,I=W(v);++E<v;)for(var A=o[E],D=-1;++D<v;)D!=E&&(I[E]=Ao(I[E]||A,o[D],c,p));return Cs(Bt(I,1),c,p)}function SR(o,c,p){for(var v=-1,E=o.length,I=c.length,A={};++v<E;){var D=v<I?c[v]:t;p(A,o[v],D)}return A}function kv(o){return qt(o)?o:[]}function Tv(o){return typeof o=="function"?o:$r}function Os(o,c){return Re(o)?o:jv(o,c)?[o]:GR(rt(o))}var i$=Te;function Is(o,c,p){var v=o.length;return p=p===t?v:p,!c&&p>=v?o:dn(o,c,p)}var wR=By||function(o){return Nt.clearTimeout(o)};function _R(o,c){if(c)return o.slice();var p=o.length,v=rp?rp(p):new o.constructor(p);return o.copy(v),v}function Av(o){var c=new o.constructor(o.byteLength);return new Qa(c).set(new Qa(o)),c}function s$(o,c){var p=c?Av(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function o$(o){var c=new o.constructor(o.source,Pd.exec(o));return c.lastIndex=o.lastIndex,c}function a$(o){return To?Ue(To.call(o)):{}}function xR(o,c){var p=c?Av(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function RR(o,c){if(o!==c){var p=o!==t,v=o===null,E=o===o,I=Qr(o),A=c!==t,D=c===null,H=c===c,Q=Qr(c);if(!D&&!Q&&!I&&o>c||I&&A&&H&&!D&&!Q||v&&A&&H||!p&&H||!E)return 1;if(!v&&!I&&!Q&&o<c||Q&&p&&E&&!v&&!I||D&&p&&E||!A&&E||!H)return-1}return 0}function l$(o,c,p){for(var v=-1,E=o.criteria,I=c.criteria,A=E.length,D=p.length;++v<A;){var H=RR(E[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 ER(o,c,p,v){for(var E=-1,I=o.length,A=p.length,D=-1,H=c.length,Q=gt(I-A,0),Z=W(H+Q),ee=!v;++D<H;)Z[D]=c[D];for(;++E<A;)(ee||E<I)&&(Z[p[E]]=o[E]);for(;Q--;)Z[D++]=o[E++];return Z}function CR(o,c,p,v){for(var E=-1,I=o.length,A=-1,D=p.length,H=-1,Q=c.length,Z=gt(I-D,0),ee=W(Z+Q),ie=!v;++E<Z;)ee[E]=o[E];for(var ue=E;++H<Q;)ee[ue+H]=c[H];for(;++A<D;)(ie||E<I)&&(ee[ue+p[A]]=o[E++]);return ee}function Tr(o,c){var p=-1,v=o.length;for(c||(c=W(v));++p<v;)c[p]=o[p];return c}function gi(o,c,p,v){var E=!p;p||(p={});for(var I=-1,A=c.length;++I<A;){var D=c[I],H=v?v(p[D],o[D],D,p,o):t;H===t&&(H=o[D]),E?Yr(p,D,H):Sr(p,D,H)}return p}function c$(o,c){return gi(o,Lv(o),c)}function u$(o,c){return gi(o,LR(o),c)}function Ep(o,c){return function(p,v){var E=Re(p)?Tn:gp,I=c?c():{};return E(p,o,ge(v,2),I)}}function fl(o){return Te(function(c,p){var v=-1,E=p.length,I=E>1?p[E-1]:t,A=E>2?p[2]:t;for(I=o.length>3&&typeof I=="function"?(E--,I):t,A&&wr(p[0],p[1],A)&&(I=E<3?t:I,E=1),c=Ue(c);++v<E;){var D=p[v];D&&o(c,D,v,I)}return c})}function OR(o,c){return function(p,v){if(p==null)return p;if(!Ar(p))return o(p,v);for(var E=p.length,I=c?E:-1,A=Ue(p);(c?I--:++I<E)&&v(A[I],I,A)!==!1;);return p}}function IR(o){return function(c,p,v){for(var E=-1,I=Ue(c),A=v(c),D=A.length;D--;){var H=A[o?D:++E];if(p(I[H],H,I)===!1)break}return c}}function f$(o,c,p){var v=c&x,E=fu(o);function I(){var A=this&&this!==Nt&&this instanceof I?E:o;return A.apply(v?p:this,arguments)}return I}function PR(o){return function(c){c=rt(c);var p=ys(c)?vr(c):t,v=p?p[0]:c.charAt(0),E=p?Is(p,1).join(""):c.slice(1);return v[o]()+E}}function dl(o){return function(c){return Yc(IE(OE(c).replace(cy,"")),o,"")}}function fu(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=_s(o.prototype),v=o.apply(p,c);return Et(v)?v:p}}function d$(o,c,p){var v=fu(o);function E(){for(var I=arguments.length,A=W(I),D=I,H=pl(E);D--;)A[D]=arguments[D];var Q=I<3&&A[0]!==H&&A[I-1]!==H?[]:ln(A,H);if(I-=Q.length,I<p)return $R(o,c,Cp,E.placeholder,t,A,Q,t,t,p-I);var Z=this&&this!==Nt&&this instanceof E?v:o;return mr(Z,this,A)}return E}function kR(o){return function(c,p,v){var E=Ue(c);if(!Ar(c)){var I=ge(p,3);c=Kt(c),p=function(D){return I(E[D],D,E)}}var A=o(c,p,v);return A>-1?E[I?c[A]:A]:t}}function TR(o){return Di(function(c){var p=c.length,v=p,E=nr.prototype.thru;for(o&&c.reverse();v--;){var I=c[v];if(typeof I!="function")throw new br(i);if(E&&!A&&kp(I)=="wrapper")var A=new nr([],!0)}for(v=A?v:p;++v<p;){I=c[v];var D=kp(I),H=D=="wrapper"?Dv(I):t;H&&Uv(H[0])&&H[1]==(X|L|B|k)&&!H[4].length&&H[9]==1?A=A[kp(H[0])].apply(A,H[3]):A=I.length==1&&Uv(I)?A[D]():A.thru(I)}return function(){var Q=arguments,Z=Q[0];if(A&&Q.length==1&&Re(Z))return A.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 Cp(o,c,p,v,E,I,A,D,H,Q){var Z=c&X,ee=c&x,ie=c&T,ue=c&(L|V),ye=c&_,Pe=ie?t:fu(o);function me(){for(var Le=arguments.length,He=W(Le),Zr=Le;Zr--;)He[Zr]=arguments[Zr];if(ue)var _r=pl(me),Xr=Zd(He,_r);if(v&&(He=ER(He,v,E,ue)),I&&(He=CR(He,I,A,ue)),Le-=Xr,ue&&Le<Q){var $t=ln(He,_r);return $R(o,c,Cp,me.placeholder,p,He,$t,D,H,Q-Le)}var Ln=ee?p:this,Ui=ie?Ln[o]:o;return Le=He.length,D?He=A$(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Nt&&this instanceof me&&(Ui=Pe||fu(Ui)),Ui.apply(Ln,He)}return me}function AR(o,c){return function(p,v){return xs(p,o,c(v),{})}}function Op(o,c){return function(p,v){var E;if(p===t&&v===t)return c;if(p!==t&&(E=p),v!==t){if(E===t)return v;typeof p=="string"||typeof v=="string"?(p=Kr(p),v=Kr(v)):(p=yR(p),v=yR(v)),E=o(p,v)}return E}}function qv(o){return Di(function(c){return c=lt(c,yr(ge())),Te(function(p){var v=this;return o(c,function(E){return mr(E,v,p)})})})}function Ip(o,c){c=c===t?" ":Kr(c);var p=c.length;if(p<2)return p?Cv(c,o):c;var v=Cv(c,Co(o/ui(c)));return ys(c)?Is(vr(v),0,o).join(""):v.slice(0,o)}function p$(o,c,p,v){var E=c&x,I=fu(o);function A(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=W(Z+H),ie=this&&this!==Nt&&this instanceof A?I:o;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return mr(ie,E?p:this,ee)}return A}function qR(o){return function(c,p,v){return v&&typeof v!="number"&&wr(c,p,v)&&(p=v=t),c=ji(c),p===t?(p=c,c=0):p=ji(p),v=v===t?c<p?1:-1:ji(v),Zq(c,p,v,o)}}function Pp(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=hn(c),p=hn(p)),o(c,p)}}function $R(o,c,p,v,E,I,A,D,H,Q){var Z=c&L,ee=Z?A:t,ie=Z?t:A,ue=Z?I:t,ye=Z?t:I;c|=Z?B:K,c&=~(Z?K:B),c&q||(c&=~(x|T));var Pe=[o,c,E,ue,ee,ye,ie,D,H,Q],me=p.apply(t,Pe);return Uv(o)&&zR(me,Pe),me.placeholder=v,JR(me,o,c)}function $v(o){var c=tt[o];return function(p,v){if(p=hn(p),v=v==null?0:Ht(Ce(v),292),v&&qi(p)){var E=(rt(p)+"e").split("e"),I=c(E[0]+"e"+(+E[1]+v));return E=(rt(I)+"e").split("e"),+(E[0]+"e"+(+E[1]-v))}return c(p)}}var h$=Ss&&1/za(new Ss([,-0]))[1]==pe?function(o){return new Ss(o)}:nb;function MR(o){return function(c){var p=sr(c);return p==Jt?vs(c):p==hr?Xd(c):Ey(c,o(c))}}function Ni(o,c,p,v,E,I,A,D){var H=c&T;if(!H&&typeof o!="function")throw new br(i);var Q=v?v.length:0;if(Q||(c&=~(B|K),v=E=t),A=A===t?A:gt(Ce(A),0),D=D===t?D:Ce(D),Q-=E?E.length:0,c&K){var Z=v,ee=E;v=E=t}var ie=H?t:Dv(o),ue=[o,c,p,v,E,Z,ee,I,A,D];if(ie&&P$(ue,ie),o=ue[0],c=ue[1],p=ue[2],v=ue[3],E=ue[4],D=ue[9]=ue[9]===t?H?0:o.length:gt(ue[9]-Q,0),!D&&c&(L|V)&&(c&=~(L|V)),!c||c==x)var ye=f$(o,c,p);else c==L||c==V?ye=d$(o,c,D):(c==B||c==(x|B))&&!E.length?ye=p$(o,c,p,v):ye=Cp.apply(t,ue);var Pe=ie?mR:zR;return JR(Pe(ye,ue),o,c)}function NR(o,c,p,v){return o===t||Fn(o,bs[p])&&!Ze.call(v,p)?c:o}function DR(o,c,p,v,E,I){return Et(o)&&Et(c)&&(I.set(c,o),Dt(o,c,t,DR,I),I.delete(c)),o}function m$(o){return hu(o)?t:o}function FR(o,c,p,v,E,I){var A=p&w,D=o.length,H=c.length;if(D!=H&&!(A&&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&R?new $i:t;for(I.set(o,c),I.set(c,o);++ee<D;){var ye=o[ee],Pe=c[ee];if(v)var me=A?v(Pe,ye,ee,c,o,I):v(ye,Pe,ee,o,c,I);if(me!==t){if(me)continue;ie=!1;break}if(ue){if(!Ha(c,function(Le,He){if(!et(ue,He)&&(ye===Le||E(ye,Le,p,v,I)))return ue.push(He)})){ie=!1;break}}else if(!(ye===Pe||E(ye,Pe,p,v,I))){ie=!1;break}}return I.delete(o),I.delete(c),ie}function g$(o,c,p,v,E,I,A){switch(p){case On:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Ci:return!(o.byteLength!=c.byteLength||!I(new Qa(o),new Qa(c)));case zr:case Or:case ao:return Fn(+o,+c);case mt:return o.name==c.name&&o.message==c.message;case Yt:case lo:return o==c+"";case Jt:var D=vs;case hr:var H=v&w;if(D||(D=za),o.size!=c.size&&!H)return!1;var Q=A.get(o);if(Q)return Q==c;v|=R,A.set(o,c);var Z=FR(D(o),D(c),v,E,I,A);return A.delete(o),Z;case Oa:if(To)return To.call(o)==To.call(c)}return!1}function y$(o,c,p,v,E,I){var A=p&w,D=Mv(o),H=D.length,Q=Mv(c),Z=Q.length;if(H!=Z&&!A)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(A?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 Pe=!0;I.set(o,c),I.set(c,o);for(var me=A;++ee<H;){ie=D[ee];var Le=o[ie],He=c[ie];if(v)var Zr=A?v(He,Le,ie,c,o,I):v(Le,He,ie,o,c,I);if(!(Zr===t?Le===He||E(Le,He,p,v,I):Zr)){Pe=!1;break}me||(me=ie=="constructor")}if(Pe&&!me){var _r=o.constructor,Xr=c.constructor;_r!=Xr&&"constructor"in o&&"constructor"in c&&!(typeof _r=="function"&&_r instanceof _r&&typeof Xr=="function"&&Xr instanceof Xr)&&(Pe=!1)}return I.delete(o),I.delete(c),Pe}function Di(o){return Bv(VR(o,t,XR),o+"")}function Mv(o){return wp(o,Kt,Lv)}function Nv(o){return wp(o,qr,LR)}var Dv=il?function(o){return il.get(o)}:nb;function kp(o){for(var c=o.name+"",p=ws[c],v=Ze.call(ws,c)?p.length:0;v--;){var E=p[v],I=E.func;if(I==null||I==o)return E.name}return c}function pl(o){var c=Ze.call(O,"placeholder")?O:o;return c.placeholder}function ge(){var o=O.iteratee||tb;return o=o===tb?S:o,arguments.length?o(arguments[0],arguments[1]):o}function Tp(o,c){var p=o.__data__;return E$(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Fv(o){for(var c=Kt(o),p=c.length;p--;){var v=c[p],E=o[v];c[p]=[v,E,HR(E)]}return c}function Mo(o,c){var p=So(o,c);return Fe(p)?p:t}function v$(o){var c=Ze.call(o,Ai),p=o[Ai];try{o[Ai]=t;var v=!0}catch{}var E=Ga.call(o);return v&&(c?o[Ai]=p:delete o[Ai]),E}var Lv=tl?function(o){return o==null?[]:(o=Ue(o),li(tl(o),function(c){return Ro.call(o,c)}))}:ib,LR=tl?function(o){for(var c=[];o;)ci(c,Lv(o)),o=Za(o);return c}:ib,sr=Qt;(eu&&sr(new eu(new ArrayBuffer(1)))!=On||Io&&sr(new Io)!=Jt||tu&&sr(tu.resolve())!=Ed||Ss&&sr(new Ss)!=hr||Po&&sr(new Po)!=Ut)&&(sr=function(o){var c=Qt(o),p=c==Cn?o.constructor:t,v=p?No(p):"";if(v)switch(v){case Yy:return On;case Gy:return Jt;case Ky:return Ed;case Qy:return hr;case Zy:return Ut}return c});function b$(o,c,p){for(var v=-1,E=p.length;++v<E;){var I=p[v],A=I.size;switch(I.type){case"drop":o+=A;break;case"dropRight":c-=A;break;case"take":c=Ht(c,o+A);break;case"takeRight":o=gt(o,c-A);break}}return{start:o,end:c}}function S$(o){var c=o.match(In);return c?c[1].split(on):[]}function jR(o,c,p){c=Os(c,o);for(var v=-1,E=c.length,I=!1;++v<E;){var A=Dn(c[v]);if(!(I=o!=null&&p(o,A)))break;o=o[A]}return I||++v!=E?I:(E=o==null?0:o.length,!!E&&Fp(E)&&Fi(A,E)&&(Re(o)||Do(o)))}function w$(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 UR(o){return typeof o.constructor=="function"&&!du(o)?_s(Za(o)):{}}function _$(o,c,p){var v=o.constructor;switch(c){case Ci:return Av(o);case zr:case Or:return new v(+o);case On:return s$(o,p);case st:case Ia:case Pa:case cs:case co:case us:case ai:case fs:case qc:return xR(o,p);case Jt:return new v;case ao:case lo:return new v(o);case Yt:return o$(o);case hr:return new v;case Oa:return a$(o)}}function x$(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(Gt,`{
|
|
2
2
|
/* [wrapped with `+c+`] */
|
|
3
|
-
`)}function _$(o){return Re(o)||Do(o)||!!(tp&&o&&o[tp])}function Fi(o,c){var p=typeof o;return c=c??Xe,!!c&&(p=="number"||p!="symbol"&&ds.test(o))&&o>-1&&o%1==0&&o<c}function wr(o,c,p){if(!Et(p))return!1;var v=typeof c;return(v=="number"?Ar(p)&&Fi(c,p.length):v=="string"&&c in p)?Fn(p[c],o):!1}function Fv(o,c){if(Re(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Qr(o)?!0:qe.test(o)||!Ir.test(o)||c!=null&&o in Ue(c)}function x$(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Lv(o){var c=Op(o),p=O[c];if(typeof p!="function"||!(c in $e.prototype))return!1;if(o===p)return!0;var v=Mv(p);return!!v&&o===v[0]}function R$(o){return!!Zd&&Zd in o}var E$=xo?Li:nb;function uu(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||bs;return o===p}function HR(o){return o===o&&!Et(o)}function BR(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==t||o in Ue(p))}}function C$(o){var c=qp(o,function(v){return p.size===f&&p.clear(),v}),p=c.cache;return c}function O$(o,c){var p=o[1],v=c[1],E=p|v,I=E<(x|T|X),A=v==X&&p==L||v==X&&p==k&&o[7].length<=c[8]||v==(X|k)&&c[7].length<=c[8]&&p==L;if(!(I||A))return o;v&x&&(o[2]=c[2],E|=p&x?0:q);var D=c[3];if(D){var H=o[3];o[3]=H?ER(H,D,c[4]):D,o[4]=H?ln(o[3],d):c[4]}return D=c[5],D&&(H=o[5],o[5]=H?CR(H,D,c[6]):D,o[6]=H?ln(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]=E,o}function I$(o){var c=[];if(o!=null)for(var p in Ue(o))c.push(p);return c}function P$(o){return Ga.call(o)}function VR(o,c,p){return c=gt(c===t?o.length-1:c,0),function(){for(var v=arguments,E=-1,I=gt(v.length-c,0),A=W(I);++E<I;)A[E]=v[c+E];E=-1;for(var D=W(c+1);++E<c;)D[E]=v[E];return D[c]=p(A),mr(o,this,D)}}function WR(o,c){return c.length<2?o:Mi(o,dn(c,0,-1))}function k$(o,c){for(var p=o.length,v=Ht(c.length,p),E=Tr(o);v--;){var I=c[v];o[v]=Fi(I,p)?E[I]:t}return o}function jv(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var zR=YR(mR),fu=By||function(o,c){return Nt.setTimeout(o,c)},Uv=YR(Xq);function JR(o,c,p){var v=c+"";return Uv(o,w$(v,T$(v$(v),p)))}function YR(o){var c=0,p=0;return function(){var v=np(),E=j-(v-p);if(p=v,E>0){if(++c>=N)return arguments[0]}else c=0;return o.apply(t,arguments)}}function Pp(o,c){var p=-1,v=o.length,E=v-1;for(c=c===t?v:c;++p<c;){var I=xv(p,E),A=o[I];o[I]=o[p],o[p]=A}return o.length=c,o}var GR=C$(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Ac,function(p,v,E,I){c.push(E?I.replace(Pn,"$1"):v||p)}),c});function Dn(o){if(typeof o=="string"||Qr(o))return o;var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function No(o){if(o!=null){try{return Ya.call(o)}catch{}try{return o+""}catch{}}return""}function T$(o,c){return gr(ce,function(p){var v="_."+p[0];c&p[1]&&!Ua(o,v)&&o.push(v)}),o.sort()}function KR(o){if(o instanceof $e)return o.clone();var c=new nr(o.__wrapped__,o.__chain__);return c.__actions__=Tr(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function A$(o,c,p){(p?wr(o,c,p):c===t)?c=1:c=gt(Ce(c),0);var v=o==null?0:o.length;if(!v||c<1)return[];for(var E=0,I=0,A=W(Co(v/c));E<v;)A[I++]=dn(o,E,E+=c);return A}function q$(o){for(var c=-1,p=o==null?0:o.length,v=0,E=[];++c<p;){var I=o[c];I&&(E[v++]=I)}return E}function $$(){var o=arguments.length;if(!o)return[];for(var c=W(o-1),p=arguments[0],v=o;v--;)c[v-1]=arguments[v];return ci(Re(p)?Tr(p):[p],Bt(c,1))}var M$=Te(function(o,c){return qt(o)?Ao(o,Bt(c,1,qt,!0)):[]}),N$=Te(function(o,c){var p=pn(c);return qt(p)&&(p=t),qt(o)?Ao(o,Bt(c,1,qt,!0),ge(p,2)):[]}),D$=Te(function(o,c){var p=pn(c);return qt(p)&&(p=t),qt(o)?Ao(o,Bt(c,1,qt,!0),t,p):[]});function F$(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ce(c),dn(o,c<0?0:c,v)):[]}function L$(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ce(c),c=v-c,dn(o,0,c<0?0:c)):[]}function j$(o,c){return o&&o.length?wp(o,ge(c,3),!0,!0):[]}function U$(o,c){return o&&o.length?wp(o,ge(c,3),!0):[]}function H$(o,c,p,v){var E=o==null?0:o.length;return E?(p&&typeof p!="number"&&wr(o,c,p)&&(p=0,v=E),gv(o,c,p,v)):[]}function QR(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=p==null?0:Ce(p);return E<0&&(E=gt(v+E,0)),Ba(o,ge(c,3),E)}function ZR(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=v-1;return p!==t&&(E=Ce(p),E=p<0?gt(v+E,0):Ht(E,v-1)),Ba(o,ge(c,3),E,!0)}function XR(o){var c=o==null?0:o.length;return c?Bt(o,1):[]}function B$(o){var c=o==null?0:o.length;return c?Bt(o,pe):[]}function V$(o,c){var p=o==null?0:o.length;return p?(c=c===t?1:Ce(c),Bt(o,c)):[]}function W$(o){for(var c=-1,p=o==null?0:o.length,v={};++c<p;){var E=o[c];Yr(v,E[0],E[1])}return v}function eE(o){return o&&o.length?o[0]:t}function z$(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=p==null?0:Ce(p);return E<0&&(E=gt(v+E,0)),ki(o,c,E)}function J$(o){var c=o==null?0:o.length;return c?dn(o,0,-1):[]}var Y$=Te(function(o){var c=lt(o,Iv);return c.length&&c[0]===o[0]?Gr(c):[]}),G$=Te(function(o){var c=pn(o),p=lt(o,Iv);return c===pn(p)?c=t:p.pop(),p.length&&p[0]===o[0]?Gr(p,ge(c,2)):[]}),K$=Te(function(o){var c=pn(o),p=lt(o,Iv);return c=typeof c=="function"?c:t,c&&p.pop(),p.length&&p[0]===o[0]?Gr(p,t,c):[]});function Q$(o,c){return o==null?"":nl.call(o,c)}function pn(o){var c=o==null?0:o.length;return c?o[c-1]:t}function Z$(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=v;return p!==t&&(E=Ce(p),E=E<0?gt(v+E,0):Ht(E,v-1)),c===c?Qc(o,c,E):Ba(o,Ti,E,!0)}function X$(o,c){return o&&o.length?Nn(o,Ce(c)):t}var eM=Te(tE);function tE(o,c){return o&&o.length&&c&&c.length?_v(o,c):o}function tM(o,c,p){return o&&o.length&&c&&c.length?_v(o,c,ge(p,2)):o}function rM(o,c,p){return o&&o.length&&c&&c.length?_v(o,c,t,p):o}var nM=Di(function(o,c){var p=o==null?0:o.length,v=nu(o,c);return hR(o,lt(c,function(E){return Fi(E,p)?+E:E}).sort(RR)),v});function iM(o,c){var p=[];if(!(o&&o.length))return p;var v=-1,E=[],I=o.length;for(c=ge(c,3);++v<I;){var A=o[v];c(A,v,o)&&(p.push(A),E.push(v))}return hR(o,E),p}function Hv(o){return o==null?o:Wy.call(o)}function sM(o,c,p){var v=o==null?0:o.length;return v?(p&&typeof p!="number"&&wr(o,c,p)?(c=0,p=v):(c=c==null?0:Ce(c),p=p===t?v:Ce(p)),dn(o,c,p)):[]}function oM(o,c){return Sp(o,c)}function aM(o,c,p){return Ev(o,c,ge(p,2))}function lM(o,c){var p=o==null?0:o.length;if(p){var v=Sp(o,c);if(v<p&&Fn(o[v],c))return v}return-1}function cM(o,c){return Sp(o,c,!0)}function uM(o,c,p){return Ev(o,c,ge(p,2),!0)}function fM(o,c){var p=o==null?0:o.length;if(p){var v=Sp(o,c,!0)-1;if(Fn(o[v],c))return v}return-1}function dM(o){return o&&o.length?gR(o):[]}function pM(o,c){return o&&o.length?gR(o,ge(c,2)):[]}function hM(o){var c=o==null?0:o.length;return c?dn(o,1,c):[]}function mM(o,c,p){return o&&o.length?(c=p||c===t?1:Ce(c),dn(o,0,c<0?0:c)):[]}function gM(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ce(c),c=v-c,dn(o,c<0?0:c,v)):[]}function yM(o,c){return o&&o.length?wp(o,ge(c,3),!1,!0):[]}function vM(o,c){return o&&o.length?wp(o,ge(c,3)):[]}var bM=Te(function(o){return Cs(Bt(o,1,qt,!0))}),SM=Te(function(o){var c=pn(o);return qt(c)&&(c=t),Cs(Bt(o,1,qt,!0),ge(c,2))}),wM=Te(function(o){var c=pn(o);return c=typeof c=="function"?c:t,Cs(Bt(o,1,qt,!0),t,c)});function _M(o){return o&&o.length?Cs(o):[]}function xM(o,c){return o&&o.length?Cs(o,ge(c,2)):[]}function RM(o,c){return c=typeof c=="function"?c:t,o&&o.length?Cs(o,t,c):[]}function Bv(o){if(!(o&&o.length))return[];var c=0;return o=li(o,function(p){if(qt(p))return c=gt(p.length,c),!0}),Gc(c,function(p){return lt(o,bo(p))})}function rE(o,c){if(!(o&&o.length))return[];var p=Bv(o);return c==null?p:lt(p,function(v){return mr(c,t,v)})}var EM=Te(function(o,c){return qt(o)?Ao(o,c):[]}),CM=Te(function(o){return Ov(li(o,qt))}),OM=Te(function(o){var c=pn(o);return qt(c)&&(c=t),Ov(li(o,qt),ge(c,2))}),IM=Te(function(o){var c=pn(o);return c=typeof c=="function"?c:t,Ov(li(o,qt),t,c)}),PM=Te(Bv);function kM(o,c){return SR(o||[],c||[],Sr)}function TM(o,c){return SR(o||[],c||[],lu)}var AM=Te(function(o){var c=o.length,p=c>1?o[c-1]:t;return p=typeof p=="function"?(o.pop(),p):t,rE(o,p)});function nE(o){var c=O(o);return c.__chain__=!0,c}function qM(o,c){return c(o),o}function kp(o,c){return c(o)}var $M=Di(function(o){var c=o.length,p=c?o[0]:0,v=this.__wrapped__,E=function(I){return nu(I,o)};return c>1||this.__actions__.length||!(v instanceof $e)||!Fi(p)?this.thru(E):(v=v.slice(p,+p+(c?1:0)),v.__actions__.push({func:kp,args:[E],thisArg:t}),new nr(v,this.__chain__).thru(function(I){return c&&!I.length&&I.push(t),I}))});function MM(){return nE(this)}function NM(){return new nr(this.value(),this.__chain__)}function DM(){this.__values__===t&&(this.__values__=yE(this.value()));var o=this.__index__>=this.__values__.length,c=o?t:this.__values__[this.__index__++];return{done:o,value:c}}function FM(){return this}function LM(o){for(var c,p=this;p instanceof ol;){var v=KR(p);v.__index__=0,v.__values__=t,c?E.__wrapped__=v:c=v;var E=v;p=p.__wrapped__}return E.__wrapped__=o,c}function jM(){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:kp,args:[Hv],thisArg:t}),new nr(c,this.__chain__)}return this.thru(Hv)}function UM(){return bR(this.__wrapped__,this.__actions__)}var HM=_p(function(o,c,p){Ze.call(o,p)?++o[p]:Yr(o,p,1)});function BM(o,c,p){var v=Re(o)?Vd:mv;return p&&wr(o,c,p)&&(c=t),v(o,ge(c,3))}function VM(o,c){var p=Re(o)?li:gp;return p(o,ge(c,3))}var WM=kR(QR),zM=kR(ZR);function JM(o,c){return Bt(Tp(o,c),1)}function YM(o,c){return Bt(Tp(o,c),pe)}function GM(o,c,p){return p=p===t?1:Ce(p),Bt(Tp(o,c),p)}function iE(o,c){var p=Re(o)?gr:mi;return p(o,ge(c,3))}function sE(o,c){var p=Re(o)?Wc:mp;return p(o,ge(c,3))}var KM=_p(function(o,c,p){Ze.call(o,p)?o[p].push(c):Yr(o,p,[c])});function QM(o,c,p,v){o=Ar(o)?o:ml(o),p=p&&!v?Ce(p):0;var E=o.length;return p<0&&(p=gt(E+p,0)),Np(o)?p<=E&&o.indexOf(c,p)>-1:!!E&&ki(o,c,p)>-1}var ZM=Te(function(o,c,p){var v=-1,E=typeof c=="function",I=Ar(o)?W(o.length):[];return mi(o,function(A){I[++v]=E?mr(c,A,p):qo(A,c,p)}),I}),XM=_p(function(o,c,p){Yr(o,p,c)});function Tp(o,c){var p=Re(o)?lt:se;return p(o,ge(c,3))}function eN(o,c,p,v){return o==null?[]:(Re(c)||(c=c==null?[]:[c]),p=v?t:p,Re(p)||(p=p==null?[]:[p]),dR(o,c,p))}var tN=_p(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function rN(o,c,p){var v=Re(o)?zc:Va,E=arguments.length<3;return v(o,ge(c,4),p,E,mi)}function nN(o,c,p){var v=Re(o)?yy:Va,E=arguments.length<3;return v(o,ge(c,4),p,E,mp)}function iN(o,c){var p=Re(o)?li:gp;return p(o,$p(ge(c,3)))}function sN(o){var c=Re(o)?dp:Qq;return c(o)}function oN(o,c,p){(p?wr(o,c,p):c===t)?c=1:c=Ce(c);var v=Re(o)?fv:Zq;return v(o,c)}function aN(o){var c=Re(o)?dv:e$;return c(o)}function lN(o){if(o==null)return 0;if(Ar(o))return Np(o)?ui(o):o.length;var c=sr(o);return c==Jt||c==hr?o.size:C(o).length}function cN(o,c,p){var v=Re(o)?Ha:t$;return p&&wr(o,c,p)&&(c=t),v(o,ge(c,3))}var uN=Te(function(o,c){if(o==null)return[];var p=c.length;return p>1&&wr(o,c[0],c[1])?c=[]:p>2&&wr(c[0],c[1],c[2])&&(c=[c[0]]),dR(o,Bt(c,1),[])}),Ap=Hy||function(){return Nt.Date.now()};function fN(o,c){if(typeof c!="function")throw new br(i);return o=Ce(o),function(){if(--o<1)return c.apply(this,arguments)}}function oE(o,c,p){return c=p?t:c,c=o&&c==null?o.length:c,Ni(o,X,t,t,t,t,c)}function aE(o,c){var p;if(typeof c!="function")throw new br(i);return o=Ce(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=t),p}}var Vv=Te(function(o,c,p){var v=x;if(p.length){var E=ln(p,pl(Vv));v|=B}return Ni(o,v,c,p,E)}),lE=Te(function(o,c,p){var v=x|T;if(p.length){var E=ln(p,pl(lE));v|=B}return Ni(c,v,o,p,E)});function cE(o,c,p){c=p?t:c;var v=Ni(o,L,t,t,t,t,t,c);return v.placeholder=cE.placeholder,v}function uE(o,c,p){c=p?t:c;var v=Ni(o,V,t,t,t,t,t,c);return v.placeholder=uE.placeholder,v}function fE(o,c,p){var v,E,I,A,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof o!="function")throw new br(i);c=hn(c)||0,Et(p)&&(Z=!!p.leading,ee="maxWait"in p,I=ee?gt(hn(p.maxWait)||0,c):I,ie="trailing"in p?!!p.trailing:ie);function ue($t){var Ln=v,Ui=E;return v=E=t,Q=$t,A=o.apply(Ui,Ln),A}function ye($t){return Q=$t,D=fu(Le,c),Z?ue($t):A}function Pe($t){var Ln=$t-H,Ui=$t-Q,TE=c-Ln;return ee?Ht(TE,I-Ui):TE}function me($t){var Ln=$t-H,Ui=$t-Q;return H===t||Ln>=c||Ln<0||ee&&Ui>=I}function Le(){var $t=Ap();if(me($t))return He($t);D=fu(Le,Pe($t))}function He($t){return D=t,ie&&v?ue($t):(v=E=t,A)}function Zr(){D!==t&&wR(D),Q=0,v=H=E=D=t}function _r(){return D===t?A:He(Ap())}function Xr(){var $t=Ap(),Ln=me($t);if(v=arguments,E=this,H=$t,Ln){if(D===t)return ye(H);if(ee)return wR(D),D=fu(Le,c),ue(H)}return D===t&&(D=fu(Le,c)),A}return Xr.cancel=Zr,Xr.flush=_r,Xr}var dN=Te(function(o,c){return iu(o,1,c)}),pN=Te(function(o,c,p){return iu(o,hn(c)||0,p)});function hN(o){return Ni(o,_)}function qp(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new br(i);var p=function(){var v=arguments,E=c?c.apply(this,v):v[0],I=p.cache;if(I.has(E))return I.get(E);var A=o.apply(this,v);return p.cache=I.set(E,A)||I,A};return p.cache=new(qp.Cache||qn),p}qp.Cache=qn;function $p(o){if(typeof o!="function")throw new br(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 mN(o){return aE(2,o)}var gN=r$(function(o,c){c=c.length==1&&Re(c[0])?lt(c[0],yr(ge())):lt(Bt(c,1),yr(ge()));var p=c.length;return Te(function(v){for(var E=-1,I=Ht(v.length,p);++E<I;)v[E]=c[E].call(this,v[E]);return mr(o,this,v)})}),Wv=Te(function(o,c){var p=ln(c,pl(Wv));return Ni(o,B,t,c,p)}),dE=Te(function(o,c){var p=ln(c,pl(dE));return Ni(o,K,t,c,p)}),yN=Di(function(o,c){return Ni(o,k,t,t,t,c)});function vN(o,c){if(typeof o!="function")throw new br(i);return c=c===t?c:Ce(c),Te(o,c)}function bN(o,c){if(typeof o!="function")throw new br(i);return c=c==null?0:gt(Ce(c),0),Te(function(p){var v=p[c],E=Is(p,0,c);return v&&ci(E,v),mr(o,this,E)})}function SN(o,c,p){var v=!0,E=!0;if(typeof o!="function")throw new br(i);return Et(p)&&(v="leading"in p?!!p.leading:v,E="trailing"in p?!!p.trailing:E),fE(o,c,{leading:v,maxWait:c,trailing:E})}function wN(o){return oE(o,1)}function _N(o,c){return Wv(Pv(c),o)}function xN(){if(!arguments.length)return[];var o=arguments[0];return Re(o)?o:[o]}function RN(o){return ir(o,y)}function EN(o,c){return c=typeof c=="function"?c:t,ir(o,y,c)}function CN(o){return ir(o,m|y)}function ON(o,c){return c=typeof c=="function"?c:t,ir(o,m|y,c)}function IN(o,c){return c==null||un(o,c,Kt(c))}function Fn(o,c){return o===c||o!==o&&c!==c}var PN=Cp(ou),kN=Cp(function(o,c){return o>=c}),Do=bp((function(){return arguments})())?bp:function(o){return Ot(o)&&Ze.call(o,"callee")&&!Ro.call(o,"callee")},Re=W.isArray,TN=Vc?yr(Vc):Sv;function Ar(o){return o!=null&&Mp(o.length)&&!Li(o)}function qt(o){return Ot(o)&&Ar(o)}function AN(o){return o===!0||o===!1||Ot(o)&&Qt(o)==zr}var Ps=rl||nb,qN=Hd?yr(Hd):wv;function $N(o){return Ot(o)&&o.nodeType===1&&!du(o)}function MN(o){if(o==null)return!0;if(Ar(o)&&(Re(o)||typeof o=="string"||typeof o.splice=="function"||Ps(o)||hl(o)||Do(o)))return!o.length;var c=sr(o);if(c==Jt||c==hr)return!o.size;if(uu(o))return!C(o).length;for(var p in o)if(Ze.call(o,p))return!1;return!0}function NN(o,c){return $o(o,c)}function DN(o,c,p){p=typeof p=="function"?p:t;var v=p?p(o,c):t;return v===t?$o(o,c,t,p):!!v}function zv(o){if(!Ot(o))return!1;var c=Qt(o);return c==mt||c==ht||typeof o.message=="string"&&typeof o.name=="string"&&!du(o)}function FN(o){return typeof o=="number"&&qi(o)}function Li(o){if(!Et(o))return!1;var c=Qt(o);return c==nn||c==oo||c==xt||c==xd}function pE(o){return typeof o=="number"&&o==Ce(o)}function Mp(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Xe}function Et(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function Ot(o){return o!=null&&typeof o=="object"}var hE=Bd?yr(Bd):Rs;function LN(o,c){return o===c||Es(o,c,Nv(c))}function jN(o,c,p){return p=typeof p=="function"?p:t,Es(o,c,Nv(c),p)}function UN(o){return mE(o)&&o!=+o}function HN(o){if(E$(o))throw new be(n);return Fe(o)}function BN(o){return o===null}function VN(o){return o==null}function mE(o){return typeof o=="number"||Ot(o)&&Qt(o)==ao}function du(o){if(!Ot(o)||Qt(o)!=Cn)return!1;var c=Za(o);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Ya.call(p)==Fy}var Jv=vo?yr(vo):u;function WN(o){return pE(o)&&o>=-Xe&&o<=Xe}var gE=kn?yr(kn):h;function Np(o){return typeof o=="string"||!Re(o)&&Ot(o)&&Qt(o)==lo}function Qr(o){return typeof o=="symbol"||Ot(o)&&Qt(o)==Oa}var hl=ja?yr(ja):b;function zN(o){return o===t}function JN(o){return Ot(o)&&sr(o)==Ut}function YN(o){return Ot(o)&&Qt(o)==Ed}var GN=Cp(z),KN=Cp(function(o,c){return o<=c});function yE(o){if(!o)return[];if(Ar(o))return Np(o)?vr(o):Tr(o);if(Eo&&o[Eo])return Iy(o[Eo]());var c=sr(o),p=c==Jt?vs:c==hr?za:ml;return p(o)}function ji(o){if(!o)return o===0?o:0;if(o=hn(o),o===pe||o===-pe){var c=o<0?-1:1;return c*xe}return o===o?o:0}function Ce(o){var c=ji(o),p=c%1;return c===c?p?c-p:c:0}function vE(o){return o?hi(Ce(o),0,Ee):0}function hn(o){if(typeof o=="number")return o;if(Qr(o))return he;if(Et(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=Et(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=Kc(o);var p=po.test(o);return p||Jg.test(o)?my(o.slice(2),p?2:8):zg.test(o)?he:+o}function bE(o){return gi(o,qr(o))}function QN(o){return o?hi(Ce(o),-Xe,Xe):o===0?o:0}function rt(o){return o==null?"":Kr(o)}var ZN=fl(function(o,c){if(uu(c)||Ar(c)){gi(c,Kt(c),o);return}for(var p in c)Ze.call(c,p)&&Sr(o,p,c[p])}),SE=fl(function(o,c){gi(c,qr(c),o)}),wE=fl(function(o,c,p,v){gi(c,qr(c),o,v)}),Yv=fl(function(o,c,p,v){gi(c,Kt(c),o,v)}),XN=Di(nu);function eD(o,c){var p=_s(o);return c==null?p:hp(p,c)}var tD=Te(function(o,c){o=Ue(o);var p=-1,v=c.length,E=v>2?c[2]:t;for(E&&wr(c[0],c[1],E)&&(v=1);++p<v;)for(var I=c[p],A=qr(I),D=-1,H=A.length;++D<H;){var Q=A[D],Z=o[Q];(Z===t||Fn(Z,bs[Q])&&!Ze.call(o,Q))&&(o[Q]=I[Q])}return o}),rD=Te(function(o){return o.push(t,DR),mr(_E,t,o)});function nD(o,c){return Wd(o,ge(c,3),fn)}function iD(o,c){return Wd(o,ge(c,3),$n)}function sD(o,c){return o==null?o:su(o,ge(c,3),qr)}function oD(o,c){return o==null?o:yp(o,ge(c,3),qr)}function aD(o,c){return o&&fn(o,ge(c,3))}function lD(o,c){return o&&$n(o,ge(c,3))}function cD(o){return o==null?[]:ul(o,Kt(o))}function uD(o){return o==null?[]:ul(o,qr(o))}function Gv(o,c,p){var v=o==null?t:Mi(o,c);return v===t?p:v}function fD(o,c){return o!=null&&jR(o,c,yv)}function Kv(o,c){return o!=null&&jR(o,c,vv)}var dD=AR(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Ga.call(c)),o[c]=p},Zv($r)),pD=AR(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Ga.call(c)),Ze.call(o,c)?o[c].push(p):o[c]=[p]},ge),hD=Te(qo);function Kt(o){return Ar(o)?fp(o):C(o)}function qr(o){return Ar(o)?fp(o,!0):M(o)}function mD(o,c){var p={};return c=ge(c,3),fn(o,function(v,E,I){Yr(p,c(v,E,I),v)}),p}function gD(o,c){var p={};return c=ge(c,3),fn(o,function(v,E,I){Yr(p,E,c(v,E,I))}),p}var yD=fl(function(o,c,p){Dt(o,c,p)}),_E=fl(function(o,c,p,v){Dt(o,c,p,v)}),vD=Di(function(o,c){var p={};if(o==null)return p;var v=!1;c=lt(c,function(I){return I=Os(I,o),v||(v=I.length>1),I}),gi(o,$v(o),p),v&&(p=ir(p,m|g|y,p$));for(var E=c.length;E--;)Cv(p,c[E]);return p});function bD(o,c){return xE(o,$p(ge(c)))}var SD=Di(function(o,c){return o==null?{}:Yq(o,c)});function xE(o,c){if(o==null)return{};var p=lt($v(o),function(v){return[v]});return c=ge(c),pR(o,p,function(v,E){return c(v,E[0])})}function wD(o,c,p){c=Os(c,o);var v=-1,E=c.length;for(E||(E=1,o=t);++v<E;){var I=o==null?t:o[Dn(c[v])];I===t&&(v=E,I=p),o=Li(I)?I.call(o):I}return o}function _D(o,c,p){return o==null?o:lu(o,c,p)}function xD(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:lu(o,c,p,v)}var RE=MR(Kt),EE=MR(qr);function RD(o,c,p){var v=Re(o),E=v||Ps(o)||hl(o);if(c=ge(c,4),p==null){var I=o&&o.constructor;E?p=v?new I:[]:Et(o)?p=Li(I)?_s(Za(o)):{}:p={}}return(E?gr:fn)(o,function(A,D,H){return c(p,A,D,H)}),p}function ED(o,c){return o==null?!0:Cv(o,c)}function CD(o,c,p){return o==null?o:vR(o,c,Pv(p))}function OD(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:vR(o,c,Pv(p),v)}function ml(o){return o==null?[]:Wa(o,Kt(o))}function ID(o){return o==null?[]:Wa(o,qr(o))}function PD(o,c,p){return p===t&&(p=c,c=t),p!==t&&(p=hn(p),p=p===p?p:0),c!==t&&(c=hn(c),c=c===c?c:0),hi(hn(o),c,p)}function kD(o,c,p){return c=ji(c),p===t?(p=c,c=0):p=ji(p),o=hn(o),bv(o,c,p)}function TD(o,c,p){if(p&&typeof p!="boolean"&&wr(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=ji(o),c===t?(c=o,o=0):c=ji(c)),o>c){var v=o;o=c,c=v}if(p||o%1||c%1){var E=ip();return Ht(o+E*(c-o+jd("1e-"+((E+"").length-1))),c)}return xv(o,c)}var AD=dl(function(o,c,p){return c=c.toLowerCase(),o+(p?CE(c):c)});function CE(o){return Qv(rt(o).toLowerCase())}function OE(o){return o=rt(o),o&&o.replace(ho,Ry).replace(ly,"")}function qD(o,c,p){o=rt(o),c=Kr(c);var v=o.length;p=p===t?v:hi(Ce(p),0,v);var E=p;return p-=c.length,p>=0&&o.slice(p,E)==c}function $D(o){return o=rt(o),o&&ae.test(o)?o.replace(Ta,Ey):o}function MD(o){return o=rt(o),o&&fo.test(o)?o.replace(Ke,"\\$&"):o}var ND=dl(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),DD=dl(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),FD=PR("toLowerCase");function LD(o,c,p){o=rt(o),c=Ce(c);var v=c?ui(o):0;if(!c||v>=c)return o;var E=(c-v)/2;return Ep(Oo(E),p)+o+Ep(Co(E),p)}function jD(o,c,p){o=rt(o),c=Ce(c);var v=c?ui(o):0;return c&&v<c?o+Ep(c-v,p):o}function UD(o,c,p){o=rt(o),c=Ce(c);var v=c?ui(o):0;return c&&v<c?Ep(c-v,p)+o:o}function HD(o,c,p){return p||c==null?c=0:c&&(c=+c),Vy(rt(o).replace(qc,""),c||0)}function BD(o,c,p){return(p?wr(o,c,p):c===t)?c=1:c=Ce(c),Rv(rt(o),c)}function VD(){var o=arguments,c=rt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var WD=dl(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function zD(o,c,p){return p&&typeof p!="number"&&wr(o,c,p)&&(c=p=t),p=p===t?Ee:p>>>0,p?(o=rt(o),o&&(typeof c=="string"||c!=null&&!Jv(c))&&(c=Kr(c),!c&&ys(o))?Is(vr(o),0,p):o.split(c,p)):[]}var JD=dl(function(o,c,p){return o+(p?" ":"")+Qv(c)});function YD(o,c,p){return o=rt(o),p=p==null?0:hi(Ce(p),0,o.length),c=Kr(c),o.slice(p,p+c.length)==c}function GD(o,c,p){var v=O.templateSettings;p&&wr(o,c,p)&&(c=t),o=rt(o),c=Yv({},c,v,NR);var E=Yv({},c.imports,v.imports,NR),I=Kt(E),A=Wa(E,I);gr(I,function(me){if(Pr.test(me))throw new be(a)});var D,H,Q=0,Z=c.interpolate||mo,ee="__p += '",ie=Ja((c.escape||mo).source+"|"+Z.source+"|"+(Z===sn?Ii:mo).source+"|"+(c.evaluate||mo).source+"|$","g"),ue="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++py+"]")+`
|
|
4
|
-
`;o.replace(ie,function(me,Le,He,Zr,_r,Xr){return He||(He=Zr),ee+=o.slice(Q,Xr).replace(
|
|
3
|
+
`)}function R$(o){return Re(o)||Do(o)||!!(ip&&o&&o[ip])}function Fi(o,c){var p=typeof o;return c=c??Xe,!!c&&(p=="number"||p!="symbol"&&ds.test(o))&&o>-1&&o%1==0&&o<c}function wr(o,c,p){if(!Et(p))return!1;var v=typeof c;return(v=="number"?Ar(p)&&Fi(c,p.length):v=="string"&&c in p)?Fn(p[c],o):!1}function jv(o,c){if(Re(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Qr(o)?!0:qe.test(o)||!Ir.test(o)||c!=null&&o in Ue(c)}function E$(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Uv(o){var c=kp(o),p=O[c];if(typeof p!="function"||!(c in $e.prototype))return!1;if(o===p)return!0;var v=Dv(p);return!!v&&o===v[0]}function C$(o){return!!tp&&tp in o}var O$=xo?Li:sb;function du(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||bs;return o===p}function HR(o){return o===o&&!Et(o)}function BR(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==t||o in Ue(p))}}function I$(o){var c=Np(o,function(v){return p.size===f&&p.clear(),v}),p=c.cache;return c}function P$(o,c){var p=o[1],v=c[1],E=p|v,I=E<(x|T|X),A=v==X&&p==L||v==X&&p==k&&o[7].length<=c[8]||v==(X|k)&&c[7].length<=c[8]&&p==L;if(!(I||A))return o;v&x&&(o[2]=c[2],E|=p&x?0:q);var D=c[3];if(D){var H=o[3];o[3]=H?ER(H,D,c[4]):D,o[4]=H?ln(o[3],d):c[4]}return D=c[5],D&&(H=o[5],o[5]=H?CR(H,D,c[6]):D,o[6]=H?ln(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]=E,o}function k$(o){var c=[];if(o!=null)for(var p in Ue(o))c.push(p);return c}function T$(o){return Ga.call(o)}function VR(o,c,p){return c=gt(c===t?o.length-1:c,0),function(){for(var v=arguments,E=-1,I=gt(v.length-c,0),A=W(I);++E<I;)A[E]=v[c+E];E=-1;for(var D=W(c+1);++E<c;)D[E]=v[E];return D[c]=p(A),mr(o,this,D)}}function WR(o,c){return c.length<2?o:Mi(o,dn(c,0,-1))}function A$(o,c){for(var p=o.length,v=Ht(c.length,p),E=Tr(o);v--;){var I=c[v];o[v]=Fi(I,p)?E[I]:t}return o}function Hv(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var zR=YR(mR),pu=Wy||function(o,c){return Nt.setTimeout(o,c)},Bv=YR(t$);function JR(o,c,p){var v=c+"";return Bv(o,x$(v,q$(S$(v),p)))}function YR(o){var c=0,p=0;return function(){var v=op(),E=j-(v-p);if(p=v,E>0){if(++c>=N)return arguments[0]}else c=0;return o.apply(t,arguments)}}function Ap(o,c){var p=-1,v=o.length,E=v-1;for(c=c===t?v:c;++p<c;){var I=Ev(p,E),A=o[I];o[I]=o[p],o[p]=A}return o.length=c,o}var GR=I$(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace($c,function(p,v,E,I){c.push(E?I.replace(Pn,"$1"):v||p)}),c});function Dn(o){if(typeof o=="string"||Qr(o))return o;var c=o+"";return c=="0"&&1/o==-pe?"-0":c}function No(o){if(o!=null){try{return Ya.call(o)}catch{}try{return o+""}catch{}}return""}function q$(o,c){return gr(ce,function(p){var v="_."+p[0];c&p[1]&&!Ua(o,v)&&o.push(v)}),o.sort()}function KR(o){if(o instanceof $e)return o.clone();var c=new nr(o.__wrapped__,o.__chain__);return c.__actions__=Tr(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function $$(o,c,p){(p?wr(o,c,p):c===t)?c=1:c=gt(Ce(c),0);var v=o==null?0:o.length;if(!v||c<1)return[];for(var E=0,I=0,A=W(Co(v/c));E<v;)A[I++]=dn(o,E,E+=c);return A}function M$(o){for(var c=-1,p=o==null?0:o.length,v=0,E=[];++c<p;){var I=o[c];I&&(E[v++]=I)}return E}function N$(){var o=arguments.length;if(!o)return[];for(var c=W(o-1),p=arguments[0],v=o;v--;)c[v-1]=arguments[v];return ci(Re(p)?Tr(p):[p],Bt(c,1))}var D$=Te(function(o,c){return qt(o)?Ao(o,Bt(c,1,qt,!0)):[]}),F$=Te(function(o,c){var p=pn(c);return qt(p)&&(p=t),qt(o)?Ao(o,Bt(c,1,qt,!0),ge(p,2)):[]}),L$=Te(function(o,c){var p=pn(c);return qt(p)&&(p=t),qt(o)?Ao(o,Bt(c,1,qt,!0),t,p):[]});function j$(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ce(c),dn(o,c<0?0:c,v)):[]}function U$(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ce(c),c=v-c,dn(o,0,c<0?0:c)):[]}function H$(o,c){return o&&o.length?Rp(o,ge(c,3),!0,!0):[]}function B$(o,c){return o&&o.length?Rp(o,ge(c,3),!0):[]}function V$(o,c,p,v){var E=o==null?0:o.length;return E?(p&&typeof p!="number"&&wr(o,c,p)&&(p=0,v=E),vv(o,c,p,v)):[]}function QR(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=p==null?0:Ce(p);return E<0&&(E=gt(v+E,0)),Ba(o,ge(c,3),E)}function ZR(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=v-1;return p!==t&&(E=Ce(p),E=p<0?gt(v+E,0):Ht(E,v-1)),Ba(o,ge(c,3),E,!0)}function XR(o){var c=o==null?0:o.length;return c?Bt(o,1):[]}function W$(o){var c=o==null?0:o.length;return c?Bt(o,pe):[]}function z$(o,c){var p=o==null?0:o.length;return p?(c=c===t?1:Ce(c),Bt(o,c)):[]}function J$(o){for(var c=-1,p=o==null?0:o.length,v={};++c<p;){var E=o[c];Yr(v,E[0],E[1])}return v}function eE(o){return o&&o.length?o[0]:t}function Y$(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=p==null?0:Ce(p);return E<0&&(E=gt(v+E,0)),ki(o,c,E)}function G$(o){var c=o==null?0:o.length;return c?dn(o,0,-1):[]}var K$=Te(function(o){var c=lt(o,kv);return c.length&&c[0]===o[0]?Gr(c):[]}),Q$=Te(function(o){var c=pn(o),p=lt(o,kv);return c===pn(p)?c=t:p.pop(),p.length&&p[0]===o[0]?Gr(p,ge(c,2)):[]}),Z$=Te(function(o){var c=pn(o),p=lt(o,kv);return c=typeof c=="function"?c:t,c&&p.pop(),p.length&&p[0]===o[0]?Gr(p,t,c):[]});function X$(o,c){return o==null?"":nl.call(o,c)}function pn(o){var c=o==null?0:o.length;return c?o[c-1]:t}function eM(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var E=v;return p!==t&&(E=Ce(p),E=E<0?gt(v+E,0):Ht(E,v-1)),c===c?Xc(o,c,E):Ba(o,Ti,E,!0)}function tM(o,c){return o&&o.length?Nn(o,Ce(c)):t}var rM=Te(tE);function tE(o,c){return o&&o.length&&c&&c.length?Rv(o,c):o}function nM(o,c,p){return o&&o.length&&c&&c.length?Rv(o,c,ge(p,2)):o}function iM(o,c,p){return o&&o.length&&c&&c.length?Rv(o,c,t,p):o}var sM=Di(function(o,c){var p=o==null?0:o.length,v=su(o,c);return hR(o,lt(c,function(E){return Fi(E,p)?+E:E}).sort(RR)),v});function oM(o,c){var p=[];if(!(o&&o.length))return p;var v=-1,E=[],I=o.length;for(c=ge(c,3);++v<I;){var A=o[v];c(A,v,o)&&(p.push(A),E.push(v))}return hR(o,E),p}function Vv(o){return o==null?o:Jy.call(o)}function aM(o,c,p){var v=o==null?0:o.length;return v?(p&&typeof p!="number"&&wr(o,c,p)?(c=0,p=v):(c=c==null?0:Ce(c),p=p===t?v:Ce(p)),dn(o,c,p)):[]}function lM(o,c){return xp(o,c)}function cM(o,c,p){return Ov(o,c,ge(p,2))}function uM(o,c){var p=o==null?0:o.length;if(p){var v=xp(o,c);if(v<p&&Fn(o[v],c))return v}return-1}function fM(o,c){return xp(o,c,!0)}function dM(o,c,p){return Ov(o,c,ge(p,2),!0)}function pM(o,c){var p=o==null?0:o.length;if(p){var v=xp(o,c,!0)-1;if(Fn(o[v],c))return v}return-1}function hM(o){return o&&o.length?gR(o):[]}function mM(o,c){return o&&o.length?gR(o,ge(c,2)):[]}function gM(o){var c=o==null?0:o.length;return c?dn(o,1,c):[]}function yM(o,c,p){return o&&o.length?(c=p||c===t?1:Ce(c),dn(o,0,c<0?0:c)):[]}function vM(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ce(c),c=v-c,dn(o,c<0?0:c,v)):[]}function bM(o,c){return o&&o.length?Rp(o,ge(c,3),!1,!0):[]}function SM(o,c){return o&&o.length?Rp(o,ge(c,3)):[]}var wM=Te(function(o){return Cs(Bt(o,1,qt,!0))}),_M=Te(function(o){var c=pn(o);return qt(c)&&(c=t),Cs(Bt(o,1,qt,!0),ge(c,2))}),xM=Te(function(o){var c=pn(o);return c=typeof c=="function"?c:t,Cs(Bt(o,1,qt,!0),t,c)});function RM(o){return o&&o.length?Cs(o):[]}function EM(o,c){return o&&o.length?Cs(o,ge(c,2)):[]}function CM(o,c){return c=typeof c=="function"?c:t,o&&o.length?Cs(o,t,c):[]}function Wv(o){if(!(o&&o.length))return[];var c=0;return o=li(o,function(p){if(qt(p))return c=gt(p.length,c),!0}),Qc(c,function(p){return lt(o,bo(p))})}function rE(o,c){if(!(o&&o.length))return[];var p=Wv(o);return c==null?p:lt(p,function(v){return mr(c,t,v)})}var OM=Te(function(o,c){return qt(o)?Ao(o,c):[]}),IM=Te(function(o){return Pv(li(o,qt))}),PM=Te(function(o){var c=pn(o);return qt(c)&&(c=t),Pv(li(o,qt),ge(c,2))}),kM=Te(function(o){var c=pn(o);return c=typeof c=="function"?c:t,Pv(li(o,qt),t,c)}),TM=Te(Wv);function AM(o,c){return SR(o||[],c||[],Sr)}function qM(o,c){return SR(o||[],c||[],uu)}var $M=Te(function(o){var c=o.length,p=c>1?o[c-1]:t;return p=typeof p=="function"?(o.pop(),p):t,rE(o,p)});function nE(o){var c=O(o);return c.__chain__=!0,c}function MM(o,c){return c(o),o}function qp(o,c){return c(o)}var NM=Di(function(o){var c=o.length,p=c?o[0]:0,v=this.__wrapped__,E=function(I){return su(I,o)};return c>1||this.__actions__.length||!(v instanceof $e)||!Fi(p)?this.thru(E):(v=v.slice(p,+p+(c?1:0)),v.__actions__.push({func:qp,args:[E],thisArg:t}),new nr(v,this.__chain__).thru(function(I){return c&&!I.length&&I.push(t),I}))});function DM(){return nE(this)}function FM(){return new nr(this.value(),this.__chain__)}function LM(){this.__values__===t&&(this.__values__=yE(this.value()));var o=this.__index__>=this.__values__.length,c=o?t:this.__values__[this.__index__++];return{done:o,value:c}}function jM(){return this}function UM(o){for(var c,p=this;p instanceof ol;){var v=KR(p);v.__index__=0,v.__values__=t,c?E.__wrapped__=v:c=v;var E=v;p=p.__wrapped__}return E.__wrapped__=o,c}function HM(){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:qp,args:[Vv],thisArg:t}),new nr(c,this.__chain__)}return this.thru(Vv)}function BM(){return bR(this.__wrapped__,this.__actions__)}var VM=Ep(function(o,c,p){Ze.call(o,p)?++o[p]:Yr(o,p,1)});function WM(o,c,p){var v=Re(o)?Jd:yv;return p&&wr(o,c,p)&&(c=t),v(o,ge(c,3))}function zM(o,c){var p=Re(o)?li:bp;return p(o,ge(c,3))}var JM=kR(QR),YM=kR(ZR);function GM(o,c){return Bt($p(o,c),1)}function KM(o,c){return Bt($p(o,c),pe)}function QM(o,c,p){return p=p===t?1:Ce(p),Bt($p(o,c),p)}function iE(o,c){var p=Re(o)?gr:mi;return p(o,ge(c,3))}function sE(o,c){var p=Re(o)?Jc:vp;return p(o,ge(c,3))}var ZM=Ep(function(o,c,p){Ze.call(o,p)?o[p].push(c):Yr(o,p,[c])});function XM(o,c,p,v){o=Ar(o)?o:ml(o),p=p&&!v?Ce(p):0;var E=o.length;return p<0&&(p=gt(E+p,0)),Lp(o)?p<=E&&o.indexOf(c,p)>-1:!!E&&ki(o,c,p)>-1}var eN=Te(function(o,c,p){var v=-1,E=typeof c=="function",I=Ar(o)?W(o.length):[];return mi(o,function(A){I[++v]=E?mr(c,A,p):qo(A,c,p)}),I}),tN=Ep(function(o,c,p){Yr(o,p,c)});function $p(o,c){var p=Re(o)?lt:se;return p(o,ge(c,3))}function rN(o,c,p,v){return o==null?[]:(Re(c)||(c=c==null?[]:[c]),p=v?t:p,Re(p)||(p=p==null?[]:[p]),dR(o,c,p))}var nN=Ep(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function iN(o,c,p){var v=Re(o)?Yc:Va,E=arguments.length<3;return v(o,ge(c,4),p,E,mi)}function sN(o,c,p){var v=Re(o)?by:Va,E=arguments.length<3;return v(o,ge(c,4),p,E,vp)}function oN(o,c){var p=Re(o)?li:bp;return p(o,Dp(ge(c,3)))}function aN(o){var c=Re(o)?mp:Xq;return c(o)}function lN(o,c,p){(p?wr(o,c,p):c===t)?c=1:c=Ce(c);var v=Re(o)?pv:e$;return v(o,c)}function cN(o){var c=Re(o)?hv:r$;return c(o)}function uN(o){if(o==null)return 0;if(Ar(o))return Lp(o)?ui(o):o.length;var c=sr(o);return c==Jt||c==hr?o.size:C(o).length}function fN(o,c,p){var v=Re(o)?Ha:n$;return p&&wr(o,c,p)&&(c=t),v(o,ge(c,3))}var dN=Te(function(o,c){if(o==null)return[];var p=c.length;return p>1&&wr(o,c[0],c[1])?c=[]:p>2&&wr(c[0],c[1],c[2])&&(c=[c[0]]),dR(o,Bt(c,1),[])}),Mp=Vy||function(){return Nt.Date.now()};function pN(o,c){if(typeof c!="function")throw new br(i);return o=Ce(o),function(){if(--o<1)return c.apply(this,arguments)}}function oE(o,c,p){return c=p?t:c,c=o&&c==null?o.length:c,Ni(o,X,t,t,t,t,c)}function aE(o,c){var p;if(typeof c!="function")throw new br(i);return o=Ce(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=t),p}}var zv=Te(function(o,c,p){var v=x;if(p.length){var E=ln(p,pl(zv));v|=B}return Ni(o,v,c,p,E)}),lE=Te(function(o,c,p){var v=x|T;if(p.length){var E=ln(p,pl(lE));v|=B}return Ni(c,v,o,p,E)});function cE(o,c,p){c=p?t:c;var v=Ni(o,L,t,t,t,t,t,c);return v.placeholder=cE.placeholder,v}function uE(o,c,p){c=p?t:c;var v=Ni(o,V,t,t,t,t,t,c);return v.placeholder=uE.placeholder,v}function fE(o,c,p){var v,E,I,A,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof o!="function")throw new br(i);c=hn(c)||0,Et(p)&&(Z=!!p.leading,ee="maxWait"in p,I=ee?gt(hn(p.maxWait)||0,c):I,ie="trailing"in p?!!p.trailing:ie);function ue($t){var Ln=v,Ui=E;return v=E=t,Q=$t,A=o.apply(Ui,Ln),A}function ye($t){return Q=$t,D=pu(Le,c),Z?ue($t):A}function Pe($t){var Ln=$t-H,Ui=$t-Q,TE=c-Ln;return ee?Ht(TE,I-Ui):TE}function me($t){var Ln=$t-H,Ui=$t-Q;return H===t||Ln>=c||Ln<0||ee&&Ui>=I}function Le(){var $t=Mp();if(me($t))return He($t);D=pu(Le,Pe($t))}function He($t){return D=t,ie&&v?ue($t):(v=E=t,A)}function Zr(){D!==t&&wR(D),Q=0,v=H=E=D=t}function _r(){return D===t?A:He(Mp())}function Xr(){var $t=Mp(),Ln=me($t);if(v=arguments,E=this,H=$t,Ln){if(D===t)return ye(H);if(ee)return wR(D),D=pu(Le,c),ue(H)}return D===t&&(D=pu(Le,c)),A}return Xr.cancel=Zr,Xr.flush=_r,Xr}var hN=Te(function(o,c){return ou(o,1,c)}),mN=Te(function(o,c,p){return ou(o,hn(c)||0,p)});function gN(o){return Ni(o,_)}function Np(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new br(i);var p=function(){var v=arguments,E=c?c.apply(this,v):v[0],I=p.cache;if(I.has(E))return I.get(E);var A=o.apply(this,v);return p.cache=I.set(E,A)||I,A};return p.cache=new(Np.Cache||qn),p}Np.Cache=qn;function Dp(o){if(typeof o!="function")throw new br(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 yN(o){return aE(2,o)}var vN=i$(function(o,c){c=c.length==1&&Re(c[0])?lt(c[0],yr(ge())):lt(Bt(c,1),yr(ge()));var p=c.length;return Te(function(v){for(var E=-1,I=Ht(v.length,p);++E<I;)v[E]=c[E].call(this,v[E]);return mr(o,this,v)})}),Jv=Te(function(o,c){var p=ln(c,pl(Jv));return Ni(o,B,t,c,p)}),dE=Te(function(o,c){var p=ln(c,pl(dE));return Ni(o,K,t,c,p)}),bN=Di(function(o,c){return Ni(o,k,t,t,t,c)});function SN(o,c){if(typeof o!="function")throw new br(i);return c=c===t?c:Ce(c),Te(o,c)}function wN(o,c){if(typeof o!="function")throw new br(i);return c=c==null?0:gt(Ce(c),0),Te(function(p){var v=p[c],E=Is(p,0,c);return v&&ci(E,v),mr(o,this,E)})}function _N(o,c,p){var v=!0,E=!0;if(typeof o!="function")throw new br(i);return Et(p)&&(v="leading"in p?!!p.leading:v,E="trailing"in p?!!p.trailing:E),fE(o,c,{leading:v,maxWait:c,trailing:E})}function xN(o){return oE(o,1)}function RN(o,c){return Jv(Tv(c),o)}function EN(){if(!arguments.length)return[];var o=arguments[0];return Re(o)?o:[o]}function CN(o){return ir(o,y)}function ON(o,c){return c=typeof c=="function"?c:t,ir(o,y,c)}function IN(o){return ir(o,m|y)}function PN(o,c){return c=typeof c=="function"?c:t,ir(o,m|y,c)}function kN(o,c){return c==null||un(o,c,Kt(c))}function Fn(o,c){return o===c||o!==o&&c!==c}var TN=Pp(lu),AN=Pp(function(o,c){return o>=c}),Do=_p((function(){return arguments})())?_p:function(o){return Ot(o)&&Ze.call(o,"callee")&&!Ro.call(o,"callee")},Re=W.isArray,qN=zc?yr(zc):_v;function Ar(o){return o!=null&&Fp(o.length)&&!Li(o)}function qt(o){return Ot(o)&&Ar(o)}function $N(o){return o===!0||o===!1||Ot(o)&&Qt(o)==zr}var Ps=rl||sb,MN=Wd?yr(Wd):xv;function NN(o){return Ot(o)&&o.nodeType===1&&!hu(o)}function DN(o){if(o==null)return!0;if(Ar(o)&&(Re(o)||typeof o=="string"||typeof o.splice=="function"||Ps(o)||hl(o)||Do(o)))return!o.length;var c=sr(o);if(c==Jt||c==hr)return!o.size;if(du(o))return!C(o).length;for(var p in o)if(Ze.call(o,p))return!1;return!0}function FN(o,c){return $o(o,c)}function LN(o,c,p){p=typeof p=="function"?p:t;var v=p?p(o,c):t;return v===t?$o(o,c,t,p):!!v}function Yv(o){if(!Ot(o))return!1;var c=Qt(o);return c==mt||c==ht||typeof o.message=="string"&&typeof o.name=="string"&&!hu(o)}function jN(o){return typeof o=="number"&&qi(o)}function Li(o){if(!Et(o))return!1;var c=Qt(o);return c==nn||c==oo||c==xt||c==Cd}function pE(o){return typeof o=="number"&&o==Ce(o)}function Fp(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Xe}function Et(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function Ot(o){return o!=null&&typeof o=="object"}var hE=zd?yr(zd):Rs;function UN(o,c){return o===c||Es(o,c,Fv(c))}function HN(o,c,p){return p=typeof p=="function"?p:t,Es(o,c,Fv(c),p)}function BN(o){return mE(o)&&o!=+o}function VN(o){if(O$(o))throw new be(n);return Fe(o)}function WN(o){return o===null}function zN(o){return o==null}function mE(o){return typeof o=="number"||Ot(o)&&Qt(o)==ao}function hu(o){if(!Ot(o)||Qt(o)!=Cn)return!1;var c=Za(o);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Ya.call(p)==jy}var Gv=vo?yr(vo):u;function JN(o){return pE(o)&&o>=-Xe&&o<=Xe}var gE=kn?yr(kn):h;function Lp(o){return typeof o=="string"||!Re(o)&&Ot(o)&&Qt(o)==lo}function Qr(o){return typeof o=="symbol"||Ot(o)&&Qt(o)==Oa}var hl=ja?yr(ja):b;function YN(o){return o===t}function GN(o){return Ot(o)&&sr(o)==Ut}function KN(o){return Ot(o)&&Qt(o)==Id}var QN=Pp(z),ZN=Pp(function(o,c){return o<=c});function yE(o){if(!o)return[];if(Ar(o))return Lp(o)?vr(o):Tr(o);if(Eo&&o[Eo])return ky(o[Eo]());var c=sr(o),p=c==Jt?vs:c==hr?za:ml;return p(o)}function ji(o){if(!o)return o===0?o:0;if(o=hn(o),o===pe||o===-pe){var c=o<0?-1:1;return c*xe}return o===o?o:0}function Ce(o){var c=ji(o),p=c%1;return c===c?p?c-p:c:0}function vE(o){return o?hi(Ce(o),0,Ee):0}function hn(o){if(typeof o=="number")return o;if(Qr(o))return he;if(Et(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=Et(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=Zc(o);var p=po.test(o);return p||Gg.test(o)?yy(o.slice(2),p?2:8):Yg.test(o)?he:+o}function bE(o){return gi(o,qr(o))}function XN(o){return o?hi(Ce(o),-Xe,Xe):o===0?o:0}function rt(o){return o==null?"":Kr(o)}var eD=fl(function(o,c){if(du(c)||Ar(c)){gi(c,Kt(c),o);return}for(var p in c)Ze.call(c,p)&&Sr(o,p,c[p])}),SE=fl(function(o,c){gi(c,qr(c),o)}),wE=fl(function(o,c,p,v){gi(c,qr(c),o,v)}),Kv=fl(function(o,c,p,v){gi(c,Kt(c),o,v)}),tD=Di(su);function rD(o,c){var p=_s(o);return c==null?p:yp(p,c)}var nD=Te(function(o,c){o=Ue(o);var p=-1,v=c.length,E=v>2?c[2]:t;for(E&&wr(c[0],c[1],E)&&(v=1);++p<v;)for(var I=c[p],A=qr(I),D=-1,H=A.length;++D<H;){var Q=A[D],Z=o[Q];(Z===t||Fn(Z,bs[Q])&&!Ze.call(o,Q))&&(o[Q]=I[Q])}return o}),iD=Te(function(o){return o.push(t,DR),mr(_E,t,o)});function sD(o,c){return Yd(o,ge(c,3),fn)}function oD(o,c){return Yd(o,ge(c,3),$n)}function aD(o,c){return o==null?o:au(o,ge(c,3),qr)}function lD(o,c){return o==null?o:Sp(o,ge(c,3),qr)}function cD(o,c){return o&&fn(o,ge(c,3))}function uD(o,c){return o&&$n(o,ge(c,3))}function fD(o){return o==null?[]:ul(o,Kt(o))}function dD(o){return o==null?[]:ul(o,qr(o))}function Qv(o,c,p){var v=o==null?t:Mi(o,c);return v===t?p:v}function pD(o,c){return o!=null&&jR(o,c,bv)}function Zv(o,c){return o!=null&&jR(o,c,Sv)}var hD=AR(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Ga.call(c)),o[c]=p},eb($r)),mD=AR(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Ga.call(c)),Ze.call(o,c)?o[c].push(p):o[c]=[p]},ge),gD=Te(qo);function Kt(o){return Ar(o)?hp(o):C(o)}function qr(o){return Ar(o)?hp(o,!0):M(o)}function yD(o,c){var p={};return c=ge(c,3),fn(o,function(v,E,I){Yr(p,c(v,E,I),v)}),p}function vD(o,c){var p={};return c=ge(c,3),fn(o,function(v,E,I){Yr(p,E,c(v,E,I))}),p}var bD=fl(function(o,c,p){Dt(o,c,p)}),_E=fl(function(o,c,p,v){Dt(o,c,p,v)}),SD=Di(function(o,c){var p={};if(o==null)return p;var v=!1;c=lt(c,function(I){return I=Os(I,o),v||(v=I.length>1),I}),gi(o,Nv(o),p),v&&(p=ir(p,m|g|y,m$));for(var E=c.length;E--;)Iv(p,c[E]);return p});function wD(o,c){return xE(o,Dp(ge(c)))}var _D=Di(function(o,c){return o==null?{}:Kq(o,c)});function xE(o,c){if(o==null)return{};var p=lt(Nv(o),function(v){return[v]});return c=ge(c),pR(o,p,function(v,E){return c(v,E[0])})}function xD(o,c,p){c=Os(c,o);var v=-1,E=c.length;for(E||(E=1,o=t);++v<E;){var I=o==null?t:o[Dn(c[v])];I===t&&(v=E,I=p),o=Li(I)?I.call(o):I}return o}function RD(o,c,p){return o==null?o:uu(o,c,p)}function ED(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:uu(o,c,p,v)}var RE=MR(Kt),EE=MR(qr);function CD(o,c,p){var v=Re(o),E=v||Ps(o)||hl(o);if(c=ge(c,4),p==null){var I=o&&o.constructor;E?p=v?new I:[]:Et(o)?p=Li(I)?_s(Za(o)):{}:p={}}return(E?gr:fn)(o,function(A,D,H){return c(p,A,D,H)}),p}function OD(o,c){return o==null?!0:Iv(o,c)}function ID(o,c,p){return o==null?o:vR(o,c,Tv(p))}function PD(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:vR(o,c,Tv(p),v)}function ml(o){return o==null?[]:Wa(o,Kt(o))}function kD(o){return o==null?[]:Wa(o,qr(o))}function TD(o,c,p){return p===t&&(p=c,c=t),p!==t&&(p=hn(p),p=p===p?p:0),c!==t&&(c=hn(c),c=c===c?c:0),hi(hn(o),c,p)}function AD(o,c,p){return c=ji(c),p===t?(p=c,c=0):p=ji(p),o=hn(o),wv(o,c,p)}function qD(o,c,p){if(p&&typeof p!="boolean"&&wr(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=ji(o),c===t?(c=o,o=0):c=ji(c)),o>c){var v=o;o=c,c=v}if(p||o%1||c%1){var E=ap();return Ht(o+E*(c-o+Bd("1e-"+((E+"").length-1))),c)}return Ev(o,c)}var $D=dl(function(o,c,p){return c=c.toLowerCase(),o+(p?CE(c):c)});function CE(o){return Xv(rt(o).toLowerCase())}function OE(o){return o=rt(o),o&&o.replace(ho,Cy).replace(uy,"")}function MD(o,c,p){o=rt(o),c=Kr(c);var v=o.length;p=p===t?v:hi(Ce(p),0,v);var E=p;return p-=c.length,p>=0&&o.slice(p,E)==c}function ND(o){return o=rt(o),o&&ae.test(o)?o.replace(Ta,Oy):o}function DD(o){return o=rt(o),o&&fo.test(o)?o.replace(Ke,"\\$&"):o}var FD=dl(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),LD=dl(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),jD=PR("toLowerCase");function UD(o,c,p){o=rt(o),c=Ce(c);var v=c?ui(o):0;if(!c||v>=c)return o;var E=(c-v)/2;return Ip(Oo(E),p)+o+Ip(Co(E),p)}function HD(o,c,p){o=rt(o),c=Ce(c);var v=c?ui(o):0;return c&&v<c?o+Ip(c-v,p):o}function BD(o,c,p){o=rt(o),c=Ce(c);var v=c?ui(o):0;return c&&v<c?Ip(c-v,p)+o:o}function VD(o,c,p){return p||c==null?c=0:c&&(c=+c),zy(rt(o).replace(Mc,""),c||0)}function WD(o,c,p){return(p?wr(o,c,p):c===t)?c=1:c=Ce(c),Cv(rt(o),c)}function zD(){var o=arguments,c=rt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var JD=dl(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function YD(o,c,p){return p&&typeof p!="number"&&wr(o,c,p)&&(c=p=t),p=p===t?Ee:p>>>0,p?(o=rt(o),o&&(typeof c=="string"||c!=null&&!Gv(c))&&(c=Kr(c),!c&&ys(o))?Is(vr(o),0,p):o.split(c,p)):[]}var GD=dl(function(o,c,p){return o+(p?" ":"")+Xv(c)});function KD(o,c,p){return o=rt(o),p=p==null?0:hi(Ce(p),0,o.length),c=Kr(c),o.slice(p,p+c.length)==c}function QD(o,c,p){var v=O.templateSettings;p&&wr(o,c,p)&&(c=t),o=rt(o),c=Kv({},c,v,NR);var E=Kv({},c.imports,v.imports,NR),I=Kt(E),A=Wa(E,I);gr(I,function(me){if(Pr.test(me))throw new be(a)});var D,H,Q=0,Z=c.interpolate||mo,ee="__p += '",ie=Ja((c.escape||mo).source+"|"+Z.source+"|"+(Z===sn?Ii:mo).source+"|"+(c.evaluate||mo).source+"|$","g"),ue="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++my+"]")+`
|
|
4
|
+
`;o.replace(ie,function(me,Le,He,Zr,_r,Xr){return He||(He=Zr),ee+=o.slice(Q,Xr).replace(Kg,Iy),Le&&(D=!0,ee+=`' +
|
|
5
5
|
__e(`+Le+`) +
|
|
6
6
|
'`),_r&&(H=!0,ee+=`';
|
|
7
7
|
`+_r+`;
|
|
@@ -11,40 +11,40 @@ __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(Pr.test(ye))throw new be(s);ee=(H?ee.replace(ka,""):ee).replace(
|
|
14
|
+
`;else if(Pr.test(ye))throw new be(s);ee=(H?ee.replace(ka,""):ee).replace(Wg,"$1").replace(uo,"$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 Pe=PE(function(){return Ye(I,ue+"return "+ee).apply(t,A)});if(Pe.source=ee,zv(Pe))throw Pe;return Pe}function KD(o){return rt(o).toLowerCase()}function QD(o){return rt(o).toUpperCase()}function ZD(o,c,p){if(o=rt(o),o&&(p||c===t))return Kc(o);if(!o||!(c=Kr(c)))return o;var v=vr(o),E=vr(c),I=Jd(v,E),A=Yd(v,E)+1;return Is(v,I,A).join("")}function XD(o,c,p){if(o=rt(o),o&&(p||c===t))return o.slice(0,Qd(o)+1);if(!o||!(c=Kr(c)))return o;var v=vr(o),E=Yd(v,vr(c))+1;return Is(v,0,E).join("")}function eF(o,c,p){if(o=rt(o),o&&(p||c===t))return o.replace(qc,"");if(!o||!(c=Kr(c)))return o;var v=vr(o),E=Jd(v,vr(c));return Is(v,E).join("")}function tF(o,c){var p=P,v=$;if(Et(c)){var E="separator"in c?c.separator:E;p="length"in c?Ce(c.length):p,v="omission"in c?Kr(c.omission):v}o=rt(o);var I=o.length;if(ys(o)){var A=vr(o);I=A.length}if(p>=I)return o;var D=p-ui(v);if(D<1)return v;var H=A?Is(A,0,D).join(""):o.slice(0,D);if(E===t)return H+v;if(A&&(D+=H.length-D),Jv(E)){if(o.slice(D).search(E)){var Q,Z=H;for(E.global||(E=Ja(E.source,rt(Cd.exec(E))+"g")),E.lastIndex=0;Q=E.exec(Z);)var ee=Q.index;H=H.slice(0,ee===t?D:ee)}}else if(o.indexOf(Kr(E),D)!=D){var ie=H.lastIndexOf(E);ie>-1&&(H=H.slice(0,ie))}return H+v}function rF(o){return o=rt(o),o&&Aa.test(o)?o.replace(Oi,ky):o}var nF=dl(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Qv=PR("toUpperCase");function IE(o,c,p){return o=rt(o),c=p?t:c,c===t?Oy(o)?qy(o):Sy(o):o.match(c)||[]}var PE=Te(function(o,c){try{return mr(o,t,c)}catch(p){return zv(p)?p:new be(p)}}),iF=Di(function(o,c){return gr(c,function(p){p=Dn(p),Yr(o,p,Vv(o[p],o))}),o});function sF(o){var c=o==null?0:o.length,p=ge();return o=c?lt(o,function(v){if(typeof v[1]!="function")throw new br(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var E=-1;++E<c;){var I=o[E];if(mr(I[0],this,v))return mr(I[1],this,v)}})}function oF(o){return hv(ir(o,m))}function Zv(o){return function(){return o}}function aF(o,c){return o==null||o!==o?c:o}var lF=TR(),cF=TR(!0);function $r(o){return o}function Xv(o){return S(typeof o=="function"?o:ir(o,m))}function uF(o){return ve(ir(o,m))}function fF(o,c){return Me(o,ir(c,m))}var dF=Te(function(o,c){return function(p){return qo(p,o,c)}}),pF=Te(function(o,c){return function(p){return qo(o,p,c)}});function eb(o,c,p){var v=Kt(c),E=ul(c,v);p==null&&!(Et(c)&&(E.length||!v.length))&&(p=c,c=o,o=this,E=ul(c,Kt(c)));var I=!(Et(p)&&"chain"in p)||!!p.chain,A=Li(o);return gr(E,function(D){var H=c[D];o[D]=H,A&&(o.prototype[D]=function(){var Q=this.__chain__;if(I||Q){var Z=o(this.__wrapped__),ee=Z.__actions__=Tr(this.__actions__);return ee.push({func:H,args:arguments,thisArg:o}),Z.__chain__=Q,Z}return H.apply(o,ci([this.value()],arguments))})}),o}function hF(){return Nt._===this&&(Nt._=Ly),this}function tb(){}function mF(o){return o=Ce(o),Te(function(c){return Nn(c,o)})}var gF=Tv(lt),yF=Tv(Vd),vF=Tv(Ha);function kE(o){return Fv(o)?bo(Dn(o)):Gq(o)}function bF(o){return function(c){return o==null?t:Mi(o,c)}}var SF=qR(),wF=qR(!0);function rb(){return[]}function nb(){return!1}function _F(){return{}}function xF(){return""}function RF(){return!0}function EF(o,c){if(o=Ce(o),o<1||o>Xe)return[];var p=Ee,v=Ht(o,Ee);c=ge(c),o-=Ee;for(var E=Gc(v,c);++p<o;)c(p);return E}function CF(o){return Re(o)?lt(o,Dn):Qr(o)?[o]:Tr(GR(rt(o)))}function OF(o){var c=++Dy;return rt(o)+c}var IF=Rp(function(o,c){return o+c},0),PF=Av("ceil"),kF=Rp(function(o,c){return o/c},1),TF=Av("floor");function AF(o){return o&&o.length?cl(o,$r,ou):t}function qF(o,c){return o&&o.length?cl(o,ge(c,2),ou):t}function $F(o){return zd(o,$r)}function MF(o,c){return zd(o,ge(c,2))}function NF(o){return o&&o.length?cl(o,$r,z):t}function DF(o,c){return o&&o.length?cl(o,ge(c,2),z):t}var FF=Rp(function(o,c){return o*c},1),LF=Av("round"),jF=Rp(function(o,c){return o-c},0);function UF(o){return o&&o.length?Yc(o,$r):0}function HF(o,c){return o&&o.length?Yc(o,ge(c,2)):0}return O.after=fN,O.ary=oE,O.assign=ZN,O.assignIn=SE,O.assignInWith=wE,O.assignWith=Yv,O.at=XN,O.before=aE,O.bind=Vv,O.bindAll=iF,O.bindKey=lE,O.castArray=xN,O.chain=nE,O.chunk=A$,O.compact=q$,O.concat=$$,O.cond=sF,O.conforms=oF,O.constant=Zv,O.countBy=HM,O.create=eD,O.curry=cE,O.curryRight=uE,O.debounce=fE,O.defaults=tD,O.defaultsDeep=rD,O.defer=dN,O.delay=pN,O.difference=M$,O.differenceBy=N$,O.differenceWith=D$,O.drop=F$,O.dropRight=L$,O.dropRightWhile=j$,O.dropWhile=U$,O.fill=H$,O.filter=VM,O.flatMap=JM,O.flatMapDeep=YM,O.flatMapDepth=GM,O.flatten=XR,O.flattenDeep=B$,O.flattenDepth=V$,O.flip=hN,O.flow=lF,O.flowRight=cF,O.fromPairs=W$,O.functions=cD,O.functionsIn=uD,O.groupBy=KM,O.initial=J$,O.intersection=Y$,O.intersectionBy=G$,O.intersectionWith=K$,O.invert=dD,O.invertBy=pD,O.invokeMap=ZM,O.iteratee=Xv,O.keyBy=XM,O.keys=Kt,O.keysIn=qr,O.map=Tp,O.mapKeys=mD,O.mapValues=gD,O.matches=uF,O.matchesProperty=fF,O.memoize=qp,O.merge=yD,O.mergeWith=_E,O.method=dF,O.methodOf=pF,O.mixin=eb,O.negate=$p,O.nthArg=mF,O.omit=vD,O.omitBy=bD,O.once=mN,O.orderBy=eN,O.over=gF,O.overArgs=gN,O.overEvery=yF,O.overSome=vF,O.partial=Wv,O.partialRight=dE,O.partition=tN,O.pick=SD,O.pickBy=xE,O.property=kE,O.propertyOf=bF,O.pull=eM,O.pullAll=tE,O.pullAllBy=tM,O.pullAllWith=rM,O.pullAt=nM,O.range=SF,O.rangeRight=wF,O.rearg=yN,O.reject=iN,O.remove=iM,O.rest=vN,O.reverse=Hv,O.sampleSize=oN,O.set=_D,O.setWith=xD,O.shuffle=aN,O.slice=sM,O.sortBy=uN,O.sortedUniq=dM,O.sortedUniqBy=pM,O.split=zD,O.spread=bN,O.tail=hM,O.take=mM,O.takeRight=gM,O.takeRightWhile=yM,O.takeWhile=vM,O.tap=qM,O.throttle=SN,O.thru=kp,O.toArray=yE,O.toPairs=RE,O.toPairsIn=EE,O.toPath=CF,O.toPlainObject=bE,O.transform=RD,O.unary=wN,O.union=bM,O.unionBy=SM,O.unionWith=wM,O.uniq=_M,O.uniqBy=xM,O.uniqWith=RM,O.unset=ED,O.unzip=Bv,O.unzipWith=rE,O.update=CD,O.updateWith=OD,O.values=ml,O.valuesIn=ID,O.without=EM,O.words=IE,O.wrap=_N,O.xor=CM,O.xorBy=OM,O.xorWith=IM,O.zip=PM,O.zipObject=kM,O.zipObjectDeep=TM,O.zipWith=AM,O.entries=RE,O.entriesIn=EE,O.extend=SE,O.extendWith=wE,eb(O,O),O.add=IF,O.attempt=PE,O.camelCase=AD,O.capitalize=CE,O.ceil=PF,O.clamp=PD,O.clone=RN,O.cloneDeep=CN,O.cloneDeepWith=ON,O.cloneWith=EN,O.conformsTo=IN,O.deburr=OE,O.defaultTo=aF,O.divide=kF,O.endsWith=qD,O.eq=Fn,O.escape=$D,O.escapeRegExp=MD,O.every=BM,O.find=WM,O.findIndex=QR,O.findKey=nD,O.findLast=zM,O.findLastIndex=ZR,O.findLastKey=iD,O.floor=TF,O.forEach=iE,O.forEachRight=sE,O.forIn=sD,O.forInRight=oD,O.forOwn=aD,O.forOwnRight=lD,O.get=Gv,O.gt=PN,O.gte=kN,O.has=fD,O.hasIn=Kv,O.head=eE,O.identity=$r,O.includes=QM,O.indexOf=z$,O.inRange=kD,O.invoke=hD,O.isArguments=Do,O.isArray=Re,O.isArrayBuffer=TN,O.isArrayLike=Ar,O.isArrayLikeObject=qt,O.isBoolean=AN,O.isBuffer=Ps,O.isDate=qN,O.isElement=$N,O.isEmpty=MN,O.isEqual=NN,O.isEqualWith=DN,O.isError=zv,O.isFinite=FN,O.isFunction=Li,O.isInteger=pE,O.isLength=Mp,O.isMap=hE,O.isMatch=LN,O.isMatchWith=jN,O.isNaN=UN,O.isNative=HN,O.isNil=VN,O.isNull=BN,O.isNumber=mE,O.isObject=Et,O.isObjectLike=Ot,O.isPlainObject=du,O.isRegExp=Jv,O.isSafeInteger=WN,O.isSet=gE,O.isString=Np,O.isSymbol=Qr,O.isTypedArray=hl,O.isUndefined=zN,O.isWeakMap=JN,O.isWeakSet=YN,O.join=Q$,O.kebabCase=ND,O.last=pn,O.lastIndexOf=Z$,O.lowerCase=DD,O.lowerFirst=FD,O.lt=GN,O.lte=KN,O.max=AF,O.maxBy=qF,O.mean=$F,O.meanBy=MF,O.min=NF,O.minBy=DF,O.stubArray=rb,O.stubFalse=nb,O.stubObject=_F,O.stubString=xF,O.stubTrue=RF,O.multiply=FF,O.nth=X$,O.noConflict=hF,O.noop=tb,O.now=Ap,O.pad=LD,O.padEnd=jD,O.padStart=UD,O.parseInt=HD,O.random=TD,O.reduce=rN,O.reduceRight=nN,O.repeat=BD,O.replace=VD,O.result=wD,O.round=LF,O.runInContext=U,O.sample=sN,O.size=lN,O.snakeCase=WD,O.some=cN,O.sortedIndex=oM,O.sortedIndexBy=aM,O.sortedIndexOf=lM,O.sortedLastIndex=cM,O.sortedLastIndexBy=uM,O.sortedLastIndexOf=fM,O.startCase=JD,O.startsWith=YD,O.subtract=jF,O.sum=UF,O.sumBy=HF,O.template=GD,O.times=EF,O.toFinite=ji,O.toInteger=Ce,O.toLength=vE,O.toLower=KD,O.toNumber=hn,O.toSafeInteger=QN,O.toString=rt,O.toUpper=QD,O.trim=ZD,O.trimEnd=XD,O.trimStart=eF,O.truncate=tF,O.unescape=rF,O.uniqueId=OF,O.upperCase=nF,O.upperFirst=Qv,O.each=iE,O.eachRight=sE,O.first=eE,eb(O,(function(){var o={};return fn(O,function(c,p){Ze.call(O.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),O.VERSION=e,gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),gr(["drop","take"],function(o,c){$e.prototype[o]=function(p){p=p===t?1:gt(Ce(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,Ee),type:o+(v.__dir__<0?"Right":"")}),v},$e.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),gr(["filter","map","takeWhile"],function(o,c){var p=c+1,v=p==Y||p==ne;$e.prototype[o]=function(E){var I=this.clone();return I.__iteratees__.push({iteratee:ge(E,3),type:p}),I.__filtered__=I.__filtered__||v,I}}),gr(["head","last"],function(o,c){var p="take"+(c?"Right":"");$e.prototype[o]=function(){return this[p](1).value()[0]}}),gr(["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($r)},$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 qo(p,o,c)})}),$e.prototype.reject=function(o){return this.filter($p(ge(o)))},$e.prototype.slice=function(o,c){o=Ce(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=Ce(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(Ee)},fn($e.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),v=/^(?:head|last)$/.test(c),E=O[v?"take"+(c=="last"?"Right":""):c],I=v||/^find/.test(c);E&&(O.prototype[c]=function(){var A=this.__wrapped__,D=v?[1]:arguments,H=A instanceof $e,Q=D[0],Z=H||Re(A),ee=function(Le){var He=E.apply(O,ci([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,Pe=H&&!ue;if(!I&&Z){A=Pe?A:new $e(this);var me=o.apply(A,D);return me.__actions__.push({func:kp,args:[ee],thisArg:t}),new nr(me,ie)}return ye&&Pe?o.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),gr(["pop","push","shift","sort","splice","unshift"],function(o){var c=_o[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var E=arguments;if(v&&!this.__chain__){var I=this.value();return c.apply(Re(I)?I:[],E)}return this[p](function(A){return c.apply(Re(A)?A:[],E)})}}),fn($e.prototype,function(o,c){var p=O[c];if(p){var v=p.name+"";Ze.call(ws,v)||(ws[v]=[]),ws[v].push({name:c,func:p})}}),ws[xp(t,T).name]=[{name:"wrapper",func:t}],$e.prototype.clone=Qy,$e.prototype.reverse=Zy,$e.prototype.value=eu,O.prototype.at=$M,O.prototype.chain=MM,O.prototype.commit=NM,O.prototype.next=DM,O.prototype.plant=LM,O.prototype.reverse=jM,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=UM,O.prototype.first=O.prototype.head,Eo&&(O.prototype[Eo]=FM),O}),fi=$y();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=fi,define(function(){return fi})):Qe?((Qe.exports=fi)._=fi,La._=fi):Nt._=fi}).call(_l)});var QE=F((vb,xl)=>{(function(t,e){typeof vb=="object"&&typeof xl<"u"?xl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(vb,(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=[],S,C=u.length;for(S=0;S<C;++S)b.push(h(u[S],S));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,S){return Wa(u,h,b,S,!0).utc()}function w(){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 R(u){return u._pf==null&&(u._pf=w()),u._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(u){var h=Object(this),b=h.length>>>0,S;for(S=0;S<b;S++)if(S in h&&u.call(this,h[S],S,h))return!0;return!1};function T(u){var h=null,b=!1,S=u._d&&!isNaN(u._d.getTime());if(S&&(h=R(u),b=x.call(h.parsedDateParts,function(C){return C!=null}),S=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&&(S=S&&h.charsLeftOver===0&&h.unusedTokens.length===0&&h.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(u))u._isValid=S;else return S;return u._isValid}function q(u){var h=y(NaN);return u!=null?g(R(h),u):R(h).userInvalidated=!0,h}var L=e.momentProperties=[],V=!1;function B(u,h){var b,S,C,M=L.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=R(h)),l(h._locale)||(u._locale=h._locale),M>0)for(b=0;b<M;b++)S=L[b],C=h[S],l(C)||(u[S]=C);return u}function K(u){B(this,u),this._d=new Date(u._d!=null?u._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),V===!1&&(V=!0,e.updateOffset(this),V=!1)}function X(u){return u instanceof K||u!=null&&u._isAMomentObject!=null}function k(u){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+u)}function _(u,h){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,u),b){var S=[],C,M,z,se=arguments.length;for(M=0;M<se;M++){if(C="",typeof arguments[M]=="object"){C+=`
|
|
20
|
+
}`;var Pe=PE(function(){return Ye(I,ue+"return "+ee).apply(t,A)});if(Pe.source=ee,Yv(Pe))throw Pe;return Pe}function ZD(o){return rt(o).toLowerCase()}function XD(o){return rt(o).toUpperCase()}function eF(o,c,p){if(o=rt(o),o&&(p||c===t))return Zc(o);if(!o||!(c=Kr(c)))return o;var v=vr(o),E=vr(c),I=Kd(v,E),A=Qd(v,E)+1;return Is(v,I,A).join("")}function tF(o,c,p){if(o=rt(o),o&&(p||c===t))return o.slice(0,ep(o)+1);if(!o||!(c=Kr(c)))return o;var v=vr(o),E=Qd(v,vr(c))+1;return Is(v,0,E).join("")}function rF(o,c,p){if(o=rt(o),o&&(p||c===t))return o.replace(Mc,"");if(!o||!(c=Kr(c)))return o;var v=vr(o),E=Kd(v,vr(c));return Is(v,E).join("")}function nF(o,c){var p=P,v=$;if(Et(c)){var E="separator"in c?c.separator:E;p="length"in c?Ce(c.length):p,v="omission"in c?Kr(c.omission):v}o=rt(o);var I=o.length;if(ys(o)){var A=vr(o);I=A.length}if(p>=I)return o;var D=p-ui(v);if(D<1)return v;var H=A?Is(A,0,D).join(""):o.slice(0,D);if(E===t)return H+v;if(A&&(D+=H.length-D),Gv(E)){if(o.slice(D).search(E)){var Q,Z=H;for(E.global||(E=Ja(E.source,rt(Pd.exec(E))+"g")),E.lastIndex=0;Q=E.exec(Z);)var ee=Q.index;H=H.slice(0,ee===t?D:ee)}}else if(o.indexOf(Kr(E),D)!=D){var ie=H.lastIndexOf(E);ie>-1&&(H=H.slice(0,ie))}return H+v}function iF(o){return o=rt(o),o&&Aa.test(o)?o.replace(Oi,Ay):o}var sF=dl(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Xv=PR("toUpperCase");function IE(o,c,p){return o=rt(o),c=p?t:c,c===t?Py(o)?My(o):_y(o):o.match(c)||[]}var PE=Te(function(o,c){try{return mr(o,t,c)}catch(p){return Yv(p)?p:new be(p)}}),oF=Di(function(o,c){return gr(c,function(p){p=Dn(p),Yr(o,p,zv(o[p],o))}),o});function aF(o){var c=o==null?0:o.length,p=ge();return o=c?lt(o,function(v){if(typeof v[1]!="function")throw new br(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var E=-1;++E<c;){var I=o[E];if(mr(I[0],this,v))return mr(I[1],this,v)}})}function lF(o){return gv(ir(o,m))}function eb(o){return function(){return o}}function cF(o,c){return o==null||o!==o?c:o}var uF=TR(),fF=TR(!0);function $r(o){return o}function tb(o){return S(typeof o=="function"?o:ir(o,m))}function dF(o){return ve(ir(o,m))}function pF(o,c){return Me(o,ir(c,m))}var hF=Te(function(o,c){return function(p){return qo(p,o,c)}}),mF=Te(function(o,c){return function(p){return qo(o,p,c)}});function rb(o,c,p){var v=Kt(c),E=ul(c,v);p==null&&!(Et(c)&&(E.length||!v.length))&&(p=c,c=o,o=this,E=ul(c,Kt(c)));var I=!(Et(p)&&"chain"in p)||!!p.chain,A=Li(o);return gr(E,function(D){var H=c[D];o[D]=H,A&&(o.prototype[D]=function(){var Q=this.__chain__;if(I||Q){var Z=o(this.__wrapped__),ee=Z.__actions__=Tr(this.__actions__);return ee.push({func:H,args:arguments,thisArg:o}),Z.__chain__=Q,Z}return H.apply(o,ci([this.value()],arguments))})}),o}function gF(){return Nt._===this&&(Nt._=Uy),this}function nb(){}function yF(o){return o=Ce(o),Te(function(c){return Nn(c,o)})}var vF=qv(lt),bF=qv(Jd),SF=qv(Ha);function kE(o){return jv(o)?bo(Dn(o)):Qq(o)}function wF(o){return function(c){return o==null?t:Mi(o,c)}}var _F=qR(),xF=qR(!0);function ib(){return[]}function sb(){return!1}function RF(){return{}}function EF(){return""}function CF(){return!0}function OF(o,c){if(o=Ce(o),o<1||o>Xe)return[];var p=Ee,v=Ht(o,Ee);c=ge(c),o-=Ee;for(var E=Qc(v,c);++p<o;)c(p);return E}function IF(o){return Re(o)?lt(o,Dn):Qr(o)?[o]:Tr(GR(rt(o)))}function PF(o){var c=++Ly;return rt(o)+c}var kF=Op(function(o,c){return o+c},0),TF=$v("ceil"),AF=Op(function(o,c){return o/c},1),qF=$v("floor");function $F(o){return o&&o.length?cl(o,$r,lu):t}function MF(o,c){return o&&o.length?cl(o,ge(c,2),lu):t}function NF(o){return Gd(o,$r)}function DF(o,c){return Gd(o,ge(c,2))}function FF(o){return o&&o.length?cl(o,$r,z):t}function LF(o,c){return o&&o.length?cl(o,ge(c,2),z):t}var jF=Op(function(o,c){return o*c},1),UF=$v("round"),HF=Op(function(o,c){return o-c},0);function BF(o){return o&&o.length?Kc(o,$r):0}function VF(o,c){return o&&o.length?Kc(o,ge(c,2)):0}return O.after=pN,O.ary=oE,O.assign=eD,O.assignIn=SE,O.assignInWith=wE,O.assignWith=Kv,O.at=tD,O.before=aE,O.bind=zv,O.bindAll=oF,O.bindKey=lE,O.castArray=EN,O.chain=nE,O.chunk=$$,O.compact=M$,O.concat=N$,O.cond=aF,O.conforms=lF,O.constant=eb,O.countBy=VM,O.create=rD,O.curry=cE,O.curryRight=uE,O.debounce=fE,O.defaults=nD,O.defaultsDeep=iD,O.defer=hN,O.delay=mN,O.difference=D$,O.differenceBy=F$,O.differenceWith=L$,O.drop=j$,O.dropRight=U$,O.dropRightWhile=H$,O.dropWhile=B$,O.fill=V$,O.filter=zM,O.flatMap=GM,O.flatMapDeep=KM,O.flatMapDepth=QM,O.flatten=XR,O.flattenDeep=W$,O.flattenDepth=z$,O.flip=gN,O.flow=uF,O.flowRight=fF,O.fromPairs=J$,O.functions=fD,O.functionsIn=dD,O.groupBy=ZM,O.initial=G$,O.intersection=K$,O.intersectionBy=Q$,O.intersectionWith=Z$,O.invert=hD,O.invertBy=mD,O.invokeMap=eN,O.iteratee=tb,O.keyBy=tN,O.keys=Kt,O.keysIn=qr,O.map=$p,O.mapKeys=yD,O.mapValues=vD,O.matches=dF,O.matchesProperty=pF,O.memoize=Np,O.merge=bD,O.mergeWith=_E,O.method=hF,O.methodOf=mF,O.mixin=rb,O.negate=Dp,O.nthArg=yF,O.omit=SD,O.omitBy=wD,O.once=yN,O.orderBy=rN,O.over=vF,O.overArgs=vN,O.overEvery=bF,O.overSome=SF,O.partial=Jv,O.partialRight=dE,O.partition=nN,O.pick=_D,O.pickBy=xE,O.property=kE,O.propertyOf=wF,O.pull=rM,O.pullAll=tE,O.pullAllBy=nM,O.pullAllWith=iM,O.pullAt=sM,O.range=_F,O.rangeRight=xF,O.rearg=bN,O.reject=oN,O.remove=oM,O.rest=SN,O.reverse=Vv,O.sampleSize=lN,O.set=RD,O.setWith=ED,O.shuffle=cN,O.slice=aM,O.sortBy=dN,O.sortedUniq=hM,O.sortedUniqBy=mM,O.split=YD,O.spread=wN,O.tail=gM,O.take=yM,O.takeRight=vM,O.takeRightWhile=bM,O.takeWhile=SM,O.tap=MM,O.throttle=_N,O.thru=qp,O.toArray=yE,O.toPairs=RE,O.toPairsIn=EE,O.toPath=IF,O.toPlainObject=bE,O.transform=CD,O.unary=xN,O.union=wM,O.unionBy=_M,O.unionWith=xM,O.uniq=RM,O.uniqBy=EM,O.uniqWith=CM,O.unset=OD,O.unzip=Wv,O.unzipWith=rE,O.update=ID,O.updateWith=PD,O.values=ml,O.valuesIn=kD,O.without=OM,O.words=IE,O.wrap=RN,O.xor=IM,O.xorBy=PM,O.xorWith=kM,O.zip=TM,O.zipObject=AM,O.zipObjectDeep=qM,O.zipWith=$M,O.entries=RE,O.entriesIn=EE,O.extend=SE,O.extendWith=wE,rb(O,O),O.add=kF,O.attempt=PE,O.camelCase=$D,O.capitalize=CE,O.ceil=TF,O.clamp=TD,O.clone=CN,O.cloneDeep=IN,O.cloneDeepWith=PN,O.cloneWith=ON,O.conformsTo=kN,O.deburr=OE,O.defaultTo=cF,O.divide=AF,O.endsWith=MD,O.eq=Fn,O.escape=ND,O.escapeRegExp=DD,O.every=WM,O.find=JM,O.findIndex=QR,O.findKey=sD,O.findLast=YM,O.findLastIndex=ZR,O.findLastKey=oD,O.floor=qF,O.forEach=iE,O.forEachRight=sE,O.forIn=aD,O.forInRight=lD,O.forOwn=cD,O.forOwnRight=uD,O.get=Qv,O.gt=TN,O.gte=AN,O.has=pD,O.hasIn=Zv,O.head=eE,O.identity=$r,O.includes=XM,O.indexOf=Y$,O.inRange=AD,O.invoke=gD,O.isArguments=Do,O.isArray=Re,O.isArrayBuffer=qN,O.isArrayLike=Ar,O.isArrayLikeObject=qt,O.isBoolean=$N,O.isBuffer=Ps,O.isDate=MN,O.isElement=NN,O.isEmpty=DN,O.isEqual=FN,O.isEqualWith=LN,O.isError=Yv,O.isFinite=jN,O.isFunction=Li,O.isInteger=pE,O.isLength=Fp,O.isMap=hE,O.isMatch=UN,O.isMatchWith=HN,O.isNaN=BN,O.isNative=VN,O.isNil=zN,O.isNull=WN,O.isNumber=mE,O.isObject=Et,O.isObjectLike=Ot,O.isPlainObject=hu,O.isRegExp=Gv,O.isSafeInteger=JN,O.isSet=gE,O.isString=Lp,O.isSymbol=Qr,O.isTypedArray=hl,O.isUndefined=YN,O.isWeakMap=GN,O.isWeakSet=KN,O.join=X$,O.kebabCase=FD,O.last=pn,O.lastIndexOf=eM,O.lowerCase=LD,O.lowerFirst=jD,O.lt=QN,O.lte=ZN,O.max=$F,O.maxBy=MF,O.mean=NF,O.meanBy=DF,O.min=FF,O.minBy=LF,O.stubArray=ib,O.stubFalse=sb,O.stubObject=RF,O.stubString=EF,O.stubTrue=CF,O.multiply=jF,O.nth=tM,O.noConflict=gF,O.noop=nb,O.now=Mp,O.pad=UD,O.padEnd=HD,O.padStart=BD,O.parseInt=VD,O.random=qD,O.reduce=iN,O.reduceRight=sN,O.repeat=WD,O.replace=zD,O.result=xD,O.round=UF,O.runInContext=U,O.sample=aN,O.size=uN,O.snakeCase=JD,O.some=fN,O.sortedIndex=lM,O.sortedIndexBy=cM,O.sortedIndexOf=uM,O.sortedLastIndex=fM,O.sortedLastIndexBy=dM,O.sortedLastIndexOf=pM,O.startCase=GD,O.startsWith=KD,O.subtract=HF,O.sum=BF,O.sumBy=VF,O.template=QD,O.times=OF,O.toFinite=ji,O.toInteger=Ce,O.toLength=vE,O.toLower=ZD,O.toNumber=hn,O.toSafeInteger=XN,O.toString=rt,O.toUpper=XD,O.trim=eF,O.trimEnd=tF,O.trimStart=rF,O.truncate=nF,O.unescape=iF,O.uniqueId=PF,O.upperCase=sF,O.upperFirst=Xv,O.each=iE,O.eachRight=sE,O.first=eE,rb(O,(function(){var o={};return fn(O,function(c,p){Ze.call(O.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),O.VERSION=e,gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),gr(["drop","take"],function(o,c){$e.prototype[o]=function(p){p=p===t?1:gt(Ce(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,Ee),type:o+(v.__dir__<0?"Right":"")}),v},$e.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),gr(["filter","map","takeWhile"],function(o,c){var p=c+1,v=p==Y||p==ne;$e.prototype[o]=function(E){var I=this.clone();return I.__iteratees__.push({iteratee:ge(E,3),type:p}),I.__filtered__=I.__filtered__||v,I}}),gr(["head","last"],function(o,c){var p="take"+(c?"Right":"");$e.prototype[o]=function(){return this[p](1).value()[0]}}),gr(["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($r)},$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 qo(p,o,c)})}),$e.prototype.reject=function(o){return this.filter(Dp(ge(o)))},$e.prototype.slice=function(o,c){o=Ce(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=Ce(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(Ee)},fn($e.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),v=/^(?:head|last)$/.test(c),E=O[v?"take"+(c=="last"?"Right":""):c],I=v||/^find/.test(c);E&&(O.prototype[c]=function(){var A=this.__wrapped__,D=v?[1]:arguments,H=A instanceof $e,Q=D[0],Z=H||Re(A),ee=function(Le){var He=E.apply(O,ci([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,Pe=H&&!ue;if(!I&&Z){A=Pe?A:new $e(this);var me=o.apply(A,D);return me.__actions__.push({func:qp,args:[ee],thisArg:t}),new nr(me,ie)}return ye&&Pe?o.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),gr(["pop","push","shift","sort","splice","unshift"],function(o){var c=_o[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var E=arguments;if(v&&!this.__chain__){var I=this.value();return c.apply(Re(I)?I:[],E)}return this[p](function(A){return c.apply(Re(A)?A:[],E)})}}),fn($e.prototype,function(o,c){var p=O[c];if(p){var v=p.name+"";Ze.call(ws,v)||(ws[v]=[]),ws[v].push({name:c,func:p})}}),ws[Cp(t,T).name]=[{name:"wrapper",func:t}],$e.prototype.clone=Xy,$e.prototype.reverse=ev,$e.prototype.value=ru,O.prototype.at=NM,O.prototype.chain=DM,O.prototype.commit=FM,O.prototype.next=LM,O.prototype.plant=UM,O.prototype.reverse=HM,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=BM,O.prototype.first=O.prototype.head,Eo&&(O.prototype[Eo]=jM),O}),fi=Ny();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=fi,define(function(){return fi})):Qe?((Qe.exports=fi)._=fi,La._=fi):Nt._=fi}).call(_l)});var QE=F((Sb,xl)=>{(function(t,e){typeof Sb=="object"&&typeof xl<"u"?xl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(Sb,(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=[],S,C=u.length;for(S=0;S<C;++S)b.push(h(u[S],S));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,S){return Wa(u,h,b,S,!0).utc()}function w(){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 R(u){return u._pf==null&&(u._pf=w()),u._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(u){var h=Object(this),b=h.length>>>0,S;for(S=0;S<b;S++)if(S in h&&u.call(this,h[S],S,h))return!0;return!1};function T(u){var h=null,b=!1,S=u._d&&!isNaN(u._d.getTime());if(S&&(h=R(u),b=x.call(h.parsedDateParts,function(C){return C!=null}),S=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&&(S=S&&h.charsLeftOver===0&&h.unusedTokens.length===0&&h.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(u))u._isValid=S;else return S;return u._isValid}function q(u){var h=y(NaN);return u!=null?g(R(h),u):R(h).userInvalidated=!0,h}var L=e.momentProperties=[],V=!1;function B(u,h){var b,S,C,M=L.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=R(h)),l(h._locale)||(u._locale=h._locale),M>0)for(b=0;b<M;b++)S=L[b],C=h[S],l(C)||(u[S]=C);return u}function K(u){B(this,u),this._d=new Date(u._d!=null?u._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),V===!1&&(V=!0,e.updateOffset(this),V=!1)}function X(u){return u instanceof K||u!=null&&u._isAMomentObject!=null}function k(u){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+u)}function _(u,h){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,u),b){var S=[],C,M,z,se=arguments.length;for(M=0;M<se;M++){if(C="",typeof arguments[M]=="object"){C+=`
|
|
21
21
|
[`+M+"] ";for(z in arguments[0])s(arguments[0],z)&&(C+=z+": "+arguments[0][z]+", ");C=C.slice(0,-2)}else C=arguments[M];S.push(C)}k(u+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(S).join("")+`
|
|
23
|
-
`+new Error().stack),b=!1}return h.apply(this,arguments)},h)}var P={};function $(u,h){e.deprecationHandler!=null&&e.deprecationHandler(u,h),P[u]||(k(h),P[u]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function N(u){return typeof Function<"u"&&u instanceof Function||Object.prototype.toString.call(u)==="[object Function]"}function j(u){var h,b;for(b in u)s(u,b)&&(h=u[b],N(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 Y(u,h){var b=g({},u),S;for(S in h)s(h,S)&&(i(u[S])&&i(h[S])?(b[S]={},g(b[S],u[S]),g(b[S],h[S])):h[S]!=null?b[S]=h[S]:delete b[S]);for(S in u)s(u,S)&&!s(h,S)&&i(u[S])&&(b[S]=g({},b[S]));return b}function J(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 Xe(u,h,b){var S=this._calendar[u]||this._calendar.sameElse;return N(S)?S.call(h,b):S}function xe(u,h,b){var S=""+Math.abs(u),C=h-S.length,M=u>=0;return(M?b?"+":"":"-")+Math.pow(10,Math.max(0,C)).toString().substr(1)+S}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,Ee=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vt={},Ct={};function ce(u,h,b,S){var C=S;typeof S=="string"&&(C=function(){return this[S]()}),u&&(Ct[u]=C),h&&(Ct[h[0]]=function(){return xe(C.apply(this,arguments),h[1],h[2])}),b&&(Ct[b]=function(){return this.localeData().ordinal(C.apply(this,arguments),u)})}function pr(u){return u.match(/\[[\s\S]/)?u.replace(/^\[|\]$/g,""):u.replace(/\\/g,"")}function oi(u){var h=u.match(he),b,S;for(b=0,S=h.length;b<S;b++)Ct[h[b]]?h[b]=Ct[h[b]]:h[b]=pr(h[b]);return function(C){var M="",z;for(z=0;z<S;z++)M+=N(h[z])?h[z].call(C,u):h[z];return M}}function xt(u,h){return u.isValid()?(h=zr(h,u.localeData()),vt[h]=vt[h]||oi(h),vt[h](u)):u.localeData().invalidDate()}function zr(u,h){var b=5;function S(C){return h.longDateFormat(C)||C}for(Ee.lastIndex=0;b>=0&&Ee.test(u);)u=u.replace(Ee,S),Ee.lastIndex=0,b-=1;return u}var Or={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(S){return S==="MMMM"||S==="MM"||S==="DD"||S==="dddd"?S.slice(1):S}).join(""),this._longDateFormat[u])}var mt="Invalid date";function nn(){return this._invalidDate}var oo="%d",Jt=/\d{1,2}/;function ao(u){return this._ordinal.replace("%d",u)}var Hg={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 Cn(u,h,b,S){var C=this._relativeTime[b];return N(C)?C(u,h,b,S):C.replace(/%d/i,u)}function _d(u,h){var b=this._relativeTime[u>0?"future":"past"];return N(b)?b(h):b.replace(/%s/i,h)}var xd={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 Yt(u){return typeof u=="string"?xd[u]||xd[u.toLowerCase()]:void 0}function hr(u){var h={},b,S;for(S in u)s(u,S)&&(b=Yt(S),b&&(h[b]=u[S]));return h}var lo={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 Oa(u){var h=[],b;for(b in u)s(u,b)&&h.push({unit:b,priority:lo[b]});return h.sort(function(S,C){return S.priority-C.priority}),h}var Rd=/\d/,Ut=/\d\d/,Ed=/\d{3}/,Ci=/\d{4}/,On=/[+-]?\d{6}/,st=/\d\d?/,Ia=/\d\d\d\d?/,Pa=/\d\d\d\d\d\d?/,cs=/\d{1,3}/,co=/\d{1,4}/,us=/[+-]?\d{1,6}/,ai=/\d+/,fs=/[+-]?\d+/,Tc=/Z|[+-]\d\d:?\d\d/gi,ka=/Z|[+-]\d\d(?::?\d\d)?/gi,Bg=/[+-]?\d+(\.\d{1,3})?/,uo=/[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,Oi=/^[1-9]\d?/,Ta=/^([1-9]\d|\d)/,Aa;Aa={};function ae(u,h,b){Aa[u]=N(h)?h:function(S,C){return S&&b?b:h}}function Vg(u,h){return s(Aa,u)?Aa[u](h._strict,h._locale):new RegExp(Wg(u))}function Wg(u){return sn(u.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(h,b,S,C,M){return b||S||C||M}))}function sn(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ir(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=Ir(h)),b}var Ac={};function Ke(u,h){var b,S=h,C;for(typeof u=="string"&&(u=[u]),f(h)&&(S=function(M,z){z[h]=qe(M)}),C=u.length,b=0;b<C;b++)Ac[u[b]]=S}function fo(u,h){Ke(u,function(b,S,C,M){C._w=C._w||{},h(b,C._w,C,M)})}function qc(u,h,b){h!=null&&s(Ac,u)&&Ac[u](h,b._a,b,u)}function qa(u){return u%4===0&&u%100!==0||u%400===0}var Gt=0,In=1,on=2,At=3,Pr=4,Pn=5,Ii=6,Cd=7,zg=8;ce("Y",0,0,function(){var u=this.year();return u<=9999?xe(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"),ae("Y",fs),ae("YY",st,Ut),ae("YYYY",co,Ci),ae("YYYYY",us,On),ae("YYYYYY",us,On),Ke(["YYYYY","YYYYYY"],Gt),Ke("YYYY",function(u,h){h[Gt]=u.length===2?e.parseTwoDigitYear(u):qe(u)}),Ke("YY",function(u,h){h[Gt]=e.parseTwoDigitYear(u)}),Ke("Y",function(u,h){h[Gt]=parseInt(u,10)});function po(u){return qa(u)?366:365}e.parseTwoDigitYear=function(u){return qe(u)+(qe(u)>68?1900:2e3)};var Od=ds("FullYear",!0);function Jg(){return qa(this.year())}function ds(u,h){return function(b){return b!=null?(mo(this,u,b),e.updateOffset(this,h),this):ho(this,u)}}function ho(u,h){if(!u.isValid())return NaN;var b=u._d,S=u._isUTC;switch(h){case"Milliseconds":return S?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return S?b.getUTCSeconds():b.getSeconds();case"Minutes":return S?b.getUTCMinutes():b.getMinutes();case"Hours":return S?b.getUTCHours():b.getHours();case"Date":return S?b.getUTCDate():b.getDate();case"Day":return S?b.getUTCDay():b.getDay();case"Month":return S?b.getUTCMonth():b.getMonth();case"FullYear":return S?b.getUTCFullYear():b.getFullYear();default:return NaN}}function mo(u,h,b){var S,C,M,z,se;if(!(!u.isValid()||isNaN(b))){switch(S=u._d,C=u._isUTC,h){case"Milliseconds":return void(C?S.setUTCMilliseconds(b):S.setMilliseconds(b));case"Seconds":return void(C?S.setUTCSeconds(b):S.setSeconds(b));case"Minutes":return void(C?S.setUTCMinutes(b):S.setMinutes(b));case"Hours":return void(C?S.setUTCHours(b):S.setHours(b));case"Date":return void(C?S.setUTCDate(b):S.setDate(b));case"FullYear":break;default:return}M=b,z=u.month(),se=u.date(),se=se===29&&z===1&&!qa(M)?28:se,C?S.setUTCFullYear(M,z,se):S.setFullYear(M,z,se)}}function Yg(u){return u=Yt(u),N(this[u])?this[u]():this}function $a(u,h){if(typeof u=="object"){u=hr(u);var b=Oa(u),S,C=b.length;for(S=0;S<C;S++)this[b[S].unit](u[b[S].unit])}else if(u=Yt(u),N(this[u]))return this[u](h);return this}function Gg(u,h){return(u%h+h)%h}var Rt;Array.prototype.indexOf?Rt=Array.prototype.indexOf:Rt=function(u){var h;for(h=0;h<this.length;++h)if(this[h]===u)return h;return-1};function $c(u,h){if(isNaN(u)||isNaN(h))return NaN;var b=Gg(h,12);return u+=(h-b)/12,b===1?qa(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)}),ae("M",st,Oi),ae("MM",st,Ut),ae("MMM",function(u,h){return h.monthsShortRegex(u)}),ae("MMMM",function(u,h){return h.monthsRegex(u)}),Ke(["M","MM"],function(u,h){h[In]=qe(u)-1}),Ke(["MMM","MMMM"],function(u,h,b,S){var C=b._locale.monthsParse(u,S,b._strict);C!=null?h[In]=C:R(b).invalidMonth=u});var Id="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Mc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Nc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Kg=uo,Qg=uo;function Zg(u,h){return u?n(this._months)?this._months[u.month()]:this._months[(this._months.isFormat||Nc).test(h)?"format":"standalone"][u.month()]:n(this._months)?this._months:this._months.standalone}function Xg(u,h){return u?n(this._monthsShort)?this._monthsShort[u.month()]:this._monthsShort[Nc.test(h)?"format":"standalone"][u.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Pd(u,h,b){var S,C,M,z=u.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],S=0;S<12;++S)M=y([2e3,S]),this._shortMonthsParse[S]=this.monthsShort(M,"").toLocaleLowerCase(),this._longMonthsParse[S]=this.months(M,"").toLocaleLowerCase();return b?h==="MMM"?(C=Rt.call(this._shortMonthsParse,z),C!==-1?C:null):(C=Rt.call(this._longMonthsParse,z),C!==-1?C:null):h==="MMM"?(C=Rt.call(this._shortMonthsParse,z),C!==-1?C:(C=Rt.call(this._longMonthsParse,z),C!==-1?C:null)):(C=Rt.call(this._longMonthsParse,z),C!==-1?C:(C=Rt.call(this._shortMonthsParse,z),C!==-1?C:null))}function kd(u,h,b){var S,C,M;if(this._monthsParseExact)return Pd.call(this,u,h,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),S=0;S<12;S++){if(C=y([2e3,S]),b&&!this._longMonthsParse[S]&&(this._longMonthsParse[S]=new RegExp("^"+this.months(C,"").replace(".","")+"$","i"),this._shortMonthsParse[S]=new RegExp("^"+this.monthsShort(C,"").replace(".","")+"$","i")),!b&&!this._monthsParse[S]&&(M="^"+this.months(C,"")+"|^"+this.monthsShort(C,""),this._monthsParse[S]=new RegExp(M.replace(".",""),"i")),b&&h==="MMMM"&&this._longMonthsParse[S].test(u))return S;if(b&&h==="MMM"&&this._shortMonthsParse[S].test(u))return S;if(!b&&this._monthsParse[S].test(u))return S}}function Dc(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,S=u.date();return S=S<29?S:Math.min(S,$c(u.year(),b)),u._isUTC?u._d.setUTCMonth(b,S):u._d.setMonth(b,S),u}function Ma(u){return u!=null?(Dc(this,u),e.updateOffset(this,!0),this):ho(this,"Month")}function ey(){return $c(this.year(),this.month())}function Td(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Fc.call(this),u?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Kg),this._monthsShortStrictRegex&&u?this._monthsShortStrictRegex:this._monthsShortRegex)}function Na(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Fc.call(this),u?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Qg),this._monthsStrictRegex&&u?this._monthsStrictRegex:this._monthsRegex)}function Fc(){function u(ve,Me){return Me.length-ve.length}var h=[],b=[],S=[],C,M,z,se;for(C=0;C<12;C++)M=y([2e3,C]),z=sn(this.monthsShort(M,"")),se=sn(this.months(M,"")),h.push(z),b.push(se),S.push(se),S.push(z);h.sort(u),b.sort(u),S.sort(u),this._monthsRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+h.join("|")+")","i")}function ty(u,h,b,S,C,M,z){var se;return u<100&&u>=0?(se=new Date(u+400,h,b,S,C,M,z),isFinite(se.getFullYear())&&se.setFullYear(u)):se=new Date(u,h,b,S,C,M,z),se}function ps(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 go(u,h,b){var S=7+h-b,C=(7+ps(u,0,S).getUTCDay()-h)%7;return-C+S-1}function Da(u,h,b,S,C){var M=(7+b-S)%7,z=go(u,S,C),se=1+7*(h-1)+M+z,ve,Me;return se<=0?(ve=u-1,Me=po(ve)+se):se>po(u)?(ve=u+1,Me=se-po(u)):(ve=u,Me=se),{year:ve,dayOfYear:Me}}function yo(u,h,b){var S=go(u.year(),h,b),C=Math.floor((u.dayOfYear()-S-1)/7)+1,M,z;return C<1?(z=u.year()-1,M=C+an(z,h,b)):C>an(u.year(),h,b)?(M=C-an(u.year(),h,b),z=u.year()+1):(z=u.year(),M=C),{week:M,year:z}}function an(u,h,b){var S=go(u,h,b),C=go(u+1,h,b);return(po(u)-S+C)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),ae("w",st,Oi),ae("ww",st,Ut),ae("W",st,Oi),ae("WW",st,Ut),fo(["w","ww","W","WW"],function(u,h,b,S){h[S.substr(0,1)]=qe(u)});function Lc(u){return yo(u,this._week.dow,this._week.doy).week}var jc={dow:0,doy:6};function hs(){return this._week.dow}function Ad(){return this._week.doy}function qd(u){var h=this.localeData().week(this);return u==null?h:this.add((u-h)*7,"d")}function ry(u){var h=yo(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"),ae("d",st),ae("e",st),ae("E",st),ae("dd",function(u,h){return h.weekdaysMinRegex(u)}),ae("ddd",function(u,h){return h.weekdaysShortRegex(u)}),ae("dddd",function(u,h){return h.weekdaysRegex(u)}),fo(["dd","ddd","dddd"],function(u,h,b,S){var C=b._locale.weekdaysParse(u,S,b._strict);C!=null?h.d=C:R(b).invalidWeekday=u}),fo(["d","e","E"],function(u,h,b,S){h[S]=qe(u)});function $d(u,h){return typeof u!="string"?u:isNaN(u)?(u=h.weekdaysParse(u),typeof u=="number"?u:null):parseInt(u,10)}function Md(u,h){return typeof u=="string"?h.weekdaysParse(u)%7||7:isNaN(u)?null:u}function Fa(u,h){return u.slice(h,7).concat(u.slice(0,h))}var Nd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Dd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ny="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),iy=uo,Fd=uo,sy=uo;function oy(u,h){var b=n(this._weekdays)?this._weekdays:this._weekdays[u&&u!==!0&&this._weekdays.isFormat.test(h)?"format":"standalone"];return u===!0?Fa(b,this._week.dow):u?b[u.day()]:b}function ay(u){return u===!0?Fa(this._weekdaysShort,this._week.dow):u?this._weekdaysShort[u.day()]:this._weekdaysShort}function ly(u){return u===!0?Fa(this._weekdaysMin,this._week.dow):u?this._weekdaysMin[u.day()]:this._weekdaysMin}function Uc(u,h,b){var S,C,M,z=u.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],S=0;S<7;++S)M=y([2e3,1]).day(S),this._minWeekdaysParse[S]=this.weekdaysMin(M,"").toLocaleLowerCase(),this._shortWeekdaysParse[S]=this.weekdaysShort(M,"").toLocaleLowerCase(),this._weekdaysParse[S]=this.weekdays(M,"").toLocaleLowerCase();return b?h==="dddd"?(C=Rt.call(this._weekdaysParse,z),C!==-1?C:null):h==="ddd"?(C=Rt.call(this._shortWeekdaysParse,z),C!==-1?C:null):(C=Rt.call(this._minWeekdaysParse,z),C!==-1?C:null):h==="dddd"?(C=Rt.call(this._weekdaysParse,z),C!==-1||(C=Rt.call(this._shortWeekdaysParse,z),C!==-1)?C:(C=Rt.call(this._minWeekdaysParse,z),C!==-1?C:null)):h==="ddd"?(C=Rt.call(this._shortWeekdaysParse,z),C!==-1||(C=Rt.call(this._weekdaysParse,z),C!==-1)?C:(C=Rt.call(this._minWeekdaysParse,z),C!==-1?C:null)):(C=Rt.call(this._minWeekdaysParse,z),C!==-1||(C=Rt.call(this._weekdaysParse,z),C!==-1)?C:(C=Rt.call(this._shortWeekdaysParse,z),C!==-1?C:null))}function cy(u,h,b){var S,C,M;if(this._weekdaysParseExact)return Uc.call(this,u,h,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),S=0;S<7;S++){if(C=y([2e3,1]).day(S),b&&!this._fullWeekdaysParse[S]&&(this._fullWeekdaysParse[S]=new RegExp("^"+this.weekdays(C,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[S]=new RegExp("^"+this.weekdaysShort(C,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[S]=new RegExp("^"+this.weekdaysMin(C,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[S]||(M="^"+this.weekdays(C,"")+"|^"+this.weekdaysShort(C,"")+"|^"+this.weekdaysMin(C,""),this._weekdaysParse[S]=new RegExp(M.replace(".",""),"i")),b&&h==="dddd"&&this._fullWeekdaysParse[S].test(u))return S;if(b&&h==="ddd"&&this._shortWeekdaysParse[S].test(u))return S;if(b&&h==="dd"&&this._minWeekdaysParse[S].test(u))return S;if(!b&&this._weekdaysParse[S].test(u))return S}}function uy(u){if(!this.isValid())return u!=null?this:NaN;var h=ho(this,"Day");return u!=null?(u=$d(u,this.localeData()),this.add(u-h,"d")):h}function fy(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 dy(u){if(!this.isValid())return u!=null?this:NaN;if(u!=null){var h=Md(u,this.localeData());return this.day(this.day()%7?h:h-7)}else return this.day()||7}function py(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Hc.call(this),u?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=iy),this._weekdaysStrictRegex&&u?this._weekdaysStrictRegex:this._weekdaysRegex)}function ut(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Hc.call(this),u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Fd),this._weekdaysShortStrictRegex&&u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function at(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Hc.call(this),u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=sy),this._weekdaysMinStrictRegex&&u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Hc(){function u(Dt,Mn){return Mn.length-Dt.length}var h=[],b=[],S=[],C=[],M,z,se,ve,Me;for(M=0;M<7;M++)z=y([2e3,1]).day(M),se=sn(this.weekdaysMin(z,"")),ve=sn(this.weekdaysShort(z,"")),Me=sn(this.weekdays(z,"")),h.push(se),b.push(ve),S.push(Me),C.push(se),C.push(ve),C.push(Me);h.sort(u),b.sort(u),S.sort(u),C.sort(u),this._weekdaysRegex=new RegExp("^("+C.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function Bc(){return this.hours()%12||12}function hy(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,Bc),ce("k",["kk",2],0,hy),ce("hmm",0,0,function(){return""+Bc.apply(this)+xe(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+Bc.apply(this)+xe(this.minutes(),2)+xe(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+xe(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+xe(this.minutes(),2)+xe(this.seconds(),2)});function Ld(u,h){ce(u,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),h)})}Ld("a",!0),Ld("A",!1);function jd(u,h){return h._meridiemParse}ae("a",jd),ae("A",jd),ae("H",st,Ta),ae("h",st,Oi),ae("k",st,Oi),ae("HH",st,Ut),ae("hh",st,Ut),ae("kk",st,Ut),ae("hmm",Ia),ae("hmmss",Pa),ae("Hmm",Ia),ae("Hmmss",Pa),Ke(["H","HH"],At),Ke(["k","kk"],function(u,h,b){var S=qe(u);h[At]=S===24?0:S}),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),R(b).bigHour=!0}),Ke("hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S)),R(b).bigHour=!0}),Ke("hmmss",function(u,h,b){var S=u.length-4,C=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Pn]=qe(u.substr(C)),R(b).bigHour=!0}),Ke("Hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S))}),Ke("Hmmss",function(u,h,b){var S=u.length-4,C=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Pn]=qe(u.substr(C))});function my(u){return(u+"").toLowerCase().charAt(0)==="p"}var Ud=/[ap]\.?m?\.?/i,gy=ds("Hours",!0);function Nt(u,h,b){return u>11?b?"pm":"PM":b?"am":"AM"}var La={calendar:pe,longDateFormat:Or,invalidDate:mt,ordinal:oo,dayOfMonthOrdinalParse:Jt,relativeTime:Hg,months:Id,monthsShort:Mc,week:jc,weekdays:Nd,weekdaysMin:ny,weekdaysShort:Dd,meridiemParse:Ud},Qe={},ms={},Pi;function kr(u,h){var b,S=Math.min(u.length,h.length);for(b=0;b<S;b+=1)if(u[b]!==h[b])return b;return S}function Vc(u){return u&&u.toLowerCase().replace("_","-")}function Hd(u){for(var h=0,b,S,C,M;h<u.length;){for(M=Vc(u[h]).split("-"),b=M.length,S=Vc(u[h+1]),S=S?S.split("-"):null;b>0;){if(C=vo(M.slice(0,b).join("-")),C)return C;if(S&&S.length>=b&&kr(M,S)>=b-1)break;b--}h++}return Pi}function Bd(u){return!!(u&&u.match("^[^/\\\\]*$"))}function vo(u){var h=null,b;if(Qe[u]===void 0&&typeof xl<"u"&&xl&&xl.exports&&Bd(u))try{h=Pi._abbr,b=nt,b("./locale/"+u),kn(h)}catch{Qe[u]=null}return Qe[u]}function kn(u,h){var b;return u&&(l(h)?b=Tn(u):b=ja(u,h),b?Pi=b:typeof console<"u"&&console.warn&&console.warn("Locale "+u+" not found. Did you forget to load it?")),Pi._abbr}function ja(u,h){if(h!==null){var b,S=La;if(h.abbr=u,Qe[u]!=null)$("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."),S=Qe[u]._config;else if(h.parentLocale!=null)if(Qe[h.parentLocale]!=null)S=Qe[h.parentLocale]._config;else if(b=vo(h.parentLocale),b!=null)S=b._config;else return ms[h.parentLocale]||(ms[h.parentLocale]=[]),ms[h.parentLocale].push({name:u,config:h}),null;return Qe[u]=new J(Y(S,h)),ms[u]&&ms[u].forEach(function(C){ja(C.name,C.config)}),kn(u),Qe[u]}else return delete Qe[u],null}function mr(u,h){if(h!=null){var b,S,C=La;Qe[u]!=null&&Qe[u].parentLocale!=null?Qe[u].set(Y(Qe[u]._config,h)):(S=vo(u),S!=null&&(C=S._config),h=Y(C,h),S==null&&(h.abbr=u),b=new J(h),b.parentLocale=Qe[u],Qe[u]=b),kn(u)}else Qe[u]!=null&&(Qe[u].parentLocale!=null?(Qe[u]=Qe[u].parentLocale,u===kn()&&kn(u)):Qe[u]!=null&&delete Qe[u]);return Qe[u]}function Tn(u){var h;if(u&&u._locale&&u._locale._abbr&&(u=u._locale._abbr),!u)return Pi;if(!n(u)){if(h=vo(u),h)return h;u=[u]}return Hd(u)}function gr(){return ne(Qe)}function Wc(u){var h,b=u._a;return b&&R(u).overflow===-2&&(h=b[In]<0||b[In]>11?In:b[on]<1||b[on]>$c(b[Gt],b[In])?on:b[At]<0||b[At]>24||b[At]===24&&(b[Pr]!==0||b[Pn]!==0||b[Ii]!==0)?At:b[Pr]<0||b[Pr]>59?Pr:b[Pn]<0||b[Pn]>59?Pn:b[Ii]<0||b[Ii]>999?Ii:-1,R(u)._overflowDayOfYear&&(h<Gt||h>on)&&(h=on),R(u)._overflowWeeks&&h===-1&&(h=Cd),R(u)._overflowWeekday&&h===-1&&(h=zg),R(u).overflow=h),u}var Vd=/^\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)?)?$/,li=/^\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)?)?$/,Ua=/Z|[+-]\d\d(?::?\d\d)?/,gs=[["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]],lt=[["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/]],ci=/^\/?Date\((-?\d+)/i,zc=/^(?:(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}))$/,yy={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ha(u){var h,b,S=u._i,C=Vd.exec(S)||li.exec(S),M,z,se,ve,Me=gs.length,Dt=lt.length;if(C){for(R(u).iso=!0,h=0,b=Me;h<b;h++)if(gs[h][1].exec(C[1])){z=gs[h][0],M=gs[h][2]!==!1;break}if(z==null){u._isValid=!1;return}if(C[3]){for(h=0,b=Dt;h<b;h++)if(lt[h][1].exec(C[3])){se=(C[2]||" ")+lt[h][0];break}if(se==null){u._isValid=!1;return}}if(!M&&se!=null){u._isValid=!1;return}if(C[4])if(Ua.exec(C[4]))ve="Z";else{u._isValid=!1;return}u._f=z+(se||"")+(ve||""),Va(u)}else u._isValid=!1}function vy(u,h,b,S,C,M){var z=[by(u),Mc.indexOf(h),parseInt(b,10),parseInt(S,10),parseInt(C,10)];return M&&z.push(parseInt(M,10)),z}function by(u){var h=parseInt(u,10);return h<=49?2e3+h:h<=999?1900+h:h}function Sy(u){return u.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Wd(u,h,b){if(u){var S=Dd.indexOf(u),C=new Date(h[0],h[1],h[2]).getDay();if(S!==C)return R(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Ba(u,h,b){if(u)return yy[u];if(h)return 0;var S=parseInt(b,10),C=S%100,M=(S-C)/100;return M*60+C}function ki(u){var h=zc.exec(Sy(u._i)),b;if(h){if(b=vy(h[4],h[3],h[2],h[5],h[6],h[7]),!Wd(h[1],b,u))return;u._a=b,u._tzm=Ba(h[8],h[9],h[10]),u._d=ps.apply(null,u._a),u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),R(u).rfc2822=!0}else u._isValid=!1}function wy(u){var h=ci.exec(u._i);if(h!==null){u._d=new Date(+h[1]);return}if(Ha(u),u._isValid===!1)delete u._isValid;else return;if(ki(u),u._isValid===!1)delete u._isValid;else return;u._strict?u._isValid=!1:e.createFromInputFallback(u)}e.createFromInputFallback=_("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 Ti(u,h,b){return u??h??b}function zd(u){var h=new Date(e.now());return u._useUTC?[h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()]:[h.getFullYear(),h.getMonth(),h.getDate()]}function bo(u){var h,b,S=[],C,M,z;if(!u._d){for(C=zd(u),u._w&&u._a[on]==null&&u._a[In]==null&&Jc(u),u._dayOfYear!=null&&(z=Ti(u._a[Gt],C[Gt]),(u._dayOfYear>po(z)||u._dayOfYear===0)&&(R(u)._overflowDayOfYear=!0),b=ps(z,0,u._dayOfYear),u._a[In]=b.getUTCMonth(),u._a[on]=b.getUTCDate()),h=0;h<3&&u._a[h]==null;++h)u._a[h]=S[h]=C[h];for(;h<7;h++)u._a[h]=S[h]=u._a[h]==null?h===2?1:0:u._a[h];u._a[At]===24&&u._a[Pr]===0&&u._a[Pn]===0&&u._a[Ii]===0&&(u._nextDay=!0,u._a[At]=0),u._d=(u._useUTC?ps:ty).apply(null,S),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&&(R(u).weekdayMismatch=!0)}}function Jc(u){var h,b,S,C,M,z,se,ve,Me;h=u._w,h.GG!=null||h.W!=null||h.E!=null?(M=1,z=4,b=Ti(h.GG,u._a[Gt],yo(et(),1,4).year),S=Ti(h.W,1),C=Ti(h.E,1),(C<1||C>7)&&(ve=!0)):(M=u._locale._week.dow,z=u._locale._week.doy,Me=yo(et(),M,z),b=Ti(h.gg,u._a[Gt],Me.year),S=Ti(h.w,Me.week),h.d!=null?(C=h.d,(C<0||C>6)&&(ve=!0)):h.e!=null?(C=h.e+M,(h.e<0||h.e>6)&&(ve=!0)):C=M),S<1||S>an(b,M,z)?R(u)._overflowWeeks=!0:ve!=null?R(u)._overflowWeekday=!0:(se=Da(b,S,C,M,z),u._a[Gt]=se.year,u._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Va(u){if(u._f===e.ISO_8601){Ha(u);return}if(u._f===e.RFC_2822){ki(u);return}u._a=[],R(u).empty=!0;var h=""+u._i,b,S,C,M,z,se=h.length,ve=0,Me,Dt;for(C=zr(u._f,u._locale).match(he)||[],Dt=C.length,b=0;b<Dt;b++)M=C[b],S=(h.match(Vg(M,u))||[])[0],S&&(z=h.substr(0,h.indexOf(S)),z.length>0&&R(u).unusedInput.push(z),h=h.slice(h.indexOf(S)+S.length),ve+=S.length),Ct[M]?(S?R(u).empty=!1:R(u).unusedTokens.push(M),qc(M,S,u)):u._strict&&!S&&R(u).unusedTokens.push(M);R(u).charsLeftOver=se-ve,h.length>0&&R(u).unusedInput.push(h),u._a[At]<=12&&R(u).bigHour===!0&&u._a[At]>0&&(R(u).bigHour=void 0),R(u).parsedDateParts=u._a.slice(0),R(u).meridiem=u._meridiem,u._a[At]=_y(u._locale,u._a[At],u._meridiem),Me=R(u).era,Me!==null&&(u._a[Gt]=u._locale.erasConvertYear(Me,u._a[Gt])),bo(u),Wc(u)}function _y(u,h,b){var S;return b==null?h:u.meridiemHour!=null?u.meridiemHour(h,b):(u.isPM!=null&&(S=u.isPM(b),S&&h<12&&(h+=12),!S&&h===12&&(h=0)),h)}function Yc(u){var h,b,S,C,M,z,se=!1,ve=u._f.length;if(ve===0){R(u).invalidFormat=!0,u._d=new Date(NaN);return}for(C=0;C<ve;C++)M=0,z=!1,h=B({},u),u._useUTC!=null&&(h._useUTC=u._useUTC),h._f=u._f[C],Va(h),T(h)&&(z=!0),M+=R(h).charsLeftOver,M+=R(h).unusedTokens.length*10,R(h).score=M,se?M<S&&(S=M,b=h):(S==null||M<S||z)&&(S=M,b=h,z&&(se=!0));g(u,b||h)}function Gc(u){if(!u._d){var h=hr(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(S){return S&&parseInt(S,10)}),bo(u)}}function xy(u){var h=new K(Wc(Kc(u)));return h._nextDay&&(h.add(1,"d"),h._nextDay=void 0),h}function Kc(u){var h=u._i,b=u._f;return u._locale=u._locale||Tn(u._l),h===null||b===void 0&&h===""?q({nullInput:!0}):(typeof h=="string"&&(u._i=h=u._locale.preparse(h)),X(h)?new K(Wc(h)):(d(h)?u._d=h:n(b)?Yc(u):b?Va(u):yr(u),T(u)||(u._d=null),u))}function yr(u){var h=u._i;l(h)?u._d=new Date(e.now()):d(h)?u._d=new Date(h.valueOf()):typeof h=="string"?wy(u):n(h)?(u._a=m(h.slice(0),function(b){return parseInt(b,10)}),bo(u)):i(h)?Gc(u):f(h)?u._d=new Date(h):e.createFromInputFallback(u)}function Wa(u,h,b,S,C){var M={};return(h===!0||h===!1)&&(S=h,h=void 0),(b===!0||b===!1)&&(S=b,b=void 0),(i(u)&&a(u)||n(u)&&u.length===0)&&(u=void 0),M._isAMomentObject=!0,M._useUTC=M._isUTC=C,M._l=b,M._i=u,M._f=h,M._strict=S,xy(M)}function et(u,h,b,S){return Wa(u,h,b,S,!1)}var Jd=_("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=et.apply(null,arguments);return this.isValid()&&u.isValid()?u<this?this:u:q()}),Yd=_("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=et.apply(null,arguments);return this.isValid()&&u.isValid()?u>this?this:u:q()});function Gd(u,h){var b,S;if(h.length===1&&n(h[0])&&(h=h[0]),!h.length)return et();for(b=h[0],S=1;S<h.length;++S)(!h[S].isValid()||h[S][u](b))&&(b=h[S]);return b}function Ry(){var u=[].slice.call(arguments,0);return Gd("isBefore",u)}function Ey(){var u=[].slice.call(arguments,0);return Gd("isAfter",u)}var Cy=function(){return Date.now?Date.now():+new Date},So=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ys(u){var h,b=!1,S,C=So.length;for(h in u)if(s(u,h)&&!(Rt.call(So,h)!==-1&&(u[h]==null||!isNaN(u[h]))))return!1;for(S=0;S<C;++S)if(u[So[S]]){if(b)return!1;parseFloat(u[So[S]])!==qe(u[So[S]])&&(b=!0)}return!0}function Oy(){return this._isValid}function Iy(){return tt(NaN)}function vs(u){var h=hr(u),b=h.year||0,S=h.quarter||0,C=h.month||0,M=h.week||h.isoWeek||0,z=h.day||0,se=h.hour||0,ve=h.minute||0,Me=h.second||0,Dt=h.millisecond||0;this._isValid=ys(h),this._milliseconds=+Dt+Me*1e3+ve*6e4+se*1e3*60*60,this._days=+z+M*7,this._months=+C+S*3+b*12,this._data={},this._locale=Tn(),this._bubble()}function wo(u){return u instanceof vs}function ln(u){return u<0?Math.round(-1*u)*-1:Math.round(u)}function za(u,h,b){var S=Math.min(u.length,h.length),C=Math.abs(u.length-h.length),M=0,z;for(z=0;z<S;z++)(b&&u[z]!==h[z]||!b&&qe(u[z])!==qe(h[z]))&&M++;return M+C}function Kd(u,h){ce(u,0,0,function(){var b=this.utcOffset(),S="+";return b<0&&(b=-b,S="-"),S+xe(~~(b/60),2)+h+xe(~~b%60,2)})}Kd("Z",":"),Kd("ZZ",""),ae("Z",ka),ae("ZZ",ka),Ke(["Z","ZZ"],function(u,h,b){b._useUTC=!0,b._tzm=Qc(ka,u)});var Py=/([\+\-]|\d\d)/gi;function Qc(u,h){var b=(h||"").match(u),S,C,M;return b===null?null:(S=b[b.length-1]||[],C=(S+"").match(Py)||["-",0,0],M=+(C[1]*60)+qe(C[2]),M===0?0:C[0]==="+"?M:-M)}function ui(u,h){var b,S;return h._isUTC?(b=h.clone(),S=(X(u)||d(u)?u.valueOf():et(u).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+S),e.updateOffset(b,!1),b):et(u).local()}function vr(u){return-Math.round(u._d.getTimezoneOffset())}e.updateOffset=function(){};function Qd(u,h,b){var S=this._offset||0,C;if(!this.isValid())return u!=null?this:NaN;if(u!=null){if(typeof u=="string"){if(u=Qc(ka,u),u===null)return this}else Math.abs(u)<16&&!b&&(u=u*60);return!this._isUTC&&h&&(C=vr(this)),this._offset=u,this._isUTC=!0,C!=null&&this.add(C,"m"),S!==u&&(!h||this._changeInProgress?_o(this,tt(u-S,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?S:vr(this)}function ky(u,h){return u!=null?(typeof u!="string"&&(u=-u),this.utcOffset(u,h),this):-this.utcOffset()}function Ty(u){return this.utcOffset(0,u)}function Ay(u){return this._isUTC&&(this.utcOffset(0,u),this._isUTC=!1,u&&this.subtract(vr(this),"m")),this}function qy(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var u=Qc(Tc,this._i);u!=null?this.utcOffset(u):this.utcOffset(0,!0)}return this}function $y(u){return this.isValid()?(u=u?et(u).utcOffset():0,(this.utcOffset()-u)%60===0):!1}function fi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function U(){if(!l(this._isDSTShifted))return this._isDSTShifted;var u={},h;return B(u,this),u=Kc(u),u._a?(h=u._isUTC?y(u._a):et(u._a),this._isDSTShifted=this.isValid()&&za(u._a,h.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function G(){return this.isValid()?!this._isUTC:!1}function W(){return this.isValid()?this._isUTC:!1}function oe(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ye=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function tt(u,h){var b=u,S=null,C,M,z;return wo(u)?b={ms:u._milliseconds,d:u._days,M:u._months}:f(u)||!isNaN(+u)?(b={},h?b[h]=+u:b.milliseconds=+u):(S=be.exec(u))?(C=S[1]==="-"?-1:1,b={y:0,d:qe(S[on])*C,h:qe(S[At])*C,m:qe(S[Pr])*C,s:qe(S[Pn])*C,ms:qe(ln(S[Ii]*1e3))*C}):(S=Ye.exec(u))?(C=S[1]==="-"?-1:1,b={y:Ue(S[2],C),M:Ue(S[3],C),w:Ue(S[4],C),d:Ue(S[5],C),h:Ue(S[6],C),m:Ue(S[7],C),s:Ue(S[8],C)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(z=My(et(b.from),et(b.to)),b={},b.ms=z.milliseconds,b.M=z.months),M=new vs(b),wo(u)&&s(u,"_locale")&&(M._locale=u._locale),wo(u)&&s(u,"_isValid")&&(M._isValid=u._isValid),M}tt.fn=vs.prototype,tt.invalid=Iy;function Ue(u,h){var b=u&&parseFloat(u.replace(",","."));return(isNaN(b)?0:b)*h}function Ja(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 My(u,h){var b;return u.isValid()&&h.isValid()?(h=ui(h,u),u.isBefore(h)?b=Ja(u,h):(b=Ja(h,u),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function br(u,h){return function(b,S){var C,M;return S!==null&&!isNaN(+S)&&($(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=S,S=M),C=tt(b,S),_o(this,C,u),this}}function _o(u,h,b,S){var C=h._milliseconds,M=ln(h._days),z=ln(h._months);u.isValid()&&(S=S??!0,z&&Dc(u,ho(u,"Month")+z*b),M&&mo(u,"Date",ho(u,"Date")+M*b),C&&u._d.setTime(u._d.valueOf()+C*b),S&&e.updateOffset(u,M||z))}var Ny=br(1,"add"),bs=br(-1,"subtract");function xo(u){return typeof u=="string"||u instanceof String}function Ya(u){return X(u)||d(u)||xo(u)||f(u)||Dy(u)||Ze(u)||u===null||u===void 0}function Ze(u){var h=i(u)&&!a(u),b=!1,S=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],C,M,z=S.length;for(C=0;C<z;C+=1)M=S[C],b=b||s(u,M);return h&&b}function Dy(u){var h=n(u),b=!1;return h&&(b=u.filter(function(S){return!f(S)&&xo(u)}).length===0),h&&b}function Zd(u){var h=i(u)&&!a(u),b=!1,S=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],C,M;for(C=0;C<S.length;C+=1)M=S[C],b=b||s(u,M);return h&&b}function Ga(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 Fy(u,h){arguments.length===1&&(arguments[0]?Ya(arguments[0])?(u=arguments[0],h=void 0):Zd(arguments[0])&&(h=arguments[0],u=void 0):(u=void 0,h=void 0));var b=u||et(),S=ui(b,this).startOf("day"),C=e.calendarFormat(this,S)||"sameElse",M=h&&(N(h[C])?h[C].call(this,b):h[C]);return this.format(M||this.localeData().calendar(C,this,et(b)))}function Ly(){return new K(this)}function jy(u,h){var b=X(u)?u:et(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(h).valueOf()):!1}function Ka(u,h){var b=X(u)?u:et(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(h).valueOf()<b.valueOf()):!1}function di(u,h,b,S){var C=X(u)?u:et(u),M=X(h)?h:et(h);return this.isValid()&&C.isValid()&&M.isValid()?(S=S||"()",(S[0]==="("?this.isAfter(C,b):!this.isBefore(C,b))&&(S[1]===")"?this.isBefore(M,b):!this.isAfter(M,b))):!1}function Qa(u,h){var b=X(u)?u:et(u),S;return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()===b.valueOf():(S=b.valueOf(),this.clone().startOf(h).valueOf()<=S&&S<=this.clone().endOf(h).valueOf())):!1}function Xd(u,h){return this.isSame(u,h)||this.isAfter(u,h)}function Za(u,h){return this.isSame(u,h)||this.isBefore(u,h)}function ep(u,h,b){var S,C,M;if(!this.isValid())return NaN;if(S=ui(u,this),!S.isValid())return NaN;switch(C=(S.utcOffset()-this.utcOffset())*6e4,h=Yt(h),h){case"year":M=Ro(this,S)/12;break;case"month":M=Ro(this,S);break;case"quarter":M=Ro(this,S)/3;break;case"second":M=(this-S)/1e3;break;case"minute":M=(this-S)/6e4;break;case"hour":M=(this-S)/36e5;break;case"day":M=(this-S-C)/864e5;break;case"week":M=(this-S-C)/6048e5;break;default:M=this-S}return b?M:Ir(M)}function Ro(u,h){if(u.date()<h.date())return-Ro(h,u);var b=(h.year()-u.year())*12+(h.month()-u.month()),S=u.clone().add(b,"months"),C,M;return h-S<0?(C=u.clone().add(b-1,"months"),M=(h-S)/(S-C)):(C=u.clone().add(b+1,"months"),M=(h-S)/(C-S)),-(b+M)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Xa(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function tp(u){if(!this.isValid())return null;var h=u!==!0,b=h?this.clone().utc():this;return b.year()<0||b.year()>9999?xt(b,h?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):N(Date.prototype.toISOString)?h?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",xt(b,"Z")):xt(b,h?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Eo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var u="moment",h="",b,S,C,M;return this.isLocal()||(u=this.utcOffset()===0?"moment.utc":"moment.parseZone",h="Z"),b="["+u+'("]',S=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",C="-MM-DD[T]HH:mm:ss.SSS",M=h+'[")]',this.format(b+S+C+M)}function Ai(u){u||(u=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var h=xt(this,u);return this.localeData().postformat(h)}function el(u,h){return this.isValid()&&(X(u)&&u.isValid()||et(u).isValid())?tt({to:this,from:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function Uy(u){return this.from(et(),u)}function Hy(u,h){return this.isValid()&&(X(u)&&u.isValid()||et(u).isValid())?tt({from:this,to:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function By(u){return this.to(et(),u)}function Co(u){var h;return u===void 0?this._locale._abbr:(h=Tn(u),h!=null&&(this._locale=h),this)}var Oo=_("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 tl(){return this._locale}var rl=1e3,qi=60*rl,nl=60*qi,rp=(365*400+97)*24*nl;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)-rp:new Date(u,h,b).valueOf()}function np(u,h,b){return u<100&&u>=0?Date.UTC(u+400,h,b)-rp:Date.UTC(u,h,b)}function Vy(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?np: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()*qi),nl);break;case"minute":h=this._d.valueOf(),h-=gt(h,qi);break;case"second":h=this._d.valueOf(),h-=gt(h,rl);break}return this._d.setTime(h),e.updateOffset(this,!0),this}function ip(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?np: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+=nl-gt(h+(this._isUTC?0:this.utcOffset()*qi),nl)-1;break;case"minute":h=this._d.valueOf(),h+=qi-gt(h,qi)-1;break;case"second":h=this._d.valueOf(),h+=rl-gt(h,rl)-1;break}return this._d.setTime(h),e.updateOffset(this,!0),this}function Wy(){return this._d.valueOf()-(this._offset||0)*6e4}function Zc(){return Math.floor(this.valueOf()/1e3)}function Io(){return new Date(this.valueOf())}function Xc(){var u=this;return[u.year(),u.month(),u.date(),u.hour(),u.minute(),u.second(),u.millisecond()]}function Ss(){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 Po(){return this.isValid()?this.toISOString():null}function ko(){return T(this)}function il(){return g({},R(this))}function ws(){return R(this).overflow}function zy(){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"),ae("N",nr),ae("NN",nr),ae("NNN",nr),ae("NNNN",$e),ae("NNNNN",Qy),Ke(["N","NN","NNN","NNNN","NNNNN"],function(u,h,b,S){var C=b._locale.erasParse(u,S,b._strict);C?R(b).era=C:R(b).invalidEra=u}),ae("y",ai),ae("yy",ai),ae("yyy",ai),ae("yyyy",ai),ae("yo",Zy),Ke(["y","yy","yyy","yyyy"],Gt),Ke(["yo"],function(u,h,b,S){var C;b._locale._eraYearOrdinalRegex&&(C=u.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?h[Gt]=b._locale.eraYearOrdinalParse(u,C):h[Gt]=parseInt(u,10)});function Jy(u,h){var b,S,C,M=this._eras||Tn("en")._eras;for(b=0,S=M.length;b<S;++b)switch(typeof M[b].since==="string"&&(C=e(M[b].since).startOf("day"),M[b].since=C.valueOf()),typeof M[b].until){case"undefined":M[b].until=1/0;break;case"string":C=e(M[b].until).startOf("day").valueOf(),M[b].until=C.valueOf();break}return M}function Yy(u,h,b){var S,C,M=this.eras(),z,se,ve;for(u=u.toUpperCase(),S=0,C=M.length;S<C;++S)if(z=M[S].name.toUpperCase(),se=M[S].abbr.toUpperCase(),ve=M[S].narrow.toUpperCase(),b)switch(h){case"N":case"NN":case"NNN":if(se===u)return M[S];break;case"NNNN":if(z===u)return M[S];break;case"NNNNN":if(ve===u)return M[S];break}else if([z,se,ve].indexOf(u)>=0)return M[S]}function Gy(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 Ky(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].name;return""}function sl(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].narrow;return""}function To(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].abbr;return""}function sp(){var u,h,b,S,C=this.localeData().eras();for(u=0,h=C.length;u<h;++u)if(b=C[u].since<=C[u].until?1:-1,S=this.clone().startOf("day").valueOf(),C[u].since<=S&&S<=C[u].until||C[u].until<=S&&S<=C[u].since)return(this.year()-e(C[u].since).year())*b+C[u].offset;return this.year()}function O(u){return s(this,"_erasNameRegex")||eu.call(this),u?this._erasNameRegex:this._erasRegex}function _s(u){return s(this,"_erasAbbrRegex")||eu.call(this),u?this._erasAbbrRegex:this._erasRegex}function ol(u){return s(this,"_erasNarrowRegex")||eu.call(this),u?this._erasNarrowRegex:this._erasRegex}function nr(u,h){return h.erasAbbrRegex(u)}function $e(u,h){return h.erasNameRegex(u)}function Qy(u,h){return h.erasNarrowRegex(u)}function Zy(u,h){return h._eraYearOrdinalRegex||ai}function eu(){var u=[],h=[],b=[],S=[],C,M,z,se,ve,Me=this.eras();for(C=0,M=Me.length;C<M;++C)z=sn(Me[C].name),se=sn(Me[C].abbr),ve=sn(Me[C].narrow),h.push(z),u.push(se),b.push(ve),S.push(z),S.push(se),S.push(ve);this._erasRegex=new RegExp("^("+S.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 cn(u,h){ce(0,[u,u.length],0,h)}cn("gggg","weekYear"),cn("ggggg","weekYear"),cn("GGGG","isoWeekYear"),cn("GGGGG","isoWeekYear"),ae("G",fs),ae("g",fs),ae("GG",st,Ut),ae("gg",st,Ut),ae("GGGG",co,Ci),ae("gggg",co,Ci),ae("GGGGG",us,On),ae("ggggg",us,On),fo(["gggg","ggggg","GGGG","GGGGG"],function(u,h,b,S){h[S.substr(0,2)]=qe(u)}),fo(["gg","GG"],function(u,h,b,S){h[S]=e.parseTwoDigitYear(u)});function Xy(u){return op.call(this,u,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function ev(u){return op.call(this,u,this.isoWeek(),this.isoWeekday(),1,4)}function tv(){return an(this.year(),1,4)}function rv(){return an(this.isoWeekYear(),1,4)}function nv(){var u=this.localeData()._week;return an(this.year(),u.dow,u.doy)}function An(){var u=this.localeData()._week;return an(this.weekYear(),u.dow,u.doy)}function op(u,h,b,S,C){var M;return u==null?yo(this,S,C).year:(M=an(u,S,C),h>M&&(h=M),iv.call(this,u,h,b,S,C))}function iv(u,h,b,S,C){var M=Da(u,h,b,S,C),z=ps(M.year,0,M.dayOfYear);return this.year(z.getUTCFullYear()),this.month(z.getUTCMonth()),this.date(z.getUTCDate()),this}ce("Q",0,"Qo","quarter"),ae("Q",Rd),Ke("Q",function(u,h){h[In]=(qe(u)-1)*3});function sv(u){return u==null?Math.ceil((this.month()+1)/3):this.month((u-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),ae("D",st,Oi),ae("DD",st,Ut),ae("Do",function(u,h){return u?h._dayOfMonthOrdinalParse||h._ordinalParse:h._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],on),Ke("Do",function(u,h){h[on]=qe(u.match(st)[0])});var ap=ds("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),ae("DDD",cs),ae("DDDD",Ed),Ke(["DDD","DDDD"],function(u,h,b){b._dayOfYear=qe(u)});function ov(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"),ae("m",st,Ta),ae("mm",st,Ut),Ke(["m","mm"],Pr);var qn=ds("Minutes",!1);ce("s",["ss",2],0,"second"),ae("s",st,Ta),ae("ss",st,Ut),Ke(["s","ss"],Pn);var av=ds("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}),ae("S",cs,Rd),ae("SS",cs,Ut),ae("SSS",cs,Ed);var pi,lp;for(pi="SSSS";pi.length<=9;pi+="S")ae(pi,ai);function lv(u,h){h[Ii]=qe(("0."+u)*1e3)}for(pi="S";pi.length<=9;pi+="S")Ke(pi,lv);lp=ds("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function cv(){return this._isUTC?"UTC":""}function $i(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Ny,te.calendar=Fy,te.clone=Ly,te.diff=ep,te.endOf=ip,te.format=Ai,te.from=el,te.fromNow=Uy,te.to=Hy,te.toNow=By,te.get=Yg,te.invalidAt=ws,te.isAfter=jy,te.isBefore=Ka,te.isBetween=di,te.isSame=Qa,te.isSameOrAfter=Xd,te.isSameOrBefore=Za,te.isValid=ko,te.lang=Oo,te.locale=Co,te.localeData=tl,te.max=Yd,te.min=Jd,te.parsingFlags=il,te.set=$a,te.startOf=Vy,te.subtract=bs,te.toArray=Xc,te.toObject=Ss,te.toDate=Io,te.toISOString=tp,te.inspect=Eo,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=Po,te.toString=Xa,te.unix=Zc,te.valueOf=Wy,te.creationData=zy,te.eraName=Ky,te.eraNarrow=sl,te.eraAbbr=To,te.eraYear=sp,te.year=Od,te.isLeapYear=Jg,te.weekYear=Xy,te.isoWeekYear=ev,te.quarter=te.quarters=sv,te.month=Ma,te.daysInMonth=ey,te.week=te.weeks=qd,te.isoWeek=te.isoWeeks=ry,te.weeksInYear=nv,te.weeksInWeekYear=An,te.isoWeeksInYear=tv,te.isoWeeksInISOWeekYear=rv,te.date=ap,te.day=te.days=uy,te.weekday=fy,te.isoWeekday=dy,te.dayOfYear=ov,te.hour=te.hours=gy,te.minute=te.minutes=qn,te.second=te.seconds=av,te.millisecond=te.milliseconds=lp,te.utcOffset=Qd,te.utc=Ty,te.local=Ay,te.parseZone=qy,te.hasAlignedHourOffset=$y,te.isDST=fi,te.isLocal=G,te.isUtcOffset=W,te.isUtc=oe,te.isUTC=oe,te.zoneAbbr=cv,te.zoneName=$i,te.dates=_("dates accessor is deprecated. Use date instead.",ap),te.months=_("months accessor is deprecated. Use month instead",Ma),te.years=_("years accessor is deprecated. Use year instead",Od),te.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ky),te.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",U);function uv(u){return et(u*1e3)}function Jr(){return et.apply(null,arguments).parseZone()}function cp(u){return u}var Ve=J.prototype;Ve.calendar=Xe,Ve.longDateFormat=ht,Ve.invalidDate=nn,Ve.ordinal=ao,Ve.preparse=cp,Ve.postformat=cp,Ve.relativeTime=Cn,Ve.pastFuture=_d,Ve.set=j,Ve.eras=Jy,Ve.erasParse=Yy,Ve.erasConvertYear=Gy,Ve.erasAbbrRegex=_s,Ve.erasNameRegex=O,Ve.erasNarrowRegex=ol,Ve.months=Zg,Ve.monthsShort=Xg,Ve.monthsParse=kd,Ve.monthsRegex=Na,Ve.monthsShortRegex=Td,Ve.week=Lc,Ve.firstDayOfYear=Ad,Ve.firstDayOfWeek=hs,Ve.weekdays=oy,Ve.weekdaysMin=ly,Ve.weekdaysShort=ay,Ve.weekdaysParse=cy,Ve.weekdaysRegex=py,Ve.weekdaysShortRegex=ut,Ve.weekdaysMinRegex=at,Ve.isPM=my,Ve.meridiem=Nt;function al(u,h,b,S){var C=Tn(),M=y().set(S,h);return C[b](M,u)}function up(u,h,b){if(f(u)&&(h=u,u=void 0),u=u||"",h!=null)return al(u,h,b,"month");var S,C=[];for(S=0;S<12;S++)C[S]=al(u,S,b,"month");return C}function tu(u,h,b,S){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 C=Tn(),M=u?C._week.dow:0,z,se=[];if(b!=null)return al(h,(b+M)%7,S,"day");for(z=0;z<7;z++)se[z]=al(h,(z+M)%7,S,"day");return se}function fp(u,h){return up(u,h,"months")}function dp(u,h){return up(u,h,"monthsShort")}function fv(u,h,b){return tu(u,h,b,"weekdays")}function dv(u,h,b){return tu(u,h,b,"weekdaysShort")}function ru(u,h,b){return tu(u,h,b,"weekdaysMin")}kn("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=_("moment.lang is deprecated. Use moment.locale instead.",kn),e.langData=_("moment.langData is deprecated. Use moment.localeData instead.",Tn);var Sr=Math.abs;function ll(){var u=this._data;return this._milliseconds=Sr(this._milliseconds),this._days=Sr(this._days),this._months=Sr(this._months),u.milliseconds=Sr(u.milliseconds),u.seconds=Sr(u.seconds),u.minutes=Sr(u.minutes),u.hours=Sr(u.hours),u.months=Sr(u.months),u.years=Sr(u.years),this}function pp(u,h,b,S){var C=tt(h,b);return u._milliseconds+=S*C._milliseconds,u._days+=S*C._days,u._months+=S*C._months,u._bubble()}function hp(u,h){return pp(this,u,h,1)}function pv(u,h){return pp(this,u,h,-1)}function Yr(u){return u<0?Math.floor(u):Math.ceil(u)}function nu(){var u=this._milliseconds,h=this._days,b=this._months,S=this._data,C,M,z,se,ve;return u>=0&&h>=0&&b>=0||u<=0&&h<=0&&b<=0||(u+=Yr(ir(b)+h)*864e5,h=0,b=0),S.milliseconds=u%1e3,C=Ir(u/1e3),S.seconds=C%60,M=Ir(C/60),S.minutes=M%60,z=Ir(M/60),S.hours=z%24,h+=Ir(z/24),ve=Ir(hi(h)),b+=ve,h-=Yr(ir(ve)),se=Ir(b/12),b%=12,S.days=h,S.months=b,S.years=se,this}function hi(u){return u*4800/146097}function ir(u){return u*146097/4800}function hv(u){if(!this.isValid())return NaN;var h,b,S=this._milliseconds;if(u=Yt(u),u==="month"||u==="quarter"||u==="year")switch(h=this._days+S/864e5,b=this._months+hi(h),u){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(h=this._days+Math.round(ir(this._months)),u){case"week":return h/7+S/6048e5;case"day":return h+S/864e5;case"hour":return h*24+S/36e5;case"minute":return h*1440+S/6e4;case"second":return h*86400+S/1e3;case"millisecond":return Math.floor(h*864e5)+S;default:throw new Error("Unknown unit "+u)}}function un(u){return function(){return this.as(u)}}var iu=un("ms"),Ao=un("s"),mi=un("m"),mp=un("h"),mv=un("d"),cl=un("w"),gv=un("M"),gp=un("Q"),Bt=un("y"),su=iu;function yp(){return tt(this)}function fn(u){return u=Yt(u),this.isValid()?this[u+"s"]():NaN}function $n(u){return function(){return this.isValid()?this._data[u]:NaN}}var ul=$n("milliseconds"),Mi=$n("seconds"),vp=$n("minutes"),Qt=$n("hours"),ou=$n("days"),yv=$n("months"),vv=$n("years");function bv(){return Ir(this.days()/7)}var Gr=Math.round,xs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function qo(u,h,b,S,C){return C.relativeTime(h||1,!!b,u,S)}function bp(u,h,b,S){var C=tt(u).abs(),M=Gr(C.as("s")),z=Gr(C.as("m")),se=Gr(C.as("h")),ve=Gr(C.as("d")),Me=Gr(C.as("M")),Dt=Gr(C.as("w")),Mn=Gr(C.as("y")),Nn=M<=b.ss&&["s",M]||M<b.s&&["ss",M]||z<=1&&["m"]||z<b.m&&["mm",z]||se<=1&&["h"]||se<b.h&&["hh",se]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(Nn=Nn||Dt<=1&&["w"]||Dt<b.w&&["ww",Dt]),Nn=Nn||Me<=1&&["M"]||Me<b.M&&["MM",Me]||Mn<=1&&["y"]||["yy",Mn],Nn[2]=h,Nn[3]=+u>0,Nn[4]=S,qo.apply(null,Nn)}function Sv(u){return u===void 0?Gr:typeof u=="function"?(Gr=u,!0):!1}function wv(u,h){return xs[u]===void 0?!1:h===void 0?xs[u]:(xs[u]=h,u==="s"&&(xs.ss=h-1),!0)}function $o(u,h){if(!this.isValid())return this.localeData().invalidDate();var b=!1,S=xs,C,M;return typeof u=="object"&&(h=u,u=!1),typeof u=="boolean"&&(b=u),typeof h=="object"&&(S=Object.assign({},xs,h),h.s!=null&&h.ss==null&&(S.ss=h.s-1)),C=this.localeData(),M=bp(this,!b,S,C),b&&(M=C.pastFuture(+this,M)),C.postformat(M)}var au=Math.abs;function Rs(u){return(u>0)-(u<0)||+u}function Es(){if(!this.isValid())return this.localeData().invalidDate();var u=au(this._milliseconds)/1e3,h=au(this._days),b=au(this._months),S,C,M,z,se=this.asSeconds(),ve,Me,Dt,Mn;return se?(S=Ir(u/60),C=Ir(S/60),u%=60,S%=60,M=Ir(b/12),b%=12,z=u?u.toFixed(3).replace(/\.?0+$/,""):"",ve=se<0?"-":"",Me=Rs(this._months)!==Rs(se)?"-":"",Dt=Rs(this._days)!==Rs(se)?"-":"",Mn=Rs(this._milliseconds)!==Rs(se)?"-":"",ve+"P"+(M?Me+M+"Y":"")+(b?Me+b+"M":"")+(h?Dt+h+"D":"")+(C||S||u?"T":"")+(C?Mn+C+"H":"")+(S?Mn+S+"M":"")+(u?Mn+z+"S":"")):"P0D"}var Fe=vs.prototype;Fe.isValid=Oy,Fe.abs=ll,Fe.add=hp,Fe.subtract=pv,Fe.as=hv,Fe.asMilliseconds=iu,Fe.asSeconds=Ao,Fe.asMinutes=mi,Fe.asHours=mp,Fe.asDays=mv,Fe.asWeeks=cl,Fe.asMonths=gv,Fe.asQuarters=gp,Fe.asYears=Bt,Fe.valueOf=su,Fe._bubble=nu,Fe.clone=yp,Fe.get=fn,Fe.milliseconds=ul,Fe.seconds=Mi,Fe.minutes=vp,Fe.hours=Qt,Fe.days=ou,Fe.weeks=bv,Fe.months=yv,Fe.years=vv,Fe.humanize=$o,Fe.toISOString=Es,Fe.toString=Es,Fe.toJSON=Es,Fe.locale=Co,Fe.localeData=tl,Fe.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Es),Fe.lang=Oo,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),ae("x",fs),ae("X",Bg),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(et),e.fn=te,e.min=Ry,e.max=Ey,e.now=Cy,e.utc=y,e.unix=uv,e.months=fp,e.isDate=d,e.locale=kn,e.invalid=q,e.duration=tt,e.isMoment=X,e.weekdays=fv,e.parseZone=Jr,e.localeData=Tn,e.isDuration=wo,e.monthsShort=dp,e.weekdaysMin=ru,e.defineLocale=ja,e.updateLocale=mr,e.locales=gr,e.weekdaysShort=dv,e.normalizeUnits=Yt,e.relativeTimeRounding=Sv,e.relativeTimeThreshold=wv,e.calendarFormat=Ga,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 XE=F((ZE,Qp)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Qp<"u"&&Qp.exports?Qp.exports=e():t.tv4=e()})(ZE,function(){Object.keys||(Object.keys=(function(){var k=Object.prototype.hasOwnProperty,_=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$=P.length;return function(N){if(typeof N!="object"&&typeof N!="function"||N===null)throw new TypeError("Object.keys called on non-object");var j=[];for(var Y in N)k.call(N,Y)&&j.push(Y);if(_)for(var J=0;J<$;J++)k.call(N,P[J])&&j.push(P[J]);return j}})()),Object.create||(Object.create=(function(){function k(){}return function(_){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=_,new k}})()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var _=Object(this),P=_.length>>>0;if(P===0)return-1;var $=0;if(arguments.length>1&&($=Number(arguments[1]),$!==$?$=0:$!==0&&$!==1/0&&$!==-1/0&&($=($>0||-1)*Math.floor(Math.abs($)))),$>=P)return-1;for(var N=$>=0?$:Math.max(P-Math.abs($),0);N<P;N++)if(N in _&&_[N]===k)return N;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var _="tv4_test_frozen_key";k.hasOwnProperty(_);)_+=Math.random();try{return k[_]=!0,delete k[_],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(_){return"%"+_.substring(3)})}function n(k){var _="";t[k.charAt(0)]&&(_=k.charAt(0),k=k.substring(1));var P="",$="",N=!0,j=!1,Y=!1;_==="+"?N=!1:_==="."?($=".",P="."):_==="/"?($="/",P="/"):_==="#"?($="#",N=!1):_===";"?($=";",P=";",j=!0,Y=!0):_==="?"?($="?",P="&",j=!0):_==="&"&&($="&",P="&",j=!0);for(var J=[],ne=k.split(","),pe=[],Xe={},xe=0;xe<ne.length;xe++){var he=ne[xe],Ee=null;if(he.indexOf(":")!==-1){var vt=he.split(":");he=vt[0],Ee=parseInt(vt[1],10)}for(var Ct={};e[he.charAt(he.length-1)];)Ct[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ce={truncate:Ee,name:he,suffices:Ct};pe.push(ce),Xe[he]=ce,J.push(he)}var pr=function(oi){for(var xt="",zr=0,Or=0;Or<pe.length;Or++){var ht=pe[Or],mt=oi(ht.name);if(mt==null||Array.isArray(mt)&&mt.length===0||typeof mt=="object"&&Object.keys(mt).length===0){zr++;continue}if(Or===zr?xt+=$:xt+=P||",",Array.isArray(mt)){j&&(xt+=ht.name+"=");for(var nn=0;nn<mt.length;nn++)nn>0&&(xt+=ht.suffices["*"]&&P||",",ht.suffices["*"]&&j&&(xt+=ht.name+"=")),xt+=N?encodeURIComponent(mt[nn]).replace(/!/g,"%21"):r(mt[nn])}else if(typeof mt=="object"){j&&!ht.suffices["*"]&&(xt+=ht.name+"=");var oo=!0;for(var Jt in mt)oo||(xt+=ht.suffices["*"]&&P||","),oo=!1,xt+=N?encodeURIComponent(Jt).replace(/!/g,"%21"):r(Jt),xt+=ht.suffices["*"]?"=":",",xt+=N?encodeURIComponent(mt[Jt]).replace(/!/g,"%21"):r(mt[Jt])}else j&&(xt+=ht.name,(!Y||mt!=="")&&(xt+="=")),ht.truncate!=null&&(mt=mt.substring(0,ht.truncate)),xt+=N?encodeURIComponent(mt).replace(/!/g,"%21"):r(mt)}return xt};return pr.varNames=J,{prefix:$,substitution:pr}}function i(k){if(!(this instanceof i))return new i(k);for(var _=k.split("{"),P=[_.shift()],$=[],N=[],j=[];_.length>0;){var Y=_.shift(),J=Y.split("}")[0],ne=Y.substring(J.length+1),pe=n(J);N.push(pe.substitution),$.push(pe.prefix),P.push(ne),j=j.concat(pe.substitution.varNames)}this.fill=function(Xe){for(var xe=P[0],he=0;he<N.length;he++){var Ee=N[he];xe+=Ee(Xe),xe+=P[he+1]}return xe},this.varNames=j,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(_){return k[_]})}};var s=function(_,P,$,N,j){if(this.missing=[],this.missingMap={},this.formatValidators=_?Object.create(_.formatValidators):{},this.schemas=_?Object.create(_.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,N&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),j&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=$||w("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},_)for(var Y in _.definedKeywords)this.definedKeywords[Y]=_.definedKeywords[Y].slice(0)};s.prototype.defineKeyword=function(k,_){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(_)},s.prototype.createError=function(k,_,P,$,N,j,Y){var J=new L(k,_,P,$,N);return J.message=this.errorReporter(J,j,Y),J},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,_,P){for(var $=k;$<this.errors.length;$++)this.errors[$]=this.errors[$].prefixWith(_,P);return this},s.prototype.banUnknownProperties=function(k,_){for(var P in this.unknownPropertyPaths){var $=this.createError(R.UNKNOWN_PROPERTY,{path:P},P,"",null,k,_),N=this.handleError($);if(N)return N}return null},s.prototype.addFormat=function(k,_){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=_},s.prototype.resolveRefs=function(k,_){if(k.$ref!==void 0){if(_=_||{},_[k.$ref])return this.createError(R.CIRCULAR_REFERENCE,{urls:Object.keys(_).join(", ")},"","",null,void 0,k);_[k.$ref]=!0,k=this.getSchema(k.$ref,_)}return k},s.prototype.getSchema=function(k,_){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,_);var $=k,N="";if(k.indexOf("#")!==-1&&(N=k.substring(k.indexOf("#")+1),$=k.substring(0,k.indexOf("#"))),typeof this.schemas[$]=="object"){P=this.schemas[$];var j=decodeURIComponent(N);if(j==="")return this.resolveRefs(P,_);if(j.charAt(0)!=="/")return;for(var Y=j.split("/").slice(1),J=0;J<Y.length;J++){var ne=Y[J].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ne]===void 0){P=void 0;break}P=P[ne]}if(P!==void 0)return this.resolveRefs(P,_)}this.missing[$]===void 0&&(this.missing.push($),this.missing[$]=$,this.missingMap[$]=$)},s.prototype.searchSchemas=function(k,_){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],_);else if(k&&typeof k=="object"){typeof k.id=="string"&&V(_,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var $ in k)if($!=="enum"){if(typeof k[$]=="object")this.searchSchemas(k[$],_);else if($==="$ref"){var N=g(k[$]);N&&this.schemas[N]===void 0&&this.missingMap[N]===void 0&&(this.missingMap[N]=N)}}}},s.prototype.addSchema=function(k,_){if(typeof k!="string"||typeof _>"u")if(typeof k=="object"&&typeof k.id=="string")_=k,k=_.id;else return;k===g(k)+"#"&&(k=g(k)),this.schemas[k]=_,delete this.missingMap[k],y(_,k),this.searchSchemas(_,k)},s.prototype.getSchemaMap=function(){var k={};for(var _ in this.schemas)k[_]=this.schemas[_];return k},s.prototype.getSchemaUris=function(k){var _=[];for(var P in this.schemas)(!k||k.test(P))&&_.push(P);return _},s.prototype.getMissingUris=function(k){var _=[];for(var P in this.missingMap)(!k||k.test(P))&&_.push(P);return _},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,_,P,$,N){var j;if(_=this.resolveRefs(_),_){if(_ instanceof L)return this.errors.push(_),_}else return null;var Y=this.errors.length,J,ne=null,pe=null;if(this.checkRecursive&&k&&typeof k=="object"){if(j=!this.scanned.length,k[this.validatedSchemasKey]){var Xe=k[this.validatedSchemasKey].indexOf(_);if(Xe!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][Xe]),null}if(Object.isFrozen(k)&&(J=this.scannedFrozen.indexOf(k),J!==-1)){var xe=this.scannedFrozenSchemas[J].indexOf(_);if(xe!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[J][xe]),null}if(this.scanned.push(k),Object.isFrozen(k))J===-1&&(J=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[J].length,this.scannedFrozenSchemas[J][ne]=_,this.scannedFrozenValidationErrors[J][ne]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}pe=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][pe]=_,k[this.validationErrorsKey][pe]=[]}}var he=this.errors.length,Ee=this.validateBasic(k,_,N)||this.validateNumeric(k,_,N)||this.validateString(k,_,N)||this.validateArray(k,_,N)||this.validateObject(k,_,N)||this.validateCombinations(k,_,N)||this.validateHypermedia(k,_,N)||this.validateFormat(k,_,N)||this.validateDefinedKeywords(k,_,N)||null;if(j){for(;this.scanned.length;){var vt=this.scanned.pop();delete vt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ee||he!==this.errors.length)for(;P&&P.length||$&&$.length;){var Ct=P&&P.length?""+P.pop():null,ce=$&&$.length?""+$.pop():null;Ee&&(Ee=Ee.prefixWith(Ct,ce)),this.prefixErrors(he,Ct,ce)}return ne!==null?this.scannedFrozenValidationErrors[J][ne]=this.errors.slice(Y):pe!==null&&(k[this.validationErrorsKey][pe]=this.errors.slice(Y)),this.handleError(Ee)},s.prototype.validateFormat=function(k,_){if(typeof _.format!="string"||!this.formatValidators[_.format])return null;var P=this.formatValidators[_.format].call(null,k,_);return typeof P=="string"||typeof P=="number"?this.createError(R.FORMAT_CUSTOM,{message:P},"","/format",null,k,_):P&&typeof P=="object"?this.createError(R.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,_):null},s.prototype.validateDefinedKeywords=function(k,_,P){for(var $ in this.definedKeywords)if(!(typeof _[$]>"u"))for(var N=this.definedKeywords[$],j=0;j<N.length;j++){var Y=N[j],J=Y(k,_[$],_,P);if(typeof J=="string"||typeof J=="number")return this.createError(R.KEYWORD_CUSTOM,{key:$,message:J},"","",null,k,_).prefixWith(null,$);if(J&&typeof J=="object"){var ne=J.code;if(typeof ne=="string"){if(!R[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=R[ne]}else typeof ne!="number"&&(ne=R.KEYWORD_CUSTOM);var pe=typeof J.message=="object"?J.message:{key:$,message:J.message||"?"},Xe=J.schemaPath||"/"+$.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,pe,J.dataPath||null,Xe,null,k,_)}}return null};function a(k,_){if(k===_)return!0;if(k&&_&&typeof k=="object"&&typeof _=="object"){if(Array.isArray(k)!==Array.isArray(_))return!1;if(Array.isArray(k)){if(k.length!==_.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],_[P]))return!1}else{var $;for($ in k)if(_[$]===void 0&&k[$]!==void 0)return!1;for($ in _)if(k[$]===void 0&&_[$]!==void 0)return!1;for($ in k)if(!a(k[$],_[$]))return!1}return!0}return!1}s.prototype.validateBasic=function(_,P,$){var N;return(N=this.validateType(_,P,$))||(N=this.validateEnum(_,P,$))?N.prefixWith(null,"type"):null},s.prototype.validateType=function(_,P){if(P.type===void 0)return null;var $=typeof _;_===null?$="null":Array.isArray(_)&&($="array");var N=P.type;Array.isArray(N)||(N=[N]);for(var j=0;j<N.length;j++){var Y=N[j];if(Y===$||Y==="integer"&&$==="number"&&_%1===0)return null}return this.createError(R.INVALID_TYPE,{type:$,expected:N.join("/")},"","",null,_,P)},s.prototype.validateEnum=function(_,P){if(P.enum===void 0)return null;for(var $=0;$<P.enum.length;$++){var N=P.enum[$];if(a(_,N))return null}return this.createError(R.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(_):_},"","",null,_,P)},s.prototype.validateNumeric=function(_,P,$){return this.validateMultipleOf(_,P,$)||this.validateMinMax(_,P,$)||this.validateNaN(_,P,$)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(_,P){var $=P.multipleOf||P.divisibleBy;if($===void 0)return null;if(typeof _=="number"){var N=_/$%1;if(N>=l&&N<f)return this.createError(R.NUMBER_MULTIPLE_OF,{value:_,multipleOf:$},"","",null,_,P)}return null},s.prototype.validateMinMax=function(_,P){if(typeof _!="number")return null;if(P.minimum!==void 0){if(_<P.minimum)return this.createError(R.NUMBER_MINIMUM,{value:_,minimum:P.minimum},"","/minimum",null,_,P);if(P.exclusiveMinimum&&_===P.minimum)return this.createError(R.NUMBER_MINIMUM_EXCLUSIVE,{value:_,minimum:P.minimum},"","/exclusiveMinimum",null,_,P)}if(P.maximum!==void 0){if(_>P.maximum)return this.createError(R.NUMBER_MAXIMUM,{value:_,maximum:P.maximum},"","/maximum",null,_,P);if(P.exclusiveMaximum&&_===P.maximum)return this.createError(R.NUMBER_MAXIMUM_EXCLUSIVE,{value:_,maximum:P.maximum},"","/exclusiveMaximum",null,_,P)}return null},s.prototype.validateNaN=function(_,P){return typeof _!="number"?null:isNaN(_)===!0||_===1/0||_===-1/0?this.createError(R.NUMBER_NOT_A_NUMBER,{value:_},"","/type",null,_,P):null},s.prototype.validateString=function(_,P,$){return this.validateStringLength(_,P,$)||this.validateStringPattern(_,P,$)||null},s.prototype.validateStringLength=function(_,P){return typeof _!="string"?null:P.minLength!==void 0&&_.length<P.minLength?this.createError(R.STRING_LENGTH_SHORT,{length:_.length,minimum:P.minLength},"","/minLength",null,_,P):P.maxLength!==void 0&&_.length>P.maxLength?this.createError(R.STRING_LENGTH_LONG,{length:_.length,maximum:P.maxLength},"","/maxLength",null,_,P):null},s.prototype.validateStringPattern=function(_,P){if(typeof _!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var $;if(P.pattern instanceof RegExp)$=P.pattern;else{var N,j="",Y=P.pattern.match(/^\/(.+)\/([img]*)$/);Y?(N=Y[1],j=Y[2]):N=P.pattern,$=new RegExp(N,j)}return $.test(_)?null:this.createError(R.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,_,P)},s.prototype.validateArray=function(_,P,$){return Array.isArray(_)&&(this.validateArrayLength(_,P,$)||this.validateArrayUniqueItems(_,P,$)||this.validateArrayItems(_,P,$))||null},s.prototype.validateArrayLength=function(_,P){var $;return P.minItems!==void 0&&_.length<P.minItems&&($=this.createError(R.ARRAY_LENGTH_SHORT,{length:_.length,minimum:P.minItems},"","/minItems",null,_,P),this.handleError($))||P.maxItems!==void 0&&_.length>P.maxItems&&($=this.createError(R.ARRAY_LENGTH_LONG,{length:_.length,maximum:P.maxItems},"","/maxItems",null,_,P),this.handleError($))?$:null},s.prototype.validateArrayUniqueItems=function(_,P){if(P.uniqueItems){for(var $=0;$<_.length;$++)for(var N=$+1;N<_.length;N++)if(a(_[$],_[N])){var j=this.createError(R.ARRAY_UNIQUE,{match1:$,match2:N},"","/uniqueItems",null,_,P);if(this.handleError(j))return j}}return null},s.prototype.validateArrayItems=function(_,P,$){if(P.items===void 0)return null;var N,j;if(Array.isArray(P.items)){for(j=0;j<_.length;j++)if(j<P.items.length){if(N=this.validateAll(_[j],P.items[j],[j],["items",j],$+"/"+j))return N}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(N=this.createError(R.ARRAY_ADDITIONAL_ITEMS,{},"/"+j,"/additionalItems",null,_,P),this.handleError(N)))return N}else if(N=this.validateAll(_[j],P.additionalItems,[j],["additionalItems"],$+"/"+j))return N}}else for(j=0;j<_.length;j++)if(N=this.validateAll(_[j],P.items,[j],["items"],$+"/"+j))return N;return null},s.prototype.validateObject=function(_,P,$){return typeof _!="object"||_===null||Array.isArray(_)?null:this.validateObjectMinMaxProperties(_,P,$)||this.validateObjectRequiredProperties(_,P,$)||this.validateObjectProperties(_,P,$)||this.validateObjectDependencies(_,P,$)||null},s.prototype.validateObjectMinMaxProperties=function(_,P){var $=Object.keys(_),N;return P.minProperties!==void 0&&$.length<P.minProperties&&(N=this.createError(R.OBJECT_PROPERTIES_MINIMUM,{propertyCount:$.length,minimum:P.minProperties},"","/minProperties",null,_,P),this.handleError(N))||P.maxProperties!==void 0&&$.length>P.maxProperties&&(N=this.createError(R.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:$.length,maximum:P.maxProperties},"","/maxProperties",null,_,P),this.handleError(N))?N:null},s.prototype.validateObjectRequiredProperties=function(_,P){if(P.required!==void 0)for(var $=0;$<P.required.length;$++){var N=P.required[$];if(_[N]===void 0){var j=this.createError(R.OBJECT_REQUIRED,{key:N},"","/required/"+$,null,_,P);if(this.handleError(j))return j}}return null},s.prototype.validateObjectProperties=function(_,P,$){var N;for(var j in _){var Y=$+"/"+j.replace(/~/g,"~0").replace(/\//g,"~1"),J=!1;if(P.properties!==void 0&&P.properties[j]!==void 0&&(J=!0,N=this.validateAll(_[j],P.properties[j],[j],["properties",j],Y)))return N;if(P.patternProperties!==void 0)for(var ne in P.patternProperties){var pe=new RegExp(ne);if(pe.test(j)&&(J=!0,N=this.validateAll(_[j],P.patternProperties[ne],[j],["patternProperties",ne],Y)))return N}if(J)this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(N=this.createError(R.OBJECT_ADDITIONAL_PROPERTIES,{key:j},"","/additionalProperties",null,_,P).prefixWith(j,null),this.handleError(N)))return N}else if(N=this.validateAll(_[j],P.additionalProperties,[j],["additionalProperties"],Y))return N}else this.trackUnknownProperties&&!this.knownPropertyPaths[Y]&&(this.unknownPropertyPaths[Y]=!0)}return null},s.prototype.validateObjectDependencies=function(_,P,$){var N;if(P.dependencies!==void 0){for(var j in P.dependencies)if(_[j]!==void 0){var Y=P.dependencies[j];if(typeof Y=="string"){if(_[Y]===void 0&&(N=this.createError(R.OBJECT_DEPENDENCY_KEY,{key:j,missing:Y},"","",null,_,P).prefixWith(null,j).prefixWith(null,"dependencies"),this.handleError(N)))return N}else if(Array.isArray(Y))for(var J=0;J<Y.length;J++){var ne=Y[J];if(_[ne]===void 0&&(N=this.createError(R.OBJECT_DEPENDENCY_KEY,{key:j,missing:ne},"","/"+J,null,_,P).prefixWith(null,j).prefixWith(null,"dependencies"),this.handleError(N)))return N}else if(N=this.validateAll(_,Y,[],["dependencies",j],$))return N}}return null},s.prototype.validateCombinations=function(_,P,$){return this.validateAllOf(_,P,$)||this.validateAnyOf(_,P,$)||this.validateOneOf(_,P,$)||this.validateNot(_,P,$)||null},s.prototype.validateAllOf=function(_,P,$){if(P.allOf===void 0)return null;for(var N,j=0;j<P.allOf.length;j++){var Y=P.allOf[j];if(N=this.validateAll(_,Y,[],["allOf",j],$))return N}return null},s.prototype.validateAnyOf=function(_,P,$){if(P.anyOf===void 0)return null;var N=[],j=this.errors.length,Y,J;this.trackUnknownProperties&&(Y=this.unknownPropertyPaths,J=this.knownPropertyPaths);for(var ne=!0,pe=0;pe<P.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Xe=P.anyOf[pe],xe=this.errors.length,he=this.validateAll(_,Xe,[],["anyOf",pe],$);if(he===null&&xe===this.errors.length){if(this.errors=this.errors.slice(0,j),this.trackUnknownProperties){for(var Ee in this.knownPropertyPaths)J[Ee]=!0,delete Y[Ee];for(var vt in this.unknownPropertyPaths)J[vt]||(Y[vt]=!0);ne=!1;continue}return null}he&&N.push(he.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=Y,this.knownPropertyPaths=J),ne)return N=N.concat(this.errors.slice(j)),this.errors=this.errors.slice(0,j),this.createError(R.ANY_OF_MISSING,{},"","/anyOf",N,_,P)},s.prototype.validateOneOf=function(_,P,$){if(P.oneOf===void 0)return null;var N=null,j=[],Y=this.errors.length,J,ne;this.trackUnknownProperties&&(J=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var pe=0;pe<P.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Xe=P.oneOf[pe],xe=this.errors.length,he=this.validateAll(_,Xe,[],["oneOf",pe],$);if(he===null&&xe===this.errors.length){if(N===null)N=pe;else return this.errors=this.errors.slice(0,Y),this.createError(R.ONE_OF_MULTIPLE,{index1:N,index2:pe},"","/oneOf",null,_,P);if(this.trackUnknownProperties){for(var Ee in this.knownPropertyPaths)ne[Ee]=!0,delete J[Ee];for(var vt in this.unknownPropertyPaths)ne[vt]||(J[vt]=!0)}}else he&&j.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=J,this.knownPropertyPaths=ne),N===null?(j=j.concat(this.errors.slice(Y)),this.errors=this.errors.slice(0,Y),this.createError(R.ONE_OF_MISSING,{},"","/oneOf",j,_,P)):(this.errors=this.errors.slice(0,Y),null)},s.prototype.validateNot=function(_,P,$){if(P.not===void 0)return null;var N=this.errors.length,j,Y;this.trackUnknownProperties&&(j=this.unknownPropertyPaths,Y=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var J=this.validateAll(_,P.not,null,null,$),ne=this.errors.slice(N);return this.errors=this.errors.slice(0,N),this.trackUnknownProperties&&(this.unknownPropertyPaths=j,this.knownPropertyPaths=Y),J===null&&ne.length===0?this.createError(R.NOT_PASSED,{},"","/not",null,_,P):null},s.prototype.validateHypermedia=function(_,P,$){if(!P.links)return null;for(var N,j=0;j<P.links.length;j++){var Y=P.links[j];if(Y.rel==="describedby"){for(var J=new i(Y.href),ne=!0,pe=0;pe<J.varNames.length;pe++)if(!(J.varNames[pe]in _)){ne=!1;break}if(ne){var Xe=J.fillFromObject(_),xe={$ref:Xe};if(N=this.validateAll(_,xe,[],["links",j],$))return N}}}};function d(k){var _=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return _?{href:_[0]||"",protocol:_[1]||"",authority:_[2]||"",host:_[3]||"",hostname:_[4]||"",port:_[5]||"",pathname:_[6]||"",search:_[7]||"",hash:_[8]||""}:null}function m(k,_){function P($){var N=[];return $.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(j){j==="/.."?N.pop():N.push(j)}),N.join("").replace(/^\//,$.charAt(0)==="/"?"/":"")}return _=d(_||""),k=d(k||""),!_||!k?null:(_.protocol||k.protocol)+(_.protocol||_.authority?_.authority:k.authority)+P(_.protocol||_.authority||_.pathname.charAt(0)==="/"?_.pathname:_.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+_.pathname:k.pathname)+(_.protocol||_.authority||_.pathname?_.search:_.search||k.search)+_.hash}function g(k){return k.split("#")[0]}function y(k,_){if(k&&typeof k=="object")if(_===void 0?_=k.id:typeof k.id=="string"&&(_=m(_,k.id),k.id=_),Array.isArray(k))for(var P=0;P<k.length;P++)y(k[P],_);else{typeof k.$ref=="string"&&(k.$ref=m(_,k.$ref));for(var $ in k)$!=="enum"&&y(k[$],_)}}function w(k){k=k||"en";var _=B[k];return function(P){var $=_[P.code]||q[P.code];if(typeof $!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var N=P.params;return $.replace(/\{([^{}]*)\}/g,function(j,Y){var J=N[Y];return typeof J=="string"||typeof J=="number"?J:j})}}var R={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},x={};for(var T in R)x[R[T]]=T;var q={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 L(k,_,P,$,N){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+$);this.message="",this.params=_,this.code=k,this.dataPath=P||"",this.schemaPath=$||"",this.subErrors=N||null;var j=new Error(this.message);if(this.stack=j.stack||j.stacktrace,!this.stack)try{throw j}catch(Y){this.stack=Y.stack||Y.stacktrace}}L.prototype=Object.create(Error.prototype),L.prototype.constructor=L,L.prototype.name="ValidationError",L.prototype.prefixWith=function(k,_){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),_!==null&&(_=_.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+_+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,_);return this};function V(k,_){if(_.substring(0,k.length)===k){var P=_.substring(k.length);if(_.length>0&&_.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var B={};function K(k){var _=new s,P,$,N={setErrorReporter:function(j){return typeof j=="string"?this.language(j):($=j,!0)},addFormat:function(){_.addFormat.apply(_,arguments)},language:function(j){return j?(B[j]||(j=j.split("-")[0]),B[j]?(P=j,j):!1):P},addLanguage:function(j,Y){var J;for(J in R)Y[J]&&!Y[R[J]]&&(Y[R[J]]=Y[J]);var ne=j.split("-")[0];if(!B[ne])B[j]=Y,B[ne]=Y;else{B[j]=Object.create(B[ne]);for(J in Y)typeof B[ne][J]>"u"&&(B[ne][J]=Y[J]),B[j][J]=Y[J]}return this},freshApi:function(j){var Y=K();return j&&Y.language(j),Y},validate:function(j,Y,J,ne){var pe=w(P),Xe=$?function(Ee,vt,Ct){return $(Ee,vt,Ct)||pe(Ee,vt,Ct)}:pe,xe=new s(_,!1,Xe,J,ne);typeof Y=="string"&&(Y={$ref:Y}),xe.addSchema("",Y);var he=xe.validateAll(j,Y,null,null,"");return!he&&ne&&(he=xe.banUnknownProperties(j,Y)),this.error=he,this.missing=xe.missing,this.valid=he===null,this.valid},validateResult:function(){var j={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(j,arguments),j},validateMultiple:function(j,Y,J,ne){var pe=w(P),Xe=$?function(Ee,vt,Ct){return $(Ee,vt,Ct)||pe(Ee,vt,Ct)}:pe,xe=new s(_,!0,Xe,J,ne);typeof Y=="string"&&(Y={$ref:Y}),xe.addSchema("",Y),xe.validateAll(j,Y,null,null,""),ne&&xe.banUnknownProperties(j,Y);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=xe.errors,he.missing=xe.missing,he.valid=he.errors.length===0,he},addSchema:function(){return _.addSchema.apply(_,arguments)},getSchema:function(){return _.getSchema.apply(_,arguments)},getSchemaMap:function(){return _.getSchemaMap.apply(_,arguments)},getSchemaUris:function(){return _.getSchemaUris.apply(_,arguments)},getMissingUris:function(){return _.getMissingUris.apply(_,arguments)},dropSchemas:function(){_.dropSchemas.apply(_,arguments)},defineKeyword:function(){_.defineKeyword.apply(_,arguments)},defineError:function(j,Y,J){if(typeof j!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(j))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof Y!="number"||Y%1!==0||Y<1e4)throw new Error("Code number must be an integer > 10000");if(typeof R[j]<"u")throw new Error("Error already defined: "+j+" as "+R[j]);if(typeof x[Y]<"u")throw new Error("Error code already used: "+x[Y]+" as "+Y);R[j]=Y,x[Y]=j,q[j]=q[Y]=J;for(var ne in B){var pe=B[ne];pe[j]&&(pe[Y]=pe[Y]||pe[j])}},reset:function(){_.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:m,getDocumentUri:g,errorCodes:R};return N.language(k||"en"),N}var X=K();return X.addLanguage("en-gb",q),X.tv4=X,X})});var ku=F(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.regexpCode=Ge.getEsmExportName=Ge.getProperty=Ge.safeStringify=Ge.stringify=Ge.strConcat=Ge.addCodeArg=Ge.str=Ge._=Ge.nil=Ge._Code=Ge.Name=Ge.IDENTIFIER=Ge._CodeOrName=void 0;var Iu=class{};Ge._CodeOrName=Iu;Ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Wo=class extends Iu{constructor(e){if(super(),!Ge.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}}};Ge.Name=Wo;var yn=class extends Iu{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 Wo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ge._Code=yn;Ge.nil=new yn("");function eC(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Sb(r,e[n]),r.push(t[++n]);return new yn(r)}Ge._=eC;var bb=new yn("+");function tC(t,...e){let r=[Pu(t[0])],n=0;for(;n<e.length;)r.push(bb),Sb(r,e[n]),r.push(bb,Pu(t[++n]));return TL(r),new yn(r)}Ge.str=tC;function Sb(t,e){e instanceof yn?t.push(...e._items):e instanceof Wo?t.push(e):t.push($L(e))}Ge.addCodeArg=Sb;function TL(t){let e=1;for(;e<t.length-1;){if(t[e]===bb){let r=AL(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function AL(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Wo||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 Wo))return`"${t}${e.slice(1)}`}function qL(t,e){return e.emptyStr()?t:t.emptyStr()?e:tC`${t}${e}`}Ge.strConcat=qL;function $L(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Pu(Array.isArray(t)?t.join(","):t)}function ML(t){return new yn(Pu(t))}Ge.stringify=ML;function Pu(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ge.safeStringify=Pu;function NL(t){return typeof t=="string"&&Ge.IDENTIFIER.test(t)?new yn(`.${t}`):eC`[${t}]`}Ge.getProperty=NL;function DL(t){if(typeof t=="string"&&Ge.IDENTIFIER.test(t))return new yn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ge.getEsmExportName=DL;function FL(t){return new yn(t.toString())}Ge.regexpCode=FL});var xb=F(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ValueScope=Nr.ValueScopeName=Nr.Scope=Nr.varKinds=Nr.UsedValueState=void 0;var Mr=ku(),wb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Zp;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Zp||(Nr.UsedValueState=Zp={}));Nr.varKinds={const:new Mr.Name("const"),let:new Mr.Name("let"),var:new Mr.Name("var")};var Xp=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Mr.Name?e:this.name(e)}name(e){return new Mr.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}}};Nr.Scope=Xp;var eh=class extends Mr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Mr._)`.${new Mr.Name(r)}[${n}]`}};Nr.ValueScopeName=eh;var LL=(0,Mr._)`\n`,_b=class extends Xp{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?LL:Mr.nil}}get(){return this._scope}name(e){return new eh(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,Mr._)`${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=Mr.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,Zp.Started);let m=r(d);if(m){let g=this.opts.es5?Nr.varKinds.var:Nr.varKinds.const;s=(0,Mr._)`${s}${g} ${d} = ${m};${this.opts._n}`}else if(m=i?.(d))s=(0,Mr._)`${s}${m}${this.opts._n}`;else throw new wb(d);f.set(d,Zp.Completed)})}return s}};Nr.ValueScope=_b});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=ku(),Bn=xb(),$s=ku();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return $s._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return $s.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return $s.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return $s.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return $s.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return $s.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return $s.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return $s.Name}});var ih=xb();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return ih.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return ih.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return ih.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return ih.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 Ji=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Rb=class extends Ji{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Bn.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=El(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},th=class extends Ji{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=El(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return nh(e,this.rhs)}},Eb=class extends th{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Cb=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ob=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ib=class extends Ji{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Pb=class extends Ji{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=El(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Tu=class extends Ji{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)||(jL(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Yo(e,r.names),{})}},Yi=class extends Tu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},kb=class extends Tu{},Rl=class extends Yi{};Rl.kind="else";var zo=class t extends Yi{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 Rl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(rC(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=El(this.condition,e,r),this}get names(){let e=super.names;return nh(e,this.condition),this.else&&Yo(e,this.else.names),e}};zo.kind="if";var Jo=class extends Yi{};Jo.kind="for";var Tb=class extends Jo{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=El(this.iteration,e,r),this}get names(){return Yo(super.names,this.iteration.names)}},Ab=class extends Jo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Bn.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=nh(super.names,this.from);return nh(e,this.to)}},rh=class extends Jo{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=El(this.iterable,e,r),this}get names(){return Yo(super.names,this.iterable.names)}},Au=class extends Yi{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)}};Au.kind="func";var qu=class extends Tu{render(e){return"return "+super.render(e)}};qu.kind="return";var qb=class extends Yi{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&&Yo(e,this.catch.names),this.finally&&Yo(e,this.finally.names),e}},$u=class extends Yi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};$u.kind="catch";var Mu=class extends Yi{render(e){return"finally"+super.render(e)}};Mu.kind="finally";var $b=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Bn.Scope({parent:e}),this._nodes=[new kb]}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 Rb(e,s,n)),s}const(e,r,n){return this._def(Bn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Bn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Bn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new th(e,r,n))}add(e,r){return this._leafNode(new Eb(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Pb(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 Rl)}endIf(){return this._endBlockNode(zo,Rl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Tb(e),r)}forRange(e,r,n,i,s=this.opts.es5?Bn.varKinds.var:Bn.varKinds.let){let a=this._scope.toName(e);return this._for(new Ab(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Bn.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 rh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Bn.varKinds.var:Bn.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 rh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Jo)}label(e){return this._leafNode(new Cb(e))}break(e){return this._leafNode(new Ob(e))}return(e){let r=new qu;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(qu)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new qb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new $u(s),r(s)}return n&&(this._currNode=i.finally=new Mu,this.code(n)),this._endBlockNode($u,Mu)}throw(e){return this._leafNode(new Ib(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 Au(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Au)}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=$b;function Yo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function nh(t,e){return e instanceof Be._CodeOrName?Yo(t,e.names):t}function El(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 jL(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function rC(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${Mb(t)}`}Ae.not=rC;var UL=nC(Ae.operators.AND);function HL(...t){return t.reduce(UL)}Ae.and=HL;var BL=nC(Ae.operators.OR);function VL(...t){return t.reduce(BL)}Ae.or=VL;function nC(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${Mb(e)} ${t} ${Mb(r)}`}function Mb(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(),WL=ku();function zL(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=zL;function JL(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(oC(t,e),!aC(e,t.self.RULES.all))}De.alwaysValidSchema=JL;function oC(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]||uC(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=oC;function aC(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=aC;function YL(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=YL;function GL({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=GL;function KL(t){return lC(decodeURIComponent(t))}De.unescapeFragment=KL;function QL(t){return encodeURIComponent(Db(t))}De.escapeFragment=QL;function Db(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Db;function lC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=lC;function ZL(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=ZL;function iC({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:iC({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} || {}`),Fb(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:cC}),items:iC({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 cC(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,pt._)`{}`);return e!==void 0&&Fb(t,r,e),r}De.evaluatedPropsToName=cC;function Fb(t,e,r){Object.keys(r).forEach(n=>t.assign((0,pt._)`${e}${(0,pt.getProperty)(n)}`,!0))}De.setEvaluated=Fb;var sC={};function XL(t,e){return t.scopeValue("func",{ref:e,code:sC[e.code]||(sC[e.code]=new WL._Code(e.code))})}De.useFunc=XL;var Nb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Nb||(De.Type=Nb={}));function ej(t,e,r){if(t instanceof pt.Name){let n=e===Nb.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():"/"+Db(t)}De.getErrorPath=ej;function uC(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=uC});var Gi=F(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});var or=Ne(),tj={data:new or.Name("data"),valCxt:new or.Name("valCxt"),instancePath:new or.Name("instancePath"),parentData:new or.Name("parentData"),parentDataProperty:new or.Name("parentDataProperty"),rootData:new or.Name("rootData"),dynamicAnchors:new or.Name("dynamicAnchors"),vErrors:new or.Name("vErrors"),errors:new or.Name("errors"),this:new or.Name("this"),self:new or.Name("self"),scope:new or.Name("scope"),json:new or.Name("json"),jsonPos:new or.Name("jsonPos"),jsonLen:new or.Name("jsonLen"),jsonPart:new or.Name("jsonPart")};Lb.default=tj});var Nu=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.extendErrors=ar.resetErrorsCount=ar.reportExtraError=ar.reportError=ar.keyword$DataError=ar.keywordError=void 0;var ze=Ne(),sh=We(),Rr=Gi();ar.keywordError={message:({keyword:t})=>(0,ze.str)`must pass "${t}" keyword validation`};ar.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 rj(t,e=ar.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:l}=i,f=pC(t,e,r);n??(a||l)?fC(s,f):dC(i,(0,ze._)`[${f}]`)}ar.reportError=rj;function nj(t,e=ar.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,l=pC(t,e,r);fC(i,l),s||a||dC(n,Rr.default.vErrors)}ar.reportExtraError=nj;function ij(t,e){t.assign(Rr.default.errors,e),t.if((0,ze._)`${Rr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ze._)`${Rr.default.vErrors}.length`,e),()=>t.assign(Rr.default.vErrors,null)))}ar.resetErrorsCount=ij;function sj({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,Rr.default.errors,l=>{t.const(a,(0,ze._)`${Rr.default.vErrors}[${l}]`),t.if((0,ze._)`${a}.instancePath === undefined`,()=>t.assign((0,ze._)`${a}.instancePath`,(0,ze.strConcat)(Rr.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))})}ar.extendErrors=sj;function fC(t,e){let r=t.const("err",e);t.if((0,ze._)`${Rr.default.vErrors} === null`,()=>t.assign(Rr.default.vErrors,(0,ze._)`[${r}]`),(0,ze._)`${Rr.default.vErrors}.push(${r})`),t.code((0,ze._)`${Rr.default.errors}++`)}function dC(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 Go={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 pC(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ze._)`{}`:oj(t,e,r)}function oj(t,e,r={}){let{gen:n,it:i}=t,s=[aj(i,r),lj(t,r)];return cj(t,e,s),n.object(...s)}function aj({errorPath:t},{instancePath:e}){let r=e?(0,ze.str)`${t}${(0,sh.getErrorPath)(e,sh.Type.Str)}`:t;return[Rr.default.instancePath,(0,ze.strConcat)(Rr.default.instancePath,r)]}function lj({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,sh.getErrorPath)(r,sh.Type.Str)}`),[Go.schemaPath,i]}function cj(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([Go.keyword,i],[Go.params,typeof e=="function"?e(t):e||(0,ze._)`{}`]),f.messages&&n.push([Go.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Go.schema,a],[Go.parentSchema,(0,ze._)`${m}${g}`],[Rr.default.data,s]),d&&n.push([Go.propertyName,d])}});var mC=F(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.boolOrEmptySchema=Cl.topBoolOrEmptySchema=void 0;var uj=Nu(),fj=Ne(),dj=Gi(),pj={message:"boolean schema is false"};function hj(t){let{gen:e,schema:r,validateName:n}=t;r===!1?hC(t,!1):typeof r=="object"&&r.$async===!0?e.return(dj.default.data):(e.assign((0,fj._)`${n}.errors`,null),e.return(!0))}Cl.topBoolOrEmptySchema=hj;function mj(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),hC(t)):r.var(e,!0)}Cl.boolOrEmptySchema=mj;function hC(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,uj.reportError)(i,pj,void 0,e)}});var jb=F(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.getRules=Ol.isJSONType=void 0;var gj=["string","number","integer","boolean","null","object","array"],yj=new Set(gj);function vj(t){return typeof t=="string"&&yj.has(t)}Ol.isJSONType=vj;function bj(){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:{}}}Ol.getRules=bj});var Ub=F(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.shouldUseRule=Ms.shouldUseGroup=Ms.schemaHasRulesForType=void 0;function Sj({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&gC(t,n)}Ms.schemaHasRulesForType=Sj;function gC(t,e){return e.rules.some(r=>yC(t,r))}Ms.shouldUseGroup=gC;function yC(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))}Ms.shouldUseRule=yC});var Du=F(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.reportTypeError=lr.checkDataTypes=lr.checkDataType=lr.coerceAndCheckDataType=lr.getJSONTypes=lr.getSchemaTypes=lr.DataType=void 0;var wj=jb(),_j=Ub(),xj=Nu(),Ie=Ne(),vC=We(),Il;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Il||(lr.DataType=Il={}));function Rj(t){let e=bC(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}lr.getSchemaTypes=Rj;function bC(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(wj.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}lr.getJSONTypes=bC;function Ej(t,e){let{gen:r,data:n,opts:i}=t,s=Cj(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,_j.schemaHasRulesForType)(t,e[0]));if(a){let l=Bb(e,n,i.strictNumbers,Il.Wrong);r.if(l,()=>{s.length?Oj(t,e,s):Vb(t)})}return a}lr.coerceAndCheckDataType=Ej;var SC=new Set(["string","number","integer","boolean","null"]);function Cj(t,e){return e?t.filter(r=>SC.has(r)||e==="array"&&r==="array"):[]}function Oj(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Ie._)`typeof ${i}`),l=n.let("coerced",(0,Ie._)`undefined`);s.coerceTypes==="array"&&n.if((0,Ie._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ie._)`${i}[0]`).assign(a,(0,Ie._)`typeof ${i}`).if(Bb(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Ie._)`${l} !== undefined`);for(let d of r)(SC.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),Vb(t),n.endIf(),n.if((0,Ie._)`${l} !== undefined`,()=>{n.assign(i,l),Ij(t,l)});function f(d){switch(d){case"string":n.elseIf((0,Ie._)`${a} == "number" || ${a} == "boolean"`).assign(l,(0,Ie._)`"" + ${i}`).elseIf((0,Ie._)`${i} === null`).assign(l,(0,Ie._)`""`);return;case"number":n.elseIf((0,Ie._)`${a} == "boolean" || ${i} === null
|
|
23
|
+
`+new Error().stack),b=!1}return h.apply(this,arguments)},h)}var P={};function $(u,h){e.deprecationHandler!=null&&e.deprecationHandler(u,h),P[u]||(k(h),P[u]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function N(u){return typeof Function<"u"&&u instanceof Function||Object.prototype.toString.call(u)==="[object Function]"}function j(u){var h,b;for(b in u)s(u,b)&&(h=u[b],N(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 Y(u,h){var b=g({},u),S;for(S in h)s(h,S)&&(i(u[S])&&i(h[S])?(b[S]={},g(b[S],u[S]),g(b[S],h[S])):h[S]!=null?b[S]=h[S]:delete b[S]);for(S in u)s(u,S)&&!s(h,S)&&i(u[S])&&(b[S]=g({},b[S]));return b}function J(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 Xe(u,h,b){var S=this._calendar[u]||this._calendar.sameElse;return N(S)?S.call(h,b):S}function xe(u,h,b){var S=""+Math.abs(u),C=h-S.length,M=u>=0;return(M?b?"+":"":"-")+Math.pow(10,Math.max(0,C)).toString().substr(1)+S}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,Ee=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vt={},Ct={};function ce(u,h,b,S){var C=S;typeof S=="string"&&(C=function(){return this[S]()}),u&&(Ct[u]=C),h&&(Ct[h[0]]=function(){return xe(C.apply(this,arguments),h[1],h[2])}),b&&(Ct[b]=function(){return this.localeData().ordinal(C.apply(this,arguments),u)})}function pr(u){return u.match(/\[[\s\S]/)?u.replace(/^\[|\]$/g,""):u.replace(/\\/g,"")}function oi(u){var h=u.match(he),b,S;for(b=0,S=h.length;b<S;b++)Ct[h[b]]?h[b]=Ct[h[b]]:h[b]=pr(h[b]);return function(C){var M="",z;for(z=0;z<S;z++)M+=N(h[z])?h[z].call(C,u):h[z];return M}}function xt(u,h){return u.isValid()?(h=zr(h,u.localeData()),vt[h]=vt[h]||oi(h),vt[h](u)):u.localeData().invalidDate()}function zr(u,h){var b=5;function S(C){return h.longDateFormat(C)||C}for(Ee.lastIndex=0;b>=0&&Ee.test(u);)u=u.replace(Ee,S),Ee.lastIndex=0,b-=1;return u}var Or={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(S){return S==="MMMM"||S==="MM"||S==="DD"||S==="dddd"?S.slice(1):S}).join(""),this._longDateFormat[u])}var mt="Invalid date";function nn(){return this._invalidDate}var oo="%d",Jt=/\d{1,2}/;function ao(u){return this._ordinal.replace("%d",u)}var Vg={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 Cn(u,h,b,S){var C=this._relativeTime[b];return N(C)?C(u,h,b,S):C.replace(/%d/i,u)}function Ed(u,h){var b=this._relativeTime[u>0?"future":"past"];return N(b)?b(h):b.replace(/%s/i,h)}var Cd={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 Yt(u){return typeof u=="string"?Cd[u]||Cd[u.toLowerCase()]:void 0}function hr(u){var h={},b,S;for(S in u)s(u,S)&&(b=Yt(S),b&&(h[b]=u[S]));return h}var lo={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 Oa(u){var h=[],b;for(b in u)s(u,b)&&h.push({unit:b,priority:lo[b]});return h.sort(function(S,C){return S.priority-C.priority}),h}var Od=/\d/,Ut=/\d\d/,Id=/\d{3}/,Ci=/\d{4}/,On=/[+-]?\d{6}/,st=/\d\d?/,Ia=/\d\d\d\d?/,Pa=/\d\d\d\d\d\d?/,cs=/\d{1,3}/,co=/\d{1,4}/,us=/[+-]?\d{1,6}/,ai=/\d+/,fs=/[+-]?\d+/,qc=/Z|[+-]\d\d:?\d\d/gi,ka=/Z|[+-]\d\d(?::?\d\d)?/gi,Wg=/[+-]?\d+(\.\d{1,3})?/,uo=/[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,Oi=/^[1-9]\d?/,Ta=/^([1-9]\d|\d)/,Aa;Aa={};function ae(u,h,b){Aa[u]=N(h)?h:function(S,C){return S&&b?b:h}}function zg(u,h){return s(Aa,u)?Aa[u](h._strict,h._locale):new RegExp(Jg(u))}function Jg(u){return sn(u.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(h,b,S,C,M){return b||S||C||M}))}function sn(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ir(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=Ir(h)),b}var $c={};function Ke(u,h){var b,S=h,C;for(typeof u=="string"&&(u=[u]),f(h)&&(S=function(M,z){z[h]=qe(M)}),C=u.length,b=0;b<C;b++)$c[u[b]]=S}function fo(u,h){Ke(u,function(b,S,C,M){C._w=C._w||{},h(b,C._w,C,M)})}function Mc(u,h,b){h!=null&&s($c,u)&&$c[u](h,b._a,b,u)}function qa(u){return u%4===0&&u%100!==0||u%400===0}var Gt=0,In=1,on=2,At=3,Pr=4,Pn=5,Ii=6,Pd=7,Yg=8;ce("Y",0,0,function(){var u=this.year();return u<=9999?xe(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"),ae("Y",fs),ae("YY",st,Ut),ae("YYYY",co,Ci),ae("YYYYY",us,On),ae("YYYYYY",us,On),Ke(["YYYYY","YYYYYY"],Gt),Ke("YYYY",function(u,h){h[Gt]=u.length===2?e.parseTwoDigitYear(u):qe(u)}),Ke("YY",function(u,h){h[Gt]=e.parseTwoDigitYear(u)}),Ke("Y",function(u,h){h[Gt]=parseInt(u,10)});function po(u){return qa(u)?366:365}e.parseTwoDigitYear=function(u){return qe(u)+(qe(u)>68?1900:2e3)};var kd=ds("FullYear",!0);function Gg(){return qa(this.year())}function ds(u,h){return function(b){return b!=null?(mo(this,u,b),e.updateOffset(this,h),this):ho(this,u)}}function ho(u,h){if(!u.isValid())return NaN;var b=u._d,S=u._isUTC;switch(h){case"Milliseconds":return S?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return S?b.getUTCSeconds():b.getSeconds();case"Minutes":return S?b.getUTCMinutes():b.getMinutes();case"Hours":return S?b.getUTCHours():b.getHours();case"Date":return S?b.getUTCDate():b.getDate();case"Day":return S?b.getUTCDay():b.getDay();case"Month":return S?b.getUTCMonth():b.getMonth();case"FullYear":return S?b.getUTCFullYear():b.getFullYear();default:return NaN}}function mo(u,h,b){var S,C,M,z,se;if(!(!u.isValid()||isNaN(b))){switch(S=u._d,C=u._isUTC,h){case"Milliseconds":return void(C?S.setUTCMilliseconds(b):S.setMilliseconds(b));case"Seconds":return void(C?S.setUTCSeconds(b):S.setSeconds(b));case"Minutes":return void(C?S.setUTCMinutes(b):S.setMinutes(b));case"Hours":return void(C?S.setUTCHours(b):S.setHours(b));case"Date":return void(C?S.setUTCDate(b):S.setDate(b));case"FullYear":break;default:return}M=b,z=u.month(),se=u.date(),se=se===29&&z===1&&!qa(M)?28:se,C?S.setUTCFullYear(M,z,se):S.setFullYear(M,z,se)}}function Kg(u){return u=Yt(u),N(this[u])?this[u]():this}function $a(u,h){if(typeof u=="object"){u=hr(u);var b=Oa(u),S,C=b.length;for(S=0;S<C;S++)this[b[S].unit](u[b[S].unit])}else if(u=Yt(u),N(this[u]))return this[u](h);return this}function Qg(u,h){return(u%h+h)%h}var Rt;Array.prototype.indexOf?Rt=Array.prototype.indexOf:Rt=function(u){var h;for(h=0;h<this.length;++h)if(this[h]===u)return h;return-1};function Nc(u,h){if(isNaN(u)||isNaN(h))return NaN;var b=Qg(h,12);return u+=(h-b)/12,b===1?qa(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)}),ae("M",st,Oi),ae("MM",st,Ut),ae("MMM",function(u,h){return h.monthsShortRegex(u)}),ae("MMMM",function(u,h){return h.monthsRegex(u)}),Ke(["M","MM"],function(u,h){h[In]=qe(u)-1}),Ke(["MMM","MMMM"],function(u,h,b,S){var C=b._locale.monthsParse(u,S,b._strict);C!=null?h[In]=C:R(b).invalidMonth=u});var Td="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Dc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Fc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Zg=uo,Xg=uo;function ey(u,h){return u?n(this._months)?this._months[u.month()]:this._months[(this._months.isFormat||Fc).test(h)?"format":"standalone"][u.month()]:n(this._months)?this._months:this._months.standalone}function ty(u,h){return u?n(this._monthsShort)?this._monthsShort[u.month()]:this._monthsShort[Fc.test(h)?"format":"standalone"][u.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ad(u,h,b){var S,C,M,z=u.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],S=0;S<12;++S)M=y([2e3,S]),this._shortMonthsParse[S]=this.monthsShort(M,"").toLocaleLowerCase(),this._longMonthsParse[S]=this.months(M,"").toLocaleLowerCase();return b?h==="MMM"?(C=Rt.call(this._shortMonthsParse,z),C!==-1?C:null):(C=Rt.call(this._longMonthsParse,z),C!==-1?C:null):h==="MMM"?(C=Rt.call(this._shortMonthsParse,z),C!==-1?C:(C=Rt.call(this._longMonthsParse,z),C!==-1?C:null)):(C=Rt.call(this._longMonthsParse,z),C!==-1?C:(C=Rt.call(this._shortMonthsParse,z),C!==-1?C:null))}function qd(u,h,b){var S,C,M;if(this._monthsParseExact)return Ad.call(this,u,h,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),S=0;S<12;S++){if(C=y([2e3,S]),b&&!this._longMonthsParse[S]&&(this._longMonthsParse[S]=new RegExp("^"+this.months(C,"").replace(".","")+"$","i"),this._shortMonthsParse[S]=new RegExp("^"+this.monthsShort(C,"").replace(".","")+"$","i")),!b&&!this._monthsParse[S]&&(M="^"+this.months(C,"")+"|^"+this.monthsShort(C,""),this._monthsParse[S]=new RegExp(M.replace(".",""),"i")),b&&h==="MMMM"&&this._longMonthsParse[S].test(u))return S;if(b&&h==="MMM"&&this._shortMonthsParse[S].test(u))return S;if(!b&&this._monthsParse[S].test(u))return S}}function Lc(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,S=u.date();return S=S<29?S:Math.min(S,Nc(u.year(),b)),u._isUTC?u._d.setUTCMonth(b,S):u._d.setMonth(b,S),u}function Ma(u){return u!=null?(Lc(this,u),e.updateOffset(this,!0),this):ho(this,"Month")}function ry(){return Nc(this.year(),this.month())}function $d(u){return this._monthsParseExact?(s(this,"_monthsRegex")||jc.call(this),u?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Zg),this._monthsShortStrictRegex&&u?this._monthsShortStrictRegex:this._monthsShortRegex)}function Na(u){return this._monthsParseExact?(s(this,"_monthsRegex")||jc.call(this),u?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Xg),this._monthsStrictRegex&&u?this._monthsStrictRegex:this._monthsRegex)}function jc(){function u(ve,Me){return Me.length-ve.length}var h=[],b=[],S=[],C,M,z,se;for(C=0;C<12;C++)M=y([2e3,C]),z=sn(this.monthsShort(M,"")),se=sn(this.months(M,"")),h.push(z),b.push(se),S.push(se),S.push(z);h.sort(u),b.sort(u),S.sort(u),this._monthsRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+h.join("|")+")","i")}function ny(u,h,b,S,C,M,z){var se;return u<100&&u>=0?(se=new Date(u+400,h,b,S,C,M,z),isFinite(se.getFullYear())&&se.setFullYear(u)):se=new Date(u,h,b,S,C,M,z),se}function ps(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 go(u,h,b){var S=7+h-b,C=(7+ps(u,0,S).getUTCDay()-h)%7;return-C+S-1}function Da(u,h,b,S,C){var M=(7+b-S)%7,z=go(u,S,C),se=1+7*(h-1)+M+z,ve,Me;return se<=0?(ve=u-1,Me=po(ve)+se):se>po(u)?(ve=u+1,Me=se-po(u)):(ve=u,Me=se),{year:ve,dayOfYear:Me}}function yo(u,h,b){var S=go(u.year(),h,b),C=Math.floor((u.dayOfYear()-S-1)/7)+1,M,z;return C<1?(z=u.year()-1,M=C+an(z,h,b)):C>an(u.year(),h,b)?(M=C-an(u.year(),h,b),z=u.year()+1):(z=u.year(),M=C),{week:M,year:z}}function an(u,h,b){var S=go(u,h,b),C=go(u+1,h,b);return(po(u)-S+C)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),ae("w",st,Oi),ae("ww",st,Ut),ae("W",st,Oi),ae("WW",st,Ut),fo(["w","ww","W","WW"],function(u,h,b,S){h[S.substr(0,1)]=qe(u)});function Uc(u){return yo(u,this._week.dow,this._week.doy).week}var Hc={dow:0,doy:6};function hs(){return this._week.dow}function Md(){return this._week.doy}function Nd(u){var h=this.localeData().week(this);return u==null?h:this.add((u-h)*7,"d")}function iy(u){var h=yo(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"),ae("d",st),ae("e",st),ae("E",st),ae("dd",function(u,h){return h.weekdaysMinRegex(u)}),ae("ddd",function(u,h){return h.weekdaysShortRegex(u)}),ae("dddd",function(u,h){return h.weekdaysRegex(u)}),fo(["dd","ddd","dddd"],function(u,h,b,S){var C=b._locale.weekdaysParse(u,S,b._strict);C!=null?h.d=C:R(b).invalidWeekday=u}),fo(["d","e","E"],function(u,h,b,S){h[S]=qe(u)});function Dd(u,h){return typeof u!="string"?u:isNaN(u)?(u=h.weekdaysParse(u),typeof u=="number"?u:null):parseInt(u,10)}function Fd(u,h){return typeof u=="string"?h.weekdaysParse(u)%7||7:isNaN(u)?null:u}function Fa(u,h){return u.slice(h,7).concat(u.slice(0,h))}var Ld="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),jd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),sy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),oy=uo,Ud=uo,ay=uo;function ly(u,h){var b=n(this._weekdays)?this._weekdays:this._weekdays[u&&u!==!0&&this._weekdays.isFormat.test(h)?"format":"standalone"];return u===!0?Fa(b,this._week.dow):u?b[u.day()]:b}function cy(u){return u===!0?Fa(this._weekdaysShort,this._week.dow):u?this._weekdaysShort[u.day()]:this._weekdaysShort}function uy(u){return u===!0?Fa(this._weekdaysMin,this._week.dow):u?this._weekdaysMin[u.day()]:this._weekdaysMin}function Bc(u,h,b){var S,C,M,z=u.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],S=0;S<7;++S)M=y([2e3,1]).day(S),this._minWeekdaysParse[S]=this.weekdaysMin(M,"").toLocaleLowerCase(),this._shortWeekdaysParse[S]=this.weekdaysShort(M,"").toLocaleLowerCase(),this._weekdaysParse[S]=this.weekdays(M,"").toLocaleLowerCase();return b?h==="dddd"?(C=Rt.call(this._weekdaysParse,z),C!==-1?C:null):h==="ddd"?(C=Rt.call(this._shortWeekdaysParse,z),C!==-1?C:null):(C=Rt.call(this._minWeekdaysParse,z),C!==-1?C:null):h==="dddd"?(C=Rt.call(this._weekdaysParse,z),C!==-1||(C=Rt.call(this._shortWeekdaysParse,z),C!==-1)?C:(C=Rt.call(this._minWeekdaysParse,z),C!==-1?C:null)):h==="ddd"?(C=Rt.call(this._shortWeekdaysParse,z),C!==-1||(C=Rt.call(this._weekdaysParse,z),C!==-1)?C:(C=Rt.call(this._minWeekdaysParse,z),C!==-1?C:null)):(C=Rt.call(this._minWeekdaysParse,z),C!==-1||(C=Rt.call(this._weekdaysParse,z),C!==-1)?C:(C=Rt.call(this._shortWeekdaysParse,z),C!==-1?C:null))}function fy(u,h,b){var S,C,M;if(this._weekdaysParseExact)return Bc.call(this,u,h,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),S=0;S<7;S++){if(C=y([2e3,1]).day(S),b&&!this._fullWeekdaysParse[S]&&(this._fullWeekdaysParse[S]=new RegExp("^"+this.weekdays(C,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[S]=new RegExp("^"+this.weekdaysShort(C,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[S]=new RegExp("^"+this.weekdaysMin(C,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[S]||(M="^"+this.weekdays(C,"")+"|^"+this.weekdaysShort(C,"")+"|^"+this.weekdaysMin(C,""),this._weekdaysParse[S]=new RegExp(M.replace(".",""),"i")),b&&h==="dddd"&&this._fullWeekdaysParse[S].test(u))return S;if(b&&h==="ddd"&&this._shortWeekdaysParse[S].test(u))return S;if(b&&h==="dd"&&this._minWeekdaysParse[S].test(u))return S;if(!b&&this._weekdaysParse[S].test(u))return S}}function dy(u){if(!this.isValid())return u!=null?this:NaN;var h=ho(this,"Day");return u!=null?(u=Dd(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 hy(u){if(!this.isValid())return u!=null?this:NaN;if(u!=null){var h=Fd(u,this.localeData());return this.day(this.day()%7?h:h-7)}else return this.day()||7}function my(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Vc.call(this),u?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=oy),this._weekdaysStrictRegex&&u?this._weekdaysStrictRegex:this._weekdaysRegex)}function ut(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Vc.call(this),u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ud),this._weekdaysShortStrictRegex&&u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function at(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Vc.call(this),u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ay),this._weekdaysMinStrictRegex&&u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Vc(){function u(Dt,Mn){return Mn.length-Dt.length}var h=[],b=[],S=[],C=[],M,z,se,ve,Me;for(M=0;M<7;M++)z=y([2e3,1]).day(M),se=sn(this.weekdaysMin(z,"")),ve=sn(this.weekdaysShort(z,"")),Me=sn(this.weekdays(z,"")),h.push(se),b.push(ve),S.push(Me),C.push(se),C.push(ve),C.push(Me);h.sort(u),b.sort(u),S.sort(u),C.sort(u),this._weekdaysRegex=new RegExp("^("+C.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function Wc(){return this.hours()%12||12}function gy(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,Wc),ce("k",["kk",2],0,gy),ce("hmm",0,0,function(){return""+Wc.apply(this)+xe(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+Wc.apply(this)+xe(this.minutes(),2)+xe(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+xe(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+xe(this.minutes(),2)+xe(this.seconds(),2)});function Hd(u,h){ce(u,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),h)})}Hd("a",!0),Hd("A",!1);function Bd(u,h){return h._meridiemParse}ae("a",Bd),ae("A",Bd),ae("H",st,Ta),ae("h",st,Oi),ae("k",st,Oi),ae("HH",st,Ut),ae("hh",st,Ut),ae("kk",st,Ut),ae("hmm",Ia),ae("hmmss",Pa),ae("Hmm",Ia),ae("Hmmss",Pa),Ke(["H","HH"],At),Ke(["k","kk"],function(u,h,b){var S=qe(u);h[At]=S===24?0:S}),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),R(b).bigHour=!0}),Ke("hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S)),R(b).bigHour=!0}),Ke("hmmss",function(u,h,b){var S=u.length-4,C=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Pn]=qe(u.substr(C)),R(b).bigHour=!0}),Ke("Hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S))}),Ke("Hmmss",function(u,h,b){var S=u.length-4,C=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Pn]=qe(u.substr(C))});function yy(u){return(u+"").toLowerCase().charAt(0)==="p"}var Vd=/[ap]\.?m?\.?/i,vy=ds("Hours",!0);function Nt(u,h,b){return u>11?b?"pm":"PM":b?"am":"AM"}var La={calendar:pe,longDateFormat:Or,invalidDate:mt,ordinal:oo,dayOfMonthOrdinalParse:Jt,relativeTime:Vg,months:Td,monthsShort:Dc,week:Hc,weekdays:Ld,weekdaysMin:sy,weekdaysShort:jd,meridiemParse:Vd},Qe={},ms={},Pi;function kr(u,h){var b,S=Math.min(u.length,h.length);for(b=0;b<S;b+=1)if(u[b]!==h[b])return b;return S}function zc(u){return u&&u.toLowerCase().replace("_","-")}function Wd(u){for(var h=0,b,S,C,M;h<u.length;){for(M=zc(u[h]).split("-"),b=M.length,S=zc(u[h+1]),S=S?S.split("-"):null;b>0;){if(C=vo(M.slice(0,b).join("-")),C)return C;if(S&&S.length>=b&&kr(M,S)>=b-1)break;b--}h++}return Pi}function zd(u){return!!(u&&u.match("^[^/\\\\]*$"))}function vo(u){var h=null,b;if(Qe[u]===void 0&&typeof xl<"u"&&xl&&xl.exports&&zd(u))try{h=Pi._abbr,b=nt,b("./locale/"+u),kn(h)}catch{Qe[u]=null}return Qe[u]}function kn(u,h){var b;return u&&(l(h)?b=Tn(u):b=ja(u,h),b?Pi=b:typeof console<"u"&&console.warn&&console.warn("Locale "+u+" not found. Did you forget to load it?")),Pi._abbr}function ja(u,h){if(h!==null){var b,S=La;if(h.abbr=u,Qe[u]!=null)$("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."),S=Qe[u]._config;else if(h.parentLocale!=null)if(Qe[h.parentLocale]!=null)S=Qe[h.parentLocale]._config;else if(b=vo(h.parentLocale),b!=null)S=b._config;else return ms[h.parentLocale]||(ms[h.parentLocale]=[]),ms[h.parentLocale].push({name:u,config:h}),null;return Qe[u]=new J(Y(S,h)),ms[u]&&ms[u].forEach(function(C){ja(C.name,C.config)}),kn(u),Qe[u]}else return delete Qe[u],null}function mr(u,h){if(h!=null){var b,S,C=La;Qe[u]!=null&&Qe[u].parentLocale!=null?Qe[u].set(Y(Qe[u]._config,h)):(S=vo(u),S!=null&&(C=S._config),h=Y(C,h),S==null&&(h.abbr=u),b=new J(h),b.parentLocale=Qe[u],Qe[u]=b),kn(u)}else Qe[u]!=null&&(Qe[u].parentLocale!=null?(Qe[u]=Qe[u].parentLocale,u===kn()&&kn(u)):Qe[u]!=null&&delete Qe[u]);return Qe[u]}function Tn(u){var h;if(u&&u._locale&&u._locale._abbr&&(u=u._locale._abbr),!u)return Pi;if(!n(u)){if(h=vo(u),h)return h;u=[u]}return Wd(u)}function gr(){return ne(Qe)}function Jc(u){var h,b=u._a;return b&&R(u).overflow===-2&&(h=b[In]<0||b[In]>11?In:b[on]<1||b[on]>Nc(b[Gt],b[In])?on:b[At]<0||b[At]>24||b[At]===24&&(b[Pr]!==0||b[Pn]!==0||b[Ii]!==0)?At:b[Pr]<0||b[Pr]>59?Pr:b[Pn]<0||b[Pn]>59?Pn:b[Ii]<0||b[Ii]>999?Ii:-1,R(u)._overflowDayOfYear&&(h<Gt||h>on)&&(h=on),R(u)._overflowWeeks&&h===-1&&(h=Pd),R(u)._overflowWeekday&&h===-1&&(h=Yg),R(u).overflow=h),u}var Jd=/^\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)?)?$/,li=/^\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)?)?$/,Ua=/Z|[+-]\d\d(?::?\d\d)?/,gs=[["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]],lt=[["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/]],ci=/^\/?Date\((-?\d+)/i,Yc=/^(?:(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}))$/,by={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ha(u){var h,b,S=u._i,C=Jd.exec(S)||li.exec(S),M,z,se,ve,Me=gs.length,Dt=lt.length;if(C){for(R(u).iso=!0,h=0,b=Me;h<b;h++)if(gs[h][1].exec(C[1])){z=gs[h][0],M=gs[h][2]!==!1;break}if(z==null){u._isValid=!1;return}if(C[3]){for(h=0,b=Dt;h<b;h++)if(lt[h][1].exec(C[3])){se=(C[2]||" ")+lt[h][0];break}if(se==null){u._isValid=!1;return}}if(!M&&se!=null){u._isValid=!1;return}if(C[4])if(Ua.exec(C[4]))ve="Z";else{u._isValid=!1;return}u._f=z+(se||"")+(ve||""),Va(u)}else u._isValid=!1}function Sy(u,h,b,S,C,M){var z=[wy(u),Dc.indexOf(h),parseInt(b,10),parseInt(S,10),parseInt(C,10)];return M&&z.push(parseInt(M,10)),z}function wy(u){var h=parseInt(u,10);return h<=49?2e3+h:h<=999?1900+h:h}function _y(u){return u.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Yd(u,h,b){if(u){var S=jd.indexOf(u),C=new Date(h[0],h[1],h[2]).getDay();if(S!==C)return R(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Ba(u,h,b){if(u)return by[u];if(h)return 0;var S=parseInt(b,10),C=S%100,M=(S-C)/100;return M*60+C}function ki(u){var h=Yc.exec(_y(u._i)),b;if(h){if(b=Sy(h[4],h[3],h[2],h[5],h[6],h[7]),!Yd(h[1],b,u))return;u._a=b,u._tzm=Ba(h[8],h[9],h[10]),u._d=ps.apply(null,u._a),u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),R(u).rfc2822=!0}else u._isValid=!1}function xy(u){var h=ci.exec(u._i);if(h!==null){u._d=new Date(+h[1]);return}if(Ha(u),u._isValid===!1)delete u._isValid;else return;if(ki(u),u._isValid===!1)delete u._isValid;else return;u._strict?u._isValid=!1:e.createFromInputFallback(u)}e.createFromInputFallback=_("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 Ti(u,h,b){return u??h??b}function Gd(u){var h=new Date(e.now());return u._useUTC?[h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()]:[h.getFullYear(),h.getMonth(),h.getDate()]}function bo(u){var h,b,S=[],C,M,z;if(!u._d){for(C=Gd(u),u._w&&u._a[on]==null&&u._a[In]==null&&Gc(u),u._dayOfYear!=null&&(z=Ti(u._a[Gt],C[Gt]),(u._dayOfYear>po(z)||u._dayOfYear===0)&&(R(u)._overflowDayOfYear=!0),b=ps(z,0,u._dayOfYear),u._a[In]=b.getUTCMonth(),u._a[on]=b.getUTCDate()),h=0;h<3&&u._a[h]==null;++h)u._a[h]=S[h]=C[h];for(;h<7;h++)u._a[h]=S[h]=u._a[h]==null?h===2?1:0:u._a[h];u._a[At]===24&&u._a[Pr]===0&&u._a[Pn]===0&&u._a[Ii]===0&&(u._nextDay=!0,u._a[At]=0),u._d=(u._useUTC?ps:ny).apply(null,S),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&&(R(u).weekdayMismatch=!0)}}function Gc(u){var h,b,S,C,M,z,se,ve,Me;h=u._w,h.GG!=null||h.W!=null||h.E!=null?(M=1,z=4,b=Ti(h.GG,u._a[Gt],yo(et(),1,4).year),S=Ti(h.W,1),C=Ti(h.E,1),(C<1||C>7)&&(ve=!0)):(M=u._locale._week.dow,z=u._locale._week.doy,Me=yo(et(),M,z),b=Ti(h.gg,u._a[Gt],Me.year),S=Ti(h.w,Me.week),h.d!=null?(C=h.d,(C<0||C>6)&&(ve=!0)):h.e!=null?(C=h.e+M,(h.e<0||h.e>6)&&(ve=!0)):C=M),S<1||S>an(b,M,z)?R(u)._overflowWeeks=!0:ve!=null?R(u)._overflowWeekday=!0:(se=Da(b,S,C,M,z),u._a[Gt]=se.year,u._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Va(u){if(u._f===e.ISO_8601){Ha(u);return}if(u._f===e.RFC_2822){ki(u);return}u._a=[],R(u).empty=!0;var h=""+u._i,b,S,C,M,z,se=h.length,ve=0,Me,Dt;for(C=zr(u._f,u._locale).match(he)||[],Dt=C.length,b=0;b<Dt;b++)M=C[b],S=(h.match(zg(M,u))||[])[0],S&&(z=h.substr(0,h.indexOf(S)),z.length>0&&R(u).unusedInput.push(z),h=h.slice(h.indexOf(S)+S.length),ve+=S.length),Ct[M]?(S?R(u).empty=!1:R(u).unusedTokens.push(M),Mc(M,S,u)):u._strict&&!S&&R(u).unusedTokens.push(M);R(u).charsLeftOver=se-ve,h.length>0&&R(u).unusedInput.push(h),u._a[At]<=12&&R(u).bigHour===!0&&u._a[At]>0&&(R(u).bigHour=void 0),R(u).parsedDateParts=u._a.slice(0),R(u).meridiem=u._meridiem,u._a[At]=Ry(u._locale,u._a[At],u._meridiem),Me=R(u).era,Me!==null&&(u._a[Gt]=u._locale.erasConvertYear(Me,u._a[Gt])),bo(u),Jc(u)}function Ry(u,h,b){var S;return b==null?h:u.meridiemHour!=null?u.meridiemHour(h,b):(u.isPM!=null&&(S=u.isPM(b),S&&h<12&&(h+=12),!S&&h===12&&(h=0)),h)}function Kc(u){var h,b,S,C,M,z,se=!1,ve=u._f.length;if(ve===0){R(u).invalidFormat=!0,u._d=new Date(NaN);return}for(C=0;C<ve;C++)M=0,z=!1,h=B({},u),u._useUTC!=null&&(h._useUTC=u._useUTC),h._f=u._f[C],Va(h),T(h)&&(z=!0),M+=R(h).charsLeftOver,M+=R(h).unusedTokens.length*10,R(h).score=M,se?M<S&&(S=M,b=h):(S==null||M<S||z)&&(S=M,b=h,z&&(se=!0));g(u,b||h)}function Qc(u){if(!u._d){var h=hr(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(S){return S&&parseInt(S,10)}),bo(u)}}function Ey(u){var h=new K(Jc(Zc(u)));return h._nextDay&&(h.add(1,"d"),h._nextDay=void 0),h}function Zc(u){var h=u._i,b=u._f;return u._locale=u._locale||Tn(u._l),h===null||b===void 0&&h===""?q({nullInput:!0}):(typeof h=="string"&&(u._i=h=u._locale.preparse(h)),X(h)?new K(Jc(h)):(d(h)?u._d=h:n(b)?Kc(u):b?Va(u):yr(u),T(u)||(u._d=null),u))}function yr(u){var h=u._i;l(h)?u._d=new Date(e.now()):d(h)?u._d=new Date(h.valueOf()):typeof h=="string"?xy(u):n(h)?(u._a=m(h.slice(0),function(b){return parseInt(b,10)}),bo(u)):i(h)?Qc(u):f(h)?u._d=new Date(h):e.createFromInputFallback(u)}function Wa(u,h,b,S,C){var M={};return(h===!0||h===!1)&&(S=h,h=void 0),(b===!0||b===!1)&&(S=b,b=void 0),(i(u)&&a(u)||n(u)&&u.length===0)&&(u=void 0),M._isAMomentObject=!0,M._useUTC=M._isUTC=C,M._l=b,M._i=u,M._f=h,M._strict=S,Ey(M)}function et(u,h,b,S){return Wa(u,h,b,S,!1)}var Kd=_("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=et.apply(null,arguments);return this.isValid()&&u.isValid()?u<this?this:u:q()}),Qd=_("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=et.apply(null,arguments);return this.isValid()&&u.isValid()?u>this?this:u:q()});function Zd(u,h){var b,S;if(h.length===1&&n(h[0])&&(h=h[0]),!h.length)return et();for(b=h[0],S=1;S<h.length;++S)(!h[S].isValid()||h[S][u](b))&&(b=h[S]);return b}function Cy(){var u=[].slice.call(arguments,0);return Zd("isBefore",u)}function Oy(){var u=[].slice.call(arguments,0);return Zd("isAfter",u)}var Iy=function(){return Date.now?Date.now():+new Date},So=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ys(u){var h,b=!1,S,C=So.length;for(h in u)if(s(u,h)&&!(Rt.call(So,h)!==-1&&(u[h]==null||!isNaN(u[h]))))return!1;for(S=0;S<C;++S)if(u[So[S]]){if(b)return!1;parseFloat(u[So[S]])!==qe(u[So[S]])&&(b=!0)}return!0}function Py(){return this._isValid}function ky(){return tt(NaN)}function vs(u){var h=hr(u),b=h.year||0,S=h.quarter||0,C=h.month||0,M=h.week||h.isoWeek||0,z=h.day||0,se=h.hour||0,ve=h.minute||0,Me=h.second||0,Dt=h.millisecond||0;this._isValid=ys(h),this._milliseconds=+Dt+Me*1e3+ve*6e4+se*1e3*60*60,this._days=+z+M*7,this._months=+C+S*3+b*12,this._data={},this._locale=Tn(),this._bubble()}function wo(u){return u instanceof vs}function ln(u){return u<0?Math.round(-1*u)*-1:Math.round(u)}function za(u,h,b){var S=Math.min(u.length,h.length),C=Math.abs(u.length-h.length),M=0,z;for(z=0;z<S;z++)(b&&u[z]!==h[z]||!b&&qe(u[z])!==qe(h[z]))&&M++;return M+C}function Xd(u,h){ce(u,0,0,function(){var b=this.utcOffset(),S="+";return b<0&&(b=-b,S="-"),S+xe(~~(b/60),2)+h+xe(~~b%60,2)})}Xd("Z",":"),Xd("ZZ",""),ae("Z",ka),ae("ZZ",ka),Ke(["Z","ZZ"],function(u,h,b){b._useUTC=!0,b._tzm=Xc(ka,u)});var Ty=/([\+\-]|\d\d)/gi;function Xc(u,h){var b=(h||"").match(u),S,C,M;return b===null?null:(S=b[b.length-1]||[],C=(S+"").match(Ty)||["-",0,0],M=+(C[1]*60)+qe(C[2]),M===0?0:C[0]==="+"?M:-M)}function ui(u,h){var b,S;return h._isUTC?(b=h.clone(),S=(X(u)||d(u)?u.valueOf():et(u).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+S),e.updateOffset(b,!1),b):et(u).local()}function vr(u){return-Math.round(u._d.getTimezoneOffset())}e.updateOffset=function(){};function ep(u,h,b){var S=this._offset||0,C;if(!this.isValid())return u!=null?this:NaN;if(u!=null){if(typeof u=="string"){if(u=Xc(ka,u),u===null)return this}else Math.abs(u)<16&&!b&&(u=u*60);return!this._isUTC&&h&&(C=vr(this)),this._offset=u,this._isUTC=!0,C!=null&&this.add(C,"m"),S!==u&&(!h||this._changeInProgress?_o(this,tt(u-S,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?S:vr(this)}function Ay(u,h){return u!=null?(typeof u!="string"&&(u=-u),this.utcOffset(u,h),this):-this.utcOffset()}function qy(u){return this.utcOffset(0,u)}function $y(u){return this._isUTC&&(this.utcOffset(0,u),this._isUTC=!1,u&&this.subtract(vr(this),"m")),this}function My(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var u=Xc(qc,this._i);u!=null?this.utcOffset(u):this.utcOffset(0,!0)}return this}function Ny(u){return this.isValid()?(u=u?et(u).utcOffset():0,(this.utcOffset()-u)%60===0):!1}function fi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function U(){if(!l(this._isDSTShifted))return this._isDSTShifted;var u={},h;return B(u,this),u=Zc(u),u._a?(h=u._isUTC?y(u._a):et(u._a),this._isDSTShifted=this.isValid()&&za(u._a,h.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function G(){return this.isValid()?!this._isUTC:!1}function W(){return this.isValid()?this._isUTC:!1}function oe(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ye=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function tt(u,h){var b=u,S=null,C,M,z;return wo(u)?b={ms:u._milliseconds,d:u._days,M:u._months}:f(u)||!isNaN(+u)?(b={},h?b[h]=+u:b.milliseconds=+u):(S=be.exec(u))?(C=S[1]==="-"?-1:1,b={y:0,d:qe(S[on])*C,h:qe(S[At])*C,m:qe(S[Pr])*C,s:qe(S[Pn])*C,ms:qe(ln(S[Ii]*1e3))*C}):(S=Ye.exec(u))?(C=S[1]==="-"?-1:1,b={y:Ue(S[2],C),M:Ue(S[3],C),w:Ue(S[4],C),d:Ue(S[5],C),h:Ue(S[6],C),m:Ue(S[7],C),s:Ue(S[8],C)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(z=Dy(et(b.from),et(b.to)),b={},b.ms=z.milliseconds,b.M=z.months),M=new vs(b),wo(u)&&s(u,"_locale")&&(M._locale=u._locale),wo(u)&&s(u,"_isValid")&&(M._isValid=u._isValid),M}tt.fn=vs.prototype,tt.invalid=ky;function Ue(u,h){var b=u&&parseFloat(u.replace(",","."));return(isNaN(b)?0:b)*h}function Ja(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 Dy(u,h){var b;return u.isValid()&&h.isValid()?(h=ui(h,u),u.isBefore(h)?b=Ja(u,h):(b=Ja(h,u),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function br(u,h){return function(b,S){var C,M;return S!==null&&!isNaN(+S)&&($(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=S,S=M),C=tt(b,S),_o(this,C,u),this}}function _o(u,h,b,S){var C=h._milliseconds,M=ln(h._days),z=ln(h._months);u.isValid()&&(S=S??!0,z&&Lc(u,ho(u,"Month")+z*b),M&&mo(u,"Date",ho(u,"Date")+M*b),C&&u._d.setTime(u._d.valueOf()+C*b),S&&e.updateOffset(u,M||z))}var Fy=br(1,"add"),bs=br(-1,"subtract");function xo(u){return typeof u=="string"||u instanceof String}function Ya(u){return X(u)||d(u)||xo(u)||f(u)||Ly(u)||Ze(u)||u===null||u===void 0}function Ze(u){var h=i(u)&&!a(u),b=!1,S=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],C,M,z=S.length;for(C=0;C<z;C+=1)M=S[C],b=b||s(u,M);return h&&b}function Ly(u){var h=n(u),b=!1;return h&&(b=u.filter(function(S){return!f(S)&&xo(u)}).length===0),h&&b}function tp(u){var h=i(u)&&!a(u),b=!1,S=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],C,M;for(C=0;C<S.length;C+=1)M=S[C],b=b||s(u,M);return h&&b}function Ga(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 jy(u,h){arguments.length===1&&(arguments[0]?Ya(arguments[0])?(u=arguments[0],h=void 0):tp(arguments[0])&&(h=arguments[0],u=void 0):(u=void 0,h=void 0));var b=u||et(),S=ui(b,this).startOf("day"),C=e.calendarFormat(this,S)||"sameElse",M=h&&(N(h[C])?h[C].call(this,b):h[C]);return this.format(M||this.localeData().calendar(C,this,et(b)))}function Uy(){return new K(this)}function Hy(u,h){var b=X(u)?u:et(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(h).valueOf()):!1}function Ka(u,h){var b=X(u)?u:et(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(h).valueOf()<b.valueOf()):!1}function di(u,h,b,S){var C=X(u)?u:et(u),M=X(h)?h:et(h);return this.isValid()&&C.isValid()&&M.isValid()?(S=S||"()",(S[0]==="("?this.isAfter(C,b):!this.isBefore(C,b))&&(S[1]===")"?this.isBefore(M,b):!this.isAfter(M,b))):!1}function Qa(u,h){var b=X(u)?u:et(u),S;return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()===b.valueOf():(S=b.valueOf(),this.clone().startOf(h).valueOf()<=S&&S<=this.clone().endOf(h).valueOf())):!1}function rp(u,h){return this.isSame(u,h)||this.isAfter(u,h)}function Za(u,h){return this.isSame(u,h)||this.isBefore(u,h)}function np(u,h,b){var S,C,M;if(!this.isValid())return NaN;if(S=ui(u,this),!S.isValid())return NaN;switch(C=(S.utcOffset()-this.utcOffset())*6e4,h=Yt(h),h){case"year":M=Ro(this,S)/12;break;case"month":M=Ro(this,S);break;case"quarter":M=Ro(this,S)/3;break;case"second":M=(this-S)/1e3;break;case"minute":M=(this-S)/6e4;break;case"hour":M=(this-S)/36e5;break;case"day":M=(this-S-C)/864e5;break;case"week":M=(this-S-C)/6048e5;break;default:M=this-S}return b?M:Ir(M)}function Ro(u,h){if(u.date()<h.date())return-Ro(h,u);var b=(h.year()-u.year())*12+(h.month()-u.month()),S=u.clone().add(b,"months"),C,M;return h-S<0?(C=u.clone().add(b-1,"months"),M=(h-S)/(S-C)):(C=u.clone().add(b+1,"months"),M=(h-S)/(C-S)),-(b+M)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Xa(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ip(u){if(!this.isValid())return null;var h=u!==!0,b=h?this.clone().utc():this;return b.year()<0||b.year()>9999?xt(b,h?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):N(Date.prototype.toISOString)?h?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",xt(b,"Z")):xt(b,h?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Eo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var u="moment",h="",b,S,C,M;return this.isLocal()||(u=this.utcOffset()===0?"moment.utc":"moment.parseZone",h="Z"),b="["+u+'("]',S=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",C="-MM-DD[T]HH:mm:ss.SSS",M=h+'[")]',this.format(b+S+C+M)}function Ai(u){u||(u=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var h=xt(this,u);return this.localeData().postformat(h)}function el(u,h){return this.isValid()&&(X(u)&&u.isValid()||et(u).isValid())?tt({to:this,from:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function By(u){return this.from(et(),u)}function Vy(u,h){return this.isValid()&&(X(u)&&u.isValid()||et(u).isValid())?tt({from:this,to:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function Wy(u){return this.to(et(),u)}function Co(u){var h;return u===void 0?this._locale._abbr:(h=Tn(u),h!=null&&(this._locale=h),this)}var Oo=_("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 tl(){return this._locale}var rl=1e3,qi=60*rl,nl=60*qi,sp=(365*400+97)*24*nl;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)-sp:new Date(u,h,b).valueOf()}function op(u,h,b){return u<100&&u>=0?Date.UTC(u+400,h,b)-sp:Date.UTC(u,h,b)}function zy(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?op: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()*qi),nl);break;case"minute":h=this._d.valueOf(),h-=gt(h,qi);break;case"second":h=this._d.valueOf(),h-=gt(h,rl);break}return this._d.setTime(h),e.updateOffset(this,!0),this}function ap(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?op: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+=nl-gt(h+(this._isUTC?0:this.utcOffset()*qi),nl)-1;break;case"minute":h=this._d.valueOf(),h+=qi-gt(h,qi)-1;break;case"second":h=this._d.valueOf(),h+=rl-gt(h,rl)-1;break}return this._d.setTime(h),e.updateOffset(this,!0),this}function Jy(){return this._d.valueOf()-(this._offset||0)*6e4}function eu(){return Math.floor(this.valueOf()/1e3)}function Io(){return new Date(this.valueOf())}function tu(){var u=this;return[u.year(),u.month(),u.date(),u.hour(),u.minute(),u.second(),u.millisecond()]}function Ss(){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 Po(){return this.isValid()?this.toISOString():null}function ko(){return T(this)}function il(){return g({},R(this))}function ws(){return R(this).overflow}function Yy(){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"),ae("N",nr),ae("NN",nr),ae("NNN",nr),ae("NNNN",$e),ae("NNNNN",Xy),Ke(["N","NN","NNN","NNNN","NNNNN"],function(u,h,b,S){var C=b._locale.erasParse(u,S,b._strict);C?R(b).era=C:R(b).invalidEra=u}),ae("y",ai),ae("yy",ai),ae("yyy",ai),ae("yyyy",ai),ae("yo",ev),Ke(["y","yy","yyy","yyyy"],Gt),Ke(["yo"],function(u,h,b,S){var C;b._locale._eraYearOrdinalRegex&&(C=u.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?h[Gt]=b._locale.eraYearOrdinalParse(u,C):h[Gt]=parseInt(u,10)});function Gy(u,h){var b,S,C,M=this._eras||Tn("en")._eras;for(b=0,S=M.length;b<S;++b)switch(typeof M[b].since==="string"&&(C=e(M[b].since).startOf("day"),M[b].since=C.valueOf()),typeof M[b].until){case"undefined":M[b].until=1/0;break;case"string":C=e(M[b].until).startOf("day").valueOf(),M[b].until=C.valueOf();break}return M}function Ky(u,h,b){var S,C,M=this.eras(),z,se,ve;for(u=u.toUpperCase(),S=0,C=M.length;S<C;++S)if(z=M[S].name.toUpperCase(),se=M[S].abbr.toUpperCase(),ve=M[S].narrow.toUpperCase(),b)switch(h){case"N":case"NN":case"NNN":if(se===u)return M[S];break;case"NNNN":if(z===u)return M[S];break;case"NNNNN":if(ve===u)return M[S];break}else if([z,se,ve].indexOf(u)>=0)return M[S]}function Qy(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 Zy(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].name;return""}function sl(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].narrow;return""}function To(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].abbr;return""}function lp(){var u,h,b,S,C=this.localeData().eras();for(u=0,h=C.length;u<h;++u)if(b=C[u].since<=C[u].until?1:-1,S=this.clone().startOf("day").valueOf(),C[u].since<=S&&S<=C[u].until||C[u].until<=S&&S<=C[u].since)return(this.year()-e(C[u].since).year())*b+C[u].offset;return this.year()}function O(u){return s(this,"_erasNameRegex")||ru.call(this),u?this._erasNameRegex:this._erasRegex}function _s(u){return s(this,"_erasAbbrRegex")||ru.call(this),u?this._erasAbbrRegex:this._erasRegex}function ol(u){return s(this,"_erasNarrowRegex")||ru.call(this),u?this._erasNarrowRegex:this._erasRegex}function nr(u,h){return h.erasAbbrRegex(u)}function $e(u,h){return h.erasNameRegex(u)}function Xy(u,h){return h.erasNarrowRegex(u)}function ev(u,h){return h._eraYearOrdinalRegex||ai}function ru(){var u=[],h=[],b=[],S=[],C,M,z,se,ve,Me=this.eras();for(C=0,M=Me.length;C<M;++C)z=sn(Me[C].name),se=sn(Me[C].abbr),ve=sn(Me[C].narrow),h.push(z),u.push(se),b.push(ve),S.push(z),S.push(se),S.push(ve);this._erasRegex=new RegExp("^("+S.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 cn(u,h){ce(0,[u,u.length],0,h)}cn("gggg","weekYear"),cn("ggggg","weekYear"),cn("GGGG","isoWeekYear"),cn("GGGGG","isoWeekYear"),ae("G",fs),ae("g",fs),ae("GG",st,Ut),ae("gg",st,Ut),ae("GGGG",co,Ci),ae("gggg",co,Ci),ae("GGGGG",us,On),ae("ggggg",us,On),fo(["gggg","ggggg","GGGG","GGGGG"],function(u,h,b,S){h[S.substr(0,2)]=qe(u)}),fo(["gg","GG"],function(u,h,b,S){h[S]=e.parseTwoDigitYear(u)});function tv(u){return cp.call(this,u,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function rv(u){return cp.call(this,u,this.isoWeek(),this.isoWeekday(),1,4)}function nv(){return an(this.year(),1,4)}function iv(){return an(this.isoWeekYear(),1,4)}function sv(){var u=this.localeData()._week;return an(this.year(),u.dow,u.doy)}function An(){var u=this.localeData()._week;return an(this.weekYear(),u.dow,u.doy)}function cp(u,h,b,S,C){var M;return u==null?yo(this,S,C).year:(M=an(u,S,C),h>M&&(h=M),ov.call(this,u,h,b,S,C))}function ov(u,h,b,S,C){var M=Da(u,h,b,S,C),z=ps(M.year,0,M.dayOfYear);return this.year(z.getUTCFullYear()),this.month(z.getUTCMonth()),this.date(z.getUTCDate()),this}ce("Q",0,"Qo","quarter"),ae("Q",Od),Ke("Q",function(u,h){h[In]=(qe(u)-1)*3});function av(u){return u==null?Math.ceil((this.month()+1)/3):this.month((u-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),ae("D",st,Oi),ae("DD",st,Ut),ae("Do",function(u,h){return u?h._dayOfMonthOrdinalParse||h._ordinalParse:h._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],on),Ke("Do",function(u,h){h[on]=qe(u.match(st)[0])});var up=ds("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),ae("DDD",cs),ae("DDDD",Id),Ke(["DDD","DDDD"],function(u,h,b){b._dayOfYear=qe(u)});function lv(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"),ae("m",st,Ta),ae("mm",st,Ut),Ke(["m","mm"],Pr);var qn=ds("Minutes",!1);ce("s",["ss",2],0,"second"),ae("s",st,Ta),ae("ss",st,Ut),Ke(["s","ss"],Pn);var cv=ds("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}),ae("S",cs,Od),ae("SS",cs,Ut),ae("SSS",cs,Id);var pi,fp;for(pi="SSSS";pi.length<=9;pi+="S")ae(pi,ai);function uv(u,h){h[Ii]=qe(("0."+u)*1e3)}for(pi="S";pi.length<=9;pi+="S")Ke(pi,uv);fp=ds("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function fv(){return this._isUTC?"UTC":""}function $i(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Fy,te.calendar=jy,te.clone=Uy,te.diff=np,te.endOf=ap,te.format=Ai,te.from=el,te.fromNow=By,te.to=Vy,te.toNow=Wy,te.get=Kg,te.invalidAt=ws,te.isAfter=Hy,te.isBefore=Ka,te.isBetween=di,te.isSame=Qa,te.isSameOrAfter=rp,te.isSameOrBefore=Za,te.isValid=ko,te.lang=Oo,te.locale=Co,te.localeData=tl,te.max=Qd,te.min=Kd,te.parsingFlags=il,te.set=$a,te.startOf=zy,te.subtract=bs,te.toArray=tu,te.toObject=Ss,te.toDate=Io,te.toISOString=ip,te.inspect=Eo,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=Po,te.toString=Xa,te.unix=eu,te.valueOf=Jy,te.creationData=Yy,te.eraName=Zy,te.eraNarrow=sl,te.eraAbbr=To,te.eraYear=lp,te.year=kd,te.isLeapYear=Gg,te.weekYear=tv,te.isoWeekYear=rv,te.quarter=te.quarters=av,te.month=Ma,te.daysInMonth=ry,te.week=te.weeks=Nd,te.isoWeek=te.isoWeeks=iy,te.weeksInYear=sv,te.weeksInWeekYear=An,te.isoWeeksInYear=nv,te.isoWeeksInISOWeekYear=iv,te.date=up,te.day=te.days=dy,te.weekday=py,te.isoWeekday=hy,te.dayOfYear=lv,te.hour=te.hours=vy,te.minute=te.minutes=qn,te.second=te.seconds=cv,te.millisecond=te.milliseconds=fp,te.utcOffset=ep,te.utc=qy,te.local=$y,te.parseZone=My,te.hasAlignedHourOffset=Ny,te.isDST=fi,te.isLocal=G,te.isUtcOffset=W,te.isUtc=oe,te.isUTC=oe,te.zoneAbbr=fv,te.zoneName=$i,te.dates=_("dates accessor is deprecated. Use date instead.",up),te.months=_("months accessor is deprecated. Use month instead",Ma),te.years=_("years accessor is deprecated. Use year instead",kd),te.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ay),te.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",U);function dv(u){return et(u*1e3)}function Jr(){return et.apply(null,arguments).parseZone()}function dp(u){return u}var Ve=J.prototype;Ve.calendar=Xe,Ve.longDateFormat=ht,Ve.invalidDate=nn,Ve.ordinal=ao,Ve.preparse=dp,Ve.postformat=dp,Ve.relativeTime=Cn,Ve.pastFuture=Ed,Ve.set=j,Ve.eras=Gy,Ve.erasParse=Ky,Ve.erasConvertYear=Qy,Ve.erasAbbrRegex=_s,Ve.erasNameRegex=O,Ve.erasNarrowRegex=ol,Ve.months=ey,Ve.monthsShort=ty,Ve.monthsParse=qd,Ve.monthsRegex=Na,Ve.monthsShortRegex=$d,Ve.week=Uc,Ve.firstDayOfYear=Md,Ve.firstDayOfWeek=hs,Ve.weekdays=ly,Ve.weekdaysMin=uy,Ve.weekdaysShort=cy,Ve.weekdaysParse=fy,Ve.weekdaysRegex=my,Ve.weekdaysShortRegex=ut,Ve.weekdaysMinRegex=at,Ve.isPM=yy,Ve.meridiem=Nt;function al(u,h,b,S){var C=Tn(),M=y().set(S,h);return C[b](M,u)}function pp(u,h,b){if(f(u)&&(h=u,u=void 0),u=u||"",h!=null)return al(u,h,b,"month");var S,C=[];for(S=0;S<12;S++)C[S]=al(u,S,b,"month");return C}function nu(u,h,b,S){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 C=Tn(),M=u?C._week.dow:0,z,se=[];if(b!=null)return al(h,(b+M)%7,S,"day");for(z=0;z<7;z++)se[z]=al(h,(z+M)%7,S,"day");return se}function hp(u,h){return pp(u,h,"months")}function mp(u,h){return pp(u,h,"monthsShort")}function pv(u,h,b){return nu(u,h,b,"weekdays")}function hv(u,h,b){return nu(u,h,b,"weekdaysShort")}function iu(u,h,b){return nu(u,h,b,"weekdaysMin")}kn("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=_("moment.lang is deprecated. Use moment.locale instead.",kn),e.langData=_("moment.langData is deprecated. Use moment.localeData instead.",Tn);var Sr=Math.abs;function ll(){var u=this._data;return this._milliseconds=Sr(this._milliseconds),this._days=Sr(this._days),this._months=Sr(this._months),u.milliseconds=Sr(u.milliseconds),u.seconds=Sr(u.seconds),u.minutes=Sr(u.minutes),u.hours=Sr(u.hours),u.months=Sr(u.months),u.years=Sr(u.years),this}function gp(u,h,b,S){var C=tt(h,b);return u._milliseconds+=S*C._milliseconds,u._days+=S*C._days,u._months+=S*C._months,u._bubble()}function yp(u,h){return gp(this,u,h,1)}function mv(u,h){return gp(this,u,h,-1)}function Yr(u){return u<0?Math.floor(u):Math.ceil(u)}function su(){var u=this._milliseconds,h=this._days,b=this._months,S=this._data,C,M,z,se,ve;return u>=0&&h>=0&&b>=0||u<=0&&h<=0&&b<=0||(u+=Yr(ir(b)+h)*864e5,h=0,b=0),S.milliseconds=u%1e3,C=Ir(u/1e3),S.seconds=C%60,M=Ir(C/60),S.minutes=M%60,z=Ir(M/60),S.hours=z%24,h+=Ir(z/24),ve=Ir(hi(h)),b+=ve,h-=Yr(ir(ve)),se=Ir(b/12),b%=12,S.days=h,S.months=b,S.years=se,this}function hi(u){return u*4800/146097}function ir(u){return u*146097/4800}function gv(u){if(!this.isValid())return NaN;var h,b,S=this._milliseconds;if(u=Yt(u),u==="month"||u==="quarter"||u==="year")switch(h=this._days+S/864e5,b=this._months+hi(h),u){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(h=this._days+Math.round(ir(this._months)),u){case"week":return h/7+S/6048e5;case"day":return h+S/864e5;case"hour":return h*24+S/36e5;case"minute":return h*1440+S/6e4;case"second":return h*86400+S/1e3;case"millisecond":return Math.floor(h*864e5)+S;default:throw new Error("Unknown unit "+u)}}function un(u){return function(){return this.as(u)}}var ou=un("ms"),Ao=un("s"),mi=un("m"),vp=un("h"),yv=un("d"),cl=un("w"),vv=un("M"),bp=un("Q"),Bt=un("y"),au=ou;function Sp(){return tt(this)}function fn(u){return u=Yt(u),this.isValid()?this[u+"s"]():NaN}function $n(u){return function(){return this.isValid()?this._data[u]:NaN}}var ul=$n("milliseconds"),Mi=$n("seconds"),wp=$n("minutes"),Qt=$n("hours"),lu=$n("days"),bv=$n("months"),Sv=$n("years");function wv(){return Ir(this.days()/7)}var Gr=Math.round,xs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function qo(u,h,b,S,C){return C.relativeTime(h||1,!!b,u,S)}function _p(u,h,b,S){var C=tt(u).abs(),M=Gr(C.as("s")),z=Gr(C.as("m")),se=Gr(C.as("h")),ve=Gr(C.as("d")),Me=Gr(C.as("M")),Dt=Gr(C.as("w")),Mn=Gr(C.as("y")),Nn=M<=b.ss&&["s",M]||M<b.s&&["ss",M]||z<=1&&["m"]||z<b.m&&["mm",z]||se<=1&&["h"]||se<b.h&&["hh",se]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(Nn=Nn||Dt<=1&&["w"]||Dt<b.w&&["ww",Dt]),Nn=Nn||Me<=1&&["M"]||Me<b.M&&["MM",Me]||Mn<=1&&["y"]||["yy",Mn],Nn[2]=h,Nn[3]=+u>0,Nn[4]=S,qo.apply(null,Nn)}function _v(u){return u===void 0?Gr:typeof u=="function"?(Gr=u,!0):!1}function xv(u,h){return xs[u]===void 0?!1:h===void 0?xs[u]:(xs[u]=h,u==="s"&&(xs.ss=h-1),!0)}function $o(u,h){if(!this.isValid())return this.localeData().invalidDate();var b=!1,S=xs,C,M;return typeof u=="object"&&(h=u,u=!1),typeof u=="boolean"&&(b=u),typeof h=="object"&&(S=Object.assign({},xs,h),h.s!=null&&h.ss==null&&(S.ss=h.s-1)),C=this.localeData(),M=_p(this,!b,S,C),b&&(M=C.pastFuture(+this,M)),C.postformat(M)}var cu=Math.abs;function Rs(u){return(u>0)-(u<0)||+u}function Es(){if(!this.isValid())return this.localeData().invalidDate();var u=cu(this._milliseconds)/1e3,h=cu(this._days),b=cu(this._months),S,C,M,z,se=this.asSeconds(),ve,Me,Dt,Mn;return se?(S=Ir(u/60),C=Ir(S/60),u%=60,S%=60,M=Ir(b/12),b%=12,z=u?u.toFixed(3).replace(/\.?0+$/,""):"",ve=se<0?"-":"",Me=Rs(this._months)!==Rs(se)?"-":"",Dt=Rs(this._days)!==Rs(se)?"-":"",Mn=Rs(this._milliseconds)!==Rs(se)?"-":"",ve+"P"+(M?Me+M+"Y":"")+(b?Me+b+"M":"")+(h?Dt+h+"D":"")+(C||S||u?"T":"")+(C?Mn+C+"H":"")+(S?Mn+S+"M":"")+(u?Mn+z+"S":"")):"P0D"}var Fe=vs.prototype;Fe.isValid=Py,Fe.abs=ll,Fe.add=yp,Fe.subtract=mv,Fe.as=gv,Fe.asMilliseconds=ou,Fe.asSeconds=Ao,Fe.asMinutes=mi,Fe.asHours=vp,Fe.asDays=yv,Fe.asWeeks=cl,Fe.asMonths=vv,Fe.asQuarters=bp,Fe.asYears=Bt,Fe.valueOf=au,Fe._bubble=su,Fe.clone=Sp,Fe.get=fn,Fe.milliseconds=ul,Fe.seconds=Mi,Fe.minutes=wp,Fe.hours=Qt,Fe.days=lu,Fe.weeks=wv,Fe.months=bv,Fe.years=Sv,Fe.humanize=$o,Fe.toISOString=Es,Fe.toString=Es,Fe.toJSON=Es,Fe.locale=Co,Fe.localeData=tl,Fe.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Es),Fe.lang=Oo,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),ae("x",fs),ae("X",Wg),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(et),e.fn=te,e.min=Cy,e.max=Oy,e.now=Iy,e.utc=y,e.unix=dv,e.months=hp,e.isDate=d,e.locale=kn,e.invalid=q,e.duration=tt,e.isMoment=X,e.weekdays=pv,e.parseZone=Jr,e.localeData=Tn,e.isDuration=wo,e.monthsShort=mp,e.weekdaysMin=iu,e.defineLocale=ja,e.updateLocale=mr,e.locales=gr,e.weekdaysShort=hv,e.normalizeUnits=Yt,e.relativeTimeRounding=_v,e.relativeTimeThreshold=xv,e.calendarFormat=Ga,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 XE=F((ZE,eh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof eh<"u"&&eh.exports?eh.exports=e():t.tv4=e()})(ZE,function(){Object.keys||(Object.keys=(function(){var k=Object.prototype.hasOwnProperty,_=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$=P.length;return function(N){if(typeof N!="object"&&typeof N!="function"||N===null)throw new TypeError("Object.keys called on non-object");var j=[];for(var Y in N)k.call(N,Y)&&j.push(Y);if(_)for(var J=0;J<$;J++)k.call(N,P[J])&&j.push(P[J]);return j}})()),Object.create||(Object.create=(function(){function k(){}return function(_){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=_,new k}})()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var _=Object(this),P=_.length>>>0;if(P===0)return-1;var $=0;if(arguments.length>1&&($=Number(arguments[1]),$!==$?$=0:$!==0&&$!==1/0&&$!==-1/0&&($=($>0||-1)*Math.floor(Math.abs($)))),$>=P)return-1;for(var N=$>=0?$:Math.max(P-Math.abs($),0);N<P;N++)if(N in _&&_[N]===k)return N;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var _="tv4_test_frozen_key";k.hasOwnProperty(_);)_+=Math.random();try{return k[_]=!0,delete k[_],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(_){return"%"+_.substring(3)})}function n(k){var _="";t[k.charAt(0)]&&(_=k.charAt(0),k=k.substring(1));var P="",$="",N=!0,j=!1,Y=!1;_==="+"?N=!1:_==="."?($=".",P="."):_==="/"?($="/",P="/"):_==="#"?($="#",N=!1):_===";"?($=";",P=";",j=!0,Y=!0):_==="?"?($="?",P="&",j=!0):_==="&"&&($="&",P="&",j=!0);for(var J=[],ne=k.split(","),pe=[],Xe={},xe=0;xe<ne.length;xe++){var he=ne[xe],Ee=null;if(he.indexOf(":")!==-1){var vt=he.split(":");he=vt[0],Ee=parseInt(vt[1],10)}for(var Ct={};e[he.charAt(he.length-1)];)Ct[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ce={truncate:Ee,name:he,suffices:Ct};pe.push(ce),Xe[he]=ce,J.push(he)}var pr=function(oi){for(var xt="",zr=0,Or=0;Or<pe.length;Or++){var ht=pe[Or],mt=oi(ht.name);if(mt==null||Array.isArray(mt)&&mt.length===0||typeof mt=="object"&&Object.keys(mt).length===0){zr++;continue}if(Or===zr?xt+=$:xt+=P||",",Array.isArray(mt)){j&&(xt+=ht.name+"=");for(var nn=0;nn<mt.length;nn++)nn>0&&(xt+=ht.suffices["*"]&&P||",",ht.suffices["*"]&&j&&(xt+=ht.name+"=")),xt+=N?encodeURIComponent(mt[nn]).replace(/!/g,"%21"):r(mt[nn])}else if(typeof mt=="object"){j&&!ht.suffices["*"]&&(xt+=ht.name+"=");var oo=!0;for(var Jt in mt)oo||(xt+=ht.suffices["*"]&&P||","),oo=!1,xt+=N?encodeURIComponent(Jt).replace(/!/g,"%21"):r(Jt),xt+=ht.suffices["*"]?"=":",",xt+=N?encodeURIComponent(mt[Jt]).replace(/!/g,"%21"):r(mt[Jt])}else j&&(xt+=ht.name,(!Y||mt!=="")&&(xt+="=")),ht.truncate!=null&&(mt=mt.substring(0,ht.truncate)),xt+=N?encodeURIComponent(mt).replace(/!/g,"%21"):r(mt)}return xt};return pr.varNames=J,{prefix:$,substitution:pr}}function i(k){if(!(this instanceof i))return new i(k);for(var _=k.split("{"),P=[_.shift()],$=[],N=[],j=[];_.length>0;){var Y=_.shift(),J=Y.split("}")[0],ne=Y.substring(J.length+1),pe=n(J);N.push(pe.substitution),$.push(pe.prefix),P.push(ne),j=j.concat(pe.substitution.varNames)}this.fill=function(Xe){for(var xe=P[0],he=0;he<N.length;he++){var Ee=N[he];xe+=Ee(Xe),xe+=P[he+1]}return xe},this.varNames=j,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(_){return k[_]})}};var s=function(_,P,$,N,j){if(this.missing=[],this.missingMap={},this.formatValidators=_?Object.create(_.formatValidators):{},this.schemas=_?Object.create(_.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,N&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),j&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=$||w("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},_)for(var Y in _.definedKeywords)this.definedKeywords[Y]=_.definedKeywords[Y].slice(0)};s.prototype.defineKeyword=function(k,_){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(_)},s.prototype.createError=function(k,_,P,$,N,j,Y){var J=new L(k,_,P,$,N);return J.message=this.errorReporter(J,j,Y),J},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,_,P){for(var $=k;$<this.errors.length;$++)this.errors[$]=this.errors[$].prefixWith(_,P);return this},s.prototype.banUnknownProperties=function(k,_){for(var P in this.unknownPropertyPaths){var $=this.createError(R.UNKNOWN_PROPERTY,{path:P},P,"",null,k,_),N=this.handleError($);if(N)return N}return null},s.prototype.addFormat=function(k,_){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=_},s.prototype.resolveRefs=function(k,_){if(k.$ref!==void 0){if(_=_||{},_[k.$ref])return this.createError(R.CIRCULAR_REFERENCE,{urls:Object.keys(_).join(", ")},"","",null,void 0,k);_[k.$ref]=!0,k=this.getSchema(k.$ref,_)}return k},s.prototype.getSchema=function(k,_){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,_);var $=k,N="";if(k.indexOf("#")!==-1&&(N=k.substring(k.indexOf("#")+1),$=k.substring(0,k.indexOf("#"))),typeof this.schemas[$]=="object"){P=this.schemas[$];var j=decodeURIComponent(N);if(j==="")return this.resolveRefs(P,_);if(j.charAt(0)!=="/")return;for(var Y=j.split("/").slice(1),J=0;J<Y.length;J++){var ne=Y[J].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ne]===void 0){P=void 0;break}P=P[ne]}if(P!==void 0)return this.resolveRefs(P,_)}this.missing[$]===void 0&&(this.missing.push($),this.missing[$]=$,this.missingMap[$]=$)},s.prototype.searchSchemas=function(k,_){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],_);else if(k&&typeof k=="object"){typeof k.id=="string"&&V(_,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var $ in k)if($!=="enum"){if(typeof k[$]=="object")this.searchSchemas(k[$],_);else if($==="$ref"){var N=g(k[$]);N&&this.schemas[N]===void 0&&this.missingMap[N]===void 0&&(this.missingMap[N]=N)}}}},s.prototype.addSchema=function(k,_){if(typeof k!="string"||typeof _>"u")if(typeof k=="object"&&typeof k.id=="string")_=k,k=_.id;else return;k===g(k)+"#"&&(k=g(k)),this.schemas[k]=_,delete this.missingMap[k],y(_,k),this.searchSchemas(_,k)},s.prototype.getSchemaMap=function(){var k={};for(var _ in this.schemas)k[_]=this.schemas[_];return k},s.prototype.getSchemaUris=function(k){var _=[];for(var P in this.schemas)(!k||k.test(P))&&_.push(P);return _},s.prototype.getMissingUris=function(k){var _=[];for(var P in this.missingMap)(!k||k.test(P))&&_.push(P);return _},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,_,P,$,N){var j;if(_=this.resolveRefs(_),_){if(_ instanceof L)return this.errors.push(_),_}else return null;var Y=this.errors.length,J,ne=null,pe=null;if(this.checkRecursive&&k&&typeof k=="object"){if(j=!this.scanned.length,k[this.validatedSchemasKey]){var Xe=k[this.validatedSchemasKey].indexOf(_);if(Xe!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][Xe]),null}if(Object.isFrozen(k)&&(J=this.scannedFrozen.indexOf(k),J!==-1)){var xe=this.scannedFrozenSchemas[J].indexOf(_);if(xe!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[J][xe]),null}if(this.scanned.push(k),Object.isFrozen(k))J===-1&&(J=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[J].length,this.scannedFrozenSchemas[J][ne]=_,this.scannedFrozenValidationErrors[J][ne]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}pe=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][pe]=_,k[this.validationErrorsKey][pe]=[]}}var he=this.errors.length,Ee=this.validateBasic(k,_,N)||this.validateNumeric(k,_,N)||this.validateString(k,_,N)||this.validateArray(k,_,N)||this.validateObject(k,_,N)||this.validateCombinations(k,_,N)||this.validateHypermedia(k,_,N)||this.validateFormat(k,_,N)||this.validateDefinedKeywords(k,_,N)||null;if(j){for(;this.scanned.length;){var vt=this.scanned.pop();delete vt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ee||he!==this.errors.length)for(;P&&P.length||$&&$.length;){var Ct=P&&P.length?""+P.pop():null,ce=$&&$.length?""+$.pop():null;Ee&&(Ee=Ee.prefixWith(Ct,ce)),this.prefixErrors(he,Ct,ce)}return ne!==null?this.scannedFrozenValidationErrors[J][ne]=this.errors.slice(Y):pe!==null&&(k[this.validationErrorsKey][pe]=this.errors.slice(Y)),this.handleError(Ee)},s.prototype.validateFormat=function(k,_){if(typeof _.format!="string"||!this.formatValidators[_.format])return null;var P=this.formatValidators[_.format].call(null,k,_);return typeof P=="string"||typeof P=="number"?this.createError(R.FORMAT_CUSTOM,{message:P},"","/format",null,k,_):P&&typeof P=="object"?this.createError(R.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,_):null},s.prototype.validateDefinedKeywords=function(k,_,P){for(var $ in this.definedKeywords)if(!(typeof _[$]>"u"))for(var N=this.definedKeywords[$],j=0;j<N.length;j++){var Y=N[j],J=Y(k,_[$],_,P);if(typeof J=="string"||typeof J=="number")return this.createError(R.KEYWORD_CUSTOM,{key:$,message:J},"","",null,k,_).prefixWith(null,$);if(J&&typeof J=="object"){var ne=J.code;if(typeof ne=="string"){if(!R[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=R[ne]}else typeof ne!="number"&&(ne=R.KEYWORD_CUSTOM);var pe=typeof J.message=="object"?J.message:{key:$,message:J.message||"?"},Xe=J.schemaPath||"/"+$.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,pe,J.dataPath||null,Xe,null,k,_)}}return null};function a(k,_){if(k===_)return!0;if(k&&_&&typeof k=="object"&&typeof _=="object"){if(Array.isArray(k)!==Array.isArray(_))return!1;if(Array.isArray(k)){if(k.length!==_.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],_[P]))return!1}else{var $;for($ in k)if(_[$]===void 0&&k[$]!==void 0)return!1;for($ in _)if(k[$]===void 0&&_[$]!==void 0)return!1;for($ in k)if(!a(k[$],_[$]))return!1}return!0}return!1}s.prototype.validateBasic=function(_,P,$){var N;return(N=this.validateType(_,P,$))||(N=this.validateEnum(_,P,$))?N.prefixWith(null,"type"):null},s.prototype.validateType=function(_,P){if(P.type===void 0)return null;var $=typeof _;_===null?$="null":Array.isArray(_)&&($="array");var N=P.type;Array.isArray(N)||(N=[N]);for(var j=0;j<N.length;j++){var Y=N[j];if(Y===$||Y==="integer"&&$==="number"&&_%1===0)return null}return this.createError(R.INVALID_TYPE,{type:$,expected:N.join("/")},"","",null,_,P)},s.prototype.validateEnum=function(_,P){if(P.enum===void 0)return null;for(var $=0;$<P.enum.length;$++){var N=P.enum[$];if(a(_,N))return null}return this.createError(R.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(_):_},"","",null,_,P)},s.prototype.validateNumeric=function(_,P,$){return this.validateMultipleOf(_,P,$)||this.validateMinMax(_,P,$)||this.validateNaN(_,P,$)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(_,P){var $=P.multipleOf||P.divisibleBy;if($===void 0)return null;if(typeof _=="number"){var N=_/$%1;if(N>=l&&N<f)return this.createError(R.NUMBER_MULTIPLE_OF,{value:_,multipleOf:$},"","",null,_,P)}return null},s.prototype.validateMinMax=function(_,P){if(typeof _!="number")return null;if(P.minimum!==void 0){if(_<P.minimum)return this.createError(R.NUMBER_MINIMUM,{value:_,minimum:P.minimum},"","/minimum",null,_,P);if(P.exclusiveMinimum&&_===P.minimum)return this.createError(R.NUMBER_MINIMUM_EXCLUSIVE,{value:_,minimum:P.minimum},"","/exclusiveMinimum",null,_,P)}if(P.maximum!==void 0){if(_>P.maximum)return this.createError(R.NUMBER_MAXIMUM,{value:_,maximum:P.maximum},"","/maximum",null,_,P);if(P.exclusiveMaximum&&_===P.maximum)return this.createError(R.NUMBER_MAXIMUM_EXCLUSIVE,{value:_,maximum:P.maximum},"","/exclusiveMaximum",null,_,P)}return null},s.prototype.validateNaN=function(_,P){return typeof _!="number"?null:isNaN(_)===!0||_===1/0||_===-1/0?this.createError(R.NUMBER_NOT_A_NUMBER,{value:_},"","/type",null,_,P):null},s.prototype.validateString=function(_,P,$){return this.validateStringLength(_,P,$)||this.validateStringPattern(_,P,$)||null},s.prototype.validateStringLength=function(_,P){return typeof _!="string"?null:P.minLength!==void 0&&_.length<P.minLength?this.createError(R.STRING_LENGTH_SHORT,{length:_.length,minimum:P.minLength},"","/minLength",null,_,P):P.maxLength!==void 0&&_.length>P.maxLength?this.createError(R.STRING_LENGTH_LONG,{length:_.length,maximum:P.maxLength},"","/maxLength",null,_,P):null},s.prototype.validateStringPattern=function(_,P){if(typeof _!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var $;if(P.pattern instanceof RegExp)$=P.pattern;else{var N,j="",Y=P.pattern.match(/^\/(.+)\/([img]*)$/);Y?(N=Y[1],j=Y[2]):N=P.pattern,$=new RegExp(N,j)}return $.test(_)?null:this.createError(R.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,_,P)},s.prototype.validateArray=function(_,P,$){return Array.isArray(_)&&(this.validateArrayLength(_,P,$)||this.validateArrayUniqueItems(_,P,$)||this.validateArrayItems(_,P,$))||null},s.prototype.validateArrayLength=function(_,P){var $;return P.minItems!==void 0&&_.length<P.minItems&&($=this.createError(R.ARRAY_LENGTH_SHORT,{length:_.length,minimum:P.minItems},"","/minItems",null,_,P),this.handleError($))||P.maxItems!==void 0&&_.length>P.maxItems&&($=this.createError(R.ARRAY_LENGTH_LONG,{length:_.length,maximum:P.maxItems},"","/maxItems",null,_,P),this.handleError($))?$:null},s.prototype.validateArrayUniqueItems=function(_,P){if(P.uniqueItems){for(var $=0;$<_.length;$++)for(var N=$+1;N<_.length;N++)if(a(_[$],_[N])){var j=this.createError(R.ARRAY_UNIQUE,{match1:$,match2:N},"","/uniqueItems",null,_,P);if(this.handleError(j))return j}}return null},s.prototype.validateArrayItems=function(_,P,$){if(P.items===void 0)return null;var N,j;if(Array.isArray(P.items)){for(j=0;j<_.length;j++)if(j<P.items.length){if(N=this.validateAll(_[j],P.items[j],[j],["items",j],$+"/"+j))return N}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(N=this.createError(R.ARRAY_ADDITIONAL_ITEMS,{},"/"+j,"/additionalItems",null,_,P),this.handleError(N)))return N}else if(N=this.validateAll(_[j],P.additionalItems,[j],["additionalItems"],$+"/"+j))return N}}else for(j=0;j<_.length;j++)if(N=this.validateAll(_[j],P.items,[j],["items"],$+"/"+j))return N;return null},s.prototype.validateObject=function(_,P,$){return typeof _!="object"||_===null||Array.isArray(_)?null:this.validateObjectMinMaxProperties(_,P,$)||this.validateObjectRequiredProperties(_,P,$)||this.validateObjectProperties(_,P,$)||this.validateObjectDependencies(_,P,$)||null},s.prototype.validateObjectMinMaxProperties=function(_,P){var $=Object.keys(_),N;return P.minProperties!==void 0&&$.length<P.minProperties&&(N=this.createError(R.OBJECT_PROPERTIES_MINIMUM,{propertyCount:$.length,minimum:P.minProperties},"","/minProperties",null,_,P),this.handleError(N))||P.maxProperties!==void 0&&$.length>P.maxProperties&&(N=this.createError(R.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:$.length,maximum:P.maxProperties},"","/maxProperties",null,_,P),this.handleError(N))?N:null},s.prototype.validateObjectRequiredProperties=function(_,P){if(P.required!==void 0)for(var $=0;$<P.required.length;$++){var N=P.required[$];if(_[N]===void 0){var j=this.createError(R.OBJECT_REQUIRED,{key:N},"","/required/"+$,null,_,P);if(this.handleError(j))return j}}return null},s.prototype.validateObjectProperties=function(_,P,$){var N;for(var j in _){var Y=$+"/"+j.replace(/~/g,"~0").replace(/\//g,"~1"),J=!1;if(P.properties!==void 0&&P.properties[j]!==void 0&&(J=!0,N=this.validateAll(_[j],P.properties[j],[j],["properties",j],Y)))return N;if(P.patternProperties!==void 0)for(var ne in P.patternProperties){var pe=new RegExp(ne);if(pe.test(j)&&(J=!0,N=this.validateAll(_[j],P.patternProperties[ne],[j],["patternProperties",ne],Y)))return N}if(J)this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(N=this.createError(R.OBJECT_ADDITIONAL_PROPERTIES,{key:j},"","/additionalProperties",null,_,P).prefixWith(j,null),this.handleError(N)))return N}else if(N=this.validateAll(_[j],P.additionalProperties,[j],["additionalProperties"],Y))return N}else this.trackUnknownProperties&&!this.knownPropertyPaths[Y]&&(this.unknownPropertyPaths[Y]=!0)}return null},s.prototype.validateObjectDependencies=function(_,P,$){var N;if(P.dependencies!==void 0){for(var j in P.dependencies)if(_[j]!==void 0){var Y=P.dependencies[j];if(typeof Y=="string"){if(_[Y]===void 0&&(N=this.createError(R.OBJECT_DEPENDENCY_KEY,{key:j,missing:Y},"","",null,_,P).prefixWith(null,j).prefixWith(null,"dependencies"),this.handleError(N)))return N}else if(Array.isArray(Y))for(var J=0;J<Y.length;J++){var ne=Y[J];if(_[ne]===void 0&&(N=this.createError(R.OBJECT_DEPENDENCY_KEY,{key:j,missing:ne},"","/"+J,null,_,P).prefixWith(null,j).prefixWith(null,"dependencies"),this.handleError(N)))return N}else if(N=this.validateAll(_,Y,[],["dependencies",j],$))return N}}return null},s.prototype.validateCombinations=function(_,P,$){return this.validateAllOf(_,P,$)||this.validateAnyOf(_,P,$)||this.validateOneOf(_,P,$)||this.validateNot(_,P,$)||null},s.prototype.validateAllOf=function(_,P,$){if(P.allOf===void 0)return null;for(var N,j=0;j<P.allOf.length;j++){var Y=P.allOf[j];if(N=this.validateAll(_,Y,[],["allOf",j],$))return N}return null},s.prototype.validateAnyOf=function(_,P,$){if(P.anyOf===void 0)return null;var N=[],j=this.errors.length,Y,J;this.trackUnknownProperties&&(Y=this.unknownPropertyPaths,J=this.knownPropertyPaths);for(var ne=!0,pe=0;pe<P.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Xe=P.anyOf[pe],xe=this.errors.length,he=this.validateAll(_,Xe,[],["anyOf",pe],$);if(he===null&&xe===this.errors.length){if(this.errors=this.errors.slice(0,j),this.trackUnknownProperties){for(var Ee in this.knownPropertyPaths)J[Ee]=!0,delete Y[Ee];for(var vt in this.unknownPropertyPaths)J[vt]||(Y[vt]=!0);ne=!1;continue}return null}he&&N.push(he.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=Y,this.knownPropertyPaths=J),ne)return N=N.concat(this.errors.slice(j)),this.errors=this.errors.slice(0,j),this.createError(R.ANY_OF_MISSING,{},"","/anyOf",N,_,P)},s.prototype.validateOneOf=function(_,P,$){if(P.oneOf===void 0)return null;var N=null,j=[],Y=this.errors.length,J,ne;this.trackUnknownProperties&&(J=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var pe=0;pe<P.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Xe=P.oneOf[pe],xe=this.errors.length,he=this.validateAll(_,Xe,[],["oneOf",pe],$);if(he===null&&xe===this.errors.length){if(N===null)N=pe;else return this.errors=this.errors.slice(0,Y),this.createError(R.ONE_OF_MULTIPLE,{index1:N,index2:pe},"","/oneOf",null,_,P);if(this.trackUnknownProperties){for(var Ee in this.knownPropertyPaths)ne[Ee]=!0,delete J[Ee];for(var vt in this.unknownPropertyPaths)ne[vt]||(J[vt]=!0)}}else he&&j.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=J,this.knownPropertyPaths=ne),N===null?(j=j.concat(this.errors.slice(Y)),this.errors=this.errors.slice(0,Y),this.createError(R.ONE_OF_MISSING,{},"","/oneOf",j,_,P)):(this.errors=this.errors.slice(0,Y),null)},s.prototype.validateNot=function(_,P,$){if(P.not===void 0)return null;var N=this.errors.length,j,Y;this.trackUnknownProperties&&(j=this.unknownPropertyPaths,Y=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var J=this.validateAll(_,P.not,null,null,$),ne=this.errors.slice(N);return this.errors=this.errors.slice(0,N),this.trackUnknownProperties&&(this.unknownPropertyPaths=j,this.knownPropertyPaths=Y),J===null&&ne.length===0?this.createError(R.NOT_PASSED,{},"","/not",null,_,P):null},s.prototype.validateHypermedia=function(_,P,$){if(!P.links)return null;for(var N,j=0;j<P.links.length;j++){var Y=P.links[j];if(Y.rel==="describedby"){for(var J=new i(Y.href),ne=!0,pe=0;pe<J.varNames.length;pe++)if(!(J.varNames[pe]in _)){ne=!1;break}if(ne){var Xe=J.fillFromObject(_),xe={$ref:Xe};if(N=this.validateAll(_,xe,[],["links",j],$))return N}}}};function d(k){var _=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return _?{href:_[0]||"",protocol:_[1]||"",authority:_[2]||"",host:_[3]||"",hostname:_[4]||"",port:_[5]||"",pathname:_[6]||"",search:_[7]||"",hash:_[8]||""}:null}function m(k,_){function P($){var N=[];return $.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(j){j==="/.."?N.pop():N.push(j)}),N.join("").replace(/^\//,$.charAt(0)==="/"?"/":"")}return _=d(_||""),k=d(k||""),!_||!k?null:(_.protocol||k.protocol)+(_.protocol||_.authority?_.authority:k.authority)+P(_.protocol||_.authority||_.pathname.charAt(0)==="/"?_.pathname:_.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+_.pathname:k.pathname)+(_.protocol||_.authority||_.pathname?_.search:_.search||k.search)+_.hash}function g(k){return k.split("#")[0]}function y(k,_){if(k&&typeof k=="object")if(_===void 0?_=k.id:typeof k.id=="string"&&(_=m(_,k.id),k.id=_),Array.isArray(k))for(var P=0;P<k.length;P++)y(k[P],_);else{typeof k.$ref=="string"&&(k.$ref=m(_,k.$ref));for(var $ in k)$!=="enum"&&y(k[$],_)}}function w(k){k=k||"en";var _=B[k];return function(P){var $=_[P.code]||q[P.code];if(typeof $!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var N=P.params;return $.replace(/\{([^{}]*)\}/g,function(j,Y){var J=N[Y];return typeof J=="string"||typeof J=="number"?J:j})}}var R={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},x={};for(var T in R)x[R[T]]=T;var q={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 L(k,_,P,$,N){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+$);this.message="",this.params=_,this.code=k,this.dataPath=P||"",this.schemaPath=$||"",this.subErrors=N||null;var j=new Error(this.message);if(this.stack=j.stack||j.stacktrace,!this.stack)try{throw j}catch(Y){this.stack=Y.stack||Y.stacktrace}}L.prototype=Object.create(Error.prototype),L.prototype.constructor=L,L.prototype.name="ValidationError",L.prototype.prefixWith=function(k,_){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),_!==null&&(_=_.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+_+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,_);return this};function V(k,_){if(_.substring(0,k.length)===k){var P=_.substring(k.length);if(_.length>0&&_.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var B={};function K(k){var _=new s,P,$,N={setErrorReporter:function(j){return typeof j=="string"?this.language(j):($=j,!0)},addFormat:function(){_.addFormat.apply(_,arguments)},language:function(j){return j?(B[j]||(j=j.split("-")[0]),B[j]?(P=j,j):!1):P},addLanguage:function(j,Y){var J;for(J in R)Y[J]&&!Y[R[J]]&&(Y[R[J]]=Y[J]);var ne=j.split("-")[0];if(!B[ne])B[j]=Y,B[ne]=Y;else{B[j]=Object.create(B[ne]);for(J in Y)typeof B[ne][J]>"u"&&(B[ne][J]=Y[J]),B[j][J]=Y[J]}return this},freshApi:function(j){var Y=K();return j&&Y.language(j),Y},validate:function(j,Y,J,ne){var pe=w(P),Xe=$?function(Ee,vt,Ct){return $(Ee,vt,Ct)||pe(Ee,vt,Ct)}:pe,xe=new s(_,!1,Xe,J,ne);typeof Y=="string"&&(Y={$ref:Y}),xe.addSchema("",Y);var he=xe.validateAll(j,Y,null,null,"");return!he&&ne&&(he=xe.banUnknownProperties(j,Y)),this.error=he,this.missing=xe.missing,this.valid=he===null,this.valid},validateResult:function(){var j={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(j,arguments),j},validateMultiple:function(j,Y,J,ne){var pe=w(P),Xe=$?function(Ee,vt,Ct){return $(Ee,vt,Ct)||pe(Ee,vt,Ct)}:pe,xe=new s(_,!0,Xe,J,ne);typeof Y=="string"&&(Y={$ref:Y}),xe.addSchema("",Y),xe.validateAll(j,Y,null,null,""),ne&&xe.banUnknownProperties(j,Y);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=xe.errors,he.missing=xe.missing,he.valid=he.errors.length===0,he},addSchema:function(){return _.addSchema.apply(_,arguments)},getSchema:function(){return _.getSchema.apply(_,arguments)},getSchemaMap:function(){return _.getSchemaMap.apply(_,arguments)},getSchemaUris:function(){return _.getSchemaUris.apply(_,arguments)},getMissingUris:function(){return _.getMissingUris.apply(_,arguments)},dropSchemas:function(){_.dropSchemas.apply(_,arguments)},defineKeyword:function(){_.defineKeyword.apply(_,arguments)},defineError:function(j,Y,J){if(typeof j!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(j))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof Y!="number"||Y%1!==0||Y<1e4)throw new Error("Code number must be an integer > 10000");if(typeof R[j]<"u")throw new Error("Error already defined: "+j+" as "+R[j]);if(typeof x[Y]<"u")throw new Error("Error code already used: "+x[Y]+" as "+Y);R[j]=Y,x[Y]=j,q[j]=q[Y]=J;for(var ne in B){var pe=B[ne];pe[j]&&(pe[Y]=pe[Y]||pe[j])}},reset:function(){_.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:m,getDocumentUri:g,errorCodes:R};return N.language(k||"en"),N}var X=K();return X.addLanguage("en-gb",q),X.tv4=X,X})});var Au=F(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.regexpCode=Ge.getEsmExportName=Ge.getProperty=Ge.safeStringify=Ge.stringify=Ge.strConcat=Ge.addCodeArg=Ge.str=Ge._=Ge.nil=Ge._Code=Ge.Name=Ge.IDENTIFIER=Ge._CodeOrName=void 0;var ku=class{};Ge._CodeOrName=ku;Ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Wo=class extends ku{constructor(e){if(super(),!Ge.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}}};Ge.Name=Wo;var yn=class extends ku{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 Wo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ge._Code=yn;Ge.nil=new yn("");function eC(t,...e){let r=[t[0]],n=0;for(;n<e.length;)_b(r,e[n]),r.push(t[++n]);return new yn(r)}Ge._=eC;var wb=new yn("+");function tC(t,...e){let r=[Tu(t[0])],n=0;for(;n<e.length;)r.push(wb),_b(r,e[n]),r.push(wb,Tu(t[++n]));return qL(r),new yn(r)}Ge.str=tC;function _b(t,e){e instanceof yn?t.push(...e._items):e instanceof Wo?t.push(e):t.push(NL(e))}Ge.addCodeArg=_b;function qL(t){let e=1;for(;e<t.length-1;){if(t[e]===wb){let r=$L(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function $L(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Wo||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 Wo))return`"${t}${e.slice(1)}`}function ML(t,e){return e.emptyStr()?t:t.emptyStr()?e:tC`${t}${e}`}Ge.strConcat=ML;function NL(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Tu(Array.isArray(t)?t.join(","):t)}function DL(t){return new yn(Tu(t))}Ge.stringify=DL;function Tu(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ge.safeStringify=Tu;function FL(t){return typeof t=="string"&&Ge.IDENTIFIER.test(t)?new yn(`.${t}`):eC`[${t}]`}Ge.getProperty=FL;function LL(t){if(typeof t=="string"&&Ge.IDENTIFIER.test(t))return new yn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ge.getEsmExportName=LL;function jL(t){return new yn(t.toString())}Ge.regexpCode=jL});var Eb=F(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ValueScope=Nr.ValueScopeName=Nr.Scope=Nr.varKinds=Nr.UsedValueState=void 0;var Mr=Au(),xb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},th;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(th||(Nr.UsedValueState=th={}));Nr.varKinds={const:new Mr.Name("const"),let:new Mr.Name("let"),var:new Mr.Name("var")};var rh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Mr.Name?e:this.name(e)}name(e){return new Mr.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}}};Nr.Scope=rh;var nh=class extends Mr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Mr._)`.${new Mr.Name(r)}[${n}]`}};Nr.ValueScopeName=nh;var UL=(0,Mr._)`\n`,Rb=class extends rh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?UL:Mr.nil}}get(){return this._scope}name(e){return new nh(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,Mr._)`${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=Mr.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,th.Started);let m=r(d);if(m){let g=this.opts.es5?Nr.varKinds.var:Nr.varKinds.const;s=(0,Mr._)`${s}${g} ${d} = ${m};${this.opts._n}`}else if(m=i?.(d))s=(0,Mr._)`${s}${m}${this.opts._n}`;else throw new xb(d);f.set(d,th.Completed)})}return s}};Nr.ValueScope=Rb});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=Au(),Bn=Eb(),$s=Au();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return $s._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return $s.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return $s.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return $s.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return $s.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return $s.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return $s.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return $s.Name}});var ah=Eb();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return ah.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return ah.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return ah.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return ah.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 Ji=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Cb=class extends Ji{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Bn.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=El(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},ih=class extends Ji{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=El(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return oh(e,this.rhs)}},Ob=class extends ih{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Ib=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Pb=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},kb=class extends Ji{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Tb=class extends Ji{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=El(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},qu=class extends Ji{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)||(HL(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Yo(e,r.names),{})}},Yi=class extends qu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Ab=class extends qu{},Rl=class extends Yi{};Rl.kind="else";var zo=class t extends Yi{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 Rl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(rC(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=El(this.condition,e,r),this}get names(){let e=super.names;return oh(e,this.condition),this.else&&Yo(e,this.else.names),e}};zo.kind="if";var Jo=class extends Yi{};Jo.kind="for";var qb=class extends Jo{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=El(this.iteration,e,r),this}get names(){return Yo(super.names,this.iteration.names)}},$b=class extends Jo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Bn.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=oh(super.names,this.from);return oh(e,this.to)}},sh=class extends Jo{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=El(this.iterable,e,r),this}get names(){return Yo(super.names,this.iterable.names)}},$u=class extends Yi{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)}};$u.kind="func";var Mu=class extends qu{render(e){return"return "+super.render(e)}};Mu.kind="return";var Mb=class extends Yi{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&&Yo(e,this.catch.names),this.finally&&Yo(e,this.finally.names),e}},Nu=class extends Yi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Nu.kind="catch";var Du=class extends Yi{render(e){return"finally"+super.render(e)}};Du.kind="finally";var Nb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new Bn.Scope({parent:e}),this._nodes=[new Ab]}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 Cb(e,s,n)),s}const(e,r,n){return this._def(Bn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Bn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Bn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new ih(e,r,n))}add(e,r){return this._leafNode(new Ob(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Tb(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 Rl)}endIf(){return this._endBlockNode(zo,Rl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new qb(e),r)}forRange(e,r,n,i,s=this.opts.es5?Bn.varKinds.var:Bn.varKinds.let){let a=this._scope.toName(e);return this._for(new $b(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Bn.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 sh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Bn.varKinds.var:Bn.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 sh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Jo)}label(e){return this._leafNode(new Ib(e))}break(e){return this._leafNode(new Pb(e))}return(e){let r=new Mu;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Mu)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Mb;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Nu(s),r(s)}return n&&(this._currNode=i.finally=new Du,this.code(n)),this._endBlockNode(Nu,Du)}throw(e){return this._leafNode(new kb(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 $u(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode($u)}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=Nb;function Yo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function oh(t,e){return e instanceof Be._CodeOrName?Yo(t,e.names):t}function El(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 HL(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function rC(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${Db(t)}`}Ae.not=rC;var BL=nC(Ae.operators.AND);function VL(...t){return t.reduce(BL)}Ae.and=VL;var WL=nC(Ae.operators.OR);function zL(...t){return t.reduce(WL)}Ae.or=zL;function nC(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${Db(e)} ${t} ${Db(r)}`}function Db(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(),JL=Au();function YL(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=YL;function GL(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(oC(t,e),!aC(e,t.self.RULES.all))}De.alwaysValidSchema=GL;function oC(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]||uC(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=oC;function aC(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=aC;function KL(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=KL;function QL({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=QL;function ZL(t){return lC(decodeURIComponent(t))}De.unescapeFragment=ZL;function XL(t){return encodeURIComponent(Lb(t))}De.escapeFragment=XL;function Lb(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Lb;function lC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=lC;function ej(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=ej;function iC({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:iC({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} || {}`),jb(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:cC}),items:iC({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 cC(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,pt._)`{}`);return e!==void 0&&jb(t,r,e),r}De.evaluatedPropsToName=cC;function jb(t,e,r){Object.keys(r).forEach(n=>t.assign((0,pt._)`${e}${(0,pt.getProperty)(n)}`,!0))}De.setEvaluated=jb;var sC={};function tj(t,e){return t.scopeValue("func",{ref:e,code:sC[e.code]||(sC[e.code]=new JL._Code(e.code))})}De.useFunc=tj;var Fb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Fb||(De.Type=Fb={}));function rj(t,e,r){if(t instanceof pt.Name){let n=e===Fb.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():"/"+Lb(t)}De.getErrorPath=rj;function uC(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=uC});var Gi=F(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});var or=Ne(),nj={data:new or.Name("data"),valCxt:new or.Name("valCxt"),instancePath:new or.Name("instancePath"),parentData:new or.Name("parentData"),parentDataProperty:new or.Name("parentDataProperty"),rootData:new or.Name("rootData"),dynamicAnchors:new or.Name("dynamicAnchors"),vErrors:new or.Name("vErrors"),errors:new or.Name("errors"),this:new or.Name("this"),self:new or.Name("self"),scope:new or.Name("scope"),json:new or.Name("json"),jsonPos:new or.Name("jsonPos"),jsonLen:new or.Name("jsonLen"),jsonPart:new or.Name("jsonPart")};Ub.default=nj});var Fu=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.extendErrors=ar.resetErrorsCount=ar.reportExtraError=ar.reportError=ar.keyword$DataError=ar.keywordError=void 0;var ze=Ne(),lh=We(),Rr=Gi();ar.keywordError={message:({keyword:t})=>(0,ze.str)`must pass "${t}" keyword validation`};ar.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 ij(t,e=ar.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:l}=i,f=pC(t,e,r);n??(a||l)?fC(s,f):dC(i,(0,ze._)`[${f}]`)}ar.reportError=ij;function sj(t,e=ar.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,l=pC(t,e,r);fC(i,l),s||a||dC(n,Rr.default.vErrors)}ar.reportExtraError=sj;function oj(t,e){t.assign(Rr.default.errors,e),t.if((0,ze._)`${Rr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ze._)`${Rr.default.vErrors}.length`,e),()=>t.assign(Rr.default.vErrors,null)))}ar.resetErrorsCount=oj;function aj({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,Rr.default.errors,l=>{t.const(a,(0,ze._)`${Rr.default.vErrors}[${l}]`),t.if((0,ze._)`${a}.instancePath === undefined`,()=>t.assign((0,ze._)`${a}.instancePath`,(0,ze.strConcat)(Rr.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))})}ar.extendErrors=aj;function fC(t,e){let r=t.const("err",e);t.if((0,ze._)`${Rr.default.vErrors} === null`,()=>t.assign(Rr.default.vErrors,(0,ze._)`[${r}]`),(0,ze._)`${Rr.default.vErrors}.push(${r})`),t.code((0,ze._)`${Rr.default.errors}++`)}function dC(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 Go={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 pC(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ze._)`{}`:lj(t,e,r)}function lj(t,e,r={}){let{gen:n,it:i}=t,s=[cj(i,r),uj(t,r)];return fj(t,e,s),n.object(...s)}function cj({errorPath:t},{instancePath:e}){let r=e?(0,ze.str)`${t}${(0,lh.getErrorPath)(e,lh.Type.Str)}`:t;return[Rr.default.instancePath,(0,ze.strConcat)(Rr.default.instancePath,r)]}function uj({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,lh.getErrorPath)(r,lh.Type.Str)}`),[Go.schemaPath,i]}function fj(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([Go.keyword,i],[Go.params,typeof e=="function"?e(t):e||(0,ze._)`{}`]),f.messages&&n.push([Go.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Go.schema,a],[Go.parentSchema,(0,ze._)`${m}${g}`],[Rr.default.data,s]),d&&n.push([Go.propertyName,d])}});var mC=F(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.boolOrEmptySchema=Cl.topBoolOrEmptySchema=void 0;var dj=Fu(),pj=Ne(),hj=Gi(),mj={message:"boolean schema is false"};function gj(t){let{gen:e,schema:r,validateName:n}=t;r===!1?hC(t,!1):typeof r=="object"&&r.$async===!0?e.return(hj.default.data):(e.assign((0,pj._)`${n}.errors`,null),e.return(!0))}Cl.topBoolOrEmptySchema=gj;function yj(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),hC(t)):r.var(e,!0)}Cl.boolOrEmptySchema=yj;function hC(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,dj.reportError)(i,mj,void 0,e)}});var Hb=F(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.getRules=Ol.isJSONType=void 0;var vj=["string","number","integer","boolean","null","object","array"],bj=new Set(vj);function Sj(t){return typeof t=="string"&&bj.has(t)}Ol.isJSONType=Sj;function wj(){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:{}}}Ol.getRules=wj});var Bb=F(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.shouldUseRule=Ms.shouldUseGroup=Ms.schemaHasRulesForType=void 0;function _j({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&gC(t,n)}Ms.schemaHasRulesForType=_j;function gC(t,e){return e.rules.some(r=>yC(t,r))}Ms.shouldUseGroup=gC;function yC(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))}Ms.shouldUseRule=yC});var Lu=F(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.reportTypeError=lr.checkDataTypes=lr.checkDataType=lr.coerceAndCheckDataType=lr.getJSONTypes=lr.getSchemaTypes=lr.DataType=void 0;var xj=Hb(),Rj=Bb(),Ej=Fu(),Ie=Ne(),vC=We(),Il;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Il||(lr.DataType=Il={}));function Cj(t){let e=bC(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}lr.getSchemaTypes=Cj;function bC(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(xj.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}lr.getJSONTypes=bC;function Oj(t,e){let{gen:r,data:n,opts:i}=t,s=Ij(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,Rj.schemaHasRulesForType)(t,e[0]));if(a){let l=Wb(e,n,i.strictNumbers,Il.Wrong);r.if(l,()=>{s.length?Pj(t,e,s):zb(t)})}return a}lr.coerceAndCheckDataType=Oj;var SC=new Set(["string","number","integer","boolean","null"]);function Ij(t,e){return e?t.filter(r=>SC.has(r)||e==="array"&&r==="array"):[]}function Pj(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Ie._)`typeof ${i}`),l=n.let("coerced",(0,Ie._)`undefined`);s.coerceTypes==="array"&&n.if((0,Ie._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Ie._)`${i}[0]`).assign(a,(0,Ie._)`typeof ${i}`).if(Wb(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Ie._)`${l} !== undefined`);for(let d of r)(SC.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),zb(t),n.endIf(),n.if((0,Ie._)`${l} !== undefined`,()=>{n.assign(i,l),kj(t,l)});function f(d){switch(d){case"string":n.elseIf((0,Ie._)`${a} == "number" || ${a} == "boolean"`).assign(l,(0,Ie._)`"" + ${i}`).elseIf((0,Ie._)`${i} === null`).assign(l,(0,Ie._)`""`);return;case"number":n.elseIf((0,Ie._)`${a} == "boolean" || ${i} === null
|
|
25
25
|
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,Ie._)`+${i}`);return;case"integer":n.elseIf((0,Ie._)`${a} === "boolean" || ${i} === null
|
|
26
26
|
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,Ie._)`+${i}`);return;case"boolean":n.elseIf((0,Ie._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,Ie._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,Ie._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,Ie._)`${a} === "string" || ${a} === "number"
|
|
27
|
-
|| ${a} === "boolean" || ${i} === null`).assign(l,(0,Ie._)`[${i}]`)}}}function Ij({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ie._)`${e} !== undefined`,()=>t.assign((0,Ie._)`${e}[${r}]`,n))}function Hb(t,e,r,n=Il.Correct){let i=n===Il.Correct?Ie.operators.EQ:Ie.operators.NEQ,s;switch(t){case"null":return(0,Ie._)`${e} ${i} null`;case"array":s=(0,Ie._)`Array.isArray(${e})`;break;case"object":s=(0,Ie._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Ie._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Ie._)`typeof ${e} ${i} ${t}`}return n===Il.Correct?s:(0,Ie.not)(s);function a(l=Ie.nil){return(0,Ie.and)((0,Ie._)`typeof ${e} == "number"`,l,r?(0,Ie._)`isFinite(${e})`:Ie.nil)}}lr.checkDataType=Hb;function Bb(t,e,r,n){if(t.length===1)return Hb(t[0],e,r,n);let i,s=(0,vC.toHash)(t);if(s.array&&s.object){let a=(0,Ie._)`typeof ${e} != "object"`;i=s.null?a:(0,Ie._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Ie.nil;s.number&&delete s.integer;for(let a in s)i=(0,Ie.and)(i,Hb(a,e,r,n));return i}lr.checkDataTypes=Bb;var Pj={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ie._)`{type: ${t}}`:(0,Ie._)`{type: ${e}}`};function Vb(t){let e=kj(t);(0,xj.reportError)(e,Pj)}lr.reportTypeError=Vb;function kj(t){let{gen:e,data:r,schema:n}=t,i=(0,vC.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var _C=F(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.assignDefaults=void 0;var Pl=Ne(),Tj=We();function Aj(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)wC(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>wC(t,s,i.default))}oh.assignDefaults=Aj;function wC(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let l=(0,Pl._)`${s}${(0,Pl.getProperty)(e)}`;if(i){(0,Tj.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Pl._)`${l} === undefined`;a.useDefaults==="empty"&&(f=(0,Pl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Pl._)`${l} = ${(0,Pl.stringify)(r)}`)}});var vn=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.validateUnion=ct.validateArray=ct.usePattern=ct.callValidateCode=ct.schemaProperties=ct.allSchemaProperties=ct.noPropertyInData=ct.propertyInData=ct.isOwnProperty=ct.hasPropFunc=ct.reportMissingProp=ct.checkMissingProp=ct.checkReportMissingProp=void 0;var bt=Ne(),Wb=We(),Ns=Gi(),qj=We();function $j(t,e){let{gen:r,data:n,it:i}=t;r.if(Jb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,bt._)`${e}`},!0),t.error()})}ct.checkReportMissingProp=$j;function Mj({gen:t,data:e,it:{opts:r}},n,i){return(0,bt.or)(...n.map(s=>(0,bt.and)(Jb(t,e,s,r.ownProperties),(0,bt._)`${i} = ${s}`)))}ct.checkMissingProp=Mj;function Nj(t,e){t.setParams({missingProperty:e},!0),t.error()}ct.reportMissingProp=Nj;function xC(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,bt._)`Object.prototype.hasOwnProperty`})}ct.hasPropFunc=xC;function zb(t,e,r){return(0,bt._)`${xC(t)}.call(${e}, ${r})`}ct.isOwnProperty=zb;function Dj(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} !== undefined`;return n?(0,bt._)`${i} && ${zb(t,e,r)}`:i}ct.propertyInData=Dj;function Jb(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} === undefined`;return n?(0,bt.or)(i,(0,bt.not)(zb(t,e,r))):i}ct.noPropertyInData=Jb;function RC(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ct.allSchemaProperties=RC;function Fj(t,e){return RC(e).filter(r=>!(0,Wb.alwaysValidSchema)(t,e[r]))}ct.schemaProperties=Fj;function Lj({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=[[Ns.default.instancePath,(0,bt.strConcat)(Ns.default.instancePath,s)],[Ns.default.parentData,a.parentData],[Ns.default.parentDataProperty,a.parentDataProperty],[Ns.default.rootData,Ns.default.rootData]];a.opts.dynamicRef&&g.push([Ns.default.dynamicAnchors,Ns.default.dynamicAnchors]);let y=(0,bt._)`${m}, ${r.object(...g)}`;return f!==bt.nil?(0,bt._)`${l}.call(${f}, ${y})`:(0,bt._)`${l}(${y})`}ct.callValidateCode=Lj;var jj=(0,bt._)`new RegExp`;function Uj({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"?jj:(0,qj.useFunc)(t,i)}(${r}, ${n})`})}ct.usePattern=Uj;function Hj(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:Wb.Type.Num},s),e.if((0,bt.not)(s),l)})}}ct.validateArray=Hj;function Bj(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,Wb.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))}ct.validateUnion=Bj});var OC=F(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.validateKeywordUsage=yi.validSchemaType=yi.funcKeywordCode=yi.macroKeywordCode=void 0;var Er=Ne(),Ko=Gi(),Vj=vn(),Wj=Nu();function zj(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,l=e.macro.call(a.self,i,s,a),f=CC(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))}yi.macroKeywordCode=zj;function Jj(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:l,it:f}=t;Gj(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,a,f):e.validate,m=CC(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)x(),e.modifying&&EC(t),T(()=>t.error());else{let q=e.async?w():R();e.modifying&&EC(t),T(()=>Yj(t,q))}}function w(){let q=n.let("ruleErrs",null);return n.try(()=>x((0,Er._)`await `),L=>n.assign(g,!1).if((0,Er._)`${L} instanceof ${f.ValidationError}`,()=>n.assign(q,(0,Er._)`${L}.errors`),()=>n.throw(L))),q}function R(){let q=(0,Er._)`${m}.errors`;return n.assign(q,null),x(Er.nil),q}function x(q=e.async?(0,Er._)`await `:Er.nil){let L=f.opts.passContext?Ko.default.this:Ko.default.self,V=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Er._)`${q}${(0,Vj.callValidateCode)(t,m,L,V)}`,e.modifying)}function T(q){var L;n.if((0,Er.not)((L=e.valid)!==null&&L!==void 0?L:g),q)}}yi.funcKeywordCode=Jj;function EC(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Er._)`${n.parentData}[${n.parentDataProperty}]`))}function Yj(t,e){let{gen:r}=t;r.if((0,Er._)`Array.isArray(${e})`,()=>{r.assign(Ko.default.vErrors,(0,Er._)`${Ko.default.vErrors} === null ? ${e} : ${Ko.default.vErrors}.concat(${e})`).assign(Ko.default.errors,(0,Er._)`${Ko.default.vErrors}.length`),(0,Wj.extendErrors)(t)},()=>t.error())}function Gj({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function CC(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 Kj(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")}yi.validSchemaType=Kj;function Qj({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)}}yi.validateKeywordUsage=Qj});var PC=F(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.extendSubschemaMode=Ds.extendSubschemaData=Ds.getSubschema=void 0;var vi=Ne(),IC=We();function Zj(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,vi._)`${t.schemaPath}${(0,vi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,vi._)`${t.schemaPath}${(0,vi.getProperty)(e)}${(0,vi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,IC.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')}Ds.getSubschema=Zj;function Xj(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,vi._)`${e.data}${(0,vi.getProperty)(r)}`,!0);f(y),t.errorPath=(0,vi.str)`${d}${(0,IC.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,vi._)`${r}`,t.dataPathArr=[...m,t.parentDataProperty]}if(i!==void 0){let d=i instanceof vi.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]}}Ds.extendSubschemaData=Xj;function e2(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}Ds.extendSubschemaMode=e2});var Yb=F((c5,kC)=>{"use strict";kC.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 AC=F((u5,TC)=>{"use strict";var Fs=TC.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(){};ah(e,n,i,t,"",t)};Fs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Fs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Fs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Fs.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 ah(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 Fs.arrayKeywords)for(var y=0;y<g.length;y++)ah(t,e,r,g[y],i+"/"+m+"/"+y,s,i,m,n,y)}else if(m in Fs.propsKeywords){if(g&&typeof g=="object")for(var w in g)ah(t,e,r,g[w],i+"/"+m+"/"+t2(w),s,i,m,n,w)}else(m in Fs.keywords||t.allKeys&&!(m in Fs.skipKeywords))&&ah(t,e,r,g,i+"/"+m,s,i,m,n)}r(n,i,s,a,l,f,d)}}function t2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Fu=F(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.getSchemaRefs=Dr.resolveUrl=Dr.normalizeId=Dr._getFullPath=Dr.getFullPath=Dr.inlineRef=void 0;var r2=We(),n2=Yb(),i2=AC(),s2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function o2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Gb(t):e?qC(t)<=e:!1}Dr.inlineRef=o2;var a2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Gb(t){for(let e in t){if(a2.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Gb)||typeof r=="object"&&Gb(r))return!0}return!1}function qC(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!s2.has(r)&&(typeof t[r]=="object"&&(0,r2.eachItem)(t[r],n=>e+=qC(n)),e===1/0))return 1/0}return e}function $C(t,e="",r){r!==!1&&(e=kl(e));let n=t.parse(e);return MC(t,n)}Dr.getFullPath=$C;function MC(t,e){return t.serialize(e).split("#")[0]+"#"}Dr._getFullPath=MC;var l2=/#\/?$/;function kl(t){return t?t.replace(l2,""):""}Dr.normalizeId=kl;function c2(t,e,r){return r=kl(r),t.resolve(e,r)}Dr.resolveUrl=c2;var u2=/^[a-z_][-a-z0-9._]*$/i;function f2(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=kl(t[r]||e),s={"":i},a=$C(n,i,!1),l={},f=new Set;return i2(t,{allKeys:!0},(g,y,w,R)=>{if(R===void 0)return;let x=a+y,T=s[R];typeof g[r]=="string"&&(T=q.call(this,g[r])),L.call(this,g.$anchor),L.call(this,g.$dynamicAnchor),s[y]=T;function q(V){let B=this.opts.uriResolver.resolve;if(V=kl(T?B(T,V):V),f.has(V))throw m(V);f.add(V);let K=this.refs[V];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?d(g,K.schema,V):V!==kl(x)&&(V[0]==="#"?(d(g,l[V],V),l[V]=g):this.refs[V]=x),V}function L(V){if(typeof V=="string"){if(!u2.test(V))throw new Error(`invalid anchor "${V}"`);q.call(this,`#${V}`)}}}),l;function d(g,y,w){if(y!==void 0&&!n2(g,y))throw m(w)}function m(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Dr.getSchemaRefs=f2});var Uu=F(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.getData=Ls.KeywordCxt=Ls.validateFunctionCode=void 0;var jC=mC(),NC=Du(),Qb=Ub(),lh=Du(),d2=_C(),ju=OC(),Kb=PC(),de=Ne(),we=Gi(),p2=Fu(),Ki=We(),Lu=Nu();function h2(t){if(BC(t)&&(VC(t),HC(t))){y2(t);return}UC(t,()=>(0,jC.topBoolOrEmptySchema)(t))}Ls.validateFunctionCode=h2;function UC({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,de._)`${we.default.data}, ${we.default.valCxt}`,n.$async,()=>{t.code((0,de._)`"use strict"; ${DC(r,i)}`),g2(t,i),t.code(s)}):t.func(e,(0,de._)`${we.default.data}, ${m2(i)}`,n.$async,()=>t.code(DC(r,i)).code(s))}function m2(t){return(0,de._)`{${we.default.instancePath}="", ${we.default.parentData}, ${we.default.parentDataProperty}, ${we.default.rootData}=${we.default.data}${t.dynamicRef?(0,de._)`, ${we.default.dynamicAnchors}={}`:de.nil}}={}`}function g2(t,e){t.if(we.default.valCxt,()=>{t.var(we.default.instancePath,(0,de._)`${we.default.valCxt}.${we.default.instancePath}`),t.var(we.default.parentData,(0,de._)`${we.default.valCxt}.${we.default.parentData}`),t.var(we.default.parentDataProperty,(0,de._)`${we.default.valCxt}.${we.default.parentDataProperty}`),t.var(we.default.rootData,(0,de._)`${we.default.valCxt}.${we.default.rootData}`),e.dynamicRef&&t.var(we.default.dynamicAnchors,(0,de._)`${we.default.valCxt}.${we.default.dynamicAnchors}`)},()=>{t.var(we.default.instancePath,(0,de._)`""`),t.var(we.default.parentData,(0,de._)`undefined`),t.var(we.default.parentDataProperty,(0,de._)`undefined`),t.var(we.default.rootData,we.default.data),e.dynamicRef&&t.var(we.default.dynamicAnchors,(0,de._)`{}`)})}function y2(t){let{schema:e,opts:r,gen:n}=t;UC(t,()=>{r.$comment&&e.$comment&&zC(t),_2(t),n.let(we.default.vErrors,null),n.let(we.default.errors,0),r.unevaluated&&v2(t),WC(t),E2(t)})}function v2(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 DC(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 b2(t,e){if(BC(t)&&(VC(t),HC(t))){S2(t,e);return}(0,jC.boolOrEmptySchema)(t,e)}function HC({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 BC(t){return typeof t.schema!="boolean"}function S2(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&zC(t),x2(t),R2(t);let s=n.const("_errs",we.default.errors);WC(t,s),n.var(e,(0,de._)`${s} === ${we.default.errors}`)}function VC(t){(0,Ki.checkUnknownRules)(t),w2(t)}function WC(t,e){if(t.opts.jtd)return FC(t,[],!1,e);let r=(0,NC.getSchemaTypes)(t.schema),n=(0,NC.coerceAndCheckDataType)(t,r);FC(t,r,!n,e)}function w2(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ki.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function _2(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ki.checkStrictMode)(t,"default is ignored in the schema root")}function x2(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,p2.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function R2(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function zC({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,de._)`${we.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._)`${we.default.self}.opts.$comment(${s}, ${a}, ${l}.schema)`)}}function E2(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,de._)`${we.default.errors} === 0`,()=>e.return(we.default.data),()=>e.throw((0,de._)`new ${i}(${we.default.vErrors})`)):(e.assign((0,de._)`${n}.errors`,we.default.vErrors),s.unevaluated&&C2(t),e.return((0,de._)`${we.default.errors} === 0`))}function C2({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 FC(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,Ki.schemaHasRulesButRef)(s,m))){i.block(()=>YC(t,"$ref",m.all.$ref.definition));return}f.jtd||O2(t,e),i.block(()=>{for(let y of m.rules)g(y);g(m.post)});function g(y){(0,Qb.shouldUseGroup)(s,y)&&(y.type?(i.if((0,lh.checkDataType)(y.type,a,f.strictNumbers)),LC(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,lh.reportTypeError)(t)),i.endIf()):LC(t,y),l||i.if((0,de._)`${we.default.errors} === ${n||0}`))}}function LC(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,d2.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Qb.shouldUseRule)(n,s)&&YC(t,s.keyword,s.definition,e.type)})}function O2(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(I2(t,e),t.opts.allowUnionTypes||P2(t,e),k2(t,t.dataTypes))}function I2(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{JC(t.dataTypes,r)||Zb(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),A2(t,e)}}function P2(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Zb(t,"use allowUnionTypes to allow union type keyword")}function k2(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Qb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>T2(e,a))&&Zb(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function T2(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function JC(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function A2(t,e){let r=[];for(let n of t.dataTypes)JC(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Zb(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ki.checkStrictMode)(t,e,t.opts.strictTypes)}var ch=class{constructor(e,r,n){if((0,ju.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,Ki.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",GC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ju.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",we.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?Lu.reportExtraError:Lu.reportError)(this,this.def.error,r)}$dataError(){(0,Lu.reportError)(this,this.def.$dataError||Lu.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Lu.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,lh.checkDataTypes)(f,r,s.opts.strictNumbers,lh.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,Kb.getSubschema)(this.it,e);(0,Kb.extendSubschemaData)(n,this.it,e),(0,Kb.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return b2(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ki.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ki.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}};Ls.KeywordCxt=ch;function YC(t,e,r,n){let i=new ch(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ju.funcKeywordCode)(i,r):"macro"in r?(0,ju.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ju.funcKeywordCode)(i,r)}var q2=/^\/(?:[^~]|~0|~1)*$/,$2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function GC(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return we.default.rootData;if(t[0]==="/"){if(!q2.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=we.default.rootData}else{let d=$2.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,Ki.unescapeJsonPointer)(d))}`,a=(0,de._)`${a} && ${s}`);return a;function f(d,m){return`Cannot access ${d} ${m} levels up, current level is ${e}`}}Ls.getData=GC});var uh=F(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var Xb=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};eS.default=Xb});var Hu=F(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});var tS=Fu(),rS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,tS.resolveUrl)(e,r,n),this.missingSchema=(0,tS.normalizeId)((0,tS.getFullPath)(e,this.missingRef))}};nS.default=rS});var dh=F(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.resolveSchema=bn.getCompilingSchema=bn.resolveRef=bn.compileSchema=bn.SchemaEnv=void 0;var Vn=Ne(),M2=uh(),Qo=Gi(),Wn=Fu(),KC=We(),N2=Uu(),Tl=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,Wn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};bn.SchemaEnv=Tl;function sS(t){let e=QC.call(this,t);if(e)return e;let r=(0,Wn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Vn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=a.scopeValue("Error",{ref:M2.default,code:(0,Vn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let d={gen:a,allErrors:this.opts.allErrors,data:Qo.default.data,parentData:Qo.default.parentData,parentDataProperty:Qo.default.parentDataProperty,dataNames:[Qo.default.data],dataPathArr:[Vn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Vn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Vn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Vn._)`""`,opts:this.opts,self:this},m;try{this._compilations.add(t),(0,N2.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let g=a.toString();m=`${a.scopeRefs(Qo.default.scope)}return ${g}`,this.opts.code.process&&(m=this.opts.code.process(m,t));let w=new Function(`${Qo.default.self}`,`${Qo.default.scope}`,m)(this,this.scope.get());if(this.scope.value(f,{ref:w}),w.errors=null,w.schema=t.schema,w.schemaEnv=t,t.$async&&(w.$async=!0),this.opts.code.source===!0&&(w.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:R,items:x}=d;w.evaluated={props:R instanceof Vn.Name?void 0:R,items:x instanceof Vn.Name?void 0:x,dynamicProps:R instanceof Vn.Name,dynamicItems:x instanceof Vn.Name},w.source&&(w.source.evaluated=(0,Vn.stringify)(w.evaluated))}return t.validate=w,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)}}bn.compileSchema=sS;function D2(t,e,r){var n;r=(0,Wn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=j2.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 Tl({schema:a,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=F2.call(this,s)}bn.resolveRef=D2;function F2(t){return(0,Wn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:sS.call(this,t)}function QC(t){for(let e of this._compilations)if(L2(e,t))return e}bn.getCompilingSchema=QC;function L2(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function j2(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||fh.call(this,t,e)}function fh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Wn._getFullPath)(this.opts.uriResolver,r),i=(0,Wn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return iS.call(this,r,t);let s=(0,Wn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let l=fh.call(this,t,a);return typeof l?.schema!="object"?void 0:iS.call(this,r,l)}if(typeof a?.schema=="object"){if(a.validate||sS.call(this,a),s===(0,Wn.normalizeId)(e)){let{schema:l}=a,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,Wn.resolveUrl)(this.opts.uriResolver,i,d)),new Tl({schema:l,schemaId:f,root:t,baseId:i})}return iS.call(this,r,a)}}bn.resolveSchema=fh;var U2=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function iS(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,KC.unescapeFragment)(l)];if(f===void 0)return;r=f;let d=typeof r=="object"&&r[this.opts.schemaId];!U2.has(l)&&d&&(e=(0,Wn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,KC.schemaHasRulesButRef)(r,this.RULES)){let l=(0,Wn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=fh.call(this,n,l)}let{schemaId:a}=this.opts;if(s=s||new Tl({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var ZC=F((g5,H2)=>{H2.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 lS=F((y5,iO)=>{"use strict";var B2=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),eO=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),oS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),tO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),V2=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function aS(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 W2=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function XC(t){return t.length=0,!0}function z2(t,e,r){if(t.length){let n=aS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function J2(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,l=z2;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=XC}else{i.push(d);continue}}return i.length&&(l===XC?r.zone=i.join(""):a?n.push(i.join("")):n.push(aS(i))),r.address=n.join(""),r}function rO(t){if(Y2(t,":")<2)return{host:t,isIPV6:!1};let e=J2(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 Y2(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function G2(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 K2={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Q2=/[@/?#:]/g,Z2=/[@/?#]/g;function nO(t,e){let r=e?Z2:Q2;return r.lastIndex=0,t.replace(r,n=>K2[n])}function X2(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(oS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&tO(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function eU(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(oS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&tO(s)?e+=s:e+="%"+i,r+=2;continue}}V2(t[r])?e+=t[r]:e+=escape(t[r])}return e}function tU(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(oS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function rU(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!eO(r)){let n=rO(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}iO.exports={nonSimpleDomain:W2,recomposeAuthority:rU,reescapeHostDelimiters:nO,normalizePercentEncoding:X2,normalizePathEncoding:eU,escapePreservingEscapes:tU,removeDotSegments:G2,isIPv4:eO,isUUID:B2,normalizeIPv6:rO,stringArrayToHexStripped:aS}});var cO=F((v5,lO)=>{"use strict";var{isUUID:nU}=lS(),iU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,sU=["http","https","ws","wss","urn","urn:uuid"];function oU(t){return sU.indexOf(t)!==-1}function cS(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 sO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function oO(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 aU(t){return t.secure=cS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function lU(t){if((t.port===(cS(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 cU(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(iU);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=uS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function uU(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=uS(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 fU(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!nU(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function dU(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var aO={scheme:"http",domainHost:!0,parse:sO,serialize:oO},pU={scheme:"https",domainHost:aO.domainHost,parse:sO,serialize:oO},ph={scheme:"ws",domainHost:!0,parse:aU,serialize:lU},hU={scheme:"wss",domainHost:ph.domainHost,parse:ph.parse,serialize:ph.serialize},mU={scheme:"urn",parse:cU,serialize:uU,skipNormalize:!0},gU={scheme:"urn:uuid",parse:fU,serialize:dU,skipNormalize:!0},hh={http:aO,https:pU,ws:ph,wss:hU,urn:mU,"urn:uuid":gU};Object.setPrototypeOf(hh,null);function uS(t){return t&&(hh[t]||hh[t.toLowerCase()])||void 0}lO.exports={wsIsSecure:cS,SCHEMES:hh,isValidSchemeName:oU,getSchemeHandler:uS}});var mO=F((b5,mh)=>{"use strict";var{normalizeIPv6:yU,removeDotSegments:Bu,recomposeAuthority:vU,normalizePercentEncoding:bU,normalizePathEncoding:SU,escapePreservingEscapes:wU,reescapeHostDelimiters:_U,isIPv4:xU,nonSimpleDomain:RU}=lS(),{SCHEMES:EU,getSchemeHandler:fO}=cO();function CU(t,e){return typeof t=="string"?t=TU(t,e):typeof t=="object"&&(t=Al(Zo(t,e),e)),t}function OU(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=dO(Al(t,n),Al(e,n),n,!0);return n.skipEscape=!0,Zo(i,n)}function dO(t,e,r,n){let i={};return n||(t=Al(Zo(t,r),r),e=Al(Zo(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=Bu(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=Bu(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Bu(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=Bu(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 IU(t,e,r){let n=uO(t,r),i=uO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Zo(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=fO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=bU(r.path):(r.path=wU(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=vU(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=Bu(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 PU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function kU(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 pO(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(PU);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=kU(n,a);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(xU(n.host)===!1){let m=yU(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=fO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&RU(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=_U(unescape(n.host),s))),n.path&&(n.path=SU(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 Al(t,e){return pO(t,e).parsed}function TU(t,e){return hO(t,e).normalized}function hO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=pO(t,e);return{normalized:n?t:Zo(r,e),malformedAuthorityOrPort:n}}function uO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=hO(t,e);return n?void 0:r}if(typeof t=="object")return Zo(t,e)}var fS={SCHEMES:EU,normalize:CU,resolve:OU,resolveComponent:dO,equal:IU,serialize:Zo,parse:Al};mh.exports=fS;mh.exports.default=fS;mh.exports.fastUri=fS});var yO=F(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});var gO=mO();gO.code='require("ajv/dist/runtime/uri").default';dS.default=gO});var EO=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 AU=Uu();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return AU.KeywordCxt}});var ql=Ne();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return ql._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return ql.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return ql.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return ql.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return ql.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return ql.CodeGen}});var qU=uh(),_O=Hu(),$U=jb(),Vu=dh(),MU=Ne(),Wu=Fu(),gh=Du(),hS=We(),vO=ZC(),NU=yO(),xO=(t,e)=>new RegExp(t,e);xO.code="new RegExp";var DU=["removeAdditional","useDefaults","coerceTypes"],FU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),LU={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."},jU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},bO=200;function UU(t){var e,r,n,i,s,a,l,f,d,m,g,y,w,R,x,T,q,L,V,B,K,X,k,_,P;let $=t.strict,N=(e=t.code)===null||e===void 0?void 0:e.optimize,j=N===!0||N===void 0?1:N||0,Y=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:xO,J=(i=t.uriResolver)!==null&&i!==void 0?i:NU.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:$)!==null&&a!==void 0?a:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:$)!==null&&f!==void 0?f:!0,strictTypes:(m=(d=t.strictTypes)!==null&&d!==void 0?d:$)!==null&&m!==void 0?m:"log",strictTuples:(y=(g=t.strictTuples)!==null&&g!==void 0?g:$)!==null&&y!==void 0?y:"log",strictRequired:(R=(w=t.strictRequired)!==null&&w!==void 0?w:$)!==null&&R!==void 0?R:!1,code:t.code?{...t.code,optimize:j,regExp:Y}:{optimize:j,regExp:Y},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:bO,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:bO,meta:(q=t.meta)!==null&&q!==void 0?q:!0,messages:(L=t.messages)!==null&&L!==void 0?L:!0,inlineRefs:(V=t.inlineRefs)!==null&&V!==void 0?V:!0,schemaId:(B=t.schemaId)!==null&&B!==void 0?B:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(_=t.unicodeRegExp)!==null&&_!==void 0?_:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:J}}var zu=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,...UU(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new MU.ValueScope({scope:{},prefixes:FU,es5:r,lines:n}),this.logger=JU(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,$U.getRules)(),SO.call(this,LU,e,"NOT SUPPORTED"),SO.call(this,jU,e,"DEPRECATED","warn"),this._metaOpts=WU.call(this),e.formats&&BU.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&VU.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),HU.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=vO;n==="id"&&(i={...vO},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 _O.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,Wu.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=wO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Vu.SchemaEnv({schema:{},schemaId:n});if(r=Vu.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=wO.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,Wu.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(GU.call(this,n,r),!r)return(0,hS.eachItem)(n,s=>pS.call(this,s)),this;QU.call(this,r);let i={...r,type:(0,gh.getJSONTypes)(r.type),schemaType:(0,gh.getJSONTypes)(r.schemaType)};return(0,hS.eachItem)(n,i.type.length===0?s=>pS.call(this,s,i):s=>i.type.forEach(a=>pS.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]=RO(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,Wu.normalizeId)(a||n);let d=Wu.getSchemaRefs.call(this,e,n);return f=new Vu.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):Vu.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{Vu.compileSchema.call(this,e)}finally{this.opts=r}}};zu.ValidationError=qU.default;zu.MissingRefError=_O.default;Xt.default=zu;function SO(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 wO(t){return t=(0,Wu.normalizeId)(t),this.schemas[t]||this.refs[t]}function HU(){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 BU(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function VU(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 WU(){let t={...this.opts};for(let e of DU)delete t[e];return t}var zU={log(){},warn(){},error(){}};function JU(t){if(t===!1)return zU;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 YU=/^[a-z_$][a-z0-9_$:-]*$/i;function GU(t,e){let{RULES:r}=this;if((0,hS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!YU.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 pS(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,gh.getJSONTypes)(e.type),schemaType:(0,gh.getJSONTypes)(e.schemaType)}};e.before?KU.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 KU(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 QU(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=RO(e)),t.validateSchema=this.compile(e,!0))}var ZU={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function RO(t){return{anyOf:[t,ZU]}}});var CO=F(mS=>{"use strict";Object.defineProperty(mS,"__esModule",{value:!0});var XU={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};mS.default=XU});var kO=F(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.callRef=Xo.getValidate=void 0;var eH=Hu(),OO=vn(),Fr=Ne(),$l=Gi(),IO=dh(),yh=We(),tH={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=IO.resolveRef.call(f,d,i,r);if(m===void 0)throw new eH.default(n.opts.uriResolver,i,r);if(m instanceof IO.SchemaEnv)return y(m);return w(m);function g(){if(s===d)return vh(t,a,s,s.$async);let R=e.scopeValue("root",{ref:d});return vh(t,(0,Fr._)`${R}.validate`,d,d.$async)}function y(R){let x=PO(t,R);vh(t,x,R,R.$async)}function w(R){let x=e.scopeValue("schema",l.code.source===!0?{ref:R,code:(0,Fr.stringify)(R)}:{ref:R}),T=e.name("valid"),q=t.subschema({schema:R,dataTypes:[],schemaPath:Fr.nil,topSchemaRef:x,errSchemaPath:r},T);t.mergeEvaluated(q),t.ok(T)}}};function PO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Fr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Xo.getValidate=PO;function vh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:l,opts:f}=s,d=f.passContext?$l.default.this:Fr.nil;n?m():g();function m(){if(!l.$async)throw new Error("async schema referenced by sync schema");let R=i.let("valid");i.try(()=>{i.code((0,Fr._)`await ${(0,OO.callValidateCode)(t,e,d)}`),w(e),a||i.assign(R,!0)},x=>{i.if((0,Fr._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),y(x),a||i.assign(R,!1)}),t.ok(R)}function g(){t.result((0,OO.callValidateCode)(t,e,d),()=>w(e),()=>y(e))}function y(R){let x=(0,Fr._)`${R}.errors`;i.assign($l.default.vErrors,(0,Fr._)`${$l.default.vErrors} === null ? ${x} : ${$l.default.vErrors}.concat(${x})`),i.assign($l.default.errors,(0,Fr._)`${$l.default.vErrors}.length`)}function w(R){var x;if(!s.opts.unevaluated)return;let T=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=yh.mergeEvaluated.props(i,T.props,s.props));else{let q=i.var("props",(0,Fr._)`${R}.evaluated.props`);s.props=yh.mergeEvaluated.props(i,q,s.props,Fr.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=yh.mergeEvaluated.items(i,T.items,s.items));else{let q=i.var("items",(0,Fr._)`${R}.evaluated.items`);s.items=yh.mergeEvaluated.items(i,q,s.items,Fr.Name)}}}Xo.callRef=vh;Xo.default=tH});var TO=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var rH=CO(),nH=kO(),iH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",rH.default,nH.default];gS.default=iH});var AO=F(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var bh=Ne(),js=bh.operators,Sh={maximum:{okStr:"<=",ok:js.LTE,fail:js.GT},minimum:{okStr:">=",ok:js.GTE,fail:js.LT},exclusiveMaximum:{okStr:"<",ok:js.LT,fail:js.GTE},exclusiveMinimum:{okStr:">",ok:js.GT,fail:js.LTE}},sH={message:({keyword:t,schemaCode:e})=>(0,bh.str)`must be ${Sh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,bh._)`{comparison: ${Sh[t].okStr}, limit: ${e}}`},oH={keyword:Object.keys(Sh),type:"number",schemaType:"number",$data:!0,error:sH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,bh._)`${r} ${Sh[e].fail} ${n} || isNaN(${r})`)}};yS.default=oH});var qO=F(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var Ju=Ne(),aH={message:({schemaCode:t})=>(0,Ju.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Ju._)`{multipleOf: ${t}}`},lH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:aH,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),l=s?(0,Ju._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Ju._)`${a} !== parseInt(${a})`;t.fail$data((0,Ju._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};vS.default=lH});var MO=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});function $O(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}bS.default=$O;$O.code='require("ajv/dist/runtime/ucs2length").default'});var NO=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var ea=Ne(),cH=We(),uH=MO(),fH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,ea.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ea._)`{limit: ${t}}`},dH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:fH,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?ea.operators.GT:ea.operators.LT,a=i.opts.unicode===!1?(0,ea._)`${r}.length`:(0,ea._)`${(0,cH.useFunc)(t.gen,uH.default)}(${r})`;t.fail$data((0,ea._)`${a} ${s} ${n}`)}};SS.default=dH});var DO=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var pH=vn(),hH=We(),Ml=Ne(),mH={message:({schemaCode:t})=>(0,Ml.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Ml._)`{pattern: ${t}}`},gH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:mH,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,Ml._)`new RegExp`:(0,hH.useFunc)(e,f),m=e.let("valid");e.try(()=>e.assign(m,(0,Ml._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(m,!1)),t.fail$data((0,Ml._)`!${m}`)}else{let f=(0,pH.usePattern)(t,i);t.fail$data((0,Ml._)`!${f}.test(${r})`)}}};wS.default=gH});var FO=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var Yu=Ne(),yH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Yu.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Yu._)`{limit: ${t}}`},vH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:yH,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Yu.operators.GT:Yu.operators.LT;t.fail$data((0,Yu._)`Object.keys(${r}).length ${i} ${n}`)}};_S.default=vH});var LO=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var Gu=vn(),Ku=Ne(),bH=We(),SH={message:({params:{missingProperty:t}})=>(0,Ku.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Ku._)`{missingProperty: ${t}}`},wH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:SH,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 w=t.parentSchema.properties,{definedProperties:R}=t.it;for(let x of r)if(w?.[x]===void 0&&!R.has(x)){let T=a.schemaEnv.baseId+a.errSchemaPath,q=`required property "${x}" is not defined at "${T}" (strictRequired)`;(0,bH.checkStrictMode)(a,q,a.opts.strictRequired)}}function d(){if(f||s)t.block$data(Ku.nil,g);else for(let w of r)(0,Gu.checkReportMissingProp)(t,w)}function m(){let w=e.let("missing");if(f||s){let R=e.let("valid",!0);t.block$data(R,()=>y(w,R)),t.ok(R)}else e.if((0,Gu.checkMissingProp)(t,r,w)),(0,Gu.reportMissingProp)(t,w),e.else()}function g(){e.forOf("prop",n,w=>{t.setParams({missingProperty:w}),e.if((0,Gu.noPropertyInData)(e,i,w,l.ownProperties),()=>t.error())})}function y(w,R){t.setParams({missingProperty:w}),e.forOf(w,n,()=>{e.assign(R,(0,Gu.propertyInData)(e,i,w,l.ownProperties)),e.if((0,Ku.not)(R),()=>{t.error(),e.break()})},Ku.nil)}}};xS.default=wH});var jO=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var Qu=Ne(),_H={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Qu.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Qu._)`{limit: ${t}}`},xH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:_H,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Qu.operators.GT:Qu.operators.LT;t.fail$data((0,Qu._)`${r}.length ${i} ${n}`)}};RS.default=xH});var wh=F(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});var UO=Yb();UO.code='require("ajv/dist/runtime/equal").default';ES.default=UO});var HO=F(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});var CS=Du(),er=Ne(),RH=We(),EH=wh(),CH={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}}`},OH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:CH,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,CS.getSchemaTypes)(s.items):[];t.block$data(f,m,(0,er._)`${a} === false`),t.ok(f);function m(){let R=e.let("i",(0,er._)`${r}.length`),x=e.let("j");t.setParams({i:R,j:x}),e.assign(f,!0),e.if((0,er._)`${R} > 1`,()=>(g()?y:w)(R,x))}function g(){return d.length>0&&!d.some(R=>R==="object"||R==="array")}function y(R,x){let T=e.name("item"),q=(0,CS.checkDataTypes)(d,T,l.opts.strictNumbers,CS.DataType.Wrong),L=e.const("indices",(0,er._)`{}`);e.for((0,er._)`;${R}--;`,()=>{e.let(T,(0,er._)`${r}[${R}]`),e.if(q,(0,er._)`continue`),d.length>1&&e.if((0,er._)`typeof ${T} == "string"`,(0,er._)`${T} += "_"`),e.if((0,er._)`typeof ${L}[${T}] == "number"`,()=>{e.assign(x,(0,er._)`${L}[${T}]`),t.error(),e.assign(f,!1).break()}).code((0,er._)`${L}[${T}] = ${R}`)})}function w(R,x){let T=(0,RH.useFunc)(e,EH.default),q=e.name("outer");e.label(q).for((0,er._)`;${R}--;`,()=>e.for((0,er._)`${x} = ${R}; ${x}--;`,()=>e.if((0,er._)`${T}(${r}[${R}], ${r}[${x}])`,()=>{t.error(),e.assign(f,!1).break(q)})))}}};OS.default=OH});var BO=F(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var IS=Ne(),IH=We(),PH=wh(),kH={message:"must be equal to constant",params:({schemaCode:t})=>(0,IS._)`{allowedValue: ${t}}`},TH={keyword:"const",$data:!0,error:kH,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,IS._)`!${(0,IH.useFunc)(e,PH.default)}(${r}, ${i})`):t.fail((0,IS._)`${s} !== ${r}`)}};PS.default=TH});var VO=F(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var Zu=Ne(),AH=We(),qH=wh(),$H={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Zu._)`{allowedValues: ${t}}`},MH={keyword:"enum",schemaType:"array",$data:!0,error:$H,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,AH.useFunc)(e,qH.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 w=e.const("vSchema",s);m=(0,Zu.or)(...i.map((R,x)=>y(w,x)))}t.pass(m);function g(){e.assign(m,!1),e.forOf("v",s,w=>e.if((0,Zu._)`${d()}(${r}, ${w})`,()=>e.assign(m,!0).break()))}function y(w,R){let x=i[R];return typeof x=="object"&&x!==null?(0,Zu._)`${d()}(${r}, ${w}[${R}])`:(0,Zu._)`${r} === ${x}`}}};kS.default=MH});var WO=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var NH=AO(),DH=qO(),FH=NO(),LH=DO(),jH=FO(),UH=LO(),HH=jO(),BH=HO(),VH=BO(),WH=VO(),zH=[NH.default,DH.default,FH.default,LH.default,jH.default,UH.default,HH.default,BH.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},VH.default,WH.default];TS.default=zH});var qS=F(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.validateAdditionalItems=void 0;var ta=Ne(),AS=We(),JH={message:({params:{len:t}})=>(0,ta.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ta._)`{limit: ${t}}`},YH={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:JH,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,AS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}zO(t,n)}};function zO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let l=r.const("len",(0,ta._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,ta._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,AS.alwaysValidSchema)(a,n)){let d=r.var("valid",(0,ta._)`${l} <= ${e.length}`);r.if((0,ta.not)(d),()=>f(d)),t.ok(d)}function f(d){r.forRange("i",e.length,l,m=>{t.subschema({keyword:s,dataProp:m,dataPropType:AS.Type.Num},d),a.allErrors||r.if((0,ta.not)(d),()=>r.break())})}}Xu.validateAdditionalItems=zO;Xu.default=YH});var $S=F(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.validateTuple=void 0;var JO=Ne(),_h=We(),GH=vn(),KH={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return YO(t,"additionalItems",e);r.items=!0,!(0,_h.alwaysValidSchema)(r,e)&&t.ok((0,GH.validateArray)(t))}};function YO(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,JO._)`${s}.length`);r.forEach((g,y)=>{(0,_h.alwaysValidSchema)(l,g)||(n.if((0,JO._)`${d} > ${y}`,()=>t.subschema({keyword:a,schemaProp:y,dataProp:y},f)),t.ok(f))});function m(g){let{opts:y,errSchemaPath:w}=l,R=r.length,x=R===g.minItems&&(R===g.maxItems||g[e]===!1);if(y.strictTuples&&!x){let T=`"${a}" is ${R}-tuple, but minItems or maxItems/${e} are not specified or different at path "${w}"`;(0,_h.checkStrictMode)(l,T,y.strictTuples)}}}ef.validateTuple=YO;ef.default=KH});var GO=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var QH=$S(),ZH={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,QH.validateTuple)(t,"items")};MS.default=ZH});var QO=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var KO=Ne(),XH=We(),eB=vn(),tB=qS(),rB={message:({params:{len:t}})=>(0,KO.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,KO._)`{limit: ${t}}`},nB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:rB,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,XH.alwaysValidSchema)(n,e)&&(i?(0,tB.validateAdditionalItems)(t,i):t.ok((0,eB.validateArray)(t)))}};NS.default=nB});var ZO=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var Sn=Ne(),xh=We(),iB={message:({params:{min:t,max:e}})=>e===void 0?(0,Sn.str)`must contain at least ${t} valid item(s)`:(0,Sn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Sn._)`{minContains: ${t}}`:(0,Sn._)`{minContains: ${t}, maxContains: ${e}}`},sB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:iB,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,Sn._)`${i}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,xh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,xh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,xh.alwaysValidSchema)(s,r)){let x=(0,Sn._)`${m} >= ${a}`;l!==void 0&&(x=(0,Sn._)`${x} && ${m} <= ${l}`),t.pass(x);return}s.items=!0;let g=e.name("valid");l===void 0&&a===1?w(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,Sn._)`${i}.length > 0`,y)):(e.let(g,!1),y()),t.result(g,()=>t.reset());function y(){let x=e.name("_valid"),T=e.let("count",0);w(x,()=>e.if(x,()=>R(T)))}function w(x,T){e.forRange("i",0,m,q=>{t.subschema({keyword:"contains",dataProp:q,dataPropType:xh.Type.Num,compositeRule:!0},x),T()})}function R(x){e.code((0,Sn._)`${x}++`),l===void 0?e.if((0,Sn._)`${x} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,Sn._)`${x} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,Sn._)`${x} >= ${a}`,()=>e.assign(g,!0)))}}};DS.default=sB});var tI=F(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.validateSchemaDeps=bi.validatePropertyDeps=bi.error=void 0;var FS=Ne(),oB=We(),tf=vn();bi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,FS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,FS._)`{property: ${t},
|
|
27
|
+
|| ${a} === "boolean" || ${i} === null`).assign(l,(0,Ie._)`[${i}]`)}}}function kj({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Ie._)`${e} !== undefined`,()=>t.assign((0,Ie._)`${e}[${r}]`,n))}function Vb(t,e,r,n=Il.Correct){let i=n===Il.Correct?Ie.operators.EQ:Ie.operators.NEQ,s;switch(t){case"null":return(0,Ie._)`${e} ${i} null`;case"array":s=(0,Ie._)`Array.isArray(${e})`;break;case"object":s=(0,Ie._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Ie._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Ie._)`typeof ${e} ${i} ${t}`}return n===Il.Correct?s:(0,Ie.not)(s);function a(l=Ie.nil){return(0,Ie.and)((0,Ie._)`typeof ${e} == "number"`,l,r?(0,Ie._)`isFinite(${e})`:Ie.nil)}}lr.checkDataType=Vb;function Wb(t,e,r,n){if(t.length===1)return Vb(t[0],e,r,n);let i,s=(0,vC.toHash)(t);if(s.array&&s.object){let a=(0,Ie._)`typeof ${e} != "object"`;i=s.null?a:(0,Ie._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Ie.nil;s.number&&delete s.integer;for(let a in s)i=(0,Ie.and)(i,Vb(a,e,r,n));return i}lr.checkDataTypes=Wb;var Tj={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Ie._)`{type: ${t}}`:(0,Ie._)`{type: ${e}}`};function zb(t){let e=Aj(t);(0,Ej.reportError)(e,Tj)}lr.reportTypeError=zb;function Aj(t){let{gen:e,data:r,schema:n}=t,i=(0,vC.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var _C=F(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.assignDefaults=void 0;var Pl=Ne(),qj=We();function $j(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)wC(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>wC(t,s,i.default))}ch.assignDefaults=$j;function wC(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let l=(0,Pl._)`${s}${(0,Pl.getProperty)(e)}`;if(i){(0,qj.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Pl._)`${l} === undefined`;a.useDefaults==="empty"&&(f=(0,Pl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Pl._)`${l} = ${(0,Pl.stringify)(r)}`)}});var vn=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.validateUnion=ct.validateArray=ct.usePattern=ct.callValidateCode=ct.schemaProperties=ct.allSchemaProperties=ct.noPropertyInData=ct.propertyInData=ct.isOwnProperty=ct.hasPropFunc=ct.reportMissingProp=ct.checkMissingProp=ct.checkReportMissingProp=void 0;var bt=Ne(),Jb=We(),Ns=Gi(),Mj=We();function Nj(t,e){let{gen:r,data:n,it:i}=t;r.if(Gb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,bt._)`${e}`},!0),t.error()})}ct.checkReportMissingProp=Nj;function Dj({gen:t,data:e,it:{opts:r}},n,i){return(0,bt.or)(...n.map(s=>(0,bt.and)(Gb(t,e,s,r.ownProperties),(0,bt._)`${i} = ${s}`)))}ct.checkMissingProp=Dj;function Fj(t,e){t.setParams({missingProperty:e},!0),t.error()}ct.reportMissingProp=Fj;function xC(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,bt._)`Object.prototype.hasOwnProperty`})}ct.hasPropFunc=xC;function Yb(t,e,r){return(0,bt._)`${xC(t)}.call(${e}, ${r})`}ct.isOwnProperty=Yb;function Lj(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} !== undefined`;return n?(0,bt._)`${i} && ${Yb(t,e,r)}`:i}ct.propertyInData=Lj;function Gb(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} === undefined`;return n?(0,bt.or)(i,(0,bt.not)(Yb(t,e,r))):i}ct.noPropertyInData=Gb;function RC(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ct.allSchemaProperties=RC;function jj(t,e){return RC(e).filter(r=>!(0,Jb.alwaysValidSchema)(t,e[r]))}ct.schemaProperties=jj;function Uj({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=[[Ns.default.instancePath,(0,bt.strConcat)(Ns.default.instancePath,s)],[Ns.default.parentData,a.parentData],[Ns.default.parentDataProperty,a.parentDataProperty],[Ns.default.rootData,Ns.default.rootData]];a.opts.dynamicRef&&g.push([Ns.default.dynamicAnchors,Ns.default.dynamicAnchors]);let y=(0,bt._)`${m}, ${r.object(...g)}`;return f!==bt.nil?(0,bt._)`${l}.call(${f}, ${y})`:(0,bt._)`${l}(${y})`}ct.callValidateCode=Uj;var Hj=(0,bt._)`new RegExp`;function Bj({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"?Hj:(0,Mj.useFunc)(t,i)}(${r}, ${n})`})}ct.usePattern=Bj;function Vj(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:Jb.Type.Num},s),e.if((0,bt.not)(s),l)})}}ct.validateArray=Vj;function Wj(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,Jb.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))}ct.validateUnion=Wj});var OC=F(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.validateKeywordUsage=yi.validSchemaType=yi.funcKeywordCode=yi.macroKeywordCode=void 0;var Er=Ne(),Ko=Gi(),zj=vn(),Jj=Fu();function Yj(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,l=e.macro.call(a.self,i,s,a),f=CC(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))}yi.macroKeywordCode=Yj;function Gj(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:l,it:f}=t;Qj(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,a,f):e.validate,m=CC(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)x(),e.modifying&&EC(t),T(()=>t.error());else{let q=e.async?w():R();e.modifying&&EC(t),T(()=>Kj(t,q))}}function w(){let q=n.let("ruleErrs",null);return n.try(()=>x((0,Er._)`await `),L=>n.assign(g,!1).if((0,Er._)`${L} instanceof ${f.ValidationError}`,()=>n.assign(q,(0,Er._)`${L}.errors`),()=>n.throw(L))),q}function R(){let q=(0,Er._)`${m}.errors`;return n.assign(q,null),x(Er.nil),q}function x(q=e.async?(0,Er._)`await `:Er.nil){let L=f.opts.passContext?Ko.default.this:Ko.default.self,V=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Er._)`${q}${(0,zj.callValidateCode)(t,m,L,V)}`,e.modifying)}function T(q){var L;n.if((0,Er.not)((L=e.valid)!==null&&L!==void 0?L:g),q)}}yi.funcKeywordCode=Gj;function EC(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Er._)`${n.parentData}[${n.parentDataProperty}]`))}function Kj(t,e){let{gen:r}=t;r.if((0,Er._)`Array.isArray(${e})`,()=>{r.assign(Ko.default.vErrors,(0,Er._)`${Ko.default.vErrors} === null ? ${e} : ${Ko.default.vErrors}.concat(${e})`).assign(Ko.default.errors,(0,Er._)`${Ko.default.vErrors}.length`),(0,Jj.extendErrors)(t)},()=>t.error())}function Qj({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function CC(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 Zj(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")}yi.validSchemaType=Zj;function Xj({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)}}yi.validateKeywordUsage=Xj});var PC=F(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.extendSubschemaMode=Ds.extendSubschemaData=Ds.getSubschema=void 0;var vi=Ne(),IC=We();function e2(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,vi._)`${t.schemaPath}${(0,vi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,vi._)`${t.schemaPath}${(0,vi.getProperty)(e)}${(0,vi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,IC.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')}Ds.getSubschema=e2;function t2(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,vi._)`${e.data}${(0,vi.getProperty)(r)}`,!0);f(y),t.errorPath=(0,vi.str)`${d}${(0,IC.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,vi._)`${r}`,t.dataPathArr=[...m,t.parentDataProperty]}if(i!==void 0){let d=i instanceof vi.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]}}Ds.extendSubschemaData=t2;function r2(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}Ds.extendSubschemaMode=r2});var Kb=F((v5,kC)=>{"use strict";kC.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 AC=F((b5,TC)=>{"use strict";var Fs=TC.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(){};uh(e,n,i,t,"",t)};Fs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Fs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Fs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Fs.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 uh(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 Fs.arrayKeywords)for(var y=0;y<g.length;y++)uh(t,e,r,g[y],i+"/"+m+"/"+y,s,i,m,n,y)}else if(m in Fs.propsKeywords){if(g&&typeof g=="object")for(var w in g)uh(t,e,r,g[w],i+"/"+m+"/"+n2(w),s,i,m,n,w)}else(m in Fs.keywords||t.allKeys&&!(m in Fs.skipKeywords))&&uh(t,e,r,g,i+"/"+m,s,i,m,n)}r(n,i,s,a,l,f,d)}}function n2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ju=F(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.getSchemaRefs=Dr.resolveUrl=Dr.normalizeId=Dr._getFullPath=Dr.getFullPath=Dr.inlineRef=void 0;var i2=We(),s2=Kb(),o2=AC(),a2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function l2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Qb(t):e?qC(t)<=e:!1}Dr.inlineRef=l2;var c2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Qb(t){for(let e in t){if(c2.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Qb)||typeof r=="object"&&Qb(r))return!0}return!1}function qC(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!a2.has(r)&&(typeof t[r]=="object"&&(0,i2.eachItem)(t[r],n=>e+=qC(n)),e===1/0))return 1/0}return e}function $C(t,e="",r){r!==!1&&(e=kl(e));let n=t.parse(e);return MC(t,n)}Dr.getFullPath=$C;function MC(t,e){return t.serialize(e).split("#")[0]+"#"}Dr._getFullPath=MC;var u2=/#\/?$/;function kl(t){return t?t.replace(u2,""):""}Dr.normalizeId=kl;function f2(t,e,r){return r=kl(r),t.resolve(e,r)}Dr.resolveUrl=f2;var d2=/^[a-z_][-a-z0-9._]*$/i;function p2(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=kl(t[r]||e),s={"":i},a=$C(n,i,!1),l={},f=new Set;return o2(t,{allKeys:!0},(g,y,w,R)=>{if(R===void 0)return;let x=a+y,T=s[R];typeof g[r]=="string"&&(T=q.call(this,g[r])),L.call(this,g.$anchor),L.call(this,g.$dynamicAnchor),s[y]=T;function q(V){let B=this.opts.uriResolver.resolve;if(V=kl(T?B(T,V):V),f.has(V))throw m(V);f.add(V);let K=this.refs[V];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?d(g,K.schema,V):V!==kl(x)&&(V[0]==="#"?(d(g,l[V],V),l[V]=g):this.refs[V]=x),V}function L(V){if(typeof V=="string"){if(!d2.test(V))throw new Error(`invalid anchor "${V}"`);q.call(this,`#${V}`)}}}),l;function d(g,y,w){if(y!==void 0&&!s2(g,y))throw m(w)}function m(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Dr.getSchemaRefs=p2});var Bu=F(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.getData=Ls.KeywordCxt=Ls.validateFunctionCode=void 0;var jC=mC(),NC=Lu(),Xb=Bb(),fh=Lu(),h2=_C(),Hu=OC(),Zb=PC(),de=Ne(),we=Gi(),m2=ju(),Ki=We(),Uu=Fu();function g2(t){if(BC(t)&&(VC(t),HC(t))){b2(t);return}UC(t,()=>(0,jC.topBoolOrEmptySchema)(t))}Ls.validateFunctionCode=g2;function UC({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,de._)`${we.default.data}, ${we.default.valCxt}`,n.$async,()=>{t.code((0,de._)`"use strict"; ${DC(r,i)}`),v2(t,i),t.code(s)}):t.func(e,(0,de._)`${we.default.data}, ${y2(i)}`,n.$async,()=>t.code(DC(r,i)).code(s))}function y2(t){return(0,de._)`{${we.default.instancePath}="", ${we.default.parentData}, ${we.default.parentDataProperty}, ${we.default.rootData}=${we.default.data}${t.dynamicRef?(0,de._)`, ${we.default.dynamicAnchors}={}`:de.nil}}={}`}function v2(t,e){t.if(we.default.valCxt,()=>{t.var(we.default.instancePath,(0,de._)`${we.default.valCxt}.${we.default.instancePath}`),t.var(we.default.parentData,(0,de._)`${we.default.valCxt}.${we.default.parentData}`),t.var(we.default.parentDataProperty,(0,de._)`${we.default.valCxt}.${we.default.parentDataProperty}`),t.var(we.default.rootData,(0,de._)`${we.default.valCxt}.${we.default.rootData}`),e.dynamicRef&&t.var(we.default.dynamicAnchors,(0,de._)`${we.default.valCxt}.${we.default.dynamicAnchors}`)},()=>{t.var(we.default.instancePath,(0,de._)`""`),t.var(we.default.parentData,(0,de._)`undefined`),t.var(we.default.parentDataProperty,(0,de._)`undefined`),t.var(we.default.rootData,we.default.data),e.dynamicRef&&t.var(we.default.dynamicAnchors,(0,de._)`{}`)})}function b2(t){let{schema:e,opts:r,gen:n}=t;UC(t,()=>{r.$comment&&e.$comment&&zC(t),R2(t),n.let(we.default.vErrors,null),n.let(we.default.errors,0),r.unevaluated&&S2(t),WC(t),O2(t)})}function S2(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 DC(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 w2(t,e){if(BC(t)&&(VC(t),HC(t))){_2(t,e);return}(0,jC.boolOrEmptySchema)(t,e)}function HC({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 BC(t){return typeof t.schema!="boolean"}function _2(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&zC(t),E2(t),C2(t);let s=n.const("_errs",we.default.errors);WC(t,s),n.var(e,(0,de._)`${s} === ${we.default.errors}`)}function VC(t){(0,Ki.checkUnknownRules)(t),x2(t)}function WC(t,e){if(t.opts.jtd)return FC(t,[],!1,e);let r=(0,NC.getSchemaTypes)(t.schema),n=(0,NC.coerceAndCheckDataType)(t,r);FC(t,r,!n,e)}function x2(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ki.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function R2(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ki.checkStrictMode)(t,"default is ignored in the schema root")}function E2(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,m2.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function C2(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function zC({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,de._)`${we.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._)`${we.default.self}.opts.$comment(${s}, ${a}, ${l}.schema)`)}}function O2(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,de._)`${we.default.errors} === 0`,()=>e.return(we.default.data),()=>e.throw((0,de._)`new ${i}(${we.default.vErrors})`)):(e.assign((0,de._)`${n}.errors`,we.default.vErrors),s.unevaluated&&I2(t),e.return((0,de._)`${we.default.errors} === 0`))}function I2({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 FC(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,Ki.schemaHasRulesButRef)(s,m))){i.block(()=>YC(t,"$ref",m.all.$ref.definition));return}f.jtd||P2(t,e),i.block(()=>{for(let y of m.rules)g(y);g(m.post)});function g(y){(0,Xb.shouldUseGroup)(s,y)&&(y.type?(i.if((0,fh.checkDataType)(y.type,a,f.strictNumbers)),LC(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,fh.reportTypeError)(t)),i.endIf()):LC(t,y),l||i.if((0,de._)`${we.default.errors} === ${n||0}`))}}function LC(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,h2.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Xb.shouldUseRule)(n,s)&&YC(t,s.keyword,s.definition,e.type)})}function P2(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(k2(t,e),t.opts.allowUnionTypes||T2(t,e),A2(t,t.dataTypes))}function k2(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{JC(t.dataTypes,r)||eS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),$2(t,e)}}function T2(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&eS(t,"use allowUnionTypes to allow union type keyword")}function A2(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Xb.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>q2(e,a))&&eS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function q2(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function JC(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function $2(t,e){let r=[];for(let n of t.dataTypes)JC(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function eS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ki.checkStrictMode)(t,e,t.opts.strictTypes)}var dh=class{constructor(e,r,n){if((0,Hu.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,Ki.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",GC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Hu.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",we.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?Uu.reportExtraError:Uu.reportError)(this,this.def.error,r)}$dataError(){(0,Uu.reportError)(this,this.def.$dataError||Uu.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Uu.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,fh.checkDataTypes)(f,r,s.opts.strictNumbers,fh.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,Zb.getSubschema)(this.it,e);(0,Zb.extendSubschemaData)(n,this.it,e),(0,Zb.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return w2(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ki.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ki.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}};Ls.KeywordCxt=dh;function YC(t,e,r,n){let i=new dh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Hu.funcKeywordCode)(i,r):"macro"in r?(0,Hu.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Hu.funcKeywordCode)(i,r)}var M2=/^\/(?:[^~]|~0|~1)*$/,N2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function GC(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return we.default.rootData;if(t[0]==="/"){if(!M2.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=we.default.rootData}else{let d=N2.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,Ki.unescapeJsonPointer)(d))}`,a=(0,de._)`${a} && ${s}`);return a;function f(d,m){return`Cannot access ${d} ${m} levels up, current level is ${e}`}}Ls.getData=GC});var ph=F(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});var tS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};rS.default=tS});var Vu=F(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});var nS=ju(),iS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,nS.resolveUrl)(e,r,n),this.missingSchema=(0,nS.normalizeId)((0,nS.getFullPath)(e,this.missingRef))}};sS.default=iS});var mh=F(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.resolveSchema=bn.getCompilingSchema=bn.resolveRef=bn.compileSchema=bn.SchemaEnv=void 0;var Vn=Ne(),D2=ph(),Qo=Gi(),Wn=ju(),KC=We(),F2=Bu(),Tl=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,Wn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};bn.SchemaEnv=Tl;function aS(t){let e=QC.call(this,t);if(e)return e;let r=(0,Wn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Vn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=a.scopeValue("Error",{ref:D2.default,code:(0,Vn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let d={gen:a,allErrors:this.opts.allErrors,data:Qo.default.data,parentData:Qo.default.parentData,parentDataProperty:Qo.default.parentDataProperty,dataNames:[Qo.default.data],dataPathArr:[Vn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Vn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Vn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Vn._)`""`,opts:this.opts,self:this},m;try{this._compilations.add(t),(0,F2.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let g=a.toString();m=`${a.scopeRefs(Qo.default.scope)}return ${g}`,this.opts.code.process&&(m=this.opts.code.process(m,t));let w=new Function(`${Qo.default.self}`,`${Qo.default.scope}`,m)(this,this.scope.get());if(this.scope.value(f,{ref:w}),w.errors=null,w.schema=t.schema,w.schemaEnv=t,t.$async&&(w.$async=!0),this.opts.code.source===!0&&(w.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:R,items:x}=d;w.evaluated={props:R instanceof Vn.Name?void 0:R,items:x instanceof Vn.Name?void 0:x,dynamicProps:R instanceof Vn.Name,dynamicItems:x instanceof Vn.Name},w.source&&(w.source.evaluated=(0,Vn.stringify)(w.evaluated))}return t.validate=w,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)}}bn.compileSchema=aS;function L2(t,e,r){var n;r=(0,Wn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=H2.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 Tl({schema:a,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=j2.call(this,s)}bn.resolveRef=L2;function j2(t){return(0,Wn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:aS.call(this,t)}function QC(t){for(let e of this._compilations)if(U2(e,t))return e}bn.getCompilingSchema=QC;function U2(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function H2(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||hh.call(this,t,e)}function hh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Wn._getFullPath)(this.opts.uriResolver,r),i=(0,Wn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return oS.call(this,r,t);let s=(0,Wn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let l=hh.call(this,t,a);return typeof l?.schema!="object"?void 0:oS.call(this,r,l)}if(typeof a?.schema=="object"){if(a.validate||aS.call(this,a),s===(0,Wn.normalizeId)(e)){let{schema:l}=a,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,Wn.resolveUrl)(this.opts.uriResolver,i,d)),new Tl({schema:l,schemaId:f,root:t,baseId:i})}return oS.call(this,r,a)}}bn.resolveSchema=hh;var B2=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function oS(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,KC.unescapeFragment)(l)];if(f===void 0)return;r=f;let d=typeof r=="object"&&r[this.opts.schemaId];!B2.has(l)&&d&&(e=(0,Wn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,KC.schemaHasRulesButRef)(r,this.RULES)){let l=(0,Wn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=hh.call(this,n,l)}let{schemaId:a}=this.opts;if(s=s||new Tl({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var ZC=F((E5,V2)=>{V2.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 uS=F((C5,iO)=>{"use strict";var W2=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),eO=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),lS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),tO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),z2=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function cS(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 J2=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function XC(t){return t.length=0,!0}function Y2(t,e,r){if(t.length){let n=cS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function G2(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,l=Y2;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=XC}else{i.push(d);continue}}return i.length&&(l===XC?r.zone=i.join(""):a?n.push(i.join("")):n.push(cS(i))),r.address=n.join(""),r}function rO(t){if(K2(t,":")<2)return{host:t,isIPV6:!1};let e=G2(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 K2(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function Q2(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 Z2={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},X2=/[@/?#:]/g,eU=/[@/?#]/g;function nO(t,e){let r=e?eU:X2;return r.lastIndex=0,t.replace(r,n=>Z2[n])}function tU(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(lS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&tO(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function rU(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(lS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&tO(s)?e+=s:e+="%"+i,r+=2;continue}}z2(t[r])?e+=t[r]:e+=escape(t[r])}return e}function nU(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(lS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function iU(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!eO(r)){let n=rO(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}iO.exports={nonSimpleDomain:J2,recomposeAuthority:iU,reescapeHostDelimiters:nO,normalizePercentEncoding:tU,normalizePathEncoding:rU,escapePreservingEscapes:nU,removeDotSegments:Q2,isIPv4:eO,isUUID:W2,normalizeIPv6:rO,stringArrayToHexStripped:cS}});var cO=F((O5,lO)=>{"use strict";var{isUUID:sU}=uS(),oU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,aU=["http","https","ws","wss","urn","urn:uuid"];function lU(t){return aU.indexOf(t)!==-1}function fS(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 sO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function oO(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 cU(t){return t.secure=fS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function uU(t){if((t.port===(fS(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 fU(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(oU);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=dS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function dU(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=dS(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 pU(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!sU(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function hU(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var aO={scheme:"http",domainHost:!0,parse:sO,serialize:oO},mU={scheme:"https",domainHost:aO.domainHost,parse:sO,serialize:oO},gh={scheme:"ws",domainHost:!0,parse:cU,serialize:uU},gU={scheme:"wss",domainHost:gh.domainHost,parse:gh.parse,serialize:gh.serialize},yU={scheme:"urn",parse:fU,serialize:dU,skipNormalize:!0},vU={scheme:"urn:uuid",parse:pU,serialize:hU,skipNormalize:!0},yh={http:aO,https:mU,ws:gh,wss:gU,urn:yU,"urn:uuid":vU};Object.setPrototypeOf(yh,null);function dS(t){return t&&(yh[t]||yh[t.toLowerCase()])||void 0}lO.exports={wsIsSecure:fS,SCHEMES:yh,isValidSchemeName:lU,getSchemeHandler:dS}});var mO=F((I5,vh)=>{"use strict";var{normalizeIPv6:bU,removeDotSegments:Wu,recomposeAuthority:SU,normalizePercentEncoding:wU,normalizePathEncoding:_U,escapePreservingEscapes:xU,reescapeHostDelimiters:RU,isIPv4:EU,nonSimpleDomain:CU}=uS(),{SCHEMES:OU,getSchemeHandler:fO}=cO();function IU(t,e){return typeof t=="string"?t=qU(t,e):typeof t=="object"&&(t=Al(Zo(t,e),e)),t}function PU(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=dO(Al(t,n),Al(e,n),n,!0);return n.skipEscape=!0,Zo(i,n)}function dO(t,e,r,n){let i={};return n||(t=Al(Zo(t,r),r),e=Al(Zo(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=Wu(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=Wu(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Wu(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=Wu(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 kU(t,e,r){let n=uO(t,r),i=uO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Zo(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=fO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=wU(r.path):(r.path=xU(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=SU(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=Wu(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 TU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function AU(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 pO(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(TU);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=AU(n,a);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(EU(n.host)===!1){let m=bU(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=fO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&CU(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=RU(unescape(n.host),s))),n.path&&(n.path=_U(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 Al(t,e){return pO(t,e).parsed}function qU(t,e){return hO(t,e).normalized}function hO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=pO(t,e);return{normalized:n?t:Zo(r,e),malformedAuthorityOrPort:n}}function uO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=hO(t,e);return n?void 0:r}if(typeof t=="object")return Zo(t,e)}var pS={SCHEMES:OU,normalize:IU,resolve:PU,resolveComponent:dO,equal:kU,serialize:Zo,parse:Al};vh.exports=pS;vh.exports.default=pS;vh.exports.fastUri=pS});var yO=F(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var gO=mO();gO.code='require("ajv/dist/runtime/uri").default';hS.default=gO});var EO=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 $U=Bu();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return $U.KeywordCxt}});var ql=Ne();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return ql._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return ql.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return ql.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return ql.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return ql.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return ql.CodeGen}});var MU=ph(),_O=Vu(),NU=Hb(),zu=mh(),DU=Ne(),Ju=ju(),bh=Lu(),gS=We(),vO=ZC(),FU=yO(),xO=(t,e)=>new RegExp(t,e);xO.code="new RegExp";var LU=["removeAdditional","useDefaults","coerceTypes"],jU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),UU={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."},HU={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},bO=200;function BU(t){var e,r,n,i,s,a,l,f,d,m,g,y,w,R,x,T,q,L,V,B,K,X,k,_,P;let $=t.strict,N=(e=t.code)===null||e===void 0?void 0:e.optimize,j=N===!0||N===void 0?1:N||0,Y=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:xO,J=(i=t.uriResolver)!==null&&i!==void 0?i:FU.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:$)!==null&&a!==void 0?a:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:$)!==null&&f!==void 0?f:!0,strictTypes:(m=(d=t.strictTypes)!==null&&d!==void 0?d:$)!==null&&m!==void 0?m:"log",strictTuples:(y=(g=t.strictTuples)!==null&&g!==void 0?g:$)!==null&&y!==void 0?y:"log",strictRequired:(R=(w=t.strictRequired)!==null&&w!==void 0?w:$)!==null&&R!==void 0?R:!1,code:t.code?{...t.code,optimize:j,regExp:Y}:{optimize:j,regExp:Y},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:bO,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:bO,meta:(q=t.meta)!==null&&q!==void 0?q:!0,messages:(L=t.messages)!==null&&L!==void 0?L:!0,inlineRefs:(V=t.inlineRefs)!==null&&V!==void 0?V:!0,schemaId:(B=t.schemaId)!==null&&B!==void 0?B:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(_=t.unicodeRegExp)!==null&&_!==void 0?_:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:J}}var Yu=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,...BU(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new DU.ValueScope({scope:{},prefixes:jU,es5:r,lines:n}),this.logger=GU(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,NU.getRules)(),SO.call(this,UU,e,"NOT SUPPORTED"),SO.call(this,HU,e,"DEPRECATED","warn"),this._metaOpts=JU.call(this),e.formats&&WU.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&zU.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),VU.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=vO;n==="id"&&(i={...vO},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 _O.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,Ju.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=wO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new zu.SchemaEnv({schema:{},schemaId:n});if(r=zu.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=wO.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,Ju.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(QU.call(this,n,r),!r)return(0,gS.eachItem)(n,s=>mS.call(this,s)),this;XU.call(this,r);let i={...r,type:(0,bh.getJSONTypes)(r.type),schemaType:(0,bh.getJSONTypes)(r.schemaType)};return(0,gS.eachItem)(n,i.type.length===0?s=>mS.call(this,s,i):s=>i.type.forEach(a=>mS.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]=RO(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,Ju.normalizeId)(a||n);let d=Ju.getSchemaRefs.call(this,e,n);return f=new zu.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):zu.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{zu.compileSchema.call(this,e)}finally{this.opts=r}}};Yu.ValidationError=MU.default;Yu.MissingRefError=_O.default;Xt.default=Yu;function SO(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 wO(t){return t=(0,Ju.normalizeId)(t),this.schemas[t]||this.refs[t]}function VU(){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 WU(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function zU(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 JU(){let t={...this.opts};for(let e of LU)delete t[e];return t}var YU={log(){},warn(){},error(){}};function GU(t){if(t===!1)return YU;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 KU=/^[a-z_$][a-z0-9_$:-]*$/i;function QU(t,e){let{RULES:r}=this;if((0,gS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!KU.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 mS(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,bh.getJSONTypes)(e.type),schemaType:(0,bh.getJSONTypes)(e.schemaType)}};e.before?ZU.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 ZU(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 XU(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=RO(e)),t.validateSchema=this.compile(e,!0))}var eH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function RO(t){return{anyOf:[t,eH]}}});var CO=F(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var tH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};yS.default=tH});var kO=F(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.callRef=Xo.getValidate=void 0;var rH=Vu(),OO=vn(),Fr=Ne(),$l=Gi(),IO=mh(),Sh=We(),nH={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=IO.resolveRef.call(f,d,i,r);if(m===void 0)throw new rH.default(n.opts.uriResolver,i,r);if(m instanceof IO.SchemaEnv)return y(m);return w(m);function g(){if(s===d)return wh(t,a,s,s.$async);let R=e.scopeValue("root",{ref:d});return wh(t,(0,Fr._)`${R}.validate`,d,d.$async)}function y(R){let x=PO(t,R);wh(t,x,R,R.$async)}function w(R){let x=e.scopeValue("schema",l.code.source===!0?{ref:R,code:(0,Fr.stringify)(R)}:{ref:R}),T=e.name("valid"),q=t.subschema({schema:R,dataTypes:[],schemaPath:Fr.nil,topSchemaRef:x,errSchemaPath:r},T);t.mergeEvaluated(q),t.ok(T)}}};function PO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Fr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Xo.getValidate=PO;function wh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:l,opts:f}=s,d=f.passContext?$l.default.this:Fr.nil;n?m():g();function m(){if(!l.$async)throw new Error("async schema referenced by sync schema");let R=i.let("valid");i.try(()=>{i.code((0,Fr._)`await ${(0,OO.callValidateCode)(t,e,d)}`),w(e),a||i.assign(R,!0)},x=>{i.if((0,Fr._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),y(x),a||i.assign(R,!1)}),t.ok(R)}function g(){t.result((0,OO.callValidateCode)(t,e,d),()=>w(e),()=>y(e))}function y(R){let x=(0,Fr._)`${R}.errors`;i.assign($l.default.vErrors,(0,Fr._)`${$l.default.vErrors} === null ? ${x} : ${$l.default.vErrors}.concat(${x})`),i.assign($l.default.errors,(0,Fr._)`${$l.default.vErrors}.length`)}function w(R){var x;if(!s.opts.unevaluated)return;let T=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=Sh.mergeEvaluated.props(i,T.props,s.props));else{let q=i.var("props",(0,Fr._)`${R}.evaluated.props`);s.props=Sh.mergeEvaluated.props(i,q,s.props,Fr.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=Sh.mergeEvaluated.items(i,T.items,s.items));else{let q=i.var("items",(0,Fr._)`${R}.evaluated.items`);s.items=Sh.mergeEvaluated.items(i,q,s.items,Fr.Name)}}}Xo.callRef=wh;Xo.default=nH});var TO=F(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var iH=CO(),sH=kO(),oH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",iH.default,sH.default];vS.default=oH});var AO=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var _h=Ne(),js=_h.operators,xh={maximum:{okStr:"<=",ok:js.LTE,fail:js.GT},minimum:{okStr:">=",ok:js.GTE,fail:js.LT},exclusiveMaximum:{okStr:"<",ok:js.LT,fail:js.GTE},exclusiveMinimum:{okStr:">",ok:js.GT,fail:js.LTE}},aH={message:({keyword:t,schemaCode:e})=>(0,_h.str)`must be ${xh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,_h._)`{comparison: ${xh[t].okStr}, limit: ${e}}`},lH={keyword:Object.keys(xh),type:"number",schemaType:"number",$data:!0,error:aH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,_h._)`${r} ${xh[e].fail} ${n} || isNaN(${r})`)}};bS.default=lH});var qO=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var Gu=Ne(),cH={message:({schemaCode:t})=>(0,Gu.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Gu._)`{multipleOf: ${t}}`},uH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:cH,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),l=s?(0,Gu._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Gu._)`${a} !== parseInt(${a})`;t.fail$data((0,Gu._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};SS.default=uH});var MO=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});function $O(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}wS.default=$O;$O.code='require("ajv/dist/runtime/ucs2length").default'});var NO=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var ea=Ne(),fH=We(),dH=MO(),pH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,ea.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ea._)`{limit: ${t}}`},hH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:pH,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?ea.operators.GT:ea.operators.LT,a=i.opts.unicode===!1?(0,ea._)`${r}.length`:(0,ea._)`${(0,fH.useFunc)(t.gen,dH.default)}(${r})`;t.fail$data((0,ea._)`${a} ${s} ${n}`)}};_S.default=hH});var DO=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var mH=vn(),gH=We(),Ml=Ne(),yH={message:({schemaCode:t})=>(0,Ml.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Ml._)`{pattern: ${t}}`},vH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:yH,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,Ml._)`new RegExp`:(0,gH.useFunc)(e,f),m=e.let("valid");e.try(()=>e.assign(m,(0,Ml._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(m,!1)),t.fail$data((0,Ml._)`!${m}`)}else{let f=(0,mH.usePattern)(t,i);t.fail$data((0,Ml._)`!${f}.test(${r})`)}}};xS.default=vH});var FO=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var Ku=Ne(),bH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Ku.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Ku._)`{limit: ${t}}`},SH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:bH,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Ku.operators.GT:Ku.operators.LT;t.fail$data((0,Ku._)`Object.keys(${r}).length ${i} ${n}`)}};RS.default=SH});var LO=F(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});var Qu=vn(),Zu=Ne(),wH=We(),_H={message:({params:{missingProperty:t}})=>(0,Zu.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Zu._)`{missingProperty: ${t}}`},xH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:_H,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 w=t.parentSchema.properties,{definedProperties:R}=t.it;for(let x of r)if(w?.[x]===void 0&&!R.has(x)){let T=a.schemaEnv.baseId+a.errSchemaPath,q=`required property "${x}" is not defined at "${T}" (strictRequired)`;(0,wH.checkStrictMode)(a,q,a.opts.strictRequired)}}function d(){if(f||s)t.block$data(Zu.nil,g);else for(let w of r)(0,Qu.checkReportMissingProp)(t,w)}function m(){let w=e.let("missing");if(f||s){let R=e.let("valid",!0);t.block$data(R,()=>y(w,R)),t.ok(R)}else e.if((0,Qu.checkMissingProp)(t,r,w)),(0,Qu.reportMissingProp)(t,w),e.else()}function g(){e.forOf("prop",n,w=>{t.setParams({missingProperty:w}),e.if((0,Qu.noPropertyInData)(e,i,w,l.ownProperties),()=>t.error())})}function y(w,R){t.setParams({missingProperty:w}),e.forOf(w,n,()=>{e.assign(R,(0,Qu.propertyInData)(e,i,w,l.ownProperties)),e.if((0,Zu.not)(R),()=>{t.error(),e.break()})},Zu.nil)}}};ES.default=xH});var jO=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var Xu=Ne(),RH={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Xu.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Xu._)`{limit: ${t}}`},EH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:RH,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Xu.operators.GT:Xu.operators.LT;t.fail$data((0,Xu._)`${r}.length ${i} ${n}`)}};CS.default=EH});var Rh=F(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});var UO=Kb();UO.code='require("ajv/dist/runtime/equal").default';OS.default=UO});var HO=F(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var IS=Lu(),er=Ne(),CH=We(),OH=Rh(),IH={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}}`},PH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:IH,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,IS.getSchemaTypes)(s.items):[];t.block$data(f,m,(0,er._)`${a} === false`),t.ok(f);function m(){let R=e.let("i",(0,er._)`${r}.length`),x=e.let("j");t.setParams({i:R,j:x}),e.assign(f,!0),e.if((0,er._)`${R} > 1`,()=>(g()?y:w)(R,x))}function g(){return d.length>0&&!d.some(R=>R==="object"||R==="array")}function y(R,x){let T=e.name("item"),q=(0,IS.checkDataTypes)(d,T,l.opts.strictNumbers,IS.DataType.Wrong),L=e.const("indices",(0,er._)`{}`);e.for((0,er._)`;${R}--;`,()=>{e.let(T,(0,er._)`${r}[${R}]`),e.if(q,(0,er._)`continue`),d.length>1&&e.if((0,er._)`typeof ${T} == "string"`,(0,er._)`${T} += "_"`),e.if((0,er._)`typeof ${L}[${T}] == "number"`,()=>{e.assign(x,(0,er._)`${L}[${T}]`),t.error(),e.assign(f,!1).break()}).code((0,er._)`${L}[${T}] = ${R}`)})}function w(R,x){let T=(0,CH.useFunc)(e,OH.default),q=e.name("outer");e.label(q).for((0,er._)`;${R}--;`,()=>e.for((0,er._)`${x} = ${R}; ${x}--;`,()=>e.if((0,er._)`${T}(${r}[${R}], ${r}[${x}])`,()=>{t.error(),e.assign(f,!1).break(q)})))}}};PS.default=PH});var BO=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var kS=Ne(),kH=We(),TH=Rh(),AH={message:"must be equal to constant",params:({schemaCode:t})=>(0,kS._)`{allowedValue: ${t}}`},qH={keyword:"const",$data:!0,error:AH,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,kS._)`!${(0,kH.useFunc)(e,TH.default)}(${r}, ${i})`):t.fail((0,kS._)`${s} !== ${r}`)}};TS.default=qH});var VO=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var ef=Ne(),$H=We(),MH=Rh(),NH={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ef._)`{allowedValues: ${t}}`},DH={keyword:"enum",schemaType:"array",$data:!0,error:NH,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,$H.useFunc)(e,MH.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 w=e.const("vSchema",s);m=(0,ef.or)(...i.map((R,x)=>y(w,x)))}t.pass(m);function g(){e.assign(m,!1),e.forOf("v",s,w=>e.if((0,ef._)`${d()}(${r}, ${w})`,()=>e.assign(m,!0).break()))}function y(w,R){let x=i[R];return typeof x=="object"&&x!==null?(0,ef._)`${d()}(${r}, ${w}[${R}])`:(0,ef._)`${r} === ${x}`}}};AS.default=DH});var WO=F(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});var FH=AO(),LH=qO(),jH=NO(),UH=DO(),HH=FO(),BH=LO(),VH=jO(),WH=HO(),zH=BO(),JH=VO(),YH=[FH.default,LH.default,jH.default,UH.default,HH.default,BH.default,VH.default,WH.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},zH.default,JH.default];qS.default=YH});var MS=F(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.validateAdditionalItems=void 0;var ta=Ne(),$S=We(),GH={message:({params:{len:t}})=>(0,ta.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ta._)`{limit: ${t}}`},KH={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:GH,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,$S.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}zO(t,n)}};function zO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let l=r.const("len",(0,ta._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,ta._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,$S.alwaysValidSchema)(a,n)){let d=r.var("valid",(0,ta._)`${l} <= ${e.length}`);r.if((0,ta.not)(d),()=>f(d)),t.ok(d)}function f(d){r.forRange("i",e.length,l,m=>{t.subschema({keyword:s,dataProp:m,dataPropType:$S.Type.Num},d),a.allErrors||r.if((0,ta.not)(d),()=>r.break())})}}tf.validateAdditionalItems=zO;tf.default=KH});var NS=F(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.validateTuple=void 0;var JO=Ne(),Eh=We(),QH=vn(),ZH={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return YO(t,"additionalItems",e);r.items=!0,!(0,Eh.alwaysValidSchema)(r,e)&&t.ok((0,QH.validateArray)(t))}};function YO(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=Eh.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),d=n.const("len",(0,JO._)`${s}.length`);r.forEach((g,y)=>{(0,Eh.alwaysValidSchema)(l,g)||(n.if((0,JO._)`${d} > ${y}`,()=>t.subschema({keyword:a,schemaProp:y,dataProp:y},f)),t.ok(f))});function m(g){let{opts:y,errSchemaPath:w}=l,R=r.length,x=R===g.minItems&&(R===g.maxItems||g[e]===!1);if(y.strictTuples&&!x){let T=`"${a}" is ${R}-tuple, but minItems or maxItems/${e} are not specified or different at path "${w}"`;(0,Eh.checkStrictMode)(l,T,y.strictTuples)}}}rf.validateTuple=YO;rf.default=ZH});var GO=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var XH=NS(),eB={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,XH.validateTuple)(t,"items")};DS.default=eB});var QO=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var KO=Ne(),tB=We(),rB=vn(),nB=MS(),iB={message:({params:{len:t}})=>(0,KO.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,KO._)`{limit: ${t}}`},sB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:iB,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,tB.alwaysValidSchema)(n,e)&&(i?(0,nB.validateAdditionalItems)(t,i):t.ok((0,rB.validateArray)(t)))}};FS.default=sB});var ZO=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var Sn=Ne(),Ch=We(),oB={message:({params:{min:t,max:e}})=>e===void 0?(0,Sn.str)`must contain at least ${t} valid item(s)`:(0,Sn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Sn._)`{minContains: ${t}}`:(0,Sn._)`{minContains: ${t}, maxContains: ${e}}`},aB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:oB,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,Sn._)`${i}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,Ch.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Ch.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Ch.alwaysValidSchema)(s,r)){let x=(0,Sn._)`${m} >= ${a}`;l!==void 0&&(x=(0,Sn._)`${x} && ${m} <= ${l}`),t.pass(x);return}s.items=!0;let g=e.name("valid");l===void 0&&a===1?w(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,Sn._)`${i}.length > 0`,y)):(e.let(g,!1),y()),t.result(g,()=>t.reset());function y(){let x=e.name("_valid"),T=e.let("count",0);w(x,()=>e.if(x,()=>R(T)))}function w(x,T){e.forRange("i",0,m,q=>{t.subschema({keyword:"contains",dataProp:q,dataPropType:Ch.Type.Num,compositeRule:!0},x),T()})}function R(x){e.code((0,Sn._)`${x}++`),l===void 0?e.if((0,Sn._)`${x} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,Sn._)`${x} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,Sn._)`${x} >= ${a}`,()=>e.assign(g,!0)))}}};LS.default=aB});var tI=F(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.validateSchemaDeps=bi.validatePropertyDeps=bi.error=void 0;var jS=Ne(),lB=We(),nf=vn();bi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,jS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,jS._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${r}}`};var aB={keyword:"dependencies",type:"object",schemaType:"object",error:bi.error,code(t){let[e,r]=lB(t);XO(t,e),eI(t,r)}};function lB({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 XO(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,tf.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,tf.checkReportMissingProp)(t,d)}):(r.if((0,FS._)`${f} && (${(0,tf.checkMissingProp)(t,l,s)})`),(0,tf.reportMissingProp)(t,s),r.else())}}bi.validatePropertyDeps=XO;function eI(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let l in e)(0,oB.alwaysValidSchema)(s,e[l])||(r.if((0,tf.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))}bi.validateSchemaDeps=eI;bi.default=aB});var nI=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var rI=Ne(),cB=We(),uB={message:"property name must be valid",params:({params:t})=>(0,rI._)`{propertyName: ${t.propertyName}}`},fB={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:uB,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,cB.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,rI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};LS.default=fB});var US=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var Rh=vn(),zn=Ne(),dB=Gi(),Eh=We(),pB={message:"must NOT have additional properties",params:({params:t})=>(0,zn._)`{additionalProperty: ${t.additionalProperty}}`},hB={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:pB,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,Eh.alwaysValidSchema)(a,r))return;let d=(0,Rh.allSchemaProperties)(n.properties),m=(0,Rh.allSchemaProperties)(n.patternProperties);g(),t.ok((0,zn._)`${s} === ${dB.default.errors}`);function g(){e.forIn("key",i,T=>{!d.length&&!m.length?R(T):e.if(y(T),()=>R(T))})}function y(T){let q;if(d.length>8){let L=(0,Eh.schemaRefOrVal)(a,n.properties,"properties");q=(0,Rh.isOwnProperty)(e,L,T)}else d.length?q=(0,zn.or)(...d.map(L=>(0,zn._)`${T} === ${L}`)):q=zn.nil;return m.length&&(q=(0,zn.or)(q,...m.map(L=>(0,zn._)`${(0,Rh.usePattern)(t,L)}.test(${T})`))),(0,zn.not)(q)}function w(T){e.code((0,zn._)`delete ${i}[${T}]`)}function R(T){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){w(T);return}if(r===!1){t.setParams({additionalProperty:T}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Eh.alwaysValidSchema)(a,r)){let q=e.name("valid");f.removeAdditional==="failing"?(x(T,q,!1),e.if((0,zn.not)(q),()=>{t.reset(),w(T)})):(x(T,q),l||e.if((0,zn.not)(q),()=>e.break()))}}function x(T,q,L){let V={keyword:"additionalProperties",dataProp:T,dataPropType:Eh.Type.Str};L===!1&&Object.assign(V,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(V,q)}}};jS.default=hB});var oI=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var mB=Uu(),iI=vn(),HS=We(),sI=US(),gB={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&&sI.default.code(new mB.KeywordCxt(s,sI.default,"additionalProperties"));let a=(0,iI.allSchemaProperties)(r);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=HS.mergeEvaluated.props(e,(0,HS.toHash)(a),s.props));let l=a.filter(g=>!(0,HS.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,iI.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)}}};BS.default=gB});var uI=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var aI=vn(),Ch=Ne(),lI=We(),cI=We(),yB={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,aI.allSchemaProperties)(r),f=l.filter(x=>(0,lI.alwaysValidSchema)(s,r[x]));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 Ch.Name)&&(s.props=(0,cI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let x of l)d&&w(x),s.allErrors?R(x):(e.var(m,!0),R(x),e.if(m))}function w(x){for(let T in d)new RegExp(x).test(T)&&(0,lI.checkStrictMode)(s,`property ${T} matches pattern ${x} (use allowMatchingProperties)`)}function R(x){e.forIn("key",n,T=>{e.if((0,Ch._)`${(0,aI.usePattern)(t,x)}.test(${T})`,()=>{let q=f.includes(x);q||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:T,dataPropType:cI.Type.Str},m),s.opts.unevaluated&&g!==!0?e.assign((0,Ch._)`${g}[${T}]`,!0):!q&&!s.allErrors&&e.if((0,Ch.not)(m),()=>e.break())})})}}};VS.default=yB});var fI=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var vB=We(),bB={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,vB.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"}};WS.default=bB});var dI=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var SB=vn(),wB={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:SB.validateUnion,error:{message:"must match a schema in anyOf"}};zS.default=wB});var pI=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var Oh=Ne(),_B=We(),xB={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Oh._)`{passingSchemas: ${t.passing}}`},RB={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:xB,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,_B.alwaysValidSchema)(i,m)?e.var(f,!0):y=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,Oh._)`${f} && ${a}`).assign(a,!1).assign(l,(0,Oh._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(l,g),y&&t.mergeEvaluated(y,Oh.Name)})})}}};JS.default=RB});var hI=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var EB=We(),CB={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,EB.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(l)})}};YS.default=CB});var yI=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var Ih=Ne(),gI=We(),OB={message:({params:t})=>(0,Ih.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ih._)`{failingKeyword: ${t.ifClause}}`},IB={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:OB,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=mI(n,"then"),s=mI(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,Ih.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,Ih._)`${m}`):t.setParams({ifClause:m})}}}};function mI(t,e){let r=t.schema[e];return r!==void 0&&!(0,gI.alwaysValidSchema)(t,r)}GS.default=IB});var vI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var PB=We(),kB={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,PB.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};KS.default=kB});var bI=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var TB=qS(),AB=GO(),qB=$S(),$B=QO(),MB=ZO(),NB=tI(),DB=nI(),FB=US(),LB=oI(),jB=uI(),UB=fI(),HB=dI(),BB=pI(),VB=hI(),WB=yI(),zB=vI();function JB(t=!1){let e=[UB.default,HB.default,BB.default,VB.default,WB.default,zB.default,DB.default,FB.default,NB.default,LB.default,jB.default];return t?e.push(AB.default,$B.default):e.push(TB.default,qB.default),e.push(MB.default),e}QS.default=JB});var SI=F(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var Mt=Ne(),YB={message:({schemaCode:t})=>(0,Mt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Mt._)`{format: ${t}}`},GB={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:YB,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():w();function y(){let R=r.scopeValue("formats",{ref:g.formats,code:f.code.formats}),x=r.const("fDef",(0,Mt._)`${R}[${a}]`),T=r.let("fType"),q=r.let("format");r.if((0,Mt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(T,(0,Mt._)`${x}.type || "string"`).assign(q,(0,Mt._)`${x}.validate`),()=>r.assign(T,(0,Mt._)`"string"`).assign(q,x)),t.fail$data((0,Mt.or)(L(),V()));function L(){return f.strictSchema===!1?Mt.nil:(0,Mt._)`${a} && !${q}`}function V(){let B=m.$async?(0,Mt._)`(${x}.async ? await ${q}(${n}) : ${q}(${n}))`:(0,Mt._)`${q}(${n})`,K=(0,Mt._)`(typeof ${q} == "function" ? ${B} : ${q}.test(${n}))`;return(0,Mt._)`${q} && ${q} !== true && ${T} === ${e} && !${K}`}}function w(){let R=g.formats[s];if(!R){L();return}if(R===!0)return;let[x,T,q]=V(R);x===e&&t.pass(B());function L(){if(f.strictSchema===!1){g.logger.warn(K());return}throw new Error(K());function K(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function V(K){let X=K instanceof RegExp?(0,Mt.regexpCode)(K):f.code.formats?(0,Mt._)`${f.code.formats}${(0,Mt.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:K,code:X});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,Mt._)`${k}.validate`]:["string",K,k]}function B(){if(typeof R=="object"&&!(R instanceof RegExp)&&R.async){if(!m.$async)throw new Error("async format in sync schema");return(0,Mt._)`await ${q}(${n})`}return typeof T=="function"?(0,Mt._)`${q}(${n})`:(0,Mt._)`${q}.test(${n})`}}}};ZS.default=GB});var wI=F(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});var KB=SI(),QB=[KB.default];XS.default=QB});var _I=F(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.contentVocabulary=Nl.metadataVocabulary=void 0;Nl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Nl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var RI=F(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var ZB=TO(),XB=WO(),eV=bI(),tV=wI(),xI=_I(),rV=[ZB.default,XB.default,(0,eV.default)(),tV.default,xI.metadataVocabulary,xI.contentVocabulary];e0.default=rV});var CI=F(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.DiscrError=void 0;var EI;(function(t){t.Tag="tag",t.Mapping="mapping"})(EI||(Ph.DiscrError=EI={}))});var II=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var Dl=Ne(),t0=CI(),OI=dh(),nV=Hu(),iV=We(),sV={message:({params:{discrError:t,tagName:e}})=>t===t0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Dl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},oV={keyword:"discriminator",type:"object",schemaType:"object",error:sV,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,Dl._)`${r}${(0,Dl.getProperty)(l)}`);e.if((0,Dl._)`typeof ${d} == "string"`,()=>m(),()=>t.error(!1,{discrError:t0.DiscrError.Tag,tag:d,tagName:l})),t.ok(f);function m(){let w=y();e.if(!1);for(let R in w)e.elseIf((0,Dl._)`${d} === ${R}`),e.assign(f,g(w[R]));e.else(),t.error(!1,{discrError:t0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(w){let R=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:w},R);return t.mergeEvaluated(x,Dl.Name),R}function y(){var w;let R={},x=q(i),T=!0;for(let B=0;B<a.length;B++){let K=a[B];if(K?.$ref&&!(0,iV.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=OI.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof OI.SchemaEnv&&(K=K.schema),K===void 0)throw new nV.default(s.opts.uriResolver,s.baseId,k)}let X=(w=K?.properties)===null||w===void 0?void 0:w[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);T=T&&(x||q(K)),L(X,B)}if(!T)throw new Error(`discriminator: "${l}" must be required`);return R;function q({required:B}){return Array.isArray(B)&&B.includes(l)}function L(B,K){if(B.const)V(B.const,K);else if(B.enum)for(let X of B.enum)V(X,K);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function V(B,K){if(typeof B!="string"||B in R)throw new Error(`discriminator: "${l}" values must be unique strings`);R[B]=K}}}};r0.default=oV});var PI=F((a7,aV)=>{aV.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 TI=F((St,n0)=>{"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 lV=EO(),cV=RI(),uV=II(),kI=PI(),fV=["/properties"],kh="http://json-schema.org/draft-07/schema",Fl=class extends lV.default{_addVocabularies(){super._addVocabularies(),cV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(uV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(kI,fV):kI;this.addMetaSchema(e,kh,!1),this.refs["http://json-schema.org/schema"]=kh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(kh)?kh:void 0)}};St.Ajv=Fl;n0.exports=St=Fl;n0.exports.Ajv=Fl;Object.defineProperty(St,"__esModule",{value:!0});St.default=Fl;var dV=Uu();Object.defineProperty(St,"KeywordCxt",{enumerable:!0,get:function(){return dV.KeywordCxt}});var Ll=Ne();Object.defineProperty(St,"_",{enumerable:!0,get:function(){return Ll._}});Object.defineProperty(St,"str",{enumerable:!0,get:function(){return Ll.str}});Object.defineProperty(St,"stringify",{enumerable:!0,get:function(){return Ll.stringify}});Object.defineProperty(St,"nil",{enumerable:!0,get:function(){return Ll.nil}});Object.defineProperty(St,"Name",{enumerable:!0,get:function(){return Ll.Name}});Object.defineProperty(St,"CodeGen",{enumerable:!0,get:function(){return Ll.CodeGen}});var pV=uh();Object.defineProperty(St,"ValidationError",{enumerable:!0,get:function(){return pV.default}});var hV=Hu();Object.defineProperty(St,"MissingRefError",{enumerable:!0,get:function(){return hV.default}})});import*as mV from"crypto";import*as ra from"fs";import{createRequire as gV}from"module";import*as Jn from"path";function Ah(){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 AI(){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 i0(t,e){return new Th(t,e)}var Th,s0=le(()=>{"use strict";db();Th=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:wl}),crypto:()=>mV,path:()=>Jn,querystring:()=>nt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>KE(),AI),moment:()=>this.loadOptionalModule("moment",()=>QE(),Ah),tv4:()=>this.loadOptionalModule("tv4",()=>XE()),ajv:()=>this.loadOptionalModule("ajv",()=>TI()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>nt("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=Jn.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 cB={keyword:"dependencies",type:"object",schemaType:"object",error:bi.error,code(t){let[e,r]=uB(t);XO(t,e),eI(t,r)}};function uB({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 XO(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,nf.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,nf.checkReportMissingProp)(t,d)}):(r.if((0,jS._)`${f} && (${(0,nf.checkMissingProp)(t,l,s)})`),(0,nf.reportMissingProp)(t,s),r.else())}}bi.validatePropertyDeps=XO;function eI(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let l in e)(0,lB.alwaysValidSchema)(s,e[l])||(r.if((0,nf.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))}bi.validateSchemaDeps=eI;bi.default=cB});var nI=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var rI=Ne(),fB=We(),dB={message:"property name must be valid",params:({params:t})=>(0,rI._)`{propertyName: ${t.propertyName}}`},pB={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:dB,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,fB.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,rI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};US.default=pB});var BS=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var Oh=vn(),zn=Ne(),hB=Gi(),Ih=We(),mB={message:"must NOT have additional properties",params:({params:t})=>(0,zn._)`{additionalProperty: ${t.additionalProperty}}`},gB={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:mB,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,Ih.alwaysValidSchema)(a,r))return;let d=(0,Oh.allSchemaProperties)(n.properties),m=(0,Oh.allSchemaProperties)(n.patternProperties);g(),t.ok((0,zn._)`${s} === ${hB.default.errors}`);function g(){e.forIn("key",i,T=>{!d.length&&!m.length?R(T):e.if(y(T),()=>R(T))})}function y(T){let q;if(d.length>8){let L=(0,Ih.schemaRefOrVal)(a,n.properties,"properties");q=(0,Oh.isOwnProperty)(e,L,T)}else d.length?q=(0,zn.or)(...d.map(L=>(0,zn._)`${T} === ${L}`)):q=zn.nil;return m.length&&(q=(0,zn.or)(q,...m.map(L=>(0,zn._)`${(0,Oh.usePattern)(t,L)}.test(${T})`))),(0,zn.not)(q)}function w(T){e.code((0,zn._)`delete ${i}[${T}]`)}function R(T){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){w(T);return}if(r===!1){t.setParams({additionalProperty:T}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Ih.alwaysValidSchema)(a,r)){let q=e.name("valid");f.removeAdditional==="failing"?(x(T,q,!1),e.if((0,zn.not)(q),()=>{t.reset(),w(T)})):(x(T,q),l||e.if((0,zn.not)(q),()=>e.break()))}}function x(T,q,L){let V={keyword:"additionalProperties",dataProp:T,dataPropType:Ih.Type.Str};L===!1&&Object.assign(V,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(V,q)}}};HS.default=gB});var oI=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var yB=Bu(),iI=vn(),VS=We(),sI=BS(),vB={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&&sI.default.code(new yB.KeywordCxt(s,sI.default,"additionalProperties"));let a=(0,iI.allSchemaProperties)(r);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=VS.mergeEvaluated.props(e,(0,VS.toHash)(a),s.props));let l=a.filter(g=>!(0,VS.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,iI.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)}}};WS.default=vB});var uI=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var aI=vn(),Ph=Ne(),lI=We(),cI=We(),bB={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,aI.allSchemaProperties)(r),f=l.filter(x=>(0,lI.alwaysValidSchema)(s,r[x]));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 Ph.Name)&&(s.props=(0,cI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let x of l)d&&w(x),s.allErrors?R(x):(e.var(m,!0),R(x),e.if(m))}function w(x){for(let T in d)new RegExp(x).test(T)&&(0,lI.checkStrictMode)(s,`property ${T} matches pattern ${x} (use allowMatchingProperties)`)}function R(x){e.forIn("key",n,T=>{e.if((0,Ph._)`${(0,aI.usePattern)(t,x)}.test(${T})`,()=>{let q=f.includes(x);q||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:T,dataPropType:cI.Type.Str},m),s.opts.unevaluated&&g!==!0?e.assign((0,Ph._)`${g}[${T}]`,!0):!q&&!s.allErrors&&e.if((0,Ph.not)(m),()=>e.break())})})}}};zS.default=bB});var fI=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var SB=We(),wB={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,SB.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"}};JS.default=wB});var dI=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var _B=vn(),xB={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:_B.validateUnion,error:{message:"must match a schema in anyOf"}};YS.default=xB});var pI=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var kh=Ne(),RB=We(),EB={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,kh._)`{passingSchemas: ${t.passing}}`},CB={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:EB,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,RB.alwaysValidSchema)(i,m)?e.var(f,!0):y=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,kh._)`${f} && ${a}`).assign(a,!1).assign(l,(0,kh._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(l,g),y&&t.mergeEvaluated(y,kh.Name)})})}}};GS.default=CB});var hI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var OB=We(),IB={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,OB.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(l)})}};KS.default=IB});var yI=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var Th=Ne(),gI=We(),PB={message:({params:t})=>(0,Th.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Th._)`{failingKeyword: ${t.ifClause}}`},kB={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:PB,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=mI(n,"then"),s=mI(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,Th.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,Th._)`${m}`):t.setParams({ifClause:m})}}}};function mI(t,e){let r=t.schema[e];return r!==void 0&&!(0,gI.alwaysValidSchema)(t,r)}QS.default=kB});var vI=F(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var TB=We(),AB={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,TB.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};ZS.default=AB});var bI=F(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});var qB=MS(),$B=GO(),MB=NS(),NB=QO(),DB=ZO(),FB=tI(),LB=nI(),jB=BS(),UB=oI(),HB=uI(),BB=fI(),VB=dI(),WB=pI(),zB=hI(),JB=yI(),YB=vI();function GB(t=!1){let e=[BB.default,VB.default,WB.default,zB.default,JB.default,YB.default,LB.default,jB.default,FB.default,UB.default,HB.default];return t?e.push($B.default,NB.default):e.push(qB.default,MB.default),e.push(DB.default),e}XS.default=GB});var SI=F(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var Mt=Ne(),KB={message:({schemaCode:t})=>(0,Mt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Mt._)`{format: ${t}}`},QB={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:KB,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():w();function y(){let R=r.scopeValue("formats",{ref:g.formats,code:f.code.formats}),x=r.const("fDef",(0,Mt._)`${R}[${a}]`),T=r.let("fType"),q=r.let("format");r.if((0,Mt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(T,(0,Mt._)`${x}.type || "string"`).assign(q,(0,Mt._)`${x}.validate`),()=>r.assign(T,(0,Mt._)`"string"`).assign(q,x)),t.fail$data((0,Mt.or)(L(),V()));function L(){return f.strictSchema===!1?Mt.nil:(0,Mt._)`${a} && !${q}`}function V(){let B=m.$async?(0,Mt._)`(${x}.async ? await ${q}(${n}) : ${q}(${n}))`:(0,Mt._)`${q}(${n})`,K=(0,Mt._)`(typeof ${q} == "function" ? ${B} : ${q}.test(${n}))`;return(0,Mt._)`${q} && ${q} !== true && ${T} === ${e} && !${K}`}}function w(){let R=g.formats[s];if(!R){L();return}if(R===!0)return;let[x,T,q]=V(R);x===e&&t.pass(B());function L(){if(f.strictSchema===!1){g.logger.warn(K());return}throw new Error(K());function K(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function V(K){let X=K instanceof RegExp?(0,Mt.regexpCode)(K):f.code.formats?(0,Mt._)`${f.code.formats}${(0,Mt.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:K,code:X});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,Mt._)`${k}.validate`]:["string",K,k]}function B(){if(typeof R=="object"&&!(R instanceof RegExp)&&R.async){if(!m.$async)throw new Error("async format in sync schema");return(0,Mt._)`await ${q}(${n})`}return typeof T=="function"?(0,Mt._)`${q}(${n})`:(0,Mt._)`${q}.test(${n})`}}}};e0.default=QB});var wI=F(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var ZB=SI(),XB=[ZB.default];t0.default=XB});var _I=F(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.contentVocabulary=Nl.metadataVocabulary=void 0;Nl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Nl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var RI=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var eV=TO(),tV=WO(),rV=bI(),nV=wI(),xI=_I(),iV=[eV.default,tV.default,(0,rV.default)(),nV.default,xI.metadataVocabulary,xI.contentVocabulary];r0.default=iV});var CI=F(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.DiscrError=void 0;var EI;(function(t){t.Tag="tag",t.Mapping="mapping"})(EI||(Ah.DiscrError=EI={}))});var II=F(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var Dl=Ne(),n0=CI(),OI=mh(),sV=Vu(),oV=We(),aV={message:({params:{discrError:t,tagName:e}})=>t===n0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Dl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},lV={keyword:"discriminator",type:"object",schemaType:"object",error:aV,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,Dl._)`${r}${(0,Dl.getProperty)(l)}`);e.if((0,Dl._)`typeof ${d} == "string"`,()=>m(),()=>t.error(!1,{discrError:n0.DiscrError.Tag,tag:d,tagName:l})),t.ok(f);function m(){let w=y();e.if(!1);for(let R in w)e.elseIf((0,Dl._)`${d} === ${R}`),e.assign(f,g(w[R]));e.else(),t.error(!1,{discrError:n0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(w){let R=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:w},R);return t.mergeEvaluated(x,Dl.Name),R}function y(){var w;let R={},x=q(i),T=!0;for(let B=0;B<a.length;B++){let K=a[B];if(K?.$ref&&!(0,oV.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=OI.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof OI.SchemaEnv&&(K=K.schema),K===void 0)throw new sV.default(s.opts.uriResolver,s.baseId,k)}let X=(w=K?.properties)===null||w===void 0?void 0:w[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);T=T&&(x||q(K)),L(X,B)}if(!T)throw new Error(`discriminator: "${l}" must be required`);return R;function q({required:B}){return Array.isArray(B)&&B.includes(l)}function L(B,K){if(B.const)V(B.const,K);else if(B.enum)for(let X of B.enum)V(X,K);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function V(B,K){if(typeof B!="string"||B in R)throw new Error(`discriminator: "${l}" values must be unique strings`);R[B]=K}}}};i0.default=lV});var PI=F((g7,cV)=>{cV.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 TI=F((St,s0)=>{"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 uV=EO(),fV=RI(),dV=II(),kI=PI(),pV=["/properties"],qh="http://json-schema.org/draft-07/schema",Fl=class extends uV.default{_addVocabularies(){super._addVocabularies(),fV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(dV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(kI,pV):kI;this.addMetaSchema(e,qh,!1),this.refs["http://json-schema.org/schema"]=qh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(qh)?qh:void 0)}};St.Ajv=Fl;s0.exports=St=Fl;s0.exports.Ajv=Fl;Object.defineProperty(St,"__esModule",{value:!0});St.default=Fl;var hV=Bu();Object.defineProperty(St,"KeywordCxt",{enumerable:!0,get:function(){return hV.KeywordCxt}});var Ll=Ne();Object.defineProperty(St,"_",{enumerable:!0,get:function(){return Ll._}});Object.defineProperty(St,"str",{enumerable:!0,get:function(){return Ll.str}});Object.defineProperty(St,"stringify",{enumerable:!0,get:function(){return Ll.stringify}});Object.defineProperty(St,"nil",{enumerable:!0,get:function(){return Ll.nil}});Object.defineProperty(St,"Name",{enumerable:!0,get:function(){return Ll.Name}});Object.defineProperty(St,"CodeGen",{enumerable:!0,get:function(){return Ll.CodeGen}});var mV=ph();Object.defineProperty(St,"ValidationError",{enumerable:!0,get:function(){return mV.default}});var gV=Vu();Object.defineProperty(St,"MissingRefError",{enumerable:!0,get:function(){return gV.default}})});import*as yV from"crypto";import*as ra from"fs";import{createRequire as vV}from"module";import*as Jn from"path";function Mh(){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 AI(){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 o0(t,e){return new $h(t,e)}var $h,a0=le(()=>{"use strict";hb();$h=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:wl}),crypto:()=>yV,path:()=>Jn,querystring:()=>nt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>KE(),AI),moment:()=>this.loadOptionalModule("moment",()=>QE(),Mh),tv4:()=>this.loadOptionalModule("tv4",()=>XE()),ajv:()=>this.loadOptionalModule("ajv",()=>TI()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>nt("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=Jn.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=Jn.resolve(e,"package.json");if(!ra.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=ra.realpathSync(r);return this.customModulesRequire=
|
|
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
|
|
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=Jn.resolve(e,"package.json");if(!ra.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=ra.realpathSync(r);return this.customModulesRequire=vV(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=Jn.join(e,"package.json"),n=ra.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=Jn.join(e,"global-setup.js");if(ra.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=Jn.resolve(this.modulesPath,e),l=Jn.normalize(a),f=Jn.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 l0(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(...l0(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(...l0(s,e.items,`${r}[${a}]`))}),n}function bV(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 Nh(t){let e=bV(t.headers);return{status:t.status,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:t.cookies||{},responseTime:t.responseTime,responseSize:t.responseSize,getHeader(r){let n=r.toLowerCase();for(let[i,s]of Object.entries(t.headers))if(i.toLowerCase()===n)return s},getCookie(r){return t.cookies?.[r]},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)},cookie(r){return this.cookies?.[r]},hasCookie(r){return this.cookies?r in this.cookies:!1},to:{have:{status(r){if(t.status!==r)throw new Error(`Expected status ${r} but got ${t.status}`)},header(r,n){let i=t.headers[r]||t.headers[r.toLowerCase()];if(!i)throw new Error(`Expected header "${r}" to exist`);if(n!==void 0&&i!==n)throw new Error(`Expected header "${r}" to be "${n}" but got "${i}"`)},body(r){let n=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(r!==void 0&&n!==r)throw new Error(`Expected body to be "${r}" but got "${n}"`)},jsonBody(r){let n=typeof t.body=="object"?t.body:JSON.parse(t.body);if(r!==void 0&&JSON.stringify(n)!==JSON.stringify(r))throw new Error("Expected JSON body to match")},jsonSchema(r){let n=typeof t.body=="object"?t.body:JSON.parse(t.body),i=l0(n,r);if(i.length>0)throw new Error(`Expected response body to match JSON schema:
|
|
39
39
|
- ${i.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
|
|
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 sf(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 Dh=le(()=>{"use strict"});function Fh(t){return typeof t=="string"?t:t.filter(e=>e&&e.trim()).join(`
|
|
41
41
|
|
|
42
42
|
// --- Next Script ---
|
|
43
43
|
|
|
44
|
-
`)}function nf(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Nh(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 vV(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 a0(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 l0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}var Dh=le(()=>{"use strict"});import*as c0 from"vm";function bV(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 sf,u0=le(()=>{"use strict";$h();Dh();sf=class{constructor(e,r){this.deps=e;this.initialContext=r;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;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)}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:a0(this.assertions),expect:rf,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),w={};if(Array.isArray(y?.cookies))for(let T of y.cookies)T?.name&&(w[T.name]=T.value);let R=y?.body,x=0;if(typeof R=="string")x=Buffer.byteLength(R,"utf8");else if(Buffer.isBuffer(R))x=R.length;else if(R!=null)try{x=Buffer.byteLength(JSON.stringify(R),"utf8")}catch{}return qh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:R,cookies:w,responseTime:y?.time,responseSize:x})})();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 bV(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}}}}async executePreRequest(e){let r=Mh(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);c0.runInContext(n,this.vmContext,{timeout:5e3});let i=Nh(this.consoleMessages),s=this.initialContext.request.body,a=!this.bodiesEqual(this.modifiedRequest.body,s);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:nf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:nf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:nf(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:i.length>0?i:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:[`[error] Script execution failed: ${n.message}`],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=Mh(e);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=qh(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(l,f,d){return i.assertions.push({name:String(f),passed:!!d,message:d?void 0:`"${String(f)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n);c0.runInContext(s,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let a=Nh(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:a.length>0?a:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){return this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"}),{testResults:[...this.assertions],consoleOutput:[`[error] Script execution failed: ${i.message}`],modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,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.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as tr from"crypto";import*as SV from"querystring";import*as $I from"vm";function MI(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 NI(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function wV(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=MI(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return NI(e[t]);if(jo(t)){let n=Lo(t,e),i=Uo(t,n);if(i!==void 0)return i}}function qI(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 f0(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}=qI(s,e,r,f),g=tr.createCipheriv(n(e),d,m),y=Buffer.concat([g.update(l),g.final()]),w=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:R=>R?R.stringify(new je(w)):w.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}=qI(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 _V(){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:f0("aes",32,16),DES:f0("des",8,8),TripleDES:f0("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,Qi,of=le(()=>{"use strict";Wp();Jp();Gp();s0();u0();$h();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"))}};Qi=class t{constructor(e,r=[],n){this.httpService=e;this.secretRegistry=n;this.moduleLoader=i0(r)}httpService;secretRegistry;moduleLoader;createRequestSession(e){return new sf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction();e.require=i,e.vault=this.createVault();let s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:a=>Buffer.from(a,"base64").toString("binary"),btoa:a=>Buffer.from(a,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:tr,_:i("lodash"),require:i,moment:Ah(),querystring:SV,CryptoJS:_V(),postman:{setNextRequest:a=>e.setNextRequest?.(a),setGlobalVariable:(a,l)=>e.globals?.set(a,l),getGlobalVariable:a=>e.globals?.get(a),clearGlobalVariable:a=>e.globals?.unset(a),setEnvironmentVariable:(a,l)=>e.environment?.set(a,l),getEnvironmentVariable:a=>e.environment?.get(a),clearEnvironmentVariable:a=>e.environment?.unset(a)},jsonStringify:(a,l,f)=>JSON.stringify(a,l,f),jsonParse:a=>JSON.parse(a),xml2Json:a=>{try{let l=this.moduleLoader.createRequireFunction()("xml2js"),f;return l.parseString(a,{explicitArray:!1},(d,m)=>{if(d)throw d;f=m}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return $I.createContext(s)}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.createVariableScope(s),m=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(R,x)=>{let T=this.serializeValue(x);g.set(R,T),n[R]=T},unset(R){g.unset(R),delete n[R]},clear(){g.clear();for(let R of Object.keys(a))delete n[R]}};return d.replaceIn=f.replaceIn,m.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:m,variables:f,environment:y,iterationData:{get:R=>l[R],has:R=>R in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:rf,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}}}}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();return l.replace(/\{\{([^}]+)\}\}/g,(d,m)=>{let g=m.trim(),y=g.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(y)try{let x=MI(y[2],f),T=Vi(y[1],x);return T!==null?String(T):d}catch{return d}let w=Su(g);if(w){let x=wV(w.input,f);if(x!==void 0){let T=wu(x,w.filters,f);return T!==void 0?String(T):d}return d}let R=a.get(g);if(R!==void 0)return String(R);if(jo(g)){let x={};for(let[L,V]of Object.entries(f))x[L]=NI(V);let T=Lo(g,x),q=Uo(g,T);if(q!==void 0)return String(q)}return d})}};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 d0,na,Fh=le(()=>{"use strict";d0={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"},na=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=d0["x-www-form-urlencoded"];break;case"raw":s=r.format?d0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=d0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var sa,Lh=le(()=>{"use strict";sa=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 Hl from"crypto";var RV,uf,h0=le(()=>{"use strict";RV=3e4,uf=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||Hl.randomBytes(16).toString("hex"),w=await this.getCallbackUri(),R=new URL(n);if(R.searchParams.set("response_type","code"),R.searchParams.set("client_id",s),R.searchParams.set("redirect_uri",w),l&&R.searchParams.set("scope",l),R.searchParams.set("state",y),m&&(R.searchParams.set("code_challenge",m),R.searchParams.set("code_challenge_method",g)),e.audience&&R.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&R.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,k]of Object.entries(e.extraParams))R.searchParams.set(X,this.resolve(k,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((X,k)=>{this.pendingAuthCallback={resolve:X,reject:k,state:y}});await this.browserService.openExternal(R.toString());let T;try{T=await Promise.race([x,new Promise((X,k)=>setTimeout(()=>{this.pendingAuthCallback=null,k(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(T.state&&T.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let q=new URLSearchParams;q.append("grant_type","authorization_code"),q.append("code",T.code),q.append("redirect_uri",w),d&&q.append("code_verifier",d);let L={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,L,q,s,a,r);let V=await this.httpService.execute({method:"POST",url:i,headers:L,body:q.toString()}),B=this.parseTokenResponse(V.body,e),K=this.buildCacheKeyString(e);return this.tokenCache.set(K,B),B.refreshToken&&await this.storeRefreshToken(K,B.refreshToken),B}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||Hl.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[w,R]of Object.entries(e.extraParams))f.searchParams.set(w,this.resolve(R,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((w,R)=>{this.pendingImplicitCallback={resolve:w,reject:R,state:a}});await this.browserService.openExternal(f.toString());let m;try{m=await Promise.race([d,new Promise((w,R)=>setTimeout(()=>{this.pendingImplicitCallback=null,R(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){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-RV:!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 Hl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Hl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as oa from"fs";import*as Us from"path";function Bl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&oa.writeFileSync(t,r.join(`
|
|
45
|
-
`),"utf-8")}function
|
|
46
|
-
`)}function IV(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 Uh=le(()=>{"use strict";mn()});import*as cr from"fs";import*as m0 from"path";var Vl,g0=le(()=>{"use strict";mn();Vl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){cr.existsSync(this.collectionsDir)||cr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!cr.existsSync(this.collectionsDir))return[];let e=cr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=m0.join(this.collectionsDir,n),s=cr.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(cr.existsSync(r))try{let n=cr.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=ft(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await cr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!cr.existsSync(r))return!1;try{return await cr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return cr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return m0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||ft(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 df,y0=le(()=>{"use strict";Up();g0();df=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new Ts(n):new Vl(n)}static createForFormat(e,r){return e==="folder"?new Ts(r):new Vl(r)}}});import*as wt from"fs";import*as Yn from"path";function DI(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 PV(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=>FI(e)),event:v0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function FI(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(FI):[],event:v0(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(kV),url:TV(e),body:AV(e),auth:qV(e.auth),description:e.description},event:v0(e.scripts),protocolProfileBehavior:$V(e.settings)}}}function kV(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function TV(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,...w]=g.split("=");return{key:y,value:w.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 AV(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=DI(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||DI(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 qV(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 $V(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 v0(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 pf,b0=le(()=>{"use strict";mn();Uh();y0();pf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=df.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;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.loadCollections(),this.onCollectionsChanged?.()};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=ft(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=ft(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:ft(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=ft(r),s=this.loader.getCollectionPath(e),a=Yn.join(this.collectionsDir,i);if(!wt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let l=Yn.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:ft(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=Yn.dirname(s),l=ft(n),f=Yn.join(a,l);this.copyDirRecursive(s,f);let d=Yn.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||ft(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=Yn.join(e,n.name),s=Yn.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||ft(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(q=>q.key==="token")?.value||""};case"basic":let y=d.basic?.find(q=>q.key==="username"),w=d.basic?.find(q=>q.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:w?.value||""}};case"apikey":let R=d.apikey?.find(q=>q.key==="key"),x=d.apikey?.find(q=>q.key==="value"),T=d.apikey?.find(q=>q.key==="in");return{type:"apikey",apikey:{key:R?.value||"",value:x?.value||"",in:T?.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 w=Array.isArray(y)?y.join(`
|
|
47
|
-
`):y;g.listen==="prerequest"?m.preRequest=w:g.listen==="test"&&(m.postResponse=w)}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 w=(Array.isArray(d.path)?d.path:[d.path]).map(R=>{let x=R.startsWith(":")?R.substring(1):R;return m.has(x)?":"+x:(R.startsWith(":"),R)});g+="/"+w.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(m=>{if(m.item)return{id:ft(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:ft(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 w=y.options?.raw?.language;return{type:"raw",format:w==="xml"?"xml":w==="html"?"html":w==="javascript"?"javascript":w==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(w=>({key:w.key||"",value:w.value||"",enabled:w.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(w=>({key:w.key||"",value:w.value||"",type:w.type||"text",enabled:w.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let w;if(y.graphql.variables)try{w=JSON.parse(y.graphql.variables)}catch{w=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:w}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior)}}}),f={id:ft(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=PV(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=Yn.join(r,It(n.name));wt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Bl(Yn.join(i,`${It(n.name)}.env`),s),ff(i,It(n.name),n.scripts),jh(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}}});var Vt,Wl,aa,S0=le(()=>{"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"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,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"}}}},Wl={config:"http-forge.config.json"},aa={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Lr from"fs";import*as wn from"path";var zl,w0=le(()=>{"use strict";S0();zl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=wn.join(e,Wl.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Lr.existsSync(this.configPath))return{...Vt};try{let e=Lr.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 ${Wl.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,Wl.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 wn.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 wn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return wn.join(this.getRootPath(),aa.collections)}getEnvironmentsPath(){return wn.join(this.getRootPath(),aa.environments)}getFlowsPath(){return wn.join(this.getRootPath(),aa.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return wn.join(this.getRootPath(),aa.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Lr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Vt,null,2);await Lr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Lr.existsSync(i)||await Lr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Lr.existsSync(i)||await Lr.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 Lr.promises.writeFile(wn.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 Lr.promises.writeFile(wn.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 Lr.promises.writeFile(wn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var MV,hf,_0=le(()=>{"use strict";bl();MV="httpForge.cookies",hf=class{constructor(e,r=MV){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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.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 dt.domainMatches(e,r)}get count(){return this.cookies.size}}});var mf,x0=le(()=>{"use strict";bl();mf=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=>!(dt.isExpired(s)||s.domain&&!dt.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return dt.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 Hh(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 NV(t,e){try{let r=await e.readFile(t);return Hh(r)}catch{return null}}var R0=le(()=>{"use strict"});import*as Wt from"fs";import*as tn from"path";var gf,yf,E0=le(()=>{"use strict";mn();R0();Uh();Vp();_u();gf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},yf=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=tn.join(a,"_global.json"),this.localConfigPath=tn.join(a,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(gf.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(gf.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`${gf.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=pu(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},w={...n.globalVariables||{},...s.variables||{},...l,...f,...g,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:m,variables:w}}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=tn.join(e,"globals.env");Bl(a,s)}n.forEach(a=>{let l=i?.environments?.[a];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let d=tn.join(e,`${It(a)}.env`);Bl(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 tn.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=Hh(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 tn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=vu(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 Ho({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},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=>!Bp(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=tn.basename(s,".json");if(!i.has(a))try{Wt.unlinkSync(tn.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(tn.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(gf.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(gf.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=tn.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 Hs,Bh=le(()=>{"use strict";Dh();Hs=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={request:e,variables:{...r},environmentVariables:l.variables||{},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(g,y,w)=>{g==="set"&&y&&w!==void 0?this.envConfigService.setEnvironmentVariable(y,w,this.environment):g==="unset"&&y?this.envConfigService.deleteEnvironmentVariable(y,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)}},d=this.scriptExecutor.createRequestSession(f),m=null;try{let g={...r},y={...e},w;if(s.length>0){let N=await d.executePreRequest(s);if(N.consoleOutput&&N.consoleOutput.length>0&&this.onConsoleOutput?.(N.consoleOutput),N.nextRequest!==void 0&&(w=N.nextRequest),N.skipRequest){let j={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:j,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:g,nextRequest:w}}N.success&&(N.modifiedRequest&&(N.modifiedRequest.url&&(y.url=N.modifiedRequest.url),N.modifiedRequest.headers&&(y.headers=N.modifiedRequest.headers),N.modifiedRequest.params&&(y.params=N.modifiedRequest.params),N.modifiedRequest.query&&(y.query=N.modifiedRequest.query),N.modifiedRequest.body!==void 0&&(y.body=N.modifiedRequest.body)),N.modifiedVariables&&(g=N.modifiedVariables))}m=await this.requestPreparer.prepareRequest(y,this.environment,l,g);let{url:R,headers:x,body:T,method:q}=m,L={};for(let N in x)Object.prototype.hasOwnProperty.call(x,N)&&(L[N.toUpperCase()]=x[N]);if(!L.COOKIE&&y.settings?.includeCookies!==!1&&this.cookieJar){let j=this.cookieJar.getCookieHeader(R);j&&(L.COOKIE=j)}let V={method:q,url:R,headers:L,body:T.content,signal:n,settings:y.settings?{timeout:y.settings.timeout,followRedirects:y.settings.followRedirects,maxRedirects:y.settings.maxRedirects,strictSSL:y.settings.strictSSL}:void 0},B=await this.httpService.execute(V);this.cookieJar&&B.headers&&await this.cookieJar.setCookiesFromResponse(R,B.headers);let K=Date.now()-i,X=[],k={},_;if(a.length>0){let N=0;if(B.body)if(typeof B.body=="string")N=Buffer.byteLength(B.body,"utf8");else if(Buffer.isBuffer(B.body))N=B.body.length;else try{N=Buffer.byteLength(JSON.stringify(B.body),"utf8")}catch{N=0}let j={};B.cookies&&Array.isArray(B.cookies)&&B.cookies.forEach(ne=>{ne.name&&(j[ne.name]=ne.value)});let Y={executedRequest:m,status:B.status,statusText:B.statusText,headers:l0(B.headers||{}),body:B.body,cookies:j,responseTime:B.time,responseSize:N},J=await d.executePostResponse(a,Y);X=J.testResults,k=J.modifiedEnvironmentVariables||{},_=J.visualizerData,J.nextRequest!==void 0&&(w=J.nextRequest),J.consoleOutput&&J.consoleOutput.length>0&&this.onConsoleOutput?.(J.consoleOutput)}let P=X.length===0||X.every(N=>N.passed),$=X.length>0?P:B.status>=200&&B.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...m,headers:L},response:{status:B.status,statusText:B.statusText,headers:B.headers||{},body:B.body,time:B.time||K,cookies:B.cookies||[]},duration:K,timestamp:Date.now(),passed:$,assertions:X,modifiedVariables:g,modifiedEnvironmentVariables:k,nextRequest:w,visualizerData:_}}catch(g){return this.handleError(e,m,g,i)}finally{d.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 w={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:a||"GET",headers:r?.headers||{},body:r?.body||w,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
44
|
+
`)}function of(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Lh(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 SV(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 c0(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 u0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}var jh=le(()=>{"use strict"});import*as f0 from"vm";function wV(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 af,d0=le(()=>{"use strict";Dh();jh();af=class{constructor(e,r){this.deps=e;this.initialContext=r;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;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)}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:c0(this.assertions),expect:sf,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),w={};if(Array.isArray(y?.cookies))for(let T of y.cookies)T?.name&&(w[T.name]=T.value);let R=y?.body,x=0;if(typeof R=="string")x=Buffer.byteLength(R,"utf8");else if(Buffer.isBuffer(R))x=R.length;else if(R!=null)try{x=Buffer.byteLength(JSON.stringify(R),"utf8")}catch{}return Nh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:R,cookies:w,responseTime:y?.time,responseSize:x})})();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 wV(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}}}}async executePreRequest(e){let r=Fh(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);f0.runInContext(n,this.vmContext,{timeout:5e3});let i=Lh(this.consoleMessages),s=this.initialContext.request.body,a=!this.bodiesEqual(this.modifiedRequest.body,s);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:of(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:of(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:of(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:i.length>0?i:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:[`[error] Script execution failed: ${n.message}`],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=Fh(e);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=Nh(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(l,f,d){return i.assertions.push({name:String(f),passed:!!d,message:d?void 0:`"${String(f)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n);f0.runInContext(s,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let a=Lh(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:a.length>0?a:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){return this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"}),{testResults:[...this.assertions],consoleOutput:[`[error] Script execution failed: ${i.message}`],modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,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.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as tr from"crypto";import*as _V from"querystring";import*as $I from"vm";function MI(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 NI(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function xV(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=MI(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return NI(e[t]);if(jo(t)){let n=Lo(t,e),i=Uo(t,n);if(i!==void 0)return i}}function qI(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 p0(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}=qI(s,e,r,f),g=tr.createCipheriv(n(e),d,m),y=Buffer.concat([g.update(l),g.final()]),w=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:R=>R?R.stringify(new je(w)):w.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}=qI(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 RV(){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:p0("aes",32,16),DES:p0("des",8,8),TripleDES:p0("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,Qi,lf=le(()=>{"use strict";Yp();Kp();Zp();a0();d0();Dh();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"))}};Qi=class t{constructor(e,r=[],n){this.httpService=e;this.secretRegistry=n;this.moduleLoader=o0(r)}httpService;secretRegistry;moduleLoader;createRequestSession(e){return new af({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction();e.require=i,e.vault=this.createVault();let s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:a=>Buffer.from(a,"base64").toString("binary"),btoa:a=>Buffer.from(a,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:tr,_:i("lodash"),require:i,moment:Mh(),querystring:_V,CryptoJS:RV(),postman:{setNextRequest:a=>e.setNextRequest?.(a),setGlobalVariable:(a,l)=>e.globals?.set(a,l),getGlobalVariable:a=>e.globals?.get(a),clearGlobalVariable:a=>e.globals?.unset(a),setEnvironmentVariable:(a,l)=>e.environment?.set(a,l),getEnvironmentVariable:a=>e.environment?.get(a),clearEnvironmentVariable:a=>e.environment?.unset(a)},jsonStringify:(a,l,f)=>JSON.stringify(a,l,f),jsonParse:a=>JSON.parse(a),xml2Json:a=>{try{let l=this.moduleLoader.createRequireFunction()("xml2js"),f;return l.parseString(a,{explicitArray:!1},(d,m)=>{if(d)throw d;f=m}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return $I.createContext(s)}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.createVariableScope(s),m=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(R,x)=>{let T=this.serializeValue(x);g.set(R,T),n[R]=T},unset(R){g.unset(R),delete n[R]},clear(){g.clear();for(let R of Object.keys(a))delete n[R]}};return d.replaceIn=f.replaceIn,m.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:m,variables:f,environment:y,iterationData:{get:R=>l[R],has:R=>R in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:sf,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}}}}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();return l.replace(/\{\{([^}]+)\}\}/g,(d,m)=>{let g=m.trim(),y=g.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(y)try{let x=MI(y[2],f),T=Vi(y[1],x);return T!==null?String(T):d}catch{return d}let w=_u(g);if(w){let x=xV(w.input,f);if(x!==void 0){let T=xu(x,w.filters,f);return T!==void 0?String(T):d}return d}let R=a.get(g);if(R!==void 0)return String(R);if(jo(g)){let x={};for(let[L,V]of Object.entries(f))x[L]=NI(V);let T=Lo(g,x),q=Uo(g,T);if(q!==void 0)return String(q)}return d})}};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 h0,na,Uh=le(()=>{"use strict";h0={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"},na=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=h0["x-www-form-urlencoded"];break;case"raw":s=r.format?h0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=h0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var sa,Hh=le(()=>{"use strict";sa=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 Hl from"crypto";var CV,df,g0=le(()=>{"use strict";CV=3e4,df=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||Hl.randomBytes(16).toString("hex"),w=await this.getCallbackUri(),R=new URL(n);if(R.searchParams.set("response_type","code"),R.searchParams.set("client_id",s),R.searchParams.set("redirect_uri",w),l&&R.searchParams.set("scope",l),R.searchParams.set("state",y),m&&(R.searchParams.set("code_challenge",m),R.searchParams.set("code_challenge_method",g)),e.audience&&R.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&R.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,k]of Object.entries(e.extraParams))R.searchParams.set(X,this.resolve(k,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((X,k)=>{this.pendingAuthCallback={resolve:X,reject:k,state:y}});await this.browserService.openExternal(R.toString());let T;try{T=await Promise.race([x,new Promise((X,k)=>setTimeout(()=>{this.pendingAuthCallback=null,k(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(T.state&&T.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let q=new URLSearchParams;q.append("grant_type","authorization_code"),q.append("code",T.code),q.append("redirect_uri",w),d&&q.append("code_verifier",d);let L={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,L,q,s,a,r);let V=await this.httpService.execute({method:"POST",url:i,headers:L,body:q.toString()}),B=this.parseTokenResponse(V.body,e),K=this.buildCacheKeyString(e);return this.tokenCache.set(K,B),B.refreshToken&&await this.storeRefreshToken(K,B.refreshToken),B}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||Hl.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[w,R]of Object.entries(e.extraParams))f.searchParams.set(w,this.resolve(R,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((w,R)=>{this.pendingImplicitCallback={resolve:w,reject:R,state:a}});await this.browserService.openExternal(f.toString());let m;try{m=await Promise.race([d,new Promise((w,R)=>setTimeout(()=>{this.pendingImplicitCallback=null,R(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){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-CV:!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 Hl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Hl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as oa from"fs";import*as Us from"path";function Bl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&oa.writeFileSync(t,r.join(`
|
|
45
|
+
`),"utf-8")}function pf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&oa.writeFileSync(Us.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&oa.writeFileSync(Us.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function OV(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Us.isAbsolute(n)?n:Us.join(t,n)}async function IV(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Bh(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Us.join(e,It(n.name));oa.mkdirSync(i,{recursive:!0}),pf(i,It(n.name),n.scripts),Bh(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=It(i.name)+".http",a=Us.join(e,s),l=PV(i,r);oa.writeFileSync(a,l,"utf-8"),pf(e,It(i.name),i.scripts)}})}function PV(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=kV(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(`
|
|
46
|
+
`)}function kV(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 Vh=le(()=>{"use strict";mn()});import*as cr from"fs";import*as y0 from"path";var Vl,v0=le(()=>{"use strict";mn();Vl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){cr.existsSync(this.collectionsDir)||cr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!cr.existsSync(this.collectionsDir))return[];let e=cr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=y0.join(this.collectionsDir,n),s=cr.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(cr.existsSync(r))try{let n=cr.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=ft(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await cr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!cr.existsSync(r))return!1;try{return await cr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return cr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return y0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||ft(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 hf,b0=le(()=>{"use strict";Vp();v0();hf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new Ts(n):new Vl(n)}static createForFormat(e,r){return e==="folder"?new Ts(r):new Vl(r)}}});import*as wt from"fs";import*as Yn from"path";function DI(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 TV(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=>FI(e)),event:S0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function FI(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(FI):[],event:S0(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(AV),url:qV(e),body:$V(e),auth:MV(e.auth),description:e.description},event:S0(e.scripts),protocolProfileBehavior:NV(e.settings)}}}function AV(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function qV(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,...w]=g.split("=");return{key:y,value:w.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 $V(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=DI(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||DI(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 MV(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 NV(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 S0(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 mf,w0=le(()=>{"use strict";mn();Vh();b0();mf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=hf.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;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.loadCollections(),this.onCollectionsChanged?.()};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=ft(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=ft(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:ft(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=ft(r),s=this.loader.getCollectionPath(e),a=Yn.join(this.collectionsDir,i);if(!wt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let l=Yn.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:ft(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=Yn.dirname(s),l=ft(n),f=Yn.join(a,l);this.copyDirRecursive(s,f);let d=Yn.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||ft(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=Yn.join(e,n.name),s=Yn.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||ft(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(q=>q.key==="token")?.value||""};case"basic":let y=d.basic?.find(q=>q.key==="username"),w=d.basic?.find(q=>q.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:w?.value||""}};case"apikey":let R=d.apikey?.find(q=>q.key==="key"),x=d.apikey?.find(q=>q.key==="value"),T=d.apikey?.find(q=>q.key==="in");return{type:"apikey",apikey:{key:R?.value||"",value:x?.value||"",in:T?.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 w=Array.isArray(y)?y.join(`
|
|
47
|
+
`):y;g.listen==="prerequest"?m.preRequest=w:g.listen==="test"&&(m.postResponse=w)}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 w=(Array.isArray(d.path)?d.path:[d.path]).map(R=>{let x=R.startsWith(":")?R.substring(1):R;return m.has(x)?":"+x:(R.startsWith(":"),R)});g+="/"+w.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(m=>{if(m.item)return{id:ft(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:ft(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 w=y.options?.raw?.language;return{type:"raw",format:w==="xml"?"xml":w==="html"?"html":w==="javascript"?"javascript":w==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(w=>({key:w.key||"",value:w.value||"",enabled:w.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(w=>({key:w.key||"",value:w.value||"",type:w.type||"text",enabled:w.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let w;if(y.graphql.variables)try{w=JSON.parse(y.graphql.variables)}catch{w=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:w}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior)}}}),f={id:ft(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=TV(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=Yn.join(r,It(n.name));wt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Bl(Yn.join(i,`${It(n.name)}.env`),s),pf(i,It(n.name),n.scripts),Bh(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}}});var Vt,Wl,aa,_0=le(()=>{"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"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,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"}}}},Wl={config:"http-forge.config.json"},aa={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Lr from"fs";import*as wn from"path";var zl,x0=le(()=>{"use strict";_0();zl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=wn.join(e,Wl.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Lr.existsSync(this.configPath))return{...Vt};try{let e=Lr.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 ${Wl.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,Wl.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 wn.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 wn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return wn.join(this.getRootPath(),aa.collections)}getEnvironmentsPath(){return wn.join(this.getRootPath(),aa.environments)}getFlowsPath(){return wn.join(this.getRootPath(),aa.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return wn.join(this.getRootPath(),aa.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Lr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Vt,null,2);await Lr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Lr.existsSync(i)||await Lr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Lr.existsSync(i)||await Lr.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 Lr.promises.writeFile(wn.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 Lr.promises.writeFile(wn.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 Lr.promises.writeFile(wn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var DV,gf,R0=le(()=>{"use strict";bl();DV="httpForge.cookies",gf=class{constructor(e,r=DV){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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.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 dt.domainMatches(e,r)}get count(){return this.cookies.size}}});var yf,E0=le(()=>{"use strict";bl();yf=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=>!(dt.isExpired(s)||s.domain&&!dt.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return dt.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 Wh(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 FV(t,e){try{let r=await e.readFile(t);return Wh(r)}catch{return null}}var C0=le(()=>{"use strict"});import*as Wt from"fs";import*as tn from"path";var vf,bf,O0=le(()=>{"use strict";mn();C0();Vh();Jp();Ru();vf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},bf=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=tn.join(a,"_global.json"),this.localConfigPath=tn.join(a,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(vf.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(vf.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`${vf.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=mu(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},w={...n.globalVariables||{},...s.variables||{},...l,...f,...g,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:m,variables:w}}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=tn.join(e,"globals.env");Bl(a,s)}n.forEach(a=>{let l=i?.environments?.[a];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let d=tn.join(e,`${It(a)}.env`);Bl(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 tn.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=Wh(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 tn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Su(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 Ho({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},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=>!zp(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=tn.basename(s,".json");if(!i.has(a))try{Wt.unlinkSync(tn.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(tn.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(vf.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(vf.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=tn.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 Hs,zh=le(()=>{"use strict";jh();Hs=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={request:e,variables:{...r},environmentVariables:l.variables||{},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(g,y,w)=>{g==="set"&&y&&w!==void 0?this.envConfigService.setEnvironmentVariable(y,w,this.environment):g==="unset"&&y?this.envConfigService.deleteEnvironmentVariable(y,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)}},d=this.scriptExecutor.createRequestSession(f),m=null;try{let g={...r},y={...e},w;if(s.length>0){let N=await d.executePreRequest(s);if(N.consoleOutput&&N.consoleOutput.length>0&&this.onConsoleOutput?.(N.consoleOutput),N.nextRequest!==void 0&&(w=N.nextRequest),N.skipRequest){let j={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:j,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:g,nextRequest:w}}N.success&&(N.modifiedRequest&&(N.modifiedRequest.url&&(y.url=N.modifiedRequest.url),N.modifiedRequest.headers&&(y.headers=N.modifiedRequest.headers),N.modifiedRequest.params&&(y.params=N.modifiedRequest.params),N.modifiedRequest.query&&(y.query=N.modifiedRequest.query),N.modifiedRequest.body!==void 0&&(y.body=N.modifiedRequest.body)),N.modifiedVariables&&(g=N.modifiedVariables))}m=await this.requestPreparer.prepareRequest(y,this.environment,l,g);let{url:R,headers:x,body:T,method:q}=m,L={};for(let N in x)Object.prototype.hasOwnProperty.call(x,N)&&(L[N.toUpperCase()]=x[N]);if(!L.COOKIE&&y.settings?.includeCookies!==!1&&this.cookieJar){let j=this.cookieJar.getCookieHeader(R);j&&(L.COOKIE=j)}let V={method:q,url:R,headers:L,body:T.content,signal:n,settings:y.settings?{timeout:y.settings.timeout,followRedirects:y.settings.followRedirects,maxRedirects:y.settings.maxRedirects,strictSSL:y.settings.strictSSL}:void 0},B=await this.httpService.execute(V);this.cookieJar&&B.headers&&await this.cookieJar.setCookiesFromResponse(R,B.headers);let K=Date.now()-i,X=[],k={},_;if(a.length>0){let N=0;if(B.body)if(typeof B.body=="string")N=Buffer.byteLength(B.body,"utf8");else if(Buffer.isBuffer(B.body))N=B.body.length;else try{N=Buffer.byteLength(JSON.stringify(B.body),"utf8")}catch{N=0}let j={};B.cookies&&Array.isArray(B.cookies)&&B.cookies.forEach(ne=>{ne.name&&(j[ne.name]=ne.value)});let Y={executedRequest:m,status:B.status,statusText:B.statusText,headers:u0(B.headers||{}),body:B.body,cookies:j,responseTime:B.time,responseSize:N},J=await d.executePostResponse(a,Y);X=J.testResults,k=J.modifiedEnvironmentVariables||{},_=J.visualizerData,J.nextRequest!==void 0&&(w=J.nextRequest),J.consoleOutput&&J.consoleOutput.length>0&&this.onConsoleOutput?.(J.consoleOutput)}let P=X.length===0||X.every(N=>N.passed),$=X.length>0?P:B.status>=200&&B.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...m,headers:L},response:{status:B.status,statusText:B.statusText,headers:B.headers||{},body:B.body,time:B.time||K,cookies:B.cookies||[]},duration:K,timestamp:Date.now(),passed:$,assertions:X,modifiedVariables:g,modifiedEnvironmentVariables:k,nextRequest:w,visualizerData:_}}catch(g){return this.handleError(e,m,g,i)}finally{d.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 w={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:a||"GET",headers:r?.headers||{},body:r?.body||w,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
48
48
|
<html>
|
|
49
49
|
<body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
|
|
50
50
|
<h2 style="margin-top:0;color:#a94442">Request Error</h2>
|
|
@@ -53,7 +53,7 @@ Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}fin
|
|
|
53
53
|
${n(r)}
|
|
54
54
|
</pre>`:""}
|
|
55
55
|
</body>
|
|
56
|
-
</html>`}}});var
|
|
56
|
+
</html>`}}});var Sf,I0=le(()=>{"use strict";mn();Sf=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 q=await this.secretRegistry.resolveSecretTokens(e);Object.keys(q).length>0&&(i={...q,...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=mu(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(q=>q.toLowerCase()==="user-agent")){let q=this.appInfo?.version||"0.0.0",L=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${L}/${q}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let q=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);d.Authorization=`Bearer ${q}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let q=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),L=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),V=Buffer.from(`${q}:${L}`).toString("base64");d.Authorization=`Basic ${V}`}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 q=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 q=="string")try{q=JSON.parse(q)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let L={type:e.body.type,format:e.body.format,content:q};g=this.preprocessor.encodeBody(L)}this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",w=e.url||"",R=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(w,i,r):this.envConfigService.resolveVariables(w,r),x=this.httpService.buildUrl(R,a,l),T={type:e.body?.type||"none",format:e.body?.format,content:g};return{url:x,method:y,headers:d,body:T,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 LV,wf,P0=le(()=>{"use strict";LV=`
|
|
57
57
|
query IntrospectionQuery {
|
|
58
58
|
__schema {
|
|
59
59
|
queryType { name }
|
|
@@ -81,82 +81,82 @@ fragment TypeRef on __Type {
|
|
|
81
81
|
kind name
|
|
82
82
|
ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }
|
|
83
83
|
}
|
|
84
|
-
`.trim(),
|
|
85
|
-
`),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 Zi(t){let e={};for(let[r,n]of Object.entries(t))
|
|
86
|
-
`))return
|
|
87
|
-
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)rn.test(i)&&s&&!ur(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=>
|
|
88
|
-
`)){try{let s=new URLSearchParams(i);for(let[a,l]of s)if(rn.test(a)&&l&&!ur(l)){let f=la(a),d=2;for(;r.has(f);)f=`${la(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)=>
|
|
89
|
-
`)){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&&LI(a,e,r||e,n,i)}}function LI(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 VV(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ca,I0,rn,LV,Sf=le(()=>{"use strict";ca="***",I0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,rn=/(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;LV=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as jr from"path";var wf,$0=le(()=>{"use strict";mn();Sf();wf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return jr.join(this.historyPath,It(e))}getCollectionHistoryPath(e,r){return jr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return jr.join(this.getCollectionHistoryPath(e,r),It(n))}getSharedEnvironmentHistoryPath(e){return jr.join(this.sharedHistoryPath,It(e))}getSharedCollectionHistoryPath(e,r){return jr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return jr.join(this.getSharedCollectionHistoryPath(e,r),It(n))}getHistoryFilePath(e,r,n){return jr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return jr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return jr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return jr.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=T0({...s,method:i,id:sb(),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(w=>w.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(w=>w.id===i)){let w={...d,ticket:null,branch:a};m.requests.unshift(w),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 w=jr.dirname(y);ke.existsSync(w)||ke.mkdirSync(w,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(x){return console.error(`Failed to copy full response from ${g} to ${y}:`,x),!0}try{ke.unlinkSync(g)}catch(x){console.warn(`Failed to remove original full response after copy: ${g}`,x)}}}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(jr.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=A0(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 Jl,M0=le(()=>{"use strict";Jl=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 w=this.historyService.loadFullResponse(i,e,r,y.id);if(w||(w=this.historyService.loadSharedFullResponse(i,e,r,y.id)),w){let R=w.status;m.has(R)||m.set(R,[]),m.get(R).push(w)}}let g={};for(let[y,w]of m){let R=this.buildResponseDefinition(w);g[String(y)]=R}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 N0=Symbol.for("yaml.alias"),jI=Symbol.for("yaml.document"),Yh=Symbol.for("yaml.map"),UI=Symbol.for("yaml.pair"),D0=Symbol.for("yaml.scalar"),Gh=Symbol.for("yaml.seq"),Xi=Symbol.for("yaml.node.type"),WV=t=>!!t&&typeof t=="object"&&t[Xi]===N0,zV=t=>!!t&&typeof t=="object"&&t[Xi]===jI,JV=t=>!!t&&typeof t=="object"&&t[Xi]===Yh,YV=t=>!!t&&typeof t=="object"&&t[Xi]===UI,HI=t=>!!t&&typeof t=="object"&&t[Xi]===D0,GV=t=>!!t&&typeof t=="object"&&t[Xi]===Gh;function BI(t){if(t&&typeof t=="object")switch(t[Xi]){case Yh:case Gh:return!0}return!1}function KV(t){if(t&&typeof t=="object")switch(t[Xi]){case N0:case Yh:case D0:case Gh:return!0}return!1}var QV=t=>(HI(t)||BI(t))&&!!t.anchor;rr.ALIAS=N0;rr.DOC=jI;rr.MAP=Yh;rr.NODE_TYPE=Xi;rr.PAIR=UI;rr.SCALAR=D0;rr.SEQ=Gh;rr.hasAnchor=QV;rr.isAlias=WV;rr.isCollection=BI;rr.isDocument=zV;rr.isMap=JV;rr.isNode=KV;rr.isPair=YV;rr.isScalar=HI;rr.isSeq=GV});var _f=F(F0=>{"use strict";var zt=Je(),Ur=Symbol("break visit"),VI=Symbol("skip children"),Si=Symbol("remove node");function Kh(t,e){let r=WI(e);zt.isDocument(t)?Yl(null,t.contents,r,Object.freeze([t]))===Si&&(t.contents=null):Yl(null,t,r,Object.freeze([]))}Kh.BREAK=Ur;Kh.SKIP=VI;Kh.REMOVE=Si;function Yl(t,e,r,n){let i=zI(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return JI(t,n,i),Yl(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=Yl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Ur)return Ur;a===Si&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=Yl("key",e.key,r,n);if(s===Ur)return Ur;s===Si&&(e.key=null);let a=Yl("value",e.value,r,n);if(a===Ur)return Ur;a===Si&&(e.value=null)}}return i}async function Qh(t,e){let r=WI(e);zt.isDocument(t)?await Gl(null,t.contents,r,Object.freeze([t]))===Si&&(t.contents=null):await Gl(null,t,r,Object.freeze([]))}Qh.BREAK=Ur;Qh.SKIP=VI;Qh.REMOVE=Si;async function Gl(t,e,r,n){let i=await zI(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return JI(t,n,i),Gl(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 Gl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Ur)return Ur;a===Si&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Gl("key",e.key,r,n);if(s===Ur)return Ur;s===Si&&(e.key=null);let a=await Gl("value",e.value,r,n);if(a===Ur)return Ur;a===Si&&(e.value=null)}}return i}function WI(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 zI(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 JI(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`)}}F0.visit=Kh;F0.visitAsync=Qh});var L0=F(GI=>{"use strict";var YI=Je(),ZV=_f(),XV={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},eW=t=>t.replace(/[!,[\]{}]/g,e=>XV[e]),xf=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+eW(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&&YI.isNode(e.contents)){let s={};ZV.visit(e.contents,(a,l)=>{YI.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(`
|
|
90
|
-
`)}};
|
|
91
|
-
`)?
|
|
84
|
+
`.trim(),wf=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:LV,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(`
|
|
85
|
+
`),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 Zi(t){let e={};for(let[r,n]of Object.entries(t))k0.test(r)?e[r]=Array.isArray(n)?n.map(()=>ca):ca:e[r]=n;return e}function T0(t=[]){return t.map(e=>e&&typeof e=="object"&&e.name&&rn.test(e.name)?{...e,value:ca}:e)}function Gh(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)rn.test(n)&&(e.searchParams.set(n,ca),r=!0);return r?e.toString():t}catch{return t}}function Kh(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>Kh(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t))rn.test(r)?e[r]=ca:typeof n=="object"&&n!==null?e[r]=Kh(n):e[r]=n;return e}function jV(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)rn.test(n)&&(e.set(n,ca),r=!0);return r?e.toString():t}catch{return t}}function A0(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return Kh(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=Kh(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
|
|
86
|
+
`))return jV(e)}return t}function q0(t){return{...t,sentRequest:{...t.sentRequest,url:Gh(t.sentRequest.url),headers:Zi(t.sentRequest.headers),body:t.sentRequest.body!=null?A0(t.sentRequest.body):t.sentRequest.body}}}function $0(t){return{...t,headers:Zi(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&rn.test(e.name)?{...e,value:ca}:e)}}function M0(t){return{...t,url:Gh(t.url),request:{...t.request,url:Gh(t.request.url),headers:Zi(t.request.headers),query:Zi(t.request.query),params:Zi(t.request.params),body:t.request.body!=null?A0(t.request.body):t.request.body},response:{headers:Zi(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?T0(t.response.cookies):t.response.cookies}}}function ur(t){return typeof t=="string"&&UV.test(t)}function HV(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)rn.test(n)&&i&&!ur(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)k0.test(n)&&i&&!ur(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)rn.test(n)&&i&&!ur(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&&!ur(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&&!ur(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&&!ur(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&&Jh(r,e)}return e}function Jh(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{Jh(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
|
|
87
|
+
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)rn.test(i)&&s&&!ur(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=>Jh(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))rn.test(r)&&n&&typeof n=="string"&&!ur(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&Jh(n,e)}}function la(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function BV(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)rn.test(s)&&a&&!ur(a)&&e.push({location:"url",field:s,value:a,variableName:n(la(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)k0.test(s)&&a&&!ur(a)&&e.push({location:"header",field:s,value:a,variableName:n(la(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)rn.test(s)&&a&&!ur(a)&&e.push({location:"query",field:s,value:a,variableName:n(la(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!ur(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!ur(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&&!ur(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&&Yh(i,e,r,"")}return e}function Yh(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{Yh(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
|
|
88
|
+
`)){try{let s=new URLSearchParams(i);for(let[a,l]of s)if(rn.test(a)&&l&&!ur(l)){let f=la(a),d=2;for(;r.has(f);)f=`${la(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)=>Yh(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(rn.test(i)&&s&&typeof s=="string"&&!ur(s)){let l=la(i),f=2;for(;r.has(l);)l=`${la(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:a,value:s,variableName:l})}else typeof s=="object"&&s!==null&&Yh(s,e,r,a)}}}function VV(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(`([?&])${zV(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":WV(r,n.field,n.path,n.value,i);break}}return r}function WV(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);LI(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(`
|
|
89
|
+
`)){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&&LI(a,e,r||e,n,i)}}function LI(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 zV(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ca,k0,rn,UV,_f=le(()=>{"use strict";ca="***",k0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,rn=/(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;UV=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as jr from"path";var xf,N0=le(()=>{"use strict";mn();_f();xf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return jr.join(this.historyPath,It(e))}getCollectionHistoryPath(e,r){return jr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return jr.join(this.getCollectionHistoryPath(e,r),It(n))}getSharedEnvironmentHistoryPath(e){return jr.join(this.sharedHistoryPath,It(e))}getSharedCollectionHistoryPath(e,r){return jr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return jr.join(this.getSharedCollectionHistoryPath(e,r),It(n))}getHistoryFilePath(e,r,n){return jr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return jr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return jr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return jr.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=q0({...s,method:i,id:ab(),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(w=>w.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(w=>w.id===i)){let w={...d,ticket:null,branch:a};m.requests.unshift(w),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 w=jr.dirname(y);ke.existsSync(w)||ke.mkdirSync(w,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(x){return console.error(`Failed to copy full response from ${g} to ${y}:`,x),!0}try{ke.unlinkSync(g)}catch(x){console.warn(`Failed to remove original full response after copy: ${g}`,x)}}}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(jr.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=$0(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 Jl,D0=le(()=>{"use strict";Jl=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 w=this.historyService.loadFullResponse(i,e,r,y.id);if(w||(w=this.historyService.loadSharedFullResponse(i,e,r,y.id)),w){let R=w.status;m.has(R)||m.set(R,[]),m.get(R).push(w)}}let g={};for(let[y,w]of m){let R=this.buildResponseDefinition(w);g[String(y)]=R}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 F0=Symbol.for("yaml.alias"),jI=Symbol.for("yaml.document"),Qh=Symbol.for("yaml.map"),UI=Symbol.for("yaml.pair"),L0=Symbol.for("yaml.scalar"),Zh=Symbol.for("yaml.seq"),Xi=Symbol.for("yaml.node.type"),JV=t=>!!t&&typeof t=="object"&&t[Xi]===F0,YV=t=>!!t&&typeof t=="object"&&t[Xi]===jI,GV=t=>!!t&&typeof t=="object"&&t[Xi]===Qh,KV=t=>!!t&&typeof t=="object"&&t[Xi]===UI,HI=t=>!!t&&typeof t=="object"&&t[Xi]===L0,QV=t=>!!t&&typeof t=="object"&&t[Xi]===Zh;function BI(t){if(t&&typeof t=="object")switch(t[Xi]){case Qh:case Zh:return!0}return!1}function ZV(t){if(t&&typeof t=="object")switch(t[Xi]){case F0:case Qh:case L0:case Zh:return!0}return!1}var XV=t=>(HI(t)||BI(t))&&!!t.anchor;rr.ALIAS=F0;rr.DOC=jI;rr.MAP=Qh;rr.NODE_TYPE=Xi;rr.PAIR=UI;rr.SCALAR=L0;rr.SEQ=Zh;rr.hasAnchor=XV;rr.isAlias=JV;rr.isCollection=BI;rr.isDocument=YV;rr.isMap=GV;rr.isNode=ZV;rr.isPair=KV;rr.isScalar=HI;rr.isSeq=QV});var Rf=F(j0=>{"use strict";var zt=Je(),Ur=Symbol("break visit"),VI=Symbol("skip children"),Si=Symbol("remove node");function Xh(t,e){let r=WI(e);zt.isDocument(t)?Yl(null,t.contents,r,Object.freeze([t]))===Si&&(t.contents=null):Yl(null,t,r,Object.freeze([]))}Xh.BREAK=Ur;Xh.SKIP=VI;Xh.REMOVE=Si;function Yl(t,e,r,n){let i=zI(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return JI(t,n,i),Yl(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=Yl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Ur)return Ur;a===Si&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=Yl("key",e.key,r,n);if(s===Ur)return Ur;s===Si&&(e.key=null);let a=Yl("value",e.value,r,n);if(a===Ur)return Ur;a===Si&&(e.value=null)}}return i}async function em(t,e){let r=WI(e);zt.isDocument(t)?await Gl(null,t.contents,r,Object.freeze([t]))===Si&&(t.contents=null):await Gl(null,t,r,Object.freeze([]))}em.BREAK=Ur;em.SKIP=VI;em.REMOVE=Si;async function Gl(t,e,r,n){let i=await zI(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return JI(t,n,i),Gl(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 Gl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Ur)return Ur;a===Si&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Gl("key",e.key,r,n);if(s===Ur)return Ur;s===Si&&(e.key=null);let a=await Gl("value",e.value,r,n);if(a===Ur)return Ur;a===Si&&(e.value=null)}}return i}function WI(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 zI(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 JI(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`)}}j0.visit=Xh;j0.visitAsync=em});var U0=F(GI=>{"use strict";var YI=Je(),eW=Rf(),tW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},rW=t=>t.replace(/[!,[\]{}]/g,e=>tW[e]),Ef=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+rW(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&&YI.isNode(e.contents)){let s={};eW.visit(e.contents,(a,l)=>{YI.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(`
|
|
90
|
+
`)}};Ef.defaultYaml={explicit:!1,version:"1.2"};Ef.defaultTags={"!!":"tag:yaml.org,2002:"};GI.Directives=Ef});var tm=F(Cf=>{"use strict";var KI=Je(),nW=Rf();function iW(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 QI(t){let e=new Set;return nW.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function ZI(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function sW(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=QI(t));let a=ZI(e,i);return i.add(a),a},setAnchors:()=>{for(let s of r){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(KI.isScalar(a.node)||KI.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}}Cf.anchorIsValid=iW;Cf.anchorNames=QI;Cf.createNodeAnchors=sW;Cf.findNewAnchor=ZI});var H0=F(XI=>{"use strict";function Of(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=Of(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=Of(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=Of(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=Of(t,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return t.call(e,r,n)}XI.applyReviver=Of});var Bs=F(tP=>{"use strict";var oW=Je();function eP(t,e,r){if(Array.isArray(t))return t.map((n,i)=>eP(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!oW.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}tP.toJS=eP});var rm=F(nP=>{"use strict";var aW=H0(),rP=Je(),lW=Bs(),B0=class{constructor(e){Object.defineProperty(this,rP.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(!rP.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=lW.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:d}of a.anchors.values())i(d,f);return typeof s=="function"?aW.applyReviver(s,{"":l},"",l):l}};nP.NodeBase=B0});var If=F(iP=>{"use strict";var cW=tm(),uW=Rf(),Kl=Je(),fW=rm(),dW=Bs(),V0=class extends fW.NodeBase{constructor(e){super(Kl.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=[],uW.visit(e,{Node:(s,a)=>{(Kl.isAlias(a)||Kl.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||(dW.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=nm(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(cW.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 nm(t,e,r){if(Kl.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Kl.isCollection(e)){let n=0;for(let i of e.items){let s=nm(t,i,r);s>n&&(n=s)}return n}else if(Kl.isPair(e)){let n=nm(t,e.key,r),i=nm(t,e.value,r);return Math.max(n,i)}return 1}iP.Alias=V0});var Ft=F(W0=>{"use strict";var pW=Je(),hW=rm(),mW=Bs(),gW=t=>!t||typeof t!="function"&&typeof t!="object",Vs=class extends hW.NodeBase{constructor(e){super(pW.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:mW.toJS(this.value,e,r)}toString(){return String(this.value)}};Vs.BLOCK_FOLDED="BLOCK_FOLDED";Vs.BLOCK_LITERAL="BLOCK_LITERAL";Vs.PLAIN="PLAIN";Vs.QUOTE_DOUBLE="QUOTE_DOUBLE";Vs.QUOTE_SINGLE="QUOTE_SINGLE";W0.Scalar=Vs;W0.isScalarValue=gW});var Pf=F(oP=>{"use strict";var yW=If(),ua=Je(),sP=Ft(),vW="tag:yaml.org,2002:";function bW(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 SW(t,e,r){if(ua.isDocument(t)&&(t=t.contents),ua.isNode(t))return t;if(ua.isPair(t)){let g=r.schema[ua.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 yW.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=vW+e.slice(2));let d=bW(t,e,a.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let g=new sP.Scalar(t);return f&&(f.node=g),g}d=t instanceof Map?a[ua.MAP]:Symbol.iterator in Object(t)?a[ua.SEQ]:a[ua.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 sP.Scalar(t);return e?m.tag=e:d.default||(m.tag=d.tag),f&&(f.node=m),m}oP.createNode=SW});var sm=F(im=>{"use strict";var wW=Pf(),wi=Je(),_W=rm();function z0(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 wW.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 aP=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,J0=class extends _W.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=>wi.isNode(n)||wi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(aP(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(wi.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,z0(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(wi.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&&wi.isScalar(s)?s.value:s:wi.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!wi.isPair(r))return!1;let n=r.value;return n==null||e&&wi.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 wi.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(wi.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,z0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};im.Collection=J0;im.collectionFromPath=z0;im.isEmptyPath=aP});var kf=F(om=>{"use strict";var xW=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Y0(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var RW=(t,e,r)=>t.endsWith(`
|
|
91
|
+
`)?Y0(r,e):r.includes(`
|
|
92
92
|
`)?`
|
|
93
|
-
`+
|
|
94
|
-
`)r===
|
|
93
|
+
`+Y0(r,e):(t.endsWith(" ")?"":" ")+r;om.indentComment=Y0;om.lineComment=RW;om.stringifyComment=xW});var cP=F(Tf=>{"use strict";var EW="flow",G0="block",am="quoted";function CW(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,w,R=!1,x=-1,T=-1,q=-1;r===G0&&(x=lP(t,x,e.length),x!==-1&&(g=x+f));for(let V;V=t[x+=1];){if(r===am&&V==="\\"){switch(T=x,t[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}q=x}if(V===`
|
|
94
|
+
`)r===G0&&(x=lP(t,x,e.length)),g=x+e.length+f,y=void 0;else{if(V===" "&&w&&w!==" "&&w!==`
|
|
95
95
|
`&&w!==" "){let B=t[x+1];B&&B!==" "&&B!==`
|
|
96
|
-
`&&B!==" "&&(y=x)}if(x>=g)if(y)d.push(y),g=y+f,y=void 0;else if(r===
|
|
97
|
-
${e}${t.slice(0,K)}`:(r===
|
|
96
|
+
`&&B!==" "&&(y=x)}if(x>=g)if(y)d.push(y),g=y+f,y=void 0;else if(r===am){for(;w===" "||w===" ";)w=V,V=t[x+=1],R=!0;let B=x>q+1?x-2:T-1;if(m[B])return t;d.push(B),m[B]=!0,g=B+f,y=void 0}else R=!0}w=V}if(R&&l&&l(),d.length===0)return t;a&&a();let L=t.slice(0,d[0]);for(let V=0;V<d.length;++V){let B=d[V],K=d[V+1]||t.length;B===0?L=`
|
|
97
|
+
${e}${t.slice(0,K)}`:(r===am&&m[B]&&(L+=`${t[B]}\\`),L+=`
|
|
98
98
|
${e}${t.slice(B+1,K)}`)}return L}function lP(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!==`
|
|
99
|
-
`);n=e,i=e+1,s=t[i]}return n}
|
|
100
|
-
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function
|
|
99
|
+
`);n=e,i=e+1,s=t[i]}return n}Tf.FOLD_BLOCK=G0;Tf.FOLD_FLOW=EW;Tf.FOLD_QUOTED=am;Tf.foldFlowLines=CW});var qf=F(uP=>{"use strict";var Gn=Ft(),Ws=cP(),cm=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),um=t=>/^(%|---|\.\.\.)/m.test(t);function OW(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]===`
|
|
100
|
+
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function Af(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(um(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)+`
|
|
101
101
|
|
|
102
102
|
`;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)a+=`
|
|
103
|
-
`,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:Ws.foldFlowLines(a,s,Ws.FOLD_QUOTED,
|
|
104
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return
|
|
105
|
-
${r}`)+"'";return e.implicitKey?n:Ws.foldFlowLines(n,r,Ws.FOLD_FLOW,
|
|
103
|
+
`,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:Ws.foldFlowLines(a,s,Ws.FOLD_QUOTED,cm(e,!1))}function K0(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
104
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return Af(t,e);let r=e.indent||(um(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
105
|
+
${r}`)+"'";return e.implicitKey?n:Ws.foldFlowLines(n,r,Ws.FOLD_FLOW,cm(e,!1))}function Ql(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=Af;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=K0:s&&!i?n=Af:n=r?K0:Af}return n(t,e)}var Q0;try{Q0=new RegExp(`(^|(?<!
|
|
106
106
|
))
|
|
107
107
|
+(?!
|
|
108
|
-
|$)`,"g")}catch{
|
|
108
|
+
|$)`,"g")}catch{Q0=/\n+(?!\n|$)/g}function lm({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 Ql(r,n);let d=n.indent||(n.forceBlockIndent||um(r)?" ":""),m=a==="literal"?!0:a==="folded"||e===Gn.Scalar.BLOCK_FOLDED?!1:e===Gn.Scalar.BLOCK_LITERAL?!0:!OW(r,f,d.length);if(!r)return m?`|
|
|
109
109
|
`:`>
|
|
110
110
|
`;let g,y;for(y=r.length;y>0;--y){let K=r[y-1];if(K!==`
|
|
111
111
|
`&&K!==" "&&K!==" ")break}let w=r.substring(y),R=w.indexOf(`
|
|
112
112
|
`);R===-1?g="-":r===w||R!==w.length-1?(g="+",s&&s()):g="",w&&(r=r.slice(0,-w.length),w[w.length-1]===`
|
|
113
|
-
`&&(w=w.slice(0,-1)),w=w.replace(
|
|
113
|
+
`&&(w=w.slice(0,-1)),w=w.replace(Q0,`$&${d}`));let x=!1,T,q=-1;for(T=0;T<r.length;++T){let K=r[T];if(K===" ")x=!0;else if(K===`
|
|
114
114
|
`)q=T;else break}let L=r.substring(0,q<T?q+1:T);L&&(r=r.substring(L.length),L=L.replace(/\n+/g,`$&${d}`));let B=(x?d?"2":"1":"")+g;if(t&&(B+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){let K=r.replace(/\n+/g,`
|
|
115
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,k=
|
|
115
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,k=cm(n,!0);a!=="folded"&&e!==Gn.Scalar.BLOCK_FOLDED&&(k.onOverflow=()=>{X=!0});let _=Ws.foldFlowLines(`${L}${K}${w}`,d,Ws.FOLD_BLOCK,k);if(!X)return`>${B}
|
|
116
116
|
${d}${_}`}return r=r.replace(/\n+/g,`$&${d}`),`|${B}
|
|
117
|
-
${d}${L}${r}${w}`}function
|
|
117
|
+
${d}${L}${r}${w}`}function IW(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(`
|
|
118
118
|
`)||m&&/[[\]{},]/.test(s))return Ql(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||m||!s.includes(`
|
|
119
|
-
`)?Ql(s,e):
|
|
120
|
-
`))return
|
|
121
|
-
${f}`);if(a){let y=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(g),{compat:w,tags:R}=e.doc.schema;if(R.some(y)||w?.some(y))return Ql(s,e)}return l?g:Ws.foldFlowLines(g,f,Ws.FOLD_FLOW,
|
|
122
|
-
${e.indent}${l}`:l}
|
|
123
|
-
${l}:`):(T=`${T}:`,y&&(T+=
|
|
119
|
+
`)?Ql(s,e):lm(t,e,r,n);if(!l&&!m&&i!==Gn.Scalar.PLAIN&&s.includes(`
|
|
120
|
+
`))return lm(t,e,r,n);if(um(s)){if(f==="")return e.forceBlockIndent=!0,lm(t,e,r,n);if(l&&f===d)return Ql(s,e)}let g=s.replace(/\n+/g,`$&
|
|
121
|
+
${f}`);if(a){let y=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(g),{compat:w,tags:R}=e.doc.schema;if(R.some(y)||w?.some(y))return Ql(s,e)}return l?g:Ws.foldFlowLines(g,f,Ws.FOLD_FLOW,cm(e,!1))}function PW(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!==Gn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Gn.Scalar.QUOTE_DOUBLE);let f=m=>{switch(m){case Gn.Scalar.BLOCK_FOLDED:case Gn.Scalar.BLOCK_LITERAL:return i||s?Ql(a.value,e):lm(a,e,r,n);case Gn.Scalar.QUOTE_DOUBLE:return Af(a.value,e);case Gn.Scalar.QUOTE_SINGLE:return K0(a.value,e);case Gn.Scalar.PLAIN:return IW(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}uP.stringifyString=PW});var $f=F(Z0=>{"use strict";var kW=tm(),zs=Je(),TW=kf(),AW=qf();function qW(t,e){let r=Object.assign({blockQuote:!0,commentString:TW.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 $W(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(zs.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 MW(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(zs.isScalar(t)||zs.isCollection(t))&&t.anchor;s&&kW.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 NW(t,e,r,n){if(zs.isPair(t))return t.toString(e,r,n);if(zs.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=zs.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=$W(e.doc.schema.tags,s));let a=MW(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):zs.isScalar(s)?AW.stringifyString(s,e,r,n):s.toString(e,r,n);return a?zs.isScalar(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
|
|
122
|
+
${e.indent}${l}`:l}Z0.createStringifyContext=qW;Z0.stringify=NW});var hP=F(pP=>{"use strict";var es=Je(),fP=Ft(),dP=$f(),Mf=kf();function DW({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=es.isNode(t)&&t.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(es.isCollection(t)||!es.isNode(t)&&typeof t=="object"){let k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let w=!g&&(!t||y&&e==null&&!r.inFlow||es.isCollection(t)||(es.isScalar(t)?t.type===fP.Scalar.BLOCK_FOLDED||t.type===fP.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!w&&(g||!s),indent:l+f});let R=!1,x=!1,T=dP.stringify(t,r,()=>R=!0,()=>x=!0);if(!w&&!r.inFlow&&T.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(r.inFlow){if(s||e==null)return R&&n&&n(),T===""?"?":w?`? ${T}`:T}else if(s&&!g||e==null&&w)return T=`? ${T}`,y&&!R?T+=Mf.lineComment(T,r.indent,d(y)):x&&i&&i(),T;R&&(y=null),w?(y&&(T+=Mf.lineComment(T,r.indent,d(y))),T=`? ${T}
|
|
123
|
+
${l}:`):(T=`${T}:`,y&&(T+=Mf.lineComment(T,r.indent,d(y))));let q,L,V;es.isNode(e)?(q=!!e.spaceBefore,L=e.commentBefore,V=e.comment):(q=!1,L=null,V=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!w&&!y&&es.isScalar(e)&&(r.indentAtStart=T.length+1),x=!1,!m&&f.length>=2&&!r.inFlow&&!w&&es.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let B=!1,K=dP.stringify(e,r,()=>B=!0,()=>x=!0),X=" ";if(y||q||L){if(X=q?`
|
|
124
124
|
`:"",L){let k=d(L);X+=`
|
|
125
|
-
${
|
|
125
|
+
${Mf.indentComment(k,r.indent)}`}K===""&&!r.inFlow?X===`
|
|
126
126
|
`&&V&&(X=`
|
|
127
127
|
|
|
128
128
|
`):X+=`
|
|
129
129
|
${r.indent}`}else if(!w&&es.isCollection(e)){let k=K[0],_=K.indexOf(`
|
|
130
130
|
`),P=_!==-1,$=r.inFlow??e.flow??e.items.length===0;if(P||!$){let N=!1;if(P&&(k==="&"||k==="!")){let j=K.indexOf(" ");k==="&"&&j!==-1&&j<_&&K[j+1]==="!"&&(j=K.indexOf(" ",j+1)),(j===-1||_<j)&&(N=!0)}N||(X=`
|
|
131
131
|
${r.indent}`)}}else(K===""||K[0]===`
|
|
132
|
-
`)&&(X="");return T+=X+K,r.inFlow?B&&n&&n():V&&!B?T+=
|
|
132
|
+
`)&&(X="");return T+=X+K,r.inFlow?B&&n&&n():V&&!B?T+=Mf.lineComment(T,r.indent,d(V)):x&&i&&i(),T}pP.stringifyPair=DW});var ew=F(X0=>{"use strict";var mP=nt("process");function FW(t,...e){t==="debug"&&console.log(...e)}function LW(t,e){(t==="debug"||t==="warn")&&(typeof mP.emitWarning=="function"?mP.emitWarning(e):console.warn(e))}X0.debug=FW;X0.warn=LW});var mm=F(hm=>{"use strict";var pm=Je(),gP=Ft(),fm="<<",dm={identify:t=>t===fm||typeof t=="symbol"&&t.description===fm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new gP.Scalar(Symbol(fm)),{addToJSMap:yP}),stringify:()=>fm},jW=(t,e)=>(dm.identify(e)||pm.isScalar(e)&&(!e.type||e.type===gP.Scalar.PLAIN)&&dm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===dm.tag&&r.default);function yP(t,e,r){let n=vP(t,r);if(pm.isSeq(n))for(let i of n.items)tw(t,e,i);else if(Array.isArray(n))for(let i of n)tw(t,e,i);else tw(t,e,n)}function tw(t,e,r){let n=vP(t,r);if(!pm.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 vP(t,e){return t&&pm.isAlias(e)?e.resolve(t.doc,t):e}hm.addMergeToJSMap=yP;hm.isMergeKey=jW;hm.merge=dm});var nw=F(wP=>{"use strict";var UW=ew(),bP=mm(),HW=$f(),SP=Je(),rw=Bs();function BW(t,e,{key:r,value:n}){if(SP.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(bP.isMergeKey(t,r))bP.addMergeToJSMap(t,e,n);else{let i=rw.toJS(r,"",t);if(e instanceof Map)e.set(i,rw.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=VW(r,i,t),a=rw.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 VW(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(SP.isNode(t)&&r?.doc){let n=HW.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)+'..."'),UW.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)}wP.addPairToJSMap=BW});var Js=F(iw=>{"use strict";var _P=Pf(),WW=hP(),zW=nw(),gm=Je();function JW(t,e,r){let n=_P.createNode(t,void 0,r),i=_P.createNode(e,void 0,r);return new ym(n,i)}var ym=class t{constructor(e,r=null){Object.defineProperty(this,gm.NODE_TYPE,{value:gm.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return gm.isNode(r)&&(r=r.clone(e)),gm.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return zW.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?WW.stringifyPair(this,e,r,n):JSON.stringify(this)}};iw.Pair=ym;iw.createPair=JW});var sw=F(RP=>{"use strict";var fa=Je(),xP=$f(),vm=kf();function YW(t,e,r){return(e.inFlow??t.flow?KW:GW)(t,e,r)}function GW({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 R=0;R<e.length;++R){let x=e[R],T=null;if(fa.isNode(x))!g&&x.spaceBefore&&y.push(""),bm(r,y,x.commentBefore,g),x.comment&&(T=x.comment);else if(fa.isPair(x)){let L=fa.isNode(x.key)?x.key:null;L&&(!g&&L.spaceBefore&&y.push(""),bm(r,y,L.commentBefore,g))}g=!1;let q=xP.stringify(x,m,()=>T=null,()=>g=!0);T&&(q+=vm.lineComment(q,s,d(T))),g&&T&&(g=!1),y.push(n+q)}let w;if(y.length===0)w=i.start+i.end;else{w=y[0];for(let R=1;R<y.length;++R){let x=y[R];w+=x?`
|
|
133
133
|
${f}${x}`:`
|
|
134
134
|
`}}return t?(w+=`
|
|
135
|
-
`+
|
|
136
|
-
`)),R<t.length-1?q+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((L,V)=>L+V.length+2,2)+(q.length+2)>e.options.lineWidth)),d&&(q+=",")),T&&(q+=
|
|
135
|
+
`+vm.indentComment(d(t),f),l&&l()):g&&a&&a(),w}function KW({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 R=0;R<t.length;++R){let x=t[R],T=null;if(fa.isNode(x))x.spaceBefore&&g.push(""),bm(e,g,x.commentBefore,!1),x.comment&&(T=x.comment);else if(fa.isPair(x)){let L=fa.isNode(x.key)?x.key:null;L&&(L.spaceBefore&&g.push(""),bm(e,g,L.commentBefore,!1),L.comment&&(d=!0));let V=fa.isNode(x.value)?x.value:null;V?(V.comment&&(T=V.comment),V.commentBefore&&(d=!0)):x.value==null&&L?.comment&&(T=L.comment)}T&&(d=!0);let q=xP.stringify(x,f,()=>T=null);d||(d=g.length>m||q.includes(`
|
|
136
|
+
`)),R<t.length-1?q+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((L,V)=>L+V.length+2,2)+(q.length+2)>e.options.lineWidth)),d&&(q+=",")),T&&(q+=vm.lineComment(q,n,l(T))),g.push(q),m=g.length}let{start:y,end:w}=r;if(g.length===0)return y+w;if(!d){let R=g.reduce((x,T)=>x+T.length+2,2);d=e.options.lineWidth>0&&R>e.options.lineWidth}if(d){let R=y;for(let x of g)R+=x?`
|
|
137
137
|
${s}${i}${x}`:`
|
|
138
138
|
`;return`${R}
|
|
139
|
-
${i}${w}`}else return`${y}${a}${g.join(" ")}${a}${w}`}function
|
|
140
|
-
`:" ")}return
|
|
139
|
+
${i}${w}`}else return`${y}${a}${g.join(" ")}${a}${w}`}function bm({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=vm.indentComment(e(n),t);r.push(s.trimStart())}}RP.stringifyCollection=YW});var Gs=F(aw=>{"use strict";var QW=sw(),ZW=nw(),XW=sm(),Ys=Je(),Sm=Js(),ez=Ft();function Nf(t,e){let r=Ys.isScalar(e)?e.value:e;for(let n of t)if(Ys.isPair(n)&&(n.key===e||n.key===r||Ys.isScalar(n.key)&&n.key.value===r))return n}var ow=class extends XW.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ys.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(Sm.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;Ys.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Sm.Pair(e,e?.value):n=new Sm.Pair(e.key,e.value);let i=Nf(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Ys.isScalar(i.value)&&ez.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=Nf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Nf(this.items,e)?.value;return(!r&&Ys.isScalar(i)?i.value:i)??void 0}has(e){return!!Nf(this.items,e)}set(e,r){this.add(new Sm.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)ZW.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Ys.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})),QW.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};aw.YAMLMap=ow;aw.findPair=Nf});var Zl=F(CP=>{"use strict";var tz=Je(),EP=Gs(),rz={collection:"map",default:!0,nodeClass:EP.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return tz.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>EP.YAMLMap.from(t,e,r)};CP.map=rz});var Ks=F(OP=>{"use strict";var nz=Pf(),iz=sw(),sz=sm(),_m=Je(),oz=Ft(),az=Bs(),lw=class extends sz.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(_m.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=wm(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=wm(e);if(typeof n!="number")return;let i=this.items[n];return!r&&_m.isScalar(i)?i.value:i}has(e){let r=wm(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=wm(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];_m.isScalar(i)&&oz.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(az.toJS(s,String(i++),r));return n}toString(e,r,n){return e?iz.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(nz.createNode(l,void 0,n))}}return s}};function wm(t){let e=_m.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}OP.YAMLSeq=lw});var Xl=F(PP=>{"use strict";var lz=Je(),IP=Ks(),cz={collection:"seq",default:!0,nodeClass:IP.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return lz.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>IP.YAMLSeq.from(t,e,r)};PP.seq=cz});var Df=F(kP=>{"use strict";var uz=qf(),fz={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),uz.stringifyString(t,e,r,n)}};kP.string=fz});var xm=F(qP=>{"use strict";var TP=Ft(),AP={identify:t=>t==null,createNode:()=>new TP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new TP.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&AP.test.test(t)?t:e.options.nullStr};qP.nullTag=AP});var cw=F(MP=>{"use strict";var dz=Ft(),$P={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new dz.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&$P.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};MP.boolTag=$P});var ec=F(NP=>{"use strict";function pz({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}NP.stringifyNumber=pz});var fw=F(Rm=>{"use strict";var hz=Ft(),uw=ec(),mz={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:uw.stringifyNumber},gz={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():uw.stringifyNumber(t)}},yz={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 hz.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:uw.stringifyNumber};Rm.float=yz;Rm.floatExp=gz;Rm.floatNaN=mz});var pw=F(Cm=>{"use strict";var DP=ec(),Em=t=>typeof t=="bigint"||Number.isInteger(t),dw=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function FP(t,e,r){let{value:n}=t;return Em(n)&&n>=0?r+n.toString(e):DP.stringifyNumber(t)}var vz={identify:t=>Em(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>dw(t,2,8,r),stringify:t=>FP(t,8,"0o")},bz={identify:Em,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>dw(t,0,10,r),stringify:DP.stringifyNumber},Sz={identify:t=>Em(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>dw(t,2,16,r),stringify:t=>FP(t,16,"0x")};Cm.int=bz;Cm.intHex=Sz;Cm.intOct=vz});var jP=F(LP=>{"use strict";var wz=Zl(),_z=xm(),xz=Xl(),Rz=Df(),Ez=cw(),hw=fw(),mw=pw(),Cz=[wz.map,xz.seq,Rz.string,_z.nullTag,Ez.boolTag,mw.intOct,mw.int,mw.intHex,hw.floatNaN,hw.floatExp,hw.float];LP.schema=Cz});var BP=F(HP=>{"use strict";var Oz=Ft(),Iz=Zl(),Pz=Xl();function UP(t){return typeof t=="bigint"||Number.isInteger(t)}var Om=({value:t})=>JSON.stringify(t),kz=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Om},{identify:t=>t==null,createNode:()=>new Oz.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Om},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Om},{identify:UP,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})=>UP(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:Om}],Tz={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Az=[Iz.map,Pz.seq].concat(kz,Tz);HP.schema=Az});var yw=F(VP=>{"use strict";var Ff=nt("buffer"),gw=Ft(),qz=qf(),$z={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Ff.Buffer=="function")return Ff.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 Ff.Buffer=="function")l=a instanceof Ff.Buffer?a.toString("base64"):Ff.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=gw.Scalar.BLOCK_LITERAL),e!==gw.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===gw.Scalar.BLOCK_LITERAL?`
|
|
140
|
+
`:" ")}return qz.stringifyString({comment:t,type:e,value:l},n,i,s)}};VP.binary=$z});var km=F(Pm=>{"use strict";var Im=Je(),vw=Js(),Mz=Ft(),Nz=Ks();function WP(t,e){if(Im.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Im.isPair(n)){if(Im.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new vw.Pair(new Mz.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
141
141
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
142
|
-
${s.comment}`:n.comment}n=i}t.items[r]=Em.isPair(n)?n:new gw.Pair(n)}}else e("Expected a sequence for this tag");return t}function zP(t,e,r){let{replacer:n}=r,i=new $z.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(gw.createPair(l,f,r))}return i}var Mz={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:WP,createNode:zP};Cm.createPairs=zP;Cm.pairs=Mz;Cm.resolvePairs=WP});var bw=F(vw=>{"use strict";var JP=Je(),yw=Bs(),Df=Gs(),Nz=Ks(),YP=Om(),da=class t extends Nz.YAMLSeq{constructor(){super(),this.add=Df.YAMLMap.prototype.add.bind(this),this.delete=Df.YAMLMap.prototype.delete.bind(this),this.get=Df.YAMLMap.prototype.get.bind(this),this.has=Df.YAMLMap.prototype.has.bind(this),this.set=Df.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(JP.isPair(i)?(s=yw.toJS(i.key,"",r),a=yw.toJS(i.value,s,r)):s=yw.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=YP.createPairs(e,r,n),s=new this;return s.items=i.items,s}};da.tag="tag:yaml.org,2002:omap";var Dz={collection:"seq",identify:t=>t instanceof Map,nodeClass:da,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=YP.resolvePairs(t,e),n=[];for(let{key:i}of r.items)JP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new da,r)},createNode:(t,e,r)=>da.from(t,e,r)};vw.YAMLOMap=da;vw.omap=Dz});var XP=F(Sw=>{"use strict";var GP=Ft();function KP({value:t,source:e},r){return e&&(t?QP:ZP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var QP={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 GP.Scalar(!0),stringify:KP},ZP={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 GP.Scalar(!1),stringify:KP};Sw.falseTag=ZP;Sw.trueTag=QP});var ek=F(Im=>{"use strict";var Fz=Ft(),ww=ec(),Lz={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:ww.stringifyNumber},jz={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():ww.stringifyNumber(t)}},Uz={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 Fz.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:ww.stringifyNumber};Im.float=Uz;Im.floatExp=jz;Im.floatNaN=Lz});var rk=F(Lf=>{"use strict";var tk=ec(),Ff=t=>typeof t=="bigint"||Number.isInteger(t);function Pm(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 _w(t,e,r){let{value:n}=t;if(Ff(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return tk.stringifyNumber(t)}var Hz={identify:Ff,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Pm(t,2,2,r),stringify:t=>_w(t,2,"0b")},Bz={identify:Ff,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Pm(t,1,8,r),stringify:t=>_w(t,8,"0")},Vz={identify:Ff,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Pm(t,0,10,r),stringify:tk.stringifyNumber},Wz={identify:Ff,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Pm(t,2,16,r),stringify:t=>_w(t,16,"0x")};Lf.int=Vz;Lf.intBin=Hz;Lf.intHex=Wz;Lf.intOct=Bz});var Rw=F(xw=>{"use strict";var Am=Je(),km=Js(),Tm=Gs(),pa=class t extends Tm.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Am.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new km.Pair(e.key,null):r=new km.Pair(e,null),Tm.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Tm.findPair(this.items,e);return!r&&Am.isPair(n)?Am.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=Tm.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new km.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(km.createPair(a,null,n));return s}};pa.tag="tag:yaml.org,2002:set";var zz={collection:"map",identify:t=>t instanceof Set,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>pa.from(t,e,r),resolve(t,e){if(Am.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new pa,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};xw.YAMLSet=pa;xw.set=zz});var Cw=F(qm=>{"use strict";var Jz=ec();function Ew(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 nk(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Jz.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 Yz={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})=>Ew(t,r),stringify:nk},Gz={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=>Ew(t,!1),stringify:nk},ik={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(ik.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=Ew(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$/,"")??""};qm.floatTime=Gz;qm.intTime=Yz;qm.timestamp=ik});var ak=F(ok=>{"use strict";var Kz=Zl(),Qz=Sm(),Zz=Xl(),Xz=Mf(),eJ=mw(),sk=XP(),Ow=ek(),$m=rk(),tJ=dm(),rJ=bw(),nJ=Om(),iJ=Rw(),Iw=Cw(),sJ=[Kz.map,Zz.seq,Xz.string,Qz.nullTag,sk.trueTag,sk.falseTag,$m.intBin,$m.intOct,$m.int,$m.intHex,Ow.floatNaN,Ow.floatExp,Ow.float,eJ.binary,tJ.merge,rJ.omap,nJ.pairs,iJ.set,Iw.intTime,Iw.floatTime,Iw.timestamp];ok.schema=sJ});var yk=F(Tw=>{"use strict";var fk=Zl(),oJ=Sm(),dk=Xl(),aJ=Mf(),lJ=aw(),Pw=cw(),kw=fw(),cJ=jP(),uJ=BP(),pk=mw(),jf=dm(),hk=bw(),mk=Om(),lk=ak(),gk=Rw(),Mm=Cw(),ck=new Map([["core",cJ.schema],["failsafe",[fk.map,dk.seq,aJ.string]],["json",uJ.schema],["yaml11",lk.schema],["yaml-1.1",lk.schema]]),uk={binary:pk.binary,bool:lJ.boolTag,float:Pw.float,floatExp:Pw.floatExp,floatNaN:Pw.floatNaN,floatTime:Mm.floatTime,int:kw.int,intHex:kw.intHex,intOct:kw.intOct,intTime:Mm.intTime,map:fk.map,merge:jf.merge,null:oJ.nullTag,omap:hk.omap,pairs:mk.pairs,seq:dk.seq,set:gk.set,timestamp:Mm.timestamp},fJ={"tag:yaml.org,2002:binary":pk.binary,"tag:yaml.org,2002:merge":jf.merge,"tag:yaml.org,2002:omap":hk.omap,"tag:yaml.org,2002:pairs":mk.pairs,"tag:yaml.org,2002:set":gk.set,"tag:yaml.org,2002:timestamp":Mm.timestamp};function dJ(t,e,r){let n=ck.get(e);if(n&&!t)return r&&!n.includes(jf.merge)?n.concat(jf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(ck.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(jf.merge)),i.reduce((s,a)=>{let l=typeof a=="string"?uk[a]:a;if(!l){let f=JSON.stringify(a),d=Object.keys(uk).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},[])}Tw.coreKnownTags=fJ;Tw.getTags=dJ});var $w=F(vk=>{"use strict";var Aw=Je(),pJ=Zl(),hJ=Xl(),mJ=Mf(),Nm=yk(),gJ=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,qw=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Nm.getTags(e,"compat"):e?Nm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Nm.coreKnownTags:{},this.tags=Nm.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Aw.MAP,{value:pJ.map}),Object.defineProperty(this,Aw.SCALAR,{value:mJ.string}),Object.defineProperty(this,Aw.SEQ,{value:hJ.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?gJ:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};vk.Schema=qw});var Sk=F(bk=>{"use strict";var yJ=Je(),Mw=Af(),Uf=If();function vJ(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=Mw.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Uf.indentComment(f,""))}let a=!1,l=null;if(t.contents){if(yJ.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let m=s(t.contents.commentBefore);r.push(Uf.indentComment(m,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>a=!0,d=Mw.stringify(t.contents,i,()=>l=null,f);l&&(d+=Uf.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Mw.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
143
|
-
`)?(r.push("..."),r.push(
|
|
142
|
+
${s.comment}`:n.comment}n=i}t.items[r]=Im.isPair(n)?n:new vw.Pair(n)}}else e("Expected a sequence for this tag");return t}function zP(t,e,r){let{replacer:n}=r,i=new Nz.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(vw.createPair(l,f,r))}return i}var Dz={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:WP,createNode:zP};Pm.createPairs=zP;Pm.pairs=Dz;Pm.resolvePairs=WP});var ww=F(Sw=>{"use strict";var JP=Je(),bw=Bs(),Lf=Gs(),Fz=Ks(),YP=km(),da=class t extends Fz.YAMLSeq{constructor(){super(),this.add=Lf.YAMLMap.prototype.add.bind(this),this.delete=Lf.YAMLMap.prototype.delete.bind(this),this.get=Lf.YAMLMap.prototype.get.bind(this),this.has=Lf.YAMLMap.prototype.has.bind(this),this.set=Lf.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(JP.isPair(i)?(s=bw.toJS(i.key,"",r),a=bw.toJS(i.value,s,r)):s=bw.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=YP.createPairs(e,r,n),s=new this;return s.items=i.items,s}};da.tag="tag:yaml.org,2002:omap";var Lz={collection:"seq",identify:t=>t instanceof Map,nodeClass:da,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=YP.resolvePairs(t,e),n=[];for(let{key:i}of r.items)JP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new da,r)},createNode:(t,e,r)=>da.from(t,e,r)};Sw.YAMLOMap=da;Sw.omap=Lz});var XP=F(_w=>{"use strict";var GP=Ft();function KP({value:t,source:e},r){return e&&(t?QP:ZP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var QP={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 GP.Scalar(!0),stringify:KP},ZP={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 GP.Scalar(!1),stringify:KP};_w.falseTag=ZP;_w.trueTag=QP});var ek=F(Tm=>{"use strict";var jz=Ft(),xw=ec(),Uz={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:xw.stringifyNumber},Hz={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():xw.stringifyNumber(t)}},Bz={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 jz.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:xw.stringifyNumber};Tm.float=Bz;Tm.floatExp=Hz;Tm.floatNaN=Uz});var rk=F(Uf=>{"use strict";var tk=ec(),jf=t=>typeof t=="bigint"||Number.isInteger(t);function Am(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 Rw(t,e,r){let{value:n}=t;if(jf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return tk.stringifyNumber(t)}var Vz={identify:jf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Am(t,2,2,r),stringify:t=>Rw(t,2,"0b")},Wz={identify:jf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Am(t,1,8,r),stringify:t=>Rw(t,8,"0")},zz={identify:jf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Am(t,0,10,r),stringify:tk.stringifyNumber},Jz={identify:jf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Am(t,2,16,r),stringify:t=>Rw(t,16,"0x")};Uf.int=zz;Uf.intBin=Vz;Uf.intHex=Jz;Uf.intOct=Wz});var Cw=F(Ew=>{"use strict";var Mm=Je(),qm=Js(),$m=Gs(),pa=class t extends $m.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Mm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new qm.Pair(e.key,null):r=new qm.Pair(e,null),$m.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=$m.findPair(this.items,e);return!r&&Mm.isPair(n)?Mm.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=$m.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new qm.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(qm.createPair(a,null,n));return s}};pa.tag="tag:yaml.org,2002:set";var Yz={collection:"map",identify:t=>t instanceof Set,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>pa.from(t,e,r),resolve(t,e){if(Mm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new pa,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Ew.YAMLSet=pa;Ew.set=Yz});var Iw=F(Nm=>{"use strict";var Gz=ec();function Ow(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 nk(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Gz.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 Kz={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})=>Ow(t,r),stringify:nk},Qz={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=>Ow(t,!1),stringify:nk},ik={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(ik.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=Ow(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$/,"")??""};Nm.floatTime=Qz;Nm.intTime=Kz;Nm.timestamp=ik});var ak=F(ok=>{"use strict";var Zz=Zl(),Xz=xm(),eJ=Xl(),tJ=Df(),rJ=yw(),sk=XP(),Pw=ek(),Dm=rk(),nJ=mm(),iJ=ww(),sJ=km(),oJ=Cw(),kw=Iw(),aJ=[Zz.map,eJ.seq,tJ.string,Xz.nullTag,sk.trueTag,sk.falseTag,Dm.intBin,Dm.intOct,Dm.int,Dm.intHex,Pw.floatNaN,Pw.floatExp,Pw.float,rJ.binary,nJ.merge,iJ.omap,sJ.pairs,oJ.set,kw.intTime,kw.floatTime,kw.timestamp];ok.schema=aJ});var yk=F(qw=>{"use strict";var fk=Zl(),lJ=xm(),dk=Xl(),cJ=Df(),uJ=cw(),Tw=fw(),Aw=pw(),fJ=jP(),dJ=BP(),pk=yw(),Hf=mm(),hk=ww(),mk=km(),lk=ak(),gk=Cw(),Fm=Iw(),ck=new Map([["core",fJ.schema],["failsafe",[fk.map,dk.seq,cJ.string]],["json",dJ.schema],["yaml11",lk.schema],["yaml-1.1",lk.schema]]),uk={binary:pk.binary,bool:uJ.boolTag,float:Tw.float,floatExp:Tw.floatExp,floatNaN:Tw.floatNaN,floatTime:Fm.floatTime,int:Aw.int,intHex:Aw.intHex,intOct:Aw.intOct,intTime:Fm.intTime,map:fk.map,merge:Hf.merge,null:lJ.nullTag,omap:hk.omap,pairs:mk.pairs,seq:dk.seq,set:gk.set,timestamp:Fm.timestamp},pJ={"tag:yaml.org,2002:binary":pk.binary,"tag:yaml.org,2002:merge":Hf.merge,"tag:yaml.org,2002:omap":hk.omap,"tag:yaml.org,2002:pairs":mk.pairs,"tag:yaml.org,2002:set":gk.set,"tag:yaml.org,2002:timestamp":Fm.timestamp};function hJ(t,e,r){let n=ck.get(e);if(n&&!t)return r&&!n.includes(Hf.merge)?n.concat(Hf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(ck.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(Hf.merge)),i.reduce((s,a)=>{let l=typeof a=="string"?uk[a]:a;if(!l){let f=JSON.stringify(a),d=Object.keys(uk).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},[])}qw.coreKnownTags=pJ;qw.getTags=hJ});var Nw=F(vk=>{"use strict";var $w=Je(),mJ=Zl(),gJ=Xl(),yJ=Df(),Lm=yk(),vJ=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Mw=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Lm.getTags(e,"compat"):e?Lm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Lm.coreKnownTags:{},this.tags=Lm.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,$w.MAP,{value:mJ.map}),Object.defineProperty(this,$w.SCALAR,{value:yJ.string}),Object.defineProperty(this,$w.SEQ,{value:gJ.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?vJ:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};vk.Schema=Mw});var Sk=F(bk=>{"use strict";var bJ=Je(),Dw=$f(),Bf=kf();function SJ(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=Dw.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Bf.indentComment(f,""))}let a=!1,l=null;if(t.contents){if(bJ.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let m=s(t.contents.commentBefore);r.push(Bf.indentComment(m,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>a=!0,d=Dw.stringify(t.contents,i,()=>l=null,f);l&&(d+=Bf.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Dw.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
143
|
+
`)?(r.push("..."),r.push(Bf.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(Bf.indentComment(s(f),"")))}return r.join(`
|
|
144
144
|
`)+`
|
|
145
|
-
`}bk.stringifyDocument=
|
|
145
|
+
`}bk.stringifyDocument=SJ});var Vf=F(wk=>{"use strict";var wJ=If(),tc=sm(),_n=Je(),_J=Js(),xJ=Bs(),RJ=Nw(),EJ=Sk(),Fw=tm(),CJ=H0(),OJ=Pf(),Lw=U0(),jw=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_n.NODE_TYPE,{value:_n.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 Lw.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,{[_n.NODE_TYPE]:{value:_n.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=_n.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){rc(this.contents)&&this.contents.add(e)}addIn(e,r){rc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Fw.anchorNames(this);e.anchor=!r||n.has(r)?Fw.findNewAnchor(r||"a",n):r}return new wJ.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 T=L=>typeof L=="number"||L instanceof String||L instanceof Number,q=r.filter(T).map(String);q.length>0&&(r=r.concat(q)),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:w}=Fw.createNodeAnchors(this,a||"a"),R={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:w},x=OJ.createNode(e,m,R);return l&&_n.isCollection(x)&&(x.flow=!0),y(),x}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new _J.Pair(i,s)}delete(e){return rc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return tc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):rc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return _n.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return tc.isEmptyPath(e)?!r&&_n.isScalar(this.contents)?this.contents.value:this.contents:_n.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return _n.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return tc.isEmptyPath(e)?this.contents!==void 0:_n.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=tc.collectionFromPath(this.schema,[e],r):rc(this.contents)&&this.contents.set(e,r)}setIn(e,r){tc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=tc.collectionFromPath(this.schema,Array.from(e),r):rc(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 Lw.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 Lw.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 RJ.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=xJ.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"?CJ.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 EJ.stringifyDocument(this,e)}};function rc(t){if(_n.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}wk.Document=jw});var Jf=F(zf=>{"use strict";var Wf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},Uw=class extends Wf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Hw=class extends Wf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},IJ=(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
|
|
146
146
|
`),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+=`:
|
|
147
147
|
|
|
148
148
|
${a}
|
|
149
149
|
${d}
|
|
150
|
-
`}};
|
|
151
|
-
`))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(
|
|
152
|
-
`+x.comment:l.comment=x.comment);continue}(x.newlineAfterProp
|
|
153
|
-
`+V.comment:L.comment=V.comment);let B=new Ok.Pair(L);r.options.keepSourceTokens&&(B.srcToken=m),l.items.push(B)}}return d&&d<f&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,d??f],l}Tk.resolveBlockMap
|
|
154
|
-
`+X.comment:d.comment=X.comment),g=X.end;continue}!a&&r.options.strict&&
|
|
155
|
-
`+k:_.comment=k,X.comment=X.comment.substring(k.length+1)}}if(!a&&!B&&!X.found){let k=K?t(r,K,X,i):e(r,X.end,B,null,X,i);d.items.push(k),g=k.range[2],
|
|
156
|
-
`+P.comment:_.comment=P.comment);let N=new
|
|
157
|
-
`+T.comment:d.comment=T.comment),d.range=[n.offset,x,T.offset]}else d.range=[n.offset,x,x];return d}Fk.resolveFlowCollection=
|
|
150
|
+
`}};zf.YAMLError=Wf;zf.YAMLParseError=Uw;zf.YAMLWarning=Hw;zf.prettifyError=IJ});var Yf=F(_k=>{"use strict";function PJ(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:l}){let f=!1,d=l,m=l,g="",y="",w=!1,R=!1,x=null,T=null,q=null,L=null,V=null,B=null,K=null;for(let _ of t)switch(R&&(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma"&&s(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),R=!1),x&&(d&&_.type!=="comment"&&_.type!=="newline"&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),_.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&_.source.includes(" ")&&(x=_),m=!0;break;case"comment":{m||s(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=_.source.substring(1)||" ";g?g+=y+P:g=P,y="",d=!1;break}case"newline":d?g?g+=_.source:(!B||r!=="seq-item-ind")&&(f=!0):y+=_.source,d=!0,w=!0,(T||q)&&(L=_),m=!0;break;case"anchor":T&&s(_,"MULTIPLE_ANCHORS","A node can have at most one anchor"),_.source.endsWith(":")&&s(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=_,K??(K=_.offset),d=!1,m=!1,R=!0;break;case"tag":{q&&s(_,"MULTIPLE_TAGS","A node can have at most one tag"),q=_,K??(K=_.offset),d=!1,m=!1,R=!0;break}case r:(T||q)&&s(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`),B&&s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${e??"collection"}`),B=_,d=r==="seq-item-ind"||r==="explicit-key-ind",m=!1;break;case"comma":if(e){V&&s(_,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),V=_,d=!1,m=!1;break}default:s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),d=!1,m=!1}let X=t[t.length-1],k=X?X.offset+X.source.length:i;return R&&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"),x&&(d&&x.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:V,found:B,spaceBefore:f,comment:g,hasNewline:w,anchor:T,tag:q,newlineAfterProp:L,end:k,start:K??k}}_k.resolveProps=PJ});var jm=F(xk=>{"use strict";function Bw(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
151
|
+
`))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(Bw(e.key)||Bw(e.value))return!0}return!1;default:return!0}}xk.containsNewline=Bw});var Vw=F(Rk=>{"use strict";var kJ=jm();function TJ(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&kJ.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rk.flowIndentCheck=TJ});var Ww=F(Ck=>{"use strict";var Ek=Je();function AJ(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||Ek.isScalar(s)&&Ek.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,r))}Ck.mapIncludes=AJ});var Ak=F(Tk=>{"use strict";var Ok=Js(),qJ=Gs(),Ik=Yf(),$J=jm(),Pk=Vw(),MJ=Ww(),kk="All mapping items must start at the same column";function NJ({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??qJ.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:w,value:R}=m,x=Ik.resolveProps(g,{indicator:"explicit-key-ind",next:y??w?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),T=!x.found;if(T){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",kk)),!x.anchor&&!x.tag&&!w){d=x.end,x.comment&&(l.comment?l.comment+=`
|
|
152
|
+
`+x.comment:l.comment=x.comment);continue}(x.newlineAfterProp||$J.containsNewline(y))&&i(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==n.indent&&i(f,"BAD_INDENT",kk);r.atKey=!0;let q=x.end,L=y?t(r,y,x,i):e(r,q,g,null,x,i);r.schema.compat&&Pk.flowIndentCheck(n.indent,y,i),r.atKey=!1,MJ.mapIncludes(r,l.items,L)&&i(q,"DUPLICATE_KEY","Map keys must be unique");let V=Ik.resolveProps(w??[],{indicator:"map-value-ind",next:R,offset:L.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(f=V.end,V.found){T&&(R?.type==="block-map"&&!V.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&x.start<V.found.offset-1024&&i(L.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let B=R?t(r,R,V,i):e(r,f,w,null,V,i);r.schema.compat&&Pk.flowIndentCheck(n.indent,R,i),f=B.range[2];let K=new Ok.Pair(L,B);r.options.keepSourceTokens&&(K.srcToken=m),l.items.push(K)}else{T&&i(L.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),V.comment&&(L.comment?L.comment+=`
|
|
153
|
+
`+V.comment:L.comment=V.comment);let B=new Ok.Pair(L);r.options.keepSourceTokens&&(B.srcToken=m),l.items.push(B)}}return d&&d<f&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,d??f],l}Tk.resolveBlockMap=NJ});var $k=F(qk=>{"use strict";var DJ=Ks(),FJ=Yf(),LJ=Vw();function jJ({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??DJ.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=FJ.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 w=g?t(r,g,y,i):e(r,y.end,m,null,y,i);r.schema.compat&&LJ.flowIndentCheck(n.indent,g,i),f=w.range[2],l.items.push(w)}return l.range=[n.offset,f,d??f],l}qk.resolveBlockSeq=jJ});var nc=F(Mk=>{"use strict";function UJ(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}}Mk.resolveEnd=UJ});var Lk=F(Fk=>{"use strict";var HJ=Je(),BJ=Js(),Nk=Gs(),VJ=Ks(),WJ=nc(),Dk=Yf(),zJ=jm(),JJ=Ww(),zw="Block collections are not allowed within flow collections",Jw=t=>t&&(t.type==="block-map"||t.type==="block-seq");function YJ({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=n.start.source==="{",l=a?"flow map":"flow sequence",f=s?.nodeClass??(a?Nk.YAMLMap:VJ.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 T=0;T<n.items.length;++T){let q=n.items[T],{start:L,key:V,sep:B,value:K}=q,X=Dk.resolveProps(L,{flow:l,indicator:"explicit-key-ind",next:V??B?.[0],offset:g,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!B&&!K){T===0&&X.comma?i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):T<n.items.length-1&&i(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),X.comment&&(d.comment?d.comment+=`
|
|
154
|
+
`+X.comment:d.comment=X.comment),g=X.end;continue}!a&&r.options.strict&&zJ.containsNewline(V)&&i(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===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 k="";e:for(let _ of L)switch(_.type){case"comma":case"space":break;case"comment":k=_.source.substring(1);break e;default:break e}if(k){let _=d.items[d.items.length-1];HJ.isPair(_)&&(_=_.value??_.key),_.comment?_.comment+=`
|
|
155
|
+
`+k:_.comment=k,X.comment=X.comment.substring(k.length+1)}}if(!a&&!B&&!X.found){let k=K?t(r,K,X,i):e(r,X.end,B,null,X,i);d.items.push(k),g=k.range[2],Jw(K)&&i(k.range,"BLOCK_IN_FLOW",zw)}else{r.atKey=!0;let k=X.end,_=V?t(r,V,X,i):e(r,k,L,null,X,i);Jw(V)&&i(_.range,"BLOCK_IN_FLOW",zw),r.atKey=!1;let P=Dk.resolveProps(B??[],{flow:l,indicator:"map-value-ind",next:K,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(P.found){if(!a&&!X.found&&r.options.strict){if(B)for(let j of B){if(j===P.found)break;if(j.type==="newline"){i(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<P.found.offset-1024&&i(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else K&&("source"in K&&K.source?.[0]===":"?i(K,"MISSING_CHAR",`Missing space after : in ${l}`):i(P.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let $=K?t(r,K,P,i):P.found?e(r,P.end,B,null,P,i):null;$?Jw(K)&&i($.range,"BLOCK_IN_FLOW",zw):P.comment&&(_.comment?_.comment+=`
|
|
156
|
+
`+P.comment:_.comment=P.comment);let N=new BJ.Pair(_,$);if(r.options.keepSourceTokens&&(N.srcToken=q),a){let j=d;JJ.mapIncludes(r,j.items,_)&&i(k,"DUPLICATE_KEY","Map keys must be unique"),j.items.push(N)}else{let j=new Nk.YAMLMap(r.schema);j.flow=!0,j.items.push(N);let Y=($??_).range;j.range=[_.range[0],Y[1],Y[2]],d.items.push(j)}g=$?$.range[2]:P.end}}let y=a?"}":"]",[w,...R]=n.end,x=g;if(w?.source===y)x=w.offset+w.source.length;else{let T=l[0].toUpperCase()+l.substring(1),q=m?`${T} must end with a ${y}`:`${T} in block collection must be sufficiently indented and end with a ${y}`;i(g,m?"MISSING_CHAR":"BAD_INDENT",q),w&&w.source.length!==1&&R.unshift(w)}if(R.length>0){let T=WJ.resolveEnd(R,x,r.options.strict,i);T.comment&&(d.comment?d.comment+=`
|
|
157
|
+
`+T.comment:d.comment=T.comment),d.range=[n.offset,x,T.offset]}else d.range=[n.offset,x,x];return d}Fk.resolveFlowCollection=YJ});var Uk=F(jk=>{"use strict";var GJ=Je(),KJ=Ft(),QJ=Gs(),ZJ=Ks(),XJ=Ak(),eY=$k(),tY=Lk();function Yw(t,e,r,n,i,s){let a=r.type==="block-map"?XJ.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?eY.resolveBlockSeq(t,e,r,n,s):tY.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 rY(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:w}=n,R=y&&s?y.offset>s.offset?y:s:y??s;R&&(!w||w.offset<R.offset)&&i(R,"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===QJ.YAMLMap.tagName&&l==="map"||a===ZJ.YAMLSeq.tagName&&l==="seq")return Yw(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),Yw(t,e,r,i,a)}let d=Yw(t,e,r,i,a,f),m=f.resolve?.(d,y=>i(s,"TAG_RESOLVE_FAILED",y),e.options)??d,g=GJ.isNode(m)?m:new KJ.Scalar(m);return g.range=d.range,g.tag=a,f?.format&&(g.format=f.format),g}jk.composeCollection=rY});var Kw=F(Hk=>{"use strict";var Gw=Ft();function nY(t,e,r){let n=e.offset,i=iY(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?Gw.Scalar.BLOCK_FOLDED:Gw.Scalar.BLOCK_LITERAL,a=e.source?sY(e.source):[],l=a.length;for(let x=a.length-1;x>=0;--x){let T=a[x][1];if(T===""||T==="\r")l=x;else break}if(l===0){let x=i.chomp==="+"&&a.length>0?`
|
|
158
158
|
`.repeat(Math.max(1,a.length-1)):"",T=n+i.length;return e.source&&(T+=e.source.length),{value:x,type:s,comment:i.comment,range:[n,T,T]}}let f=e.indent+i.indent,d=e.offset+i.length,m=0;for(let x=0;x<l;++x){let[T,q]=a[x];if(q===""||q==="\r")i.indent===0&&T.length>f&&(f=T.length);else{T.length<f&&r(d+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=T.length),m=x,f===0&&!t.atRoot&&r(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=T.length+q.length+1}for(let x=a.length-1;x>=l;--x)a[x][0].length>f&&(l=x+1);let g="",y="",w=!1;for(let x=0;x<m;++x)g+=a[x][0].slice(f)+`
|
|
159
|
-
`;for(let x=m;x<l;++x){let[T,q]=a[x];d+=T.length+q.length+1;let L=q[q.length-1]==="\r";if(L&&(q=q.slice(0,-1)),q&&T.length<f){let B=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(d-q.length-(L?2:1),"BAD_INDENT",B),T=""}s===
|
|
159
|
+
`;for(let x=m;x<l;++x){let[T,q]=a[x];d+=T.length+q.length+1;let L=q[q.length-1]==="\r";if(L&&(q=q.slice(0,-1)),q&&T.length<f){let B=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(d-q.length-(L?2:1),"BAD_INDENT",B),T=""}s===Gw.Scalar.BLOCK_LITERAL?(g+=y+T.slice(f)+q,y=`
|
|
160
160
|
`):T.length>f||q[0]===" "?(y===" "?y=`
|
|
161
161
|
`:!w&&y===`
|
|
162
162
|
`&&(y=`
|
|
@@ -169,114 +169,114 @@ ${d}
|
|
|
169
169
|
`+a[x][0].slice(f);g[g.length-1]!==`
|
|
170
170
|
`&&(g+=`
|
|
171
171
|
`);break;default:g+=`
|
|
172
|
-
`}let R=n+i.length+e.source.length;return{value:g,type:s,comment:i.comment,range:[n,R,R]}}function
|
|
172
|
+
`}let R=n+i.length+e.source.length;return{value:g,type:s,comment:i.comment,range:[n,R,R]}}function iY({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 w=i[y];if(!l&&(w==="-"||w==="+"))l=w;else{let R=Number(w);!a&&R?a=R: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 w=e[y];switch(w.type){case"space":d=!0;case"newline":g+=w.source.length;break;case"comment":r&&!d&&n(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=w.source.length,m=w.source.substring(1);break;case"error":n(w,"UNEXPECTED_TOKEN",w.message),g+=w.source.length;break;default:{let R=`Unexpected token in block scalar header: ${w.type}`;n(w,"UNEXPECTED_TOKEN",R);let x=w.source;x&&typeof x=="string"&&(g+=x.length)}}}return{mode:s,indent:a,chomp:l,comment:m,length:g}}function sY(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}Hk.resolveBlockScalar=nY});var Zw=F(Vk=>{"use strict";var Qw=Ft(),oY=nc();function aY(t,e,r){let{offset:n,type:i,source:s,end:a}=t,l,f,d=(y,w,R)=>r(n+y,w,R);switch(i){case"scalar":l=Qw.Scalar.PLAIN,f=lY(s,d);break;case"single-quoted-scalar":l=Qw.Scalar.QUOTE_SINGLE,f=cY(s,d);break;case"double-quoted-scalar":l=Qw.Scalar.QUOTE_DOUBLE,f=uY(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=oY.resolveEnd(a,m,e,r);return{value:f,type:l,comment:g.comment,range:[n,m,g.offset]}}function lY(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}`),Bk(t)}function cY(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Bk(t.slice(1,-1)).replace(/''/g,"'")}function Bk(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
173
173
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
174
174
|
`,"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===`
|
|
175
175
|
`?i+=s:s=`
|
|
176
|
-
`:(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
|
|
176
|
+
`:(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 uY(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
|
|
177
177
|
`))if(i===`
|
|
178
|
-
`){let{fold:s,offset:a}=
|
|
178
|
+
`){let{fold:s,offset:a}=fY(t,n);r+=s,n=a}else if(i==="\\"){let s=t[++n],a=dY[s];if(a)r+=a;else if(s===`
|
|
179
179
|
`)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
|
|
180
|
-
`)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+=
|
|
180
|
+
`)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+=pY(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!==`
|
|
181
181
|
`&&!(a==="\r"&&t[n+2]===`
|
|
182
|
-
`)&&(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
|
|
182
|
+
`)&&(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 fY(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
|
|
183
183
|
`||n==="\r")&&!(n==="\r"&&t[e+2]!==`
|
|
184
184
|
`);)n===`
|
|
185
185
|
`&&(r+=`
|
|
186
|
-
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var
|
|
187
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
186
|
+
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var dY={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
187
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function pY(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}}Vk.resolveFlowScalar=aY});var Jk=F(zk=>{"use strict";var ha=Je(),Wk=Ft(),hY=Kw(),mY=Zw();function gY(t,e,r,n){let{value:i,type:s,comment:a,range:l}=e.type==="block-scalar"?hY.resolveBlockScalar(t,e,n):mY.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[ha.SCALAR]:f?d=yY(t.schema,i,f,r,n):e.type==="scalar"?d=vY(t,i,e,n):d=t.schema[ha.SCALAR];let m;try{let g=d.resolve(i,y=>n(r??e,"TAG_RESOLVE_FAILED",y),t.options);m=ha.isScalar(g)?g:new Wk.Scalar(g)}catch(g){let y=g instanceof Error?g.message:String(g);n(r??e,"TAG_RESOLVE_FAILED",y),m=new Wk.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 yY(t,e,r,n,i){if(r==="!")return t[ha.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[ha.SCALAR])}function vY({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[ha.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[ha.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}zk.composeScalar=gY});var Gk=F(Yk=>{"use strict";function bY(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}Yk.emptyScalarPosition=bY});var Zk=F(e_=>{"use strict";var SY=If(),wY=Je(),_Y=Uk(),Kk=Jk(),xY=nc(),RY=Gk(),EY={composeNode:Qk,composeEmptyNode:Xw};function Qk(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=CY(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=Kk.composeScalar(t,e,f,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=_Y.composeCollection(EY,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=Xw(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&&(!wY.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 Xw(t,e,r,n,{spaceBefore:i,comment:s,anchor:a,tag:l,end:f},d){let m={type:"scalar",offset:RY.emptyScalarPosition(e,r,n),indent:-1,source:""},g=Kk.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 CY({options:t},{offset:e,source:r,end:n},i){let s=new SY.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=xY.resolveEnd(n,a,t.strict,i);return s.range=[e,a,l.offset],l.comment&&(s.comment=l.comment),s}e_.composeEmptyNode=Xw;e_.composeNode=Qk});var t1=F(e1=>{"use strict";var OY=Vf(),Xk=Zk(),IY=nc(),PY=Yf();function kY(t,e,{offset:r,start:n,value:i,end:s},a){let l=Object.assign({_directives:e},t),f=new OY.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=PY.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?Xk.composeNode(d,i,m,a):Xk.composeEmptyNode(d,m.end,n,null,m,a);let g=f.contents.range[2],y=IY.resolveEnd(s,g,!1,a);return y.comment&&(f.comment=y.comment),f.range=[r,g,y.offset],f}e1.composeDoc=kY});var r_=F(i1=>{"use strict";var TY=nt("process"),AY=U0(),qY=Vf(),Gf=Jf(),r1=Je(),$Y=t1(),MY=nc();function Kf(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 n1(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?`
|
|
188
188
|
|
|
189
189
|
`:`
|
|
190
|
-
`)+(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
|
|
190
|
+
`)+(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 t_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let a=Kf(r);s?this.warnings.push(new Gf.YAMLWarning(a,n,i)):this.errors.push(new Gf.YAMLParseError(a,n,i))},this.directives=new AY.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=n1(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
191
191
|
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(r1.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];r1.isPair(a)&&(a=a.key);let l=a.commentBefore;a.commentBefore=l?`${n}
|
|
192
192
|
${l}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n}
|
|
193
|
-
${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:n1(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(
|
|
194
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new
|
|
193
|
+
${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:n1(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(TY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=Kf(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=$Y.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 Gf.YAMLParseError(Kf(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 Gf.YAMLParseError(Kf(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=MY.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}
|
|
194
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Gf.YAMLParseError(Kf(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 qY.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}}};i1.Composer=t_});var a1=F(Um=>{"use strict";var NY=Kw(),DY=Zw(),FY=Jf(),s1=qf();function LY(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 FY.YAMLParseError([l,l+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return DY.resolveFlowScalar(t,e,n);case"block-scalar":return NY.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function jY(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,l=s1.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:`
|
|
195
195
|
`}];switch(l[0]){case"|":case">":{let d=l.indexOf(`
|
|
196
196
|
`),m=l.substring(0,d),g=l.substring(d+1)+`
|
|
197
197
|
`,y=[{type:"block-scalar-header",offset:s,indent:n,source:m}];return o1(y,f)||y.push({type:"newline",offset:-1,indent:n,source:`
|
|
198
|
-
`}),{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
|
|
198
|
+
`}),{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 UY(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=s1.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">":HY(t,f);break;case'"':n_(t,f,"double-quoted-scalar");break;case"'":n_(t,f,"single-quoted-scalar");break;default:n_(t,f,"scalar")}}function HY(t,e){let r=e.indexOf(`
|
|
199
199
|
`),n=e.substring(0,r),i=e.substring(r+1)+`
|
|
200
200
|
`;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}];o1(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:a,source:`
|
|
201
|
-
`});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 o1(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
|
|
202
|
-
`};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})}}}
|
|
201
|
+
`});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 o1(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 n_(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:`
|
|
202
|
+
`};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})}}}Um.createScalarToken=jY;Um.resolveAsScalar=LY;Um.setScalarValue=UY});var c1=F(l1=>{"use strict";var BY=t=>"type"in t?Bm(t):Hm(t);function Bm(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Bm(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Hm(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Hm(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Hm(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 Hm({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Bm(e)),r)for(let s of r)i+=s.source;return n&&(i+=Bm(n)),i}l1.stringify=BY});var p1=F(d1=>{"use strict";var i_=Symbol("break visit"),VY=Symbol("skip children"),u1=Symbol("remove item");function ma(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),f1(Object.freeze([]),t,e)}ma.BREAK=i_;ma.SKIP=VY;ma.REMOVE=u1;ma.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};ma.parentCollection=(t,e)=>{let r=ma.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 f1(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=f1(Object.freeze(t.concat([[i,a]])),s.items[a],r);if(typeof l=="number")a=l-1;else{if(l===i_)return i_;l===u1&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}d1.visit=ma});var Vm=F(Hr=>{"use strict";var s_=a1(),WY=c1(),zY=p1(),o_="\uFEFF",a_="",l_="",c_="",JY=t=>!!t&&"items"in t,YY=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function GY(t){switch(t){case o_:return"<BOM>";case a_:return"<DOC>";case l_:return"<FLOW_END>";case c_:return"<SCALAR>";default:return JSON.stringify(t)}}function KY(t){switch(t){case o_:return"byte-order-mark";case a_:return"doc-mode";case l_:return"flow-error-end";case c_:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
203
203
|
`:case`\r
|
|
204
|
-
`: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}Hr.createScalarToken=
|
|
205
|
-
`:case"\r":case" ":return!0;default:return!1}}var h1=new Set("0123456789ABCDEFabcdef"),
|
|
206
|
-
\r `),
|
|
204
|
+
`: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}Hr.createScalarToken=s_.createScalarToken;Hr.resolveAsScalar=s_.resolveAsScalar;Hr.setScalarValue=s_.setScalarValue;Hr.stringify=WY.stringify;Hr.visit=zY.visit;Hr.BOM=o_;Hr.DOCUMENT=a_;Hr.FLOW_END=l_;Hr.SCALAR=c_;Hr.isCollection=JY;Hr.isScalar=YY;Hr.prettyToken=GY;Hr.tokenType=KY});var d_=F(m1=>{"use strict";var Qf=Vm();function Kn(t){switch(t){case void 0:case" ":case`
|
|
205
|
+
`:case"\r":case" ":return!0;default:return!1}}var h1=new Set("0123456789ABCDEFabcdef"),QY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Wm=new Set(",[]{}"),ZY=new Set(` ,[]{}
|
|
206
|
+
\r `),u_=t=>!t||ZY.has(t),f_=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===`
|
|
207
207
|
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
208
208
|
`:!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===`
|
|
209
209
|
`||!i&&!this.atEnd)return e+n+1}return r===`
|
|
210
210
|
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Kn(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(`
|
|
211
|
-
`,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]===
|
|
211
|
+
`,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]===Qf.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 Qf.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==="...")&&Kn(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&&!Kn(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===":")&&Kn(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(u_),"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("..."))&&Kn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Qf.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(u_),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Kn(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(`
|
|
212
212
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
213
213
|
`,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=>Kn(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`
|
|
214
214
|
`:e=s,r=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
215
215
|
`)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(`
|
|
216
216
|
`,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===`
|
|
217
217
|
`;)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===`
|
|
218
|
-
`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield
|
|
218
|
+
`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield Qf.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(Kn(s)||e&&Wm.has(s))break;r=n}else if(Kn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
219
219
|
`?(n+=1,i=`
|
|
220
|
-
`,s=this.buffer[n+1]):r=n),s==="#"||e&&
|
|
221
|
-
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&
|
|
220
|
+
`,s=this.buffer[n+1]):r=n),s==="#"||e&&Wm.has(s))break;if(i===`
|
|
221
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&Wm.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Qf.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(u_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Kn(n)||r&&Wm.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(;!Kn(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(QY.has(r))r=this.buffer[++e];else if(r==="%"&&h1.has(this.buffer[e+1])&&h1.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===`
|
|
222
222
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
223
|
-
`?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)}};m1.Lexer=
|
|
223
|
+
`?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)}};m1.Lexer=f_});var h_=F(g1=>{"use strict";var p_=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}}}};g1.LineCounter=p_});var g_=F(w1=>{"use strict";var XY=nt("process"),y1=Vm(),eG=d_();function Qs(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function v1(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 S1(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 zm(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 ic(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 Jm(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 b1(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Qs(e.start,"explicit-key-ind")&&!Qs(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,S1(e.value)?e.value.end?Jm(e.value.end,e.sep):e.value.end=e.sep:Jm(e.start,e.sep),delete e.sep)}var m_=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 eG.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,XY.env.LOG_TOKENS&&console.log("|",y1.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=y1.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"&&b1(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&&v1(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":{v1(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=zm(this.peek(2)),n=ic(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(`
|
|
224
224
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
225
|
-
`,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)){
|
|
225
|
+
`,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)){Jm(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(Qs(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(S1(r.key)&&!Qs(r.sep,"newline")){let a=ic(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(Qs(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=ic(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]}):Qs(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&&!Qs(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)){Jm(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||Qs(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=zm(n),s=ic(i);b1(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(`
|
|
226
226
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
227
|
-
`,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=
|
|
228
|
-
|
|
229
|
-
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||EG.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 w={};y.schema&&(w.schema=y.schema),y.examples&&(w.examples=y.examples),y.encoding&&(w.encoding=y.encoding),i.content[g]=w}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 oc,v_=le(()=>{"use strict";oc=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 Jm=F(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.getDeepKeys=ac.toJSON=void 0;var CG=["function","symbol","undefined"],OG=["constructor","prototype","__proto__"],IG=Object.getPrototypeOf({});function PG(){let t={},e=this;for(let r of P1(e))if(typeof r=="string"){let n=e[r],i=typeof n;CG.includes(i)||(t[r]=n)}return t}ac.toJSON=PG;function P1(t,e=[]){let r=[];for(;t&&t!==IG;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(OG))n.delete(i);return n}ac.getDeepKeys=P1});var b_=F(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.addInspectMethod=lc.format=void 0;var k1=nt("util"),kG=Jm(),T1=k1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");lc.format=k1.format;function TG(t){t[T1]=AG}lc.addInspectMethod=TG;function AG(){let t={},e=this;for(let r of kG.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[T1],t}});var $1=F(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.lazyJoinStacks=_i.joinStacks=_i.isWritableStack=_i.isLazyStack=void 0;var qG=/\r?\n/,$G=/\bono[ @]/;function MG(t){return!!(t&&t.configurable&&typeof t.get=="function")}_i.isLazyStack=MG;function NG(t){return!!(!t||t.writable||typeof t.set=="function")}_i.isWritableStack=NG;function A1(t,e){let r=q1(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
230
|
-
|
|
231
|
-
`+n:r||n}_i.joinStacks=A1;function
|
|
232
|
-
`)}return t}function
|
|
233
|
-
`:"")+r.message),{originalError:r,props:n,message:s}}cc.normalizeArgs=WG});var w_=F(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.Ono=void 0;var Km=D1(),L1=F1(),zG=Jm(),JG=S_;Qm.Ono=JG;function S_(t,e){e=L1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=L1.normalizeArgs(n,e),l=new t(a);return Km.extendError(l,i,s)}return r[Symbol.species]=t,r}S_.toJSON=function(e){return zG.toJSON.call(e)};S_.extend=function(e,r,n){return n||r instanceof Error?Km.extendError(e,r,n):r?Km.extendError(e,void 0,r):Km.extendError(e)}});var j1=F(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.ono=void 0;var ga=w_(),YG=xi;Zm.ono=YG;xi.error=new ga.Ono(Error);xi.eval=new ga.Ono(EvalError);xi.range=new ga.Ono(RangeError);xi.reference=new ga.Ono(ReferenceError);xi.syntax=new ga.Ono(SyntaxError);xi.type=new ga.Ono(TypeError);xi.uri=new ga.Ono(URIError);var GG=xi;function xi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(GG))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 xi.error.apply(void 0,t)}});var H1=F(U1=>{"use strict";Object.defineProperty(U1,"__esModule",{value:!0});var RX=nt("util")});var eo=F((Qn,uc)=>{"use strict";var KG=Qn&&Qn.__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]})),QG=Qn&&Qn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&KG(e,t,r)};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ono=void 0;var B1=j1();Object.defineProperty(Qn,"ono",{enumerable:!0,get:function(){return B1.ono}});var ZG=w_();Object.defineProperty(Qn,"Ono",{enumerable:!0,get:function(){return ZG.Ono}});QG(H1(),Qn);Qn.default=B1.ono;typeof uc=="object"&&typeof uc.exports=="object"&&(uc.exports=Object.assign(uc.exports.default,uc.exports))});var __=F(Zf=>{"use strict";var XG=Zf&&Zf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zf,"__esModule",{value:!0});Zf.default=eK;var V1=XG(nt("path"));function eK(t){return t.startsWith("\\\\?\\")?t:t.split(V1.default?.win32?.sep).join(V1.default?.posix?.sep??"/")}});var W1=F(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.isWindows=void 0;var tK=/^win/.test(globalThis.process?globalThis.process.platform:""),rK=()=>tK;Xm.isWindows=rK});var xn=F(_t=>{"use strict";var nK=_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]})),iK=_t&&_t.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sK=_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"&&nK(r,e,n[i]);return iK(r,e),r}})(),oK=_t&&_t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_t,"__esModule",{value:!0});_t.parse=void 0;_t.resolve=z1;_t.cwd=J1;_t.getProtocol=O_;_t.getExtension=hK;_t.stripQuery=Y1;_t.getHash=G1;_t.stripHash=E_;_t.isHttp=mK;_t.isFileSystemPath=C_;_t.fromFileSystemPath=gK;_t.toFileSystemPath=yK;_t.safePointerToPath=vK;_t.relative=bK;var tg=oK(__()),R_=sK(nt("path")),aK=/\//g,lK=/^(\w{2,}):\/\//i,cK=/~1/g,uK=/~0/g,fK=nt("path"),eg=W1(),dK=[[/\?/g,"%3F"],[/#/g,"%23"]],x_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],pK=t=>new URL(t);_t.parse=pK;function z1(t,e){let r=new URL((0,tg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,tg.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 J1(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function O_(t){let e=lK.exec(t||"");if(e)return e[1].toLowerCase()}function hK(t){let e=t.lastIndexOf(".");return e>=0?Y1(t.substr(e).toLowerCase()):""}function Y1(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function G1(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function E_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function mK(t){let e=O_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function C_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=O_(t);return e===void 0||e==="file"}function gK(t){if((0,eg.isWindows)()){let e=J1(),r=t.toUpperCase(),i=(0,tg.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),l=R_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||l)&&!e.startsWith("http")&&(t=(0,fK.join)(e,t)),t=(0,tg.default)(t)}t=encodeURI(t);for(let e of dK)t=t.replace(e[0],e[1]);return t}function yK(t,e){t=decodeURI(t);for(let n=0;n<x_.length;n+=2)t=t.replace(x_[n],x_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,eg.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,eg.isWindows)()?t:"/"+t)),(0,eg.isWindows)()&&!r&&(t=t.replace(aK,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function vK(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(cK,"/").replace(uK,"~"))}function bK(t,e){if(!C_(t)||!C_(e))return z1(t,e);let r=R_.default.dirname(E_(t)),n=E_(e);return R_.default.relative(r,n)+G1(e)}});var Rn=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=SK;kt.normalizeError=wK;var K1=eo(),rg=xn(),Zn=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=Zn;var ng=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,rg.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=ng;var I_=class extends Zn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};kt.ParserError=I_;var P_=class extends Zn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};kt.UnmatchedParserError=P_;var k_=class extends Zn{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=k_;var T_=class extends Zn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};kt.UnmatchedResolverError=T_;var A_=class extends Zn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,rg.getHash)(r)}". Token "${e}" does not exist.`,(0,rg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};kt.MissingPointerError=A_;var q_=class extends Zn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};kt.TimeoutError=q_;var $_=class extends Zn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,rg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};kt.InvalidPointerError=$_;function SK(t){return t instanceof Zn||t instanceof ng}function wK(t){return t.path===null&&(t.path=[]),t}});var Xf=F(Br=>{"use strict";var _K=Br&&Br.__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]})),xK=Br&&Br.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RK=Br&&Br.__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"&&_K(r,e,n[i]);return xK(r,e),r}})(),EK=Br&&Br.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Br,"__esModule",{value:!0});Br.nullSymbol=void 0;var M_=EK(fc()),N_=RK(xn()),sg=Rn();Br.nullSymbol=Symbol("null");var CK=/\//g,OK=/~/g,IK=/~1/g,PK=/~0/g,kK=t=>{try{return decodeURIComponent(t)}catch{return t}},og=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=Z1(e);for(let a=0;a<i.length;a++){if(ig(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!X1(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 w=i.length-1;w>a;w--){let R=i.slice(a,w+1).join("/");if(this.value[R]!==void 0){this.value=this.value[R],a=w,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Br.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 sg.MissingPointerError(l,decodeURI(this.originalPath),m,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&N_.resolve(this.path,this.value.$ref)!==n)&&ig(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=Z1(e);for(let a=0;a<i.length-1;a++)ig(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=Q1(this,s,{});return ig(this,n),s=i[i.length-1],Q1(this,s,r),e}static parse(e,r){let n=N_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=kK(i[s].replace(IK,"/").replace(PK,"~"));if(i[0]!=="")throw new sg.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(OK,"~0").replace(CK,"~1"))}return e}};function ig(t,e,r){if(M_.default.isAllowed$Ref(t.value,e)){let n=N_.resolve(t.path,t.value.$ref);if(n===t.path&&!X1(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,M_.default.isExtended$Ref(t.value)?(t.value=M_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Br.default=og;function Q1(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 sg.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
234
|
-
Cannot set "${e}" of a non-object.`);return r}function Z1(t){if((0,
|
|
235
|
-
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=to.resolve(this._root$Ref.path,e);let r=to.stripHash(e);return this._$refs[r]}_add(e){let r=to.stripHash(e),n=new
|
|
236
|
-
"${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}};Xn.default=
|
|
237
|
-
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new ya.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?
|
|
238
|
-
|
|
239
|
-
`+t.mark.snippet),n+" "+r):n}function
|
|
240
|
-
`+l}let m=
|
|
241
|
-
`,l+=
|
|
242
|
-
`;for(let g=1;g<=e.linesAfter&&!(a+g>=i.length);g++){let y=
|
|
243
|
-
`}return l.replace(/\n$/,"")}pT.exports=
|
|
244
|
-
\r`;function
|
|
245
|
-
`;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
|
|
246
|
-
`,e-1))}function
|
|
247
|
-
`,i?1+l:l):n===
|
|
227
|
+
`,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=zm(e),n=ic(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=zm(e),n=ic(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())}}};w1.Parser=m_});var C1=F(Xf=>{"use strict";var _1=r_(),tG=Vf(),Zf=Jf(),rG=ew(),nG=Je(),iG=h_(),x1=g_();function R1(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new iG.LineCounter||null,prettyErrors:e}}function sG(t,e={}){let{lineCounter:r,prettyErrors:n}=R1(e),i=new x1.Parser(r?.addNewLine),s=new _1.Composer(e),a=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of a)l.errors.forEach(Zf.prettifyError(t,r)),l.warnings.forEach(Zf.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function E1(t,e={}){let{lineCounter:r,prettyErrors:n}=R1(e),i=new x1.Parser(r?.addNewLine),s=new _1.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 Zf.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(a.errors.forEach(Zf.prettifyError(t,r)),a.warnings.forEach(Zf.prettifyError(t,r))),a}function oG(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=E1(t,r);if(!i)return null;if(i.warnings.forEach(s=>rG.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 aG(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 nG.isDocument(t)&&!n?t.toString(r):new tG.Document(t,n,r).toString(r)}Xf.parse=oG;Xf.parseAllDocuments=sG;Xf.parseDocument=E1;Xf.stringify=aG});var v_=F(it=>{"use strict";var lG=r_(),cG=Vf(),uG=Nw(),y_=Jf(),fG=If(),Zs=Je(),dG=Js(),pG=Ft(),hG=Gs(),mG=Ks(),gG=Vm(),yG=d_(),vG=h_(),bG=g_(),Ym=C1(),O1=Rf();it.Composer=lG.Composer;it.Document=cG.Document;it.Schema=uG.Schema;it.YAMLError=y_.YAMLError;it.YAMLParseError=y_.YAMLParseError;it.YAMLWarning=y_.YAMLWarning;it.Alias=fG.Alias;it.isAlias=Zs.isAlias;it.isCollection=Zs.isCollection;it.isDocument=Zs.isDocument;it.isMap=Zs.isMap;it.isNode=Zs.isNode;it.isPair=Zs.isPair;it.isScalar=Zs.isScalar;it.isSeq=Zs.isSeq;it.Pair=dG.Pair;it.Scalar=pG.Scalar;it.YAMLMap=hG.YAMLMap;it.YAMLSeq=mG.YAMLSeq;it.CST=gG;it.Lexer=yG.Lexer;it.LineCounter=vG.LineCounter;it.Parser=bG.Parser;it.parse=Ym.parse;it.parseAllDocuments=Ym.parseAllDocuments;it.parseDocument=Ym.parseDocument;it.stringify=Ym.stringify;it.visit=O1.visit;it.visitAsync=O1.visitAsync});var SG,wG,_G,xG,RG,EG,CG,Xs,Gm=le(()=>{"use strict";SG=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,wG=/^\d{4}-\d{2}-\d{2}$/,_G=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,xG=/^https?:\/\/[^\s]+$/,RG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,EG=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,CG=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,Xs=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(SG.test(e))return"date-time";if(wG.test(e))return"date";if(_G.test(e))return"email";if(RG.test(e))return"uuid";if(xG.test(e))return"uri";if(EG.test(e))return"ipv4";if(CG.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 I1,OG,sc,b_=le(()=>{"use strict";I1=ob(v_());Gm();OG=new Set(["content-type","authorization","accept","cookie","host","content-length"]),sc=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new Xs}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"?I1.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 w=this.buildParameters(e);w.length>0&&(y.parameters=w);let R=await this.buildRequestBody(e,f);R&&(y.requestBody=R);let x=await this.buildResponses(e,l.id,f);y.responses=x;let T=this.buildOperationSecurity(e,l,n);T!==void 0&&(y.security=T);let q=r.paths[d][g];q?this.mergeOperation(q,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||"")+`
|
|
228
|
+
|
|
229
|
+
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||OG.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 w={};y.schema&&(w.schema=y.schema),y.examples&&(w.examples=y.examples),y.encoding&&(w.encoding=y.encoding),i.content[g]=w}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 oc,S_=le(()=>{"use strict";oc=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 Km=F(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.getDeepKeys=ac.toJSON=void 0;var IG=["function","symbol","undefined"],PG=["constructor","prototype","__proto__"],kG=Object.getPrototypeOf({});function TG(){let t={},e=this;for(let r of P1(e))if(typeof r=="string"){let n=e[r],i=typeof n;IG.includes(i)||(t[r]=n)}return t}ac.toJSON=TG;function P1(t,e=[]){let r=[];for(;t&&t!==kG;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(PG))n.delete(i);return n}ac.getDeepKeys=P1});var w_=F(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.addInspectMethod=lc.format=void 0;var k1=nt("util"),AG=Km(),T1=k1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");lc.format=k1.format;function qG(t){t[T1]=$G}lc.addInspectMethod=qG;function $G(){let t={},e=this;for(let r of AG.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[T1],t}});var $1=F(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.lazyJoinStacks=_i.joinStacks=_i.isWritableStack=_i.isLazyStack=void 0;var MG=/\r?\n/,NG=/\bono[ @]/;function DG(t){return!!(t&&t.configurable&&typeof t.get=="function")}_i.isLazyStack=DG;function FG(t){return!!(!t||t.writable||typeof t.set=="function")}_i.isWritableStack=FG;function A1(t,e){let r=q1(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
230
|
+
|
|
231
|
+
`+n:r||n}_i.joinStacks=A1;function LG(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return A1({stack:n},r)},enumerable:!1,configurable:!0}):jG(e,t)}_i.lazyJoinStacks=LG;function q1(t){if(t){let e=t.split(MG),r;for(let n=0;n<e.length;n++){let i=e[n];if(NG.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(`
|
|
232
|
+
`)}return t}function jG(t,e){Object.defineProperty(t,"stack",{get:()=>q1(e.get.apply(t)),enumerable:!1,configurable:!0})}});var D1=F(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.extendError=void 0;var M1=w_(),Qm=$1(),N1=Km(),UG=["name","message","stack"];function HG(t,e,r){let n=t;return BG(n,e),e&&typeof e=="object"&&VG(n,e),n.toJSON=N1.toJSON,M1.addInspectMethod&&M1.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}Zm.extendError=HG;function BG(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");Qm.isLazyStack(r)?Qm.lazyJoinStacks(r,t,e):Qm.isWritableStack(r)&&(t.stack=Qm.joinStacks(t,e))}function VG(t,e){let r=N1.getDeepKeys(e,UG),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var F1=F(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.normalizeArgs=cc.normalizeOptions=void 0;var WG=w_();function zG(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?WG.format:typeof t.format=="function"?t.format:!1}}cc.normalizeOptions=zG;function JG(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?`
|
|
233
|
+
`:"")+r.message),{originalError:r,props:n,message:s}}cc.normalizeArgs=JG});var x_=F(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.Ono=void 0;var Xm=D1(),L1=F1(),YG=Km(),GG=__;eg.Ono=GG;function __(t,e){e=L1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=L1.normalizeArgs(n,e),l=new t(a);return Xm.extendError(l,i,s)}return r[Symbol.species]=t,r}__.toJSON=function(e){return YG.toJSON.call(e)};__.extend=function(e,r,n){return n||r instanceof Error?Xm.extendError(e,r,n):r?Xm.extendError(e,void 0,r):Xm.extendError(e)}});var j1=F(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.ono=void 0;var ga=x_(),KG=xi;tg.ono=KG;xi.error=new ga.Ono(Error);xi.eval=new ga.Ono(EvalError);xi.range=new ga.Ono(RangeError);xi.reference=new ga.Ono(ReferenceError);xi.syntax=new ga.Ono(SyntaxError);xi.type=new ga.Ono(TypeError);xi.uri=new ga.Ono(URIError);var QG=xi;function xi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(QG))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 xi.error.apply(void 0,t)}});var H1=F(U1=>{"use strict";Object.defineProperty(U1,"__esModule",{value:!0});var qX=nt("util")});var eo=F((Qn,uc)=>{"use strict";var ZG=Qn&&Qn.__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]})),XG=Qn&&Qn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&ZG(e,t,r)};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ono=void 0;var B1=j1();Object.defineProperty(Qn,"ono",{enumerable:!0,get:function(){return B1.ono}});var eK=x_();Object.defineProperty(Qn,"Ono",{enumerable:!0,get:function(){return eK.Ono}});XG(H1(),Qn);Qn.default=B1.ono;typeof uc=="object"&&typeof uc.exports=="object"&&(uc.exports=Object.assign(uc.exports.default,uc.exports))});var R_=F(ed=>{"use strict";var tK=ed&&ed.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ed,"__esModule",{value:!0});ed.default=rK;var V1=tK(nt("path"));function rK(t){return t.startsWith("\\\\?\\")?t:t.split(V1.default?.win32?.sep).join(V1.default?.posix?.sep??"/")}});var W1=F(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.isWindows=void 0;var nK=/^win/.test(globalThis.process?globalThis.process.platform:""),iK=()=>nK;rg.isWindows=iK});var xn=F(_t=>{"use strict";var sK=_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]})),oK=_t&&_t.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aK=_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"&&sK(r,e,n[i]);return oK(r,e),r}})(),lK=_t&&_t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_t,"__esModule",{value:!0});_t.parse=void 0;_t.resolve=z1;_t.cwd=J1;_t.getProtocol=P_;_t.getExtension=gK;_t.stripQuery=Y1;_t.getHash=G1;_t.stripHash=O_;_t.isHttp=yK;_t.isFileSystemPath=I_;_t.fromFileSystemPath=vK;_t.toFileSystemPath=bK;_t.safePointerToPath=SK;_t.relative=wK;var ig=lK(R_()),C_=aK(nt("path")),cK=/\//g,uK=/^(\w{2,}):\/\//i,fK=/~1/g,dK=/~0/g,pK=nt("path"),ng=W1(),hK=[[/\?/g,"%3F"],[/#/g,"%23"]],E_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],mK=t=>new URL(t);_t.parse=mK;function z1(t,e){let r=new URL((0,ig.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,ig.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 J1(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function P_(t){let e=uK.exec(t||"");if(e)return e[1].toLowerCase()}function gK(t){let e=t.lastIndexOf(".");return e>=0?Y1(t.substr(e).toLowerCase()):""}function Y1(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function G1(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function O_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function yK(t){let e=P_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function I_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=P_(t);return e===void 0||e==="file"}function vK(t){if((0,ng.isWindows)()){let e=J1(),r=t.toUpperCase(),i=(0,ig.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),l=C_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||l)&&!e.startsWith("http")&&(t=(0,pK.join)(e,t)),t=(0,ig.default)(t)}t=encodeURI(t);for(let e of hK)t=t.replace(e[0],e[1]);return t}function bK(t,e){t=decodeURI(t);for(let n=0;n<E_.length;n+=2)t=t.replace(E_[n],E_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,ng.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,ng.isWindows)()?t:"/"+t)),(0,ng.isWindows)()&&!r&&(t=t.replace(cK,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function SK(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(fK,"/").replace(dK,"~"))}function wK(t,e){if(!I_(t)||!I_(e))return z1(t,e);let r=C_.default.dirname(O_(t)),n=O_(e);return C_.default.relative(r,n)+G1(e)}});var Rn=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=_K;kt.normalizeError=xK;var K1=eo(),sg=xn(),Zn=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=Zn;var og=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,sg.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=og;var k_=class extends Zn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};kt.ParserError=k_;var T_=class extends Zn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};kt.UnmatchedParserError=T_;var A_=class extends Zn{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=A_;var q_=class extends Zn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};kt.UnmatchedResolverError=q_;var $_=class extends Zn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,sg.getHash)(r)}". Token "${e}" does not exist.`,(0,sg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};kt.MissingPointerError=$_;var M_=class extends Zn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};kt.TimeoutError=M_;var N_=class extends Zn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,sg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};kt.InvalidPointerError=N_;function _K(t){return t instanceof Zn||t instanceof og}function xK(t){return t.path===null&&(t.path=[]),t}});var td=F(Br=>{"use strict";var RK=Br&&Br.__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]})),EK=Br&&Br.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),CK=Br&&Br.__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"&&RK(r,e,n[i]);return EK(r,e),r}})(),OK=Br&&Br.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Br,"__esModule",{value:!0});Br.nullSymbol=void 0;var D_=OK(fc()),F_=CK(xn()),lg=Rn();Br.nullSymbol=Symbol("null");var IK=/\//g,PK=/~/g,kK=/~1/g,TK=/~0/g,AK=t=>{try{return decodeURIComponent(t)}catch{return t}},cg=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=Z1(e);for(let a=0;a<i.length;a++){if(ag(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!X1(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 w=i.length-1;w>a;w--){let R=i.slice(a,w+1).join("/");if(this.value[R]!==void 0){this.value=this.value[R],a=w,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Br.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 lg.MissingPointerError(l,decodeURI(this.originalPath),m,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&F_.resolve(this.path,this.value.$ref)!==n)&&ag(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=Z1(e);for(let a=0;a<i.length-1;a++)ag(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=Q1(this,s,{});return ag(this,n),s=i[i.length-1],Q1(this,s,r),e}static parse(e,r){let n=F_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=AK(i[s].replace(kK,"/").replace(TK,"~"));if(i[0]!=="")throw new lg.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(PK,"~0").replace(IK,"~1"))}return e}};function ag(t,e,r){if(D_.default.isAllowed$Ref(t.value,e)){let n=F_.resolve(t.path,t.value.$ref);if(n===t.path&&!X1(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,D_.default.isExtended$Ref(t.value)?(t.value=D_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Br.default=cg;function Q1(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 lg.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
234
|
+
Cannot set "${e}" of a non-object.`);return r}function Z1(t){if((0,lg.isHandledError)(t))throw t;return t}function X1(t){return typeof t=="string"&&cg.parse(t).length==0}});var fc=F(ts=>{"use strict";var qK=ts&&ts.__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]})),$K=ts&&ts.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MK=ts&&ts.__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"&&qK(r,e,n[i]);return $K(r,e),r}})();Object.defineProperty(ts,"__esModule",{value:!0});var ug=MK(td()),fg=Rn(),L_=xn(),j_=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(fg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,fg.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 ug.default(this,e,n);try{let a=s.resolve(this.value,r,i);return a.value===ug.nullSymbol&&(a.value=null),a}catch(a){if(!r||!r.continueOnError||!(0,fg.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,L_.safePointerToPath)((0,L_.getHash)(i))),a instanceof fg.InvalidPointerError&&(a.source=decodeURI((0,L_.stripHash)(i))),this.addError(a),null}}set(e,r){let n=new ug.default(this,e);this.value=n.set(this.value,r),this.value===ug.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}};ts.default=j_});var iT=F(Xn=>{"use strict";var NK=Xn&&Xn.__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]})),DK=Xn&&Xn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FK=Xn&&Xn.__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"&&NK(r,e,n[i]);return DK(r,e),r}})(),nT=Xn&&Xn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xn,"__esModule",{value:!0});var eT=eo(),LK=nT(fc()),to=FK(xn()),tT=nT(R_()),U_=class{paths(...e){return rT(this._$refs,e.flat()).map(n=>(0,tT.default)(n.decoded))}values(...e){let r=this._$refs;return rT(r,e.flat()).reduce((i,s)=>(i[(0,tT.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=to.resolve(this._root$Ref.path,e),i=to.stripHash(n),s=this._$refs[i];if(!s)throw(0,eT.ono)(`Error resolving $ref pointer "${e}".
|
|
235
|
+
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=to.resolve(this._root$Ref.path,e);let r=to.stripHash(e);return this._$refs[r]}_add(e){let r=to.stripHash(e),n=new LK.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=to.resolve(this._root$Ref.path,e),s=to.stripHash(i),a=this._$refs[s];if(!a)throw(0,eT.ono)(`Error resolving $ref pointer "${e}".
|
|
236
|
+
"${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}};Xn.default=U_;function rT(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"?to.toFileSystemPath(n,!0):n}))}});var oT=F(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.all=jK;dc.filter=UK;dc.sort=HK;dc.run=BK;function jK(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function UK(t,e,r){return t.filter(n=>!!sT(n,e,r))}function HK(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 BK(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 w=sT(i,e,r,m,n);if(w&&typeof w.then=="function")w.then(g,y);else if(w!==void 0)g(w);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(w){y(w)}}function m(w,R){w?y(w):g(R)}function g(w){l({plugin:i,result:w})}function y(w){s={plugin:i,error:w},d()}})}function sT(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 B_=F(rs=>{"use strict";var VK=rs&&rs.__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]})),WK=rs&&rs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aT=rs&&rs.__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"&&VK(r,e,n[i]);return WK(r,e),r}})();Object.defineProperty(rs,"__esModule",{value:!0});var H_=eo(),zK=aT(xn()),ro=aT(oT()),ya=Rn();async function JK(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:zK.getExtension(t)};try{let l=await YK(a,r,e);s.pathType=l.plugin.name,a.data=l.result;let f=await GK(a,r,e);return s.value=f.result,f.result}catch(l){throw(0,ya.isHandledError)(l)&&(s.value=l),l}}async function YK(t,e,r){let n=ro.all(e.resolve);n=ro.filter(n,"canRead",t),ro.sort(n);try{return await ro.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new ya.UnmatchedResolverError(t.url):!i||!("error"in i)?H_.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof ya.ResolverError?i.error:new ya.ResolverError(i,t.url)}}async function GK(t,e,r){let n=ro.all(e.parse),i=ro.filter(n,"canParse",t),s=i.length>0?i:n;ro.sort(s);try{let a=await ro.run(s,"parse",t,r);if(!a.plugin.allowEmpty&&KK(a.result))throw H_.ono.syntax(`Error parsing "${t.url}" as ${a.plugin.name}.
|
|
237
|
+
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new ya.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?H_.ono.syntax(`Unable to parse ${t.url}`):a.error instanceof ya.ParserError?a.error:new ya.ParserError(a.error.message,t.url)}}function KK(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}rs.default=JK});var cT=F(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var lT=Rn();V_.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 lT.ParserError(n.message,t.url)}throw new lT.ParserError(r.message,t.url)}}else return e}}});var pc=F((WX,va)=>{"use strict";function uT(t){return typeof t>"u"||t===null}function QK(t){return typeof t=="object"&&t!==null}function ZK(t){return Array.isArray(t)?t:uT(t)?[]:[t]}function XK(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 e6(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function t6(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}va.exports.isNothing=uT;va.exports.isObject=QK;va.exports.toArray=ZK;va.exports.repeat=e6;va.exports.isNegativeZero=t6;va.exports.extend=XK});var hc=F((zX,dT)=>{"use strict";function fT(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+=`
|
|
238
|
+
|
|
239
|
+
`+t.mark.snippet),n+" "+r):n}function rd(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=fT(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}rd.prototype=Object.create(Error.prototype);rd.prototype.constructor=rd;rd.prototype.toString=function(e){return this.name+": "+fT(this,e)};dT.exports=rd});var hT=F((JX,pT)=>{"use strict";var nd=pc();function W_(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 z_(t,e){return nd.repeat(" ",e-t.length)+t}function r6(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=W_(t.buffer,n[a-g],i[a-g],t.position-(n[a]-n[a-g]),d);l=nd.repeat(" ",e.indent)+z_((t.line-g+1).toString(),f)+" | "+y.str+`
|
|
240
|
+
`+l}let m=W_(t.buffer,n[a],i[a],t.position,d);l+=nd.repeat(" ",e.indent)+z_((t.line+1).toString(),f)+" | "+m.str+`
|
|
241
|
+
`,l+=nd.repeat("-",e.indent+f+3+m.pos)+`^
|
|
242
|
+
`;for(let g=1;g<=e.linesAfter&&!(a+g>=i.length);g++){let y=W_(t.buffer,n[a+g],i[a+g],t.position-(n[a]-n[a+g]),d);l+=nd.repeat(" ",e.indent)+z_((t.line+g+1).toString(),f)+" | "+y.str+`
|
|
243
|
+
`}return l.replace(/\n$/,"")}pT.exports=r6});var fr=F((YX,gT)=>{"use strict";var mT=hc(),n6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],i6=["scalar","sequence","mapping"];function s6(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function o6(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(n6.indexOf(r)===-1)throw new mT('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=s6(e.styleAliases||null),i6.indexOf(this.kind)===-1)throw new mT('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}gT.exports=o6});var G_=F((GX,vT)=>{"use strict";var id=hc(),J_=fr();function yT(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 a6(){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 Y_(t){return this.extend(t)}Y_.prototype.extend=function(e){let r=[],n=[];if(e instanceof J_)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 id("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof J_))throw new id("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new id("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 id("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 J_))throw new id("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(Y_.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=yT(i,"implicit"),i.compiledExplicit=yT(i,"explicit"),i.compiledTypeMap=a6(i.compiledImplicit,i.compiledExplicit),i};vT.exports=Y_});var K_=F((KX,bT)=>{"use strict";var l6=fr();bT.exports=new l6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var Q_=F((QX,ST)=>{"use strict";var c6=fr();ST.exports=new c6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var Z_=F((ZX,wT)=>{"use strict";var u6=fr();wT.exports=new u6("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var X_=F((XX,_T)=>{"use strict";var f6=G_();_T.exports=new f6({explicit:[K_(),Q_(),Z_()]})});var ex=F((eee,xT)=>{"use strict";var d6=fr();function p6(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function h6(){return null}function m6(t){return t===null}xT.exports=new d6("tag:yaml.org,2002:null",{kind:"scalar",resolve:p6,construct:h6,predicate:m6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var tx=F((tee,RT)=>{"use strict";var g6=fr();function y6(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 v6(t){return t==="true"||t==="True"||t==="TRUE"}function b6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}RT.exports=new g6("tag:yaml.org,2002:bool",{kind:"scalar",resolve:y6,construct:v6,predicate:b6,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 rx=F((ree,ET)=>{"use strict";var S6=pc(),w6=fr();function _6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function x6(t){return t>=48&&t<=55}function R6(t){return t>=48&&t<=57}function E6(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(sd(t))}if(i==="x"){for(r++;r<e;r++){if(!_6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(sd(t))}if(i==="o"){for(r++;r<e;r++){if(!x6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(sd(t))}}for(;r<e;r++){if(!R6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(sd(t)):!1}function sd(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 C6(t){return sd(t)}function O6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!S6.isNegativeZero(t)}ET.exports=new w6("tag:yaml.org,2002:int",{kind:"scalar",resolve:E6,construct:C6,predicate:O6,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 nx=F((nee,OT)=>{"use strict";var CT=pc(),I6=fr(),P6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),k6=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function T6(t){return t===null||!P6.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:k6.test(t)}function A6(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 q6=/^[-+]?[0-9]+e/;function $6(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(CT.isNegativeZero(t))return"-0.0";let r=t.toString(10);return q6.test(r)?r.replace("e",".e"):r}function M6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||CT.isNegativeZero(t))}OT.exports=new I6("tag:yaml.org,2002:float",{kind:"scalar",resolve:T6,construct:A6,predicate:M6,represent:$6,defaultStyle:"lowercase"})});var ix=F((iee,IT)=>{"use strict";IT.exports=X_().extend({implicit:[ex(),tx(),rx(),nx()]})});var sx=F((see,PT)=>{"use strict";PT.exports=ix()});var ox=F((oee,AT)=>{"use strict";var N6=fr(),kT=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),TT=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 D6(t){return t===null?!1:kT.exec(t)!==null||TT.exec(t)!==null}function F6(t){let e=0,r=null,n=kT.exec(t);if(n===null&&(n=TT.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 L6(t){return t.toISOString()}AT.exports=new N6("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:D6,construct:F6,instanceOf:Date,represent:L6})});var ax=F((aee,qT)=>{"use strict";var j6=fr();function U6(t){return t==="<<"||t===null}qT.exports=new j6("tag:yaml.org,2002:merge",{kind:"scalar",resolve:U6})});var cx=F((lee,$T)=>{"use strict";var H6=fr(),lx=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
244
|
+
\r`;function B6(t){if(t===null)return!1;let e=0,r=t.length,n=lx;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 V6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=lx,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 W6(t){let e="",r=0,n=t.length,i=lx;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 z6(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}$T.exports=new H6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:B6,construct:V6,predicate:z6,represent:W6})});var ux=F((cee,MT)=>{"use strict";var J6=fr(),Y6=Object.prototype.hasOwnProperty,G6=Object.prototype.toString;function K6(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(G6.call(s)!=="[object Object]")return!1;let l;for(l in s)if(Y6.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 Q6(t){return t!==null?t:[]}MT.exports=new J6("tag:yaml.org,2002:omap",{kind:"sequence",resolve:K6,construct:Q6})});var fx=F((uee,NT)=>{"use strict";var Z6=fr(),X6=Object.prototype.toString;function e4(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(X6.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 t4(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}NT.exports=new Z6("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:e4,construct:t4})});var dx=F((fee,DT)=>{"use strict";var r4=fr(),n4=Object.prototype.hasOwnProperty;function i4(t){if(t===null)return!0;let e=t;for(let r in e)if(n4.call(e,r)&&e[r]!==null)return!1;return!0}function s4(t){return t!==null?t:{}}DT.exports=new r4("tag:yaml.org,2002:set",{kind:"mapping",resolve:i4,construct:s4})});var dg=F((dee,FT)=>{"use strict";FT.exports=sx().extend({implicit:[ox(),ax()],explicit:[cx(),ux(),fx(),dx()]})});var iA=F((pee,gx)=>{"use strict";var ba=pc(),zT=hc(),o4=hT(),a4=dg(),ei=Object.prototype.hasOwnProperty,pg=1,JT=2,YT=3,hg=4,px=1,l4=2,LT=3,c4=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,u4=/[\x85\u2028\u2029]/,f4=/[,\[\]{}]/,GT=/^(?:!|!!|![0-9A-Za-z-]+!)$/,KT=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function jT(t){return Object.prototype.toString.call(t)}function Ri(t){return t===10||t===13}function ns(t){return t===9||t===32}function Vr(t){return t===9||t===32||t===10||t===13}function mc(t){return t===44||t===91||t===93||t===123||t===125}function d4(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function p4(t){return t===120?2:t===117?4:t===85?8:0}function h4(t){return t>=48&&t<=57?t-48:-1}function UT(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
245
|
+
`;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 m4(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function QT(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var ZT=new Array(256),XT=new Array(256);for(let t=0;t<256;t++)ZT[t]=UT(t)?1:0,XT[t]=UT(t);function g4(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||a4,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 eA(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=o4(r),new zT(e,r)}function fe(t,e){throw eA(t,e)}function mg(t,e){t.onWarning&&t.onWarning.call(null,eA(t,e))}function Sa(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ei.call(i,e)||(i[e]={existed:ei.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function y4(t){t.anchorMapTransactions.push(Object.create(null))}function v4(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];ei.call(n,l)||(n[l]=e[l])}}function b4(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 tA(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 HT(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 BT={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&&mg(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],GT.test(s)||fe(e,"ill-formed tag handle (first argument) of the TAG directive"),ei.call(e.tagMap,s)&&fe(e,'there is a previously declared suffix for "'+s+'" tag handle'),KT.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 no(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 c4.test(i)&&fe(t,"the stream contains non-printable characters");t.result+=i}}function VT(t,e,r,n){ba.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];ei.call(e,l)||(QT(e,l,r[l]),n[l]=!0)}}function gc(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"&&jT(i[d])==="[object Object]"&&(i[d]="[object Object]")}if(typeof i=="object"&&jT(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),VT(t,e,y,r))}}else VT(t,e,s,r);else!t.json&&!ei.call(r,i)&&ei.call(e,i)&&(t.line=a||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,fe(t,"duplicated mapping key")),QT(e,i,s),delete r[i];return e}function hx(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(;ns(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(Ri(i))for(hx(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&&mg(t,"deficient indentation"),n}function gg(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||Vr(r)))}function mx(t,e){e===1?t.result+=" ":e>1&&(t.result+=ba.repeat(`
|
|
246
|
+
`,e-1))}function S4(t,e,r){let n,i,s,a,l,f,d=t.kind,m=t.result,g=t.input.charCodeAt(t.position);if(Vr(g)||mc(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(Vr(y)||r&&mc(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(Vr(y)||r&&mc(y))break}else if(g===35){let y=t.input.charCodeAt(t.position-1);if(Vr(y))break}else{if(t.position===t.lineStart&&gg(t)||r&&mc(g))break;if(Ri(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&&(no(t,n,i,!1),mx(t,t.line-a),n=i=t.position,s=!1),ns(g)||(i=t.position+1),g=t.input.charCodeAt(++t.position)}return no(t,n,i,!1),t.result?!0:(t.kind=d,t.result=m,!1)}function w4(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(no(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 Ri(i)?(no(t,r,n,!0),mx(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&gg(t)?fe(t,"unexpected end of the document within a single quoted scalar"):(t.position++,ns(i)||(n=t.position));fe(t,"unexpected end of the stream within a single quoted scalar")}function _4(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 no(t,r,t.position,!0),t.position++,!0;if(s===92){if(no(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ri(s))Lt(t,!1,e);else if(s<256&&ZT[s])t.result+=XT[s],t.position++;else if((i=p4(s))>0){let a=i,l=0;for(;a>0;a--)s=t.input.charCodeAt(++t.position),(i=d4(s))>=0?l=(l<<4)+i:fe(t,"expected hexadecimal character");t.result+=m4(l),t.position++}else fe(t,"unknown escape sequence");r=n=t.position}else Ri(s)?(no(t,r,n,!0),mx(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&gg(t)?fe(t,"unexpected end of the document within a double quoted scalar"):(t.position++,ns(s)||(n=t.position))}fe(t,"unexpected end of the stream within a double quoted scalar")}function x4(t,e){let r=!0,n,i,s,a=t.tag,l,f=t.anchor,d,m,g,y,w=Object.create(null),R,x,T,q=t.input.charCodeAt(t.position);if(q===91)d=93,y=!1,l=[];else if(q===123)d=125,y=!0,l={};else return!1;for(t.anchor!==null&&Sa(t,t.anchor,l),q=t.input.charCodeAt(++t.position);q!==0;){if(Lt(t,!0,e),q=t.input.charCodeAt(t.position),q===d)return t.position++,t.tag=a,t.anchor=f,t.kind=y?"mapping":"sequence",t.result=l,!0;if(r?q===44&&fe(t,"expected the node content, but found ','"):fe(t,"missed comma between flow collection entries"),x=R=T=null,m=g=!1,q===63){let L=t.input.charCodeAt(t.position+1);Vr(L)&&(m=g=!0,t.position++,Lt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,yc(t,e,pg,!1,!0),x=t.tag,R=t.result,Lt(t,!0,e),q=t.input.charCodeAt(t.position),(g||t.line===n)&&q===58&&(m=!0,q=t.input.charCodeAt(++t.position),Lt(t,!0,e),yc(t,e,pg,!1,!0),T=t.result),y?gc(t,l,w,x,R,T,n,i,s):m?l.push(gc(t,null,w,x,R,T,n,i,s)):l.push(R),Lt(t,!0,e),q=t.input.charCodeAt(t.position),q===44?(r=!0,q=t.input.charCodeAt(++t.position)):r=!1}fe(t,"unexpected end of the stream within a flow collection")}function R4(t,e){let r,n=px,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)px===n?n=m===43?LT:l4:fe(t,"repeat of a chomping mode identifier");else if((d=h4(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(ns(m)){do m=t.input.charCodeAt(++t.position);while(ns(m));if(m===35)do m=t.input.charCodeAt(++t.position);while(!Ri(m)&&m!==0)}for(;m!==0;){for(hx(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),Ri(m)){l++;continue}if(!s&&a===0&&fe(t,"missing indentation for block scalar"),t.lineIndent<a){n===LT?t.result+=ba.repeat(`
|
|
247
|
+
`,i?1+l:l):n===px&&i&&(t.result+=`
|
|
248
248
|
`);break}r?ns(m)?(f=!0,t.result+=ba.repeat(`
|
|
249
249
|
`,i?1+l:l)):f?(f=!1,t.result+=ba.repeat(`
|
|
250
250
|
`,l+1)):l===0?i&&(t.result+=" "):t.result+=ba.repeat(`
|
|
251
251
|
`,l):t.result+=ba.repeat(`
|
|
252
|
-
`,i?1+l:l),i=!0,s=!0,l=0;let g=t.position;for(;!Ri(m)&&m!==0;)m=t.input.charCodeAt(++t.position);no(t,g,t.position,!1)}return!0}function WT(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Sa(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(!Vr(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(yc(t,e,YT,!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 rA(t,e,r){let n,i,s,a,l=t.tag,f=t.anchor,d={},m=Object.create(null),g=null,y=null,w=null,R=!1,x=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Sa(t,t.anchor,d);let T=t.input.charCodeAt(t.position);for(;T!==0;){!R&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,fe(t,"tab characters must not be used in indentation"));let q=t.input.charCodeAt(t.position+1),L=t.line;if((T===63||T===58)&&Vr(q))T===63?(R&&(gc(t,d,m,g,y,null,i,s,a),g=y=w=null),x=!0,R=!0,n=!0):R?(R=!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,T=q;else{if(i=t.line,s=t.lineStart,a=t.position,!yc(t,r,JT,!1,!0))break;if(t.line===L){for(T=t.input.charCodeAt(t.position);ns(T);)T=t.input.charCodeAt(++t.position);if(T===58)T=t.input.charCodeAt(++t.position),Vr(T)||fe(t,"a whitespace character is expected after the key-value separator within a block mapping"),R&&(gc(t,d,m,g,y,null,i,s,a),g=y=w=null),x=!0,R=!1,n=!1,g=t.tag,y=t.result;else if(x)fe(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(x)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===L||t.lineIndent>e)&&(R&&(i=t.line,s=t.lineStart,a=t.position),yc(t,e,
|
|
253
|
-
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new
|
|
252
|
+
`,i?1+l:l),i=!0,s=!0,l=0;let g=t.position;for(;!Ri(m)&&m!==0;)m=t.input.charCodeAt(++t.position);no(t,g,t.position,!1)}return!0}function WT(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Sa(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(!Vr(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(yc(t,e,YT,!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 rA(t,e,r){let n,i,s,a,l=t.tag,f=t.anchor,d={},m=Object.create(null),g=null,y=null,w=null,R=!1,x=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Sa(t,t.anchor,d);let T=t.input.charCodeAt(t.position);for(;T!==0;){!R&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,fe(t,"tab characters must not be used in indentation"));let q=t.input.charCodeAt(t.position+1),L=t.line;if((T===63||T===58)&&Vr(q))T===63?(R&&(gc(t,d,m,g,y,null,i,s,a),g=y=w=null),x=!0,R=!0,n=!0):R?(R=!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,T=q;else{if(i=t.line,s=t.lineStart,a=t.position,!yc(t,r,JT,!1,!0))break;if(t.line===L){for(T=t.input.charCodeAt(t.position);ns(T);)T=t.input.charCodeAt(++t.position);if(T===58)T=t.input.charCodeAt(++t.position),Vr(T)||fe(t,"a whitespace character is expected after the key-value separator within a block mapping"),R&&(gc(t,d,m,g,y,null,i,s,a),g=y=w=null),x=!0,R=!1,n=!1,g=t.tag,y=t.result;else if(x)fe(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(x)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===L||t.lineIndent>e)&&(R&&(i=t.line,s=t.lineStart,a=t.position),yc(t,e,hg,!0,n)&&(R?y=t.result:w=t.result),R||(gc(t,d,m,g,y,w,i,s,a),g=y=w=null),Lt(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===L||t.lineIndent>e)&&T!==0)fe(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return R&&gc(t,d,m,g,y,null,i,s,a),x&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=d),x}function E4(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&&!Vr(s);)s===33&&(r?fe(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(a-1,t.position+1),GT.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),f4.test(i)&&fe(t,"tag suffix cannot contain flow indicator characters")}i&&!KT.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:ei.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 C4(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&&!Vr(e)&&!mc(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 O4(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&&!Vr(e)&&!mc(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 ei.call(t.anchorMap,n)||fe(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Lt(t,!0,-1),!0}function I4(t,e,r,n){let i=tA(t);return y4(t),HT(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,rA(t,r,n)&&t.kind==="mapping"?(v4(t),!0):(b4(t),HT(t,i),!1)}function yc(t,e,r,n,i){let s,a,l=1,f=!1,d=!1,m=null,g,y,w;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 R=s=a=hg===r||YT===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 x=t.input.charCodeAt(t.position),T=tA(t);if(f&&(x===33&&t.tag!==null||x===38&&t.anchor!==null)||!E4(t)&&!C4(t))break;m===null&&(m=T),Lt(t,!0,-1)?(f=!0,a=R,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):a=!1}if(a&&(a=f||i),l===1||hg===r)if(pg===r||JT===r?y=e:y=e+1,w=t.position-t.lineStart,l===1)if(a&&(WT(t,w)||rA(t,w,y))||x4(t,y))d=!0;else{let x=t.input.charCodeAt(t.position);m!==null&&R&&!a&&x!==124&&x!==62&&I4(t,m,m.position-m.lineStart,y)||s&&R4(t,y)||w4(t,y)||_4(t,y)?d=!0:O4(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&fe(t,"alias node should not have any properties")):S4(t,y,pg===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&Sa(t,t.anchor,t.result)}else l===0&&(d=a&&WT(t,w));if(t.tag===null)t.anchor!==null&&Sa(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 x=0,T=t.implicitTypes.length;x<T;x+=1)if(g=t.implicitTypes[x],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&Sa(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ei.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else{g=null;let x=t.typeMap.multi[t.kind||"fallback"];for(let T=0,q=x.length;T<q;T+=1)if(t.tag.slice(0,x[T].tag.length)===x[T].tag){g=x[T];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&&Sa(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 P4(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&&!Vr(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(;ns(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ri(n));break}if(Ri(n))break;for(i=t.position;n!==0&&!Vr(n);)n=t.input.charCodeAt(++t.position);a.push(t.input.slice(i,t.position))}n!==0&&hx(t),ei.call(BT,s)?BT[s](t,s,a):mg(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"),yc(t,t.lineIndent-1,hg,!1,!0),Lt(t,!0,-1),t.checkLineBreaks&&u4.test(t.input.slice(e,t.position))&&mg(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&gg(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 nA(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
253
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new g4(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;)P4(r);return r.documents}function k4(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=nA(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function T4(t,e){let r=nA(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new zT("expected a single document in the stream, but found more")}}gx.exports.loadAll=k4;gx.exports.load=T4});var EA=F((hee,RA)=>{"use strict";var bg=pc(),ud=hc(),A4=dg(),pA=Object.prototype.toString,hA=Object.prototype.hasOwnProperty,wx=65279,q4=9,ad=10,$4=13,M4=32,N4=33,D4=34,yx=35,F4=37,L4=38,j4=39,U4=42,mA=44,H4=45,yg=58,B4=61,V4=62,W4=63,z4=64,gA=91,yA=93,J4=96,vA=123,Y4=124,bA=125,dr={};dr[0]="\\0";dr[7]="\\a";dr[8]="\\b";dr[9]="\\t";dr[10]="\\n";dr[11]="\\v";dr[12]="\\f";dr[13]="\\r";dr[27]="\\e";dr[34]='\\"';dr[92]="\\\\";dr[133]="\\N";dr[160]="\\_";dr[8232]="\\L";dr[8233]="\\P";var G4=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],K4=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Q4(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&&hA.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[a]=l}return r}function Z4(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 ud("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+bg.repeat("0",r-n.length)+n}var X4=1,ld=2;function e3(t){this.schema=t.schema||A4,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=bg.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Q4(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==='"'?ld:X4,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 sA(t,e){let r=bg.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let a,l=t.indexOf(`
|
|
254
254
|
`,n);l===-1?(a=t.slice(n),n=s):(a=t.slice(n,l+1),n=l+1),a.length&&a!==`
|
|
255
|
-
`&&(i+=r),i+=a}return i}function
|
|
256
|
-
`+
|
|
255
|
+
`&&(i+=r),i+=a}return i}function vx(t,e){return`
|
|
256
|
+
`+bg.repeat(" ",t.indent*e)}function t3(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 vg(t){return t===M4||t===q4}function cd(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==wx||t>=65536&&t<=1114111}function oA(t){return cd(t)&&t!==wx&&t!==$4&&t!==ad}function aA(t,e,r){let n=oA(t),i=n&&!vg(t);return(r?n:n&&t!==mA&&t!==gA&&t!==yA&&t!==vA&&t!==bA)&&t!==yx&&!(e===yg&&!i)||oA(e)&&!vg(e)&&t===yx||e===yg&&i}function r3(t){return cd(t)&&t!==wx&&!vg(t)&&t!==H4&&t!==W4&&t!==yg&&t!==mA&&t!==gA&&t!==yA&&t!==vA&&t!==bA&&t!==yx&&t!==L4&&t!==U4&&t!==N4&&t!==Y4&&t!==B4&&t!==V4&&t!==j4&&t!==D4&&t!==F4&&t!==z4&&t!==J4}function n3(t){return!vg(t)&&t!==yg}function od(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 SA(t){return/^\n* /.test(t)}var wA=1,bx=2,_A=3,xA=4,vc=5;function i3(t,e,r,n,i,s,a,l){let f,d=0,m=null,g=!1,y=!1,w=n!==-1,R=-1,x=r3(od(t,0))&&n3(od(t,t.length-1));if(e||a)for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=od(t,f),!cd(d))return vc;x=x&&aA(d,m,l),m=d}else{for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=od(t,f),d===ad)g=!0,w&&(y=y||f-R-1>n&&t[R+1]!==" ",R=f);else if(!cd(d))return vc;x=x&&aA(d,m,l),m=d}y=y||w&&f-R-1>n&&t[R+1]!==" "}return!g&&!y?x&&!a&&!i(t)?wA:s===ld?vc:bx:r>9&&SA(t)?vc:a?s===ld?vc:bx:y?xA:_A}function s3(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===ld?'""':"''";if(!t.noCompatMode&&(G4.indexOf(e)!==-1||K4.test(e)))return t.quotingType===ld?'"'+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 t3(t,d)}switch(i3(e,l,t.indent,a,f,t.quotingType,t.forceQuotes&&!n,i)){case wA:return e;case bx:return"'"+e.replace(/'/g,"''")+"'";case _A:return"|"+lA(e,t.indent)+cA(sA(e,s));case xA:return">"+lA(e,t.indent)+cA(sA(o3(e,a),s));case vc:return'"'+a3(e,a)+'"';default:throw new ud("impossible error: invalid scalar style")}})()}function lA(t,e){let r=SA(t)?String(e):"",n=t[t.length-1]===`
|
|
257
257
|
`,s=n&&(t[t.length-2]===`
|
|
258
258
|
`||t===`
|
|
259
259
|
`)?"+":n?"":"-";return r+s+`
|
|
260
260
|
`}function cA(t){return t[t.length-1]===`
|
|
261
|
-
`?t.slice(0,-1):t}function
|
|
261
|
+
`?t.slice(0,-1):t}function o3(t,e){let r=/(\n+)([^\n]*)/g,n=(function(){let l=t.indexOf(`
|
|
262
262
|
`);return l=l!==-1?l:t.length,r.lastIndex=l,uA(t.slice(0,l),e)})(),i=t[0]===`
|
|
263
263
|
`||t[0]===" ",s,a;for(;a=r.exec(t);){let l=a[1],f=a[2];s=f[0]===" ",n+=l+(!i&&!s&&f!==""?`
|
|
264
264
|
`:"")+uA(f,e),i=s}return n}function uA(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+=`
|
|
265
265
|
`+t.slice(i,s),i=s+1),a=l;return f+=`
|
|
266
266
|
`,t.length-i>e&&a>i?f+=t.slice(i,a)+`
|
|
267
|
-
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function
|
|
268
|
-
`:""}RA.exports.dump=
|
|
267
|
+
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function a3(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=od(t,n);let i=dr[r];!i&&cd(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||Z4(r)}return e}function l3(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)),(is(t,e,l,!1,!1)||typeof l>"u"&&is(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function fA(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)),(is(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&is(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=vx(t,e)),t.dump&&ad===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function c3(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)),is(t,e,d,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),is(t,e,m,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function u3(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 ud("sortKeys must be a boolean or a function");for(let l=0,f=a.length;l<f;l+=1){let d="";(!n||i!=="")&&(d+=vx(t,e));let m=a[l],g=r[m];if(t.replacer&&(g=t.replacer.call(r,m,g)),!is(t,e+1,m,!0,!0,!0))continue;let y=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;y&&(t.dump&&ad===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,y&&(d+=vx(t,e)),is(t,e+1,g,!0,y)&&(t.dump&&ad===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d)}t.tag=s,t.dump=i||"{}"}function dA(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(pA.call(a.represent)==="[object Function]")f=a.represent(e,l);else if(hA.call(a.represent,l))f=a.represent[l](e,l);else throw new ud("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=f}return!0}}return!1}function is(t,e,r,n,i,s,a){t.tag=null,t.dump=r,dA(t,r,!1)||dA(t,r,!0);let l=pA.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?(u3(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(c3(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?fA(t,e-1,t.dump,i):fA(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(l3(t,e,t.dump),g&&(t.dump="&ref_"+m+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&s3(t,t.dump,e,s,f);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new ud("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 f3(t,e){let r=[],n=[];Sx(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 Sx(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)Sx(t[i],e,r);else{let i=Object.keys(t);for(let s=0,a=i.length;s<a;s+=1)Sx(t[i[s]],e,r)}}}function d3(t,e){e=e||{};let r=new e3(e);r.noRefs||f3(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),is(r,0,n,!0,!0)?r.dump+`
|
|
268
|
+
`:""}RA.exports.dump=d3});var xx=F((mee,Cr)=>{"use strict";var CA=iA(),p3=EA();function _x(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.")}}Cr.exports.Type=fr();Cr.exports.Schema=G_();Cr.exports.FAILSAFE_SCHEMA=X_();Cr.exports.JSON_SCHEMA=ix();Cr.exports.CORE_SCHEMA=sx();Cr.exports.DEFAULT_SCHEMA=dg();Cr.exports.load=CA.load;Cr.exports.loadAll=CA.loadAll;Cr.exports.dump=p3.dump;Cr.exports.YAMLException=hc();Cr.exports.types={binary:cx(),float:nx(),map:Z_(),null:ex(),pairs:fx(),set:dx(),timestamp:ox(),bool:tx(),int:rx(),merge:ax(),omap:ux(),seq:Q_(),str:K_()};Cr.exports.safeLoad=_x("safeLoad","load");Cr.exports.safeLoadAll=_x("safeLoadAll","loadAll");Cr.exports.safeDump=_x("safeDump","dump")});var OA=F(fd=>{"use strict";var h3=fd&&fd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fd,"__esModule",{value:!0});var m3=Rn(),g3=h3(xx()),y3=xx();fd.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 g3.default.load(e,{schema:y3.JSON_SCHEMA})}catch(r){throw new m3.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var IA=F(Rx=>{"use strict";Object.defineProperty(Rx,"__esModule",{value:!0});var v3=Rn(),b3=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;Rx.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&b3.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 v3.ParserError("data is not text",t.url)}}});var PA=F(Ex=>{"use strict";Object.defineProperty(Ex,"__esModule",{value:!0});var S3=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;Ex.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&S3.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var qA=F(ti=>{"use strict";var w3=ti&&ti.__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]})),_3=ti&&ti.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),x3=ti&&ti.__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"&&w3(r,e,n[i]);return _3(r,e),r}})(),R3=ti&&ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ti,"__esModule",{value:!0});var E3=R3(nt("fs")),kA=eo(),TA=x3(xn()),AA=Rn();ti.default={order:100,canRead(t){return TA.isFileSystemPath(t.url)},async read(t){let e;try{e=TA.toFileSystemPath(t.url)}catch(r){throw new AA.ResolverError(kA.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await E3.default.promises.readFile(e)}catch(r){throw new AA.ResolverError((0,kA.ono)(r,`Error opening file "${e}"`),e)}}}});var NA=F(ss=>{"use strict";var C3=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]})),O3=ss&&ss.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I3=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"&&C3(r,e,n[i]);return O3(r,e),r}})();Object.defineProperty(ss,"__esModule",{value:!0});var Sg=eo(),dd=I3(xn()),$A=Rn();ss.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return dd.isHttp(t.url)},read(t){let e=dd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=dd.parse(location.href).protocol),MA(e,this)}};async function MA(t,e,r){t=dd.parse(t);let n=r||[];n.push(t.href);try{let i=await P3(t,e);if(i.status>=400)throw(0,Sg.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new $A.ResolverError((0,Sg.ono)({status:i.status},`Error downloading ${n[0]}.
|
|
269
269
|
Too many redirects:
|
|
270
270
|
${n.join(`
|
|
271
|
-
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,yg.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=ud.resolve(t.href,i.headers.location);return MA(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new $A.ResolverError((0,yg.ono)(i,`Error downloading ${t.href}`),t.href)}}async function O3(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 Rx=F(os=>{"use strict";var bc=os&&os.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(os,"__esModule",{value:!0});os.getNewOptions=os.getJsonSchemaRefParserDefaultOptions=void 0;var I3=bc(cT()),P3=bc(OA()),k3=bc(IA()),T3=bc(PA()),A3=bc(qA()),q3=bc(NA()),$3=()=>({parse:{json:{...I3.default},yaml:{...P3.default},text:{...k3.default},binary:{...T3.default}},resolve:{file:{...A3.default},http:{...q3.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});os.getJsonSchemaRefParserDefaultOptions=$3;var M3=t=>{let e=(0,os.getJsonSchemaRefParserDefaultOptions)();return t&&FA(e,t),e};os.getNewOptions=M3;function FA(t,e){if(DA(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];DA(s)?t[i]=FA(a||{},s):s!==void 0&&(t[i]=s)}}return t}function DA(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var jA=F(vg=>{"use strict";Object.defineProperty(vg,"__esModule",{value:!0});vg.normalizeArgs=LA;var N3=Rx();function LA(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,N3.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}}vg.default=LA});var UA=F(ri=>{"use strict";var D3=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]})),F3=ri&&ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L3=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"&&D3(r,e,n[i]);return F3(r,e),r}})(),Ex=ri&&ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ri,"__esModule",{value:!0});var j3=Ex(fc()),U3=Ex(Xf()),H3=Ex(U_()),Sc=L3(xn()),B3=Rn();function V3(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=Cx(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function Cx(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),j3.default.isExternal$Ref(t)&&a.push(W3(t,e,r,n));let l=Object.keys(t);for(let f of l){let d=U3.default.join(e,f),m=t[f];a=a.concat(Cx(m,d,r,n,i,s))}}return a}async function W3(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Sc.resolve(i?Sc.cwd():e,t.$ref),a=Sc.stripHash(s),l=r._$refs[a];if(l)return Promise.resolve(l.value);try{let f=await(0,H3.default)(s,r,n),d=Cx(f,a+"#",r,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,B3.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Sc.stripHash(e)),f.path=Sc.safePointerToPath(Sc.getHash(e))),[]}}ri.default=V3});var VA=F(ni=>{"use strict";var z3=ni&&ni.__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]})),J3=ni&&ni.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y3=ni&&ni.__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"&&z3(r,e,n[i]);return J3(r,e),r}})(),BA=ni&&ni.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ni,"__esModule",{value:!0});var bg=BA(fc()),fd=BA(Xf()),Ox=Y3(xn());function G3(t,e){let r=[];Ix(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),K3(r)}function Ix(t,e,r,n,i,s,a,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(bg.default.isAllowed$Ref(f))HA(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=fd.default.join(r,m),y=fd.default.join(n,m),w=f[m];bg.default.isAllowed$Ref(w)?HA(f,m,r,y,i,s,a,l):Ix(f,m,g,y,i,s,a,l)}}}function HA(t,e,r,n,i,s,a,l){let f=e===null?t:t[e],d=Ox.resolve(r,f.$ref),m=a._resolve(d,n,l);if(m===null)return;let y=fd.default.parse(n).length,w=Ox.stripHash(m.path),R=Ox.getHash(m.path),x=w!==a._root$Ref.path,T=bg.default.isExtended$Ref(f);i+=m.indirections;let q=Q3(s,t,e);if(q)if(y<q.depth||i<q.indirections)Z3(s,q);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:y,file:w,hash:R,value:m.value,circular:m.circular,extended:T,external:x,indirections:i}),(!q||x)&&Ix(m.value,null,m.path,n,i+1,s,a,l)}function K3(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=fd.default.join(n,fd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=bg.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function Q3(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function Z3(t,e){let r=t.indexOf(e);t.splice(r,1)}ni.default=G3});var KA=F(ii=>{"use strict";var X3=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]})),e9=ii&&ii.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),t9=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"&&X3(r,e,n[i]);return e9(r,e),r}})(),YA=ii&&ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ii,"__esModule",{value:!0});var Sg=YA(fc()),WA=YA(Xf()),r9=eo(),zA=t9(xn()),n9=Rn();ii.default=i9;function i9(t,e){let r=Date.now(),n=Px(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 Px(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 n9.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),Sg.default.isAllowed$Ref(t,l))d=JA(t,e,r,n,i,s,a,l,f),m.circular=d.circular,m.value=d.value;else for(let w of Object.keys(t)){let R=WA.default.join(e,w),x=WA.default.join(r,w);if(y(x))continue;let T=t[w],q=!1;if(Sg.default.isAllowed$Ref(T,l)){if(d=JA(T,R,x,n,i,s,a,l,f),q=d.circular,t[w]!==d.value){let L=new Map;g?.preservedProperties&&typeof t[w]=="object"&&!Array.isArray(t[w])&&g?.preservedProperties.forEach(V=>{V in t[w]&&L.set(V,t[w][V])}),t[w]=d.value,g?.preservedProperties&&L.size&&typeof t[w]=="object"&&!Array.isArray(t[w])&&L.forEach((V,B)=>{t[w][B]=V}),g?.onDereference?.(T.$ref,t[w],t,w)}}else n.has(T)?q=GA(R,a,l):(d=Px(T,R,x,n,i,s,a,l,f),q=d.circular,t[w]!==d.value&&(t[w]=d.value));m.circular=m.circular||q}n.delete(t)}return m}function JA(t,e,r,n,i,s,a,l,f){let m=Sg.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",g=zA.resolve(m?zA.cwd():e,t.$ref),y=s.get(g);if(y&&!y.circular){let L=Object.keys(t);if(L.length>1){let V={};for(let B of L)B!=="$ref"&&!(B in y.value)&&(V[B]=t[B]);return{circular:y.circular,value:Object.assign({},y.value,V)}}return y}let w=a._resolve(g,e,l);if(w===null)return{circular:!1,value:null};let R=w.circular,x=R||n.has(w.value);x&&GA(e,a,l);let T=Sg.default.dereference(t,w.value);if(!x){let L=Px(T,w.path,r,n,i,s,a,l,f);x=L.circular,T=L.value}x&&!R&&l.dereference?.circular==="ignore"&&(T=t),R&&(T.$ref=r);let q={circular:x,value:T};return Object.keys(t).length===1&&s.set(g,q),q}function GA(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw r9.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var QA=F(kx=>{"use strict";Object.defineProperty(kx,"__esModule",{value:!0});function s9(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}kx.default=s9()});var XA=F(dd=>{"use strict";var o9=dd&&dd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dd,"__esModule",{value:!0});dd.default=a9;var ZA=o9(QA());function a9(t,e){if(t){e.then(function(r){(0,ZA.default)(function(){t(null,r)})},function(r){(0,ZA.default)(function(){t(r)})});return}else return e}});var nq=F(_e=>{"use strict";var l9=_e&&_e.__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]})),c9=_e&&_e.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u9=_e&&_e.__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"&&l9(r,e,n[i]);return c9(r,e),r}})(),_a=_e&&_e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_e,"__esModule",{value:!0});_e.getJsonSchemaRefParserDefaultOptions=_e.jsonSchemaParserNormalizeArgs=_e.dereferenceInternal=_e.JSONParserErrorGroup=_e.isHandledError=_e.UnmatchedParserError=_e.ParserError=_e.ResolverError=_e.MissingPointerError=_e.InvalidPointerError=_e.JSONParserError=_e.UnmatchedResolverError=_e.dereference=_e.bundle=_e.resolve=_e.parse=_e.$RefParser=void 0;var eq=_a(iT()),f9=_a(U_()),pd=_a(jA());_e.jsonSchemaParserNormalizeArgs=pd.default;var d9=_a(UA()),p9=_a(VA()),rq=_a(KA());_e.dereferenceInternal=rq.default;var wa=u9(xn()),En=Rn();Object.defineProperty(_e,"JSONParserError",{enumerable:!0,get:function(){return En.JSONParserError}});Object.defineProperty(_e,"InvalidPointerError",{enumerable:!0,get:function(){return En.InvalidPointerError}});Object.defineProperty(_e,"MissingPointerError",{enumerable:!0,get:function(){return En.MissingPointerError}});Object.defineProperty(_e,"ResolverError",{enumerable:!0,get:function(){return En.ResolverError}});Object.defineProperty(_e,"ParserError",{enumerable:!0,get:function(){return En.ParserError}});Object.defineProperty(_e,"UnmatchedParserError",{enumerable:!0,get:function(){return En.UnmatchedParserError}});Object.defineProperty(_e,"UnmatchedResolverError",{enumerable:!0,get:function(){return En.UnmatchedResolverError}});Object.defineProperty(_e,"isHandledError",{enumerable:!0,get:function(){return En.isHandledError}});Object.defineProperty(_e,"JSONParserErrorGroup",{enumerable:!0,get:function(){return En.JSONParserErrorGroup}});var tq=eo(),si=_a(XA()),h9=Rx();Object.defineProperty(_e,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return h9.getJsonSchemaRefParserDefaultOptions}});var io=class t{constructor(){this.schema=null,this.$refs=new eq.default}async parse(){let e=(0,pd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,tq.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,si.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new eq.default;let n="http";if(wa.isFileSystemPath(e.path))e.path=wa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=wa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=wa.resolve(wa.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,f9.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,si.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,si.default)(e.callback,Promise.resolve(this.schema));throw tq.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,En.isHandledError)(i)?(0,si.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[wa.stripHash(e.path)]&&this.$refs._$refs[wa.stripHash(e.path)].addError(i),(0,si.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,pd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,d9.default)(this,e.options),Tx(this),(0,si.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,si.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,pd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,p9.default)(this,e.options),Tx(this),(0,si.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,si.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,pd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,rq.default)(this,e.options),Tx(this),(0,si.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,si.default)(e.callback,Promise.reject(r))}}};_e.$RefParser=io;_e.default=io;function Tx(t){if(En.JSONParserErrorGroup.getParserErrors(t).length>0)throw new En.JSONParserErrorGroup(t)}_e.parse=io.parse;_e.resolve=io.resolve;_e.bundle=io.bundle;_e.dereference=io.dereference});var wg,wc,Ax=le(()=>{"use strict";wg=ib(nq()),wc=class{async resolve(e){try{return await wg.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 wg.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await wg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as iq from"fs";var sq,m9,_c,qx=le(()=>{"use strict";sq=ib(g_());mn();v_();Ax();m9=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],_c=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new oc,this.refResolver=new wc}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await iq.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=sq.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:ft(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:ft(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 w of["get","post","put","patch","delete","head","options","trace"]){let R=y[w];if(!R)continue;let x=this.processOperation(w,g,R,y,i,s),T=R.tags?.[0];if(T&&d.has(T))d.get(T).items.push(x);else if(T){let q={type:"folder",id:ft(T),name:T,items:[x]};d.set(T,q),f.items.push(q)}else f.items.push(x)}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=ft(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 w=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);w&&(g.auth=w)}}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),w=f.deprecated===!0;switch(m){case"path":{if(f.description||g.type||g.format||g.enum||w||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 x={value:y};g.oneOf?(x.oneOf=g.oneOf,this.applyOneOfHints(x,g.oneOf)):(g.type&&(x.type=g.type),g.format&&(x.format=g.format),g.enum&&(x.enum=g.enum.map(String)),g.pattern&&(x.pattern=g.pattern),g.minimum!==void 0&&(x.minimum=g.minimum),g.maximum!==void 0&&(x.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(x.multipleOf=g.multipleOf),g.minLength!==void 0&&(x.minLength=g.minLength),g.maxLength!==void 0&&(x.maxLength=g.maxLength),g.minItems!==void 0&&(x.minItems=g.minItems),g.maxItems!==void 0&&(x.maxItems=g.maxItems),g.uniqueItems&&(x.uniqueItems=!0),g.nullable&&(x.nullable=!0)),f.description&&(x.description=f.description),w&&(x.deprecated=!0),a[d]=x}else a[d]=y;break}case"query":{let R={key:d,value:y};this.applySchemaConstraints(R,g,f,w),s.push(R);break}case"header":{let R={key:d,value:y};this.applySchemaConstraints(R,g,f,w),i.push(R);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 m9)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 xc,$x=le(()=>{"use strict";xc=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 oq,_g,aq,lq,cq,uq,fq,Rc,Mx=le(()=>{"use strict";oq=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,_g="(?:pm|hf|ctx)",aq=new RegExp(`${_g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),lq=new RegExp(`${_g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),cq=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,uq=new RegExp(`${_g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),fq=new RegExp(`${_g}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Rc=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(oq.source,oq.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(aq.source,aq.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(lq.source,lq.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(uq.source,uq.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(fq.source,fq.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(cq.source,cq.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 dq={};ks(dq,{AwsSecretResolver:()=>xg});var xg,Nx=le(()=>{"use strict";xg=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=>nt(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 pq={};ks(pq,{AzureKeyVaultResolver:()=>Rg});var Rg,Dx=le(()=>{"use strict";Rg=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=>nt(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 hq={};ks(hq,{HashiCorpVaultResolver:()=>Eg});var Eg,Fx=le(()=>{"use strict";Eg=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 mq={};ks(mq,{OnePasswordResolver:()=>Cg});import{execFile as g9}from"child_process";import{promisify as y9}from"util";var v9,Cg,Lx=le(()=>{"use strict";v9=y9(g9),Cg=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}=nt("@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 v9("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 gq={};ks(gq,{GcpSecretResolver:()=>Og});var Og,jx=le(()=>{"use strict";Og=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=>nt(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 vq={};ks(vq,{DopplerResolver:()=>Ig});import*as yq from"https";var Ig,Ux=le(()=>{"use strict";Ig=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=yq.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 Pg from"fs";import{createRequire as b9}from"module";import*as bq from"path";var hd,Hx=le(()=>{"use strict";hd=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 w=y?.message??String(y);console.warn(`[HTTP Forge] {{${a}}} could not be resolved: ${w}`)}}));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}=(Nx(),gl(dq));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(Dx(),gl(pq));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(Fx(),gl(hq));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(Lx(),gl(mq));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(jx(),gl(gq));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(Ux(),gl(vq));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>nt(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=bq.resolve(i,"package.json");if(Pg.existsSync(s)){let a=Pg.realpathSync(s),l=b9(a);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});var kg,Bx=le(()=>{"use strict";kg={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Tt from"fs";import*as so from"path";var md,Vx=le(()=>{"use strict";mn();Bx();md=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=so.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:ft(e),name:e,requests:r,config:{...kg},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=so.join(this.suitesDir,e),a=so.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=so.join(e,n.name),s=so.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=so.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:{...kg},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:ft(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=so.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Tt.writeFileSync(n,i,"utf-8")}}});var re,Tg=le(()=>{"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 Sq from"path";function Ag(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 zl(r,n,i)),t.registerSingleton(re.Console,()=>m??S9),t.registerSingleton(re.EnvironmentConfig,y=>new yf(r,s,y.resolve(re.Config),n,l)),t.registerSingleton(re.Cookie,()=>new hf(a)),t.registerSingleton(re.Collection,y=>new pf(r,y.resolve(re.Config),n)),t.registerSingleton(re.TestSuite,y=>new md(y.resolve(re.Collection),y.resolve(re.Config))),t.registerSingleton(re.HttpClient,()=>new Vo),t.registerSingleton(re.UrlBuilder,()=>new Un),t.registerSingleton(re.InterceptorChain,()=>new zi),t.registerSingleton(re.HttpRequest,y=>new Wi(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),t.registerSingleton(re.RequestPreprocessor,()=>new na),t.registerSingleton(re.RequestHistory,y=>{let w=y.resolve(re.EnvironmentConfig);return new wf(w.getHistoriesPath(),Sq.join(w.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(re.OAuth2TokenManager,y=>new uf(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),t.registerSingleton(re.GraphQLSchemaService,y=>new bf(y.resolve(re.HttpClient))),t.registerSingleton(re.SecretResolverRegistry,y=>new hd(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(re.RequestPreparer,y=>new vf(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 w=y.resolve(re.Config);return new Qi(y.resolve(re.HttpRequest),w.getModulePaths(),y.resolve(re.SecretResolverRegistry))}),t.registerSingleton(re.DataFileParser,()=>new sa),t.registerSingleton(re.CollectionRequestExecutor,y=>new Hs(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),t.registerSingleton(re.PersistentCookieJar,y=>new mf(y.resolve(re.Cookie))),t.registerSingleton(re.SchemaInferrer,()=>new Xs),t.registerSingleton(re.HistoryAnalyzer,y=>new Jl(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.ScriptAnalyzer,()=>new Rc),t.registerSingleton(re.SchemaInferenceService,y=>new xc(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.OpenApiExporter,y=>new sc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),t.registerSingleton(re.OpenApiImporter,y=>new _c(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var S9,Wx=le(()=>{"use strict";h0();b0();w0();_0();x0();E0();Bh();C0();O0();$0();Eu();Cu();Ru();Fh();Sl();M0();y_();qx();$x();zm();Mx();Lh();of();Hx();Vx();Tg();S9={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function wq(){return xa.instance}var xa,zx=le(()=>{"use strict";Tg();xa=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)}}});var Ec,Jx=le(()=>{"use strict";bl();Ec=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())dt.isExpired(n)||(!n.domain||dt.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&&!dt.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())dt.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=dt.extractDomain(e),i=dt.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=dt.extractDomain(e),n=dt.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return dt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function qg(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function w9(t){return{index:t.i,iteration:t.it,name:t.n,method:Cc[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:qg(t.i,t.it,t.r),error:t.e}}var Yx,Cc,$g=le(()=>{"use strict";Yx={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Cc={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Ic from"fs/promises";import*as Oc from"path";function yt(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ra(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function Gx(t){try{return new Date(t).toLocaleString()}catch{return t}}function Mg(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function _9(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function Rq(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}function _q(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 x9(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(Rq(t))}</pre>`}function Kx(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])=>`
|
|
271
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Sg.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=dd.resolve(t.href,i.headers.location);return MA(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new $A.ResolverError((0,Sg.ono)(i,`Error downloading ${t.href}`),t.href)}}async function P3(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 Cx=F(os=>{"use strict";var bc=os&&os.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(os,"__esModule",{value:!0});os.getNewOptions=os.getJsonSchemaRefParserDefaultOptions=void 0;var k3=bc(cT()),T3=bc(OA()),A3=bc(IA()),q3=bc(PA()),$3=bc(qA()),M3=bc(NA()),N3=()=>({parse:{json:{...k3.default},yaml:{...T3.default},text:{...A3.default},binary:{...q3.default}},resolve:{file:{...$3.default},http:{...M3.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});os.getJsonSchemaRefParserDefaultOptions=N3;var D3=t=>{let e=(0,os.getJsonSchemaRefParserDefaultOptions)();return t&&FA(e,t),e};os.getNewOptions=D3;function FA(t,e){if(DA(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];DA(s)?t[i]=FA(a||{},s):s!==void 0&&(t[i]=s)}}return t}function DA(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var jA=F(wg=>{"use strict";Object.defineProperty(wg,"__esModule",{value:!0});wg.normalizeArgs=LA;var F3=Cx();function LA(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,F3.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}}wg.default=LA});var UA=F(ri=>{"use strict";var L3=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]})),j3=ri&&ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U3=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"&&L3(r,e,n[i]);return j3(r,e),r}})(),Ox=ri&&ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ri,"__esModule",{value:!0});var H3=Ox(fc()),B3=Ox(td()),V3=Ox(B_()),Sc=U3(xn()),W3=Rn();function z3(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=Ix(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function Ix(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),H3.default.isExternal$Ref(t)&&a.push(J3(t,e,r,n));let l=Object.keys(t);for(let f of l){let d=B3.default.join(e,f),m=t[f];a=a.concat(Ix(m,d,r,n,i,s))}}return a}async function J3(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Sc.resolve(i?Sc.cwd():e,t.$ref),a=Sc.stripHash(s),l=r._$refs[a];if(l)return Promise.resolve(l.value);try{let f=await(0,V3.default)(s,r,n),d=Ix(f,a+"#",r,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,W3.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Sc.stripHash(e)),f.path=Sc.safePointerToPath(Sc.getHash(e))),[]}}ri.default=z3});var VA=F(ni=>{"use strict";var Y3=ni&&ni.__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]})),G3=ni&&ni.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K3=ni&&ni.__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"&&Y3(r,e,n[i]);return G3(r,e),r}})(),BA=ni&&ni.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ni,"__esModule",{value:!0});var _g=BA(fc()),pd=BA(td()),Px=K3(xn());function Q3(t,e){let r=[];kx(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),Z3(r)}function kx(t,e,r,n,i,s,a,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(_g.default.isAllowed$Ref(f))HA(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=pd.default.join(r,m),y=pd.default.join(n,m),w=f[m];_g.default.isAllowed$Ref(w)?HA(f,m,r,y,i,s,a,l):kx(f,m,g,y,i,s,a,l)}}}function HA(t,e,r,n,i,s,a,l){let f=e===null?t:t[e],d=Px.resolve(r,f.$ref),m=a._resolve(d,n,l);if(m===null)return;let y=pd.default.parse(n).length,w=Px.stripHash(m.path),R=Px.getHash(m.path),x=w!==a._root$Ref.path,T=_g.default.isExtended$Ref(f);i+=m.indirections;let q=X3(s,t,e);if(q)if(y<q.depth||i<q.indirections)e9(s,q);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:y,file:w,hash:R,value:m.value,circular:m.circular,extended:T,external:x,indirections:i}),(!q||x)&&kx(m.value,null,m.path,n,i+1,s,a,l)}function Z3(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=pd.default.join(n,pd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=_g.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function X3(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function e9(t,e){let r=t.indexOf(e);t.splice(r,1)}ni.default=Q3});var KA=F(ii=>{"use strict";var t9=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]})),r9=ii&&ii.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n9=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"&&t9(r,e,n[i]);return r9(r,e),r}})(),YA=ii&&ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ii,"__esModule",{value:!0});var xg=YA(fc()),WA=YA(td()),i9=eo(),zA=n9(xn()),s9=Rn();ii.default=o9;function o9(t,e){let r=Date.now(),n=Tx(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 Tx(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 s9.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),xg.default.isAllowed$Ref(t,l))d=JA(t,e,r,n,i,s,a,l,f),m.circular=d.circular,m.value=d.value;else for(let w of Object.keys(t)){let R=WA.default.join(e,w),x=WA.default.join(r,w);if(y(x))continue;let T=t[w],q=!1;if(xg.default.isAllowed$Ref(T,l)){if(d=JA(T,R,x,n,i,s,a,l,f),q=d.circular,t[w]!==d.value){let L=new Map;g?.preservedProperties&&typeof t[w]=="object"&&!Array.isArray(t[w])&&g?.preservedProperties.forEach(V=>{V in t[w]&&L.set(V,t[w][V])}),t[w]=d.value,g?.preservedProperties&&L.size&&typeof t[w]=="object"&&!Array.isArray(t[w])&&L.forEach((V,B)=>{t[w][B]=V}),g?.onDereference?.(T.$ref,t[w],t,w)}}else n.has(T)?q=GA(R,a,l):(d=Tx(T,R,x,n,i,s,a,l,f),q=d.circular,t[w]!==d.value&&(t[w]=d.value));m.circular=m.circular||q}n.delete(t)}return m}function JA(t,e,r,n,i,s,a,l,f){let m=xg.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",g=zA.resolve(m?zA.cwd():e,t.$ref),y=s.get(g);if(y&&!y.circular){let L=Object.keys(t);if(L.length>1){let V={};for(let B of L)B!=="$ref"&&!(B in y.value)&&(V[B]=t[B]);return{circular:y.circular,value:Object.assign({},y.value,V)}}return y}let w=a._resolve(g,e,l);if(w===null)return{circular:!1,value:null};let R=w.circular,x=R||n.has(w.value);x&&GA(e,a,l);let T=xg.default.dereference(t,w.value);if(!x){let L=Tx(T,w.path,r,n,i,s,a,l,f);x=L.circular,T=L.value}x&&!R&&l.dereference?.circular==="ignore"&&(T=t),R&&(T.$ref=r);let q={circular:x,value:T};return Object.keys(t).length===1&&s.set(g,q),q}function GA(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw i9.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var QA=F(Ax=>{"use strict";Object.defineProperty(Ax,"__esModule",{value:!0});function a9(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}Ax.default=a9()});var XA=F(hd=>{"use strict";var l9=hd&&hd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hd,"__esModule",{value:!0});hd.default=c9;var ZA=l9(QA());function c9(t,e){if(t){e.then(function(r){(0,ZA.default)(function(){t(null,r)})},function(r){(0,ZA.default)(function(){t(r)})});return}else return e}});var nq=F(_e=>{"use strict";var u9=_e&&_e.__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=_e&&_e.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),d9=_e&&_e.__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}})(),_a=_e&&_e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_e,"__esModule",{value:!0});_e.getJsonSchemaRefParserDefaultOptions=_e.jsonSchemaParserNormalizeArgs=_e.dereferenceInternal=_e.JSONParserErrorGroup=_e.isHandledError=_e.UnmatchedParserError=_e.ParserError=_e.ResolverError=_e.MissingPointerError=_e.InvalidPointerError=_e.JSONParserError=_e.UnmatchedResolverError=_e.dereference=_e.bundle=_e.resolve=_e.parse=_e.$RefParser=void 0;var eq=_a(iT()),p9=_a(B_()),md=_a(jA());_e.jsonSchemaParserNormalizeArgs=md.default;var h9=_a(UA()),m9=_a(VA()),rq=_a(KA());_e.dereferenceInternal=rq.default;var wa=d9(xn()),En=Rn();Object.defineProperty(_e,"JSONParserError",{enumerable:!0,get:function(){return En.JSONParserError}});Object.defineProperty(_e,"InvalidPointerError",{enumerable:!0,get:function(){return En.InvalidPointerError}});Object.defineProperty(_e,"MissingPointerError",{enumerable:!0,get:function(){return En.MissingPointerError}});Object.defineProperty(_e,"ResolverError",{enumerable:!0,get:function(){return En.ResolverError}});Object.defineProperty(_e,"ParserError",{enumerable:!0,get:function(){return En.ParserError}});Object.defineProperty(_e,"UnmatchedParserError",{enumerable:!0,get:function(){return En.UnmatchedParserError}});Object.defineProperty(_e,"UnmatchedResolverError",{enumerable:!0,get:function(){return En.UnmatchedResolverError}});Object.defineProperty(_e,"isHandledError",{enumerable:!0,get:function(){return En.isHandledError}});Object.defineProperty(_e,"JSONParserErrorGroup",{enumerable:!0,get:function(){return En.JSONParserErrorGroup}});var tq=eo(),si=_a(XA()),g9=Cx();Object.defineProperty(_e,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return g9.getJsonSchemaRefParserDefaultOptions}});var io=class t{constructor(){this.schema=null,this.$refs=new eq.default}async parse(){let e=(0,md.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,tq.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,si.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new eq.default;let n="http";if(wa.isFileSystemPath(e.path))e.path=wa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=wa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=wa.resolve(wa.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,p9.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,si.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,si.default)(e.callback,Promise.resolve(this.schema));throw tq.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,En.isHandledError)(i)?(0,si.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[wa.stripHash(e.path)]&&this.$refs._$refs[wa.stripHash(e.path)].addError(i),(0,si.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,md.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,h9.default)(this,e.options),qx(this),(0,si.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,si.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,md.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,m9.default)(this,e.options),qx(this),(0,si.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,si.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,md.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,rq.default)(this,e.options),qx(this),(0,si.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,si.default)(e.callback,Promise.reject(r))}}};_e.$RefParser=io;_e.default=io;function qx(t){if(En.JSONParserErrorGroup.getParserErrors(t).length>0)throw new En.JSONParserErrorGroup(t)}_e.parse=io.parse;_e.resolve=io.resolve;_e.bundle=io.bundle;_e.dereference=io.dereference});var Rg,wc,$x=le(()=>{"use strict";Rg=ob(nq()),wc=class{async resolve(e){try{return await Rg.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 Rg.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Rg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as iq from"fs";var sq,y9,_c,Mx=le(()=>{"use strict";sq=ob(v_());mn();S_();$x();y9=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],_c=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new oc,this.refResolver=new wc}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await iq.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=sq.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:ft(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:ft(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 w of["get","post","put","patch","delete","head","options","trace"]){let R=y[w];if(!R)continue;let x=this.processOperation(w,g,R,y,i,s),T=R.tags?.[0];if(T&&d.has(T))d.get(T).items.push(x);else if(T){let q={type:"folder",id:ft(T),name:T,items:[x]};d.set(T,q),f.items.push(q)}else f.items.push(x)}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=ft(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 w=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);w&&(g.auth=w)}}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),w=f.deprecated===!0;switch(m){case"path":{if(f.description||g.type||g.format||g.enum||w||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 x={value:y};g.oneOf?(x.oneOf=g.oneOf,this.applyOneOfHints(x,g.oneOf)):(g.type&&(x.type=g.type),g.format&&(x.format=g.format),g.enum&&(x.enum=g.enum.map(String)),g.pattern&&(x.pattern=g.pattern),g.minimum!==void 0&&(x.minimum=g.minimum),g.maximum!==void 0&&(x.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(x.multipleOf=g.multipleOf),g.minLength!==void 0&&(x.minLength=g.minLength),g.maxLength!==void 0&&(x.maxLength=g.maxLength),g.minItems!==void 0&&(x.minItems=g.minItems),g.maxItems!==void 0&&(x.maxItems=g.maxItems),g.uniqueItems&&(x.uniqueItems=!0),g.nullable&&(x.nullable=!0)),f.description&&(x.description=f.description),w&&(x.deprecated=!0),a[d]=x}else a[d]=y;break}case"query":{let R={key:d,value:y};this.applySchemaConstraints(R,g,f,w),s.push(R);break}case"header":{let R={key:d,value:y};this.applySchemaConstraints(R,g,f,w),i.push(R);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 y9)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 xc,Nx=le(()=>{"use strict";xc=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 oq,Eg,aq,lq,cq,uq,fq,Rc,Dx=le(()=>{"use strict";oq=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,Eg="(?:pm|hf|ctx)",aq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),lq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),cq=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,uq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),fq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Rc=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(oq.source,oq.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(aq.source,aq.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(lq.source,lq.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(uq.source,uq.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(fq.source,fq.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(cq.source,cq.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 dq={};ks(dq,{AwsSecretResolver:()=>Cg});var Cg,Fx=le(()=>{"use strict";Cg=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=>nt(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 pq={};ks(pq,{AzureKeyVaultResolver:()=>Og});var Og,Lx=le(()=>{"use strict";Og=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=>nt(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 hq={};ks(hq,{HashiCorpVaultResolver:()=>Ig});var Ig,jx=le(()=>{"use strict";Ig=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 mq={};ks(mq,{OnePasswordResolver:()=>Pg});import{execFile as v9}from"child_process";import{promisify as b9}from"util";var S9,Pg,Ux=le(()=>{"use strict";S9=b9(v9),Pg=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}=nt("@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 S9("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 gq={};ks(gq,{GcpSecretResolver:()=>kg});var kg,Hx=le(()=>{"use strict";kg=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=>nt(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 vq={};ks(vq,{DopplerResolver:()=>Tg});import*as yq from"https";var Tg,Bx=le(()=>{"use strict";Tg=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=yq.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 Ag from"fs";import{createRequire as w9}from"module";import*as bq from"path";var gd,Vx=le(()=>{"use strict";gd=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 w=y?.message??String(y);console.warn(`[HTTP Forge] {{${a}}} could not be resolved: ${w}`)}}));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}=(Fx(),gl(dq));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(Lx(),gl(pq));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(jx(),gl(hq));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(Ux(),gl(mq));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(Hx(),gl(gq));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(Bx(),gl(vq));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>nt(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=bq.resolve(i,"package.json");if(Ag.existsSync(s)){let a=Ag.realpathSync(s),l=w9(a);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});var yd,Wx=le(()=>{"use strict";yd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Tt from"fs";import*as so from"path";var vd,zx=le(()=>{"use strict";mn();Wx();vd=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=so.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:ft(e),name:e,requests:r,config:{...yd},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=so.join(this.suitesDir,e),a=so.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=so.join(e,n.name),s=so.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=so.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:{...yd},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:{...yd},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:ft(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=so.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Tt.writeFileSync(n,i,"utf-8")}}});var re,qg=le(()=>{"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 Sq from"path";function $g(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 zl(r,n,i)),t.registerSingleton(re.Console,()=>m??_9),t.registerSingleton(re.EnvironmentConfig,y=>new bf(r,s,y.resolve(re.Config),n,l)),t.registerSingleton(re.Cookie,()=>new gf(a)),t.registerSingleton(re.Collection,y=>new mf(r,y.resolve(re.Config),n)),t.registerSingleton(re.TestSuite,y=>new vd(y.resolve(re.Collection),y.resolve(re.Config))),t.registerSingleton(re.HttpClient,()=>new Vo),t.registerSingleton(re.UrlBuilder,()=>new Un),t.registerSingleton(re.InterceptorChain,()=>new zi),t.registerSingleton(re.HttpRequest,y=>new Wi(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),t.registerSingleton(re.RequestPreprocessor,()=>new na),t.registerSingleton(re.RequestHistory,y=>{let w=y.resolve(re.EnvironmentConfig);return new xf(w.getHistoriesPath(),Sq.join(w.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(re.OAuth2TokenManager,y=>new df(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),t.registerSingleton(re.GraphQLSchemaService,y=>new wf(y.resolve(re.HttpClient))),t.registerSingleton(re.SecretResolverRegistry,y=>new gd(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(re.RequestPreparer,y=>new Sf(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 w=y.resolve(re.Config);return new Qi(y.resolve(re.HttpRequest),w.getModulePaths(),y.resolve(re.SecretResolverRegistry))}),t.registerSingleton(re.DataFileParser,()=>new sa),t.registerSingleton(re.CollectionRequestExecutor,y=>new Hs(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),t.registerSingleton(re.PersistentCookieJar,y=>new yf(y.resolve(re.Cookie))),t.registerSingleton(re.SchemaInferrer,()=>new Xs),t.registerSingleton(re.HistoryAnalyzer,y=>new Jl(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.ScriptAnalyzer,()=>new Rc),t.registerSingleton(re.SchemaInferenceService,y=>new xc(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.OpenApiExporter,y=>new sc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),t.registerSingleton(re.OpenApiImporter,y=>new _c(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var _9,Jx=le(()=>{"use strict";g0();w0();x0();R0();E0();O0();zh();I0();P0();N0();Ou();Iu();Cu();Uh();Sl();D0();b_();Mx();Nx();Gm();Dx();Hh();lf();Vx();zx();qg();_9={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function wq(){return xa.instance}var xa,Yx=le(()=>{"use strict";qg();xa=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)}}});var Ec,Gx=le(()=>{"use strict";bl();Ec=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())dt.isExpired(n)||(!n.domain||dt.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&&!dt.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())dt.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=dt.extractDomain(e),i=dt.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=dt.extractDomain(e),n=dt.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return dt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Mg(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function x9(t){return{index:t.i,iteration:t.it,name:t.n,method:Cc[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Mg(t.i,t.it,t.r),error:t.e}}var Kx,Cc,Ng=le(()=>{"use strict";Kx={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Cc={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Ic from"fs/promises";import*as Oc from"path";function yt(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ra(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function Qx(t){try{return new Date(t).toLocaleString()}catch{return t}}function Dg(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function R9(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function Rq(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}function _q(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 E9(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(Rq(t))}</pre>`}function Zx(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])=>`
|
|
272
272
|
<tr>
|
|
273
273
|
<td class="kv-key">${yt(r)}</td>
|
|
274
|
-
<td class="kv-val">${
|
|
275
|
-
</tr>`).join("")}</table>`}function
|
|
274
|
+
<td class="kv-val">${E9(n)}</td>
|
|
275
|
+
</tr>`).join("")}</table>`}function C9(t){return!t||t.length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${t.map(r=>`
|
|
276
276
|
<tr>
|
|
277
277
|
<td class="kv-key">${yt(r.name??"(unnamed)")}</td>
|
|
278
278
|
<td class="kv-val">${yt(r.value??"")}</td>
|
|
279
|
-
</tr>`).join("")}</table>`}function xq(t,e){if(t==null||t==="")return'<span class="dim">\u2014 empty \u2014</span>';let r=Rq(t);return`<pre class="code">${yt(r)}</pre>`}var
|
|
279
|
+
</tr>`).join("")}</table>`}function xq(t,e){if(t==null||t==="")return'<span class="dim">\u2014 empty \u2014</span>';let r=Rq(t);return`<pre class="code">${yt(r)}</pre>`}var bd,Xx=le(()=>{"use strict";Ng();bd=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Oc.join(this.basePath,e,r),i=JSON.parse(await Ic.readFile(Oc.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=Oc.join(n,"report.html");return await Ic.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Oc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let a=JSON.parse(await Ic.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=Mg(i.i,i.it,i.r),a=`${i.i}-${i.it}`;try{let l=JSON.parse(await Ic.readFile(Oc.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(x=>x.p).length,y=d.items.length,w=g<y,R=d.items.map(n).join("");return`
|
|
280
280
|
<details class="group-block${w?" group-fail":""}" open>
|
|
281
281
|
<summary class="group-head">
|
|
282
282
|
<span class="group-title">\u{1F4C1} ${this.groupLabel(d.cn,d.fp,m+1)}</span>
|
|
@@ -290,7 +290,7 @@ Too many redirects:
|
|
|
290
290
|
<span class="dim iter-count">(${l}/${f} passed)</span>
|
|
291
291
|
</summary>
|
|
292
292
|
<div class="iter-body">${a}</div>
|
|
293
|
-
</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=Ra(e.stats.totalDuration),s=e.stats.failed===0,a=Object.entries(e.requestStats).map(([,w])=>{let R=
|
|
293
|
+
</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=Ra(e.stats.totalDuration),s=e.stats.failed===0,a=Object.entries(e.requestStats).map(([,w])=>{let R=R9(w.passed,w.count);return`
|
|
294
294
|
<tr${w.failed>0?' class="row-fail"':""}>
|
|
295
295
|
<td>${yt(w.name)}</td>
|
|
296
296
|
<td>${w.count}</td>
|
|
@@ -306,7 +306,7 @@ Too many redirects:
|
|
|
306
306
|
<td>${w.it}</td>
|
|
307
307
|
<td><span class="method method-${R.toLowerCase()}">${R}</span></td>
|
|
308
308
|
<td><a href="#${L}" class="req-link">${yt(w.n)}</a></td>
|
|
309
|
-
<td class="${
|
|
309
|
+
<td class="${Dg(w.s)}">${w.s}</td>
|
|
310
310
|
<td>${Ra(w.d)}</td>
|
|
311
311
|
<td><div class="bar-wrap"><div class="${T}" style="width:${x}%"></div></div></td>
|
|
312
312
|
<td class="${w.p?"pass":"fail"}">${w.p?"\u2713":"\u2717"}</td>
|
|
@@ -315,7 +315,7 @@ Too many redirects:
|
|
|
315
315
|
<span class="assert-icon">${ht.passed?"\u2713":"\u2717"}</span>
|
|
316
316
|
${yt(ht.name)}
|
|
317
317
|
${ht.message?`<span class="assert-msg"> \u2014 ${yt(ht.message)}</span>`:""}
|
|
318
|
-
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',K=_q(x?.request?.headers),X=
|
|
318
|
+
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',K=_q(x?.request?.headers),X=Zx(x?{method:x.request?.method,url:x.request?.url,query:x.request?.query,params:x.request?.params,bodyType:x.request?.body?.type,bodyFormat:x.request?.body?.format}:void 0),k=x?.request?.body,_=k&&typeof k=="object"?k.type:void 0,P=k&&typeof k=="object"&&"content"in k?k.content:k,$=_!=="none"&&!(P==null||P===""),N=$?xq(P):"",j=_q(x?.response?.headers),Y=Zx(x?{status:x.status,statusText:x.statusText,durationMs:x.duration,responseTimeMs:x.response?.time,responseSizeBytes:x.response?.size}:void 0),J=x?.response?.body!==void 0&&x.response.body!==null?xq(x.response.body):'<span class="dim">\u2014 no body \u2014</span>',ne=C9(x?.response?.cookies),pe=Zx(x?{timestamp:x.timestamp?new Date(x.timestamp).toISOString():void 0,nextRequest:x.nextRequest,visualizerTemplate:x.visualizerData?.template,visualizerData:x.visualizerData?.data}:void 0),Xe=`
|
|
319
319
|
<div class="detail-section">
|
|
320
320
|
<div class="pane-section-title">Assertions
|
|
321
321
|
<span class="assert-counts">
|
|
@@ -365,7 +365,7 @@ Too many redirects:
|
|
|
365
365
|
<div class="pane-section-title">Body</div>
|
|
366
366
|
${J}
|
|
367
367
|
</div>`,vt=he.length<=Ee.length,Ct=vt?xe:"",ce=vt?"":xe,pr=x?.consoleOutput?.length?`<div class="console-block"><pre class="code console-code">${x.consoleOutput.map(ht=>yt(typeof ht=="string"?ht:JSON.stringify(ht))).join(`
|
|
368
|
-
`)}</pre></div>`:"",oi=x?.error?`<div class="error-box">\u26A0 ${yt(x.error)}</div>`:"",xt=x?`<span class="${
|
|
368
|
+
`)}</pre></div>`:"",oi=x?.error?`<div class="error-box">\u26A0 ${yt(x.error)}</div>`:"",xt=x?`<span class="${Dg(x.status)} status-badge">${x.status} ${yt(x.statusText??"")}</span>`:"",zr=`<span class="dur-badge">${Ra(w.d)}</span>`,Or=e.config.iterations>1?`<span class="iter-badge">iter ${w.it}</span>`:"";return`
|
|
369
369
|
<details class="req-detail ${L?"req-pass":"req-fail"}" id="${q}" style="--border:${V}">
|
|
370
370
|
<summary class="req-summary">
|
|
371
371
|
<span class="toggle-icon">\u25B6</span>
|
|
@@ -403,7 +403,7 @@ Too many redirects:
|
|
|
403
403
|
<!-- Response column -->
|
|
404
404
|
<div class="col-stack">
|
|
405
405
|
<div class="col-pane">
|
|
406
|
-
<div class="pane-title">Response <span class="${
|
|
406
|
+
<div class="pane-title">Response <span class="${Dg(w.s)} status-badge">${w.s}</span></div>
|
|
407
407
|
${Ee}
|
|
408
408
|
</div>
|
|
409
409
|
${ce}
|
|
@@ -604,7 +604,7 @@ Too many redirects:
|
|
|
604
604
|
<div class="meta">
|
|
605
605
|
Environment: <strong>${yt(e.environment)}</strong> \xB7
|
|
606
606
|
Run ID: <code>${yt(e.runId)}</code> \xB7
|
|
607
|
-
${
|
|
607
|
+
${Qx(e.startTime)}${e.endTime?` \u2192 ${Qx(e.endTime)}`:""}
|
|
608
608
|
\xB7 Iterations: ${e.config.iterations}
|
|
609
609
|
</div>
|
|
610
610
|
</div>
|
|
@@ -701,7 +701,7 @@ Too many redirects:
|
|
|
701
701
|
border:1px solid #f8514940;border-radius:6px;padding:8px 12px">
|
|
702
702
|
<span class="method method-${R.toLowerCase()}">${R}</span>
|
|
703
703
|
<strong>${yt(w.n)}</strong>
|
|
704
|
-
<span class="status-badge ${
|
|
704
|
+
<span class="status-badge ${Dg(w.s)}">${w.s}</span>
|
|
705
705
|
<span class="dur-badge">${Ra(w.d)}</span>
|
|
706
706
|
${w.e?`<span class="dim" style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"> \u2014 ${yt(w.e)}</span>`:""}
|
|
707
707
|
</a>
|
|
@@ -710,7 +710,7 @@ Too many redirects:
|
|
|
710
710
|
</div>`:""}
|
|
711
711
|
|
|
712
712
|
<p class="dim" style="margin-top:20px;text-align:center">
|
|
713
|
-
Generated by HTTP Forge \xB7 ${
|
|
713
|
+
Generated by HTTP Forge \xB7 ${Qx(new Date().toISOString())}
|
|
714
714
|
</p>
|
|
715
715
|
</div>
|
|
716
716
|
<script>
|
|
@@ -794,14 +794,14 @@ Too many redirects:
|
|
|
794
794
|
});
|
|
795
795
|
</script>
|
|
796
796
|
</body>
|
|
797
|
-
</html>`}}});import*as jt from"fs/promises";import*as Wr from"path";function Ng(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 Pc,Zx=le(()=>{"use strict";mn();Sf();Qx();$g();Pc=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=Wr.join(this.basePath,e,s),await jt.mkdir(Wr.join(this.currentRunPath,"results"),{recursive:!0}),await jt.mkdir(Wr.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=Wr.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(w=>({name:w.name,passed:w.passed,message:w.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,modifiedSessionVariables:r.modifiedSessionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await jt.writeFile(f,JSON.stringify(q0(d),null,2),"utf-8");let m=r.assertions.filter(w=>w.passed).length,g=r.assertions.filter(w=>!w.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:Yx[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=Ng(d,50),f.p90=Ng(d,90),f.p95=Ng(d,95),f.p99=Ng(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 gd(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=Wr.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=Wr.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=Wr.join(this.basePath,e,r,"manifest.json"),i=await jt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Wr.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=Wr.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=Wr.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=Wr.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=Wr.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=Wr.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 Ei from"fs";import*as yd from"path";var Xx,Dg,vd,Fg,Eq=le(()=>{"use strict";Xx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Ei.watch(n,{recursive:!0},(s,a)=>{if(a){let l=yd.join(n,a);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:yd.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=[]}},Dg=class{createFileWatcher(e,r){return new Xx(e,r)}},vd=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Ei.existsSync(this.storeFile)){let e=Ei.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=yd.dirname(this.storeFile);Ei.mkdirSync(e,{recursive:!0}),Ei.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()}},Fg=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as kc from"path";function Cq(t){let e=kc.resolve(t.workspaceFolder),{appInfo:r}=t,n=xa.instance;n.clear();let i=kc.join(e,".http-forge-cache","stores"),s=kc.join(i,"workspace-state.json"),a=kc.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new Dg,notificationService:new Fg,workspaceStore:new vd(s),globalStore:new vd(a),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"}};return Ag(n,l),n}function as(t){return Cq({workspaceFolder:t})}var Lg=le(()=>{"use strict";Wx();zx();Eq()});var jg={};ks(jg,{runCollection:()=>nR,runRequest:()=>rR,runSuite:()=>iR});function eR(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function Iq(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function E9(){return Iq(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function C9(){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 Pq(t){return Iq(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:t.includes("report")}function kq(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function O9(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function Tq(t){return Zi(O9(t))}function Aq(t){return P0((t??[]).map(e=>({name:e.name,value:e.value})))}function Oq(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function qq(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 $q(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 Mq(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function tR(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=tR(t,e,s.items??[],a);if(l)return l}}}function Nq(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(...Nq(t,a.items??[],l,f))}return i}async function Dq(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=Mq(r.variables),g=E9(),y=Pq(d),w=e.requests.filter(_=>!(_.enabled===!1||f&&!f.some(P=>_.name.toLowerCase().includes(P.toLowerCase()))));if(g){let _=C9(),P=w.length*s;if(P>_)throw new Error(`Suite "${e.name}" would execute ${P} request calls (${w.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${_}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let R=new Pc(t.config);await R.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:a});let x=[],T=[],q=0,L=0,V=new AbortController,B=new Ec;for(let _=1;_<=s;_++){for(let P of w){let $=t.collection.getCollection(P.collectionId);if(!$)continue;let N=tR($,P.requestId);if(!N)continue;let j=new Hs(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,B,$.scripts,N.folderScriptsChain,void 0,$.name,_,s),Y=$q(qq(N.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),J=await j.execute(Y,m,V.signal);if(J.folderPath=P.folderPath??"",J.collectionName=$.name,await R.saveResult(_,J),J.passed?q++:L++,d.includes("perRequest")&&x.push({name:P.name,iteration:_,status:J.response?.status,ok:(J.response?.status??0)>=200&&(J.response?.status??0)<300,duration:`${J.duration}ms`,allPassed:J.passed,...d.includes("consoleOutput")&&J.consoleOutput?.length?{consoleOutput:J.consoleOutput}:{}}),!J.passed&&(T.push({name:P.name,iteration:_,status:J.response?.status,duration:`${J.duration}ms`,body:kq(J.response?.body),headers:Tq(J.response?.headers),cookies:Aq(J.response?.cookies),failedTests:J.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...J.error?{error:J.error}:{},...d.includes("consoleOutput")&&J.consoleOutput?.length?{consoleOutput:J.consoleOutput}:{}}),a)){V.abort();break}l>0&&!V.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(V.signal.aborted)break}let K=await R.finalizeRun("completed",y),k={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:q+L,passed:q,failed:L,...s>1?{iterations:s}:{},allPassed:L===0}};return(L>0||d.includes("failedOnly"))&&(k.failedRequests=T),d.includes("perRequest")&&(k.results=x),K!==null&&(k.report={uri:`file://${K}`,hint:"Click the URI to open the HTML report in your browser"}),k}async function rR(t){let e=as(t.workspaceFolder),r=t.include??[],n=Pq(r);try{let s=e.collection.getCollection(t.collectionId);if(!s)throw new Error(`Collection "${t.collectionId}" not found`);let a=tR(s,t.requestId);if(!a)throw new Error(`Request "${t.requestId}" not found in collection "${s.name}"`);let l=t.environment||e.environmentConfig.getSelectedEnvironment(),f=$q(qq(a.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),m=await new Hs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,l,new Ec,s.scripts,a.folderScriptsChain).execute(f,Mq(t.variables)),g=null;if(n){let R=new Pc(e.config),x=`request-${Oq(t.collectionId)}-${Oq(t.requestId)}`,T=`Request: ${a.request.name}`;await R.initializeRun(x,T,l,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await R.saveResult(1,m),g=await R.finalizeRun("completed")}let y=Tq(m.response?.headers),w=Aq(m.response?.cookies);return{request:a.request.name,status:m.response?.status||0,ok:(m.response?.status??0)>=200&&(m.response?.status??0)<300,duration:`${m.duration}ms`,body:kq(m.response?.body),allPassed:m.passed,assertions:m.assertions?.map(R=>({name:R.name,passed:R.passed,message:R.message})),...r.includes("headers")?{headers:y}:{},...r.includes("cookies")?{cookies:w}:{},...r.includes("tests")?{tests:m.assertions?.map(R=>({name:R.name,passed:R.passed,...R.message?{message:R.message}:{}}))}:{},...Object.keys(m.modifiedVariables??{}).length?{modifiedVariables:m.modifiedVariables}:{},...r.includes("consoleOutput")&&m.consoleOutput?.length?{consoleOutput:m.consoleOutput}:{},...g!==null?{report:{uri:`file://${g}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...m.error?{error:m.error}:{}}}catch(i){throw i}finally{eR(e)}}async function nR(t){let e=as(t.workspaceFolder);try{let n=e.collection.getCollection(t.collectionId);if(!n)throw new Error(`Collection "${t.collectionId}" not found`);let s=Nq(n).map(({request:l,folderPath:f})=>({id:l.id,slug:l.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:l.id,name:l.name,method:l.method,collectionName:n.name,folderPath:f,enabled:!0})),a={id:`temp-${n.id}`,name:n.name,requests:s,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return Dq(e,a,{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{eR(e)}}async function iR(t){let e=as(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return Dq(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{eR(e)}}var bd=le(()=>{"use strict";Jx();Bh();Sf();Zx();Lg()});var Hq={};ks(Hq,{createMcpRuntime:()=>U9});import*as jq from"fs";import{createServer as I9}from"http";import*as wd from"path";async function sR(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 Uq(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(...Uq(t,s.items??[],a))}return n}async function q9(t){let e=as(t),r=e.config.getMcpConfig(),n=r.toolPrefix??"",i=[],s=e.collection.getAllCollections();for(let l of s){let f=r.excludedCollections;if(f?.length&&(f.includes(l.id)||f.includes(l.name)))continue;let d=Uq(l);for(let{request:m,folderPath:g}of d){let y=g?`${g} / ${m.name}`:m.name;i.push({name:`${n}request__${l.id}__${m.id}`,description:`[${m.method}] ${y} (collection: ${l.name})`,inputSchema:k9})}i.push({name:`${n}collection__${l.id}`,description:`Run all requests in collection: "${l.name}" (${d.length} requests)`,inputSchema:T9})}let a=await e.testSuite.getAllSuites();for(let l of a){let f=r.excludedSuites;f?.length&&(f.includes(l.id)||f.includes(l.name))||i.push({name:`${n}suite__${l.id}`,description:`Run test suite: "${l.name}" (${l.requests.length} requests, ${l.config.iterations} iteration(s) by default)`,inputSchema:A9})}return i}function $9(t,e){let n=as(t).config.getMcpConfig().toolPrefix??"";return n&&e.startsWith(n)?e.slice(n.length):e}function M9(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function Fq(t,e,r,n){Ea(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}async function N9(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 q9(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 oR(t.workspaceFolder,n,i??{}),a=JSON.stringify(s,null,2);return{content:[{type:"text",text:M9(a,t.host,t.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function D9(t,e,r){let i=as(t.workspaceFolder).config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"],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")}function F9(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=wd.resolve(i),a=wd.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(a+wd.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}jq.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 Sd(t){return new Error(`Bad request: ${t}`)}function L9(t){if(t.startsWith("request__")){let[,e,r]=t.split("__");if(!e||!r)throw Sd(`request tool format must be request__<collectionId>__<requestId>, got: ${t}`);return{kind:"request",id1:e,id2:r}}if(t.startsWith("collection__")){let[,e]=t.split("__");if(!e)throw Sd(`collection tool format must be collection__<collectionId>, got: ${t}`);return{kind:"collection",id1:e}}if(t.startsWith("suite__")){let[,e]=t.split("__");if(!e)throw Sd(`suite tool format must be suite__<suiteId>, got: ${t}`);return{kind:"suite",id1:e}}throw Sd(`unknown tool name: ${t}`)}async function oR(t,e,r={}){let n=L9($9(t,e));return n.kind==="request"?sR(()=>rR({workspaceFolder:t,collectionId:n.id1,requestId:n.id2,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include})):n.kind==="collection"?sR(()=>nR({workspaceFolder:t,collectionId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include})):sR(()=>iR({workspaceFolder:t,suiteId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}function Ea(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function Lq(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(Sd("invalid JSON body"))}}),t.on("error",r)})}function j9(t){return I9(async(e,r)=>{try{if(D9(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Ea(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){F9(t,e,r);return}if(e.method==="POST"&&e.url==="/"){let n;try{n=await Lq(e)}catch{Fq(r,null,-32700,"Parse error");return}try{let i=await N9(t,n);Ea(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){Fq(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await Lq(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Ea(r,400,{error:'Field "name" is required'});return}let i=await oR(t.workspaceFolder,n.name,n.args??{});Ea(r,200,{result:i});return}Ea(r,405,{error:"Method not allowed"})}catch(n){Ea(r,500,{error:n.message})}})}async function U9(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 P9.set(n,i),{async start(){if(i.isRunning)return;let s=j9(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 oR(i.workspaceFolder,s,a??{})}}}var P9,k9,T9,A9,Bq=le(()=>{"use strict";bd();Lg();P9=new Map,k9={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to selected environment)"},variables:{type:"object",description:"Extra variables to inject",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 request body (JSON string)"},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in response"}}},T9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables for 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"}}},A9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},requestFilter:{type:"array",items:{type:"string"},description:"Run requests matching names"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}}});var yl=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()}};Up();vl();function cb(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(jE),source:{format:"folder",filePath:e,version:t.version}}}function jE(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(jE)};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 XF(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(ub)}}function ub(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(ub)}:{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 mu=class{store;constructor(e){this.store=new Ts(e)}loadAll(){return this.store.loadAll().map(r=>cb(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 cb(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return cb(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(XF(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,ub(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 gu=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()}};bl();var yu=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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.isExpired(e)}domainMatches(e,r){return dt.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)}};Vp();var Bi=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}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})}};Sl();_u();var qs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Bo,this.urlBuilder=new Un}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():[]}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=Bi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};_u();Eu();Cu();Sl();of();var jl=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?[nt("path").join(s.forgeRoot,"modules")]:[],l=new Wi(new Un,new zi,e);this.scriptExecutor=new Qi(l,a)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},l={...s},f=this.buildHttpRequest(e,n.overrides),d=this.findFolderPath(r,e.id),m=this.buildScriptChain(e,r,d),g={request:{url:f.url,method:f.method,headers:{...f.headers},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:void 0},variables:a,collectionVariables:r.variables||{},globals:{},sessionVariables:{},environmentVariables:l,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange},y=this.scriptExecutor.createRequestSession(g),w,R;try{if(!n.skipPreRequest&&m.preRequest.length>0){let L=await y.executePreRequest(m.preRequest);if(w={success:L.success,error:L.error,modifiedVariables:L.modifiedVariables,modifiedEnvironment:L.modifiedEnvironmentVariables,modifiedGlobals:L.modifiedGlobals,modifiedCollectionVariables:L.modifiedCollectionVariables,consoleOutput:L.consoleOutput,modifiedRequest:L.modifiedRequest?{url:L.modifiedRequest.url,method:L.modifiedRequest.method,headers:L.modifiedRequest.headers,body:L.modifiedRequest.body?.content}:void 0},L.modifiedVariables&&(a={...a,...L.modifiedVariables}),L.modifiedEnvironmentVariables&&(l={...l,...L.modifiedEnvironmentVariables}),L.modifiedRequest){let V=L.modifiedRequest;V.url&&(f.url=V.url),V.method&&(f.method=V.method),V.headers&&(f.headers={...f.headers,...V.headers}),V.body!==void 0&&(f.body=V.body?.content||V.body)}if(!L.success)throw new Error(`Pre-request script failed: ${L.error}`)}let x={...l,...a};f=this.interpolateRequest(f,x);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&f.body!==void 0){let L=this.preprocessor.encodeBody({type:"graphql",content:f.body});L!=null&&(f.body=typeof L=="string"?L:JSON.stringify(L))}let q=await this.httpClient.send(f);if(!n.skipPostResponse&&m.postResponse.length>0){let L=await y.executePostResponse(m.postResponse,{status:q.status,statusText:q.statusText,headers:q.headers,body:q.body,cookies:Object.fromEntries(q.cookies.map(V=>[V.name,V.value])),responseTime:q.time,responseSize:q.size,executedRequest:{url:f.url,method:f.method,headers:f.headers||{},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:L.testResults,consoleOutput:L.consoleOutput,modifiedEnvironment:L.modifiedEnvironmentVariables},L.modifiedEnvironmentVariables&&(l={...l,...L.modifiedEnvironmentVariables})}return{response:q,preRequestResult:w,postResponseResult:R,totalTime:Date.now()-i,finalRequest:f,variables:{environment:l,local:a}}}finally{y.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=qs.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 xV(){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 af=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=xV(),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 lf=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=l.headers.get("content-type")||"",m;try{d.includes("application/json")?m=await l.json():d.includes("text/")?m=await l.text():m=await l.text()}catch{m=null}let g={};return l.headers.forEach((y,w)=>{let R=g[w];R!==void 0?g[w]=Array.isArray(R)?[...R,y]:[R,y]:g[w]=y}),{status:l.status,statusText:l.statusText,headers:g,cookies:[],body:m,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};Eu();Cu();Ru();Fh();Sl();var ia=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}}};Lh();import*as en from"fs/promises";import*as Ul from"path";var cf=class{async readFile(e){return en.readFile(e,"utf-8")}async writeFile(e,r){let n=Ul.dirname(e);await this.mkdir(n),await en.writeFile(e,r,"utf-8")}async exists(e){try{return await en.access(e),!0}catch{return!1}}async mkdir(e){await en.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Ul.basename(s);for(let l of e)if(this.matchPattern(a,l)){i.push(s);break}})}catch{}return i}async readDir(e){return en.readdir(e)}async isDirectory(e){try{return(await en.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await en.readdir(e,{withFileTypes:!0});for(let i of n){let s=Ul.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)}};of();var p0=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 Bo,this.fileSystem=e.fileSystem||new cf,this.preprocessor=e.preprocessor||new na,this.dataFileParser=e.dataFileParser||new sa,this.cookieJar=e.cookieJar||new yu,e.enableHistory?this.requestHistory=e.requestHistory||new af({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 Vo(s)}else this.httpClient=new lf;let r=e.forgeRoot?[nt("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Un,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Qi(n,r),this.parserRegistry=new gu,this.parserRegistry.register("http-forge",new ia),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=nt("path").join(e.forgeRoot,"collections");this.collectionLoader=new mu(s)}else this.collectionLoader=new yl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Bi(e.environmentConfig):Bi.fromVariables({}),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new jl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new zi;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 yl)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 Bi(e),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new jl(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=nt("path"),i=n.join(e,"environments"),s,a=vu(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=nt("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,w]of Object.entries(g.environments)){let R=w;s.environments[y]={name:R.name||y,variables:R.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})}};Wx();zx();Tg();async function H9(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(Bq(),Hq));return e(t)}async function B9(t){let{runRequest:e}=await Promise.resolve().then(()=>(bd(),jg));return e(t)}async function V9(t){let{runCollection:e}=await Promise.resolve().then(()=>(bd(),jg));return e(t)}async function W9(t){let{runSuite:e}=await Promise.resolve().then(()=>(bd(),jg));return e(t)}Lg();_0();bl();Jx();x0();Eu();Cu();hb();Ru();Fh();Sl();s0();u0();of();$h();Dh();Sf();y0();b0();Up();vl();vl();g0();E0();Vp();_u();Bh();C0();$0();h0();function z9(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=t8(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(r8(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&&Vq(a)){let g=aR(a,r),y=g.length>0?g[g.length-1]:void 0,w=Wq(a);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:w||void 0}}if(Vq(a)){let g=aR(a,r),y=g.length>0?g[g.length-1]:void 0,w=Wq(a);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:w||void 0}}if(lR(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let m=aR(a,r);return{contextType:"selection_set",fieldPath:m,parentType:m.length>0?m[m.length-1]:void 0,prefix:s}}function J9(t,e){switch(e.contextType){case"root":return Y9(t,e.prefix);case"selection_set":return G9(t,e);case"argument":return K9(t,e);case"argument_value":return Q9(t,e);case"directive":return Z9(t,e.prefix);case"fragment_type":return X9(t,e.prefix);case"variable_def":return e8(t,e.prefix);default:return[]}}function Y9(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
797
|
+
</html>`}}});import*as jt from"fs/promises";import*as Wr from"path";function Fg(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 Pc,eR=le(()=>{"use strict";mn();_f();Xx();Ng();Pc=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=Wr.join(this.basePath,e,s),await jt.mkdir(Wr.join(this.currentRunPath,"results"),{recursive:!0}),await jt.mkdir(Wr.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=Wr.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(w=>({name:w.name,passed:w.passed,message:w.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,modifiedSessionVariables:r.modifiedSessionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await jt.writeFile(f,JSON.stringify(M0(d),null,2),"utf-8");let m=r.assertions.filter(w=>w.passed).length,g=r.assertions.filter(w=>!w.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:Kx[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=Fg(d,50),f.p90=Fg(d,90),f.p95=Fg(d,95),f.p99=Fg(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 bd(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=Wr.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=Wr.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=Wr.join(this.basePath,e,r,"manifest.json"),i=await jt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Wr.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=Wr.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=Wr.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=Wr.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=Wr.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=Wr.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 Ei from"fs";import*as Sd from"path";var tR,Lg,wd,jg,Eq=le(()=>{"use strict";tR=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Ei.watch(n,{recursive:!0},(s,a)=>{if(a){let l=Sd.join(n,a);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:Sd.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=[]}},Lg=class{createFileWatcher(e,r){return new tR(e,r)}},wd=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Ei.existsSync(this.storeFile)){let e=Ei.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=Sd.dirname(this.storeFile);Ei.mkdirSync(e,{recursive:!0}),Ei.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()}},jg=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as kc from"path";function Cq(t){let e=kc.resolve(t.workspaceFolder),{appInfo:r}=t,n=xa.instance;n.clear();let i=kc.join(e,".http-forge-cache","stores"),s=kc.join(i,"workspace-state.json"),a=kc.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new Lg,notificationService:new jg,workspaceStore:new wd(s),globalStore:new wd(a),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"}};return $g(n,l),n}function as(t){return Cq({workspaceFolder:t})}var Ug=le(()=>{"use strict";Jx();Yx();Eq()});var xd={};ks(xd,{runCollection:()=>_d,runFolder:()=>A9,runRequest:()=>iR,runSuite:()=>sR});function rR(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function Iq(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function O9(){return Iq(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function I9(){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 Pq(t){return Iq(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:t.includes("report")}function kq(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function P9(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function Tq(t){return Zi(P9(t))}function Aq(t){return T0((t??[]).map(e=>({name:e.name,value:e.value})))}function Oq(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function qq(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 $q(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 Mq(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function nR(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=nR(t,e,s.items??[],a);if(l)return l}}}function Nq(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(...Nq(t,a.items??[],l,f))}return i}function k9(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 T9(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async function Dq(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=Mq(r.variables),g=O9(),y=Pq(d),w=e.requests.filter(_=>!(_.enabled===!1||f&&!f.some(P=>_.name.toLowerCase().includes(P.toLowerCase()))));if(g){let _=I9(),P=w.length*s;if(P>_)throw new Error(`Suite "${e.name}" would execute ${P} request calls (${w.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${_}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let R=new Pc(t.config);await R.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:a});let x=[],T=[],q=0,L=0,V=new AbortController,B=new Ec;for(let _=1;_<=s;_++){for(let P of w){let $=t.collection.getCollection(P.collectionId);if(!$)continue;let N=nR($,P.requestId);if(!N)continue;let j=new Hs(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,B,$.scripts,N.folderScriptsChain,void 0,$.name,_,s),Y=$q(qq(N.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),J=await j.execute(Y,m,V.signal);if(J.folderPath=P.folderPath??"",J.collectionName=$.name,await R.saveResult(_,J),J.passed?q++:L++,d.includes("perRequest")&&x.push({name:P.name,iteration:_,status:J.response?.status,ok:(J.response?.status??0)>=200&&(J.response?.status??0)<300,duration:`${J.duration}ms`,allPassed:J.passed,...d.includes("consoleOutput")&&J.consoleOutput?.length?{consoleOutput:J.consoleOutput}:{}}),!J.passed&&(T.push({name:P.name,iteration:_,status:J.response?.status,duration:`${J.duration}ms`,body:kq(J.response?.body),headers:Tq(J.response?.headers),cookies:Aq(J.response?.cookies),failedTests:J.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...J.error?{error:J.error}:{},...d.includes("consoleOutput")&&J.consoleOutput?.length?{consoleOutput:J.consoleOutput}:{}}),a)){V.abort();break}l>0&&!V.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(V.signal.aborted)break}let K=await R.finalizeRun("completed",y),k={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:q+L,passed:q,failed:L,...s>1?{iterations:s}:{},allPassed:L===0}};return(L>0||d.includes("failedOnly"))&&(k.failedRequests=T),d.includes("perRequest")&&(k.results=x),K!==null&&(k.report={uri:`file://${K}`,hint:"Click the URI to open the HTML report in your browser"}),k}async function iR(t){let e=as(t.workspaceFolder),r=t.include??[],n=Pq(r);try{let s=e.collection.getCollection(t.collectionId);if(!s)throw new Error(`Collection "${t.collectionId}" not found`);let a=nR(s,t.requestId);if(!a)throw new Error(`Request "${t.requestId}" not found in collection "${s.name}"`);let l=t.environment||e.environmentConfig.getSelectedEnvironment(),f=$q(qq(a.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),m=await new Hs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,l,new Ec,s.scripts,a.folderScriptsChain).execute(f,Mq(t.variables)),g=null;if(n){let R=new Pc(e.config),x=`request-${Oq(t.collectionId)}-${Oq(t.requestId)}`,T=`Request: ${a.request.name}`;await R.initializeRun(x,T,l,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await R.saveResult(1,m),g=await R.finalizeRun("completed")}let y=Tq(m.response?.headers),w=Aq(m.response?.cookies);return{request:a.request.name,status:m.response?.status||0,ok:(m.response?.status??0)>=200&&(m.response?.status??0)<300,duration:`${m.duration}ms`,body:kq(m.response?.body),allPassed:m.passed,assertions:m.assertions?.map(R=>({name:R.name,passed:R.passed,message:R.message})),...r.includes("headers")?{headers:y}:{},...r.includes("cookies")?{cookies:w}:{},...r.includes("tests")?{tests:m.assertions?.map(R=>({name:R.name,passed:R.passed,...R.message?{message:R.message}:{}}))}:{},...Object.keys(m.modifiedVariables??{}).length?{modifiedVariables:m.modifiedVariables}:{},...r.includes("consoleOutput")&&m.consoleOutput?.length?{consoleOutput:m.consoleOutput}:{},...g!==null?{report:{uri:`file://${g}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...m.error?{error:m.error}:{}}}catch(i){throw i}finally{rR(e)}}async function _d(t){let e=as(t.workspaceFolder);try{let n=e.collection.getCollection(t.collectionId);if(!n)throw new Error(`Collection "${t.collectionId}" not found`);let i=Nq(n),s=k9(i,t.folderPath,t.recursive);if(s.length===0&&t.folderPath)throw new Error(`No requests found under folder "${t.folderPath}" in collection "${n.name}"`);let a=s.map(({request:f,folderPath:d})=>({id:f.id,slug:f.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:f.id,name:f.name,method:f.method,collectionName:n.name,folderPath:d,enabled:!0})),l={id:t.folderPath?`temp-${n.id}-${T9(t.folderPath)}`:`temp-${n.id}`,name:t.folderPath?`${n.name} / ${t.folderPath}`:n.name,requests:a,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return Dq(e,l,{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{rR(e)}}async function A9(t){return _d({recursive:!0,...t})}async function sR(t){let e=as(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return Dq(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{rR(e)}}var Tc=le(()=>{"use strict";Gx();zh();_f();eR();Ug()});var Vq={};ks(Vq,{createMcpRuntime:()=>G9});import*as jq from"fs";import{createServer as q9}from"http";import*as Rd from"path";function F9(t){return Buffer.from(t,"utf8").toString("base64url")}function L9(t){return Buffer.from(t,"base64url").toString("utf8")}async function Hg(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 Uq(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(...Uq(t,s.items??[],a))}return n}function Hq(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:Bq(s.items??[])}),n.push(...Hq(t,s.items??[],a))}return n}function Bq(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Bq(r.items??[]);return e}async function U9(t){let e=as(t),r=e.config.getMcpConfig(),n=r.toolPrefix??"",i=[],s=e.collection.getAllCollections();for(let l of s){let f=r.excludedCollections;if(f?.length&&(f.includes(l.id)||f.includes(l.name)))continue;let d=Uq(l);for(let{request:m,folderPath:g}of d){let y=g?`${g} / ${m.name}`:m.name;i.push({name:`${n}request__${l.id}__${m.id}`,description:`[${m.method}] ${y} (collection: ${l.name})`,inputSchema:M9})}i.push({name:`${n}collection__${l.id}`,description:`Run all requests in collection: "${l.name}" (${d.length} requests)`,inputSchema:N9});for(let{folderPath:m,requestCount:g}of Hq(l))g!==0&&i.push({name:`${n}folder__${l.id}__${F9(m)}`,description:`Run folder "${m}" in collection: "${l.name}" (${g} requests)`,inputSchema:D9})}let a=await e.testSuite.getAllSuites();for(let l of a){let f=r.excludedSuites;f?.length&&(f.includes(l.id)||f.includes(l.name))||i.push({name:`${n}suite__${l.id}`,description:`Run test suite: "${l.name}" (${l.requests.length} requests, ${l.config.iterations} iteration(s) by default)`,inputSchema:j9})}return i}function H9(t,e){let n=as(t).config.getMcpConfig().toolPrefix??"";return n&&e.startsWith(n)?e.slice(n.length):e}function B9(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function Fq(t,e,r,n){Ea(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}async function V9(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 U9(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 oR(t.workspaceFolder,n,i??{}),a=JSON.stringify(s,null,2);return{content:[{type:"text",text:B9(a,t.host,t.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function W9(t,e,r){let i=as(t.workspaceFolder).config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"],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")}function z9(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=Rd.resolve(i),a=Rd.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(a+Rd.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}jq.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 Ac(t){return new Error(`Bad request: ${t}`)}function J9(t){if(t.startsWith("request__")){let[,e,r]=t.split("__");if(!e||!r)throw Ac(`request tool format must be request__<collectionId>__<requestId>, got: ${t}`);return{kind:"request",id1:e,id2:r}}if(t.startsWith("folder__")){let e=t.indexOf("__"),r=t.indexOf("__",e+2),n=r>=0?t.slice(e+2,r):"",i=r>=0?t.slice(r+2):"";if(!n||!i)throw Ac(`folder tool format must be folder__<collectionId>__<encodedPath>, got: ${t}`);return{kind:"folder",id1:n,id2:L9(i)}}if(t.startsWith("collection__")){let[,e]=t.split("__");if(!e)throw Ac(`collection tool format must be collection__<collectionId>, got: ${t}`);return{kind:"collection",id1:e}}if(t.startsWith("suite__")){let[,e]=t.split("__");if(!e)throw Ac(`suite tool format must be suite__<suiteId>, got: ${t}`);return{kind:"suite",id1:e}}throw Ac(`unknown tool name: ${t}`)}async function oR(t,e,r={}){let n=J9(H9(t,e));return n.kind==="request"?Hg(()=>iR({workspaceFolder:t,collectionId:n.id1,requestId:n.id2,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include})):n.kind==="collection"?Hg(()=>_d({workspaceFolder:t,collectionId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include})):n.kind==="folder"?Hg(()=>_d({workspaceFolder:t,collectionId:n.id1,folderPath:n.id2,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include})):Hg(()=>sR({workspaceFolder:t,suiteId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}function Ea(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function Lq(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(Ac("invalid JSON body"))}}),t.on("error",r)})}function Y9(t){return q9(async(e,r)=>{try{if(W9(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Ea(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){z9(t,e,r);return}if(e.method==="POST"&&e.url==="/"){let n;try{n=await Lq(e)}catch{Fq(r,null,-32700,"Parse error");return}try{let i=await V9(t,n);Ea(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){Fq(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await Lq(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Ea(r,400,{error:'Field "name" is required'});return}let i=await oR(t.workspaceFolder,n.name,n.args??{});Ea(r,200,{result:i});return}Ea(r,405,{error:"Method not allowed"})}catch(n){Ea(r,500,{error:n.message})}})}async function G9(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 $9.set(n,i),{async start(){if(i.isRunning)return;let s=Y9(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 oR(i.workspaceFolder,s,a??{})}}}var $9,M9,N9,D9,j9,Wq=le(()=>{"use strict";Tc();Ug();$9=new Map,M9={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to selected environment)"},variables:{type:"object",description:"Extra variables to inject",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 request body (JSON string)"},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in response"}}},N9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables for 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"}}},D9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables for 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"}}};j9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},requestFilter:{type:"array",items:{type:"string"},description:"Run requests matching names"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}}});var yl=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()}};Vp();vl();function fb(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(jE),source:{format:"folder",filePath:e,version:t.version}}}function jE(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(jE)};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 tL(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(db)}}function db(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(db)}:{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 yu=class{store;constructor(e){this.store=new Ts(e)}loadAll(){return this.store.loadAll().map(r=>fb(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 fb(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return fb(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(tL(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,db(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 vu=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()}};bl();var bu=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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.isExpired(e)}domainMatches(e,r){return dt.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)}};Jp();var Bi=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}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})}};Sl();Ru();var qs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Bo,this.urlBuilder=new Un}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():[]}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=Bi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Ru();Ou();Iu();Sl();lf();var jl=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?[nt("path").join(s.forgeRoot,"modules")]:[],l=new Wi(new Un,new zi,e);this.scriptExecutor=new Qi(l,a)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},l={...s},f=this.buildHttpRequest(e,n.overrides),d=this.findFolderPath(r,e.id),m=this.buildScriptChain(e,r,d),g={request:{url:f.url,method:f.method,headers:{...f.headers},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:void 0},variables:a,collectionVariables:r.variables||{},globals:{},sessionVariables:{},environmentVariables:l,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange},y=this.scriptExecutor.createRequestSession(g),w,R;try{if(!n.skipPreRequest&&m.preRequest.length>0){let L=await y.executePreRequest(m.preRequest);if(w={success:L.success,error:L.error,modifiedVariables:L.modifiedVariables,modifiedEnvironment:L.modifiedEnvironmentVariables,modifiedGlobals:L.modifiedGlobals,modifiedCollectionVariables:L.modifiedCollectionVariables,consoleOutput:L.consoleOutput,modifiedRequest:L.modifiedRequest?{url:L.modifiedRequest.url,method:L.modifiedRequest.method,headers:L.modifiedRequest.headers,body:L.modifiedRequest.body?.content}:void 0},L.modifiedVariables&&(a={...a,...L.modifiedVariables}),L.modifiedEnvironmentVariables&&(l={...l,...L.modifiedEnvironmentVariables}),L.modifiedRequest){let V=L.modifiedRequest;V.url&&(f.url=V.url),V.method&&(f.method=V.method),V.headers&&(f.headers={...f.headers,...V.headers}),V.body!==void 0&&(f.body=V.body?.content||V.body)}if(!L.success)throw new Error(`Pre-request script failed: ${L.error}`)}let x={...l,...a};f=this.interpolateRequest(f,x);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&f.body!==void 0){let L=this.preprocessor.encodeBody({type:"graphql",content:f.body});L!=null&&(f.body=typeof L=="string"?L:JSON.stringify(L))}let q=await this.httpClient.send(f);if(!n.skipPostResponse&&m.postResponse.length>0){let L=await y.executePostResponse(m.postResponse,{status:q.status,statusText:q.statusText,headers:q.headers,body:q.body,cookies:Object.fromEntries(q.cookies.map(V=>[V.name,V.value])),responseTime:q.time,responseSize:q.size,executedRequest:{url:f.url,method:f.method,headers:f.headers||{},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:L.testResults,consoleOutput:L.consoleOutput,modifiedEnvironment:L.modifiedEnvironmentVariables},L.modifiedEnvironmentVariables&&(l={...l,...L.modifiedEnvironmentVariables})}return{response:q,preRequestResult:w,postResponseResult:R,totalTime:Date.now()-i,finalRequest:f,variables:{environment:l,local:a}}}finally{y.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=qs.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 EV(){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 cf=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=EV(),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 uf=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=l.headers.get("content-type")||"",m;try{d.includes("application/json")?m=await l.json():d.includes("text/")?m=await l.text():m=await l.text()}catch{m=null}let g={};return l.headers.forEach((y,w)=>{let R=g[w];R!==void 0?g[w]=Array.isArray(R)?[...R,y]:[R,y]:g[w]=y}),{status:l.status,statusText:l.statusText,headers:g,cookies:[],body:m,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};Ou();Iu();Cu();Uh();Sl();var ia=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}}};Hh();import*as en from"fs/promises";import*as Ul from"path";var ff=class{async readFile(e){return en.readFile(e,"utf-8")}async writeFile(e,r){let n=Ul.dirname(e);await this.mkdir(n),await en.writeFile(e,r,"utf-8")}async exists(e){try{return await en.access(e),!0}catch{return!1}}async mkdir(e){await en.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Ul.basename(s);for(let l of e)if(this.matchPattern(a,l)){i.push(s);break}})}catch{}return i}async readDir(e){return en.readdir(e)}async isDirectory(e){try{return(await en.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await en.readdir(e,{withFileTypes:!0});for(let i of n){let s=Ul.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)}};lf();var m0=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 Bo,this.fileSystem=e.fileSystem||new ff,this.preprocessor=e.preprocessor||new na,this.dataFileParser=e.dataFileParser||new sa,this.cookieJar=e.cookieJar||new bu,e.enableHistory?this.requestHistory=e.requestHistory||new cf({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 Vo(s)}else this.httpClient=new uf;let r=e.forgeRoot?[nt("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Un,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Qi(n,r),this.parserRegistry=new vu,this.parserRegistry.register("http-forge",new ia),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=nt("path").join(e.forgeRoot,"collections");this.collectionLoader=new yu(s)}else this.collectionLoader=new yl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Bi(e.environmentConfig):Bi.fromVariables({}),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new jl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new zi;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 yl)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 Bi(e),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new jl(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=nt("path"),i=n.join(e,"environments"),s,a=Su(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=nt("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,w]of Object.entries(g.environments)){let R=w;s.environments[y]={name:R.name||y,variables:R.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})}};Jx();Yx();qg();async function K9(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(Wq(),Vq));return e(t)}async function Q9(t){let{runRequest:e}=await Promise.resolve().then(()=>(Tc(),xd));return e(t)}async function Z9(t){let{runCollection:e}=await Promise.resolve().then(()=>(Tc(),xd));return e(t)}async function X9(t){let{runFolder:e}=await Promise.resolve().then(()=>(Tc(),xd));return e(t)}async function e8(t){let{runSuite:e}=await Promise.resolve().then(()=>(Tc(),xd));return e(t)}Ug();R0();bl();Gx();E0();Ou();Iu();gb();Cu();Uh();Sl();a0();d0();lf();Dh();jh();_f();b0();w0();Vp();vl();vl();v0();O0();Jp();Ru();zh();I0();N0();g0();function t8(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=u8(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(f8(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&&zq(a)){let g=aR(a,r),y=g.length>0?g[g.length-1]:void 0,w=Jq(a);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:w||void 0}}if(zq(a)){let g=aR(a,r),y=g.length>0?g[g.length-1]:void 0,w=Jq(a);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:w||void 0}}if(lR(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let m=aR(a,r);return{contextType:"selection_set",fieldPath:m,parentType:m.length>0?m[m.length-1]:void 0,prefix:s}}function r8(t,e){switch(e.contextType){case"root":return n8(t,e.prefix);case"selection_set":return i8(t,e);case"argument":return s8(t,e);case"argument_value":return o8(t,e);case"directive":return a8(t,e.prefix);case"fragment_type":return l8(t,e.prefix);case"variable_def":return c8(t,e.prefix);default:return[]}}function n8(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
798
798
|
$0
|
|
799
799
|
}`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
|
|
800
800
|
$0
|
|
801
801
|
}`},{label:"subscription",detail:"Subscription operation",insertText:`subscription \${1:OperationName} {
|
|
802
802
|
$0
|
|
803
|
-
}`},{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(
|
|
803
|
+
}`},{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(Yq(s,1,t));return r}function i8(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(Yq(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} {
|
|
804
804
|
$0
|
|
805
|
-
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function
|
|
805
|
+
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function s8(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 o8(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 a8(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 l8(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 c8(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 Yq(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+=` {
|
|
806
806
|
$0
|
|
807
|
-
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function t8(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function lR(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function Vq(t){return lR(t,"(",")")>0}function r8(t){if(lR(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function Wq(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 aR(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=n8(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 n8(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}O0();v_();M0();Ax();zm();Mx();$x();y_();qx();S0();w0();Qx();Bx();$g();Zx();function Ug(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function cR(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 Jq(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=Ug(e,50),t.p90=Ug(e,90),t.p95=Ug(e,95),t.p99=Ug(e,99)}var uR=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=cR("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=cR("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,cR(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),Jq(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),Jq(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}}};Vx();vl();import*as ls from"fs";import*as Ca from"path";var fR=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=Ca.join(this.suiteDir,e,"request.json");if(ls.existsSync(r))try{let n=JSON.parse(ls.readFileSync(r,"utf-8")),i=Ca.join(this.suiteDir,e,"scripts"),s=Lp(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=Ca.join(this.suiteDir,e);ls.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,ls.writeFileSync(Ca.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Ca.join(n,"scripts");jp(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:ls.existsSync(Ca.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=Hi(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=Hi(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}};R0();Uh();Lh();Nx();Dx();Ux();jx();Fx();Lx();Hx();Wp();Jp();Gp();mn();export{xg as AwsSecretResolver,Rg as AzureKeyVaultResolver,qE as BODY_FILE_MAP,Wl as CONFIG_FILES,yl as CollectionLoader,df as CollectionLoaderFactory,Hs as CollectionRequestExecutor,pf as CollectionService,zl as ConfigService,yu as CookieJar,hf as CookieService,dt as CookieUtils,Vt as DEFAULT_CONFIG,Hn as DEFAULT_REQUEST_SETTINGS,kg as DEFAULT_SUITE_CONFIG,JE as DYNAMIC_VARIABLES,sa as DataFileParser,Ig as DopplerResolver,yf as EnvironmentConfigService,Bi as EnvironmentResolver,oc as ExampleGenerator,lf as FetchHttpClient,mu as FolderCollectionLoader,Ts as FolderCollectionStore,p0 as ForgeContainer,qs as ForgeEnv,Og as GcpSecretResolver,bf as GraphQLSchemaService,Yx as HTTP_METHOD_MAP,Cc as HTTP_METHOD_REVERSE,Eg as HashiCorpVaultResolver,Jl as HistoryAnalyzer,gd as HtmlReportGenerator,ia as HttpForgeParser,Wi as HttpRequestService,Ec as InMemoryCookieJar,zi as InterceptorChain,Vl as JsonCollectionLoader,mb as LoggingRequestInterceptor,xr as METADATA_FILES,Th as ModuleLoader,cf as NodeFileSystem,Vo as NodeHttpClient,uf as OAuth2TokenManager,Cg as OnePasswordResolver,sc as OpenApiExporter,_c as OpenApiImporter,gu as ParserRegistry,mf as PersistentCookieJar,aa as ROOT_DIRECTORIES,wc as RefResolver,jl as RequestExecutor,wf as RequestHistoryService,af as RequestHistoryStore,vf as RequestPreparer,na as RequestPreprocessor,sf as RequestScriptSession,Pc as ResultStorageService,yb as RetryErrorInterceptor,hu as SCHEMA_FILES,gn as SCRIPTS_DIR,Fp as SCRIPT_FILES,xc as SchemaInferenceService,Xs as SchemaInferrer,Rc as ScriptAnalyzer,Qi as ScriptExecutor,hd as SecretResolverRegistry,xa as ServiceContainer,re as ServiceIdentifiers,uR as StatisticsService,md as TestSuiteService,fR as TestSuiteStore,gb as TimingResponseInterceptor,Un as UrlBuilder,Bo as VariableInterpolator,Ho as VariableResolver,HV as applyExtractionPlan,wu as applyFilterChain,Lo as augmentWithDynamicVars,Cq as bootstrapNodeRuntime,UV as buildExtractionPlan,qg as buildResultFileName,NE as cleanupOldBodyFiles,Mh as concatenateScripts,rf as createExpectChain,AI as createLodashShim,H9 as createMcpRuntime,i0 as createModuleLoader,Ah as createMomentShim,as as createNodeContainer,qh as createResponseObject,vV as createScriptConsole,a0 as createTestFunction,PL as createVariableResolver,YF as deepClone,ab as deleteItemFromTree,jV as detectSensitiveData,Uo as evaluateExpression,w9 as expandSummary,CV as exportCollectionToRestClient,ob as findItemById,QF as formatBytes,Nh as formatConsoleOutput,ZF as formatDuration,ft as generateId,Hi as generateSlug,sb as generateUUID,J9 as getCompletions,EV as getRestClientExportFolder,wq as getServiceContainer,nf as hasChanged,jo as isExpression,GF as isPlainObject,Bp as isSystemEnvironmentFile,vu as loadEnvironmentsFromFolder,pu as mergeHeadersCaseInsensitive,pb as mergeRequestSettings,l0 as normalizeHeaders,Su as parseFilterChain,Hh as parsePostmanEnvironment,NV as parsePostmanEnvironmentFile,z9 as parseQueryContext,ME as prepareBodyForSave,$E as readBodyFromDir,DE as readSchemaFile,Lp as readScriptsFromDir,k0 as redactBody,A0 as redactFullResponse,q0 as redactFullResultDetails,Zi as redactHeaders,T0 as redactHistoryEntry,zh as redactUrl,Ag as registerCoreServices,Vi as resolveDynamicVariable,SL as resolveDynamicVariablesInString,V9 as runCollection,B9 as runRequest,W9 as runSuite,KF as safeJsonParse,It as sanitizeName,lb as searchForItemPath,LE as sortItemsByOrder,Bl as writeEnvFile,jh as writeFolderItems,FE as writeSchemaFiles,ff as writeScriptFile,jp as writeScriptsToDir};
|
|
807
|
+
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function u8(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function lR(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function zq(t){return lR(t,"(",")")>0}function f8(t){if(lR(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function Jq(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 aR(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=d8(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 d8(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}P0();S_();D0();$x();Gm();Dx();Nx();b_();Mx();_0();x0();Xx();Wx();Ng();eR();function Bg(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function cR(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 Gq(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=Bg(e,50),t.p90=Bg(e,90),t.p95=Bg(e,95),t.p99=Bg(e,99)}var uR=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=cR("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=cR("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,cR(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),Gq(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),Gq(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}}};zx();vl();import*as ls from"fs";import*as Ca from"path";var fR=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=Ca.join(this.suiteDir,e,"request.json");if(ls.existsSync(r))try{let n=JSON.parse(ls.readFileSync(r,"utf-8")),i=Ca.join(this.suiteDir,e,"scripts"),s=Hp(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=Ca.join(this.suiteDir,e);ls.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,ls.writeFileSync(Ca.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Ca.join(n,"scripts");Bp(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:ls.existsSync(Ca.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=Hi(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=Hi(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}};C0();Vh();Hh();Fx();Lx();Bx();Hx();jx();Ux();Vx();Yp();Kp();Zp();mn();export{Cg as AwsSecretResolver,Og as AzureKeyVaultResolver,qE as BODY_FILE_MAP,Wl as CONFIG_FILES,yl as CollectionLoader,hf as CollectionLoaderFactory,Hs as CollectionRequestExecutor,mf as CollectionService,zl as ConfigService,bu as CookieJar,gf as CookieService,dt as CookieUtils,Vt as DEFAULT_CONFIG,Hn as DEFAULT_REQUEST_SETTINGS,yd as DEFAULT_SUITE_CONFIG,JE as DYNAMIC_VARIABLES,sa as DataFileParser,Tg as DopplerResolver,bf as EnvironmentConfigService,Bi as EnvironmentResolver,oc as ExampleGenerator,uf as FetchHttpClient,yu as FolderCollectionLoader,Ts as FolderCollectionStore,m0 as ForgeContainer,qs as ForgeEnv,kg as GcpSecretResolver,wf as GraphQLSchemaService,Kx as HTTP_METHOD_MAP,Cc as HTTP_METHOD_REVERSE,Ig as HashiCorpVaultResolver,Jl as HistoryAnalyzer,bd as HtmlReportGenerator,ia as HttpForgeParser,Wi as HttpRequestService,Ec as InMemoryCookieJar,zi as InterceptorChain,Vl as JsonCollectionLoader,yb as LoggingRequestInterceptor,xr as METADATA_FILES,$h as ModuleLoader,ff as NodeFileSystem,Vo as NodeHttpClient,df as OAuth2TokenManager,Pg as OnePasswordResolver,sc as OpenApiExporter,_c as OpenApiImporter,vu as ParserRegistry,yf as PersistentCookieJar,aa as ROOT_DIRECTORIES,wc as RefResolver,jl as RequestExecutor,xf as RequestHistoryService,cf as RequestHistoryStore,Sf as RequestPreparer,na as RequestPreprocessor,af as RequestScriptSession,Pc as ResultStorageService,bb as RetryErrorInterceptor,gu as SCHEMA_FILES,gn as SCRIPTS_DIR,Up as SCRIPT_FILES,xc as SchemaInferenceService,Xs as SchemaInferrer,Rc as ScriptAnalyzer,Qi as ScriptExecutor,gd as SecretResolverRegistry,xa as ServiceContainer,re as ServiceIdentifiers,uR as StatisticsService,vd as TestSuiteService,fR as TestSuiteStore,vb as TimingResponseInterceptor,Un as UrlBuilder,Bo as VariableInterpolator,Ho as VariableResolver,VV as applyExtractionPlan,xu as applyFilterChain,Lo as augmentWithDynamicVars,Cq as bootstrapNodeRuntime,BV as buildExtractionPlan,Mg as buildResultFileName,NE as cleanupOldBodyFiles,Fh as concatenateScripts,sf as createExpectChain,AI as createLodashShim,K9 as createMcpRuntime,o0 as createModuleLoader,Mh as createMomentShim,as as createNodeContainer,Nh as createResponseObject,SV as createScriptConsole,c0 as createTestFunction,TL as createVariableResolver,KF as deepClone,cb as deleteItemFromTree,HV as detectSensitiveData,Uo as evaluateExpression,x9 as expandSummary,IV as exportCollectionToRestClient,lb as findItemById,XF as formatBytes,Lh as formatConsoleOutput,eL as formatDuration,ft as generateId,Hi as generateSlug,ab as generateUUID,r8 as getCompletions,OV as getRestClientExportFolder,wq as getServiceContainer,of as hasChanged,jo as isExpression,QF as isPlainObject,zp as isSystemEnvironmentFile,Su as loadEnvironmentsFromFolder,mu as mergeHeadersCaseInsensitive,mb as mergeRequestSettings,u0 as normalizeHeaders,_u as parseFilterChain,Wh as parsePostmanEnvironment,FV as parsePostmanEnvironmentFile,t8 as parseQueryContext,ME as prepareBodyForSave,$E as readBodyFromDir,DE as readSchemaFile,Hp as readScriptsFromDir,A0 as redactBody,$0 as redactFullResponse,M0 as redactFullResultDetails,Zi as redactHeaders,q0 as redactHistoryEntry,Gh as redactUrl,$g as registerCoreServices,Vi as resolveDynamicVariable,_L as resolveDynamicVariablesInString,Z9 as runCollection,X9 as runFolder,Q9 as runRequest,e8 as runSuite,ZF as safeJsonParse,It as sanitizeName,ub as searchForItemPath,LE as sortItemsByOrder,Bl as writeEnvFile,Bh as writeFolderItems,FE as writeSchemaFiles,pf as writeScriptFile,Bp as writeScriptsToDir};
|