@http-forge/core 0.6.10 → 0.6.11
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 +51 -1054
- package/dist/index.js +69 -69
- package/dist/index.mjs +65 -65
- package/dist/infrastructure/openapi/openapi-exporter.d.ts +5 -0
- package/dist/types/types.d.ts +36 -0
- package/package.json +16 -3
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var Xj=Object.create;var zh=Object.defineProperty;var e2=Object.getOwnPropertyDescriptor;var t2=Object.getOwnPropertyNames;var r2=Object.getPrototypeOf,n2=Object.prototype.hasOwnProperty;var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var H=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},us=(t,e)=>{for(var r in e)zh(t,r,{get:e[r],enumerable:!0})},fI=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of t2(e))!n2.call(t,i)&&i!==r&&zh(t,i,{get:()=>e[i],enumerable:!(n=e2(e,i))||n.enumerable});return t};var me=(t,e,r)=>(r=t!=null?Xj(r2(t)):{},fI(e||!t||!t.__esModule?zh(r,"default",{value:t,enumerable:!0}):r,t)),ga=t=>fI(zh({},"__esModule",{value:!0}),t);function Tt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function vt(t){let e=Date.now().toString(36)+(i2++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${Tt(t)}_${e}`:e}function Jh(){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 ou(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let o=i.toLowerCase();n[o]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let o=i.toLowerCase(),l=n[o];l&&delete r[l],n[o]=i,r[i]=s}return r}function dI(t){return JSON.parse(JSON.stringify(t))}function pI(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function hI(t,e){try{return JSON.parse(t)}catch{return e}}function mI(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 gI(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var i2,En=se(()=>{"use strict";i2=0});function vf(t){if(!lt.existsSync(t))return;let e={},r=un.join(t,yf.preRequest);lt.existsSync(r)&&(e.preRequest=lt.readFileSync(r,"utf-8"));let n=un.join(t,yf.postResponse);return lt.existsSync(n)&&(e.postResponse=lt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function bf(t,e){await lt.promises.mkdir(t,{recursive:!0});let r=un.join(t,yf.preRequest);e.preRequest?await lt.promises.writeFile(r,e.preRequest,"utf-8"):lt.existsSync(r)&&await lt.promises.unlink(r);let n=un.join(t,yf.postResponse);e.postResponse?await lt.promises.writeFile(n,e.postResponse,"utf-8"):lt.existsSync(n)&&await lt.promises.unlink(n)}function DS(t){for(let[e,r]of Object.entries(FS)){let n=un.join(t,e);if(lt.existsSync(n))try{let i=lt.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 LS(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 jS(t,e){for(let r of Object.keys(FS))if(r!==e){let n=un.join(t,r);if(lt.existsSync(n))try{await lt.promises.unlink(n)}catch{}}}function US(t){if(lt.existsSync(t))try{let e=lt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function HS(t,e,r){let n=un.join(t,au.responseSchema),i=un.join(t,au.bodySchema);e?await lt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):lt.existsSync(n)&&await lt.promises.unlink(n),r?await lt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):lt.existsSync(i)&&await lt.promises.unlink(i)}function Gh(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Gh(r.items,e);if(n)return n}}}function Yh(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&&Yh(n.items,e))return!0}return!1}function BS(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 Kh(t,e){let r;try{r=lt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===Hr)continue;if(n.name===e)return un.join(t,n.name);let i=Kh(un.join(t,n.name),e);if(i)return i}}function s2(t){for(let e of[pr.request,pr.folder]){let r=un.join(t,e);if(lt.existsSync(r))try{let n=lt.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function Qh(t,e){let r;try{r=lt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===Hr)continue;let i=un.join(t,n.name);if(s2(i)===e)return i;let s=Qh(i,e);if(s)return s}}function cn(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)||[],o=0;for(let g of s){let v=parseInt(g.substring(1));v>o&&(o=v)}let l="";if(o>0)l=`t${o}`;else{let g=r.match(/[_\s-](\d+\.\d+)[_\s-]/);g&&(l=`v${g[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 c=f.split("-").filter(g=>g.length>0),p=[];i&&p.push(i),p.push(...c),l&&p.push(l);let h=p.join("-");if(h||(h="item"),e.includes(h)){let g=2;for(;e.includes(`${h}-${g}`);)g++;h=`${h}-${g}`}return h}var lt,un,yf,pr,FS,au,Hr,va=se(()=>{"use strict";lt=me(require("fs")),un=me(require("path")),yf={preRequest:"pre-request.js",postResponse:"post-response.js"},pr={collection:"collection.json",folder:"folder.json",request:"request.json"},FS={"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"}},au={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},Hr="scripts"});var qe,Ae,cs,Zh=se(()=>{"use strict";qe=me(require("fs")),Ae=me(require("path"));En();va();cs=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(){qe.existsSync(this.collectionsDir)||qe.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=qe.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!qe.existsSync(this.collectionsDir))return[];let e=qe.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=Ae.join(this.collectionsDir,e),n=Ae.join(r,pr.collection);if(!qe.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Ae.join(r,Hr)),o=this.loadItemsFromDir(r,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,o=qe.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===Hr)continue;let f=Ae.join(e,l.name);if(qe.existsSync(Ae.join(f,pr.folder))){let c=this.loadFolderFromDir(f,l.name);c&&s.set(l.name,c)}else if(qe.existsSync(Ae.join(f,pr.request))){let c=this.loadRequestFromDir(f,l.name);c&&s.set(l.name,c)}}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=Ae.join(e,pr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Ae.join(e,Hr)),o=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=Ae.join(e,pr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Ae.join(e,Hr)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let f=this.loadSchemaFile(Ae.join(e,au.responseSchema)),c=this.loadSchemaFile(Ae.join(e,au.bodySchema)),p=Ae.join(e,"doc.md"),h=qe.existsSync(p)?qe.readFileSync(p,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:o,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,...h&&{doc:h},...f&&{responseSchema:f},...c&&{bodySchema:c}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return vf(e)}loadBodyFromDir(e){return DS(e)}loadSchemaFile(e){return US(e)}async saveSchemaFiles(e,r){return HS(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=vt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=qe.readdirSync(this.collectionsDir);r=cn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Ae.join(this.collectionsDir,r),i=!qe.existsSync(n);await qe.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[o]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Ae.join(n,Hr),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await qe.promises.writeFile(Ae.join(n,pr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let o of r){let l=this.idToSlugMap.get(o.id);l||(l=cn(o.name,i),this.idToSlugMap.set(o.id,l),this.slugToIdMap.set(l,o.id)),i.push(l),s.push({item:o,slug:l})}return await Promise.all(s.map(async({item:o,slug:l})=>{let f=Ae.join(e,l);await qe.promises.mkdir(f,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(f,o,n):await this.saveRequestToDir(f,o,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(Ae.join(e,Hr),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await qe.promises.writeFile(Ae.join(e,pr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),o={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}},l=[qe.promises.writeFile(Ae.join(e,pr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(qe.promises.writeFile(Ae.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(qe.promises.writeFile(Ae.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Ae.join(e,Hr),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return LS(e)}async cleanupOldBodyFiles(e,r){return jS(e,r)}async saveScriptsToDir(e,r){return bf(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=Ae.join(this.collectionsDir,r);if(!qe.existsSync(n))return!1;try{return await qe.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?qe.existsSync(Ae.join(this.collectionsDir,r,pr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Ae.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||vt(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(Ae.join(s,Hr),n);let o=this.findItemById(i.items,r);o&&(o.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Ae.join(n,Hr))}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=Ae.join(this.collectionsDir,i),o=Ae.join(s,pr.collection),l=qe.readFileSync(o,"utf-8"),c={...JSON.parse(l),...r,id:e};await qe.promises.writeFile(o,JSON.stringify(c,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 o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=Ae.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=qe.readdirSync(o).filter(h=>qe.statSync(Ae.join(o,h)).isDirectory()&&h!==Hr);l=cn(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Ae.join(o,l);await qe.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let c=this.findItemById(i.items,r.id);if(c)Object.assign(c,r);else if(n){let p=this.findItemById(i.items,n);p&&p.type==="folder"&&(p.items=p.items||[],p.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||!qe.existsSync(i))return!1;try{await qe.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 o=this.findItemById(i.items,r);if(!o)return!1;let{id:l,type:f,items:c,...p}=n;return Object.assign(o,p),o.type==="folder"?await this.saveFolderToDir(s,o):await this.saveRequestToDir(s,o),!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 o=this.findItemPath(e,r);if(!o||!qe.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=Ae.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let c=Ae.join(l,f);if(qe.existsSync(c))return!1;try{await qe.promises.rename(o,c);let p=this.findItemById(i.items,r);if(p){let h=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(h))}else i.items.push(h)}return!0}catch(p){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,p),!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 o=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&o.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Ae.join(l,pr.folder),c=qe.readFileSync(f,"utf-8"),p=JSON.parse(c);p.order=o,await qe.promises.writeFile(f,JSON.stringify(p,null,2),"utf-8");let h=this.findItemById(i.items,r);h&&h.type==="folder"&&h.items&&(h.items=this.sortItemsByOrder(h.items,n))}else{let l=Ae.join(this.collectionsDir,s,pr.collection),f=qe.readFileSync(l,"utf-8"),c=JSON.parse(f);c.order=o,await qe.promises.writeFile(l,JSON.stringify(c,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 BS(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Ae.join(this.collectionsDir,n),s=Qh(i,r);if(s)return s;let o=this.load(e);if(o){let f=this.buildSlugPath(o.items,r);if(f)return Ae.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Kh(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return Gh(e,r)}deleteItemFromTree(e,r){return Yh(e,r)}}});var dt,ba=se(()=>{"use strict";dt=class{static parseSetCookie(e,r){let n=e.split(";").map(p=>p.trim());if(n.length===0)return null;let[i,...s]=n,o=i.indexOf("=");if(o===-1)return null;let l=i.substring(0,o).trim(),f=i.substring(o+1).trim(),c={name:l,value:f,domain:r};for(let p of s){let h=p.indexOf("="),g=(h===-1?p:p.substring(0,h)).toLowerCase(),v=h===-1?"":p.substring(h+1);switch(g){case"domain":c.domain=v.startsWith(".")?v.substring(1):v;break;case"path":c.path=v;break;case"expires":c.expires=v;break;case"max-age":c.maxAge=parseInt(v,10);break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break;case"samesite":c.sameSite=v;break}}return c}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 o of s){let l=this.parseSetCookie(o,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"/"}}}});function Sf(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function fu(t){if(!Zs.existsSync(t))return a2();let e=Xh(Sa.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=Zs.readdirSync(t).filter(c=>c.endsWith(".json")).filter(c=>!c.endsWith(".local.json")).filter(c=>!Sf(c)),s={};for(let c of i){let p=Xh(Sa.join(t,c))||{},h=Sa.basename(c,".json");s[h]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(Xh(Sa.join(t,"_global.local.json"))||{}).variables||{},f={};for(let c of Object.keys(s)){let p=Sa.join(t,`${c}.local.json`);if(Zs.existsSync(p)){let h=Xh(p)||{};f[c]={variables:h.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function a2(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Xh(t){try{if(!Zs.existsSync(t))return null;let e=Zs.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 Zs,Sa,em=se(()=>{"use strict";Zs=me(require("fs")),Sa=me(require("path"))});var In,du=se(()=>{"use strict";In=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,o="",l=e.indexOf("?");l!==-1&&(o=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let c=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(c,(h,g,v)=>{let _=r[g];return _!==void 0&&_!==""?encodeURIComponent(_):v?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${g}`),h)});return p=p.replace(/([^:])\/+/g,"$1/"),p.length>1&&p.endsWith("/")&&(p=p.slice(0,-1)),`${n}${i}${p}${o}`}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,c]=e.split("?");n=f,c&&new URLSearchParams(c).forEach((h,g)=>{i[g]=h})}let s={...i,...r},o=new URLSearchParams;for(let[f,c]of Object.entries(s))c!=null&&o.append(f,c);let l=o.toString();return l?`${n}?${l}`:n}}});function vI(t,e=0){return(ir[t[e+0]]+ir[t[e+1]]+ir[t[e+2]]+ir[t[e+3]]+"-"+ir[t[e+4]]+ir[t[e+5]]+"-"+ir[t[e+6]]+ir[t[e+7]]+"-"+ir[t[e+8]]+ir[t[e+9]]+"-"+ir[t[e+10]]+ir[t[e+11]]+ir[t[e+12]]+ir[t[e+13]]+ir[t[e+14]]+ir[t[e+15]]).toLowerCase()}var ir,bI=se(()=>{ir=[];for(let t=0;t<256;++t)ir.push((t+256).toString(16).slice(1))});function zS(){return crypto.getRandomValues(l2)}var l2,SI=se(()=>{l2=new Uint8Array(16)});function u2(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():c2(t,e,r)}function c2(t,e,r){t=t||{};let n=t.random??t.rng?.()??zS();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 vI(n)}var pu,wI=se(()=>{SI();bI();pu=u2});var JS=se(()=>{wI()});function f2(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function d2(){return Date.now()}function _I(){return pu()}function p2(){return pu()}function RI(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 h2(){let t=RI(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function m2(){return Math.random()<.5}function g2(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 y2(){return Math.floor(Date.now()/1e3)}function v2(){return new Date().toISOString()}function b2(){return new Date().toISOString().split("T")[0]}function S2(){return new Date().toISOString().split("T")[1].split(".")[0]}function w2(){return new Date().toISOString()}function _2(t=""){return Buffer.from(String(t)).toString("base64")}function R2(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function C2(t=""){return encodeURIComponent(String(t))}function x2(t=""){return decodeURIComponent(String(t))}function E2(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 Oi(t,e){let r=GS[t];return r?e&&e.length>0?r(...e):r():null}function CI(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?E2(n):void 0,s=Oi(r,i);return s===null?e:String(s)}catch{return e}})}function Xs(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],o=i[1];if(!(s in e)){let l=Oi(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var GS,tm=se(()=>{"use strict";JS();GS={randomInt:f2,timestamp:d2,guid:p2,uuid:_I,randomUUID:_I,randomString:RI,randomHexadecimal:g2,randomEmail:h2,randomBoolean:m2,isoTimestamp:w2,timestamp_s:y2,datetime:v2,date:b2,time:S2,base64Encode:_2,base64Decode:R2,urlEncode:C2,urlDecode:x2}});function eo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function to(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=rm.createContext(r);return rm.runInContext(t,n,{timeout:I2,displayErrors:!1})}catch{return}}var rm,I2,nm=se(()=>{"use strict";rm=me(require("vm")),I2=100});function q2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function hu(t){if(!t||!t.includes("|"))return null;let e=O2(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 o=k2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function O2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],f=o>0?t[o-1]:"",c=o<t.length-1?t[o+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(c==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function k2(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:P2(n)}}function P2(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if((s>0?t[s-1]:"")==="\\"){r+=o;continue}if(o==="'"&&!i){n=!n,r+=o;continue}else if(o==='"'&&!n){i=!i,r+=o;continue}else if(o===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=o}return r.trim()&&e.push(r.trim()),e}function $t(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=q2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function mu(t,e,r={}){let n=t;for(let i of e)n=T2(n,i.name,i.args,r);return n}function T2(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=$t(r[0],n),s=r[1]!==void 0?$t(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($t(r[0],n)):"",s=r[1]!==void 0?String($t(r[1],n)):"";return String(t).replace(new RegExp($2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String($t(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String($t(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($t(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=$t(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=$t(r[0],n);return Number(t)+i}case"subtract":{let i=$t(r[0],n);return Number(t)-i}case"multiply":{let i=$t(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?$t(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?$t(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return im.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String($t(r[0],n)):"",s=String(r[1]!==void 0?$t(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?$t(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return im.createHmac(f,i).update(String(t)).digest(o)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=$t(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=$t(r[0],n),s=r[1]!==void 0?$t(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:A2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String($t(s,n)));return i.length===1?t.map(s=>wf(s,i[0])):t.map(s=>{let o={};for(let l of i){let f=wf(s,l);f!==void 0&&(o[l]=f)}return o})}case"prop":{let i=r[0]!==void 0?String($t(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>wf(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?wf(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 A2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=$t(o,r);return t.filter(f=>{let c=wf(f,i);if(c===void 0)return!1;switch(s){case">":return Number(c)>Number(l);case">=":return Number(c)>=Number(l);case"<":return Number(c)<Number(l);case"<=":return Number(c)<=Number(l);case"=":return String(c)===String(l);case"!=":return String(c)!==String(l);case"*=":return String(c).includes(String(l));case"^=":return String(c).startsWith(String(l));case"$=":return String(c).endsWith(String(l));default:return!0}})}function wf(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function $2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var im,sm=se(()=>{"use strict";im=me(require("crypto"))});function xI(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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function EI(t){return new ro(t)}var ro,no,_f=se(()=>{"use strict";tm();nm();sm();ro=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let o=this.resolveSinglePass(i,r,n);if(o===i)break;i=o}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,c)=>this.resolveTemplateContent(c.trim(),r,f));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let f=l[1].trim(),c=this.resolveTemplateContent(f,r,l[0]);if(c!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(c),p):String(c)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,o]of Object.entries(e))i[s]=this.resolveObjectWithExtra(o,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=xI(i[2],r),f=Oi(i[1],l);return f!==null?String(f):n}let s=hu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=mu(l,s.filters,r);return f!==void 0?String(f):n}return n}let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(o){let l=o[1];if(r[l]!==void 0){let f=this.deserializeValue(r[l]),c=o[2],p=this.resolvePropertyAccess(f,c);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(eo(e)){let l=this.deserializeVariables(r),f=Xs(e,l),c=to(e,f);if(c!==void 0)return String(c)}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=xI(n[2],r),o=Oi(n[1],s);return o!==null?o: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 o=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(o,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(eo(e)){let s=this.deserializeVariables(r),o=Xs(e,s),l=to(e,o);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 o=s[1];/^\d+$/.test(o)?n=n[Number(o)]:n=n[o.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}},no=class{interpolate(e,r){return!e||typeof e!="string"?e:new ro({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});var N2,Rf,YS,om,qn,io,Cf=se(()=>{"use strict";N2=me(require("http")),Rf=me(require("https")),YS=require("url"),om=me(require("zlib")),qn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},io=class{settings;version;constructor(e){this.settings={...qn,...e};try{this.version=require("../../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(),o=new YS.URL(e.url),l=o.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(h=>h.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let p={hostname:o.hostname,port:o.port||(l?443:80),path:o.pathname+o.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l&&(p.rejectUnauthorized=r.strictSSL,r.strictSSL?p.agent=Rf.globalAgent:p.agent=new Rf.Agent({rejectUnauthorized:!1})),new Promise((h,g)=>{if(i?.aborted){let w=new Error("Request cancelled");w.name="AbortError",g(w);return}let _=(l?Rf:N2).request(p,async w=>{let E=w.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(E)){if(n>=r.maxRedirects){g(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let T=w.headers.location;if(!T){g(new Error("Redirect response missing Location header"));return}let N=new YS.URL(T,e.url).toString(),$=e.method;!r.followOriginalMethod&&[301,302,303].includes(E)&&($="GET");let j={...e.headers};r.followAuthHeader||(delete j.authorization,delete j.Authorization);try{let G=await this.executeInternal({...e,url:N,method:$,headers:j,body:$==="GET"?void 0:e.body},r,n+1,i),O=Date.now();G.time=O-s,h(G)}catch(G){g(G)}return}let k=[];w.on("data",T=>k.push(T)),w.on("end",()=>{let T=Date.now(),N=Buffer.concat(k),$=w.headers["content-encoding"];if(r.decompress&&$)try{$==="gzip"?N=om.gunzipSync(N):$==="deflate"&&(N=om.inflateSync(N))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let j=N.toString("utf-8"),G={};for(let[C,A]of Object.entries(w.headers))(typeof A=="string"||Array.isArray(A))&&(G[C]=A);let O=this.parseCookies(w.headers["set-cookie"],o.hostname);h({status:w.statusCode||0,statusText:w.statusMessage||"",headers:G,cookies:O,body:j,time:T-s,size:N.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let w=new Error("Request cancelled");w.name="AbortError",g(w)}),_.on("error",w=>{g(w)}),_.on("timeout",()=>{_.destroy(),g(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let w=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(w)}_.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(p=>p.trim()),[s,...o]=i,[l,f]=s.split("="),c={name:l.trim(),value:f?.trim()||"",domain:r};for(let p of o){let[h,g]=p.split("=");switch(h.toLowerCase().trim()){case"domain":c.domain=g?.trim();break;case"path":c.path=g?.trim();break;case"expires":c.expires=g?.trim();break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break}}return c}):[]}}});function am(t){return{timeout:t?.timeout??qn.timeout,followRedirects:t?.followRedirects??qn.followRedirects,followOriginalMethod:t?.followOriginalMethod??qn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??qn.followAuthHeader,maxRedirects:t?.maxRedirects??qn.maxRedirects,strictSSL:t?.strictSSL??qn.strictSSL,decompress:t?.decompress??qn.decompress,includeCookies:t?.includeCookies??qn.includeCookies}}var KS=se(()=>{"use strict";Cf()});var ki,xf=se(()=>{"use strict";KS();ki=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=am(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,e,n);if(o)return o;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,i,n);if(o)return o;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var Pi,lm,um,cm,Ef=se(()=>{"use strict";Pi=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(o){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,o),o}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))}},lm=class{name="logging";priority=1e3;intercept(e,r){return e}},um=class{name="timing";priority=1;intercept(e,r,n){return e}},cm=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 II=H((gu,If)=>{(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`",o="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,c="__lodash_placeholder__",p=1,h=2,g=4,v=1,_=2,w=1,E=2,k=4,T=8,N=16,$=32,j=64,G=128,O=256,C=512,A=30,D="...",B=800,F=16,K=1,ee=2,ie=3,pe=1/0,Pe=9007199254740991,de=17976931348623157e292,le=NaN,be=4294967295,ze=be-1,mt=be>>>1,ce=[["ary",G],["bind",w],["bindKey",E],["curry",T],["curryRight",N],["flip",C],["partial",$],["partialRight",j],["rearg",O]],rr="[object Arguments]",Ne="[object Array]",it="[object AsyncFunction]",en="[object Boolean]",$r="[object Date]",_t="[object DOMException]",Rt="[object Error]",mn="[object Function]",Lo="[object GeneratorFunction]",Zt="[object Map]",jo="[object Number]",wv="[object Null]",Dn="[object Object]",Pp="[object Promise]",Tp="[object Proxy]",Xt="[object RegExp]",wr="[object Set]",Uo="[object String]",yl="[object Symbol]",Ap="[object Undefined]",Jt="[object WeakMap]",$p="[object WeakSet]",Ji="[object ArrayBuffer]",Ln="[object DataView]",ht="[object Float32Array]",vl="[object Float64Array]",bl="[object Int8Array]",Ps="[object Int16Array]",Ho="[object Int32Array]",Ts="[object Uint8Array]",vi="[object Uint8ClampedArray]",As="[object Uint16Array]",$c="[object Uint32Array]",Sl=/\b__p \+= '';/g,_v=/\b(__p \+=) '' \+/g,Bo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Gi=/&(?:amp|lt|gt|quot|#39);/g,wl=/[&<>"']/g,_l=RegExp(Gi.source),fe=RegExp(wl.source),Rv=/<%-([\s\S]+?)%>/g,Cv=/<%([\s\S]+?)%>/g,gn=/<%=([\s\S]+?)%>/g,Nr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,De=/^\w*$/,Nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,st=/[\\^$.*+?()[\]{}|]/g,Vo=RegExp(st.source),Mc=/^\s+/,Rl=/\s/,er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,jn=/\{\n\/\* \[wrapped with (.+)\] \*/,yn=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mr=/[()=,{}\[\]\/\s]/,Un=/\\(\\)?/g,Yi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Np=/\w*$/,xv=/^[-+]0x[0-9a-f]+$/i,Wo=/^0b[01]+$/i,Mp=/^\[object .+?Constructor\]$/,Ev=/^0o[0-7]+$/i,$s=/^(?:0|[1-9]\d*)$/,zo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jo=/($^)/,Iv=/['\n\r\u2028\u2029\\]/g,Cl="\\ud800-\\udfff",qv="\\u0300-\\u036f",kt="\\ufe20-\\ufe2f",Fc="\\u20d0-\\u20ff",Fp=qv+kt+Fc,Dc="\\u2700-\\u27bf",Lc="a-z\\xdf-\\xf6\\xf8-\\xff",Ov="\\xac\\xb1\\xd7\\xf7",kv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Pv="\\u2000-\\u206f",Tv=" \\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",Dp="A-Z\\xc0-\\xd6\\xd8-\\xde",Lp="\\ufe0e\\ufe0f",jc=Ov+kv+Pv+Tv,xl="['\u2019]",Av="["+Cl+"]",jp="["+jc+"]",El="["+Fp+"]",Uc="\\d+",$v="["+Dc+"]",Ns="["+Lc+"]",Go="[^"+Cl+jc+Uc+Dc+Lc+Dp+"]",Il="\\ud83c[\\udffb-\\udfff]",Yo="(?:"+El+"|"+Il+")",vn="[^"+Cl+"]",Hc="(?:\\ud83c[\\udde6-\\uddff]){2}",Bc="[\\ud800-\\udbff][\\udc00-\\udfff]",Ms="["+Dp+"]",Up="\\u200d",Hp="(?:"+Ns+"|"+Go+")",Nv="(?:"+Ms+"|"+Go+")",Bp="(?:"+xl+"(?:d|ll|m|re|s|t|ve))?",Vp="(?:"+xl+"(?:D|LL|M|RE|S|T|VE))?",ql=Yo+"?",Wp="["+Lp+"]?",zp="(?:"+Up+"(?:"+[vn,Hc,Bc].join("|")+")"+Wp+ql+")*",Mv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Jp=Wp+ql+zp,Dv="(?:"+[$v,Hc,Bc].join("|")+")"+Jp,Lv="(?:"+[vn+El+"?",El,Hc,Bc,Av].join("|")+")",jv=RegExp(xl,"g"),Uv=RegExp(El,"g"),Vc=RegExp(Il+"(?="+Il+")|"+Lv+Jp,"g"),Hv=RegExp([Ms+"?"+Ns+"+"+Bp+"(?="+[jp,Ms,"$"].join("|")+")",Nv+"+"+Vp+"(?="+[jp,Ms+Hp,"$"].join("|")+")",Ms+"?"+Hp+"+"+Bp,Ms+"+"+Vp,Fv,Mv,Uc,Dv].join("|"),"g"),Bv=RegExp("["+Up+Cl+Fp+Lp+"]"),Vv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wv=["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"],zv=-1,St={};St[ht]=St[vl]=St[bl]=St[Ps]=St[Ho]=St[Ts]=St[vi]=St[As]=St[$c]=!0,St[rr]=St[Ne]=St[Ji]=St[en]=St[Ln]=St[$r]=St[Rt]=St[mn]=St[Zt]=St[jo]=St[Dn]=St[Xt]=St[wr]=St[Uo]=St[Jt]=!1;var gt={};gt[rr]=gt[Ne]=gt[Ji]=gt[Ln]=gt[en]=gt[$r]=gt[ht]=gt[vl]=gt[bl]=gt[Ps]=gt[Ho]=gt[Zt]=gt[jo]=gt[Dn]=gt[Xt]=gt[wr]=gt[Uo]=gt[yl]=gt[Ts]=gt[vi]=gt[As]=gt[$c]=!0,gt[Rt]=gt[mn]=gt[Jt]=!1;var Wc={\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"},zc={"&":"&","<":"<",">":">",'"':""","'":"'"},Jv={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Yp=parseFloat,Gv=parseInt,Kp=typeof global=="object"&&global&&global.Object===Object&&global,Yv=typeof self=="object"&&self&&self.Object===Object&&self,Ut=Kp||Yv||Function("return this")(),Ol=typeof gu=="object"&&gu&&!gu.nodeType&&gu,ot=Ol&&typeof If=="object"&&If&&!If.nodeType&&If,Fs=ot&&ot.exports===Ol,Ki=Fs&&Kp.process,Fr=(function(){try{var V=ot&&ot.require&&ot.require("util").types;return V||Ki&&Ki.binding&&Ki.binding("util")}catch{}})(),Jc=Fr&&Fr.isArrayBuffer,Qp=Fr&&Fr.isDate,Zp=Fr&&Fr.isMap,Ko=Fr&&Fr.isRegExp,Hn=Fr&&Fr.isSet,kl=Fr&&Fr.isTypedArray;function _r(V,Q,z){switch(z.length){case 0:return V.call(Q);case 1:return V.call(Q,z[0]);case 2:return V.call(Q,z[0],z[1]);case 3:return V.call(Q,z[0],z[1],z[2])}return V.apply(Q,z)}function Bn(V,Q,z,ue){for(var Ce=-1,rt=V==null?0:V.length;++Ce<rt;){var ct=V[Ce];Q(ue,ct,z(ct),V)}return ue}function Rr(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue&&Q(V[z],z,V)!==!1;);return V}function Gc(V,Q){for(var z=V==null?0:V.length;z--&&Q(V[z],z,V)!==!1;);return V}function Xp(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(!Q(V[z],z,V))return!1;return!0}function bi(V,Q){for(var z=-1,ue=V==null?0:V.length,Ce=0,rt=[];++z<ue;){var ct=V[z];Q(ct,z,V)&&(rt[Ce++]=ct)}return rt}function Pl(V,Q){var z=V==null?0:V.length;return!!z&&Qi(V,Q,0)>-1}function Ds(V,Q,z){for(var ue=-1,Ce=V==null?0:V.length;++ue<Ce;)if(z(Q,V[ue]))return!0;return!1}function yt(V,Q){for(var z=-1,ue=V==null?0:V.length,Ce=Array(ue);++z<ue;)Ce[z]=Q(V[z],z,V);return Ce}function Si(V,Q){for(var z=-1,ue=Q.length,Ce=V.length;++z<ue;)V[Ce+z]=Q[z];return V}function Yc(V,Q,z,ue){var Ce=-1,rt=V==null?0:V.length;for(ue&&rt&&(z=V[++Ce]);++Ce<rt;)z=Q(z,V[Ce],Ce,V);return z}function Kv(V,Q,z,ue){var Ce=V==null?0:V.length;for(ue&&Ce&&(z=V[--Ce]);Ce--;)z=Q(z,V[Ce],Ce,V);return z}function Tl(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(Q(V[z],z,V))return!0;return!1}var Qv=Qo("length");function Zv(V){return V.split("")}function Xv(V){return V.match(Ft)||[]}function eh(V,Q,z){var ue;return z(V,function(Ce,rt,ct){if(Q(Ce,rt,ct))return ue=rt,!1}),ue}function Al(V,Q,z,ue){for(var Ce=V.length,rt=z+(ue?1:-1);ue?rt--:++rt<Ce;)if(Q(V[rt],rt,V))return rt;return-1}function Qi(V,Q,z){return Q===Q?lb(V,Q,z):Al(V,Zi,z)}function eb(V,Q,z,ue){for(var Ce=z-1,rt=V.length;++Ce<rt;)if(ue(V[Ce],Q))return Ce;return-1}function Zi(V){return V!==V}function th(V,Q){var z=V==null?0:V.length;return z?Qc(V,Q)/z:le}function Qo(V){return function(Q){return Q==null?t:Q[V]}}function Kc(V){return function(Q){return V==null?t:V[Q]}}function $l(V,Q,z,ue,Ce){return Ce(V,function(rt,ct,Je){z=ue?(ue=!1,rt):Q(z,rt,ct,Je)}),z}function tb(V,Q){var z=V.length;for(V.sort(Q);z--;)V[z]=V[z].value;return V}function Qc(V,Q){for(var z,ue=-1,Ce=V.length;++ue<Ce;){var rt=Q(V[ue]);rt!==t&&(z=z===t?rt:z+rt)}return z}function Zc(V,Q){for(var z=-1,ue=Array(V);++z<V;)ue[z]=Q(z);return ue}function rb(V,Q){return yt(Q,function(z){return[z,V[z]]})}function Xc(V){return V&&V.slice(0,oh(V)+1).replace(Mc,"")}function Cr(V){return function(Q){return V(Q)}}function Nl(V,Q){return yt(Q,function(z){return V[z]})}function ut(V,Q){return V.has(Q)}function rh(V,Q){for(var z=-1,ue=V.length;++z<ue&&Qi(Q,V[z],0)>-1;);return z}function nh(V,Q){for(var z=V.length;z--&&Qi(Q,V[z],0)>-1;);return z}function ih(V,Q){for(var z=V.length,ue=0;z--;)V[z]===Q&&++ue;return ue}var nb=Kc(Wc),ib=Kc(zc);function sb(V){return"\\"+Gp[V]}function Zo(V,Q){return V==null?t:V[Q]}function Ls(V){return Bv.test(V)}function ob(V){return Vv.test(V)}function ab(V){for(var Q,z=[];!(Q=V.next()).done;)z.push(Q.value);return z}function js(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue,Ce){z[++Q]=[Ce,ue]}),z}function Xo(V,Q){return function(z){return V(Q(z))}}function bn(V,Q){for(var z=-1,ue=V.length,Ce=0,rt=[];++z<ue;){var ct=V[z];(ct===Q||ct===c)&&(V[z]=c,rt[Ce++]=z)}return rt}function Ml(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=ue}),z}function sh(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=[ue,ue]}),z}function lb(V,Q,z){for(var ue=z-1,Ce=V.length;++ue<Ce;)if(V[ue]===Q)return ue;return-1}function ef(V,Q,z){for(var ue=z+1;ue--;)if(V[ue]===Q)return ue;return ue}function wi(V){return Ls(V)?cb(V):Qv(V)}function xr(V){return Ls(V)?fb(V):Zv(V)}function oh(V){for(var Q=V.length;Q--&&Rl.test(V.charAt(Q)););return Q}var ub=Kc(Jv);function cb(V){for(var Q=Vc.lastIndex=0;Vc.test(V);)++Q;return Q}function fb(V){return V.match(Vc)||[]}function db(V){return V.match(Hv)||[]}var pb=(function V(Q){Q=Q==null?Ut:_i.defaults(Ut.Object(),Q,_i.pick(Ut,Wv));var z=Q.Array,ue=Q.Date,Ce=Q.Error,rt=Q.Function,ct=Q.Math,Je=Q.Object,Fl=Q.RegExp,hb=Q.String,Er=Q.TypeError,ea=z.prototype,mb=rt.prototype,Us=Je.prototype,ta=Q["__core-js_shared__"],Dl=mb.toString,at=Us.hasOwnProperty,gb=0,ah=(function(){var a=/[^.]+$/.exec(ta&&ta.keys&&ta.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Ll=Us.toString,yb=Dl.call(Je),vb=Ut._,bb=Fl("^"+Dl.call(at).replace(st,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jl=Fs?Q.Buffer:t,Ri=Q.Symbol,Ul=Q.Uint8Array,lh=jl?jl.allocUnsafe:t,Hl=Xo(Je.getPrototypeOf,Je),uh=Je.create,ra=Us.propertyIsEnumerable,Bl=ea.splice,ch=Ri?Ri.isConcatSpreadable:t,na=Ri?Ri.iterator:t,Xi=Ri?Ri.toStringTag:t,Vl=(function(){try{var a=pa(Je,"defineProperty");return a({},"",{}),a}catch{}})(),Sb=Q.clearTimeout!==Ut.clearTimeout&&Q.clearTimeout,wb=ue&&ue.now!==Ut.Date.now&&ue.now,_b=Q.setTimeout!==Ut.setTimeout&&Q.setTimeout,ia=ct.ceil,sa=ct.floor,Wl=Je.getOwnPropertySymbols,zl=jl?jl.isBuffer:t,es=Q.isFinite,Jl=ea.join,fh=Xo(Je.keys,Je),Ct=ct.max,Gt=ct.min,dh=ue.now,Rb=Q.parseInt,ph=ct.random,Cb=ea.reverse,tf=pa(Q,"DataView"),oa=pa(Q,"Map"),rf=pa(Q,"Promise"),Hs=pa(Q,"Set"),aa=pa(Q,"WeakMap"),la=pa(Je,"create"),Gl=aa&&new aa,Bs={},xb=ha(tf),Eb=ha(oa),Ib=ha(rf),qb=ha(Hs),Ob=ha(aa),Yl=Ri?Ri.prototype:t,ua=Yl?Yl.valueOf:t,hh=Yl?Yl.toString:t;function q(a){if(At(a)&&!Ie(a)&&!(a instanceof Le)){if(a instanceof cr)return a;if(at.call(a,"__wrapped__"))return OE(a)}return new cr(a)}var Vs=(function(){function a(){}return function(u){if(!Pt(u))return{};if(uh)return uh(u);a.prototype=u;var m=new a;return a.prototype=t,m}})();function Kl(){}function cr(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}q.templateSettings={escape:Rv,evaluate:Cv,interpolate:gn,variable:"",imports:{_:q}},q.prototype=Kl.prototype,q.prototype.constructor=q,cr.prototype=Vs(Kl.prototype),cr.prototype.constructor=cr;function Le(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=be,this.__views__=[]}function kb(){var a=new Le(this.__wrapped__);return a.__actions__=Dr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Dr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Dr(this.__views__),a}function Pb(){if(this.__filtered__){var a=new Le(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function nf(){var a=this.__wrapped__.value(),u=this.__dir__,m=Ie(a),b=u<0,x=m?a.length:0,P=IM(0,x,this.__views__),M=P.start,U=P.end,W=U-M,Z=b?U:M-1,X=this.__iteratees__,te=X.length,oe=0,he=Gt(W,this.__takeCount__);if(!m||!b&&x==W&&he==W)return Zx(a,this.__actions__);var _e=[];e:for(;W--&&oe<he;){Z+=u;for(var Te=-1,Se=a[Z];++Te<te;){var Ve=X[Te],Ge=Ve.iteratee,an=Ve.type,Or=Ge(Se);if(an==ee)Se=Or;else if(!Or){if(an==K)continue e;break e}}_e[oe++]=Se}return _e}Le.prototype=Vs(Kl.prototype),Le.prototype.constructor=Le;function Sn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Tb(){this.__data__=la?la(null):{},this.size=0}function Ab(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function $b(a){var u=this.__data__;if(la){var m=u[a];return m===l?t:m}return at.call(u,a)?u[a]:t}function Nb(a){var u=this.__data__;return la?u[a]!==t:at.call(u,a)}function Mb(a,u){var m=this.__data__;return this.size+=this.has(a)?0:1,m[a]=la&&u===t?l:u,this}Sn.prototype.clear=Tb,Sn.prototype.delete=Ab,Sn.prototype.get=$b,Sn.prototype.has=Nb,Sn.prototype.set=Mb;function Vn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function mh(){this.__data__=[],this.size=0}function Fb(a){var u=this.__data__,m=Zl(u,a);if(m<0)return!1;var b=u.length-1;return m==b?u.pop():Bl.call(u,m,1),--this.size,!0}function Db(a){var u=this.__data__,m=Zl(u,a);return m<0?t:u[m][1]}function gh(a){return Zl(this.__data__,a)>-1}function Lb(a,u){var m=this.__data__,b=Zl(m,a);return b<0?(++this.size,m.push([a,u])):m[b][1]=u,this}Vn.prototype.clear=mh,Vn.prototype.delete=Fb,Vn.prototype.get=Db,Vn.prototype.has=gh,Vn.prototype.set=Lb;function Wn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function jb(){this.size=0,this.__data__={hash:new Sn,map:new(oa||Vn),string:new Sn}}function Ci(a){var u=Fh(this,a).delete(a);return this.size-=u?1:0,u}function yh(a){return Fh(this,a).get(a)}function Ub(a){return Fh(this,a).has(a)}function Hb(a,u){var m=Fh(this,a),b=m.size;return m.set(a,u),this.size+=m.size==b?0:1,this}Wn.prototype.clear=jb,Wn.prototype.delete=Ci,Wn.prototype.get=yh,Wn.prototype.has=Ub,Wn.prototype.set=Hb;function ts(a){var u=-1,m=a==null?0:a.length;for(this.__data__=new Wn;++u<m;)this.add(a[u])}function re(a){return this.__data__.set(a,l),this}function Bb(a){return this.__data__.has(a)}ts.prototype.add=ts.prototype.push=re,ts.prototype.has=Bb;function tn(a){var u=this.__data__=new Vn(a);this.size=u.size}function vh(){this.__data__=new Vn,this.size=0}function Qe(a){var u=this.__data__,m=u.delete(a);return this.size=u.size,m}function Ql(a){return this.__data__.get(a)}function bh(a){return this.__data__.has(a)}function sf(a,u){var m=this.__data__;if(m instanceof Vn){var b=m.__data__;if(!oa||b.length<r-1)return b.push([a,u]),this.size=++m.size,this;m=this.__data__=new Wn(b)}return m.set(a,u),this.size=m.size,this}tn.prototype.clear=vh,tn.prototype.delete=Qe,tn.prototype.get=Ql,tn.prototype.has=bh,tn.prototype.set=sf;function Sh(a,u){var m=Ie(a),b=!m&&ma(a),x=!m&&!b&&Qs(a),P=!m&&!b&&!x&&iu(a),M=m||b||x||P,U=M?Zc(a.length,hb):[],W=U.length;for(var Z in a)(u||at.call(a,Z))&&!(M&&(Z=="length"||x&&(Z=="offset"||Z=="parent")||P&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||ss(Z,W)))&&U.push(Z);return U}function wh(a){var u=a.length;return u?a[rS(0,u-1)]:t}function Vb(a,u){return Dh(Dr(a),xi(u,0,a.length))}function Wb(a){return Dh(Dr(a))}function of(a,u,m){(m!==t&&!Kn(a[u],m)||m===t&&!(u in a))&&rn(a,u,m)}function Ir(a,u,m){var b=a[u];(!(at.call(a,u)&&Kn(b,m))||m===t&&!(u in a))&&rn(a,u,m)}function Zl(a,u){for(var m=a.length;m--;)if(Kn(a[m][0],u))return m;return-1}function _h(a,u,m,b){return Ei(a,function(x,P,M){u(b,x,m(x),M)}),b}function Rh(a,u){return a&&Ii(u,tr(u),a)}function zb(a,u){return a&&Ii(u,jr(u),a)}function rn(a,u,m){u=="__proto__"&&Vl?Vl(a,u,{configurable:!0,enumerable:!0,value:m,writable:!0}):a[u]=m}function af(a,u){for(var m=-1,b=u.length,x=z(b),P=a==null;++m<b;)x[m]=P?t:qS(a,u[m]);return x}function xi(a,u,m){return a===a&&(m!==t&&(a=a<=m?a:m),u!==t&&(a=a>=u?a:u)),a}function fr(a,u,m,b,x,P){var M,U=u&p,W=u&h,Z=u&g;if(m&&(M=x?m(a,b,x,P):m(a)),M!==t)return M;if(!Pt(a))return a;var X=Ie(a);if(X){if(M=OM(a),!U)return Dr(a,M)}else{var te=dr(a),oe=te==mn||te==Lo;if(Qs(a))return tE(a,U);if(te==Dn||te==rr||oe&&!x){if(M=W||oe?{}:SE(a),!U)return W?vM(a,zb(M,a)):yM(a,Rh(M,a))}else{if(!gt[te])return x?a:{};M=kM(a,te,U)}}P||(P=new tn);var he=P.get(a);if(he)return he;P.set(a,M),YE(a)?a.forEach(function(Se){M.add(fr(Se,u,m,Se,a,P))}):JE(a)&&a.forEach(function(Se,Ve){M.set(Ve,fr(Se,u,m,Ve,a,P))});var _e=Z?W?pS:dS:W?jr:tr,Te=X?t:_e(a);return Rr(Te||a,function(Se,Ve){Te&&(Ve=Se,Se=a[Ve]),Ir(M,Ve,fr(Se,u,m,Ve,a,P))}),M}function Jb(a){var u=tr(a);return function(m){return wn(m,a,u)}}function wn(a,u,m){var b=m.length;if(a==null)return!b;for(a=Je(a);b--;){var x=m[b],P=u[x],M=a[x];if(M===t&&!(x in a)||!P(M))return!1}return!0}function lf(a,u,m){if(typeof a!="function")throw new Er(i);return mf(function(){a.apply(t,m)},u)}function ca(a,u,m,b){var x=-1,P=Pl,M=!0,U=a.length,W=[],Z=u.length;if(!U)return W;m&&(u=yt(u,Cr(m))),b?(P=Ds,M=!1):u.length>=r&&(P=ut,M=!1,u=new ts(u));e:for(;++x<U;){var X=a[x],te=m==null?X:m(X);if(X=b||X!==0?X:0,M&&te===te){for(var oe=Z;oe--;)if(u[oe]===te)continue e;W.push(X)}else P(u,te,b)||W.push(X)}return W}var Ei=oE(_n),Ch=oE(zn,!0);function Gb(a,u){var m=!0;return Ei(a,function(b,x,P){return m=!!u(b,x,P),m}),m}function Xl(a,u,m){for(var b=-1,x=a.length;++b<x;){var P=a[b],M=u(P);if(M!=null&&(U===t?M===M&&!on(M):m(M,U)))var U=M,W=P}return W}function Yb(a,u,m,b){var x=a.length;for(m=Oe(m),m<0&&(m=-m>x?0:x+m),b=b===t||b>x?x:Oe(b),b<0&&(b+=x),b=m>b?0:QE(b);m<b;)a[m++]=u;return a}function xh(a,u){var m=[];return Ei(a,function(b,x,P){u(b,x,P)&&m.push(b)}),m}function Yt(a,u,m,b,x){var P=-1,M=a.length;for(m||(m=TM),x||(x=[]);++P<M;){var U=a[P];u>0&&m(U)?u>1?Yt(U,u-1,m,b,x):Si(x,U):b||(x[x.length]=U)}return x}var uf=aE(),Eh=aE(!0);function _n(a,u){return a&&uf(a,u,tr)}function zn(a,u){return a&&Eh(a,u,tr)}function eu(a,u){return bi(u,function(m){return os(a[m])})}function rs(a,u){u=Ys(u,a);for(var m=0,b=u.length;a!=null&&m<b;)a=a[Yn(u[m++])];return m&&m==b?a:t}function Ih(a,u,m){var b=u(a);return Ie(a)?b:Si(b,m(a))}function nr(a){return a==null?a===t?Ap:wv:Xi&&Xi in Je(a)?EM(a):LM(a)}function cf(a,u){return a>u}function Kb(a,u){return a!=null&&at.call(a,u)}function Qb(a,u){return a!=null&&u in Je(a)}function Zb(a,u,m){return a>=Gt(u,m)&&a<Ct(u,m)}function nn(a,u,m){for(var b=m?Ds:Pl,x=a[0].length,P=a.length,M=P,U=z(P),W=1/0,Z=[];M--;){var X=a[M];M&&u&&(X=yt(X,Cr(u))),W=Gt(X.length,W),U[M]=!m&&(u||x>=120&&X.length>=120)?new ts(M&&X):t}X=a[0];var te=-1,oe=U[0];e:for(;++te<x&&Z.length<W;){var he=X[te],_e=u?u(he):he;if(he=m||he!==0?he:0,!(oe?ut(oe,_e):b(Z,_e,m))){for(M=P;--M;){var Te=U[M];if(!(Te?ut(Te,_e):b(a[M],_e,m)))continue e}oe&&oe.push(_e),Z.push(he)}}return Z}function Ws(a,u,m,b){return _n(a,function(x,P,M){u(b,m(x),P,M)}),b}function fa(a,u,m){u=Ys(u,a),a=CE(a,u);var b=a==null?a:a[Yn(Cn(u))];return b==null?t:_r(b,a,m)}function qh(a){return At(a)&&nr(a)==rr}function Xb(a){return At(a)&&nr(a)==Ji}function eS(a){return At(a)&&nr(a)==$r}function da(a,u,m,b,x){return a===u?!0:a==null||u==null||!At(a)&&!At(u)?a!==a&&u!==u:ff(a,u,m,b,da,x)}function ff(a,u,m,b,x,P){var M=Ie(a),U=Ie(u),W=M?Ne:dr(a),Z=U?Ne:dr(u);W=W==rr?Dn:W,Z=Z==rr?Dn:Z;var X=W==Dn,te=Z==Dn,oe=W==Z;if(oe&&Qs(a)){if(!Qs(u))return!1;M=!0,X=!1}if(oe&&!X)return P||(P=new tn),M||iu(a)?yE(a,u,m,b,x,P):CM(a,u,W,m,b,x,P);if(!(m&v)){var he=X&&at.call(a,"__wrapped__"),_e=te&&at.call(u,"__wrapped__");if(he||_e){var Te=he?a.value():a,Se=_e?u.value():u;return P||(P=new tn),x(Te,Se,m,b,P)}}return oe?(P||(P=new tn),xM(a,u,m,b,x,P)):!1}function zs(a){return At(a)&&dr(a)==Zt}function Js(a,u,m,b){var x=m.length,P=x,M=!b;if(a==null)return!P;for(a=Je(a);x--;){var U=m[x];if(M&&U[2]?U[1]!==a[U[0]]:!(U[0]in a))return!1}for(;++x<P;){U=m[x];var W=U[0],Z=a[W],X=U[1];if(M&&U[2]){if(Z===t&&!(W in a))return!1}else{var te=new tn;if(b)var oe=b(Z,X,W,a,u,te);if(!(oe===t?da(X,Z,v|_,b,te):oe))return!1}}return!0}function Be(a){if(!Pt(a)||$M(a))return!1;var u=os(a)?bb:Mp;return u.test(ha(a))}function d(a){return At(a)&&nr(a)==Xt}function y(a){return At(a)&&dr(a)==wr}function S(a){return At(a)&&Vh(a.length)&&!!St[nr(a)]}function R(a){return typeof a=="function"?a:a==null?Ur:typeof a=="object"?Ie(a)?je(a[0],a[1]):Re(a):uI(a)}function I(a){if(!hf(a))return fh(a);var u=[];for(var m in Je(a))at.call(a,m)&&m!="constructor"&&u.push(m);return u}function L(a){if(!Pt(a))return DM(a);var u=hf(a),m=[];for(var b in a)b=="constructor"&&(u||!at.call(a,b))||m.push(b);return m}function Y(a,u){return a<u}function ae(a,u){var m=-1,b=Lr(a)?z(a.length):[];return Ei(a,function(x,P,M){b[++m]=u(x,P,M)}),b}function Re(a){var u=mS(a);return u.length==1&&u[0][2]?_E(u[0][0],u[0][1]):function(m){return m===a||Js(m,a,u)}}function je(a,u){return yS(a)&&wE(u)?_E(Yn(a),u):function(m){var b=qS(m,a);return b===t&&b===u?OS(m,a):da(u,b,v|_)}}function Ht(a,u,m,b,x){a!==u&&uf(u,function(P,M){if(x||(x=new tn),Pt(P))Jn(a,u,M,m,Ht,b,x);else{var U=b?b(bS(a,M),P,M+"",a,u,x):t;U===t&&(U=P),of(a,M,U)}},jr)}function Jn(a,u,m,b,x,P,M){var U=bS(a,m),W=bS(u,m),Z=M.get(W);if(Z){of(a,m,Z);return}var X=P?P(U,W,m+"",a,u,M):t,te=X===t;if(te){var oe=Ie(W),he=!oe&&Qs(W),_e=!oe&&!he&&iu(W);X=W,oe||he||_e?Ie(U)?X=U:Dt(U)?X=Dr(U):he?(te=!1,X=tE(W,!0)):_e?(te=!1,X=rE(W,!0)):X=[]:gf(W)||ma(W)?(X=U,ma(U)?X=ZE(U):(!Pt(U)||os(U))&&(X=SE(W))):te=!1}te&&(M.set(W,X),x(X,W,b,P,M),M.delete(W)),of(a,m,X)}function Gn(a,u){var m=a.length;if(m)return u+=u<0?m:0,ss(u,m)?a[u]:t}function Wx(a,u,m){u.length?u=yt(u,function(P){return Ie(P)?function(M){return rs(M,P.length===1?P[0]:P)}:P}):u=[Ur];var b=-1;u=yt(u,Cr(we()));var x=ae(a,function(P,M,U){var W=yt(u,function(Z){return Z(P)});return{criteria:W,index:++b,value:P}});return tb(x,function(P,M){return gM(P,M,m)})}function iM(a,u){return zx(a,u,function(m,b){return OS(a,b)})}function zx(a,u,m){for(var b=-1,x=u.length,P={};++b<x;){var M=u[b],U=rs(a,M);m(U,M)&&df(P,Ys(M,a),U)}return P}function sM(a){return function(u){return rs(u,a)}}function tS(a,u,m,b){var x=b?eb:Qi,P=-1,M=u.length,U=a;for(a===u&&(u=Dr(u)),m&&(U=yt(a,Cr(m)));++P<M;)for(var W=0,Z=u[P],X=m?m(Z):Z;(W=x(U,X,W,b))>-1;)U!==a&&Bl.call(U,W,1),Bl.call(a,W,1);return a}function Jx(a,u){for(var m=a?u.length:0,b=m-1;m--;){var x=u[m];if(m==b||x!==P){var P=x;ss(x)?Bl.call(a,x,1):sS(a,x)}}return a}function rS(a,u){return a+sa(ph()*(u-a+1))}function oM(a,u,m,b){for(var x=-1,P=Ct(ia((u-a)/(m||1)),0),M=z(P);P--;)M[b?P:++x]=a,a+=m;return M}function nS(a,u){var m="";if(!a||u<1||u>Pe)return m;do u%2&&(m+=a),u=sa(u/2),u&&(a+=a);while(u);return m}function Me(a,u){return SS(RE(a,u,Ur),a+"")}function aM(a){return wh(su(a))}function lM(a,u){var m=su(a);return Dh(m,xi(u,0,m.length))}function df(a,u,m,b){if(!Pt(a))return a;u=Ys(u,a);for(var x=-1,P=u.length,M=P-1,U=a;U!=null&&++x<P;){var W=Yn(u[x]),Z=m;if(W==="__proto__"||W==="constructor"||W==="prototype")return a;if(x!=M){var X=U[W];Z=b?b(X,W,U):t,Z===t&&(Z=Pt(X)?X:ss(u[x+1])?[]:{})}Ir(U,W,Z),U=U[W]}return a}var Gx=Gl?function(a,u){return Gl.set(a,u),a}:Ur,uM=Vl?function(a,u){return Vl(a,"toString",{configurable:!0,enumerable:!1,value:PS(u),writable:!0})}:Ur;function cM(a){return Dh(su(a))}function Rn(a,u,m){var b=-1,x=a.length;u<0&&(u=-u>x?0:x+u),m=m>x?x:m,m<0&&(m+=x),x=u>m?0:m-u>>>0,u>>>=0;for(var P=z(x);++b<x;)P[b]=a[b+u];return P}function fM(a,u){var m;return Ei(a,function(b,x,P){return m=u(b,x,P),!m}),!!m}function Oh(a,u,m){var b=0,x=a==null?b:a.length;if(typeof u=="number"&&u===u&&x<=mt){for(;b<x;){var P=b+x>>>1,M=a[P];M!==null&&!on(M)&&(m?M<=u:M<u)?b=P+1:x=P}return x}return iS(a,u,Ur,m)}function iS(a,u,m,b){var x=0,P=a==null?0:a.length;if(P===0)return 0;u=m(u);for(var M=u!==u,U=u===null,W=on(u),Z=u===t;x<P;){var X=sa((x+P)/2),te=m(a[X]),oe=te!==t,he=te===null,_e=te===te,Te=on(te);if(M)var Se=b||_e;else Z?Se=_e&&(b||oe):U?Se=_e&&oe&&(b||!he):W?Se=_e&&oe&&!he&&(b||!Te):he||Te?Se=!1:Se=b?te<=u:te<u;Se?x=X+1:P=X}return Gt(P,ze)}function Yx(a,u){for(var m=-1,b=a.length,x=0,P=[];++m<b;){var M=a[m],U=u?u(M):M;if(!m||!Kn(U,W)){var W=U;P[x++]=M===0?0:M}}return P}function Kx(a){return typeof a=="number"?a:on(a)?le:+a}function sn(a){if(typeof a=="string")return a;if(Ie(a))return yt(a,sn)+"";if(on(a))return hh?hh.call(a):"";var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function Gs(a,u,m){var b=-1,x=Pl,P=a.length,M=!0,U=[],W=U;if(m)M=!1,x=Ds;else if(P>=r){var Z=u?null:_M(a);if(Z)return Ml(Z);M=!1,x=ut,W=new ts}else W=u?[]:U;e:for(;++b<P;){var X=a[b],te=u?u(X):X;if(X=m||X!==0?X:0,M&&te===te){for(var oe=W.length;oe--;)if(W[oe]===te)continue e;u&&W.push(te),U.push(X)}else x(W,te,m)||(W!==U&&W.push(te),U.push(X))}return U}function sS(a,u){u=Ys(u,a);var m=-1,b=u.length;if(!b)return!0;for(;++m<b;){var x=Yn(u[m]);if(x==="__proto__"&&!at.call(a,"__proto__")||(x==="constructor"||x==="prototype")&&m<b-1)return!1}var P=CE(a,u);return P==null||delete P[Yn(Cn(u))]}function Qx(a,u,m,b){return df(a,u,m(rs(a,u)),b)}function kh(a,u,m,b){for(var x=a.length,P=b?x:-1;(b?P--:++P<x)&&u(a[P],P,a););return m?Rn(a,b?0:P,b?P+1:x):Rn(a,b?P+1:0,b?x:P)}function Zx(a,u){var m=a;return m instanceof Le&&(m=m.value()),Yc(u,function(b,x){return x.func.apply(x.thisArg,Si([b],x.args))},m)}function oS(a,u,m){var b=a.length;if(b<2)return b?Gs(a[0]):[];for(var x=-1,P=z(b);++x<b;)for(var M=a[x],U=-1;++U<b;)U!=x&&(P[x]=ca(P[x]||M,a[U],u,m));return Gs(Yt(P,1),u,m)}function Xx(a,u,m){for(var b=-1,x=a.length,P=u.length,M={};++b<x;){var U=b<P?u[b]:t;m(M,a[b],U)}return M}function aS(a){return Dt(a)?a:[]}function lS(a){return typeof a=="function"?a:Ur}function Ys(a,u){return Ie(a)?a:yS(a,u)?[a]:qE(ft(a))}var dM=Me;function Ks(a,u,m){var b=a.length;return m=m===t?b:m,!u&&m>=b?a:Rn(a,u,m)}var eE=Sb||function(a){return Ut.clearTimeout(a)};function tE(a,u){if(u)return a.slice();var m=a.length,b=lh?lh(m):new a.constructor(m);return a.copy(b),b}function uS(a){var u=new a.constructor(a.byteLength);return new Ul(u).set(new Ul(a)),u}function pM(a,u){var m=u?uS(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.byteLength)}function hM(a){var u=new a.constructor(a.source,Np.exec(a));return u.lastIndex=a.lastIndex,u}function mM(a){return ua?Je(ua.call(a)):{}}function rE(a,u){var m=u?uS(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.length)}function nE(a,u){if(a!==u){var m=a!==t,b=a===null,x=a===a,P=on(a),M=u!==t,U=u===null,W=u===u,Z=on(u);if(!U&&!Z&&!P&&a>u||P&&M&&W&&!U&&!Z||b&&M&&W||!m&&W||!x)return 1;if(!b&&!P&&!Z&&a<u||Z&&m&&x&&!b&&!P||U&&m&&x||!M&&x||!W)return-1}return 0}function gM(a,u,m){for(var b=-1,x=a.criteria,P=u.criteria,M=x.length,U=m.length;++b<M;){var W=nE(x[b],P[b]);if(W){if(b>=U)return W;var Z=m[b];return W*(Z=="desc"?-1:1)}}return a.index-u.index}function iE(a,u,m,b){for(var x=-1,P=a.length,M=m.length,U=-1,W=u.length,Z=Ct(P-M,0),X=z(W+Z),te=!b;++U<W;)X[U]=u[U];for(;++x<M;)(te||x<P)&&(X[m[x]]=a[x]);for(;Z--;)X[U++]=a[x++];return X}function sE(a,u,m,b){for(var x=-1,P=a.length,M=-1,U=m.length,W=-1,Z=u.length,X=Ct(P-U,0),te=z(X+Z),oe=!b;++x<X;)te[x]=a[x];for(var he=x;++W<Z;)te[he+W]=u[W];for(;++M<U;)(oe||x<P)&&(te[he+m[M]]=a[x++]);return te}function Dr(a,u){var m=-1,b=a.length;for(u||(u=z(b));++m<b;)u[m]=a[m];return u}function Ii(a,u,m,b){var x=!m;m||(m={});for(var P=-1,M=u.length;++P<M;){var U=u[P],W=b?b(m[U],a[U],U,m,a):t;W===t&&(W=a[U]),x?rn(m,U,W):Ir(m,U,W)}return m}function yM(a,u){return Ii(a,gS(a),u)}function vM(a,u){return Ii(a,vE(a),u)}function Ph(a,u){return function(m,b){var x=Ie(m)?Bn:_h,P=u?u():{};return x(m,a,we(b,2),P)}}function tu(a){return Me(function(u,m){var b=-1,x=m.length,P=x>1?m[x-1]:t,M=x>2?m[2]:t;for(P=a.length>3&&typeof P=="function"?(x--,P):t,M&&qr(m[0],m[1],M)&&(P=x<3?t:P,x=1),u=Je(u);++b<x;){var U=m[b];U&&a(u,U,b,P)}return u})}function oE(a,u){return function(m,b){if(m==null)return m;if(!Lr(m))return a(m,b);for(var x=m.length,P=u?x:-1,M=Je(m);(u?P--:++P<x)&&b(M[P],P,M)!==!1;);return m}}function aE(a){return function(u,m,b){for(var x=-1,P=Je(u),M=b(u),U=M.length;U--;){var W=M[a?U:++x];if(m(P[W],W,P)===!1)break}return u}}function bM(a,u,m){var b=u&w,x=pf(a);function P(){var M=this&&this!==Ut&&this instanceof P?x:a;return M.apply(b?m:this,arguments)}return P}function lE(a){return function(u){u=ft(u);var m=Ls(u)?xr(u):t,b=m?m[0]:u.charAt(0),x=m?Ks(m,1).join(""):u.slice(1);return b[a]()+x}}function ru(a){return function(u){return Yc(aI(oI(u).replace(jv,"")),a,"")}}function pf(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var m=Vs(a.prototype),b=a.apply(m,u);return Pt(b)?b:m}}function SM(a,u,m){var b=pf(a);function x(){for(var P=arguments.length,M=z(P),U=P,W=nu(x);U--;)M[U]=arguments[U];var Z=P<3&&M[0]!==W&&M[P-1]!==W?[]:bn(M,W);if(P-=Z.length,P<m)return pE(a,u,Th,x.placeholder,t,M,Z,t,t,m-P);var X=this&&this!==Ut&&this instanceof x?b:a;return _r(X,this,M)}return x}function uE(a){return function(u,m,b){var x=Je(u);if(!Lr(u)){var P=we(m,3);u=tr(u),m=function(U){return P(x[U],U,x)}}var M=a(u,m,b);return M>-1?x[P?u[M]:M]:t}}function cE(a){return is(function(u){var m=u.length,b=m,x=cr.prototype.thru;for(a&&u.reverse();b--;){var P=u[b];if(typeof P!="function")throw new Er(i);if(x&&!M&&Mh(P)=="wrapper")var M=new cr([],!0)}for(b=M?b:m;++b<m;){P=u[b];var U=Mh(P),W=U=="wrapper"?hS(P):t;W&&vS(W[0])&&W[1]==(G|T|$|O)&&!W[4].length&&W[9]==1?M=M[Mh(W[0])].apply(M,W[3]):M=P.length==1&&vS(P)?M[U]():M.thru(P)}return function(){var Z=arguments,X=Z[0];if(M&&Z.length==1&&Ie(X))return M.plant(X).value();for(var te=0,oe=m?u[te].apply(this,Z):X;++te<m;)oe=u[te].call(this,oe);return oe}})}function Th(a,u,m,b,x,P,M,U,W,Z){var X=u&G,te=u&w,oe=u&E,he=u&(T|N),_e=u&C,Te=oe?t:pf(a);function Se(){for(var Ve=arguments.length,Ge=z(Ve),an=Ve;an--;)Ge[an]=arguments[an];if(he)var Or=nu(Se),ln=ih(Ge,Or);if(b&&(Ge=iE(Ge,b,x,he)),P&&(Ge=sE(Ge,P,M,he)),Ve-=ln,he&&Ve<Z){var Lt=bn(Ge,Or);return pE(a,u,Th,Se.placeholder,m,Ge,Lt,U,W,Z-Ve)}var Qn=te?m:this,ls=oe?Qn[a]:a;return Ve=Ge.length,U?Ge=jM(Ge,U):_e&&Ve>1&&Ge.reverse(),X&&W<Ve&&(Ge.length=W),this&&this!==Ut&&this instanceof Se&&(ls=Te||pf(ls)),ls.apply(Qn,Ge)}return Se}function fE(a,u){return function(m,b){return Ws(m,a,u(b),{})}}function Ah(a,u){return function(m,b){var x;if(m===t&&b===t)return u;if(m!==t&&(x=m),b!==t){if(x===t)return b;typeof m=="string"||typeof b=="string"?(m=sn(m),b=sn(b)):(m=Kx(m),b=Kx(b)),x=a(m,b)}return x}}function cS(a){return is(function(u){return u=yt(u,Cr(we())),Me(function(m){var b=this;return a(u,function(x){return _r(x,b,m)})})})}function $h(a,u){u=u===t?" ":sn(u);var m=u.length;if(m<2)return m?nS(u,a):u;var b=nS(u,ia(a/wi(u)));return Ls(u)?Ks(xr(b),0,a).join(""):b.slice(0,a)}function wM(a,u,m,b){var x=u&w,P=pf(a);function M(){for(var U=-1,W=arguments.length,Z=-1,X=b.length,te=z(X+W),oe=this&&this!==Ut&&this instanceof M?P:a;++Z<X;)te[Z]=b[Z];for(;W--;)te[Z++]=arguments[++U];return _r(oe,x?m:this,te)}return M}function dE(a){return function(u,m,b){return b&&typeof b!="number"&&qr(u,m,b)&&(m=b=t),u=as(u),m===t?(m=u,u=0):m=as(m),b=b===t?u<m?1:-1:as(b),oM(u,m,b,a)}}function Nh(a){return function(u,m){return typeof u=="string"&&typeof m=="string"||(u=xn(u),m=xn(m)),a(u,m)}}function pE(a,u,m,b,x,P,M,U,W,Z){var X=u&T,te=X?M:t,oe=X?t:M,he=X?P:t,_e=X?t:P;u|=X?$:j,u&=~(X?j:$),u&k||(u&=~(w|E));var Te=[a,u,x,he,te,_e,oe,U,W,Z],Se=m.apply(t,Te);return vS(a)&&xE(Se,Te),Se.placeholder=b,EE(Se,a,u)}function fS(a){var u=ct[a];return function(m,b){if(m=xn(m),b=b==null?0:Gt(Oe(b),292),b&&es(m)){var x=(ft(m)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+b));return x=(ft(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-b))}return u(m)}}var _M=Hs&&1/Ml(new Hs([,-0]))[1]==pe?function(a){return new Hs(a)}:$S;function hE(a){return function(u){var m=dr(u);return m==Zt?js(u):m==wr?sh(u):rb(u,a(u))}}function ns(a,u,m,b,x,P,M,U){var W=u&E;if(!W&&typeof a!="function")throw new Er(i);var Z=b?b.length:0;if(Z||(u&=~($|j),b=x=t),M=M===t?M:Ct(Oe(M),0),U=U===t?U:Oe(U),Z-=x?x.length:0,u&j){var X=b,te=x;b=x=t}var oe=W?t:hS(a),he=[a,u,m,b,x,X,te,P,M,U];if(oe&&FM(he,oe),a=he[0],u=he[1],m=he[2],b=he[3],x=he[4],U=he[9]=he[9]===t?W?0:a.length:Ct(he[9]-Z,0),!U&&u&(T|N)&&(u&=~(T|N)),!u||u==w)var _e=bM(a,u,m);else u==T||u==N?_e=SM(a,u,U):(u==$||u==(w|$))&&!x.length?_e=wM(a,u,m,b):_e=Th.apply(t,he);var Te=oe?Gx:xE;return EE(Te(_e,he),a,u)}function mE(a,u,m,b){return a===t||Kn(a,Us[m])&&!at.call(b,m)?u:a}function gE(a,u,m,b,x,P){return Pt(a)&&Pt(u)&&(P.set(u,a),Ht(a,u,t,gE,P),P.delete(u)),a}function RM(a){return gf(a)?t:a}function yE(a,u,m,b,x,P){var M=m&v,U=a.length,W=u.length;if(U!=W&&!(M&&W>U))return!1;var Z=P.get(a),X=P.get(u);if(Z&&X)return Z==u&&X==a;var te=-1,oe=!0,he=m&_?new ts:t;for(P.set(a,u),P.set(u,a);++te<U;){var _e=a[te],Te=u[te];if(b)var Se=M?b(Te,_e,te,u,a,P):b(_e,Te,te,a,u,P);if(Se!==t){if(Se)continue;oe=!1;break}if(he){if(!Tl(u,function(Ve,Ge){if(!ut(he,Ge)&&(_e===Ve||x(_e,Ve,m,b,P)))return he.push(Ge)})){oe=!1;break}}else if(!(_e===Te||x(_e,Te,m,b,P))){oe=!1;break}}return P.delete(a),P.delete(u),oe}function CM(a,u,m,b,x,P,M){switch(m){case Ln:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case Ji:return!(a.byteLength!=u.byteLength||!P(new Ul(a),new Ul(u)));case en:case $r:case jo:return Kn(+a,+u);case Rt:return a.name==u.name&&a.message==u.message;case Xt:case Uo:return a==u+"";case Zt:var U=js;case wr:var W=b&v;if(U||(U=Ml),a.size!=u.size&&!W)return!1;var Z=M.get(a);if(Z)return Z==u;b|=_,M.set(a,u);var X=yE(U(a),U(u),b,x,P,M);return M.delete(a),X;case yl:if(ua)return ua.call(a)==ua.call(u)}return!1}function xM(a,u,m,b,x,P){var M=m&v,U=dS(a),W=U.length,Z=dS(u),X=Z.length;if(W!=X&&!M)return!1;for(var te=W;te--;){var oe=U[te];if(!(M?oe in u:at.call(u,oe)))return!1}var he=P.get(a),_e=P.get(u);if(he&&_e)return he==u&&_e==a;var Te=!0;P.set(a,u),P.set(u,a);for(var Se=M;++te<W;){oe=U[te];var Ve=a[oe],Ge=u[oe];if(b)var an=M?b(Ge,Ve,oe,u,a,P):b(Ve,Ge,oe,a,u,P);if(!(an===t?Ve===Ge||x(Ve,Ge,m,b,P):an)){Te=!1;break}Se||(Se=oe=="constructor")}if(Te&&!Se){var Or=a.constructor,ln=u.constructor;Or!=ln&&"constructor"in a&&"constructor"in u&&!(typeof Or=="function"&&Or instanceof Or&&typeof ln=="function"&&ln instanceof ln)&&(Te=!1)}return P.delete(a),P.delete(u),Te}function is(a){return SS(RE(a,t,TE),a+"")}function dS(a){return Ih(a,tr,gS)}function pS(a){return Ih(a,jr,vE)}var hS=Gl?function(a){return Gl.get(a)}:$S;function Mh(a){for(var u=a.name+"",m=Bs[u],b=at.call(Bs,u)?m.length:0;b--;){var x=m[b],P=x.func;if(P==null||P==a)return x.name}return u}function nu(a){var u=at.call(q,"placeholder")?q:a;return u.placeholder}function we(){var a=q.iteratee||TS;return a=a===TS?R:a,arguments.length?a(arguments[0],arguments[1]):a}function Fh(a,u){var m=a.__data__;return AM(u)?m[typeof u=="string"?"string":"hash"]:m.map}function mS(a){for(var u=tr(a),m=u.length;m--;){var b=u[m],x=a[b];u[m]=[b,x,wE(x)]}return u}function pa(a,u){var m=Zo(a,u);return Be(m)?m:t}function EM(a){var u=at.call(a,Xi),m=a[Xi];try{a[Xi]=t;var b=!0}catch{}var x=Ll.call(a);return b&&(u?a[Xi]=m:delete a[Xi]),x}var gS=Wl?function(a){return a==null?[]:(a=Je(a),bi(Wl(a),function(u){return ra.call(a,u)}))}:NS,vE=Wl?function(a){for(var u=[];a;)Si(u,gS(a)),a=Hl(a);return u}:NS,dr=nr;(tf&&dr(new tf(new ArrayBuffer(1)))!=Ln||oa&&dr(new oa)!=Zt||rf&&dr(rf.resolve())!=Pp||Hs&&dr(new Hs)!=wr||aa&&dr(new aa)!=Jt)&&(dr=function(a){var u=nr(a),m=u==Dn?a.constructor:t,b=m?ha(m):"";if(b)switch(b){case xb:return Ln;case Eb:return Zt;case Ib:return Pp;case qb:return wr;case Ob:return Jt}return u});function IM(a,u,m){for(var b=-1,x=m.length;++b<x;){var P=m[b],M=P.size;switch(P.type){case"drop":a+=M;break;case"dropRight":u-=M;break;case"take":u=Gt(u,a+M);break;case"takeRight":a=Ct(a,u-M);break}}return{start:a,end:u}}function qM(a){var u=a.match(jn);return u?u[1].split(yn):[]}function bE(a,u,m){u=Ys(u,a);for(var b=-1,x=u.length,P=!1;++b<x;){var M=Yn(u[b]);if(!(P=a!=null&&m(a,M)))break;a=a[M]}return P||++b!=x?P:(x=a==null?0:a.length,!!x&&Vh(x)&&ss(M,x)&&(Ie(a)||ma(a)))}function OM(a){var u=a.length,m=new a.constructor(u);return u&&typeof a[0]=="string"&&at.call(a,"index")&&(m.index=a.index,m.input=a.input),m}function SE(a){return typeof a.constructor=="function"&&!hf(a)?Vs(Hl(a)):{}}function kM(a,u,m){var b=a.constructor;switch(u){case Ji:return uS(a);case en:case $r:return new b(+a);case Ln:return pM(a,m);case ht:case vl:case bl:case Ps:case Ho:case Ts:case vi:case As:case $c:return rE(a,m);case Zt:return new b;case jo:case Uo:return new b(a);case Xt:return hM(a);case wr:return new b;case yl:return mM(a)}}function PM(a,u){var m=u.length;if(!m)return a;var b=m-1;return u[b]=(m>1?"& ":"")+u[b],u=u.join(m>2?", ":" "),a.replace(er,`{
|
|
1
|
+
"use strict";var Xj=Object.create;var zh=Object.defineProperty;var e2=Object.getOwnPropertyDescriptor;var t2=Object.getOwnPropertyNames;var r2=Object.getPrototypeOf,n2=Object.prototype.hasOwnProperty;var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var H=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},us=(t,e)=>{for(var r in e)zh(t,r,{get:e[r],enumerable:!0})},fI=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of t2(e))!n2.call(t,i)&&i!==r&&zh(t,i,{get:()=>e[i],enumerable:!(n=e2(e,i))||n.enumerable});return t};var me=(t,e,r)=>(r=t!=null?Xj(r2(t)):{},fI(e||!t||!t.__esModule?zh(r,"default",{value:t,enumerable:!0}):r,t)),ga=t=>fI(zh({},"__esModule",{value:!0}),t);function Tt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function vt(t){let e=Date.now().toString(36)+(i2++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${Tt(t)}_${e}`:e}function Jh(){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 ou(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let o=i.toLowerCase();n[o]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let o=i.toLowerCase(),l=n[o];l&&delete r[l],n[o]=i,r[i]=s}return r}function dI(t){return JSON.parse(JSON.stringify(t))}function pI(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function hI(t,e){try{return JSON.parse(t)}catch{return e}}function mI(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 gI(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var i2,En=se(()=>{"use strict";i2=0});function vf(t){if(!lt.existsSync(t))return;let e={},r=un.join(t,yf.preRequest);lt.existsSync(r)&&(e.preRequest=lt.readFileSync(r,"utf-8"));let n=un.join(t,yf.postResponse);return lt.existsSync(n)&&(e.postResponse=lt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function bf(t,e){await lt.promises.mkdir(t,{recursive:!0});let r=un.join(t,yf.preRequest);e.preRequest?await lt.promises.writeFile(r,e.preRequest,"utf-8"):lt.existsSync(r)&&await lt.promises.unlink(r);let n=un.join(t,yf.postResponse);e.postResponse?await lt.promises.writeFile(n,e.postResponse,"utf-8"):lt.existsSync(n)&&await lt.promises.unlink(n)}function DS(t){for(let[e,r]of Object.entries(FS)){let n=un.join(t,e);if(lt.existsSync(n))try{let i=lt.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 LS(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 jS(t,e){for(let r of Object.keys(FS))if(r!==e){let n=un.join(t,r);if(lt.existsSync(n))try{await lt.promises.unlink(n)}catch{}}}function US(t){if(lt.existsSync(t))try{let e=lt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function HS(t,e,r){let n=un.join(t,au.responseSchema),i=un.join(t,au.bodySchema);e?await lt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):lt.existsSync(n)&&await lt.promises.unlink(n),r?await lt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):lt.existsSync(i)&&await lt.promises.unlink(i)}function Gh(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Gh(r.items,e);if(n)return n}}}function Yh(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&&Yh(n.items,e))return!0}return!1}function BS(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 Kh(t,e){let r;try{r=lt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===Hr)continue;if(n.name===e)return un.join(t,n.name);let i=Kh(un.join(t,n.name),e);if(i)return i}}function s2(t){for(let e of[pr.request,pr.folder]){let r=un.join(t,e);if(lt.existsSync(r))try{let n=lt.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function Qh(t,e){let r;try{r=lt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===Hr)continue;let i=un.join(t,n.name);if(s2(i)===e)return i;let s=Qh(i,e);if(s)return s}}function cn(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)||[],o=0;for(let g of s){let v=parseInt(g.substring(1));v>o&&(o=v)}let l="";if(o>0)l=`t${o}`;else{let g=r.match(/[_\s-](\d+\.\d+)[_\s-]/);g&&(l=`v${g[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 c=f.split("-").filter(g=>g.length>0),p=[];i&&p.push(i),p.push(...c),l&&p.push(l);let h=p.join("-");if(h||(h="item"),e.includes(h)){let g=2;for(;e.includes(`${h}-${g}`);)g++;h=`${h}-${g}`}return h}var lt,un,yf,pr,FS,au,Hr,va=se(()=>{"use strict";lt=me(require("fs")),un=me(require("path")),yf={preRequest:"pre-request.js",postResponse:"post-response.js"},pr={collection:"collection.json",folder:"folder.json",request:"request.json"},FS={"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"}},au={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},Hr="scripts"});var Oe,Ae,cs,Zh=se(()=>{"use strict";Oe=me(require("fs")),Ae=me(require("path"));En();va();cs=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(){Oe.existsSync(this.collectionsDir)||Oe.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=Oe.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Oe.existsSync(this.collectionsDir))return[];let e=Oe.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=Ae.join(this.collectionsDir,e),n=Ae.join(r,pr.collection);if(!Oe.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Ae.join(r,Hr)),o=this.loadItemsFromDir(r,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,o=Oe.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===Hr)continue;let f=Ae.join(e,l.name);if(Oe.existsSync(Ae.join(f,pr.folder))){let c=this.loadFolderFromDir(f,l.name);c&&s.set(l.name,c)}else if(Oe.existsSync(Ae.join(f,pr.request))){let c=this.loadRequestFromDir(f,l.name);c&&s.set(l.name,c)}}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=Ae.join(e,pr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Ae.join(e,Hr)),o=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=Ae.join(e,pr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Ae.join(e,Hr)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let f=this.loadSchemaFile(Ae.join(e,au.responseSchema)),c=this.loadSchemaFile(Ae.join(e,au.bodySchema)),p=Ae.join(e,"doc.md"),h=Oe.existsSync(p)?Oe.readFileSync(p,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:o,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...h&&{doc:h},...f&&{responseSchema:f},...c&&{bodySchema:c}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return vf(e)}loadBodyFromDir(e){return DS(e)}loadSchemaFile(e){return US(e)}async saveSchemaFiles(e,r){return HS(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=vt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=Oe.readdirSync(this.collectionsDir);r=cn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Ae.join(this.collectionsDir,r),i=!Oe.existsSync(n);await Oe.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[o]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Ae.join(n,Hr),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await Oe.promises.writeFile(Ae.join(n,pr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let o of r){let l=this.idToSlugMap.get(o.id);l||(l=cn(o.name,i),this.idToSlugMap.set(o.id,l),this.slugToIdMap.set(l,o.id)),i.push(l),s.push({item:o,slug:l})}return await Promise.all(s.map(async({item:o,slug:l})=>{let f=Ae.join(e,l);await Oe.promises.mkdir(f,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(f,o,n):await this.saveRequestToDir(f,o,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(Ae.join(e,Hr),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Oe.promises.writeFile(Ae.join(e,pr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),o={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated},...r.operationId&&{operationId:r.operationId},...r.summary&&{summary:r.summary},...r.tags&&r.tags.length>0&&{tags:r.tags},...r.examples&&r.examples.length>0&&{examples:r.examples},...r.responses&&Object.keys(r.responses).length>0&&{responses:r.responses},...r.security&&r.security.length>0&&{security:r.security}},l=[Oe.promises.writeFile(Ae.join(e,pr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(Oe.promises.writeFile(Ae.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(Oe.promises.writeFile(Ae.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Ae.join(e,Hr),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return LS(e)}async cleanupOldBodyFiles(e,r){return jS(e,r)}async saveScriptsToDir(e,r){return bf(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=Ae.join(this.collectionsDir,r);if(!Oe.existsSync(n))return!1;try{return await Oe.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?Oe.existsSync(Ae.join(this.collectionsDir,r,pr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Ae.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||vt(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(Ae.join(s,Hr),n);let o=this.findItemById(i.items,r);o&&(o.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Ae.join(n,Hr))}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=Ae.join(this.collectionsDir,i),o=Ae.join(s,pr.collection),l=Oe.readFileSync(o,"utf-8"),c={...JSON.parse(l),...r,id:e};await Oe.promises.writeFile(o,JSON.stringify(c,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 o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=Ae.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=Oe.readdirSync(o).filter(h=>Oe.statSync(Ae.join(o,h)).isDirectory()&&h!==Hr);l=cn(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Ae.join(o,l);await Oe.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let c=this.findItemById(i.items,r.id);if(c)Object.assign(c,r);else if(n){let p=this.findItemById(i.items,n);p&&p.type==="folder"&&(p.items=p.items||[],p.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||!Oe.existsSync(i))return!1;try{await Oe.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 o=this.findItemById(i.items,r);if(!o)return!1;let{id:l,type:f,items:c,...p}=n;return Object.assign(o,p),o.type==="folder"?await this.saveFolderToDir(s,o):await this.saveRequestToDir(s,o),!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 o=this.findItemPath(e,r);if(!o||!Oe.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=Ae.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let c=Ae.join(l,f);if(Oe.existsSync(c))return!1;try{await Oe.promises.rename(o,c);let p=this.findItemById(i.items,r);if(p){let h=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(h))}else i.items.push(h)}return!0}catch(p){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,p),!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 o=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&o.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Ae.join(l,pr.folder),c=Oe.readFileSync(f,"utf-8"),p=JSON.parse(c);p.order=o,await Oe.promises.writeFile(f,JSON.stringify(p,null,2),"utf-8");let h=this.findItemById(i.items,r);h&&h.type==="folder"&&h.items&&(h.items=this.sortItemsByOrder(h.items,n))}else{let l=Ae.join(this.collectionsDir,s,pr.collection),f=Oe.readFileSync(l,"utf-8"),c=JSON.parse(f);c.order=o,await Oe.promises.writeFile(l,JSON.stringify(c,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 BS(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Ae.join(this.collectionsDir,n),s=Qh(i,r);if(s)return s;let o=this.load(e);if(o){let f=this.buildSlugPath(o.items,r);if(f)return Ae.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Kh(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return Gh(e,r)}deleteItemFromTree(e,r){return Yh(e,r)}}});var dt,ba=se(()=>{"use strict";dt=class{static parseSetCookie(e,r){let n=e.split(";").map(p=>p.trim());if(n.length===0)return null;let[i,...s]=n,o=i.indexOf("=");if(o===-1)return null;let l=i.substring(0,o).trim(),f=i.substring(o+1).trim(),c={name:l,value:f,domain:r};for(let p of s){let h=p.indexOf("="),g=(h===-1?p:p.substring(0,h)).toLowerCase(),v=h===-1?"":p.substring(h+1);switch(g){case"domain":c.domain=v.startsWith(".")?v.substring(1):v;break;case"path":c.path=v;break;case"expires":c.expires=v;break;case"max-age":c.maxAge=parseInt(v,10);break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break;case"samesite":c.sameSite=v;break}}return c}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 o of s){let l=this.parseSetCookie(o,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"/"}}}});function Sf(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function fu(t){if(!Zs.existsSync(t))return a2();let e=Xh(Sa.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=Zs.readdirSync(t).filter(c=>c.endsWith(".json")).filter(c=>!c.endsWith(".local.json")).filter(c=>!Sf(c)),s={};for(let c of i){let p=Xh(Sa.join(t,c))||{},h=Sa.basename(c,".json");s[h]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(Xh(Sa.join(t,"_global.local.json"))||{}).variables||{},f={};for(let c of Object.keys(s)){let p=Sa.join(t,`${c}.local.json`);if(Zs.existsSync(p)){let h=Xh(p)||{};f[c]={variables:h.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function a2(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Xh(t){try{if(!Zs.existsSync(t))return null;let e=Zs.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 Zs,Sa,em=se(()=>{"use strict";Zs=me(require("fs")),Sa=me(require("path"))});var In,du=se(()=>{"use strict";In=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,o="",l=e.indexOf("?");l!==-1&&(o=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let c=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(c,(h,g,v)=>{let _=r[g];return _!==void 0&&_!==""?encodeURIComponent(_):v?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${g}`),h)});return p=p.replace(/([^:])\/+/g,"$1/"),p.length>1&&p.endsWith("/")&&(p=p.slice(0,-1)),`${n}${i}${p}${o}`}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,c]=e.split("?");n=f,c&&new URLSearchParams(c).forEach((h,g)=>{i[g]=h})}let s={...i,...r},o=new URLSearchParams;for(let[f,c]of Object.entries(s))c!=null&&o.append(f,c);let l=o.toString();return l?`${n}?${l}`:n}}});function vI(t,e=0){return(ir[t[e+0]]+ir[t[e+1]]+ir[t[e+2]]+ir[t[e+3]]+"-"+ir[t[e+4]]+ir[t[e+5]]+"-"+ir[t[e+6]]+ir[t[e+7]]+"-"+ir[t[e+8]]+ir[t[e+9]]+"-"+ir[t[e+10]]+ir[t[e+11]]+ir[t[e+12]]+ir[t[e+13]]+ir[t[e+14]]+ir[t[e+15]]).toLowerCase()}var ir,bI=se(()=>{ir=[];for(let t=0;t<256;++t)ir.push((t+256).toString(16).slice(1))});function zS(){return crypto.getRandomValues(l2)}var l2,SI=se(()=>{l2=new Uint8Array(16)});function u2(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():c2(t,e,r)}function c2(t,e,r){t=t||{};let n=t.random??t.rng?.()??zS();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 vI(n)}var pu,wI=se(()=>{SI();bI();pu=u2});var JS=se(()=>{wI()});function f2(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function d2(){return Date.now()}function _I(){return pu()}function p2(){return pu()}function RI(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 h2(){let t=RI(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function m2(){return Math.random()<.5}function g2(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 y2(){return Math.floor(Date.now()/1e3)}function v2(){return new Date().toISOString()}function b2(){return new Date().toISOString().split("T")[0]}function S2(){return new Date().toISOString().split("T")[1].split(".")[0]}function w2(){return new Date().toISOString()}function _2(t=""){return Buffer.from(String(t)).toString("base64")}function R2(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function C2(t=""){return encodeURIComponent(String(t))}function x2(t=""){return decodeURIComponent(String(t))}function E2(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 qi(t,e){let r=GS[t];return r?e&&e.length>0?r(...e):r():null}function CI(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?E2(n):void 0,s=qi(r,i);return s===null?e:String(s)}catch{return e}})}function Xs(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],o=i[1];if(!(s in e)){let l=qi(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var GS,tm=se(()=>{"use strict";JS();GS={randomInt:f2,timestamp:d2,guid:p2,uuid:_I,randomUUID:_I,randomString:RI,randomHexadecimal:g2,randomEmail:h2,randomBoolean:m2,isoTimestamp:w2,timestamp_s:y2,datetime:v2,date:b2,time:S2,base64Encode:_2,base64Decode:R2,urlEncode:C2,urlDecode:x2}});function eo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function to(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=rm.createContext(r);return rm.runInContext(t,n,{timeout:I2,displayErrors:!1})}catch{return}}var rm,I2,nm=se(()=>{"use strict";rm=me(require("vm")),I2=100});function O2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function hu(t){if(!t||!t.includes("|"))return null;let e=q2(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 o=k2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function q2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],f=o>0?t[o-1]:"",c=o<t.length-1?t[o+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(c==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function k2(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:P2(n)}}function P2(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if((s>0?t[s-1]:"")==="\\"){r+=o;continue}if(o==="'"&&!i){n=!n,r+=o;continue}else if(o==='"'&&!n){i=!i,r+=o;continue}else if(o===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=o}return r.trim()&&e.push(r.trim()),e}function $t(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=O2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function mu(t,e,r={}){let n=t;for(let i of e)n=T2(n,i.name,i.args,r);return n}function T2(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=$t(r[0],n),s=r[1]!==void 0?$t(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($t(r[0],n)):"",s=r[1]!==void 0?String($t(r[1],n)):"";return String(t).replace(new RegExp($2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String($t(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String($t(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($t(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=$t(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=$t(r[0],n);return Number(t)+i}case"subtract":{let i=$t(r[0],n);return Number(t)-i}case"multiply":{let i=$t(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?$t(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?$t(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return im.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String($t(r[0],n)):"",s=String(r[1]!==void 0?$t(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?$t(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return im.createHmac(f,i).update(String(t)).digest(o)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=$t(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=$t(r[0],n),s=r[1]!==void 0?$t(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:A2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String($t(s,n)));return i.length===1?t.map(s=>wf(s,i[0])):t.map(s=>{let o={};for(let l of i){let f=wf(s,l);f!==void 0&&(o[l]=f)}return o})}case"prop":{let i=r[0]!==void 0?String($t(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>wf(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?wf(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 A2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=$t(o,r);return t.filter(f=>{let c=wf(f,i);if(c===void 0)return!1;switch(s){case">":return Number(c)>Number(l);case">=":return Number(c)>=Number(l);case"<":return Number(c)<Number(l);case"<=":return Number(c)<=Number(l);case"=":return String(c)===String(l);case"!=":return String(c)!==String(l);case"*=":return String(c).includes(String(l));case"^=":return String(c).startsWith(String(l));case"$=":return String(c).endsWith(String(l));default:return!0}})}function wf(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function $2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var im,sm=se(()=>{"use strict";im=me(require("crypto"))});function xI(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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function EI(t){return new ro(t)}var ro,no,_f=se(()=>{"use strict";tm();nm();sm();ro=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let o=this.resolveSinglePass(i,r,n);if(o===i)break;i=o}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,c)=>this.resolveTemplateContent(c.trim(),r,f));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let f=l[1].trim(),c=this.resolveTemplateContent(f,r,l[0]);if(c!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(c),p):String(c)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,o]of Object.entries(e))i[s]=this.resolveObjectWithExtra(o,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=xI(i[2],r),f=qi(i[1],l);return f!==null?String(f):n}let s=hu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=mu(l,s.filters,r);return f!==void 0?String(f):n}return n}let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(o){let l=o[1];if(r[l]!==void 0){let f=this.deserializeValue(r[l]),c=o[2],p=this.resolvePropertyAccess(f,c);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(eo(e)){let l=this.deserializeVariables(r),f=Xs(e,l),c=to(e,f);if(c!==void 0)return String(c)}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=xI(n[2],r),o=qi(n[1],s);return o!==null?o: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 o=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(o,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(eo(e)){let s=this.deserializeVariables(r),o=Xs(e,s),l=to(e,o);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 o=s[1];/^\d+$/.test(o)?n=n[Number(o)]:n=n[o.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}},no=class{interpolate(e,r){return!e||typeof e!="string"?e:new ro({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});var N2,Rf,YS,om,On,io,Cf=se(()=>{"use strict";N2=me(require("http")),Rf=me(require("https")),YS=require("url"),om=me(require("zlib")),On={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},io=class{settings;version;constructor(e){this.settings={...On,...e};try{this.version=require("../../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(),o=new YS.URL(e.url),l=o.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(h=>h.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let p={hostname:o.hostname,port:o.port||(l?443:80),path:o.pathname+o.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l&&(p.rejectUnauthorized=r.strictSSL,r.strictSSL?p.agent=Rf.globalAgent:p.agent=new Rf.Agent({rejectUnauthorized:!1})),new Promise((h,g)=>{if(i?.aborted){let w=new Error("Request cancelled");w.name="AbortError",g(w);return}let _=(l?Rf:N2).request(p,async w=>{let E=w.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(E)){if(n>=r.maxRedirects){g(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let T=w.headers.location;if(!T){g(new Error("Redirect response missing Location header"));return}let N=new YS.URL(T,e.url).toString(),$=e.method;!r.followOriginalMethod&&[301,302,303].includes(E)&&($="GET");let j={...e.headers};r.followAuthHeader||(delete j.authorization,delete j.Authorization);try{let G=await this.executeInternal({...e,url:N,method:$,headers:j,body:$==="GET"?void 0:e.body},r,n+1,i),q=Date.now();G.time=q-s,h(G)}catch(G){g(G)}return}let k=[];w.on("data",T=>k.push(T)),w.on("end",()=>{let T=Date.now(),N=Buffer.concat(k),$=w.headers["content-encoding"];if(r.decompress&&$)try{$==="gzip"?N=om.gunzipSync(N):$==="deflate"&&(N=om.inflateSync(N))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let j=N.toString("utf-8"),G={};for(let[C,A]of Object.entries(w.headers))(typeof A=="string"||Array.isArray(A))&&(G[C]=A);let q=this.parseCookies(w.headers["set-cookie"],o.hostname);h({status:w.statusCode||0,statusText:w.statusMessage||"",headers:G,cookies:q,body:j,time:T-s,size:N.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let w=new Error("Request cancelled");w.name="AbortError",g(w)}),_.on("error",w=>{g(w)}),_.on("timeout",()=>{_.destroy(),g(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let w=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(w)}_.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(p=>p.trim()),[s,...o]=i,[l,f]=s.split("="),c={name:l.trim(),value:f?.trim()||"",domain:r};for(let p of o){let[h,g]=p.split("=");switch(h.toLowerCase().trim()){case"domain":c.domain=g?.trim();break;case"path":c.path=g?.trim();break;case"expires":c.expires=g?.trim();break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break}}return c}):[]}}});function am(t){return{timeout:t?.timeout??On.timeout,followRedirects:t?.followRedirects??On.followRedirects,followOriginalMethod:t?.followOriginalMethod??On.followOriginalMethod,followAuthHeader:t?.followAuthHeader??On.followAuthHeader,maxRedirects:t?.maxRedirects??On.maxRedirects,strictSSL:t?.strictSSL??On.strictSSL,decompress:t?.decompress??On.decompress,includeCookies:t?.includeCookies??On.includeCookies}}var KS=se(()=>{"use strict";Cf()});var ki,xf=se(()=>{"use strict";KS();ki=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=am(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,e,n);if(o)return o;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,i,n);if(o)return o;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var Pi,lm,um,cm,Ef=se(()=>{"use strict";Pi=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(o){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,o),o}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))}},lm=class{name="logging";priority=1e3;intercept(e,r){return e}},um=class{name="timing";priority=1;intercept(e,r,n){return e}},cm=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 II=H((gu,If)=>{(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`",o="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,c="__lodash_placeholder__",p=1,h=2,g=4,v=1,_=2,w=1,E=2,k=4,T=8,N=16,$=32,j=64,G=128,q=256,C=512,A=30,D="...",B=800,F=16,K=1,ee=2,ie=3,pe=1/0,Pe=9007199254740991,de=17976931348623157e292,le=NaN,be=4294967295,ze=be-1,mt=be>>>1,ce=[["ary",G],["bind",w],["bindKey",E],["curry",T],["curryRight",N],["flip",C],["partial",$],["partialRight",j],["rearg",q]],rr="[object Arguments]",Ne="[object Array]",it="[object AsyncFunction]",en="[object Boolean]",$r="[object Date]",_t="[object DOMException]",Rt="[object Error]",mn="[object Function]",Lo="[object GeneratorFunction]",Zt="[object Map]",jo="[object Number]",wv="[object Null]",Dn="[object Object]",Pp="[object Promise]",Tp="[object Proxy]",Xt="[object RegExp]",wr="[object Set]",Uo="[object String]",yl="[object Symbol]",Ap="[object Undefined]",Jt="[object WeakMap]",$p="[object WeakSet]",Ji="[object ArrayBuffer]",Ln="[object DataView]",ht="[object Float32Array]",vl="[object Float64Array]",bl="[object Int8Array]",Ps="[object Int16Array]",Ho="[object Int32Array]",Ts="[object Uint8Array]",vi="[object Uint8ClampedArray]",As="[object Uint16Array]",$c="[object Uint32Array]",Sl=/\b__p \+= '';/g,_v=/\b(__p \+=) '' \+/g,Bo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Gi=/&(?:amp|lt|gt|quot|#39);/g,wl=/[&<>"']/g,_l=RegExp(Gi.source),fe=RegExp(wl.source),Rv=/<%-([\s\S]+?)%>/g,Cv=/<%([\s\S]+?)%>/g,gn=/<%=([\s\S]+?)%>/g,Nr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,De=/^\w*$/,Nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,st=/[\\^$.*+?()[\]{}|]/g,Vo=RegExp(st.source),Mc=/^\s+/,Rl=/\s/,er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,jn=/\{\n\/\* \[wrapped with (.+)\] \*/,yn=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mr=/[()=,{}\[\]\/\s]/,Un=/\\(\\)?/g,Yi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Np=/\w*$/,xv=/^[-+]0x[0-9a-f]+$/i,Wo=/^0b[01]+$/i,Mp=/^\[object .+?Constructor\]$/,Ev=/^0o[0-7]+$/i,$s=/^(?:0|[1-9]\d*)$/,zo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jo=/($^)/,Iv=/['\n\r\u2028\u2029\\]/g,Cl="\\ud800-\\udfff",Ov="\\u0300-\\u036f",kt="\\ufe20-\\ufe2f",Fc="\\u20d0-\\u20ff",Fp=Ov+kt+Fc,Dc="\\u2700-\\u27bf",Lc="a-z\\xdf-\\xf6\\xf8-\\xff",qv="\\xac\\xb1\\xd7\\xf7",kv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Pv="\\u2000-\\u206f",Tv=" \\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",Dp="A-Z\\xc0-\\xd6\\xd8-\\xde",Lp="\\ufe0e\\ufe0f",jc=qv+kv+Pv+Tv,xl="['\u2019]",Av="["+Cl+"]",jp="["+jc+"]",El="["+Fp+"]",Uc="\\d+",$v="["+Dc+"]",Ns="["+Lc+"]",Go="[^"+Cl+jc+Uc+Dc+Lc+Dp+"]",Il="\\ud83c[\\udffb-\\udfff]",Yo="(?:"+El+"|"+Il+")",vn="[^"+Cl+"]",Hc="(?:\\ud83c[\\udde6-\\uddff]){2}",Bc="[\\ud800-\\udbff][\\udc00-\\udfff]",Ms="["+Dp+"]",Up="\\u200d",Hp="(?:"+Ns+"|"+Go+")",Nv="(?:"+Ms+"|"+Go+")",Bp="(?:"+xl+"(?:d|ll|m|re|s|t|ve))?",Vp="(?:"+xl+"(?:D|LL|M|RE|S|T|VE))?",Ol=Yo+"?",Wp="["+Lp+"]?",zp="(?:"+Up+"(?:"+[vn,Hc,Bc].join("|")+")"+Wp+Ol+")*",Mv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Jp=Wp+Ol+zp,Dv="(?:"+[$v,Hc,Bc].join("|")+")"+Jp,Lv="(?:"+[vn+El+"?",El,Hc,Bc,Av].join("|")+")",jv=RegExp(xl,"g"),Uv=RegExp(El,"g"),Vc=RegExp(Il+"(?="+Il+")|"+Lv+Jp,"g"),Hv=RegExp([Ms+"?"+Ns+"+"+Bp+"(?="+[jp,Ms,"$"].join("|")+")",Nv+"+"+Vp+"(?="+[jp,Ms+Hp,"$"].join("|")+")",Ms+"?"+Hp+"+"+Bp,Ms+"+"+Vp,Fv,Mv,Uc,Dv].join("|"),"g"),Bv=RegExp("["+Up+Cl+Fp+Lp+"]"),Vv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wv=["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"],zv=-1,St={};St[ht]=St[vl]=St[bl]=St[Ps]=St[Ho]=St[Ts]=St[vi]=St[As]=St[$c]=!0,St[rr]=St[Ne]=St[Ji]=St[en]=St[Ln]=St[$r]=St[Rt]=St[mn]=St[Zt]=St[jo]=St[Dn]=St[Xt]=St[wr]=St[Uo]=St[Jt]=!1;var gt={};gt[rr]=gt[Ne]=gt[Ji]=gt[Ln]=gt[en]=gt[$r]=gt[ht]=gt[vl]=gt[bl]=gt[Ps]=gt[Ho]=gt[Zt]=gt[jo]=gt[Dn]=gt[Xt]=gt[wr]=gt[Uo]=gt[yl]=gt[Ts]=gt[vi]=gt[As]=gt[$c]=!0,gt[Rt]=gt[mn]=gt[Jt]=!1;var Wc={\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"},zc={"&":"&","<":"<",">":">",'"':""","'":"'"},Jv={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Yp=parseFloat,Gv=parseInt,Kp=typeof global=="object"&&global&&global.Object===Object&&global,Yv=typeof self=="object"&&self&&self.Object===Object&&self,Ut=Kp||Yv||Function("return this")(),ql=typeof gu=="object"&&gu&&!gu.nodeType&&gu,ot=ql&&typeof If=="object"&&If&&!If.nodeType&&If,Fs=ot&&ot.exports===ql,Ki=Fs&&Kp.process,Fr=(function(){try{var V=ot&&ot.require&&ot.require("util").types;return V||Ki&&Ki.binding&&Ki.binding("util")}catch{}})(),Jc=Fr&&Fr.isArrayBuffer,Qp=Fr&&Fr.isDate,Zp=Fr&&Fr.isMap,Ko=Fr&&Fr.isRegExp,Hn=Fr&&Fr.isSet,kl=Fr&&Fr.isTypedArray;function _r(V,Q,z){switch(z.length){case 0:return V.call(Q);case 1:return V.call(Q,z[0]);case 2:return V.call(Q,z[0],z[1]);case 3:return V.call(Q,z[0],z[1],z[2])}return V.apply(Q,z)}function Bn(V,Q,z,ue){for(var Ce=-1,rt=V==null?0:V.length;++Ce<rt;){var ct=V[Ce];Q(ue,ct,z(ct),V)}return ue}function Rr(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue&&Q(V[z],z,V)!==!1;);return V}function Gc(V,Q){for(var z=V==null?0:V.length;z--&&Q(V[z],z,V)!==!1;);return V}function Xp(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(!Q(V[z],z,V))return!1;return!0}function bi(V,Q){for(var z=-1,ue=V==null?0:V.length,Ce=0,rt=[];++z<ue;){var ct=V[z];Q(ct,z,V)&&(rt[Ce++]=ct)}return rt}function Pl(V,Q){var z=V==null?0:V.length;return!!z&&Qi(V,Q,0)>-1}function Ds(V,Q,z){for(var ue=-1,Ce=V==null?0:V.length;++ue<Ce;)if(z(Q,V[ue]))return!0;return!1}function yt(V,Q){for(var z=-1,ue=V==null?0:V.length,Ce=Array(ue);++z<ue;)Ce[z]=Q(V[z],z,V);return Ce}function Si(V,Q){for(var z=-1,ue=Q.length,Ce=V.length;++z<ue;)V[Ce+z]=Q[z];return V}function Yc(V,Q,z,ue){var Ce=-1,rt=V==null?0:V.length;for(ue&&rt&&(z=V[++Ce]);++Ce<rt;)z=Q(z,V[Ce],Ce,V);return z}function Kv(V,Q,z,ue){var Ce=V==null?0:V.length;for(ue&&Ce&&(z=V[--Ce]);Ce--;)z=Q(z,V[Ce],Ce,V);return z}function Tl(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(Q(V[z],z,V))return!0;return!1}var Qv=Qo("length");function Zv(V){return V.split("")}function Xv(V){return V.match(Ft)||[]}function eh(V,Q,z){var ue;return z(V,function(Ce,rt,ct){if(Q(Ce,rt,ct))return ue=rt,!1}),ue}function Al(V,Q,z,ue){for(var Ce=V.length,rt=z+(ue?1:-1);ue?rt--:++rt<Ce;)if(Q(V[rt],rt,V))return rt;return-1}function Qi(V,Q,z){return Q===Q?lb(V,Q,z):Al(V,Zi,z)}function eb(V,Q,z,ue){for(var Ce=z-1,rt=V.length;++Ce<rt;)if(ue(V[Ce],Q))return Ce;return-1}function Zi(V){return V!==V}function th(V,Q){var z=V==null?0:V.length;return z?Qc(V,Q)/z:le}function Qo(V){return function(Q){return Q==null?t:Q[V]}}function Kc(V){return function(Q){return V==null?t:V[Q]}}function $l(V,Q,z,ue,Ce){return Ce(V,function(rt,ct,Je){z=ue?(ue=!1,rt):Q(z,rt,ct,Je)}),z}function tb(V,Q){var z=V.length;for(V.sort(Q);z--;)V[z]=V[z].value;return V}function Qc(V,Q){for(var z,ue=-1,Ce=V.length;++ue<Ce;){var rt=Q(V[ue]);rt!==t&&(z=z===t?rt:z+rt)}return z}function Zc(V,Q){for(var z=-1,ue=Array(V);++z<V;)ue[z]=Q(z);return ue}function rb(V,Q){return yt(Q,function(z){return[z,V[z]]})}function Xc(V){return V&&V.slice(0,oh(V)+1).replace(Mc,"")}function Cr(V){return function(Q){return V(Q)}}function Nl(V,Q){return yt(Q,function(z){return V[z]})}function ut(V,Q){return V.has(Q)}function rh(V,Q){for(var z=-1,ue=V.length;++z<ue&&Qi(Q,V[z],0)>-1;);return z}function nh(V,Q){for(var z=V.length;z--&&Qi(Q,V[z],0)>-1;);return z}function ih(V,Q){for(var z=V.length,ue=0;z--;)V[z]===Q&&++ue;return ue}var nb=Kc(Wc),ib=Kc(zc);function sb(V){return"\\"+Gp[V]}function Zo(V,Q){return V==null?t:V[Q]}function Ls(V){return Bv.test(V)}function ob(V){return Vv.test(V)}function ab(V){for(var Q,z=[];!(Q=V.next()).done;)z.push(Q.value);return z}function js(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue,Ce){z[++Q]=[Ce,ue]}),z}function Xo(V,Q){return function(z){return V(Q(z))}}function bn(V,Q){for(var z=-1,ue=V.length,Ce=0,rt=[];++z<ue;){var ct=V[z];(ct===Q||ct===c)&&(V[z]=c,rt[Ce++]=z)}return rt}function Ml(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=ue}),z}function sh(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=[ue,ue]}),z}function lb(V,Q,z){for(var ue=z-1,Ce=V.length;++ue<Ce;)if(V[ue]===Q)return ue;return-1}function ef(V,Q,z){for(var ue=z+1;ue--;)if(V[ue]===Q)return ue;return ue}function wi(V){return Ls(V)?cb(V):Qv(V)}function xr(V){return Ls(V)?fb(V):Zv(V)}function oh(V){for(var Q=V.length;Q--&&Rl.test(V.charAt(Q)););return Q}var ub=Kc(Jv);function cb(V){for(var Q=Vc.lastIndex=0;Vc.test(V);)++Q;return Q}function fb(V){return V.match(Vc)||[]}function db(V){return V.match(Hv)||[]}var pb=(function V(Q){Q=Q==null?Ut:_i.defaults(Ut.Object(),Q,_i.pick(Ut,Wv));var z=Q.Array,ue=Q.Date,Ce=Q.Error,rt=Q.Function,ct=Q.Math,Je=Q.Object,Fl=Q.RegExp,hb=Q.String,Er=Q.TypeError,ea=z.prototype,mb=rt.prototype,Us=Je.prototype,ta=Q["__core-js_shared__"],Dl=mb.toString,at=Us.hasOwnProperty,gb=0,ah=(function(){var a=/[^.]+$/.exec(ta&&ta.keys&&ta.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Ll=Us.toString,yb=Dl.call(Je),vb=Ut._,bb=Fl("^"+Dl.call(at).replace(st,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jl=Fs?Q.Buffer:t,Ri=Q.Symbol,Ul=Q.Uint8Array,lh=jl?jl.allocUnsafe:t,Hl=Xo(Je.getPrototypeOf,Je),uh=Je.create,ra=Us.propertyIsEnumerable,Bl=ea.splice,ch=Ri?Ri.isConcatSpreadable:t,na=Ri?Ri.iterator:t,Xi=Ri?Ri.toStringTag:t,Vl=(function(){try{var a=pa(Je,"defineProperty");return a({},"",{}),a}catch{}})(),Sb=Q.clearTimeout!==Ut.clearTimeout&&Q.clearTimeout,wb=ue&&ue.now!==Ut.Date.now&&ue.now,_b=Q.setTimeout!==Ut.setTimeout&&Q.setTimeout,ia=ct.ceil,sa=ct.floor,Wl=Je.getOwnPropertySymbols,zl=jl?jl.isBuffer:t,es=Q.isFinite,Jl=ea.join,fh=Xo(Je.keys,Je),Ct=ct.max,Gt=ct.min,dh=ue.now,Rb=Q.parseInt,ph=ct.random,Cb=ea.reverse,tf=pa(Q,"DataView"),oa=pa(Q,"Map"),rf=pa(Q,"Promise"),Hs=pa(Q,"Set"),aa=pa(Q,"WeakMap"),la=pa(Je,"create"),Gl=aa&&new aa,Bs={},xb=ha(tf),Eb=ha(oa),Ib=ha(rf),Ob=ha(Hs),qb=ha(aa),Yl=Ri?Ri.prototype:t,ua=Yl?Yl.valueOf:t,hh=Yl?Yl.toString:t;function O(a){if(At(a)&&!Ie(a)&&!(a instanceof Le)){if(a instanceof cr)return a;if(at.call(a,"__wrapped__"))return qE(a)}return new cr(a)}var Vs=(function(){function a(){}return function(u){if(!Pt(u))return{};if(uh)return uh(u);a.prototype=u;var m=new a;return a.prototype=t,m}})();function Kl(){}function cr(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}O.templateSettings={escape:Rv,evaluate:Cv,interpolate:gn,variable:"",imports:{_:O}},O.prototype=Kl.prototype,O.prototype.constructor=O,cr.prototype=Vs(Kl.prototype),cr.prototype.constructor=cr;function Le(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=be,this.__views__=[]}function kb(){var a=new Le(this.__wrapped__);return a.__actions__=Dr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Dr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Dr(this.__views__),a}function Pb(){if(this.__filtered__){var a=new Le(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function nf(){var a=this.__wrapped__.value(),u=this.__dir__,m=Ie(a),b=u<0,x=m?a.length:0,P=IM(0,x,this.__views__),M=P.start,U=P.end,W=U-M,Z=b?U:M-1,X=this.__iteratees__,te=X.length,oe=0,he=Gt(W,this.__takeCount__);if(!m||!b&&x==W&&he==W)return Zx(a,this.__actions__);var _e=[];e:for(;W--&&oe<he;){Z+=u;for(var Te=-1,Se=a[Z];++Te<te;){var Ve=X[Te],Ge=Ve.iteratee,an=Ve.type,qr=Ge(Se);if(an==ee)Se=qr;else if(!qr){if(an==K)continue e;break e}}_e[oe++]=Se}return _e}Le.prototype=Vs(Kl.prototype),Le.prototype.constructor=Le;function Sn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Tb(){this.__data__=la?la(null):{},this.size=0}function Ab(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function $b(a){var u=this.__data__;if(la){var m=u[a];return m===l?t:m}return at.call(u,a)?u[a]:t}function Nb(a){var u=this.__data__;return la?u[a]!==t:at.call(u,a)}function Mb(a,u){var m=this.__data__;return this.size+=this.has(a)?0:1,m[a]=la&&u===t?l:u,this}Sn.prototype.clear=Tb,Sn.prototype.delete=Ab,Sn.prototype.get=$b,Sn.prototype.has=Nb,Sn.prototype.set=Mb;function Vn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function mh(){this.__data__=[],this.size=0}function Fb(a){var u=this.__data__,m=Zl(u,a);if(m<0)return!1;var b=u.length-1;return m==b?u.pop():Bl.call(u,m,1),--this.size,!0}function Db(a){var u=this.__data__,m=Zl(u,a);return m<0?t:u[m][1]}function gh(a){return Zl(this.__data__,a)>-1}function Lb(a,u){var m=this.__data__,b=Zl(m,a);return b<0?(++this.size,m.push([a,u])):m[b][1]=u,this}Vn.prototype.clear=mh,Vn.prototype.delete=Fb,Vn.prototype.get=Db,Vn.prototype.has=gh,Vn.prototype.set=Lb;function Wn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function jb(){this.size=0,this.__data__={hash:new Sn,map:new(oa||Vn),string:new Sn}}function Ci(a){var u=Fh(this,a).delete(a);return this.size-=u?1:0,u}function yh(a){return Fh(this,a).get(a)}function Ub(a){return Fh(this,a).has(a)}function Hb(a,u){var m=Fh(this,a),b=m.size;return m.set(a,u),this.size+=m.size==b?0:1,this}Wn.prototype.clear=jb,Wn.prototype.delete=Ci,Wn.prototype.get=yh,Wn.prototype.has=Ub,Wn.prototype.set=Hb;function ts(a){var u=-1,m=a==null?0:a.length;for(this.__data__=new Wn;++u<m;)this.add(a[u])}function re(a){return this.__data__.set(a,l),this}function Bb(a){return this.__data__.has(a)}ts.prototype.add=ts.prototype.push=re,ts.prototype.has=Bb;function tn(a){var u=this.__data__=new Vn(a);this.size=u.size}function vh(){this.__data__=new Vn,this.size=0}function Qe(a){var u=this.__data__,m=u.delete(a);return this.size=u.size,m}function Ql(a){return this.__data__.get(a)}function bh(a){return this.__data__.has(a)}function sf(a,u){var m=this.__data__;if(m instanceof Vn){var b=m.__data__;if(!oa||b.length<r-1)return b.push([a,u]),this.size=++m.size,this;m=this.__data__=new Wn(b)}return m.set(a,u),this.size=m.size,this}tn.prototype.clear=vh,tn.prototype.delete=Qe,tn.prototype.get=Ql,tn.prototype.has=bh,tn.prototype.set=sf;function Sh(a,u){var m=Ie(a),b=!m&&ma(a),x=!m&&!b&&Qs(a),P=!m&&!b&&!x&&iu(a),M=m||b||x||P,U=M?Zc(a.length,hb):[],W=U.length;for(var Z in a)(u||at.call(a,Z))&&!(M&&(Z=="length"||x&&(Z=="offset"||Z=="parent")||P&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||ss(Z,W)))&&U.push(Z);return U}function wh(a){var u=a.length;return u?a[rS(0,u-1)]:t}function Vb(a,u){return Dh(Dr(a),xi(u,0,a.length))}function Wb(a){return Dh(Dr(a))}function of(a,u,m){(m!==t&&!Kn(a[u],m)||m===t&&!(u in a))&&rn(a,u,m)}function Ir(a,u,m){var b=a[u];(!(at.call(a,u)&&Kn(b,m))||m===t&&!(u in a))&&rn(a,u,m)}function Zl(a,u){for(var m=a.length;m--;)if(Kn(a[m][0],u))return m;return-1}function _h(a,u,m,b){return Ei(a,function(x,P,M){u(b,x,m(x),M)}),b}function Rh(a,u){return a&&Ii(u,tr(u),a)}function zb(a,u){return a&&Ii(u,jr(u),a)}function rn(a,u,m){u=="__proto__"&&Vl?Vl(a,u,{configurable:!0,enumerable:!0,value:m,writable:!0}):a[u]=m}function af(a,u){for(var m=-1,b=u.length,x=z(b),P=a==null;++m<b;)x[m]=P?t:OS(a,u[m]);return x}function xi(a,u,m){return a===a&&(m!==t&&(a=a<=m?a:m),u!==t&&(a=a>=u?a:u)),a}function fr(a,u,m,b,x,P){var M,U=u&p,W=u&h,Z=u&g;if(m&&(M=x?m(a,b,x,P):m(a)),M!==t)return M;if(!Pt(a))return a;var X=Ie(a);if(X){if(M=qM(a),!U)return Dr(a,M)}else{var te=dr(a),oe=te==mn||te==Lo;if(Qs(a))return tE(a,U);if(te==Dn||te==rr||oe&&!x){if(M=W||oe?{}:SE(a),!U)return W?vM(a,zb(M,a)):yM(a,Rh(M,a))}else{if(!gt[te])return x?a:{};M=kM(a,te,U)}}P||(P=new tn);var he=P.get(a);if(he)return he;P.set(a,M),YE(a)?a.forEach(function(Se){M.add(fr(Se,u,m,Se,a,P))}):JE(a)&&a.forEach(function(Se,Ve){M.set(Ve,fr(Se,u,m,Ve,a,P))});var _e=Z?W?pS:dS:W?jr:tr,Te=X?t:_e(a);return Rr(Te||a,function(Se,Ve){Te&&(Ve=Se,Se=a[Ve]),Ir(M,Ve,fr(Se,u,m,Ve,a,P))}),M}function Jb(a){var u=tr(a);return function(m){return wn(m,a,u)}}function wn(a,u,m){var b=m.length;if(a==null)return!b;for(a=Je(a);b--;){var x=m[b],P=u[x],M=a[x];if(M===t&&!(x in a)||!P(M))return!1}return!0}function lf(a,u,m){if(typeof a!="function")throw new Er(i);return mf(function(){a.apply(t,m)},u)}function ca(a,u,m,b){var x=-1,P=Pl,M=!0,U=a.length,W=[],Z=u.length;if(!U)return W;m&&(u=yt(u,Cr(m))),b?(P=Ds,M=!1):u.length>=r&&(P=ut,M=!1,u=new ts(u));e:for(;++x<U;){var X=a[x],te=m==null?X:m(X);if(X=b||X!==0?X:0,M&&te===te){for(var oe=Z;oe--;)if(u[oe]===te)continue e;W.push(X)}else P(u,te,b)||W.push(X)}return W}var Ei=oE(_n),Ch=oE(zn,!0);function Gb(a,u){var m=!0;return Ei(a,function(b,x,P){return m=!!u(b,x,P),m}),m}function Xl(a,u,m){for(var b=-1,x=a.length;++b<x;){var P=a[b],M=u(P);if(M!=null&&(U===t?M===M&&!on(M):m(M,U)))var U=M,W=P}return W}function Yb(a,u,m,b){var x=a.length;for(m=qe(m),m<0&&(m=-m>x?0:x+m),b=b===t||b>x?x:qe(b),b<0&&(b+=x),b=m>b?0:QE(b);m<b;)a[m++]=u;return a}function xh(a,u){var m=[];return Ei(a,function(b,x,P){u(b,x,P)&&m.push(b)}),m}function Yt(a,u,m,b,x){var P=-1,M=a.length;for(m||(m=TM),x||(x=[]);++P<M;){var U=a[P];u>0&&m(U)?u>1?Yt(U,u-1,m,b,x):Si(x,U):b||(x[x.length]=U)}return x}var uf=aE(),Eh=aE(!0);function _n(a,u){return a&&uf(a,u,tr)}function zn(a,u){return a&&Eh(a,u,tr)}function eu(a,u){return bi(u,function(m){return os(a[m])})}function rs(a,u){u=Ys(u,a);for(var m=0,b=u.length;a!=null&&m<b;)a=a[Yn(u[m++])];return m&&m==b?a:t}function Ih(a,u,m){var b=u(a);return Ie(a)?b:Si(b,m(a))}function nr(a){return a==null?a===t?Ap:wv:Xi&&Xi in Je(a)?EM(a):LM(a)}function cf(a,u){return a>u}function Kb(a,u){return a!=null&&at.call(a,u)}function Qb(a,u){return a!=null&&u in Je(a)}function Zb(a,u,m){return a>=Gt(u,m)&&a<Ct(u,m)}function nn(a,u,m){for(var b=m?Ds:Pl,x=a[0].length,P=a.length,M=P,U=z(P),W=1/0,Z=[];M--;){var X=a[M];M&&u&&(X=yt(X,Cr(u))),W=Gt(X.length,W),U[M]=!m&&(u||x>=120&&X.length>=120)?new ts(M&&X):t}X=a[0];var te=-1,oe=U[0];e:for(;++te<x&&Z.length<W;){var he=X[te],_e=u?u(he):he;if(he=m||he!==0?he:0,!(oe?ut(oe,_e):b(Z,_e,m))){for(M=P;--M;){var Te=U[M];if(!(Te?ut(Te,_e):b(a[M],_e,m)))continue e}oe&&oe.push(_e),Z.push(he)}}return Z}function Ws(a,u,m,b){return _n(a,function(x,P,M){u(b,m(x),P,M)}),b}function fa(a,u,m){u=Ys(u,a),a=CE(a,u);var b=a==null?a:a[Yn(Cn(u))];return b==null?t:_r(b,a,m)}function Oh(a){return At(a)&&nr(a)==rr}function Xb(a){return At(a)&&nr(a)==Ji}function eS(a){return At(a)&&nr(a)==$r}function da(a,u,m,b,x){return a===u?!0:a==null||u==null||!At(a)&&!At(u)?a!==a&&u!==u:ff(a,u,m,b,da,x)}function ff(a,u,m,b,x,P){var M=Ie(a),U=Ie(u),W=M?Ne:dr(a),Z=U?Ne:dr(u);W=W==rr?Dn:W,Z=Z==rr?Dn:Z;var X=W==Dn,te=Z==Dn,oe=W==Z;if(oe&&Qs(a)){if(!Qs(u))return!1;M=!0,X=!1}if(oe&&!X)return P||(P=new tn),M||iu(a)?yE(a,u,m,b,x,P):CM(a,u,W,m,b,x,P);if(!(m&v)){var he=X&&at.call(a,"__wrapped__"),_e=te&&at.call(u,"__wrapped__");if(he||_e){var Te=he?a.value():a,Se=_e?u.value():u;return P||(P=new tn),x(Te,Se,m,b,P)}}return oe?(P||(P=new tn),xM(a,u,m,b,x,P)):!1}function zs(a){return At(a)&&dr(a)==Zt}function Js(a,u,m,b){var x=m.length,P=x,M=!b;if(a==null)return!P;for(a=Je(a);x--;){var U=m[x];if(M&&U[2]?U[1]!==a[U[0]]:!(U[0]in a))return!1}for(;++x<P;){U=m[x];var W=U[0],Z=a[W],X=U[1];if(M&&U[2]){if(Z===t&&!(W in a))return!1}else{var te=new tn;if(b)var oe=b(Z,X,W,a,u,te);if(!(oe===t?da(X,Z,v|_,b,te):oe))return!1}}return!0}function Be(a){if(!Pt(a)||$M(a))return!1;var u=os(a)?bb:Mp;return u.test(ha(a))}function d(a){return At(a)&&nr(a)==Xt}function y(a){return At(a)&&dr(a)==wr}function S(a){return At(a)&&Vh(a.length)&&!!St[nr(a)]}function R(a){return typeof a=="function"?a:a==null?Ur:typeof a=="object"?Ie(a)?je(a[0],a[1]):Re(a):uI(a)}function I(a){if(!hf(a))return fh(a);var u=[];for(var m in Je(a))at.call(a,m)&&m!="constructor"&&u.push(m);return u}function L(a){if(!Pt(a))return DM(a);var u=hf(a),m=[];for(var b in a)b=="constructor"&&(u||!at.call(a,b))||m.push(b);return m}function Y(a,u){return a<u}function ae(a,u){var m=-1,b=Lr(a)?z(a.length):[];return Ei(a,function(x,P,M){b[++m]=u(x,P,M)}),b}function Re(a){var u=mS(a);return u.length==1&&u[0][2]?_E(u[0][0],u[0][1]):function(m){return m===a||Js(m,a,u)}}function je(a,u){return yS(a)&&wE(u)?_E(Yn(a),u):function(m){var b=OS(m,a);return b===t&&b===u?qS(m,a):da(u,b,v|_)}}function Ht(a,u,m,b,x){a!==u&&uf(u,function(P,M){if(x||(x=new tn),Pt(P))Jn(a,u,M,m,Ht,b,x);else{var U=b?b(bS(a,M),P,M+"",a,u,x):t;U===t&&(U=P),of(a,M,U)}},jr)}function Jn(a,u,m,b,x,P,M){var U=bS(a,m),W=bS(u,m),Z=M.get(W);if(Z){of(a,m,Z);return}var X=P?P(U,W,m+"",a,u,M):t,te=X===t;if(te){var oe=Ie(W),he=!oe&&Qs(W),_e=!oe&&!he&&iu(W);X=W,oe||he||_e?Ie(U)?X=U:Dt(U)?X=Dr(U):he?(te=!1,X=tE(W,!0)):_e?(te=!1,X=rE(W,!0)):X=[]:gf(W)||ma(W)?(X=U,ma(U)?X=ZE(U):(!Pt(U)||os(U))&&(X=SE(W))):te=!1}te&&(M.set(W,X),x(X,W,b,P,M),M.delete(W)),of(a,m,X)}function Gn(a,u){var m=a.length;if(m)return u+=u<0?m:0,ss(u,m)?a[u]:t}function Wx(a,u,m){u.length?u=yt(u,function(P){return Ie(P)?function(M){return rs(M,P.length===1?P[0]:P)}:P}):u=[Ur];var b=-1;u=yt(u,Cr(we()));var x=ae(a,function(P,M,U){var W=yt(u,function(Z){return Z(P)});return{criteria:W,index:++b,value:P}});return tb(x,function(P,M){return gM(P,M,m)})}function iM(a,u){return zx(a,u,function(m,b){return qS(a,b)})}function zx(a,u,m){for(var b=-1,x=u.length,P={};++b<x;){var M=u[b],U=rs(a,M);m(U,M)&&df(P,Ys(M,a),U)}return P}function sM(a){return function(u){return rs(u,a)}}function tS(a,u,m,b){var x=b?eb:Qi,P=-1,M=u.length,U=a;for(a===u&&(u=Dr(u)),m&&(U=yt(a,Cr(m)));++P<M;)for(var W=0,Z=u[P],X=m?m(Z):Z;(W=x(U,X,W,b))>-1;)U!==a&&Bl.call(U,W,1),Bl.call(a,W,1);return a}function Jx(a,u){for(var m=a?u.length:0,b=m-1;m--;){var x=u[m];if(m==b||x!==P){var P=x;ss(x)?Bl.call(a,x,1):sS(a,x)}}return a}function rS(a,u){return a+sa(ph()*(u-a+1))}function oM(a,u,m,b){for(var x=-1,P=Ct(ia((u-a)/(m||1)),0),M=z(P);P--;)M[b?P:++x]=a,a+=m;return M}function nS(a,u){var m="";if(!a||u<1||u>Pe)return m;do u%2&&(m+=a),u=sa(u/2),u&&(a+=a);while(u);return m}function Me(a,u){return SS(RE(a,u,Ur),a+"")}function aM(a){return wh(su(a))}function lM(a,u){var m=su(a);return Dh(m,xi(u,0,m.length))}function df(a,u,m,b){if(!Pt(a))return a;u=Ys(u,a);for(var x=-1,P=u.length,M=P-1,U=a;U!=null&&++x<P;){var W=Yn(u[x]),Z=m;if(W==="__proto__"||W==="constructor"||W==="prototype")return a;if(x!=M){var X=U[W];Z=b?b(X,W,U):t,Z===t&&(Z=Pt(X)?X:ss(u[x+1])?[]:{})}Ir(U,W,Z),U=U[W]}return a}var Gx=Gl?function(a,u){return Gl.set(a,u),a}:Ur,uM=Vl?function(a,u){return Vl(a,"toString",{configurable:!0,enumerable:!1,value:PS(u),writable:!0})}:Ur;function cM(a){return Dh(su(a))}function Rn(a,u,m){var b=-1,x=a.length;u<0&&(u=-u>x?0:x+u),m=m>x?x:m,m<0&&(m+=x),x=u>m?0:m-u>>>0,u>>>=0;for(var P=z(x);++b<x;)P[b]=a[b+u];return P}function fM(a,u){var m;return Ei(a,function(b,x,P){return m=u(b,x,P),!m}),!!m}function qh(a,u,m){var b=0,x=a==null?b:a.length;if(typeof u=="number"&&u===u&&x<=mt){for(;b<x;){var P=b+x>>>1,M=a[P];M!==null&&!on(M)&&(m?M<=u:M<u)?b=P+1:x=P}return x}return iS(a,u,Ur,m)}function iS(a,u,m,b){var x=0,P=a==null?0:a.length;if(P===0)return 0;u=m(u);for(var M=u!==u,U=u===null,W=on(u),Z=u===t;x<P;){var X=sa((x+P)/2),te=m(a[X]),oe=te!==t,he=te===null,_e=te===te,Te=on(te);if(M)var Se=b||_e;else Z?Se=_e&&(b||oe):U?Se=_e&&oe&&(b||!he):W?Se=_e&&oe&&!he&&(b||!Te):he||Te?Se=!1:Se=b?te<=u:te<u;Se?x=X+1:P=X}return Gt(P,ze)}function Yx(a,u){for(var m=-1,b=a.length,x=0,P=[];++m<b;){var M=a[m],U=u?u(M):M;if(!m||!Kn(U,W)){var W=U;P[x++]=M===0?0:M}}return P}function Kx(a){return typeof a=="number"?a:on(a)?le:+a}function sn(a){if(typeof a=="string")return a;if(Ie(a))return yt(a,sn)+"";if(on(a))return hh?hh.call(a):"";var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function Gs(a,u,m){var b=-1,x=Pl,P=a.length,M=!0,U=[],W=U;if(m)M=!1,x=Ds;else if(P>=r){var Z=u?null:_M(a);if(Z)return Ml(Z);M=!1,x=ut,W=new ts}else W=u?[]:U;e:for(;++b<P;){var X=a[b],te=u?u(X):X;if(X=m||X!==0?X:0,M&&te===te){for(var oe=W.length;oe--;)if(W[oe]===te)continue e;u&&W.push(te),U.push(X)}else x(W,te,m)||(W!==U&&W.push(te),U.push(X))}return U}function sS(a,u){u=Ys(u,a);var m=-1,b=u.length;if(!b)return!0;for(;++m<b;){var x=Yn(u[m]);if(x==="__proto__"&&!at.call(a,"__proto__")||(x==="constructor"||x==="prototype")&&m<b-1)return!1}var P=CE(a,u);return P==null||delete P[Yn(Cn(u))]}function Qx(a,u,m,b){return df(a,u,m(rs(a,u)),b)}function kh(a,u,m,b){for(var x=a.length,P=b?x:-1;(b?P--:++P<x)&&u(a[P],P,a););return m?Rn(a,b?0:P,b?P+1:x):Rn(a,b?P+1:0,b?x:P)}function Zx(a,u){var m=a;return m instanceof Le&&(m=m.value()),Yc(u,function(b,x){return x.func.apply(x.thisArg,Si([b],x.args))},m)}function oS(a,u,m){var b=a.length;if(b<2)return b?Gs(a[0]):[];for(var x=-1,P=z(b);++x<b;)for(var M=a[x],U=-1;++U<b;)U!=x&&(P[x]=ca(P[x]||M,a[U],u,m));return Gs(Yt(P,1),u,m)}function Xx(a,u,m){for(var b=-1,x=a.length,P=u.length,M={};++b<x;){var U=b<P?u[b]:t;m(M,a[b],U)}return M}function aS(a){return Dt(a)?a:[]}function lS(a){return typeof a=="function"?a:Ur}function Ys(a,u){return Ie(a)?a:yS(a,u)?[a]:OE(ft(a))}var dM=Me;function Ks(a,u,m){var b=a.length;return m=m===t?b:m,!u&&m>=b?a:Rn(a,u,m)}var eE=Sb||function(a){return Ut.clearTimeout(a)};function tE(a,u){if(u)return a.slice();var m=a.length,b=lh?lh(m):new a.constructor(m);return a.copy(b),b}function uS(a){var u=new a.constructor(a.byteLength);return new Ul(u).set(new Ul(a)),u}function pM(a,u){var m=u?uS(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.byteLength)}function hM(a){var u=new a.constructor(a.source,Np.exec(a));return u.lastIndex=a.lastIndex,u}function mM(a){return ua?Je(ua.call(a)):{}}function rE(a,u){var m=u?uS(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.length)}function nE(a,u){if(a!==u){var m=a!==t,b=a===null,x=a===a,P=on(a),M=u!==t,U=u===null,W=u===u,Z=on(u);if(!U&&!Z&&!P&&a>u||P&&M&&W&&!U&&!Z||b&&M&&W||!m&&W||!x)return 1;if(!b&&!P&&!Z&&a<u||Z&&m&&x&&!b&&!P||U&&m&&x||!M&&x||!W)return-1}return 0}function gM(a,u,m){for(var b=-1,x=a.criteria,P=u.criteria,M=x.length,U=m.length;++b<M;){var W=nE(x[b],P[b]);if(W){if(b>=U)return W;var Z=m[b];return W*(Z=="desc"?-1:1)}}return a.index-u.index}function iE(a,u,m,b){for(var x=-1,P=a.length,M=m.length,U=-1,W=u.length,Z=Ct(P-M,0),X=z(W+Z),te=!b;++U<W;)X[U]=u[U];for(;++x<M;)(te||x<P)&&(X[m[x]]=a[x]);for(;Z--;)X[U++]=a[x++];return X}function sE(a,u,m,b){for(var x=-1,P=a.length,M=-1,U=m.length,W=-1,Z=u.length,X=Ct(P-U,0),te=z(X+Z),oe=!b;++x<X;)te[x]=a[x];for(var he=x;++W<Z;)te[he+W]=u[W];for(;++M<U;)(oe||x<P)&&(te[he+m[M]]=a[x++]);return te}function Dr(a,u){var m=-1,b=a.length;for(u||(u=z(b));++m<b;)u[m]=a[m];return u}function Ii(a,u,m,b){var x=!m;m||(m={});for(var P=-1,M=u.length;++P<M;){var U=u[P],W=b?b(m[U],a[U],U,m,a):t;W===t&&(W=a[U]),x?rn(m,U,W):Ir(m,U,W)}return m}function yM(a,u){return Ii(a,gS(a),u)}function vM(a,u){return Ii(a,vE(a),u)}function Ph(a,u){return function(m,b){var x=Ie(m)?Bn:_h,P=u?u():{};return x(m,a,we(b,2),P)}}function tu(a){return Me(function(u,m){var b=-1,x=m.length,P=x>1?m[x-1]:t,M=x>2?m[2]:t;for(P=a.length>3&&typeof P=="function"?(x--,P):t,M&&Or(m[0],m[1],M)&&(P=x<3?t:P,x=1),u=Je(u);++b<x;){var U=m[b];U&&a(u,U,b,P)}return u})}function oE(a,u){return function(m,b){if(m==null)return m;if(!Lr(m))return a(m,b);for(var x=m.length,P=u?x:-1,M=Je(m);(u?P--:++P<x)&&b(M[P],P,M)!==!1;);return m}}function aE(a){return function(u,m,b){for(var x=-1,P=Je(u),M=b(u),U=M.length;U--;){var W=M[a?U:++x];if(m(P[W],W,P)===!1)break}return u}}function bM(a,u,m){var b=u&w,x=pf(a);function P(){var M=this&&this!==Ut&&this instanceof P?x:a;return M.apply(b?m:this,arguments)}return P}function lE(a){return function(u){u=ft(u);var m=Ls(u)?xr(u):t,b=m?m[0]:u.charAt(0),x=m?Ks(m,1).join(""):u.slice(1);return b[a]()+x}}function ru(a){return function(u){return Yc(aI(oI(u).replace(jv,"")),a,"")}}function pf(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var m=Vs(a.prototype),b=a.apply(m,u);return Pt(b)?b:m}}function SM(a,u,m){var b=pf(a);function x(){for(var P=arguments.length,M=z(P),U=P,W=nu(x);U--;)M[U]=arguments[U];var Z=P<3&&M[0]!==W&&M[P-1]!==W?[]:bn(M,W);if(P-=Z.length,P<m)return pE(a,u,Th,x.placeholder,t,M,Z,t,t,m-P);var X=this&&this!==Ut&&this instanceof x?b:a;return _r(X,this,M)}return x}function uE(a){return function(u,m,b){var x=Je(u);if(!Lr(u)){var P=we(m,3);u=tr(u),m=function(U){return P(x[U],U,x)}}var M=a(u,m,b);return M>-1?x[P?u[M]:M]:t}}function cE(a){return is(function(u){var m=u.length,b=m,x=cr.prototype.thru;for(a&&u.reverse();b--;){var P=u[b];if(typeof P!="function")throw new Er(i);if(x&&!M&&Mh(P)=="wrapper")var M=new cr([],!0)}for(b=M?b:m;++b<m;){P=u[b];var U=Mh(P),W=U=="wrapper"?hS(P):t;W&&vS(W[0])&&W[1]==(G|T|$|q)&&!W[4].length&&W[9]==1?M=M[Mh(W[0])].apply(M,W[3]):M=P.length==1&&vS(P)?M[U]():M.thru(P)}return function(){var Z=arguments,X=Z[0];if(M&&Z.length==1&&Ie(X))return M.plant(X).value();for(var te=0,oe=m?u[te].apply(this,Z):X;++te<m;)oe=u[te].call(this,oe);return oe}})}function Th(a,u,m,b,x,P,M,U,W,Z){var X=u&G,te=u&w,oe=u&E,he=u&(T|N),_e=u&C,Te=oe?t:pf(a);function Se(){for(var Ve=arguments.length,Ge=z(Ve),an=Ve;an--;)Ge[an]=arguments[an];if(he)var qr=nu(Se),ln=ih(Ge,qr);if(b&&(Ge=iE(Ge,b,x,he)),P&&(Ge=sE(Ge,P,M,he)),Ve-=ln,he&&Ve<Z){var Lt=bn(Ge,qr);return pE(a,u,Th,Se.placeholder,m,Ge,Lt,U,W,Z-Ve)}var Qn=te?m:this,ls=oe?Qn[a]:a;return Ve=Ge.length,U?Ge=jM(Ge,U):_e&&Ve>1&&Ge.reverse(),X&&W<Ve&&(Ge.length=W),this&&this!==Ut&&this instanceof Se&&(ls=Te||pf(ls)),ls.apply(Qn,Ge)}return Se}function fE(a,u){return function(m,b){return Ws(m,a,u(b),{})}}function Ah(a,u){return function(m,b){var x;if(m===t&&b===t)return u;if(m!==t&&(x=m),b!==t){if(x===t)return b;typeof m=="string"||typeof b=="string"?(m=sn(m),b=sn(b)):(m=Kx(m),b=Kx(b)),x=a(m,b)}return x}}function cS(a){return is(function(u){return u=yt(u,Cr(we())),Me(function(m){var b=this;return a(u,function(x){return _r(x,b,m)})})})}function $h(a,u){u=u===t?" ":sn(u);var m=u.length;if(m<2)return m?nS(u,a):u;var b=nS(u,ia(a/wi(u)));return Ls(u)?Ks(xr(b),0,a).join(""):b.slice(0,a)}function wM(a,u,m,b){var x=u&w,P=pf(a);function M(){for(var U=-1,W=arguments.length,Z=-1,X=b.length,te=z(X+W),oe=this&&this!==Ut&&this instanceof M?P:a;++Z<X;)te[Z]=b[Z];for(;W--;)te[Z++]=arguments[++U];return _r(oe,x?m:this,te)}return M}function dE(a){return function(u,m,b){return b&&typeof b!="number"&&Or(u,m,b)&&(m=b=t),u=as(u),m===t?(m=u,u=0):m=as(m),b=b===t?u<m?1:-1:as(b),oM(u,m,b,a)}}function Nh(a){return function(u,m){return typeof u=="string"&&typeof m=="string"||(u=xn(u),m=xn(m)),a(u,m)}}function pE(a,u,m,b,x,P,M,U,W,Z){var X=u&T,te=X?M:t,oe=X?t:M,he=X?P:t,_e=X?t:P;u|=X?$:j,u&=~(X?j:$),u&k||(u&=~(w|E));var Te=[a,u,x,he,te,_e,oe,U,W,Z],Se=m.apply(t,Te);return vS(a)&&xE(Se,Te),Se.placeholder=b,EE(Se,a,u)}function fS(a){var u=ct[a];return function(m,b){if(m=xn(m),b=b==null?0:Gt(qe(b),292),b&&es(m)){var x=(ft(m)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+b));return x=(ft(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-b))}return u(m)}}var _M=Hs&&1/Ml(new Hs([,-0]))[1]==pe?function(a){return new Hs(a)}:$S;function hE(a){return function(u){var m=dr(u);return m==Zt?js(u):m==wr?sh(u):rb(u,a(u))}}function ns(a,u,m,b,x,P,M,U){var W=u&E;if(!W&&typeof a!="function")throw new Er(i);var Z=b?b.length:0;if(Z||(u&=~($|j),b=x=t),M=M===t?M:Ct(qe(M),0),U=U===t?U:qe(U),Z-=x?x.length:0,u&j){var X=b,te=x;b=x=t}var oe=W?t:hS(a),he=[a,u,m,b,x,X,te,P,M,U];if(oe&&FM(he,oe),a=he[0],u=he[1],m=he[2],b=he[3],x=he[4],U=he[9]=he[9]===t?W?0:a.length:Ct(he[9]-Z,0),!U&&u&(T|N)&&(u&=~(T|N)),!u||u==w)var _e=bM(a,u,m);else u==T||u==N?_e=SM(a,u,U):(u==$||u==(w|$))&&!x.length?_e=wM(a,u,m,b):_e=Th.apply(t,he);var Te=oe?Gx:xE;return EE(Te(_e,he),a,u)}function mE(a,u,m,b){return a===t||Kn(a,Us[m])&&!at.call(b,m)?u:a}function gE(a,u,m,b,x,P){return Pt(a)&&Pt(u)&&(P.set(u,a),Ht(a,u,t,gE,P),P.delete(u)),a}function RM(a){return gf(a)?t:a}function yE(a,u,m,b,x,P){var M=m&v,U=a.length,W=u.length;if(U!=W&&!(M&&W>U))return!1;var Z=P.get(a),X=P.get(u);if(Z&&X)return Z==u&&X==a;var te=-1,oe=!0,he=m&_?new ts:t;for(P.set(a,u),P.set(u,a);++te<U;){var _e=a[te],Te=u[te];if(b)var Se=M?b(Te,_e,te,u,a,P):b(_e,Te,te,a,u,P);if(Se!==t){if(Se)continue;oe=!1;break}if(he){if(!Tl(u,function(Ve,Ge){if(!ut(he,Ge)&&(_e===Ve||x(_e,Ve,m,b,P)))return he.push(Ge)})){oe=!1;break}}else if(!(_e===Te||x(_e,Te,m,b,P))){oe=!1;break}}return P.delete(a),P.delete(u),oe}function CM(a,u,m,b,x,P,M){switch(m){case Ln:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case Ji:return!(a.byteLength!=u.byteLength||!P(new Ul(a),new Ul(u)));case en:case $r:case jo:return Kn(+a,+u);case Rt:return a.name==u.name&&a.message==u.message;case Xt:case Uo:return a==u+"";case Zt:var U=js;case wr:var W=b&v;if(U||(U=Ml),a.size!=u.size&&!W)return!1;var Z=M.get(a);if(Z)return Z==u;b|=_,M.set(a,u);var X=yE(U(a),U(u),b,x,P,M);return M.delete(a),X;case yl:if(ua)return ua.call(a)==ua.call(u)}return!1}function xM(a,u,m,b,x,P){var M=m&v,U=dS(a),W=U.length,Z=dS(u),X=Z.length;if(W!=X&&!M)return!1;for(var te=W;te--;){var oe=U[te];if(!(M?oe in u:at.call(u,oe)))return!1}var he=P.get(a),_e=P.get(u);if(he&&_e)return he==u&&_e==a;var Te=!0;P.set(a,u),P.set(u,a);for(var Se=M;++te<W;){oe=U[te];var Ve=a[oe],Ge=u[oe];if(b)var an=M?b(Ge,Ve,oe,u,a,P):b(Ve,Ge,oe,a,u,P);if(!(an===t?Ve===Ge||x(Ve,Ge,m,b,P):an)){Te=!1;break}Se||(Se=oe=="constructor")}if(Te&&!Se){var qr=a.constructor,ln=u.constructor;qr!=ln&&"constructor"in a&&"constructor"in u&&!(typeof qr=="function"&&qr instanceof qr&&typeof ln=="function"&&ln instanceof ln)&&(Te=!1)}return P.delete(a),P.delete(u),Te}function is(a){return SS(RE(a,t,TE),a+"")}function dS(a){return Ih(a,tr,gS)}function pS(a){return Ih(a,jr,vE)}var hS=Gl?function(a){return Gl.get(a)}:$S;function Mh(a){for(var u=a.name+"",m=Bs[u],b=at.call(Bs,u)?m.length:0;b--;){var x=m[b],P=x.func;if(P==null||P==a)return x.name}return u}function nu(a){var u=at.call(O,"placeholder")?O:a;return u.placeholder}function we(){var a=O.iteratee||TS;return a=a===TS?R:a,arguments.length?a(arguments[0],arguments[1]):a}function Fh(a,u){var m=a.__data__;return AM(u)?m[typeof u=="string"?"string":"hash"]:m.map}function mS(a){for(var u=tr(a),m=u.length;m--;){var b=u[m],x=a[b];u[m]=[b,x,wE(x)]}return u}function pa(a,u){var m=Zo(a,u);return Be(m)?m:t}function EM(a){var u=at.call(a,Xi),m=a[Xi];try{a[Xi]=t;var b=!0}catch{}var x=Ll.call(a);return b&&(u?a[Xi]=m:delete a[Xi]),x}var gS=Wl?function(a){return a==null?[]:(a=Je(a),bi(Wl(a),function(u){return ra.call(a,u)}))}:NS,vE=Wl?function(a){for(var u=[];a;)Si(u,gS(a)),a=Hl(a);return u}:NS,dr=nr;(tf&&dr(new tf(new ArrayBuffer(1)))!=Ln||oa&&dr(new oa)!=Zt||rf&&dr(rf.resolve())!=Pp||Hs&&dr(new Hs)!=wr||aa&&dr(new aa)!=Jt)&&(dr=function(a){var u=nr(a),m=u==Dn?a.constructor:t,b=m?ha(m):"";if(b)switch(b){case xb:return Ln;case Eb:return Zt;case Ib:return Pp;case Ob:return wr;case qb:return Jt}return u});function IM(a,u,m){for(var b=-1,x=m.length;++b<x;){var P=m[b],M=P.size;switch(P.type){case"drop":a+=M;break;case"dropRight":u-=M;break;case"take":u=Gt(u,a+M);break;case"takeRight":a=Ct(a,u-M);break}}return{start:a,end:u}}function OM(a){var u=a.match(jn);return u?u[1].split(yn):[]}function bE(a,u,m){u=Ys(u,a);for(var b=-1,x=u.length,P=!1;++b<x;){var M=Yn(u[b]);if(!(P=a!=null&&m(a,M)))break;a=a[M]}return P||++b!=x?P:(x=a==null?0:a.length,!!x&&Vh(x)&&ss(M,x)&&(Ie(a)||ma(a)))}function qM(a){var u=a.length,m=new a.constructor(u);return u&&typeof a[0]=="string"&&at.call(a,"index")&&(m.index=a.index,m.input=a.input),m}function SE(a){return typeof a.constructor=="function"&&!hf(a)?Vs(Hl(a)):{}}function kM(a,u,m){var b=a.constructor;switch(u){case Ji:return uS(a);case en:case $r:return new b(+a);case Ln:return pM(a,m);case ht:case vl:case bl:case Ps:case Ho:case Ts:case vi:case As:case $c:return rE(a,m);case Zt:return new b;case jo:case Uo:return new b(a);case Xt:return hM(a);case wr:return new b;case yl:return mM(a)}}function PM(a,u){var m=u.length;if(!m)return a;var b=m-1;return u[b]=(m>1?"& ":"")+u[b],u=u.join(m>2?", ":" "),a.replace(er,`{
|
|
2
2
|
/* [wrapped with `+u+`] */
|
|
3
|
-
`)}function TM(a){return Ie(a)||ma(a)||!!(ch&&a&&a[ch])}function ss(a,u){var m=typeof a;return u=u??Pe,!!u&&(m=="number"||m!="symbol"&&$s.test(a))&&a>-1&&a%1==0&&a<u}function qr(a,u,m){if(!Pt(m))return!1;var b=typeof u;return(b=="number"?Lr(m)&&ss(u,m.length):b=="string"&&u in m)?Kn(m[u],a):!1}function yS(a,u){if(Ie(a))return!1;var m=typeof a;return m=="number"||m=="symbol"||m=="boolean"||a==null||on(a)?!0:De.test(a)||!Nr.test(a)||u!=null&&a in Je(u)}function AM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function vS(a){var u=Mh(a),m=q[u];if(typeof m!="function"||!(u in Le.prototype))return!1;if(a===m)return!0;var b=hS(m);return!!b&&a===b[0]}function $M(a){return!!ah&&ah in a}var NM=ta?os:MS;function hf(a){var u=a&&a.constructor,m=typeof u=="function"&&u.prototype||Us;return a===m}function wE(a){return a===a&&!Pt(a)}function _E(a,u){return function(m){return m==null?!1:m[a]===u&&(u!==t||a in Je(m))}}function MM(a){var u=Hh(a,function(b){return m.size===f&&m.clear(),b}),m=u.cache;return u}function FM(a,u){var m=a[1],b=u[1],x=m|b,P=x<(w|E|G),M=b==G&&m==T||b==G&&m==O&&a[7].length<=u[8]||b==(G|O)&&u[7].length<=u[8]&&m==T;if(!(P||M))return a;b&w&&(a[2]=u[2],x|=m&w?0:k);var U=u[3];if(U){var W=a[3];a[3]=W?iE(W,U,u[4]):U,a[4]=W?bn(a[3],c):u[4]}return U=u[5],U&&(W=a[5],a[5]=W?sE(W,U,u[6]):U,a[6]=W?bn(a[5],c):u[6]),U=u[7],U&&(a[7]=U),b&G&&(a[8]=a[8]==null?u[8]:Gt(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=x,a}function DM(a){var u=[];if(a!=null)for(var m in Je(a))u.push(m);return u}function LM(a){return Ll.call(a)}function RE(a,u,m){return u=Ct(u===t?a.length-1:u,0),function(){for(var b=arguments,x=-1,P=Ct(b.length-u,0),M=z(P);++x<P;)M[x]=b[u+x];x=-1;for(var U=z(u+1);++x<u;)U[x]=b[x];return U[u]=m(M),_r(a,this,U)}}function CE(a,u){return u.length<2?a:rs(a,Rn(u,0,-1))}function jM(a,u){for(var m=a.length,b=Gt(u.length,m),x=Dr(a);b--;){var P=u[b];a[b]=ss(P,m)?x[P]:t}return a}function bS(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var xE=IE(Gx),mf=_b||function(a,u){return Ut.setTimeout(a,u)},SS=IE(uM);function EE(a,u,m){var b=u+"";return SS(a,PM(b,UM(qM(b),m)))}function IE(a){var u=0,m=0;return function(){var b=dh(),x=F-(b-m);if(m=b,x>0){if(++u>=B)return arguments[0]}else u=0;return a.apply(t,arguments)}}function Dh(a,u){var m=-1,b=a.length,x=b-1;for(u=u===t?b:u;++m<u;){var P=rS(m,x),M=a[P];a[P]=a[m],a[m]=M}return a.length=u,a}var qE=MM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(Nc,function(m,b,x,P){u.push(x?P.replace(Un,"$1"):b||m)}),u});function Yn(a){if(typeof a=="string"||on(a))return a;var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function ha(a){if(a!=null){try{return Dl.call(a)}catch{}try{return a+""}catch{}}return""}function UM(a,u){return Rr(ce,function(m){var b="_."+m[0];u&m[1]&&!Pl(a,b)&&a.push(b)}),a.sort()}function OE(a){if(a instanceof Le)return a.clone();var u=new cr(a.__wrapped__,a.__chain__);return u.__actions__=Dr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function HM(a,u,m){(m?qr(a,u,m):u===t)?u=1:u=Ct(Oe(u),0);var b=a==null?0:a.length;if(!b||u<1)return[];for(var x=0,P=0,M=z(ia(b/u));x<b;)M[P++]=Rn(a,x,x+=u);return M}function BM(a){for(var u=-1,m=a==null?0:a.length,b=0,x=[];++u<m;){var P=a[u];P&&(x[b++]=P)}return x}function VM(){var a=arguments.length;if(!a)return[];for(var u=z(a-1),m=arguments[0],b=a;b--;)u[b-1]=arguments[b];return Si(Ie(m)?Dr(m):[m],Yt(u,1))}var WM=Me(function(a,u){return Dt(a)?ca(a,Yt(u,1,Dt,!0)):[]}),zM=Me(function(a,u){var m=Cn(u);return Dt(m)&&(m=t),Dt(a)?ca(a,Yt(u,1,Dt,!0),we(m,2)):[]}),JM=Me(function(a,u){var m=Cn(u);return Dt(m)&&(m=t),Dt(a)?ca(a,Yt(u,1,Dt,!0),t,m):[]});function GM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),Rn(a,u<0?0:u,b)):[]}function YM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,Rn(a,0,u<0?0:u)):[]}function KM(a,u){return a&&a.length?kh(a,we(u,3),!0,!0):[]}function QM(a,u){return a&&a.length?kh(a,we(u,3),!0):[]}function ZM(a,u,m,b){var x=a==null?0:a.length;return x?(m&&typeof m!="number"&&qr(a,u,m)&&(m=0,b=x),Yb(a,u,m,b)):[]}function kE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),Al(a,we(u,3),x)}function PE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b-1;return m!==t&&(x=Oe(m),x=m<0?Ct(b+x,0):Gt(x,b-1)),Al(a,we(u,3),x,!0)}function TE(a){var u=a==null?0:a.length;return u?Yt(a,1):[]}function XM(a){var u=a==null?0:a.length;return u?Yt(a,pe):[]}function eF(a,u){var m=a==null?0:a.length;return m?(u=u===t?1:Oe(u),Yt(a,u)):[]}function tF(a){for(var u=-1,m=a==null?0:a.length,b={};++u<m;){var x=a[u];rn(b,x[0],x[1])}return b}function AE(a){return a&&a.length?a[0]:t}function rF(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),Qi(a,u,x)}function nF(a){var u=a==null?0:a.length;return u?Rn(a,0,-1):[]}var iF=Me(function(a){var u=yt(a,aS);return u.length&&u[0]===a[0]?nn(u):[]}),sF=Me(function(a){var u=Cn(a),m=yt(a,aS);return u===Cn(m)?u=t:m.pop(),m.length&&m[0]===a[0]?nn(m,we(u,2)):[]}),oF=Me(function(a){var u=Cn(a),m=yt(a,aS);return u=typeof u=="function"?u:t,u&&m.pop(),m.length&&m[0]===a[0]?nn(m,t,u):[]});function aF(a,u){return a==null?"":Jl.call(a,u)}function Cn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function lF(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b;return m!==t&&(x=Oe(m),x=x<0?Ct(b+x,0):Gt(x,b-1)),u===u?ef(a,u,x):Al(a,Zi,x,!0)}function uF(a,u){return a&&a.length?Gn(a,Oe(u)):t}var cF=Me($E);function $E(a,u){return a&&a.length&&u&&u.length?tS(a,u):a}function fF(a,u,m){return a&&a.length&&u&&u.length?tS(a,u,we(m,2)):a}function dF(a,u,m){return a&&a.length&&u&&u.length?tS(a,u,t,m):a}var pF=is(function(a,u){var m=a==null?0:a.length,b=af(a,u);return Jx(a,yt(u,function(x){return ss(x,m)?+x:x}).sort(nE)),b});function hF(a,u){var m=[];if(!(a&&a.length))return m;var b=-1,x=[],P=a.length;for(u=we(u,3);++b<P;){var M=a[b];u(M,b,a)&&(m.push(M),x.push(b))}return Jx(a,x),m}function wS(a){return a==null?a:Cb.call(a)}function mF(a,u,m){var b=a==null?0:a.length;return b?(m&&typeof m!="number"&&qr(a,u,m)?(u=0,m=b):(u=u==null?0:Oe(u),m=m===t?b:Oe(m)),Rn(a,u,m)):[]}function gF(a,u){return Oh(a,u)}function yF(a,u,m){return iS(a,u,we(m,2))}function vF(a,u){var m=a==null?0:a.length;if(m){var b=Oh(a,u);if(b<m&&Kn(a[b],u))return b}return-1}function bF(a,u){return Oh(a,u,!0)}function SF(a,u,m){return iS(a,u,we(m,2),!0)}function wF(a,u){var m=a==null?0:a.length;if(m){var b=Oh(a,u,!0)-1;if(Kn(a[b],u))return b}return-1}function _F(a){return a&&a.length?Yx(a):[]}function RF(a,u){return a&&a.length?Yx(a,we(u,2)):[]}function CF(a){var u=a==null?0:a.length;return u?Rn(a,1,u):[]}function xF(a,u,m){return a&&a.length?(u=m||u===t?1:Oe(u),Rn(a,0,u<0?0:u)):[]}function EF(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,Rn(a,u<0?0:u,b)):[]}function IF(a,u){return a&&a.length?kh(a,we(u,3),!1,!0):[]}function qF(a,u){return a&&a.length?kh(a,we(u,3)):[]}var OF=Me(function(a){return Gs(Yt(a,1,Dt,!0))}),kF=Me(function(a){var u=Cn(a);return Dt(u)&&(u=t),Gs(Yt(a,1,Dt,!0),we(u,2))}),PF=Me(function(a){var u=Cn(a);return u=typeof u=="function"?u:t,Gs(Yt(a,1,Dt,!0),t,u)});function TF(a){return a&&a.length?Gs(a):[]}function AF(a,u){return a&&a.length?Gs(a,we(u,2)):[]}function $F(a,u){return u=typeof u=="function"?u:t,a&&a.length?Gs(a,t,u):[]}function _S(a){if(!(a&&a.length))return[];var u=0;return a=bi(a,function(m){if(Dt(m))return u=Ct(m.length,u),!0}),Zc(u,function(m){return yt(a,Qo(m))})}function NE(a,u){if(!(a&&a.length))return[];var m=_S(a);return u==null?m:yt(m,function(b){return _r(u,t,b)})}var NF=Me(function(a,u){return Dt(a)?ca(a,u):[]}),MF=Me(function(a){return oS(bi(a,Dt))}),FF=Me(function(a){var u=Cn(a);return Dt(u)&&(u=t),oS(bi(a,Dt),we(u,2))}),DF=Me(function(a){var u=Cn(a);return u=typeof u=="function"?u:t,oS(bi(a,Dt),t,u)}),LF=Me(_S);function jF(a,u){return Xx(a||[],u||[],Ir)}function UF(a,u){return Xx(a||[],u||[],df)}var HF=Me(function(a){var u=a.length,m=u>1?a[u-1]:t;return m=typeof m=="function"?(a.pop(),m):t,NE(a,m)});function ME(a){var u=q(a);return u.__chain__=!0,u}function BF(a,u){return u(a),a}function Lh(a,u){return u(a)}var VF=is(function(a){var u=a.length,m=u?a[0]:0,b=this.__wrapped__,x=function(P){return af(P,a)};return u>1||this.__actions__.length||!(b instanceof Le)||!ss(m)?this.thru(x):(b=b.slice(m,+m+(u?1:0)),b.__actions__.push({func:Lh,args:[x],thisArg:t}),new cr(b,this.__chain__).thru(function(P){return u&&!P.length&&P.push(t),P}))});function WF(){return ME(this)}function zF(){return new cr(this.value(),this.__chain__)}function JF(){this.__values__===t&&(this.__values__=KE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function GF(){return this}function YF(a){for(var u,m=this;m instanceof Kl;){var b=OE(m);b.__index__=0,b.__values__=t,u?x.__wrapped__=b:u=b;var x=b;m=m.__wrapped__}return x.__wrapped__=a,u}function KF(){var a=this.__wrapped__;if(a instanceof Le){var u=a;return this.__actions__.length&&(u=new Le(this)),u=u.reverse(),u.__actions__.push({func:Lh,args:[wS],thisArg:t}),new cr(u,this.__chain__)}return this.thru(wS)}function QF(){return Zx(this.__wrapped__,this.__actions__)}var ZF=Ph(function(a,u,m){at.call(a,m)?++a[m]:rn(a,m,1)});function XF(a,u,m){var b=Ie(a)?Xp:Gb;return m&&qr(a,u,m)&&(u=t),b(a,we(u,3))}function eD(a,u){var m=Ie(a)?bi:xh;return m(a,we(u,3))}var tD=uE(kE),rD=uE(PE);function nD(a,u){return Yt(jh(a,u),1)}function iD(a,u){return Yt(jh(a,u),pe)}function sD(a,u,m){return m=m===t?1:Oe(m),Yt(jh(a,u),m)}function FE(a,u){var m=Ie(a)?Rr:Ei;return m(a,we(u,3))}function DE(a,u){var m=Ie(a)?Gc:Ch;return m(a,we(u,3))}var oD=Ph(function(a,u,m){at.call(a,m)?a[m].push(u):rn(a,m,[u])});function aD(a,u,m,b){a=Lr(a)?a:su(a),m=m&&!b?Oe(m):0;var x=a.length;return m<0&&(m=Ct(x+m,0)),Wh(a)?m<=x&&a.indexOf(u,m)>-1:!!x&&Qi(a,u,m)>-1}var lD=Me(function(a,u,m){var b=-1,x=typeof u=="function",P=Lr(a)?z(a.length):[];return Ei(a,function(M){P[++b]=x?_r(u,M,m):fa(M,u,m)}),P}),uD=Ph(function(a,u,m){rn(a,m,u)});function jh(a,u){var m=Ie(a)?yt:ae;return m(a,we(u,3))}function cD(a,u,m,b){return a==null?[]:(Ie(u)||(u=u==null?[]:[u]),m=b?t:m,Ie(m)||(m=m==null?[]:[m]),Wx(a,u,m))}var fD=Ph(function(a,u,m){a[m?0:1].push(u)},function(){return[[],[]]});function dD(a,u,m){var b=Ie(a)?Yc:$l,x=arguments.length<3;return b(a,we(u,4),m,x,Ei)}function pD(a,u,m){var b=Ie(a)?Kv:$l,x=arguments.length<3;return b(a,we(u,4),m,x,Ch)}function hD(a,u){var m=Ie(a)?bi:xh;return m(a,Bh(we(u,3)))}function mD(a){var u=Ie(a)?wh:aM;return u(a)}function gD(a,u,m){(m?qr(a,u,m):u===t)?u=1:u=Oe(u);var b=Ie(a)?Vb:lM;return b(a,u)}function yD(a){var u=Ie(a)?Wb:cM;return u(a)}function vD(a){if(a==null)return 0;if(Lr(a))return Wh(a)?wi(a):a.length;var u=dr(a);return u==Zt||u==wr?a.size:I(a).length}function bD(a,u,m){var b=Ie(a)?Tl:fM;return m&&qr(a,u,m)&&(u=t),b(a,we(u,3))}var SD=Me(function(a,u){if(a==null)return[];var m=u.length;return m>1&&qr(a,u[0],u[1])?u=[]:m>2&&qr(u[0],u[1],u[2])&&(u=[u[0]]),Wx(a,Yt(u,1),[])}),Uh=wb||function(){return Ut.Date.now()};function wD(a,u){if(typeof u!="function")throw new Er(i);return a=Oe(a),function(){if(--a<1)return u.apply(this,arguments)}}function LE(a,u,m){return u=m?t:u,u=a&&u==null?a.length:u,ns(a,G,t,t,t,t,u)}function jE(a,u){var m;if(typeof u!="function")throw new Er(i);return a=Oe(a),function(){return--a>0&&(m=u.apply(this,arguments)),a<=1&&(u=t),m}}var RS=Me(function(a,u,m){var b=w;if(m.length){var x=bn(m,nu(RS));b|=$}return ns(a,b,u,m,x)}),UE=Me(function(a,u,m){var b=w|E;if(m.length){var x=bn(m,nu(UE));b|=$}return ns(u,b,a,m,x)});function HE(a,u,m){u=m?t:u;var b=ns(a,T,t,t,t,t,t,u);return b.placeholder=HE.placeholder,b}function BE(a,u,m){u=m?t:u;var b=ns(a,N,t,t,t,t,t,u);return b.placeholder=BE.placeholder,b}function VE(a,u,m){var b,x,P,M,U,W,Z=0,X=!1,te=!1,oe=!0;if(typeof a!="function")throw new Er(i);u=xn(u)||0,Pt(m)&&(X=!!m.leading,te="maxWait"in m,P=te?Ct(xn(m.maxWait)||0,u):P,oe="trailing"in m?!!m.trailing:oe);function he(Lt){var Qn=b,ls=x;return b=x=t,Z=Lt,M=a.apply(ls,Qn),M}function _e(Lt){return Z=Lt,U=mf(Ve,u),X?he(Lt):M}function Te(Lt){var Qn=Lt-W,ls=Lt-Z,cI=u-Qn;return te?Gt(cI,P-ls):cI}function Se(Lt){var Qn=Lt-W,ls=Lt-Z;return W===t||Qn>=u||Qn<0||te&&ls>=P}function Ve(){var Lt=Uh();if(Se(Lt))return Ge(Lt);U=mf(Ve,Te(Lt))}function Ge(Lt){return U=t,oe&&b?he(Lt):(b=x=t,M)}function an(){U!==t&&eE(U),Z=0,b=W=x=U=t}function Or(){return U===t?M:Ge(Uh())}function ln(){var Lt=Uh(),Qn=Se(Lt);if(b=arguments,x=this,W=Lt,Qn){if(U===t)return _e(W);if(te)return eE(U),U=mf(Ve,u),he(W)}return U===t&&(U=mf(Ve,u)),M}return ln.cancel=an,ln.flush=Or,ln}var _D=Me(function(a,u){return lf(a,1,u)}),RD=Me(function(a,u,m){return lf(a,xn(u)||0,m)});function CD(a){return ns(a,C)}function Hh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Er(i);var m=function(){var b=arguments,x=u?u.apply(this,b):b[0],P=m.cache;if(P.has(x))return P.get(x);var M=a.apply(this,b);return m.cache=P.set(x,M)||P,M};return m.cache=new(Hh.Cache||Wn),m}Hh.Cache=Wn;function Bh(a){if(typeof a!="function")throw new Er(i);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function xD(a){return jE(2,a)}var ED=dM(function(a,u){u=u.length==1&&Ie(u[0])?yt(u[0],Cr(we())):yt(Yt(u,1),Cr(we()));var m=u.length;return Me(function(b){for(var x=-1,P=Gt(b.length,m);++x<P;)b[x]=u[x].call(this,b[x]);return _r(a,this,b)})}),CS=Me(function(a,u){var m=bn(u,nu(CS));return ns(a,$,t,u,m)}),WE=Me(function(a,u){var m=bn(u,nu(WE));return ns(a,j,t,u,m)}),ID=is(function(a,u){return ns(a,O,t,t,t,u)});function qD(a,u){if(typeof a!="function")throw new Er(i);return u=u===t?u:Oe(u),Me(a,u)}function OD(a,u){if(typeof a!="function")throw new Er(i);return u=u==null?0:Ct(Oe(u),0),Me(function(m){var b=m[u],x=Ks(m,0,u);return b&&Si(x,b),_r(a,this,x)})}function kD(a,u,m){var b=!0,x=!0;if(typeof a!="function")throw new Er(i);return Pt(m)&&(b="leading"in m?!!m.leading:b,x="trailing"in m?!!m.trailing:x),VE(a,u,{leading:b,maxWait:u,trailing:x})}function PD(a){return LE(a,1)}function TD(a,u){return CS(lS(u),a)}function AD(){if(!arguments.length)return[];var a=arguments[0];return Ie(a)?a:[a]}function $D(a){return fr(a,g)}function ND(a,u){return u=typeof u=="function"?u:t,fr(a,g,u)}function MD(a){return fr(a,p|g)}function FD(a,u){return u=typeof u=="function"?u:t,fr(a,p|g,u)}function DD(a,u){return u==null||wn(a,u,tr(u))}function Kn(a,u){return a===u||a!==a&&u!==u}var LD=Nh(cf),jD=Nh(function(a,u){return a>=u}),ma=qh((function(){return arguments})())?qh:function(a){return At(a)&&at.call(a,"callee")&&!ra.call(a,"callee")},Ie=z.isArray,UD=Jc?Cr(Jc):Xb;function Lr(a){return a!=null&&Vh(a.length)&&!os(a)}function Dt(a){return At(a)&&Lr(a)}function HD(a){return a===!0||a===!1||At(a)&&nr(a)==en}var Qs=zl||MS,BD=Qp?Cr(Qp):eS;function VD(a){return At(a)&&a.nodeType===1&&!gf(a)}function WD(a){if(a==null)return!0;if(Lr(a)&&(Ie(a)||typeof a=="string"||typeof a.splice=="function"||Qs(a)||iu(a)||ma(a)))return!a.length;var u=dr(a);if(u==Zt||u==wr)return!a.size;if(hf(a))return!I(a).length;for(var m in a)if(at.call(a,m))return!1;return!0}function zD(a,u){return da(a,u)}function JD(a,u,m){m=typeof m=="function"?m:t;var b=m?m(a,u):t;return b===t?da(a,u,t,m):!!b}function xS(a){if(!At(a))return!1;var u=nr(a);return u==Rt||u==_t||typeof a.message=="string"&&typeof a.name=="string"&&!gf(a)}function GD(a){return typeof a=="number"&&es(a)}function os(a){if(!Pt(a))return!1;var u=nr(a);return u==mn||u==Lo||u==it||u==Tp}function zE(a){return typeof a=="number"&&a==Oe(a)}function Vh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=Pe}function Pt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function At(a){return a!=null&&typeof a=="object"}var JE=Zp?Cr(Zp):zs;function YD(a,u){return a===u||Js(a,u,mS(u))}function KD(a,u,m){return m=typeof m=="function"?m:t,Js(a,u,mS(u),m)}function QD(a){return GE(a)&&a!=+a}function ZD(a){if(NM(a))throw new Ce(n);return Be(a)}function XD(a){return a===null}function eL(a){return a==null}function GE(a){return typeof a=="number"||At(a)&&nr(a)==jo}function gf(a){if(!At(a)||nr(a)!=Dn)return!1;var u=Hl(a);if(u===null)return!0;var m=at.call(u,"constructor")&&u.constructor;return typeof m=="function"&&m instanceof m&&Dl.call(m)==yb}var ES=Ko?Cr(Ko):d;function tL(a){return zE(a)&&a>=-Pe&&a<=Pe}var YE=Hn?Cr(Hn):y;function Wh(a){return typeof a=="string"||!Ie(a)&&At(a)&&nr(a)==Uo}function on(a){return typeof a=="symbol"||At(a)&&nr(a)==yl}var iu=kl?Cr(kl):S;function rL(a){return a===t}function nL(a){return At(a)&&dr(a)==Jt}function iL(a){return At(a)&&nr(a)==$p}var sL=Nh(Y),oL=Nh(function(a,u){return a<=u});function KE(a){if(!a)return[];if(Lr(a))return Wh(a)?xr(a):Dr(a);if(na&&a[na])return ab(a[na]());var u=dr(a),m=u==Zt?js:u==wr?Ml:su;return m(a)}function as(a){if(!a)return a===0?a:0;if(a=xn(a),a===pe||a===-pe){var u=a<0?-1:1;return u*de}return a===a?a:0}function Oe(a){var u=as(a),m=u%1;return u===u?m?u-m:u:0}function QE(a){return a?xi(Oe(a),0,be):0}function xn(a){if(typeof a=="number")return a;if(on(a))return le;if(Pt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Pt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=Xc(a);var m=Wo.test(a);return m||Ev.test(a)?Gv(a.slice(2),m?2:8):xv.test(a)?le:+a}function ZE(a){return Ii(a,jr(a))}function aL(a){return a?xi(Oe(a),-Pe,Pe):a===0?a:0}function ft(a){return a==null?"":sn(a)}var lL=tu(function(a,u){if(hf(u)||Lr(u)){Ii(u,tr(u),a);return}for(var m in u)at.call(u,m)&&Ir(a,m,u[m])}),XE=tu(function(a,u){Ii(u,jr(u),a)}),eI=tu(function(a,u,m,b){Ii(u,jr(u),a,b)}),IS=tu(function(a,u,m,b){Ii(u,tr(u),a,b)}),uL=is(af);function cL(a,u){var m=Vs(a);return u==null?m:Rh(m,u)}var fL=Me(function(a,u){a=Je(a);var m=-1,b=u.length,x=b>2?u[2]:t;for(x&&qr(u[0],u[1],x)&&(b=1);++m<b;)for(var P=u[m],M=jr(P),U=-1,W=M.length;++U<W;){var Z=M[U],X=a[Z];(X===t||Kn(X,Us[Z])&&!at.call(a,Z))&&(a[Z]=P[Z])}return a}),dL=Me(function(a){return a.push(t,gE),_r(tI,t,a)});function pL(a,u){return eh(a,we(u,3),_n)}function hL(a,u){return eh(a,we(u,3),zn)}function mL(a,u){return a==null?a:uf(a,we(u,3),jr)}function gL(a,u){return a==null?a:Eh(a,we(u,3),jr)}function yL(a,u){return a&&_n(a,we(u,3))}function vL(a,u){return a&&zn(a,we(u,3))}function bL(a){return a==null?[]:eu(a,tr(a))}function SL(a){return a==null?[]:eu(a,jr(a))}function qS(a,u,m){var b=a==null?t:rs(a,u);return b===t?m:b}function wL(a,u){return a!=null&&bE(a,u,Kb)}function OS(a,u){return a!=null&&bE(a,u,Qb)}var _L=fE(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Ll.call(u)),a[u]=m},PS(Ur)),RL=fE(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Ll.call(u)),at.call(a,u)?a[u].push(m):a[u]=[m]},we),CL=Me(fa);function tr(a){return Lr(a)?Sh(a):I(a)}function jr(a){return Lr(a)?Sh(a,!0):L(a)}function xL(a,u){var m={};return u=we(u,3),_n(a,function(b,x,P){rn(m,u(b,x,P),b)}),m}function EL(a,u){var m={};return u=we(u,3),_n(a,function(b,x,P){rn(m,x,u(b,x,P))}),m}var IL=tu(function(a,u,m){Ht(a,u,m)}),tI=tu(function(a,u,m,b){Ht(a,u,m,b)}),qL=is(function(a,u){var m={};if(a==null)return m;var b=!1;u=yt(u,function(P){return P=Ys(P,a),b||(b=P.length>1),P}),Ii(a,pS(a),m),b&&(m=fr(m,p|h|g,RM));for(var x=u.length;x--;)sS(m,u[x]);return m});function OL(a,u){return rI(a,Bh(we(u)))}var kL=is(function(a,u){return a==null?{}:iM(a,u)});function rI(a,u){if(a==null)return{};var m=yt(pS(a),function(b){return[b]});return u=we(u),zx(a,m,function(b,x){return u(b,x[0])})}function PL(a,u,m){u=Ys(u,a);var b=-1,x=u.length;for(x||(x=1,a=t);++b<x;){var P=a==null?t:a[Yn(u[b])];P===t&&(b=x,P=m),a=os(P)?P.call(a):P}return a}function TL(a,u,m){return a==null?a:df(a,u,m)}function AL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:df(a,u,m,b)}var nI=hE(tr),iI=hE(jr);function $L(a,u,m){var b=Ie(a),x=b||Qs(a)||iu(a);if(u=we(u,4),m==null){var P=a&&a.constructor;x?m=b?new P:[]:Pt(a)?m=os(P)?Vs(Hl(a)):{}:m={}}return(x?Rr:_n)(a,function(M,U,W){return u(m,M,U,W)}),m}function NL(a,u){return a==null?!0:sS(a,u)}function ML(a,u,m){return a==null?a:Qx(a,u,lS(m))}function FL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Qx(a,u,lS(m),b)}function su(a){return a==null?[]:Nl(a,tr(a))}function DL(a){return a==null?[]:Nl(a,jr(a))}function LL(a,u,m){return m===t&&(m=u,u=t),m!==t&&(m=xn(m),m=m===m?m:0),u!==t&&(u=xn(u),u=u===u?u:0),xi(xn(a),u,m)}function jL(a,u,m){return u=as(u),m===t?(m=u,u=0):m=as(m),a=xn(a),Zb(a,u,m)}function UL(a,u,m){if(m&&typeof m!="boolean"&&qr(a,u,m)&&(u=m=t),m===t&&(typeof u=="boolean"?(m=u,u=t):typeof a=="boolean"&&(m=a,a=t)),a===t&&u===t?(a=0,u=1):(a=as(a),u===t?(u=a,a=0):u=as(u)),a>u){var b=a;a=u,u=b}if(m||a%1||u%1){var x=ph();return Gt(a+x*(u-a+Yp("1e-"+((x+"").length-1))),u)}return rS(a,u)}var HL=ru(function(a,u,m){return u=u.toLowerCase(),a+(m?sI(u):u)});function sI(a){return kS(ft(a).toLowerCase())}function oI(a){return a=ft(a),a&&a.replace(zo,nb).replace(Uv,"")}function BL(a,u,m){a=ft(a),u=sn(u);var b=a.length;m=m===t?b:xi(Oe(m),0,b);var x=m;return m-=u.length,m>=0&&a.slice(m,x)==u}function VL(a){return a=ft(a),a&&fe.test(a)?a.replace(wl,ib):a}function WL(a){return a=ft(a),a&&Vo.test(a)?a.replace(st,"\\$&"):a}var zL=ru(function(a,u,m){return a+(m?"-":"")+u.toLowerCase()}),JL=ru(function(a,u,m){return a+(m?" ":"")+u.toLowerCase()}),GL=lE("toLowerCase");function YL(a,u,m){a=ft(a),u=Oe(u);var b=u?wi(a):0;if(!u||b>=u)return a;var x=(u-b)/2;return $h(sa(x),m)+a+$h(ia(x),m)}function KL(a,u,m){a=ft(a),u=Oe(u);var b=u?wi(a):0;return u&&b<u?a+$h(u-b,m):a}function QL(a,u,m){a=ft(a),u=Oe(u);var b=u?wi(a):0;return u&&b<u?$h(u-b,m)+a:a}function ZL(a,u,m){return m||u==null?u=0:u&&(u=+u),Rb(ft(a).replace(Mc,""),u||0)}function XL(a,u,m){return(m?qr(a,u,m):u===t)?u=1:u=Oe(u),nS(ft(a),u)}function ej(){var a=arguments,u=ft(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var tj=ru(function(a,u,m){return a+(m?"_":"")+u.toLowerCase()});function rj(a,u,m){return m&&typeof m!="number"&&qr(a,u,m)&&(u=m=t),m=m===t?be:m>>>0,m?(a=ft(a),a&&(typeof u=="string"||u!=null&&!ES(u))&&(u=sn(u),!u&&Ls(a))?Ks(xr(a),0,m):a.split(u,m)):[]}var nj=ru(function(a,u,m){return a+(m?" ":"")+kS(u)});function ij(a,u,m){return a=ft(a),m=m==null?0:xi(Oe(m),0,a.length),u=sn(u),a.slice(m,m+u.length)==u}function sj(a,u,m){var b=q.templateSettings;m&&qr(a,u,m)&&(u=t),a=ft(a),u=IS({},u,b,mE);var x=IS({},u.imports,b.imports,mE),P=tr(x),M=Nl(x,P);Rr(P,function(Se){if(Mr.test(Se))throw new Ce(o)});var U,W,Z=0,X=u.interpolate||Jo,te="__p += '",oe=Fl((u.escape||Jo).source+"|"+X.source+"|"+(X===gn?Yi:Jo).source+"|"+(u.evaluate||Jo).source+"|$","g"),he="//# sourceURL="+(at.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++zv+"]")+`
|
|
4
|
-
`;a.replace(oe,function(Se,Ve,Ge,an,
|
|
3
|
+
`)}function TM(a){return Ie(a)||ma(a)||!!(ch&&a&&a[ch])}function ss(a,u){var m=typeof a;return u=u??Pe,!!u&&(m=="number"||m!="symbol"&&$s.test(a))&&a>-1&&a%1==0&&a<u}function Or(a,u,m){if(!Pt(m))return!1;var b=typeof u;return(b=="number"?Lr(m)&&ss(u,m.length):b=="string"&&u in m)?Kn(m[u],a):!1}function yS(a,u){if(Ie(a))return!1;var m=typeof a;return m=="number"||m=="symbol"||m=="boolean"||a==null||on(a)?!0:De.test(a)||!Nr.test(a)||u!=null&&a in Je(u)}function AM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function vS(a){var u=Mh(a),m=O[u];if(typeof m!="function"||!(u in Le.prototype))return!1;if(a===m)return!0;var b=hS(m);return!!b&&a===b[0]}function $M(a){return!!ah&&ah in a}var NM=ta?os:MS;function hf(a){var u=a&&a.constructor,m=typeof u=="function"&&u.prototype||Us;return a===m}function wE(a){return a===a&&!Pt(a)}function _E(a,u){return function(m){return m==null?!1:m[a]===u&&(u!==t||a in Je(m))}}function MM(a){var u=Hh(a,function(b){return m.size===f&&m.clear(),b}),m=u.cache;return u}function FM(a,u){var m=a[1],b=u[1],x=m|b,P=x<(w|E|G),M=b==G&&m==T||b==G&&m==q&&a[7].length<=u[8]||b==(G|q)&&u[7].length<=u[8]&&m==T;if(!(P||M))return a;b&w&&(a[2]=u[2],x|=m&w?0:k);var U=u[3];if(U){var W=a[3];a[3]=W?iE(W,U,u[4]):U,a[4]=W?bn(a[3],c):u[4]}return U=u[5],U&&(W=a[5],a[5]=W?sE(W,U,u[6]):U,a[6]=W?bn(a[5],c):u[6]),U=u[7],U&&(a[7]=U),b&G&&(a[8]=a[8]==null?u[8]:Gt(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=x,a}function DM(a){var u=[];if(a!=null)for(var m in Je(a))u.push(m);return u}function LM(a){return Ll.call(a)}function RE(a,u,m){return u=Ct(u===t?a.length-1:u,0),function(){for(var b=arguments,x=-1,P=Ct(b.length-u,0),M=z(P);++x<P;)M[x]=b[u+x];x=-1;for(var U=z(u+1);++x<u;)U[x]=b[x];return U[u]=m(M),_r(a,this,U)}}function CE(a,u){return u.length<2?a:rs(a,Rn(u,0,-1))}function jM(a,u){for(var m=a.length,b=Gt(u.length,m),x=Dr(a);b--;){var P=u[b];a[b]=ss(P,m)?x[P]:t}return a}function bS(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var xE=IE(Gx),mf=_b||function(a,u){return Ut.setTimeout(a,u)},SS=IE(uM);function EE(a,u,m){var b=u+"";return SS(a,PM(b,UM(OM(b),m)))}function IE(a){var u=0,m=0;return function(){var b=dh(),x=F-(b-m);if(m=b,x>0){if(++u>=B)return arguments[0]}else u=0;return a.apply(t,arguments)}}function Dh(a,u){var m=-1,b=a.length,x=b-1;for(u=u===t?b:u;++m<u;){var P=rS(m,x),M=a[P];a[P]=a[m],a[m]=M}return a.length=u,a}var OE=MM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(Nc,function(m,b,x,P){u.push(x?P.replace(Un,"$1"):b||m)}),u});function Yn(a){if(typeof a=="string"||on(a))return a;var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function ha(a){if(a!=null){try{return Dl.call(a)}catch{}try{return a+""}catch{}}return""}function UM(a,u){return Rr(ce,function(m){var b="_."+m[0];u&m[1]&&!Pl(a,b)&&a.push(b)}),a.sort()}function qE(a){if(a instanceof Le)return a.clone();var u=new cr(a.__wrapped__,a.__chain__);return u.__actions__=Dr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function HM(a,u,m){(m?Or(a,u,m):u===t)?u=1:u=Ct(qe(u),0);var b=a==null?0:a.length;if(!b||u<1)return[];for(var x=0,P=0,M=z(ia(b/u));x<b;)M[P++]=Rn(a,x,x+=u);return M}function BM(a){for(var u=-1,m=a==null?0:a.length,b=0,x=[];++u<m;){var P=a[u];P&&(x[b++]=P)}return x}function VM(){var a=arguments.length;if(!a)return[];for(var u=z(a-1),m=arguments[0],b=a;b--;)u[b-1]=arguments[b];return Si(Ie(m)?Dr(m):[m],Yt(u,1))}var WM=Me(function(a,u){return Dt(a)?ca(a,Yt(u,1,Dt,!0)):[]}),zM=Me(function(a,u){var m=Cn(u);return Dt(m)&&(m=t),Dt(a)?ca(a,Yt(u,1,Dt,!0),we(m,2)):[]}),JM=Me(function(a,u){var m=Cn(u);return Dt(m)&&(m=t),Dt(a)?ca(a,Yt(u,1,Dt,!0),t,m):[]});function GM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:qe(u),Rn(a,u<0?0:u,b)):[]}function YM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:qe(u),u=b-u,Rn(a,0,u<0?0:u)):[]}function KM(a,u){return a&&a.length?kh(a,we(u,3),!0,!0):[]}function QM(a,u){return a&&a.length?kh(a,we(u,3),!0):[]}function ZM(a,u,m,b){var x=a==null?0:a.length;return x?(m&&typeof m!="number"&&Or(a,u,m)&&(m=0,b=x),Yb(a,u,m,b)):[]}function kE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:qe(m);return x<0&&(x=Ct(b+x,0)),Al(a,we(u,3),x)}function PE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b-1;return m!==t&&(x=qe(m),x=m<0?Ct(b+x,0):Gt(x,b-1)),Al(a,we(u,3),x,!0)}function TE(a){var u=a==null?0:a.length;return u?Yt(a,1):[]}function XM(a){var u=a==null?0:a.length;return u?Yt(a,pe):[]}function eF(a,u){var m=a==null?0:a.length;return m?(u=u===t?1:qe(u),Yt(a,u)):[]}function tF(a){for(var u=-1,m=a==null?0:a.length,b={};++u<m;){var x=a[u];rn(b,x[0],x[1])}return b}function AE(a){return a&&a.length?a[0]:t}function rF(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:qe(m);return x<0&&(x=Ct(b+x,0)),Qi(a,u,x)}function nF(a){var u=a==null?0:a.length;return u?Rn(a,0,-1):[]}var iF=Me(function(a){var u=yt(a,aS);return u.length&&u[0]===a[0]?nn(u):[]}),sF=Me(function(a){var u=Cn(a),m=yt(a,aS);return u===Cn(m)?u=t:m.pop(),m.length&&m[0]===a[0]?nn(m,we(u,2)):[]}),oF=Me(function(a){var u=Cn(a),m=yt(a,aS);return u=typeof u=="function"?u:t,u&&m.pop(),m.length&&m[0]===a[0]?nn(m,t,u):[]});function aF(a,u){return a==null?"":Jl.call(a,u)}function Cn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function lF(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b;return m!==t&&(x=qe(m),x=x<0?Ct(b+x,0):Gt(x,b-1)),u===u?ef(a,u,x):Al(a,Zi,x,!0)}function uF(a,u){return a&&a.length?Gn(a,qe(u)):t}var cF=Me($E);function $E(a,u){return a&&a.length&&u&&u.length?tS(a,u):a}function fF(a,u,m){return a&&a.length&&u&&u.length?tS(a,u,we(m,2)):a}function dF(a,u,m){return a&&a.length&&u&&u.length?tS(a,u,t,m):a}var pF=is(function(a,u){var m=a==null?0:a.length,b=af(a,u);return Jx(a,yt(u,function(x){return ss(x,m)?+x:x}).sort(nE)),b});function hF(a,u){var m=[];if(!(a&&a.length))return m;var b=-1,x=[],P=a.length;for(u=we(u,3);++b<P;){var M=a[b];u(M,b,a)&&(m.push(M),x.push(b))}return Jx(a,x),m}function wS(a){return a==null?a:Cb.call(a)}function mF(a,u,m){var b=a==null?0:a.length;return b?(m&&typeof m!="number"&&Or(a,u,m)?(u=0,m=b):(u=u==null?0:qe(u),m=m===t?b:qe(m)),Rn(a,u,m)):[]}function gF(a,u){return qh(a,u)}function yF(a,u,m){return iS(a,u,we(m,2))}function vF(a,u){var m=a==null?0:a.length;if(m){var b=qh(a,u);if(b<m&&Kn(a[b],u))return b}return-1}function bF(a,u){return qh(a,u,!0)}function SF(a,u,m){return iS(a,u,we(m,2),!0)}function wF(a,u){var m=a==null?0:a.length;if(m){var b=qh(a,u,!0)-1;if(Kn(a[b],u))return b}return-1}function _F(a){return a&&a.length?Yx(a):[]}function RF(a,u){return a&&a.length?Yx(a,we(u,2)):[]}function CF(a){var u=a==null?0:a.length;return u?Rn(a,1,u):[]}function xF(a,u,m){return a&&a.length?(u=m||u===t?1:qe(u),Rn(a,0,u<0?0:u)):[]}function EF(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:qe(u),u=b-u,Rn(a,u<0?0:u,b)):[]}function IF(a,u){return a&&a.length?kh(a,we(u,3),!1,!0):[]}function OF(a,u){return a&&a.length?kh(a,we(u,3)):[]}var qF=Me(function(a){return Gs(Yt(a,1,Dt,!0))}),kF=Me(function(a){var u=Cn(a);return Dt(u)&&(u=t),Gs(Yt(a,1,Dt,!0),we(u,2))}),PF=Me(function(a){var u=Cn(a);return u=typeof u=="function"?u:t,Gs(Yt(a,1,Dt,!0),t,u)});function TF(a){return a&&a.length?Gs(a):[]}function AF(a,u){return a&&a.length?Gs(a,we(u,2)):[]}function $F(a,u){return u=typeof u=="function"?u:t,a&&a.length?Gs(a,t,u):[]}function _S(a){if(!(a&&a.length))return[];var u=0;return a=bi(a,function(m){if(Dt(m))return u=Ct(m.length,u),!0}),Zc(u,function(m){return yt(a,Qo(m))})}function NE(a,u){if(!(a&&a.length))return[];var m=_S(a);return u==null?m:yt(m,function(b){return _r(u,t,b)})}var NF=Me(function(a,u){return Dt(a)?ca(a,u):[]}),MF=Me(function(a){return oS(bi(a,Dt))}),FF=Me(function(a){var u=Cn(a);return Dt(u)&&(u=t),oS(bi(a,Dt),we(u,2))}),DF=Me(function(a){var u=Cn(a);return u=typeof u=="function"?u:t,oS(bi(a,Dt),t,u)}),LF=Me(_S);function jF(a,u){return Xx(a||[],u||[],Ir)}function UF(a,u){return Xx(a||[],u||[],df)}var HF=Me(function(a){var u=a.length,m=u>1?a[u-1]:t;return m=typeof m=="function"?(a.pop(),m):t,NE(a,m)});function ME(a){var u=O(a);return u.__chain__=!0,u}function BF(a,u){return u(a),a}function Lh(a,u){return u(a)}var VF=is(function(a){var u=a.length,m=u?a[0]:0,b=this.__wrapped__,x=function(P){return af(P,a)};return u>1||this.__actions__.length||!(b instanceof Le)||!ss(m)?this.thru(x):(b=b.slice(m,+m+(u?1:0)),b.__actions__.push({func:Lh,args:[x],thisArg:t}),new cr(b,this.__chain__).thru(function(P){return u&&!P.length&&P.push(t),P}))});function WF(){return ME(this)}function zF(){return new cr(this.value(),this.__chain__)}function JF(){this.__values__===t&&(this.__values__=KE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function GF(){return this}function YF(a){for(var u,m=this;m instanceof Kl;){var b=qE(m);b.__index__=0,b.__values__=t,u?x.__wrapped__=b:u=b;var x=b;m=m.__wrapped__}return x.__wrapped__=a,u}function KF(){var a=this.__wrapped__;if(a instanceof Le){var u=a;return this.__actions__.length&&(u=new Le(this)),u=u.reverse(),u.__actions__.push({func:Lh,args:[wS],thisArg:t}),new cr(u,this.__chain__)}return this.thru(wS)}function QF(){return Zx(this.__wrapped__,this.__actions__)}var ZF=Ph(function(a,u,m){at.call(a,m)?++a[m]:rn(a,m,1)});function XF(a,u,m){var b=Ie(a)?Xp:Gb;return m&&Or(a,u,m)&&(u=t),b(a,we(u,3))}function eD(a,u){var m=Ie(a)?bi:xh;return m(a,we(u,3))}var tD=uE(kE),rD=uE(PE);function nD(a,u){return Yt(jh(a,u),1)}function iD(a,u){return Yt(jh(a,u),pe)}function sD(a,u,m){return m=m===t?1:qe(m),Yt(jh(a,u),m)}function FE(a,u){var m=Ie(a)?Rr:Ei;return m(a,we(u,3))}function DE(a,u){var m=Ie(a)?Gc:Ch;return m(a,we(u,3))}var oD=Ph(function(a,u,m){at.call(a,m)?a[m].push(u):rn(a,m,[u])});function aD(a,u,m,b){a=Lr(a)?a:su(a),m=m&&!b?qe(m):0;var x=a.length;return m<0&&(m=Ct(x+m,0)),Wh(a)?m<=x&&a.indexOf(u,m)>-1:!!x&&Qi(a,u,m)>-1}var lD=Me(function(a,u,m){var b=-1,x=typeof u=="function",P=Lr(a)?z(a.length):[];return Ei(a,function(M){P[++b]=x?_r(u,M,m):fa(M,u,m)}),P}),uD=Ph(function(a,u,m){rn(a,m,u)});function jh(a,u){var m=Ie(a)?yt:ae;return m(a,we(u,3))}function cD(a,u,m,b){return a==null?[]:(Ie(u)||(u=u==null?[]:[u]),m=b?t:m,Ie(m)||(m=m==null?[]:[m]),Wx(a,u,m))}var fD=Ph(function(a,u,m){a[m?0:1].push(u)},function(){return[[],[]]});function dD(a,u,m){var b=Ie(a)?Yc:$l,x=arguments.length<3;return b(a,we(u,4),m,x,Ei)}function pD(a,u,m){var b=Ie(a)?Kv:$l,x=arguments.length<3;return b(a,we(u,4),m,x,Ch)}function hD(a,u){var m=Ie(a)?bi:xh;return m(a,Bh(we(u,3)))}function mD(a){var u=Ie(a)?wh:aM;return u(a)}function gD(a,u,m){(m?Or(a,u,m):u===t)?u=1:u=qe(u);var b=Ie(a)?Vb:lM;return b(a,u)}function yD(a){var u=Ie(a)?Wb:cM;return u(a)}function vD(a){if(a==null)return 0;if(Lr(a))return Wh(a)?wi(a):a.length;var u=dr(a);return u==Zt||u==wr?a.size:I(a).length}function bD(a,u,m){var b=Ie(a)?Tl:fM;return m&&Or(a,u,m)&&(u=t),b(a,we(u,3))}var SD=Me(function(a,u){if(a==null)return[];var m=u.length;return m>1&&Or(a,u[0],u[1])?u=[]:m>2&&Or(u[0],u[1],u[2])&&(u=[u[0]]),Wx(a,Yt(u,1),[])}),Uh=wb||function(){return Ut.Date.now()};function wD(a,u){if(typeof u!="function")throw new Er(i);return a=qe(a),function(){if(--a<1)return u.apply(this,arguments)}}function LE(a,u,m){return u=m?t:u,u=a&&u==null?a.length:u,ns(a,G,t,t,t,t,u)}function jE(a,u){var m;if(typeof u!="function")throw new Er(i);return a=qe(a),function(){return--a>0&&(m=u.apply(this,arguments)),a<=1&&(u=t),m}}var RS=Me(function(a,u,m){var b=w;if(m.length){var x=bn(m,nu(RS));b|=$}return ns(a,b,u,m,x)}),UE=Me(function(a,u,m){var b=w|E;if(m.length){var x=bn(m,nu(UE));b|=$}return ns(u,b,a,m,x)});function HE(a,u,m){u=m?t:u;var b=ns(a,T,t,t,t,t,t,u);return b.placeholder=HE.placeholder,b}function BE(a,u,m){u=m?t:u;var b=ns(a,N,t,t,t,t,t,u);return b.placeholder=BE.placeholder,b}function VE(a,u,m){var b,x,P,M,U,W,Z=0,X=!1,te=!1,oe=!0;if(typeof a!="function")throw new Er(i);u=xn(u)||0,Pt(m)&&(X=!!m.leading,te="maxWait"in m,P=te?Ct(xn(m.maxWait)||0,u):P,oe="trailing"in m?!!m.trailing:oe);function he(Lt){var Qn=b,ls=x;return b=x=t,Z=Lt,M=a.apply(ls,Qn),M}function _e(Lt){return Z=Lt,U=mf(Ve,u),X?he(Lt):M}function Te(Lt){var Qn=Lt-W,ls=Lt-Z,cI=u-Qn;return te?Gt(cI,P-ls):cI}function Se(Lt){var Qn=Lt-W,ls=Lt-Z;return W===t||Qn>=u||Qn<0||te&&ls>=P}function Ve(){var Lt=Uh();if(Se(Lt))return Ge(Lt);U=mf(Ve,Te(Lt))}function Ge(Lt){return U=t,oe&&b?he(Lt):(b=x=t,M)}function an(){U!==t&&eE(U),Z=0,b=W=x=U=t}function qr(){return U===t?M:Ge(Uh())}function ln(){var Lt=Uh(),Qn=Se(Lt);if(b=arguments,x=this,W=Lt,Qn){if(U===t)return _e(W);if(te)return eE(U),U=mf(Ve,u),he(W)}return U===t&&(U=mf(Ve,u)),M}return ln.cancel=an,ln.flush=qr,ln}var _D=Me(function(a,u){return lf(a,1,u)}),RD=Me(function(a,u,m){return lf(a,xn(u)||0,m)});function CD(a){return ns(a,C)}function Hh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Er(i);var m=function(){var b=arguments,x=u?u.apply(this,b):b[0],P=m.cache;if(P.has(x))return P.get(x);var M=a.apply(this,b);return m.cache=P.set(x,M)||P,M};return m.cache=new(Hh.Cache||Wn),m}Hh.Cache=Wn;function Bh(a){if(typeof a!="function")throw new Er(i);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function xD(a){return jE(2,a)}var ED=dM(function(a,u){u=u.length==1&&Ie(u[0])?yt(u[0],Cr(we())):yt(Yt(u,1),Cr(we()));var m=u.length;return Me(function(b){for(var x=-1,P=Gt(b.length,m);++x<P;)b[x]=u[x].call(this,b[x]);return _r(a,this,b)})}),CS=Me(function(a,u){var m=bn(u,nu(CS));return ns(a,$,t,u,m)}),WE=Me(function(a,u){var m=bn(u,nu(WE));return ns(a,j,t,u,m)}),ID=is(function(a,u){return ns(a,q,t,t,t,u)});function OD(a,u){if(typeof a!="function")throw new Er(i);return u=u===t?u:qe(u),Me(a,u)}function qD(a,u){if(typeof a!="function")throw new Er(i);return u=u==null?0:Ct(qe(u),0),Me(function(m){var b=m[u],x=Ks(m,0,u);return b&&Si(x,b),_r(a,this,x)})}function kD(a,u,m){var b=!0,x=!0;if(typeof a!="function")throw new Er(i);return Pt(m)&&(b="leading"in m?!!m.leading:b,x="trailing"in m?!!m.trailing:x),VE(a,u,{leading:b,maxWait:u,trailing:x})}function PD(a){return LE(a,1)}function TD(a,u){return CS(lS(u),a)}function AD(){if(!arguments.length)return[];var a=arguments[0];return Ie(a)?a:[a]}function $D(a){return fr(a,g)}function ND(a,u){return u=typeof u=="function"?u:t,fr(a,g,u)}function MD(a){return fr(a,p|g)}function FD(a,u){return u=typeof u=="function"?u:t,fr(a,p|g,u)}function DD(a,u){return u==null||wn(a,u,tr(u))}function Kn(a,u){return a===u||a!==a&&u!==u}var LD=Nh(cf),jD=Nh(function(a,u){return a>=u}),ma=Oh((function(){return arguments})())?Oh:function(a){return At(a)&&at.call(a,"callee")&&!ra.call(a,"callee")},Ie=z.isArray,UD=Jc?Cr(Jc):Xb;function Lr(a){return a!=null&&Vh(a.length)&&!os(a)}function Dt(a){return At(a)&&Lr(a)}function HD(a){return a===!0||a===!1||At(a)&&nr(a)==en}var Qs=zl||MS,BD=Qp?Cr(Qp):eS;function VD(a){return At(a)&&a.nodeType===1&&!gf(a)}function WD(a){if(a==null)return!0;if(Lr(a)&&(Ie(a)||typeof a=="string"||typeof a.splice=="function"||Qs(a)||iu(a)||ma(a)))return!a.length;var u=dr(a);if(u==Zt||u==wr)return!a.size;if(hf(a))return!I(a).length;for(var m in a)if(at.call(a,m))return!1;return!0}function zD(a,u){return da(a,u)}function JD(a,u,m){m=typeof m=="function"?m:t;var b=m?m(a,u):t;return b===t?da(a,u,t,m):!!b}function xS(a){if(!At(a))return!1;var u=nr(a);return u==Rt||u==_t||typeof a.message=="string"&&typeof a.name=="string"&&!gf(a)}function GD(a){return typeof a=="number"&&es(a)}function os(a){if(!Pt(a))return!1;var u=nr(a);return u==mn||u==Lo||u==it||u==Tp}function zE(a){return typeof a=="number"&&a==qe(a)}function Vh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=Pe}function Pt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function At(a){return a!=null&&typeof a=="object"}var JE=Zp?Cr(Zp):zs;function YD(a,u){return a===u||Js(a,u,mS(u))}function KD(a,u,m){return m=typeof m=="function"?m:t,Js(a,u,mS(u),m)}function QD(a){return GE(a)&&a!=+a}function ZD(a){if(NM(a))throw new Ce(n);return Be(a)}function XD(a){return a===null}function eL(a){return a==null}function GE(a){return typeof a=="number"||At(a)&&nr(a)==jo}function gf(a){if(!At(a)||nr(a)!=Dn)return!1;var u=Hl(a);if(u===null)return!0;var m=at.call(u,"constructor")&&u.constructor;return typeof m=="function"&&m instanceof m&&Dl.call(m)==yb}var ES=Ko?Cr(Ko):d;function tL(a){return zE(a)&&a>=-Pe&&a<=Pe}var YE=Hn?Cr(Hn):y;function Wh(a){return typeof a=="string"||!Ie(a)&&At(a)&&nr(a)==Uo}function on(a){return typeof a=="symbol"||At(a)&&nr(a)==yl}var iu=kl?Cr(kl):S;function rL(a){return a===t}function nL(a){return At(a)&&dr(a)==Jt}function iL(a){return At(a)&&nr(a)==$p}var sL=Nh(Y),oL=Nh(function(a,u){return a<=u});function KE(a){if(!a)return[];if(Lr(a))return Wh(a)?xr(a):Dr(a);if(na&&a[na])return ab(a[na]());var u=dr(a),m=u==Zt?js:u==wr?Ml:su;return m(a)}function as(a){if(!a)return a===0?a:0;if(a=xn(a),a===pe||a===-pe){var u=a<0?-1:1;return u*de}return a===a?a:0}function qe(a){var u=as(a),m=u%1;return u===u?m?u-m:u:0}function QE(a){return a?xi(qe(a),0,be):0}function xn(a){if(typeof a=="number")return a;if(on(a))return le;if(Pt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Pt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=Xc(a);var m=Wo.test(a);return m||Ev.test(a)?Gv(a.slice(2),m?2:8):xv.test(a)?le:+a}function ZE(a){return Ii(a,jr(a))}function aL(a){return a?xi(qe(a),-Pe,Pe):a===0?a:0}function ft(a){return a==null?"":sn(a)}var lL=tu(function(a,u){if(hf(u)||Lr(u)){Ii(u,tr(u),a);return}for(var m in u)at.call(u,m)&&Ir(a,m,u[m])}),XE=tu(function(a,u){Ii(u,jr(u),a)}),eI=tu(function(a,u,m,b){Ii(u,jr(u),a,b)}),IS=tu(function(a,u,m,b){Ii(u,tr(u),a,b)}),uL=is(af);function cL(a,u){var m=Vs(a);return u==null?m:Rh(m,u)}var fL=Me(function(a,u){a=Je(a);var m=-1,b=u.length,x=b>2?u[2]:t;for(x&&Or(u[0],u[1],x)&&(b=1);++m<b;)for(var P=u[m],M=jr(P),U=-1,W=M.length;++U<W;){var Z=M[U],X=a[Z];(X===t||Kn(X,Us[Z])&&!at.call(a,Z))&&(a[Z]=P[Z])}return a}),dL=Me(function(a){return a.push(t,gE),_r(tI,t,a)});function pL(a,u){return eh(a,we(u,3),_n)}function hL(a,u){return eh(a,we(u,3),zn)}function mL(a,u){return a==null?a:uf(a,we(u,3),jr)}function gL(a,u){return a==null?a:Eh(a,we(u,3),jr)}function yL(a,u){return a&&_n(a,we(u,3))}function vL(a,u){return a&&zn(a,we(u,3))}function bL(a){return a==null?[]:eu(a,tr(a))}function SL(a){return a==null?[]:eu(a,jr(a))}function OS(a,u,m){var b=a==null?t:rs(a,u);return b===t?m:b}function wL(a,u){return a!=null&&bE(a,u,Kb)}function qS(a,u){return a!=null&&bE(a,u,Qb)}var _L=fE(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Ll.call(u)),a[u]=m},PS(Ur)),RL=fE(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Ll.call(u)),at.call(a,u)?a[u].push(m):a[u]=[m]},we),CL=Me(fa);function tr(a){return Lr(a)?Sh(a):I(a)}function jr(a){return Lr(a)?Sh(a,!0):L(a)}function xL(a,u){var m={};return u=we(u,3),_n(a,function(b,x,P){rn(m,u(b,x,P),b)}),m}function EL(a,u){var m={};return u=we(u,3),_n(a,function(b,x,P){rn(m,x,u(b,x,P))}),m}var IL=tu(function(a,u,m){Ht(a,u,m)}),tI=tu(function(a,u,m,b){Ht(a,u,m,b)}),OL=is(function(a,u){var m={};if(a==null)return m;var b=!1;u=yt(u,function(P){return P=Ys(P,a),b||(b=P.length>1),P}),Ii(a,pS(a),m),b&&(m=fr(m,p|h|g,RM));for(var x=u.length;x--;)sS(m,u[x]);return m});function qL(a,u){return rI(a,Bh(we(u)))}var kL=is(function(a,u){return a==null?{}:iM(a,u)});function rI(a,u){if(a==null)return{};var m=yt(pS(a),function(b){return[b]});return u=we(u),zx(a,m,function(b,x){return u(b,x[0])})}function PL(a,u,m){u=Ys(u,a);var b=-1,x=u.length;for(x||(x=1,a=t);++b<x;){var P=a==null?t:a[Yn(u[b])];P===t&&(b=x,P=m),a=os(P)?P.call(a):P}return a}function TL(a,u,m){return a==null?a:df(a,u,m)}function AL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:df(a,u,m,b)}var nI=hE(tr),iI=hE(jr);function $L(a,u,m){var b=Ie(a),x=b||Qs(a)||iu(a);if(u=we(u,4),m==null){var P=a&&a.constructor;x?m=b?new P:[]:Pt(a)?m=os(P)?Vs(Hl(a)):{}:m={}}return(x?Rr:_n)(a,function(M,U,W){return u(m,M,U,W)}),m}function NL(a,u){return a==null?!0:sS(a,u)}function ML(a,u,m){return a==null?a:Qx(a,u,lS(m))}function FL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Qx(a,u,lS(m),b)}function su(a){return a==null?[]:Nl(a,tr(a))}function DL(a){return a==null?[]:Nl(a,jr(a))}function LL(a,u,m){return m===t&&(m=u,u=t),m!==t&&(m=xn(m),m=m===m?m:0),u!==t&&(u=xn(u),u=u===u?u:0),xi(xn(a),u,m)}function jL(a,u,m){return u=as(u),m===t?(m=u,u=0):m=as(m),a=xn(a),Zb(a,u,m)}function UL(a,u,m){if(m&&typeof m!="boolean"&&Or(a,u,m)&&(u=m=t),m===t&&(typeof u=="boolean"?(m=u,u=t):typeof a=="boolean"&&(m=a,a=t)),a===t&&u===t?(a=0,u=1):(a=as(a),u===t?(u=a,a=0):u=as(u)),a>u){var b=a;a=u,u=b}if(m||a%1||u%1){var x=ph();return Gt(a+x*(u-a+Yp("1e-"+((x+"").length-1))),u)}return rS(a,u)}var HL=ru(function(a,u,m){return u=u.toLowerCase(),a+(m?sI(u):u)});function sI(a){return kS(ft(a).toLowerCase())}function oI(a){return a=ft(a),a&&a.replace(zo,nb).replace(Uv,"")}function BL(a,u,m){a=ft(a),u=sn(u);var b=a.length;m=m===t?b:xi(qe(m),0,b);var x=m;return m-=u.length,m>=0&&a.slice(m,x)==u}function VL(a){return a=ft(a),a&&fe.test(a)?a.replace(wl,ib):a}function WL(a){return a=ft(a),a&&Vo.test(a)?a.replace(st,"\\$&"):a}var zL=ru(function(a,u,m){return a+(m?"-":"")+u.toLowerCase()}),JL=ru(function(a,u,m){return a+(m?" ":"")+u.toLowerCase()}),GL=lE("toLowerCase");function YL(a,u,m){a=ft(a),u=qe(u);var b=u?wi(a):0;if(!u||b>=u)return a;var x=(u-b)/2;return $h(sa(x),m)+a+$h(ia(x),m)}function KL(a,u,m){a=ft(a),u=qe(u);var b=u?wi(a):0;return u&&b<u?a+$h(u-b,m):a}function QL(a,u,m){a=ft(a),u=qe(u);var b=u?wi(a):0;return u&&b<u?$h(u-b,m)+a:a}function ZL(a,u,m){return m||u==null?u=0:u&&(u=+u),Rb(ft(a).replace(Mc,""),u||0)}function XL(a,u,m){return(m?Or(a,u,m):u===t)?u=1:u=qe(u),nS(ft(a),u)}function ej(){var a=arguments,u=ft(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var tj=ru(function(a,u,m){return a+(m?"_":"")+u.toLowerCase()});function rj(a,u,m){return m&&typeof m!="number"&&Or(a,u,m)&&(u=m=t),m=m===t?be:m>>>0,m?(a=ft(a),a&&(typeof u=="string"||u!=null&&!ES(u))&&(u=sn(u),!u&&Ls(a))?Ks(xr(a),0,m):a.split(u,m)):[]}var nj=ru(function(a,u,m){return a+(m?" ":"")+kS(u)});function ij(a,u,m){return a=ft(a),m=m==null?0:xi(qe(m),0,a.length),u=sn(u),a.slice(m,m+u.length)==u}function sj(a,u,m){var b=O.templateSettings;m&&Or(a,u,m)&&(u=t),a=ft(a),u=IS({},u,b,mE);var x=IS({},u.imports,b.imports,mE),P=tr(x),M=Nl(x,P);Rr(P,function(Se){if(Mr.test(Se))throw new Ce(o)});var U,W,Z=0,X=u.interpolate||Jo,te="__p += '",oe=Fl((u.escape||Jo).source+"|"+X.source+"|"+(X===gn?Yi:Jo).source+"|"+(u.evaluate||Jo).source+"|$","g"),he="//# sourceURL="+(at.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++zv+"]")+`
|
|
4
|
+
`;a.replace(oe,function(Se,Ve,Ge,an,qr,ln){return Ge||(Ge=an),te+=a.slice(Z,ln).replace(Iv,sb),Ve&&(U=!0,te+=`' +
|
|
5
5
|
__e(`+Ve+`) +
|
|
6
|
-
'`),
|
|
7
|
-
`+
|
|
6
|
+
'`),qr&&(W=!0,te+=`';
|
|
7
|
+
`+qr+`;
|
|
8
8
|
__p += '`),Ge&&(te+=`' +
|
|
9
9
|
((__t = (`+Ge+`)) == null ? '' : __t) +
|
|
10
10
|
'`),Z=ln+Se.length,Se}),te+=`';
|
|
@@ -17,17 +17,17 @@ __p += '`),Ge&&(te+=`' +
|
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
19
|
`)+te+`return __p
|
|
20
|
-
}`;var Te=lI(function(){return rt(P,he+"return "+te).apply(t,M)});if(Te.source=te,xS(Te))throw Te;return Te}function oj(a){return ft(a).toLowerCase()}function aj(a){return ft(a).toUpperCase()}function lj(a,u,m){if(a=ft(a),a&&(m||u===t))return Xc(a);if(!a||!(u=sn(u)))return a;var b=xr(a),x=xr(u),P=rh(b,x),M=nh(b,x)+1;return Ks(b,P,M).join("")}function uj(a,u,m){if(a=ft(a),a&&(m||u===t))return a.slice(0,oh(a)+1);if(!a||!(u=sn(u)))return a;var b=xr(a),x=nh(b,xr(u))+1;return Ks(b,0,x).join("")}function cj(a,u,m){if(a=ft(a),a&&(m||u===t))return a.replace(Mc,"");if(!a||!(u=sn(u)))return a;var b=xr(a),x=rh(b,xr(u));return Ks(b,x).join("")}function fj(a,u){var m=A,b=D;if(Pt(u)){var x="separator"in u?u.separator:x;m="length"in u?Oe(u.length):m,b="omission"in u?sn(u.omission):b}a=ft(a);var P=a.length;if(Ls(a)){var M=xr(a);P=M.length}if(m>=P)return a;var U=m-wi(b);if(U<1)return b;var W=M?Ks(M,0,U).join(""):a.slice(0,U);if(x===t)return W+b;if(M&&(U+=W.length-U),ES(x)){if(a.slice(U).search(x)){var Z,X=W;for(x.global||(x=Fl(x.source,ft(Np.exec(x))+"g")),x.lastIndex=0;Z=x.exec(X);)var te=Z.index;W=W.slice(0,te===t?U:te)}}else if(a.indexOf(sn(x),U)!=U){var oe=W.lastIndexOf(x);oe>-1&&(W=W.slice(0,oe))}return W+b}function dj(a){return a=ft(a),a&&_l.test(a)?a.replace(Gi,ub):a}var pj=ru(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),kS=lE("toUpperCase");function aI(a,u,m){return a=ft(a),u=m?t:u,u===t?ob(a)?db(a):Xv(a):a.match(u)||[]}var lI=Me(function(a,u){try{return _r(a,t,u)}catch(m){return xS(m)?m:new Ce(m)}}),hj=is(function(a,u){return Rr(u,function(m){m=Yn(m),rn(a,m,RS(a[m],a))}),a});function mj(a){var u=a==null?0:a.length,m=we();return a=u?yt(a,function(b){if(typeof b[1]!="function")throw new Er(i);return[m(b[0]),b[1]]}):[],Me(function(b){for(var x=-1;++x<u;){var P=a[x];if(_r(P[0],this,b))return _r(P[1],this,b)}})}function gj(a){return Jb(fr(a,p))}function PS(a){return function(){return a}}function yj(a,u){return a==null||a!==a?u:a}var vj=cE(),bj=cE(!0);function Ur(a){return a}function TS(a){return R(typeof a=="function"?a:fr(a,p))}function Sj(a){return Re(fr(a,p))}function wj(a,u){return je(a,fr(u,p))}var _j=Me(function(a,u){return function(m){return fa(m,a,u)}}),Rj=Me(function(a,u){return function(m){return fa(a,m,u)}});function AS(a,u,m){var b=tr(u),x=eu(u,b);m==null&&!(Pt(u)&&(x.length||!b.length))&&(m=u,u=a,a=this,x=eu(u,tr(u)));var P=!(Pt(m)&&"chain"in m)||!!m.chain,M=os(a);return Rr(x,function(U){var W=u[U];a[U]=W,M&&(a.prototype[U]=function(){var Z=this.__chain__;if(P||Z){var X=a(this.__wrapped__),te=X.__actions__=Dr(this.__actions__);return te.push({func:W,args:arguments,thisArg:a}),X.__chain__=Z,X}return W.apply(a,Si([this.value()],arguments))})}),a}function Cj(){return Ut._===this&&(Ut._=vb),this}function $S(){}function xj(a){return a=Oe(a),Me(function(u){return Gn(u,a)})}var Ej=cS(yt),Ij=cS(Xp),qj=cS(Tl);function uI(a){return yS(a)?Qo(Yn(a)):sM(a)}function Oj(a){return function(u){return a==null?t:rs(a,u)}}var kj=dE(),Pj=dE(!0);function NS(){return[]}function MS(){return!1}function Tj(){return{}}function Aj(){return""}function $j(){return!0}function Nj(a,u){if(a=Oe(a),a<1||a>Pe)return[];var m=be,b=Gt(a,be);u=we(u),a-=be;for(var x=Zc(b,u);++m<a;)u(m);return x}function Mj(a){return Ie(a)?yt(a,Yn):on(a)?[a]:Dr(qE(ft(a)))}function Fj(a){var u=++gb;return ft(a)+u}var Dj=Ah(function(a,u){return a+u},0),Lj=fS("ceil"),jj=Ah(function(a,u){return a/u},1),Uj=fS("floor");function Hj(a){return a&&a.length?Xl(a,Ur,cf):t}function Bj(a,u){return a&&a.length?Xl(a,we(u,2),cf):t}function Vj(a){return th(a,Ur)}function Wj(a,u){return th(a,we(u,2))}function zj(a){return a&&a.length?Xl(a,Ur,Y):t}function Jj(a,u){return a&&a.length?Xl(a,we(u,2),Y):t}var Gj=Ah(function(a,u){return a*u},1),Yj=fS("round"),Kj=Ah(function(a,u){return a-u},0);function Qj(a){return a&&a.length?Qc(a,Ur):0}function Zj(a,u){return a&&a.length?Qc(a,we(u,2)):0}return q.after=wD,q.ary=LE,q.assign=lL,q.assignIn=XE,q.assignInWith=eI,q.assignWith=IS,q.at=uL,q.before=jE,q.bind=RS,q.bindAll=hj,q.bindKey=UE,q.castArray=AD,q.chain=ME,q.chunk=HM,q.compact=BM,q.concat=VM,q.cond=mj,q.conforms=gj,q.constant=PS,q.countBy=ZF,q.create=cL,q.curry=HE,q.curryRight=BE,q.debounce=VE,q.defaults=fL,q.defaultsDeep=dL,q.defer=_D,q.delay=RD,q.difference=WM,q.differenceBy=zM,q.differenceWith=JM,q.drop=GM,q.dropRight=YM,q.dropRightWhile=KM,q.dropWhile=QM,q.fill=ZM,q.filter=eD,q.flatMap=nD,q.flatMapDeep=iD,q.flatMapDepth=sD,q.flatten=TE,q.flattenDeep=XM,q.flattenDepth=eF,q.flip=CD,q.flow=vj,q.flowRight=bj,q.fromPairs=tF,q.functions=bL,q.functionsIn=SL,q.groupBy=oD,q.initial=nF,q.intersection=iF,q.intersectionBy=sF,q.intersectionWith=oF,q.invert=_L,q.invertBy=RL,q.invokeMap=lD,q.iteratee=TS,q.keyBy=uD,q.keys=tr,q.keysIn=jr,q.map=jh,q.mapKeys=xL,q.mapValues=EL,q.matches=Sj,q.matchesProperty=wj,q.memoize=Hh,q.merge=IL,q.mergeWith=tI,q.method=_j,q.methodOf=Rj,q.mixin=AS,q.negate=Bh,q.nthArg=xj,q.omit=qL,q.omitBy=OL,q.once=xD,q.orderBy=cD,q.over=Ej,q.overArgs=ED,q.overEvery=Ij,q.overSome=qj,q.partial=CS,q.partialRight=WE,q.partition=fD,q.pick=kL,q.pickBy=rI,q.property=uI,q.propertyOf=Oj,q.pull=cF,q.pullAll=$E,q.pullAllBy=fF,q.pullAllWith=dF,q.pullAt=pF,q.range=kj,q.rangeRight=Pj,q.rearg=ID,q.reject=hD,q.remove=hF,q.rest=qD,q.reverse=wS,q.sampleSize=gD,q.set=TL,q.setWith=AL,q.shuffle=yD,q.slice=mF,q.sortBy=SD,q.sortedUniq=_F,q.sortedUniqBy=RF,q.split=rj,q.spread=OD,q.tail=CF,q.take=xF,q.takeRight=EF,q.takeRightWhile=IF,q.takeWhile=qF,q.tap=BF,q.throttle=kD,q.thru=Lh,q.toArray=KE,q.toPairs=nI,q.toPairsIn=iI,q.toPath=Mj,q.toPlainObject=ZE,q.transform=$L,q.unary=PD,q.union=OF,q.unionBy=kF,q.unionWith=PF,q.uniq=TF,q.uniqBy=AF,q.uniqWith=$F,q.unset=NL,q.unzip=_S,q.unzipWith=NE,q.update=ML,q.updateWith=FL,q.values=su,q.valuesIn=DL,q.without=NF,q.words=aI,q.wrap=TD,q.xor=MF,q.xorBy=FF,q.xorWith=DF,q.zip=LF,q.zipObject=jF,q.zipObjectDeep=UF,q.zipWith=HF,q.entries=nI,q.entriesIn=iI,q.extend=XE,q.extendWith=eI,AS(q,q),q.add=Dj,q.attempt=lI,q.camelCase=HL,q.capitalize=sI,q.ceil=Lj,q.clamp=LL,q.clone=$D,q.cloneDeep=MD,q.cloneDeepWith=FD,q.cloneWith=ND,q.conformsTo=DD,q.deburr=oI,q.defaultTo=yj,q.divide=jj,q.endsWith=BL,q.eq=Kn,q.escape=VL,q.escapeRegExp=WL,q.every=XF,q.find=tD,q.findIndex=kE,q.findKey=pL,q.findLast=rD,q.findLastIndex=PE,q.findLastKey=hL,q.floor=Uj,q.forEach=FE,q.forEachRight=DE,q.forIn=mL,q.forInRight=gL,q.forOwn=yL,q.forOwnRight=vL,q.get=qS,q.gt=LD,q.gte=jD,q.has=wL,q.hasIn=OS,q.head=AE,q.identity=Ur,q.includes=aD,q.indexOf=rF,q.inRange=jL,q.invoke=CL,q.isArguments=ma,q.isArray=Ie,q.isArrayBuffer=UD,q.isArrayLike=Lr,q.isArrayLikeObject=Dt,q.isBoolean=HD,q.isBuffer=Qs,q.isDate=BD,q.isElement=VD,q.isEmpty=WD,q.isEqual=zD,q.isEqualWith=JD,q.isError=xS,q.isFinite=GD,q.isFunction=os,q.isInteger=zE,q.isLength=Vh,q.isMap=JE,q.isMatch=YD,q.isMatchWith=KD,q.isNaN=QD,q.isNative=ZD,q.isNil=eL,q.isNull=XD,q.isNumber=GE,q.isObject=Pt,q.isObjectLike=At,q.isPlainObject=gf,q.isRegExp=ES,q.isSafeInteger=tL,q.isSet=YE,q.isString=Wh,q.isSymbol=on,q.isTypedArray=iu,q.isUndefined=rL,q.isWeakMap=nL,q.isWeakSet=iL,q.join=aF,q.kebabCase=zL,q.last=Cn,q.lastIndexOf=lF,q.lowerCase=JL,q.lowerFirst=GL,q.lt=sL,q.lte=oL,q.max=Hj,q.maxBy=Bj,q.mean=Vj,q.meanBy=Wj,q.min=zj,q.minBy=Jj,q.stubArray=NS,q.stubFalse=MS,q.stubObject=Tj,q.stubString=Aj,q.stubTrue=$j,q.multiply=Gj,q.nth=uF,q.noConflict=Cj,q.noop=$S,q.now=Uh,q.pad=YL,q.padEnd=KL,q.padStart=QL,q.parseInt=ZL,q.random=UL,q.reduce=dD,q.reduceRight=pD,q.repeat=XL,q.replace=ej,q.result=PL,q.round=Yj,q.runInContext=V,q.sample=mD,q.size=vD,q.snakeCase=tj,q.some=bD,q.sortedIndex=gF,q.sortedIndexBy=yF,q.sortedIndexOf=vF,q.sortedLastIndex=bF,q.sortedLastIndexBy=SF,q.sortedLastIndexOf=wF,q.startCase=nj,q.startsWith=ij,q.subtract=Kj,q.sum=Qj,q.sumBy=Zj,q.template=sj,q.times=Nj,q.toFinite=as,q.toInteger=Oe,q.toLength=QE,q.toLower=oj,q.toNumber=xn,q.toSafeInteger=aL,q.toString=ft,q.toUpper=aj,q.trim=lj,q.trimEnd=uj,q.trimStart=cj,q.truncate=fj,q.unescape=dj,q.uniqueId=Fj,q.upperCase=pj,q.upperFirst=kS,q.each=FE,q.eachRight=DE,q.first=AE,AS(q,(function(){var a={};return _n(q,function(u,m){at.call(q.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),q.VERSION=e,Rr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){q[a].placeholder=q}),Rr(["drop","take"],function(a,u){Le.prototype[a]=function(m){m=m===t?1:Ct(Oe(m),0);var b=this.__filtered__&&!u?new Le(this):this.clone();return b.__filtered__?b.__takeCount__=Gt(m,b.__takeCount__):b.__views__.push({size:Gt(m,be),type:a+(b.__dir__<0?"Right":"")}),b},Le.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),Rr(["filter","map","takeWhile"],function(a,u){var m=u+1,b=m==K||m==ie;Le.prototype[a]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:we(x,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),Rr(["head","last"],function(a,u){var m="take"+(u?"Right":"");Le.prototype[a]=function(){return this[m](1).value()[0]}}),Rr(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");Le.prototype[a]=function(){return this.__filtered__?new Le(this):this[m](1)}}),Le.prototype.compact=function(){return this.filter(Ur)},Le.prototype.find=function(a){return this.filter(a).head()},Le.prototype.findLast=function(a){return this.reverse().find(a)},Le.prototype.invokeMap=Me(function(a,u){return typeof a=="function"?new Le(this):this.map(function(m){return fa(m,a,u)})}),Le.prototype.reject=function(a){return this.filter(Bh(we(a)))},Le.prototype.slice=function(a,u){a=Oe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new Le(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==t&&(u=Oe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},Le.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Le.prototype.toArray=function(){return this.take(be)},_n(Le.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),b=/^(?:head|last)$/.test(u),x=q[b?"take"+(u=="last"?"Right":""):u],P=b||/^find/.test(u);x&&(q.prototype[u]=function(){var M=this.__wrapped__,U=b?[1]:arguments,W=M instanceof Le,Z=U[0],X=W||Ie(M),te=function(Ve){var Ge=x.apply(q,Si([Ve],U));return b&&oe?Ge[0]:Ge};X&&m&&typeof Z=="function"&&Z.length!=1&&(W=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,_e=P&&!oe,Te=W&&!he;if(!P&&X){M=Te?M:new Le(this);var Se=a.apply(M,U);return Se.__actions__.push({func:Lh,args:[te],thisArg:t}),new cr(Se,oe)}return _e&&Te?a.apply(this,U):(Se=this.thru(te),_e?b?Se.value()[0]:Se.value():Se)})}),Rr(["pop","push","shift","sort","splice","unshift"],function(a){var u=ea[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);q.prototype[a]=function(){var x=arguments;if(b&&!this.__chain__){var P=this.value();return u.apply(Ie(P)?P:[],x)}return this[m](function(M){return u.apply(Ie(M)?M:[],x)})}}),_n(Le.prototype,function(a,u){var m=q[u];if(m){var b=m.name+"";at.call(Bs,b)||(Bs[b]=[]),Bs[b].push({name:u,func:m})}}),Bs[Th(t,E).name]=[{name:"wrapper",func:t}],Le.prototype.clone=kb,Le.prototype.reverse=Pb,Le.prototype.value=nf,q.prototype.at=VF,q.prototype.chain=WF,q.prototype.commit=zF,q.prototype.next=JF,q.prototype.plant=YF,q.prototype.reverse=KF,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=QF,q.prototype.first=q.prototype.head,na&&(q.prototype[na]=GF),q}),_i=pb();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ut._=_i,define(function(){return _i})):ot?((ot.exports=_i)._=_i,Ol._=_i):Ut._=_i}).call(gu)});var qI=H((QS,yu)=>{(function(t,e){typeof QS=="object"&&typeof yu<"u"?yu.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(QS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(d){t=d}function n(d){return d instanceof Array||Object.prototype.toString.call(d)==="[object Array]"}function i(d){return d!=null&&Object.prototype.toString.call(d)==="[object Object]"}function s(d,y){return Object.prototype.hasOwnProperty.call(d,y)}function o(d){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(d).length===0;var y;for(y in d)if(s(d,y))return!1;return!0}function l(d){return d===void 0}function f(d){return typeof d=="number"||Object.prototype.toString.call(d)==="[object Number]"}function c(d){return d instanceof Date||Object.prototype.toString.call(d)==="[object Date]"}function p(d,y){var S=[],R,I=d.length;for(R=0;R<I;++R)S.push(y(d[R],R));return S}function h(d,y){for(var S in y)s(y,S)&&(d[S]=y[S]);return s(y,"toString")&&(d.toString=y.toString),s(y,"valueOf")&&(d.valueOf=y.valueOf),d}function g(d,y,S,R){return Nl(d,y,S,R,!0).utc()}function v(){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 _(d){return d._pf==null&&(d._pf=v()),d._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(d){var y=Object(this),S=y.length>>>0,R;for(R=0;R<S;R++)if(R in y&&d.call(this,y[R],R,y))return!0;return!1};function E(d){var y=null,S=!1,R=d._d&&!isNaN(d._d.getTime());if(R&&(y=_(d),S=w.call(y.parsedDateParts,function(I){return I!=null}),R=y.overflow<0&&!y.empty&&!y.invalidEra&&!y.invalidMonth&&!y.invalidWeekday&&!y.weekdayMismatch&&!y.nullInput&&!y.invalidFormat&&!y.userInvalidated&&(!y.meridiem||y.meridiem&&S),d._strict&&(R=R&&y.charsLeftOver===0&&y.unusedTokens.length===0&&y.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(d))d._isValid=R;else return R;return d._isValid}function k(d){var y=g(NaN);return d!=null?h(_(y),d):_(y).userInvalidated=!0,y}var T=e.momentProperties=[],N=!1;function $(d,y){var S,R,I,L=T.length;if(l(y._isAMomentObject)||(d._isAMomentObject=y._isAMomentObject),l(y._i)||(d._i=y._i),l(y._f)||(d._f=y._f),l(y._l)||(d._l=y._l),l(y._strict)||(d._strict=y._strict),l(y._tzm)||(d._tzm=y._tzm),l(y._isUTC)||(d._isUTC=y._isUTC),l(y._offset)||(d._offset=y._offset),l(y._pf)||(d._pf=_(y)),l(y._locale)||(d._locale=y._locale),L>0)for(S=0;S<L;S++)R=T[S],I=y[R],l(I)||(d[R]=I);return d}function j(d){$(this,d),this._d=new Date(d._d!=null?d._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),N===!1&&(N=!0,e.updateOffset(this),N=!1)}function G(d){return d instanceof j||d!=null&&d._isAMomentObject!=null}function O(d){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+d)}function C(d,y){var S=!0;return h(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,d),S){var R=[],I,L,Y,ae=arguments.length;for(L=0;L<ae;L++){if(I="",typeof arguments[L]=="object"){I+=`
|
|
21
|
-
[`+L+"] ";for(Y in arguments[0])s(arguments[0],Y)&&(I+=Y+": "+arguments[0][Y]+", ");I=I.slice(0,-2)}else I=arguments[L];R.push(I)}
|
|
20
|
+
}`;var Te=lI(function(){return rt(P,he+"return "+te).apply(t,M)});if(Te.source=te,xS(Te))throw Te;return Te}function oj(a){return ft(a).toLowerCase()}function aj(a){return ft(a).toUpperCase()}function lj(a,u,m){if(a=ft(a),a&&(m||u===t))return Xc(a);if(!a||!(u=sn(u)))return a;var b=xr(a),x=xr(u),P=rh(b,x),M=nh(b,x)+1;return Ks(b,P,M).join("")}function uj(a,u,m){if(a=ft(a),a&&(m||u===t))return a.slice(0,oh(a)+1);if(!a||!(u=sn(u)))return a;var b=xr(a),x=nh(b,xr(u))+1;return Ks(b,0,x).join("")}function cj(a,u,m){if(a=ft(a),a&&(m||u===t))return a.replace(Mc,"");if(!a||!(u=sn(u)))return a;var b=xr(a),x=rh(b,xr(u));return Ks(b,x).join("")}function fj(a,u){var m=A,b=D;if(Pt(u)){var x="separator"in u?u.separator:x;m="length"in u?qe(u.length):m,b="omission"in u?sn(u.omission):b}a=ft(a);var P=a.length;if(Ls(a)){var M=xr(a);P=M.length}if(m>=P)return a;var U=m-wi(b);if(U<1)return b;var W=M?Ks(M,0,U).join(""):a.slice(0,U);if(x===t)return W+b;if(M&&(U+=W.length-U),ES(x)){if(a.slice(U).search(x)){var Z,X=W;for(x.global||(x=Fl(x.source,ft(Np.exec(x))+"g")),x.lastIndex=0;Z=x.exec(X);)var te=Z.index;W=W.slice(0,te===t?U:te)}}else if(a.indexOf(sn(x),U)!=U){var oe=W.lastIndexOf(x);oe>-1&&(W=W.slice(0,oe))}return W+b}function dj(a){return a=ft(a),a&&_l.test(a)?a.replace(Gi,ub):a}var pj=ru(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),kS=lE("toUpperCase");function aI(a,u,m){return a=ft(a),u=m?t:u,u===t?ob(a)?db(a):Xv(a):a.match(u)||[]}var lI=Me(function(a,u){try{return _r(a,t,u)}catch(m){return xS(m)?m:new Ce(m)}}),hj=is(function(a,u){return Rr(u,function(m){m=Yn(m),rn(a,m,RS(a[m],a))}),a});function mj(a){var u=a==null?0:a.length,m=we();return a=u?yt(a,function(b){if(typeof b[1]!="function")throw new Er(i);return[m(b[0]),b[1]]}):[],Me(function(b){for(var x=-1;++x<u;){var P=a[x];if(_r(P[0],this,b))return _r(P[1],this,b)}})}function gj(a){return Jb(fr(a,p))}function PS(a){return function(){return a}}function yj(a,u){return a==null||a!==a?u:a}var vj=cE(),bj=cE(!0);function Ur(a){return a}function TS(a){return R(typeof a=="function"?a:fr(a,p))}function Sj(a){return Re(fr(a,p))}function wj(a,u){return je(a,fr(u,p))}var _j=Me(function(a,u){return function(m){return fa(m,a,u)}}),Rj=Me(function(a,u){return function(m){return fa(a,m,u)}});function AS(a,u,m){var b=tr(u),x=eu(u,b);m==null&&!(Pt(u)&&(x.length||!b.length))&&(m=u,u=a,a=this,x=eu(u,tr(u)));var P=!(Pt(m)&&"chain"in m)||!!m.chain,M=os(a);return Rr(x,function(U){var W=u[U];a[U]=W,M&&(a.prototype[U]=function(){var Z=this.__chain__;if(P||Z){var X=a(this.__wrapped__),te=X.__actions__=Dr(this.__actions__);return te.push({func:W,args:arguments,thisArg:a}),X.__chain__=Z,X}return W.apply(a,Si([this.value()],arguments))})}),a}function Cj(){return Ut._===this&&(Ut._=vb),this}function $S(){}function xj(a){return a=qe(a),Me(function(u){return Gn(u,a)})}var Ej=cS(yt),Ij=cS(Xp),Oj=cS(Tl);function uI(a){return yS(a)?Qo(Yn(a)):sM(a)}function qj(a){return function(u){return a==null?t:rs(a,u)}}var kj=dE(),Pj=dE(!0);function NS(){return[]}function MS(){return!1}function Tj(){return{}}function Aj(){return""}function $j(){return!0}function Nj(a,u){if(a=qe(a),a<1||a>Pe)return[];var m=be,b=Gt(a,be);u=we(u),a-=be;for(var x=Zc(b,u);++m<a;)u(m);return x}function Mj(a){return Ie(a)?yt(a,Yn):on(a)?[a]:Dr(OE(ft(a)))}function Fj(a){var u=++gb;return ft(a)+u}var Dj=Ah(function(a,u){return a+u},0),Lj=fS("ceil"),jj=Ah(function(a,u){return a/u},1),Uj=fS("floor");function Hj(a){return a&&a.length?Xl(a,Ur,cf):t}function Bj(a,u){return a&&a.length?Xl(a,we(u,2),cf):t}function Vj(a){return th(a,Ur)}function Wj(a,u){return th(a,we(u,2))}function zj(a){return a&&a.length?Xl(a,Ur,Y):t}function Jj(a,u){return a&&a.length?Xl(a,we(u,2),Y):t}var Gj=Ah(function(a,u){return a*u},1),Yj=fS("round"),Kj=Ah(function(a,u){return a-u},0);function Qj(a){return a&&a.length?Qc(a,Ur):0}function Zj(a,u){return a&&a.length?Qc(a,we(u,2)):0}return O.after=wD,O.ary=LE,O.assign=lL,O.assignIn=XE,O.assignInWith=eI,O.assignWith=IS,O.at=uL,O.before=jE,O.bind=RS,O.bindAll=hj,O.bindKey=UE,O.castArray=AD,O.chain=ME,O.chunk=HM,O.compact=BM,O.concat=VM,O.cond=mj,O.conforms=gj,O.constant=PS,O.countBy=ZF,O.create=cL,O.curry=HE,O.curryRight=BE,O.debounce=VE,O.defaults=fL,O.defaultsDeep=dL,O.defer=_D,O.delay=RD,O.difference=WM,O.differenceBy=zM,O.differenceWith=JM,O.drop=GM,O.dropRight=YM,O.dropRightWhile=KM,O.dropWhile=QM,O.fill=ZM,O.filter=eD,O.flatMap=nD,O.flatMapDeep=iD,O.flatMapDepth=sD,O.flatten=TE,O.flattenDeep=XM,O.flattenDepth=eF,O.flip=CD,O.flow=vj,O.flowRight=bj,O.fromPairs=tF,O.functions=bL,O.functionsIn=SL,O.groupBy=oD,O.initial=nF,O.intersection=iF,O.intersectionBy=sF,O.intersectionWith=oF,O.invert=_L,O.invertBy=RL,O.invokeMap=lD,O.iteratee=TS,O.keyBy=uD,O.keys=tr,O.keysIn=jr,O.map=jh,O.mapKeys=xL,O.mapValues=EL,O.matches=Sj,O.matchesProperty=wj,O.memoize=Hh,O.merge=IL,O.mergeWith=tI,O.method=_j,O.methodOf=Rj,O.mixin=AS,O.negate=Bh,O.nthArg=xj,O.omit=OL,O.omitBy=qL,O.once=xD,O.orderBy=cD,O.over=Ej,O.overArgs=ED,O.overEvery=Ij,O.overSome=Oj,O.partial=CS,O.partialRight=WE,O.partition=fD,O.pick=kL,O.pickBy=rI,O.property=uI,O.propertyOf=qj,O.pull=cF,O.pullAll=$E,O.pullAllBy=fF,O.pullAllWith=dF,O.pullAt=pF,O.range=kj,O.rangeRight=Pj,O.rearg=ID,O.reject=hD,O.remove=hF,O.rest=OD,O.reverse=wS,O.sampleSize=gD,O.set=TL,O.setWith=AL,O.shuffle=yD,O.slice=mF,O.sortBy=SD,O.sortedUniq=_F,O.sortedUniqBy=RF,O.split=rj,O.spread=qD,O.tail=CF,O.take=xF,O.takeRight=EF,O.takeRightWhile=IF,O.takeWhile=OF,O.tap=BF,O.throttle=kD,O.thru=Lh,O.toArray=KE,O.toPairs=nI,O.toPairsIn=iI,O.toPath=Mj,O.toPlainObject=ZE,O.transform=$L,O.unary=PD,O.union=qF,O.unionBy=kF,O.unionWith=PF,O.uniq=TF,O.uniqBy=AF,O.uniqWith=$F,O.unset=NL,O.unzip=_S,O.unzipWith=NE,O.update=ML,O.updateWith=FL,O.values=su,O.valuesIn=DL,O.without=NF,O.words=aI,O.wrap=TD,O.xor=MF,O.xorBy=FF,O.xorWith=DF,O.zip=LF,O.zipObject=jF,O.zipObjectDeep=UF,O.zipWith=HF,O.entries=nI,O.entriesIn=iI,O.extend=XE,O.extendWith=eI,AS(O,O),O.add=Dj,O.attempt=lI,O.camelCase=HL,O.capitalize=sI,O.ceil=Lj,O.clamp=LL,O.clone=$D,O.cloneDeep=MD,O.cloneDeepWith=FD,O.cloneWith=ND,O.conformsTo=DD,O.deburr=oI,O.defaultTo=yj,O.divide=jj,O.endsWith=BL,O.eq=Kn,O.escape=VL,O.escapeRegExp=WL,O.every=XF,O.find=tD,O.findIndex=kE,O.findKey=pL,O.findLast=rD,O.findLastIndex=PE,O.findLastKey=hL,O.floor=Uj,O.forEach=FE,O.forEachRight=DE,O.forIn=mL,O.forInRight=gL,O.forOwn=yL,O.forOwnRight=vL,O.get=OS,O.gt=LD,O.gte=jD,O.has=wL,O.hasIn=qS,O.head=AE,O.identity=Ur,O.includes=aD,O.indexOf=rF,O.inRange=jL,O.invoke=CL,O.isArguments=ma,O.isArray=Ie,O.isArrayBuffer=UD,O.isArrayLike=Lr,O.isArrayLikeObject=Dt,O.isBoolean=HD,O.isBuffer=Qs,O.isDate=BD,O.isElement=VD,O.isEmpty=WD,O.isEqual=zD,O.isEqualWith=JD,O.isError=xS,O.isFinite=GD,O.isFunction=os,O.isInteger=zE,O.isLength=Vh,O.isMap=JE,O.isMatch=YD,O.isMatchWith=KD,O.isNaN=QD,O.isNative=ZD,O.isNil=eL,O.isNull=XD,O.isNumber=GE,O.isObject=Pt,O.isObjectLike=At,O.isPlainObject=gf,O.isRegExp=ES,O.isSafeInteger=tL,O.isSet=YE,O.isString=Wh,O.isSymbol=on,O.isTypedArray=iu,O.isUndefined=rL,O.isWeakMap=nL,O.isWeakSet=iL,O.join=aF,O.kebabCase=zL,O.last=Cn,O.lastIndexOf=lF,O.lowerCase=JL,O.lowerFirst=GL,O.lt=sL,O.lte=oL,O.max=Hj,O.maxBy=Bj,O.mean=Vj,O.meanBy=Wj,O.min=zj,O.minBy=Jj,O.stubArray=NS,O.stubFalse=MS,O.stubObject=Tj,O.stubString=Aj,O.stubTrue=$j,O.multiply=Gj,O.nth=uF,O.noConflict=Cj,O.noop=$S,O.now=Uh,O.pad=YL,O.padEnd=KL,O.padStart=QL,O.parseInt=ZL,O.random=UL,O.reduce=dD,O.reduceRight=pD,O.repeat=XL,O.replace=ej,O.result=PL,O.round=Yj,O.runInContext=V,O.sample=mD,O.size=vD,O.snakeCase=tj,O.some=bD,O.sortedIndex=gF,O.sortedIndexBy=yF,O.sortedIndexOf=vF,O.sortedLastIndex=bF,O.sortedLastIndexBy=SF,O.sortedLastIndexOf=wF,O.startCase=nj,O.startsWith=ij,O.subtract=Kj,O.sum=Qj,O.sumBy=Zj,O.template=sj,O.times=Nj,O.toFinite=as,O.toInteger=qe,O.toLength=QE,O.toLower=oj,O.toNumber=xn,O.toSafeInteger=aL,O.toString=ft,O.toUpper=aj,O.trim=lj,O.trimEnd=uj,O.trimStart=cj,O.truncate=fj,O.unescape=dj,O.uniqueId=Fj,O.upperCase=pj,O.upperFirst=kS,O.each=FE,O.eachRight=DE,O.first=AE,AS(O,(function(){var a={};return _n(O,function(u,m){at.call(O.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),O.VERSION=e,Rr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){O[a].placeholder=O}),Rr(["drop","take"],function(a,u){Le.prototype[a]=function(m){m=m===t?1:Ct(qe(m),0);var b=this.__filtered__&&!u?new Le(this):this.clone();return b.__filtered__?b.__takeCount__=Gt(m,b.__takeCount__):b.__views__.push({size:Gt(m,be),type:a+(b.__dir__<0?"Right":"")}),b},Le.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),Rr(["filter","map","takeWhile"],function(a,u){var m=u+1,b=m==K||m==ie;Le.prototype[a]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:we(x,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),Rr(["head","last"],function(a,u){var m="take"+(u?"Right":"");Le.prototype[a]=function(){return this[m](1).value()[0]}}),Rr(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");Le.prototype[a]=function(){return this.__filtered__?new Le(this):this[m](1)}}),Le.prototype.compact=function(){return this.filter(Ur)},Le.prototype.find=function(a){return this.filter(a).head()},Le.prototype.findLast=function(a){return this.reverse().find(a)},Le.prototype.invokeMap=Me(function(a,u){return typeof a=="function"?new Le(this):this.map(function(m){return fa(m,a,u)})}),Le.prototype.reject=function(a){return this.filter(Bh(we(a)))},Le.prototype.slice=function(a,u){a=qe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new Le(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==t&&(u=qe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},Le.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Le.prototype.toArray=function(){return this.take(be)},_n(Le.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),b=/^(?:head|last)$/.test(u),x=O[b?"take"+(u=="last"?"Right":""):u],P=b||/^find/.test(u);x&&(O.prototype[u]=function(){var M=this.__wrapped__,U=b?[1]:arguments,W=M instanceof Le,Z=U[0],X=W||Ie(M),te=function(Ve){var Ge=x.apply(O,Si([Ve],U));return b&&oe?Ge[0]:Ge};X&&m&&typeof Z=="function"&&Z.length!=1&&(W=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,_e=P&&!oe,Te=W&&!he;if(!P&&X){M=Te?M:new Le(this);var Se=a.apply(M,U);return Se.__actions__.push({func:Lh,args:[te],thisArg:t}),new cr(Se,oe)}return _e&&Te?a.apply(this,U):(Se=this.thru(te),_e?b?Se.value()[0]:Se.value():Se)})}),Rr(["pop","push","shift","sort","splice","unshift"],function(a){var u=ea[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);O.prototype[a]=function(){var x=arguments;if(b&&!this.__chain__){var P=this.value();return u.apply(Ie(P)?P:[],x)}return this[m](function(M){return u.apply(Ie(M)?M:[],x)})}}),_n(Le.prototype,function(a,u){var m=O[u];if(m){var b=m.name+"";at.call(Bs,b)||(Bs[b]=[]),Bs[b].push({name:u,func:m})}}),Bs[Th(t,E).name]=[{name:"wrapper",func:t}],Le.prototype.clone=kb,Le.prototype.reverse=Pb,Le.prototype.value=nf,O.prototype.at=VF,O.prototype.chain=WF,O.prototype.commit=zF,O.prototype.next=JF,O.prototype.plant=YF,O.prototype.reverse=KF,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=QF,O.prototype.first=O.prototype.head,na&&(O.prototype[na]=GF),O}),_i=pb();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ut._=_i,define(function(){return _i})):ot?((ot.exports=_i)._=_i,ql._=_i):Ut._=_i}).call(gu)});var OI=H((QS,yu)=>{(function(t,e){typeof QS=="object"&&typeof yu<"u"?yu.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(QS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(d){t=d}function n(d){return d instanceof Array||Object.prototype.toString.call(d)==="[object Array]"}function i(d){return d!=null&&Object.prototype.toString.call(d)==="[object Object]"}function s(d,y){return Object.prototype.hasOwnProperty.call(d,y)}function o(d){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(d).length===0;var y;for(y in d)if(s(d,y))return!1;return!0}function l(d){return d===void 0}function f(d){return typeof d=="number"||Object.prototype.toString.call(d)==="[object Number]"}function c(d){return d instanceof Date||Object.prototype.toString.call(d)==="[object Date]"}function p(d,y){var S=[],R,I=d.length;for(R=0;R<I;++R)S.push(y(d[R],R));return S}function h(d,y){for(var S in y)s(y,S)&&(d[S]=y[S]);return s(y,"toString")&&(d.toString=y.toString),s(y,"valueOf")&&(d.valueOf=y.valueOf),d}function g(d,y,S,R){return Nl(d,y,S,R,!0).utc()}function v(){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 _(d){return d._pf==null&&(d._pf=v()),d._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(d){var y=Object(this),S=y.length>>>0,R;for(R=0;R<S;R++)if(R in y&&d.call(this,y[R],R,y))return!0;return!1};function E(d){var y=null,S=!1,R=d._d&&!isNaN(d._d.getTime());if(R&&(y=_(d),S=w.call(y.parsedDateParts,function(I){return I!=null}),R=y.overflow<0&&!y.empty&&!y.invalidEra&&!y.invalidMonth&&!y.invalidWeekday&&!y.weekdayMismatch&&!y.nullInput&&!y.invalidFormat&&!y.userInvalidated&&(!y.meridiem||y.meridiem&&S),d._strict&&(R=R&&y.charsLeftOver===0&&y.unusedTokens.length===0&&y.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(d))d._isValid=R;else return R;return d._isValid}function k(d){var y=g(NaN);return d!=null?h(_(y),d):_(y).userInvalidated=!0,y}var T=e.momentProperties=[],N=!1;function $(d,y){var S,R,I,L=T.length;if(l(y._isAMomentObject)||(d._isAMomentObject=y._isAMomentObject),l(y._i)||(d._i=y._i),l(y._f)||(d._f=y._f),l(y._l)||(d._l=y._l),l(y._strict)||(d._strict=y._strict),l(y._tzm)||(d._tzm=y._tzm),l(y._isUTC)||(d._isUTC=y._isUTC),l(y._offset)||(d._offset=y._offset),l(y._pf)||(d._pf=_(y)),l(y._locale)||(d._locale=y._locale),L>0)for(S=0;S<L;S++)R=T[S],I=y[R],l(I)||(d[R]=I);return d}function j(d){$(this,d),this._d=new Date(d._d!=null?d._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),N===!1&&(N=!0,e.updateOffset(this),N=!1)}function G(d){return d instanceof j||d!=null&&d._isAMomentObject!=null}function q(d){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+d)}function C(d,y){var S=!0;return h(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,d),S){var R=[],I,L,Y,ae=arguments.length;for(L=0;L<ae;L++){if(I="",typeof arguments[L]=="object"){I+=`
|
|
21
|
+
[`+L+"] ";for(Y in arguments[0])s(arguments[0],Y)&&(I+=Y+": "+arguments[0][Y]+", ");I=I.slice(0,-2)}else I=arguments[L];R.push(I)}q(d+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(R).join("")+`
|
|
23
|
-
`+new Error().stack),S=!1}return y.apply(this,arguments)},y)}var A={};function D(d,y){e.deprecationHandler!=null&&e.deprecationHandler(d,y),A[d]||(O(y),A[d]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function B(d){return typeof Function<"u"&&d instanceof Function||Object.prototype.toString.call(d)==="[object Function]"}function F(d){var y,S;for(S in d)s(d,S)&&(y=d[S],B(y)?this[S]=y:this["_"+S]=y);this._config=d,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function K(d,y){var S=h({},d),R;for(R in y)s(y,R)&&(i(d[R])&&i(y[R])?(S[R]={},h(S[R],d[R]),h(S[R],y[R])):y[R]!=null?S[R]=y[R]:delete S[R]);for(R in d)s(d,R)&&!s(y,R)&&i(d[R])&&(S[R]=h({},S[R]));return S}function ee(d){d!=null&&this.set(d)}var ie;Object.keys?ie=Object.keys:ie=function(d){var y,S=[];for(y in d)s(d,y)&&S.push(y);return S};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 Pe(d,y,S){var R=this._calendar[d]||this._calendar.sameElse;return B(R)?R.call(y,S):R}function de(d,y,S){var R=""+Math.abs(d),I=y-R.length,L=d>=0;return(L?S?"+":"":"-")+Math.pow(10,Math.max(0,I)).toString().substr(1)+R}var le=/(\[[^\[]*\])|(\\)?([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,be=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ze={},mt={};function ce(d,y,S,R){var I=R;typeof R=="string"&&(I=function(){return this[R]()}),d&&(mt[d]=I),y&&(mt[y[0]]=function(){return de(I.apply(this,arguments),y[1],y[2])}),S&&(mt[S]=function(){return this.localeData().ordinal(I.apply(this,arguments),d)})}function rr(d){return d.match(/\[[\s\S]/)?d.replace(/^\[|\]$/g,""):d.replace(/\\/g,"")}function Ne(d){var y=d.match(le),S,R;for(S=0,R=y.length;S<R;S++)mt[y[S]]?y[S]=mt[y[S]]:y[S]=rr(y[S]);return function(I){var L="",Y;for(Y=0;Y<R;Y++)L+=B(y[Y])?y[Y].call(I,d):y[Y];return L}}function it(d,y){return d.isValid()?(y=en(y,d.localeData()),ze[y]=ze[y]||Ne(y),ze[y](d)):d.localeData().invalidDate()}function en(d,y){var S=5;function R(I){return y.longDateFormat(I)||I}for(be.lastIndex=0;S>=0&&be.test(d);)d=d.replace(be,R),be.lastIndex=0,S-=1;return d}var $r={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 _t(d){var y=this._longDateFormat[d],S=this._longDateFormat[d.toUpperCase()];return y||!S?y:(this._longDateFormat[d]=S.match(le).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[d])}var Rt="Invalid date";function mn(){return this._invalidDate}var Lo="%d",Zt=/\d{1,2}/;function jo(d){return this._ordinal.replace("%d",d)}var wv={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 Dn(d,y,S,R){var I=this._relativeTime[S];return B(I)?I(d,y,S,R):I.replace(/%d/i,d)}function Pp(d,y){var S=this._relativeTime[d>0?"future":"past"];return B(S)?S(y):S.replace(/%s/i,y)}var Tp={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 Xt(d){return typeof d=="string"?Tp[d]||Tp[d.toLowerCase()]:void 0}function wr(d){var y={},S,R;for(R in d)s(d,R)&&(S=Xt(R),S&&(y[S]=d[R]));return y}var Uo={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 yl(d){var y=[],S;for(S in d)s(d,S)&&y.push({unit:S,priority:Uo[S]});return y.sort(function(R,I){return R.priority-I.priority}),y}var Ap=/\d/,Jt=/\d\d/,$p=/\d{3}/,Ji=/\d{4}/,Ln=/[+-]?\d{6}/,ht=/\d\d?/,vl=/\d\d\d\d?/,bl=/\d\d\d\d\d\d?/,Ps=/\d{1,3}/,Ho=/\d{1,4}/,Ts=/[+-]?\d{1,6}/,vi=/\d+/,As=/[+-]?\d+/,$c=/Z|[+-]\d\d:?\d\d/gi,Sl=/Z|[+-]\d\d(?::?\d\d)?/gi,_v=/[+-]?\d+(\.\d{1,3})?/,Bo=/[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,Gi=/^[1-9]\d?/,wl=/^([1-9]\d|\d)/,_l;_l={};function fe(d,y,S){_l[d]=B(y)?y:function(R,I){return R&&S?S:y}}function Rv(d,y){return s(_l,d)?_l[d](y._strict,y._locale):new RegExp(Cv(d))}function Cv(d){return gn(d.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(y,S,R,I,L){return S||R||I||L}))}function gn(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Nr(d){return d<0?Math.ceil(d)||0:Math.floor(d)}function De(d){var y=+d,S=0;return y!==0&&isFinite(y)&&(S=Nr(y)),S}var Nc={};function st(d,y){var S,R=y,I;for(typeof d=="string"&&(d=[d]),f(y)&&(R=function(L,Y){Y[y]=De(L)}),I=d.length,S=0;S<I;S++)Nc[d[S]]=R}function Vo(d,y){st(d,function(S,R,I,L){I._w=I._w||{},y(S,I._w,I,L)})}function Mc(d,y,S){y!=null&&s(Nc,d)&&Nc[d](y,S._a,S,d)}function Rl(d){return d%4===0&&d%100!==0||d%400===0}var er=0,jn=1,yn=2,Ft=3,Mr=4,Un=5,Yi=6,Np=7,xv=8;ce("Y",0,0,function(){var d=this.year();return d<=9999?de(d,4):"+"+d}),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"),fe("Y",As),fe("YY",ht,Jt),fe("YYYY",Ho,Ji),fe("YYYYY",Ts,Ln),fe("YYYYYY",Ts,Ln),st(["YYYYY","YYYYYY"],er),st("YYYY",function(d,y){y[er]=d.length===2?e.parseTwoDigitYear(d):De(d)}),st("YY",function(d,y){y[er]=e.parseTwoDigitYear(d)}),st("Y",function(d,y){y[er]=parseInt(d,10)});function Wo(d){return Rl(d)?366:365}e.parseTwoDigitYear=function(d){return De(d)+(De(d)>68?1900:2e3)};var Mp=$s("FullYear",!0);function Ev(){return Rl(this.year())}function $s(d,y){return function(S){return S!=null?(Jo(this,d,S),e.updateOffset(this,y),this):zo(this,d)}}function zo(d,y){if(!d.isValid())return NaN;var S=d._d,R=d._isUTC;switch(y){case"Milliseconds":return R?S.getUTCMilliseconds():S.getMilliseconds();case"Seconds":return R?S.getUTCSeconds():S.getSeconds();case"Minutes":return R?S.getUTCMinutes():S.getMinutes();case"Hours":return R?S.getUTCHours():S.getHours();case"Date":return R?S.getUTCDate():S.getDate();case"Day":return R?S.getUTCDay():S.getDay();case"Month":return R?S.getUTCMonth():S.getMonth();case"FullYear":return R?S.getUTCFullYear():S.getFullYear();default:return NaN}}function Jo(d,y,S){var R,I,L,Y,ae;if(!(!d.isValid()||isNaN(S))){switch(R=d._d,I=d._isUTC,y){case"Milliseconds":return void(I?R.setUTCMilliseconds(S):R.setMilliseconds(S));case"Seconds":return void(I?R.setUTCSeconds(S):R.setSeconds(S));case"Minutes":return void(I?R.setUTCMinutes(S):R.setMinutes(S));case"Hours":return void(I?R.setUTCHours(S):R.setHours(S));case"Date":return void(I?R.setUTCDate(S):R.setDate(S));case"FullYear":break;default:return}L=S,Y=d.month(),ae=d.date(),ae=ae===29&&Y===1&&!Rl(L)?28:ae,I?R.setUTCFullYear(L,Y,ae):R.setFullYear(L,Y,ae)}}function Iv(d){return d=Xt(d),B(this[d])?this[d]():this}function Cl(d,y){if(typeof d=="object"){d=wr(d);var S=yl(d),R,I=S.length;for(R=0;R<I;R++)this[S[R].unit](d[S[R].unit])}else if(d=Xt(d),B(this[d]))return this[d](y);return this}function qv(d,y){return(d%y+y)%y}var kt;Array.prototype.indexOf?kt=Array.prototype.indexOf:kt=function(d){var y;for(y=0;y<this.length;++y)if(this[y]===d)return y;return-1};function Fc(d,y){if(isNaN(d)||isNaN(y))return NaN;var S=qv(y,12);return d+=(y-S)/12,S===1?Rl(d)?29:28:31-S%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(d){return this.localeData().monthsShort(this,d)}),ce("MMMM",0,0,function(d){return this.localeData().months(this,d)}),fe("M",ht,Gi),fe("MM",ht,Jt),fe("MMM",function(d,y){return y.monthsShortRegex(d)}),fe("MMMM",function(d,y){return y.monthsRegex(d)}),st(["M","MM"],function(d,y){y[jn]=De(d)-1}),st(["MMM","MMMM"],function(d,y,S,R){var I=S._locale.monthsParse(d,R,S._strict);I!=null?y[jn]=I:_(S).invalidMonth=d});var Fp="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("_"),Lc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ov=Bo,kv=Bo;function Pv(d,y){return d?n(this._months)?this._months[d.month()]:this._months[(this._months.isFormat||Lc).test(y)?"format":"standalone"][d.month()]:n(this._months)?this._months:this._months.standalone}function Tv(d,y){return d?n(this._monthsShort)?this._monthsShort[d.month()]:this._monthsShort[Lc.test(y)?"format":"standalone"][d.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Dp(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)L=g([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(L,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(L,"").toLocaleLowerCase();return S?y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null):y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null)):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null))}function Lp(d,y,S){var R,I,L;if(this._monthsParseExact)return Dp.call(this,d,y,S);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(I=g([2e3,R]),S&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(I,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(I,"").replace(".","")+"$","i")),!S&&!this._monthsParse[R]&&(L="^"+this.months(I,"")+"|^"+this.monthsShort(I,""),this._monthsParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="MMMM"&&this._longMonthsParse[R].test(d))return R;if(S&&y==="MMM"&&this._shortMonthsParse[R].test(d))return R;if(!S&&this._monthsParse[R].test(d))return R}}function jc(d,y){if(!d.isValid())return d;if(typeof y=="string"){if(/^\d+$/.test(y))y=De(y);else if(y=d.localeData().monthsParse(y),!f(y))return d}var S=y,R=d.date();return R=R<29?R:Math.min(R,Fc(d.year(),S)),d._isUTC?d._d.setUTCMonth(S,R):d._d.setMonth(S,R),d}function xl(d){return d!=null?(jc(this,d),e.updateOffset(this,!0),this):zo(this,"Month")}function Av(){return Fc(this.year(),this.month())}function jp(d){return this._monthsParseExact?(s(this,"_monthsRegex")||Uc.call(this),d?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Ov),this._monthsShortStrictRegex&&d?this._monthsShortStrictRegex:this._monthsShortRegex)}function El(d){return this._monthsParseExact?(s(this,"_monthsRegex")||Uc.call(this),d?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=kv),this._monthsStrictRegex&&d?this._monthsStrictRegex:this._monthsRegex)}function Uc(){function d(Re,je){return je.length-Re.length}var y=[],S=[],R=[],I,L,Y,ae;for(I=0;I<12;I++)L=g([2e3,I]),Y=gn(this.monthsShort(L,"")),ae=gn(this.months(L,"")),y.push(Y),S.push(ae),R.push(ae),R.push(Y);y.sort(d),S.sort(d),R.sort(d),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+y.join("|")+")","i")}function $v(d,y,S,R,I,L,Y){var ae;return d<100&&d>=0?(ae=new Date(d+400,y,S,R,I,L,Y),isFinite(ae.getFullYear())&&ae.setFullYear(d)):ae=new Date(d,y,S,R,I,L,Y),ae}function Ns(d){var y,S;return d<100&&d>=0?(S=Array.prototype.slice.call(arguments),S[0]=d+400,y=new Date(Date.UTC.apply(null,S)),isFinite(y.getUTCFullYear())&&y.setUTCFullYear(d)):y=new Date(Date.UTC.apply(null,arguments)),y}function Go(d,y,S){var R=7+y-S,I=(7+Ns(d,0,R).getUTCDay()-y)%7;return-I+R-1}function Il(d,y,S,R,I){var L=(7+S-R)%7,Y=Go(d,R,I),ae=1+7*(y-1)+L+Y,Re,je;return ae<=0?(Re=d-1,je=Wo(Re)+ae):ae>Wo(d)?(Re=d+1,je=ae-Wo(d)):(Re=d,je=ae),{year:Re,dayOfYear:je}}function Yo(d,y,S){var R=Go(d.year(),y,S),I=Math.floor((d.dayOfYear()-R-1)/7)+1,L,Y;return I<1?(Y=d.year()-1,L=I+vn(Y,y,S)):I>vn(d.year(),y,S)?(L=I-vn(d.year(),y,S),Y=d.year()+1):(Y=d.year(),L=I),{week:L,year:Y}}function vn(d,y,S){var R=Go(d,y,S),I=Go(d+1,y,S);return(Wo(d)-R+I)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),fe("w",ht,Gi),fe("ww",ht,Jt),fe("W",ht,Gi),fe("WW",ht,Jt),Vo(["w","ww","W","WW"],function(d,y,S,R){y[R.substr(0,1)]=De(d)});function Hc(d){return Yo(d,this._week.dow,this._week.doy).week}var Bc={dow:0,doy:6};function Ms(){return this._week.dow}function Up(){return this._week.doy}function Hp(d){var y=this.localeData().week(this);return d==null?y:this.add((d-y)*7,"d")}function Nv(d){var y=Yo(this,1,4).week;return d==null?y:this.add((d-y)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(d){return this.localeData().weekdaysMin(this,d)}),ce("ddd",0,0,function(d){return this.localeData().weekdaysShort(this,d)}),ce("dddd",0,0,function(d){return this.localeData().weekdays(this,d)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),fe("d",ht),fe("e",ht),fe("E",ht),fe("dd",function(d,y){return y.weekdaysMinRegex(d)}),fe("ddd",function(d,y){return y.weekdaysShortRegex(d)}),fe("dddd",function(d,y){return y.weekdaysRegex(d)}),Vo(["dd","ddd","dddd"],function(d,y,S,R){var I=S._locale.weekdaysParse(d,R,S._strict);I!=null?y.d=I:_(S).invalidWeekday=d}),Vo(["d","e","E"],function(d,y,S,R){y[R]=De(d)});function Bp(d,y){return typeof d!="string"?d:isNaN(d)?(d=y.weekdaysParse(d),typeof d=="number"?d:null):parseInt(d,10)}function Vp(d,y){return typeof d=="string"?y.weekdaysParse(d)%7||7:isNaN(d)?null:d}function ql(d,y){return d.slice(y,7).concat(d.slice(0,y))}var Wp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),zp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Mv="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Fv=Bo,Jp=Bo,Dv=Bo;function Lv(d,y){var S=n(this._weekdays)?this._weekdays:this._weekdays[d&&d!==!0&&this._weekdays.isFormat.test(y)?"format":"standalone"];return d===!0?ql(S,this._week.dow):d?S[d.day()]:S}function jv(d){return d===!0?ql(this._weekdaysShort,this._week.dow):d?this._weekdaysShort[d.day()]:this._weekdaysShort}function Uv(d){return d===!0?ql(this._weekdaysMin,this._week.dow):d?this._weekdaysMin[d.day()]:this._weekdaysMin}function Vc(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)L=g([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(L,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(L,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(L,"").toLocaleLowerCase();return S?y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1?I:null):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null):(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null):y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1||(I=kt.call(this._shortWeekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):(I=kt.call(this._minWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null))}function Hv(d,y,S){var R,I,L;if(this._weekdaysParseExact)return Vc.call(this,d,y,S);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(I=g([2e3,1]).day(R),S&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(I,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(I,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(I,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(L="^"+this.weekdays(I,"")+"|^"+this.weekdaysShort(I,"")+"|^"+this.weekdaysMin(I,""),this._weekdaysParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="dddd"&&this._fullWeekdaysParse[R].test(d))return R;if(S&&y==="ddd"&&this._shortWeekdaysParse[R].test(d))return R;if(S&&y==="dd"&&this._minWeekdaysParse[R].test(d))return R;if(!S&&this._weekdaysParse[R].test(d))return R}}function Bv(d){if(!this.isValid())return d!=null?this:NaN;var y=zo(this,"Day");return d!=null?(d=Bp(d,this.localeData()),this.add(d-y,"d")):y}function Vv(d){if(!this.isValid())return d!=null?this:NaN;var y=(this.day()+7-this.localeData()._week.dow)%7;return d==null?y:this.add(d-y,"d")}function Wv(d){if(!this.isValid())return d!=null?this:NaN;if(d!=null){var y=Vp(d,this.localeData());return this.day(this.day()%7?y:y-7)}else return this.day()||7}function zv(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Wc.call(this),d?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Fv),this._weekdaysStrictRegex&&d?this._weekdaysStrictRegex:this._weekdaysRegex)}function St(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Wc.call(this),d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Jp),this._weekdaysShortStrictRegex&&d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Wc.call(this),d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Dv),this._weekdaysMinStrictRegex&&d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wc(){function d(Ht,Jn){return Jn.length-Ht.length}var y=[],S=[],R=[],I=[],L,Y,ae,Re,je;for(L=0;L<7;L++)Y=g([2e3,1]).day(L),ae=gn(this.weekdaysMin(Y,"")),Re=gn(this.weekdaysShort(Y,"")),je=gn(this.weekdays(Y,"")),y.push(ae),S.push(Re),R.push(je),I.push(ae),I.push(Re),I.push(je);y.sort(d),S.sort(d),R.sort(d),I.sort(d),this._weekdaysRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+y.join("|")+")","i")}function zc(){return this.hours()%12||12}function Jv(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,zc),ce("k",["kk",2],0,Jv),ce("hmm",0,0,function(){return""+zc.apply(this)+de(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+zc.apply(this)+de(this.minutes(),2)+de(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+de(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+de(this.minutes(),2)+de(this.seconds(),2)});function Gp(d,y){ce(d,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),y)})}Gp("a",!0),Gp("A",!1);function Yp(d,y){return y._meridiemParse}fe("a",Yp),fe("A",Yp),fe("H",ht,wl),fe("h",ht,Gi),fe("k",ht,Gi),fe("HH",ht,Jt),fe("hh",ht,Jt),fe("kk",ht,Jt),fe("hmm",vl),fe("hmmss",bl),fe("Hmm",vl),fe("Hmmss",bl),st(["H","HH"],Ft),st(["k","kk"],function(d,y,S){var R=De(d);y[Ft]=R===24?0:R}),st(["a","A"],function(d,y,S){S._isPm=S._locale.isPM(d),S._meridiem=d}),st(["h","hh"],function(d,y,S){y[Ft]=De(d),_(S).bigHour=!0}),st("hmm",function(d,y,S){var R=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R)),_(S).bigHour=!0}),st("hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R,2)),y[Un]=De(d.substr(I)),_(S).bigHour=!0}),st("Hmm",function(d,y,S){var R=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R))}),st("Hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R,2)),y[Un]=De(d.substr(I))});function Gv(d){return(d+"").toLowerCase().charAt(0)==="p"}var Kp=/[ap]\.?m?\.?/i,Yv=$s("Hours",!0);function Ut(d,y,S){return d>11?S?"pm":"PM":S?"am":"AM"}var Ol={calendar:pe,longDateFormat:$r,invalidDate:Rt,ordinal:Lo,dayOfMonthOrdinalParse:Zt,relativeTime:wv,months:Fp,monthsShort:Dc,week:Bc,weekdays:Wp,weekdaysMin:Mv,weekdaysShort:zp,meridiemParse:Kp},ot={},Fs={},Ki;function Fr(d,y){var S,R=Math.min(d.length,y.length);for(S=0;S<R;S+=1)if(d[S]!==y[S])return S;return R}function Jc(d){return d&&d.toLowerCase().replace("_","-")}function Qp(d){for(var y=0,S,R,I,L;y<d.length;){for(L=Jc(d[y]).split("-"),S=L.length,R=Jc(d[y+1]),R=R?R.split("-"):null;S>0;){if(I=Ko(L.slice(0,S).join("-")),I)return I;if(R&&R.length>=S&&Fr(L,R)>=S-1)break;S--}y++}return Ki}function Zp(d){return!!(d&&d.match("^[^/\\\\]*$"))}function Ko(d){var y=null,S;if(ot[d]===void 0&&typeof yu<"u"&&yu&&yu.exports&&Zp(d))try{y=Ki._abbr,S=require,S("./locale/"+d),Hn(y)}catch{ot[d]=null}return ot[d]}function Hn(d,y){var S;return d&&(l(y)?S=Bn(d):S=kl(d,y),S?Ki=S:typeof console<"u"&&console.warn&&console.warn("Locale "+d+" not found. Did you forget to load it?")),Ki._abbr}function kl(d,y){if(y!==null){var S,R=Ol;if(y.abbr=d,ot[d]!=null)D("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."),R=ot[d]._config;else if(y.parentLocale!=null)if(ot[y.parentLocale]!=null)R=ot[y.parentLocale]._config;else if(S=Ko(y.parentLocale),S!=null)R=S._config;else return Fs[y.parentLocale]||(Fs[y.parentLocale]=[]),Fs[y.parentLocale].push({name:d,config:y}),null;return ot[d]=new ee(K(R,y)),Fs[d]&&Fs[d].forEach(function(I){kl(I.name,I.config)}),Hn(d),ot[d]}else return delete ot[d],null}function _r(d,y){if(y!=null){var S,R,I=Ol;ot[d]!=null&&ot[d].parentLocale!=null?ot[d].set(K(ot[d]._config,y)):(R=Ko(d),R!=null&&(I=R._config),y=K(I,y),R==null&&(y.abbr=d),S=new ee(y),S.parentLocale=ot[d],ot[d]=S),Hn(d)}else ot[d]!=null&&(ot[d].parentLocale!=null?(ot[d]=ot[d].parentLocale,d===Hn()&&Hn(d)):ot[d]!=null&&delete ot[d]);return ot[d]}function Bn(d){var y;if(d&&d._locale&&d._locale._abbr&&(d=d._locale._abbr),!d)return Ki;if(!n(d)){if(y=Ko(d),y)return y;d=[d]}return Qp(d)}function Rr(){return ie(ot)}function Gc(d){var y,S=d._a;return S&&_(d).overflow===-2&&(y=S[jn]<0||S[jn]>11?jn:S[yn]<1||S[yn]>Fc(S[er],S[jn])?yn:S[Ft]<0||S[Ft]>24||S[Ft]===24&&(S[Mr]!==0||S[Un]!==0||S[Yi]!==0)?Ft:S[Mr]<0||S[Mr]>59?Mr:S[Un]<0||S[Un]>59?Un:S[Yi]<0||S[Yi]>999?Yi:-1,_(d)._overflowDayOfYear&&(y<er||y>yn)&&(y=yn),_(d)._overflowWeeks&&y===-1&&(y=Np),_(d)._overflowWeekday&&y===-1&&(y=xv),_(d).overflow=y),d}var Xp=/^\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)?)?$/,bi=/^\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)?)?$/,Pl=/Z|[+-]\d\d(?::?\d\d)?/,Ds=[["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]],yt=[["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/]],Si=/^\/?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}))$/,Kv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tl(d){var y,S,R=d._i,I=Xp.exec(R)||bi.exec(R),L,Y,ae,Re,je=Ds.length,Ht=yt.length;if(I){for(_(d).iso=!0,y=0,S=je;y<S;y++)if(Ds[y][1].exec(I[1])){Y=Ds[y][0],L=Ds[y][2]!==!1;break}if(Y==null){d._isValid=!1;return}if(I[3]){for(y=0,S=Ht;y<S;y++)if(yt[y][1].exec(I[3])){ae=(I[2]||" ")+yt[y][0];break}if(ae==null){d._isValid=!1;return}}if(!L&&ae!=null){d._isValid=!1;return}if(I[4])if(Pl.exec(I[4]))Re="Z";else{d._isValid=!1;return}d._f=Y+(ae||"")+(Re||""),$l(d)}else d._isValid=!1}function Qv(d,y,S,R,I,L){var Y=[Zv(d),Dc.indexOf(y),parseInt(S,10),parseInt(R,10),parseInt(I,10)];return L&&Y.push(parseInt(L,10)),Y}function Zv(d){var y=parseInt(d,10);return y<=49?2e3+y:y<=999?1900+y:y}function Xv(d){return d.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function eh(d,y,S){if(d){var R=zp.indexOf(d),I=new Date(y[0],y[1],y[2]).getDay();if(R!==I)return _(S).weekdayMismatch=!0,S._isValid=!1,!1}return!0}function Al(d,y,S){if(d)return Kv[d];if(y)return 0;var R=parseInt(S,10),I=R%100,L=(R-I)/100;return L*60+I}function Qi(d){var y=Yc.exec(Xv(d._i)),S;if(y){if(S=Qv(y[4],y[3],y[2],y[5],y[6],y[7]),!eh(y[1],S,d))return;d._a=S,d._tzm=Al(y[8],y[9],y[10]),d._d=Ns.apply(null,d._a),d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),_(d).rfc2822=!0}else d._isValid=!1}function eb(d){var y=Si.exec(d._i);if(y!==null){d._d=new Date(+y[1]);return}if(Tl(d),d._isValid===!1)delete d._isValid;else return;if(Qi(d),d._isValid===!1)delete d._isValid;else return;d._strict?d._isValid=!1:e.createFromInputFallback(d)}e.createFromInputFallback=C("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(d){d._d=new Date(d._i+(d._useUTC?" UTC":""))});function Zi(d,y,S){return d??y??S}function th(d){var y=new Date(e.now());return d._useUTC?[y.getUTCFullYear(),y.getUTCMonth(),y.getUTCDate()]:[y.getFullYear(),y.getMonth(),y.getDate()]}function Qo(d){var y,S,R=[],I,L,Y;if(!d._d){for(I=th(d),d._w&&d._a[yn]==null&&d._a[jn]==null&&Kc(d),d._dayOfYear!=null&&(Y=Zi(d._a[er],I[er]),(d._dayOfYear>Wo(Y)||d._dayOfYear===0)&&(_(d)._overflowDayOfYear=!0),S=Ns(Y,0,d._dayOfYear),d._a[jn]=S.getUTCMonth(),d._a[yn]=S.getUTCDate()),y=0;y<3&&d._a[y]==null;++y)d._a[y]=R[y]=I[y];for(;y<7;y++)d._a[y]=R[y]=d._a[y]==null?y===2?1:0:d._a[y];d._a[Ft]===24&&d._a[Mr]===0&&d._a[Un]===0&&d._a[Yi]===0&&(d._nextDay=!0,d._a[Ft]=0),d._d=(d._useUTC?Ns:$v).apply(null,R),L=d._useUTC?d._d.getUTCDay():d._d.getDay(),d._tzm!=null&&d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),d._nextDay&&(d._a[Ft]=24),d._w&&typeof d._w.d<"u"&&d._w.d!==L&&(_(d).weekdayMismatch=!0)}}function Kc(d){var y,S,R,I,L,Y,ae,Re,je;y=d._w,y.GG!=null||y.W!=null||y.E!=null?(L=1,Y=4,S=Zi(y.GG,d._a[er],Yo(ut(),1,4).year),R=Zi(y.W,1),I=Zi(y.E,1),(I<1||I>7)&&(Re=!0)):(L=d._locale._week.dow,Y=d._locale._week.doy,je=Yo(ut(),L,Y),S=Zi(y.gg,d._a[er],je.year),R=Zi(y.w,je.week),y.d!=null?(I=y.d,(I<0||I>6)&&(Re=!0)):y.e!=null?(I=y.e+L,(y.e<0||y.e>6)&&(Re=!0)):I=L),R<1||R>vn(S,L,Y)?_(d)._overflowWeeks=!0:Re!=null?_(d)._overflowWeekday=!0:(ae=Il(S,R,I,L,Y),d._a[er]=ae.year,d._dayOfYear=ae.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function $l(d){if(d._f===e.ISO_8601){Tl(d);return}if(d._f===e.RFC_2822){Qi(d);return}d._a=[],_(d).empty=!0;var y=""+d._i,S,R,I,L,Y,ae=y.length,Re=0,je,Ht;for(I=en(d._f,d._locale).match(le)||[],Ht=I.length,S=0;S<Ht;S++)L=I[S],R=(y.match(Rv(L,d))||[])[0],R&&(Y=y.substr(0,y.indexOf(R)),Y.length>0&&_(d).unusedInput.push(Y),y=y.slice(y.indexOf(R)+R.length),Re+=R.length),mt[L]?(R?_(d).empty=!1:_(d).unusedTokens.push(L),Mc(L,R,d)):d._strict&&!R&&_(d).unusedTokens.push(L);_(d).charsLeftOver=ae-Re,y.length>0&&_(d).unusedInput.push(y),d._a[Ft]<=12&&_(d).bigHour===!0&&d._a[Ft]>0&&(_(d).bigHour=void 0),_(d).parsedDateParts=d._a.slice(0),_(d).meridiem=d._meridiem,d._a[Ft]=tb(d._locale,d._a[Ft],d._meridiem),je=_(d).era,je!==null&&(d._a[er]=d._locale.erasConvertYear(je,d._a[er])),Qo(d),Gc(d)}function tb(d,y,S){var R;return S==null?y:d.meridiemHour!=null?d.meridiemHour(y,S):(d.isPM!=null&&(R=d.isPM(S),R&&y<12&&(y+=12),!R&&y===12&&(y=0)),y)}function Qc(d){var y,S,R,I,L,Y,ae=!1,Re=d._f.length;if(Re===0){_(d).invalidFormat=!0,d._d=new Date(NaN);return}for(I=0;I<Re;I++)L=0,Y=!1,y=$({},d),d._useUTC!=null&&(y._useUTC=d._useUTC),y._f=d._f[I],$l(y),E(y)&&(Y=!0),L+=_(y).charsLeftOver,L+=_(y).unusedTokens.length*10,_(y).score=L,ae?L<R&&(R=L,S=y):(R==null||L<R||Y)&&(R=L,S=y,Y&&(ae=!0));h(d,S||y)}function Zc(d){if(!d._d){var y=wr(d._i),S=y.day===void 0?y.date:y.day;d._a=p([y.year,y.month,S,y.hour,y.minute,y.second,y.millisecond],function(R){return R&&parseInt(R,10)}),Qo(d)}}function rb(d){var y=new j(Gc(Xc(d)));return y._nextDay&&(y.add(1,"d"),y._nextDay=void 0),y}function Xc(d){var y=d._i,S=d._f;return d._locale=d._locale||Bn(d._l),y===null||S===void 0&&y===""?k({nullInput:!0}):(typeof y=="string"&&(d._i=y=d._locale.preparse(y)),G(y)?new j(Gc(y)):(c(y)?d._d=y:n(S)?Qc(d):S?$l(d):Cr(d),E(d)||(d._d=null),d))}function Cr(d){var y=d._i;l(y)?d._d=new Date(e.now()):c(y)?d._d=new Date(y.valueOf()):typeof y=="string"?eb(d):n(y)?(d._a=p(y.slice(0),function(S){return parseInt(S,10)}),Qo(d)):i(y)?Zc(d):f(y)?d._d=new Date(y):e.createFromInputFallback(d)}function Nl(d,y,S,R,I){var L={};return(y===!0||y===!1)&&(R=y,y=void 0),(S===!0||S===!1)&&(R=S,S=void 0),(i(d)&&o(d)||n(d)&&d.length===0)&&(d=void 0),L._isAMomentObject=!0,L._useUTC=L._isUTC=I,L._l=S,L._i=d,L._f=y,L._strict=R,rb(L)}function ut(d,y,S,R){return Nl(d,y,S,R,!1)}var rh=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=ut.apply(null,arguments);return this.isValid()&&d.isValid()?d<this?this:d:k()}),nh=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=ut.apply(null,arguments);return this.isValid()&&d.isValid()?d>this?this:d:k()});function ih(d,y){var S,R;if(y.length===1&&n(y[0])&&(y=y[0]),!y.length)return ut();for(S=y[0],R=1;R<y.length;++R)(!y[R].isValid()||y[R][d](S))&&(S=y[R]);return S}function nb(){var d=[].slice.call(arguments,0);return ih("isBefore",d)}function ib(){var d=[].slice.call(arguments,0);return ih("isAfter",d)}var sb=function(){return Date.now?Date.now():+new Date},Zo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ls(d){var y,S=!1,R,I=Zo.length;for(y in d)if(s(d,y)&&!(kt.call(Zo,y)!==-1&&(d[y]==null||!isNaN(d[y]))))return!1;for(R=0;R<I;++R)if(d[Zo[R]]){if(S)return!1;parseFloat(d[Zo[R]])!==De(d[Zo[R]])&&(S=!0)}return!0}function ob(){return this._isValid}function ab(){return ct(NaN)}function js(d){var y=wr(d),S=y.year||0,R=y.quarter||0,I=y.month||0,L=y.week||y.isoWeek||0,Y=y.day||0,ae=y.hour||0,Re=y.minute||0,je=y.second||0,Ht=y.millisecond||0;this._isValid=Ls(y),this._milliseconds=+Ht+je*1e3+Re*6e4+ae*1e3*60*60,this._days=+Y+L*7,this._months=+I+R*3+S*12,this._data={},this._locale=Bn(),this._bubble()}function Xo(d){return d instanceof js}function bn(d){return d<0?Math.round(-1*d)*-1:Math.round(d)}function Ml(d,y,S){var R=Math.min(d.length,y.length),I=Math.abs(d.length-y.length),L=0,Y;for(Y=0;Y<R;Y++)(S&&d[Y]!==y[Y]||!S&&De(d[Y])!==De(y[Y]))&&L++;return L+I}function sh(d,y){ce(d,0,0,function(){var S=this.utcOffset(),R="+";return S<0&&(S=-S,R="-"),R+de(~~(S/60),2)+y+de(~~S%60,2)})}sh("Z",":"),sh("ZZ",""),fe("Z",Sl),fe("ZZ",Sl),st(["Z","ZZ"],function(d,y,S){S._useUTC=!0,S._tzm=ef(Sl,d)});var lb=/([\+\-]|\d\d)/gi;function ef(d,y){var S=(y||"").match(d),R,I,L;return S===null?null:(R=S[S.length-1]||[],I=(R+"").match(lb)||["-",0,0],L=+(I[1]*60)+De(I[2]),L===0?0:I[0]==="+"?L:-L)}function wi(d,y){var S,R;return y._isUTC?(S=y.clone(),R=(G(d)||c(d)?d.valueOf():ut(d).valueOf())-S.valueOf(),S._d.setTime(S._d.valueOf()+R),e.updateOffset(S,!1),S):ut(d).local()}function xr(d){return-Math.round(d._d.getTimezoneOffset())}e.updateOffset=function(){};function oh(d,y,S){var R=this._offset||0,I;if(!this.isValid())return d!=null?this:NaN;if(d!=null){if(typeof d=="string"){if(d=ef(Sl,d),d===null)return this}else Math.abs(d)<16&&!S&&(d=d*60);return!this._isUTC&&y&&(I=xr(this)),this._offset=d,this._isUTC=!0,I!=null&&this.add(I,"m"),R!==d&&(!y||this._changeInProgress?ea(this,ct(d-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:xr(this)}function ub(d,y){return d!=null?(typeof d!="string"&&(d=-d),this.utcOffset(d,y),this):-this.utcOffset()}function cb(d){return this.utcOffset(0,d)}function fb(d){return this._isUTC&&(this.utcOffset(0,d),this._isUTC=!1,d&&this.subtract(xr(this),"m")),this}function db(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var d=ef($c,this._i);d!=null?this.utcOffset(d):this.utcOffset(0,!0)}return this}function pb(d){return this.isValid()?(d=d?ut(d).utcOffset():0,(this.utcOffset()-d)%60===0):!1}function _i(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function V(){if(!l(this._isDSTShifted))return this._isDSTShifted;var d={},y;return $(d,this),d=Xc(d),d._a?(y=d._isUTC?g(d._a):ut(d._a),this._isDSTShifted=this.isValid()&&Ml(d._a,y.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Q(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ue(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ce=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,rt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ct(d,y){var S=d,R=null,I,L,Y;return Xo(d)?S={ms:d._milliseconds,d:d._days,M:d._months}:f(d)||!isNaN(+d)?(S={},y?S[y]=+d:S.milliseconds=+d):(R=Ce.exec(d))?(I=R[1]==="-"?-1:1,S={y:0,d:De(R[yn])*I,h:De(R[Ft])*I,m:De(R[Mr])*I,s:De(R[Un])*I,ms:De(bn(R[Yi]*1e3))*I}):(R=rt.exec(d))?(I=R[1]==="-"?-1:1,S={y:Je(R[2],I),M:Je(R[3],I),w:Je(R[4],I),d:Je(R[5],I),h:Je(R[6],I),m:Je(R[7],I),s:Je(R[8],I)}):S==null?S={}:typeof S=="object"&&("from"in S||"to"in S)&&(Y=hb(ut(S.from),ut(S.to)),S={},S.ms=Y.milliseconds,S.M=Y.months),L=new js(S),Xo(d)&&s(d,"_locale")&&(L._locale=d._locale),Xo(d)&&s(d,"_isValid")&&(L._isValid=d._isValid),L}ct.fn=js.prototype,ct.invalid=ab;function Je(d,y){var S=d&&parseFloat(d.replace(",","."));return(isNaN(S)?0:S)*y}function Fl(d,y){var S={};return S.months=y.month()-d.month()+(y.year()-d.year())*12,d.clone().add(S.months,"M").isAfter(y)&&--S.months,S.milliseconds=+y-+d.clone().add(S.months,"M"),S}function hb(d,y){var S;return d.isValid()&&y.isValid()?(y=wi(y,d),d.isBefore(y)?S=Fl(d,y):(S=Fl(y,d),S.milliseconds=-S.milliseconds,S.months=-S.months),S):{milliseconds:0,months:0}}function Er(d,y){return function(S,R){var I,L;return R!==null&&!isNaN(+R)&&(D(y,"moment()."+y+"(period, number) is deprecated. Please use moment()."+y+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),L=S,S=R,R=L),I=ct(S,R),ea(this,I,d),this}}function ea(d,y,S,R){var I=y._milliseconds,L=bn(y._days),Y=bn(y._months);d.isValid()&&(R=R??!0,Y&&jc(d,zo(d,"Month")+Y*S),L&&Jo(d,"Date",zo(d,"Date")+L*S),I&&d._d.setTime(d._d.valueOf()+I*S),R&&e.updateOffset(d,L||Y))}var mb=Er(1,"add"),Us=Er(-1,"subtract");function ta(d){return typeof d=="string"||d instanceof String}function Dl(d){return G(d)||c(d)||ta(d)||f(d)||gb(d)||at(d)||d===null||d===void 0}function at(d){var y=i(d)&&!o(d),S=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],I,L,Y=R.length;for(I=0;I<Y;I+=1)L=R[I],S=S||s(d,L);return y&&S}function gb(d){var y=n(d),S=!1;return y&&(S=d.filter(function(R){return!f(R)&&ta(d)}).length===0),y&&S}function ah(d){var y=i(d)&&!o(d),S=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],I,L;for(I=0;I<R.length;I+=1)L=R[I],S=S||s(d,L);return y&&S}function Ll(d,y){var S=d.diff(y,"days",!0);return S<-6?"sameElse":S<-1?"lastWeek":S<0?"lastDay":S<1?"sameDay":S<2?"nextDay":S<7?"nextWeek":"sameElse"}function yb(d,y){arguments.length===1&&(arguments[0]?Dl(arguments[0])?(d=arguments[0],y=void 0):ah(arguments[0])&&(y=arguments[0],d=void 0):(d=void 0,y=void 0));var S=d||ut(),R=wi(S,this).startOf("day"),I=e.calendarFormat(this,R)||"sameElse",L=y&&(B(y[I])?y[I].call(this,S):y[I]);return this.format(L||this.localeData().calendar(I,this,ut(S)))}function vb(){return new j(this)}function bb(d,y){var S=G(d)?d:ut(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()>S.valueOf():S.valueOf()<this.clone().startOf(y).valueOf()):!1}function jl(d,y){var S=G(d)?d:ut(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()<S.valueOf():this.clone().endOf(y).valueOf()<S.valueOf()):!1}function Ri(d,y,S,R){var I=G(d)?d:ut(d),L=G(y)?y:ut(y);return this.isValid()&&I.isValid()&&L.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(I,S):!this.isBefore(I,S))&&(R[1]===")"?this.isBefore(L,S):!this.isAfter(L,S))):!1}function Ul(d,y){var S=G(d)?d:ut(d),R;return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()===S.valueOf():(R=S.valueOf(),this.clone().startOf(y).valueOf()<=R&&R<=this.clone().endOf(y).valueOf())):!1}function lh(d,y){return this.isSame(d,y)||this.isAfter(d,y)}function Hl(d,y){return this.isSame(d,y)||this.isBefore(d,y)}function uh(d,y,S){var R,I,L;if(!this.isValid())return NaN;if(R=wi(d,this),!R.isValid())return NaN;switch(I=(R.utcOffset()-this.utcOffset())*6e4,y=Xt(y),y){case"year":L=ra(this,R)/12;break;case"month":L=ra(this,R);break;case"quarter":L=ra(this,R)/3;break;case"second":L=(this-R)/1e3;break;case"minute":L=(this-R)/6e4;break;case"hour":L=(this-R)/36e5;break;case"day":L=(this-R-I)/864e5;break;case"week":L=(this-R-I)/6048e5;break;default:L=this-R}return S?L:Nr(L)}function ra(d,y){if(d.date()<y.date())return-ra(y,d);var S=(y.year()-d.year())*12+(y.month()-d.month()),R=d.clone().add(S,"months"),I,L;return y-R<0?(I=d.clone().add(S-1,"months"),L=(y-R)/(R-I)):(I=d.clone().add(S+1,"months"),L=(y-R)/(I-R)),-(S+L)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Bl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ch(d){if(!this.isValid())return null;var y=d!==!0,S=y?this.clone().utc():this;return S.year()<0||S.year()>9999?it(S,y?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?y?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",it(S,"Z")):it(S,y?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function na(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var d="moment",y="",S,R,I,L;return this.isLocal()||(d=this.utcOffset()===0?"moment.utc":"moment.parseZone",y="Z"),S="["+d+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",I="-MM-DD[T]HH:mm:ss.SSS",L=y+'[")]',this.format(S+R+I+L)}function Xi(d){d||(d=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var y=it(this,d);return this.localeData().postformat(y)}function Vl(d,y){return this.isValid()&&(G(d)&&d.isValid()||ut(d).isValid())?ct({to:this,from:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Sb(d){return this.from(ut(),d)}function wb(d,y){return this.isValid()&&(G(d)&&d.isValid()||ut(d).isValid())?ct({from:this,to:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function _b(d){return this.to(ut(),d)}function ia(d){var y;return d===void 0?this._locale._abbr:(y=Bn(d),y!=null&&(this._locale=y),this)}var sa=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(d){return d===void 0?this.localeData():this.locale(d)});function Wl(){return this._locale}var zl=1e3,es=60*zl,Jl=60*es,fh=(365*400+97)*24*Jl;function Ct(d,y){return(d%y+y)%y}function Gt(d,y,S){return d<100&&d>=0?new Date(d+400,y,S)-fh:new Date(d,y,S).valueOf()}function dh(d,y,S){return d<100&&d>=0?Date.UTC(d+400,y,S)-fh:Date.UTC(d,y,S)}function Rb(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?dh:Gt,d){case"year":y=S(this.year(),0,1);break;case"quarter":y=S(this.year(),this.month()-this.month()%3,1);break;case"month":y=S(this.year(),this.month(),1);break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":y=S(this.year(),this.month(),this.date());break;case"hour":y=this._d.valueOf(),y-=Ct(y+(this._isUTC?0:this.utcOffset()*es),Jl);break;case"minute":y=this._d.valueOf(),y-=Ct(y,es);break;case"second":y=this._d.valueOf(),y-=Ct(y,zl);break}return this._d.setTime(y),e.updateOffset(this,!0),this}function ph(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?dh:Gt,d){case"year":y=S(this.year()+1,0,1)-1;break;case"quarter":y=S(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":y=S(this.year(),this.month()+1,1)-1;break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":y=S(this.year(),this.month(),this.date()+1)-1;break;case"hour":y=this._d.valueOf(),y+=Jl-Ct(y+(this._isUTC?0:this.utcOffset()*es),Jl)-1;break;case"minute":y=this._d.valueOf(),y+=es-Ct(y,es)-1;break;case"second":y=this._d.valueOf(),y+=zl-Ct(y,zl)-1;break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Cb(){return this._d.valueOf()-(this._offset||0)*6e4}function tf(){return Math.floor(this.valueOf()/1e3)}function oa(){return new Date(this.valueOf())}function rf(){var d=this;return[d.year(),d.month(),d.date(),d.hour(),d.minute(),d.second(),d.millisecond()]}function Hs(){var d=this;return{years:d.year(),months:d.month(),date:d.date(),hours:d.hours(),minutes:d.minutes(),seconds:d.seconds(),milliseconds:d.milliseconds()}}function aa(){return this.isValid()?this.toISOString():null}function la(){return E(this)}function Gl(){return h({},_(this))}function Bs(){return _(this).overflow}function xb(){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"),fe("N",cr),fe("NN",cr),fe("NNN",cr),fe("NNNN",Le),fe("NNNNN",kb),st(["N","NN","NNN","NNNN","NNNNN"],function(d,y,S,R){var I=S._locale.erasParse(d,R,S._strict);I?_(S).era=I:_(S).invalidEra=d}),fe("y",vi),fe("yy",vi),fe("yyy",vi),fe("yyyy",vi),fe("yo",Pb),st(["y","yy","yyy","yyyy"],er),st(["yo"],function(d,y,S,R){var I;S._locale._eraYearOrdinalRegex&&(I=d.match(S._locale._eraYearOrdinalRegex)),S._locale.eraYearOrdinalParse?y[er]=S._locale.eraYearOrdinalParse(d,I):y[er]=parseInt(d,10)});function Eb(d,y){var S,R,I,L=this._eras||Bn("en")._eras;for(S=0,R=L.length;S<R;++S)switch(typeof L[S].since==="string"&&(I=e(L[S].since).startOf("day"),L[S].since=I.valueOf()),typeof L[S].until){case"undefined":L[S].until=1/0;break;case"string":I=e(L[S].until).startOf("day").valueOf(),L[S].until=I.valueOf();break}return L}function Ib(d,y,S){var R,I,L=this.eras(),Y,ae,Re;for(d=d.toUpperCase(),R=0,I=L.length;R<I;++R)if(Y=L[R].name.toUpperCase(),ae=L[R].abbr.toUpperCase(),Re=L[R].narrow.toUpperCase(),S)switch(y){case"N":case"NN":case"NNN":if(ae===d)return L[R];break;case"NNNN":if(Y===d)return L[R];break;case"NNNNN":if(Re===d)return L[R];break}else if([Y,ae,Re].indexOf(d)>=0)return L[R]}function qb(d,y){var S=d.since<=d.until?1:-1;return y===void 0?e(d.since).year():e(d.since).year()+(y-d.offset)*S}function Ob(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].name;return""}function Yl(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].narrow;return""}function ua(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].abbr;return""}function hh(){var d,y,S,R,I=this.localeData().eras();for(d=0,y=I.length;d<y;++d)if(S=I[d].since<=I[d].until?1:-1,R=this.clone().startOf("day").valueOf(),I[d].since<=R&&R<=I[d].until||I[d].until<=R&&R<=I[d].since)return(this.year()-e(I[d].since).year())*S+I[d].offset;return this.year()}function q(d){return s(this,"_erasNameRegex")||nf.call(this),d?this._erasNameRegex:this._erasRegex}function Vs(d){return s(this,"_erasAbbrRegex")||nf.call(this),d?this._erasAbbrRegex:this._erasRegex}function Kl(d){return s(this,"_erasNarrowRegex")||nf.call(this),d?this._erasNarrowRegex:this._erasRegex}function cr(d,y){return y.erasAbbrRegex(d)}function Le(d,y){return y.erasNameRegex(d)}function kb(d,y){return y.erasNarrowRegex(d)}function Pb(d,y){return y._eraYearOrdinalRegex||vi}function nf(){var d=[],y=[],S=[],R=[],I,L,Y,ae,Re,je=this.eras();for(I=0,L=je.length;I<L;++I)Y=gn(je[I].name),ae=gn(je[I].abbr),Re=gn(je[I].narrow),y.push(Y),d.push(ae),S.push(Re),R.push(Y),R.push(ae),R.push(Re);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+y.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+S.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Sn(d,y){ce(0,[d,d.length],0,y)}Sn("gggg","weekYear"),Sn("ggggg","weekYear"),Sn("GGGG","isoWeekYear"),Sn("GGGGG","isoWeekYear"),fe("G",As),fe("g",As),fe("GG",ht,Jt),fe("gg",ht,Jt),fe("GGGG",Ho,Ji),fe("gggg",Ho,Ji),fe("GGGGG",Ts,Ln),fe("ggggg",Ts,Ln),Vo(["gggg","ggggg","GGGG","GGGGG"],function(d,y,S,R){y[R.substr(0,2)]=De(d)}),Vo(["gg","GG"],function(d,y,S,R){y[R]=e.parseTwoDigitYear(d)});function Tb(d){return mh.call(this,d,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Ab(d){return mh.call(this,d,this.isoWeek(),this.isoWeekday(),1,4)}function $b(){return vn(this.year(),1,4)}function Nb(){return vn(this.isoWeekYear(),1,4)}function Mb(){var d=this.localeData()._week;return vn(this.year(),d.dow,d.doy)}function Vn(){var d=this.localeData()._week;return vn(this.weekYear(),d.dow,d.doy)}function mh(d,y,S,R,I){var L;return d==null?Yo(this,R,I).year:(L=vn(d,R,I),y>L&&(y=L),Fb.call(this,d,y,S,R,I))}function Fb(d,y,S,R,I){var L=Il(d,y,S,R,I),Y=Ns(L.year,0,L.dayOfYear);return this.year(Y.getUTCFullYear()),this.month(Y.getUTCMonth()),this.date(Y.getUTCDate()),this}ce("Q",0,"Qo","quarter"),fe("Q",Ap),st("Q",function(d,y){y[jn]=(De(d)-1)*3});function Db(d){return d==null?Math.ceil((this.month()+1)/3):this.month((d-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),fe("D",ht,Gi),fe("DD",ht,Jt),fe("Do",function(d,y){return d?y._dayOfMonthOrdinalParse||y._ordinalParse:y._dayOfMonthOrdinalParseLenient}),st(["D","DD"],yn),st("Do",function(d,y){y[yn]=De(d.match(ht)[0])});var gh=$s("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),fe("DDD",Ps),fe("DDDD",$p),st(["DDD","DDDD"],function(d,y,S){S._dayOfYear=De(d)});function Lb(d){var y=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return d==null?y:this.add(d-y,"d")}ce("m",["mm",2],0,"minute"),fe("m",ht,wl),fe("mm",ht,Jt),st(["m","mm"],Mr);var Wn=$s("Minutes",!1);ce("s",["ss",2],0,"second"),fe("s",ht,wl),fe("ss",ht,Jt),st(["s","ss"],Un);var jb=$s("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}),fe("S",Ps,Ap),fe("SS",Ps,Jt),fe("SSS",Ps,$p);var Ci,yh;for(Ci="SSSS";Ci.length<=9;Ci+="S")fe(Ci,vi);function Ub(d,y){y[Yi]=De(("0."+d)*1e3)}for(Ci="S";Ci.length<=9;Ci+="S")st(Ci,Ub);yh=$s("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function Hb(){return this._isUTC?"UTC":""}function ts(){return this._isUTC?"Coordinated Universal Time":""}var re=j.prototype;re.add=mb,re.calendar=yb,re.clone=vb,re.diff=uh,re.endOf=ph,re.format=Xi,re.from=Vl,re.fromNow=Sb,re.to=wb,re.toNow=_b,re.get=Iv,re.invalidAt=Bs,re.isAfter=bb,re.isBefore=jl,re.isBetween=Ri,re.isSame=Ul,re.isSameOrAfter=lh,re.isSameOrBefore=Hl,re.isValid=la,re.lang=sa,re.locale=ia,re.localeData=Wl,re.max=nh,re.min=rh,re.parsingFlags=Gl,re.set=Cl,re.startOf=Rb,re.subtract=Us,re.toArray=rf,re.toObject=Hs,re.toDate=oa,re.toISOString=ch,re.inspect=na,typeof Symbol<"u"&&Symbol.for!=null&&(re[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),re.toJSON=aa,re.toString=Bl,re.unix=tf,re.valueOf=Cb,re.creationData=xb,re.eraName=Ob,re.eraNarrow=Yl,re.eraAbbr=ua,re.eraYear=hh,re.year=Mp,re.isLeapYear=Ev,re.weekYear=Tb,re.isoWeekYear=Ab,re.quarter=re.quarters=Db,re.month=xl,re.daysInMonth=Av,re.week=re.weeks=Hp,re.isoWeek=re.isoWeeks=Nv,re.weeksInYear=Mb,re.weeksInWeekYear=Vn,re.isoWeeksInYear=$b,re.isoWeeksInISOWeekYear=Nb,re.date=gh,re.day=re.days=Bv,re.weekday=Vv,re.isoWeekday=Wv,re.dayOfYear=Lb,re.hour=re.hours=Yv,re.minute=re.minutes=Wn,re.second=re.seconds=jb,re.millisecond=re.milliseconds=yh,re.utcOffset=oh,re.utc=cb,re.local=fb,re.parseZone=db,re.hasAlignedHourOffset=pb,re.isDST=_i,re.isLocal=Q,re.isUtcOffset=z,re.isUtc=ue,re.isUTC=ue,re.zoneAbbr=Hb,re.zoneName=ts,re.dates=C("dates accessor is deprecated. Use date instead.",gh),re.months=C("months accessor is deprecated. Use month instead",xl),re.years=C("years accessor is deprecated. Use year instead",Mp),re.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ub),re.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",V);function Bb(d){return ut(d*1e3)}function tn(){return ut.apply(null,arguments).parseZone()}function vh(d){return d}var Qe=ee.prototype;Qe.calendar=Pe,Qe.longDateFormat=_t,Qe.invalidDate=mn,Qe.ordinal=jo,Qe.preparse=vh,Qe.postformat=vh,Qe.relativeTime=Dn,Qe.pastFuture=Pp,Qe.set=F,Qe.eras=Eb,Qe.erasParse=Ib,Qe.erasConvertYear=qb,Qe.erasAbbrRegex=Vs,Qe.erasNameRegex=q,Qe.erasNarrowRegex=Kl,Qe.months=Pv,Qe.monthsShort=Tv,Qe.monthsParse=Lp,Qe.monthsRegex=El,Qe.monthsShortRegex=jp,Qe.week=Hc,Qe.firstDayOfYear=Up,Qe.firstDayOfWeek=Ms,Qe.weekdays=Lv,Qe.weekdaysMin=Uv,Qe.weekdaysShort=jv,Qe.weekdaysParse=Hv,Qe.weekdaysRegex=zv,Qe.weekdaysShortRegex=St,Qe.weekdaysMinRegex=gt,Qe.isPM=Gv,Qe.meridiem=Ut;function Ql(d,y,S,R){var I=Bn(),L=g().set(R,y);return I[S](L,d)}function bh(d,y,S){if(f(d)&&(y=d,d=void 0),d=d||"",y!=null)return Ql(d,y,S,"month");var R,I=[];for(R=0;R<12;R++)I[R]=Ql(d,R,S,"month");return I}function sf(d,y,S,R){typeof d=="boolean"?(f(y)&&(S=y,y=void 0),y=y||""):(y=d,S=y,d=!1,f(y)&&(S=y,y=void 0),y=y||"");var I=Bn(),L=d?I._week.dow:0,Y,ae=[];if(S!=null)return Ql(y,(S+L)%7,R,"day");for(Y=0;Y<7;Y++)ae[Y]=Ql(y,(Y+L)%7,R,"day");return ae}function Sh(d,y){return bh(d,y,"months")}function wh(d,y){return bh(d,y,"monthsShort")}function Vb(d,y,S){return sf(d,y,S,"weekdays")}function Wb(d,y,S){return sf(d,y,S,"weekdaysShort")}function of(d,y,S){return sf(d,y,S,"weekdaysMin")}Hn("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(d){var y=d%10,S=De(d%100/10)===1?"th":y===1?"st":y===2?"nd":y===3?"rd":"th";return d+S}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",Hn),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Bn);var Ir=Math.abs;function Zl(){var d=this._data;return this._milliseconds=Ir(this._milliseconds),this._days=Ir(this._days),this._months=Ir(this._months),d.milliseconds=Ir(d.milliseconds),d.seconds=Ir(d.seconds),d.minutes=Ir(d.minutes),d.hours=Ir(d.hours),d.months=Ir(d.months),d.years=Ir(d.years),this}function _h(d,y,S,R){var I=ct(y,S);return d._milliseconds+=R*I._milliseconds,d._days+=R*I._days,d._months+=R*I._months,d._bubble()}function Rh(d,y){return _h(this,d,y,1)}function zb(d,y){return _h(this,d,y,-1)}function rn(d){return d<0?Math.floor(d):Math.ceil(d)}function af(){var d=this._milliseconds,y=this._days,S=this._months,R=this._data,I,L,Y,ae,Re;return d>=0&&y>=0&&S>=0||d<=0&&y<=0&&S<=0||(d+=rn(fr(S)+y)*864e5,y=0,S=0),R.milliseconds=d%1e3,I=Nr(d/1e3),R.seconds=I%60,L=Nr(I/60),R.minutes=L%60,Y=Nr(L/60),R.hours=Y%24,y+=Nr(Y/24),Re=Nr(xi(y)),S+=Re,y-=rn(fr(Re)),ae=Nr(S/12),S%=12,R.days=y,R.months=S,R.years=ae,this}function xi(d){return d*4800/146097}function fr(d){return d*146097/4800}function Jb(d){if(!this.isValid())return NaN;var y,S,R=this._milliseconds;if(d=Xt(d),d==="month"||d==="quarter"||d==="year")switch(y=this._days+R/864e5,S=this._months+xi(y),d){case"month":return S;case"quarter":return S/3;case"year":return S/12}else switch(y=this._days+Math.round(fr(this._months)),d){case"week":return y/7+R/6048e5;case"day":return y+R/864e5;case"hour":return y*24+R/36e5;case"minute":return y*1440+R/6e4;case"second":return y*86400+R/1e3;case"millisecond":return Math.floor(y*864e5)+R;default:throw new Error("Unknown unit "+d)}}function wn(d){return function(){return this.as(d)}}var lf=wn("ms"),ca=wn("s"),Ei=wn("m"),Ch=wn("h"),Gb=wn("d"),Xl=wn("w"),Yb=wn("M"),xh=wn("Q"),Yt=wn("y"),uf=lf;function Eh(){return ct(this)}function _n(d){return d=Xt(d),this.isValid()?this[d+"s"]():NaN}function zn(d){return function(){return this.isValid()?this._data[d]:NaN}}var eu=zn("milliseconds"),rs=zn("seconds"),Ih=zn("minutes"),nr=zn("hours"),cf=zn("days"),Kb=zn("months"),Qb=zn("years");function Zb(){return Nr(this.days()/7)}var nn=Math.round,Ws={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function fa(d,y,S,R,I){return I.relativeTime(y||1,!!S,d,R)}function qh(d,y,S,R){var I=ct(d).abs(),L=nn(I.as("s")),Y=nn(I.as("m")),ae=nn(I.as("h")),Re=nn(I.as("d")),je=nn(I.as("M")),Ht=nn(I.as("w")),Jn=nn(I.as("y")),Gn=L<=S.ss&&["s",L]||L<S.s&&["ss",L]||Y<=1&&["m"]||Y<S.m&&["mm",Y]||ae<=1&&["h"]||ae<S.h&&["hh",ae]||Re<=1&&["d"]||Re<S.d&&["dd",Re];return S.w!=null&&(Gn=Gn||Ht<=1&&["w"]||Ht<S.w&&["ww",Ht]),Gn=Gn||je<=1&&["M"]||je<S.M&&["MM",je]||Jn<=1&&["y"]||["yy",Jn],Gn[2]=y,Gn[3]=+d>0,Gn[4]=R,fa.apply(null,Gn)}function Xb(d){return d===void 0?nn:typeof d=="function"?(nn=d,!0):!1}function eS(d,y){return Ws[d]===void 0?!1:y===void 0?Ws[d]:(Ws[d]=y,d==="s"&&(Ws.ss=y-1),!0)}function da(d,y){if(!this.isValid())return this.localeData().invalidDate();var S=!1,R=Ws,I,L;return typeof d=="object"&&(y=d,d=!1),typeof d=="boolean"&&(S=d),typeof y=="object"&&(R=Object.assign({},Ws,y),y.s!=null&&y.ss==null&&(R.ss=y.s-1)),I=this.localeData(),L=qh(this,!S,R,I),S&&(L=I.pastFuture(+this,L)),I.postformat(L)}var ff=Math.abs;function zs(d){return(d>0)-(d<0)||+d}function Js(){if(!this.isValid())return this.localeData().invalidDate();var d=ff(this._milliseconds)/1e3,y=ff(this._days),S=ff(this._months),R,I,L,Y,ae=this.asSeconds(),Re,je,Ht,Jn;return ae?(R=Nr(d/60),I=Nr(R/60),d%=60,R%=60,L=Nr(S/12),S%=12,Y=d?d.toFixed(3).replace(/\.?0+$/,""):"",Re=ae<0?"-":"",je=zs(this._months)!==zs(ae)?"-":"",Ht=zs(this._days)!==zs(ae)?"-":"",Jn=zs(this._milliseconds)!==zs(ae)?"-":"",Re+"P"+(L?je+L+"Y":"")+(S?je+S+"M":"")+(y?Ht+y+"D":"")+(I||R||d?"T":"")+(I?Jn+I+"H":"")+(R?Jn+R+"M":"")+(d?Jn+Y+"S":"")):"P0D"}var Be=js.prototype;Be.isValid=ob,Be.abs=Zl,Be.add=Rh,Be.subtract=zb,Be.as=Jb,Be.asMilliseconds=lf,Be.asSeconds=ca,Be.asMinutes=Ei,Be.asHours=Ch,Be.asDays=Gb,Be.asWeeks=Xl,Be.asMonths=Yb,Be.asQuarters=xh,Be.asYears=Yt,Be.valueOf=uf,Be._bubble=af,Be.clone=Eh,Be.get=_n,Be.milliseconds=eu,Be.seconds=rs,Be.minutes=Ih,Be.hours=nr,Be.days=cf,Be.weeks=Zb,Be.months=Kb,Be.years=Qb,Be.humanize=da,Be.toISOString=Js,Be.toString=Js,Be.toJSON=Js,Be.locale=ia,Be.localeData=Wl,Be.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Js),Be.lang=sa,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),fe("x",As),fe("X",_v),st("X",function(d,y,S){S._d=new Date(parseFloat(d)*1e3)}),st("x",function(d,y,S){S._d=new Date(De(d))});return e.version="2.30.1",r(ut),e.fn=re,e.min=nb,e.max=ib,e.now=sb,e.utc=g,e.unix=Bb,e.months=Sh,e.isDate=c,e.locale=Hn,e.invalid=k,e.duration=ct,e.isMoment=G,e.weekdays=Vb,e.parseZone=tn,e.localeData=Bn,e.isDuration=Xo,e.monthsShort=wh,e.weekdaysMin=of,e.defineLocale=kl,e.updateLocale=_r,e.locales=Rr,e.weekdaysShort=Wb,e.normalizeUnits=Xt,e.relativeTimeRounding=Xb,e.relativeTimeThreshold=eS,e.calendarFormat=Ll,e.prototype=re,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 kI=H((OI,fm)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof fm<"u"&&fm.exports?fm.exports=e():t.tv4=e()})(OI,function(){Object.keys||(Object.keys=(function(){var O=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],D=A.length;return function(B){if(typeof B!="object"&&typeof B!="function"||B===null)throw new TypeError("Object.keys called on non-object");var F=[];for(var K in B)O.call(B,K)&&F.push(K);if(C)for(var ee=0;ee<D;ee++)O.call(B,A[ee])&&F.push(A[ee]);return F}})()),Object.create||(Object.create=(function(){function O(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return O.prototype=C,new O}})()),Array.isArray||(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(O){if(this===null)throw new TypeError;var C=Object(this),A=C.length>>>0;if(A===0)return-1;var D=0;if(arguments.length>1&&(D=Number(arguments[1]),D!==D?D=0:D!==0&&D!==1/0&&D!==-1/0&&(D=(D>0||-1)*Math.floor(Math.abs(D)))),D>=A)return-1;for(var B=D>=0?D:Math.max(A-Math.abs(D),0);B<A;B++)if(B in C&&C[B]===O)return B;return-1}),Object.isFrozen||(Object.isFrozen=function(O){for(var C="tv4_test_frozen_key";O.hasOwnProperty(C);)C+=Math.random();try{return O[C]=!0,delete O[C],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(O){return encodeURI(O).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(O){var C="";t[O.charAt(0)]&&(C=O.charAt(0),O=O.substring(1));var A="",D="",B=!0,F=!1,K=!1;C==="+"?B=!1:C==="."?(D=".",A="."):C==="/"?(D="/",A="/"):C==="#"?(D="#",B=!1):C===";"?(D=";",A=";",F=!0,K=!0):C==="?"?(D="?",A="&",F=!0):C==="&"&&(D="&",A="&",F=!0);for(var ee=[],ie=O.split(","),pe=[],Pe={},de=0;de<ie.length;de++){var le=ie[de],be=null;if(le.indexOf(":")!==-1){var ze=le.split(":");le=ze[0],be=parseInt(ze[1],10)}for(var mt={};e[le.charAt(le.length-1)];)mt[le.charAt(le.length-1)]=!0,le=le.substring(0,le.length-1);var ce={truncate:be,name:le,suffices:mt};pe.push(ce),Pe[le]=ce,ee.push(le)}var rr=function(Ne){for(var it="",en=0,$r=0;$r<pe.length;$r++){var _t=pe[$r],Rt=Ne(_t.name);if(Rt==null||Array.isArray(Rt)&&Rt.length===0||typeof Rt=="object"&&Object.keys(Rt).length===0){en++;continue}if($r===en?it+=D:it+=A||",",Array.isArray(Rt)){F&&(it+=_t.name+"=");for(var mn=0;mn<Rt.length;mn++)mn>0&&(it+=_t.suffices["*"]&&A||",",_t.suffices["*"]&&F&&(it+=_t.name+"=")),it+=B?encodeURIComponent(Rt[mn]).replace(/!/g,"%21"):r(Rt[mn])}else if(typeof Rt=="object"){F&&!_t.suffices["*"]&&(it+=_t.name+"=");var Lo=!0;for(var Zt in Rt)Lo||(it+=_t.suffices["*"]&&A||","),Lo=!1,it+=B?encodeURIComponent(Zt).replace(/!/g,"%21"):r(Zt),it+=_t.suffices["*"]?"=":",",it+=B?encodeURIComponent(Rt[Zt]).replace(/!/g,"%21"):r(Rt[Zt])}else F&&(it+=_t.name,(!K||Rt!=="")&&(it+="=")),_t.truncate!=null&&(Rt=Rt.substring(0,_t.truncate)),it+=B?encodeURIComponent(Rt).replace(/!/g,"%21"):r(Rt)}return it};return rr.varNames=ee,{prefix:D,substitution:rr}}function i(O){if(!(this instanceof i))return new i(O);for(var C=O.split("{"),A=[C.shift()],D=[],B=[],F=[];C.length>0;){var K=C.shift(),ee=K.split("}")[0],ie=K.substring(ee.length+1),pe=n(ee);B.push(pe.substitution),D.push(pe.prefix),A.push(ie),F=F.concat(pe.substitution.varNames)}this.fill=function(Pe){for(var de=A[0],le=0;le<B.length;le++){var be=B[le];de+=be(Pe),de+=A[le+1]}return de},this.varNames=F,this.template=O}i.prototype={toString:function(){return this.template},fillFromObject:function(O){return this.fill(function(C){return O[C]})}};var s=function(C,A,D,B,F){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,B&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),F&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=D||v("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var K in C.definedKeywords)this.definedKeywords[K]=C.definedKeywords[K].slice(0)};s.prototype.defineKeyword=function(O,C){this.definedKeywords[O]=this.definedKeywords[O]||[],this.definedKeywords[O].push(C)},s.prototype.createError=function(O,C,A,D,B,F,K){var ee=new T(O,C,A,D,B);return ee.message=this.errorReporter(ee,F,K),ee},s.prototype.returnError=function(O){return O},s.prototype.collectError=function(O){return O&&this.errors.push(O),null},s.prototype.prefixErrors=function(O,C,A){for(var D=O;D<this.errors.length;D++)this.errors[D]=this.errors[D].prefixWith(C,A);return this},s.prototype.banUnknownProperties=function(O,C){for(var A in this.unknownPropertyPaths){var D=this.createError(_.UNKNOWN_PROPERTY,{path:A},A,"",null,O,C),B=this.handleError(D);if(B)return B}return null},s.prototype.addFormat=function(O,C){if(typeof O=="object"){for(var A in O)this.addFormat(A,O[A]);return this}this.formatValidators[O]=C},s.prototype.resolveRefs=function(O,C){if(O.$ref!==void 0){if(C=C||{},C[O.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,O);C[O.$ref]=!0,O=this.getSchema(O.$ref,C)}return O},s.prototype.getSchema=function(O,C){var A;if(this.schemas[O]!==void 0)return A=this.schemas[O],this.resolveRefs(A,C);var D=O,B="";if(O.indexOf("#")!==-1&&(B=O.substring(O.indexOf("#")+1),D=O.substring(0,O.indexOf("#"))),typeof this.schemas[D]=="object"){A=this.schemas[D];var F=decodeURIComponent(B);if(F==="")return this.resolveRefs(A,C);if(F.charAt(0)!=="/")return;for(var K=F.split("/").slice(1),ee=0;ee<K.length;ee++){var ie=K[ee].replace(/~1/g,"/").replace(/~0/g,"~");if(A[ie]===void 0){A=void 0;break}A=A[ie]}if(A!==void 0)return this.resolveRefs(A,C)}this.missing[D]===void 0&&(this.missing.push(D),this.missing[D]=D,this.missingMap[D]=D)},s.prototype.searchSchemas=function(O,C){if(Array.isArray(O))for(var A=0;A<O.length;A++)this.searchSchemas(O[A],C);else if(O&&typeof O=="object"){typeof O.id=="string"&&N(C,O.id)&&this.schemas[O.id]===void 0&&(this.schemas[O.id]=O);for(var D in O)if(D!=="enum"){if(typeof O[D]=="object")this.searchSchemas(O[D],C);else if(D==="$ref"){var B=h(O[D]);B&&this.schemas[B]===void 0&&this.missingMap[B]===void 0&&(this.missingMap[B]=B)}}}},s.prototype.addSchema=function(O,C){if(typeof O!="string"||typeof C>"u")if(typeof O=="object"&&typeof O.id=="string")C=O,O=C.id;else return;O===h(O)+"#"&&(O=h(O)),this.schemas[O]=C,delete this.missingMap[O],g(C,O),this.searchSchemas(C,O)},s.prototype.getSchemaMap=function(){var O={};for(var C in this.schemas)O[C]=this.schemas[C];return O},s.prototype.getSchemaUris=function(O){var C=[];for(var A in this.schemas)(!O||O.test(A))&&C.push(A);return C},s.prototype.getMissingUris=function(O){var C=[];for(var A in this.missingMap)(!O||O.test(A))&&C.push(A);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(O,C,A,D,B){var F;if(C=this.resolveRefs(C),C){if(C instanceof T)return this.errors.push(C),C}else return null;var K=this.errors.length,ee,ie=null,pe=null;if(this.checkRecursive&&O&&typeof O=="object"){if(F=!this.scanned.length,O[this.validatedSchemasKey]){var Pe=O[this.validatedSchemasKey].indexOf(C);if(Pe!==-1)return this.errors=this.errors.concat(O[this.validationErrorsKey][Pe]),null}if(Object.isFrozen(O)&&(ee=this.scannedFrozen.indexOf(O),ee!==-1)){var de=this.scannedFrozenSchemas[ee].indexOf(C);if(de!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[ee][de]),null}if(this.scanned.push(O),Object.isFrozen(O))ee===-1&&(ee=this.scannedFrozen.length,this.scannedFrozen.push(O),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[ee].length,this.scannedFrozenSchemas[ee][ie]=C,this.scannedFrozenValidationErrors[ee][ie]=[];else{if(!O[this.validatedSchemasKey])try{Object.defineProperty(O,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(O,this.validationErrorsKey,{value:[],configurable:!0})}catch{O[this.validatedSchemasKey]=[],O[this.validationErrorsKey]=[]}pe=O[this.validatedSchemasKey].length,O[this.validatedSchemasKey][pe]=C,O[this.validationErrorsKey][pe]=[]}}var le=this.errors.length,be=this.validateBasic(O,C,B)||this.validateNumeric(O,C,B)||this.validateString(O,C,B)||this.validateArray(O,C,B)||this.validateObject(O,C,B)||this.validateCombinations(O,C,B)||this.validateHypermedia(O,C,B)||this.validateFormat(O,C,B)||this.validateDefinedKeywords(O,C,B)||null;if(F){for(;this.scanned.length;){var ze=this.scanned.pop();delete ze[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(be||le!==this.errors.length)for(;A&&A.length||D&&D.length;){var mt=A&&A.length?""+A.pop():null,ce=D&&D.length?""+D.pop():null;be&&(be=be.prefixWith(mt,ce)),this.prefixErrors(le,mt,ce)}return ie!==null?this.scannedFrozenValidationErrors[ee][ie]=this.errors.slice(K):pe!==null&&(O[this.validationErrorsKey][pe]=this.errors.slice(K)),this.handleError(be)},s.prototype.validateFormat=function(O,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var A=this.formatValidators[C.format].call(null,O,C);return typeof A=="string"||typeof A=="number"?this.createError(_.FORMAT_CUSTOM,{message:A},"","/format",null,O,C):A&&typeof A=="object"?this.createError(_.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,O,C):null},s.prototype.validateDefinedKeywords=function(O,C,A){for(var D in this.definedKeywords)if(!(typeof C[D]>"u"))for(var B=this.definedKeywords[D],F=0;F<B.length;F++){var K=B[F],ee=K(O,C[D],C,A);if(typeof ee=="string"||typeof ee=="number")return this.createError(_.KEYWORD_CUSTOM,{key:D,message:ee},"","",null,O,C).prefixWith(null,D);if(ee&&typeof ee=="object"){var ie=ee.code;if(typeof ie=="string"){if(!_[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=_[ie]}else typeof ie!="number"&&(ie=_.KEYWORD_CUSTOM);var pe=typeof ee.message=="object"?ee.message:{key:D,message:ee.message||"?"},Pe=ee.schemaPath||"/"+D.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,pe,ee.dataPath||null,Pe,null,O,C)}}return null};function o(O,C){if(O===C)return!0;if(O&&C&&typeof O=="object"&&typeof C=="object"){if(Array.isArray(O)!==Array.isArray(C))return!1;if(Array.isArray(O)){if(O.length!==C.length)return!1;for(var A=0;A<O.length;A++)if(!o(O[A],C[A]))return!1}else{var D;for(D in O)if(C[D]===void 0&&O[D]!==void 0)return!1;for(D in C)if(O[D]===void 0&&C[D]!==void 0)return!1;for(D in O)if(!o(O[D],C[D]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,A,D){var B;return(B=this.validateType(C,A,D))||(B=this.validateEnum(C,A,D))?B.prefixWith(null,"type"):null},s.prototype.validateType=function(C,A){if(A.type===void 0)return null;var D=typeof C;C===null?D="null":Array.isArray(C)&&(D="array");var B=A.type;Array.isArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var K=B[F];if(K===D||K==="integer"&&D==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:D,expected:B.join("/")},"","",null,C,A)},s.prototype.validateEnum=function(C,A){if(A.enum===void 0)return null;for(var D=0;D<A.enum.length;D++){var B=A.enum[D];if(o(C,B))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,A)},s.prototype.validateNumeric=function(C,A,D){return this.validateMultipleOf(C,A,D)||this.validateMinMax(C,A,D)||this.validateNaN(C,A,D)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,A){var D=A.multipleOf||A.divisibleBy;if(D===void 0)return null;if(typeof C=="number"){var B=C/D%1;if(B>=l&&B<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:D},"","",null,C,A)}return null},s.prototype.validateMinMax=function(C,A){if(typeof C!="number")return null;if(A.minimum!==void 0){if(C<A.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:A.minimum},"","/minimum",null,C,A);if(A.exclusiveMinimum&&C===A.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:A.minimum},"","/exclusiveMinimum",null,C,A)}if(A.maximum!==void 0){if(C>A.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:A.maximum},"","/maximum",null,C,A);if(A.exclusiveMaximum&&C===A.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:A.maximum},"","/exclusiveMaximum",null,C,A)}return null},s.prototype.validateNaN=function(C,A){return typeof C!="number"?null:isNaN(C)===!0||C===1/0||C===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:C},"","/type",null,C,A):null},s.prototype.validateString=function(C,A,D){return this.validateStringLength(C,A,D)||this.validateStringPattern(C,A,D)||null},s.prototype.validateStringLength=function(C,A){return typeof C!="string"?null:A.minLength!==void 0&&C.length<A.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:A.minLength},"","/minLength",null,C,A):A.maxLength!==void 0&&C.length>A.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:A.maxLength},"","/maxLength",null,C,A):null},s.prototype.validateStringPattern=function(C,A){if(typeof C!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var D;if(A.pattern instanceof RegExp)D=A.pattern;else{var B,F="",K=A.pattern.match(/^\/(.+)\/([img]*)$/);K?(B=K[1],F=K[2]):B=A.pattern,D=new RegExp(B,F)}return D.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,C,A)},s.prototype.validateArray=function(C,A,D){return Array.isArray(C)&&(this.validateArrayLength(C,A,D)||this.validateArrayUniqueItems(C,A,D)||this.validateArrayItems(C,A,D))||null},s.prototype.validateArrayLength=function(C,A){var D;return A.minItems!==void 0&&C.length<A.minItems&&(D=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:A.minItems},"","/minItems",null,C,A),this.handleError(D))||A.maxItems!==void 0&&C.length>A.maxItems&&(D=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:A.maxItems},"","/maxItems",null,C,A),this.handleError(D))?D:null},s.prototype.validateArrayUniqueItems=function(C,A){if(A.uniqueItems){for(var D=0;D<C.length;D++)for(var B=D+1;B<C.length;B++)if(o(C[D],C[B])){var F=this.createError(_.ARRAY_UNIQUE,{match1:D,match2:B},"","/uniqueItems",null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateArrayItems=function(C,A,D){if(A.items===void 0)return null;var B,F;if(Array.isArray(A.items)){for(F=0;F<C.length;F++)if(F<A.items.length){if(B=this.validateAll(C[F],A.items[F],[F],["items",F],D+"/"+F))return B}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(B=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+F,"/additionalItems",null,C,A),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalItems,[F],["additionalItems"],D+"/"+F))return B}}else for(F=0;F<C.length;F++)if(B=this.validateAll(C[F],A.items,[F],["items"],D+"/"+F))return B;return null},s.prototype.validateObject=function(C,A,D){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,A,D)||this.validateObjectRequiredProperties(C,A,D)||this.validateObjectProperties(C,A,D)||this.validateObjectDependencies(C,A,D)||null},s.prototype.validateObjectMinMaxProperties=function(C,A){var D=Object.keys(C),B;return A.minProperties!==void 0&&D.length<A.minProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:D.length,minimum:A.minProperties},"","/minProperties",null,C,A),this.handleError(B))||A.maxProperties!==void 0&&D.length>A.maxProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:D.length,maximum:A.maxProperties},"","/maxProperties",null,C,A),this.handleError(B))?B:null},s.prototype.validateObjectRequiredProperties=function(C,A){if(A.required!==void 0)for(var D=0;D<A.required.length;D++){var B=A.required[D];if(C[B]===void 0){var F=this.createError(_.OBJECT_REQUIRED,{key:B},"","/required/"+D,null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateObjectProperties=function(C,A,D){var B;for(var F in C){var K=D+"/"+F.replace(/~/g,"~0").replace(/\//g,"~1"),ee=!1;if(A.properties!==void 0&&A.properties[F]!==void 0&&(ee=!0,B=this.validateAll(C[F],A.properties[F],[F],["properties",F],K)))return B;if(A.patternProperties!==void 0)for(var ie in A.patternProperties){var pe=new RegExp(ie);if(pe.test(F)&&(ee=!0,B=this.validateAll(C[F],A.patternProperties[ie],[F],["patternProperties",ie],K)))return B}if(ee)this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(B=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:F},"","/additionalProperties",null,C,A).prefixWith(F,null),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalProperties,[F],["additionalProperties"],K))return B}else this.trackUnknownProperties&&!this.knownPropertyPaths[K]&&(this.unknownPropertyPaths[K]=!0)}return null},s.prototype.validateObjectDependencies=function(C,A,D){var B;if(A.dependencies!==void 0){for(var F in A.dependencies)if(C[F]!==void 0){var K=A.dependencies[F];if(typeof K=="string"){if(C[K]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:K},"","",null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(Array.isArray(K))for(var ee=0;ee<K.length;ee++){var ie=K[ee];if(C[ie]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:ie},"","/"+ee,null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(B=this.validateAll(C,K,[],["dependencies",F],D))return B}}return null},s.prototype.validateCombinations=function(C,A,D){return this.validateAllOf(C,A,D)||this.validateAnyOf(C,A,D)||this.validateOneOf(C,A,D)||this.validateNot(C,A,D)||null},s.prototype.validateAllOf=function(C,A,D){if(A.allOf===void 0)return null;for(var B,F=0;F<A.allOf.length;F++){var K=A.allOf[F];if(B=this.validateAll(C,K,[],["allOf",F],D))return B}return null},s.prototype.validateAnyOf=function(C,A,D){if(A.anyOf===void 0)return null;var B=[],F=this.errors.length,K,ee;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ee=this.knownPropertyPaths);for(var ie=!0,pe=0;pe<A.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Pe=A.anyOf[pe],de=this.errors.length,le=this.validateAll(C,Pe,[],["anyOf",pe],D);if(le===null&&de===this.errors.length){if(this.errors=this.errors.slice(0,F),this.trackUnknownProperties){for(var be in this.knownPropertyPaths)ee[be]=!0,delete K[be];for(var ze in this.unknownPropertyPaths)ee[ze]||(K[ze]=!0);ie=!1;continue}return null}le&&B.push(le.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ee),ie)return B=B.concat(this.errors.slice(F)),this.errors=this.errors.slice(0,F),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",B,C,A)},s.prototype.validateOneOf=function(C,A,D){if(A.oneOf===void 0)return null;var B=null,F=[],K=this.errors.length,ee,ie;this.trackUnknownProperties&&(ee=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var pe=0;pe<A.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Pe=A.oneOf[pe],de=this.errors.length,le=this.validateAll(C,Pe,[],["oneOf",pe],D);if(le===null&&de===this.errors.length){if(B===null)B=pe;else return this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MULTIPLE,{index1:B,index2:pe},"","/oneOf",null,C,A);if(this.trackUnknownProperties){for(var be in this.knownPropertyPaths)ie[be]=!0,delete ee[be];for(var ze in this.unknownPropertyPaths)ie[ze]||(ee[ze]=!0)}}else le&&F.push(le)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=ee,this.knownPropertyPaths=ie),B===null?(F=F.concat(this.errors.slice(K)),this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",F,C,A)):(this.errors=this.errors.slice(0,K),null)},s.prototype.validateNot=function(C,A,D){if(A.not===void 0)return null;var B=this.errors.length,F,K;this.trackUnknownProperties&&(F=this.unknownPropertyPaths,K=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var ee=this.validateAll(C,A.not,null,null,D),ie=this.errors.slice(B);return this.errors=this.errors.slice(0,B),this.trackUnknownProperties&&(this.unknownPropertyPaths=F,this.knownPropertyPaths=K),ee===null&&ie.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,A):null},s.prototype.validateHypermedia=function(C,A,D){if(!A.links)return null;for(var B,F=0;F<A.links.length;F++){var K=A.links[F];if(K.rel==="describedby"){for(var ee=new i(K.href),ie=!0,pe=0;pe<ee.varNames.length;pe++)if(!(ee.varNames[pe]in C)){ie=!1;break}if(ie){var Pe=ee.fillFromObject(C),de={$ref:Pe};if(B=this.validateAll(C,de,[],["links",F],D))return B}}}};function c(O){var C=String(O).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return C?{href:C[0]||"",protocol:C[1]||"",authority:C[2]||"",host:C[3]||"",hostname:C[4]||"",port:C[5]||"",pathname:C[6]||"",search:C[7]||"",hash:C[8]||""}:null}function p(O,C){function A(D){var B=[];return D.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(F){F==="/.."?B.pop():B.push(F)}),B.join("").replace(/^\//,D.charAt(0)==="/"?"/":"")}return C=c(C||""),O=c(O||""),!C||!O?null:(C.protocol||O.protocol)+(C.protocol||C.authority?C.authority:O.authority)+A(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(O.authority&&!O.pathname?"/":"")+O.pathname.slice(0,O.pathname.lastIndexOf("/")+1)+C.pathname:O.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||O.search)+C.hash}function h(O){return O.split("#")[0]}function g(O,C){if(O&&typeof O=="object")if(C===void 0?C=O.id:typeof O.id=="string"&&(C=p(C,O.id),O.id=C),Array.isArray(O))for(var A=0;A<O.length;A++)g(O[A],C);else{typeof O.$ref=="string"&&(O.$ref=p(C,O.$ref));for(var D in O)D!=="enum"&&g(O[D],C)}}function v(O){O=O||"en";var C=$[O];return function(A){var D=C[A.code]||k[A.code];if(typeof D!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var B=A.params;return D.replace(/\{([^{}]*)\}/g,function(F,K){var ee=B[K];return typeof ee=="string"||typeof ee=="number"?ee:F})}}var _={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},w={};for(var E in _)w[_[E]]=E;var k={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 T(O,C,A,D,B){if(Error.call(this),O===void 0)throw new Error("No error code supplied: "+D);this.message="",this.params=C,this.code=O,this.dataPath=A||"",this.schemaPath=D||"",this.subErrors=B||null;var F=new Error(this.message);if(this.stack=F.stack||F.stacktrace,!this.stack)try{throw F}catch(K){this.stack=K.stack||K.stacktrace}}T.prototype=Object.create(Error.prototype),T.prototype.constructor=T,T.prototype.name="ValidationError",T.prototype.prefixWith=function(O,C){if(O!==null&&(O=O.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+O+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(O,C);return this};function N(O,C){if(C.substring(0,O.length)===O){var A=C.substring(O.length);if(C.length>0&&C.charAt(O.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var $={};function j(O){var C=new s,A,D,B={setErrorReporter:function(F){return typeof F=="string"?this.language(F):(D=F,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function(F){return F?($[F]||(F=F.split("-")[0]),$[F]?(A=F,F):!1):A},addLanguage:function(F,K){var ee;for(ee in _)K[ee]&&!K[_[ee]]&&(K[_[ee]]=K[ee]);var ie=F.split("-")[0];if(!$[ie])$[F]=K,$[ie]=K;else{$[F]=Object.create($[ie]);for(ee in K)typeof $[ie][ee]>"u"&&($[ie][ee]=K[ee]),$[F][ee]=K[ee]}return this},freshApi:function(F){var K=j();return F&&K.language(F),K},validate:function(F,K,ee,ie){var pe=v(A),Pe=D?function(be,ze,mt){return D(be,ze,mt)||pe(be,ze,mt)}:pe,de=new s(C,!1,Pe,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K);var le=de.validateAll(F,K,null,null,"");return!le&&ie&&(le=de.banUnknownProperties(F,K)),this.error=le,this.missing=de.missing,this.valid=le===null,this.valid},validateResult:function(){var F={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(F,arguments),F},validateMultiple:function(F,K,ee,ie){var pe=v(A),Pe=D?function(be,ze,mt){return D(be,ze,mt)||pe(be,ze,mt)}:pe,de=new s(C,!0,Pe,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K),de.validateAll(F,K,null,null,""),ie&&de.banUnknownProperties(F,K);var le={toString:function(){return this.valid?"valid":this.error.message}};return le.errors=de.errors,le.missing=de.missing,le.valid=le.errors.length===0,le},addSchema:function(){return C.addSchema.apply(C,arguments)},getSchema:function(){return C.getSchema.apply(C,arguments)},getSchemaMap:function(){return C.getSchemaMap.apply(C,arguments)},getSchemaUris:function(){return C.getSchemaUris.apply(C,arguments)},getMissingUris:function(){return C.getMissingUris.apply(C,arguments)},dropSchemas:function(){C.dropSchemas.apply(C,arguments)},defineKeyword:function(){C.defineKeyword.apply(C,arguments)},defineError:function(F,K,ee){if(typeof F!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(F))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof K!="number"||K%1!==0||K<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[F]<"u")throw new Error("Error already defined: "+F+" as "+_[F]);if(typeof w[K]<"u")throw new Error("Error code already used: "+w[K]+" as "+K);_[F]=K,w[K]=F,k[F]=k[K]=ee;for(var ie in $){var pe=$[ie];pe[F]&&(pe[K]=pe[K]||pe[F])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:g,resolveUrl:p,getDocumentUri:h,errorCodes:_};return B.language(O||"en"),B}var G=j();return G.addLanguage("en-gb",k),G.tv4=G,G})});var kf=H(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.regexpCode=nt.getEsmExportName=nt.getProperty=nt.safeStringify=nt.stringify=nt.strConcat=nt.addCodeArg=nt.str=nt._=nt.nil=nt._Code=nt.Name=nt.IDENTIFIER=nt._CodeOrName=void 0;var qf=class{};nt._CodeOrName=qf;nt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var wa=class extends qf{constructor(e){if(super(),!nt.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}}};nt.Name=wa;var On=class extends qf{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 wa&&(r[n.str]=(r[n.str]||0)+1),r),{})}};nt._Code=On;nt.nil=new On("");function PI(t,...e){let r=[t[0]],n=0;for(;n<e.length;)XS(r,e[n]),r.push(t[++n]);return new On(r)}nt._=PI;var ZS=new On("+");function TI(t,...e){let r=[Of(t[0])],n=0;for(;n<e.length;)r.push(ZS),XS(r,e[n]),r.push(ZS,Of(t[++n]));return M2(r),new On(r)}nt.str=TI;function XS(t,e){e instanceof On?t.push(...e._items):e instanceof wa?t.push(e):t.push(L2(e))}nt.addCodeArg=XS;function M2(t){let e=1;for(;e<t.length-1;){if(t[e]===ZS){let r=F2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function F2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof wa||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 wa))return`"${t}${e.slice(1)}`}function D2(t,e){return e.emptyStr()?t:t.emptyStr()?e:TI`${t}${e}`}nt.strConcat=D2;function L2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Of(Array.isArray(t)?t.join(","):t)}function j2(t){return new On(Of(t))}nt.stringify=j2;function Of(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}nt.safeStringify=Of;function U2(t){return typeof t=="string"&&nt.IDENTIFIER.test(t)?new On(`.${t}`):PI`[${t}]`}nt.getProperty=U2;function H2(t){if(typeof t=="string"&&nt.IDENTIFIER.test(t))return new On(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}nt.getEsmExportName=H2;function B2(t){return new On(t.toString())}nt.regexpCode=B2});var rw=H(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ValueScope=Vr.ValueScopeName=Vr.Scope=Vr.varKinds=Vr.UsedValueState=void 0;var Br=kf(),ew=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},dm;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(dm||(Vr.UsedValueState=dm={}));Vr.varKinds={const:new Br.Name("const"),let:new Br.Name("let"),var:new Br.Name("var")};var pm=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Br.Name?e:this.name(e)}name(e){return new Br.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}}};Vr.Scope=pm;var hm=class extends Br.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Br._)`.${new Br.Name(r)}[${n}]`}};Vr.ValueScopeName=hm;var V2=(0,Br._)`\n`,tw=class extends pm{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?V2:Br.nil}}get(){return this._scope}name(e){return new hm(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,o=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let p=l.get(o);if(p)return p}else l=this._values[s]=new Map;l.set(o,i);let f=this._scope[s]||(this._scope[s]=[]),c=f.length;return f[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),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,Br._)`${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=Br.nil;for(let o in e){let l=e[o];if(!l)continue;let f=n[o]=n[o]||new Map;l.forEach(c=>{if(f.has(c))return;f.set(c,dm.Started);let p=r(c);if(p){let h=this.opts.es5?Vr.varKinds.var:Vr.varKinds.const;s=(0,Br._)`${s}${h} ${c} = ${p};${this.opts._n}`}else if(p=i?.(c))s=(0,Br._)`${s}${p}${this.opts._n}`;else throw new ew(c);f.set(c,dm.Completed)})}return s}};Vr.ValueScope=tw});var Ue=H(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.or=Fe.and=Fe.not=Fe.CodeGen=Fe.operators=Fe.varKinds=Fe.ValueScopeName=Fe.ValueScope=Fe.Scope=Fe.Name=Fe.regexpCode=Fe.stringify=Fe.getProperty=Fe.nil=Fe.strConcat=Fe.str=Fe._=void 0;var Ye=kf(),Zn=rw(),so=kf();Object.defineProperty(Fe,"_",{enumerable:!0,get:function(){return so._}});Object.defineProperty(Fe,"str",{enumerable:!0,get:function(){return so.str}});Object.defineProperty(Fe,"strConcat",{enumerable:!0,get:function(){return so.strConcat}});Object.defineProperty(Fe,"nil",{enumerable:!0,get:function(){return so.nil}});Object.defineProperty(Fe,"getProperty",{enumerable:!0,get:function(){return so.getProperty}});Object.defineProperty(Fe,"stringify",{enumerable:!0,get:function(){return so.stringify}});Object.defineProperty(Fe,"regexpCode",{enumerable:!0,get:function(){return so.regexpCode}});Object.defineProperty(Fe,"Name",{enumerable:!0,get:function(){return so.Name}});var vm=rw();Object.defineProperty(Fe,"Scope",{enumerable:!0,get:function(){return vm.Scope}});Object.defineProperty(Fe,"ValueScope",{enumerable:!0,get:function(){return vm.ValueScope}});Object.defineProperty(Fe,"ValueScopeName",{enumerable:!0,get:function(){return vm.ValueScopeName}});Object.defineProperty(Fe,"varKinds",{enumerable:!0,get:function(){return vm.varKinds}});Fe.operators={GT:new Ye._Code(">"),GTE:new Ye._Code(">="),LT:new Ye._Code("<"),LTE:new Ye._Code("<="),EQ:new Ye._Code("==="),NEQ:new Ye._Code("!=="),NOT:new Ye._Code("!"),OR:new Ye._Code("||"),AND:new Ye._Code("&&"),ADD:new Ye._Code("+")};var ds=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},nw=class extends ds{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Zn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=bu(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ye._CodeOrName?this.rhs.names:{}}},mm=class extends ds{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 Ye.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=bu(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ye.Name?{}:{...this.lhs.names};return ym(e,this.rhs)}},iw=class extends mm{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},sw=class extends ds{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ow=class extends ds{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},aw=class extends ds{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},lw=class extends ds{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=bu(this.code,e,r),this}get names(){return this.code instanceof Ye._CodeOrName?this.code.names:{}}},Pf=class extends ds{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)||(W2(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ca(e,r.names),{})}},ps=class extends Pf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},uw=class extends Pf{},vu=class extends ps{};vu.kind="else";var _a=class t extends ps{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 vu(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(AI(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=bu(this.condition,e,r),this}get names(){let e=super.names;return ym(e,this.condition),this.else&&Ca(e,this.else.names),e}};_a.kind="if";var Ra=class extends ps{};Ra.kind="for";var cw=class extends Ra{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=bu(this.iteration,e,r),this}get names(){return Ca(super.names,this.iteration.names)}},fw=class extends Ra{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Zn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=ym(super.names,this.from);return ym(e,this.to)}},gm=class extends Ra{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=bu(this.iterable,e,r),this}get names(){return Ca(super.names,this.iterable.names)}},Tf=class extends ps{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)}};Tf.kind="func";var Af=class extends Pf{render(e){return"return "+super.render(e)}};Af.kind="return";var dw=class extends ps{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&&Ca(e,this.catch.names),this.finally&&Ca(e,this.finally.names),e}},$f=class extends ps{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};$f.kind="catch";var Nf=class extends ps{render(e){return"finally"+super.render(e)}};Nf.kind="finally";var pw=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Zn.Scope({parent:e}),this._nodes=[new uw]}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 nw(e,s,n)),s}const(e,r,n){return this._def(Zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new mm(e,r,n))}add(e,r){return this._leafNode(new iw(e,Fe.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ye.nil&&this._leafNode(new lw(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,Ye.addCodeArg)(r,i));return r.push("}"),new Ye._Code(r)}if(e,r,n){if(this._blockNode(new _a(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 _a(e))}else(){return this._elseNode(new vu)}endIf(){return this._endBlockNode(_a,vu)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new cw(e),r)}forRange(e,r,n,i,s=this.opts.es5?Zn.varKinds.var:Zn.varKinds.let){let o=this._scope.toName(e);return this._for(new fw(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ye.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ye._)`${o}.length`,l=>{this.var(s,(0,Ye._)`${o}[${l}]`),n(s)})}return this._for(new gm("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Zn.varKinds.var:Zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ye._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new gm("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Ra)}label(e){return this._leafNode(new sw(e))}break(e){return this._leafNode(new ow(e))}return(e){let r=new Af;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Af)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new dw;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new $f(s),r(s)}return n&&(this._currNode=i.finally=new Nf,this.code(n)),this._endBlockNode($f,Nf)}throw(e){return this._leafNode(new aw(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=Ye.nil,n,i){return this._blockNode(new Tf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Tf)}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 _a))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}};Fe.CodeGen=pw;function Ca(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function ym(t,e){return e instanceof Ye._CodeOrName?Ca(t,e.names):t}function bu(t,e,r){if(t instanceof Ye.Name)return n(t);if(!i(t))return t;return new Ye._Code(t._items.reduce((s,o)=>(o instanceof Ye.Name&&(o=n(o)),o instanceof Ye._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ye._Code&&s._items.some(o=>o instanceof Ye.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function W2(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function AI(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ye._)`!${hw(t)}`}Fe.not=AI;var z2=$I(Fe.operators.AND);function J2(...t){return t.reduce(z2)}Fe.and=J2;var G2=$I(Fe.operators.OR);function Y2(...t){return t.reduce(G2)}Fe.or=Y2;function $I(t){return(e,r)=>e===Ye.nil?r:r===Ye.nil?e:(0,Ye._)`${hw(e)} ${t} ${hw(r)}`}function hw(t){return t instanceof Ye.Name?t:(0,Ye._)`(${t})`}});var Ze=H(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.checkStrictMode=He.getErrorPath=He.Type=He.useFunc=He.setEvaluated=He.evaluatedPropsToName=He.mergeEvaluated=He.eachItem=He.unescapeJsonPointer=He.escapeJsonPointer=He.escapeFragment=He.unescapeFragment=He.schemaRefOrVal=He.schemaHasRulesButRef=He.schemaHasRules=He.checkUnknownRules=He.alwaysValidSchema=He.toHash=void 0;var wt=Ue(),K2=kf();function Q2(t){let e={};for(let r of t)e[r]=!0;return e}He.toHash=Q2;function Z2(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(FI(t,e),!DI(e,t.self.RULES.all))}He.alwaysValidSchema=Z2;function FI(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]||UI(t,`unknown keyword: "${s}"`)}He.checkUnknownRules=FI;function DI(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}He.schemaHasRules=DI;function X2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}He.schemaHasRulesButRef=X2;function eU({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,wt._)`${r}`}return(0,wt._)`${t}${e}${(0,wt.getProperty)(n)}`}He.schemaRefOrVal=eU;function tU(t){return LI(decodeURIComponent(t))}He.unescapeFragment=tU;function rU(t){return encodeURIComponent(gw(t))}He.escapeFragment=rU;function gw(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}He.escapeJsonPointer=gw;function LI(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}He.unescapeJsonPointer=LI;function nU(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}He.eachItem=nU;function NI({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let f=o===void 0?s:o instanceof wt.Name?(s instanceof wt.Name?t(i,s,o):e(i,s,o),o):s instanceof wt.Name?(e(i,o,s),s):r(s,o);return l===wt.Name&&!(f instanceof wt.Name)?n(i,f):f}}He.mergeEvaluated={props:NI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,wt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,wt._)`${r} || {}`).code((0,wt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,wt._)`${r} || {}`),yw(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:jI}),items:NI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,wt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,wt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function jI(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,wt._)`{}`);return e!==void 0&&yw(t,r,e),r}He.evaluatedPropsToName=jI;function yw(t,e,r){Object.keys(r).forEach(n=>t.assign((0,wt._)`${e}${(0,wt.getProperty)(n)}`,!0))}He.setEvaluated=yw;var MI={};function iU(t,e){return t.scopeValue("func",{ref:e,code:MI[e.code]||(MI[e.code]=new K2._Code(e.code))})}He.useFunc=iU;var mw;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(mw||(He.Type=mw={}));function sU(t,e,r){if(t instanceof wt.Name){let n=e===mw.Num;return r?n?(0,wt._)`"[" + ${t} + "]"`:(0,wt._)`"['" + ${t} + "']"`:n?(0,wt._)`"/" + ${t}`:(0,wt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,wt.getProperty)(t).toString():"/"+gw(t)}He.getErrorPath=sU;function UI(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}He.checkStrictMode=UI});var hs=H(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var hr=Ue(),oU={data:new hr.Name("data"),valCxt:new hr.Name("valCxt"),instancePath:new hr.Name("instancePath"),parentData:new hr.Name("parentData"),parentDataProperty:new hr.Name("parentDataProperty"),rootData:new hr.Name("rootData"),dynamicAnchors:new hr.Name("dynamicAnchors"),vErrors:new hr.Name("vErrors"),errors:new hr.Name("errors"),this:new hr.Name("this"),self:new hr.Name("self"),scope:new hr.Name("scope"),json:new hr.Name("json"),jsonPos:new hr.Name("jsonPos"),jsonLen:new hr.Name("jsonLen"),jsonPart:new hr.Name("jsonPart")};vw.default=oU});var Mf=H(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.extendErrors=mr.resetErrorsCount=mr.reportExtraError=mr.reportError=mr.keyword$DataError=mr.keywordError=void 0;var Xe=Ue(),bm=Ze(),kr=hs();mr.keywordError={message:({keyword:t})=>(0,Xe.str)`must pass "${t}" keyword validation`};mr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Xe.str)`"${t}" keyword must be ${e} ($data)`:(0,Xe.str)`"${t}" keyword is invalid ($data)`};function aU(t,e=mr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,f=VI(t,e,r);n??(o||l)?HI(s,f):BI(i,(0,Xe._)`[${f}]`)}mr.reportError=aU;function lU(t,e=mr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=VI(t,e,r);HI(i,l),s||o||BI(n,kr.default.vErrors)}mr.reportExtraError=lU;function uU(t,e){t.assign(kr.default.errors,e),t.if((0,Xe._)`${kr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Xe._)`${kr.default.vErrors}.length`,e),()=>t.assign(kr.default.vErrors,null)))}mr.resetErrorsCount=uU;function cU({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,kr.default.errors,l=>{t.const(o,(0,Xe._)`${kr.default.vErrors}[${l}]`),t.if((0,Xe._)`${o}.instancePath === undefined`,()=>t.assign((0,Xe._)`${o}.instancePath`,(0,Xe.strConcat)(kr.default.instancePath,s.errorPath))),t.assign((0,Xe._)`${o}.schemaPath`,(0,Xe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Xe._)`${o}.schema`,r),t.assign((0,Xe._)`${o}.data`,n))})}mr.extendErrors=cU;function HI(t,e){let r=t.const("err",e);t.if((0,Xe._)`${kr.default.vErrors} === null`,()=>t.assign(kr.default.vErrors,(0,Xe._)`[${r}]`),(0,Xe._)`${kr.default.vErrors}.push(${r})`),t.code((0,Xe._)`${kr.default.errors}++`)}function BI(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Xe._)`new ${t.ValidationError}(${e})`):(r.assign((0,Xe._)`${n}.errors`,e),r.return(!1))}var xa={keyword:new Xe.Name("keyword"),schemaPath:new Xe.Name("schemaPath"),params:new Xe.Name("params"),propertyName:new Xe.Name("propertyName"),message:new Xe.Name("message"),schema:new Xe.Name("schema"),parentSchema:new Xe.Name("parentSchema")};function VI(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Xe._)`{}`:fU(t,e,r)}function fU(t,e,r={}){let{gen:n,it:i}=t,s=[dU(i,r),pU(t,r)];return hU(t,e,s),n.object(...s)}function dU({errorPath:t},{instancePath:e}){let r=e?(0,Xe.str)`${t}${(0,bm.getErrorPath)(e,bm.Type.Str)}`:t;return[kr.default.instancePath,(0,Xe.strConcat)(kr.default.instancePath,r)]}function pU({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Xe.str)`${e}/${t}`;return r&&(i=(0,Xe.str)`${i}${(0,bm.getErrorPath)(r,bm.Type.Str)}`),[xa.schemaPath,i]}function hU(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:f,propertyName:c,topSchemaRef:p,schemaPath:h}=l;n.push([xa.keyword,i],[xa.params,typeof e=="function"?e(t):e||(0,Xe._)`{}`]),f.messages&&n.push([xa.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([xa.schema,o],[xa.parentSchema,(0,Xe._)`${p}${h}`],[kr.default.data,s]),c&&n.push([xa.propertyName,c])}});var zI=H(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.boolOrEmptySchema=Su.topBoolOrEmptySchema=void 0;var mU=Mf(),gU=Ue(),yU=hs(),vU={message:"boolean schema is false"};function bU(t){let{gen:e,schema:r,validateName:n}=t;r===!1?WI(t,!1):typeof r=="object"&&r.$async===!0?e.return(yU.default.data):(e.assign((0,gU._)`${n}.errors`,null),e.return(!0))}Su.topBoolOrEmptySchema=bU;function SU(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),WI(t)):r.var(e,!0)}Su.boolOrEmptySchema=SU;function WI(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,mU.reportError)(i,vU,void 0,e)}});var bw=H(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.getRules=wu.isJSONType=void 0;var wU=["string","number","integer","boolean","null","object","array"],_U=new Set(wU);function RU(t){return typeof t=="string"&&_U.has(t)}wu.isJSONType=RU;function CU(){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:{}}}wu.getRules=CU});var Sw=H(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.shouldUseRule=oo.shouldUseGroup=oo.schemaHasRulesForType=void 0;function xU({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&JI(t,n)}oo.schemaHasRulesForType=xU;function JI(t,e){return e.rules.some(r=>GI(t,r))}oo.shouldUseGroup=JI;function GI(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))}oo.shouldUseRule=GI});var Ff=H(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.reportTypeError=gr.checkDataTypes=gr.checkDataType=gr.coerceAndCheckDataType=gr.getJSONTypes=gr.getSchemaTypes=gr.DataType=void 0;var EU=bw(),IU=Sw(),qU=Mf(),ke=Ue(),YI=Ze(),_u;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(_u||(gr.DataType=_u={}));function OU(t){let e=KI(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}gr.getSchemaTypes=OU;function KI(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(EU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}gr.getJSONTypes=KI;function kU(t,e){let{gen:r,data:n,opts:i}=t,s=PU(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,IU.schemaHasRulesForType)(t,e[0]));if(o){let l=_w(e,n,i.strictNumbers,_u.Wrong);r.if(l,()=>{s.length?TU(t,e,s):Rw(t)})}return o}gr.coerceAndCheckDataType=kU;var QI=new Set(["string","number","integer","boolean","null"]);function PU(t,e){return e?t.filter(r=>QI.has(r)||e==="array"&&r==="array"):[]}function TU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,ke._)`typeof ${i}`),l=n.let("coerced",(0,ke._)`undefined`);s.coerceTypes==="array"&&n.if((0,ke._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,ke._)`${i}[0]`).assign(o,(0,ke._)`typeof ${i}`).if(_w(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,ke._)`${l} !== undefined`);for(let c of r)(QI.has(c)||c==="array"&&s.coerceTypes==="array")&&f(c);n.else(),Rw(t),n.endIf(),n.if((0,ke._)`${l} !== undefined`,()=>{n.assign(i,l),AU(t,l)});function f(c){switch(c){case"string":n.elseIf((0,ke._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,ke._)`"" + ${i}`).elseIf((0,ke._)`${i} === null`).assign(l,(0,ke._)`""`);return;case"number":n.elseIf((0,ke._)`${o} == "boolean" || ${i} === null
|
|
23
|
+
`+new Error().stack),S=!1}return y.apply(this,arguments)},y)}var A={};function D(d,y){e.deprecationHandler!=null&&e.deprecationHandler(d,y),A[d]||(q(y),A[d]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function B(d){return typeof Function<"u"&&d instanceof Function||Object.prototype.toString.call(d)==="[object Function]"}function F(d){var y,S;for(S in d)s(d,S)&&(y=d[S],B(y)?this[S]=y:this["_"+S]=y);this._config=d,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function K(d,y){var S=h({},d),R;for(R in y)s(y,R)&&(i(d[R])&&i(y[R])?(S[R]={},h(S[R],d[R]),h(S[R],y[R])):y[R]!=null?S[R]=y[R]:delete S[R]);for(R in d)s(d,R)&&!s(y,R)&&i(d[R])&&(S[R]=h({},S[R]));return S}function ee(d){d!=null&&this.set(d)}var ie;Object.keys?ie=Object.keys:ie=function(d){var y,S=[];for(y in d)s(d,y)&&S.push(y);return S};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 Pe(d,y,S){var R=this._calendar[d]||this._calendar.sameElse;return B(R)?R.call(y,S):R}function de(d,y,S){var R=""+Math.abs(d),I=y-R.length,L=d>=0;return(L?S?"+":"":"-")+Math.pow(10,Math.max(0,I)).toString().substr(1)+R}var le=/(\[[^\[]*\])|(\\)?([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,be=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ze={},mt={};function ce(d,y,S,R){var I=R;typeof R=="string"&&(I=function(){return this[R]()}),d&&(mt[d]=I),y&&(mt[y[0]]=function(){return de(I.apply(this,arguments),y[1],y[2])}),S&&(mt[S]=function(){return this.localeData().ordinal(I.apply(this,arguments),d)})}function rr(d){return d.match(/\[[\s\S]/)?d.replace(/^\[|\]$/g,""):d.replace(/\\/g,"")}function Ne(d){var y=d.match(le),S,R;for(S=0,R=y.length;S<R;S++)mt[y[S]]?y[S]=mt[y[S]]:y[S]=rr(y[S]);return function(I){var L="",Y;for(Y=0;Y<R;Y++)L+=B(y[Y])?y[Y].call(I,d):y[Y];return L}}function it(d,y){return d.isValid()?(y=en(y,d.localeData()),ze[y]=ze[y]||Ne(y),ze[y](d)):d.localeData().invalidDate()}function en(d,y){var S=5;function R(I){return y.longDateFormat(I)||I}for(be.lastIndex=0;S>=0&&be.test(d);)d=d.replace(be,R),be.lastIndex=0,S-=1;return d}var $r={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 _t(d){var y=this._longDateFormat[d],S=this._longDateFormat[d.toUpperCase()];return y||!S?y:(this._longDateFormat[d]=S.match(le).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[d])}var Rt="Invalid date";function mn(){return this._invalidDate}var Lo="%d",Zt=/\d{1,2}/;function jo(d){return this._ordinal.replace("%d",d)}var wv={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 Dn(d,y,S,R){var I=this._relativeTime[S];return B(I)?I(d,y,S,R):I.replace(/%d/i,d)}function Pp(d,y){var S=this._relativeTime[d>0?"future":"past"];return B(S)?S(y):S.replace(/%s/i,y)}var Tp={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 Xt(d){return typeof d=="string"?Tp[d]||Tp[d.toLowerCase()]:void 0}function wr(d){var y={},S,R;for(R in d)s(d,R)&&(S=Xt(R),S&&(y[S]=d[R]));return y}var Uo={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 yl(d){var y=[],S;for(S in d)s(d,S)&&y.push({unit:S,priority:Uo[S]});return y.sort(function(R,I){return R.priority-I.priority}),y}var Ap=/\d/,Jt=/\d\d/,$p=/\d{3}/,Ji=/\d{4}/,Ln=/[+-]?\d{6}/,ht=/\d\d?/,vl=/\d\d\d\d?/,bl=/\d\d\d\d\d\d?/,Ps=/\d{1,3}/,Ho=/\d{1,4}/,Ts=/[+-]?\d{1,6}/,vi=/\d+/,As=/[+-]?\d+/,$c=/Z|[+-]\d\d:?\d\d/gi,Sl=/Z|[+-]\d\d(?::?\d\d)?/gi,_v=/[+-]?\d+(\.\d{1,3})?/,Bo=/[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,Gi=/^[1-9]\d?/,wl=/^([1-9]\d|\d)/,_l;_l={};function fe(d,y,S){_l[d]=B(y)?y:function(R,I){return R&&S?S:y}}function Rv(d,y){return s(_l,d)?_l[d](y._strict,y._locale):new RegExp(Cv(d))}function Cv(d){return gn(d.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(y,S,R,I,L){return S||R||I||L}))}function gn(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Nr(d){return d<0?Math.ceil(d)||0:Math.floor(d)}function De(d){var y=+d,S=0;return y!==0&&isFinite(y)&&(S=Nr(y)),S}var Nc={};function st(d,y){var S,R=y,I;for(typeof d=="string"&&(d=[d]),f(y)&&(R=function(L,Y){Y[y]=De(L)}),I=d.length,S=0;S<I;S++)Nc[d[S]]=R}function Vo(d,y){st(d,function(S,R,I,L){I._w=I._w||{},y(S,I._w,I,L)})}function Mc(d,y,S){y!=null&&s(Nc,d)&&Nc[d](y,S._a,S,d)}function Rl(d){return d%4===0&&d%100!==0||d%400===0}var er=0,jn=1,yn=2,Ft=3,Mr=4,Un=5,Yi=6,Np=7,xv=8;ce("Y",0,0,function(){var d=this.year();return d<=9999?de(d,4):"+"+d}),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"),fe("Y",As),fe("YY",ht,Jt),fe("YYYY",Ho,Ji),fe("YYYYY",Ts,Ln),fe("YYYYYY",Ts,Ln),st(["YYYYY","YYYYYY"],er),st("YYYY",function(d,y){y[er]=d.length===2?e.parseTwoDigitYear(d):De(d)}),st("YY",function(d,y){y[er]=e.parseTwoDigitYear(d)}),st("Y",function(d,y){y[er]=parseInt(d,10)});function Wo(d){return Rl(d)?366:365}e.parseTwoDigitYear=function(d){return De(d)+(De(d)>68?1900:2e3)};var Mp=$s("FullYear",!0);function Ev(){return Rl(this.year())}function $s(d,y){return function(S){return S!=null?(Jo(this,d,S),e.updateOffset(this,y),this):zo(this,d)}}function zo(d,y){if(!d.isValid())return NaN;var S=d._d,R=d._isUTC;switch(y){case"Milliseconds":return R?S.getUTCMilliseconds():S.getMilliseconds();case"Seconds":return R?S.getUTCSeconds():S.getSeconds();case"Minutes":return R?S.getUTCMinutes():S.getMinutes();case"Hours":return R?S.getUTCHours():S.getHours();case"Date":return R?S.getUTCDate():S.getDate();case"Day":return R?S.getUTCDay():S.getDay();case"Month":return R?S.getUTCMonth():S.getMonth();case"FullYear":return R?S.getUTCFullYear():S.getFullYear();default:return NaN}}function Jo(d,y,S){var R,I,L,Y,ae;if(!(!d.isValid()||isNaN(S))){switch(R=d._d,I=d._isUTC,y){case"Milliseconds":return void(I?R.setUTCMilliseconds(S):R.setMilliseconds(S));case"Seconds":return void(I?R.setUTCSeconds(S):R.setSeconds(S));case"Minutes":return void(I?R.setUTCMinutes(S):R.setMinutes(S));case"Hours":return void(I?R.setUTCHours(S):R.setHours(S));case"Date":return void(I?R.setUTCDate(S):R.setDate(S));case"FullYear":break;default:return}L=S,Y=d.month(),ae=d.date(),ae=ae===29&&Y===1&&!Rl(L)?28:ae,I?R.setUTCFullYear(L,Y,ae):R.setFullYear(L,Y,ae)}}function Iv(d){return d=Xt(d),B(this[d])?this[d]():this}function Cl(d,y){if(typeof d=="object"){d=wr(d);var S=yl(d),R,I=S.length;for(R=0;R<I;R++)this[S[R].unit](d[S[R].unit])}else if(d=Xt(d),B(this[d]))return this[d](y);return this}function Ov(d,y){return(d%y+y)%y}var kt;Array.prototype.indexOf?kt=Array.prototype.indexOf:kt=function(d){var y;for(y=0;y<this.length;++y)if(this[y]===d)return y;return-1};function Fc(d,y){if(isNaN(d)||isNaN(y))return NaN;var S=Ov(y,12);return d+=(y-S)/12,S===1?Rl(d)?29:28:31-S%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(d){return this.localeData().monthsShort(this,d)}),ce("MMMM",0,0,function(d){return this.localeData().months(this,d)}),fe("M",ht,Gi),fe("MM",ht,Jt),fe("MMM",function(d,y){return y.monthsShortRegex(d)}),fe("MMMM",function(d,y){return y.monthsRegex(d)}),st(["M","MM"],function(d,y){y[jn]=De(d)-1}),st(["MMM","MMMM"],function(d,y,S,R){var I=S._locale.monthsParse(d,R,S._strict);I!=null?y[jn]=I:_(S).invalidMonth=d});var Fp="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("_"),Lc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,qv=Bo,kv=Bo;function Pv(d,y){return d?n(this._months)?this._months[d.month()]:this._months[(this._months.isFormat||Lc).test(y)?"format":"standalone"][d.month()]:n(this._months)?this._months:this._months.standalone}function Tv(d,y){return d?n(this._monthsShort)?this._monthsShort[d.month()]:this._monthsShort[Lc.test(y)?"format":"standalone"][d.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Dp(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)L=g([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(L,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(L,"").toLocaleLowerCase();return S?y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null):y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null)):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null))}function Lp(d,y,S){var R,I,L;if(this._monthsParseExact)return Dp.call(this,d,y,S);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(I=g([2e3,R]),S&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(I,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(I,"").replace(".","")+"$","i")),!S&&!this._monthsParse[R]&&(L="^"+this.months(I,"")+"|^"+this.monthsShort(I,""),this._monthsParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="MMMM"&&this._longMonthsParse[R].test(d))return R;if(S&&y==="MMM"&&this._shortMonthsParse[R].test(d))return R;if(!S&&this._monthsParse[R].test(d))return R}}function jc(d,y){if(!d.isValid())return d;if(typeof y=="string"){if(/^\d+$/.test(y))y=De(y);else if(y=d.localeData().monthsParse(y),!f(y))return d}var S=y,R=d.date();return R=R<29?R:Math.min(R,Fc(d.year(),S)),d._isUTC?d._d.setUTCMonth(S,R):d._d.setMonth(S,R),d}function xl(d){return d!=null?(jc(this,d),e.updateOffset(this,!0),this):zo(this,"Month")}function Av(){return Fc(this.year(),this.month())}function jp(d){return this._monthsParseExact?(s(this,"_monthsRegex")||Uc.call(this),d?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=qv),this._monthsShortStrictRegex&&d?this._monthsShortStrictRegex:this._monthsShortRegex)}function El(d){return this._monthsParseExact?(s(this,"_monthsRegex")||Uc.call(this),d?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=kv),this._monthsStrictRegex&&d?this._monthsStrictRegex:this._monthsRegex)}function Uc(){function d(Re,je){return je.length-Re.length}var y=[],S=[],R=[],I,L,Y,ae;for(I=0;I<12;I++)L=g([2e3,I]),Y=gn(this.monthsShort(L,"")),ae=gn(this.months(L,"")),y.push(Y),S.push(ae),R.push(ae),R.push(Y);y.sort(d),S.sort(d),R.sort(d),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+y.join("|")+")","i")}function $v(d,y,S,R,I,L,Y){var ae;return d<100&&d>=0?(ae=new Date(d+400,y,S,R,I,L,Y),isFinite(ae.getFullYear())&&ae.setFullYear(d)):ae=new Date(d,y,S,R,I,L,Y),ae}function Ns(d){var y,S;return d<100&&d>=0?(S=Array.prototype.slice.call(arguments),S[0]=d+400,y=new Date(Date.UTC.apply(null,S)),isFinite(y.getUTCFullYear())&&y.setUTCFullYear(d)):y=new Date(Date.UTC.apply(null,arguments)),y}function Go(d,y,S){var R=7+y-S,I=(7+Ns(d,0,R).getUTCDay()-y)%7;return-I+R-1}function Il(d,y,S,R,I){var L=(7+S-R)%7,Y=Go(d,R,I),ae=1+7*(y-1)+L+Y,Re,je;return ae<=0?(Re=d-1,je=Wo(Re)+ae):ae>Wo(d)?(Re=d+1,je=ae-Wo(d)):(Re=d,je=ae),{year:Re,dayOfYear:je}}function Yo(d,y,S){var R=Go(d.year(),y,S),I=Math.floor((d.dayOfYear()-R-1)/7)+1,L,Y;return I<1?(Y=d.year()-1,L=I+vn(Y,y,S)):I>vn(d.year(),y,S)?(L=I-vn(d.year(),y,S),Y=d.year()+1):(Y=d.year(),L=I),{week:L,year:Y}}function vn(d,y,S){var R=Go(d,y,S),I=Go(d+1,y,S);return(Wo(d)-R+I)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),fe("w",ht,Gi),fe("ww",ht,Jt),fe("W",ht,Gi),fe("WW",ht,Jt),Vo(["w","ww","W","WW"],function(d,y,S,R){y[R.substr(0,1)]=De(d)});function Hc(d){return Yo(d,this._week.dow,this._week.doy).week}var Bc={dow:0,doy:6};function Ms(){return this._week.dow}function Up(){return this._week.doy}function Hp(d){var y=this.localeData().week(this);return d==null?y:this.add((d-y)*7,"d")}function Nv(d){var y=Yo(this,1,4).week;return d==null?y:this.add((d-y)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(d){return this.localeData().weekdaysMin(this,d)}),ce("ddd",0,0,function(d){return this.localeData().weekdaysShort(this,d)}),ce("dddd",0,0,function(d){return this.localeData().weekdays(this,d)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),fe("d",ht),fe("e",ht),fe("E",ht),fe("dd",function(d,y){return y.weekdaysMinRegex(d)}),fe("ddd",function(d,y){return y.weekdaysShortRegex(d)}),fe("dddd",function(d,y){return y.weekdaysRegex(d)}),Vo(["dd","ddd","dddd"],function(d,y,S,R){var I=S._locale.weekdaysParse(d,R,S._strict);I!=null?y.d=I:_(S).invalidWeekday=d}),Vo(["d","e","E"],function(d,y,S,R){y[R]=De(d)});function Bp(d,y){return typeof d!="string"?d:isNaN(d)?(d=y.weekdaysParse(d),typeof d=="number"?d:null):parseInt(d,10)}function Vp(d,y){return typeof d=="string"?y.weekdaysParse(d)%7||7:isNaN(d)?null:d}function Ol(d,y){return d.slice(y,7).concat(d.slice(0,y))}var Wp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),zp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Mv="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Fv=Bo,Jp=Bo,Dv=Bo;function Lv(d,y){var S=n(this._weekdays)?this._weekdays:this._weekdays[d&&d!==!0&&this._weekdays.isFormat.test(y)?"format":"standalone"];return d===!0?Ol(S,this._week.dow):d?S[d.day()]:S}function jv(d){return d===!0?Ol(this._weekdaysShort,this._week.dow):d?this._weekdaysShort[d.day()]:this._weekdaysShort}function Uv(d){return d===!0?Ol(this._weekdaysMin,this._week.dow):d?this._weekdaysMin[d.day()]:this._weekdaysMin}function Vc(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)L=g([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(L,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(L,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(L,"").toLocaleLowerCase();return S?y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1?I:null):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null):(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null):y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1||(I=kt.call(this._shortWeekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):(I=kt.call(this._minWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null))}function Hv(d,y,S){var R,I,L;if(this._weekdaysParseExact)return Vc.call(this,d,y,S);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(I=g([2e3,1]).day(R),S&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(I,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(I,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(I,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(L="^"+this.weekdays(I,"")+"|^"+this.weekdaysShort(I,"")+"|^"+this.weekdaysMin(I,""),this._weekdaysParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="dddd"&&this._fullWeekdaysParse[R].test(d))return R;if(S&&y==="ddd"&&this._shortWeekdaysParse[R].test(d))return R;if(S&&y==="dd"&&this._minWeekdaysParse[R].test(d))return R;if(!S&&this._weekdaysParse[R].test(d))return R}}function Bv(d){if(!this.isValid())return d!=null?this:NaN;var y=zo(this,"Day");return d!=null?(d=Bp(d,this.localeData()),this.add(d-y,"d")):y}function Vv(d){if(!this.isValid())return d!=null?this:NaN;var y=(this.day()+7-this.localeData()._week.dow)%7;return d==null?y:this.add(d-y,"d")}function Wv(d){if(!this.isValid())return d!=null?this:NaN;if(d!=null){var y=Vp(d,this.localeData());return this.day(this.day()%7?y:y-7)}else return this.day()||7}function zv(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Wc.call(this),d?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Fv),this._weekdaysStrictRegex&&d?this._weekdaysStrictRegex:this._weekdaysRegex)}function St(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Wc.call(this),d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Jp),this._weekdaysShortStrictRegex&&d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Wc.call(this),d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Dv),this._weekdaysMinStrictRegex&&d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Wc(){function d(Ht,Jn){return Jn.length-Ht.length}var y=[],S=[],R=[],I=[],L,Y,ae,Re,je;for(L=0;L<7;L++)Y=g([2e3,1]).day(L),ae=gn(this.weekdaysMin(Y,"")),Re=gn(this.weekdaysShort(Y,"")),je=gn(this.weekdays(Y,"")),y.push(ae),S.push(Re),R.push(je),I.push(ae),I.push(Re),I.push(je);y.sort(d),S.sort(d),R.sort(d),I.sort(d),this._weekdaysRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+y.join("|")+")","i")}function zc(){return this.hours()%12||12}function Jv(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,zc),ce("k",["kk",2],0,Jv),ce("hmm",0,0,function(){return""+zc.apply(this)+de(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+zc.apply(this)+de(this.minutes(),2)+de(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+de(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+de(this.minutes(),2)+de(this.seconds(),2)});function Gp(d,y){ce(d,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),y)})}Gp("a",!0),Gp("A",!1);function Yp(d,y){return y._meridiemParse}fe("a",Yp),fe("A",Yp),fe("H",ht,wl),fe("h",ht,Gi),fe("k",ht,Gi),fe("HH",ht,Jt),fe("hh",ht,Jt),fe("kk",ht,Jt),fe("hmm",vl),fe("hmmss",bl),fe("Hmm",vl),fe("Hmmss",bl),st(["H","HH"],Ft),st(["k","kk"],function(d,y,S){var R=De(d);y[Ft]=R===24?0:R}),st(["a","A"],function(d,y,S){S._isPm=S._locale.isPM(d),S._meridiem=d}),st(["h","hh"],function(d,y,S){y[Ft]=De(d),_(S).bigHour=!0}),st("hmm",function(d,y,S){var R=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R)),_(S).bigHour=!0}),st("hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R,2)),y[Un]=De(d.substr(I)),_(S).bigHour=!0}),st("Hmm",function(d,y,S){var R=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R))}),st("Hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=De(d.substr(0,R)),y[Mr]=De(d.substr(R,2)),y[Un]=De(d.substr(I))});function Gv(d){return(d+"").toLowerCase().charAt(0)==="p"}var Kp=/[ap]\.?m?\.?/i,Yv=$s("Hours",!0);function Ut(d,y,S){return d>11?S?"pm":"PM":S?"am":"AM"}var ql={calendar:pe,longDateFormat:$r,invalidDate:Rt,ordinal:Lo,dayOfMonthOrdinalParse:Zt,relativeTime:wv,months:Fp,monthsShort:Dc,week:Bc,weekdays:Wp,weekdaysMin:Mv,weekdaysShort:zp,meridiemParse:Kp},ot={},Fs={},Ki;function Fr(d,y){var S,R=Math.min(d.length,y.length);for(S=0;S<R;S+=1)if(d[S]!==y[S])return S;return R}function Jc(d){return d&&d.toLowerCase().replace("_","-")}function Qp(d){for(var y=0,S,R,I,L;y<d.length;){for(L=Jc(d[y]).split("-"),S=L.length,R=Jc(d[y+1]),R=R?R.split("-"):null;S>0;){if(I=Ko(L.slice(0,S).join("-")),I)return I;if(R&&R.length>=S&&Fr(L,R)>=S-1)break;S--}y++}return Ki}function Zp(d){return!!(d&&d.match("^[^/\\\\]*$"))}function Ko(d){var y=null,S;if(ot[d]===void 0&&typeof yu<"u"&&yu&&yu.exports&&Zp(d))try{y=Ki._abbr,S=require,S("./locale/"+d),Hn(y)}catch{ot[d]=null}return ot[d]}function Hn(d,y){var S;return d&&(l(y)?S=Bn(d):S=kl(d,y),S?Ki=S:typeof console<"u"&&console.warn&&console.warn("Locale "+d+" not found. Did you forget to load it?")),Ki._abbr}function kl(d,y){if(y!==null){var S,R=ql;if(y.abbr=d,ot[d]!=null)D("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."),R=ot[d]._config;else if(y.parentLocale!=null)if(ot[y.parentLocale]!=null)R=ot[y.parentLocale]._config;else if(S=Ko(y.parentLocale),S!=null)R=S._config;else return Fs[y.parentLocale]||(Fs[y.parentLocale]=[]),Fs[y.parentLocale].push({name:d,config:y}),null;return ot[d]=new ee(K(R,y)),Fs[d]&&Fs[d].forEach(function(I){kl(I.name,I.config)}),Hn(d),ot[d]}else return delete ot[d],null}function _r(d,y){if(y!=null){var S,R,I=ql;ot[d]!=null&&ot[d].parentLocale!=null?ot[d].set(K(ot[d]._config,y)):(R=Ko(d),R!=null&&(I=R._config),y=K(I,y),R==null&&(y.abbr=d),S=new ee(y),S.parentLocale=ot[d],ot[d]=S),Hn(d)}else ot[d]!=null&&(ot[d].parentLocale!=null?(ot[d]=ot[d].parentLocale,d===Hn()&&Hn(d)):ot[d]!=null&&delete ot[d]);return ot[d]}function Bn(d){var y;if(d&&d._locale&&d._locale._abbr&&(d=d._locale._abbr),!d)return Ki;if(!n(d)){if(y=Ko(d),y)return y;d=[d]}return Qp(d)}function Rr(){return ie(ot)}function Gc(d){var y,S=d._a;return S&&_(d).overflow===-2&&(y=S[jn]<0||S[jn]>11?jn:S[yn]<1||S[yn]>Fc(S[er],S[jn])?yn:S[Ft]<0||S[Ft]>24||S[Ft]===24&&(S[Mr]!==0||S[Un]!==0||S[Yi]!==0)?Ft:S[Mr]<0||S[Mr]>59?Mr:S[Un]<0||S[Un]>59?Un:S[Yi]<0||S[Yi]>999?Yi:-1,_(d)._overflowDayOfYear&&(y<er||y>yn)&&(y=yn),_(d)._overflowWeeks&&y===-1&&(y=Np),_(d)._overflowWeekday&&y===-1&&(y=xv),_(d).overflow=y),d}var Xp=/^\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)?)?$/,bi=/^\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)?)?$/,Pl=/Z|[+-]\d\d(?::?\d\d)?/,Ds=[["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]],yt=[["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/]],Si=/^\/?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}))$/,Kv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tl(d){var y,S,R=d._i,I=Xp.exec(R)||bi.exec(R),L,Y,ae,Re,je=Ds.length,Ht=yt.length;if(I){for(_(d).iso=!0,y=0,S=je;y<S;y++)if(Ds[y][1].exec(I[1])){Y=Ds[y][0],L=Ds[y][2]!==!1;break}if(Y==null){d._isValid=!1;return}if(I[3]){for(y=0,S=Ht;y<S;y++)if(yt[y][1].exec(I[3])){ae=(I[2]||" ")+yt[y][0];break}if(ae==null){d._isValid=!1;return}}if(!L&&ae!=null){d._isValid=!1;return}if(I[4])if(Pl.exec(I[4]))Re="Z";else{d._isValid=!1;return}d._f=Y+(ae||"")+(Re||""),$l(d)}else d._isValid=!1}function Qv(d,y,S,R,I,L){var Y=[Zv(d),Dc.indexOf(y),parseInt(S,10),parseInt(R,10),parseInt(I,10)];return L&&Y.push(parseInt(L,10)),Y}function Zv(d){var y=parseInt(d,10);return y<=49?2e3+y:y<=999?1900+y:y}function Xv(d){return d.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function eh(d,y,S){if(d){var R=zp.indexOf(d),I=new Date(y[0],y[1],y[2]).getDay();if(R!==I)return _(S).weekdayMismatch=!0,S._isValid=!1,!1}return!0}function Al(d,y,S){if(d)return Kv[d];if(y)return 0;var R=parseInt(S,10),I=R%100,L=(R-I)/100;return L*60+I}function Qi(d){var y=Yc.exec(Xv(d._i)),S;if(y){if(S=Qv(y[4],y[3],y[2],y[5],y[6],y[7]),!eh(y[1],S,d))return;d._a=S,d._tzm=Al(y[8],y[9],y[10]),d._d=Ns.apply(null,d._a),d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),_(d).rfc2822=!0}else d._isValid=!1}function eb(d){var y=Si.exec(d._i);if(y!==null){d._d=new Date(+y[1]);return}if(Tl(d),d._isValid===!1)delete d._isValid;else return;if(Qi(d),d._isValid===!1)delete d._isValid;else return;d._strict?d._isValid=!1:e.createFromInputFallback(d)}e.createFromInputFallback=C("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(d){d._d=new Date(d._i+(d._useUTC?" UTC":""))});function Zi(d,y,S){return d??y??S}function th(d){var y=new Date(e.now());return d._useUTC?[y.getUTCFullYear(),y.getUTCMonth(),y.getUTCDate()]:[y.getFullYear(),y.getMonth(),y.getDate()]}function Qo(d){var y,S,R=[],I,L,Y;if(!d._d){for(I=th(d),d._w&&d._a[yn]==null&&d._a[jn]==null&&Kc(d),d._dayOfYear!=null&&(Y=Zi(d._a[er],I[er]),(d._dayOfYear>Wo(Y)||d._dayOfYear===0)&&(_(d)._overflowDayOfYear=!0),S=Ns(Y,0,d._dayOfYear),d._a[jn]=S.getUTCMonth(),d._a[yn]=S.getUTCDate()),y=0;y<3&&d._a[y]==null;++y)d._a[y]=R[y]=I[y];for(;y<7;y++)d._a[y]=R[y]=d._a[y]==null?y===2?1:0:d._a[y];d._a[Ft]===24&&d._a[Mr]===0&&d._a[Un]===0&&d._a[Yi]===0&&(d._nextDay=!0,d._a[Ft]=0),d._d=(d._useUTC?Ns:$v).apply(null,R),L=d._useUTC?d._d.getUTCDay():d._d.getDay(),d._tzm!=null&&d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),d._nextDay&&(d._a[Ft]=24),d._w&&typeof d._w.d<"u"&&d._w.d!==L&&(_(d).weekdayMismatch=!0)}}function Kc(d){var y,S,R,I,L,Y,ae,Re,je;y=d._w,y.GG!=null||y.W!=null||y.E!=null?(L=1,Y=4,S=Zi(y.GG,d._a[er],Yo(ut(),1,4).year),R=Zi(y.W,1),I=Zi(y.E,1),(I<1||I>7)&&(Re=!0)):(L=d._locale._week.dow,Y=d._locale._week.doy,je=Yo(ut(),L,Y),S=Zi(y.gg,d._a[er],je.year),R=Zi(y.w,je.week),y.d!=null?(I=y.d,(I<0||I>6)&&(Re=!0)):y.e!=null?(I=y.e+L,(y.e<0||y.e>6)&&(Re=!0)):I=L),R<1||R>vn(S,L,Y)?_(d)._overflowWeeks=!0:Re!=null?_(d)._overflowWeekday=!0:(ae=Il(S,R,I,L,Y),d._a[er]=ae.year,d._dayOfYear=ae.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function $l(d){if(d._f===e.ISO_8601){Tl(d);return}if(d._f===e.RFC_2822){Qi(d);return}d._a=[],_(d).empty=!0;var y=""+d._i,S,R,I,L,Y,ae=y.length,Re=0,je,Ht;for(I=en(d._f,d._locale).match(le)||[],Ht=I.length,S=0;S<Ht;S++)L=I[S],R=(y.match(Rv(L,d))||[])[0],R&&(Y=y.substr(0,y.indexOf(R)),Y.length>0&&_(d).unusedInput.push(Y),y=y.slice(y.indexOf(R)+R.length),Re+=R.length),mt[L]?(R?_(d).empty=!1:_(d).unusedTokens.push(L),Mc(L,R,d)):d._strict&&!R&&_(d).unusedTokens.push(L);_(d).charsLeftOver=ae-Re,y.length>0&&_(d).unusedInput.push(y),d._a[Ft]<=12&&_(d).bigHour===!0&&d._a[Ft]>0&&(_(d).bigHour=void 0),_(d).parsedDateParts=d._a.slice(0),_(d).meridiem=d._meridiem,d._a[Ft]=tb(d._locale,d._a[Ft],d._meridiem),je=_(d).era,je!==null&&(d._a[er]=d._locale.erasConvertYear(je,d._a[er])),Qo(d),Gc(d)}function tb(d,y,S){var R;return S==null?y:d.meridiemHour!=null?d.meridiemHour(y,S):(d.isPM!=null&&(R=d.isPM(S),R&&y<12&&(y+=12),!R&&y===12&&(y=0)),y)}function Qc(d){var y,S,R,I,L,Y,ae=!1,Re=d._f.length;if(Re===0){_(d).invalidFormat=!0,d._d=new Date(NaN);return}for(I=0;I<Re;I++)L=0,Y=!1,y=$({},d),d._useUTC!=null&&(y._useUTC=d._useUTC),y._f=d._f[I],$l(y),E(y)&&(Y=!0),L+=_(y).charsLeftOver,L+=_(y).unusedTokens.length*10,_(y).score=L,ae?L<R&&(R=L,S=y):(R==null||L<R||Y)&&(R=L,S=y,Y&&(ae=!0));h(d,S||y)}function Zc(d){if(!d._d){var y=wr(d._i),S=y.day===void 0?y.date:y.day;d._a=p([y.year,y.month,S,y.hour,y.minute,y.second,y.millisecond],function(R){return R&&parseInt(R,10)}),Qo(d)}}function rb(d){var y=new j(Gc(Xc(d)));return y._nextDay&&(y.add(1,"d"),y._nextDay=void 0),y}function Xc(d){var y=d._i,S=d._f;return d._locale=d._locale||Bn(d._l),y===null||S===void 0&&y===""?k({nullInput:!0}):(typeof y=="string"&&(d._i=y=d._locale.preparse(y)),G(y)?new j(Gc(y)):(c(y)?d._d=y:n(S)?Qc(d):S?$l(d):Cr(d),E(d)||(d._d=null),d))}function Cr(d){var y=d._i;l(y)?d._d=new Date(e.now()):c(y)?d._d=new Date(y.valueOf()):typeof y=="string"?eb(d):n(y)?(d._a=p(y.slice(0),function(S){return parseInt(S,10)}),Qo(d)):i(y)?Zc(d):f(y)?d._d=new Date(y):e.createFromInputFallback(d)}function Nl(d,y,S,R,I){var L={};return(y===!0||y===!1)&&(R=y,y=void 0),(S===!0||S===!1)&&(R=S,S=void 0),(i(d)&&o(d)||n(d)&&d.length===0)&&(d=void 0),L._isAMomentObject=!0,L._useUTC=L._isUTC=I,L._l=S,L._i=d,L._f=y,L._strict=R,rb(L)}function ut(d,y,S,R){return Nl(d,y,S,R,!1)}var rh=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=ut.apply(null,arguments);return this.isValid()&&d.isValid()?d<this?this:d:k()}),nh=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=ut.apply(null,arguments);return this.isValid()&&d.isValid()?d>this?this:d:k()});function ih(d,y){var S,R;if(y.length===1&&n(y[0])&&(y=y[0]),!y.length)return ut();for(S=y[0],R=1;R<y.length;++R)(!y[R].isValid()||y[R][d](S))&&(S=y[R]);return S}function nb(){var d=[].slice.call(arguments,0);return ih("isBefore",d)}function ib(){var d=[].slice.call(arguments,0);return ih("isAfter",d)}var sb=function(){return Date.now?Date.now():+new Date},Zo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ls(d){var y,S=!1,R,I=Zo.length;for(y in d)if(s(d,y)&&!(kt.call(Zo,y)!==-1&&(d[y]==null||!isNaN(d[y]))))return!1;for(R=0;R<I;++R)if(d[Zo[R]]){if(S)return!1;parseFloat(d[Zo[R]])!==De(d[Zo[R]])&&(S=!0)}return!0}function ob(){return this._isValid}function ab(){return ct(NaN)}function js(d){var y=wr(d),S=y.year||0,R=y.quarter||0,I=y.month||0,L=y.week||y.isoWeek||0,Y=y.day||0,ae=y.hour||0,Re=y.minute||0,je=y.second||0,Ht=y.millisecond||0;this._isValid=Ls(y),this._milliseconds=+Ht+je*1e3+Re*6e4+ae*1e3*60*60,this._days=+Y+L*7,this._months=+I+R*3+S*12,this._data={},this._locale=Bn(),this._bubble()}function Xo(d){return d instanceof js}function bn(d){return d<0?Math.round(-1*d)*-1:Math.round(d)}function Ml(d,y,S){var R=Math.min(d.length,y.length),I=Math.abs(d.length-y.length),L=0,Y;for(Y=0;Y<R;Y++)(S&&d[Y]!==y[Y]||!S&&De(d[Y])!==De(y[Y]))&&L++;return L+I}function sh(d,y){ce(d,0,0,function(){var S=this.utcOffset(),R="+";return S<0&&(S=-S,R="-"),R+de(~~(S/60),2)+y+de(~~S%60,2)})}sh("Z",":"),sh("ZZ",""),fe("Z",Sl),fe("ZZ",Sl),st(["Z","ZZ"],function(d,y,S){S._useUTC=!0,S._tzm=ef(Sl,d)});var lb=/([\+\-]|\d\d)/gi;function ef(d,y){var S=(y||"").match(d),R,I,L;return S===null?null:(R=S[S.length-1]||[],I=(R+"").match(lb)||["-",0,0],L=+(I[1]*60)+De(I[2]),L===0?0:I[0]==="+"?L:-L)}function wi(d,y){var S,R;return y._isUTC?(S=y.clone(),R=(G(d)||c(d)?d.valueOf():ut(d).valueOf())-S.valueOf(),S._d.setTime(S._d.valueOf()+R),e.updateOffset(S,!1),S):ut(d).local()}function xr(d){return-Math.round(d._d.getTimezoneOffset())}e.updateOffset=function(){};function oh(d,y,S){var R=this._offset||0,I;if(!this.isValid())return d!=null?this:NaN;if(d!=null){if(typeof d=="string"){if(d=ef(Sl,d),d===null)return this}else Math.abs(d)<16&&!S&&(d=d*60);return!this._isUTC&&y&&(I=xr(this)),this._offset=d,this._isUTC=!0,I!=null&&this.add(I,"m"),R!==d&&(!y||this._changeInProgress?ea(this,ct(d-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:xr(this)}function ub(d,y){return d!=null?(typeof d!="string"&&(d=-d),this.utcOffset(d,y),this):-this.utcOffset()}function cb(d){return this.utcOffset(0,d)}function fb(d){return this._isUTC&&(this.utcOffset(0,d),this._isUTC=!1,d&&this.subtract(xr(this),"m")),this}function db(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var d=ef($c,this._i);d!=null?this.utcOffset(d):this.utcOffset(0,!0)}return this}function pb(d){return this.isValid()?(d=d?ut(d).utcOffset():0,(this.utcOffset()-d)%60===0):!1}function _i(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function V(){if(!l(this._isDSTShifted))return this._isDSTShifted;var d={},y;return $(d,this),d=Xc(d),d._a?(y=d._isUTC?g(d._a):ut(d._a),this._isDSTShifted=this.isValid()&&Ml(d._a,y.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Q(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ue(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ce=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,rt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ct(d,y){var S=d,R=null,I,L,Y;return Xo(d)?S={ms:d._milliseconds,d:d._days,M:d._months}:f(d)||!isNaN(+d)?(S={},y?S[y]=+d:S.milliseconds=+d):(R=Ce.exec(d))?(I=R[1]==="-"?-1:1,S={y:0,d:De(R[yn])*I,h:De(R[Ft])*I,m:De(R[Mr])*I,s:De(R[Un])*I,ms:De(bn(R[Yi]*1e3))*I}):(R=rt.exec(d))?(I=R[1]==="-"?-1:1,S={y:Je(R[2],I),M:Je(R[3],I),w:Je(R[4],I),d:Je(R[5],I),h:Je(R[6],I),m:Je(R[7],I),s:Je(R[8],I)}):S==null?S={}:typeof S=="object"&&("from"in S||"to"in S)&&(Y=hb(ut(S.from),ut(S.to)),S={},S.ms=Y.milliseconds,S.M=Y.months),L=new js(S),Xo(d)&&s(d,"_locale")&&(L._locale=d._locale),Xo(d)&&s(d,"_isValid")&&(L._isValid=d._isValid),L}ct.fn=js.prototype,ct.invalid=ab;function Je(d,y){var S=d&&parseFloat(d.replace(",","."));return(isNaN(S)?0:S)*y}function Fl(d,y){var S={};return S.months=y.month()-d.month()+(y.year()-d.year())*12,d.clone().add(S.months,"M").isAfter(y)&&--S.months,S.milliseconds=+y-+d.clone().add(S.months,"M"),S}function hb(d,y){var S;return d.isValid()&&y.isValid()?(y=wi(y,d),d.isBefore(y)?S=Fl(d,y):(S=Fl(y,d),S.milliseconds=-S.milliseconds,S.months=-S.months),S):{milliseconds:0,months:0}}function Er(d,y){return function(S,R){var I,L;return R!==null&&!isNaN(+R)&&(D(y,"moment()."+y+"(period, number) is deprecated. Please use moment()."+y+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),L=S,S=R,R=L),I=ct(S,R),ea(this,I,d),this}}function ea(d,y,S,R){var I=y._milliseconds,L=bn(y._days),Y=bn(y._months);d.isValid()&&(R=R??!0,Y&&jc(d,zo(d,"Month")+Y*S),L&&Jo(d,"Date",zo(d,"Date")+L*S),I&&d._d.setTime(d._d.valueOf()+I*S),R&&e.updateOffset(d,L||Y))}var mb=Er(1,"add"),Us=Er(-1,"subtract");function ta(d){return typeof d=="string"||d instanceof String}function Dl(d){return G(d)||c(d)||ta(d)||f(d)||gb(d)||at(d)||d===null||d===void 0}function at(d){var y=i(d)&&!o(d),S=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],I,L,Y=R.length;for(I=0;I<Y;I+=1)L=R[I],S=S||s(d,L);return y&&S}function gb(d){var y=n(d),S=!1;return y&&(S=d.filter(function(R){return!f(R)&&ta(d)}).length===0),y&&S}function ah(d){var y=i(d)&&!o(d),S=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],I,L;for(I=0;I<R.length;I+=1)L=R[I],S=S||s(d,L);return y&&S}function Ll(d,y){var S=d.diff(y,"days",!0);return S<-6?"sameElse":S<-1?"lastWeek":S<0?"lastDay":S<1?"sameDay":S<2?"nextDay":S<7?"nextWeek":"sameElse"}function yb(d,y){arguments.length===1&&(arguments[0]?Dl(arguments[0])?(d=arguments[0],y=void 0):ah(arguments[0])&&(y=arguments[0],d=void 0):(d=void 0,y=void 0));var S=d||ut(),R=wi(S,this).startOf("day"),I=e.calendarFormat(this,R)||"sameElse",L=y&&(B(y[I])?y[I].call(this,S):y[I]);return this.format(L||this.localeData().calendar(I,this,ut(S)))}function vb(){return new j(this)}function bb(d,y){var S=G(d)?d:ut(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()>S.valueOf():S.valueOf()<this.clone().startOf(y).valueOf()):!1}function jl(d,y){var S=G(d)?d:ut(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()<S.valueOf():this.clone().endOf(y).valueOf()<S.valueOf()):!1}function Ri(d,y,S,R){var I=G(d)?d:ut(d),L=G(y)?y:ut(y);return this.isValid()&&I.isValid()&&L.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(I,S):!this.isBefore(I,S))&&(R[1]===")"?this.isBefore(L,S):!this.isAfter(L,S))):!1}function Ul(d,y){var S=G(d)?d:ut(d),R;return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()===S.valueOf():(R=S.valueOf(),this.clone().startOf(y).valueOf()<=R&&R<=this.clone().endOf(y).valueOf())):!1}function lh(d,y){return this.isSame(d,y)||this.isAfter(d,y)}function Hl(d,y){return this.isSame(d,y)||this.isBefore(d,y)}function uh(d,y,S){var R,I,L;if(!this.isValid())return NaN;if(R=wi(d,this),!R.isValid())return NaN;switch(I=(R.utcOffset()-this.utcOffset())*6e4,y=Xt(y),y){case"year":L=ra(this,R)/12;break;case"month":L=ra(this,R);break;case"quarter":L=ra(this,R)/3;break;case"second":L=(this-R)/1e3;break;case"minute":L=(this-R)/6e4;break;case"hour":L=(this-R)/36e5;break;case"day":L=(this-R-I)/864e5;break;case"week":L=(this-R-I)/6048e5;break;default:L=this-R}return S?L:Nr(L)}function ra(d,y){if(d.date()<y.date())return-ra(y,d);var S=(y.year()-d.year())*12+(y.month()-d.month()),R=d.clone().add(S,"months"),I,L;return y-R<0?(I=d.clone().add(S-1,"months"),L=(y-R)/(R-I)):(I=d.clone().add(S+1,"months"),L=(y-R)/(I-R)),-(S+L)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Bl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ch(d){if(!this.isValid())return null;var y=d!==!0,S=y?this.clone().utc():this;return S.year()<0||S.year()>9999?it(S,y?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?y?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",it(S,"Z")):it(S,y?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function na(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var d="moment",y="",S,R,I,L;return this.isLocal()||(d=this.utcOffset()===0?"moment.utc":"moment.parseZone",y="Z"),S="["+d+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",I="-MM-DD[T]HH:mm:ss.SSS",L=y+'[")]',this.format(S+R+I+L)}function Xi(d){d||(d=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var y=it(this,d);return this.localeData().postformat(y)}function Vl(d,y){return this.isValid()&&(G(d)&&d.isValid()||ut(d).isValid())?ct({to:this,from:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Sb(d){return this.from(ut(),d)}function wb(d,y){return this.isValid()&&(G(d)&&d.isValid()||ut(d).isValid())?ct({from:this,to:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function _b(d){return this.to(ut(),d)}function ia(d){var y;return d===void 0?this._locale._abbr:(y=Bn(d),y!=null&&(this._locale=y),this)}var sa=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(d){return d===void 0?this.localeData():this.locale(d)});function Wl(){return this._locale}var zl=1e3,es=60*zl,Jl=60*es,fh=(365*400+97)*24*Jl;function Ct(d,y){return(d%y+y)%y}function Gt(d,y,S){return d<100&&d>=0?new Date(d+400,y,S)-fh:new Date(d,y,S).valueOf()}function dh(d,y,S){return d<100&&d>=0?Date.UTC(d+400,y,S)-fh:Date.UTC(d,y,S)}function Rb(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?dh:Gt,d){case"year":y=S(this.year(),0,1);break;case"quarter":y=S(this.year(),this.month()-this.month()%3,1);break;case"month":y=S(this.year(),this.month(),1);break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":y=S(this.year(),this.month(),this.date());break;case"hour":y=this._d.valueOf(),y-=Ct(y+(this._isUTC?0:this.utcOffset()*es),Jl);break;case"minute":y=this._d.valueOf(),y-=Ct(y,es);break;case"second":y=this._d.valueOf(),y-=Ct(y,zl);break}return this._d.setTime(y),e.updateOffset(this,!0),this}function ph(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?dh:Gt,d){case"year":y=S(this.year()+1,0,1)-1;break;case"quarter":y=S(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":y=S(this.year(),this.month()+1,1)-1;break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":y=S(this.year(),this.month(),this.date()+1)-1;break;case"hour":y=this._d.valueOf(),y+=Jl-Ct(y+(this._isUTC?0:this.utcOffset()*es),Jl)-1;break;case"minute":y=this._d.valueOf(),y+=es-Ct(y,es)-1;break;case"second":y=this._d.valueOf(),y+=zl-Ct(y,zl)-1;break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Cb(){return this._d.valueOf()-(this._offset||0)*6e4}function tf(){return Math.floor(this.valueOf()/1e3)}function oa(){return new Date(this.valueOf())}function rf(){var d=this;return[d.year(),d.month(),d.date(),d.hour(),d.minute(),d.second(),d.millisecond()]}function Hs(){var d=this;return{years:d.year(),months:d.month(),date:d.date(),hours:d.hours(),minutes:d.minutes(),seconds:d.seconds(),milliseconds:d.milliseconds()}}function aa(){return this.isValid()?this.toISOString():null}function la(){return E(this)}function Gl(){return h({},_(this))}function Bs(){return _(this).overflow}function xb(){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"),fe("N",cr),fe("NN",cr),fe("NNN",cr),fe("NNNN",Le),fe("NNNNN",kb),st(["N","NN","NNN","NNNN","NNNNN"],function(d,y,S,R){var I=S._locale.erasParse(d,R,S._strict);I?_(S).era=I:_(S).invalidEra=d}),fe("y",vi),fe("yy",vi),fe("yyy",vi),fe("yyyy",vi),fe("yo",Pb),st(["y","yy","yyy","yyyy"],er),st(["yo"],function(d,y,S,R){var I;S._locale._eraYearOrdinalRegex&&(I=d.match(S._locale._eraYearOrdinalRegex)),S._locale.eraYearOrdinalParse?y[er]=S._locale.eraYearOrdinalParse(d,I):y[er]=parseInt(d,10)});function Eb(d,y){var S,R,I,L=this._eras||Bn("en")._eras;for(S=0,R=L.length;S<R;++S)switch(typeof L[S].since==="string"&&(I=e(L[S].since).startOf("day"),L[S].since=I.valueOf()),typeof L[S].until){case"undefined":L[S].until=1/0;break;case"string":I=e(L[S].until).startOf("day").valueOf(),L[S].until=I.valueOf();break}return L}function Ib(d,y,S){var R,I,L=this.eras(),Y,ae,Re;for(d=d.toUpperCase(),R=0,I=L.length;R<I;++R)if(Y=L[R].name.toUpperCase(),ae=L[R].abbr.toUpperCase(),Re=L[R].narrow.toUpperCase(),S)switch(y){case"N":case"NN":case"NNN":if(ae===d)return L[R];break;case"NNNN":if(Y===d)return L[R];break;case"NNNNN":if(Re===d)return L[R];break}else if([Y,ae,Re].indexOf(d)>=0)return L[R]}function Ob(d,y){var S=d.since<=d.until?1:-1;return y===void 0?e(d.since).year():e(d.since).year()+(y-d.offset)*S}function qb(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].name;return""}function Yl(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].narrow;return""}function ua(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].abbr;return""}function hh(){var d,y,S,R,I=this.localeData().eras();for(d=0,y=I.length;d<y;++d)if(S=I[d].since<=I[d].until?1:-1,R=this.clone().startOf("day").valueOf(),I[d].since<=R&&R<=I[d].until||I[d].until<=R&&R<=I[d].since)return(this.year()-e(I[d].since).year())*S+I[d].offset;return this.year()}function O(d){return s(this,"_erasNameRegex")||nf.call(this),d?this._erasNameRegex:this._erasRegex}function Vs(d){return s(this,"_erasAbbrRegex")||nf.call(this),d?this._erasAbbrRegex:this._erasRegex}function Kl(d){return s(this,"_erasNarrowRegex")||nf.call(this),d?this._erasNarrowRegex:this._erasRegex}function cr(d,y){return y.erasAbbrRegex(d)}function Le(d,y){return y.erasNameRegex(d)}function kb(d,y){return y.erasNarrowRegex(d)}function Pb(d,y){return y._eraYearOrdinalRegex||vi}function nf(){var d=[],y=[],S=[],R=[],I,L,Y,ae,Re,je=this.eras();for(I=0,L=je.length;I<L;++I)Y=gn(je[I].name),ae=gn(je[I].abbr),Re=gn(je[I].narrow),y.push(Y),d.push(ae),S.push(Re),R.push(Y),R.push(ae),R.push(Re);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+y.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+S.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Sn(d,y){ce(0,[d,d.length],0,y)}Sn("gggg","weekYear"),Sn("ggggg","weekYear"),Sn("GGGG","isoWeekYear"),Sn("GGGGG","isoWeekYear"),fe("G",As),fe("g",As),fe("GG",ht,Jt),fe("gg",ht,Jt),fe("GGGG",Ho,Ji),fe("gggg",Ho,Ji),fe("GGGGG",Ts,Ln),fe("ggggg",Ts,Ln),Vo(["gggg","ggggg","GGGG","GGGGG"],function(d,y,S,R){y[R.substr(0,2)]=De(d)}),Vo(["gg","GG"],function(d,y,S,R){y[R]=e.parseTwoDigitYear(d)});function Tb(d){return mh.call(this,d,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Ab(d){return mh.call(this,d,this.isoWeek(),this.isoWeekday(),1,4)}function $b(){return vn(this.year(),1,4)}function Nb(){return vn(this.isoWeekYear(),1,4)}function Mb(){var d=this.localeData()._week;return vn(this.year(),d.dow,d.doy)}function Vn(){var d=this.localeData()._week;return vn(this.weekYear(),d.dow,d.doy)}function mh(d,y,S,R,I){var L;return d==null?Yo(this,R,I).year:(L=vn(d,R,I),y>L&&(y=L),Fb.call(this,d,y,S,R,I))}function Fb(d,y,S,R,I){var L=Il(d,y,S,R,I),Y=Ns(L.year,0,L.dayOfYear);return this.year(Y.getUTCFullYear()),this.month(Y.getUTCMonth()),this.date(Y.getUTCDate()),this}ce("Q",0,"Qo","quarter"),fe("Q",Ap),st("Q",function(d,y){y[jn]=(De(d)-1)*3});function Db(d){return d==null?Math.ceil((this.month()+1)/3):this.month((d-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),fe("D",ht,Gi),fe("DD",ht,Jt),fe("Do",function(d,y){return d?y._dayOfMonthOrdinalParse||y._ordinalParse:y._dayOfMonthOrdinalParseLenient}),st(["D","DD"],yn),st("Do",function(d,y){y[yn]=De(d.match(ht)[0])});var gh=$s("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),fe("DDD",Ps),fe("DDDD",$p),st(["DDD","DDDD"],function(d,y,S){S._dayOfYear=De(d)});function Lb(d){var y=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return d==null?y:this.add(d-y,"d")}ce("m",["mm",2],0,"minute"),fe("m",ht,wl),fe("mm",ht,Jt),st(["m","mm"],Mr);var Wn=$s("Minutes",!1);ce("s",["ss",2],0,"second"),fe("s",ht,wl),fe("ss",ht,Jt),st(["s","ss"],Un);var jb=$s("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}),fe("S",Ps,Ap),fe("SS",Ps,Jt),fe("SSS",Ps,$p);var Ci,yh;for(Ci="SSSS";Ci.length<=9;Ci+="S")fe(Ci,vi);function Ub(d,y){y[Yi]=De(("0."+d)*1e3)}for(Ci="S";Ci.length<=9;Ci+="S")st(Ci,Ub);yh=$s("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function Hb(){return this._isUTC?"UTC":""}function ts(){return this._isUTC?"Coordinated Universal Time":""}var re=j.prototype;re.add=mb,re.calendar=yb,re.clone=vb,re.diff=uh,re.endOf=ph,re.format=Xi,re.from=Vl,re.fromNow=Sb,re.to=wb,re.toNow=_b,re.get=Iv,re.invalidAt=Bs,re.isAfter=bb,re.isBefore=jl,re.isBetween=Ri,re.isSame=Ul,re.isSameOrAfter=lh,re.isSameOrBefore=Hl,re.isValid=la,re.lang=sa,re.locale=ia,re.localeData=Wl,re.max=nh,re.min=rh,re.parsingFlags=Gl,re.set=Cl,re.startOf=Rb,re.subtract=Us,re.toArray=rf,re.toObject=Hs,re.toDate=oa,re.toISOString=ch,re.inspect=na,typeof Symbol<"u"&&Symbol.for!=null&&(re[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),re.toJSON=aa,re.toString=Bl,re.unix=tf,re.valueOf=Cb,re.creationData=xb,re.eraName=qb,re.eraNarrow=Yl,re.eraAbbr=ua,re.eraYear=hh,re.year=Mp,re.isLeapYear=Ev,re.weekYear=Tb,re.isoWeekYear=Ab,re.quarter=re.quarters=Db,re.month=xl,re.daysInMonth=Av,re.week=re.weeks=Hp,re.isoWeek=re.isoWeeks=Nv,re.weeksInYear=Mb,re.weeksInWeekYear=Vn,re.isoWeeksInYear=$b,re.isoWeeksInISOWeekYear=Nb,re.date=gh,re.day=re.days=Bv,re.weekday=Vv,re.isoWeekday=Wv,re.dayOfYear=Lb,re.hour=re.hours=Yv,re.minute=re.minutes=Wn,re.second=re.seconds=jb,re.millisecond=re.milliseconds=yh,re.utcOffset=oh,re.utc=cb,re.local=fb,re.parseZone=db,re.hasAlignedHourOffset=pb,re.isDST=_i,re.isLocal=Q,re.isUtcOffset=z,re.isUtc=ue,re.isUTC=ue,re.zoneAbbr=Hb,re.zoneName=ts,re.dates=C("dates accessor is deprecated. Use date instead.",gh),re.months=C("months accessor is deprecated. Use month instead",xl),re.years=C("years accessor is deprecated. Use year instead",Mp),re.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ub),re.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",V);function Bb(d){return ut(d*1e3)}function tn(){return ut.apply(null,arguments).parseZone()}function vh(d){return d}var Qe=ee.prototype;Qe.calendar=Pe,Qe.longDateFormat=_t,Qe.invalidDate=mn,Qe.ordinal=jo,Qe.preparse=vh,Qe.postformat=vh,Qe.relativeTime=Dn,Qe.pastFuture=Pp,Qe.set=F,Qe.eras=Eb,Qe.erasParse=Ib,Qe.erasConvertYear=Ob,Qe.erasAbbrRegex=Vs,Qe.erasNameRegex=O,Qe.erasNarrowRegex=Kl,Qe.months=Pv,Qe.monthsShort=Tv,Qe.monthsParse=Lp,Qe.monthsRegex=El,Qe.monthsShortRegex=jp,Qe.week=Hc,Qe.firstDayOfYear=Up,Qe.firstDayOfWeek=Ms,Qe.weekdays=Lv,Qe.weekdaysMin=Uv,Qe.weekdaysShort=jv,Qe.weekdaysParse=Hv,Qe.weekdaysRegex=zv,Qe.weekdaysShortRegex=St,Qe.weekdaysMinRegex=gt,Qe.isPM=Gv,Qe.meridiem=Ut;function Ql(d,y,S,R){var I=Bn(),L=g().set(R,y);return I[S](L,d)}function bh(d,y,S){if(f(d)&&(y=d,d=void 0),d=d||"",y!=null)return Ql(d,y,S,"month");var R,I=[];for(R=0;R<12;R++)I[R]=Ql(d,R,S,"month");return I}function sf(d,y,S,R){typeof d=="boolean"?(f(y)&&(S=y,y=void 0),y=y||""):(y=d,S=y,d=!1,f(y)&&(S=y,y=void 0),y=y||"");var I=Bn(),L=d?I._week.dow:0,Y,ae=[];if(S!=null)return Ql(y,(S+L)%7,R,"day");for(Y=0;Y<7;Y++)ae[Y]=Ql(y,(Y+L)%7,R,"day");return ae}function Sh(d,y){return bh(d,y,"months")}function wh(d,y){return bh(d,y,"monthsShort")}function Vb(d,y,S){return sf(d,y,S,"weekdays")}function Wb(d,y,S){return sf(d,y,S,"weekdaysShort")}function of(d,y,S){return sf(d,y,S,"weekdaysMin")}Hn("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(d){var y=d%10,S=De(d%100/10)===1?"th":y===1?"st":y===2?"nd":y===3?"rd":"th";return d+S}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",Hn),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Bn);var Ir=Math.abs;function Zl(){var d=this._data;return this._milliseconds=Ir(this._milliseconds),this._days=Ir(this._days),this._months=Ir(this._months),d.milliseconds=Ir(d.milliseconds),d.seconds=Ir(d.seconds),d.minutes=Ir(d.minutes),d.hours=Ir(d.hours),d.months=Ir(d.months),d.years=Ir(d.years),this}function _h(d,y,S,R){var I=ct(y,S);return d._milliseconds+=R*I._milliseconds,d._days+=R*I._days,d._months+=R*I._months,d._bubble()}function Rh(d,y){return _h(this,d,y,1)}function zb(d,y){return _h(this,d,y,-1)}function rn(d){return d<0?Math.floor(d):Math.ceil(d)}function af(){var d=this._milliseconds,y=this._days,S=this._months,R=this._data,I,L,Y,ae,Re;return d>=0&&y>=0&&S>=0||d<=0&&y<=0&&S<=0||(d+=rn(fr(S)+y)*864e5,y=0,S=0),R.milliseconds=d%1e3,I=Nr(d/1e3),R.seconds=I%60,L=Nr(I/60),R.minutes=L%60,Y=Nr(L/60),R.hours=Y%24,y+=Nr(Y/24),Re=Nr(xi(y)),S+=Re,y-=rn(fr(Re)),ae=Nr(S/12),S%=12,R.days=y,R.months=S,R.years=ae,this}function xi(d){return d*4800/146097}function fr(d){return d*146097/4800}function Jb(d){if(!this.isValid())return NaN;var y,S,R=this._milliseconds;if(d=Xt(d),d==="month"||d==="quarter"||d==="year")switch(y=this._days+R/864e5,S=this._months+xi(y),d){case"month":return S;case"quarter":return S/3;case"year":return S/12}else switch(y=this._days+Math.round(fr(this._months)),d){case"week":return y/7+R/6048e5;case"day":return y+R/864e5;case"hour":return y*24+R/36e5;case"minute":return y*1440+R/6e4;case"second":return y*86400+R/1e3;case"millisecond":return Math.floor(y*864e5)+R;default:throw new Error("Unknown unit "+d)}}function wn(d){return function(){return this.as(d)}}var lf=wn("ms"),ca=wn("s"),Ei=wn("m"),Ch=wn("h"),Gb=wn("d"),Xl=wn("w"),Yb=wn("M"),xh=wn("Q"),Yt=wn("y"),uf=lf;function Eh(){return ct(this)}function _n(d){return d=Xt(d),this.isValid()?this[d+"s"]():NaN}function zn(d){return function(){return this.isValid()?this._data[d]:NaN}}var eu=zn("milliseconds"),rs=zn("seconds"),Ih=zn("minutes"),nr=zn("hours"),cf=zn("days"),Kb=zn("months"),Qb=zn("years");function Zb(){return Nr(this.days()/7)}var nn=Math.round,Ws={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function fa(d,y,S,R,I){return I.relativeTime(y||1,!!S,d,R)}function Oh(d,y,S,R){var I=ct(d).abs(),L=nn(I.as("s")),Y=nn(I.as("m")),ae=nn(I.as("h")),Re=nn(I.as("d")),je=nn(I.as("M")),Ht=nn(I.as("w")),Jn=nn(I.as("y")),Gn=L<=S.ss&&["s",L]||L<S.s&&["ss",L]||Y<=1&&["m"]||Y<S.m&&["mm",Y]||ae<=1&&["h"]||ae<S.h&&["hh",ae]||Re<=1&&["d"]||Re<S.d&&["dd",Re];return S.w!=null&&(Gn=Gn||Ht<=1&&["w"]||Ht<S.w&&["ww",Ht]),Gn=Gn||je<=1&&["M"]||je<S.M&&["MM",je]||Jn<=1&&["y"]||["yy",Jn],Gn[2]=y,Gn[3]=+d>0,Gn[4]=R,fa.apply(null,Gn)}function Xb(d){return d===void 0?nn:typeof d=="function"?(nn=d,!0):!1}function eS(d,y){return Ws[d]===void 0?!1:y===void 0?Ws[d]:(Ws[d]=y,d==="s"&&(Ws.ss=y-1),!0)}function da(d,y){if(!this.isValid())return this.localeData().invalidDate();var S=!1,R=Ws,I,L;return typeof d=="object"&&(y=d,d=!1),typeof d=="boolean"&&(S=d),typeof y=="object"&&(R=Object.assign({},Ws,y),y.s!=null&&y.ss==null&&(R.ss=y.s-1)),I=this.localeData(),L=Oh(this,!S,R,I),S&&(L=I.pastFuture(+this,L)),I.postformat(L)}var ff=Math.abs;function zs(d){return(d>0)-(d<0)||+d}function Js(){if(!this.isValid())return this.localeData().invalidDate();var d=ff(this._milliseconds)/1e3,y=ff(this._days),S=ff(this._months),R,I,L,Y,ae=this.asSeconds(),Re,je,Ht,Jn;return ae?(R=Nr(d/60),I=Nr(R/60),d%=60,R%=60,L=Nr(S/12),S%=12,Y=d?d.toFixed(3).replace(/\.?0+$/,""):"",Re=ae<0?"-":"",je=zs(this._months)!==zs(ae)?"-":"",Ht=zs(this._days)!==zs(ae)?"-":"",Jn=zs(this._milliseconds)!==zs(ae)?"-":"",Re+"P"+(L?je+L+"Y":"")+(S?je+S+"M":"")+(y?Ht+y+"D":"")+(I||R||d?"T":"")+(I?Jn+I+"H":"")+(R?Jn+R+"M":"")+(d?Jn+Y+"S":"")):"P0D"}var Be=js.prototype;Be.isValid=ob,Be.abs=Zl,Be.add=Rh,Be.subtract=zb,Be.as=Jb,Be.asMilliseconds=lf,Be.asSeconds=ca,Be.asMinutes=Ei,Be.asHours=Ch,Be.asDays=Gb,Be.asWeeks=Xl,Be.asMonths=Yb,Be.asQuarters=xh,Be.asYears=Yt,Be.valueOf=uf,Be._bubble=af,Be.clone=Eh,Be.get=_n,Be.milliseconds=eu,Be.seconds=rs,Be.minutes=Ih,Be.hours=nr,Be.days=cf,Be.weeks=Zb,Be.months=Kb,Be.years=Qb,Be.humanize=da,Be.toISOString=Js,Be.toString=Js,Be.toJSON=Js,Be.locale=ia,Be.localeData=Wl,Be.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Js),Be.lang=sa,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),fe("x",As),fe("X",_v),st("X",function(d,y,S){S._d=new Date(parseFloat(d)*1e3)}),st("x",function(d,y,S){S._d=new Date(De(d))});return e.version="2.30.1",r(ut),e.fn=re,e.min=nb,e.max=ib,e.now=sb,e.utc=g,e.unix=Bb,e.months=Sh,e.isDate=c,e.locale=Hn,e.invalid=k,e.duration=ct,e.isMoment=G,e.weekdays=Vb,e.parseZone=tn,e.localeData=Bn,e.isDuration=Xo,e.monthsShort=wh,e.weekdaysMin=of,e.defineLocale=kl,e.updateLocale=_r,e.locales=Rr,e.weekdaysShort=Wb,e.normalizeUnits=Xt,e.relativeTimeRounding=Xb,e.relativeTimeThreshold=eS,e.calendarFormat=Ll,e.prototype=re,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 kI=H((qI,fm)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof fm<"u"&&fm.exports?fm.exports=e():t.tv4=e()})(qI,function(){Object.keys||(Object.keys=(function(){var q=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],D=A.length;return function(B){if(typeof B!="object"&&typeof B!="function"||B===null)throw new TypeError("Object.keys called on non-object");var F=[];for(var K in B)q.call(B,K)&&F.push(K);if(C)for(var ee=0;ee<D;ee++)q.call(B,A[ee])&&F.push(A[ee]);return F}})()),Object.create||(Object.create=(function(){function q(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return q.prototype=C,new q}})()),Array.isArray||(Array.isArray=function(q){return Object.prototype.toString.call(q)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(q){if(this===null)throw new TypeError;var C=Object(this),A=C.length>>>0;if(A===0)return-1;var D=0;if(arguments.length>1&&(D=Number(arguments[1]),D!==D?D=0:D!==0&&D!==1/0&&D!==-1/0&&(D=(D>0||-1)*Math.floor(Math.abs(D)))),D>=A)return-1;for(var B=D>=0?D:Math.max(A-Math.abs(D),0);B<A;B++)if(B in C&&C[B]===q)return B;return-1}),Object.isFrozen||(Object.isFrozen=function(q){for(var C="tv4_test_frozen_key";q.hasOwnProperty(C);)C+=Math.random();try{return q[C]=!0,delete q[C],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(q){return encodeURI(q).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(q){var C="";t[q.charAt(0)]&&(C=q.charAt(0),q=q.substring(1));var A="",D="",B=!0,F=!1,K=!1;C==="+"?B=!1:C==="."?(D=".",A="."):C==="/"?(D="/",A="/"):C==="#"?(D="#",B=!1):C===";"?(D=";",A=";",F=!0,K=!0):C==="?"?(D="?",A="&",F=!0):C==="&"&&(D="&",A="&",F=!0);for(var ee=[],ie=q.split(","),pe=[],Pe={},de=0;de<ie.length;de++){var le=ie[de],be=null;if(le.indexOf(":")!==-1){var ze=le.split(":");le=ze[0],be=parseInt(ze[1],10)}for(var mt={};e[le.charAt(le.length-1)];)mt[le.charAt(le.length-1)]=!0,le=le.substring(0,le.length-1);var ce={truncate:be,name:le,suffices:mt};pe.push(ce),Pe[le]=ce,ee.push(le)}var rr=function(Ne){for(var it="",en=0,$r=0;$r<pe.length;$r++){var _t=pe[$r],Rt=Ne(_t.name);if(Rt==null||Array.isArray(Rt)&&Rt.length===0||typeof Rt=="object"&&Object.keys(Rt).length===0){en++;continue}if($r===en?it+=D:it+=A||",",Array.isArray(Rt)){F&&(it+=_t.name+"=");for(var mn=0;mn<Rt.length;mn++)mn>0&&(it+=_t.suffices["*"]&&A||",",_t.suffices["*"]&&F&&(it+=_t.name+"=")),it+=B?encodeURIComponent(Rt[mn]).replace(/!/g,"%21"):r(Rt[mn])}else if(typeof Rt=="object"){F&&!_t.suffices["*"]&&(it+=_t.name+"=");var Lo=!0;for(var Zt in Rt)Lo||(it+=_t.suffices["*"]&&A||","),Lo=!1,it+=B?encodeURIComponent(Zt).replace(/!/g,"%21"):r(Zt),it+=_t.suffices["*"]?"=":",",it+=B?encodeURIComponent(Rt[Zt]).replace(/!/g,"%21"):r(Rt[Zt])}else F&&(it+=_t.name,(!K||Rt!=="")&&(it+="=")),_t.truncate!=null&&(Rt=Rt.substring(0,_t.truncate)),it+=B?encodeURIComponent(Rt).replace(/!/g,"%21"):r(Rt)}return it};return rr.varNames=ee,{prefix:D,substitution:rr}}function i(q){if(!(this instanceof i))return new i(q);for(var C=q.split("{"),A=[C.shift()],D=[],B=[],F=[];C.length>0;){var K=C.shift(),ee=K.split("}")[0],ie=K.substring(ee.length+1),pe=n(ee);B.push(pe.substitution),D.push(pe.prefix),A.push(ie),F=F.concat(pe.substitution.varNames)}this.fill=function(Pe){for(var de=A[0],le=0;le<B.length;le++){var be=B[le];de+=be(Pe),de+=A[le+1]}return de},this.varNames=F,this.template=q}i.prototype={toString:function(){return this.template},fillFromObject:function(q){return this.fill(function(C){return q[C]})}};var s=function(C,A,D,B,F){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,B&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),F&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=D||v("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var K in C.definedKeywords)this.definedKeywords[K]=C.definedKeywords[K].slice(0)};s.prototype.defineKeyword=function(q,C){this.definedKeywords[q]=this.definedKeywords[q]||[],this.definedKeywords[q].push(C)},s.prototype.createError=function(q,C,A,D,B,F,K){var ee=new T(q,C,A,D,B);return ee.message=this.errorReporter(ee,F,K),ee},s.prototype.returnError=function(q){return q},s.prototype.collectError=function(q){return q&&this.errors.push(q),null},s.prototype.prefixErrors=function(q,C,A){for(var D=q;D<this.errors.length;D++)this.errors[D]=this.errors[D].prefixWith(C,A);return this},s.prototype.banUnknownProperties=function(q,C){for(var A in this.unknownPropertyPaths){var D=this.createError(_.UNKNOWN_PROPERTY,{path:A},A,"",null,q,C),B=this.handleError(D);if(B)return B}return null},s.prototype.addFormat=function(q,C){if(typeof q=="object"){for(var A in q)this.addFormat(A,q[A]);return this}this.formatValidators[q]=C},s.prototype.resolveRefs=function(q,C){if(q.$ref!==void 0){if(C=C||{},C[q.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,q);C[q.$ref]=!0,q=this.getSchema(q.$ref,C)}return q},s.prototype.getSchema=function(q,C){var A;if(this.schemas[q]!==void 0)return A=this.schemas[q],this.resolveRefs(A,C);var D=q,B="";if(q.indexOf("#")!==-1&&(B=q.substring(q.indexOf("#")+1),D=q.substring(0,q.indexOf("#"))),typeof this.schemas[D]=="object"){A=this.schemas[D];var F=decodeURIComponent(B);if(F==="")return this.resolveRefs(A,C);if(F.charAt(0)!=="/")return;for(var K=F.split("/").slice(1),ee=0;ee<K.length;ee++){var ie=K[ee].replace(/~1/g,"/").replace(/~0/g,"~");if(A[ie]===void 0){A=void 0;break}A=A[ie]}if(A!==void 0)return this.resolveRefs(A,C)}this.missing[D]===void 0&&(this.missing.push(D),this.missing[D]=D,this.missingMap[D]=D)},s.prototype.searchSchemas=function(q,C){if(Array.isArray(q))for(var A=0;A<q.length;A++)this.searchSchemas(q[A],C);else if(q&&typeof q=="object"){typeof q.id=="string"&&N(C,q.id)&&this.schemas[q.id]===void 0&&(this.schemas[q.id]=q);for(var D in q)if(D!=="enum"){if(typeof q[D]=="object")this.searchSchemas(q[D],C);else if(D==="$ref"){var B=h(q[D]);B&&this.schemas[B]===void 0&&this.missingMap[B]===void 0&&(this.missingMap[B]=B)}}}},s.prototype.addSchema=function(q,C){if(typeof q!="string"||typeof C>"u")if(typeof q=="object"&&typeof q.id=="string")C=q,q=C.id;else return;q===h(q)+"#"&&(q=h(q)),this.schemas[q]=C,delete this.missingMap[q],g(C,q),this.searchSchemas(C,q)},s.prototype.getSchemaMap=function(){var q={};for(var C in this.schemas)q[C]=this.schemas[C];return q},s.prototype.getSchemaUris=function(q){var C=[];for(var A in this.schemas)(!q||q.test(A))&&C.push(A);return C},s.prototype.getMissingUris=function(q){var C=[];for(var A in this.missingMap)(!q||q.test(A))&&C.push(A);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(q,C,A,D,B){var F;if(C=this.resolveRefs(C),C){if(C instanceof T)return this.errors.push(C),C}else return null;var K=this.errors.length,ee,ie=null,pe=null;if(this.checkRecursive&&q&&typeof q=="object"){if(F=!this.scanned.length,q[this.validatedSchemasKey]){var Pe=q[this.validatedSchemasKey].indexOf(C);if(Pe!==-1)return this.errors=this.errors.concat(q[this.validationErrorsKey][Pe]),null}if(Object.isFrozen(q)&&(ee=this.scannedFrozen.indexOf(q),ee!==-1)){var de=this.scannedFrozenSchemas[ee].indexOf(C);if(de!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[ee][de]),null}if(this.scanned.push(q),Object.isFrozen(q))ee===-1&&(ee=this.scannedFrozen.length,this.scannedFrozen.push(q),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[ee].length,this.scannedFrozenSchemas[ee][ie]=C,this.scannedFrozenValidationErrors[ee][ie]=[];else{if(!q[this.validatedSchemasKey])try{Object.defineProperty(q,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(q,this.validationErrorsKey,{value:[],configurable:!0})}catch{q[this.validatedSchemasKey]=[],q[this.validationErrorsKey]=[]}pe=q[this.validatedSchemasKey].length,q[this.validatedSchemasKey][pe]=C,q[this.validationErrorsKey][pe]=[]}}var le=this.errors.length,be=this.validateBasic(q,C,B)||this.validateNumeric(q,C,B)||this.validateString(q,C,B)||this.validateArray(q,C,B)||this.validateObject(q,C,B)||this.validateCombinations(q,C,B)||this.validateHypermedia(q,C,B)||this.validateFormat(q,C,B)||this.validateDefinedKeywords(q,C,B)||null;if(F){for(;this.scanned.length;){var ze=this.scanned.pop();delete ze[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(be||le!==this.errors.length)for(;A&&A.length||D&&D.length;){var mt=A&&A.length?""+A.pop():null,ce=D&&D.length?""+D.pop():null;be&&(be=be.prefixWith(mt,ce)),this.prefixErrors(le,mt,ce)}return ie!==null?this.scannedFrozenValidationErrors[ee][ie]=this.errors.slice(K):pe!==null&&(q[this.validationErrorsKey][pe]=this.errors.slice(K)),this.handleError(be)},s.prototype.validateFormat=function(q,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var A=this.formatValidators[C.format].call(null,q,C);return typeof A=="string"||typeof A=="number"?this.createError(_.FORMAT_CUSTOM,{message:A},"","/format",null,q,C):A&&typeof A=="object"?this.createError(_.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,q,C):null},s.prototype.validateDefinedKeywords=function(q,C,A){for(var D in this.definedKeywords)if(!(typeof C[D]>"u"))for(var B=this.definedKeywords[D],F=0;F<B.length;F++){var K=B[F],ee=K(q,C[D],C,A);if(typeof ee=="string"||typeof ee=="number")return this.createError(_.KEYWORD_CUSTOM,{key:D,message:ee},"","",null,q,C).prefixWith(null,D);if(ee&&typeof ee=="object"){var ie=ee.code;if(typeof ie=="string"){if(!_[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=_[ie]}else typeof ie!="number"&&(ie=_.KEYWORD_CUSTOM);var pe=typeof ee.message=="object"?ee.message:{key:D,message:ee.message||"?"},Pe=ee.schemaPath||"/"+D.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,pe,ee.dataPath||null,Pe,null,q,C)}}return null};function o(q,C){if(q===C)return!0;if(q&&C&&typeof q=="object"&&typeof C=="object"){if(Array.isArray(q)!==Array.isArray(C))return!1;if(Array.isArray(q)){if(q.length!==C.length)return!1;for(var A=0;A<q.length;A++)if(!o(q[A],C[A]))return!1}else{var D;for(D in q)if(C[D]===void 0&&q[D]!==void 0)return!1;for(D in C)if(q[D]===void 0&&C[D]!==void 0)return!1;for(D in q)if(!o(q[D],C[D]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,A,D){var B;return(B=this.validateType(C,A,D))||(B=this.validateEnum(C,A,D))?B.prefixWith(null,"type"):null},s.prototype.validateType=function(C,A){if(A.type===void 0)return null;var D=typeof C;C===null?D="null":Array.isArray(C)&&(D="array");var B=A.type;Array.isArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var K=B[F];if(K===D||K==="integer"&&D==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:D,expected:B.join("/")},"","",null,C,A)},s.prototype.validateEnum=function(C,A){if(A.enum===void 0)return null;for(var D=0;D<A.enum.length;D++){var B=A.enum[D];if(o(C,B))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,A)},s.prototype.validateNumeric=function(C,A,D){return this.validateMultipleOf(C,A,D)||this.validateMinMax(C,A,D)||this.validateNaN(C,A,D)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,A){var D=A.multipleOf||A.divisibleBy;if(D===void 0)return null;if(typeof C=="number"){var B=C/D%1;if(B>=l&&B<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:D},"","",null,C,A)}return null},s.prototype.validateMinMax=function(C,A){if(typeof C!="number")return null;if(A.minimum!==void 0){if(C<A.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:A.minimum},"","/minimum",null,C,A);if(A.exclusiveMinimum&&C===A.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:A.minimum},"","/exclusiveMinimum",null,C,A)}if(A.maximum!==void 0){if(C>A.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:A.maximum},"","/maximum",null,C,A);if(A.exclusiveMaximum&&C===A.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:A.maximum},"","/exclusiveMaximum",null,C,A)}return null},s.prototype.validateNaN=function(C,A){return typeof C!="number"?null:isNaN(C)===!0||C===1/0||C===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:C},"","/type",null,C,A):null},s.prototype.validateString=function(C,A,D){return this.validateStringLength(C,A,D)||this.validateStringPattern(C,A,D)||null},s.prototype.validateStringLength=function(C,A){return typeof C!="string"?null:A.minLength!==void 0&&C.length<A.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:A.minLength},"","/minLength",null,C,A):A.maxLength!==void 0&&C.length>A.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:A.maxLength},"","/maxLength",null,C,A):null},s.prototype.validateStringPattern=function(C,A){if(typeof C!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var D;if(A.pattern instanceof RegExp)D=A.pattern;else{var B,F="",K=A.pattern.match(/^\/(.+)\/([img]*)$/);K?(B=K[1],F=K[2]):B=A.pattern,D=new RegExp(B,F)}return D.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,C,A)},s.prototype.validateArray=function(C,A,D){return Array.isArray(C)&&(this.validateArrayLength(C,A,D)||this.validateArrayUniqueItems(C,A,D)||this.validateArrayItems(C,A,D))||null},s.prototype.validateArrayLength=function(C,A){var D;return A.minItems!==void 0&&C.length<A.minItems&&(D=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:A.minItems},"","/minItems",null,C,A),this.handleError(D))||A.maxItems!==void 0&&C.length>A.maxItems&&(D=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:A.maxItems},"","/maxItems",null,C,A),this.handleError(D))?D:null},s.prototype.validateArrayUniqueItems=function(C,A){if(A.uniqueItems){for(var D=0;D<C.length;D++)for(var B=D+1;B<C.length;B++)if(o(C[D],C[B])){var F=this.createError(_.ARRAY_UNIQUE,{match1:D,match2:B},"","/uniqueItems",null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateArrayItems=function(C,A,D){if(A.items===void 0)return null;var B,F;if(Array.isArray(A.items)){for(F=0;F<C.length;F++)if(F<A.items.length){if(B=this.validateAll(C[F],A.items[F],[F],["items",F],D+"/"+F))return B}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(B=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+F,"/additionalItems",null,C,A),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalItems,[F],["additionalItems"],D+"/"+F))return B}}else for(F=0;F<C.length;F++)if(B=this.validateAll(C[F],A.items,[F],["items"],D+"/"+F))return B;return null},s.prototype.validateObject=function(C,A,D){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,A,D)||this.validateObjectRequiredProperties(C,A,D)||this.validateObjectProperties(C,A,D)||this.validateObjectDependencies(C,A,D)||null},s.prototype.validateObjectMinMaxProperties=function(C,A){var D=Object.keys(C),B;return A.minProperties!==void 0&&D.length<A.minProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:D.length,minimum:A.minProperties},"","/minProperties",null,C,A),this.handleError(B))||A.maxProperties!==void 0&&D.length>A.maxProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:D.length,maximum:A.maxProperties},"","/maxProperties",null,C,A),this.handleError(B))?B:null},s.prototype.validateObjectRequiredProperties=function(C,A){if(A.required!==void 0)for(var D=0;D<A.required.length;D++){var B=A.required[D];if(C[B]===void 0){var F=this.createError(_.OBJECT_REQUIRED,{key:B},"","/required/"+D,null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateObjectProperties=function(C,A,D){var B;for(var F in C){var K=D+"/"+F.replace(/~/g,"~0").replace(/\//g,"~1"),ee=!1;if(A.properties!==void 0&&A.properties[F]!==void 0&&(ee=!0,B=this.validateAll(C[F],A.properties[F],[F],["properties",F],K)))return B;if(A.patternProperties!==void 0)for(var ie in A.patternProperties){var pe=new RegExp(ie);if(pe.test(F)&&(ee=!0,B=this.validateAll(C[F],A.patternProperties[ie],[F],["patternProperties",ie],K)))return B}if(ee)this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(B=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:F},"","/additionalProperties",null,C,A).prefixWith(F,null),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalProperties,[F],["additionalProperties"],K))return B}else this.trackUnknownProperties&&!this.knownPropertyPaths[K]&&(this.unknownPropertyPaths[K]=!0)}return null},s.prototype.validateObjectDependencies=function(C,A,D){var B;if(A.dependencies!==void 0){for(var F in A.dependencies)if(C[F]!==void 0){var K=A.dependencies[F];if(typeof K=="string"){if(C[K]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:K},"","",null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(Array.isArray(K))for(var ee=0;ee<K.length;ee++){var ie=K[ee];if(C[ie]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:ie},"","/"+ee,null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(B=this.validateAll(C,K,[],["dependencies",F],D))return B}}return null},s.prototype.validateCombinations=function(C,A,D){return this.validateAllOf(C,A,D)||this.validateAnyOf(C,A,D)||this.validateOneOf(C,A,D)||this.validateNot(C,A,D)||null},s.prototype.validateAllOf=function(C,A,D){if(A.allOf===void 0)return null;for(var B,F=0;F<A.allOf.length;F++){var K=A.allOf[F];if(B=this.validateAll(C,K,[],["allOf",F],D))return B}return null},s.prototype.validateAnyOf=function(C,A,D){if(A.anyOf===void 0)return null;var B=[],F=this.errors.length,K,ee;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ee=this.knownPropertyPaths);for(var ie=!0,pe=0;pe<A.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Pe=A.anyOf[pe],de=this.errors.length,le=this.validateAll(C,Pe,[],["anyOf",pe],D);if(le===null&&de===this.errors.length){if(this.errors=this.errors.slice(0,F),this.trackUnknownProperties){for(var be in this.knownPropertyPaths)ee[be]=!0,delete K[be];for(var ze in this.unknownPropertyPaths)ee[ze]||(K[ze]=!0);ie=!1;continue}return null}le&&B.push(le.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ee),ie)return B=B.concat(this.errors.slice(F)),this.errors=this.errors.slice(0,F),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",B,C,A)},s.prototype.validateOneOf=function(C,A,D){if(A.oneOf===void 0)return null;var B=null,F=[],K=this.errors.length,ee,ie;this.trackUnknownProperties&&(ee=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var pe=0;pe<A.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Pe=A.oneOf[pe],de=this.errors.length,le=this.validateAll(C,Pe,[],["oneOf",pe],D);if(le===null&&de===this.errors.length){if(B===null)B=pe;else return this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MULTIPLE,{index1:B,index2:pe},"","/oneOf",null,C,A);if(this.trackUnknownProperties){for(var be in this.knownPropertyPaths)ie[be]=!0,delete ee[be];for(var ze in this.unknownPropertyPaths)ie[ze]||(ee[ze]=!0)}}else le&&F.push(le)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=ee,this.knownPropertyPaths=ie),B===null?(F=F.concat(this.errors.slice(K)),this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",F,C,A)):(this.errors=this.errors.slice(0,K),null)},s.prototype.validateNot=function(C,A,D){if(A.not===void 0)return null;var B=this.errors.length,F,K;this.trackUnknownProperties&&(F=this.unknownPropertyPaths,K=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var ee=this.validateAll(C,A.not,null,null,D),ie=this.errors.slice(B);return this.errors=this.errors.slice(0,B),this.trackUnknownProperties&&(this.unknownPropertyPaths=F,this.knownPropertyPaths=K),ee===null&&ie.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,A):null},s.prototype.validateHypermedia=function(C,A,D){if(!A.links)return null;for(var B,F=0;F<A.links.length;F++){var K=A.links[F];if(K.rel==="describedby"){for(var ee=new i(K.href),ie=!0,pe=0;pe<ee.varNames.length;pe++)if(!(ee.varNames[pe]in C)){ie=!1;break}if(ie){var Pe=ee.fillFromObject(C),de={$ref:Pe};if(B=this.validateAll(C,de,[],["links",F],D))return B}}}};function c(q){var C=String(q).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return C?{href:C[0]||"",protocol:C[1]||"",authority:C[2]||"",host:C[3]||"",hostname:C[4]||"",port:C[5]||"",pathname:C[6]||"",search:C[7]||"",hash:C[8]||""}:null}function p(q,C){function A(D){var B=[];return D.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(F){F==="/.."?B.pop():B.push(F)}),B.join("").replace(/^\//,D.charAt(0)==="/"?"/":"")}return C=c(C||""),q=c(q||""),!C||!q?null:(C.protocol||q.protocol)+(C.protocol||C.authority?C.authority:q.authority)+A(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(q.authority&&!q.pathname?"/":"")+q.pathname.slice(0,q.pathname.lastIndexOf("/")+1)+C.pathname:q.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||q.search)+C.hash}function h(q){return q.split("#")[0]}function g(q,C){if(q&&typeof q=="object")if(C===void 0?C=q.id:typeof q.id=="string"&&(C=p(C,q.id),q.id=C),Array.isArray(q))for(var A=0;A<q.length;A++)g(q[A],C);else{typeof q.$ref=="string"&&(q.$ref=p(C,q.$ref));for(var D in q)D!=="enum"&&g(q[D],C)}}function v(q){q=q||"en";var C=$[q];return function(A){var D=C[A.code]||k[A.code];if(typeof D!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var B=A.params;return D.replace(/\{([^{}]*)\}/g,function(F,K){var ee=B[K];return typeof ee=="string"||typeof ee=="number"?ee:F})}}var _={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},w={};for(var E in _)w[_[E]]=E;var k={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 T(q,C,A,D,B){if(Error.call(this),q===void 0)throw new Error("No error code supplied: "+D);this.message="",this.params=C,this.code=q,this.dataPath=A||"",this.schemaPath=D||"",this.subErrors=B||null;var F=new Error(this.message);if(this.stack=F.stack||F.stacktrace,!this.stack)try{throw F}catch(K){this.stack=K.stack||K.stacktrace}}T.prototype=Object.create(Error.prototype),T.prototype.constructor=T,T.prototype.name="ValidationError",T.prototype.prefixWith=function(q,C){if(q!==null&&(q=q.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+q+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(q,C);return this};function N(q,C){if(C.substring(0,q.length)===q){var A=C.substring(q.length);if(C.length>0&&C.charAt(q.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var $={};function j(q){var C=new s,A,D,B={setErrorReporter:function(F){return typeof F=="string"?this.language(F):(D=F,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function(F){return F?($[F]||(F=F.split("-")[0]),$[F]?(A=F,F):!1):A},addLanguage:function(F,K){var ee;for(ee in _)K[ee]&&!K[_[ee]]&&(K[_[ee]]=K[ee]);var ie=F.split("-")[0];if(!$[ie])$[F]=K,$[ie]=K;else{$[F]=Object.create($[ie]);for(ee in K)typeof $[ie][ee]>"u"&&($[ie][ee]=K[ee]),$[F][ee]=K[ee]}return this},freshApi:function(F){var K=j();return F&&K.language(F),K},validate:function(F,K,ee,ie){var pe=v(A),Pe=D?function(be,ze,mt){return D(be,ze,mt)||pe(be,ze,mt)}:pe,de=new s(C,!1,Pe,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K);var le=de.validateAll(F,K,null,null,"");return!le&&ie&&(le=de.banUnknownProperties(F,K)),this.error=le,this.missing=de.missing,this.valid=le===null,this.valid},validateResult:function(){var F={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(F,arguments),F},validateMultiple:function(F,K,ee,ie){var pe=v(A),Pe=D?function(be,ze,mt){return D(be,ze,mt)||pe(be,ze,mt)}:pe,de=new s(C,!0,Pe,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K),de.validateAll(F,K,null,null,""),ie&&de.banUnknownProperties(F,K);var le={toString:function(){return this.valid?"valid":this.error.message}};return le.errors=de.errors,le.missing=de.missing,le.valid=le.errors.length===0,le},addSchema:function(){return C.addSchema.apply(C,arguments)},getSchema:function(){return C.getSchema.apply(C,arguments)},getSchemaMap:function(){return C.getSchemaMap.apply(C,arguments)},getSchemaUris:function(){return C.getSchemaUris.apply(C,arguments)},getMissingUris:function(){return C.getMissingUris.apply(C,arguments)},dropSchemas:function(){C.dropSchemas.apply(C,arguments)},defineKeyword:function(){C.defineKeyword.apply(C,arguments)},defineError:function(F,K,ee){if(typeof F!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(F))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof K!="number"||K%1!==0||K<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[F]<"u")throw new Error("Error already defined: "+F+" as "+_[F]);if(typeof w[K]<"u")throw new Error("Error code already used: "+w[K]+" as "+K);_[F]=K,w[K]=F,k[F]=k[K]=ee;for(var ie in $){var pe=$[ie];pe[F]&&(pe[K]=pe[K]||pe[F])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:g,resolveUrl:p,getDocumentUri:h,errorCodes:_};return B.language(q||"en"),B}var G=j();return G.addLanguage("en-gb",k),G.tv4=G,G})});var kf=H(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.regexpCode=nt.getEsmExportName=nt.getProperty=nt.safeStringify=nt.stringify=nt.strConcat=nt.addCodeArg=nt.str=nt._=nt.nil=nt._Code=nt.Name=nt.IDENTIFIER=nt._CodeOrName=void 0;var Of=class{};nt._CodeOrName=Of;nt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var wa=class extends Of{constructor(e){if(super(),!nt.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}}};nt.Name=wa;var qn=class extends Of{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 wa&&(r[n.str]=(r[n.str]||0)+1),r),{})}};nt._Code=qn;nt.nil=new qn("");function PI(t,...e){let r=[t[0]],n=0;for(;n<e.length;)XS(r,e[n]),r.push(t[++n]);return new qn(r)}nt._=PI;var ZS=new qn("+");function TI(t,...e){let r=[qf(t[0])],n=0;for(;n<e.length;)r.push(ZS),XS(r,e[n]),r.push(ZS,qf(t[++n]));return M2(r),new qn(r)}nt.str=TI;function XS(t,e){e instanceof qn?t.push(...e._items):e instanceof wa?t.push(e):t.push(L2(e))}nt.addCodeArg=XS;function M2(t){let e=1;for(;e<t.length-1;){if(t[e]===ZS){let r=F2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function F2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof wa||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 wa))return`"${t}${e.slice(1)}`}function D2(t,e){return e.emptyStr()?t:t.emptyStr()?e:TI`${t}${e}`}nt.strConcat=D2;function L2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:qf(Array.isArray(t)?t.join(","):t)}function j2(t){return new qn(qf(t))}nt.stringify=j2;function qf(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}nt.safeStringify=qf;function U2(t){return typeof t=="string"&&nt.IDENTIFIER.test(t)?new qn(`.${t}`):PI`[${t}]`}nt.getProperty=U2;function H2(t){if(typeof t=="string"&&nt.IDENTIFIER.test(t))return new qn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}nt.getEsmExportName=H2;function B2(t){return new qn(t.toString())}nt.regexpCode=B2});var rw=H(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ValueScope=Vr.ValueScopeName=Vr.Scope=Vr.varKinds=Vr.UsedValueState=void 0;var Br=kf(),ew=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},dm;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(dm||(Vr.UsedValueState=dm={}));Vr.varKinds={const:new Br.Name("const"),let:new Br.Name("let"),var:new Br.Name("var")};var pm=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Br.Name?e:this.name(e)}name(e){return new Br.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}}};Vr.Scope=pm;var hm=class extends Br.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Br._)`.${new Br.Name(r)}[${n}]`}};Vr.ValueScopeName=hm;var V2=(0,Br._)`\n`,tw=class extends pm{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?V2:Br.nil}}get(){return this._scope}name(e){return new hm(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,o=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let p=l.get(o);if(p)return p}else l=this._values[s]=new Map;l.set(o,i);let f=this._scope[s]||(this._scope[s]=[]),c=f.length;return f[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),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,Br._)`${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=Br.nil;for(let o in e){let l=e[o];if(!l)continue;let f=n[o]=n[o]||new Map;l.forEach(c=>{if(f.has(c))return;f.set(c,dm.Started);let p=r(c);if(p){let h=this.opts.es5?Vr.varKinds.var:Vr.varKinds.const;s=(0,Br._)`${s}${h} ${c} = ${p};${this.opts._n}`}else if(p=i?.(c))s=(0,Br._)`${s}${p}${this.opts._n}`;else throw new ew(c);f.set(c,dm.Completed)})}return s}};Vr.ValueScope=tw});var Ue=H(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.or=Fe.and=Fe.not=Fe.CodeGen=Fe.operators=Fe.varKinds=Fe.ValueScopeName=Fe.ValueScope=Fe.Scope=Fe.Name=Fe.regexpCode=Fe.stringify=Fe.getProperty=Fe.nil=Fe.strConcat=Fe.str=Fe._=void 0;var Ye=kf(),Zn=rw(),so=kf();Object.defineProperty(Fe,"_",{enumerable:!0,get:function(){return so._}});Object.defineProperty(Fe,"str",{enumerable:!0,get:function(){return so.str}});Object.defineProperty(Fe,"strConcat",{enumerable:!0,get:function(){return so.strConcat}});Object.defineProperty(Fe,"nil",{enumerable:!0,get:function(){return so.nil}});Object.defineProperty(Fe,"getProperty",{enumerable:!0,get:function(){return so.getProperty}});Object.defineProperty(Fe,"stringify",{enumerable:!0,get:function(){return so.stringify}});Object.defineProperty(Fe,"regexpCode",{enumerable:!0,get:function(){return so.regexpCode}});Object.defineProperty(Fe,"Name",{enumerable:!0,get:function(){return so.Name}});var vm=rw();Object.defineProperty(Fe,"Scope",{enumerable:!0,get:function(){return vm.Scope}});Object.defineProperty(Fe,"ValueScope",{enumerable:!0,get:function(){return vm.ValueScope}});Object.defineProperty(Fe,"ValueScopeName",{enumerable:!0,get:function(){return vm.ValueScopeName}});Object.defineProperty(Fe,"varKinds",{enumerable:!0,get:function(){return vm.varKinds}});Fe.operators={GT:new Ye._Code(">"),GTE:new Ye._Code(">="),LT:new Ye._Code("<"),LTE:new Ye._Code("<="),EQ:new Ye._Code("==="),NEQ:new Ye._Code("!=="),NOT:new Ye._Code("!"),OR:new Ye._Code("||"),AND:new Ye._Code("&&"),ADD:new Ye._Code("+")};var ds=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},nw=class extends ds{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Zn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=bu(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ye._CodeOrName?this.rhs.names:{}}},mm=class extends ds{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 Ye.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=bu(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ye.Name?{}:{...this.lhs.names};return ym(e,this.rhs)}},iw=class extends mm{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},sw=class extends ds{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},ow=class extends ds{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},aw=class extends ds{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},lw=class extends ds{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=bu(this.code,e,r),this}get names(){return this.code instanceof Ye._CodeOrName?this.code.names:{}}},Pf=class extends ds{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)||(W2(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ca(e,r.names),{})}},ps=class extends Pf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},uw=class extends Pf{},vu=class extends ps{};vu.kind="else";var _a=class t extends ps{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 vu(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(AI(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=bu(this.condition,e,r),this}get names(){let e=super.names;return ym(e,this.condition),this.else&&Ca(e,this.else.names),e}};_a.kind="if";var Ra=class extends ps{};Ra.kind="for";var cw=class extends Ra{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=bu(this.iteration,e,r),this}get names(){return Ca(super.names,this.iteration.names)}},fw=class extends Ra{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Zn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=ym(super.names,this.from);return ym(e,this.to)}},gm=class extends Ra{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=bu(this.iterable,e,r),this}get names(){return Ca(super.names,this.iterable.names)}},Tf=class extends ps{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)}};Tf.kind="func";var Af=class extends Pf{render(e){return"return "+super.render(e)}};Af.kind="return";var dw=class extends ps{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&&Ca(e,this.catch.names),this.finally&&Ca(e,this.finally.names),e}},$f=class extends ps{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};$f.kind="catch";var Nf=class extends ps{render(e){return"finally"+super.render(e)}};Nf.kind="finally";var pw=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new Zn.Scope({parent:e}),this._nodes=[new uw]}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 nw(e,s,n)),s}const(e,r,n){return this._def(Zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new mm(e,r,n))}add(e,r){return this._leafNode(new iw(e,Fe.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ye.nil&&this._leafNode(new lw(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,Ye.addCodeArg)(r,i));return r.push("}"),new Ye._Code(r)}if(e,r,n){if(this._blockNode(new _a(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 _a(e))}else(){return this._elseNode(new vu)}endIf(){return this._endBlockNode(_a,vu)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new cw(e),r)}forRange(e,r,n,i,s=this.opts.es5?Zn.varKinds.var:Zn.varKinds.let){let o=this._scope.toName(e);return this._for(new fw(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ye.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ye._)`${o}.length`,l=>{this.var(s,(0,Ye._)`${o}[${l}]`),n(s)})}return this._for(new gm("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Zn.varKinds.var:Zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ye._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new gm("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Ra)}label(e){return this._leafNode(new sw(e))}break(e){return this._leafNode(new ow(e))}return(e){let r=new Af;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Af)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new dw;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new $f(s),r(s)}return n&&(this._currNode=i.finally=new Nf,this.code(n)),this._endBlockNode($f,Nf)}throw(e){return this._leafNode(new aw(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=Ye.nil,n,i){return this._blockNode(new Tf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Tf)}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 _a))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}};Fe.CodeGen=pw;function Ca(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function ym(t,e){return e instanceof Ye._CodeOrName?Ca(t,e.names):t}function bu(t,e,r){if(t instanceof Ye.Name)return n(t);if(!i(t))return t;return new Ye._Code(t._items.reduce((s,o)=>(o instanceof Ye.Name&&(o=n(o)),o instanceof Ye._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof Ye._Code&&s._items.some(o=>o instanceof Ye.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function W2(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function AI(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ye._)`!${hw(t)}`}Fe.not=AI;var z2=$I(Fe.operators.AND);function J2(...t){return t.reduce(z2)}Fe.and=J2;var G2=$I(Fe.operators.OR);function Y2(...t){return t.reduce(G2)}Fe.or=Y2;function $I(t){return(e,r)=>e===Ye.nil?r:r===Ye.nil?e:(0,Ye._)`${hw(e)} ${t} ${hw(r)}`}function hw(t){return t instanceof Ye.Name?t:(0,Ye._)`(${t})`}});var Ze=H(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.checkStrictMode=He.getErrorPath=He.Type=He.useFunc=He.setEvaluated=He.evaluatedPropsToName=He.mergeEvaluated=He.eachItem=He.unescapeJsonPointer=He.escapeJsonPointer=He.escapeFragment=He.unescapeFragment=He.schemaRefOrVal=He.schemaHasRulesButRef=He.schemaHasRules=He.checkUnknownRules=He.alwaysValidSchema=He.toHash=void 0;var wt=Ue(),K2=kf();function Q2(t){let e={};for(let r of t)e[r]=!0;return e}He.toHash=Q2;function Z2(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(FI(t,e),!DI(e,t.self.RULES.all))}He.alwaysValidSchema=Z2;function FI(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]||UI(t,`unknown keyword: "${s}"`)}He.checkUnknownRules=FI;function DI(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}He.schemaHasRules=DI;function X2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}He.schemaHasRulesButRef=X2;function eU({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,wt._)`${r}`}return(0,wt._)`${t}${e}${(0,wt.getProperty)(n)}`}He.schemaRefOrVal=eU;function tU(t){return LI(decodeURIComponent(t))}He.unescapeFragment=tU;function rU(t){return encodeURIComponent(gw(t))}He.escapeFragment=rU;function gw(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}He.escapeJsonPointer=gw;function LI(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}He.unescapeJsonPointer=LI;function nU(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}He.eachItem=nU;function NI({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let f=o===void 0?s:o instanceof wt.Name?(s instanceof wt.Name?t(i,s,o):e(i,s,o),o):s instanceof wt.Name?(e(i,o,s),s):r(s,o);return l===wt.Name&&!(f instanceof wt.Name)?n(i,f):f}}He.mergeEvaluated={props:NI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,wt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,wt._)`${r} || {}`).code((0,wt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,wt._)`${r} || {}`),yw(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:jI}),items:NI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,wt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,wt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function jI(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,wt._)`{}`);return e!==void 0&&yw(t,r,e),r}He.evaluatedPropsToName=jI;function yw(t,e,r){Object.keys(r).forEach(n=>t.assign((0,wt._)`${e}${(0,wt.getProperty)(n)}`,!0))}He.setEvaluated=yw;var MI={};function iU(t,e){return t.scopeValue("func",{ref:e,code:MI[e.code]||(MI[e.code]=new K2._Code(e.code))})}He.useFunc=iU;var mw;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(mw||(He.Type=mw={}));function sU(t,e,r){if(t instanceof wt.Name){let n=e===mw.Num;return r?n?(0,wt._)`"[" + ${t} + "]"`:(0,wt._)`"['" + ${t} + "']"`:n?(0,wt._)`"/" + ${t}`:(0,wt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,wt.getProperty)(t).toString():"/"+gw(t)}He.getErrorPath=sU;function UI(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}He.checkStrictMode=UI});var hs=H(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var hr=Ue(),oU={data:new hr.Name("data"),valCxt:new hr.Name("valCxt"),instancePath:new hr.Name("instancePath"),parentData:new hr.Name("parentData"),parentDataProperty:new hr.Name("parentDataProperty"),rootData:new hr.Name("rootData"),dynamicAnchors:new hr.Name("dynamicAnchors"),vErrors:new hr.Name("vErrors"),errors:new hr.Name("errors"),this:new hr.Name("this"),self:new hr.Name("self"),scope:new hr.Name("scope"),json:new hr.Name("json"),jsonPos:new hr.Name("jsonPos"),jsonLen:new hr.Name("jsonLen"),jsonPart:new hr.Name("jsonPart")};vw.default=oU});var Mf=H(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.extendErrors=mr.resetErrorsCount=mr.reportExtraError=mr.reportError=mr.keyword$DataError=mr.keywordError=void 0;var Xe=Ue(),bm=Ze(),kr=hs();mr.keywordError={message:({keyword:t})=>(0,Xe.str)`must pass "${t}" keyword validation`};mr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Xe.str)`"${t}" keyword must be ${e} ($data)`:(0,Xe.str)`"${t}" keyword is invalid ($data)`};function aU(t,e=mr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,f=VI(t,e,r);n??(o||l)?HI(s,f):BI(i,(0,Xe._)`[${f}]`)}mr.reportError=aU;function lU(t,e=mr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=VI(t,e,r);HI(i,l),s||o||BI(n,kr.default.vErrors)}mr.reportExtraError=lU;function uU(t,e){t.assign(kr.default.errors,e),t.if((0,Xe._)`${kr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Xe._)`${kr.default.vErrors}.length`,e),()=>t.assign(kr.default.vErrors,null)))}mr.resetErrorsCount=uU;function cU({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,kr.default.errors,l=>{t.const(o,(0,Xe._)`${kr.default.vErrors}[${l}]`),t.if((0,Xe._)`${o}.instancePath === undefined`,()=>t.assign((0,Xe._)`${o}.instancePath`,(0,Xe.strConcat)(kr.default.instancePath,s.errorPath))),t.assign((0,Xe._)`${o}.schemaPath`,(0,Xe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Xe._)`${o}.schema`,r),t.assign((0,Xe._)`${o}.data`,n))})}mr.extendErrors=cU;function HI(t,e){let r=t.const("err",e);t.if((0,Xe._)`${kr.default.vErrors} === null`,()=>t.assign(kr.default.vErrors,(0,Xe._)`[${r}]`),(0,Xe._)`${kr.default.vErrors}.push(${r})`),t.code((0,Xe._)`${kr.default.errors}++`)}function BI(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Xe._)`new ${t.ValidationError}(${e})`):(r.assign((0,Xe._)`${n}.errors`,e),r.return(!1))}var xa={keyword:new Xe.Name("keyword"),schemaPath:new Xe.Name("schemaPath"),params:new Xe.Name("params"),propertyName:new Xe.Name("propertyName"),message:new Xe.Name("message"),schema:new Xe.Name("schema"),parentSchema:new Xe.Name("parentSchema")};function VI(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Xe._)`{}`:fU(t,e,r)}function fU(t,e,r={}){let{gen:n,it:i}=t,s=[dU(i,r),pU(t,r)];return hU(t,e,s),n.object(...s)}function dU({errorPath:t},{instancePath:e}){let r=e?(0,Xe.str)`${t}${(0,bm.getErrorPath)(e,bm.Type.Str)}`:t;return[kr.default.instancePath,(0,Xe.strConcat)(kr.default.instancePath,r)]}function pU({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Xe.str)`${e}/${t}`;return r&&(i=(0,Xe.str)`${i}${(0,bm.getErrorPath)(r,bm.Type.Str)}`),[xa.schemaPath,i]}function hU(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:f,propertyName:c,topSchemaRef:p,schemaPath:h}=l;n.push([xa.keyword,i],[xa.params,typeof e=="function"?e(t):e||(0,Xe._)`{}`]),f.messages&&n.push([xa.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([xa.schema,o],[xa.parentSchema,(0,Xe._)`${p}${h}`],[kr.default.data,s]),c&&n.push([xa.propertyName,c])}});var zI=H(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.boolOrEmptySchema=Su.topBoolOrEmptySchema=void 0;var mU=Mf(),gU=Ue(),yU=hs(),vU={message:"boolean schema is false"};function bU(t){let{gen:e,schema:r,validateName:n}=t;r===!1?WI(t,!1):typeof r=="object"&&r.$async===!0?e.return(yU.default.data):(e.assign((0,gU._)`${n}.errors`,null),e.return(!0))}Su.topBoolOrEmptySchema=bU;function SU(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),WI(t)):r.var(e,!0)}Su.boolOrEmptySchema=SU;function WI(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,mU.reportError)(i,vU,void 0,e)}});var bw=H(wu=>{"use strict";Object.defineProperty(wu,"__esModule",{value:!0});wu.getRules=wu.isJSONType=void 0;var wU=["string","number","integer","boolean","null","object","array"],_U=new Set(wU);function RU(t){return typeof t=="string"&&_U.has(t)}wu.isJSONType=RU;function CU(){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:{}}}wu.getRules=CU});var Sw=H(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.shouldUseRule=oo.shouldUseGroup=oo.schemaHasRulesForType=void 0;function xU({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&JI(t,n)}oo.schemaHasRulesForType=xU;function JI(t,e){return e.rules.some(r=>GI(t,r))}oo.shouldUseGroup=JI;function GI(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))}oo.shouldUseRule=GI});var Ff=H(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.reportTypeError=gr.checkDataTypes=gr.checkDataType=gr.coerceAndCheckDataType=gr.getJSONTypes=gr.getSchemaTypes=gr.DataType=void 0;var EU=bw(),IU=Sw(),OU=Mf(),ke=Ue(),YI=Ze(),_u;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(_u||(gr.DataType=_u={}));function qU(t){let e=KI(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}gr.getSchemaTypes=qU;function KI(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(EU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}gr.getJSONTypes=KI;function kU(t,e){let{gen:r,data:n,opts:i}=t,s=PU(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,IU.schemaHasRulesForType)(t,e[0]));if(o){let l=_w(e,n,i.strictNumbers,_u.Wrong);r.if(l,()=>{s.length?TU(t,e,s):Rw(t)})}return o}gr.coerceAndCheckDataType=kU;var QI=new Set(["string","number","integer","boolean","null"]);function PU(t,e){return e?t.filter(r=>QI.has(r)||e==="array"&&r==="array"):[]}function TU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,ke._)`typeof ${i}`),l=n.let("coerced",(0,ke._)`undefined`);s.coerceTypes==="array"&&n.if((0,ke._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,ke._)`${i}[0]`).assign(o,(0,ke._)`typeof ${i}`).if(_w(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,ke._)`${l} !== undefined`);for(let c of r)(QI.has(c)||c==="array"&&s.coerceTypes==="array")&&f(c);n.else(),Rw(t),n.endIf(),n.if((0,ke._)`${l} !== undefined`,()=>{n.assign(i,l),AU(t,l)});function f(c){switch(c){case"string":n.elseIf((0,ke._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,ke._)`"" + ${i}`).elseIf((0,ke._)`${i} === null`).assign(l,(0,ke._)`""`);return;case"number":n.elseIf((0,ke._)`${o} == "boolean" || ${i} === null
|
|
25
25
|
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,ke._)`+${i}`);return;case"integer":n.elseIf((0,ke._)`${o} === "boolean" || ${i} === null
|
|
26
26
|
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,ke._)`+${i}`);return;case"boolean":n.elseIf((0,ke._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,ke._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,ke._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,ke._)`${o} === "string" || ${o} === "number"
|
|
27
|
-
|| ${o} === "boolean" || ${i} === null`).assign(l,(0,ke._)`[${i}]`)}}}function AU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ke._)`${e} !== undefined`,()=>t.assign((0,ke._)`${e}[${r}]`,n))}function ww(t,e,r,n=_u.Correct){let i=n===_u.Correct?ke.operators.EQ:ke.operators.NEQ,s;switch(t){case"null":return(0,ke._)`${e} ${i} null`;case"array":s=(0,ke._)`Array.isArray(${e})`;break;case"object":s=(0,ke._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,ke._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,ke._)`typeof ${e} ${i} ${t}`}return n===_u.Correct?s:(0,ke.not)(s);function o(l=ke.nil){return(0,ke.and)((0,ke._)`typeof ${e} == "number"`,l,r?(0,ke._)`isFinite(${e})`:ke.nil)}}gr.checkDataType=ww;function _w(t,e,r,n){if(t.length===1)return ww(t[0],e,r,n);let i,s=(0,YI.toHash)(t);if(s.array&&s.object){let o=(0,ke._)`typeof ${e} != "object"`;i=s.null?o:(0,ke._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=ke.nil;s.number&&delete s.integer;for(let o in s)i=(0,ke.and)(i,ww(o,e,r,n));return i}gr.checkDataTypes=_w;var $U={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ke._)`{type: ${t}}`:(0,ke._)`{type: ${e}}`};function Rw(t){let e=NU(t);(0,qU.reportError)(e,$U)}gr.reportTypeError=Rw;function NU(t){let{gen:e,data:r,schema:n}=t,i=(0,YI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var XI=H(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.assignDefaults=void 0;var Ru=Ue(),MU=Ze();function FU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)ZI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>ZI(t,s,i.default))}Sm.assignDefaults=FU;function ZI(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,Ru._)`${s}${(0,Ru.getProperty)(e)}`;if(i){(0,MU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Ru._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,Ru._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Ru._)`${l} = ${(0,Ru.stringify)(r)}`)}});var kn=H(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.validateUnion=bt.validateArray=bt.usePattern=bt.callValidateCode=bt.schemaProperties=bt.allSchemaProperties=bt.noPropertyInData=bt.propertyInData=bt.isOwnProperty=bt.hasPropFunc=bt.reportMissingProp=bt.checkMissingProp=bt.checkReportMissingProp=void 0;var Et=Ue(),Cw=Ze(),ao=hs(),DU=Ze();function LU(t,e){let{gen:r,data:n,it:i}=t;r.if(Ew(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Et._)`${e}`},!0),t.error()})}bt.checkReportMissingProp=LU;function jU({gen:t,data:e,it:{opts:r}},n,i){return(0,Et.or)(...n.map(s=>(0,Et.and)(Ew(t,e,s,r.ownProperties),(0,Et._)`${i} = ${s}`)))}bt.checkMissingProp=jU;function UU(t,e){t.setParams({missingProperty:e},!0),t.error()}bt.reportMissingProp=UU;function eq(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Et._)`Object.prototype.hasOwnProperty`})}bt.hasPropFunc=eq;function xw(t,e,r){return(0,Et._)`${eq(t)}.call(${e}, ${r})`}bt.isOwnProperty=xw;function HU(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} !== undefined`;return n?(0,Et._)`${i} && ${xw(t,e,r)}`:i}bt.propertyInData=HU;function Ew(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} === undefined`;return n?(0,Et.or)(i,(0,Et.not)(xw(t,e,r))):i}bt.noPropertyInData=Ew;function tq(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}bt.allSchemaProperties=tq;function BU(t,e){return tq(e).filter(r=>!(0,Cw.alwaysValidSchema)(t,e[r]))}bt.schemaProperties=BU;function VU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,f,c){let p=c?(0,Et._)`${t}, ${e}, ${n}${i}`:e,h=[[ao.default.instancePath,(0,Et.strConcat)(ao.default.instancePath,s)],[ao.default.parentData,o.parentData],[ao.default.parentDataProperty,o.parentDataProperty],[ao.default.rootData,ao.default.rootData]];o.opts.dynamicRef&&h.push([ao.default.dynamicAnchors,ao.default.dynamicAnchors]);let g=(0,Et._)`${p}, ${r.object(...h)}`;return f!==Et.nil?(0,Et._)`${l}.call(${f}, ${g})`:(0,Et._)`${l}(${g})`}bt.callValidateCode=VU;var WU=(0,Et._)`new RegExp`;function zU({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,Et._)`${i.code==="new RegExp"?WU:(0,DU.useFunc)(t,i)}(${r}, ${n})`})}bt.usePattern=zU;function JU(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 o(()=>e.assign(l,!1)),l}return e.var(s,!0),o(()=>e.break()),s;function o(l){let f=e.const("len",(0,Et._)`${r}.length`);e.forRange("i",0,f,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:Cw.Type.Num},s),e.if((0,Et.not)(s),l)})}}bt.validateArray=JU;function GU(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,Cw.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,c)=>{let p=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},l);e.assign(o,(0,Et._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Et.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}bt.validateUnion=GU});var iq=H(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.validateKeywordUsage=Ti.validSchemaType=Ti.funcKeywordCode=Ti.macroKeywordCode=void 0;var Pr=Ue(),Ea=hs(),YU=kn(),KU=Mf();function QU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),f=nq(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let c=r.name("valid");t.subschema({schema:l,schemaPath:Pr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}Ti.macroKeywordCode=QU;function ZU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:f}=t;eH(f,e);let c=!l&&e.compile?e.compile.call(f.self,s,o,f):e.validate,p=nq(n,i,c),h=n.let("valid");t.block$data(h,g),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function g(){if(e.errors===!1)w(),e.modifying&&rq(t),E(()=>t.error());else{let k=e.async?v():_();e.modifying&&rq(t),E(()=>XU(t,k))}}function v(){let k=n.let("ruleErrs",null);return n.try(()=>w((0,Pr._)`await `),T=>n.assign(h,!1).if((0,Pr._)`${T} instanceof ${f.ValidationError}`,()=>n.assign(k,(0,Pr._)`${T}.errors`),()=>n.throw(T))),k}function _(){let k=(0,Pr._)`${p}.errors`;return n.assign(k,null),w(Pr.nil),k}function w(k=e.async?(0,Pr._)`await `:Pr.nil){let T=f.opts.passContext?Ea.default.this:Ea.default.self,N=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Pr._)`${k}${(0,YU.callValidateCode)(t,p,T,N)}`,e.modifying)}function E(k){var T;n.if((0,Pr.not)((T=e.valid)!==null&&T!==void 0?T:h),k)}}Ti.funcKeywordCode=ZU;function rq(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Pr._)`${n.parentData}[${n.parentDataProperty}]`))}function XU(t,e){let{gen:r}=t;r.if((0,Pr._)`Array.isArray(${e})`,()=>{r.assign(Ea.default.vErrors,(0,Pr._)`${Ea.default.vErrors} === null ? ${e} : ${Ea.default.vErrors}.concat(${e})`).assign(Ea.default.errors,(0,Pr._)`${Ea.default.vErrors}.length`),(0,KU.extendErrors)(t)},()=>t.error())}function eH({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function nq(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,Pr.stringify)(r)})}function tH(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")}Ti.validSchemaType=tH;function rH({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 o=i.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${o.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)}}Ti.validateKeywordUsage=rH});var oq=H(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.extendSubschemaMode=lo.extendSubschemaData=lo.getSubschema=void 0;var Ai=Ue(),sq=Ze();function nH(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){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,Ai._)`${t.schemaPath}${(0,Ai.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Ai._)`${t.schemaPath}${(0,Ai.getProperty)(e)}${(0,Ai.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,sq.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}lo.getSubschema=nH;function iH(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:c,dataPathArr:p,opts:h}=e,g=l.let("data",(0,Ai._)`${e.data}${(0,Ai.getProperty)(r)}`,!0);f(g),t.errorPath=(0,Ai.str)`${c}${(0,sq.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Ai._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let c=i instanceof Ai.Name?i:l.let("data",i,!0);f(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function f(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}lo.extendSubschemaData=iH;function sH(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}lo.extendSubschemaMode=sH});var Iw=H((_Q,aq)=>{"use strict";aq.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 o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var uq=H((RQ,lq)=>{"use strict";var uo=lq.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(){};wm(e,n,i,t,"",t)};uo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};uo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};uo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};uo.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 wm(t,e,r,n,i,s,o,l,f,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,f,c);for(var p in n){var h=n[p];if(Array.isArray(h)){if(p in uo.arrayKeywords)for(var g=0;g<h.length;g++)wm(t,e,r,h[g],i+"/"+p+"/"+g,s,i,p,n,g)}else if(p in uo.propsKeywords){if(h&&typeof h=="object")for(var v in h)wm(t,e,r,h[v],i+"/"+p+"/"+oH(v),s,i,p,n,v)}else(p in uo.keywords||t.allKeys&&!(p in uo.skipKeywords))&&wm(t,e,r,h,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,f,c)}}function oH(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Df=H(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.getSchemaRefs=Wr.resolveUrl=Wr.normalizeId=Wr._getFullPath=Wr.getFullPath=Wr.inlineRef=void 0;var aH=Ze(),lH=Iw(),uH=uq(),cH=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fH(t,e=!0){return typeof t=="boolean"?!0:e===!0?!qw(t):e?cq(t)<=e:!1}Wr.inlineRef=fH;var dH=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qw(t){for(let e in t){if(dH.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(qw)||typeof r=="object"&&qw(r))return!0}return!1}function cq(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!cH.has(r)&&(typeof t[r]=="object"&&(0,aH.eachItem)(t[r],n=>e+=cq(n)),e===1/0))return 1/0}return e}function fq(t,e="",r){r!==!1&&(e=Cu(e));let n=t.parse(e);return dq(t,n)}Wr.getFullPath=fq;function dq(t,e){return t.serialize(e).split("#")[0]+"#"}Wr._getFullPath=dq;var pH=/#\/?$/;function Cu(t){return t?t.replace(pH,""):""}Wr.normalizeId=Cu;function hH(t,e,r){return r=Cu(r),t.resolve(e,r)}Wr.resolveUrl=hH;var mH=/^[a-z_][-a-z0-9._]*$/i;function gH(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Cu(t[r]||e),s={"":i},o=fq(n,i,!1),l={},f=new Set;return uH(t,{allKeys:!0},(h,g,v,_)=>{if(_===void 0)return;let w=o+g,E=s[_];typeof h[r]=="string"&&(E=k.call(this,h[r])),T.call(this,h.$anchor),T.call(this,h.$dynamicAnchor),s[g]=E;function k(N){let $=this.opts.uriResolver.resolve;if(N=Cu(E?$(E,N):N),f.has(N))throw p(N);f.add(N);let j=this.refs[N];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?c(h,j.schema,N):N!==Cu(w)&&(N[0]==="#"?(c(h,l[N],N),l[N]=h):this.refs[N]=w),N}function T(N){if(typeof N=="string"){if(!mH.test(N))throw new Error(`invalid anchor "${N}"`);k.call(this,`#${N}`)}}}),l;function c(h,g,v){if(g!==void 0&&!lH(h,g))throw p(v)}function p(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Wr.getSchemaRefs=gH});var Uf=H(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.getData=co.KeywordCxt=co.validateFunctionCode=void 0;var yq=zI(),pq=Ff(),kw=Sw(),_m=Ff(),yH=XI(),jf=iq(),Ow=oq(),ve=Ue(),xe=hs(),vH=Df(),ms=Ze(),Lf=Mf();function bH(t){if(Sq(t)&&(wq(t),bq(t))){_H(t);return}vq(t,()=>(0,yq.topBoolOrEmptySchema)(t))}co.validateFunctionCode=bH;function vq({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ve._)`${xe.default.data}, ${xe.default.valCxt}`,n.$async,()=>{t.code((0,ve._)`"use strict"; ${hq(r,i)}`),wH(t,i),t.code(s)}):t.func(e,(0,ve._)`${xe.default.data}, ${SH(i)}`,n.$async,()=>t.code(hq(r,i)).code(s))}function SH(t){return(0,ve._)`{${xe.default.instancePath}="", ${xe.default.parentData}, ${xe.default.parentDataProperty}, ${xe.default.rootData}=${xe.default.data}${t.dynamicRef?(0,ve._)`, ${xe.default.dynamicAnchors}={}`:ve.nil}}={}`}function wH(t,e){t.if(xe.default.valCxt,()=>{t.var(xe.default.instancePath,(0,ve._)`${xe.default.valCxt}.${xe.default.instancePath}`),t.var(xe.default.parentData,(0,ve._)`${xe.default.valCxt}.${xe.default.parentData}`),t.var(xe.default.parentDataProperty,(0,ve._)`${xe.default.valCxt}.${xe.default.parentDataProperty}`),t.var(xe.default.rootData,(0,ve._)`${xe.default.valCxt}.${xe.default.rootData}`),e.dynamicRef&&t.var(xe.default.dynamicAnchors,(0,ve._)`${xe.default.valCxt}.${xe.default.dynamicAnchors}`)},()=>{t.var(xe.default.instancePath,(0,ve._)`""`),t.var(xe.default.parentData,(0,ve._)`undefined`),t.var(xe.default.parentDataProperty,(0,ve._)`undefined`),t.var(xe.default.rootData,xe.default.data),e.dynamicRef&&t.var(xe.default.dynamicAnchors,(0,ve._)`{}`)})}function _H(t){let{schema:e,opts:r,gen:n}=t;vq(t,()=>{r.$comment&&e.$comment&&Rq(t),IH(t),n.let(xe.default.vErrors,null),n.let(xe.default.errors,0),r.unevaluated&&RH(t),_q(t),kH(t)})}function RH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ve._)`${r}.evaluated`),e.if((0,ve._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ve._)`${t.evaluated}.props`,(0,ve._)`undefined`)),e.if((0,ve._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ve._)`${t.evaluated}.items`,(0,ve._)`undefined`))}function hq(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ve._)`/*# sourceURL=${r} */`:ve.nil}function CH(t,e){if(Sq(t)&&(wq(t),bq(t))){xH(t,e);return}(0,yq.boolOrEmptySchema)(t,e)}function bq({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 Sq(t){return typeof t.schema!="boolean"}function xH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&Rq(t),qH(t),OH(t);let s=n.const("_errs",xe.default.errors);_q(t,s),n.var(e,(0,ve._)`${s} === ${xe.default.errors}`)}function wq(t){(0,ms.checkUnknownRules)(t),EH(t)}function _q(t,e){if(t.opts.jtd)return mq(t,[],!1,e);let r=(0,pq.getSchemaTypes)(t.schema),n=(0,pq.coerceAndCheckDataType)(t,r);mq(t,r,!n,e)}function EH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,ms.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function IH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ms.checkStrictMode)(t,"default is ignored in the schema root")}function qH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,vH.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function OH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Rq({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ve._)`${xe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,ve.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ve._)`${xe.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function kH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ve._)`${xe.default.errors} === 0`,()=>e.return(xe.default.data),()=>e.throw((0,ve._)`new ${i}(${xe.default.vErrors})`)):(e.assign((0,ve._)`${n}.errors`,xe.default.vErrors),s.unevaluated&&PH(t),e.return((0,ve._)`${xe.default.errors} === 0`))}function PH({gen:t,evaluated:e,props:r,items:n}){r instanceof ve.Name&&t.assign((0,ve._)`${e}.props`,r),n instanceof ve.Name&&t.assign((0,ve._)`${e}.items`,n)}function mq(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:f,self:c}=t,{RULES:p}=c;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,ms.schemaHasRulesButRef)(s,p))){i.block(()=>xq(t,"$ref",p.all.$ref.definition));return}f.jtd||TH(t,e),i.block(()=>{for(let g of p.rules)h(g);h(p.post)});function h(g){(0,kw.shouldUseGroup)(s,g)&&(g.type?(i.if((0,_m.checkDataType)(g.type,o,f.strictNumbers)),gq(t,g),e.length===1&&e[0]===g.type&&r&&(i.else(),(0,_m.reportTypeError)(t)),i.endIf()):gq(t,g),l||i.if((0,ve._)`${xe.default.errors} === ${n||0}`))}}function gq(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,yH.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,kw.shouldUseRule)(n,s)&&xq(t,s.keyword,s.definition,e.type)})}function TH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(AH(t,e),t.opts.allowUnionTypes||$H(t,e),NH(t,t.dataTypes))}function AH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Cq(t.dataTypes,r)||Pw(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),FH(t,e)}}function $H(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Pw(t,"use allowUnionTypes to allow union type keyword")}function NH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,kw.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>MH(e,o))&&Pw(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function MH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Cq(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function FH(t,e){let r=[];for(let n of t.dataTypes)Cq(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Pw(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ms.checkStrictMode)(t,e,t.opts.strictTypes)}var Rm=class{constructor(e,r,n){if((0,jf.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,ms.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",Eq(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,jf.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",xe.default.errors))}result(e,r,n){this.failResult((0,ve.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,ve.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,ve._)`${r} !== undefined && (${(0,ve.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?Lf.reportExtraError:Lf.reportError)(this,this.def.error,r)}$dataError(){(0,Lf.reportError)(this,this.def.$dataError||Lf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Lf.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=ve.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ve.nil,r=ve.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,ve.or)((0,ve._)`${i} === undefined`,r)),e!==ve.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ve.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ve.or)(o(),l());function o(){if(n.length){if(!(r instanceof ve.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ve._)`${(0,_m.checkDataTypes)(f,r,s.opts.strictNumbers,_m.DataType.Wrong)}`}return ve.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ve._)`!${f}(${r})`}return ve.nil}}subschema(e,r){let n=(0,Ow.getSubschema)(this.it,e);(0,Ow.extendSubschemaData)(n,this.it,e),(0,Ow.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return CH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ms.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=ms.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,ve.Name)),!0}};co.KeywordCxt=Rm;function xq(t,e,r,n){let i=new Rm(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,jf.funcKeywordCode)(i,r):"macro"in r?(0,jf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,jf.funcKeywordCode)(i,r)}var DH=/^\/(?:[^~]|~0|~1)*$/,LH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Eq(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return xe.default.rootData;if(t[0]==="/"){if(!DH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=xe.default.rootData}else{let c=LH.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+c[1];if(i=c[2],i==="#"){if(p>=e)throw new Error(f("property/index",p));return n[e-p]}if(p>e)throw new Error(f("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let c of l)c&&(s=(0,ve._)`${s}${(0,ve.getProperty)((0,ms.unescapeJsonPointer)(c))}`,o=(0,ve._)`${o} && ${s}`);return o;function f(c,p){return`Cannot access ${c} ${p} levels up, current level is ${e}`}}co.getData=Eq});var Cm=H(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});var Tw=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Aw.default=Tw});var Hf=H(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var $w=Df(),Nw=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,$w.resolveUrl)(e,r,n),this.missingSchema=(0,$w.normalizeId)((0,$w.getFullPath)(e,this.missingRef))}};Mw.default=Nw});var Em=H(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.resolveSchema=Pn.getCompilingSchema=Pn.resolveRef=Pn.compileSchema=Pn.SchemaEnv=void 0;var Xn=Ue(),jH=Cm(),Ia=hs(),ei=Df(),Iq=Ze(),UH=Uf(),xu=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,ei.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Pn.SchemaEnv=xu;function Dw(t){let e=qq.call(this,t);if(e)return e;let r=(0,ei.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Xn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:jH.default,code:(0,Xn._)`require("ajv/dist/runtime/validation_error").default`}));let f=o.scopeName("validate");t.validateName=f;let c={gen:o,allErrors:this.opts.allErrors,data:Ia.default.data,parentData:Ia.default.parentData,parentDataProperty:Ia.default.parentDataProperty,dataNames:[Ia.default.data],dataPathArr:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Xn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,UH.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();p=`${o.scopeRefs(Ia.default.scope)}return ${h}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let v=new Function(`${Ia.default.self}`,`${Ia.default.scope}`,p)(this,this.scope.get());if(this.scope.value(f,{ref:v}),v.errors=null,v.schema=t.schema,v.schemaEnv=t,t.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:f,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:_,items:w}=c;v.evaluated={props:_ instanceof Xn.Name?void 0:_,items:w instanceof Xn.Name?void 0:w,dynamicProps:_ instanceof Xn.Name,dynamicItems:w instanceof Xn.Name},v.source&&(v.source.evaluated=(0,Xn.stringify)(v.evaluated))}return t.validate=v,t}catch(h){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),h}finally{this._compilations.delete(t)}}Pn.compileSchema=Dw;function HH(t,e,r){var n;r=(0,ei.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=WH.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(s=new xu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=BH.call(this,s)}Pn.resolveRef=HH;function BH(t){return(0,ei.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Dw.call(this,t)}function qq(t){for(let e of this._compilations)if(VH(e,t))return e}Pn.getCompilingSchema=qq;function VH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function WH(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||xm.call(this,t,e)}function xm(t,e){let r=this.opts.uriResolver.parse(e),n=(0,ei._getFullPath)(this.opts.uriResolver,r),i=(0,ei.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Fw.call(this,r,t);let s=(0,ei.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=xm.call(this,t,o);return typeof l?.schema!="object"?void 0:Fw.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||Dw.call(this,o),s===(0,ei.normalizeId)(e)){let{schema:l}=o,{schemaId:f}=this.opts,c=l[f];return c&&(i=(0,ei.resolveUrl)(this.opts.uriResolver,i,c)),new xu({schema:l,schemaId:f,root:t,baseId:i})}return Fw.call(this,r,o)}}Pn.resolveSchema=xm;var zH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Fw(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,Iq.unescapeFragment)(l)];if(f===void 0)return;r=f;let c=typeof r=="object"&&r[this.opts.schemaId];!zH.has(l)&&c&&(e=(0,ei.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Iq.schemaHasRulesButRef)(r,this.RULES)){let l=(0,ei.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=xm.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new xu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var Oq=H((OQ,JH)=>{JH.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 Uw=H((kQ,Nq)=>{"use strict";var GH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Pq=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),Lw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Tq=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),YH=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function jw(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 KH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function kq(t){return t.length=0,!0}function QH(t,e,r){if(t.length){let n=jw(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function ZH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=QH;for(let f=0;f<t.length;f++){let c=t[f];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!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(c==="%"){if(!l(i,n,r))break;l=kq}else{i.push(c);continue}}return i.length&&(l===kq?r.zone=i.join(""):o?n.push(i.join("")):n.push(jw(i))),r.address=n.join(""),r}function Aq(t){if(XH(t,":")<2)return{host:t,isIPV6:!1};let e=ZH(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 XH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function eB(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 tB={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},rB=/[@/?#:]/g,nB=/[@/?#]/g;function $q(t,e){let r=e?nB:rB;return r.lastIndex=0,t.replace(r,n=>tB[n])}function iB(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(Lw(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&Tq(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function sB(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(Lw(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&Tq(s)?e+=s:e+="%"+i,r+=2;continue}}YH(t[r])?e+=t[r]:e+=escape(t[r])}return e}function oB(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(Lw(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function aB(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!Pq(r)){let n=Aq(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=$q(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}Nq.exports={nonSimpleDomain:KH,recomposeAuthority:aB,reescapeHostDelimiters:$q,normalizePercentEncoding:iB,normalizePathEncoding:sB,escapePreservingEscapes:oB,removeDotSegments:eB,isIPv4:Pq,isUUID:GH,normalizeIPv6:Aq,stringArrayToHexStripped:jw}});var jq=H((PQ,Lq)=>{"use strict";var{isUUID:lB}=Uw(),uB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,cB=["http","https","ws","wss","urn","urn:uuid"];function fB(t){return cB.indexOf(t)!==-1}function Hw(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 Mq(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Fq(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 dB(t){return t.secure=Hw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function pB(t){if((t.port===(Hw(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 hB(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(uB);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=Bw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function mB(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=Bw(i);s&&(t=s.serialize(t,e));let o=t,l=t.nss;return o.path=`${n||e.nid}:${l}`,e.skipEscape=!0,o}function gB(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!lB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function yB(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Dq={scheme:"http",domainHost:!0,parse:Mq,serialize:Fq},vB={scheme:"https",domainHost:Dq.domainHost,parse:Mq,serialize:Fq},Im={scheme:"ws",domainHost:!0,parse:dB,serialize:pB},bB={scheme:"wss",domainHost:Im.domainHost,parse:Im.parse,serialize:Im.serialize},SB={scheme:"urn",parse:hB,serialize:mB,skipNormalize:!0},wB={scheme:"urn:uuid",parse:gB,serialize:yB,skipNormalize:!0},qm={http:Dq,https:vB,ws:Im,wss:bB,urn:SB,"urn:uuid":wB};Object.setPrototypeOf(qm,null);function Bw(t){return t&&(qm[t]||qm[t.toLowerCase()])||void 0}Lq.exports={wsIsSecure:Hw,SCHEMES:qm,isValidSchemeName:fB,getSchemeHandler:Bw}});var zq=H((TQ,Om)=>{"use strict";var{normalizeIPv6:_B,removeDotSegments:Bf,recomposeAuthority:RB,normalizePercentEncoding:CB,normalizePathEncoding:xB,escapePreservingEscapes:EB,reescapeHostDelimiters:IB,isIPv4:qB,nonSimpleDomain:OB}=Uw(),{SCHEMES:kB,getSchemeHandler:Hq}=jq();function PB(t,e){return typeof t=="string"?t=MB(t,e):typeof t=="object"&&(t=Eu(qa(t,e),e)),t}function TB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Bq(Eu(t,n),Eu(e,n),n,!0);return n.skipEscape=!0,qa(i,n)}function Bq(t,e,r,n){let i={};return n||(t=Eu(qa(t,r),r),e=Eu(qa(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=Bf(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=Bf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Bf(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=Bf(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 AB(t,e,r){let n=Uq(t,r),i=Uq(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function qa(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=Hq(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=CB(r.path):(r.path=EB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=RB(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=Bf(l)),o===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 $B=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function NB(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 Vq(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 o=t.match($B);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let l=NB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(qB(n.host)===!1){let p=_B(n.host);n.host=p.host.toLowerCase(),s=p.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=Hq(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&OB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=IB(unescape(n.host),s))),n.path&&(n.path=xB(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 Eu(t,e){return Vq(t,e).parsed}function MB(t,e){return Wq(t,e).normalized}function Wq(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Vq(t,e);return{normalized:n?t:qa(r,e),malformedAuthorityOrPort:n}}function Uq(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Wq(t,e);return n?void 0:r}if(typeof t=="object")return qa(t,e)}var Vw={SCHEMES:kB,normalize:PB,resolve:TB,resolveComponent:Bq,equal:AB,serialize:qa,parse:Eu};Om.exports=Vw;Om.exports.default=Vw;Om.exports.fastUri=Vw});var Gq=H(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var Jq=zq();Jq.code='require("ajv/dist/runtime/uri").default';Ww.default=Jq});var rO=H(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CodeGen=sr.Name=sr.nil=sr.stringify=sr.str=sr._=sr.KeywordCxt=void 0;var FB=Uf();Object.defineProperty(sr,"KeywordCxt",{enumerable:!0,get:function(){return FB.KeywordCxt}});var Iu=Ue();Object.defineProperty(sr,"_",{enumerable:!0,get:function(){return Iu._}});Object.defineProperty(sr,"str",{enumerable:!0,get:function(){return Iu.str}});Object.defineProperty(sr,"stringify",{enumerable:!0,get:function(){return Iu.stringify}});Object.defineProperty(sr,"nil",{enumerable:!0,get:function(){return Iu.nil}});Object.defineProperty(sr,"Name",{enumerable:!0,get:function(){return Iu.Name}});Object.defineProperty(sr,"CodeGen",{enumerable:!0,get:function(){return Iu.CodeGen}});var DB=Cm(),Xq=Hf(),LB=bw(),Vf=Em(),jB=Ue(),Wf=Df(),km=Ff(),Jw=Ze(),Yq=Oq(),UB=Gq(),eO=(t,e)=>new RegExp(t,e);eO.code="new RegExp";var HB=["removeAdditional","useDefaults","coerceTypes"],BB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),VB={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."},WB={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Kq=200;function zB(t){var e,r,n,i,s,o,l,f,c,p,h,g,v,_,w,E,k,T,N,$,j,G,O,C,A;let D=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,F=B===!0||B===void 0?1:B||0,K=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:eO,ee=(i=t.uriResolver)!==null&&i!==void 0?i:UB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:D)!==null&&o!==void 0?o:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:D)!==null&&f!==void 0?f:!0,strictTypes:(p=(c=t.strictTypes)!==null&&c!==void 0?c:D)!==null&&p!==void 0?p:"log",strictTuples:(g=(h=t.strictTuples)!==null&&h!==void 0?h:D)!==null&&g!==void 0?g:"log",strictRequired:(_=(v=t.strictRequired)!==null&&v!==void 0?v:D)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:F,regExp:K}:{optimize:F,regExp:K},loopRequired:(w=t.loopRequired)!==null&&w!==void 0?w:Kq,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:Kq,meta:(k=t.meta)!==null&&k!==void 0?k:!0,messages:(T=t.messages)!==null&&T!==void 0?T:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(C=t.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:ee}}var zf=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,...zB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new jB.ValueScope({scope:{},prefixes:BB,es5:r,lines:n}),this.logger=ZB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,LB.getRules)(),Qq.call(this,VB,e,"NOT SUPPORTED"),Qq.call(this,WB,e,"DEPRECATED","warn"),this._metaOpts=KB.call(this),e.formats&&GB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&YB.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),JB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Yq;n==="id"&&(i={...Yq},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(p,h){await s.call(this,p.$schema);let g=this._addSchema(p,h);return g.validate||o.call(this,g)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function o(p){try{return this._compileSchemaEnv(p)}catch(h){if(!(h instanceof Xq.default))throw h;return l.call(this,h),await f.call(this,h.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:h}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${h} cannot be resolved`)}async function f(p){let h=await c.call(this,p);this.refs[p]||await s.call(this,h.$schema),this.refs[p]||this.addSchema(h,p,r)}async function c(p){let h=this._loading[p];if(h)return h;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Wf.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=Zq.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Vf.SchemaEnv({schema:{},schemaId:n});if(r=Vf.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=Zq.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,Wf.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(eV.call(this,n,r),!r)return(0,Jw.eachItem)(n,s=>zw.call(this,s)),this;rV.call(this,r);let i={...r,type:(0,km.getJSONTypes)(r.type),schemaType:(0,km.getJSONTypes)(r.schemaType)};return(0,Jw.eachItem)(n,i.type.length===0?s=>zw.call(this,s,i):s=>i.type.forEach(o=>zw.call(this,s,i,o))),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),o=e;for(let l of s)o=o[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:c}=f.definition,p=o[l];c&&p&&(o[l]=tO(p))}}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 o,{schemaId:l}=this.opts;if(typeof e=="object")o=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,Wf.normalizeId)(o||n);let c=Wf.getSchemaRefs.call(this,e,n);return f=new Vf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:c}),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):Vf.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{Vf.compileSchema.call(this,e)}finally{this.opts=r}}};zf.ValidationError=DB.default;zf.MissingRefError=Xq.default;sr.default=zf;function Qq(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 Zq(t){return t=(0,Wf.normalizeId)(t),this.schemas[t]||this.refs[t]}function JB(){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 GB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function YB(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 KB(){let t={...this.opts};for(let e of HB)delete t[e];return t}var QB={log(){},warn(){},error(){}};function ZB(t){if(t===!1)return QB;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 XB=/^[a-z_$][a-z0-9_$:-]*$/i;function eV(t,e){let{RULES:r}=this;if((0,Jw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!XB.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 zw(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,o=i?s.post:s.rules.find(({type:f})=>f===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,km.getJSONTypes)(e.type),schemaType:(0,km.getJSONTypes)(e.schemaType)}};e.before?tV.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function tV(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 rV(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=tO(e)),t.validateSchema=this.compile(e,!0))}var nV={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function tO(t){return{anyOf:[t,nV]}}});var nO=H(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});var iV={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Gw.default=iV});var aO=H(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.callRef=Oa.getValidate=void 0;var sV=Hf(),iO=kn(),zr=Ue(),qu=hs(),sO=Em(),Pm=Ze(),oV={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:f}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return h();let p=sO.resolveRef.call(f,c,i,r);if(p===void 0)throw new sV.default(n.opts.uriResolver,i,r);if(p instanceof sO.SchemaEnv)return g(p);return v(p);function h(){if(s===c)return Tm(t,o,s,s.$async);let _=e.scopeValue("root",{ref:c});return Tm(t,(0,zr._)`${_}.validate`,c,c.$async)}function g(_){let w=oO(t,_);Tm(t,w,_,_.$async)}function v(_){let w=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,zr.stringify)(_)}:{ref:_}),E=e.name("valid"),k=t.subschema({schema:_,dataTypes:[],schemaPath:zr.nil,topSchemaRef:w,errSchemaPath:r},E);t.mergeEvaluated(k),t.ok(E)}}};function oO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,zr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Oa.getValidate=oO;function Tm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:f}=s,c=f.passContext?qu.default.this:zr.nil;n?p():h();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,zr._)`await ${(0,iO.callValidateCode)(t,e,c)}`),v(e),o||i.assign(_,!0)},w=>{i.if((0,zr._)`!(${w} instanceof ${s.ValidationError})`,()=>i.throw(w)),g(w),o||i.assign(_,!1)}),t.ok(_)}function h(){t.result((0,iO.callValidateCode)(t,e,c),()=>v(e),()=>g(e))}function g(_){let w=(0,zr._)`${_}.errors`;i.assign(qu.default.vErrors,(0,zr._)`${qu.default.vErrors} === null ? ${w} : ${qu.default.vErrors}.concat(${w})`),i.assign(qu.default.errors,(0,zr._)`${qu.default.vErrors}.length`)}function v(_){var w;if(!s.opts.unevaluated)return;let E=(w=r?.validate)===null||w===void 0?void 0:w.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=Pm.mergeEvaluated.props(i,E.props,s.props));else{let k=i.var("props",(0,zr._)`${_}.evaluated.props`);s.props=Pm.mergeEvaluated.props(i,k,s.props,zr.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=Pm.mergeEvaluated.items(i,E.items,s.items));else{let k=i.var("items",(0,zr._)`${_}.evaluated.items`);s.items=Pm.mergeEvaluated.items(i,k,s.items,zr.Name)}}}Oa.callRef=Tm;Oa.default=oV});var lO=H(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});var aV=nO(),lV=aO(),uV=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",aV.default,lV.default];Yw.default=uV});var uO=H(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});var Am=Ue(),fo=Am.operators,$m={maximum:{okStr:"<=",ok:fo.LTE,fail:fo.GT},minimum:{okStr:">=",ok:fo.GTE,fail:fo.LT},exclusiveMaximum:{okStr:"<",ok:fo.LT,fail:fo.GTE},exclusiveMinimum:{okStr:">",ok:fo.GT,fail:fo.LTE}},cV={message:({keyword:t,schemaCode:e})=>(0,Am.str)`must be ${$m[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Am._)`{comparison: ${$m[t].okStr}, limit: ${e}}`},fV={keyword:Object.keys($m),type:"number",schemaType:"number",$data:!0,error:cV,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Am._)`${r} ${$m[e].fail} ${n} || isNaN(${r})`)}};Kw.default=fV});var cO=H(Qw=>{"use strict";Object.defineProperty(Qw,"__esModule",{value:!0});var Jf=Ue(),dV={message:({schemaCode:t})=>(0,Jf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Jf._)`{multipleOf: ${t}}`},pV={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:dV,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Jf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Jf._)`${o} !== parseInt(${o})`;t.fail$data((0,Jf._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};Qw.default=pV});var dO=H(Zw=>{"use strict";Object.defineProperty(Zw,"__esModule",{value:!0});function fO(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}Zw.default=fO;fO.code='require("ajv/dist/runtime/ucs2length").default'});var pO=H(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});var ka=Ue(),hV=Ze(),mV=dO(),gV={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,ka.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ka._)`{limit: ${t}}`},yV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:gV,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?ka.operators.GT:ka.operators.LT,o=i.opts.unicode===!1?(0,ka._)`${r}.length`:(0,ka._)`${(0,hV.useFunc)(t.gen,mV.default)}(${r})`;t.fail$data((0,ka._)`${o} ${s} ${n}`)}};Xw.default=yV});var hO=H(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var vV=kn(),bV=Ze(),Ou=Ue(),SV={message:({schemaCode:t})=>(0,Ou.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Ou._)`{pattern: ${t}}`},wV={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:SV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,l=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=o.opts.code,c=f.code==="new RegExp"?(0,Ou._)`new RegExp`:(0,bV.useFunc)(e,f),p=e.let("valid");e.try(()=>e.assign(p,(0,Ou._)`${c}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,Ou._)`!${p}`)}else{let f=(0,vV.usePattern)(t,i);t.fail$data((0,Ou._)`!${f}.test(${r})`)}}};e0.default=wV});var mO=H(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var Gf=Ue(),_V={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Gf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Gf._)`{limit: ${t}}`},RV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:_V,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Gf.operators.GT:Gf.operators.LT;t.fail$data((0,Gf._)`Object.keys(${r}).length ${i} ${n}`)}};t0.default=RV});var gO=H(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var Yf=kn(),Kf=Ue(),CV=Ze(),xV={message:({params:{missingProperty:t}})=>(0,Kf.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Kf._)`{missingProperty: ${t}}`},EV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:xV,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:l}=o;if(!s&&r.length===0)return;let f=r.length>=l.loopRequired;if(o.allErrors?c():p(),l.strictRequired){let v=t.parentSchema.properties,{definedProperties:_}=t.it;for(let w of r)if(v?.[w]===void 0&&!_.has(w)){let E=o.schemaEnv.baseId+o.errSchemaPath,k=`required property "${w}" is not defined at "${E}" (strictRequired)`;(0,CV.checkStrictMode)(o,k,o.opts.strictRequired)}}function c(){if(f||s)t.block$data(Kf.nil,h);else for(let v of r)(0,Yf.checkReportMissingProp)(t,v)}function p(){let v=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>g(v,_)),t.ok(_)}else e.if((0,Yf.checkMissingProp)(t,r,v)),(0,Yf.reportMissingProp)(t,v),e.else()}function h(){e.forOf("prop",n,v=>{t.setParams({missingProperty:v}),e.if((0,Yf.noPropertyInData)(e,i,v,l.ownProperties),()=>t.error())})}function g(v,_){t.setParams({missingProperty:v}),e.forOf(v,n,()=>{e.assign(_,(0,Yf.propertyInData)(e,i,v,l.ownProperties)),e.if((0,Kf.not)(_),()=>{t.error(),e.break()})},Kf.nil)}}};r0.default=EV});var yO=H(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var Qf=Ue(),IV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Qf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Qf._)`{limit: ${t}}`},qV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:IV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Qf.operators.GT:Qf.operators.LT;t.fail$data((0,Qf._)`${r}.length ${i} ${n}`)}};n0.default=qV});var Nm=H(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var vO=Iw();vO.code='require("ajv/dist/runtime/equal").default';i0.default=vO});var bO=H(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var s0=Ff(),or=Ue(),OV=Ze(),kV=Nm(),PV={message:({params:{i:t,j:e}})=>(0,or.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,or._)`{i: ${t}, j: ${e}}`},TV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:PV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let f=e.let("valid"),c=s.items?(0,s0.getSchemaTypes)(s.items):[];t.block$data(f,p,(0,or._)`${o} === false`),t.ok(f);function p(){let _=e.let("i",(0,or._)`${r}.length`),w=e.let("j");t.setParams({i:_,j:w}),e.assign(f,!0),e.if((0,or._)`${_} > 1`,()=>(h()?g:v)(_,w))}function h(){return c.length>0&&!c.some(_=>_==="object"||_==="array")}function g(_,w){let E=e.name("item"),k=(0,s0.checkDataTypes)(c,E,l.opts.strictNumbers,s0.DataType.Wrong),T=e.const("indices",(0,or._)`{}`);e.for((0,or._)`;${_}--;`,()=>{e.let(E,(0,or._)`${r}[${_}]`),e.if(k,(0,or._)`continue`),c.length>1&&e.if((0,or._)`typeof ${E} == "string"`,(0,or._)`${E} += "_"`),e.if((0,or._)`typeof ${T}[${E}] == "number"`,()=>{e.assign(w,(0,or._)`${T}[${E}]`),t.error(),e.assign(f,!1).break()}).code((0,or._)`${T}[${E}] = ${_}`)})}function v(_,w){let E=(0,OV.useFunc)(e,kV.default),k=e.name("outer");e.label(k).for((0,or._)`;${_}--;`,()=>e.for((0,or._)`${w} = ${_}; ${w}--;`,()=>e.if((0,or._)`${E}(${r}[${_}], ${r}[${w}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};o0.default=TV});var SO=H(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});var a0=Ue(),AV=Ze(),$V=Nm(),NV={message:"must be equal to constant",params:({schemaCode:t})=>(0,a0._)`{allowedValue: ${t}}`},MV={keyword:"const",$data:!0,error:NV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,a0._)`!${(0,AV.useFunc)(e,$V.default)}(${r}, ${i})`):t.fail((0,a0._)`${s} !== ${r}`)}};l0.default=MV});var wO=H(u0=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var Zf=Ue(),FV=Ze(),DV=Nm(),LV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Zf._)`{allowedValues: ${t}}`},jV={keyword:"enum",schemaType:"array",$data:!0,error:LV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=o.opts.loopEnum,f,c=()=>f??(f=(0,FV.useFunc)(e,DV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let v=e.const("vSchema",s);p=(0,Zf.or)(...i.map((_,w)=>g(v,w)))}t.pass(p);function h(){e.assign(p,!1),e.forOf("v",s,v=>e.if((0,Zf._)`${c()}(${r}, ${v})`,()=>e.assign(p,!0).break()))}function g(v,_){let w=i[_];return typeof w=="object"&&w!==null?(0,Zf._)`${c()}(${r}, ${v}[${_}])`:(0,Zf._)`${r} === ${w}`}}};u0.default=jV});var _O=H(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var UV=uO(),HV=cO(),BV=pO(),VV=hO(),WV=mO(),zV=gO(),JV=yO(),GV=bO(),YV=SO(),KV=wO(),QV=[UV.default,HV.default,BV.default,VV.default,WV.default,zV.default,JV.default,GV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},YV.default,KV.default];c0.default=QV});var d0=H(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.validateAdditionalItems=void 0;var Pa=Ue(),f0=Ze(),ZV={message:({params:{len:t}})=>(0,Pa.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Pa._)`{limit: ${t}}`},XV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ZV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,f0.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}RO(t,n)}};function RO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,Pa._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Pa._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,f0.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,Pa._)`${l} <= ${e.length}`);r.if((0,Pa.not)(c),()=>f(c)),t.ok(c)}function f(c){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:f0.Type.Num},c),o.allErrors||r.if((0,Pa.not)(c),()=>r.break())})}}Xf.validateAdditionalItems=RO;Xf.default=XV});var p0=H(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.validateTuple=void 0;var CO=Ue(),Mm=Ze(),eW=kn(),tW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return xO(t,"additionalItems",e);r.items=!0,!(0,Mm.alwaysValidSchema)(r,e)&&t.ok((0,eW.validateArray)(t))}};function xO(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:l}=t;p(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Mm.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),c=n.const("len",(0,CO._)`${s}.length`);r.forEach((h,g)=>{(0,Mm.alwaysValidSchema)(l,h)||(n.if((0,CO._)`${c} > ${g}`,()=>t.subschema({keyword:o,schemaProp:g,dataProp:g},f)),t.ok(f))});function p(h){let{opts:g,errSchemaPath:v}=l,_=r.length,w=_===h.minItems&&(_===h.maxItems||h[e]===!1);if(g.strictTuples&&!w){let E=`"${o}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${v}"`;(0,Mm.checkStrictMode)(l,E,g.strictTuples)}}}ed.validateTuple=xO;ed.default=tW});var EO=H(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var rW=p0(),nW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,rW.validateTuple)(t,"items")};h0.default=nW});var qO=H(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var IO=Ue(),iW=Ze(),sW=kn(),oW=d0(),aW={message:({params:{len:t}})=>(0,IO.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,IO._)`{limit: ${t}}`},lW={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:aW,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,iW.alwaysValidSchema)(n,e)&&(i?(0,oW.validateAdditionalItems)(t,i):t.ok((0,sW.validateArray)(t)))}};m0.default=lW});var OO=H(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var Tn=Ue(),Fm=Ze(),uW={message:({params:{min:t,max:e}})=>e===void 0?(0,Tn.str)`must contain at least ${t} valid item(s)`:(0,Tn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Tn._)`{minContains: ${t}}`:(0,Tn._)`{minContains: ${t}, maxContains: ${e}}`},cW={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:uW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:f,maxContains:c}=n;s.opts.next?(o=f===void 0?1:f,l=c):o=1;let p=e.const("len",(0,Tn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,Fm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,Fm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Fm.alwaysValidSchema)(s,r)){let w=(0,Tn._)`${p} >= ${o}`;l!==void 0&&(w=(0,Tn._)`${w} && ${p} <= ${l}`),t.pass(w);return}s.items=!0;let h=e.name("valid");l===void 0&&o===1?v(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),l!==void 0&&e.if((0,Tn._)`${i}.length > 0`,g)):(e.let(h,!1),g()),t.result(h,()=>t.reset());function g(){let w=e.name("_valid"),E=e.let("count",0);v(w,()=>e.if(w,()=>_(E)))}function v(w,E){e.forRange("i",0,p,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:Fm.Type.Num,compositeRule:!0},w),E()})}function _(w){e.code((0,Tn._)`${w}++`),l===void 0?e.if((0,Tn._)`${w} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,Tn._)`${w} > ${l}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,Tn._)`${w} >= ${o}`,()=>e.assign(h,!0)))}}};g0.default=cW});var TO=H($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.validateSchemaDeps=$i.validatePropertyDeps=$i.error=void 0;var y0=Ue(),fW=Ze(),td=kn();$i.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,y0.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,y0._)`{property: ${t},
|
|
27
|
+
|| ${o} === "boolean" || ${i} === null`).assign(l,(0,ke._)`[${i}]`)}}}function AU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ke._)`${e} !== undefined`,()=>t.assign((0,ke._)`${e}[${r}]`,n))}function ww(t,e,r,n=_u.Correct){let i=n===_u.Correct?ke.operators.EQ:ke.operators.NEQ,s;switch(t){case"null":return(0,ke._)`${e} ${i} null`;case"array":s=(0,ke._)`Array.isArray(${e})`;break;case"object":s=(0,ke._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,ke._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,ke._)`typeof ${e} ${i} ${t}`}return n===_u.Correct?s:(0,ke.not)(s);function o(l=ke.nil){return(0,ke.and)((0,ke._)`typeof ${e} == "number"`,l,r?(0,ke._)`isFinite(${e})`:ke.nil)}}gr.checkDataType=ww;function _w(t,e,r,n){if(t.length===1)return ww(t[0],e,r,n);let i,s=(0,YI.toHash)(t);if(s.array&&s.object){let o=(0,ke._)`typeof ${e} != "object"`;i=s.null?o:(0,ke._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=ke.nil;s.number&&delete s.integer;for(let o in s)i=(0,ke.and)(i,ww(o,e,r,n));return i}gr.checkDataTypes=_w;var $U={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ke._)`{type: ${t}}`:(0,ke._)`{type: ${e}}`};function Rw(t){let e=NU(t);(0,OU.reportError)(e,$U)}gr.reportTypeError=Rw;function NU(t){let{gen:e,data:r,schema:n}=t,i=(0,YI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var XI=H(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.assignDefaults=void 0;var Ru=Ue(),MU=Ze();function FU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)ZI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>ZI(t,s,i.default))}Sm.assignDefaults=FU;function ZI(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,Ru._)`${s}${(0,Ru.getProperty)(e)}`;if(i){(0,MU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,Ru._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,Ru._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,Ru._)`${l} = ${(0,Ru.stringify)(r)}`)}});var kn=H(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.validateUnion=bt.validateArray=bt.usePattern=bt.callValidateCode=bt.schemaProperties=bt.allSchemaProperties=bt.noPropertyInData=bt.propertyInData=bt.isOwnProperty=bt.hasPropFunc=bt.reportMissingProp=bt.checkMissingProp=bt.checkReportMissingProp=void 0;var Et=Ue(),Cw=Ze(),ao=hs(),DU=Ze();function LU(t,e){let{gen:r,data:n,it:i}=t;r.if(Ew(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Et._)`${e}`},!0),t.error()})}bt.checkReportMissingProp=LU;function jU({gen:t,data:e,it:{opts:r}},n,i){return(0,Et.or)(...n.map(s=>(0,Et.and)(Ew(t,e,s,r.ownProperties),(0,Et._)`${i} = ${s}`)))}bt.checkMissingProp=jU;function UU(t,e){t.setParams({missingProperty:e},!0),t.error()}bt.reportMissingProp=UU;function eO(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Et._)`Object.prototype.hasOwnProperty`})}bt.hasPropFunc=eO;function xw(t,e,r){return(0,Et._)`${eO(t)}.call(${e}, ${r})`}bt.isOwnProperty=xw;function HU(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} !== undefined`;return n?(0,Et._)`${i} && ${xw(t,e,r)}`:i}bt.propertyInData=HU;function Ew(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} === undefined`;return n?(0,Et.or)(i,(0,Et.not)(xw(t,e,r))):i}bt.noPropertyInData=Ew;function tO(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}bt.allSchemaProperties=tO;function BU(t,e){return tO(e).filter(r=>!(0,Cw.alwaysValidSchema)(t,e[r]))}bt.schemaProperties=BU;function VU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,f,c){let p=c?(0,Et._)`${t}, ${e}, ${n}${i}`:e,h=[[ao.default.instancePath,(0,Et.strConcat)(ao.default.instancePath,s)],[ao.default.parentData,o.parentData],[ao.default.parentDataProperty,o.parentDataProperty],[ao.default.rootData,ao.default.rootData]];o.opts.dynamicRef&&h.push([ao.default.dynamicAnchors,ao.default.dynamicAnchors]);let g=(0,Et._)`${p}, ${r.object(...h)}`;return f!==Et.nil?(0,Et._)`${l}.call(${f}, ${g})`:(0,Et._)`${l}(${g})`}bt.callValidateCode=VU;var WU=(0,Et._)`new RegExp`;function zU({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,Et._)`${i.code==="new RegExp"?WU:(0,DU.useFunc)(t,i)}(${r}, ${n})`})}bt.usePattern=zU;function JU(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 o(()=>e.assign(l,!1)),l}return e.var(s,!0),o(()=>e.break()),s;function o(l){let f=e.const("len",(0,Et._)`${r}.length`);e.forRange("i",0,f,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:Cw.Type.Num},s),e.if((0,Et.not)(s),l)})}}bt.validateArray=JU;function GU(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,Cw.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,c)=>{let p=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},l);e.assign(o,(0,Et._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Et.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}bt.validateUnion=GU});var iO=H(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.validateKeywordUsage=Ti.validSchemaType=Ti.funcKeywordCode=Ti.macroKeywordCode=void 0;var Pr=Ue(),Ea=hs(),YU=kn(),KU=Mf();function QU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),f=nO(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let c=r.name("valid");t.subschema({schema:l,schemaPath:Pr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}Ti.macroKeywordCode=QU;function ZU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:f}=t;eH(f,e);let c=!l&&e.compile?e.compile.call(f.self,s,o,f):e.validate,p=nO(n,i,c),h=n.let("valid");t.block$data(h,g),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function g(){if(e.errors===!1)w(),e.modifying&&rO(t),E(()=>t.error());else{let k=e.async?v():_();e.modifying&&rO(t),E(()=>XU(t,k))}}function v(){let k=n.let("ruleErrs",null);return n.try(()=>w((0,Pr._)`await `),T=>n.assign(h,!1).if((0,Pr._)`${T} instanceof ${f.ValidationError}`,()=>n.assign(k,(0,Pr._)`${T}.errors`),()=>n.throw(T))),k}function _(){let k=(0,Pr._)`${p}.errors`;return n.assign(k,null),w(Pr.nil),k}function w(k=e.async?(0,Pr._)`await `:Pr.nil){let T=f.opts.passContext?Ea.default.this:Ea.default.self,N=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Pr._)`${k}${(0,YU.callValidateCode)(t,p,T,N)}`,e.modifying)}function E(k){var T;n.if((0,Pr.not)((T=e.valid)!==null&&T!==void 0?T:h),k)}}Ti.funcKeywordCode=ZU;function rO(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Pr._)`${n.parentData}[${n.parentDataProperty}]`))}function XU(t,e){let{gen:r}=t;r.if((0,Pr._)`Array.isArray(${e})`,()=>{r.assign(Ea.default.vErrors,(0,Pr._)`${Ea.default.vErrors} === null ? ${e} : ${Ea.default.vErrors}.concat(${e})`).assign(Ea.default.errors,(0,Pr._)`${Ea.default.vErrors}.length`),(0,KU.extendErrors)(t)},()=>t.error())}function eH({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function nO(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,Pr.stringify)(r)})}function tH(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")}Ti.validSchemaType=tH;function rH({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 o=i.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${o.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)}}Ti.validateKeywordUsage=rH});var oO=H(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.extendSubschemaMode=lo.extendSubschemaData=lo.getSubschema=void 0;var Ai=Ue(),sO=Ze();function nH(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){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,Ai._)`${t.schemaPath}${(0,Ai.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Ai._)`${t.schemaPath}${(0,Ai.getProperty)(e)}${(0,Ai.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,sO.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}lo.getSubschema=nH;function iH(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:c,dataPathArr:p,opts:h}=e,g=l.let("data",(0,Ai._)`${e.data}${(0,Ai.getProperty)(r)}`,!0);f(g),t.errorPath=(0,Ai.str)`${c}${(0,sO.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Ai._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let c=i instanceof Ai.Name?i:l.let("data",i,!0);f(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function f(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}lo.extendSubschemaData=iH;function sH(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}lo.extendSubschemaMode=sH});var Iw=H((_Q,aO)=>{"use strict";aO.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 o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var uO=H((RQ,lO)=>{"use strict";var uo=lO.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(){};wm(e,n,i,t,"",t)};uo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};uo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};uo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};uo.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 wm(t,e,r,n,i,s,o,l,f,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,f,c);for(var p in n){var h=n[p];if(Array.isArray(h)){if(p in uo.arrayKeywords)for(var g=0;g<h.length;g++)wm(t,e,r,h[g],i+"/"+p+"/"+g,s,i,p,n,g)}else if(p in uo.propsKeywords){if(h&&typeof h=="object")for(var v in h)wm(t,e,r,h[v],i+"/"+p+"/"+oH(v),s,i,p,n,v)}else(p in uo.keywords||t.allKeys&&!(p in uo.skipKeywords))&&wm(t,e,r,h,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,f,c)}}function oH(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Df=H(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.getSchemaRefs=Wr.resolveUrl=Wr.normalizeId=Wr._getFullPath=Wr.getFullPath=Wr.inlineRef=void 0;var aH=Ze(),lH=Iw(),uH=uO(),cH=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fH(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ow(t):e?cO(t)<=e:!1}Wr.inlineRef=fH;var dH=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ow(t){for(let e in t){if(dH.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Ow)||typeof r=="object"&&Ow(r))return!0}return!1}function cO(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!cH.has(r)&&(typeof t[r]=="object"&&(0,aH.eachItem)(t[r],n=>e+=cO(n)),e===1/0))return 1/0}return e}function fO(t,e="",r){r!==!1&&(e=Cu(e));let n=t.parse(e);return dO(t,n)}Wr.getFullPath=fO;function dO(t,e){return t.serialize(e).split("#")[0]+"#"}Wr._getFullPath=dO;var pH=/#\/?$/;function Cu(t){return t?t.replace(pH,""):""}Wr.normalizeId=Cu;function hH(t,e,r){return r=Cu(r),t.resolve(e,r)}Wr.resolveUrl=hH;var mH=/^[a-z_][-a-z0-9._]*$/i;function gH(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Cu(t[r]||e),s={"":i},o=fO(n,i,!1),l={},f=new Set;return uH(t,{allKeys:!0},(h,g,v,_)=>{if(_===void 0)return;let w=o+g,E=s[_];typeof h[r]=="string"&&(E=k.call(this,h[r])),T.call(this,h.$anchor),T.call(this,h.$dynamicAnchor),s[g]=E;function k(N){let $=this.opts.uriResolver.resolve;if(N=Cu(E?$(E,N):N),f.has(N))throw p(N);f.add(N);let j=this.refs[N];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?c(h,j.schema,N):N!==Cu(w)&&(N[0]==="#"?(c(h,l[N],N),l[N]=h):this.refs[N]=w),N}function T(N){if(typeof N=="string"){if(!mH.test(N))throw new Error(`invalid anchor "${N}"`);k.call(this,`#${N}`)}}}),l;function c(h,g,v){if(g!==void 0&&!lH(h,g))throw p(v)}function p(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Wr.getSchemaRefs=gH});var Uf=H(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.getData=co.KeywordCxt=co.validateFunctionCode=void 0;var yO=zI(),pO=Ff(),kw=Sw(),_m=Ff(),yH=XI(),jf=iO(),qw=oO(),ve=Ue(),xe=hs(),vH=Df(),ms=Ze(),Lf=Mf();function bH(t){if(SO(t)&&(wO(t),bO(t))){_H(t);return}vO(t,()=>(0,yO.topBoolOrEmptySchema)(t))}co.validateFunctionCode=bH;function vO({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ve._)`${xe.default.data}, ${xe.default.valCxt}`,n.$async,()=>{t.code((0,ve._)`"use strict"; ${hO(r,i)}`),wH(t,i),t.code(s)}):t.func(e,(0,ve._)`${xe.default.data}, ${SH(i)}`,n.$async,()=>t.code(hO(r,i)).code(s))}function SH(t){return(0,ve._)`{${xe.default.instancePath}="", ${xe.default.parentData}, ${xe.default.parentDataProperty}, ${xe.default.rootData}=${xe.default.data}${t.dynamicRef?(0,ve._)`, ${xe.default.dynamicAnchors}={}`:ve.nil}}={}`}function wH(t,e){t.if(xe.default.valCxt,()=>{t.var(xe.default.instancePath,(0,ve._)`${xe.default.valCxt}.${xe.default.instancePath}`),t.var(xe.default.parentData,(0,ve._)`${xe.default.valCxt}.${xe.default.parentData}`),t.var(xe.default.parentDataProperty,(0,ve._)`${xe.default.valCxt}.${xe.default.parentDataProperty}`),t.var(xe.default.rootData,(0,ve._)`${xe.default.valCxt}.${xe.default.rootData}`),e.dynamicRef&&t.var(xe.default.dynamicAnchors,(0,ve._)`${xe.default.valCxt}.${xe.default.dynamicAnchors}`)},()=>{t.var(xe.default.instancePath,(0,ve._)`""`),t.var(xe.default.parentData,(0,ve._)`undefined`),t.var(xe.default.parentDataProperty,(0,ve._)`undefined`),t.var(xe.default.rootData,xe.default.data),e.dynamicRef&&t.var(xe.default.dynamicAnchors,(0,ve._)`{}`)})}function _H(t){let{schema:e,opts:r,gen:n}=t;vO(t,()=>{r.$comment&&e.$comment&&RO(t),IH(t),n.let(xe.default.vErrors,null),n.let(xe.default.errors,0),r.unevaluated&&RH(t),_O(t),kH(t)})}function RH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ve._)`${r}.evaluated`),e.if((0,ve._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ve._)`${t.evaluated}.props`,(0,ve._)`undefined`)),e.if((0,ve._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ve._)`${t.evaluated}.items`,(0,ve._)`undefined`))}function hO(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ve._)`/*# sourceURL=${r} */`:ve.nil}function CH(t,e){if(SO(t)&&(wO(t),bO(t))){xH(t,e);return}(0,yO.boolOrEmptySchema)(t,e)}function bO({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 SO(t){return typeof t.schema!="boolean"}function xH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&RO(t),OH(t),qH(t);let s=n.const("_errs",xe.default.errors);_O(t,s),n.var(e,(0,ve._)`${s} === ${xe.default.errors}`)}function wO(t){(0,ms.checkUnknownRules)(t),EH(t)}function _O(t,e){if(t.opts.jtd)return mO(t,[],!1,e);let r=(0,pO.getSchemaTypes)(t.schema),n=(0,pO.coerceAndCheckDataType)(t,r);mO(t,r,!n,e)}function EH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,ms.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function IH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ms.checkStrictMode)(t,"default is ignored in the schema root")}function OH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,vH.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function qH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function RO({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ve._)`${xe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,ve.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ve._)`${xe.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function kH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ve._)`${xe.default.errors} === 0`,()=>e.return(xe.default.data),()=>e.throw((0,ve._)`new ${i}(${xe.default.vErrors})`)):(e.assign((0,ve._)`${n}.errors`,xe.default.vErrors),s.unevaluated&&PH(t),e.return((0,ve._)`${xe.default.errors} === 0`))}function PH({gen:t,evaluated:e,props:r,items:n}){r instanceof ve.Name&&t.assign((0,ve._)`${e}.props`,r),n instanceof ve.Name&&t.assign((0,ve._)`${e}.items`,n)}function mO(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:f,self:c}=t,{RULES:p}=c;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,ms.schemaHasRulesButRef)(s,p))){i.block(()=>xO(t,"$ref",p.all.$ref.definition));return}f.jtd||TH(t,e),i.block(()=>{for(let g of p.rules)h(g);h(p.post)});function h(g){(0,kw.shouldUseGroup)(s,g)&&(g.type?(i.if((0,_m.checkDataType)(g.type,o,f.strictNumbers)),gO(t,g),e.length===1&&e[0]===g.type&&r&&(i.else(),(0,_m.reportTypeError)(t)),i.endIf()):gO(t,g),l||i.if((0,ve._)`${xe.default.errors} === ${n||0}`))}}function gO(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,yH.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,kw.shouldUseRule)(n,s)&&xO(t,s.keyword,s.definition,e.type)})}function TH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(AH(t,e),t.opts.allowUnionTypes||$H(t,e),NH(t,t.dataTypes))}function AH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{CO(t.dataTypes,r)||Pw(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),FH(t,e)}}function $H(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Pw(t,"use allowUnionTypes to allow union type keyword")}function NH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,kw.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>MH(e,o))&&Pw(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function MH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function CO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function FH(t,e){let r=[];for(let n of t.dataTypes)CO(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Pw(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ms.checkStrictMode)(t,e,t.opts.strictTypes)}var Rm=class{constructor(e,r,n){if((0,jf.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,ms.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",EO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,jf.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",xe.default.errors))}result(e,r,n){this.failResult((0,ve.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,ve.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,ve._)`${r} !== undefined && (${(0,ve.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?Lf.reportExtraError:Lf.reportError)(this,this.def.error,r)}$dataError(){(0,Lf.reportError)(this,this.def.$dataError||Lf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Lf.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=ve.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ve.nil,r=ve.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,ve.or)((0,ve._)`${i} === undefined`,r)),e!==ve.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ve.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ve.or)(o(),l());function o(){if(n.length){if(!(r instanceof ve.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ve._)`${(0,_m.checkDataTypes)(f,r,s.opts.strictNumbers,_m.DataType.Wrong)}`}return ve.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ve._)`!${f}(${r})`}return ve.nil}}subschema(e,r){let n=(0,qw.getSubschema)(this.it,e);(0,qw.extendSubschemaData)(n,this.it,e),(0,qw.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return CH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=ms.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=ms.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,ve.Name)),!0}};co.KeywordCxt=Rm;function xO(t,e,r,n){let i=new Rm(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,jf.funcKeywordCode)(i,r):"macro"in r?(0,jf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,jf.funcKeywordCode)(i,r)}var DH=/^\/(?:[^~]|~0|~1)*$/,LH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function EO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return xe.default.rootData;if(t[0]==="/"){if(!DH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=xe.default.rootData}else{let c=LH.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+c[1];if(i=c[2],i==="#"){if(p>=e)throw new Error(f("property/index",p));return n[e-p]}if(p>e)throw new Error(f("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let c of l)c&&(s=(0,ve._)`${s}${(0,ve.getProperty)((0,ms.unescapeJsonPointer)(c))}`,o=(0,ve._)`${o} && ${s}`);return o;function f(c,p){return`Cannot access ${c} ${p} levels up, current level is ${e}`}}co.getData=EO});var Cm=H(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});var Tw=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Aw.default=Tw});var Hf=H(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var $w=Df(),Nw=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,$w.resolveUrl)(e,r,n),this.missingSchema=(0,$w.normalizeId)((0,$w.getFullPath)(e,this.missingRef))}};Mw.default=Nw});var Em=H(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.resolveSchema=Pn.getCompilingSchema=Pn.resolveRef=Pn.compileSchema=Pn.SchemaEnv=void 0;var Xn=Ue(),jH=Cm(),Ia=hs(),ei=Df(),IO=Ze(),UH=Uf(),xu=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,ei.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Pn.SchemaEnv=xu;function Dw(t){let e=OO.call(this,t);if(e)return e;let r=(0,ei.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Xn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:jH.default,code:(0,Xn._)`require("ajv/dist/runtime/validation_error").default`}));let f=o.scopeName("validate");t.validateName=f;let c={gen:o,allErrors:this.opts.allErrors,data:Ia.default.data,parentData:Ia.default.parentData,parentDataProperty:Ia.default.parentDataProperty,dataNames:[Ia.default.data],dataPathArr:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Xn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,UH.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();p=`${o.scopeRefs(Ia.default.scope)}return ${h}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let v=new Function(`${Ia.default.self}`,`${Ia.default.scope}`,p)(this,this.scope.get());if(this.scope.value(f,{ref:v}),v.errors=null,v.schema=t.schema,v.schemaEnv=t,t.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:f,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:_,items:w}=c;v.evaluated={props:_ instanceof Xn.Name?void 0:_,items:w instanceof Xn.Name?void 0:w,dynamicProps:_ instanceof Xn.Name,dynamicItems:w instanceof Xn.Name},v.source&&(v.source.evaluated=(0,Xn.stringify)(v.evaluated))}return t.validate=v,t}catch(h){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),h}finally{this._compilations.delete(t)}}Pn.compileSchema=Dw;function HH(t,e,r){var n;r=(0,ei.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=WH.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(s=new xu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=BH.call(this,s)}Pn.resolveRef=HH;function BH(t){return(0,ei.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Dw.call(this,t)}function OO(t){for(let e of this._compilations)if(VH(e,t))return e}Pn.getCompilingSchema=OO;function VH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function WH(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||xm.call(this,t,e)}function xm(t,e){let r=this.opts.uriResolver.parse(e),n=(0,ei._getFullPath)(this.opts.uriResolver,r),i=(0,ei.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Fw.call(this,r,t);let s=(0,ei.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=xm.call(this,t,o);return typeof l?.schema!="object"?void 0:Fw.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||Dw.call(this,o),s===(0,ei.normalizeId)(e)){let{schema:l}=o,{schemaId:f}=this.opts,c=l[f];return c&&(i=(0,ei.resolveUrl)(this.opts.uriResolver,i,c)),new xu({schema:l,schemaId:f,root:t,baseId:i})}return Fw.call(this,r,o)}}Pn.resolveSchema=xm;var zH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Fw(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,IO.unescapeFragment)(l)];if(f===void 0)return;r=f;let c=typeof r=="object"&&r[this.opts.schemaId];!zH.has(l)&&c&&(e=(0,ei.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,IO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,ei.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=xm.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new xu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var qO=H((qQ,JH)=>{JH.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 Uw=H((kQ,NO)=>{"use strict";var GH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),PO=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),Lw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),TO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),YH=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function jw(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 KH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function kO(t){return t.length=0,!0}function QH(t,e,r){if(t.length){let n=jw(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function ZH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=QH;for(let f=0;f<t.length;f++){let c=t[f];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!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(c==="%"){if(!l(i,n,r))break;l=kO}else{i.push(c);continue}}return i.length&&(l===kO?r.zone=i.join(""):o?n.push(i.join("")):n.push(jw(i))),r.address=n.join(""),r}function AO(t){if(XH(t,":")<2)return{host:t,isIPV6:!1};let e=ZH(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 XH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function eB(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 tB={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},rB=/[@/?#:]/g,nB=/[@/?#]/g;function $O(t,e){let r=e?nB:rB;return r.lastIndex=0,t.replace(r,n=>tB[n])}function iB(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(Lw(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&TO(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function sB(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(Lw(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&TO(s)?e+=s:e+="%"+i,r+=2;continue}}YH(t[r])?e+=t[r]:e+=escape(t[r])}return e}function oB(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(Lw(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function aB(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!PO(r)){let n=AO(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=$O(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}NO.exports={nonSimpleDomain:KH,recomposeAuthority:aB,reescapeHostDelimiters:$O,normalizePercentEncoding:iB,normalizePathEncoding:sB,escapePreservingEscapes:oB,removeDotSegments:eB,isIPv4:PO,isUUID:GH,normalizeIPv6:AO,stringArrayToHexStripped:jw}});var jO=H((PQ,LO)=>{"use strict";var{isUUID:lB}=Uw(),uB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,cB=["http","https","ws","wss","urn","urn:uuid"];function fB(t){return cB.indexOf(t)!==-1}function Hw(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 MO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function FO(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function dB(t){return t.secure=Hw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function pB(t){if((t.port===(Hw(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 hB(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(uB);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=Bw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function mB(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=Bw(i);s&&(t=s.serialize(t,e));let o=t,l=t.nss;return o.path=`${n||e.nid}:${l}`,e.skipEscape=!0,o}function gB(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!lB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function yB(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var DO={scheme:"http",domainHost:!0,parse:MO,serialize:FO},vB={scheme:"https",domainHost:DO.domainHost,parse:MO,serialize:FO},Im={scheme:"ws",domainHost:!0,parse:dB,serialize:pB},bB={scheme:"wss",domainHost:Im.domainHost,parse:Im.parse,serialize:Im.serialize},SB={scheme:"urn",parse:hB,serialize:mB,skipNormalize:!0},wB={scheme:"urn:uuid",parse:gB,serialize:yB,skipNormalize:!0},Om={http:DO,https:vB,ws:Im,wss:bB,urn:SB,"urn:uuid":wB};Object.setPrototypeOf(Om,null);function Bw(t){return t&&(Om[t]||Om[t.toLowerCase()])||void 0}LO.exports={wsIsSecure:Hw,SCHEMES:Om,isValidSchemeName:fB,getSchemeHandler:Bw}});var zO=H((TQ,qm)=>{"use strict";var{normalizeIPv6:_B,removeDotSegments:Bf,recomposeAuthority:RB,normalizePercentEncoding:CB,normalizePathEncoding:xB,escapePreservingEscapes:EB,reescapeHostDelimiters:IB,isIPv4:OB,nonSimpleDomain:qB}=Uw(),{SCHEMES:kB,getSchemeHandler:HO}=jO();function PB(t,e){return typeof t=="string"?t=MB(t,e):typeof t=="object"&&(t=Eu(Oa(t,e),e)),t}function TB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=BO(Eu(t,n),Eu(e,n),n,!0);return n.skipEscape=!0,Oa(i,n)}function BO(t,e,r,n){let i={};return n||(t=Eu(Oa(t,r),r),e=Eu(Oa(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=Bf(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=Bf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Bf(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=Bf(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 AB(t,e,r){let n=UO(t,r),i=UO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Oa(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=HO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=CB(r.path):(r.path=EB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=RB(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=Bf(l)),o===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 $B=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function NB(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 VO(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 o=t.match($B);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let l=NB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(OB(n.host)===!1){let p=_B(n.host);n.host=p.host.toLowerCase(),s=p.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=HO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&qB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=IB(unescape(n.host),s))),n.path&&(n.path=xB(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 Eu(t,e){return VO(t,e).parsed}function MB(t,e){return WO(t,e).normalized}function WO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=VO(t,e);return{normalized:n?t:Oa(r,e),malformedAuthorityOrPort:n}}function UO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=WO(t,e);return n?void 0:r}if(typeof t=="object")return Oa(t,e)}var Vw={SCHEMES:kB,normalize:PB,resolve:TB,resolveComponent:BO,equal:AB,serialize:Oa,parse:Eu};qm.exports=Vw;qm.exports.default=Vw;qm.exports.fastUri=Vw});var GO=H(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var JO=zO();JO.code='require("ajv/dist/runtime/uri").default';Ww.default=JO});var rq=H(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CodeGen=sr.Name=sr.nil=sr.stringify=sr.str=sr._=sr.KeywordCxt=void 0;var FB=Uf();Object.defineProperty(sr,"KeywordCxt",{enumerable:!0,get:function(){return FB.KeywordCxt}});var Iu=Ue();Object.defineProperty(sr,"_",{enumerable:!0,get:function(){return Iu._}});Object.defineProperty(sr,"str",{enumerable:!0,get:function(){return Iu.str}});Object.defineProperty(sr,"stringify",{enumerable:!0,get:function(){return Iu.stringify}});Object.defineProperty(sr,"nil",{enumerable:!0,get:function(){return Iu.nil}});Object.defineProperty(sr,"Name",{enumerable:!0,get:function(){return Iu.Name}});Object.defineProperty(sr,"CodeGen",{enumerable:!0,get:function(){return Iu.CodeGen}});var DB=Cm(),XO=Hf(),LB=bw(),Vf=Em(),jB=Ue(),Wf=Df(),km=Ff(),Jw=Ze(),YO=qO(),UB=GO(),eq=(t,e)=>new RegExp(t,e);eq.code="new RegExp";var HB=["removeAdditional","useDefaults","coerceTypes"],BB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),VB={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."},WB={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},KO=200;function zB(t){var e,r,n,i,s,o,l,f,c,p,h,g,v,_,w,E,k,T,N,$,j,G,q,C,A;let D=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,F=B===!0||B===void 0?1:B||0,K=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:eq,ee=(i=t.uriResolver)!==null&&i!==void 0?i:UB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:D)!==null&&o!==void 0?o:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:D)!==null&&f!==void 0?f:!0,strictTypes:(p=(c=t.strictTypes)!==null&&c!==void 0?c:D)!==null&&p!==void 0?p:"log",strictTuples:(g=(h=t.strictTuples)!==null&&h!==void 0?h:D)!==null&&g!==void 0?g:"log",strictRequired:(_=(v=t.strictRequired)!==null&&v!==void 0?v:D)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:F,regExp:K}:{optimize:F,regExp:K},loopRequired:(w=t.loopRequired)!==null&&w!==void 0?w:KO,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:KO,meta:(k=t.meta)!==null&&k!==void 0?k:!0,messages:(T=t.messages)!==null&&T!==void 0?T:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(q=t.validateFormats)!==null&&q!==void 0?q:!0,unicodeRegExp:(C=t.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:ee}}var zf=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,...zB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new jB.ValueScope({scope:{},prefixes:BB,es5:r,lines:n}),this.logger=ZB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,LB.getRules)(),QO.call(this,VB,e,"NOT SUPPORTED"),QO.call(this,WB,e,"DEPRECATED","warn"),this._metaOpts=KB.call(this),e.formats&&GB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&YB.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),JB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=YO;n==="id"&&(i={...YO},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(p,h){await s.call(this,p.$schema);let g=this._addSchema(p,h);return g.validate||o.call(this,g)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function o(p){try{return this._compileSchemaEnv(p)}catch(h){if(!(h instanceof XO.default))throw h;return l.call(this,h),await f.call(this,h.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:h}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${h} cannot be resolved`)}async function f(p){let h=await c.call(this,p);this.refs[p]||await s.call(this,h.$schema),this.refs[p]||this.addSchema(h,p,r)}async function c(p){let h=this._loading[p];if(h)return h;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Wf.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=ZO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Vf.SchemaEnv({schema:{},schemaId:n});if(r=Vf.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=ZO.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,Wf.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(eV.call(this,n,r),!r)return(0,Jw.eachItem)(n,s=>zw.call(this,s)),this;rV.call(this,r);let i={...r,type:(0,km.getJSONTypes)(r.type),schemaType:(0,km.getJSONTypes)(r.schemaType)};return(0,Jw.eachItem)(n,i.type.length===0?s=>zw.call(this,s,i):s=>i.type.forEach(o=>zw.call(this,s,i,o))),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),o=e;for(let l of s)o=o[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:c}=f.definition,p=o[l];c&&p&&(o[l]=tq(p))}}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 o,{schemaId:l}=this.opts;if(typeof e=="object")o=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,Wf.normalizeId)(o||n);let c=Wf.getSchemaRefs.call(this,e,n);return f=new Vf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:c}),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):Vf.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{Vf.compileSchema.call(this,e)}finally{this.opts=r}}};zf.ValidationError=DB.default;zf.MissingRefError=XO.default;sr.default=zf;function QO(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 ZO(t){return t=(0,Wf.normalizeId)(t),this.schemas[t]||this.refs[t]}function JB(){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 GB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function YB(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 KB(){let t={...this.opts};for(let e of HB)delete t[e];return t}var QB={log(){},warn(){},error(){}};function ZB(t){if(t===!1)return QB;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 XB=/^[a-z_$][a-z0-9_$:-]*$/i;function eV(t,e){let{RULES:r}=this;if((0,Jw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!XB.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 zw(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,o=i?s.post:s.rules.find(({type:f})=>f===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,km.getJSONTypes)(e.type),schemaType:(0,km.getJSONTypes)(e.schemaType)}};e.before?tV.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function tV(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 rV(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=tq(e)),t.validateSchema=this.compile(e,!0))}var nV={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function tq(t){return{anyOf:[t,nV]}}});var nq=H(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});var iV={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Gw.default=iV});var aq=H(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.callRef=qa.getValidate=void 0;var sV=Hf(),iq=kn(),zr=Ue(),Ou=hs(),sq=Em(),Pm=Ze(),oV={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:f}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return h();let p=sq.resolveRef.call(f,c,i,r);if(p===void 0)throw new sV.default(n.opts.uriResolver,i,r);if(p instanceof sq.SchemaEnv)return g(p);return v(p);function h(){if(s===c)return Tm(t,o,s,s.$async);let _=e.scopeValue("root",{ref:c});return Tm(t,(0,zr._)`${_}.validate`,c,c.$async)}function g(_){let w=oq(t,_);Tm(t,w,_,_.$async)}function v(_){let w=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,zr.stringify)(_)}:{ref:_}),E=e.name("valid"),k=t.subschema({schema:_,dataTypes:[],schemaPath:zr.nil,topSchemaRef:w,errSchemaPath:r},E);t.mergeEvaluated(k),t.ok(E)}}};function oq(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,zr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}qa.getValidate=oq;function Tm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:f}=s,c=f.passContext?Ou.default.this:zr.nil;n?p():h();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,zr._)`await ${(0,iq.callValidateCode)(t,e,c)}`),v(e),o||i.assign(_,!0)},w=>{i.if((0,zr._)`!(${w} instanceof ${s.ValidationError})`,()=>i.throw(w)),g(w),o||i.assign(_,!1)}),t.ok(_)}function h(){t.result((0,iq.callValidateCode)(t,e,c),()=>v(e),()=>g(e))}function g(_){let w=(0,zr._)`${_}.errors`;i.assign(Ou.default.vErrors,(0,zr._)`${Ou.default.vErrors} === null ? ${w} : ${Ou.default.vErrors}.concat(${w})`),i.assign(Ou.default.errors,(0,zr._)`${Ou.default.vErrors}.length`)}function v(_){var w;if(!s.opts.unevaluated)return;let E=(w=r?.validate)===null||w===void 0?void 0:w.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=Pm.mergeEvaluated.props(i,E.props,s.props));else{let k=i.var("props",(0,zr._)`${_}.evaluated.props`);s.props=Pm.mergeEvaluated.props(i,k,s.props,zr.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=Pm.mergeEvaluated.items(i,E.items,s.items));else{let k=i.var("items",(0,zr._)`${_}.evaluated.items`);s.items=Pm.mergeEvaluated.items(i,k,s.items,zr.Name)}}}qa.callRef=Tm;qa.default=oV});var lq=H(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});var aV=nq(),lV=aq(),uV=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",aV.default,lV.default];Yw.default=uV});var uq=H(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});var Am=Ue(),fo=Am.operators,$m={maximum:{okStr:"<=",ok:fo.LTE,fail:fo.GT},minimum:{okStr:">=",ok:fo.GTE,fail:fo.LT},exclusiveMaximum:{okStr:"<",ok:fo.LT,fail:fo.GTE},exclusiveMinimum:{okStr:">",ok:fo.GT,fail:fo.LTE}},cV={message:({keyword:t,schemaCode:e})=>(0,Am.str)`must be ${$m[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Am._)`{comparison: ${$m[t].okStr}, limit: ${e}}`},fV={keyword:Object.keys($m),type:"number",schemaType:"number",$data:!0,error:cV,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Am._)`${r} ${$m[e].fail} ${n} || isNaN(${r})`)}};Kw.default=fV});var cq=H(Qw=>{"use strict";Object.defineProperty(Qw,"__esModule",{value:!0});var Jf=Ue(),dV={message:({schemaCode:t})=>(0,Jf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Jf._)`{multipleOf: ${t}}`},pV={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:dV,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Jf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Jf._)`${o} !== parseInt(${o})`;t.fail$data((0,Jf._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};Qw.default=pV});var dq=H(Zw=>{"use strict";Object.defineProperty(Zw,"__esModule",{value:!0});function fq(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}Zw.default=fq;fq.code='require("ajv/dist/runtime/ucs2length").default'});var pq=H(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});var ka=Ue(),hV=Ze(),mV=dq(),gV={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,ka.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ka._)`{limit: ${t}}`},yV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:gV,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?ka.operators.GT:ka.operators.LT,o=i.opts.unicode===!1?(0,ka._)`${r}.length`:(0,ka._)`${(0,hV.useFunc)(t.gen,mV.default)}(${r})`;t.fail$data((0,ka._)`${o} ${s} ${n}`)}};Xw.default=yV});var hq=H(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var vV=kn(),bV=Ze(),qu=Ue(),SV={message:({schemaCode:t})=>(0,qu.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,qu._)`{pattern: ${t}}`},wV={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:SV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,l=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=o.opts.code,c=f.code==="new RegExp"?(0,qu._)`new RegExp`:(0,bV.useFunc)(e,f),p=e.let("valid");e.try(()=>e.assign(p,(0,qu._)`${c}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,qu._)`!${p}`)}else{let f=(0,vV.usePattern)(t,i);t.fail$data((0,qu._)`!${f}.test(${r})`)}}};e0.default=wV});var mq=H(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var Gf=Ue(),_V={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Gf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Gf._)`{limit: ${t}}`},RV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:_V,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Gf.operators.GT:Gf.operators.LT;t.fail$data((0,Gf._)`Object.keys(${r}).length ${i} ${n}`)}};t0.default=RV});var gq=H(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var Yf=kn(),Kf=Ue(),CV=Ze(),xV={message:({params:{missingProperty:t}})=>(0,Kf.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Kf._)`{missingProperty: ${t}}`},EV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:xV,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:l}=o;if(!s&&r.length===0)return;let f=r.length>=l.loopRequired;if(o.allErrors?c():p(),l.strictRequired){let v=t.parentSchema.properties,{definedProperties:_}=t.it;for(let w of r)if(v?.[w]===void 0&&!_.has(w)){let E=o.schemaEnv.baseId+o.errSchemaPath,k=`required property "${w}" is not defined at "${E}" (strictRequired)`;(0,CV.checkStrictMode)(o,k,o.opts.strictRequired)}}function c(){if(f||s)t.block$data(Kf.nil,h);else for(let v of r)(0,Yf.checkReportMissingProp)(t,v)}function p(){let v=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>g(v,_)),t.ok(_)}else e.if((0,Yf.checkMissingProp)(t,r,v)),(0,Yf.reportMissingProp)(t,v),e.else()}function h(){e.forOf("prop",n,v=>{t.setParams({missingProperty:v}),e.if((0,Yf.noPropertyInData)(e,i,v,l.ownProperties),()=>t.error())})}function g(v,_){t.setParams({missingProperty:v}),e.forOf(v,n,()=>{e.assign(_,(0,Yf.propertyInData)(e,i,v,l.ownProperties)),e.if((0,Kf.not)(_),()=>{t.error(),e.break()})},Kf.nil)}}};r0.default=EV});var yq=H(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var Qf=Ue(),IV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Qf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Qf._)`{limit: ${t}}`},OV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:IV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Qf.operators.GT:Qf.operators.LT;t.fail$data((0,Qf._)`${r}.length ${i} ${n}`)}};n0.default=OV});var Nm=H(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var vq=Iw();vq.code='require("ajv/dist/runtime/equal").default';i0.default=vq});var bq=H(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var s0=Ff(),or=Ue(),qV=Ze(),kV=Nm(),PV={message:({params:{i:t,j:e}})=>(0,or.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,or._)`{i: ${t}, j: ${e}}`},TV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:PV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let f=e.let("valid"),c=s.items?(0,s0.getSchemaTypes)(s.items):[];t.block$data(f,p,(0,or._)`${o} === false`),t.ok(f);function p(){let _=e.let("i",(0,or._)`${r}.length`),w=e.let("j");t.setParams({i:_,j:w}),e.assign(f,!0),e.if((0,or._)`${_} > 1`,()=>(h()?g:v)(_,w))}function h(){return c.length>0&&!c.some(_=>_==="object"||_==="array")}function g(_,w){let E=e.name("item"),k=(0,s0.checkDataTypes)(c,E,l.opts.strictNumbers,s0.DataType.Wrong),T=e.const("indices",(0,or._)`{}`);e.for((0,or._)`;${_}--;`,()=>{e.let(E,(0,or._)`${r}[${_}]`),e.if(k,(0,or._)`continue`),c.length>1&&e.if((0,or._)`typeof ${E} == "string"`,(0,or._)`${E} += "_"`),e.if((0,or._)`typeof ${T}[${E}] == "number"`,()=>{e.assign(w,(0,or._)`${T}[${E}]`),t.error(),e.assign(f,!1).break()}).code((0,or._)`${T}[${E}] = ${_}`)})}function v(_,w){let E=(0,qV.useFunc)(e,kV.default),k=e.name("outer");e.label(k).for((0,or._)`;${_}--;`,()=>e.for((0,or._)`${w} = ${_}; ${w}--;`,()=>e.if((0,or._)`${E}(${r}[${_}], ${r}[${w}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};o0.default=TV});var Sq=H(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});var a0=Ue(),AV=Ze(),$V=Nm(),NV={message:"must be equal to constant",params:({schemaCode:t})=>(0,a0._)`{allowedValue: ${t}}`},MV={keyword:"const",$data:!0,error:NV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,a0._)`!${(0,AV.useFunc)(e,$V.default)}(${r}, ${i})`):t.fail((0,a0._)`${s} !== ${r}`)}};l0.default=MV});var wq=H(u0=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var Zf=Ue(),FV=Ze(),DV=Nm(),LV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Zf._)`{allowedValues: ${t}}`},jV={keyword:"enum",schemaType:"array",$data:!0,error:LV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=o.opts.loopEnum,f,c=()=>f??(f=(0,FV.useFunc)(e,DV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let v=e.const("vSchema",s);p=(0,Zf.or)(...i.map((_,w)=>g(v,w)))}t.pass(p);function h(){e.assign(p,!1),e.forOf("v",s,v=>e.if((0,Zf._)`${c()}(${r}, ${v})`,()=>e.assign(p,!0).break()))}function g(v,_){let w=i[_];return typeof w=="object"&&w!==null?(0,Zf._)`${c()}(${r}, ${v}[${_}])`:(0,Zf._)`${r} === ${w}`}}};u0.default=jV});var _q=H(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});var UV=uq(),HV=cq(),BV=pq(),VV=hq(),WV=mq(),zV=gq(),JV=yq(),GV=bq(),YV=Sq(),KV=wq(),QV=[UV.default,HV.default,BV.default,VV.default,WV.default,zV.default,JV.default,GV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},YV.default,KV.default];c0.default=QV});var d0=H(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.validateAdditionalItems=void 0;var Pa=Ue(),f0=Ze(),ZV={message:({params:{len:t}})=>(0,Pa.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Pa._)`{limit: ${t}}`},XV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ZV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,f0.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Rq(t,n)}};function Rq(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,Pa._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Pa._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,f0.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,Pa._)`${l} <= ${e.length}`);r.if((0,Pa.not)(c),()=>f(c)),t.ok(c)}function f(c){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:f0.Type.Num},c),o.allErrors||r.if((0,Pa.not)(c),()=>r.break())})}}Xf.validateAdditionalItems=Rq;Xf.default=XV});var p0=H(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.validateTuple=void 0;var Cq=Ue(),Mm=Ze(),eW=kn(),tW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return xq(t,"additionalItems",e);r.items=!0,!(0,Mm.alwaysValidSchema)(r,e)&&t.ok((0,eW.validateArray)(t))}};function xq(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:l}=t;p(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Mm.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),c=n.const("len",(0,Cq._)`${s}.length`);r.forEach((h,g)=>{(0,Mm.alwaysValidSchema)(l,h)||(n.if((0,Cq._)`${c} > ${g}`,()=>t.subschema({keyword:o,schemaProp:g,dataProp:g},f)),t.ok(f))});function p(h){let{opts:g,errSchemaPath:v}=l,_=r.length,w=_===h.minItems&&(_===h.maxItems||h[e]===!1);if(g.strictTuples&&!w){let E=`"${o}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${v}"`;(0,Mm.checkStrictMode)(l,E,g.strictTuples)}}}ed.validateTuple=xq;ed.default=tW});var Eq=H(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var rW=p0(),nW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,rW.validateTuple)(t,"items")};h0.default=nW});var Oq=H(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var Iq=Ue(),iW=Ze(),sW=kn(),oW=d0(),aW={message:({params:{len:t}})=>(0,Iq.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Iq._)`{limit: ${t}}`},lW={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:aW,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,iW.alwaysValidSchema)(n,e)&&(i?(0,oW.validateAdditionalItems)(t,i):t.ok((0,sW.validateArray)(t)))}};m0.default=lW});var qq=H(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});var Tn=Ue(),Fm=Ze(),uW={message:({params:{min:t,max:e}})=>e===void 0?(0,Tn.str)`must contain at least ${t} valid item(s)`:(0,Tn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Tn._)`{minContains: ${t}}`:(0,Tn._)`{minContains: ${t}, maxContains: ${e}}`},cW={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:uW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:f,maxContains:c}=n;s.opts.next?(o=f===void 0?1:f,l=c):o=1;let p=e.const("len",(0,Tn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,Fm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,Fm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Fm.alwaysValidSchema)(s,r)){let w=(0,Tn._)`${p} >= ${o}`;l!==void 0&&(w=(0,Tn._)`${w} && ${p} <= ${l}`),t.pass(w);return}s.items=!0;let h=e.name("valid");l===void 0&&o===1?v(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),l!==void 0&&e.if((0,Tn._)`${i}.length > 0`,g)):(e.let(h,!1),g()),t.result(h,()=>t.reset());function g(){let w=e.name("_valid"),E=e.let("count",0);v(w,()=>e.if(w,()=>_(E)))}function v(w,E){e.forRange("i",0,p,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:Fm.Type.Num,compositeRule:!0},w),E()})}function _(w){e.code((0,Tn._)`${w}++`),l===void 0?e.if((0,Tn._)`${w} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,Tn._)`${w} > ${l}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,Tn._)`${w} >= ${o}`,()=>e.assign(h,!0)))}}};g0.default=cW});var Tq=H($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.validateSchemaDeps=$i.validatePropertyDeps=$i.error=void 0;var y0=Ue(),fW=Ze(),td=kn();$i.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,y0.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,y0._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${r}}`};var dW={keyword:"dependencies",type:"object",schemaType:"object",error:$i.error,code(t){let[e,r]=pW(t);kO(t,e),PO(t,r)}};function pW({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 kO(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 o in e){let l=e[o];if(l.length===0)continue;let f=(0,td.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let c of l)(0,td.checkReportMissingProp)(t,c)}):(r.if((0,y0._)`${f} && (${(0,td.checkMissingProp)(t,l,s)})`),(0,td.reportMissingProp)(t,s),r.else())}}$i.validatePropertyDeps=kO;function PO(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,fW.alwaysValidSchema)(s,e[l])||(r.if((0,td.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(f,o)},()=>r.var(o,!0)),t.ok(o))}$i.validateSchemaDeps=PO;$i.default=dW});var $O=H(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var AO=Ue(),hW=Ze(),mW={message:"property name must be valid",params:({params:t})=>(0,AO._)`{propertyName: ${t.propertyName}}`},gW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:mW,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,hW.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,AO.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};v0.default=gW});var S0=H(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var Dm=kn(),ti=Ue(),yW=hs(),Lm=Ze(),vW={message:"must NOT have additional properties",params:({params:t})=>(0,ti._)`{additionalProperty: ${t.additionalProperty}}`},bW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:vW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,Lm.alwaysValidSchema)(o,r))return;let c=(0,Dm.allSchemaProperties)(n.properties),p=(0,Dm.allSchemaProperties)(n.patternProperties);h(),t.ok((0,ti._)`${s} === ${yW.default.errors}`);function h(){e.forIn("key",i,E=>{!c.length&&!p.length?_(E):e.if(g(E),()=>_(E))})}function g(E){let k;if(c.length>8){let T=(0,Lm.schemaRefOrVal)(o,n.properties,"properties");k=(0,Dm.isOwnProperty)(e,T,E)}else c.length?k=(0,ti.or)(...c.map(T=>(0,ti._)`${E} === ${T}`)):k=ti.nil;return p.length&&(k=(0,ti.or)(k,...p.map(T=>(0,ti._)`${(0,Dm.usePattern)(t,T)}.test(${E})`))),(0,ti.not)(k)}function v(E){e.code((0,ti._)`delete ${i}[${E}]`)}function _(E){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){v(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Lm.alwaysValidSchema)(o,r)){let k=e.name("valid");f.removeAdditional==="failing"?(w(E,k,!1),e.if((0,ti.not)(k),()=>{t.reset(),v(E)})):(w(E,k),l||e.if((0,ti.not)(k),()=>e.break()))}}function w(E,k,T){let N={keyword:"additionalProperties",dataProp:E,dataPropType:Lm.Type.Str};T===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,k)}}};b0.default=bW});var FO=H(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});var SW=Uf(),NO=kn(),w0=Ze(),MO=S0(),wW={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&&MO.default.code(new SW.KeywordCxt(s,MO.default,"additionalProperties"));let o=(0,NO.allSchemaProperties)(r);for(let h of o)s.definedProperties.add(h);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=w0.mergeEvaluated.props(e,(0,w0.toHash)(o),s.props));let l=o.filter(h=>!(0,w0.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let f=e.name("valid");for(let h of l)c(h)?p(h):(e.if((0,NO.propertyInData)(e,i,h,s.opts.ownProperties)),p(h),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(f);function c(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}function p(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},f)}}};_0.default=wW});var UO=H(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});var DO=kn(),jm=Ue(),LO=Ze(),jO=Ze(),_W={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,l=(0,DO.allSchemaProperties)(r),f=l.filter(w=>(0,LO.alwaysValidSchema)(s,r[w]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof jm.Name)&&(s.props=(0,jO.evaluatedPropsToName)(e,s.props));let{props:h}=s;g();function g(){for(let w of l)c&&v(w),s.allErrors?_(w):(e.var(p,!0),_(w),e.if(p))}function v(w){for(let E in c)new RegExp(w).test(E)&&(0,LO.checkStrictMode)(s,`property ${E} matches pattern ${w} (use allowMatchingProperties)`)}function _(w){e.forIn("key",n,E=>{e.if((0,jm._)`${(0,DO.usePattern)(t,w)}.test(${E})`,()=>{let k=f.includes(w);k||t.subschema({keyword:"patternProperties",schemaProp:w,dataProp:E,dataPropType:jO.Type.Str},p),s.opts.unevaluated&&h!==!0?e.assign((0,jm._)`${h}[${E}]`,!0):!k&&!s.allErrors&&e.if((0,jm.not)(p),()=>e.break())})})}}};R0.default=_W});var HO=H(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var RW=Ze(),CW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,RW.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"}};C0.default=CW});var BO=H(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});var xW=kn(),EW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:xW.validateUnion,error:{message:"must match a schema in anyOf"}};x0.default=EW});var VO=H(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});var Um=Ue(),IW=Ze(),qW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Um._)`{passingSchemas: ${t.passing}}`},OW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:qW,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,o=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");t.setParams({passing:l}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((p,h)=>{let g;(0,IW.alwaysValidSchema)(i,p)?e.var(f,!0):g=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},f),h>0&&e.if((0,Um._)`${f} && ${o}`).assign(o,!1).assign(l,(0,Um._)`[${l}, ${h}]`).else(),e.if(f,()=>{e.assign(o,!0),e.assign(l,h),g&&t.mergeEvaluated(g,Um.Name)})})}}};E0.default=OW});var WO=H(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});var kW=Ze(),PW={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,o)=>{if((0,kW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};I0.default=PW});var GO=H(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});var Hm=Ue(),JO=Ze(),TW={message:({params:t})=>(0,Hm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Hm._)`{failingKeyword: ${t.ifClause}}`},AW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:TW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,JO.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=zO(n,"then"),s=zO(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,c("then",p),c("else",p))}else i?e.if(l,c("then")):e.if((0,Hm.not)(l),c("else"));t.pass(o,()=>t.error(!0));function f(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function c(p,h){return()=>{let g=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(g,o),h?e.assign(h,(0,Hm._)`${p}`):t.setParams({ifClause:p})}}}};function zO(t,e){let r=t.schema[e];return r!==void 0&&!(0,JO.alwaysValidSchema)(t,r)}q0.default=AW});var YO=H(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var $W=Ze(),NW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,$W.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};O0.default=NW});var KO=H(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});var MW=d0(),FW=EO(),DW=p0(),LW=qO(),jW=OO(),UW=TO(),HW=$O(),BW=S0(),VW=FO(),WW=UO(),zW=HO(),JW=BO(),GW=VO(),YW=WO(),KW=GO(),QW=YO();function ZW(t=!1){let e=[zW.default,JW.default,GW.default,YW.default,KW.default,QW.default,HW.default,BW.default,UW.default,VW.default,WW.default];return t?e.push(FW.default,LW.default):e.push(MW.default,DW.default),e.push(jW.default),e}k0.default=ZW});var QO=H(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});var jt=Ue(),XW={message:({schemaCode:t})=>(0,jt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,jt._)`{format: ${t}}`},ez={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:XW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:f,errSchemaPath:c,schemaEnv:p,self:h}=l;if(!f.validateFormats)return;i?g():v();function g(){let _=r.scopeValue("formats",{ref:h.formats,code:f.code.formats}),w=r.const("fDef",(0,jt._)`${_}[${o}]`),E=r.let("fType"),k=r.let("format");r.if((0,jt._)`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>r.assign(E,(0,jt._)`${w}.type || "string"`).assign(k,(0,jt._)`${w}.validate`),()=>r.assign(E,(0,jt._)`"string"`).assign(k,w)),t.fail$data((0,jt.or)(T(),N()));function T(){return f.strictSchema===!1?jt.nil:(0,jt._)`${o} && !${k}`}function N(){let $=p.$async?(0,jt._)`(${w}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,jt._)`${k}(${n})`,j=(0,jt._)`(typeof ${k} == "function" ? ${$} : ${k}.test(${n}))`;return(0,jt._)`${k} && ${k} !== true && ${E} === ${e} && !${j}`}}function v(){let _=h.formats[s];if(!_){T();return}if(_===!0)return;let[w,E,k]=N(_);w===e&&t.pass($());function T(){if(f.strictSchema===!1){h.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function N(j){let G=j instanceof RegExp?(0,jt.regexpCode)(j):f.code.formats?(0,jt._)`${f.code.formats}${(0,jt.getProperty)(s)}`:void 0,O=r.scopeValue("formats",{key:s,ref:j,code:G});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,jt._)`${O}.validate`]:["string",j,O]}function $(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!p.$async)throw new Error("async format in sync schema");return(0,jt._)`await ${k}(${n})`}return typeof E=="function"?(0,jt._)`${k}(${n})`:(0,jt._)`${k}.test(${n})`}}}};P0.default=ez});var ZO=H(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});var tz=QO(),rz=[tz.default];T0.default=rz});var XO=H(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.contentVocabulary=ku.metadataVocabulary=void 0;ku.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ku.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var tk=H(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var nz=lO(),iz=_O(),sz=KO(),oz=ZO(),ek=XO(),az=[nz.default,iz.default,(0,sz.default)(),oz.default,ek.metadataVocabulary,ek.contentVocabulary];A0.default=az});var nk=H(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.DiscrError=void 0;var rk;(function(t){t.Tag="tag",t.Mapping="mapping"})(rk||(Bm.DiscrError=rk={}))});var sk=H(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});var Pu=Ue(),$0=nk(),ik=Em(),lz=Hf(),uz=Ze(),cz={message:({params:{discrError:t,tagName:e}})=>t===$0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Pu._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},fz={keyword:"discriminator",type:"object",schemaType:"object",error:cz,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=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(!o)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),c=e.const("tag",(0,Pu._)`${r}${(0,Pu.getProperty)(l)}`);e.if((0,Pu._)`typeof ${c} == "string"`,()=>p(),()=>t.error(!1,{discrError:$0.DiscrError.Tag,tag:c,tagName:l})),t.ok(f);function p(){let v=g();e.if(!1);for(let _ in v)e.elseIf((0,Pu._)`${c} === ${_}`),e.assign(f,h(v[_]));e.else(),t.error(!1,{discrError:$0.DiscrError.Mapping,tag:c,tagName:l}),e.endIf()}function h(v){let _=e.name("valid"),w=t.subschema({keyword:"oneOf",schemaProp:v},_);return t.mergeEvaluated(w,Pu.Name),_}function g(){var v;let _={},w=k(i),E=!0;for(let $=0;$<o.length;$++){let j=o[$];if(j?.$ref&&!(0,uz.schemaHasRulesButRef)(j,s.self.RULES)){let O=j.$ref;if(j=ik.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,O),j instanceof ik.SchemaEnv&&(j=j.schema),j===void 0)throw new lz.default(s.opts.uriResolver,s.baseId,O)}let G=(v=j?.properties)===null||v===void 0?void 0:v[l];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);E=E&&(w||k(j)),T(G,$)}if(!E)throw new Error(`discriminator: "${l}" must be required`);return _;function k({required:$}){return Array.isArray($)&&$.includes(l)}function T($,j){if($.const)N($.const,j);else if($.enum)for(let G of $.enum)N(G,j);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function N($,j){if(typeof $!="string"||$ in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[$]=j}}}};N0.default=fz});var ok=H((SZ,dz)=>{dz.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 lk=H((It,M0)=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.MissingRefError=It.ValidationError=It.CodeGen=It.Name=It.nil=It.stringify=It.str=It._=It.KeywordCxt=It.Ajv=void 0;var pz=rO(),hz=tk(),mz=sk(),ak=ok(),gz=["/properties"],Vm="http://json-schema.org/draft-07/schema",Tu=class extends pz.default{_addVocabularies(){super._addVocabularies(),hz.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(mz.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ak,gz):ak;this.addMetaSchema(e,Vm,!1),this.refs["http://json-schema.org/schema"]=Vm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Vm)?Vm:void 0)}};It.Ajv=Tu;M0.exports=It=Tu;M0.exports.Ajv=Tu;Object.defineProperty(It,"__esModule",{value:!0});It.default=Tu;var yz=Uf();Object.defineProperty(It,"KeywordCxt",{enumerable:!0,get:function(){return yz.KeywordCxt}});var Au=Ue();Object.defineProperty(It,"_",{enumerable:!0,get:function(){return Au._}});Object.defineProperty(It,"str",{enumerable:!0,get:function(){return Au.str}});Object.defineProperty(It,"stringify",{enumerable:!0,get:function(){return Au.stringify}});Object.defineProperty(It,"nil",{enumerable:!0,get:function(){return Au.nil}});Object.defineProperty(It,"Name",{enumerable:!0,get:function(){return Au.Name}});Object.defineProperty(It,"CodeGen",{enumerable:!0,get:function(){return Au.CodeGen}});var vz=Cm();Object.defineProperty(It,"ValidationError",{enumerable:!0,get:function(){return vz.default}});var bz=Hf();Object.defineProperty(It,"MissingRefError",{enumerable:!0,get:function(){return bz.default}})});function nd(){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 F0(){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 Wm(t,e){return new rd(t,e)}var Sz,Ta,uk,ri,rd,D0=se(()=>{"use strict";Sz=me(require("crypto")),Ta=me(require("fs")),uk=require("module"),ri=me(require("path"));JS();rd=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:pu}),crypto:()=>Sz,path:()=>ri,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>II(),F0),moment:()=>this.loadOptionalModule("moment",()=>qI(),nd),tv4:()=>this.loadOptionalModule("tv4",()=>kI()),ajv:()=>this.loadOptionalModule("ajv",()=>lk()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("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=ri.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 dW={keyword:"dependencies",type:"object",schemaType:"object",error:$i.error,code(t){let[e,r]=pW(t);kq(t,e),Pq(t,r)}};function pW({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 kq(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 o in e){let l=e[o];if(l.length===0)continue;let f=(0,td.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let c of l)(0,td.checkReportMissingProp)(t,c)}):(r.if((0,y0._)`${f} && (${(0,td.checkMissingProp)(t,l,s)})`),(0,td.reportMissingProp)(t,s),r.else())}}$i.validatePropertyDeps=kq;function Pq(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,fW.alwaysValidSchema)(s,e[l])||(r.if((0,td.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(f,o)},()=>r.var(o,!0)),t.ok(o))}$i.validateSchemaDeps=Pq;$i.default=dW});var $q=H(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});var Aq=Ue(),hW=Ze(),mW={message:"property name must be valid",params:({params:t})=>(0,Aq._)`{propertyName: ${t.propertyName}}`},gW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:mW,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,hW.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,Aq.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};v0.default=gW});var S0=H(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var Dm=kn(),ti=Ue(),yW=hs(),Lm=Ze(),vW={message:"must NOT have additional properties",params:({params:t})=>(0,ti._)`{additionalProperty: ${t.additionalProperty}}`},bW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:vW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,Lm.alwaysValidSchema)(o,r))return;let c=(0,Dm.allSchemaProperties)(n.properties),p=(0,Dm.allSchemaProperties)(n.patternProperties);h(),t.ok((0,ti._)`${s} === ${yW.default.errors}`);function h(){e.forIn("key",i,E=>{!c.length&&!p.length?_(E):e.if(g(E),()=>_(E))})}function g(E){let k;if(c.length>8){let T=(0,Lm.schemaRefOrVal)(o,n.properties,"properties");k=(0,Dm.isOwnProperty)(e,T,E)}else c.length?k=(0,ti.or)(...c.map(T=>(0,ti._)`${E} === ${T}`)):k=ti.nil;return p.length&&(k=(0,ti.or)(k,...p.map(T=>(0,ti._)`${(0,Dm.usePattern)(t,T)}.test(${E})`))),(0,ti.not)(k)}function v(E){e.code((0,ti._)`delete ${i}[${E}]`)}function _(E){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){v(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Lm.alwaysValidSchema)(o,r)){let k=e.name("valid");f.removeAdditional==="failing"?(w(E,k,!1),e.if((0,ti.not)(k),()=>{t.reset(),v(E)})):(w(E,k),l||e.if((0,ti.not)(k),()=>e.break()))}}function w(E,k,T){let N={keyword:"additionalProperties",dataProp:E,dataPropType:Lm.Type.Str};T===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,k)}}};b0.default=bW});var Fq=H(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});var SW=Uf(),Nq=kn(),w0=Ze(),Mq=S0(),wW={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&&Mq.default.code(new SW.KeywordCxt(s,Mq.default,"additionalProperties"));let o=(0,Nq.allSchemaProperties)(r);for(let h of o)s.definedProperties.add(h);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=w0.mergeEvaluated.props(e,(0,w0.toHash)(o),s.props));let l=o.filter(h=>!(0,w0.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let f=e.name("valid");for(let h of l)c(h)?p(h):(e.if((0,Nq.propertyInData)(e,i,h,s.opts.ownProperties)),p(h),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(f);function c(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}function p(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},f)}}};_0.default=wW});var Uq=H(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});var Dq=kn(),jm=Ue(),Lq=Ze(),jq=Ze(),_W={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,l=(0,Dq.allSchemaProperties)(r),f=l.filter(w=>(0,Lq.alwaysValidSchema)(s,r[w]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof jm.Name)&&(s.props=(0,jq.evaluatedPropsToName)(e,s.props));let{props:h}=s;g();function g(){for(let w of l)c&&v(w),s.allErrors?_(w):(e.var(p,!0),_(w),e.if(p))}function v(w){for(let E in c)new RegExp(w).test(E)&&(0,Lq.checkStrictMode)(s,`property ${E} matches pattern ${w} (use allowMatchingProperties)`)}function _(w){e.forIn("key",n,E=>{e.if((0,jm._)`${(0,Dq.usePattern)(t,w)}.test(${E})`,()=>{let k=f.includes(w);k||t.subschema({keyword:"patternProperties",schemaProp:w,dataProp:E,dataPropType:jq.Type.Str},p),s.opts.unevaluated&&h!==!0?e.assign((0,jm._)`${h}[${E}]`,!0):!k&&!s.allErrors&&e.if((0,jm.not)(p),()=>e.break())})})}}};R0.default=_W});var Hq=H(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var RW=Ze(),CW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,RW.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"}};C0.default=CW});var Bq=H(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});var xW=kn(),EW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:xW.validateUnion,error:{message:"must match a schema in anyOf"}};x0.default=EW});var Vq=H(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});var Um=Ue(),IW=Ze(),OW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Um._)`{passingSchemas: ${t.passing}}`},qW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:OW,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,o=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");t.setParams({passing:l}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((p,h)=>{let g;(0,IW.alwaysValidSchema)(i,p)?e.var(f,!0):g=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},f),h>0&&e.if((0,Um._)`${f} && ${o}`).assign(o,!1).assign(l,(0,Um._)`[${l}, ${h}]`).else(),e.if(f,()=>{e.assign(o,!0),e.assign(l,h),g&&t.mergeEvaluated(g,Um.Name)})})}}};E0.default=qW});var Wq=H(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});var kW=Ze(),PW={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,o)=>{if((0,kW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};I0.default=PW});var Gq=H(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var Hm=Ue(),Jq=Ze(),TW={message:({params:t})=>(0,Hm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Hm._)`{failingKeyword: ${t.ifClause}}`},AW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:TW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Jq.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=zq(n,"then"),s=zq(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,c("then",p),c("else",p))}else i?e.if(l,c("then")):e.if((0,Hm.not)(l),c("else"));t.pass(o,()=>t.error(!0));function f(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function c(p,h){return()=>{let g=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(g,o),h?e.assign(h,(0,Hm._)`${p}`):t.setParams({ifClause:p})}}}};function zq(t,e){let r=t.schema[e];return r!==void 0&&!(0,Jq.alwaysValidSchema)(t,r)}O0.default=AW});var Yq=H(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});var $W=Ze(),NW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,$W.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};q0.default=NW});var Kq=H(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});var MW=d0(),FW=Eq(),DW=p0(),LW=Oq(),jW=qq(),UW=Tq(),HW=$q(),BW=S0(),VW=Fq(),WW=Uq(),zW=Hq(),JW=Bq(),GW=Vq(),YW=Wq(),KW=Gq(),QW=Yq();function ZW(t=!1){let e=[zW.default,JW.default,GW.default,YW.default,KW.default,QW.default,HW.default,BW.default,UW.default,VW.default,WW.default];return t?e.push(FW.default,LW.default):e.push(MW.default,DW.default),e.push(jW.default),e}k0.default=ZW});var Qq=H(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});var jt=Ue(),XW={message:({schemaCode:t})=>(0,jt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,jt._)`{format: ${t}}`},ez={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:XW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:f,errSchemaPath:c,schemaEnv:p,self:h}=l;if(!f.validateFormats)return;i?g():v();function g(){let _=r.scopeValue("formats",{ref:h.formats,code:f.code.formats}),w=r.const("fDef",(0,jt._)`${_}[${o}]`),E=r.let("fType"),k=r.let("format");r.if((0,jt._)`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>r.assign(E,(0,jt._)`${w}.type || "string"`).assign(k,(0,jt._)`${w}.validate`),()=>r.assign(E,(0,jt._)`"string"`).assign(k,w)),t.fail$data((0,jt.or)(T(),N()));function T(){return f.strictSchema===!1?jt.nil:(0,jt._)`${o} && !${k}`}function N(){let $=p.$async?(0,jt._)`(${w}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,jt._)`${k}(${n})`,j=(0,jt._)`(typeof ${k} == "function" ? ${$} : ${k}.test(${n}))`;return(0,jt._)`${k} && ${k} !== true && ${E} === ${e} && !${j}`}}function v(){let _=h.formats[s];if(!_){T();return}if(_===!0)return;let[w,E,k]=N(_);w===e&&t.pass($());function T(){if(f.strictSchema===!1){h.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function N(j){let G=j instanceof RegExp?(0,jt.regexpCode)(j):f.code.formats?(0,jt._)`${f.code.formats}${(0,jt.getProperty)(s)}`:void 0,q=r.scopeValue("formats",{key:s,ref:j,code:G});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,jt._)`${q}.validate`]:["string",j,q]}function $(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!p.$async)throw new Error("async format in sync schema");return(0,jt._)`await ${k}(${n})`}return typeof E=="function"?(0,jt._)`${k}(${n})`:(0,jt._)`${k}.test(${n})`}}}};P0.default=ez});var Zq=H(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});var tz=Qq(),rz=[tz.default];T0.default=rz});var Xq=H(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.contentVocabulary=ku.metadataVocabulary=void 0;ku.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ku.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var tk=H(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var nz=lq(),iz=_q(),sz=Kq(),oz=Zq(),ek=Xq(),az=[nz.default,iz.default,(0,sz.default)(),oz.default,ek.metadataVocabulary,ek.contentVocabulary];A0.default=az});var nk=H(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.DiscrError=void 0;var rk;(function(t){t.Tag="tag",t.Mapping="mapping"})(rk||(Bm.DiscrError=rk={}))});var sk=H(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});var Pu=Ue(),$0=nk(),ik=Em(),lz=Hf(),uz=Ze(),cz={message:({params:{discrError:t,tagName:e}})=>t===$0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Pu._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},fz={keyword:"discriminator",type:"object",schemaType:"object",error:cz,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=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(!o)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),c=e.const("tag",(0,Pu._)`${r}${(0,Pu.getProperty)(l)}`);e.if((0,Pu._)`typeof ${c} == "string"`,()=>p(),()=>t.error(!1,{discrError:$0.DiscrError.Tag,tag:c,tagName:l})),t.ok(f);function p(){let v=g();e.if(!1);for(let _ in v)e.elseIf((0,Pu._)`${c} === ${_}`),e.assign(f,h(v[_]));e.else(),t.error(!1,{discrError:$0.DiscrError.Mapping,tag:c,tagName:l}),e.endIf()}function h(v){let _=e.name("valid"),w=t.subschema({keyword:"oneOf",schemaProp:v},_);return t.mergeEvaluated(w,Pu.Name),_}function g(){var v;let _={},w=k(i),E=!0;for(let $=0;$<o.length;$++){let j=o[$];if(j?.$ref&&!(0,uz.schemaHasRulesButRef)(j,s.self.RULES)){let q=j.$ref;if(j=ik.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,q),j instanceof ik.SchemaEnv&&(j=j.schema),j===void 0)throw new lz.default(s.opts.uriResolver,s.baseId,q)}let G=(v=j?.properties)===null||v===void 0?void 0:v[l];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);E=E&&(w||k(j)),T(G,$)}if(!E)throw new Error(`discriminator: "${l}" must be required`);return _;function k({required:$}){return Array.isArray($)&&$.includes(l)}function T($,j){if($.const)N($.const,j);else if($.enum)for(let G of $.enum)N(G,j);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function N($,j){if(typeof $!="string"||$ in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[$]=j}}}};N0.default=fz});var ok=H((SZ,dz)=>{dz.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 lk=H((It,M0)=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.MissingRefError=It.ValidationError=It.CodeGen=It.Name=It.nil=It.stringify=It.str=It._=It.KeywordCxt=It.Ajv=void 0;var pz=rq(),hz=tk(),mz=sk(),ak=ok(),gz=["/properties"],Vm="http://json-schema.org/draft-07/schema",Tu=class extends pz.default{_addVocabularies(){super._addVocabularies(),hz.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(mz.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(ak,gz):ak;this.addMetaSchema(e,Vm,!1),this.refs["http://json-schema.org/schema"]=Vm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Vm)?Vm:void 0)}};It.Ajv=Tu;M0.exports=It=Tu;M0.exports.Ajv=Tu;Object.defineProperty(It,"__esModule",{value:!0});It.default=Tu;var yz=Uf();Object.defineProperty(It,"KeywordCxt",{enumerable:!0,get:function(){return yz.KeywordCxt}});var Au=Ue();Object.defineProperty(It,"_",{enumerable:!0,get:function(){return Au._}});Object.defineProperty(It,"str",{enumerable:!0,get:function(){return Au.str}});Object.defineProperty(It,"stringify",{enumerable:!0,get:function(){return Au.stringify}});Object.defineProperty(It,"nil",{enumerable:!0,get:function(){return Au.nil}});Object.defineProperty(It,"Name",{enumerable:!0,get:function(){return Au.Name}});Object.defineProperty(It,"CodeGen",{enumerable:!0,get:function(){return Au.CodeGen}});var vz=Cm();Object.defineProperty(It,"ValidationError",{enumerable:!0,get:function(){return vz.default}});var bz=Hf();Object.defineProperty(It,"MissingRefError",{enumerable:!0,get:function(){return bz.default}})});function nd(){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 F0(){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 Wm(t,e){return new rd(t,e)}var Sz,Ta,uk,ri,rd,D0=se(()=>{"use strict";Sz=me(require("crypto")),Ta=me(require("fs")),uk=require("module"),ri=me(require("path"));JS();rd=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:pu}),crypto:()=>Sz,path:()=>ri,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>II(),F0),moment:()=>this.loadOptionalModule("moment",()=>OI(),nd),tv4:()=>this.loadOptionalModule("tv4",()=>kI()),ajv:()=>this.loadOptionalModule("ajv",()=>lk()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("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=ri.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": {
|
|
@@ -47,10 +47,10 @@ ${i}
|
|
|
47
47
|
|
|
48
48
|
// --- Next Script ---
|
|
49
49
|
|
|
50
|
-
`)}function Nu(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Aa(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 dk(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 Jm(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let o=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(o)}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 Gm(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function Ym(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=dt.parseCookieHeaders(t||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var od=se(()=>{"use strict";ba()});function xz(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 j0,Mu,U0=se(()=>{"use strict";j0=me(require("vm"));fk();zm();od();Mu=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=ck(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),f={};for(let c of l)f[c.name]=c.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,c){try{if(!l){c(null,[]);return}let p=l.getAll(f).map(h=>({name:h.name,value:h.value,domain:h.domain,path:h.path,httpOnly:h.httpOnly,secure:h.secure}));c(null,p)}catch(p){c(p,[])}},get(f,c,p){try{if(!l){p(null,void 0);return}let h=l.get(c,f);p(null,h?{name:h.name,value:h.value,domain:h.domain}:void 0)}catch(h){p(h,void 0)}},set(f,c,p,h){try{if(!l){(h||p)?.(null);return}typeof c=="string"&&typeof p=="string"?(l.set({name:c,value:p,domain:f}),h?.(null)):typeof c=="object"&&(l.set({...c,domain:f}),p?.(null))}catch(g){(h||p)?.(g)}},unset(f,c,p){try{if(!l){p?.(null);return}l.delete(c,f),p?.(null)}catch(h){p?.(h)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(c){f?.(c)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},o=this;return{request:this.createRequestObject(r,e),response:null,test:Jm(this.assertions),expect:$u,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,f){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let h=typeof l=="string"?{url:l,method:"GET"}:l,g=await n.sendRequest(h),v=Array.isArray(g?.cookies)?g.cookies.filter(E=>E?.name):[],_=g?.body,w=0;if(typeof _=="string")w=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))w=_.length;else if(_!=null)try{w=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return id({executedRequest:null,status:g?.status??0,statusText:g?.statusText??"",headers:g?.headers??{},body:_,cookies:v,responseTime:g?.time,responseSize:w})})();if(typeof f=="function"){p.then(h=>f(null,h),h=>f(h));return}return p},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){o._nextRequest=l},visualizer:{set(l,f){o._visualizerData={template:l,data:f}},clear(){o._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,c]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return c},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,c]of Object.entries(e.headers))typeof c=="string"&&(l[f]=c);return l},each:l=>{for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&l({key:f,value:c})}},o={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 xz(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 o},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[c,p]of Object.entries(e.headers))typeof p=="string"&&(f[c]=p);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[c,p]of f)e.query||(e.query={}),e.query[c]=p}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 c=typeof f=="string"?f:f.key;c&&delete e.query[c]}))},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,c){e.body={type:f||e.body?.type||"raw",format:c||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[v,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(o[v]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,c=i.request;if(n.request={id:c?.id??"",name:c?.name??"",description:c?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:f},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!r)return;let p=r.body;n.responseBody=p==null?"":typeof p=="string"?p:JSON.stringify(p);let h=r.statusText||"";n.responseCode={code:r.status,name:h,detail:h},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(v=>({...v}));let g=this;n.tests=new Proxy({},{set(v,_,w){return g.assertions.push({name:String(_),passed:!!w,message:w?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=sd(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=j0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Aa(this.consoleMessages),f=this.initialContext.request.body,c=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Nu(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:c?this.modifiedRequest.body:void 0,params:Nu(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Nu(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),localVariables:this.ctx.variables.toLocalObject?.()??{},modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Aa(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=sd(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=id(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,o=j0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&o&&typeof o.then=="function"&&await o,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let f=Aa(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Aa(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});function mk(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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function gk(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Iz(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=mk(r[2],e),i=Oi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return gk(e[t]);if(eo(t)){let n=Xs(t,e),i=to(t,n);if(i!==void 0)return i}}function pk(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],o=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)o=ar.createHash("md5").update(Buffer.concat([o,i])).digest(),s.push(o);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function H0(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,o){let l=i instanceof We?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=ar.randomBytes(8),{key:c,iv:p}=pk(s,e,r,f),h=ar.createCipheriv(n(e),c,p),g=Buffer.concat([h.update(l),h.final()]),v=Buffer.concat([Buffer.from("Salted__"),f,g]);return{ciphertext:new We(g),salt:new We(f),toString:_=>_?_.stringify(new We(v)):v.toString("base64")}}else{let f=s.toBuffer(),c=o?.iv&&o.iv instanceof We?o.iv.toBuffer():Buffer.alloc(r),p=ar.createCipheriv(n(f.length),f,c);o?.padding===!1&&p.setAutoPadding(!1);let h=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new We(h),toString:g=>g?g.stringify(new We(h)):h.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,c;l.subarray(0,8).toString()==="Salted__"?(c=l.subarray(8,16),f=l.subarray(16)):(c=Buffer.alloc(0),f=l);let{key:p,iv:h}=pk(s,e,r,c),g=ar.createDecipheriv(n(e),p,h);return new We(Buffer.concat([g.update(f),g.final()]))}else{let l=s.toBuffer(),f=o?.iv&&o.iv instanceof We?o.iv.toBuffer():Buffer.alloc(r),c=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=ar.createDecipheriv(n(l.length),l,f);return o?.padding===!1&&p.setAutoPadding(!1),new We(Buffer.concat([p.update(c),p.final()]))}}}}function qz(){let t=r=>n=>{let i=n instanceof We?n.toBuffer():Buffer.from(String(n),"utf8");return new We(ar.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof We?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof We?i.toBuffer():Buffer.from(String(i),"utf8");return new We(ar.createHmac(r,o).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:H0("aes",32,16),DES:H0("des",8,8),TripleDES:H0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof We?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof We?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new We(ar.pbkdf2Sync(s,o,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>We.fromBase64(r)},Utf8:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>We.fromUtf8(r)},Hex:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>We.fromHex(r)},Latin1:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new We(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new We(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new We(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new We(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new We(r):new We(Buffer.from(String(r))):new We(Buffer.alloc(0)),random:r=>new We(ar.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var ar,Ez,hk,We,Ni,ad=se(()=>{"use strict";ar=me(require("crypto")),Ez=me(require("querystring")),hk=me(require("vm"));tm();nm();sm();D0();U0();zm();We=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"))}};Ni=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Wm(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Mu({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let o={ctx:e,hf:e,pm:e,console:r,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:ar,_:s("lodash"),require:s,moment:nd(),querystring:Ez,CryptoJS:qz(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let c of f)if(c?.name&&c.name.toLowerCase()===l.toLowerCase())return{...c}}return null}},jsonStringify:(l,f,c)=>JSON.stringify(l,f,c),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),c;return f.parseString(l,{explicitArray:!1},(p,h)=>{if(p)throw p;c=h}),c}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return hk.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,o,i,s,l),c=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),h=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),g={...h,set:(_,w)=>{let E=this.serializeValue(w);h.set(_,E),n[_]=E},unset(_){h.unset(_),delete n[_]},clear(){let _=Object.keys(o);h.clear();for(let w of _)delete n[w]}};return c.replaceIn=f.replaceIn,p.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,{globals:c,collectionVariables:p,variables:f,environment:g,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:$u,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,o)=>{r&&r(i,s,o)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let o=this.serializeValue(s);e[i]=o,n("set",i,o)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let o={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}},toLocalObject(){return{...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=o.toObject(),c=20,p=g=>g.replace(/\{\{([^}]+)\}\}/g,(v,_)=>{let w=_.trim(),E=w.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(E)try{let N=mk(E[2],f),$=Oi(E[1],N);return $!==null?String($):v}catch{return v}let k=hu(w);if(k){let N=Iz(k.input,f);if(N!==void 0){let $=mu(N,k.filters,f);return $!==void 0?String($):v}return v}let T=o.get(w);if(T!==void 0)return String(T);if(eo(w)){let N={};for(let[G,O]of Object.entries(f))N[G]=gk(O);let $=Xs(w,N),j=to(w,$);if(j!==void 0)return String(j)}return v}),h=l;for(let g=0;g<c;g++){let v=p(h);if(v===h)break;h=v}return h}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,f)=>{n&&(i?n(o,l,f):n(l||"",o==="set"?f:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let f=this.serializeValue(l);e[o]=f,s("set",o,f)},has(o){return o in e},unset(o){delete e[o],s("unset",o)},clear(){Object.keys(e).forEach(o=>delete e[o]),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 B0,po,Km=se(()=>{"use strict";B0={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"},po=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(o=>o.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=B0["x-www-form-urlencoded"];break;case"raw":s=r.format?B0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=B0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var mo,Qm=se(()=>{"use strict";mo=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 o=this.parseCsvLine(r[s]),l={};n.forEach((f,c)=>{l[f]=o[c]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=e[s+1];o==='"'?i&&l==='"'?(n+='"',s++):i=!i:o===","&&!i?(r.push(n.trim()),n=""):n+=o}return r.push(n.trim()),r}}});var Uu,kz,Hu,V0=se(()=>{"use strict";Uu=me(require("crypto")),kz=3e4,Hu=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 o=await this.secretStore.get(`oauth2_refresh_${n}`);if(o)try{return await this.refreshToken(e,o,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),o=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,o,n);let c=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),p=this.parseTokenResponse(c.body,e);p.refreshToken||(p.refreshToken=r);let h=this.buildCacheKeyString(e);return this.tokenCache.set(h,p),p.refreshToken&&await this.storeRefreshToken(h,p.refreshToken),p}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),o=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,c,p,h;if(f){c=this.generateCodeVerifier();let G=e.pkceMethod||"S256";p=G==="S256"?this.generateCodeChallengeS256(c):c,h=G}let g=e.state||Uu.randomBytes(16).toString("hex"),v=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",v),l&&_.searchParams.set("scope",l),_.searchParams.set("state",g),p&&(_.searchParams.set("code_challenge",p),_.searchParams.set("code_challenge_method",h)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[G,O]of Object.entries(e.extraParams))_.searchParams.set(G,this.resolve(O,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let w=new Promise((G,O)=>{this.pendingAuthCallback={resolve:G,reject:O,state:g}});await this.browserService.openExternal(_.toString());let E;try{E=await Promise.race([w,new Promise((G,O)=>setTimeout(()=>{this.pendingAuthCallback=null,O(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(E.state&&E.state!==g)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let k=new URLSearchParams;k.append("grant_type","authorization_code"),k.append("code",E.code),k.append("redirect_uri",v),c&&k.append("code_verifier",c);let T={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,T,k,s,o,r);let N=await this.httpService.execute({method:"POST",url:i,headers:T,body:k.toString()}),$=this.parseTokenResponse(N.body,e),j=this.buildCacheKeyString(e);return this.tokenCache.set(j,$),$.refreshToken&&await this.storeRefreshToken(j,$.refreshToken),$}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 o=e.state||Uu.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",o),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[v,_]of Object.entries(e.extraParams))f.searchParams.set(v,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let c=new Promise((v,_)=>{this.pendingImplicitCallback={resolve:v,reject:_,state:o}});await this.browserService.openExternal(f.toString());let p;try{p=await Promise.race([c,new Promise((v,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(p.state&&p.state!==o)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let h={accessToken:p.accessToken,tokenType:p.tokenType||e.tokenPrefix||"Bearer",expiresAt:p.expiresIn?Date.now()+p.expiresIn*1e3:void 0,raw:{access_token:p.accessToken,token_type:p.tokenType,expires_in:p.expiresIn}},g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h}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),o=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 h=this.resolve(e.username||"",r),g=this.resolve(e.password||"",r);if(!h)throw new Error("OAuth2 password grant requires username");f.append("username",h),f.append("password",g)}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[h,g]of Object.entries(e.extraParams))f.append(h,this.resolve(g,r));let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,f,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:c,body:f.toString()});return this.parseTokenResponse(p.body,e)}applyClientAuth(e,r,n,i,s,o){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=r.tokenField||"access_token",o=i[s];if(!o)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:o,tokenType:i.token_type||r.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-kz:!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 Uu.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Uu.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});function Ma(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Na.writeFileSync(t,r.join(`
|
|
50
|
+
`)}function Nu(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Aa(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 dk(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 Jm(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let o=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(o)}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 Gm(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function Ym(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=dt.parseCookieHeaders(t||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var od=se(()=>{"use strict";ba()});function xz(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 j0,Mu,U0=se(()=>{"use strict";j0=me(require("vm"));fk();zm();od();Mu=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=ck(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),f={};for(let c of l)f[c.name]=c.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,c){try{if(!l){c(null,[]);return}let p=l.getAll(f).map(h=>({name:h.name,value:h.value,domain:h.domain,path:h.path,httpOnly:h.httpOnly,secure:h.secure}));c(null,p)}catch(p){c(p,[])}},get(f,c,p){try{if(!l){p(null,void 0);return}let h=l.get(c,f);p(null,h?{name:h.name,value:h.value,domain:h.domain}:void 0)}catch(h){p(h,void 0)}},set(f,c,p,h){try{if(!l){(h||p)?.(null);return}typeof c=="string"&&typeof p=="string"?(l.set({name:c,value:p,domain:f}),h?.(null)):typeof c=="object"&&(l.set({...c,domain:f}),p?.(null))}catch(g){(h||p)?.(g)}},unset(f,c,p){try{if(!l){p?.(null);return}l.delete(c,f),p?.(null)}catch(h){p?.(h)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(c){f?.(c)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},o=this;return{request:this.createRequestObject(r,e),response:null,test:Jm(this.assertions),expect:$u,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,f){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let h=typeof l=="string"?{url:l,method:"GET"}:l,g=await n.sendRequest(h),v=Array.isArray(g?.cookies)?g.cookies.filter(E=>E?.name):[],_=g?.body,w=0;if(typeof _=="string")w=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))w=_.length;else if(_!=null)try{w=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return id({executedRequest:null,status:g?.status??0,statusText:g?.statusText??"",headers:g?.headers??{},body:_,cookies:v,responseTime:g?.time,responseSize:w})})();if(typeof f=="function"){p.then(h=>f(null,h),h=>f(h));return}return p},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){o._nextRequest=l},visualizer:{set(l,f){o._visualizerData={template:l,data:f}},clear(){o._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,c]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return c},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,c]of Object.entries(e.headers))typeof c=="string"&&(l[f]=c);return l},each:l=>{for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&l({key:f,value:c})}},o={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 xz(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 o},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[c,p]of Object.entries(e.headers))typeof p=="string"&&(f[c]=p);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[c,p]of f)e.query||(e.query={}),e.query[c]=p}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 c=typeof f=="string"?f:f.key;c&&delete e.query[c]}))},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,c){e.body={type:f||e.body?.type||"raw",format:c||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[v,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(o[v]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,c=i.request;if(n.request={id:c?.id??"",name:c?.name??"",description:c?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:f},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!r)return;let p=r.body;n.responseBody=p==null?"":typeof p=="string"?p:JSON.stringify(p);let h=r.statusText||"";n.responseCode={code:r.status,name:h,detail:h},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(v=>({...v}));let g=this;n.tests=new Proxy({},{set(v,_,w){return g.assertions.push({name:String(_),passed:!!w,message:w?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=sd(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=j0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Aa(this.consoleMessages),f=this.initialContext.request.body,c=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Nu(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:c?this.modifiedRequest.body:void 0,params:Nu(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Nu(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),localVariables:this.ctx.variables.toLocalObject?.()??{},modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Aa(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=sd(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=id(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,o=j0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&o&&typeof o.then=="function"&&await o,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let f=Aa(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Aa(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});function mk(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],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function gk(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Iz(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=mk(r[2],e),i=qi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return gk(e[t]);if(eo(t)){let n=Xs(t,e),i=to(t,n);if(i!==void 0)return i}}function pk(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],o=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)o=ar.createHash("md5").update(Buffer.concat([o,i])).digest(),s.push(o);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function H0(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,o){let l=i instanceof We?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=ar.randomBytes(8),{key:c,iv:p}=pk(s,e,r,f),h=ar.createCipheriv(n(e),c,p),g=Buffer.concat([h.update(l),h.final()]),v=Buffer.concat([Buffer.from("Salted__"),f,g]);return{ciphertext:new We(g),salt:new We(f),toString:_=>_?_.stringify(new We(v)):v.toString("base64")}}else{let f=s.toBuffer(),c=o?.iv&&o.iv instanceof We?o.iv.toBuffer():Buffer.alloc(r),p=ar.createCipheriv(n(f.length),f,c);o?.padding===!1&&p.setAutoPadding(!1);let h=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new We(h),toString:g=>g?g.stringify(new We(h)):h.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,c;l.subarray(0,8).toString()==="Salted__"?(c=l.subarray(8,16),f=l.subarray(16)):(c=Buffer.alloc(0),f=l);let{key:p,iv:h}=pk(s,e,r,c),g=ar.createDecipheriv(n(e),p,h);return new We(Buffer.concat([g.update(f),g.final()]))}else{let l=s.toBuffer(),f=o?.iv&&o.iv instanceof We?o.iv.toBuffer():Buffer.alloc(r),c=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=ar.createDecipheriv(n(l.length),l,f);return o?.padding===!1&&p.setAutoPadding(!1),new We(Buffer.concat([p.update(c),p.final()]))}}}}function Oz(){let t=r=>n=>{let i=n instanceof We?n.toBuffer():Buffer.from(String(n),"utf8");return new We(ar.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof We?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof We?i.toBuffer():Buffer.from(String(i),"utf8");return new We(ar.createHmac(r,o).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:H0("aes",32,16),DES:H0("des",8,8),TripleDES:H0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof We?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof We?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new We(ar.pbkdf2Sync(s,o,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>We.fromBase64(r)},Utf8:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>We.fromUtf8(r)},Hex:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>We.fromHex(r)},Latin1:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new We(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new We(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof We?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new We(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new We(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new We(r):new We(Buffer.from(String(r))):new We(Buffer.alloc(0)),random:r=>new We(ar.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var ar,Ez,hk,We,Ni,ad=se(()=>{"use strict";ar=me(require("crypto")),Ez=me(require("querystring")),hk=me(require("vm"));tm();nm();sm();D0();U0();zm();We=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"))}};Ni=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Wm(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Mu({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let o={ctx:e,hf:e,pm:e,console:r,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:ar,_:s("lodash"),require:s,moment:nd(),querystring:Ez,CryptoJS:Oz(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let c of f)if(c?.name&&c.name.toLowerCase()===l.toLowerCase())return{...c}}return null}},jsonStringify:(l,f,c)=>JSON.stringify(l,f,c),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),c;return f.parseString(l,{explicitArray:!1},(p,h)=>{if(p)throw p;c=h}),c}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return hk.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,o,i,s,l),c=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),h=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),g={...h,set:(_,w)=>{let E=this.serializeValue(w);h.set(_,E),n[_]=E},unset(_){h.unset(_),delete n[_]},clear(){let _=Object.keys(o);h.clear();for(let w of _)delete n[w]}};return c.replaceIn=f.replaceIn,p.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,{globals:c,collectionVariables:p,variables:f,environment:g,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:$u,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,o)=>{r&&r(i,s,o)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let o=this.serializeValue(s);e[i]=o,n("set",i,o)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let o={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}},toLocalObject(){return{...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let f=o.toObject(),c=20,p=g=>g.replace(/\{\{([^}]+)\}\}/g,(v,_)=>{let w=_.trim(),E=w.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(E)try{let N=mk(E[2],f),$=qi(E[1],N);return $!==null?String($):v}catch{return v}let k=hu(w);if(k){let N=Iz(k.input,f);if(N!==void 0){let $=mu(N,k.filters,f);return $!==void 0?String($):v}return v}let T=o.get(w);if(T!==void 0)return String(T);if(eo(w)){let N={};for(let[G,q]of Object.entries(f))N[G]=gk(q);let $=Xs(w,N),j=to(w,$);if(j!==void 0)return String(j)}return v}),h=l;for(let g=0;g<c;g++){let v=p(h);if(v===h)break;h=v}return h}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,f)=>{n&&(i?n(o,l,f):n(l||"",o==="set"?f:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let f=this.serializeValue(l);e[o]=f,s("set",o,f)},has(o){return o in e},unset(o){delete e[o],s("unset",o)},clear(){Object.keys(e).forEach(o=>delete e[o]),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 B0,po,Km=se(()=>{"use strict";B0={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"},po=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(o=>o.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=B0["x-www-form-urlencoded"];break;case"raw":s=r.format?B0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=B0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var mo,Qm=se(()=>{"use strict";mo=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 o=this.parseCsvLine(r[s]),l={};n.forEach((f,c)=>{l[f]=o[c]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=e[s+1];o==='"'?i&&l==='"'?(n+='"',s++):i=!i:o===","&&!i?(r.push(n.trim()),n=""):n+=o}return r.push(n.trim()),r}}});var Uu,kz,Hu,V0=se(()=>{"use strict";Uu=me(require("crypto")),kz=3e4,Hu=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 o=await this.secretStore.get(`oauth2_refresh_${n}`);if(o)try{return await this.refreshToken(e,o,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),o=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,o,n);let c=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),p=this.parseTokenResponse(c.body,e);p.refreshToken||(p.refreshToken=r);let h=this.buildCacheKeyString(e);return this.tokenCache.set(h,p),p.refreshToken&&await this.storeRefreshToken(h,p.refreshToken),p}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),o=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,c,p,h;if(f){c=this.generateCodeVerifier();let G=e.pkceMethod||"S256";p=G==="S256"?this.generateCodeChallengeS256(c):c,h=G}let g=e.state||Uu.randomBytes(16).toString("hex"),v=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",v),l&&_.searchParams.set("scope",l),_.searchParams.set("state",g),p&&(_.searchParams.set("code_challenge",p),_.searchParams.set("code_challenge_method",h)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[G,q]of Object.entries(e.extraParams))_.searchParams.set(G,this.resolve(q,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let w=new Promise((G,q)=>{this.pendingAuthCallback={resolve:G,reject:q,state:g}});await this.browserService.openExternal(_.toString());let E;try{E=await Promise.race([w,new Promise((G,q)=>setTimeout(()=>{this.pendingAuthCallback=null,q(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(E.state&&E.state!==g)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let k=new URLSearchParams;k.append("grant_type","authorization_code"),k.append("code",E.code),k.append("redirect_uri",v),c&&k.append("code_verifier",c);let T={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,T,k,s,o,r);let N=await this.httpService.execute({method:"POST",url:i,headers:T,body:k.toString()}),$=this.parseTokenResponse(N.body,e),j=this.buildCacheKeyString(e);return this.tokenCache.set(j,$),$.refreshToken&&await this.storeRefreshToken(j,$.refreshToken),$}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 o=e.state||Uu.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",o),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[v,_]of Object.entries(e.extraParams))f.searchParams.set(v,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let c=new Promise((v,_)=>{this.pendingImplicitCallback={resolve:v,reject:_,state:o}});await this.browserService.openExternal(f.toString());let p;try{p=await Promise.race([c,new Promise((v,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(p.state&&p.state!==o)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let h={accessToken:p.accessToken,tokenType:p.tokenType||e.tokenPrefix||"Bearer",expiresAt:p.expiresIn?Date.now()+p.expiresIn*1e3:void 0,raw:{access_token:p.accessToken,token_type:p.tokenType,expires_in:p.expiresIn}},g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h}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),o=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 h=this.resolve(e.username||"",r),g=this.resolve(e.password||"",r);if(!h)throw new Error("OAuth2 password grant requires username");f.append("username",h),f.append("password",g)}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[h,g]of Object.entries(e.extraParams))f.append(h,this.resolve(g,r));let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,f,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:c,body:f.toString()});return this.parseTokenResponse(p.body,e)}applyClientAuth(e,r,n,i,s,o){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=r.tokenField||"access_token",o=i[s];if(!o)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:o,tokenType:i.token_type||r.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-kz:!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 Uu.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Uu.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});function Ma(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Na.writeFileSync(t,r.join(`
|
|
51
51
|
`),"utf-8")}function Bu(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&Na.writeFileSync(go.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&Na.writeFileSync(go.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function yk(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return go.isAbsolute(n)?n:go.join(t,n)}async function vk(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function ld(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=go.join(e,Tt(n.name));Na.mkdirSync(i,{recursive:!0}),Bu(i,Tt(n.name),n.scripts),ld(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=Tt(i.name)+".http",o=go.join(e,s),l=Pz(i,r);Na.writeFileSync(o,l,"utf-8"),Bu(e,Tt(i.name),i.scripts)}})}function Pz(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${Tt(e.name)}.env`),r.push(`# request scripts: ${Tt(t.name)}.pre.js and .post.js`);let n=Tz(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
|
|
52
|
-
`)}function Tz(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 Na,go,Xm=se(()=>{"use strict";Na=me(require("fs")),go=me(require("path"));En()});var yr,W0,Fa,z0=se(()=>{"use strict";yr=me(require("fs")),W0=me(require("path"));En();Fa=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){yr.existsSync(this.collectionsDir)||yr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!yr.existsSync(this.collectionsDir))return[];let e=yr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=W0.join(this.collectionsDir,n),s=yr.readFileSync(i,"utf-8"),o=JSON.parse(s);o.id&&o.name&&(this.cache.set(o.id,o),r.push(o))}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(yr.existsSync(r))try{let n=yr.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=vt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await yr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!yr.existsSync(r))return!1;try{return await yr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return yr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return W0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||vt(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 o=this.findItemById(i.items,n);if(o&&o.type==="folder")o.items=o.items||[],o.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:o,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 o={...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(o);else return i.items.push(o),!1}else i.items.push(o);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 o=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let c=o.get(f);c&&(l.push(c),o.delete(f))}for(let f of o.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 Vu,J0=se(()=>{"use strict";Zh();z0();Vu=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new cs(n):new Fa(n)}static createForFormat(e,r){return e==="folder"?new cs(r):new Fa(r)}}});function bk(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 Az(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=>Sk(e)),event:G0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function Sk(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(Sk):[],event:G0(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($z),url:Nz(e),body:Mz(e),auth:Fz(e.auth),description:e.description},event:G0(e.scripts),protocolProfileBehavior:Dz(e.settings)}}}function $z(t){return{key:t.key,value:t.value,disabled:t.enabled===!1,...t.description!==void 0?{description:t.description}:{},...t.type!==void 0?{type:t.type}:{},...t.required!==void 0?{required:t.required}:{},...t.format!==void 0?{format:t.format}:{},...t.enum!==void 0?{enum:t.enum}:{},...t.deprecated!==void 0?{deprecated:t.deprecated}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.minLength!==void 0?{minLength:t.minLength}:{},...t.maxLength!==void 0?{maxLength:t.maxLength}:{},...t.minimum!==void 0?{minimum:t.minimum}:{},...t.maximum!==void 0?{maximum:t.maximum}:{},...t.exclusiveMinimum!==void 0?{exclusiveMinimum:t.exclusiveMinimum}:{},...t.exclusiveMaximum!==void 0?{exclusiveMaximum:t.exclusiveMaximum}:{},...t.multipleOf!==void 0?{multipleOf:t.multipleOf}:{},...t.minItems!==void 0?{minItems:t.minItems}:{},...t.maxItems!==void 0?{maxItems:t.maxItems}:{},...t.uniqueItems!==void 0?{uniqueItems:t.uniqueItems}:{},...t.nullable!==void 0?{nullable:t.nullable}:{},...t.oneOf!==void 0?{oneOf:t.oneOf}:{}}}function Nz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let c=i[1];/^{{.*}}$/.test(c)?n=[c]:n=c.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let c=o[1].replace(/^\//,"");c.endsWith("/")?(s=c.slice(0,-1).split("/"),s.push("")):s=c.length>0?c.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(c=>{let p={key:c.key,value:c.value};return c.enabled===!1&&(p.enabled=!1),c.description!==void 0&&(p.description=c.description),c.type!==void 0&&(p.type=c.type),c.required!==void 0&&(p.required=c.required),c.format!==void 0&&(p.format=c.format),c.enum!==void 0&&(p.enum=c.enum),c.deprecated!==void 0&&(p.deprecated=c.deprecated),c.pattern!==void 0&&(p.pattern=c.pattern),c.minLength!==void 0&&(p.minLength=c.minLength),c.maxLength!==void 0&&(p.maxLength=c.maxLength),c.minimum!==void 0&&(p.minimum=c.minimum),c.maximum!==void 0&&(p.maximum=c.maximum),c.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=c.exclusiveMinimum),c.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=c.exclusiveMaximum),c.multipleOf!==void 0&&(p.multipleOf=c.multipleOf),c.minItems!==void 0&&(p.minItems=c.minItems),c.maxItems!==void 0&&(p.maxItems=c.maxItems),c.uniqueItems!==void 0&&(p.uniqueItems=c.uniqueItems),c.nullable!==void 0&&(p.nullable=c.nullable),c.oneOf!==void 0&&(p.oneOf=c.oneOf),p});else{let c=r.indexOf("?");c!==-1&&(l=r.substring(c+1).split("&").map(h=>{let[g,...v]=h.split("=");return{key:g,value:v.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([c,p])=>({key:c,value:String(p)}))),{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 Mz(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=bk(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||bk(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??"",o=i.variables;return{mode:"graphql",graphql:{query:s,variables:o?typeof o=="string"?o:JSON.stringify(o):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function Fz(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 Dz(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 G0(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 qt,ni,Wu,Y0=se(()=>{"use strict";En();Xm();J0();qt=me(require("fs")),ni=me(require("path"));Wu=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Vu.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){qt.existsSync(this.collectionsDir)||qt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null;let r=this.selfWritePending;this.selfWritePending=!1,r||this.loadCollections(),this.onCollectionsChanged?.()},300)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=vt(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,n);if(s){let o=this.findItemRecursive(i.items,r);if(o){let{id:l,type:f,...c}=n;Object.assign(o,c)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=vt(r.name)),this.selfWritePending=!0;try{return await this.loader.saveItem(e,r,n),!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(o=>o.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:vt(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=vt(r),s=this.loader.getCollectionPath(e),o=ni.join(this.collectionsDir,i);if(!qt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=ni.join(o,"collection.json");if(qt.existsSync(l)){let c=JSON.parse(qt.readFileSync(l,"utf-8"));c.id=i,c.name=r,qt.writeFileSync(l,JSON.stringify(c,null,2))}else qt.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");this.selfWritePending=!0;let n={id:vt(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;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.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||!qt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=ni.dirname(s),l=vt(n),f=ni.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let c=ni.join(f,"folder.json");if(qt.existsSync(c)){let g=JSON.parse(qt.readFileSync(c,"utf-8"));g.id=l,g.name=n,qt.writeFileSync(c,JSON.stringify(g,null,2))}else qt.writeFileSync(c,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),h=p?this.findItemById(p.items,l):void 0;return h||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||vt(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;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}getRequestScript(e,r,n){let i=this.collections.get(e);if(!i)return;let s=this.findItemById(i.items,r);if(!s||s.type!=="request")return;let o=s;return n==="pre-request"?o.scripts?.preRequest:o.scripts?.postResponse}async setRequestScript(e,r,n,i){let s=this.collections.get(e);if(!s)return!1;let o=this.findItemById(s.items,r);if(!o||o.type!=="request")return!1;let l=o,c={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=c,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,c),!0}catch{return!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}}}copyDirRecursive(e,r){qt.existsSync(r)||qt.mkdirSync(r,{recursive:!0});for(let n of qt.readdirSync(e,{withFileTypes:!0})){let i=ni.join(e,n.name),s=ni.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):qt.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=qt.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||vt(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=p=>{if(!p)return;switch(p.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:p.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let v=p.basic?.find(T=>T.key==="username"),_=p.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:v?.value||"",password:_?.value||""}};case"apikey":let w=p.apikey?.find(T=>T.key==="key"),E=p.apikey?.find(T=>T.key==="value"),k=p.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:w?.value||"",value:E?.value||"",in:k?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let h={};for(let g of p){let v=g.script?.exec;if(!v)continue;let _=Array.isArray(v)?v.join(`
|
|
53
|
-
`):v;g.listen==="prerequest"?h.preRequest=_:g.listen==="test"&&(h.postResponse=_)}return h.preRequest||h.postResponse?h:void 0},i=p=>{if(!p||typeof p!="object")return;let h={};return p.followRedirects===!1&&(h.followRedirects=!1),p.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),p.maxRedirects!==void 0&&(h.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(h.timeout=p.requestTimeout),Object.keys(h).length>0?h:void 0},s=p=>{if(!p||typeof p=="string")return;let h=p.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0,...g.description!==void 0?{description:g.description}:{},...g.type!==void 0?{type:g.type}:{},...g.required!==void 0?{required:g.required}:{},...g.format!==void 0?{format:g.format}:{},...g.enum!==void 0?{enum:g.enum}:{},...g.deprecated!==void 0?{deprecated:g.deprecated}:{},...g.pattern!==void 0?{pattern:g.pattern}:{},...g.minLength!==void 0?{minLength:g.minLength}:{},...g.maxLength!==void 0?{maxLength:g.maxLength}:{},...g.minimum!==void 0?{minimum:g.minimum}:{},...g.maximum!==void 0?{maximum:g.maximum}:{},...g.exclusiveMinimum!==void 0?{exclusiveMinimum:g.exclusiveMinimum}:{},...g.exclusiveMaximum!==void 0?{exclusiveMaximum:g.exclusiveMaximum}:{},...g.multipleOf!==void 0?{multipleOf:g.multipleOf}:{},...g.minItems!==void 0?{minItems:g.minItems}:{},...g.maxItems!==void 0?{maxItems:g.maxItems}:{},...g.uniqueItems!==void 0?{uniqueItems:g.uniqueItems}:{},...g.nullable!==void 0?{nullable:g.nullable}:{},...g.oneOf!==void 0?{oneOf:g.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let h=new Set;if(Array.isArray(p.variable))for(let v of p.variable)v.key&&h.add(v.key);if(h.size===0&&p.raw)return p.raw;let g="";if(p.protocol&&(g+=p.protocol+"://"),p.host&&(g+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(g+=":"+p.port),p.path){let _=(Array.isArray(p.path)?p.path:[p.path]).map(w=>{let E=w.startsWith(":")?w.substring(1):w;return h.has(E)?":"+E:(w.startsWith(":"),w)});g+="/"+_.join("/")}return!g&&p.raw?p.raw:g},l=p=>{if(!Array.isArray(p)||p.length===0)return;let h={responses:{}};for(let g of p){let v=String(g.code||200),_,w={};if(Array.isArray(g.header))for(let $ of g.header)!$.key||$.disabled||($.key.toLowerCase()==="content-type"?_=$.value?.split(";")[0]?.trim():w[$.key]={description:String($.value??""),schema:{type:"string"}});let E=g.body;if(typeof g.body=="string"&&g.body)try{E=JSON.parse(g.body)}catch{}let k=g.originalRequest,T;if(k){let $=typeof k.url=="string"?k.url:k.url?.raw??"";T=`${k.method||""} ${$}`.trim()||void 0}let N=g.name?g.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${v}`:`example_${v}`;if(h.responses[v]){let $=h.responses[v];$.examples=$.examples??{},$.examples[N]={summary:T,value:E}}else h.responses[v]={description:g.name,contentType:_,examples:{[N]:{summary:T,value:E}},...Object.keys(w).length>0?{headers:w}:{}}}return Object.keys(h.responses).length>0?h:void 0},f=p=>p.map(h=>{if(h.item)return{id:vt(h.name),type:"folder",name:h.name,description:h.description,auth:r(h.auth),scripts:n(h.event),items:f(h.item)};{let g=h.request||{};return{id:vt(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:o(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(v=>({key:v.key||v.name||"",value:v.value||v.value||"",enabled:v.disabled!==!0,...v.description!==void 0?{description:v.description}:{},...v.type!==void 0?{type:v.type}:{},...v.required!==void 0?{required:v.required}:{},...v.format!==void 0?{format:v.format}:{},...v.enum!==void 0?{enum:v.enum}:{},...v.deprecated!==void 0?{deprecated:v.deprecated}:{},...v.pattern!==void 0?{pattern:v.pattern}:{},...v.minLength!==void 0?{minLength:v.minLength}:{},...v.maxLength!==void 0?{maxLength:v.maxLength}:{},...v.minimum!==void 0?{minimum:v.minimum}:{},...v.maximum!==void 0?{maximum:v.maximum}:{},...v.exclusiveMinimum!==void 0?{exclusiveMinimum:v.exclusiveMinimum}:{},...v.exclusiveMaximum!==void 0?{exclusiveMaximum:v.exclusiveMaximum}:{},...v.multipleOf!==void 0?{multipleOf:v.multipleOf}:{},...v.minItems!==void 0?{minItems:v.minItems}:{},...v.maxItems!==void 0?{maxItems:v.maxItems}:{},...v.uniqueItems!==void 0?{uniqueItems:v.uniqueItems}:{},...v.nullable!==void 0?{nullable:v.nullable}:{},...v.oneOf!==void 0?{oneOf:v.oneOf}:{}})):[],body:(()=>{let v=g.body;if(v){if(v.mode==="raw"&&v.raw){let _=v.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:v.raw}}if(v.mode==="urlencoded"&&Array.isArray(v.urlencoded))return{type:"x-www-form-urlencoded",content:v.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(v.mode==="formdata"&&Array.isArray(v.formdata))return{type:"form-data",content:v.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(v.mode==="graphql"&&v.graphql){let _;if(v.graphql.variables)try{_=JSON.parse(v.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:v.graphql.query||"",variables:_}}}if(v.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior),responseSchema:l(h.response)}}}),c={id:vt(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),variables:Array.isArray(e.variable)?Object.fromEntries(e.variable.filter(p=>p&&p.key).map(p=>[p.key,String(p.value??"")])):typeof e.variable=="object"&&e.variable!==null?Object.fromEntries(Object.entries(e.variable).map(([p,h])=>[p,String(h??"")])):void 0,items:f(e.item||[])};return await this.saveCollection(c),c}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Az(n),s=JSON.stringify(i,null,2);qt.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=ni.join(r,Tt(n.name));qt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Ma(ni.join(i,`${Tt(n.name)}.env`),s),Bu(i,Tt(n.name),n.scripts),ld(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Bt,Da,yo,K0=se(()=>{"use strict";Bt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:500,toolMode:"auto",drilldownThreshold:100,toolPageSize:200,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},Da={config:"http-forge.config.json"},yo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});var Jr,An,La,Q0=se(()=>{"use strict";Jr=me(require("fs")),An=me(require("path"));K0();La=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=An.join(e,Da.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Jr.existsSync(this.configPath))return{...Bt};try{let e=Jr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${Da.config}. Using default configuration.`),{...Bt}}}mergeWithDefaults(e){return{version:e.version??Bt.version,storage:{...Bt.storage,...e.storage},request:{...Bt.request,...e.request},scripts:{...Bt.scripts,...e.scripts},runner:{...Bt.runner,...e.runner},environments:{...Bt.environments,...e.environments},restClientExport:{...Bt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Bt.proxy,mcp:{...Bt.mcp,...e.mcp,cors:{...Bt.mcp.cors,...e.mcp?.cors}},secrets:{...Bt.secrets,...e.secrets,providers:{...Bt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,Da.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 An.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){let e=this.config.mcp??Bt.mcp;return{...e,toolMode:["flat","drilldown","auto"].includes(e.toolMode)?e.toolMode:"auto",drilldownThreshold:Math.min(500,Math.max(10,e.drilldownThreshold??100)),toolPageSize:e.toolPageSize===0?0:Math.min(1e3,Math.max(10,e.toolPageSize??200)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return An.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return An.join(this.getRootPath(),yo.collections)}getEnvironmentsPath(){return An.join(this.getRootPath(),yo.environments)}getFlowsPath(){return An.join(this.getRootPath(),yo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return An.join(this.getRootPath(),yo.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Jr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Bt,null,2);await Jr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Jr.existsSync(i)||await Jr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Jr.existsSync(i)||await Jr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Jr.promises.writeFile(An.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Jr.promises.writeFile(An.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Jr.promises.writeFile(An.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var Lz,zu,Z0=se(()=>{"use strict";ba();Lz="httpForge.cookies",zu=class{constructor(e,r=Lz){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),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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 Ju,X0=se(()=>{"use strict";ba();Ju=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 o=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));o>=0?this.localCache[o]=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 ud(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,c=typeof l.enabled=="boolean"?l.enabled:!0;f&&c!==!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 o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function wk(t,e){try{let r=await e.readFile(t);return ud(r)}catch{return null}}var e_=se(()=>{"use strict"});var Kt,dn,cd,Gu,t_=se(()=>{"use strict";Kt=me(require("fs")),dn=me(require("path"));En();e_();Xm();em();_f();cd={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Gu=class{constructor(e,r,n,i,s,o=!0){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;this.persistOverrides=o;let l=n.getEnvironmentsPath();this.environmentsPath=l,this.sharedConfigPath=dn.join(l,"_global.json"),this.localConfigPath=dn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(cd.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.persistOverrides&&this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;persistOverrides;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Kt.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(!Kt.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(cd.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`${cd.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){if(!this.persistOverrides)return;let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore?.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore?.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.getLocalConfig()?.variables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],o=i?.credentials?.[r],l=i?.variables||{},f=o?.variables||{},c=o&&o.headers||{},p=ou(n.defaultHeaders||{},c),h=this.localEnvironmentValues.get(r)||{},g=this.secretValuesCache.get(r)||{},v={...s.variables||{},...f,...h,...g};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:v}}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 o=await this.secretStore.get(`${r}:${s}`);o!==void 0&&(i[s]=o)})),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 o=dn.join(e,"globals.env");Ma(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let c=dn.join(e,`${Tt(o)}.env`);Ma(c,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 dn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Kt.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),o={variables:i.variables||{}};this.saveJsonFile(s,o)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Kt.readFileSync(e,"utf-8"),n=ud(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 dn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=fu(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||{}},o=this.getGlobalVariables();return new ro({globals:o,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Kt.existsSync(this.environmentsPath)||Kt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Kt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Sf(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=dn.basename(s,".json");if(!i.has(o))try{Kt.unlinkSync(dn.join(this.environmentsPath,s))}catch{}}for(let[s,o]of Object.entries(e.environments||{})){let l={name:s,description:o.description,requiresConfirmation:o.requiresConfirmation,variables:o.variables||{}};this.saveJsonFile(dn.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(cd.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(cd.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(!Kt.existsSync(e))return null;let r=Kt.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=dn.dirname(e);Kt.existsSync(n)||Kt.mkdirSync(n,{recursive:!0}),Kt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var gs,eg=se(()=>{"use strict";od();gs=class t{constructor(e,r,n,i,s,o,l,f,c,p,h,g,v){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=c;this.collectionName=p;this.collectionAuth=h;this.iteration=g;this.iterationCount=v}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;collectionAuth;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),o=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let f=this.envConfigService.getGlobalVariables(),c={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...f},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setEnvironmentVariable(v,_,this.environment):g==="unset"&&v?this.envConfigService.deleteEnvironmentVariable(v,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setGlobalVariable(v,_):g==="unset"&&v?this.envConfigService.deleteGlobalVariable(v):g==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(c),h=null;try{let g={...r},v={...e},_;if((!v.auth||v.auth.type==="inherit")&&(v.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let F=await p.executePreRequest(s);if(F.consoleOutput&&F.consoleOutput.length>0&&this.onConsoleOutput?.(F.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),F.nextRequest!==void 0&&(_=F.nextRequest),F.skipRequest){let K={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:K,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:_}}F.success&&(F.modifiedRequest&&(F.modifiedRequest.url&&(v.url=F.modifiedRequest.url),F.modifiedRequest.headers&&(v.headers=F.modifiedRequest.headers),F.modifiedRequest.params&&(v.params=F.modifiedRequest.params),F.modifiedRequest.query&&(v.query=F.modifiedRequest.query),F.modifiedRequest.body!==void 0&&(v.body=F.modifiedRequest.body)),(F.localVariables??F.modifiedVariables)&&(g=F.localVariables??F.modifiedVariables))}h=await this.requestPreparer.prepareRequest(v,this.environment,l,g);let{url:w,headers:E,body:k,method:T}=h,N={};for(let F in E)Object.prototype.hasOwnProperty.call(E,F)&&(N[F.toUpperCase()]=E[F]);if(!N.COOKIE&&v.settings?.includeCookies!==!1&&this.cookieJar){let K=this.cookieJar.getCookieHeader(w);K&&(N.COOKIE=K)}let $={method:T,url:w,headers:N,body:k.content,signal:n,settings:v.settings?{timeout:v.settings.timeout,followRedirects:v.settings.followRedirects,maxRedirects:v.settings.maxRedirects,strictSSL:v.settings.strictSSL}:void 0},j=await this.httpService.execute($);this.cookieJar&&j.headers&&await this.cookieJar.setCookiesFromResponse(w,j.headers);let G=Date.now()-i,O=[],C={},A;if(o.length>0){let F=0;if(j.body)if(typeof j.body=="string")F=Buffer.byteLength(j.body,"utf8");else if(Buffer.isBuffer(j.body))F=j.body.length;else try{F=Buffer.byteLength(JSON.stringify(j.body),"utf8")}catch{F=0}let K=Ym(j.headers,j.cookies,h.url),ee={executedRequest:h,status:j.status,statusText:j.statusText,headers:Gm(j.headers||{}),body:j.body,cookies:K,responseTime:j.time,responseSize:F},ie=await p.executePostResponse(o,ee);O=ie.testResults,C=ie.modifiedEnvironmentVariables||{},A=ie.visualizerData,ie.nextRequest!==void 0&&(_=ie.nextRequest),ie.consoleOutput&&ie.consoleOutput.length>0&&this.onConsoleOutput?.(ie.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let D=O.length===0||O.every(F=>F.passed),B=O.length>0?D:j.status>=200&&j.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...h,headers:N},response:{status:j.status,statusText:j.statusText,headers:j.headers||{},body:j.body,time:j.time||G,cookies:j.cookies||[]},duration:G,timestamp:Date.now(),passed:B,assertions:O,modifiedVariables:g,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:A}}catch(g){return this.handleError(e,h,g,i)}finally{p.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,o=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`${n.message||n}`],{requestName:e.name||"",phase:"error"});let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),c=n?.stack?String(n.stack):"",p=this.errorBodyFormat,h,g;p==="html"||p==="both"?(h=t.formatErrorAsHtml(f,c),g={"content-type":"text/html; charset=utf-8"}):(h=f,g={});let v={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||v,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:g,cookies:[],body:h,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>
|
|
52
|
+
`)}function Tz(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 Na,go,Xm=se(()=>{"use strict";Na=me(require("fs")),go=me(require("path"));En()});var yr,W0,Fa,z0=se(()=>{"use strict";yr=me(require("fs")),W0=me(require("path"));En();Fa=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){yr.existsSync(this.collectionsDir)||yr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!yr.existsSync(this.collectionsDir))return[];let e=yr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=W0.join(this.collectionsDir,n),s=yr.readFileSync(i,"utf-8"),o=JSON.parse(s);o.id&&o.name&&(this.cache.set(o.id,o),r.push(o))}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(yr.existsSync(r))try{let n=yr.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=vt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await yr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!yr.existsSync(r))return!1;try{return await yr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return yr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return W0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||vt(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 o=this.findItemById(i.items,n);if(o&&o.type==="folder")o.items=o.items||[],o.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:o,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 o={...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(o);else return i.items.push(o),!1}else i.items.push(o);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 o=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let c=o.get(f);c&&(l.push(c),o.delete(f))}for(let f of o.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 Vu,J0=se(()=>{"use strict";Zh();z0();Vu=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new cs(n):new Fa(n)}static createForFormat(e,r){return e==="folder"?new cs(r):new Fa(r)}}});function bk(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 Az(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=>Sk(e)),event:G0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function Sk(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(Sk):[],event:G0(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($z),url:Nz(e),body:Mz(e),auth:Fz(e.auth),description:e.description},event:G0(e.scripts),protocolProfileBehavior:Dz(e.settings)}}}function $z(t){return{key:t.key,value:t.value,disabled:t.enabled===!1,...t.description!==void 0?{description:t.description}:{},...t.type!==void 0?{type:t.type}:{},...t.required!==void 0?{required:t.required}:{},...t.format!==void 0?{format:t.format}:{},...t.enum!==void 0?{enum:t.enum}:{},...t.deprecated!==void 0?{deprecated:t.deprecated}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.minLength!==void 0?{minLength:t.minLength}:{},...t.maxLength!==void 0?{maxLength:t.maxLength}:{},...t.minimum!==void 0?{minimum:t.minimum}:{},...t.maximum!==void 0?{maximum:t.maximum}:{},...t.exclusiveMinimum!==void 0?{exclusiveMinimum:t.exclusiveMinimum}:{},...t.exclusiveMaximum!==void 0?{exclusiveMaximum:t.exclusiveMaximum}:{},...t.multipleOf!==void 0?{multipleOf:t.multipleOf}:{},...t.minItems!==void 0?{minItems:t.minItems}:{},...t.maxItems!==void 0?{maxItems:t.maxItems}:{},...t.uniqueItems!==void 0?{uniqueItems:t.uniqueItems}:{},...t.nullable!==void 0?{nullable:t.nullable}:{},...t.oneOf!==void 0?{oneOf:t.oneOf}:{}}}function Nz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let c=i[1];/^{{.*}}$/.test(c)?n=[c]:n=c.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let c=o[1].replace(/^\//,"");c.endsWith("/")?(s=c.slice(0,-1).split("/"),s.push("")):s=c.length>0?c.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(c=>{let p={key:c.key,value:c.value};return c.enabled===!1&&(p.enabled=!1),c.description!==void 0&&(p.description=c.description),c.type!==void 0&&(p.type=c.type),c.required!==void 0&&(p.required=c.required),c.format!==void 0&&(p.format=c.format),c.enum!==void 0&&(p.enum=c.enum),c.deprecated!==void 0&&(p.deprecated=c.deprecated),c.pattern!==void 0&&(p.pattern=c.pattern),c.minLength!==void 0&&(p.minLength=c.minLength),c.maxLength!==void 0&&(p.maxLength=c.maxLength),c.minimum!==void 0&&(p.minimum=c.minimum),c.maximum!==void 0&&(p.maximum=c.maximum),c.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=c.exclusiveMinimum),c.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=c.exclusiveMaximum),c.multipleOf!==void 0&&(p.multipleOf=c.multipleOf),c.minItems!==void 0&&(p.minItems=c.minItems),c.maxItems!==void 0&&(p.maxItems=c.maxItems),c.uniqueItems!==void 0&&(p.uniqueItems=c.uniqueItems),c.nullable!==void 0&&(p.nullable=c.nullable),c.oneOf!==void 0&&(p.oneOf=c.oneOf),p});else{let c=r.indexOf("?");c!==-1&&(l=r.substring(c+1).split("&").map(h=>{let[g,...v]=h.split("=");return{key:g,value:v.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([c,p])=>({key:c,value:String(p)}))),{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 Mz(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=bk(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||bk(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??"",o=i.variables;return{mode:"graphql",graphql:{query:s,variables:o?typeof o=="string"?o:JSON.stringify(o):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function Fz(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 Dz(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 G0(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 Ot,ni,Wu,Y0=se(()=>{"use strict";En();Xm();J0();Ot=me(require("fs")),ni=me(require("path"));Wu=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Vu.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){Ot.existsSync(this.collectionsDir)||Ot.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null;let r=this.selfWritePending;this.selfWritePending=!1,r||this.loadCollections(),this.onCollectionsChanged?.()},300)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=vt(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,n);if(s){let o=this.findItemRecursive(i.items,r);if(o){let{id:l,type:f,...c}=n;Object.assign(o,c)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=vt(r.name)),this.selfWritePending=!0;try{return await this.loader.saveItem(e,r,n),!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(o=>o.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:vt(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=vt(r),s=this.loader.getCollectionPath(e),o=ni.join(this.collectionsDir,i);if(!Ot.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=ni.join(o,"collection.json");if(Ot.existsSync(l)){let c=JSON.parse(Ot.readFileSync(l,"utf-8"));c.id=i,c.name=r,Ot.writeFileSync(l,JSON.stringify(c,null,2))}else Ot.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");this.selfWritePending=!0;let n={id:vt(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;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.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||!Ot.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=ni.dirname(s),l=vt(n),f=ni.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let c=ni.join(f,"folder.json");if(Ot.existsSync(c)){let g=JSON.parse(Ot.readFileSync(c,"utf-8"));g.id=l,g.name=n,Ot.writeFileSync(c,JSON.stringify(g,null,2))}else Ot.writeFileSync(c,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),h=p?this.findItemById(p.items,l):void 0;return h||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||vt(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,operationId:e.operationId,summary:e.summary,tags:e.tags,examples:e.examples,responses:e.responses,security:e.security};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;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}getRequestScript(e,r,n){let i=this.collections.get(e);if(!i)return;let s=this.findItemById(i.items,r);if(!s||s.type!=="request")return;let o=s;return n==="pre-request"?o.scripts?.preRequest:o.scripts?.postResponse}async setRequestScript(e,r,n,i){let s=this.collections.get(e);if(!s)return!1;let o=this.findItemById(s.items,r);if(!o||o.type!=="request")return!1;let l=o,c={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=c,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,c),!0}catch{return!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}}}copyDirRecursive(e,r){Ot.existsSync(r)||Ot.mkdirSync(r,{recursive:!0});for(let n of Ot.readdirSync(e,{withFileTypes:!0})){let i=ni.join(e,n.name),s=ni.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Ot.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=Ot.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||vt(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=p=>{if(!p)return;switch(p.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:p.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let v=p.basic?.find(T=>T.key==="username"),_=p.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:v?.value||"",password:_?.value||""}};case"apikey":let w=p.apikey?.find(T=>T.key==="key"),E=p.apikey?.find(T=>T.key==="value"),k=p.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:w?.value||"",value:E?.value||"",in:k?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let h={};for(let g of p){let v=g.script?.exec;if(!v)continue;let _=Array.isArray(v)?v.join(`
|
|
53
|
+
`):v;g.listen==="prerequest"?h.preRequest=_:g.listen==="test"&&(h.postResponse=_)}return h.preRequest||h.postResponse?h:void 0},i=p=>{if(!p||typeof p!="object")return;let h={};return p.followRedirects===!1&&(h.followRedirects=!1),p.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),p.maxRedirects!==void 0&&(h.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(h.timeout=p.requestTimeout),Object.keys(h).length>0?h:void 0},s=p=>{if(!p||typeof p=="string")return;let h=p.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0,...g.description!==void 0?{description:g.description}:{},...g.type!==void 0?{type:g.type}:{},...g.required!==void 0?{required:g.required}:{},...g.format!==void 0?{format:g.format}:{},...g.enum!==void 0?{enum:g.enum}:{},...g.deprecated!==void 0?{deprecated:g.deprecated}:{},...g.pattern!==void 0?{pattern:g.pattern}:{},...g.minLength!==void 0?{minLength:g.minLength}:{},...g.maxLength!==void 0?{maxLength:g.maxLength}:{},...g.minimum!==void 0?{minimum:g.minimum}:{},...g.maximum!==void 0?{maximum:g.maximum}:{},...g.exclusiveMinimum!==void 0?{exclusiveMinimum:g.exclusiveMinimum}:{},...g.exclusiveMaximum!==void 0?{exclusiveMaximum:g.exclusiveMaximum}:{},...g.multipleOf!==void 0?{multipleOf:g.multipleOf}:{},...g.minItems!==void 0?{minItems:g.minItems}:{},...g.maxItems!==void 0?{maxItems:g.maxItems}:{},...g.uniqueItems!==void 0?{uniqueItems:g.uniqueItems}:{},...g.nullable!==void 0?{nullable:g.nullable}:{},...g.oneOf!==void 0?{oneOf:g.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let h=new Set;if(Array.isArray(p.variable))for(let v of p.variable)v.key&&h.add(v.key);if(h.size===0&&p.raw)return p.raw;let g="";if(p.protocol&&(g+=p.protocol+"://"),p.host&&(g+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(g+=":"+p.port),p.path){let _=(Array.isArray(p.path)?p.path:[p.path]).map(w=>{let E=w.startsWith(":")?w.substring(1):w;return h.has(E)?":"+E:(w.startsWith(":"),w)});g+="/"+_.join("/")}return!g&&p.raw?p.raw:g},l=p=>{if(!Array.isArray(p)||p.length===0)return;let h={responses:{}};for(let g of p){let v=String(g.code||200),_,w={};if(Array.isArray(g.header))for(let $ of g.header)!$.key||$.disabled||($.key.toLowerCase()==="content-type"?_=$.value?.split(";")[0]?.trim():w[$.key]={description:String($.value??""),schema:{type:"string"}});let E=g.body;if(typeof g.body=="string"&&g.body)try{E=JSON.parse(g.body)}catch{}let k=g.originalRequest,T;if(k){let $=typeof k.url=="string"?k.url:k.url?.raw??"";T=`${k.method||""} ${$}`.trim()||void 0}let N=g.name?g.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${v}`:`example_${v}`;if(h.responses[v]){let $=h.responses[v];$.examples=$.examples??{},$.examples[N]={summary:T,value:E}}else h.responses[v]={description:g.name,contentType:_,examples:{[N]:{summary:T,value:E}},...Object.keys(w).length>0?{headers:w}:{}}}return Object.keys(h.responses).length>0?h:void 0},f=p=>p.map(h=>{if(h.item)return{id:vt(h.name),type:"folder",name:h.name,description:h.description,auth:r(h.auth),scripts:n(h.event),items:f(h.item)};{let g=h.request||{};return{id:vt(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:o(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(v=>({key:v.key||v.name||"",value:v.value||v.value||"",enabled:v.disabled!==!0,...v.description!==void 0?{description:v.description}:{},...v.type!==void 0?{type:v.type}:{},...v.required!==void 0?{required:v.required}:{},...v.format!==void 0?{format:v.format}:{},...v.enum!==void 0?{enum:v.enum}:{},...v.deprecated!==void 0?{deprecated:v.deprecated}:{},...v.pattern!==void 0?{pattern:v.pattern}:{},...v.minLength!==void 0?{minLength:v.minLength}:{},...v.maxLength!==void 0?{maxLength:v.maxLength}:{},...v.minimum!==void 0?{minimum:v.minimum}:{},...v.maximum!==void 0?{maximum:v.maximum}:{},...v.exclusiveMinimum!==void 0?{exclusiveMinimum:v.exclusiveMinimum}:{},...v.exclusiveMaximum!==void 0?{exclusiveMaximum:v.exclusiveMaximum}:{},...v.multipleOf!==void 0?{multipleOf:v.multipleOf}:{},...v.minItems!==void 0?{minItems:v.minItems}:{},...v.maxItems!==void 0?{maxItems:v.maxItems}:{},...v.uniqueItems!==void 0?{uniqueItems:v.uniqueItems}:{},...v.nullable!==void 0?{nullable:v.nullable}:{},...v.oneOf!==void 0?{oneOf:v.oneOf}:{}})):[],body:(()=>{let v=g.body;if(v){if(v.mode==="raw"&&v.raw){let _=v.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:v.raw}}if(v.mode==="urlencoded"&&Array.isArray(v.urlencoded))return{type:"x-www-form-urlencoded",content:v.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(v.mode==="formdata"&&Array.isArray(v.formdata))return{type:"form-data",content:v.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(v.mode==="graphql"&&v.graphql){let _;if(v.graphql.variables)try{_=JSON.parse(v.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:v.graphql.query||"",variables:_}}}if(v.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior),responseSchema:l(h.response)}}}),c={id:vt(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),variables:Array.isArray(e.variable)?Object.fromEntries(e.variable.filter(p=>p&&p.key).map(p=>[p.key,String(p.value??"")])):typeof e.variable=="object"&&e.variable!==null?Object.fromEntries(Object.entries(e.variable).map(([p,h])=>[p,String(h??"")])):void 0,items:f(e.item||[])};return await this.saveCollection(c),c}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Az(n),s=JSON.stringify(i,null,2);Ot.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=ni.join(r,Tt(n.name));Ot.mkdirSync(i,{recursive:!0});let s=n.variables||{};Ma(ni.join(i,`${Tt(n.name)}.env`),s),Bu(i,Tt(n.name),n.scripts),ld(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Bt,Da,yo,K0=se(()=>{"use strict";Bt={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:500,toolMode:"auto",drilldownThreshold:100,toolPageSize:200,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},Da={config:"http-forge.config.json"},yo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});var Jr,An,La,Q0=se(()=>{"use strict";Jr=me(require("fs")),An=me(require("path"));K0();La=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=An.join(e,Da.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Jr.existsSync(this.configPath))return{...Bt};try{let e=Jr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${Da.config}. Using default configuration.`),{...Bt}}}mergeWithDefaults(e){return{version:e.version??Bt.version,storage:{...Bt.storage,...e.storage},request:{...Bt.request,...e.request},scripts:{...Bt.scripts,...e.scripts},runner:{...Bt.runner,...e.runner},environments:{...Bt.environments,...e.environments},restClientExport:{...Bt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Bt.proxy,mcp:{...Bt.mcp,...e.mcp,cors:{...Bt.mcp.cors,...e.mcp?.cors}},secrets:{...Bt.secrets,...e.secrets,providers:{...Bt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,Da.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 An.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){let e=this.config.mcp??Bt.mcp;return{...e,toolMode:["flat","drilldown","auto"].includes(e.toolMode)?e.toolMode:"auto",drilldownThreshold:Math.min(500,Math.max(10,e.drilldownThreshold??100)),toolPageSize:e.toolPageSize===0?0:Math.min(1e3,Math.max(10,e.toolPageSize??200)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return An.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return An.join(this.getRootPath(),yo.collections)}getEnvironmentsPath(){return An.join(this.getRootPath(),yo.environments)}getFlowsPath(){return An.join(this.getRootPath(),yo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return An.join(this.getRootPath(),yo.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Jr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Bt,null,2);await Jr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Jr.existsSync(i)||await Jr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Jr.existsSync(i)||await Jr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Jr.promises.writeFile(An.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Jr.promises.writeFile(An.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Jr.promises.writeFile(An.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var Lz,zu,Z0=se(()=>{"use strict";ba();Lz="httpForge.cookies",zu=class{constructor(e,r=Lz){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),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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 Ju,X0=se(()=>{"use strict";ba();Ju=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 o=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));o>=0?this.localCache[o]=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 ud(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,c=typeof l.enabled=="boolean"?l.enabled:!0;f&&c!==!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 o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function wk(t,e){try{let r=await e.readFile(t);return ud(r)}catch{return null}}var e_=se(()=>{"use strict"});var Kt,dn,cd,Gu,t_=se(()=>{"use strict";Kt=me(require("fs")),dn=me(require("path"));En();e_();Xm();em();_f();cd={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Gu=class{constructor(e,r,n,i,s,o=!0){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;this.persistOverrides=o;let l=n.getEnvironmentsPath();this.environmentsPath=l,this.sharedConfigPath=dn.join(l,"_global.json"),this.localConfigPath=dn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(cd.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.persistOverrides&&this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;persistOverrides;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Kt.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(!Kt.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(cd.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`${cd.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){if(!this.persistOverrides)return;let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore?.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore?.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.getLocalConfig()?.variables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],o=i?.credentials?.[r],l=i?.variables||{},f=o?.variables||{},c=o&&o.headers||{},p=ou(n.defaultHeaders||{},c),h=this.localEnvironmentValues.get(r)||{},g=this.secretValuesCache.get(r)||{},v={...s.variables||{},...f,...h,...g};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:v}}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 o=await this.secretStore.get(`${r}:${s}`);o!==void 0&&(i[s]=o)})),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 o=dn.join(e,"globals.env");Ma(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let c=dn.join(e,`${Tt(o)}.env`);Ma(c,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 dn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Kt.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),o={variables:i.variables||{}};this.saveJsonFile(s,o)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Kt.readFileSync(e,"utf-8"),n=ud(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 dn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=fu(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||{}},o=this.getGlobalVariables();return new ro({globals:o,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Kt.existsSync(this.environmentsPath)||Kt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Kt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Sf(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=dn.basename(s,".json");if(!i.has(o))try{Kt.unlinkSync(dn.join(this.environmentsPath,s))}catch{}}for(let[s,o]of Object.entries(e.environments||{})){let l={name:s,description:o.description,requiresConfirmation:o.requiresConfirmation,variables:o.variables||{}};this.saveJsonFile(dn.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(cd.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(cd.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(!Kt.existsSync(e))return null;let r=Kt.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=dn.dirname(e);Kt.existsSync(n)||Kt.mkdirSync(n,{recursive:!0}),Kt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var gs,eg=se(()=>{"use strict";od();gs=class t{constructor(e,r,n,i,s,o,l,f,c,p,h,g,v){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=c;this.collectionName=p;this.collectionAuth=h;this.iteration=g;this.iterationCount=v}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;collectionAuth;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),o=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let f=this.envConfigService.getGlobalVariables(),c={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...f},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setEnvironmentVariable(v,_,this.environment):g==="unset"&&v?this.envConfigService.deleteEnvironmentVariable(v,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setGlobalVariable(v,_):g==="unset"&&v?this.envConfigService.deleteGlobalVariable(v):g==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(c),h=null;try{let g={...r},v={...e},_;if((!v.auth||v.auth.type==="inherit")&&(v.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let F=await p.executePreRequest(s);if(F.consoleOutput&&F.consoleOutput.length>0&&this.onConsoleOutput?.(F.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),F.nextRequest!==void 0&&(_=F.nextRequest),F.skipRequest){let K={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:K,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:_}}F.success&&(F.modifiedRequest&&(F.modifiedRequest.url&&(v.url=F.modifiedRequest.url),F.modifiedRequest.headers&&(v.headers=F.modifiedRequest.headers),F.modifiedRequest.params&&(v.params=F.modifiedRequest.params),F.modifiedRequest.query&&(v.query=F.modifiedRequest.query),F.modifiedRequest.body!==void 0&&(v.body=F.modifiedRequest.body)),(F.localVariables??F.modifiedVariables)&&(g=F.localVariables??F.modifiedVariables))}h=await this.requestPreparer.prepareRequest(v,this.environment,l,g);let{url:w,headers:E,body:k,method:T}=h,N={};for(let F in E)Object.prototype.hasOwnProperty.call(E,F)&&(N[F.toUpperCase()]=E[F]);if(!N.COOKIE&&v.settings?.includeCookies!==!1&&this.cookieJar){let K=this.cookieJar.getCookieHeader(w);K&&(N.COOKIE=K)}let $={method:T,url:w,headers:N,body:k.content,signal:n,settings:v.settings?{timeout:v.settings.timeout,followRedirects:v.settings.followRedirects,maxRedirects:v.settings.maxRedirects,strictSSL:v.settings.strictSSL}:void 0},j=await this.httpService.execute($);this.cookieJar&&j.headers&&await this.cookieJar.setCookiesFromResponse(w,j.headers);let G=Date.now()-i,q=[],C={},A;if(o.length>0){let F=0;if(j.body)if(typeof j.body=="string")F=Buffer.byteLength(j.body,"utf8");else if(Buffer.isBuffer(j.body))F=j.body.length;else try{F=Buffer.byteLength(JSON.stringify(j.body),"utf8")}catch{F=0}let K=Ym(j.headers,j.cookies,h.url),ee={executedRequest:h,status:j.status,statusText:j.statusText,headers:Gm(j.headers||{}),body:j.body,cookies:K,responseTime:j.time,responseSize:F},ie=await p.executePostResponse(o,ee);q=ie.testResults,C=ie.modifiedEnvironmentVariables||{},A=ie.visualizerData,ie.nextRequest!==void 0&&(_=ie.nextRequest),ie.consoleOutput&&ie.consoleOutput.length>0&&this.onConsoleOutput?.(ie.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let D=q.length===0||q.every(F=>F.passed),B=q.length>0?D:j.status>=200&&j.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...h,headers:N},response:{status:j.status,statusText:j.statusText,headers:j.headers||{},body:j.body,time:j.time||G,cookies:j.cookies||[]},duration:G,timestamp:Date.now(),passed:B,assertions:q,modifiedVariables:g,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:A}}catch(g){return this.handleError(e,h,g,i)}finally{p.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,o=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`${n.message||n}`],{requestName:e.name||"",phase:"error"});let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),c=n?.stack?String(n.stack):"",p=this.errorBodyFormat,h,g;p==="html"||p==="both"?(h=t.formatErrorAsHtml(f,c),g={"content-type":"text/html; charset=utf-8"}):(h=f,g={});let v={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||v,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:g,cookies:[],body:h,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>
|
|
54
54
|
<html>
|
|
55
55
|
<body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
|
|
56
56
|
<h2 style="margin-top:0;color:#a94442">Request Error</h2>
|
|
@@ -92,7 +92,7 @@ fragment TypeRef on __Type {
|
|
|
92
92
|
`))return Uz(e)}return t}function ig(t){return{...t,sentRequest:{...t.sentRequest,url:dd(t.sentRequest.url),headers:ii(t.sentRequest.headers),body:t.sentRequest.body!=null?ng(t.sentRequest.body):t.sentRequest.body}}}function sg(t){return{...t,headers:ii(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&pn.test(e.name)?{...e,value:vo}:e)}}function og(t){return{...t,url:dd(t.url),request:{...t.request,url:dd(t.request.url),headers:ii(t.request.headers),query:ii(t.request.query),params:ii(t.request.params),body:t.request.body!=null?ng(t.request.body):t.request.body},response:{headers:ii(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?s_(t.response.cookies):t.response.cookies}}}function vr(t){return typeof t=="string"&&Hz.test(t)}function Rk(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)pn.test(n)&&i&&!vr(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)i_.test(n)&&i&&!vr(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)pn.test(n)&&i&&!vr(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&&!vr(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&&!vr(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&&!vr(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&&tg(r,e)}return e}function tg(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{tg(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
|
|
93
93
|
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)pn.test(i)&&s&&!vr(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=>tg(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))pn.test(r)&&n&&typeof n=="string"&&!vr(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&tg(n,e)}}function ja(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function Ck(t){let e=[],r=new Set;function n(i){let s=i,o=2;for(;r.has(s);)s=`${i}_${o++}`;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,o]of i.searchParams)pn.test(s)&&o&&!vr(o)&&e.push({location:"url",field:s,value:o,variableName:n(ja(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,o]of i)i_.test(s)&&o&&!vr(o)&&e.push({location:"header",field:s,value:o,variableName:n(ja(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,o]of i)pn.test(s)&&o&&!vr(o)&&e.push({location:"query",field:s,value:o,variableName:n(ja(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!vr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!vr(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&&!vr(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&&rg(i,e,r,"")}return e}function rg(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{rg(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
|
|
94
94
|
`)){try{let s=new URLSearchParams(i);for(let[o,l]of s)if(pn.test(o)&&l&&!vr(l)){let f=ja(o),c=2;for(;r.has(f);)f=`${ja(o)}_${c++}`;r.add(f),e.push({location:"body",field:o,path:n?`${n}.${o}`:o,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>rg(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let o=n?`${n}.${i}`:i;if(pn.test(i)&&s&&typeof s=="string"&&!vr(s)){let l=ja(i),f=2;for(;r.has(l);)l=`${ja(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:o,value:s,variableName:l})}else typeof s=="object"&&s!==null&&rg(s,e,r,o)}}}function xk(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(`([?&])${Vz(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(o=>o.key===n.field&&o.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(o=>o.key===n.field&&o.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":Bz(r,n.field,n.path,n.value,i);break}}return r}function Bz(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,o=s?s.content:t.body;if(o){if(typeof o=="string"){let l=o.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);_k(f,e,r||e,n,i);let c=JSON.stringify(f,null,2);s?s.content=c:t.body=c}catch{}return}if(l.includes("=")&&!l.includes(`
|
|
95
|
-
`)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let c=f.toString();s?s.content=c:t.body=c}return}return}typeof o=="object"&&o!==null&&_k(o,e,r||e,n,i)}}function _k(t,e,r,n,i){let s=r.split("."),o=t;for(let f=0;f<s.length-1;f++){let c=s[f],p=c.match(/^(.+)\[(\d+)\]$/);if(p?o=o?.[p[1]]?.[parseInt(p[2])]:o=o?.[c],o==null)return}let l=s[s.length-1];o&&o[l]===n&&(o[l]=i)}function Vz(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var vo,i_,pn,Hz,pd=se(()=>{"use strict";vo="***",i_=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,pn=/(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;Hz=/\{\{[^}]+\}\}/});var $e,Gr,Qu,o_=se(()=>{"use strict";$e=me(require("fs")),Gr=me(require("path"));En();pd();Qu=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Gr.join(this.historyPath,Tt(e))}getCollectionHistoryPath(e,r){return Gr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Gr.join(this.getCollectionHistoryPath(e,r),Tt(n))}getSharedEnvironmentHistoryPath(e){return Gr.join(this.sharedHistoryPath,Tt(e))}getSharedCollectionHistoryPath(e,r){return Gr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Gr.join(this.getSharedCollectionHistoryPath(e,r),Tt(n))}getHistoryFilePath(e,r,n){return Gr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Gr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Gr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Gr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!$e.existsSync(i))return null;let s=$e.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.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(!$e.existsSync(i))return null;let s=$e.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.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 o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{$e.existsSync(r)||$e.mkdirSync(r,{recursive:!0}),$e.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{$e.existsSync(r)||$e.mkdirSync(r,{recursive:!0}),$e.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 o=this.loadHistory(e,r,n);o||(o={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=ig({...s,method:i,id:Jh(),timestamp:Date.now()});return o.requests.unshift(l),o.requests.length>100&&(o.requests=o.requests.slice(0,100)),this.saveHistory(o),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return $e.existsSync(l)&&$e.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return $e.existsSync(l)&&$e.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(v=>v.id===i);if(f===-1)return!1;let[c]=l.requests.splice(f,1);this.saveHistory(l);let p=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!p.requests.some(v=>v.id===i)){let v={...c,ticket:null,branch:o};p.requests.unshift(v),p.requests.length>100&&(p.requests=p.requests.slice(0,100)),this.saveSharedHistory(p)}let h=this.getResponseFilePath(e,r,n,i),g=this.getSharedResponseFilePath(e,r,n,i);if($e.existsSync(h)){let v=Gr.dirname(g);$e.existsSync(v)||$e.mkdirSync(v,{recursive:!0});try{$e.renameSync(h,g)}catch{try{$e.copyFileSync(h,g)}catch(w){return console.error(`Failed to copy full response from ${h} to ${g}:`,w),!0}try{$e.unlinkSync(h)}catch(w){console.warn(`Failed to remove original full response after copy: ${h}`,w)}}}return!0}moveSharedEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(c=>c.id===i?(f=!0,{...c,ticket:null,branch:o}):c),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let o=(i||"").trim(),l=(s||"").trim();if(!o||!l||o===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let c=!1;return f.requests=f.requests.map(p=>!p.ticket&&p.branch===o?(c=!0,{...p,branch:l}):p),c?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if($e.existsSync(i)){let s=$e.readdirSync(i);for(let o of s)$e.unlinkSync(Gr.join(i,o));$e.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let o=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{$e.existsSync(o)||$e.mkdirSync(o,{recursive:!0});let f=sg(s);$e.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(!$e.existsSync(s))return null;let o=$e.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load full response for ${i}:`,o),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!$e.existsSync(s))return null;let o=$e.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load shared full response for ${i}:`,o),null}}}});var Ua,a_=se(()=>{"use strict";Ua=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,o=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...o?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let c=f.slice(0,s),p=new Map;for(let g of c){let v=this.historyService.loadFullResponse(i,e,r,g.id);if(v||(v=this.historyService.loadSharedFullResponse(i,e,r,g.id)),v){let _=v.status;p.has(_)||p.set(_,[]),p.get(_).push(v)}}let h={};for(let[g,v]of p){let _=this.buildResponseDefinition(v);h[String(g)]=_}return{responses:h}}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 o=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&o?o=this.inferrer.mergeSchemas(o,f):f&&(o=f)}if(o&&(r.schema=o),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,c]of Object.entries(l.headers)){let p=f.toLowerCase();r.has(p)||(n.set(p,(n.get(p)||0)+1),i.has(p)||i.set(p,Array.isArray(c)?c.join(", "):c))}let s=Math.ceil(e.length/2),o={};for(let[l,f]of n)if(f>=s){let c=i.get(l);o[l]={schema:this.inferHeaderSchema(c)}}return o}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var et=H(lr=>{"use strict";var l_=Symbol.for("yaml.alias"),Ek=Symbol.for("yaml.document"),ag=Symbol.for("yaml.map"),Ik=Symbol.for("yaml.pair"),u_=Symbol.for("yaml.scalar"),lg=Symbol.for("yaml.seq"),ys=Symbol.for("yaml.node.type"),Wz=t=>!!t&&typeof t=="object"&&t[ys]===l_,zz=t=>!!t&&typeof t=="object"&&t[ys]===Ek,Jz=t=>!!t&&typeof t=="object"&&t[ys]===ag,Gz=t=>!!t&&typeof t=="object"&&t[ys]===Ik,qk=t=>!!t&&typeof t=="object"&&t[ys]===u_,Yz=t=>!!t&&typeof t=="object"&&t[ys]===lg;function Ok(t){if(t&&typeof t=="object")switch(t[ys]){case ag:case lg:return!0}return!1}function Kz(t){if(t&&typeof t=="object")switch(t[ys]){case l_:case ag:case u_:case lg:return!0}return!1}var Qz=t=>(qk(t)||Ok(t))&&!!t.anchor;lr.ALIAS=l_;lr.DOC=Ek;lr.MAP=ag;lr.NODE_TYPE=ys;lr.PAIR=Ik;lr.SCALAR=u_;lr.SEQ=lg;lr.hasAnchor=Qz;lr.isAlias=Wz;lr.isCollection=Ok;lr.isDocument=zz;lr.isMap=Jz;lr.isNode=Kz;lr.isPair=Gz;lr.isScalar=qk;lr.isSeq=Yz});var hd=H(c_=>{"use strict";var Qt=et(),Yr=Symbol("break visit"),kk=Symbol("skip children"),Mi=Symbol("remove node");function ug(t,e){let r=Pk(e);Qt.isDocument(t)?Zu(null,t.contents,r,Object.freeze([t]))===Mi&&(t.contents=null):Zu(null,t,r,Object.freeze([]))}ug.BREAK=Yr;ug.SKIP=kk;ug.REMOVE=Mi;function Zu(t,e,r,n){let i=Tk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return Ak(t,n,i),Zu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=Zu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Yr)return Yr;o===Mi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=Zu("key",e.key,r,n);if(s===Yr)return Yr;s===Mi&&(e.key=null);let o=Zu("value",e.value,r,n);if(o===Yr)return Yr;o===Mi&&(e.value=null)}}return i}async function cg(t,e){let r=Pk(e);Qt.isDocument(t)?await Xu(null,t.contents,r,Object.freeze([t]))===Mi&&(t.contents=null):await Xu(null,t,r,Object.freeze([]))}cg.BREAK=Yr;cg.SKIP=kk;cg.REMOVE=Mi;async function Xu(t,e,r,n){let i=await Tk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return Ak(t,n,i),Xu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await Xu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Yr)return Yr;o===Mi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Xu("key",e.key,r,n);if(s===Yr)return Yr;s===Mi&&(e.key=null);let o=await Xu("value",e.value,r,n);if(o===Yr)return Yr;o===Mi&&(e.value=null)}}return i}function Pk(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 Tk(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Qt.isMap(e))return r.Map?.(t,e,n);if(Qt.isSeq(e))return r.Seq?.(t,e,n);if(Qt.isPair(e))return r.Pair?.(t,e,n);if(Qt.isScalar(e))return r.Scalar?.(t,e,n);if(Qt.isAlias(e))return r.Alias?.(t,e,n)}function Ak(t,e,r){let n=e[e.length-1];if(Qt.isCollection(n))n.items[t]=r;else if(Qt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Qt.isDocument(n))n.contents=r;else{let i=Qt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}c_.visit=ug;c_.visitAsync=cg});var f_=H(Nk=>{"use strict";var $k=et(),Zz=hd(),Xz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},eJ=t=>t.replace(/[!,[\]{}]/g,e=>Xz[e]),md=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,o]=n;return this.tags[s]=o,!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 o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!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 o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}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(o){return r(String(o)),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+eJ(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&&$k.isNode(e.contents)){let s={};Zz.visit(e.contents,(o,l)=>{$k.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
|
|
95
|
+
`)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let c=f.toString();s?s.content=c:t.body=c}return}return}typeof o=="object"&&o!==null&&_k(o,e,r||e,n,i)}}function _k(t,e,r,n,i){let s=r.split("."),o=t;for(let f=0;f<s.length-1;f++){let c=s[f],p=c.match(/^(.+)\[(\d+)\]$/);if(p?o=o?.[p[1]]?.[parseInt(p[2])]:o=o?.[c],o==null)return}let l=s[s.length-1];o&&o[l]===n&&(o[l]=i)}function Vz(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var vo,i_,pn,Hz,pd=se(()=>{"use strict";vo="***",i_=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,pn=/(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;Hz=/\{\{[^}]+\}\}/});var $e,Gr,Qu,o_=se(()=>{"use strict";$e=me(require("fs")),Gr=me(require("path"));En();pd();Qu=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Gr.join(this.historyPath,Tt(e))}getCollectionHistoryPath(e,r){return Gr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Gr.join(this.getCollectionHistoryPath(e,r),Tt(n))}getSharedEnvironmentHistoryPath(e){return Gr.join(this.sharedHistoryPath,Tt(e))}getSharedCollectionHistoryPath(e,r){return Gr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Gr.join(this.getSharedCollectionHistoryPath(e,r),Tt(n))}getHistoryFilePath(e,r,n){return Gr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Gr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Gr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Gr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!$e.existsSync(i))return null;let s=$e.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.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(!$e.existsSync(i))return null;let s=$e.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.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 o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{$e.existsSync(r)||$e.mkdirSync(r,{recursive:!0}),$e.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{$e.existsSync(r)||$e.mkdirSync(r,{recursive:!0}),$e.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 o=this.loadHistory(e,r,n);o||(o={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=ig({...s,method:i,id:Jh(),timestamp:Date.now()});return o.requests.unshift(l),o.requests.length>100&&(o.requests=o.requests.slice(0,100)),this.saveHistory(o),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return $e.existsSync(l)&&$e.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return $e.existsSync(l)&&$e.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(v=>v.id===i);if(f===-1)return!1;let[c]=l.requests.splice(f,1);this.saveHistory(l);let p=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!p.requests.some(v=>v.id===i)){let v={...c,ticket:null,branch:o};p.requests.unshift(v),p.requests.length>100&&(p.requests=p.requests.slice(0,100)),this.saveSharedHistory(p)}let h=this.getResponseFilePath(e,r,n,i),g=this.getSharedResponseFilePath(e,r,n,i);if($e.existsSync(h)){let v=Gr.dirname(g);$e.existsSync(v)||$e.mkdirSync(v,{recursive:!0});try{$e.renameSync(h,g)}catch{try{$e.copyFileSync(h,g)}catch(w){return console.error(`Failed to copy full response from ${h} to ${g}:`,w),!0}try{$e.unlinkSync(h)}catch(w){console.warn(`Failed to remove original full response after copy: ${h}`,w)}}}return!0}moveSharedEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(c=>c.id===i?(f=!0,{...c,ticket:null,branch:o}):c),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let o=(i||"").trim(),l=(s||"").trim();if(!o||!l||o===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let c=!1;return f.requests=f.requests.map(p=>!p.ticket&&p.branch===o?(c=!0,{...p,branch:l}):p),c?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if($e.existsSync(i)){let s=$e.readdirSync(i);for(let o of s)$e.unlinkSync(Gr.join(i,o));$e.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let o=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{$e.existsSync(o)||$e.mkdirSync(o,{recursive:!0});let f=sg(s);$e.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(!$e.existsSync(s))return null;let o=$e.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load full response for ${i}:`,o),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!$e.existsSync(s))return null;let o=$e.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load shared full response for ${i}:`,o),null}}}});var Ua,a_=se(()=>{"use strict";Ua=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,o=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...o?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let c=f.slice(0,s),p=new Map;for(let g of c){let v=this.historyService.loadFullResponse(i,e,r,g.id);if(v||(v=this.historyService.loadSharedFullResponse(i,e,r,g.id)),v){let _=v.status;p.has(_)||p.set(_,[]),p.get(_).push(v)}}let h={};for(let[g,v]of p){let _=this.buildResponseDefinition(v);h[String(g)]=_}return{responses:h}}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 o=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&o?o=this.inferrer.mergeSchemas(o,f):f&&(o=f)}if(o&&(r.schema=o),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,c]of Object.entries(l.headers)){let p=f.toLowerCase();r.has(p)||(n.set(p,(n.get(p)||0)+1),i.has(p)||i.set(p,Array.isArray(c)?c.join(", "):c))}let s=Math.ceil(e.length/2),o={};for(let[l,f]of n)if(f>=s){let c=i.get(l);o[l]={schema:this.inferHeaderSchema(c)}}return o}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var et=H(lr=>{"use strict";var l_=Symbol.for("yaml.alias"),Ek=Symbol.for("yaml.document"),ag=Symbol.for("yaml.map"),Ik=Symbol.for("yaml.pair"),u_=Symbol.for("yaml.scalar"),lg=Symbol.for("yaml.seq"),ys=Symbol.for("yaml.node.type"),Wz=t=>!!t&&typeof t=="object"&&t[ys]===l_,zz=t=>!!t&&typeof t=="object"&&t[ys]===Ek,Jz=t=>!!t&&typeof t=="object"&&t[ys]===ag,Gz=t=>!!t&&typeof t=="object"&&t[ys]===Ik,Ok=t=>!!t&&typeof t=="object"&&t[ys]===u_,Yz=t=>!!t&&typeof t=="object"&&t[ys]===lg;function qk(t){if(t&&typeof t=="object")switch(t[ys]){case ag:case lg:return!0}return!1}function Kz(t){if(t&&typeof t=="object")switch(t[ys]){case l_:case ag:case u_:case lg:return!0}return!1}var Qz=t=>(Ok(t)||qk(t))&&!!t.anchor;lr.ALIAS=l_;lr.DOC=Ek;lr.MAP=ag;lr.NODE_TYPE=ys;lr.PAIR=Ik;lr.SCALAR=u_;lr.SEQ=lg;lr.hasAnchor=Qz;lr.isAlias=Wz;lr.isCollection=qk;lr.isDocument=zz;lr.isMap=Jz;lr.isNode=Kz;lr.isPair=Gz;lr.isScalar=Ok;lr.isSeq=Yz});var hd=H(c_=>{"use strict";var Qt=et(),Yr=Symbol("break visit"),kk=Symbol("skip children"),Mi=Symbol("remove node");function ug(t,e){let r=Pk(e);Qt.isDocument(t)?Zu(null,t.contents,r,Object.freeze([t]))===Mi&&(t.contents=null):Zu(null,t,r,Object.freeze([]))}ug.BREAK=Yr;ug.SKIP=kk;ug.REMOVE=Mi;function Zu(t,e,r,n){let i=Tk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return Ak(t,n,i),Zu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=Zu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Yr)return Yr;o===Mi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=Zu("key",e.key,r,n);if(s===Yr)return Yr;s===Mi&&(e.key=null);let o=Zu("value",e.value,r,n);if(o===Yr)return Yr;o===Mi&&(e.value=null)}}return i}async function cg(t,e){let r=Pk(e);Qt.isDocument(t)?await Xu(null,t.contents,r,Object.freeze([t]))===Mi&&(t.contents=null):await Xu(null,t,r,Object.freeze([]))}cg.BREAK=Yr;cg.SKIP=kk;cg.REMOVE=Mi;async function Xu(t,e,r,n){let i=await Tk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return Ak(t,n,i),Xu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await Xu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Yr)return Yr;o===Mi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Xu("key",e.key,r,n);if(s===Yr)return Yr;s===Mi&&(e.key=null);let o=await Xu("value",e.value,r,n);if(o===Yr)return Yr;o===Mi&&(e.value=null)}}return i}function Pk(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 Tk(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Qt.isMap(e))return r.Map?.(t,e,n);if(Qt.isSeq(e))return r.Seq?.(t,e,n);if(Qt.isPair(e))return r.Pair?.(t,e,n);if(Qt.isScalar(e))return r.Scalar?.(t,e,n);if(Qt.isAlias(e))return r.Alias?.(t,e,n)}function Ak(t,e,r){let n=e[e.length-1];if(Qt.isCollection(n))n.items[t]=r;else if(Qt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Qt.isDocument(n))n.contents=r;else{let i=Qt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}c_.visit=ug;c_.visitAsync=cg});var f_=H(Nk=>{"use strict";var $k=et(),Zz=hd(),Xz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},eJ=t=>t.replace(/[!,[\]{}]/g,e=>Xz[e]),md=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,o]=n;return this.tags[s]=o,!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 o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!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 o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}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(o){return r(String(o)),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+eJ(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&&$k.isNode(e.contents)){let s={};Zz.visit(e.contents,(o,l)=>{$k.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
|
|
96
96
|
`)}};md.defaultYaml={explicit:!1,version:"1.2"};md.defaultTags={"!!":"tag:yaml.org,2002:"};Nk.Directives=md});var fg=H(gd=>{"use strict";var Mk=et(),tJ=hd();function rJ(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 Fk(t){let e=new Set;return tJ.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function Dk(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function nJ(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=Fk(t));let o=Dk(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(Mk.isScalar(o.node)||Mk.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}gd.anchorIsValid=rJ;gd.anchorNames=Fk;gd.createNodeAnchors=nJ;gd.findNewAnchor=Dk});var d_=H(Lk=>{"use strict";function yd(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],l=yd(t,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=yd(t,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=yd(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 o=yd(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}Lk.applyReviver=yd});var bo=H(Uk=>{"use strict";var iJ=et();function jk(t,e,r){if(Array.isArray(t))return t.map((n,i)=>jk(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!iJ.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}Uk.toJS=jk});var dg=H(Bk=>{"use strict";var sJ=d_(),Hk=et(),oJ=bo(),p_=class{constructor(e){Object.defineProperty(this,Hk.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(!Hk.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=oJ.toJS(this,"",o);if(typeof i=="function")for(let{count:f,res:c}of o.anchors.values())i(c,f);return typeof s=="function"?sJ.applyReviver(s,{"":l},"",l):l}};Bk.NodeBase=p_});var vd=H(Vk=>{"use strict";var aJ=fg(),lJ=hd(),ec=et(),uJ=dg(),cJ=bo(),h_=class extends uJ.NodeBase{constructor(e){super(ec.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=[],lJ.visit(e,{Node:(s,o)=>{(ec.isAlias(o)||ec.hasAnchor(o))&&n.push(o)}}),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,o=this.resolve(i,r);if(!o){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(o);if(l||(cJ.toJS(o,null,r),l=n.get(o)),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=pg(i,o,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(aJ.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 pg(t,e,r){if(ec.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(ec.isCollection(e)){let n=0;for(let i of e.items){let s=pg(t,i,r);s>n&&(n=s)}return n}else if(ec.isPair(e)){let n=pg(t,e.key,r),i=pg(t,e.value,r);return Math.max(n,i)}return 1}Vk.Alias=h_});var Vt=H(m_=>{"use strict";var fJ=et(),dJ=dg(),pJ=bo(),hJ=t=>!t||typeof t!="function"&&typeof t!="object",So=class extends dJ.NodeBase{constructor(e){super(fJ.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:pJ.toJS(this.value,e,r)}toString(){return String(this.value)}};So.BLOCK_FOLDED="BLOCK_FOLDED";So.BLOCK_LITERAL="BLOCK_LITERAL";So.PLAIN="PLAIN";So.QUOTE_DOUBLE="QUOTE_DOUBLE";So.QUOTE_SINGLE="QUOTE_SINGLE";m_.Scalar=So;m_.isScalarValue=hJ});var bd=H(zk=>{"use strict";var mJ=vd(),Ha=et(),Wk=Vt(),gJ="tag:yaml.org,2002:";function yJ(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 vJ(t,e,r){if(Ha.isDocument(t)&&(t=t.contents),Ha.isNode(t))return t;if(Ha.isPair(t)){let h=r.schema[Ha.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(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:o,sourceObjects:l}=r,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new mJ.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=gJ+e.slice(2));let c=yJ(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Wk.Scalar(t);return f&&(f.node=h),h}c=t instanceof Map?o[Ha.MAP]:Symbol.iterator in Object(t)?o[Ha.SEQ]:o[Ha.MAP]}s&&(s(c),delete r.onTagObj);let p=c?.createNode?c.createNode(r.schema,t,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,t,r):new Wk.Scalar(t);return e?p.tag=e:c.default||(p.tag=c.tag),f&&(f.node=p),p}zk.createNode=vJ});var mg=H(hg=>{"use strict";var bJ=bd(),Fi=et(),SJ=dg();function g_(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 o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return bJ.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 Jk=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,y_=class extends SJ.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=>Fi.isNode(n)||Fi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(Jk(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Fi.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,g_(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(Fi.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&&Fi.isScalar(s)?s.value:s:Fi.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Fi.isPair(r))return!1;let n=r.value;return n==null||e&&Fi.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 Fi.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(Fi.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,g_(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};hg.Collection=y_;hg.collectionFromPath=g_;hg.isEmptyPath=Jk});var Sd=H(gg=>{"use strict";var wJ=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function v_(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var _J=(t,e,r)=>t.endsWith(`
|
|
97
97
|
`)?v_(r,e):r.includes(`
|
|
98
98
|
`)?`
|
|
@@ -118,34 +118,34 @@ ${r}`)+"'";return e.implicitKey?n:wo.foldFlowLines(n,r,wo.FOLD_FLOW,bg(e,!1))}fu
|
|
|
118
118
|
`);_===-1?h="-":r===v||_!==v.length-1?(h="+",s&&s()):h="",v&&(r=r.slice(0,-v.length),v[v.length-1]===`
|
|
119
119
|
`&&(v=v.slice(0,-1)),v=v.replace(w_,`$&${c}`));let w=!1,E,k=-1;for(E=0;E<r.length;++E){let j=r[E];if(j===" ")w=!0;else if(j===`
|
|
120
120
|
`)k=E;else break}let T=r.substring(0,k<E?k+1:E);T&&(r=r.substring(T.length),T=T.replace(/\n+/g,`$&${c}`));let $=(w?c?"2":"1":"")+h;if(t&&($+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let j=r.replace(/\n+/g,`
|
|
121
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),G=!1,
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),G=!1,q=bg(n,!0);o!=="folded"&&e!==si.Scalar.BLOCK_FOLDED&&(q.onOverflow=()=>{G=!0});let C=wo.foldFlowLines(`${T}${j}${v}`,c,wo.FOLD_BLOCK,q);if(!G)return`>${$}
|
|
122
122
|
${c}${C}`}return r=r.replace(/\n+/g,`$&${c}`),`|${$}
|
|
123
123
|
${c}${T}${r}${v}`}function EJ(t,e,r,n){let{type:i,value:s}=t,{actualString:o,implicitKey:l,indent:f,indentStep:c,inFlow:p}=e;if(l&&s.includes(`
|
|
124
124
|
`)||p&&/[[\]{},]/.test(s))return tc(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||p||!s.includes(`
|
|
125
125
|
`)?tc(s,e):vg(t,e,r,n);if(!l&&!p&&i!==si.Scalar.PLAIN&&s.includes(`
|
|
126
126
|
`))return vg(t,e,r,n);if(Sg(s)){if(f==="")return e.forceBlockIndent=!0,vg(t,e,r,n);if(l&&f===c)return tc(s,e)}let h=s.replace(/\n+/g,`$&
|
|
127
|
-
${f}`);if(o){let g=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(h),{compat:v,tags:_}=e.doc.schema;if(_.some(g)||v?.some(g))return tc(s,e)}return l?h:wo.foldFlowLines(h,f,wo.FOLD_FLOW,bg(e,!1))}function IJ(t,e,r,n){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==si.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=si.Scalar.QUOTE_DOUBLE);let f=p=>{switch(p){case si.Scalar.BLOCK_FOLDED:case si.Scalar.BLOCK_LITERAL:return i||s?tc(o.value,e):vg(o,e,r,n);case si.Scalar.QUOTE_DOUBLE:return _d(o.value,e);case si.Scalar.QUOTE_SINGLE:return S_(o.value,e);case si.Scalar.PLAIN:return EJ(o,e,r,n);default:return null}},c=f(l);if(c===null){let{defaultKeyType:p,defaultStringType:h}=e.options,g=i&&p||h;if(c=f(g),c===null)throw new Error(`Unsupported default string type ${g}`)}return c}Kk.stringifyString=IJ});var Cd=H(__=>{"use strict";var
|
|
128
|
-
${e.indent}${l}`:l}__.createStringifyContext=PJ;__.stringify=$J});var eP=H(Xk=>{"use strict";var vs=et(),Qk=Vt(),Zk=Cd(),xd=Sd();function NJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:f,options:{commentString:c,indentSeq:p,simpleKeys:h}}=r,g=vs.isNode(t)&&t.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(vs.isCollection(t)||!vs.isNode(t)&&typeof t=="object"){let
|
|
127
|
+
${f}`);if(o){let g=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(h),{compat:v,tags:_}=e.doc.schema;if(_.some(g)||v?.some(g))return tc(s,e)}return l?h:wo.foldFlowLines(h,f,wo.FOLD_FLOW,bg(e,!1))}function IJ(t,e,r,n){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==si.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=si.Scalar.QUOTE_DOUBLE);let f=p=>{switch(p){case si.Scalar.BLOCK_FOLDED:case si.Scalar.BLOCK_LITERAL:return i||s?tc(o.value,e):vg(o,e,r,n);case si.Scalar.QUOTE_DOUBLE:return _d(o.value,e);case si.Scalar.QUOTE_SINGLE:return S_(o.value,e);case si.Scalar.PLAIN:return EJ(o,e,r,n);default:return null}},c=f(l);if(c===null){let{defaultKeyType:p,defaultStringType:h}=e.options,g=i&&p||h;if(c=f(g),c===null)throw new Error(`Unsupported default string type ${g}`)}return c}Kk.stringifyString=IJ});var Cd=H(__=>{"use strict";var OJ=fg(),_o=et(),qJ=Sd(),kJ=Rd();function PJ(t,e){let r=Object.assign({blockQuote:!0,commentString:qJ.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 TJ(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(_o.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(o=>o.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 AJ(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(_o.isScalar(t)||_o.isCollection(t))&&t.anchor;s&&OJ.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function $J(t,e,r,n){if(_o.isPair(t))return t.toString(e,r,n);if(_o.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=_o.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=TJ(e.doc.schema.tags,s));let o=AJ(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof i.stringify=="function"?i.stringify(s,e,r,n):_o.isScalar(s)?kJ.stringifyString(s,e,r,n):s.toString(e,r,n);return o?_o.isScalar(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
128
|
+
${e.indent}${l}`:l}__.createStringifyContext=PJ;__.stringify=$J});var eP=H(Xk=>{"use strict";var vs=et(),Qk=Vt(),Zk=Cd(),xd=Sd();function NJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:f,options:{commentString:c,indentSeq:p,simpleKeys:h}}=r,g=vs.isNode(t)&&t.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(vs.isCollection(t)||!vs.isNode(t)&&typeof t=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let v=!h&&(!t||g&&e==null&&!r.inFlow||vs.isCollection(t)||(vs.isScalar(t)?t.type===Qk.Scalar.BLOCK_FOLDED||t.type===Qk.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!v&&(h||!s),indent:l+f});let _=!1,w=!1,E=Zk.stringify(t,r,()=>_=!0,()=>w=!0);if(!v&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(r.inFlow){if(s||e==null)return _&&n&&n(),E===""?"?":v?`? ${E}`:E}else if(s&&!h||e==null&&v)return E=`? ${E}`,g&&!_?E+=xd.lineComment(E,r.indent,c(g)):w&&i&&i(),E;_&&(g=null),v?(g&&(E+=xd.lineComment(E,r.indent,c(g))),E=`? ${E}
|
|
129
129
|
${l}:`):(E=`${E}:`,g&&(E+=xd.lineComment(E,r.indent,c(g))));let k,T,N;vs.isNode(e)?(k=!!e.spaceBefore,T=e.commentBefore,N=e.comment):(k=!1,T=null,N=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!v&&!g&&vs.isScalar(e)&&(r.indentAtStart=E.length+1),w=!1,!p&&f.length>=2&&!r.inFlow&&!v&&vs.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let $=!1,j=Zk.stringify(e,r,()=>$=!0,()=>w=!0),G=" ";if(g||k||T){if(G=k?`
|
|
130
|
-
`:"",T){let
|
|
131
|
-
${xd.indentComment(
|
|
130
|
+
`:"",T){let q=c(T);G+=`
|
|
131
|
+
${xd.indentComment(q,r.indent)}`}j===""&&!r.inFlow?G===`
|
|
132
132
|
`&&N&&(G=`
|
|
133
133
|
|
|
134
134
|
`):G+=`
|
|
135
|
-
${r.indent}`}else if(!v&&vs.isCollection(e)){let
|
|
136
|
-
`),A=C!==-1,D=r.inFlow??e.flow??e.items.length===0;if(A||!D){let B=!1;if(A&&(
|
|
135
|
+
${r.indent}`}else if(!v&&vs.isCollection(e)){let q=j[0],C=j.indexOf(`
|
|
136
|
+
`),A=C!==-1,D=r.inFlow??e.flow??e.items.length===0;if(A||!D){let B=!1;if(A&&(q==="&"||q==="!")){let F=j.indexOf(" ");q==="&"&&F!==-1&&F<C&&j[F+1]==="!"&&(F=j.indexOf(" ",F+1)),(F===-1||C<F)&&(B=!0)}B||(G=`
|
|
137
137
|
${r.indent}`)}}else(j===""||j[0]===`
|
|
138
|
-
`)&&(G="");return E+=G+j,r.inFlow?$&&n&&n():N&&!$?E+=xd.lineComment(E,r.indent,c(N)):w&&i&&i(),E}Xk.stringifyPair=NJ});var C_=H(R_=>{"use strict";var tP=require("process");function MJ(t,...e){t==="debug"&&console.log(...e)}function FJ(t,e){(t==="debug"||t==="warn")&&(typeof tP.emitWarning=="function"?tP.emitWarning(e):console.warn(e))}R_.debug=MJ;R_.warn=FJ});var xg=H(Cg=>{"use strict";var Rg=et(),rP=Vt(),wg="<<",_g={identify:t=>t===wg||typeof t=="symbol"&&t.description===wg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new rP.Scalar(Symbol(wg)),{addToJSMap:nP}),stringify:()=>wg},DJ=(t,e)=>(_g.identify(e)||Rg.isScalar(e)&&(!e.type||e.type===rP.Scalar.PLAIN)&&_g.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===_g.tag&&r.default);function nP(t,e,r){let n=iP(t,r);if(Rg.isSeq(n))for(let i of n.items)x_(t,e,i);else if(Array.isArray(n))for(let i of n)x_(t,e,i);else x_(t,e,n)}function x_(t,e,r){let n=iP(t,r);if(!Rg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function iP(t,e){return t&&Rg.isAlias(e)?e.resolve(t.doc,t):e}Cg.addMergeToJSMap=nP;Cg.isMergeKey=DJ;Cg.merge=_g});var I_=H(aP=>{"use strict";var LJ=C_(),sP=xg(),jJ=Cd(),oP=et(),E_=bo();function UJ(t,e,{key:r,value:n}){if(oP.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(sP.isMergeKey(t,r))sP.addMergeToJSMap(t,e,n);else{let i=E_.toJS(r,"",t);if(e instanceof Map)e.set(i,E_.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=HJ(r,i,t),o=E_.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function HJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(oP.isNode(t)&&r?.doc){let n=jJ.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)+'..."'),LJ.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)}aP.addPairToJSMap=UJ});var Ro=H(
|
|
138
|
+
`)&&(G="");return E+=G+j,r.inFlow?$&&n&&n():N&&!$?E+=xd.lineComment(E,r.indent,c(N)):w&&i&&i(),E}Xk.stringifyPair=NJ});var C_=H(R_=>{"use strict";var tP=require("process");function MJ(t,...e){t==="debug"&&console.log(...e)}function FJ(t,e){(t==="debug"||t==="warn")&&(typeof tP.emitWarning=="function"?tP.emitWarning(e):console.warn(e))}R_.debug=MJ;R_.warn=FJ});var xg=H(Cg=>{"use strict";var Rg=et(),rP=Vt(),wg="<<",_g={identify:t=>t===wg||typeof t=="symbol"&&t.description===wg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new rP.Scalar(Symbol(wg)),{addToJSMap:nP}),stringify:()=>wg},DJ=(t,e)=>(_g.identify(e)||Rg.isScalar(e)&&(!e.type||e.type===rP.Scalar.PLAIN)&&_g.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===_g.tag&&r.default);function nP(t,e,r){let n=iP(t,r);if(Rg.isSeq(n))for(let i of n.items)x_(t,e,i);else if(Array.isArray(n))for(let i of n)x_(t,e,i);else x_(t,e,n)}function x_(t,e,r){let n=iP(t,r);if(!Rg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function iP(t,e){return t&&Rg.isAlias(e)?e.resolve(t.doc,t):e}Cg.addMergeToJSMap=nP;Cg.isMergeKey=DJ;Cg.merge=_g});var I_=H(aP=>{"use strict";var LJ=C_(),sP=xg(),jJ=Cd(),oP=et(),E_=bo();function UJ(t,e,{key:r,value:n}){if(oP.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(sP.isMergeKey(t,r))sP.addMergeToJSMap(t,e,n);else{let i=E_.toJS(r,"",t);if(e instanceof Map)e.set(i,E_.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=HJ(r,i,t),o=E_.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function HJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(oP.isNode(t)&&r?.doc){let n=jJ.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)+'..."'),LJ.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)}aP.addPairToJSMap=UJ});var Ro=H(O_=>{"use strict";var lP=bd(),BJ=eP(),VJ=I_(),Eg=et();function WJ(t,e,r){let n=lP.createNode(t,void 0,r),i=lP.createNode(e,void 0,r);return new Ig(n,i)}var Ig=class t{constructor(e,r=null){Object.defineProperty(this,Eg.NODE_TYPE,{value:Eg.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Eg.isNode(r)&&(r=r.clone(e)),Eg.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return VJ.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?BJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};O_.Pair=Ig;O_.createPair=WJ});var q_=H(cP=>{"use strict";var Ba=et(),uP=Cd(),Og=Sd();function zJ(t,e,r){return(e.inFlow??t.flow?GJ:JJ)(t,e,r)}function JJ({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:f,options:{commentString:c}}=r,p=Object.assign({},r,{indent:s,type:null}),h=!1,g=[];for(let _=0;_<e.length;++_){let w=e[_],E=null;if(Ba.isNode(w))!h&&w.spaceBefore&&g.push(""),qg(r,g,w.commentBefore,h),w.comment&&(E=w.comment);else if(Ba.isPair(w)){let T=Ba.isNode(w.key)?w.key:null;T&&(!h&&T.spaceBefore&&g.push(""),qg(r,g,T.commentBefore,h))}h=!1;let k=uP.stringify(w,p,()=>E=null,()=>h=!0);E&&(k+=Og.lineComment(k,s,c(E))),h&&E&&(h=!1),g.push(n+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let _=1;_<g.length;++_){let w=g[_];v+=w?`
|
|
139
139
|
${f}${w}`:`
|
|
140
140
|
`}}return t?(v+=`
|
|
141
|
-
`+
|
|
142
|
-
`)),_<t.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=h.reduce((T,N)=>T+N.length+2,2)+(k.length+2)>e.options.lineWidth)),c&&(k+=",")),E&&(k+=
|
|
141
|
+
`+Og.indentComment(c(t),f),l&&l()):h&&o&&o(),v}function GJ({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,p=0,h=[];for(let _=0;_<t.length;++_){let w=t[_],E=null;if(Ba.isNode(w))w.spaceBefore&&h.push(""),qg(e,h,w.commentBefore,!1),w.comment&&(E=w.comment);else if(Ba.isPair(w)){let T=Ba.isNode(w.key)?w.key:null;T&&(T.spaceBefore&&h.push(""),qg(e,h,T.commentBefore,!1),T.comment&&(c=!0));let N=Ba.isNode(w.value)?w.value:null;N?(N.comment&&(E=N.comment),N.commentBefore&&(c=!0)):w.value==null&&T?.comment&&(E=T.comment)}E&&(c=!0);let k=uP.stringify(w,f,()=>E=null);c||(c=h.length>p||k.includes(`
|
|
142
|
+
`)),_<t.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=h.reduce((T,N)=>T+N.length+2,2)+(k.length+2)>e.options.lineWidth)),c&&(k+=",")),E&&(k+=Og.lineComment(k,n,l(E))),h.push(k),p=h.length}let{start:g,end:v}=r;if(h.length===0)return g+v;if(!c){let _=h.reduce((w,E)=>w+E.length+2,2);c=e.options.lineWidth>0&&_>e.options.lineWidth}if(c){let _=g;for(let w of h)_+=w?`
|
|
143
143
|
${s}${i}${w}`:`
|
|
144
144
|
`;return`${_}
|
|
145
|
-
${i}${v}`}else return`${g}${o}${h.join(" ")}${o}${v}`}function
|
|
145
|
+
${i}${v}`}else return`${g}${o}${h.join(" ")}${o}${v}`}function qg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Og.indentComment(e(n),t);r.push(s.trimStart())}}cP.stringifyCollection=zJ});var xo=H(P_=>{"use strict";var YJ=q_(),KJ=I_(),QJ=mg(),Co=et(),kg=Ro(),ZJ=Vt();function Ed(t,e){let r=Co.isScalar(e)?e.value:e;for(let n of t)if(Co.isPair(n)&&(n.key===e||n.key===r||Co.isScalar(n.key)&&n.key.value===r))return n}var k_=class extends QJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Co.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),l=(f,c)=>{if(typeof s=="function")c=s.call(r,f,c);else if(Array.isArray(s)&&!s.includes(f))return;(c!==void 0||i)&&o.items.push(kg.createPair(f,c,n))};if(r instanceof Map)for(let[f,c]of r)l(f,c);else if(r&&typeof r=="object")for(let f of Object.keys(r))l(f,r[f]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;Co.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new kg.Pair(e,e?.value):n=new kg.Pair(e.key,e.value);let i=Ed(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Co.isScalar(i.value)&&ZJ.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(l=>s(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let r=Ed(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Ed(this.items,e)?.value;return(!r&&Co.isScalar(i)?i.value:i)??void 0}has(e){return!!Ed(this.items,e)}set(e,r){this.add(new kg.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)KJ.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Co.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})),YJ.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};P_.YAMLMap=k_;P_.findPair=Ed});var rc=H(dP=>{"use strict";var XJ=et(),fP=xo(),eG={collection:"map",default:!0,nodeClass:fP.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return XJ.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>fP.YAMLMap.from(t,e,r)};dP.map=eG});var Eo=H(pP=>{"use strict";var tG=bd(),rG=q_(),nG=mg(),Tg=et(),iG=Vt(),sG=bo(),T_=class extends nG.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Tg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Pg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Pg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Tg.isScalar(i)?i.value:i}has(e){let r=Pg(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=Pg(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Tg.isScalar(i)&&iG.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(sG.toJS(s,String(i++),r));return n}toString(e,r,n){return e?rG.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 o=0;for(let l of r){if(typeof i=="function"){let f=r instanceof Set?l:String(o++);l=i.call(r,f,l)}s.items.push(tG.createNode(l,void 0,n))}}return s}};function Pg(t){let e=Tg.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}pP.YAMLSeq=T_});var nc=H(mP=>{"use strict";var oG=et(),hP=Eo(),aG={collection:"seq",default:!0,nodeClass:hP.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return oG.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>hP.YAMLSeq.from(t,e,r)};mP.seq=aG});var Id=H(gP=>{"use strict";var lG=Rd(),uG={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),lG.stringifyString(t,e,r,n)}};gP.string=uG});var Ag=H(bP=>{"use strict";var yP=Vt(),vP={identify:t=>t==null,createNode:()=>new yP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yP.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&vP.test.test(t)?t:e.options.nullStr};bP.nullTag=vP});var A_=H(wP=>{"use strict";var cG=Vt(),SP={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new cG.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&SP.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};wP.boolTag=SP});var ic=H(_P=>{"use strict";function fG({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 o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}_P.stringifyNumber=fG});var N_=H($g=>{"use strict";var dG=Vt(),$_=ic(),pG={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:$_.stringifyNumber},hG={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():$_.stringifyNumber(t)}},mG={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 dG.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:$_.stringifyNumber};$g.float=mG;$g.floatExp=hG;$g.floatNaN=pG});var F_=H(Mg=>{"use strict";var RP=ic(),Ng=t=>typeof t=="bigint"||Number.isInteger(t),M_=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function CP(t,e,r){let{value:n}=t;return Ng(n)&&n>=0?r+n.toString(e):RP.stringifyNumber(t)}var gG={identify:t=>Ng(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>M_(t,2,8,r),stringify:t=>CP(t,8,"0o")},yG={identify:Ng,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>M_(t,0,10,r),stringify:RP.stringifyNumber},vG={identify:t=>Ng(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>M_(t,2,16,r),stringify:t=>CP(t,16,"0x")};Mg.int=yG;Mg.intHex=vG;Mg.intOct=gG});var EP=H(xP=>{"use strict";var bG=rc(),SG=Ag(),wG=nc(),_G=Id(),RG=A_(),D_=N_(),L_=F_(),CG=[bG.map,wG.seq,_G.string,SG.nullTag,RG.boolTag,L_.intOct,L_.int,L_.intHex,D_.floatNaN,D_.floatExp,D_.float];xP.schema=CG});var qP=H(OP=>{"use strict";var xG=Vt(),EG=rc(),IG=nc();function IP(t){return typeof t=="bigint"||Number.isInteger(t)}var Fg=({value:t})=>JSON.stringify(t),OG=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Fg},{identify:t=>t==null,createNode:()=>new xG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Fg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Fg},{identify:IP,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})=>IP(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:Fg}],qG={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},kG=[EG.map,IG.seq].concat(OG,qG);OP.schema=kG});var U_=H(kP=>{"use strict";var Od=require("buffer"),j_=Vt(),PG=Rd(),TG={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Od.Buffer=="function")return Od.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 o=r,l;if(typeof Od.Buffer=="function")l=o instanceof Od.Buffer?o.toString("base64"):Od.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let c=0;c<o.length;++c)f+=String.fromCharCode(o[c]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=j_.Scalar.BLOCK_LITERAL),e!==j_.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(l.length/f),p=new Array(c);for(let h=0,g=0;h<c;++h,g+=f)p[h]=l.substr(g,f);l=p.join(e===j_.Scalar.BLOCK_LITERAL?`
|
|
146
146
|
`:" ")}return PG.stringifyString({comment:t,type:e,value:l},n,i,s)}};kP.binary=TG});var jg=H(Lg=>{"use strict";var Dg=et(),H_=Ro(),AG=Vt(),$G=Eo();function PP(t,e){if(Dg.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Dg.isPair(n)){if(Dg.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new H_.Pair(new AG.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
147
147
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
148
|
-
${s.comment}`:n.comment}n=i}t.items[r]=Dg.isPair(n)?n:new H_.Pair(n)}}else e("Expected a sequence for this tag");return t}function TP(t,e,r){let{replacer:n}=r,i=new $G.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(s++),o));let l,f;if(Array.isArray(o))if(o.length===2)l=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(H_.createPair(l,f,r))}return i}var NG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:PP,createNode:TP};Lg.createPairs=TP;Lg.pairs=NG;Lg.resolvePairs=PP});var W_=H(V_=>{"use strict";var AP=et(),B_=bo(),Od=xo(),MG=Eo(),$P=jg(),Va=class t extends MG.YAMLSeq{constructor(){super(),this.add=Od.YAMLMap.prototype.add.bind(this),this.delete=Od.YAMLMap.prototype.delete.bind(this),this.get=Od.YAMLMap.prototype.get.bind(this),this.has=Od.YAMLMap.prototype.has.bind(this),this.set=Od.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,o;if(AP.isPair(i)?(s=B_.toJS(i.key,"",r),o=B_.toJS(i.value,s,r)):s=B_.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=$P.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Va.tag="tag:yaml.org,2002:omap";var FG={collection:"seq",identify:t=>t instanceof Map,nodeClass:Va,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=$P.resolvePairs(t,e),n=[];for(let{key:i}of r.items)AP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Va,r)},createNode:(t,e,r)=>Va.from(t,e,r)};V_.YAMLOMap=Va;V_.omap=FG});var LP=H(z_=>{"use strict";var NP=Vt();function MP({value:t,source:e},r){return e&&(t?FP:DP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var FP={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 NP.Scalar(!0),stringify:MP},DP={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 NP.Scalar(!1),stringify:MP};z_.falseTag=DP;z_.trueTag=FP});var jP=H(Ug=>{"use strict";var DG=Vt(),J_=ic(),LG={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:J_.stringifyNumber},jG={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():J_.stringifyNumber(t)}},UG={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 DG.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:J_.stringifyNumber};Ug.float=UG;Ug.floatExp=jG;Ug.floatNaN=LG});var HP=H(Pd=>{"use strict";var UP=ic(),kd=t=>typeof t=="bigint"||Number.isInteger(t);function Hg(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 o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function G_(t,e,r){let{value:n}=t;if(kd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return UP.stringifyNumber(t)}var HG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Hg(t,2,2,r),stringify:t=>G_(t,2,"0b")},BG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Hg(t,1,8,r),stringify:t=>G_(t,8,"0")},VG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Hg(t,0,10,r),stringify:UP.stringifyNumber},WG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Hg(t,2,16,r),stringify:t=>G_(t,16,"0x")};Pd.int=VG;Pd.intBin=HG;Pd.intHex=WG;Pd.intOct=BG});var K_=H(Y_=>{"use strict";var Wg=et(),Bg=Ro(),Vg=xo(),Wa=class t extends Vg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Wg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Bg.Pair(e.key,null):r=new Bg.Pair(e,null),Vg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Vg.findPair(this.items,e);return!r&&Wg.isPair(n)?Wg.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=Vg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Bg.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 o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(Bg.createPair(o,null,n));return s}};Wa.tag="tag:yaml.org,2002:set";var zG={collection:"map",identify:t=>t instanceof Set,nodeClass:Wa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Wa.from(t,e,r),resolve(t,e){if(Wg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Wa,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Y_.YAMLSet=Wa;Y_.set=zG});var Z_=H(zg=>{"use strict";var JG=ic();function Q_(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function BP(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return JG.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(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var GG={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})=>Q_(t,r),stringify:BP},YG={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=>Q_(t,!1),stringify:BP},VP={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(VP.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,n-1,i,s||0,o||0,l||0,f),p=e[8];if(p&&p!=="Z"){let h=Q_(p,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};zg.floatTime=YG;zg.intTime=GG;zg.timestamp=VP});var JP=H(zP=>{"use strict";var KG=rc(),QG=Ag(),ZG=nc(),XG=Id(),eY=U_(),WP=LP(),X_=jP(),Jg=HP(),tY=xg(),rY=W_(),nY=jg(),iY=K_(),eR=Z_(),sY=[KG.map,ZG.seq,XG.string,QG.nullTag,WP.trueTag,WP.falseTag,Jg.intBin,Jg.intOct,Jg.int,Jg.intHex,X_.floatNaN,X_.floatExp,X_.float,eY.binary,tY.merge,rY.omap,nY.pairs,iY.set,eR.intTime,eR.floatTime,eR.timestamp];zP.schema=sY});var nT=H(nR=>{"use strict";var QP=rc(),oY=Ag(),ZP=nc(),aY=Id(),lY=A_(),tR=N_(),rR=F_(),uY=EP(),cY=OP(),XP=U_(),Td=xg(),eT=W_(),tT=jg(),GP=JP(),rT=K_(),Gg=Z_(),YP=new Map([["core",uY.schema],["failsafe",[QP.map,ZP.seq,aY.string]],["json",cY.schema],["yaml11",GP.schema],["yaml-1.1",GP.schema]]),KP={binary:XP.binary,bool:lY.boolTag,float:tR.float,floatExp:tR.floatExp,floatNaN:tR.floatNaN,floatTime:Gg.floatTime,int:rR.int,intHex:rR.intHex,intOct:rR.intOct,intTime:Gg.intTime,map:QP.map,merge:Td.merge,null:oY.nullTag,omap:eT.omap,pairs:tT.pairs,seq:ZP.seq,set:rT.set,timestamp:Gg.timestamp},fY={"tag:yaml.org,2002:binary":XP.binary,"tag:yaml.org,2002:merge":Td.merge,"tag:yaml.org,2002:omap":eT.omap,"tag:yaml.org,2002:pairs":tT.pairs,"tag:yaml.org,2002:set":rT.set,"tag:yaml.org,2002:timestamp":Gg.timestamp};function dY(t,e,r){let n=YP.get(e);if(n&&!t)return r&&!n.includes(Td.merge)?n.concat(Td.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(YP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).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(Td.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?KP[o]:o;if(!l){let f=JSON.stringify(o),c=Object.keys(KP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}nR.coreKnownTags=fY;nR.getTags=dY});var oR=H(iT=>{"use strict";var iR=et(),pY=rc(),hY=nc(),mY=Id(),Yg=nT(),gY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,sR=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Yg.getTags(e,"compat"):e?Yg.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Yg.coreKnownTags:{},this.tags=Yg.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,iR.MAP,{value:pY.map}),Object.defineProperty(this,iR.SCALAR,{value:mY.string}),Object.defineProperty(this,iR.SEQ,{value:hY.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?gY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};iT.Schema=sR});var oT=H(sT=>{"use strict";var yY=et(),aR=Cd(),Ad=Sd();function vY(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=aR.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Ad.indentComment(f,""))}let o=!1,l=null;if(t.contents){if(yY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(Ad.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>o=!0,c=aR.stringify(t.contents,i,()=>l=null,f);l&&(c+=Ad.lineComment(c,"",s(l))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(aR.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
148
|
+
${s.comment}`:n.comment}n=i}t.items[r]=Dg.isPair(n)?n:new H_.Pair(n)}}else e("Expected a sequence for this tag");return t}function TP(t,e,r){let{replacer:n}=r,i=new $G.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(s++),o));let l,f;if(Array.isArray(o))if(o.length===2)l=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(H_.createPair(l,f,r))}return i}var NG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:PP,createNode:TP};Lg.createPairs=TP;Lg.pairs=NG;Lg.resolvePairs=PP});var W_=H(V_=>{"use strict";var AP=et(),B_=bo(),qd=xo(),MG=Eo(),$P=jg(),Va=class t extends MG.YAMLSeq{constructor(){super(),this.add=qd.YAMLMap.prototype.add.bind(this),this.delete=qd.YAMLMap.prototype.delete.bind(this),this.get=qd.YAMLMap.prototype.get.bind(this),this.has=qd.YAMLMap.prototype.has.bind(this),this.set=qd.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,o;if(AP.isPair(i)?(s=B_.toJS(i.key,"",r),o=B_.toJS(i.value,s,r)):s=B_.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=$P.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Va.tag="tag:yaml.org,2002:omap";var FG={collection:"seq",identify:t=>t instanceof Map,nodeClass:Va,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=$P.resolvePairs(t,e),n=[];for(let{key:i}of r.items)AP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Va,r)},createNode:(t,e,r)=>Va.from(t,e,r)};V_.YAMLOMap=Va;V_.omap=FG});var LP=H(z_=>{"use strict";var NP=Vt();function MP({value:t,source:e},r){return e&&(t?FP:DP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var FP={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 NP.Scalar(!0),stringify:MP},DP={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 NP.Scalar(!1),stringify:MP};z_.falseTag=DP;z_.trueTag=FP});var jP=H(Ug=>{"use strict";var DG=Vt(),J_=ic(),LG={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:J_.stringifyNumber},jG={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():J_.stringifyNumber(t)}},UG={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 DG.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:J_.stringifyNumber};Ug.float=UG;Ug.floatExp=jG;Ug.floatNaN=LG});var HP=H(Pd=>{"use strict";var UP=ic(),kd=t=>typeof t=="bigint"||Number.isInteger(t);function Hg(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 o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function G_(t,e,r){let{value:n}=t;if(kd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return UP.stringifyNumber(t)}var HG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Hg(t,2,2,r),stringify:t=>G_(t,2,"0b")},BG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Hg(t,1,8,r),stringify:t=>G_(t,8,"0")},VG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Hg(t,0,10,r),stringify:UP.stringifyNumber},WG={identify:kd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Hg(t,2,16,r),stringify:t=>G_(t,16,"0x")};Pd.int=VG;Pd.intBin=HG;Pd.intHex=WG;Pd.intOct=BG});var K_=H(Y_=>{"use strict";var Wg=et(),Bg=Ro(),Vg=xo(),Wa=class t extends Vg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Wg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Bg.Pair(e.key,null):r=new Bg.Pair(e,null),Vg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Vg.findPair(this.items,e);return!r&&Wg.isPair(n)?Wg.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=Vg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Bg.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 o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(Bg.createPair(o,null,n));return s}};Wa.tag="tag:yaml.org,2002:set";var zG={collection:"map",identify:t=>t instanceof Set,nodeClass:Wa,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Wa.from(t,e,r),resolve(t,e){if(Wg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Wa,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Y_.YAMLSet=Wa;Y_.set=zG});var Z_=H(zg=>{"use strict";var JG=ic();function Q_(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function BP(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return JG.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(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var GG={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})=>Q_(t,r),stringify:BP},YG={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=>Q_(t,!1),stringify:BP},VP={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(VP.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,n-1,i,s||0,o||0,l||0,f),p=e[8];if(p&&p!=="Z"){let h=Q_(p,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};zg.floatTime=YG;zg.intTime=GG;zg.timestamp=VP});var JP=H(zP=>{"use strict";var KG=rc(),QG=Ag(),ZG=nc(),XG=Id(),eY=U_(),WP=LP(),X_=jP(),Jg=HP(),tY=xg(),rY=W_(),nY=jg(),iY=K_(),eR=Z_(),sY=[KG.map,ZG.seq,XG.string,QG.nullTag,WP.trueTag,WP.falseTag,Jg.intBin,Jg.intOct,Jg.int,Jg.intHex,X_.floatNaN,X_.floatExp,X_.float,eY.binary,tY.merge,rY.omap,nY.pairs,iY.set,eR.intTime,eR.floatTime,eR.timestamp];zP.schema=sY});var nT=H(nR=>{"use strict";var QP=rc(),oY=Ag(),ZP=nc(),aY=Id(),lY=A_(),tR=N_(),rR=F_(),uY=EP(),cY=qP(),XP=U_(),Td=xg(),eT=W_(),tT=jg(),GP=JP(),rT=K_(),Gg=Z_(),YP=new Map([["core",uY.schema],["failsafe",[QP.map,ZP.seq,aY.string]],["json",cY.schema],["yaml11",GP.schema],["yaml-1.1",GP.schema]]),KP={binary:XP.binary,bool:lY.boolTag,float:tR.float,floatExp:tR.floatExp,floatNaN:tR.floatNaN,floatTime:Gg.floatTime,int:rR.int,intHex:rR.intHex,intOct:rR.intOct,intTime:Gg.intTime,map:QP.map,merge:Td.merge,null:oY.nullTag,omap:eT.omap,pairs:tT.pairs,seq:ZP.seq,set:rT.set,timestamp:Gg.timestamp},fY={"tag:yaml.org,2002:binary":XP.binary,"tag:yaml.org,2002:merge":Td.merge,"tag:yaml.org,2002:omap":eT.omap,"tag:yaml.org,2002:pairs":tT.pairs,"tag:yaml.org,2002:set":rT.set,"tag:yaml.org,2002:timestamp":Gg.timestamp};function dY(t,e,r){let n=YP.get(e);if(n&&!t)return r&&!n.includes(Td.merge)?n.concat(Td.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(YP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).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(Td.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?KP[o]:o;if(!l){let f=JSON.stringify(o),c=Object.keys(KP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}nR.coreKnownTags=fY;nR.getTags=dY});var oR=H(iT=>{"use strict";var iR=et(),pY=rc(),hY=nc(),mY=Id(),Yg=nT(),gY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,sR=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Yg.getTags(e,"compat"):e?Yg.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Yg.coreKnownTags:{},this.tags=Yg.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,iR.MAP,{value:pY.map}),Object.defineProperty(this,iR.SCALAR,{value:mY.string}),Object.defineProperty(this,iR.SEQ,{value:hY.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?gY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};iT.Schema=sR});var oT=H(sT=>{"use strict";var yY=et(),aR=Cd(),Ad=Sd();function vY(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=aR.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Ad.indentComment(f,""))}let o=!1,l=null;if(t.contents){if(yY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(Ad.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>o=!0,c=aR.stringify(t.contents,i,()=>l=null,f);l&&(c+=Ad.lineComment(c,"",s(l))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(aR.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
149
149
|
`)?(r.push("..."),r.push(Ad.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&o&&(f=f.replace(/^\n+/,"")),f&&((!o||l)&&r[r.length-1]!==""&&r.push(""),r.push(Ad.indentComment(s(f),"")))}return r.join(`
|
|
150
150
|
`)+`
|
|
151
151
|
`}sT.stringifyDocument=vY});var $d=H(aT=>{"use strict";var bY=vd(),sc=mg(),$n=et(),SY=Ro(),wY=bo(),_Y=oR(),RY=oT(),lR=fg(),CY=d_(),xY=bd(),uR=f_(),cR=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:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new uR.Directives({version:o}),this.setSchema(o,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){oc(this.contents)&&this.contents.add(e)}addIn(e,r){oc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=lR.anchorNames(this);e.anchor=!r||n.has(r)?lR.findNewAnchor(r||"a",n):r}return new bY.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 E=T=>typeof T=="number"||T instanceof String||T instanceof Number,k=r.filter(E).map(String);k.length>0&&(r=r.concat(k)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:f,onTagObj:c,tag:p}=n??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=lR.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:v},w=xY.createNode(e,p,_);return l&&$n.isCollection(w)&&(w.flow=!0),g(),w}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new SY.Pair(i,s)}delete(e){return oc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):oc(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 sc.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 sc.isEmptyPath(e)?this.contents!==void 0:$n.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=sc.collectionFromPath(this.schema,[e],r):oc(this.contents)&&this.contents.set(e,r)}setIn(e,r){sc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=sc.collectionFromPath(this.schema,Array.from(e),r):oc(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 uR.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 uR.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 _Y.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:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=wY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:c,res:p}of l.anchors.values())s(p,c);return typeof o=="function"?CY.applyReviver(o,{"":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 RY.stringifyDocument(this,e)}};function oc(t){if($n.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}aT.Document=cR});var Fd=H(Md=>{"use strict";var Nd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},fR=class extends Nd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},dR=class extends Nd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},EY=(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,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
@@ -153,14 +153,14 @@ ${s.comment}`:n.comment}n=i}t.items[r]=Dg.isPair(n)?n:new H_.Pair(n)}}else e("Ex
|
|
|
153
153
|
|
|
154
154
|
${o}
|
|
155
155
|
${c}
|
|
156
|
-
`}};Md.YAMLError=Nd;Md.YAMLParseError=fR;Md.YAMLWarning=dR;Md.prettifyError=EY});var Dd=H(lT=>{"use strict";function IY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let f=!1,c=l,p=l,h="",g="",v=!1,_=!1,w=null,E=null,k=null,T=null,N=null,$=null,j=null;for(let C of t)switch(_&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&s(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),w&&(c&&C.type!=="comment"&&C.type!=="newline"&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),C.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(w=C),p=!0;break;case"comment":{p||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=C.source.substring(1)||" ";h?h+=g+A:h=A,g="",c=!1;break}case"newline":c?h?h+=C.source:(!$||r!=="seq-item-ind")&&(f=!0):g+=C.source,c=!0,v=!0,(E||k)&&(T=C),p=!0;break;case"anchor":E&&s(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&s(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=C,j??(j=C.offset),c=!1,p=!1,_=!0;break;case"tag":{k&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),k=C,j??(j=C.offset),c=!1,p=!1,_=!0;break}case r:(E||k)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),$&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),$=C,c=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){N&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),N=C,c=!1,p=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,p=!1}let G=t[t.length-1],
|
|
157
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(pR(e.key)||pR(e.value))return!0}return!1;default:return!0}}uT.containsNewline=pR});var hR=H(cT=>{"use strict";var
|
|
156
|
+
`}};Md.YAMLError=Nd;Md.YAMLParseError=fR;Md.YAMLWarning=dR;Md.prettifyError=EY});var Dd=H(lT=>{"use strict";function IY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let f=!1,c=l,p=l,h="",g="",v=!1,_=!1,w=null,E=null,k=null,T=null,N=null,$=null,j=null;for(let C of t)switch(_&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&s(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),w&&(c&&C.type!=="comment"&&C.type!=="newline"&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),C.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(w=C),p=!0;break;case"comment":{p||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=C.source.substring(1)||" ";h?h+=g+A:h=A,g="",c=!1;break}case"newline":c?h?h+=C.source:(!$||r!=="seq-item-ind")&&(f=!0):g+=C.source,c=!0,v=!0,(E||k)&&(T=C),p=!0;break;case"anchor":E&&s(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&s(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=C,j??(j=C.offset),c=!1,p=!1,_=!0;break;case"tag":{k&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),k=C,j??(j=C.offset),c=!1,p=!1,_=!0;break}case r:(E||k)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),$&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),$=C,c=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){N&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),N=C,c=!1,p=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,p=!1}let G=t[t.length-1],q=G?G.offset+G.source.length:i;return _&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w&&(c&&w.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:$,spaceBefore:f,comment:h,hasNewline:v,anchor:E,tag:k,newlineAfterProp:T,end:q,start:j??q}}lT.resolveProps=IY});var Kg=H(uT=>{"use strict";function pR(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
157
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(pR(e.key)||pR(e.value))return!0}return!1;default:return!0}}uT.containsNewline=pR});var hR=H(cT=>{"use strict";var OY=Kg();function qY(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&OY.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}cT.flowIndentCheck=qY});var mR=H(dT=>{"use strict";var fT=et();function kY(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||fT.isScalar(s)&&fT.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}dT.mapIncludes=kY});var vT=H(yT=>{"use strict";var pT=Ro(),PY=xo(),hT=Dd(),TY=Kg(),mT=hR(),AY=mR(),gT="All mapping items must start at the same column";function $Y({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??PY.YAMLMap,l=new o(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,c=null;for(let p of n.items){let{start:h,key:g,sep:v,value:_}=p,w=hT.resolveProps(h,{indicator:"explicit-key-ind",next:g??v?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),E=!w.found;if(E){if(g&&(g.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==n.indent&&i(f,"BAD_INDENT",gT)),!w.anchor&&!w.tag&&!v){c=w.end,w.comment&&(l.comment?l.comment+=`
|
|
158
158
|
`+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||TY.containsNewline(g))&&i(g??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==n.indent&&i(f,"BAD_INDENT",gT);r.atKey=!0;let k=w.end,T=g?t(r,g,w,i):e(r,k,h,null,w,i);r.schema.compat&&mT.flowIndentCheck(n.indent,g,i),r.atKey=!1,AY.mapIncludes(r,l.items,T)&&i(k,"DUPLICATE_KEY","Map keys must be unique");let N=hT.resolveProps(v??[],{indicator:"map-value-ind",next:_,offset:T.range[2],onError:i,parentIndent:n.indent,startOnNewline:!g||g.type==="block-scalar"});if(f=N.end,N.found){E&&(_?.type==="block-map"&&!N.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&w.start<N.found.offset-1024&&i(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let $=_?t(r,_,N,i):e(r,f,v,null,N,i);r.schema.compat&&mT.flowIndentCheck(n.indent,_,i),f=$.range[2];let j=new pT.Pair(T,$);r.options.keepSourceTokens&&(j.srcToken=p),l.items.push(j)}else{E&&i(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(T.comment?T.comment+=`
|
|
159
159
|
`+N.comment:T.comment=N.comment);let $=new pT.Pair(T);r.options.keepSourceTokens&&($.srcToken=p),l.items.push($)}}return c&&c<f&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,c??f],l}yT.resolveBlockMap=$Y});var ST=H(bT=>{"use strict";var NY=Eo(),MY=Dd(),FY=hR();function DY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??NY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,c=null;for(let{start:p,value:h}of n.items){let g=MY.resolveProps(p,{indicator:"seq-item-ind",next:h,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)h?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{c=g.end,g.comment&&(l.comment=g.comment);continue}let v=h?t(r,h,g,i):e(r,g.end,p,null,g,i);r.schema.compat&&FY.flowIndentCheck(n.indent,h,i),f=v.range[2],l.items.push(v)}return l.range=[n.offset,f,c??f],l}bT.resolveBlockSeq=DY});var ac=H(wT=>{"use strict";function LY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:f,type:c}=l;switch(c){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 p=f.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=f.length}}return{comment:i,offset:e}}wT.resolveEnd=LY});var xT=H(CT=>{"use strict";var jY=et(),UY=Ro(),_T=xo(),HY=Eo(),BY=ac(),RT=Dd(),VY=Kg(),WY=mR(),gR="Block collections are not allowed within flow collections",yR=t=>t&&(t.type==="block-map"||t.type==="block-seq");function zY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",f=s?.nodeClass??(o?_T.YAMLMap:HY.YAMLSeq),c=new f(r.schema);c.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E<n.items.length;++E){let k=n.items[E],{start:T,key:N,sep:$,value:j}=k,G=RT.resolveProps(T,{flow:l,indicator:"explicit-key-ind",next:N??$?.[0],offset:h,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!G.found){if(!G.anchor&&!G.tag&&!$&&!j){E===0&&G.comma?i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):E<n.items.length-1&&i(G.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),G.comment&&(c.comment?c.comment+=`
|
|
160
|
-
`+G.comment:c.comment=G.comment),h=G.end;continue}!o&&r.options.strict&&VY.containsNewline(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)G.comma&&i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(G.comma||i(G.start,"MISSING_CHAR",`Missing , between ${l} items`),G.comment){let
|
|
161
|
-
`+
|
|
162
|
-
`+A.comment:C.comment=A.comment);let B=new UY.Pair(C,D);if(r.options.keepSourceTokens&&(B.srcToken=k),o){let F=c;WY.mapIncludes(r,F.items,C)&&i(
|
|
163
|
-
`+E.comment:c.comment=E.comment),c.range=[n.offset,w,E.offset]}else c.range=[n.offset,w,w];return c}CT.resolveFlowCollection=zY});var IT=H(ET=>{"use strict";var JY=et(),GY=Vt(),YY=xo(),KY=Eo(),QY=vT(),ZY=ST(),XY=xT();function vR(t,e,r,n,i,s){let o=r.type==="block-map"?QY.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?ZY.resolveBlockSeq(t,e,r,n,s):XY.resolveFlowCollection(t,e,r,n,s),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}function eK(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,g=>i(s,"TAG_RESOLVE_FAILED",g)):null;if(r.type==="block-seq"){let{anchor:g,newlineAfterProp:v}=n,_=g&&s?g.offset>s.offset?g:s:g??s;_&&(!v||v.offset<_.offset)&&i(_,"MISSING_CHAR","Missing newline after block sequence props")}let l=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===YY.YAMLMap.tagName&&l==="map"||o===KY.YAMLSeq.tagName&&l==="seq")return vR(t,e,r,i,o);let f=e.schema.tags.find(g=>g.tag===o&&g.collection===l);if(!f){let g=e.schema.knownTags[o];if(g?.collection===l)e.schema.tags.push(Object.assign({},g,{default:!1})),f=g;else return g?i(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${l} collection, but expects ${g.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),vR(t,e,r,i,o)}let c=vR(t,e,r,i,o,f),p=f.resolve?.(c,g=>i(s,"TAG_RESOLVE_FAILED",g),e.options)??c,h=JY.isNode(p)?p:new GY.Scalar(p);return h.range=c.range,h.tag=o,f?.format&&(h.format=f.format),h}ET.composeCollection=eK});var SR=H(
|
|
160
|
+
`+G.comment:c.comment=G.comment),h=G.end;continue}!o&&r.options.strict&&VY.containsNewline(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)G.comma&&i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(G.comma||i(G.start,"MISSING_CHAR",`Missing , between ${l} items`),G.comment){let q="";e:for(let C of T)switch(C.type){case"comma":case"space":break;case"comment":q=C.source.substring(1);break e;default:break e}if(q){let C=c.items[c.items.length-1];jY.isPair(C)&&(C=C.value??C.key),C.comment?C.comment+=`
|
|
161
|
+
`+q:C.comment=q,G.comment=G.comment.substring(q.length+1)}}if(!o&&!$&&!G.found){let q=j?t(r,j,G,i):e(r,G.end,$,null,G,i);c.items.push(q),h=q.range[2],yR(j)&&i(q.range,"BLOCK_IN_FLOW",gR)}else{r.atKey=!0;let q=G.end,C=N?t(r,N,G,i):e(r,q,T,null,G,i);yR(N)&&i(C.range,"BLOCK_IN_FLOW",gR),r.atKey=!1;let A=RT.resolveProps($??[],{flow:l,indicator:"map-value-ind",next:j,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!G.found&&r.options.strict){if($)for(let F of $){if(F===A.found)break;if(F.type==="newline"){i(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}G.start<A.found.offset-1024&&i(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source?.[0]===":"?i(j,"MISSING_CHAR",`Missing space after : in ${l}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let D=j?t(r,j,A,i):A.found?e(r,A.end,$,null,A,i):null;D?yR(j)&&i(D.range,"BLOCK_IN_FLOW",gR):A.comment&&(C.comment?C.comment+=`
|
|
162
|
+
`+A.comment:C.comment=A.comment);let B=new UY.Pair(C,D);if(r.options.keepSourceTokens&&(B.srcToken=k),o){let F=c;WY.mapIncludes(r,F.items,C)&&i(q,"DUPLICATE_KEY","Map keys must be unique"),F.items.push(B)}else{let F=new _T.YAMLMap(r.schema);F.flow=!0,F.items.push(B);let K=(D??C).range;F.range=[C.range[0],K[1],K[2]],c.items.push(F)}h=D?D.range[2]:A.end}}let g=o?"}":"]",[v,..._]=n.end,w=h;if(v?.source===g)w=v.offset+v.source.length;else{let E=l[0].toUpperCase()+l.substring(1),k=p?`${E} must end with a ${g}`:`${E} in block collection must be sufficiently indented and end with a ${g}`;i(h,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&_.unshift(v)}if(_.length>0){let E=BY.resolveEnd(_,w,r.options.strict,i);E.comment&&(c.comment?c.comment+=`
|
|
163
|
+
`+E.comment:c.comment=E.comment),c.range=[n.offset,w,E.offset]}else c.range=[n.offset,w,w];return c}CT.resolveFlowCollection=zY});var IT=H(ET=>{"use strict";var JY=et(),GY=Vt(),YY=xo(),KY=Eo(),QY=vT(),ZY=ST(),XY=xT();function vR(t,e,r,n,i,s){let o=r.type==="block-map"?QY.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?ZY.resolveBlockSeq(t,e,r,n,s):XY.resolveFlowCollection(t,e,r,n,s),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}function eK(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,g=>i(s,"TAG_RESOLVE_FAILED",g)):null;if(r.type==="block-seq"){let{anchor:g,newlineAfterProp:v}=n,_=g&&s?g.offset>s.offset?g:s:g??s;_&&(!v||v.offset<_.offset)&&i(_,"MISSING_CHAR","Missing newline after block sequence props")}let l=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===YY.YAMLMap.tagName&&l==="map"||o===KY.YAMLSeq.tagName&&l==="seq")return vR(t,e,r,i,o);let f=e.schema.tags.find(g=>g.tag===o&&g.collection===l);if(!f){let g=e.schema.knownTags[o];if(g?.collection===l)e.schema.tags.push(Object.assign({},g,{default:!1})),f=g;else return g?i(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${l} collection, but expects ${g.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),vR(t,e,r,i,o)}let c=vR(t,e,r,i,o,f),p=f.resolve?.(c,g=>i(s,"TAG_RESOLVE_FAILED",g),e.options)??c,h=JY.isNode(p)?p:new GY.Scalar(p);return h.range=c.range,h.tag=o,f?.format&&(h.format=f.format),h}ET.composeCollection=eK});var SR=H(OT=>{"use strict";var bR=Vt();function tK(t,e,r){let n=e.offset,i=rK(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?bR.Scalar.BLOCK_FOLDED:bR.Scalar.BLOCK_LITERAL,o=e.source?nK(e.source):[],l=o.length;for(let w=o.length-1;w>=0;--w){let E=o[w][1];if(E===""||E==="\r")l=w;else break}if(l===0){let w=i.chomp==="+"&&o.length>0?`
|
|
164
164
|
`.repeat(Math.max(1,o.length-1)):"",E=n+i.length;return e.source&&(E+=e.source.length),{value:w,type:s,comment:i.comment,range:[n,E,E]}}let f=e.indent+i.indent,c=e.offset+i.length,p=0;for(let w=0;w<l;++w){let[E,k]=o[w];if(k===""||k==="\r")i.indent===0&&E.length>f&&(f=E.length);else{E.length<f&&r(c+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=E.length),p=w,f===0&&!t.atRoot&&r(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=E.length+k.length+1}for(let w=o.length-1;w>=l;--w)o[w][0].length>f&&(l=w+1);let h="",g="",v=!1;for(let w=0;w<p;++w)h+=o[w][0].slice(f)+`
|
|
165
165
|
`;for(let w=p;w<l;++w){let[E,k]=o[w];c+=E.length+k.length+1;let T=k[k.length-1]==="\r";if(T&&(k=k.slice(0,-1)),k&&E.length<f){let $=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(c-k.length-(T?2:1),"BAD_INDENT",$),E=""}s===bR.Scalar.BLOCK_LITERAL?(h+=g+E.slice(f)+k,g=`
|
|
166
166
|
`):E.length>f||k[0]===" "?(g===" "?g=`
|
|
@@ -175,7 +175,7 @@ ${c}
|
|
|
175
175
|
`+o[w][0].slice(f);h[h.length-1]!==`
|
|
176
176
|
`&&(h+=`
|
|
177
177
|
`);break;default:h+=`
|
|
178
|
-
`}let _=n+i.length+e.source.length;return{value:h,type:s,comment:i.comment,range:[n,_,_]}}function rK({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],o=0,l="",f=-1;for(let g=1;g<i.length;++g){let v=i[g];if(!l&&(v==="-"||v==="+"))l=v;else{let _=Number(v);!o&&_?o=_:f===-1&&(f=t+g)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",h=i.length;for(let g=1;g<e.length;++g){let v=e[g];switch(v.type){case"space":c=!0;case"newline":h+=v.source.length;break;case"comment":r&&!c&&n(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=v.source.length,p=v.source.substring(1);break;case"error":n(v,"UNEXPECTED_TOKEN",v.message),h+=v.source.length;break;default:{let _=`Unexpected token in block scalar header: ${v.type}`;n(v,"UNEXPECTED_TOKEN",_);let w=v.source;w&&typeof w=="string"&&(h+=w.length)}}}return{mode:s,indent:o,chomp:l,comment:p,length:h}}function nK(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 o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}
|
|
178
|
+
`}let _=n+i.length+e.source.length;return{value:h,type:s,comment:i.comment,range:[n,_,_]}}function rK({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],o=0,l="",f=-1;for(let g=1;g<i.length;++g){let v=i[g];if(!l&&(v==="-"||v==="+"))l=v;else{let _=Number(v);!o&&_?o=_:f===-1&&(f=t+g)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",h=i.length;for(let g=1;g<e.length;++g){let v=e[g];switch(v.type){case"space":c=!0;case"newline":h+=v.source.length;break;case"comment":r&&!c&&n(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=v.source.length,p=v.source.substring(1);break;case"error":n(v,"UNEXPECTED_TOKEN",v.message),h+=v.source.length;break;default:{let _=`Unexpected token in block scalar header: ${v.type}`;n(v,"UNEXPECTED_TOKEN",_);let w=v.source;w&&typeof w=="string"&&(h+=w.length)}}}return{mode:s,indent:o,chomp:l,comment:p,length:h}}function nK(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 o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}OT.resolveBlockScalar=tK});var _R=H(kT=>{"use strict";var wR=Vt(),iK=ac();function sK(t,e,r){let{offset:n,type:i,source:s,end:o}=t,l,f,c=(g,v,_)=>r(n+g,v,_);switch(i){case"scalar":l=wR.Scalar.PLAIN,f=oK(s,c);break;case"single-quoted-scalar":l=wR.Scalar.QUOTE_SINGLE,f=aK(s,c);break;case"double-quoted-scalar":l=wR.Scalar.QUOTE_DOUBLE,f=lK(s,c);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 p=n+s.length,h=iK.resolveEnd(o,p,e,r);return{value:f,type:l,comment:h.comment,range:[n,p,h.offset]}}function oK(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}`),qT(t)}function aK(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),qT(t.slice(1,-1)).replace(/''/g,"'")}function qT(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
179
179
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
180
180
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",o=e.lastIndex;for(r.lastIndex=o;n=r.exec(t);)n[1]===""?s===`
|
|
181
181
|
`?i+=s:s=`
|
|
@@ -190,13 +190,13 @@ ${c}
|
|
|
190
190
|
`);)n===`
|
|
191
191
|
`&&(r+=`
|
|
192
192
|
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var cK={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fK(t,e,r,n){let i=t.substr(e,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}kT.resolveFlowScalar=sK});var AT=H(TT=>{"use strict";var za=et(),PT=Vt(),dK=SR(),pK=_R();function hK(t,e,r,n){let{value:i,type:s,comment:o,range:l}=e.type==="block-scalar"?dK.resolveBlockScalar(t,e,n):pK.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[za.SCALAR]:f?c=mK(t.schema,i,f,r,n):e.type==="scalar"?c=gK(t,i,e,n):c=t.schema[za.SCALAR];let p;try{let h=c.resolve(i,g=>n(r??e,"TAG_RESOLVE_FAILED",g),t.options);p=za.isScalar(h)?h:new PT.Scalar(h)}catch(h){let g=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",g),p=new PT.Scalar(i)}return p.range=l,p.source=i,s&&(p.type=s),f&&(p.tag=f),c.format&&(p.format=c.format),o&&(p.comment=o),p}function mK(t,e,r,n,i){if(r==="!")return t[za.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 o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[za.SCALAR])}function gK({atKey:t,directives:e,schema:r},n,i,s){let o=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[za.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[za.SCALAR];if(o.tag!==l.tag){let f=e.tagString(o.tag),c=e.tagString(l.tag),p=`Value may be parsed as either ${f} or ${c}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}TT.composeScalar=hK});var NT=H($T=>{"use strict";function yK(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}$T.emptyScalarPosition=yK});var DT=H(CR=>{"use strict";var vK=vd(),bK=et(),SK=IT(),MT=AT(),wK=ac(),_K=NT(),RK={composeNode:FT,composeEmptyNode:RR};function FT(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:f}=r,c,p=!0;switch(e.type){case"alias":c=CK(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":c=MT.composeScalar(t,e,f,n),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=SK.composeCollection(RK,t,e,r,n),l&&(c.anchor=l.source.substring(1))}catch(h){let g=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",g)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),p=!1}}return c??(c=RR(t,e.offset,void 0,null,r,n)),l&&c.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!bK.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&p&&(c.srcToken=e),c}function RR(t,e,r,n,{spaceBefore:i,comment:s,anchor:o,tag:l,end:f},c){let p={type:"scalar",offset:_K.emptyScalarPosition(e,r,n),indent:-1,source:""},h=MT.composeScalar(t,p,l,c);return o&&(h.anchor=o.source.substring(1),h.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=f),h}function CK({options:t},{offset:e,source:r,end:n},i){let s=new vK.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 o=e+r.length,l=wK.resolveEnd(n,o,t.strict,i);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}CR.composeEmptyNode=RR;CR.composeNode=FT});var UT=H(jT=>{"use strict";var xK=$d(),LT=DT(),EK=ac(),IK=Dd();function
|
|
193
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fK(t,e,r,n){let i=t.substr(e,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}kT.resolveFlowScalar=sK});var AT=H(TT=>{"use strict";var za=et(),PT=Vt(),dK=SR(),pK=_R();function hK(t,e,r,n){let{value:i,type:s,comment:o,range:l}=e.type==="block-scalar"?dK.resolveBlockScalar(t,e,n):pK.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[za.SCALAR]:f?c=mK(t.schema,i,f,r,n):e.type==="scalar"?c=gK(t,i,e,n):c=t.schema[za.SCALAR];let p;try{let h=c.resolve(i,g=>n(r??e,"TAG_RESOLVE_FAILED",g),t.options);p=za.isScalar(h)?h:new PT.Scalar(h)}catch(h){let g=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",g),p=new PT.Scalar(i)}return p.range=l,p.source=i,s&&(p.type=s),f&&(p.tag=f),c.format&&(p.format=c.format),o&&(p.comment=o),p}function mK(t,e,r,n,i){if(r==="!")return t[za.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 o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[za.SCALAR])}function gK({atKey:t,directives:e,schema:r},n,i,s){let o=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[za.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[za.SCALAR];if(o.tag!==l.tag){let f=e.tagString(o.tag),c=e.tagString(l.tag),p=`Value may be parsed as either ${f} or ${c}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}TT.composeScalar=hK});var NT=H($T=>{"use strict";function yK(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}$T.emptyScalarPosition=yK});var DT=H(CR=>{"use strict";var vK=vd(),bK=et(),SK=IT(),MT=AT(),wK=ac(),_K=NT(),RK={composeNode:FT,composeEmptyNode:RR};function FT(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:f}=r,c,p=!0;switch(e.type){case"alias":c=CK(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":c=MT.composeScalar(t,e,f,n),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=SK.composeCollection(RK,t,e,r,n),l&&(c.anchor=l.source.substring(1))}catch(h){let g=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",g)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),p=!1}}return c??(c=RR(t,e.offset,void 0,null,r,n)),l&&c.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!bK.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&p&&(c.srcToken=e),c}function RR(t,e,r,n,{spaceBefore:i,comment:s,anchor:o,tag:l,end:f},c){let p={type:"scalar",offset:_K.emptyScalarPosition(e,r,n),indent:-1,source:""},h=MT.composeScalar(t,p,l,c);return o&&(h.anchor=o.source.substring(1),h.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=f),h}function CK({options:t},{offset:e,source:r,end:n},i){let s=new vK.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 o=e+r.length,l=wK.resolveEnd(n,o,t.strict,i);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}CR.composeEmptyNode=RR;CR.composeNode=FT});var UT=H(jT=>{"use strict";var xK=$d(),LT=DT(),EK=ac(),IK=Dd();function OK(t,e,{offset:r,start:n,value:i,end:s},o){let l=Object.assign({_directives:e},t),f=new xK.Document(void 0,l),c={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},p=IK.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?LT.composeNode(c,i,p,o):LT.composeEmptyNode(c,p.end,n,null,p,o);let h=f.contents.range[2],g=EK.resolveEnd(s,h,!1,o);return g.comment&&(f.comment=g.comment),f.range=[r,h,g.offset],f}jT.composeDoc=OK});var ER=H(VT=>{"use strict";var qK=require("process"),kK=f_(),PK=$d(),Ld=Fd(),HT=et(),TK=UT(),AK=ac();function jd(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 BT(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
|
|
194
194
|
|
|
195
195
|
`:`
|
|
196
196
|
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var xR=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let o=jd(r);s?this.warnings.push(new Ld.YAMLWarning(o,n,i)):this.errors.push(new Ld.YAMLParseError(o,n,i))},this.directives=new kK.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=BT(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
197
197
|
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(HT.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];HT.isPair(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${n}
|
|
198
198
|
${l}`:n}else{let o=s.commentBefore;s.commentBefore=o?`${n}
|
|
199
|
-
${o}`: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:BT(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(
|
|
199
|
+
${o}`: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:BT(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(qK.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=jd(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=TK.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 Ld.YAMLParseError(jd(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 Ld.YAMLParseError(jd(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=AK.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
200
200
|
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ld.YAMLParseError(jd(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 PK.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}}};VT.Composer=xR});var JT=H(Qg=>{"use strict";var $K=SR(),NK=_R(),MK=Fd(),WT=Rd();function FK(t,e=!0,r){if(t){let n=(i,s,o)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(l,s,o);else throw new MK.YAMLParseError([l,l+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return NK.resolveFlowScalar(t,e,n);case"block-scalar":return $K.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function DK(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,l=WT.stringifyString({type:o,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
201
201
|
`}];switch(l[0]){case"|":case">":{let c=l.indexOf(`
|
|
202
202
|
`),p=l.substring(0,c),h=l.substring(c+1)+`
|
|
@@ -205,9 +205,9 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
205
205
|
`),n=e.substring(0,r),i=e.substring(r+1)+`
|
|
206
206
|
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,o="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:o,source:n}];zT(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
|
|
207
207
|
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:o,props:l,source:i})}}function zT(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 IR(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
208
|
-
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Qg.createScalarToken=DK;Qg.resolveAsScalar=FK;Qg.setScalarValue=LK});var YT=H(GT=>{"use strict";var UK=t=>"type"in t?Xg(t):Zg(t);function Xg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Xg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Zg(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Zg(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Zg(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 Zg({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Xg(e)),r)for(let s of r)i+=s.source;return n&&(i+=Xg(n)),i}GT.stringify=UK});var XT=H(ZT=>{"use strict";var
|
|
208
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Qg.createScalarToken=DK;Qg.resolveAsScalar=FK;Qg.setScalarValue=LK});var YT=H(GT=>{"use strict";var UK=t=>"type"in t?Xg(t):Zg(t);function Xg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Xg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Zg(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Zg(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Zg(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 Zg({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Xg(e)),r)for(let s of r)i+=s.source;return n&&(i+=Xg(n)),i}GT.stringify=UK});var XT=H(ZT=>{"use strict";var OR=Symbol("break visit"),HK=Symbol("skip children"),KT=Symbol("remove item");function Ja(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),QT(Object.freeze([]),t,e)}Ja.BREAK=OR;Ja.SKIP=HK;Ja.REMOVE=KT;Ja.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};Ja.parentCollection=(t,e)=>{let r=Ja.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 QT(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 o=0;o<s.items.length;++o){let l=QT(Object.freeze(t.concat([[i,o]])),s.items[o],r);if(typeof l=="number")o=l-1;else{if(l===OR)return OR;l===KT&&(s.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}ZT.visit=Ja});var ey=H(Kr=>{"use strict";var qR=JT(),BK=YT(),VK=XT(),kR="\uFEFF",PR="",TR="",AR="",WK=t=>!!t&&"items"in t,zK=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function JK(t){switch(t){case kR:return"<BOM>";case PR:return"<DOC>";case TR:return"<FLOW_END>";case AR:return"<SCALAR>";default:return JSON.stringify(t)}}function GK(t){switch(t){case kR:return"byte-order-mark";case PR:return"doc-mode";case TR:return"flow-error-end";case AR:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
209
209
|
`:case`\r
|
|
210
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Kr.createScalarToken=
|
|
210
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Kr.createScalarToken=qR.createScalarToken;Kr.resolveAsScalar=qR.resolveAsScalar;Kr.setScalarValue=qR.setScalarValue;Kr.stringify=BK.stringify;Kr.visit=VK.visit;Kr.BOM=kR;Kr.DOCUMENT=PR;Kr.FLOW_END=TR;Kr.SCALAR=AR;Kr.isCollection=WK;Kr.isScalar=zK;Kr.prettyToken=JK;Kr.tokenType=GK});var MR=H(tA=>{"use strict";var Ud=ey();function oi(t){switch(t){case void 0:case" ":case`
|
|
211
211
|
`:case"\r":case" ":return!0;default:return!1}}var eA=new Set("0123456789ABCDEFabcdef"),YK=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ty=new Set(",[]{}"),KK=new Set(` ,[]{}
|
|
212
212
|
\r `),$R=t=>!t||KK.has(t),NR=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
213
213
|
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
@@ -230,36 +230,36 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
230
230
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
231
231
|
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){ny(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 o=[];for(let l=0;l<r.sep.length;++l){let f=r.sep[l];switch(f.type){case"newline":o.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=r.sep.splice(o[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(Io(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(oA(r.key)&&!Io(r.sep,"newline")){let o=lc(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:o,key:l,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(Io(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=lc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Io(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 o=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Io(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(o);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)){ny(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||Io(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=ry(n),s=lc(i);sA(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
232
232
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
233
|
-
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=ry(e),n=lc(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=ry(e),n=lc(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())}}};aA.Parser=LR});var dA=H(Bd=>{"use strict";var lA=ER(),XK=$d(),Hd=Fd(),e4=C_(),t4=et(),r4=DR(),uA=jR();function cA(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new r4.LineCounter||null,prettyErrors:e}}function n4(t,e={}){let{lineCounter:r,prettyErrors:n}=cA(e),i=new uA.Parser(r?.addNewLine),s=new lA.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Hd.prettifyError(t,r)),l.warnings.forEach(Hd.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function fA(t,e={}){let{lineCounter:r,prettyErrors:n}=cA(e),i=new uA.Parser(r?.addNewLine),s=new lA.Composer(e),o=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Hd.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Hd.prettifyError(t,r)),o.warnings.forEach(Hd.prettifyError(t,r))),o}function i4(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=fA(t,r);if(!i)return null;if(i.warnings.forEach(s=>e4.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 s4(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 t4.isDocument(t)&&!n?t.toString(r):new XK.Document(t,n,r).toString(r)}Bd.parse=i4;Bd.parseAllDocuments=n4;Bd.parseDocument=fA;Bd.stringify=s4});var Vd=H(pt=>{"use strict";var o4=ER(),a4=$d(),l4=oR(),UR=Fd(),u4=vd(),qo=et(),c4=Ro(),f4=Vt(),d4=xo(),p4=Eo(),h4=ey(),m4=MR(),g4=DR(),y4=jR(),iy=dA(),pA=hd();pt.Composer=o4.Composer;pt.Document=a4.Document;pt.Schema=l4.Schema;pt.YAMLError=UR.YAMLError;pt.YAMLParseError=UR.YAMLParseError;pt.YAMLWarning=UR.YAMLWarning;pt.Alias=u4.Alias;pt.isAlias=qo.isAlias;pt.isCollection=qo.isCollection;pt.isDocument=qo.isDocument;pt.isMap=qo.isMap;pt.isNode=qo.isNode;pt.isPair=qo.isPair;pt.isScalar=qo.isScalar;pt.isSeq=qo.isSeq;pt.Pair=c4.Pair;pt.Scalar=f4.Scalar;pt.YAMLMap=d4.YAMLMap;pt.YAMLSeq=p4.YAMLSeq;pt.CST=h4;pt.Lexer=m4.Lexer;pt.LineCounter=g4.LineCounter;pt.Parser=y4.Parser;pt.parse=iy.parse;pt.parseAllDocuments=iy.parseAllDocuments;pt.parseDocument=iy.parseDocument;pt.stringify=iy.stringify;pt.visit=pA.visit;pt.visitAsync=pA.visitAsync});var v4,b4,S4,w4,_4,R4,C4,bs,sy=se(()=>{"use strict";v4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,b4=/^\d{4}-\d{2}-\d{2}$/,S4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,w4=/^https?:\/\/[^\s]+$/,_4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,R4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,C4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,bs=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(v4.test(e))return"date-time";if(b4.test(e))return"date";if(S4.test(e))return"email";if(_4.test(e))return"uuid";if(w4.test(e))return"uri";if(R4.test(e))return"ipv4";if(C4.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||{},o=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(o)]);for(let h of l)s[h]&&o[h]?i.properties[h]=this.mergeSchemas(s[h],o[h]):s[h]?i.properties[h]={...s[h]}:i.properties[h]={...o[h]};let f=new Set(e.required||Object.keys(s)),c=new Set(r.required||Object.keys(o)),p=[...l].filter(h=>f.has(h)&&c.has(h));return p.length>0&&(i.required=p),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 hA,x4,Ga,HR=se(()=>{"use strict";hA=me(Vd());sy();x4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Ga=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new bs}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:c,scheme:p,requirement:h}=f;s.set(c,p),i.security=[h]}}let o=new Set,l=new Set;if(await this.processItems(n.items,i,s,o,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[f,c]of s)i.components.securitySchemes[f]=c;else delete i.components.securitySchemes;return i.tags=[...o].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"?hA.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 o=this.envConfigService.resolveVariables("{{baseUrl}}",s);o&&o!=="{{baseUrl}}"&&!i.has(o)&&(i.add(o),r.push({url:o,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,o,l,f){for(let c of e)if(c.type==="folder"){let p=c,h=o||p.name;i.add(h),p.items&&await this.processItems(p.items,r,n,i,s,h,l,f)}else{let p=c;await this.processRequest(p,r,n,i,s,o,l,f)}}async processRequest(e,r,n,i,s,o,l,f){let{path:c,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let h=(e.method||"GET").toLowerCase();r.paths[c]||(r.paths[c]={});let g={};g.operationId=this.generateOperationId(e,h,c,r),g.summary=this.cleanSummary(e.name),e.description&&(g.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(g.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(g.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),o&&(g.tags=[o]);let v=this.buildParameters(e);v.length>0&&(g.parameters=v);let _=await this.buildRequestBody(e,f);_&&(g.requestBody=_);let w=await this.buildResponses(e,l.id,f);g.responses=w;let E=this.buildOperationSecurity(e,l,n);E!==void 0&&(g.security=E);let k=r.paths[c][h];k?this.mergeOperation(k,g,e.name):r.paths[c][h]=g}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
233
|
+
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=ry(e),n=lc(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=ry(e),n=lc(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())}}};aA.Parser=LR});var dA=H(Bd=>{"use strict";var lA=ER(),XK=$d(),Hd=Fd(),e4=C_(),t4=et(),r4=DR(),uA=jR();function cA(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new r4.LineCounter||null,prettyErrors:e}}function n4(t,e={}){let{lineCounter:r,prettyErrors:n}=cA(e),i=new uA.Parser(r?.addNewLine),s=new lA.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Hd.prettifyError(t,r)),l.warnings.forEach(Hd.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function fA(t,e={}){let{lineCounter:r,prettyErrors:n}=cA(e),i=new uA.Parser(r?.addNewLine),s=new lA.Composer(e),o=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Hd.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Hd.prettifyError(t,r)),o.warnings.forEach(Hd.prettifyError(t,r))),o}function i4(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=fA(t,r);if(!i)return null;if(i.warnings.forEach(s=>e4.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 s4(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 t4.isDocument(t)&&!n?t.toString(r):new XK.Document(t,n,r).toString(r)}Bd.parse=i4;Bd.parseAllDocuments=n4;Bd.parseDocument=fA;Bd.stringify=s4});var Vd=H(pt=>{"use strict";var o4=ER(),a4=$d(),l4=oR(),UR=Fd(),u4=vd(),Oo=et(),c4=Ro(),f4=Vt(),d4=xo(),p4=Eo(),h4=ey(),m4=MR(),g4=DR(),y4=jR(),iy=dA(),pA=hd();pt.Composer=o4.Composer;pt.Document=a4.Document;pt.Schema=l4.Schema;pt.YAMLError=UR.YAMLError;pt.YAMLParseError=UR.YAMLParseError;pt.YAMLWarning=UR.YAMLWarning;pt.Alias=u4.Alias;pt.isAlias=Oo.isAlias;pt.isCollection=Oo.isCollection;pt.isDocument=Oo.isDocument;pt.isMap=Oo.isMap;pt.isNode=Oo.isNode;pt.isPair=Oo.isPair;pt.isScalar=Oo.isScalar;pt.isSeq=Oo.isSeq;pt.Pair=c4.Pair;pt.Scalar=f4.Scalar;pt.YAMLMap=d4.YAMLMap;pt.YAMLSeq=p4.YAMLSeq;pt.CST=h4;pt.Lexer=m4.Lexer;pt.LineCounter=g4.LineCounter;pt.Parser=y4.Parser;pt.parse=iy.parse;pt.parseAllDocuments=iy.parseAllDocuments;pt.parseDocument=iy.parseDocument;pt.stringify=iy.stringify;pt.visit=pA.visit;pt.visitAsync=pA.visitAsync});var v4,b4,S4,w4,_4,R4,C4,bs,sy=se(()=>{"use strict";v4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,b4=/^\d{4}-\d{2}-\d{2}$/,S4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,w4=/^https?:\/\/[^\s]+$/,_4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,R4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,C4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,bs=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(v4.test(e))return"date-time";if(b4.test(e))return"date";if(S4.test(e))return"email";if(_4.test(e))return"uuid";if(w4.test(e))return"uri";if(R4.test(e))return"ipv4";if(C4.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||{},o=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(o)]);for(let h of l)s[h]&&o[h]?i.properties[h]=this.mergeSchemas(s[h],o[h]):s[h]?i.properties[h]={...s[h]}:i.properties[h]={...o[h]};let f=new Set(e.required||Object.keys(s)),c=new Set(r.required||Object.keys(o)),p=[...l].filter(h=>f.has(h)&&c.has(h));return p.length>0&&(i.required=p),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 hA,x4,Ga,HR=se(()=>{"use strict";hA=me(Vd());sy();x4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Ga=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new bs}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:c,scheme:p,requirement:h}=f;s.set(c,p),i.security=[h]}}let o=new Set,l=new Set;if(await this.processItems(n.items,i,s,o,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[f,c]of s)i.components.securitySchemes[f]=c;else delete i.components.securitySchemes;return i.tags=[...o].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"?hA.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 o=this.envConfigService.resolveVariables("{{baseUrl}}",s);o&&o!=="{{baseUrl}}"&&!i.has(o)&&(i.add(o),r.push({url:o,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,o,l,f){for(let c of e)if(c.type==="folder"){let p=c,h=o||p.name;i.add(h),p.items&&await this.processItems(p.items,r,n,i,s,h,l,f)}else{let p=c;await this.processRequest(p,r,n,i,s,o,l,f)}}async processRequest(e,r,n,i,s,o,l,f){let{path:c,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let h=(e.method||"GET").toLowerCase();r.paths[c]||(r.paths[c]={});let g={};g.operationId=e.operationId||this.generateOperationId(e,h,c,r),g.summary=e.summary||this.cleanSummary(e.name),e.description&&(g.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(g.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(g.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let v=e.tags;if(v&&v.length>0){g.tags=v;for(let N of v)i.add(N)}else o&&(g.tags=[o]);let _=this.buildParameters(e);_.length>0&&(g.parameters=_);let w=await this.buildRequestBody(e,f);w&&(g.requestBody=w);let E=e.responses;E&&Object.keys(E).length>0?g.responses=this.mapResponseDefinitions(E):g.responses=await this.buildResponses(e,l.id,f);let k=e.security;if(k&&k.length>0)g.security=k;else{let N=this.buildOperationSecurity(e,l,n);N!==void 0&&(g.security=N)}let T=r.paths[c][h];T?this.mergeOperation(T,g,e.name):r.paths[c][h]=g}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
234
234
|
|
|
235
|
-
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(o=>o.name===i.name&&o.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||{},o=this.getConstraintKind(i),l=this.getConstraintKind(s);if(o==="none"&&l==="none")this.widenType(i,s);else if(o==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(o===l)this.mergeSameKindConstraints(i,s,o),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(c=>JSON.stringify(c)===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),c=this.buildVariantSchema(s);i.oneOf=[f,c]}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),o=this.collectOperationIds(i);if(o.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||o.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 o=i;o.oneOf?(s.schema={oneOf:o.oneOf},o.type&&(s.schema.type=o.type)):(s.schema={type:o.type||this.inferTypeFromValue(o.value)},o.format&&(s.schema.format=o.format),o.enum&&(s.schema.enum=o.enum),o.pattern&&(s.schema.pattern=o.pattern),o.minimum!==void 0&&(s.schema.minimum=o.minimum),o.maximum!==void 0&&(s.schema.maximum=o.maximum),o.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=o.exclusiveMinimum),o.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=o.exclusiveMaximum),o.multipleOf!==void 0&&(s.schema.multipleOf=o.multipleOf),o.minLength!==void 0&&(s.schema.minLength=o.minLength),o.maxLength!==void 0&&(s.schema.maxLength=o.maxLength),o.minItems!==void 0&&(s.schema.minItems=o.minItems),o.maxItems!==void 0&&(s.schema.maxItems=o.maxItems),o.uniqueItems&&(s.schema.uniqueItems=!0),o.nullable&&(s.schema.nullable=!0)),o.description&&(s.description=o.description),o.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(o.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||x4.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 o=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:o,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,o,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[h,g]of Object.entries(e.bodySchema.content)){let v={};g.schema&&(v.schema=g.schema),g.examples&&(v.examples=g.examples),g.encoding&&(v.encoding=g.encoding),i.content[h]=v}let p=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(p&&n.content){let h=this.tryParseBodyContent(n);h!==void 0&&i.content[p]&&(i.content[p].example=h)}return i}s=e.bodySchema.contentType||this.getContentType(n),o=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 p=this.tryParseBodyContent(n);p!==void 0?(o=this.inferrer.inferFromValue(p),l=p):o={type:"string"}}else o={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{o=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{o=this.buildFormDataSchemaFromBody(n);break}case"binary":{o={type:"string",format:"binary"};break}case"graphql":{o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let c={};return o&&(c.schema=o),l!==void 0&&(c.example=l),f&&(c.encoding=f),i.content[s]=c,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,o]of Object.entries(e.responseSchema.responses)){let l={description:o.description||`Status ${s}`};if(o.content){l.content={};for(let[f,c]of Object.entries(o.content)){let p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),l.content[f]=p}}else if(o.schema){let f=o.contentType||"application/json",c={schema:o.schema};o.examples&&(c.examples=o.examples),l.content={[f]:c}}if(o.headers){l.headers={};for(let[f,c]of Object.entries(o.headers))l.headers[f]={...c.description&&{description:c.description},schema:c.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:o,requirement:l}=i;return n.set(s,o),[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[o,l]of Object.entries(s)){let f=l;if(f.responses){for(let[c,p]of Object.entries(f.responses))if(p.content)for(let h of Object.values(p.content))h.schema&&this.trackSchema(h.schema,`${o}${i}Response${c}`,r,n)}if(f.requestBody?.content)for(let c of Object.values(f.requestBody.content))c.schema&&this.trackSchema(c.schema,`${o}${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 o of Object.values(s)){if(o.responses){for(let l of Object.values(o.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(o.requestBody?.content)for(let l of Object.values(o.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(o=>o.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(o=>!!o);for(let o of e){let l=`{{${o}}}`,f=!1;for(let c of s){let p=this.envConfigService.resolveVariables(l,c);p&&p!==l&&!i.has(p)&&(r.push({url:p,description:c}),i.add(p),f=!0)}if(!f){let c=`{${o}}`;i.has(c)||(r.push({url:c,variables:{[o]:{default:""}}}),i.add(c))}}}}});var Ya,BR=se(()=>{"use strict";Ya=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,o]of Object.entries(i))r.omitReadOnly&&o.readOnly||(n[s]=this.generate(o,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let o of e){let l=o.$ref?this.resolveLocalRef(o.$ref,n.components)||{}:o;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 oy=H(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.getDeepKeys=uc.toJSON=void 0;var E4=["function","symbol","undefined"],I4=["constructor","prototype","__proto__"],q4=Object.getPrototypeOf({});function O4(){let t={},e=this;for(let r of mA(e))if(typeof r=="string"){let n=e[r],i=typeof n;E4.includes(i)||(t[r]=n)}return t}uc.toJSON=O4;function mA(t,e=[]){let r=[];for(;t&&t!==q4;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(I4))n.delete(i);return n}uc.getDeepKeys=mA});var VR=H(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.addInspectMethod=cc.format=void 0;var gA=require("util"),k4=oy(),yA=gA.inspect.custom||Symbol.for("nodejs.util.inspect.custom");cc.format=gA.format;function P4(t){t[yA]=T4}cc.addInspectMethod=P4;function T4(){let t={},e=this;for(let r of k4.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[yA],t}});var SA=H(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.lazyJoinStacks=Di.joinStacks=Di.isWritableStack=Di.isLazyStack=void 0;var A4=/\r?\n/,$4=/\bono[ @]/;function N4(t){return!!(t&&t.configurable&&typeof t.get=="function")}Di.isLazyStack=N4;function M4(t){return!!(!t||t.writable||typeof t.set=="function")}Di.isWritableStack=M4;function vA(t,e){let r=bA(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
235
|
+
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(o=>o.name===i.name&&o.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||{},o=this.getConstraintKind(i),l=this.getConstraintKind(s);if(o==="none"&&l==="none")this.widenType(i,s);else if(o==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(o===l)this.mergeSameKindConstraints(i,s,o),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(c=>JSON.stringify(c)===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),c=this.buildVariantSchema(s);i.oneOf=[f,c]}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),o=this.collectOperationIds(i);if(o.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||o.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 o=i;o.oneOf?(s.schema={oneOf:o.oneOf},o.type&&(s.schema.type=o.type)):(s.schema={type:o.type||this.inferTypeFromValue(o.value)},o.format&&(s.schema.format=o.format),o.enum&&(s.schema.enum=o.enum),o.pattern&&(s.schema.pattern=o.pattern),o.minimum!==void 0&&(s.schema.minimum=o.minimum),o.maximum!==void 0&&(s.schema.maximum=o.maximum),o.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=o.exclusiveMinimum),o.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=o.exclusiveMaximum),o.multipleOf!==void 0&&(s.schema.multipleOf=o.multipleOf),o.minLength!==void 0&&(s.schema.minLength=o.minLength),o.maxLength!==void 0&&(s.schema.maxLength=o.maxLength),o.minItems!==void 0&&(s.schema.minItems=o.minItems),o.maxItems!==void 0&&(s.schema.maxItems=o.maxItems),o.uniqueItems&&(s.schema.uniqueItems=!0),o.nullable&&(s.schema.nullable=!0)),o.description&&(s.description=o.description),o.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(o.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||x4.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 o=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:o,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,o,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[h,g]of Object.entries(e.bodySchema.content)){let v={};g.schema&&(v.schema=g.schema),g.examples&&(v.examples=g.examples),g.encoding&&(v.encoding=g.encoding),i.content[h]=v}let p=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(p&&n.content){let h=this.tryParseBodyContent(n);h!==void 0&&i.content[p]&&(i.content[p].example=h)}return i}s=e.bodySchema.contentType||this.getContentType(n),o=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 p=this.tryParseBodyContent(n);p!==void 0?(o=this.inferrer.inferFromValue(p),l=p):o={type:"string"}}else o={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{o=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{o=this.buildFormDataSchemaFromBody(n);break}case"binary":{o={type:"string",format:"binary"};break}case"graphql":{o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let c={};return o&&(c.schema=o),l!==void 0&&(c.example=l),f&&(c.encoding=f),i.content[s]=c,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,o]of Object.entries(e.responseSchema.responses)){let l={description:o.description||`Status ${s}`};if(o.content){l.content={};for(let[f,c]of Object.entries(o.content)){let p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),l.content[f]=p}}else if(o.schema){let f=o.contentType||"application/json",c={schema:o.schema};o.examples&&(c.examples=o.examples),l.content={[f]:c}}if(o.headers){l.headers={};for(let[f,c]of Object.entries(o.headers))l.headers[f]={...c.description&&{description:c.description},schema:c.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}mapResponseDefinitions(e){let r={};for(let[n,i]of Object.entries(e)){let s={description:i.description||`Status ${n}`};if(i.schema||i.examples){let o=i.contentType||"application/json",l={};i.schema&&(l.schema=i.schema),i.examples&&Object.keys(i.examples).length>0&&(l.examples=i.examples),s.content={[o]:l}}if(i.headers&&Object.keys(i.headers).length>0){s.headers={};for(let[o,l]of Object.entries(i.headers)){let f=l;s.headers[o]={...f.description&&{description:f.description},...f.schema&&{schema:f.schema}}}}r[n]=s}return Object.keys(r).length===0&&(r[200]={description:"Successful response"}),r}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:o,requirement:l}=i;return n.set(s,o),[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[o,l]of Object.entries(s)){let f=l;if(f.responses){for(let[c,p]of Object.entries(f.responses))if(p.content)for(let h of Object.values(p.content))h.schema&&this.trackSchema(h.schema,`${o}${i}Response${c}`,r,n)}if(f.requestBody?.content)for(let c of Object.values(f.requestBody.content))c.schema&&this.trackSchema(c.schema,`${o}${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 o of Object.values(s)){if(o.responses){for(let l of Object.values(o.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(o.requestBody?.content)for(let l of Object.values(o.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(o=>o.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(o=>!!o);for(let o of e){let l=`{{${o}}}`,f=!1;for(let c of s){let p=this.envConfigService.resolveVariables(l,c);p&&p!==l&&!i.has(p)&&(r.push({url:p,description:c}),i.add(p),f=!0)}if(!f){let c=`{${o}}`;i.has(c)||(r.push({url:c,variables:{[o]:{default:""}}}),i.add(c))}}}}});var Ya,BR=se(()=>{"use strict";Ya=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,o]of Object.entries(i))r.omitReadOnly&&o.readOnly||(n[s]=this.generate(o,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let o of e){let l=o.$ref?this.resolveLocalRef(o.$ref,n.components)||{}:o;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 oy=H(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.getDeepKeys=uc.toJSON=void 0;var E4=["function","symbol","undefined"],I4=["constructor","prototype","__proto__"],O4=Object.getPrototypeOf({});function q4(){let t={},e=this;for(let r of mA(e))if(typeof r=="string"){let n=e[r],i=typeof n;E4.includes(i)||(t[r]=n)}return t}uc.toJSON=q4;function mA(t,e=[]){let r=[];for(;t&&t!==O4;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(I4))n.delete(i);return n}uc.getDeepKeys=mA});var VR=H(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.addInspectMethod=cc.format=void 0;var gA=require("util"),k4=oy(),yA=gA.inspect.custom||Symbol.for("nodejs.util.inspect.custom");cc.format=gA.format;function P4(t){t[yA]=T4}cc.addInspectMethod=P4;function T4(){let t={},e=this;for(let r of k4.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[yA],t}});var SA=H(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.lazyJoinStacks=Di.joinStacks=Di.isWritableStack=Di.isLazyStack=void 0;var A4=/\r?\n/,$4=/\bono[ @]/;function N4(t){return!!(t&&t.configurable&&typeof t.get=="function")}Di.isLazyStack=N4;function M4(t){return!!(!t||t.writable||typeof t.set=="function")}Di.isWritableStack=M4;function vA(t,e){let r=bA(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
236
236
|
|
|
237
237
|
`+n:r||n}Di.joinStacks=vA;function F4(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return vA({stack:n},r)},enumerable:!1,configurable:!0}):D4(e,t)}Di.lazyJoinStacks=F4;function bA(t){if(t){let e=t.split(A4),r;for(let n=0;n<e.length;n++){let i=e[n];if($4.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
|
|
238
238
|
`)}return t}function D4(t,e){Object.defineProperty(t,"stack",{get:()=>bA(e.get.apply(t)),enumerable:!1,configurable:!0})}});var RA=H(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.extendError=void 0;var wA=VR(),ay=SA(),_A=oy(),L4=["name","message","stack"];function j4(t,e,r){let n=t;return U4(n,e),e&&typeof e=="object"&&H4(n,e),n.toJSON=_A.toJSON,wA.addInspectMethod&&wA.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}ly.extendError=j4;function U4(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");ay.isLazyStack(r)?ay.lazyJoinStacks(r,t,e):ay.isWritableStack(r)&&(t.stack=ay.joinStacks(t,e))}function H4(t,e){let r=_A.getDeepKeys(e,L4),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var CA=H(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.normalizeArgs=fc.normalizeOptions=void 0;var B4=VR();function V4(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?B4.format:typeof t.format=="function"?t.format:!1}}fc.normalizeOptions=V4;function W4(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
|
|
239
|
-
`:"")+r.message),{originalError:r,props:n,message:s}}fc.normalizeArgs=W4});var zR=H(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.Ono=void 0;var uy=RA(),xA=CA(),z4=oy(),J4=WR;cy.Ono=J4;function WR(t,e){e=xA.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:o}=xA.normalizeArgs(n,e),l=new t(o);return uy.extendError(l,i,s)}return r[Symbol.species]=t,r}WR.toJSON=function(e){return z4.toJSON.call(e)};WR.extend=function(e,r,n){return n||r instanceof Error?uy.extendError(e,r,n):r?uy.extendError(e,void 0,r):uy.extendError(e)}});var EA=H(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.ono=void 0;var Ka=zR(),G4=Li;fy.ono=G4;Li.error=new Ka.Ono(Error);Li.eval=new Ka.Ono(EvalError);Li.range=new Ka.Ono(RangeError);Li.reference=new Ka.Ono(ReferenceError);Li.syntax=new Ka.Ono(SyntaxError);Li.type=new Ka.Ono(TypeError);Li.uri=new Ka.Ono(URIError);var Y4=Li;function Li(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(Y4))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 Li.error.apply(void 0,t)}});var qA=H(IA=>{"use strict";Object.defineProperty(IA,"__esModule",{value:!0});var Ute=require("util")});var Oo=H((ai,dc)=>{"use strict";var K4=ai&&ai.__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]})),Q4=ai&&ai.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&K4(e,t,r)};Object.defineProperty(ai,"__esModule",{value:!0});ai.ono=void 0;var OA=EA();Object.defineProperty(ai,"ono",{enumerable:!0,get:function(){return OA.ono}});var Z4=zR();Object.defineProperty(ai,"Ono",{enumerable:!0,get:function(){return Z4.Ono}});Q4(qA(),ai);ai.default=OA.ono;typeof dc=="object"&&typeof dc.exports=="object"&&(dc.exports=Object.assign(dc.exports.default,dc.exports))});var JR=H(Wd=>{"use strict";var X4=Wd&&Wd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wd,"__esModule",{value:!0});Wd.default=e3;var kA=X4(require("path"));function e3(t){return t.startsWith("\\\\?\\")?t:t.split(kA.default?.win32?.sep).join(kA.default?.posix?.sep??"/")}});var PA=H(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.isWindows=void 0;var t3=/^win/.test(globalThis.process?globalThis.process.platform:""),r3=()=>t3;dy.isWindows=r3});var Nn=H(Ot=>{"use strict";var n3=Ot&&Ot.__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]})),i3=Ot&&Ot.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),s3=Ot&&Ot.__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"&&n3(r,e,n[i]);return i3(r,e),r}})(),o3=Ot&&Ot.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.parse=void 0;Ot.resolve=TA;Ot.cwd=AA;Ot.getProtocol=ZR;Ot.getExtension=h3;Ot.stripQuery=$A;Ot.getHash=NA;Ot.stripHash=KR;Ot.isHttp=m3;Ot.isFileSystemPath=QR;Ot.fromFileSystemPath=g3;Ot.toFileSystemPath=y3;Ot.safePointerToPath=v3;Ot.relative=b3;var hy=o3(JR()),YR=s3(require("path")),a3=/\//g,l3=/^(\w{2,}):\/\//i,u3=/~1/g,c3=/~0/g,f3=require("path"),py=PA(),d3=[[/\?/g,"%3F"],[/#/g,"%23"]],GR=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],p3=t=>new URL(t);Ot.parse=p3;function TA(t,e){let r=new URL((0,hy.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,hy.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:l}=n;return s+o+l+i}return n.toString()+i}function AA(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function ZR(t){let e=l3.exec(t||"");if(e)return e[1].toLowerCase()}function h3(t){let e=t.lastIndexOf(".");return e>=0?$A(t.substr(e).toLowerCase()):""}function $A(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function NA(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function KR(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function m3(t){let e=ZR(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function QR(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=ZR(t);return e===void 0||e==="file"}function g3(t){if((0,py.isWindows)()){let e=AA(),r=t.toUpperCase(),i=(0,hy.default)(e).toUpperCase(),s=r.includes(i),o=r.includes(i),l=YR.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||o||l)&&!e.startsWith("http")&&(t=(0,f3.join)(e,t)),t=(0,hy.default)(t)}t=encodeURI(t);for(let e of d3)t=t.replace(e[0],e[1]);return t}function y3(t,e){t=decodeURI(t);for(let n=0;n<GR.length;n+=2)t=t.replace(GR[n],GR[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,py.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,py.isWindows)()?t:"/"+t)),(0,py.isWindows)()&&!r&&(t=t.replace(a3,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function v3(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(u3,"/").replace(c3,"~"))}function b3(t,e){if(!QR(t)||!QR(e))return TA(t,e);let r=YR.default.dirname(KR(t)),n=KR(e);return YR.default.relative(r,n)+NA(e)}});var Mn=H(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.InvalidPointerError=Nt.TimeoutError=Nt.MissingPointerError=Nt.UnmatchedResolverError=Nt.ResolverError=Nt.UnmatchedParserError=Nt.ParserError=Nt.JSONParserErrorGroup=Nt.JSONParserError=void 0;Nt.isHandledError=S3;Nt.normalizeError=w3;var MA=Oo(),my=Nn(),li=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,MA.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Nt.JSONParserError=li;var gy=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,my.toFileSystemPath)(e.$refs._root$Ref.path)}'`,MA.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)}};Nt.JSONParserErrorGroup=gy;var XR=class extends li{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Nt.ParserError=XR;var eC=class extends li{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Nt.UnmatchedParserError=eC;var tC=class extends li{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))}};Nt.ResolverError=tC;var rC=class extends li{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Nt.UnmatchedResolverError=rC;var nC=class extends li{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,my.getHash)(r)}". Token "${e}" does not exist.`,(0,my.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Nt.MissingPointerError=nC;var iC=class extends li{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Nt.TimeoutError=iC;var sC=class extends li{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,my.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Nt.InvalidPointerError=sC;function S3(t){return t instanceof li||t instanceof gy}function w3(t){return t.path===null&&(t.path=[]),t}});var zd=H(Qr=>{"use strict";var _3=Qr&&Qr.__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]})),R3=Qr&&Qr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C3=Qr&&Qr.__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"&&_3(r,e,n[i]);return R3(r,e),r}})(),x3=Qr&&Qr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.nullSymbol=void 0;var oC=x3(pc()),aC=C3(Nn()),vy=Mn();Qr.nullSymbol=Symbol("null");var E3=/\//g,I3=/~/g,q3=/~1/g,O3=/~0/g,k3=t=>{try{return decodeURIComponent(t)}catch{return t}},by=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=DA(e);for(let o=0;o<i.length;o++){if(yy(this,r,n)&&(this.path=t.join(this.path,i.slice(o))),typeof this.value=="object"&&this.value!==null&&!LA(n)&&"$ref"in this.value)return this;let l=i[o];if(this.value[l]===void 0||this.value[l]===null&&o===i.length-1){let f=!1;for(let v=i.length-1;v>o;v--){let _=i.slice(o,v+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],o=v,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Qr.nullSymbol;continue}this.value=null;let c=this.$ref.path||"",p=this.path.replace(c,""),h=t.join("",s),g=n?.replace(c,"");throw new vy.MissingPointerError(l,decodeURI(this.originalPath),p,h,g)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&aC.resolve(this.path,this.value.$ref)!==n)&&yy(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=DA(e);for(let o=0;o<i.length-1;o++)yy(this,n),s=i[o],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=FA(this,s,{});return yy(this,n),s=i[i.length-1],FA(this,s,r),e}static parse(e,r){let n=aC.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=k3(i[s].replace(q3,"/").replace(O3,"~"));if(i[0]!=="")throw new vy.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(I3,"~0").replace(E3,"~1"))}return e}};function yy(t,e,r){if(oC.default.isAllowed$Ref(t.value,e)){let n=aC.resolve(t.path,t.value.$ref);if(n===t.path&&!LA(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,oC.default.isExtended$Ref(t.value)?(t.value=oC.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Qr.default=by;function FA(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 vy.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
240
|
-
Cannot set "${e}" of a non-object.`);return r}function DA(t){if((0,vy.isHandledError)(t))throw t;return t}function LA(t){return typeof t=="string"&&by.parse(t).length==0}});var pc=H(Ss=>{"use strict";var P3=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]})),T3=Ss&&Ss.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A3=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"&&P3(r,e,n[i]);return T3(r,e),r}})();Object.defineProperty(Ss,"__esModule",{value:!0});var Sy=A3(zd()),wy=Mn(),lC=Nn(),uC=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(wy.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,wy.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 Sy.default(this,e,n);try{let o=s.resolve(this.value,r,i);return o.value===Sy.nullSymbol&&(o.value=null),o}catch(o){if(!r||!r.continueOnError||!(0,wy.isHandledError)(o))throw o;return o.path===null&&(o.path=(0,lC.safePointerToPath)((0,lC.getHash)(i))),o instanceof wy.InvalidPointerError&&(o.source=decodeURI((0,lC.stripHash)(i))),this.addError(o),null}}set(e,r){let n=new Sy.default(this,e);this.value=n.set(this.value,r),this.value===Sy.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}};Ss.default=uC});var VA=H(ui=>{"use strict";var $3=ui&&ui.__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]})),N3=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M3=ui&&ui.__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"&&$3(r,e,n[i]);return N3(r,e),r}})(),BA=ui&&ui.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});var jA=
|
|
239
|
+
`:"")+r.message),{originalError:r,props:n,message:s}}fc.normalizeArgs=W4});var zR=H(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.Ono=void 0;var uy=RA(),xA=CA(),z4=oy(),J4=WR;cy.Ono=J4;function WR(t,e){e=xA.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:o}=xA.normalizeArgs(n,e),l=new t(o);return uy.extendError(l,i,s)}return r[Symbol.species]=t,r}WR.toJSON=function(e){return z4.toJSON.call(e)};WR.extend=function(e,r,n){return n||r instanceof Error?uy.extendError(e,r,n):r?uy.extendError(e,void 0,r):uy.extendError(e)}});var EA=H(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.ono=void 0;var Ka=zR(),G4=Li;fy.ono=G4;Li.error=new Ka.Ono(Error);Li.eval=new Ka.Ono(EvalError);Li.range=new Ka.Ono(RangeError);Li.reference=new Ka.Ono(ReferenceError);Li.syntax=new Ka.Ono(SyntaxError);Li.type=new Ka.Ono(TypeError);Li.uri=new Ka.Ono(URIError);var Y4=Li;function Li(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(Y4))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 Li.error.apply(void 0,t)}});var OA=H(IA=>{"use strict";Object.defineProperty(IA,"__esModule",{value:!0});var Ute=require("util")});var qo=H((ai,dc)=>{"use strict";var K4=ai&&ai.__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]})),Q4=ai&&ai.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&K4(e,t,r)};Object.defineProperty(ai,"__esModule",{value:!0});ai.ono=void 0;var qA=EA();Object.defineProperty(ai,"ono",{enumerable:!0,get:function(){return qA.ono}});var Z4=zR();Object.defineProperty(ai,"Ono",{enumerable:!0,get:function(){return Z4.Ono}});Q4(OA(),ai);ai.default=qA.ono;typeof dc=="object"&&typeof dc.exports=="object"&&(dc.exports=Object.assign(dc.exports.default,dc.exports))});var JR=H(Wd=>{"use strict";var X4=Wd&&Wd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wd,"__esModule",{value:!0});Wd.default=e3;var kA=X4(require("path"));function e3(t){return t.startsWith("\\\\?\\")?t:t.split(kA.default?.win32?.sep).join(kA.default?.posix?.sep??"/")}});var PA=H(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.isWindows=void 0;var t3=/^win/.test(globalThis.process?globalThis.process.platform:""),r3=()=>t3;dy.isWindows=r3});var Nn=H(qt=>{"use strict";var n3=qt&&qt.__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]})),i3=qt&&qt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),s3=qt&&qt.__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"&&n3(r,e,n[i]);return i3(r,e),r}})(),o3=qt&&qt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qt,"__esModule",{value:!0});qt.parse=void 0;qt.resolve=TA;qt.cwd=AA;qt.getProtocol=ZR;qt.getExtension=h3;qt.stripQuery=$A;qt.getHash=NA;qt.stripHash=KR;qt.isHttp=m3;qt.isFileSystemPath=QR;qt.fromFileSystemPath=g3;qt.toFileSystemPath=y3;qt.safePointerToPath=v3;qt.relative=b3;var hy=o3(JR()),YR=s3(require("path")),a3=/\//g,l3=/^(\w{2,}):\/\//i,u3=/~1/g,c3=/~0/g,f3=require("path"),py=PA(),d3=[[/\?/g,"%3F"],[/#/g,"%23"]],GR=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],p3=t=>new URL(t);qt.parse=p3;function TA(t,e){let r=new URL((0,hy.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,hy.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:l}=n;return s+o+l+i}return n.toString()+i}function AA(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function ZR(t){let e=l3.exec(t||"");if(e)return e[1].toLowerCase()}function h3(t){let e=t.lastIndexOf(".");return e>=0?$A(t.substr(e).toLowerCase()):""}function $A(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function NA(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function KR(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function m3(t){let e=ZR(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function QR(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=ZR(t);return e===void 0||e==="file"}function g3(t){if((0,py.isWindows)()){let e=AA(),r=t.toUpperCase(),i=(0,hy.default)(e).toUpperCase(),s=r.includes(i),o=r.includes(i),l=YR.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||o||l)&&!e.startsWith("http")&&(t=(0,f3.join)(e,t)),t=(0,hy.default)(t)}t=encodeURI(t);for(let e of d3)t=t.replace(e[0],e[1]);return t}function y3(t,e){t=decodeURI(t);for(let n=0;n<GR.length;n+=2)t=t.replace(GR[n],GR[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,py.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,py.isWindows)()?t:"/"+t)),(0,py.isWindows)()&&!r&&(t=t.replace(a3,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function v3(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(u3,"/").replace(c3,"~"))}function b3(t,e){if(!QR(t)||!QR(e))return TA(t,e);let r=YR.default.dirname(KR(t)),n=KR(e);return YR.default.relative(r,n)+NA(e)}});var Mn=H(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.InvalidPointerError=Nt.TimeoutError=Nt.MissingPointerError=Nt.UnmatchedResolverError=Nt.ResolverError=Nt.UnmatchedParserError=Nt.ParserError=Nt.JSONParserErrorGroup=Nt.JSONParserError=void 0;Nt.isHandledError=S3;Nt.normalizeError=w3;var MA=qo(),my=Nn(),li=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,MA.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Nt.JSONParserError=li;var gy=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,my.toFileSystemPath)(e.$refs._root$Ref.path)}'`,MA.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)}};Nt.JSONParserErrorGroup=gy;var XR=class extends li{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Nt.ParserError=XR;var eC=class extends li{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Nt.UnmatchedParserError=eC;var tC=class extends li{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))}};Nt.ResolverError=tC;var rC=class extends li{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Nt.UnmatchedResolverError=rC;var nC=class extends li{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,my.getHash)(r)}". Token "${e}" does not exist.`,(0,my.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Nt.MissingPointerError=nC;var iC=class extends li{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Nt.TimeoutError=iC;var sC=class extends li{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,my.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Nt.InvalidPointerError=sC;function S3(t){return t instanceof li||t instanceof gy}function w3(t){return t.path===null&&(t.path=[]),t}});var zd=H(Qr=>{"use strict";var _3=Qr&&Qr.__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]})),R3=Qr&&Qr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C3=Qr&&Qr.__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"&&_3(r,e,n[i]);return R3(r,e),r}})(),x3=Qr&&Qr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.nullSymbol=void 0;var oC=x3(pc()),aC=C3(Nn()),vy=Mn();Qr.nullSymbol=Symbol("null");var E3=/\//g,I3=/~/g,O3=/~1/g,q3=/~0/g,k3=t=>{try{return decodeURIComponent(t)}catch{return t}},by=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=DA(e);for(let o=0;o<i.length;o++){if(yy(this,r,n)&&(this.path=t.join(this.path,i.slice(o))),typeof this.value=="object"&&this.value!==null&&!LA(n)&&"$ref"in this.value)return this;let l=i[o];if(this.value[l]===void 0||this.value[l]===null&&o===i.length-1){let f=!1;for(let v=i.length-1;v>o;v--){let _=i.slice(o,v+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],o=v,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Qr.nullSymbol;continue}this.value=null;let c=this.$ref.path||"",p=this.path.replace(c,""),h=t.join("",s),g=n?.replace(c,"");throw new vy.MissingPointerError(l,decodeURI(this.originalPath),p,h,g)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&aC.resolve(this.path,this.value.$ref)!==n)&&yy(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=DA(e);for(let o=0;o<i.length-1;o++)yy(this,n),s=i[o],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=FA(this,s,{});return yy(this,n),s=i[i.length-1],FA(this,s,r),e}static parse(e,r){let n=aC.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=k3(i[s].replace(O3,"/").replace(q3,"~"));if(i[0]!=="")throw new vy.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(I3,"~0").replace(E3,"~1"))}return e}};function yy(t,e,r){if(oC.default.isAllowed$Ref(t.value,e)){let n=aC.resolve(t.path,t.value.$ref);if(n===t.path&&!LA(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,oC.default.isExtended$Ref(t.value)?(t.value=oC.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Qr.default=by;function FA(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 vy.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
240
|
+
Cannot set "${e}" of a non-object.`);return r}function DA(t){if((0,vy.isHandledError)(t))throw t;return t}function LA(t){return typeof t=="string"&&by.parse(t).length==0}});var pc=H(Ss=>{"use strict";var P3=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]})),T3=Ss&&Ss.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A3=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"&&P3(r,e,n[i]);return T3(r,e),r}})();Object.defineProperty(Ss,"__esModule",{value:!0});var Sy=A3(zd()),wy=Mn(),lC=Nn(),uC=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(wy.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,wy.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 Sy.default(this,e,n);try{let o=s.resolve(this.value,r,i);return o.value===Sy.nullSymbol&&(o.value=null),o}catch(o){if(!r||!r.continueOnError||!(0,wy.isHandledError)(o))throw o;return o.path===null&&(o.path=(0,lC.safePointerToPath)((0,lC.getHash)(i))),o instanceof wy.InvalidPointerError&&(o.source=decodeURI((0,lC.stripHash)(i))),this.addError(o),null}}set(e,r){let n=new Sy.default(this,e);this.value=n.set(this.value,r),this.value===Sy.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}};Ss.default=uC});var VA=H(ui=>{"use strict";var $3=ui&&ui.__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]})),N3=ui&&ui.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M3=ui&&ui.__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"&&$3(r,e,n[i]);return N3(r,e),r}})(),BA=ui&&ui.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ui,"__esModule",{value:!0});var jA=qo(),F3=BA(pc()),ko=M3(Nn()),UA=BA(JR()),cC=class{paths(...e){return HA(this._$refs,e.flat()).map(n=>(0,UA.default)(n.decoded))}values(...e){let r=this._$refs;return HA(r,e.flat()).reduce((i,s)=>(i[(0,UA.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=ko.resolve(this._root$Ref.path,e),i=ko.stripHash(n),s=this._$refs[i];if(!s)throw(0,jA.ono)(`Error resolving $ref pointer "${e}".
|
|
241
241
|
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=ko.resolve(this._root$Ref.path,e);let r=ko.stripHash(e);return this._$refs[r]}_add(e){let r=ko.stripHash(e),n=new F3.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=ko.resolve(this._root$Ref.path,e),s=ko.stripHash(i),o=this._$refs[s];if(!o)throw(0,jA.ono)(`Error resolving $ref pointer "${e}".
|
|
242
|
-
"${s}" not found.`);return o.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};ui.default=cC;function HA(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"?ko.toFileSystemPath(n,!0):n}))}});var zA=H(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.all=D3;hc.filter=L3;hc.sort=j3;hc.run=U3;function D3(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function L3(t,e,r){return t.filter(n=>!!WA(n,e,r))}function j3(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 U3(t,e,r,n){let i,s,o=0;return new Promise((l,f)=>{c();function c(){if(i=t[o++],!i)return f(s);try{let v=WA(i,e,r,p,n);if(v&&typeof v.then=="function")v.then(h,g);else if(v!==void 0)h(v);else if(o===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(v){g(v)}}function p(v,_){v?g(v):h(_)}function h(v){l({plugin:i,result:v})}function g(v){s={plugin:i,error:v},c()}})}function WA(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 dC=H(ws=>{"use strict";var H3=ws&&ws.__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]})),B3=ws&&ws.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JA=ws&&ws.__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"&&H3(r,e,n[i]);return B3(r,e),r}})();Object.defineProperty(ws,"__esModule",{value:!0});var fC=
|
|
242
|
+
"${s}" not found.`);return o.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};ui.default=cC;function HA(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"?ko.toFileSystemPath(n,!0):n}))}});var zA=H(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.all=D3;hc.filter=L3;hc.sort=j3;hc.run=U3;function D3(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function L3(t,e,r){return t.filter(n=>!!WA(n,e,r))}function j3(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 U3(t,e,r,n){let i,s,o=0;return new Promise((l,f)=>{c();function c(){if(i=t[o++],!i)return f(s);try{let v=WA(i,e,r,p,n);if(v&&typeof v.then=="function")v.then(h,g);else if(v!==void 0)h(v);else if(o===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(v){g(v)}}function p(v,_){v?g(v):h(_)}function h(v){l({plugin:i,result:v})}function g(v){s={plugin:i,error:v},c()}})}function WA(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 dC=H(ws=>{"use strict";var H3=ws&&ws.__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]})),B3=ws&&ws.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),JA=ws&&ws.__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"&&H3(r,e,n[i]);return B3(r,e),r}})();Object.defineProperty(ws,"__esModule",{value:!0});var fC=qo(),V3=JA(Nn()),Po=JA(zA()),Qa=Mn();async function W3(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),o={url:t,hash:i,extension:V3.getExtension(t)};try{let l=await z3(o,r,e);s.pathType=l.plugin.name,o.data=l.result;let f=await J3(o,r,e);return s.value=f.result,f.result}catch(l){throw(0,Qa.isHandledError)(l)&&(s.value=l),l}}async function z3(t,e,r){let n=Po.all(e.resolve);n=Po.filter(n,"canRead",t),Po.sort(n);try{return await Po.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new Qa.UnmatchedResolverError(t.url):!i||!("error"in i)?fC.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof Qa.ResolverError?i.error:new Qa.ResolverError(i,t.url)}}async function J3(t,e,r){let n=Po.all(e.parse),i=Po.filter(n,"canParse",t),s=i.length>0?i:n;Po.sort(s);try{let o=await Po.run(s,"parse",t,r);if(!o.plugin.allowEmpty&&G3(o.result))throw fC.ono.syntax(`Error parsing "${t.url}" as ${o.plugin.name}.
|
|
243
243
|
Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Qa.UnmatchedParserError(t.url):o&&o.message&&o.message.startsWith("Error parsing")?o:!o||!("error"in o)?fC.ono.syntax(`Unable to parse ${t.url}`):o.error instanceof Qa.ParserError?o.error:new Qa.ParserError(o.error.message,t.url)}}function G3(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}ws.default=W3});var YA=H(pC=>{"use strict";Object.defineProperty(pC,"__esModule",{value:!0});var GA=Mn();pC.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 GA.ParserError(n.message,t.url)}throw new GA.ParserError(r.message,t.url)}}else return e}}});var mc=H((Xte,Za)=>{"use strict";function KA(t){return typeof t>"u"||t===null}function Y3(t){return typeof t=="object"&&t!==null}function K3(t){return Array.isArray(t)?t:KA(t)?[]:[t]}function Q3(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 Z3(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function X3(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}Za.exports.isNothing=KA;Za.exports.isObject=Y3;Za.exports.toArray=K3;Za.exports.repeat=Z3;Za.exports.isNegativeZero=X3;Za.exports.extend=Q3});var gc=H((ere,ZA)=>{"use strict";function QA(t,e){let r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
|
244
244
|
|
|
245
245
|
`+t.mark.snippet),n+" "+r):n}function Jd(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=QA(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Jd.prototype=Object.create(Error.prototype);Jd.prototype.constructor=Jd;Jd.prototype.toString=function(e){return this.name+": "+QA(this,e)};ZA.exports=Jd});var e1=H((tre,XA)=>{"use strict";var Gd=mc();function hC(t,e,r,n,i){let s="",o="",l=Math.floor(i/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),r-n>l&&(o=" ...",r=n+l-o.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function mC(t,e){return Gd.repeat(" ",e-t.length)+t}function e6(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,o=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);let l="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,c=e.maxLength-(e.indent+f+3);for(let h=1;h<=e.linesBefore&&!(o-h<0);h++){let g=hC(t.buffer,n[o-h],i[o-h],t.position-(n[o]-n[o-h]),c);l=Gd.repeat(" ",e.indent)+mC((t.line-h+1).toString(),f)+" | "+g.str+`
|
|
246
246
|
`+l}let p=hC(t.buffer,n[o],i[o],t.position,c);l+=Gd.repeat(" ",e.indent)+mC((t.line+1).toString(),f)+" | "+p.str+`
|
|
247
247
|
`,l+=Gd.repeat("-",e.indent+f+3+p.pos)+`^
|
|
248
248
|
`;for(let h=1;h<=e.linesAfter&&!(o+h>=i.length);h++){let g=hC(t.buffer,n[o+h],i[o+h],t.position-(n[o]-n[o+h]),c);l+=Gd.repeat(" ",e.indent)+mC((t.line+h+1).toString(),f)+" | "+g.str+`
|
|
249
|
-
`}return l.replace(/\n$/,"")}XA.exports=e6});var br=H((rre,r1)=>{"use strict";var t1=gc(),t6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r6=["scalar","sequence","mapping"];function n6(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function i6(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(t6.indexOf(r)===-1)throw new t1('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=n6(e.styleAliases||null),r6.indexOf(this.kind)===-1)throw new t1('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}r1.exports=i6});var vC=H((nre,i1)=>{"use strict";var Yd=gc(),gC=br();function n1(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),r[i]=n}),r}function s6(){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 yC(t){return this.extend(t)}yC.prototype.extend=function(e){let r=[],n=[];if(e instanceof gC)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 Yd("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof gC))throw new Yd("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Yd("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 Yd("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 gC))throw new Yd("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(yC.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=n1(i,"implicit"),i.compiledExplicit=n1(i,"explicit"),i.compiledTypeMap=s6(i.compiledImplicit,i.compiledExplicit),i};i1.exports=yC});var bC=H((ire,s1)=>{"use strict";var o6=br();s1.exports=new o6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var SC=H((sre,o1)=>{"use strict";var a6=br();o1.exports=new a6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var wC=H((ore,a1)=>{"use strict";var l6=br();a1.exports=new l6("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var _C=H((are,l1)=>{"use strict";var u6=vC();l1.exports=new u6({explicit:[bC(),SC(),wC()]})});var RC=H((lre,u1)=>{"use strict";var c6=br();function f6(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function d6(){return null}function p6(t){return t===null}u1.exports=new c6("tag:yaml.org,2002:null",{kind:"scalar",resolve:f6,construct:d6,predicate:p6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var CC=H((ure,c1)=>{"use strict";var h6=br();function m6(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 g6(t){return t==="true"||t==="True"||t==="TRUE"}function y6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}c1.exports=new h6("tag:yaml.org,2002:bool",{kind:"scalar",resolve:m6,construct:g6,predicate:y6,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 xC=H((cre,f1)=>{"use strict";var v6=mc(),b6=br();function S6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function w6(t){return t>=48&&t<=55}function _6(t){return t>=48&&t<=57}function R6(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(Kd(t))}if(i==="x"){for(r++;r<e;r++){if(!S6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Kd(t))}if(i==="o"){for(r++;r<e;r++){if(!w6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Kd(t))}}for(;r<e;r++){if(!_6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(Kd(t)):!1}function Kd(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 Kd(t)}function x6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!v6.isNegativeZero(t)}f1.exports=new b6("tag:yaml.org,2002:int",{kind:"scalar",resolve:R6,construct:C6,predicate:x6,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 EC=H((fre,p1)=>{"use strict";var d1=mc(),E6=br(),I6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),
|
|
250
|
-
\r`;function U6(t){if(t===null)return!1;let e=0,r=t.length,n=PC;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 H6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=PC,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 o=r%4*6;return o===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):o===18?(s.push(i>>10&255),s.push(i>>2&255)):o===12&&s.push(i>>4&255),new Uint8Array(s)}function B6(t){let e="",r=0,n=t.length,i=PC;for(let o=0;o<n;o++)o%3===0&&o&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[o];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 V6(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}S1.exports=new j6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:U6,construct:H6,predicate:V6,represent:B6})});var AC=H((yre,w1)=>{"use strict";var W6=br(),z6=Object.prototype.hasOwnProperty,J6=Object.prototype.toString;function G6(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],o=!1;if(J6.call(s)!=="[object Object]")return!1;let l;for(l in s)if(z6.call(s,l))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function Y6(t){return t!==null?t:[]}w1.exports=new W6("tag:yaml.org,2002:omap",{kind:"sequence",resolve:G6,construct:Y6})});var $C=H((vre,_1)=>{"use strict";var K6=br(),Q6=Object.prototype.toString;function Z6(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(Q6.call(s)!=="[object Object]")return!1;let o=Object.keys(s);if(o.length!==1)return!1;r[n]=[o[0],s[o[0]]]}return!0}function X6(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],o=Object.keys(s);r[n]=[o[0],s[o[0]]]}return r}_1.exports=new K6("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Z6,construct:X6})});var NC=H((bre,R1)=>{"use strict";var e9=br(),t9=Object.prototype.hasOwnProperty;function r9(t){if(t===null)return!0;let e=t;for(let r in e)if(t9.call(e,r)&&e[r]!==null)return!1;return!0}function n9(t){return t!==null?t:{}}R1.exports=new e9("tag:yaml.org,2002:set",{kind:"mapping",resolve:r9,construct:n9})});var _y=H((Sre,C1)=>{"use strict";C1.exports=
|
|
251
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function p9(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function F1(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var D1=new Array(256),L1=new Array(256);for(let t=0;t<256;t++)D1[t]=I1(t)?1:0,L1[t]=I1(t);function h9(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||s9,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 j1(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=i9(r),new T1(e,r)}function ge(t,e){throw j1(t,e)}function xy(t,e){t.onWarning&&t.onWarning.call(null,j1(t,e))}function el(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ci.call(i,e)||(i[e]={existed:ci.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function m9(t){t.anchorMapTransactions.push(Object.create(null))}function g9(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,o=i.length;s<o;s+=1){let l=i[s];ci.call(n,l)||(n[l]=e[l])}}function y9(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 U1(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
|
|
249
|
+
`}return l.replace(/\n$/,"")}XA.exports=e6});var br=H((rre,r1)=>{"use strict";var t1=gc(),t6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r6=["scalar","sequence","mapping"];function n6(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function i6(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(t6.indexOf(r)===-1)throw new t1('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=n6(e.styleAliases||null),r6.indexOf(this.kind)===-1)throw new t1('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}r1.exports=i6});var vC=H((nre,i1)=>{"use strict";var Yd=gc(),gC=br();function n1(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),r[i]=n}),r}function s6(){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 yC(t){return this.extend(t)}yC.prototype.extend=function(e){let r=[],n=[];if(e instanceof gC)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 Yd("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof gC))throw new Yd("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Yd("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 Yd("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 gC))throw new Yd("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(yC.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=n1(i,"implicit"),i.compiledExplicit=n1(i,"explicit"),i.compiledTypeMap=s6(i.compiledImplicit,i.compiledExplicit),i};i1.exports=yC});var bC=H((ire,s1)=>{"use strict";var o6=br();s1.exports=new o6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var SC=H((sre,o1)=>{"use strict";var a6=br();o1.exports=new a6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var wC=H((ore,a1)=>{"use strict";var l6=br();a1.exports=new l6("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var _C=H((are,l1)=>{"use strict";var u6=vC();l1.exports=new u6({explicit:[bC(),SC(),wC()]})});var RC=H((lre,u1)=>{"use strict";var c6=br();function f6(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function d6(){return null}function p6(t){return t===null}u1.exports=new c6("tag:yaml.org,2002:null",{kind:"scalar",resolve:f6,construct:d6,predicate:p6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var CC=H((ure,c1)=>{"use strict";var h6=br();function m6(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 g6(t){return t==="true"||t==="True"||t==="TRUE"}function y6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}c1.exports=new h6("tag:yaml.org,2002:bool",{kind:"scalar",resolve:m6,construct:g6,predicate:y6,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 xC=H((cre,f1)=>{"use strict";var v6=mc(),b6=br();function S6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function w6(t){return t>=48&&t<=55}function _6(t){return t>=48&&t<=57}function R6(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(Kd(t))}if(i==="x"){for(r++;r<e;r++){if(!S6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Kd(t))}if(i==="o"){for(r++;r<e;r++){if(!w6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Kd(t))}}for(;r<e;r++){if(!_6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(Kd(t)):!1}function Kd(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 Kd(t)}function x6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!v6.isNegativeZero(t)}f1.exports=new b6("tag:yaml.org,2002:int",{kind:"scalar",resolve:R6,construct:C6,predicate:x6,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 EC=H((fre,p1)=>{"use strict";var d1=mc(),E6=br(),I6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),O6=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function q6(t){return t===null||!I6.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:O6.test(t)}function k6(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 P6=/^[-+]?[0-9]+e/;function T6(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(d1.isNegativeZero(t))return"-0.0";let r=t.toString(10);return P6.test(r)?r.replace("e",".e"):r}function A6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||d1.isNegativeZero(t))}p1.exports=new E6("tag:yaml.org,2002:float",{kind:"scalar",resolve:q6,construct:k6,predicate:A6,represent:T6,defaultStyle:"lowercase"})});var IC=H((dre,h1)=>{"use strict";h1.exports=_C().extend({implicit:[RC(),CC(),xC(),EC()]})});var OC=H((pre,m1)=>{"use strict";m1.exports=IC()});var qC=H((hre,v1)=>{"use strict";var $6=br(),g1=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),y1=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 N6(t){return t===null?!1:g1.exec(t)!==null||y1.exec(t)!==null}function M6(t){let e=0,r=null,n=g1.exec(t);if(n===null&&(n=y1.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,o=+n[3];if(!n[4])return new Date(Date.UTC(i,s,o));let l=+n[4],f=+n[5],c=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let h=+n[10],g=+(n[11]||0);r=(h*60+g)*6e4,n[9]==="-"&&(r=-r)}let p=new Date(Date.UTC(i,s,o,l,f,c,e));return r&&p.setTime(p.getTime()-r),p}function F6(t){return t.toISOString()}v1.exports=new $6("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:N6,construct:M6,instanceOf:Date,represent:F6})});var kC=H((mre,b1)=>{"use strict";var D6=br();function L6(t){return t==="<<"||t===null}b1.exports=new D6("tag:yaml.org,2002:merge",{kind:"scalar",resolve:L6})});var TC=H((gre,S1)=>{"use strict";var j6=br(),PC=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
250
|
+
\r`;function U6(t){if(t===null)return!1;let e=0,r=t.length,n=PC;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 H6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=PC,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 o=r%4*6;return o===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):o===18?(s.push(i>>10&255),s.push(i>>2&255)):o===12&&s.push(i>>4&255),new Uint8Array(s)}function B6(t){let e="",r=0,n=t.length,i=PC;for(let o=0;o<n;o++)o%3===0&&o&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[o];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 V6(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}S1.exports=new j6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:U6,construct:H6,predicate:V6,represent:B6})});var AC=H((yre,w1)=>{"use strict";var W6=br(),z6=Object.prototype.hasOwnProperty,J6=Object.prototype.toString;function G6(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],o=!1;if(J6.call(s)!=="[object Object]")return!1;let l;for(l in s)if(z6.call(s,l))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function Y6(t){return t!==null?t:[]}w1.exports=new W6("tag:yaml.org,2002:omap",{kind:"sequence",resolve:G6,construct:Y6})});var $C=H((vre,_1)=>{"use strict";var K6=br(),Q6=Object.prototype.toString;function Z6(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(Q6.call(s)!=="[object Object]")return!1;let o=Object.keys(s);if(o.length!==1)return!1;r[n]=[o[0],s[o[0]]]}return!0}function X6(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],o=Object.keys(s);r[n]=[o[0],s[o[0]]]}return r}_1.exports=new K6("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Z6,construct:X6})});var NC=H((bre,R1)=>{"use strict";var e9=br(),t9=Object.prototype.hasOwnProperty;function r9(t){if(t===null)return!0;let e=t;for(let r in e)if(t9.call(e,r)&&e[r]!==null)return!1;return!0}function n9(t){return t!==null?t:{}}R1.exports=new e9("tag:yaml.org,2002:set",{kind:"mapping",resolve:r9,construct:n9})});var _y=H((Sre,C1)=>{"use strict";C1.exports=OC().extend({implicit:[qC(),kC()],explicit:[TC(),AC(),$C(),NC()]})});var V1=H((wre,LC)=>{"use strict";var Xa=mc(),T1=gc(),i9=e1(),s9=_y(),ci=Object.prototype.hasOwnProperty,Ry=1,A1=2,$1=3,Cy=4,MC=1,o9=2,x1=3,a9=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,l9=/[\x85\u2028\u2029]/,u9=/[,\[\]{}]/,N1=/^(?:!|!!|![0-9A-Za-z-]+!)$/,M1=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function E1(t){return Object.prototype.toString.call(t)}function ji(t){return t===10||t===13}function _s(t){return t===9||t===32}function Zr(t){return t===9||t===32||t===10||t===13}function yc(t){return t===44||t===91||t===93||t===123||t===125}function c9(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function f9(t){return t===120?2:t===117?4:t===85?8:0}function d9(t){return t>=48&&t<=57?t-48:-1}function I1(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
251
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function p9(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function F1(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var D1=new Array(256),L1=new Array(256);for(let t=0;t<256;t++)D1[t]=I1(t)?1:0,L1[t]=I1(t);function h9(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||s9,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 j1(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=i9(r),new T1(e,r)}function ge(t,e){throw j1(t,e)}function xy(t,e){t.onWarning&&t.onWarning.call(null,j1(t,e))}function el(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ci.call(i,e)||(i[e]={existed:ci.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function m9(t){t.anchorMapTransactions.push(Object.create(null))}function g9(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,o=i.length;s<o;s+=1){let l=i[s];ci.call(n,l)||(n[l]=e[l])}}function y9(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 U1(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 O1(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 q1={YAML:function(e,r,n){e.version!==null&&ge(e,"duplication of %YAML directive"),n.length!==1&&ge(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&ge(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),o=parseInt(i[2],10);s!==1&&ge(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&xy(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&ge(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],N1.test(s)||ge(e,"ill-formed tag handle (first argument) of the TAG directive"),ci.call(e.tagMap,s)&&ge(e,'there is a previously declared suffix for "'+s+'" tag handle'),M1.test(i)||ge(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{ge(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function To(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,o=i.length;s<o;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||ge(t,"expected valid JSON character")}else a9.test(i)&&ge(t,"the stream contains non-printable characters");t.result+=i}}function k1(t,e,r,n){Xa.isObject(r)||ge(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,o=i.length;s<o;s+=1){let l=i[s];ci.call(e,l)||(F1(e,l,r[l]),n[l]=!0)}}function vc(t,e,r,n,i,s,o,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let c=0,p=i.length;c<p;c+=1)Array.isArray(i[c])&&ge(t,"nested arrays are not supported inside keys"),typeof i=="object"&&E1(i[c])==="[object Object]"&&(i[c]="[object Object]")}if(typeof i=="object"&&E1(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&&ge(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let c=new Set;for(let p=0,h=s.length;p<h;p+=1){let g=s[p];c.has(g)||(c.add(g),k1(t,e,g,r))}}else k1(t,e,s,r);else!t.json&&!ci.call(r,i)&&ci.call(e,i)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,ge(t,"duplicated mapping key")),F1(e,i,s),delete r[i];return e}function FC(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):ge(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Wt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;_s(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(ji(i))for(FC(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&&xy(t,"deficient indentation"),n}function Ey(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||Zr(r)))}function DC(t,e){e===1?t.result+=" ":e>1&&(t.result+=Xa.repeat(`
|
|
252
252
|
`,e-1))}function v9(t,e,r){let n,i,s,o,l,f,c=t.kind,p=t.result,h=t.input.charCodeAt(t.position);if(Zr(h)||yc(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96)return!1;if(h===63||h===45){let g=t.input.charCodeAt(t.position+1);if(Zr(g)||r&&yc(g))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;h!==0;){if(h===58){let g=t.input.charCodeAt(t.position+1);if(Zr(g)||r&&yc(g))break}else if(h===35){let g=t.input.charCodeAt(t.position-1);if(Zr(g))break}else{if(t.position===t.lineStart&&Ey(t)||r&&yc(h))break;if(ji(h))if(o=t.line,l=t.lineStart,f=t.lineIndent,Wt(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=f;break}}s&&(To(t,n,i,!1),DC(t,t.line-o),n=i=t.position,s=!1),_s(h)||(i=t.position+1),h=t.input.charCodeAt(++t.position)}return To(t,n,i,!1),t.result?!0:(t.kind=c,t.result=p,!1)}function b9(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(To(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 ji(i)?(To(t,r,n,!0),DC(t,Wt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ey(t)?ge(t,"unexpected end of the document within a single quoted scalar"):(t.position++,_s(i)||(n=t.position));ge(t,"unexpected end of the stream within a single quoted scalar")}function S9(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 To(t,r,t.position,!0),t.position++,!0;if(s===92){if(To(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),ji(s))Wt(t,!1,e);else if(s<256&&D1[s])t.result+=L1[s],t.position++;else if((i=f9(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=c9(s))>=0?l=(l<<4)+i:ge(t,"expected hexadecimal character");t.result+=p9(l),t.position++}else ge(t,"unknown escape sequence");r=n=t.position}else ji(s)?(To(t,r,n,!0),DC(t,Wt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ey(t)?ge(t,"unexpected end of the document within a double quoted scalar"):(t.position++,_s(s)||(n=t.position))}ge(t,"unexpected end of the stream within a double quoted scalar")}function w9(t,e){let r=!0,n,i,s,o=t.tag,l,f=t.anchor,c,p,h,g,v=Object.create(null),_,w,E,k=t.input.charCodeAt(t.position);if(k===91)c=93,g=!1,l=[];else if(k===123)c=125,g=!0,l={};else return!1;for(t.anchor!==null&&el(t,t.anchor,l),k=t.input.charCodeAt(++t.position);k!==0;){if(Wt(t,!0,e),k=t.input.charCodeAt(t.position),k===c)return t.position++,t.tag=o,t.anchor=f,t.kind=g?"mapping":"sequence",t.result=l,!0;if(r?k===44&&ge(t,"expected the node content, but found ','"):ge(t,"missed comma between flow collection entries"),w=_=E=null,p=h=!1,k===63){let T=t.input.charCodeAt(t.position+1);Zr(T)&&(p=h=!0,t.position++,Wt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,bc(t,e,Ry,!1,!0),w=t.tag,_=t.result,Wt(t,!0,e),k=t.input.charCodeAt(t.position),(h||t.line===n)&&k===58&&(p=!0,k=t.input.charCodeAt(++t.position),Wt(t,!0,e),bc(t,e,Ry,!1,!0),E=t.result),g?vc(t,l,v,w,_,E,n,i,s):p?l.push(vc(t,null,v,w,_,E,n,i,s)):l.push(_),Wt(t,!0,e),k=t.input.charCodeAt(t.position),k===44?(r=!0,k=t.input.charCodeAt(++t.position)):r=!1}ge(t,"unexpected end of the stream within a flow collection")}function _9(t,e){let r,n=MC,i=!1,s=!1,o=e,l=0,f=!1,c,p=t.input.charCodeAt(t.position);if(p===124)r=!1;else if(p===62)r=!0;else return!1;for(t.kind="scalar",t.result="";p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)MC===n?n=p===43?x1:o9:ge(t,"repeat of a chomping mode identifier");else if((c=d9(p))>=0)c===0?ge(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?ge(t,"repeat of an indentation width identifier"):(o=e+c-1,s=!0);else break;if(_s(p)){do p=t.input.charCodeAt(++t.position);while(_s(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!ji(p)&&p!==0)}for(;p!==0;){for(FC(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!s||t.lineIndent<o)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>o&&(o=t.lineIndent),ji(p)){l++;continue}if(!s&&o===0&&ge(t,"missing indentation for block scalar"),t.lineIndent<o){n===x1?t.result+=Xa.repeat(`
|
|
253
253
|
`,i?1+l:l):n===MC&&i&&(t.result+=`
|
|
254
254
|
`);break}r?_s(p)?(f=!0,t.result+=Xa.repeat(`
|
|
255
255
|
`,i?1+l:l)):f?(f=!1,t.result+=Xa.repeat(`
|
|
256
256
|
`,l+1)):l===0?i&&(t.result+=" "):t.result+=Xa.repeat(`
|
|
257
257
|
`,l):t.result+=Xa.repeat(`
|
|
258
|
-
`,i?1+l:l),i=!0,s=!0,l=0;let h=t.position;for(;!ji(p)&&p!==0;)p=t.input.charCodeAt(++t.position);To(t,h,t.position,!1)}return!0}function P1(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&el(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ge(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!Zr(l))break;if(s=!0,t.position++,Wt(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let f=t.line;if(bc(t,e,$1,!1,!0),i.push(t.result),Wt(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&o!==0)ge(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 H1(t,e,r){let n,i,s,o,l=t.tag,f=t.anchor,c={},p=Object.create(null),h=null,g=null,v=null,_=!1,w=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&el(t,t.anchor,c);let E=t.input.charCodeAt(t.position);for(;E!==0;){!_&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ge(t,"tab characters must not be used in indentation"));let k=t.input.charCodeAt(t.position+1),T=t.line;if((E===63||E===58)&&Zr(k))E===63?(_&&(vc(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!0,n=!0):_?(_=!1,n=!0):ge(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,E=k;else{if(i=t.line,s=t.lineStart,o=t.position,!bc(t,r,A1,!1,!0))break;if(t.line===T){for(E=t.input.charCodeAt(t.position);_s(E);)E=t.input.charCodeAt(++t.position);if(E===58)E=t.input.charCodeAt(++t.position),Zr(E)||ge(t,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(vc(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!1,n=!1,h=t.tag,g=t.result;else if(w)ge(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(w)ge(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===T||t.lineIndent>e)&&(_&&(i=t.line,s=t.lineStart,o=t.position),bc(t,e,Cy,!0,n)&&(_?g=t.result:v=t.result),_||(vc(t,c,p,h,g,v,i,s,o),h=g=v=null),Wt(t,!0,-1),E=t.input.charCodeAt(t.position)),(t.line===T||t.lineIndent>e)&&E!==0)ge(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return _&&vc(t,c,p,h,g,null,i,s,o),w&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=c),w}function R9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&ge(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 o=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(o,t.position),s=t.input.charCodeAt(++t.position)):ge(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Zr(s);)s===33&&(r?ge(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),N1.test(n)||ge(t,"named tag handle cannot contain such characters"),r=!0,o=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(o,t.position),u9.test(i)&&ge(t,"tag suffix cannot contain flow indicator characters")}i&&!M1.test(i)&&ge(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{ge(t,"tag name is malformed: "+i)}return e?t.tag=i:ci.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:ge(t,'undeclared tag handle "'+n+'"'),!0}function C9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&ge(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Zr(e)&&!yc(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&ge(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function x9(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&&!Zr(e)&&!yc(e);)e=t.input.charCodeAt(++t.position);t.position===r&&ge(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ci.call(t.anchorMap,n)||ge(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Wt(t,!0,-1),!0}function E9(t,e,r,n){let i=U1(t);return m9(t),
|
|
259
|
-
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new h9(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,ge(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;)I9(r);return r.documents}function
|
|
258
|
+
`,i?1+l:l),i=!0,s=!0,l=0;let h=t.position;for(;!ji(p)&&p!==0;)p=t.input.charCodeAt(++t.position);To(t,h,t.position,!1)}return!0}function P1(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&el(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ge(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!Zr(l))break;if(s=!0,t.position++,Wt(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let f=t.line;if(bc(t,e,$1,!1,!0),i.push(t.result),Wt(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&o!==0)ge(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 H1(t,e,r){let n,i,s,o,l=t.tag,f=t.anchor,c={},p=Object.create(null),h=null,g=null,v=null,_=!1,w=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&el(t,t.anchor,c);let E=t.input.charCodeAt(t.position);for(;E!==0;){!_&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,ge(t,"tab characters must not be used in indentation"));let k=t.input.charCodeAt(t.position+1),T=t.line;if((E===63||E===58)&&Zr(k))E===63?(_&&(vc(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!0,n=!0):_?(_=!1,n=!0):ge(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,E=k;else{if(i=t.line,s=t.lineStart,o=t.position,!bc(t,r,A1,!1,!0))break;if(t.line===T){for(E=t.input.charCodeAt(t.position);_s(E);)E=t.input.charCodeAt(++t.position);if(E===58)E=t.input.charCodeAt(++t.position),Zr(E)||ge(t,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(vc(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!1,n=!1,h=t.tag,g=t.result;else if(w)ge(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(w)ge(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===T||t.lineIndent>e)&&(_&&(i=t.line,s=t.lineStart,o=t.position),bc(t,e,Cy,!0,n)&&(_?g=t.result:v=t.result),_||(vc(t,c,p,h,g,v,i,s,o),h=g=v=null),Wt(t,!0,-1),E=t.input.charCodeAt(t.position)),(t.line===T||t.lineIndent>e)&&E!==0)ge(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return _&&vc(t,c,p,h,g,null,i,s,o),w&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=c),w}function R9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&ge(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 o=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(o,t.position),s=t.input.charCodeAt(++t.position)):ge(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Zr(s);)s===33&&(r?ge(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),N1.test(n)||ge(t,"named tag handle cannot contain such characters"),r=!0,o=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(o,t.position),u9.test(i)&&ge(t,"tag suffix cannot contain flow indicator characters")}i&&!M1.test(i)&&ge(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{ge(t,"tag name is malformed: "+i)}return e?t.tag=i:ci.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:ge(t,'undeclared tag handle "'+n+'"'),!0}function C9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&ge(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Zr(e)&&!yc(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&ge(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function x9(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&&!Zr(e)&&!yc(e);)e=t.input.charCodeAt(++t.position);t.position===r&&ge(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ci.call(t.anchorMap,n)||ge(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Wt(t,!0,-1),!0}function E9(t,e,r,n){let i=U1(t);return m9(t),O1(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,H1(t,r,n)&&t.kind==="mapping"?(g9(t),!0):(y9(t),O1(t,i),!1)}function bc(t,e,r,n,i){let s,o,l=1,f=!1,c=!1,p=null,h,g,v;t.depth>=t.maxDepth&&ge(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let _=s=o=Cy===r||$1===r;if(n&&Wt(t,!0,-1)&&(f=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let w=t.input.charCodeAt(t.position),E=U1(t);if(f&&(w===33&&t.tag!==null||w===38&&t.anchor!==null)||!R9(t)&&!C9(t))break;p===null&&(p=E),Wt(t,!0,-1)?(f=!0,o=_,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1}if(o&&(o=f||i),l===1||Cy===r)if(Ry===r||A1===r?g=e:g=e+1,v=t.position-t.lineStart,l===1)if(o&&(P1(t,v)||H1(t,v,g))||w9(t,g))c=!0;else{let w=t.input.charCodeAt(t.position);p!==null&&_&&!o&&w!==124&&w!==62&&E9(t,p,p.position-p.lineStart,g)||s&&_9(t,g)||b9(t,g)||S9(t,g)?c=!0:x9(t)?(c=!0,(t.tag!==null||t.anchor!==null)&&ge(t,"alias node should not have any properties")):v9(t,g,Ry===r)&&(c=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&el(t,t.anchor,t.result)}else l===0&&(c=o&&P1(t,v));if(t.tag===null)t.anchor!==null&&el(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&ge(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let w=0,E=t.implicitTypes.length;w<E;w+=1)if(h=t.implicitTypes[w],h.resolve(t.result)){t.result=h.construct(t.result),t.tag=h.tag,t.anchor!==null&&el(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ci.call(t.typeMap[t.kind||"fallback"],t.tag))h=t.typeMap[t.kind||"fallback"][t.tag];else{h=null;let w=t.typeMap.multi[t.kind||"fallback"];for(let E=0,k=w.length;E<k;E+=1)if(t.tag.slice(0,w[E].tag.length)===w[E].tag){h=w[E];break}}h||ge(t,"unknown tag !<"+t.tag+">"),t.result!==null&&h.kind!==t.kind&&ge(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+h.kind+'", not "'+t.kind+'"'),h.resolve(t.result,t.tag)?(t.result=h.construct(t.result,t.tag),t.anchor!==null&&el(t,t.anchor,t.result)):ge(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||c}function I9(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&&(Wt(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&&!Zr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),o=[];for(s.length<1&&ge(t,"directive name must not be less than one character in length");n!==0;){for(;_s(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!ji(n));break}if(ji(n))break;for(i=t.position;n!==0&&!Zr(n);)n=t.input.charCodeAt(++t.position);o.push(t.input.slice(i,t.position))}n!==0&&FC(t),ci.call(q1,s)?q1[s](t,s,o):xy(t,'unknown document directive "'+s+'"')}if(Wt(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,Wt(t,!0,-1)):r&&ge(t,"directives end mark is expected"),bc(t,t.lineIndent-1,Cy,!1,!0),Wt(t,!0,-1),t.checkLineBreaks&&l9.test(t.input.slice(e,t.position))&&xy(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ey(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Wt(t,!0,-1));return}t.position<t.length-1&&ge(t,"end of the stream or a document separator is expected")}function B1(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
259
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new h9(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,ge(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;)I9(r);return r.documents}function O9(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=B1(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function q9(t,e){let r=B1(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new T1("expected a single document in the stream, but found more")}}LC.exports.loadAll=O9;LC.exports.load=q9});var f$=H((_re,c$)=>{"use strict";var qy=mc(),tp=gc(),k9=_y(),X1=Object.prototype.toString,e$=Object.prototype.hasOwnProperty,VC=65279,P9=9,Zd=10,T9=13,A9=32,$9=33,N9=34,jC=35,M9=37,F9=38,D9=39,L9=42,t$=44,j9=45,Iy=58,U9=61,H9=62,B9=63,V9=64,r$=91,n$=93,W9=96,i$=123,z9=124,s$=125,Sr={};Sr[0]="\\0";Sr[7]="\\a";Sr[8]="\\b";Sr[9]="\\t";Sr[10]="\\n";Sr[11]="\\v";Sr[12]="\\f";Sr[13]="\\r";Sr[27]="\\e";Sr[34]='\\"';Sr[92]="\\\\";Sr[133]="\\N";Sr[160]="\\_";Sr[8232]="\\L";Sr[8233]="\\P";var J9=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],G9=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Y9(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let o=n[i],l=String(e[o]);o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2));let f=t.compiledTypeMap.fallback[o];f&&e$.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[o]=l}return r}function K9(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 tp("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+qy.repeat("0",r-n.length)+n}var Q9=1,Xd=2;function Z9(t){this.schema=t.schema||k9,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=qy.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Y9(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==='"'?Xd:Q9,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 W1(t,e){let r=qy.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let o,l=t.indexOf(`
|
|
260
260
|
`,n);l===-1?(o=t.slice(n),n=s):(o=t.slice(n,l+1),n=l+1),o.length&&o!==`
|
|
261
261
|
`&&(i+=r),i+=o}return i}function UC(t,e){return`
|
|
262
|
-
`+
|
|
262
|
+
`+qy.repeat(" ",t.indent*e)}function X9(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 Oy(t){return t===A9||t===P9}function ep(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==VC||t>=65536&&t<=1114111}function z1(t){return ep(t)&&t!==VC&&t!==T9&&t!==Zd}function J1(t,e,r){let n=z1(t),i=n&&!Oy(t);return(r?n:n&&t!==t$&&t!==r$&&t!==n$&&t!==i$&&t!==s$)&&t!==jC&&!(e===Iy&&!i)||z1(e)&&!Oy(e)&&t===jC||e===Iy&&i}function e8(t){return ep(t)&&t!==VC&&!Oy(t)&&t!==j9&&t!==B9&&t!==Iy&&t!==t$&&t!==r$&&t!==n$&&t!==i$&&t!==s$&&t!==jC&&t!==F9&&t!==L9&&t!==$9&&t!==z9&&t!==U9&&t!==H9&&t!==D9&&t!==N9&&t!==M9&&t!==V9&&t!==W9}function t8(t){return!Oy(t)&&t!==Iy}function Qd(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 o$(t){return/^\n* /.test(t)}var a$=1,HC=2,l$=3,u$=4,Sc=5;function r8(t,e,r,n,i,s,o,l){let f,c=0,p=null,h=!1,g=!1,v=n!==-1,_=-1,w=e8(Qd(t,0))&&t8(Qd(t,t.length-1));if(e||o)for(f=0;f<t.length;c>=65536?f+=2:f++){if(c=Qd(t,f),!ep(c))return Sc;w=w&&J1(c,p,l),p=c}else{for(f=0;f<t.length;c>=65536?f+=2:f++){if(c=Qd(t,f),c===Zd)h=!0,v&&(g=g||f-_-1>n&&t[_+1]!==" ",_=f);else if(!ep(c))return Sc;w=w&&J1(c,p,l),p=c}g=g||v&&f-_-1>n&&t[_+1]!==" "}return!h&&!g?w&&!o&&!i(t)?a$:s===Xd?Sc:HC:r>9&&o$(t)?Sc:o?s===Xd?Sc:HC:g?u$:l$}function n8(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===Xd?'""':"''";if(!t.noCompatMode&&(J9.indexOf(e)!==-1||G9.test(e)))return t.quotingType===Xd?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function f(c){return X9(t,c)}switch(r8(e,l,t.indent,o,f,t.quotingType,t.forceQuotes&&!n,i)){case a$:return e;case HC:return"'"+e.replace(/'/g,"''")+"'";case l$:return"|"+G1(e,t.indent)+Y1(W1(e,s));case u$:return">"+G1(e,t.indent)+Y1(W1(i8(e,o),s));case Sc:return'"'+s8(e,o)+'"';default:throw new tp("impossible error: invalid scalar style")}})()}function G1(t,e){let r=o$(t)?String(e):"",n=t[t.length-1]===`
|
|
263
263
|
`,s=n&&(t[t.length-2]===`
|
|
264
264
|
`||t===`
|
|
265
265
|
`)?"+":n?"":"-";return r+s+`
|
|
@@ -271,10 +271,10 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Qa.Unma
|
|
|
271
271
|
`+t.slice(i,s),i=s+1),o=l;return f+=`
|
|
272
272
|
`,t.length-i>e&&o>i?f+=t.slice(i,o)+`
|
|
273
273
|
`+t.slice(o+1):f+=t.slice(i),f.slice(1)}function s8(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=Qd(t,n);let i=Sr[r];!i&&ep(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||K9(r)}return e}function o8(t,e,r){let n="",i=t.tag;for(let s=0,o=r.length;s<o;s+=1){let l=r[s];t.replacer&&(l=t.replacer.call(r,String(s),l)),(Rs(t,e,l,!1,!1)||typeof l>"u"&&Rs(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function Q1(t,e,r,n){let i="",s=t.tag;for(let o=0,l=r.length;o<l;o+=1){let f=r[o];t.replacer&&(f=t.replacer.call(r,String(o),f)),(Rs(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&Rs(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=UC(t,e)),t.dump&&Zd===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function a8(t,e,r){let n="",i=t.tag,s=Object.keys(r);for(let o=0,l=s.length;o<l;o+=1){let f="";n!==""&&(f+=", "),t.condenseFlow&&(f+='"');let c=s[o],p=r[c];t.replacer&&(p=t.replacer.call(r,c,p)),Rs(t,e,c,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Rs(t,e,p,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function l8(t,e,r,n){let i="",s=t.tag,o=Object.keys(r);if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new tp("sortKeys must be a boolean or a function");for(let l=0,f=o.length;l<f;l+=1){let c="";(!n||i!=="")&&(c+=UC(t,e));let p=o[l],h=r[p];if(t.replacer&&(h=t.replacer.call(r,p,h)),!Rs(t,e+1,p,!0,!0,!0))continue;let g=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;g&&(t.dump&&Zd===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,g&&(c+=UC(t,e)),Rs(t,e+1,h,!0,g)&&(t.dump&&Zd===t.dump.charCodeAt(0)?c+=":":c+=": ",c+=t.dump,i+=c)}t.tag=s,t.dump=i||"{}"}function Z1(t,e,r){let n=r?t.explicitTypes:t.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let o=n[i];if((o.instanceOf||o.predicate)&&(!o.instanceOf||typeof e=="object"&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(r?o.multi&&o.representName?t.tag=o.representName(e):t.tag=o.tag:t.tag="?",o.represent){let l=t.styleMap[o.tag]||o.defaultStyle,f;if(X1.call(o.represent)==="[object Function]")f=o.represent(e,l);else if(e$.call(o.represent,l))f=o.represent[l](e,l);else throw new tp("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');t.dump=f}return!0}}return!1}function Rs(t,e,r,n,i,s,o){t.tag=null,t.dump=r,Z1(t,r,!1)||Z1(t,r,!0);let l=X1.call(t.dump),f=n;n&&(n=t.flowLevel<0||t.flowLevel>e);let c=l==="[object Object]"||l==="[object Array]",p,h;if(c&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(i=!1),h&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(c&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(l8(t,e,t.dump,i),h&&(t.dump="&ref_"+p+t.dump)):(a8(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?Q1(t,e-1,t.dump,i):Q1(t,e,t.dump,i),h&&(t.dump="&ref_"+p+t.dump)):(o8(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&n8(t,t.dump,e,s,f);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new tp("unacceptable kind of an object to dump "+l)}if(t.tag!==null&&t.tag!=="?"){let g=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?g="!"+g:g.slice(0,18)==="tag:yaml.org,2002:"?g="!!"+g.slice(18):g="!<"+g+">",t.dump=g+" "+t.dump}}return!0}function u8(t,e){let r=[],n=[];BC(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 BC(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)BC(t[i],e,r);else{let i=Object.keys(t);for(let s=0,o=i.length;s<o;s+=1)BC(t[i[s]],e,r)}}}function c8(t,e){e=e||{};let r=new Z9(e);r.noRefs||u8(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Rs(r,0,n,!0,!0)?r.dump+`
|
|
274
|
-
`:""}c$.exports.dump=c8});var zC=H((Rre,Tr)=>{"use strict";var d$=V1(),f8=f$();function WC(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.")}}Tr.exports.Type=br();Tr.exports.Schema=vC();Tr.exports.FAILSAFE_SCHEMA=_C();Tr.exports.JSON_SCHEMA=IC();Tr.exports.CORE_SCHEMA=
|
|
274
|
+
`:""}c$.exports.dump=c8});var zC=H((Rre,Tr)=>{"use strict";var d$=V1(),f8=f$();function WC(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.")}}Tr.exports.Type=br();Tr.exports.Schema=vC();Tr.exports.FAILSAFE_SCHEMA=_C();Tr.exports.JSON_SCHEMA=IC();Tr.exports.CORE_SCHEMA=OC();Tr.exports.DEFAULT_SCHEMA=_y();Tr.exports.load=d$.load;Tr.exports.loadAll=d$.loadAll;Tr.exports.dump=f8.dump;Tr.exports.YAMLException=gc();Tr.exports.types={binary:TC(),float:EC(),map:wC(),null:RC(),pairs:$C(),set:NC(),timestamp:qC(),bool:CC(),int:xC(),merge:kC(),omap:AC(),seq:SC(),str:bC()};Tr.exports.safeLoad=WC("safeLoad","load");Tr.exports.safeLoadAll=WC("safeLoadAll","loadAll");Tr.exports.safeDump=WC("safeDump","dump")});var p$=H(rp=>{"use strict";var d8=rp&&rp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rp,"__esModule",{value:!0});var p8=Mn(),h8=d8(zC()),m8=zC();rp.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 h8.default.load(e,{schema:m8.JSON_SCHEMA})}catch(r){throw new p8.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var h$=H(JC=>{"use strict";Object.defineProperty(JC,"__esModule",{value:!0});var g8=Mn(),y8=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;JC.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&y8.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 g8.ParserError("data is not text",t.url)}}});var m$=H(GC=>{"use strict";Object.defineProperty(GC,"__esModule",{value:!0});var v8=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;GC.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&v8.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var b$=H(fi=>{"use strict";var b8=fi&&fi.__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]})),S8=fi&&fi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w8=fi&&fi.__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"&&b8(r,e,n[i]);return S8(r,e),r}})(),_8=fi&&fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fi,"__esModule",{value:!0});var R8=_8(require("fs")),g$=qo(),y$=w8(Nn()),v$=Mn();fi.default={order:100,canRead(t){return y$.isFileSystemPath(t.url)},async read(t){let e;try{e=y$.toFileSystemPath(t.url)}catch(r){throw new v$.ResolverError(g$.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await R8.default.promises.readFile(e)}catch(r){throw new v$.ResolverError((0,g$.ono)(r,`Error opening file "${e}"`),e)}}}});var _$=H(Cs=>{"use strict";var C8=Cs&&Cs.__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]})),x8=Cs&&Cs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E8=Cs&&Cs.__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"&&C8(r,e,n[i]);return x8(r,e),r}})();Object.defineProperty(Cs,"__esModule",{value:!0});var ky=qo(),np=E8(Nn()),S$=Mn();Cs.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return np.isHttp(t.url)},read(t){let e=np.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=np.parse(location.href).protocol),w$(e,this)}};async function w$(t,e,r){t=np.parse(t);let n=r||[];n.push(t.href);try{let i=await I8(t,e);if(i.status>=400)throw(0,ky.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new S$.ResolverError((0,ky.ono)({status:i.status},`Error downloading ${n[0]}.
|
|
275
275
|
Too many redirects:
|
|
276
276
|
${n.join(`
|
|
277
|
-
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,ky.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=np.resolve(t.href,i.headers.location);return w$(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new S$.ResolverError((0,ky.ono)(i,`Error downloading ${t.href}`),t.href)}}async function I8(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 YC=H(xs=>{"use strict";var wc=xs&&xs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xs,"__esModule",{value:!0});xs.getNewOptions=xs.getJsonSchemaRefParserDefaultOptions=void 0;var q8=wc(YA()),O8=wc(p$()),k8=wc(h$()),P8=wc(m$()),T8=wc(b$()),A8=wc(_$()),$8=()=>({parse:{json:{...q8.default},yaml:{...O8.default},text:{...k8.default},binary:{...P8.default}},resolve:{file:{...T8.default},http:{...A8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});xs.getJsonSchemaRefParserDefaultOptions=$8;var N8=t=>{let e=(0,xs.getJsonSchemaRefParserDefaultOptions)();return t&&C$(e,t),e};xs.getNewOptions=N8;function C$(t,e){if(R$(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],o=t[i];R$(s)?t[i]=C$(o||{},s):s!==void 0&&(t[i]=s)}}return t}function R$(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var E$=H(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.normalizeArgs=x$;var M8=YC();function x$(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,M8.getNewOptions)(n)}catch(o){console.error(`JSON Schema Ref Parser: Error normalizing options: ${o}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Py.default=x$});var I$=H(di=>{"use strict";var F8=di&&di.__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]})),D8=di&&di.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L8=di&&di.__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"&&F8(r,e,n[i]);return D8(r,e),r}})(),KC=di&&di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});var j8=KC(pc()),U8=KC(zd()),H8=KC(dC()),_c=L8(Nn()),B8=Mn();function V8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=QC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function QC(t,e,r,n,i,s){i||(i=new Set);let o=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),j8.default.isExternal$Ref(t)&&o.push(W8(t,e,r,n));let l=Object.keys(t);for(let f of l){let c=U8.default.join(e,f),p=t[f];o=o.concat(QC(p,c,r,n,i,s))}}return o}async function W8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=_c.resolve(i?_c.cwd():e,t.$ref),o=_c.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let f=await(0,H8.default)(s,r,n),c=QC(f,o+"#",r,n,new Set,!0);return Promise.all(c)}catch(f){if(!n?.continueOnError||!(0,B8.isHandledError)(f))throw f;return r._$refs[o]&&(f.source=decodeURI(_c.stripHash(e)),f.path=_c.safePointerToPath(_c.getHash(e))),[]}}di.default=V8});var k$=H(pi=>{"use strict";var z8=pi&&pi.__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]})),J8=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G8=pi&&pi.__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"&&z8(r,e,n[i]);return J8(r,e),r}})(),O$=pi&&pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});var Ty=O$(pc()),ip=O$(zd()),ZC=G8(Nn());function Y8(t,e){let r=[];XC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),K8(r)}function XC(t,e,r,n,i,s,o,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Ty.default.isAllowed$Ref(f))q$(t,e,r,n,i,s,o,l);else{let c=Object.keys(f).sort((p,h)=>p==="definitions"?-1:h==="definitions"?1:p.length-h.length);for(let p of c){let h=ip.default.join(r,p),g=ip.default.join(n,p),v=f[p];Ty.default.isAllowed$Ref(v)?q$(f,p,r,g,i,s,o,l):XC(f,p,h,g,i,s,o,l)}}}function q$(t,e,r,n,i,s,o,l){let f=e===null?t:t[e],c=ZC.resolve(r,f.$ref),p=o._resolve(c,n,l);if(p===null)return;let g=ip.default.parse(n).length,v=ZC.stripHash(p.path),_=ZC.getHash(p.path),w=v!==o._root$Ref.path,E=Ty.default.isExtended$Ref(f);i+=p.indirections;let k=Q8(s,t,e);if(k)if(g<k.depth||i<k.indirections)Z8(s,k);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:g,file:v,hash:_,value:p.value,circular:p.circular,extended:E,external:w,indirections:i}),(!k||w)&&XC(p.value,null,p.path,n,i+1,s,o,l)}function K8(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 o=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return o!==l?l-o: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=ip.default.join(n,ip.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Ty.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function Q8(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function Z8(t,e){let r=t.indexOf(e);t.splice(r,1)}pi.default=Y8});var M$=H(hi=>{"use strict";var X8=hi&&hi.__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]})),e5=hi&&hi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),t5=hi&&hi.__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"&&X8(r,e,n[i]);return e5(r,e),r}})(),$$=hi&&hi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hi,"__esModule",{value:!0});var Ay=$$(pc()),P$=$$(zd()),r5=Oo(),T$=t5(Nn()),n5=Mn();hi.default=i5;function i5(t,e){let r=Date.now(),n=ex(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 ex(t,e,r,n,i,s,o,l,f){let c,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new n5.TimeoutError(l.timeoutMs);let h=l.dereference||{},g=h.excludedPathMatcher||(()=>!1);if((h?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!g(r)){if(n.add(t),i.add(t),Ay.default.isAllowed$Ref(t,l))c=A$(t,e,r,n,i,s,o,l,f),p.circular=c.circular,p.value=c.value;else for(let v of Object.keys(t)){let _=P$.default.join(e,v),w=P$.default.join(r,v);if(g(w))continue;let E=t[v],k=!1;if(Ay.default.isAllowed$Ref(E,l)){if(c=A$(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value){let T=new Map;h?.preservedProperties&&typeof t[v]=="object"&&!Array.isArray(t[v])&&h?.preservedProperties.forEach(N=>{N in t[v]&&T.set(N,t[v][N])}),t[v]=c.value,h?.preservedProperties&&T.size&&typeof t[v]=="object"&&!Array.isArray(t[v])&&T.forEach((N,$)=>{t[v][$]=N}),h?.onDereference?.(E.$ref,t[v],t,v)}}else n.has(E)?k=N$(_,o,l):(c=ex(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value&&(t[v]=c.value));p.circular=p.circular||k}n.delete(t)}return p}function A$(t,e,r,n,i,s,o,l,f){let p=Ay.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",h=T$.resolve(p?T$.cwd():e,t.$ref),g=s.get(h);if(g&&!g.circular){let T=Object.keys(t);if(T.length>1){let N={};for(let $ of T)$!=="$ref"&&!($ in g.value)&&(N[$]=t[$]);return{circular:g.circular,value:Object.assign({},g.value,N)}}return g}let v=o._resolve(h,e,l);if(v===null)return{circular:!1,value:null};let _=v.circular,w=_||n.has(v.value);w&&N$(e,o,l);let E=Ay.default.dereference(t,v.value);if(!w){let T=ex(E,v.path,r,n,i,s,o,l,f);w=T.circular,E=T.value}w&&!_&&l.dereference?.circular==="ignore"&&(E=t),_&&(E.$ref=r);let k={circular:w,value:E};return Object.keys(t).length===1&&s.set(h,k),k}function N$(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw r5.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var F$=H(tx=>{"use strict";Object.defineProperty(tx,"__esModule",{value:!0});function s5(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}tx.default=s5()});var L$=H(sp=>{"use strict";var o5=sp&&sp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sp,"__esModule",{value:!0});sp.default=a5;var D$=o5(F$());function a5(t,e){if(t){e.then(function(r){(0,D$.default)(function(){t(null,r)})},function(r){(0,D$.default)(function(){t(r)})});return}else return e}});var B$=H(Ee=>{"use strict";var l5=Ee&&Ee.__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]})),u5=Ee&&Ee.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),c5=Ee&&Ee.__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"&&l5(r,e,n[i]);return u5(r,e),r}})(),rl=Ee&&Ee.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.getJsonSchemaRefParserDefaultOptions=Ee.jsonSchemaParserNormalizeArgs=Ee.dereferenceInternal=Ee.JSONParserErrorGroup=Ee.isHandledError=Ee.UnmatchedParserError=Ee.ParserError=Ee.ResolverError=Ee.MissingPointerError=Ee.InvalidPointerError=Ee.JSONParserError=Ee.UnmatchedResolverError=Ee.dereference=Ee.bundle=Ee.resolve=Ee.parse=Ee.$RefParser=void 0;var j$=rl(VA()),f5=rl(dC()),op=rl(E$());Ee.jsonSchemaParserNormalizeArgs=op.default;var d5=rl(I$()),p5=rl(k$()),H$=rl(M$());Ee.dereferenceInternal=H$.default;var tl=c5(Nn()),Fn=Mn();Object.defineProperty(Ee,"JSONParserError",{enumerable:!0,get:function(){return Fn.JSONParserError}});Object.defineProperty(Ee,"InvalidPointerError",{enumerable:!0,get:function(){return Fn.InvalidPointerError}});Object.defineProperty(Ee,"MissingPointerError",{enumerable:!0,get:function(){return Fn.MissingPointerError}});Object.defineProperty(Ee,"ResolverError",{enumerable:!0,get:function(){return Fn.ResolverError}});Object.defineProperty(Ee,"ParserError",{enumerable:!0,get:function(){return Fn.ParserError}});Object.defineProperty(Ee,"UnmatchedParserError",{enumerable:!0,get:function(){return Fn.UnmatchedParserError}});Object.defineProperty(Ee,"UnmatchedResolverError",{enumerable:!0,get:function(){return Fn.UnmatchedResolverError}});Object.defineProperty(Ee,"isHandledError",{enumerable:!0,get:function(){return Fn.isHandledError}});Object.defineProperty(Ee,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Fn.JSONParserErrorGroup}});var U$=Oo(),mi=rl(L$()),h5=YC();Object.defineProperty(Ee,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return h5.getJsonSchemaRefParserDefaultOptions}});var Ao=class t{constructor(){this.schema=null,this.$refs=new j$.default}async parse(){let e=(0,op.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,U$.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,mi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new j$.default;let n="http";if(tl.isFileSystemPath(e.path))e.path=tl.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=tl.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=tl.resolve(tl.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,f5.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,mi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,mi.default)(e.callback,Promise.resolve(this.schema));throw U$.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Fn.isHandledError)(i)?(0,mi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[tl.stripHash(e.path)]&&this.$refs._$refs[tl.stripHash(e.path)].addError(i),(0,mi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,op.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,d5.default)(this,e.options),rx(this),(0,mi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,mi.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,op.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,p5.default)(this,e.options),rx(this),(0,mi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,mi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,op.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,H$.default)(this,e.options),rx(this),(0,mi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,mi.default)(e.callback,Promise.reject(r))}}};Ee.$RefParser=Ao;Ee.default=Ao;function rx(t){if(Fn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Fn.JSONParserErrorGroup(t)}Ee.parse=Ao.parse;Ee.resolve=Ao.resolve;Ee.bundle=Ao.bundle;Ee.dereference=Ao.dereference});var $y,nl,nx=se(()=>{"use strict";$y=me(B$()),nl=class{async resolve(e){try{return await $y.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 $y.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await $y.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});var V$,W$,m5,Es,Ny=se(()=>{"use strict";V$=me(require("fs")),W$=me(Vd());En();BR();nx();m5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Es=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Ya,this.refResolver=new nl}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await V$.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=W$.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},o=r?.collectionName||i.info?.title||"Imported API",f={id:vt(o),name:o,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 h=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);h&&(f.auth=h)}let c=new Map;if(i.tags)for(let h of i.tags){let g={type:"folder",id:vt(h.name),name:h.name,description:h.description,items:[]};c.set(h.name,g),f.items.push(g)}if(i.paths)for(let[h,g]of Object.entries(i.paths))for(let v of["get","post","put","patch","delete","head","options","trace"]){let _=g[v];if(!_)continue;let w=this.processOperation(v,h,_,g,i,s),E=_.tags?.[0];if(E&&c.has(E))c.get(E).items.push(w);else if(E){let k={type:"folder",id:vt(E),name:E,items:[w]};c.set(E,k),f.items.push(k)}else f.items.push(w)}await this.collectionService.saveCollection(f);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=vt(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,c=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(c=`[DEPRECATED] ${c}`);let h={type:"request",id:l,name:c,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:p},g=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(h,g,o),n.requestBody&&this.processRequestBody(h,n.requestBody,o),n.responses&&(h.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)h.auth={type:"none"};else if(n.security&&n.security.length>0){let v=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);v&&(h.auth=v)}}return h}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let f of r){let c=f.name,p=f.in,h=f.schema||{},g=f.example!==void 0?String(f.example):this.generateExampleForParam(h,n),v=f.deprecated===!0;switch(p){case"path":{if(f.description||h.type||h.format||h.enum||v||h.pattern||h.minimum!==void 0||h.maximum!==void 0||h.minLength!==void 0||h.maxLength!==void 0||h.multipleOf!==void 0||h.minItems!==void 0||h.maxItems!==void 0||h.uniqueItems||h.nullable||h.oneOf){let w={value:g};h.oneOf?(w.oneOf=h.oneOf,this.applyOneOfHints(w,h.oneOf)):(h.type&&(w.type=h.type),h.format&&(w.format=h.format),h.enum&&(w.enum=h.enum.map(String)),h.pattern&&(w.pattern=h.pattern),h.minimum!==void 0&&(w.minimum=h.minimum),h.maximum!==void 0&&(w.maximum=h.maximum),h.exclusiveMinimum!==void 0&&(w.exclusiveMinimum=h.exclusiveMinimum),h.exclusiveMaximum!==void 0&&(w.exclusiveMaximum=h.exclusiveMaximum),h.multipleOf!==void 0&&(w.multipleOf=h.multipleOf),h.minLength!==void 0&&(w.minLength=h.minLength),h.maxLength!==void 0&&(w.maxLength=h.maxLength),h.minItems!==void 0&&(w.minItems=h.minItems),h.maxItems!==void 0&&(w.maxItems=h.maxItems),h.uniqueItems&&(w.uniqueItems=!0),h.nullable&&(w.nullable=!0)),f.description&&(w.description=f.description),v&&(w.deprecated=!0),o[c]=w}else o[c]=g;break}case"query":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),s.push(_);break}case"header":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),i.push(_);break}case"cookie":{l.push(`${c}={{${c}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(o).length>0&&(e.params=o),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),o=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},o){let p=this.generateBodyContent(o,s,n);p!==void 0&&(e.body.content=typeof p=="string"?p:JSON.stringify(p,null,2)),l==="form-data"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n)),l==="x-www-form-urlencoded"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n))}let c=this.buildBodySchema(r,s,n);c&&(e.bodySchema=c)}selectPrimaryContentType(e){for(let i of m5)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[o,l]of Object.entries(i)){let f=l,c=f.type==="string"&&f.format==="binary",p={key:o,value:c?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:c?"file":"text",enabled:!0};n.push(p)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let o={contentType:r,schema:s.schema};if(i.length>1){o.content={};for(let f of i){let c=e.content[f],p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),c.encoding&&(p.encoding=c.encoding),o.content[f]=p}}s.encoding&&(o.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(o.components=l),o}processResponses(e,r){let n={responses:{}},i={};for(let[s,o]of Object.entries(e)){let l=o,f={description:l.description||`Status ${s}`};if(l.content){let c=Object.keys(l.content);if(c.length===1){let p=c[0],h=l.content[p];f.contentType=p,h.schema&&(f.schema=h.schema),h.examples&&(f.examples=h.examples),h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}else{f.content={};for(let p of c){let h=l.content[p],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),f.content[p]=g,h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}}}if(l.headers){f.headers={};for(let[c,p]of Object.entries(l.headers)){let h=p;f.headers[c]={...h.description&&{description:h.description},schema:h.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||{},o=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:o.tokenUrl||"",authUrl:o.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(o.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 o of e[s])this.extractUsedComponents(o,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 il,ix=se(()=>{"use strict";il=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}),o;return i?.postResponseScript&&(o=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,o)}async inferBodySchema(e,r,n,i,s){let o,l;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(f),l="application/json"}else r==="form-data"&&i?(o=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(o=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(o={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(o={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(o={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(o)return s?this.mergeBodySchemaWithExisting(o,s):{contentType:l,schema:o}}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,o]of Object.entries(r.responses))i.responses[s]={...o};if(n&&this.applyScriptHints(i,n),e){for(let[s,o]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],o):i.responses[s]={...o};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],o=s.endsWith("[]"),l=o?s.slice(0,-2):s,f=i?`${i}.${s}`:s,c=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(c.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[f];e.properties[l]={type:p||"string"};return}if(c.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,c,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 z$,My,J$,G$,Y$,K$,Q$,sl,sx=se(()=>{"use strict";z$=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,My="(?:pm|hf|ctx)",J$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),G$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),Y$=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,K$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),Q$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),sl=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(z$.source,z$.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(J$.source,J$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(o),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(G$.source,G$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].trim();if(s){let l=this.parseAssertionValue(o);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(K$.source,K$.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(Q$.source,Q$.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(Y$.source,Y$.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 Z$={};us(Z$,{AwsSecretResolver:()=>ap});var ap,ox=se(()=>{"use strict";ap=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=>require(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:o}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),c=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(c===void 0)return;if(i)try{let p=JSON.parse(c);return p[i]!==void 0?String(p[i]):void 0}catch{return}return c}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 X$={};us(X$,{AzureKeyVaultResolver:()=>lp});var lp,ax=se(()=>{"use strict";lp=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=>require(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:o}=this.moduleRequire("@azure/identity"),l=new o;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 eN={};us(eN,{HashiCorpVaultResolver:()=>up});var up,lx=se(()=>{"use strict";up=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 o=`${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(o,{headers:l})}catch(g){throw new Error(`[HTTP Forge] Vault request failed: ${g?.message??g}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let p=(await f.json())?.data?.data;if(!p)return;if(i)return p[i]!==void 0?String(p[i]):void 0;if("value"in p)return String(p.value);let h=Object.keys(p);return h.length===1?String(p[h[0]]):void 0}}});var nN={};us(nN,{OnePasswordResolver:()=>cp});var tN,rN,g5,cp,ux=se(()=>{"use strict";tN=require("child_process"),rN=require("util"),g5=(0,rN.promisify)(tN.execFile),cp=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 o=await this.tryResolveSdk(n,i,s);return o!==null?o: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}=require("@1password/sdk"),o=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await o.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 g5("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 iN={};us(iN,{GcpSecretResolver:()=>fp});var fp,cx=se(()=>{"use strict";fp=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=>require(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"),o=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await o.accessSecretVersion({name:l}),c=f.payload?.data;return c?Buffer.isBuffer(c)?c.toString("utf-8"):Buffer.from(c).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 oN={};us(oN,{DopplerResolver:()=>dp});var sN,dp,fx=se(()=>{"use strict";sN=me(require("https")),dp=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,o)=>{let l=sN.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let c=[];f.on("data",p=>c.push(p)),f.on("end",()=>{let p=Buffer.concat(c).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${p}`));return}try{let g=JSON.parse(p)?.value?.computed;s(g!=null?String(g):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});var Fy,aN,lN,Rc,dx=se(()=>{"use strict";Fy=me(require("fs")),aN=require("module"),lN=me(require("path")),Rc=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 o=>{if(n.has(o))return;let l=o.slice(7),f=l.indexOf("/");if(f<0)return;let c=l.slice(0,f),p=l.slice(f+1),h=this.resolvers.get(c);if(h)try{let g=await h.resolve(p);g!==void 0&&n.set(o,g)}catch(g){let v=g?.message??String(g);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${v}`)}}));let s={};for(let[o,l]of n.entries())s[o]=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}=(ox(),ga(Z$));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(ax(),ga(X$));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(lx(),ga(eN));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(ux(),ga(nN));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(cx(),ga(iN));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(fx(),ga(oN));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>require(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=lN.resolve(i,"package.json");if(Fy.existsSync(s)){let o=Fy.realpathSync(s),l=(0,aN.createRequire)(o);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});function ur(t){return t.replace(/\//g,"%2F")}function px(t){return t.replace(/%2F/gi,"/")}function Ui(t){return t?t.split("/").map(px).join(" / "):""}function pp(t){return t.includes(" / ")?t.split(" / ").map(e=>ur(e.trim())).join("/"):ur(t)}function Ke(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,o=ur(s.name),l=r?`${r}/${o}`:o;n.push(...Ke(t,s.items??[],l))}return n}function Ar(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=ur(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:Dy(s.items??[])}),n.push(...Ar(t,s.items??[],l))}return n}function Dy(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Dy(r.items??[]);return e}var gi=se(()=>{"use strict"});var Cc,hx=se(()=>{"use strict";Cc={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});var Mt,$o,xc,mx=se(()=>{"use strict";Mt=me(require("fs")),$o=me(require("path"));gi();En();hx();xc=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(){Mt.existsSync(this.suitesDir)||Mt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Mt.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(),!Mt.existsSync(this.suitesDir))return;let e=Mt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=$o.join(this.suitesDir,r),i=Mt.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:vt(e),name:e,requests:r,config:{...Cc},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=$o.join(this.suitesDir,e),o=$o.join(this.suitesDir,i.id);return Mt.existsSync(s)&&this.copyDirRecursive(s,o),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Mt.existsSync(r)||Mt.mkdirSync(r,{recursive:!0});for(let n of Mt.readdirSync(e,{withFileTypes:!0})){let i=$o.join(e,n.name),s=$o.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Mt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=$o.join(this.suitesDir,n);try{return Mt.existsSync(i)&&Mt.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:{...Cc},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 o=r.replace(/\/+$/,""),l=s.filter(p=>n?p.folderPath===o||p.folderPath.startsWith(`${o}/`):p.folderPath===o);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(o)}`,name:`${i.name} / ${Ui(o)}`,requests:l,config:{...Cc},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:vt(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 o of e.requests)s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.items)for(let o of e.items)if(o.items||o.folders||o.requests){let l=i?`${i}/${ur(o.name)}`:ur(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.folders)for(let o of e.folders){let l=i?`${i}/${ur(o.name)}`:ur(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=$o.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Mt.writeFileSync(n,i,"utf-8")}}});var ne,Ly=se(()=>{"use strict";ne={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")}});function hp(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:f,applicationInfo:c,consoleService:p}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new La(r,n,i)),t.registerSingleton(ne.Console,()=>p??y5),t.registerSingleton(ne.EnvironmentConfig,g=>new Gu(r,s,g.resolve(ne.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ne.Cookie,()=>new zu(o)),t.registerSingleton(ne.Collection,g=>new Wu(r,g.resolve(ne.Config),n)),t.registerSingleton(ne.TestSuite,g=>new xc(g.resolve(ne.Collection),g.resolve(ne.Config))),t.registerSingleton(ne.HttpClient,()=>new io),t.registerSingleton(ne.UrlBuilder,()=>new In),t.registerSingleton(ne.InterceptorChain,()=>new Pi),t.registerSingleton(ne.HttpRequest,g=>new ki(g.resolve(ne.UrlBuilder),g.resolve(ne.InterceptorChain),g.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new po),t.registerSingleton(ne.RequestHistory,g=>{let v=g.resolve(ne.EnvironmentConfig);return new Qu(v.getHistoriesPath(),uN.join(v.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(ne.OAuth2TokenManager,g=>new Hu(l,f,g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,g=>new Ku(g.resolve(ne.HttpClient))),t.registerSingleton(ne.SecretResolverRegistry,g=>new Rc(g.resolve(ne.Config)));let h=c??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,g=>new Yu(g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest),g.resolve(ne.RequestPreprocessor),g.has(ne.OAuth2TokenManager)?g.resolve(ne.OAuth2TokenManager):void 0,h,g.resolve(ne.SecretResolverRegistry))),t.registerSingleton(ne.ScriptExecutor,g=>{let v=g.resolve(ne.Config);return new Ni(g.resolve(ne.HttpRequest),v.getModulePaths(),g.resolve(ne.SecretResolverRegistry),v.getScriptScope(),v.getScriptTimeout())}),t.registerSingleton(ne.DataFileParser,()=>new mo),t.registerSingleton(ne.CollectionRequestExecutor,g=>new gs(g.resolve(ne.HttpRequest),g.resolve(ne.ScriptExecutor),g.resolve(ne.EnvironmentConfig),g.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,g=>new Ju(g.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new bs),t.registerSingleton(ne.HistoryAnalyzer,g=>new Ua(g.resolve(ne.RequestHistory),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new sl),t.registerSingleton(ne.SchemaInferenceService,g=>new il(g.resolve(ne.HistoryAnalyzer),g.resolve(ne.ScriptAnalyzer),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,g=>new Ga(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig),g.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,g=>new Es(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig)))}var uN,y5,gx=se(()=>{"use strict";uN=me(require("path"));V0();Y0();Q0();Z0();X0();t_();eg();r_();n_();o_();xf();Ef();Cf();Km();du();a_();HR();Ny();ix();sy();sx();Qm();ad();dx();mx();Ly();y5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function yx(){return No.instance}var No,vx=se(()=>{"use strict";Ly();No=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static createFresh(){return new t}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ne.OAuth2TokenManager)?this.resolve(ne.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}get testSuite(){return this.resolve(ne.TestSuite)}}});function cN(t){return/\{\{[^}]+\}\}/.test(t)}function mp(t,e=16){return!!t&&t.length>=e&&!cN(t)}function bx(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function gp(t,e,r,n,i,s=10){let o=t.get(e);o||(o={varName:r,reason:n,occurrences:[],priority:s},t.set(e,o));let l=`${i.requestId}::${i.field}`;o.occurrences.some(f=>`${f.requestId}::${f.field}`===l)||o.occurrences.push(i)}function yp(t,e=1){let r=Ke(t),n=new Map;for(let{request:s}of r){let o=l=>({requestId:s.id,requestName:s.name,field:l});for(let l of s.headers??[]){if(l.enabled===!1)continue;let f=l.key.toLowerCase(),c=l.value;if(f==="authorization"){let p=c.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&mp(p[2])?gp(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):mp(c)&&gp(n,c,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else v5.has(f)&&mp(c)?gp(n,c,bx(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):mp(c,20)&&!c.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(c)&&gp(n,c,bx(l.key)||"HEADER_VALUE",`Long opaque value in header: ${l.key}`,o(`header:${l.key}`),5)}for(let l of s.query??[])l.enabled!==!1&&b5.has(l.key.toLowerCase())&&mp(l.value)&&gp(n,l.value,bx(l.key),`Sensitive query param: ${l.key}`,o(`query:${l.key}`),2)}let i=new Map;for(let{request:s}of r)if(!(!s.url||cN(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let f=`${o.protocol}//${o.host}`,c=i.get(f)??[];c.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(f,c)}}catch{}for(let[s,o]of i)o.length>=Math.max(e,2)&&!n.has(s)&&n.set(s,{varName:"BASE_URL",reason:`Shared base URL across ${o.length} requests`,occurrences:o,priority:3});return[...n.entries()].filter(([,s])=>s.occurrences.length>=e).sort((s,o)=>s[1].priority-o[1].priority||s[0].localeCompare(o[0])).map(([s,o])=>({varName:o.varName,value:s,reason:o.reason,occurrences:o.occurrences}))}function jy(t,e){let r={};return fN(t,e,r),r}function fN(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&fN(n.items,e,r);continue}let i=n;for(let s of e){let o=`{{${s.varName}}}`;i.url?.includes(s.value)&&(i.url=i.url.split(s.value).join(o),r[s.varName]=(r[s.varName]??0)+1);for(let l of i.headers??[]){let f=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&f[2]===s.value?(l.value=`${f[1]} ${o}`,r[s.varName]=(r[s.varName]??0)+1):l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}for(let l of i.query??[])l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}}}var v5,b5,Sx=se(()=>{"use strict";gi();v5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),b5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Is(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Uy(t,e,r){let n=i=>Is("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${J.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_folders, list_requests or run_* tools.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.listFolders}`,description:"List all folders in a collection with their full paths and request counts. Use this before run_folder to discover the exact folder path string to pass.",inputSchema:{type:"object",properties:{collection:n(!0)},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request. For large collections use the folder filter and offset/limit to page through results.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 200)."}},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.searchRequests}`,description:"Search for requests across a collection by name, URL, method, or folder path. Returns matching requests with their folder location. Useful for large collections.",inputSchema:{type:"object",properties:{collection:n(!0),query:{type:"string",description:"Text to search for in request names, URLs, methods, and folder paths (case-insensitive)."}},required:["collection","query"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRequest}`,description:"Get the full details of a single saved request: URL, method, headers, body, auth, and scripts. Use this to inspect a request before editing it, or to read a script before rewriting it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id. Use list_requests to find names."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getEnvironment}`,description:"Show the current environment variable values (merged initial + runtime pm.environment.set overrides). Use this to inspect variable state before running a folder, or to debug {{variable}} resolution failures.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to inspect (defaults to the currently selected environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.setVariable}`,description:'Override an environment variable for the current session. In the VS Code extension the change is saved to VS Code workspace storage (survives restarts, but is not in the env JSON file and not source-controlled). In the standalone CLI/core runtime the change is in-memory only and lost when the server restarts. Use set_environment_variable with scope:"permanent" to write to the env JSON file (source-controlled, works in both runtimes).',inputSchema:{type:"object",properties:{key:{type:"string",description:"Variable name (the part inside {{...}})."},value:{type:"string",description:"New value to set."},environment:{type:"string",description:"Environment to update (defaults to the currently selected environment)."}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.getRunStatus}`,description:"Check whether an async run is still running, completed, or failed. Poll this after calling run_folder/run_collection/run_suite with async:true.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed". When failures are present the response includes a failedRequests array with full details (method, url, requestBody, status, responseBody, failedTests) and a _nextStep directive. You MUST follow the _nextStep directive immediately \u2014 analyze the failures and provide diagnosis without waiting for the user to ask.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getFailedRequests}`,description:"Get the list of failed requests from a completed async run \u2014 the failures-first view. Never returns passing requests. Use this instead of get_run_summary when you need to see what broke.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum failures to return (default: 20, max: 100)."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRequestResult}`,description:"Get the full result (status, body, assertions, console output) for one specific request from an async run. Use after get_failed_requests to drill into a single failure.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},request:{type:"string",description:"Name of the request to look up."},iteration:{type:"number",description:"Iteration number (default: 1)."}},required:["runId","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.cancelRun}`,description:'Request cancellation of an in-progress async run. Cancellation is best-effort: the currently-executing HTTP request completes normally, but no further requests in the run are started. The run status changes to "cancelled". Has no effect on runs that are already completed, failed, or cancelled.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by run_collection, run_folder, or run_suite with async:true."}},required:["runId"]},annotations:{idempotentHint:!0}},{name:`${t}${J.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests or search_requests to find names."},requestId:{type:"string",description:'ID of the request (from list_requests/search_requests). Preferred over "request" name when available \u2014 avoids ambiguity with duplicate names.'},...vp.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...Sp.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...bp.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Is("Name of the test suite to run.",r),...wp.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.createCollection}`,description:"Create a new empty collection.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new collection."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.renameCollection}`,description:"Rename an existing collection.",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"New display name for the collection."}},required:["collection","newName"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteCollection}`,description:"Permanently delete a collection and all its contents. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.duplicateCollection}`,description:"Clone a collection under a new name (all folders, requests, and scripts are copied).",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"Name for the duplicated collection."}},required:["collection","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.createFolder}`,description:"Create a folder inside a collection (optionally nested inside another folder).",inputSchema:{type:"object",properties:{collection:n(!0),name:{type:"string",description:"Display name for the new folder."},parentFolder:{type:"string",description:"Slash-separated folder path or folder id of the parent. Omit to create at collection root."}},required:["collection","name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteFolder}`,description:"Delete a folder and all its requests. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Slash-separated folder path or folder id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","folder","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.createRequest}`,description:"Create a new HTTP request inside a collection (optionally inside a folder).",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to add at collection root."},name:{type:"string",description:"Display name for the request."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method."},url:{type:"string",description:"Request URL, may include {{variable}} placeholders."},headers:{type:"object",description:"Key/value header map.",additionalProperties:{type:"string"}},body:{type:"string",description:"Raw request body (JSON, text, etc.)."},description:{type:"string",description:"Human-readable description."}},required:["collection","name","method","url"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateRequest}`,description:"Update fields on an existing request (partial update \u2014 omit fields to keep current values).",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},name:{type:"string",description:"New display name."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},url:{type:"string"},headers:{type:"object",additionalProperties:{type:"string"}},body:{type:"string"},description:{type:"string"}},required:["collection","request"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteRequest}`,description:"Remove a request from a collection. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","request","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.getRequestScript}`,description:"Read the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to read."}},required:["collection","request","phase"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.setRequestScript}`,description:"Write or replace the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to write."},script:{type:"string",description:"Full JavaScript source to write."}},required:["collection","request","phase","script"]},annotations:{idempotentHint:!0}},{name:`${t}${J.reorderCollectionItems}`,description:"Set the execution/display order of direct children of a collection root or folder. Items not listed are appended at the end.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to reorder collection root."},order:{type:"array",items:{type:"string"},description:"Ordered list of item names or ids."}},required:["collection","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getSuite}`,description:"Get full details of a test suite including its request list.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.createSuite}`,description:"Create a new test suite (empty or pre-populated from a collection/folder).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new suite."},description:{type:"string",description:"Optional description."},fromCollection:{type:"string",description:"Collection name or id to seed the suite from (all requests in execution order)."},fromFolder:{type:"string",description:"Folder path within fromCollection to seed from."},iterations:{type:"number",description:"Number of iterations (default: 1)."},stopOnError:{type:"boolean",description:"Stop on first failure (default: false)."},delayBetweenRequests:{type:"number",description:"Milliseconds delay between requests (default: 0)."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateSuiteConfig}`,description:"Change a suite's name, description, or run configuration.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${J.addSuiteRequests}`,description:"Append or insert one or more requests into a suite.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite.",r),requests:{type:"array",items:{type:"object",properties:{collection:{type:"string",description:"Collection name or id."},request:{type:"string",description:"Request name or id."}},required:["collection","request"]},description:"Requests to add."},insertAt:{type:"number",description:"Zero-based index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${J.removeSuiteRequest}`,description:"Remove a request from a suite by position (0-based) or by name.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite.",r),index:{type:"number",description:"Zero-based position in the suite requests list."},request:{type:"string",description:"Request name to remove (used if index is not provided)."}},required:["suite"]},annotations:{destructiveHint:!0}},{name:`${t}${J.reorderSuiteRequests}`,description:"Reorder requests in a suite. Requests not listed are moved to the end.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite.",r),order:{type:"array",items:{type:"string"},description:"Ordered list of request names."}},required:["suite","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite to clone.",r),newName:{type:"string",description:"Name for the duplicated suite."}},required:["suite","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite to delete.",r),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["suite","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.listEnvironments}`,description:"List all environments with their variable keys (values hidden). Use get_environment_variables to see values.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getEnvironmentVariables}`,description:"Get the resolved (merged file + session overrides) variables for an environment.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.selectEnvironment}`,description:"Set the active environment for all subsequent run_* calls in this session.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Name of the environment to activate."}},required:["environment"]},annotations:{idempotentHint:!0}},{name:`${t}${J.createEnvironment}`,description:"Create a new environment file, optionally pre-populated with variables.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Environment name (becomes the filename)."},variables:{type:"object",description:"Initial key/value variable map.",additionalProperties:{type:"string"}}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteEnvironment}`,description:"Delete an environment file permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["environment","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.setEnvironmentVariable}`,description:'Set a variable in an environment. Scope "session" (default) is in-memory only and always temporary (both runtimes). Scope "permanent" writes to the env JSON config file \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name."},value:{type:"string",description:"New value."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to disk.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.unsetEnvironmentVariable}`,description:"Remove a session-scoped variable override, restoring the file value.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name to unset."}},required:["key"]},annotations:{idempotentHint:!0}},{name:`${t}${J.setGlobalVariable}`,description:'Set a global variable visible across all environments. Scope "session" (default) is in-memory only and lost on restart (both runtimes). Scope "permanent" writes to _global.json \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{key:{type:"string",description:"Global variable name."},value:{type:"string",description:"Value to set."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to _global.json.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.scaffoldCollectionFromOpenApi}`,description:"Import an OpenAPI 3.0 spec (JSON or YAML) and scaffold a complete HTTP Forge collection from it. All operations become requests grouped by tag/path. An optional environment is created from the server URL. Returns the new collection id and name. Use this to quickly bootstrap API testing from a spec file.",inputSchema:{type:"object",properties:{specPath:{type:"string",description:"Absolute or workspace-relative path to the OpenAPI 3.0 JSON or YAML file."},collectionName:{type:"string",description:"Override the collection name (defaults to the spec title)."},environmentName:{type:"string",description:"Name for the generated environment that contains the server base URL. Omit to skip environment creation."}},required:["specPath"]},annotations:{idempotentHint:!1}},{name:`${t}${J.suggestAssertions}`,description:"Analyse the last execution history for a request and suggest pm.test() assertions to add to its post-response script. Covers status code, response time, required JSON fields, Content-Type header, and schema conformance. Returns an array of ready-to-paste JavaScript test snippets and a rationale for each.",inputSchema:{type:"object",properties:{collection:{type:"string",description:"Collection name or id that owns the request."},request:{type:"string",description:"Request name or id to analyse."},environment:{type:"string",description:"Environment used when the run was recorded (defaults to active environment)."},maxSuggestions:{type:"number",description:"Cap the number of suggestions returned (default: 10)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.explainFailure}`,description:"Explain why a specific request failed in a recent run. Returns the full request (URL, method, headers, body), the response received (status, headers, body), all assertion results, any script errors, and a plain-English diagnosis with suggested fixes. Provide either runId (from a prior run_suite/run_collection call) + request name, or the collection and request names to pull the most recent history entry.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"MCP run id (from run_suite or run_collection). Mutually exclusive with collection+request history lookup."},collection:{type:"string",description:"Collection name or id. Required when runId is omitted."},request:{type:"string",description:"Request name or id."},iteration:{type:"number",description:"Iteration number within the run (default: 1)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
|
|
277
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,ky.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=np.resolve(t.href,i.headers.location);return w$(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new S$.ResolverError((0,ky.ono)(i,`Error downloading ${t.href}`),t.href)}}async function I8(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 YC=H(xs=>{"use strict";var wc=xs&&xs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xs,"__esModule",{value:!0});xs.getNewOptions=xs.getJsonSchemaRefParserDefaultOptions=void 0;var O8=wc(YA()),q8=wc(p$()),k8=wc(h$()),P8=wc(m$()),T8=wc(b$()),A8=wc(_$()),$8=()=>({parse:{json:{...O8.default},yaml:{...q8.default},text:{...k8.default},binary:{...P8.default}},resolve:{file:{...T8.default},http:{...A8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});xs.getJsonSchemaRefParserDefaultOptions=$8;var N8=t=>{let e=(0,xs.getJsonSchemaRefParserDefaultOptions)();return t&&C$(e,t),e};xs.getNewOptions=N8;function C$(t,e){if(R$(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],o=t[i];R$(s)?t[i]=C$(o||{},s):s!==void 0&&(t[i]=s)}}return t}function R$(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var E$=H(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.normalizeArgs=x$;var M8=YC();function x$(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,M8.getNewOptions)(n)}catch(o){console.error(`JSON Schema Ref Parser: Error normalizing options: ${o}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Py.default=x$});var I$=H(di=>{"use strict";var F8=di&&di.__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]})),D8=di&&di.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),L8=di&&di.__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"&&F8(r,e,n[i]);return D8(r,e),r}})(),KC=di&&di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});var j8=KC(pc()),U8=KC(zd()),H8=KC(dC()),_c=L8(Nn()),B8=Mn();function V8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=QC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function QC(t,e,r,n,i,s){i||(i=new Set);let o=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),j8.default.isExternal$Ref(t)&&o.push(W8(t,e,r,n));let l=Object.keys(t);for(let f of l){let c=U8.default.join(e,f),p=t[f];o=o.concat(QC(p,c,r,n,i,s))}}return o}async function W8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=_c.resolve(i?_c.cwd():e,t.$ref),o=_c.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let f=await(0,H8.default)(s,r,n),c=QC(f,o+"#",r,n,new Set,!0);return Promise.all(c)}catch(f){if(!n?.continueOnError||!(0,B8.isHandledError)(f))throw f;return r._$refs[o]&&(f.source=decodeURI(_c.stripHash(e)),f.path=_c.safePointerToPath(_c.getHash(e))),[]}}di.default=V8});var k$=H(pi=>{"use strict";var z8=pi&&pi.__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]})),J8=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G8=pi&&pi.__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"&&z8(r,e,n[i]);return J8(r,e),r}})(),q$=pi&&pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});var Ty=q$(pc()),ip=q$(zd()),ZC=G8(Nn());function Y8(t,e){let r=[];XC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),K8(r)}function XC(t,e,r,n,i,s,o,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Ty.default.isAllowed$Ref(f))O$(t,e,r,n,i,s,o,l);else{let c=Object.keys(f).sort((p,h)=>p==="definitions"?-1:h==="definitions"?1:p.length-h.length);for(let p of c){let h=ip.default.join(r,p),g=ip.default.join(n,p),v=f[p];Ty.default.isAllowed$Ref(v)?O$(f,p,r,g,i,s,o,l):XC(f,p,h,g,i,s,o,l)}}}function O$(t,e,r,n,i,s,o,l){let f=e===null?t:t[e],c=ZC.resolve(r,f.$ref),p=o._resolve(c,n,l);if(p===null)return;let g=ip.default.parse(n).length,v=ZC.stripHash(p.path),_=ZC.getHash(p.path),w=v!==o._root$Ref.path,E=Ty.default.isExtended$Ref(f);i+=p.indirections;let k=Q8(s,t,e);if(k)if(g<k.depth||i<k.indirections)Z8(s,k);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:g,file:v,hash:_,value:p.value,circular:p.circular,extended:E,external:w,indirections:i}),(!k||w)&&XC(p.value,null,p.path,n,i+1,s,o,l)}function K8(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 o=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return o!==l?l-o: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=ip.default.join(n,ip.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Ty.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function Q8(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function Z8(t,e){let r=t.indexOf(e);t.splice(r,1)}pi.default=Y8});var M$=H(hi=>{"use strict";var X8=hi&&hi.__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]})),e5=hi&&hi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),t5=hi&&hi.__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"&&X8(r,e,n[i]);return e5(r,e),r}})(),$$=hi&&hi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hi,"__esModule",{value:!0});var Ay=$$(pc()),P$=$$(zd()),r5=qo(),T$=t5(Nn()),n5=Mn();hi.default=i5;function i5(t,e){let r=Date.now(),n=ex(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 ex(t,e,r,n,i,s,o,l,f){let c,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new n5.TimeoutError(l.timeoutMs);let h=l.dereference||{},g=h.excludedPathMatcher||(()=>!1);if((h?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!g(r)){if(n.add(t),i.add(t),Ay.default.isAllowed$Ref(t,l))c=A$(t,e,r,n,i,s,o,l,f),p.circular=c.circular,p.value=c.value;else for(let v of Object.keys(t)){let _=P$.default.join(e,v),w=P$.default.join(r,v);if(g(w))continue;let E=t[v],k=!1;if(Ay.default.isAllowed$Ref(E,l)){if(c=A$(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value){let T=new Map;h?.preservedProperties&&typeof t[v]=="object"&&!Array.isArray(t[v])&&h?.preservedProperties.forEach(N=>{N in t[v]&&T.set(N,t[v][N])}),t[v]=c.value,h?.preservedProperties&&T.size&&typeof t[v]=="object"&&!Array.isArray(t[v])&&T.forEach((N,$)=>{t[v][$]=N}),h?.onDereference?.(E.$ref,t[v],t,v)}}else n.has(E)?k=N$(_,o,l):(c=ex(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value&&(t[v]=c.value));p.circular=p.circular||k}n.delete(t)}return p}function A$(t,e,r,n,i,s,o,l,f){let p=Ay.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",h=T$.resolve(p?T$.cwd():e,t.$ref),g=s.get(h);if(g&&!g.circular){let T=Object.keys(t);if(T.length>1){let N={};for(let $ of T)$!=="$ref"&&!($ in g.value)&&(N[$]=t[$]);return{circular:g.circular,value:Object.assign({},g.value,N)}}return g}let v=o._resolve(h,e,l);if(v===null)return{circular:!1,value:null};let _=v.circular,w=_||n.has(v.value);w&&N$(e,o,l);let E=Ay.default.dereference(t,v.value);if(!w){let T=ex(E,v.path,r,n,i,s,o,l,f);w=T.circular,E=T.value}w&&!_&&l.dereference?.circular==="ignore"&&(E=t),_&&(E.$ref=r);let k={circular:w,value:E};return Object.keys(t).length===1&&s.set(h,k),k}function N$(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw r5.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var F$=H(tx=>{"use strict";Object.defineProperty(tx,"__esModule",{value:!0});function s5(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}tx.default=s5()});var L$=H(sp=>{"use strict";var o5=sp&&sp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sp,"__esModule",{value:!0});sp.default=a5;var D$=o5(F$());function a5(t,e){if(t){e.then(function(r){(0,D$.default)(function(){t(null,r)})},function(r){(0,D$.default)(function(){t(r)})});return}else return e}});var B$=H(Ee=>{"use strict";var l5=Ee&&Ee.__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]})),u5=Ee&&Ee.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),c5=Ee&&Ee.__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"&&l5(r,e,n[i]);return u5(r,e),r}})(),rl=Ee&&Ee.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.getJsonSchemaRefParserDefaultOptions=Ee.jsonSchemaParserNormalizeArgs=Ee.dereferenceInternal=Ee.JSONParserErrorGroup=Ee.isHandledError=Ee.UnmatchedParserError=Ee.ParserError=Ee.ResolverError=Ee.MissingPointerError=Ee.InvalidPointerError=Ee.JSONParserError=Ee.UnmatchedResolverError=Ee.dereference=Ee.bundle=Ee.resolve=Ee.parse=Ee.$RefParser=void 0;var j$=rl(VA()),f5=rl(dC()),op=rl(E$());Ee.jsonSchemaParserNormalizeArgs=op.default;var d5=rl(I$()),p5=rl(k$()),H$=rl(M$());Ee.dereferenceInternal=H$.default;var tl=c5(Nn()),Fn=Mn();Object.defineProperty(Ee,"JSONParserError",{enumerable:!0,get:function(){return Fn.JSONParserError}});Object.defineProperty(Ee,"InvalidPointerError",{enumerable:!0,get:function(){return Fn.InvalidPointerError}});Object.defineProperty(Ee,"MissingPointerError",{enumerable:!0,get:function(){return Fn.MissingPointerError}});Object.defineProperty(Ee,"ResolverError",{enumerable:!0,get:function(){return Fn.ResolverError}});Object.defineProperty(Ee,"ParserError",{enumerable:!0,get:function(){return Fn.ParserError}});Object.defineProperty(Ee,"UnmatchedParserError",{enumerable:!0,get:function(){return Fn.UnmatchedParserError}});Object.defineProperty(Ee,"UnmatchedResolverError",{enumerable:!0,get:function(){return Fn.UnmatchedResolverError}});Object.defineProperty(Ee,"isHandledError",{enumerable:!0,get:function(){return Fn.isHandledError}});Object.defineProperty(Ee,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Fn.JSONParserErrorGroup}});var U$=qo(),mi=rl(L$()),h5=YC();Object.defineProperty(Ee,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return h5.getJsonSchemaRefParserDefaultOptions}});var Ao=class t{constructor(){this.schema=null,this.$refs=new j$.default}async parse(){let e=(0,op.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,U$.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,mi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new j$.default;let n="http";if(tl.isFileSystemPath(e.path))e.path=tl.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=tl.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=tl.resolve(tl.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,f5.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,mi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,mi.default)(e.callback,Promise.resolve(this.schema));throw U$.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Fn.isHandledError)(i)?(0,mi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[tl.stripHash(e.path)]&&this.$refs._$refs[tl.stripHash(e.path)].addError(i),(0,mi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,op.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,d5.default)(this,e.options),rx(this),(0,mi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,mi.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,op.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,p5.default)(this,e.options),rx(this),(0,mi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,mi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,op.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,H$.default)(this,e.options),rx(this),(0,mi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,mi.default)(e.callback,Promise.reject(r))}}};Ee.$RefParser=Ao;Ee.default=Ao;function rx(t){if(Fn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Fn.JSONParserErrorGroup(t)}Ee.parse=Ao.parse;Ee.resolve=Ao.resolve;Ee.bundle=Ao.bundle;Ee.dereference=Ao.dereference});var $y,nl,nx=se(()=>{"use strict";$y=me(B$()),nl=class{async resolve(e){try{return await $y.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 $y.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await $y.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});var V$,W$,m5,Es,Ny=se(()=>{"use strict";V$=me(require("fs")),W$=me(Vd());En();BR();nx();m5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Es=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Ya,this.refResolver=new nl}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await V$.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=W$.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},o=r?.collectionName||i.info?.title||"Imported API",f={id:vt(o),name:o,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 h=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);h&&(f.auth=h)}let c=new Map;if(i.tags)for(let h of i.tags){let g={type:"folder",id:vt(h.name),name:h.name,description:h.description,items:[]};c.set(h.name,g),f.items.push(g)}if(i.paths)for(let[h,g]of Object.entries(i.paths))for(let v of["get","post","put","patch","delete","head","options","trace"]){let _=g[v];if(!_)continue;let w=this.processOperation(v,h,_,g,i,s),E=_.tags?.[0];if(E&&c.has(E))c.get(E).items.push(w);else if(E){let k={type:"folder",id:vt(E),name:E,items:[w]};c.set(E,k),f.items.push(k)}else f.items.push(w)}await this.collectionService.saveCollection(f);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=vt(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,c=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(c=`[DEPRECATED] ${c}`);let h={type:"request",id:l,name:c,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:p},g=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(h,g,o),n.requestBody&&this.processRequestBody(h,n.requestBody,o),n.responses&&(h.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)h.auth={type:"none"};else if(n.security&&n.security.length>0){let v=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);v&&(h.auth=v)}}return h}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let f of r){let c=f.name,p=f.in,h=f.schema||{},g=f.example!==void 0?String(f.example):this.generateExampleForParam(h,n),v=f.deprecated===!0;switch(p){case"path":{if(f.description||h.type||h.format||h.enum||v||h.pattern||h.minimum!==void 0||h.maximum!==void 0||h.minLength!==void 0||h.maxLength!==void 0||h.multipleOf!==void 0||h.minItems!==void 0||h.maxItems!==void 0||h.uniqueItems||h.nullable||h.oneOf){let w={value:g};h.oneOf?(w.oneOf=h.oneOf,this.applyOneOfHints(w,h.oneOf)):(h.type&&(w.type=h.type),h.format&&(w.format=h.format),h.enum&&(w.enum=h.enum.map(String)),h.pattern&&(w.pattern=h.pattern),h.minimum!==void 0&&(w.minimum=h.minimum),h.maximum!==void 0&&(w.maximum=h.maximum),h.exclusiveMinimum!==void 0&&(w.exclusiveMinimum=h.exclusiveMinimum),h.exclusiveMaximum!==void 0&&(w.exclusiveMaximum=h.exclusiveMaximum),h.multipleOf!==void 0&&(w.multipleOf=h.multipleOf),h.minLength!==void 0&&(w.minLength=h.minLength),h.maxLength!==void 0&&(w.maxLength=h.maxLength),h.minItems!==void 0&&(w.minItems=h.minItems),h.maxItems!==void 0&&(w.maxItems=h.maxItems),h.uniqueItems&&(w.uniqueItems=!0),h.nullable&&(w.nullable=!0)),f.description&&(w.description=f.description),v&&(w.deprecated=!0),o[c]=w}else o[c]=g;break}case"query":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),s.push(_);break}case"header":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),i.push(_);break}case"cookie":{l.push(`${c}={{${c}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(o).length>0&&(e.params=o),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),o=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},o){let p=this.generateBodyContent(o,s,n);p!==void 0&&(e.body.content=typeof p=="string"?p:JSON.stringify(p,null,2)),l==="form-data"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n)),l==="x-www-form-urlencoded"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n))}let c=this.buildBodySchema(r,s,n);c&&(e.bodySchema=c)}selectPrimaryContentType(e){for(let i of m5)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[o,l]of Object.entries(i)){let f=l,c=f.type==="string"&&f.format==="binary",p={key:o,value:c?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:c?"file":"text",enabled:!0};n.push(p)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let o={contentType:r,schema:s.schema};if(i.length>1){o.content={};for(let f of i){let c=e.content[f],p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),c.encoding&&(p.encoding=c.encoding),o.content[f]=p}}s.encoding&&(o.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(o.components=l),o}processResponses(e,r){let n={responses:{}},i={};for(let[s,o]of Object.entries(e)){let l=o,f={description:l.description||`Status ${s}`};if(l.content){let c=Object.keys(l.content);if(c.length===1){let p=c[0],h=l.content[p];f.contentType=p,h.schema&&(f.schema=h.schema),h.examples&&(f.examples=h.examples),h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}else{f.content={};for(let p of c){let h=l.content[p],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),f.content[p]=g,h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}}}if(l.headers){f.headers={};for(let[c,p]of Object.entries(l.headers)){let h=p;f.headers[c]={...h.description&&{description:h.description},schema:h.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||{},o=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:o.tokenUrl||"",authUrl:o.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(o.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 o of e[s])this.extractUsedComponents(o,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 il,ix=se(()=>{"use strict";il=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}),o;return i?.postResponseScript&&(o=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,o)}async inferBodySchema(e,r,n,i,s){let o,l;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(f),l="application/json"}else r==="form-data"&&i?(o=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(o=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(o={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(o={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(o={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(o)return s?this.mergeBodySchemaWithExisting(o,s):{contentType:l,schema:o}}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,o]of Object.entries(r.responses))i.responses[s]={...o};if(n&&this.applyScriptHints(i,n),e){for(let[s,o]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],o):i.responses[s]={...o};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],o=s.endsWith("[]"),l=o?s.slice(0,-2):s,f=i?`${i}.${s}`:s,c=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(c.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[f];e.properties[l]={type:p||"string"};return}if(c.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,c,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 z$,My,J$,G$,Y$,K$,Q$,sl,sx=se(()=>{"use strict";z$=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,My="(?:pm|hf|ctx)",J$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),G$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),Y$=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,K$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),Q$=new RegExp(`${My}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),sl=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(z$.source,z$.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(J$.source,J$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(o),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(G$.source,G$.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].trim();if(s){let l=this.parseAssertionValue(o);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(K$.source,K$.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(Q$.source,Q$.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(Y$.source,Y$.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 Z$={};us(Z$,{AwsSecretResolver:()=>ap});var ap,ox=se(()=>{"use strict";ap=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=>require(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:o}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),c=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(c===void 0)return;if(i)try{let p=JSON.parse(c);return p[i]!==void 0?String(p[i]):void 0}catch{return}return c}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 X$={};us(X$,{AzureKeyVaultResolver:()=>lp});var lp,ax=se(()=>{"use strict";lp=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=>require(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:o}=this.moduleRequire("@azure/identity"),l=new o;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 eN={};us(eN,{HashiCorpVaultResolver:()=>up});var up,lx=se(()=>{"use strict";up=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 o=`${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(o,{headers:l})}catch(g){throw new Error(`[HTTP Forge] Vault request failed: ${g?.message??g}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let p=(await f.json())?.data?.data;if(!p)return;if(i)return p[i]!==void 0?String(p[i]):void 0;if("value"in p)return String(p.value);let h=Object.keys(p);return h.length===1?String(p[h[0]]):void 0}}});var nN={};us(nN,{OnePasswordResolver:()=>cp});var tN,rN,g5,cp,ux=se(()=>{"use strict";tN=require("child_process"),rN=require("util"),g5=(0,rN.promisify)(tN.execFile),cp=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 o=await this.tryResolveSdk(n,i,s);return o!==null?o: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}=require("@1password/sdk"),o=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await o.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 g5("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 iN={};us(iN,{GcpSecretResolver:()=>fp});var fp,cx=se(()=>{"use strict";fp=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=>require(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"),o=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await o.accessSecretVersion({name:l}),c=f.payload?.data;return c?Buffer.isBuffer(c)?c.toString("utf-8"):Buffer.from(c).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 oN={};us(oN,{DopplerResolver:()=>dp});var sN,dp,fx=se(()=>{"use strict";sN=me(require("https")),dp=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,o)=>{let l=sN.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let c=[];f.on("data",p=>c.push(p)),f.on("end",()=>{let p=Buffer.concat(c).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${p}`));return}try{let g=JSON.parse(p)?.value?.computed;s(g!=null?String(g):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});var Fy,aN,lN,Rc,dx=se(()=>{"use strict";Fy=me(require("fs")),aN=require("module"),lN=me(require("path")),Rc=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 o=>{if(n.has(o))return;let l=o.slice(7),f=l.indexOf("/");if(f<0)return;let c=l.slice(0,f),p=l.slice(f+1),h=this.resolvers.get(c);if(h)try{let g=await h.resolve(p);g!==void 0&&n.set(o,g)}catch(g){let v=g?.message??String(g);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${v}`)}}));let s={};for(let[o,l]of n.entries())s[o]=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}=(ox(),ga(Z$));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(ax(),ga(X$));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(lx(),ga(eN));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(ux(),ga(nN));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(cx(),ga(iN));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(fx(),ga(oN));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>require(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=lN.resolve(i,"package.json");if(Fy.existsSync(s)){let o=Fy.realpathSync(s),l=(0,aN.createRequire)(o);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});function ur(t){return t.replace(/\//g,"%2F")}function px(t){return t.replace(/%2F/gi,"/")}function Ui(t){return t?t.split("/").map(px).join(" / "):""}function pp(t){return t.includes(" / ")?t.split(" / ").map(e=>ur(e.trim())).join("/"):ur(t)}function Ke(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,o=ur(s.name),l=r?`${r}/${o}`:o;n.push(...Ke(t,s.items??[],l))}return n}function Ar(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=ur(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:Dy(s.items??[])}),n.push(...Ar(t,s.items??[],l))}return n}function Dy(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Dy(r.items??[]);return e}var gi=se(()=>{"use strict"});var Cc,hx=se(()=>{"use strict";Cc={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});var Mt,$o,xc,mx=se(()=>{"use strict";Mt=me(require("fs")),$o=me(require("path"));gi();En();hx();xc=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(){Mt.existsSync(this.suitesDir)||Mt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Mt.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(),!Mt.existsSync(this.suitesDir))return;let e=Mt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=$o.join(this.suitesDir,r),i=Mt.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:vt(e),name:e,requests:r,config:{...Cc},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=$o.join(this.suitesDir,e),o=$o.join(this.suitesDir,i.id);return Mt.existsSync(s)&&this.copyDirRecursive(s,o),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Mt.existsSync(r)||Mt.mkdirSync(r,{recursive:!0});for(let n of Mt.readdirSync(e,{withFileTypes:!0})){let i=$o.join(e,n.name),s=$o.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Mt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=$o.join(this.suitesDir,n);try{return Mt.existsSync(i)&&Mt.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:{...Cc},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 o=r.replace(/\/+$/,""),l=s.filter(p=>n?p.folderPath===o||p.folderPath.startsWith(`${o}/`):p.folderPath===o);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(o)}`,name:`${i.name} / ${Ui(o)}`,requests:l,config:{...Cc},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:vt(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 o of e.requests)s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.items)for(let o of e.items)if(o.items||o.folders||o.requests){let l=i?`${i}/${ur(o.name)}`:ur(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.folders)for(let o of e.folders){let l=i?`${i}/${ur(o.name)}`:ur(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=$o.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Mt.writeFileSync(n,i,"utf-8")}}});var ne,Ly=se(()=>{"use strict";ne={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")}});function hp(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:f,applicationInfo:c,consoleService:p}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new La(r,n,i)),t.registerSingleton(ne.Console,()=>p??y5),t.registerSingleton(ne.EnvironmentConfig,g=>new Gu(r,s,g.resolve(ne.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ne.Cookie,()=>new zu(o)),t.registerSingleton(ne.Collection,g=>new Wu(r,g.resolve(ne.Config),n)),t.registerSingleton(ne.TestSuite,g=>new xc(g.resolve(ne.Collection),g.resolve(ne.Config))),t.registerSingleton(ne.HttpClient,()=>new io),t.registerSingleton(ne.UrlBuilder,()=>new In),t.registerSingleton(ne.InterceptorChain,()=>new Pi),t.registerSingleton(ne.HttpRequest,g=>new ki(g.resolve(ne.UrlBuilder),g.resolve(ne.InterceptorChain),g.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new po),t.registerSingleton(ne.RequestHistory,g=>{let v=g.resolve(ne.EnvironmentConfig);return new Qu(v.getHistoriesPath(),uN.join(v.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(ne.OAuth2TokenManager,g=>new Hu(l,f,g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,g=>new Ku(g.resolve(ne.HttpClient))),t.registerSingleton(ne.SecretResolverRegistry,g=>new Rc(g.resolve(ne.Config)));let h=c??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,g=>new Yu(g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest),g.resolve(ne.RequestPreprocessor),g.has(ne.OAuth2TokenManager)?g.resolve(ne.OAuth2TokenManager):void 0,h,g.resolve(ne.SecretResolverRegistry))),t.registerSingleton(ne.ScriptExecutor,g=>{let v=g.resolve(ne.Config);return new Ni(g.resolve(ne.HttpRequest),v.getModulePaths(),g.resolve(ne.SecretResolverRegistry),v.getScriptScope(),v.getScriptTimeout())}),t.registerSingleton(ne.DataFileParser,()=>new mo),t.registerSingleton(ne.CollectionRequestExecutor,g=>new gs(g.resolve(ne.HttpRequest),g.resolve(ne.ScriptExecutor),g.resolve(ne.EnvironmentConfig),g.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,g=>new Ju(g.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new bs),t.registerSingleton(ne.HistoryAnalyzer,g=>new Ua(g.resolve(ne.RequestHistory),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new sl),t.registerSingleton(ne.SchemaInferenceService,g=>new il(g.resolve(ne.HistoryAnalyzer),g.resolve(ne.ScriptAnalyzer),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,g=>new Ga(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig),g.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,g=>new Es(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig)))}var uN,y5,gx=se(()=>{"use strict";uN=me(require("path"));V0();Y0();Q0();Z0();X0();t_();eg();r_();n_();o_();xf();Ef();Cf();Km();du();a_();HR();Ny();ix();sy();sx();Qm();ad();dx();mx();Ly();y5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function yx(){return No.instance}var No,vx=se(()=>{"use strict";Ly();No=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static createFresh(){return new t}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ne.OAuth2TokenManager)?this.resolve(ne.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}get testSuite(){return this.resolve(ne.TestSuite)}}});function cN(t){return/\{\{[^}]+\}\}/.test(t)}function mp(t,e=16){return!!t&&t.length>=e&&!cN(t)}function bx(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function gp(t,e,r,n,i,s=10){let o=t.get(e);o||(o={varName:r,reason:n,occurrences:[],priority:s},t.set(e,o));let l=`${i.requestId}::${i.field}`;o.occurrences.some(f=>`${f.requestId}::${f.field}`===l)||o.occurrences.push(i)}function yp(t,e=1){let r=Ke(t),n=new Map;for(let{request:s}of r){let o=l=>({requestId:s.id,requestName:s.name,field:l});for(let l of s.headers??[]){if(l.enabled===!1)continue;let f=l.key.toLowerCase(),c=l.value;if(f==="authorization"){let p=c.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&mp(p[2])?gp(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):mp(c)&&gp(n,c,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else v5.has(f)&&mp(c)?gp(n,c,bx(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):mp(c,20)&&!c.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(c)&&gp(n,c,bx(l.key)||"HEADER_VALUE",`Long opaque value in header: ${l.key}`,o(`header:${l.key}`),5)}for(let l of s.query??[])l.enabled!==!1&&b5.has(l.key.toLowerCase())&&mp(l.value)&&gp(n,l.value,bx(l.key),`Sensitive query param: ${l.key}`,o(`query:${l.key}`),2)}let i=new Map;for(let{request:s}of r)if(!(!s.url||cN(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let f=`${o.protocol}//${o.host}`,c=i.get(f)??[];c.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(f,c)}}catch{}for(let[s,o]of i)o.length>=Math.max(e,2)&&!n.has(s)&&n.set(s,{varName:"BASE_URL",reason:`Shared base URL across ${o.length} requests`,occurrences:o,priority:3});return[...n.entries()].filter(([,s])=>s.occurrences.length>=e).sort((s,o)=>s[1].priority-o[1].priority||s[0].localeCompare(o[0])).map(([s,o])=>({varName:o.varName,value:s,reason:o.reason,occurrences:o.occurrences}))}function jy(t,e){let r={};return fN(t,e,r),r}function fN(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&fN(n.items,e,r);continue}let i=n;for(let s of e){let o=`{{${s.varName}}}`;i.url?.includes(s.value)&&(i.url=i.url.split(s.value).join(o),r[s.varName]=(r[s.varName]??0)+1);for(let l of i.headers??[]){let f=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&f[2]===s.value?(l.value=`${f[1]} ${o}`,r[s.varName]=(r[s.varName]??0)+1):l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}for(let l of i.query??[])l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}}}var v5,b5,Sx=se(()=>{"use strict";gi();v5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),b5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Is(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Uy(t,e,r){let n=i=>Is("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${J.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_folders, list_requests or run_* tools.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.listFolders}`,description:"List all folders in a collection with their full paths and request counts. Use this before run_folder to discover the exact folder path string to pass.",inputSchema:{type:"object",properties:{collection:n(!0)},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request. For large collections use the folder filter and offset/limit to page through results.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 200)."}},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.searchRequests}`,description:"Search for requests across a collection by name, URL, method, or folder path. Returns matching requests with their folder location. Useful for large collections.",inputSchema:{type:"object",properties:{collection:n(!0),query:{type:"string",description:"Text to search for in request names, URLs, methods, and folder paths (case-insensitive)."}},required:["collection","query"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRequest}`,description:"Get the full details of a single saved request: URL, method, headers, body, auth, and scripts. Use this to inspect a request before editing it, or to read a script before rewriting it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id. Use list_requests to find names."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getEnvironment}`,description:"Show the current environment variable values (merged initial + runtime pm.environment.set overrides). Use this to inspect variable state before running a folder, or to debug {{variable}} resolution failures.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to inspect (defaults to the currently selected environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.setVariable}`,description:'Override an environment variable for the current session. In the VS Code extension the change is saved to VS Code workspace storage (survives restarts, but is not in the env JSON file and not source-controlled). In the standalone CLI/core runtime the change is in-memory only and lost when the server restarts. Use set_environment_variable with scope:"permanent" to write to the env JSON file (source-controlled, works in both runtimes).',inputSchema:{type:"object",properties:{key:{type:"string",description:"Variable name (the part inside {{...}})."},value:{type:"string",description:"New value to set."},environment:{type:"string",description:"Environment to update (defaults to the currently selected environment)."}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.getRunStatus}`,description:"Check whether an async run is still running, completed, or failed. Poll this after calling run_folder/run_collection/run_suite with async:true.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed". When failures are present the response includes a failedRequests array with full details (method, url, requestBody, status, responseBody, failedTests) and a _nextStep directive. You MUST follow the _nextStep directive immediately \u2014 analyze the failures and provide diagnosis without waiting for the user to ask.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getFailedRequests}`,description:"Get the list of failed requests from a completed async run \u2014 the failures-first view. Never returns passing requests. Use this instead of get_run_summary when you need to see what broke.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum failures to return (default: 20, max: 100)."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.getRequestResult}`,description:"Get the full result (status, body, assertions, console output) for one specific request from an async run. Use after get_failed_requests to drill into a single failure.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},request:{type:"string",description:"Name of the request to look up."},iteration:{type:"number",description:"Iteration number (default: 1)."}},required:["runId","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.cancelRun}`,description:'Request cancellation of an in-progress async run. Cancellation is best-effort: the currently-executing HTTP request completes normally, but no further requests in the run are started. The run status changes to "cancelled". Has no effect on runs that are already completed, failed, or cancelled.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by run_collection, run_folder, or run_suite with async:true."}},required:["runId"]},annotations:{idempotentHint:!0}},{name:`${t}${J.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests or search_requests to find names."},requestId:{type:"string",description:'ID of the request (from list_requests/search_requests). Preferred over "request" name when available \u2014 avoids ambiguity with duplicate names.'},...vp.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...Sp.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...bp.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Is("Name of the test suite to run.",r),...wp.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.createCollection}`,description:"Create a new empty collection.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new collection."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.renameCollection}`,description:"Rename an existing collection.",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"New display name for the collection."}},required:["collection","newName"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteCollection}`,description:"Permanently delete a collection and all its contents. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.duplicateCollection}`,description:"Clone a collection under a new name (all folders, requests, and scripts are copied).",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"Name for the duplicated collection."}},required:["collection","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.createFolder}`,description:"Create a folder inside a collection (optionally nested inside another folder).",inputSchema:{type:"object",properties:{collection:n(!0),name:{type:"string",description:"Display name for the new folder."},parentFolder:{type:"string",description:"Slash-separated folder path or folder id of the parent. Omit to create at collection root."}},required:["collection","name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteFolder}`,description:"Delete a folder and all its requests. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Slash-separated folder path or folder id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","folder","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.createRequest}`,description:"Create a new HTTP request inside a collection (optionally inside a folder).",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to add at collection root."},name:{type:"string",description:"Display name for the request."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method."},url:{type:"string",description:"Request URL, may include {{variable}} placeholders."},headers:{type:"object",description:"Key/value header map.",additionalProperties:{type:"string"}},body:{type:"string",description:"Raw request body (JSON, text, etc.)."},description:{type:"string",description:"Human-readable description."}},required:["collection","name","method","url"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateRequest}`,description:"Update fields on an existing request (partial update \u2014 omit fields to keep current values).",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},name:{type:"string",description:"New display name."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},url:{type:"string"},headers:{type:"object",additionalProperties:{type:"string"}},body:{type:"string"},description:{type:"string"}},required:["collection","request"]},annotations:{idempotentHint:!0}},{name:`${t}${J.deleteRequest}`,description:"Remove a request from a collection. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","request","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.getRequestScript}`,description:"Read the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to read."}},required:["collection","request","phase"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.setRequestScript}`,description:"Write or replace the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to write."},script:{type:"string",description:"Full JavaScript source to write."}},required:["collection","request","phase","script"]},annotations:{idempotentHint:!0}},{name:`${t}${J.reorderCollectionItems}`,description:"Set the execution/display order of direct children of a collection root or folder. Items not listed are appended at the end.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to reorder collection root."},order:{type:"array",items:{type:"string"},description:"Ordered list of item names or ids."}},required:["collection","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getSuite}`,description:"Get full details of a test suite including its request list.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.createSuite}`,description:"Create a new test suite (empty or pre-populated from a collection/folder).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new suite."},description:{type:"string",description:"Optional description."},fromCollection:{type:"string",description:"Collection name or id to seed the suite from (all requests in execution order)."},fromFolder:{type:"string",description:"Folder path within fromCollection to seed from."},iterations:{type:"number",description:"Number of iterations (default: 1)."},stopOnError:{type:"boolean",description:"Stop on first failure (default: false)."},delayBetweenRequests:{type:"number",description:"Milliseconds delay between requests (default: 0)."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.updateSuiteConfig}`,description:"Change a suite's name, description, or run configuration.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${J.addSuiteRequests}`,description:"Append or insert one or more requests into a suite.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite.",r),requests:{type:"array",items:{type:"object",properties:{collection:{type:"string",description:"Collection name or id."},request:{type:"string",description:"Request name or id."}},required:["collection","request"]},description:"Requests to add."},insertAt:{type:"number",description:"Zero-based index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${J.removeSuiteRequest}`,description:"Remove a request from a suite by position (0-based) or by name.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite.",r),index:{type:"number",description:"Zero-based position in the suite requests list."},request:{type:"string",description:"Request name to remove (used if index is not provided)."}},required:["suite"]},annotations:{destructiveHint:!0}},{name:`${t}${J.reorderSuiteRequests}`,description:"Reorder requests in a suite. Requests not listed are moved to the end.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite.",r),order:{type:"array",items:{type:"string"},description:"Ordered list of request names."}},required:["suite","order"]},annotations:{idempotentHint:!0}},{name:`${t}${J.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite to clone.",r),newName:{type:"string",description:"Name for the duplicated suite."}},required:["suite","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Is("Name or id of the suite to delete.",r),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["suite","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.listEnvironments}`,description:"List all environments with their variable keys (values hidden). Use get_environment_variables to see values.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getEnvironmentVariables}`,description:"Get the resolved (merged file + session overrides) variables for an environment.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.selectEnvironment}`,description:"Set the active environment for all subsequent run_* calls in this session.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Name of the environment to activate."}},required:["environment"]},annotations:{idempotentHint:!0}},{name:`${t}${J.createEnvironment}`,description:"Create a new environment file, optionally pre-populated with variables.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Environment name (becomes the filename)."},variables:{type:"object",description:"Initial key/value variable map.",additionalProperties:{type:"string"}}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${J.deleteEnvironment}`,description:"Delete an environment file permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["environment","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${J.setEnvironmentVariable}`,description:'Set a variable in an environment. Scope "session" (default) is in-memory only and always temporary (both runtimes). Scope "permanent" writes to the env JSON config file \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name."},value:{type:"string",description:"New value."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to disk.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.unsetEnvironmentVariable}`,description:"Remove a session-scoped variable override, restoring the file value.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name to unset."}},required:["key"]},annotations:{idempotentHint:!0}},{name:`${t}${J.setGlobalVariable}`,description:'Set a global variable visible across all environments. Scope "session" (default) is in-memory only and lost on restart (both runtimes). Scope "permanent" writes to _global.json \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{key:{type:"string",description:"Global variable name."},value:{type:"string",description:"Value to set."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to _global.json.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${J.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.scaffoldCollectionFromOpenApi}`,description:"Import an OpenAPI 3.0 spec (JSON or YAML) and scaffold a complete HTTP Forge collection from it. All operations become requests grouped by tag/path. An optional environment is created from the server URL. Returns the new collection id and name. Use this to quickly bootstrap API testing from a spec file.",inputSchema:{type:"object",properties:{specPath:{type:"string",description:"Absolute or workspace-relative path to the OpenAPI 3.0 JSON or YAML file."},collectionName:{type:"string",description:"Override the collection name (defaults to the spec title)."},environmentName:{type:"string",description:"Name for the generated environment that contains the server base URL. Omit to skip environment creation."}},required:["specPath"]},annotations:{idempotentHint:!1}},{name:`${t}${J.suggestAssertions}`,description:"Analyse the last execution history for a request and suggest pm.test() assertions to add to its post-response script. Covers status code, response time, required JSON fields, Content-Type header, and schema conformance. Returns an array of ready-to-paste JavaScript test snippets and a rationale for each.",inputSchema:{type:"object",properties:{collection:{type:"string",description:"Collection name or id that owns the request."},request:{type:"string",description:"Request name or id to analyse."},environment:{type:"string",description:"Environment used when the run was recorded (defaults to active environment)."},maxSuggestions:{type:"number",description:"Cap the number of suggestions returned (default: 10)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.explainFailure}`,description:"Explain why a specific request failed in a recent run. Returns the full request (URL, method, headers, body), the response received (status, headers, body), all assertion results, any script errors, and a plain-English diagnosis with suggested fixes. Provide either runId (from a prior run_suite/run_collection call) + request name, or the collection and request names to pull the most recent history entry.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"MCP run id (from run_suite or run_collection). Mutually exclusive with collection+request history lookup."},collection:{type:"string",description:"Collection name or id. Required when runId is omitted."},request:{type:"string",description:"Request name or id."},iteration:{type:"number",description:"Iteration number within the run (default: 1)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${J.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
|
|
278
278
|
|
|
279
279
|
Returns:
|
|
280
280
|
\u2022 heuristicSuggestions \u2014 values identified by pattern-matching rules (ready to apply)
|
|
@@ -347,7 +347,7 @@ This tool returns request details AND a structured task. You MUST:
|
|
|
347
347
|
3. Return the rows as a JSON array under the key "iterationData" \u2014 each row is an object whose keys match the {{variable}} placeholders in the request.
|
|
348
348
|
4. Respond with the JSON array directly so the user can pass it to run_collection or the CLI --variables flag.
|
|
349
349
|
|
|
350
|
-
Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and iterations=4, generate 4 rows: valid user, duplicate email, missing name, email with invalid format.`,inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name, slug, or id."},iterations:{type:"number",description:"Number of test data rows to generate (default: 5, max: 50)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}}]}var vp,bp,Sp,wp,J,_p=se(()=>{"use strict";vp={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},bp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently, preserving inter-request dependencies."},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"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Sp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},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"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},wp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results."},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},J={listCollections:"list_collections",listFolders:"list_folders",listRequests:"list_requests",searchRequests:"search_requests",getEnvironment:"get_environment",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite",getRunStatus:"get_run_status",getRunSummary:"get_run_summary",getFailedRequests:"get_failed_requests",getRequestResult:"get_request_result",cancelRun:"cancel_run",setVariable:"set_variable",createCollection:"create_collection",renameCollection:"rename_collection",deleteCollection:"delete_collection",duplicateCollection:"duplicate_collection",createFolder:"create_folder",deleteFolder:"delete_folder",getRequest:"get_request",createRequest:"create_request",updateRequest:"update_request",deleteRequest:"delete_request",getRequestScript:"get_request_script",setRequestScript:"set_request_script",reorderCollectionItems:"reorder_collection_items",listSuites:"list_suites",getSuite:"get_suite",createSuite:"create_suite",updateSuiteConfig:"update_suite_config",addSuiteRequests:"add_suite_requests",removeSuiteRequest:"remove_suite_request",reorderSuiteRequests:"reorder_suite_requests",duplicateSuite:"duplicate_suite",deleteSuite:"delete_suite",listEnvironments:"list_environments",getEnvironmentVariables:"get_environment_variables",selectEnvironment:"select_environment",createEnvironment:"create_environment",deleteEnvironment:"delete_environment",setEnvironmentVariable:"set_environment_variable",unsetEnvironmentVariable:"unset_environment_variable",setGlobalVariable:"set_global_variable",getGlobals:"get_globals",scaffoldCollectionFromOpenApi:"scaffold_collection_from_openapi",suggestAssertions:"suggest_assertions",explainFailure:"explain_failure",suggestEnvVars:"suggest_env_vars",applyEnvVars:"apply_env_vars",getRequestsForEnhancement:"get_requests_for_enhancement",applyRequestEnhancements:"apply_request_enhancements",aiSuggestEnvVars:"ai_suggest_env_vars",aiEnhanceCollection:"ai_enhance_collection",analyzeCoverage:"analyze_coverage",aiAnalyzeCoverage:"ai_analyze_coverage",generateRequestFromIntent:"generate_request_from_intent",validateAgainstSpec:"validate_against_spec",generateScenarios:"generate_scenarios",healAssertions:"heal_assertions",generateIterationData:"generate_iteration_data"}});function ye(t){return new Error(`Bad request: ${t}`)}function tt(t,e){if(typeof t!="string"||!t.trim())throw ye('the "collection" argument is required');let r=t.toLowerCase(),n=e.find(i=>i.id===t||i.name===t)??e.find(i=>i.name.toLowerCase()===r)??e.find(i=>i.name.toLowerCase().includes(r))??e.find(i=>i.id.toLowerCase().includes(r));if(!n){let i=e.map(s=>`"${s.name}"`).join(", ");throw ye(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Hi(t,e){if(typeof t!="string"||!t.trim())throw ye('the "request" argument is required');let r=Ke(e),n=t.toLowerCase(),i=r.find(s=>s.request.id===t||s.request.name===t)??r.find(s=>s.request.name.toLowerCase()===n)??r.find(s=>s.request.name.toLowerCase().includes(n));if(!i){let s=r.slice(0,10).map(o=>`"${o.request.name}"`).join(", ");throw ye(`request "${t}" not found in collection "${e.name}". First ${Math.min(r.length,10)} requests: ${s||"(none)"}. Call list_requests or search_requests to find the exact name.`)}return i.request}function dN(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=dN(n.items??[],e);if(i)return i}}async function ol(t,e){if(typeof t!="string"||!t.trim())throw ye('the "suite" argument is required');let r=await e.testSuite.getAllSuites(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n);if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw ye(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function By(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===J.listCollections)return{collections:s.map(c=>({name:c.name,id:c.id,description:c.description??"",requestCount:Ke(c).length}))};if(t===J.listFolders){let c=tt(e.collection,s);return{collection:c.name,folders:Ar(c).map(({folderPath:p,requestCount:h})=>({path:Ui(p),requestCount:h}))}}if(t===J.listRequests){let c=tt(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=typeof e.offset=="number"?Math.max(0,e.offset):0,g=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,v=Ke(c).filter(({folderPath:_})=>!p||_.toLowerCase().includes(p)).map(({request:_,folderPath:w})=>({id:_.id,name:_.name,method:_.method,folder:Ui(w),description:_.description??""}));return{collection:c.name,total:v.length,offset:h,limit:g,requests:v.slice(h,h+g)}}if(t===J.searchRequests){let c=tt(e.collection,s),p=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!p)throw ye('the "query" argument is required');let h=Ke(c).filter(({request:g,folderPath:v})=>g.name.toLowerCase().includes(p)||(g.url??"").toLowerCase().includes(p)||g.method.toLowerCase().includes(p)||v.toLowerCase().includes(p)||(g.description??"").toLowerCase().includes(p)).map(({request:g,folderPath:v})=>({id:g.id,name:g.name,method:g.method,url:g.url??"",folder:Ui(v),description:g.description??""}));return{collection:c.name,query:e.query,total:h.length,requests:h}}if(t===J.getRequest){let c=tt(e.collection,s),p=Hi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"pre-request")??"",g=r.collection.getRequestScript(c.id,p.id,"post-response")??"";return{id:p.id,name:p.name,method:p.method,url:p.url??"",description:p.description??"",headers:p.headers??[],body:p.body??null,auth:p.auth??null,scripts:{preRequest:h,postResponse:g},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===J.getEnvironment){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ye(`environment "${c}" not found`);return{name:p.name,variables:p.variables}}if(t===J.setVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ye('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(c,p,h),{set:!0,key:c,environment:h}}if(t===J.getRunStatus){let c=n.require(e.runId);return{runId:c.id,status:c.status,suiteName:c.suiteName,progress:c.progress,...c.error?{error:c.error}:{}}}if(t===J.getRunSummary){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress};let p=(c.summary.failed??0)>0||c.summary.allPassed===!1,h=c.noAssertionExamples??[],g=h.length,v=c.summary.total,_=g>0?g/(v||1)>.5?`${g}/${v} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${c.suiteName}") for a full coverage analysis.`:`${g} request(s) have no pm.test() assertions (e.g. ${h.slice(0,3).map(w=>`"${w}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${c.suiteName}") to add test coverage.`:null;return{runId:c.id,status:c.status,suiteName:c.suiteName,summary:c.summary,...c.reportPath?{report:{uri:`file://${c.reportPath}`}}:{},...p?{failedRequests:c.failedRequests}:{},...p?{_nextStep:`REQUIRED ACTION: ${c.summary.failed} request(s) failed. The failedRequests array above contains the full details (method, url, requestBody, requestHeaders, status, responseBody, failedTests). Immediately analyze each failed request and provide: (1) root cause, (2) specific fix, (3) corrected pm.test() assertions if relevant. Do NOT wait for the user to ask \u2014 diagnose now.`}:{},..._?{_suggestions:[_]}:{}}}if(t===J.getFailedRequests){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress,failedSoFar:c.failedRequests.length};let p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:c.id,status:c.status,totalFailed:c.failedRequests.length,offset:p,limit:h,failedRequests:c.failedRequests.slice(p,p+h)}}if(t===J.getRequestResult){let c=n.require(e.runId),p=e.request;if(typeof p!="string"||!p)throw ye('"request" is required');let h=typeof e.iteration=="number"?e.iteration:1,g=c.allResults.find(v=>v.iteration===h&&(v.name===p||v.name.toLowerCase()===p.toLowerCase()));if(!g){if(c.status==="running")return{runId:c.id,status:"running",message:`Request "${p}" has not completed yet.`};throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c.id}".`)}return{runId:c.id,...g}}if(t===J.cancelRun){let c=n.require(e.runId);if(c.status!=="running")return{runId:c.id,status:c.status,cancelled:!1,message:`Run is already "${c.status}" \u2014 nothing to cancel.`};let p=n.cancel(String(e.runId));return{runId:c.id,status:"cancelled",cancelled:p,progress:c.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===J.runRequest){let c=tt(e.collection,s),p=Ke(c),h=typeof e.requestId=="string"?e.requestId.trim():void 0,g=e.request,v;if(h){if(v=p.find(_=>_.request.id===h),!v)throw ye(`request with id "${h}" not found in collection "${c.name}"`)}else{if(typeof g!="string"||!g.trim())throw ye('the "request" or "requestId" argument is required');if(v=p.find(_=>_.request.name===g)??p.find(_=>_.request.name.toLowerCase()===g.toLowerCase()),!v)throw ye(`request "${g}" not found in collection "${c.name}"`)}return i.runRequest(c,v.request.id,e)}if(t===J.runFolder){let c=tt(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ye('the "folder" argument is required');let p=e.folder.toLowerCase(),h=pp(e.folder),g=h.toLowerCase(),v=Ar(c).map(w=>w.folderPath),_=v.find(w=>w===h)??v.find(w=>w.toLowerCase()===g)??v.find(w=>w.toLowerCase().includes(g))??v.find(w=>w.split("/").some(E=>E.toLowerCase().includes(g)));if(!_){let w=v.map(E=>`"${E}"`).join(", ");throw ye(`folder "${e.folder}" not found in collection "${c.name}". Available folders: ${w||"(none)"}. Call list_folders to see all.`)}return i.runFolder(c,_,e)}if(t===J.runCollection){let c=tt(e.collection,s);return i.runCollection(c,e)}if(t===J.createCollection){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ye('"name" is required');let p=await r.collection.createCollection(c);return{id:p.id,name:p.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===J.renameCollection){let c=tt(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ye('"newName" is required');return await r.collection.renameCollection(c.id,p),{id:c.id,oldName:c.name,newName:p,renamed:!0}}if(t===J.deleteCollection){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a collection');let c=tt(e.collection,s);return await r.collection.deleteCollection(c.id),{deleted:!0,collection:c.name}}if(t===J.duplicateCollection){let c=tt(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ye('"newName" is required');let h=await r.collection.duplicateCollection(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name}}if(t===J.createFolder){let c=tt(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ye('"name" is required');let h;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let v=e.parentFolder.toLowerCase(),_=Ar(c);if(Ke(c).map(E=>E.folderPath)&&_.find(E=>E.folderPath===e.parentFolder||E.folderPath.toLowerCase()===v)){let k=Ar(c).find(T=>T.folderPath===e.parentFolder||T.folderPath.toLowerCase()===v);if(k){let T=c.items,N=(j,G)=>{for(let O of j)if(O.type==="folder"){let C=O;if(C.name===G||G.endsWith("/"+C.name))return C;let A=N(C.items??[],G);if(A)return A}};h=N(T,k.folderPath)?.id}}}let g=await r.collection.createFolder({collectionId:c.id,name:p,parentId:h});return{id:g.id,name:g.name,created:!0,collection:c.name}}if(t===J.deleteFolder){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a folder');let c=tt(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ye('"folder" is required');let p=e.folder.toLowerCase(),h=Ar(c).find(_=>_.folderPath===e.folder||_.folderPath.toLowerCase()===p);if(!h)throw ye(`folder "${e.folder}" not found in collection "${c.name}"`);let g=dN(c.items,h.folderId);if(!g)throw ye(`folder "${e.folder}" could not be resolved`);let v=h.requestCount;return await r.collection.deleteFolder(c.id,g.id),{deleted:!0,folder:h.folderPath,requestsRemoved:v}}if(t===J.createRequest){let c=tt(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ye('"name" is required');let h=typeof e.method=="string"?e.method.toUpperCase():"GET",g=typeof e.url=="string"?e.url:"";if(!g)throw ye('"url" is required');let v;if(typeof e.folder=="string"&&e.folder.trim()){let E=e.folder.toLowerCase(),k=Ar(c).find(T=>T.folderPath===e.folder||T.folderPath.toLowerCase()===E);k&&(v=k.folderId)}let _={collectionId:c.id,parentId:v,name:p,method:h,url:g,headers:void 0,body:e.body?{type:"raw",raw:String(e.body),contentType:"application/json"}:void 0,description:typeof e.description=="string"?e.description:void 0},w=await r.collection.createRequest(_);return{id:w.id,name:w.name,created:!0,collection:c.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===J.updateRequest){let c=tt(e.collection,s),p=Hi(e.request,c),h={};return typeof e.name=="string"&&(h.name=e.name),typeof e.method=="string"&&(h.method=e.method.toUpperCase()),typeof e.url=="string"&&(h.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(h.headers=Object.entries(e.headers).map(([g,v])=>({name:g,value:String(v),enabled:!0}))),typeof e.body=="string"&&(h.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(h.description=e.description),await r.collection.updateRequest(c.id,p.id,h),{updated:!0,request:p.name}}if(t===J.deleteRequest){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a request');let c=tt(e.collection,s),p=Hi(e.request,c);return await r.collection.deleteRequest(c.id,p.id),{deleted:!0,request:p.name}}if(t===J.getRequestScript){let c=tt(e.collection,s),p=Hi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ye('"phase" must be "pre-request" or "post-response"');let g=r.collection.getRequestScript(c.id,p.id,h);return{collection:c.name,request:p.name,phase:h,script:g??""}}if(t===J.setRequestScript){let c=tt(e.collection,s),p=Hi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ye('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ye('"script" is required');return await r.collection.setRequestScript(c.id,p.id,h,e.script),{updated:!0,collection:c.name,request:p.name,phase:h}}if(t===J.reorderCollectionItems){let c=tt(e.collection,s);if(!Array.isArray(e.order))throw ye('"order" must be an array');let p;if(typeof e.folder=="string"&&e.folder.trim()){let v=e.folder.toLowerCase(),_=Ar(c).find(w=>w.folderPath===e.folder||w.folderPath.toLowerCase()===v);if(!_)throw ye(`folder "${e.folder}" not found in collection "${c.name}"`);p=_.folderId}let h=p?c.items.find(v=>v.id===p)?.items??[]:c.items,g=e.order.map(v=>h.find(w=>w.id===v||w.name===v)?.id??v);return await r.collection.reorderItems(c.id,p,g),{reordered:!0,collection:c.name,order:e.order}}if(t===J.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(p=>({id:p.id,name:p.name,description:p.description??"",requestCount:p.requests.length,iterations:p.config?.iterations??1}))};if(t===J.getSuite){let c=await ol(e.suite,r);return{id:c.id,name:c.name,description:c.description??"",config:{iterations:c.config?.iterations??1,delayBetweenRequests:c.config?.delayBetweenRequests??0,stopOnError:c.config?.stopOnError??!1},requests:c.requests.map(p=>({slug:p.slug??p.requestId,collectionId:p.collectionId,requestId:p.requestId,name:p.name,method:p.method,folderPath:p.folderPath??"",enabled:p.enabled!==!1}))}}if(t===J.createSuite){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ye('"name" is required');let p;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let h=tt(e.fromCollection,s),g=await r.testSuite.createTempSuiteFromCollection(h.id);if(!g)throw new Error(`Could not build suite from collection "${h.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let v=pp(e.fromFolder),_=g.requests.filter(w=>w.folderPath===v||w.folderPath.startsWith(`${v}/`));g.requests=_}p=await r.testSuite.saveTempSuite(g,c)}else p=await r.testSuite.createSuite(c);return(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0)&&(e.description!==void 0&&(p.description=String(e.description)),p.config={...p.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(p)),{id:p.id,name:p.name,requestCount:p.requests.length,created:!0,hint:p.requests.length===0?"Suite is empty. Call add_suite_requests to populate it with requests from a collection.":"Suite created. Call run_suite to execute it."}}if(t===J.updateSuiteConfig){let c=await ol(e.suite,r);return typeof e.name=="string"&&e.name.trim()&&(c.name=e.name.trim()),typeof e.description=="string"&&(c.description=e.description),c.config={...c.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(c),{updated:!0,suite:c.name}}if(t===J.addSuiteRequests){let c=await ol(e.suite,r),p=Array.isArray(e.requests)?e.requests:[];if(p.length===0)throw ye('"requests" array is required and must not be empty');let h=[];for(let v of p){let _=tt(v.collection,s),w=Hi(v.request,_),E=Ke(_).find(k=>k.request.id===w.id)?.folderPath??"";h.push({slug:w.id,collectionId:_.id,requestId:w.id,name:w.name,method:w.method,collectionName:_.name,folderPath:E,enabled:!0})}let g=typeof e.insertAt=="number"?Math.max(0,e.insertAt):void 0;return g!==void 0&&g<c.requests.length?c.requests.splice(g,0,...h):c.requests.push(...h),await r.testSuite.updateSuite(c),{added:h.length,suite:c.name,newRequestCount:c.requests.length}}if(t===J.removeSuiteRequest){let c=await ol(e.suite,r),p;if(typeof e.index=="number"){if(e.index<0||e.index>=c.requests.length)throw ye(`index ${e.index} is out of range`);let[h]=c.requests.splice(e.index,1);p=h.name}else if(typeof e.request=="string"){let h=e.request.toLowerCase(),g=c.requests.findIndex(v=>v.name===e.request||v.name.toLowerCase()===h);if(g===-1)throw ye(`request "${e.request}" not found in suite "${c.name}"`);p=c.requests.splice(g,1)[0].name}else throw ye('either "index" or "request" is required');return await r.testSuite.updateSuite(c),{removed:!0,request:p,newRequestCount:c.requests.length}}if(t===J.reorderSuiteRequests){let c=await ol(e.suite,r);if(!Array.isArray(e.order))throw ye('"order" must be an array of request names');let p=e.order,h=[...c.requests].sort((g,v)=>{let _=p.findIndex(T=>T===g.name||T.toLowerCase()===g.name.toLowerCase()),w=p.findIndex(T=>T===v.name||T.toLowerCase()===v.name.toLowerCase());return(_===-1?1/0:_)-(w===-1?1/0:w)});return c.requests=h,await r.testSuite.updateSuite(c),{reordered:!0,suite:c.name,newOrder:c.requests.map(g=>g.name)}}if(t===J.duplicateSuite){let c=await ol(e.suite,r),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ye('"newName" is required');let h=await r.testSuite.duplicateSuite(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name,requestCount:h.requests.length}}if(t===J.deleteSuite){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a suite');let c=await ol(e.suite,r);return await r.testSuite.deleteSuite(c.id),{deleted:!0,suite:c.name}}if(t===J.listEnvironments){let c=r.environmentConfig.getAllEnvironments(),p=r.environmentConfig.getSelectedEnvironment();return{environments:c.map(h=>({name:h.name,active:h.active,variableKeys:Object.keys(h.variables)})),active:p}}if(t===J.getEnvironmentVariables){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ye(`environment "${c}" not found`);let g=r.environmentConfig.getSharedConfig()?.environments?.[c]?.variables??{},v=r.environmentConfig.getEnvironmentVariableLocals();return{environment:c,active:r.environmentConfig.getSelectedEnvironment()===c,fileVariables:g,sessionOverrides:v,resolved:p.variables}}if(t===J.selectEnvironment){let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ye('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(c),{selected:!0,environment:c}}if(t===J.createEnvironment){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ye('"name" is required');if(await r.environmentConfig.createEnvironment(c),e.variables&&typeof e.variables=="object"){let p=e.variables,h=r.environmentConfig.getSharedConfig();h&&(h.environments=h.environments??{},h.environments[c]={...h.environments[c]??{},variables:{...h.environments[c]?.variables??{},...p}},r.environmentConfig.saveSharedConfig(h))}return{created:!0,environment:c}}if(t===J.deleteEnvironment){if(e.confirm!==!0)throw ye('"confirm" must be true to delete an environment');let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ye('"environment" is required');let p=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(c),{deleted:!0,environment:c,newActive:p===c?void 0:p}}if(t===J.setEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ye('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),g=e.scope==="permanent"?"permanent":"session";if(g==="permanent"){let v=r.environmentConfig.getSharedConfig();v&&(v.environments=v.environments??{},v.environments[h]=v.environments[h]??{variables:{}},v.environments[h].variables=v.environments[h].variables??{},v.environments[h].variables[c]=p,r.environmentConfig.saveSharedConfig(v))}else r.environmentConfig.setEnvironmentVariable(c,p,h);return{set:!0,key:c,environment:h,scope:g}}if(t===J.unsetEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"";if(!c)throw ye('"key" is required');let p=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(c,p),{unset:!0,key:c,environment:p}}if(t===J.setGlobalVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ye('"key" is required');let h=e.scope==="permanent"?"permanent":"session";if(h==="permanent"){let g=r.environmentConfig.getSharedConfig();g&&(g.globalVariables=g.globalVariables??{},g.globalVariables[c]=p,r.environmentConfig.saveSharedConfig(g))}else r.environmentConfig.setGlobalVariable(c,p);return{set:!0,key:c,scope:h}}if(t===J.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===J.scaffoldCollectionFromOpenApi){let c=typeof e.specPath=="string"?e.specPath.trim():"";if(!c)throw ye('"specPath" is required');let p=r.workspaceFolder&&!Bi.isAbsolute(c)?Bi.join(r.workspaceFolder,c):c;if(!Rp.existsSync(p))throw ye(`OpenAPI spec file not found: "${p}"`);let g=await new Es(r.collection,r.environmentConfig).import(p,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:g.collection.id,collectionName:g.collection.name,requestCount:g.collection.items.filter(v=>v.type==="request").length,environmentCreated:g.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===J.suggestAssertions){let c=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ye('"request" is required');let h=tt(c,s),g=Hi(e.request,h),v=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,_=[],E=Array.from(n.values()).filter($=>$.status!=="running").flatMap($=>$.allResults??[]).filter($=>$.name===g.name||typeof $.name=="string"&&$.name.toLowerCase()===g.name.toLowerCase()),k=E[E.length-1],T=k?.status;T?_.push({snippet:`pm.test("Status code is ${T}", function () {
|
|
350
|
+
Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and iterations=4, generate 4 rows: valid user, duplicate email, missing name, email with invalid format.`,inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name, slug, or id."},iterations:{type:"number",description:"Number of test data rows to generate (default: 5, max: 50)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}}]}var vp,bp,Sp,wp,J,_p=se(()=>{"use strict";vp={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},bp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently, preserving inter-request dependencies."},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"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Sp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},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"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},wp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results."},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},J={listCollections:"list_collections",listFolders:"list_folders",listRequests:"list_requests",searchRequests:"search_requests",getEnvironment:"get_environment",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite",getRunStatus:"get_run_status",getRunSummary:"get_run_summary",getFailedRequests:"get_failed_requests",getRequestResult:"get_request_result",cancelRun:"cancel_run",setVariable:"set_variable",createCollection:"create_collection",renameCollection:"rename_collection",deleteCollection:"delete_collection",duplicateCollection:"duplicate_collection",createFolder:"create_folder",deleteFolder:"delete_folder",getRequest:"get_request",createRequest:"create_request",updateRequest:"update_request",deleteRequest:"delete_request",getRequestScript:"get_request_script",setRequestScript:"set_request_script",reorderCollectionItems:"reorder_collection_items",listSuites:"list_suites",getSuite:"get_suite",createSuite:"create_suite",updateSuiteConfig:"update_suite_config",addSuiteRequests:"add_suite_requests",removeSuiteRequest:"remove_suite_request",reorderSuiteRequests:"reorder_suite_requests",duplicateSuite:"duplicate_suite",deleteSuite:"delete_suite",listEnvironments:"list_environments",getEnvironmentVariables:"get_environment_variables",selectEnvironment:"select_environment",createEnvironment:"create_environment",deleteEnvironment:"delete_environment",setEnvironmentVariable:"set_environment_variable",unsetEnvironmentVariable:"unset_environment_variable",setGlobalVariable:"set_global_variable",getGlobals:"get_globals",scaffoldCollectionFromOpenApi:"scaffold_collection_from_openapi",suggestAssertions:"suggest_assertions",explainFailure:"explain_failure",suggestEnvVars:"suggest_env_vars",applyEnvVars:"apply_env_vars",getRequestsForEnhancement:"get_requests_for_enhancement",applyRequestEnhancements:"apply_request_enhancements",aiSuggestEnvVars:"ai_suggest_env_vars",aiEnhanceCollection:"ai_enhance_collection",analyzeCoverage:"analyze_coverage",aiAnalyzeCoverage:"ai_analyze_coverage",generateRequestFromIntent:"generate_request_from_intent",validateAgainstSpec:"validate_against_spec",generateScenarios:"generate_scenarios",healAssertions:"heal_assertions",generateIterationData:"generate_iteration_data"}});function ye(t){return new Error(`Bad request: ${t}`)}function tt(t,e){if(typeof t!="string"||!t.trim())throw ye('the "collection" argument is required');let r=t.toLowerCase(),n=e.find(i=>i.id===t||i.name===t)??e.find(i=>i.name.toLowerCase()===r)??e.find(i=>i.name.toLowerCase().includes(r))??e.find(i=>i.id.toLowerCase().includes(r));if(!n){let i=e.map(s=>`"${s.name}"`).join(", ");throw ye(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Hi(t,e){if(typeof t!="string"||!t.trim())throw ye('the "request" argument is required');let r=Ke(e),n=t.toLowerCase(),i=r.find(s=>s.request.id===t||s.request.name===t)??r.find(s=>s.request.name.toLowerCase()===n)??r.find(s=>s.request.name.toLowerCase().includes(n));if(!i){let s=r.slice(0,10).map(o=>`"${o.request.name}"`).join(", ");throw ye(`request "${t}" not found in collection "${e.name}". First ${Math.min(r.length,10)} requests: ${s||"(none)"}. Call list_requests or search_requests to find the exact name.`)}return i.request}function dN(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=dN(n.items??[],e);if(i)return i}}async function ol(t,e){if(typeof t!="string"||!t.trim())throw ye('the "suite" argument is required');let r=await e.testSuite.getAllSuites(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n);if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw ye(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function By(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===J.listCollections)return{collections:s.map(c=>({name:c.name,id:c.id,description:c.description??"",requestCount:Ke(c).length}))};if(t===J.listFolders){let c=tt(e.collection,s);return{collection:c.name,folders:Ar(c).map(({folderPath:p,requestCount:h})=>({path:Ui(p),requestCount:h}))}}if(t===J.listRequests){let c=tt(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=typeof e.offset=="number"?Math.max(0,e.offset):0,g=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,v=Ke(c).filter(({folderPath:_})=>!p||_.toLowerCase().includes(p)).map(({request:_,folderPath:w})=>({id:_.id,name:_.name,method:_.method,folder:Ui(w),description:_.description??""}));return{collection:c.name,total:v.length,offset:h,limit:g,requests:v.slice(h,h+g)}}if(t===J.searchRequests){let c=tt(e.collection,s),p=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!p)throw ye('the "query" argument is required');let h=Ke(c).filter(({request:g,folderPath:v})=>g.name.toLowerCase().includes(p)||(g.url??"").toLowerCase().includes(p)||g.method.toLowerCase().includes(p)||v.toLowerCase().includes(p)||(g.description??"").toLowerCase().includes(p)).map(({request:g,folderPath:v})=>({id:g.id,name:g.name,method:g.method,url:g.url??"",folder:Ui(v),description:g.description??""}));return{collection:c.name,query:e.query,total:h.length,requests:h}}if(t===J.getRequest){let c=tt(e.collection,s),p=Hi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"pre-request")??"",g=r.collection.getRequestScript(c.id,p.id,"post-response")??"";return{id:p.id,name:p.name,method:p.method,url:p.url??"",description:p.description??"",headers:p.headers??[],body:p.body??null,auth:p.auth??null,scripts:{preRequest:h,postResponse:g},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===J.getEnvironment){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ye(`environment "${c}" not found`);return{name:p.name,variables:p.variables}}if(t===J.setVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ye('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(c,p,h),{set:!0,key:c,environment:h}}if(t===J.getRunStatus){let c=n.require(e.runId);return{runId:c.id,status:c.status,suiteName:c.suiteName,progress:c.progress,...c.error?{error:c.error}:{}}}if(t===J.getRunSummary){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress};let p=(c.summary.failed??0)>0||c.summary.allPassed===!1,h=c.noAssertionExamples??[],g=h.length,v=c.summary.total,_=g>0?g/(v||1)>.5?`${g}/${v} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${c.suiteName}") for a full coverage analysis.`:`${g} request(s) have no pm.test() assertions (e.g. ${h.slice(0,3).map(w=>`"${w}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${c.suiteName}") to add test coverage.`:null;return{runId:c.id,status:c.status,suiteName:c.suiteName,summary:c.summary,...c.reportPath?{report:{uri:`file://${c.reportPath}`}}:{},...p?{failedRequests:c.failedRequests}:{},...p?{_nextStep:`REQUIRED ACTION: ${c.summary.failed} request(s) failed. The failedRequests array above contains the full details (method, url, requestBody, requestHeaders, status, responseBody, failedTests). Immediately analyze each failed request and provide: (1) root cause, (2) specific fix, (3) corrected pm.test() assertions if relevant. Do NOT wait for the user to ask \u2014 diagnose now.`}:{},..._?{_suggestions:[_]}:{}}}if(t===J.getFailedRequests){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress,failedSoFar:c.failedRequests.length};let p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:c.id,status:c.status,totalFailed:c.failedRequests.length,offset:p,limit:h,failedRequests:c.failedRequests.slice(p,p+h)}}if(t===J.getRequestResult){let c=n.require(e.runId),p=e.request;if(typeof p!="string"||!p)throw ye('"request" is required');let h=typeof e.iteration=="number"?e.iteration:1,g=c.allResults.find(v=>v.iteration===h&&(v.name===p||v.name.toLowerCase()===p.toLowerCase()));if(!g){if(c.status==="running")return{runId:c.id,status:"running",message:`Request "${p}" has not completed yet.`};throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c.id}".`)}return{runId:c.id,...g}}if(t===J.cancelRun){let c=n.require(e.runId);if(c.status!=="running")return{runId:c.id,status:c.status,cancelled:!1,message:`Run is already "${c.status}" \u2014 nothing to cancel.`};let p=n.cancel(String(e.runId));return{runId:c.id,status:"cancelled",cancelled:p,progress:c.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===J.runRequest){let c=tt(e.collection,s),p=Ke(c),h=typeof e.requestId=="string"?e.requestId.trim():void 0,g=e.request,v;if(h){if(v=p.find(_=>_.request.id===h),!v)throw ye(`request with id "${h}" not found in collection "${c.name}"`)}else{if(typeof g!="string"||!g.trim())throw ye('the "request" or "requestId" argument is required');if(v=p.find(_=>_.request.name===g)??p.find(_=>_.request.name.toLowerCase()===g.toLowerCase()),!v)throw ye(`request "${g}" not found in collection "${c.name}"`)}return i.runRequest(c,v.request.id,e)}if(t===J.runFolder){let c=tt(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ye('the "folder" argument is required');let p=e.folder.toLowerCase(),h=pp(e.folder),g=h.toLowerCase(),v=Ar(c).map(w=>w.folderPath),_=v.find(w=>w===h)??v.find(w=>w.toLowerCase()===g)??v.find(w=>w.toLowerCase().includes(g))??v.find(w=>w.split("/").some(E=>E.toLowerCase().includes(g)));if(!_){let w=v.map(E=>`"${E}"`).join(", ");throw ye(`folder "${e.folder}" not found in collection "${c.name}". Available folders: ${w||"(none)"}. Call list_folders to see all.`)}return i.runFolder(c,_,e)}if(t===J.runCollection){let c=tt(e.collection,s);return i.runCollection(c,e)}if(t===J.createCollection){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ye('"name" is required');let p=await r.collection.createCollection(c);return{id:p.id,name:p.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===J.renameCollection){let c=tt(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ye('"newName" is required');return await r.collection.renameCollection(c.id,p),{id:c.id,oldName:c.name,newName:p,renamed:!0}}if(t===J.deleteCollection){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a collection');let c=tt(e.collection,s);return await r.collection.deleteCollection(c.id),{deleted:!0,collection:c.name}}if(t===J.duplicateCollection){let c=tt(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ye('"newName" is required');let h=await r.collection.duplicateCollection(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name}}if(t===J.createFolder){let c=tt(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ye('"name" is required');let h;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let v=e.parentFolder.toLowerCase(),_=Ar(c);if(Ke(c).map(E=>E.folderPath)&&_.find(E=>E.folderPath===e.parentFolder||E.folderPath.toLowerCase()===v)){let k=Ar(c).find(T=>T.folderPath===e.parentFolder||T.folderPath.toLowerCase()===v);if(k){let T=c.items,N=(j,G)=>{for(let q of j)if(q.type==="folder"){let C=q;if(C.name===G||G.endsWith("/"+C.name))return C;let A=N(C.items??[],G);if(A)return A}};h=N(T,k.folderPath)?.id}}}let g=await r.collection.createFolder({collectionId:c.id,name:p,parentId:h});return{id:g.id,name:g.name,created:!0,collection:c.name}}if(t===J.deleteFolder){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a folder');let c=tt(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ye('"folder" is required');let p=e.folder.toLowerCase(),h=Ar(c).find(_=>_.folderPath===e.folder||_.folderPath.toLowerCase()===p);if(!h)throw ye(`folder "${e.folder}" not found in collection "${c.name}"`);let g=dN(c.items,h.folderId);if(!g)throw ye(`folder "${e.folder}" could not be resolved`);let v=h.requestCount;return await r.collection.deleteFolder(c.id,g.id),{deleted:!0,folder:h.folderPath,requestsRemoved:v}}if(t===J.createRequest){let c=tt(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ye('"name" is required');let h=typeof e.method=="string"?e.method.toUpperCase():"GET",g=typeof e.url=="string"?e.url:"";if(!g)throw ye('"url" is required');let v;if(typeof e.folder=="string"&&e.folder.trim()){let E=e.folder.toLowerCase(),k=Ar(c).find(T=>T.folderPath===e.folder||T.folderPath.toLowerCase()===E);k&&(v=k.folderId)}let _={collectionId:c.id,parentId:v,name:p,method:h,url:g,headers:void 0,body:e.body?{type:"raw",raw:String(e.body),contentType:"application/json"}:void 0,description:typeof e.description=="string"?e.description:void 0},w=await r.collection.createRequest(_);return{id:w.id,name:w.name,created:!0,collection:c.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===J.updateRequest){let c=tt(e.collection,s),p=Hi(e.request,c),h={};return typeof e.name=="string"&&(h.name=e.name),typeof e.method=="string"&&(h.method=e.method.toUpperCase()),typeof e.url=="string"&&(h.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(h.headers=Object.entries(e.headers).map(([g,v])=>({name:g,value:String(v),enabled:!0}))),typeof e.body=="string"&&(h.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(h.description=e.description),await r.collection.updateRequest(c.id,p.id,h),{updated:!0,request:p.name}}if(t===J.deleteRequest){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a request');let c=tt(e.collection,s),p=Hi(e.request,c);return await r.collection.deleteRequest(c.id,p.id),{deleted:!0,request:p.name}}if(t===J.getRequestScript){let c=tt(e.collection,s),p=Hi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ye('"phase" must be "pre-request" or "post-response"');let g=r.collection.getRequestScript(c.id,p.id,h);return{collection:c.name,request:p.name,phase:h,script:g??""}}if(t===J.setRequestScript){let c=tt(e.collection,s),p=Hi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ye('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ye('"script" is required');return await r.collection.setRequestScript(c.id,p.id,h,e.script),{updated:!0,collection:c.name,request:p.name,phase:h}}if(t===J.reorderCollectionItems){let c=tt(e.collection,s);if(!Array.isArray(e.order))throw ye('"order" must be an array');let p;if(typeof e.folder=="string"&&e.folder.trim()){let v=e.folder.toLowerCase(),_=Ar(c).find(w=>w.folderPath===e.folder||w.folderPath.toLowerCase()===v);if(!_)throw ye(`folder "${e.folder}" not found in collection "${c.name}"`);p=_.folderId}let h=p?c.items.find(v=>v.id===p)?.items??[]:c.items,g=e.order.map(v=>h.find(w=>w.id===v||w.name===v)?.id??v);return await r.collection.reorderItems(c.id,p,g),{reordered:!0,collection:c.name,order:e.order}}if(t===J.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(p=>({id:p.id,name:p.name,description:p.description??"",requestCount:p.requests.length,iterations:p.config?.iterations??1}))};if(t===J.getSuite){let c=await ol(e.suite,r);return{id:c.id,name:c.name,description:c.description??"",config:{iterations:c.config?.iterations??1,delayBetweenRequests:c.config?.delayBetweenRequests??0,stopOnError:c.config?.stopOnError??!1},requests:c.requests.map(p=>({slug:p.slug??p.requestId,collectionId:p.collectionId,requestId:p.requestId,name:p.name,method:p.method,folderPath:p.folderPath??"",enabled:p.enabled!==!1}))}}if(t===J.createSuite){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ye('"name" is required');let p;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let h=tt(e.fromCollection,s),g=await r.testSuite.createTempSuiteFromCollection(h.id);if(!g)throw new Error(`Could not build suite from collection "${h.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let v=pp(e.fromFolder),_=g.requests.filter(w=>w.folderPath===v||w.folderPath.startsWith(`${v}/`));g.requests=_}p=await r.testSuite.saveTempSuite(g,c)}else p=await r.testSuite.createSuite(c);return(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0)&&(e.description!==void 0&&(p.description=String(e.description)),p.config={...p.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(p)),{id:p.id,name:p.name,requestCount:p.requests.length,created:!0,hint:p.requests.length===0?"Suite is empty. Call add_suite_requests to populate it with requests from a collection.":"Suite created. Call run_suite to execute it."}}if(t===J.updateSuiteConfig){let c=await ol(e.suite,r);return typeof e.name=="string"&&e.name.trim()&&(c.name=e.name.trim()),typeof e.description=="string"&&(c.description=e.description),c.config={...c.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(c),{updated:!0,suite:c.name}}if(t===J.addSuiteRequests){let c=await ol(e.suite,r),p=Array.isArray(e.requests)?e.requests:[];if(p.length===0)throw ye('"requests" array is required and must not be empty');let h=[];for(let v of p){let _=tt(v.collection,s),w=Hi(v.request,_),E=Ke(_).find(k=>k.request.id===w.id)?.folderPath??"";h.push({slug:w.id,collectionId:_.id,requestId:w.id,name:w.name,method:w.method,collectionName:_.name,folderPath:E,enabled:!0})}let g=typeof e.insertAt=="number"?Math.max(0,e.insertAt):void 0;return g!==void 0&&g<c.requests.length?c.requests.splice(g,0,...h):c.requests.push(...h),await r.testSuite.updateSuite(c),{added:h.length,suite:c.name,newRequestCount:c.requests.length}}if(t===J.removeSuiteRequest){let c=await ol(e.suite,r),p;if(typeof e.index=="number"){if(e.index<0||e.index>=c.requests.length)throw ye(`index ${e.index} is out of range`);let[h]=c.requests.splice(e.index,1);p=h.name}else if(typeof e.request=="string"){let h=e.request.toLowerCase(),g=c.requests.findIndex(v=>v.name===e.request||v.name.toLowerCase()===h);if(g===-1)throw ye(`request "${e.request}" not found in suite "${c.name}"`);p=c.requests.splice(g,1)[0].name}else throw ye('either "index" or "request" is required');return await r.testSuite.updateSuite(c),{removed:!0,request:p,newRequestCount:c.requests.length}}if(t===J.reorderSuiteRequests){let c=await ol(e.suite,r);if(!Array.isArray(e.order))throw ye('"order" must be an array of request names');let p=e.order,h=[...c.requests].sort((g,v)=>{let _=p.findIndex(T=>T===g.name||T.toLowerCase()===g.name.toLowerCase()),w=p.findIndex(T=>T===v.name||T.toLowerCase()===v.name.toLowerCase());return(_===-1?1/0:_)-(w===-1?1/0:w)});return c.requests=h,await r.testSuite.updateSuite(c),{reordered:!0,suite:c.name,newOrder:c.requests.map(g=>g.name)}}if(t===J.duplicateSuite){let c=await ol(e.suite,r),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ye('"newName" is required');let h=await r.testSuite.duplicateSuite(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name,requestCount:h.requests.length}}if(t===J.deleteSuite){if(e.confirm!==!0)throw ye('"confirm" must be true to delete a suite');let c=await ol(e.suite,r);return await r.testSuite.deleteSuite(c.id),{deleted:!0,suite:c.name}}if(t===J.listEnvironments){let c=r.environmentConfig.getAllEnvironments(),p=r.environmentConfig.getSelectedEnvironment();return{environments:c.map(h=>({name:h.name,active:h.active,variableKeys:Object.keys(h.variables)})),active:p}}if(t===J.getEnvironmentVariables){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ye(`environment "${c}" not found`);let g=r.environmentConfig.getSharedConfig()?.environments?.[c]?.variables??{},v=r.environmentConfig.getEnvironmentVariableLocals();return{environment:c,active:r.environmentConfig.getSelectedEnvironment()===c,fileVariables:g,sessionOverrides:v,resolved:p.variables}}if(t===J.selectEnvironment){let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ye('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(c),{selected:!0,environment:c}}if(t===J.createEnvironment){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ye('"name" is required');if(await r.environmentConfig.createEnvironment(c),e.variables&&typeof e.variables=="object"){let p=e.variables,h=r.environmentConfig.getSharedConfig();h&&(h.environments=h.environments??{},h.environments[c]={...h.environments[c]??{},variables:{...h.environments[c]?.variables??{},...p}},r.environmentConfig.saveSharedConfig(h))}return{created:!0,environment:c}}if(t===J.deleteEnvironment){if(e.confirm!==!0)throw ye('"confirm" must be true to delete an environment');let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ye('"environment" is required');let p=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(c),{deleted:!0,environment:c,newActive:p===c?void 0:p}}if(t===J.setEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ye('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),g=e.scope==="permanent"?"permanent":"session";if(g==="permanent"){let v=r.environmentConfig.getSharedConfig();v&&(v.environments=v.environments??{},v.environments[h]=v.environments[h]??{variables:{}},v.environments[h].variables=v.environments[h].variables??{},v.environments[h].variables[c]=p,r.environmentConfig.saveSharedConfig(v))}else r.environmentConfig.setEnvironmentVariable(c,p,h);return{set:!0,key:c,environment:h,scope:g}}if(t===J.unsetEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"";if(!c)throw ye('"key" is required');let p=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(c,p),{unset:!0,key:c,environment:p}}if(t===J.setGlobalVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ye('"key" is required');let h=e.scope==="permanent"?"permanent":"session";if(h==="permanent"){let g=r.environmentConfig.getSharedConfig();g&&(g.globalVariables=g.globalVariables??{},g.globalVariables[c]=p,r.environmentConfig.saveSharedConfig(g))}else r.environmentConfig.setGlobalVariable(c,p);return{set:!0,key:c,scope:h}}if(t===J.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===J.scaffoldCollectionFromOpenApi){let c=typeof e.specPath=="string"?e.specPath.trim():"";if(!c)throw ye('"specPath" is required');let p=r.workspaceFolder&&!Bi.isAbsolute(c)?Bi.join(r.workspaceFolder,c):c;if(!Rp.existsSync(p))throw ye(`OpenAPI spec file not found: "${p}"`);let g=await new Es(r.collection,r.environmentConfig).import(p,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:g.collection.id,collectionName:g.collection.name,requestCount:g.collection.items.filter(v=>v.type==="request").length,environmentCreated:g.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===J.suggestAssertions){let c=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ye('"request" is required');let h=tt(c,s),g=Hi(e.request,h),v=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,_=[],E=Array.from(n.values()).filter($=>$.status!=="running").flatMap($=>$.allResults??[]).filter($=>$.name===g.name||typeof $.name=="string"&&$.name.toLowerCase()===g.name.toLowerCase()),k=E[E.length-1],T=k?.status;T?_.push({snippet:`pm.test("Status code is ${T}", function () {
|
|
351
351
|
pm.response.to.have.status(${T});
|
|
352
352
|
});`,rationale:`Observed status ${T} in the most recent run.`}):_.push({snippet:`pm.test("Status code is 2xx", function () {
|
|
353
353
|
pm.expect(pm.response.code).to.be.within(200, 299);
|
|
@@ -355,12 +355,12 @@ Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and i
|
|
|
355
355
|
pm.expect(pm.response.responseTime).to.be.below(2000);
|
|
356
356
|
});`,rationale:"Good practice to gate on response time in CI."});let N=k?.responseBody;if(N)try{let $=JSON.parse(N);if($&&typeof $=="object"){_.push({snippet:`pm.test("Content-Type is application/json", function () {
|
|
357
357
|
pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
|
|
358
|
-
});`,rationale:"Response body was valid JSON \u2014 assert Content-Type accordingly."});let j=Object.keys(Array.isArray($)&&$.length>0?$[0]:$).slice(0,5);for(let G of j){if(_.length>=v)break;let
|
|
358
|
+
});`,rationale:"Response body was valid JSON \u2014 assert Content-Type accordingly."});let j=Object.keys(Array.isArray($)&&$.length>0?$[0]:$).slice(0,5);for(let G of j){if(_.length>=v)break;let q=Array.isArray($)?"body[0]":"body";_.push({snippet:`pm.test("Response has field '${G}'", function () {
|
|
359
359
|
const body = pm.response.json();
|
|
360
|
-
pm.expect(${
|
|
360
|
+
pm.expect(${q}).to.have.property("${G}");
|
|
361
361
|
});`,rationale:`Field "${G}" was present in the observed response body.`})}}}catch{_.push({snippet:`pm.test("Response body is not empty", function () {
|
|
362
362
|
pm.expect(pm.response.text()).to.not.be.empty;
|
|
363
|
-
});`,rationale:"Response body was non-JSON text."})}return{collection:h.name,request:g.name,suggestions:_.slice(0,v),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===J.explainFailure){let c=typeof e.runId=="string"?e.runId.trim():void 0,p=typeof e.request=="string"?e.request.trim():"",h=typeof e.iteration=="number"?e.iteration:1;if(c){let w=n.require(c);if(w.status==="running")return{runId:c,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!p)throw ye('"request" is required when "runId" is provided');let E=w.allResults.find(j=>j.iteration===h&&(j.name===p||typeof j.name=="string"&&j.name.toLowerCase()===p.toLowerCase()));if(!E)throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c}".`);let k=E.assertions?.every(j=>j.passed)??!0,T=E.error,N=E.assertions?.filter(j=>!j.passed)??[],$="";return T?$=`The request itself failed to execute: ${T}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:N.length>0?$=`${N.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:k?$="No failures detected. The request appears to have passed.":$="The request was marked as failed but no specific errors were captured.",{runId:c,request:E.name,iteration:h,status:E.status??"unknown",passed:E.passed??!0,error:T??null,failedAssertions:N,allAssertions:E.assertions??[],requestDetails:{method:E.method,url:E.url,requestBody:E.requestBody},responseDetails:{status:E.responseStatus,headers:E.responseHeaders,body:E.responseBody},diagnosis:$,suggestedFixes:T?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:N.map(j=>`Fix assertion "${j.name}": ${j.message??"expected value mismatch"}`)}}let g=e.collection;if(!p)throw ye('"request" is required');let v=tt(g,s);return{request:Hi(e.request,v).name,collection:v.name,message:"No live run id provided. Run the request first using run_request, then call explain_failure with the runId from the result.",hint:'Use run_request or run_collection with include:["consoleOutput"] to capture a fresh run, then pass the runId here.'}}if(t===J.aiSuggestEnvVars){let c=tt(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,g=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,v=yp(c,p),_=Ke(c).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),bodyExcerpt:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content.slice(0,300):void 0}));return{task:{action:"analyze_and_apply_env_vars",instructions:["Review requestSummary. Find ALL hardcoded values: base URLs, API keys/tokens, tenant IDs, user IDs, secrets, repeated hostnames.","Skip placeholders ({{...}}), HTTP methods, standard header names, empty strings, booleans, short numbers.","Combine heuristicSuggestions with your own findings into one list.",`Call apply_env_vars immediately with: { collection: "${c.name}", suggestions: [...], ${g?`environment: "${g}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:c.name,heuristicSuggestions:v.map(w=>({varName:w.varName,value:w.value,reason:w.reason})),requestSummary:_,expectedCallAfterThis:"apply_env_vars"}}}if(t===J.aiEnhanceCollection){let c=tt(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Ke(c).filter(({folderPath:E})=>!g||E.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,folder:k,method:E.method,url:E.url,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),query:(E.query??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),currentBody:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0})),w=p+h<v.length;return{task:{action:"enhance_requests",instructions:["For each request in requests, produce body and/or testScript as appropriate:"," body: realistic JSON (or form) example matching the endpoint purpose. Only for POST/PUT/PATCH."," testScript: pm.test() assertions \u2014 check status code, response schema, key fields. Always provide this.",`Call apply_request_enhancements immediately with: { collection: "${c.name}", enhancements: [{ requestId, body?, testScript }] }`,w?`After applying, call ai_enhance_collection again with: { collection: "${c.name}", offset: ${p+h}, limit: ${h} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:c.name,total:v.length,offset:p,hasMore:w,nextOffset:w?p+h:void 0,requests:_,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===J.suggestEnvVars){let c=tt(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,h=yp(c,p),g=Ke(c).map(({request:v,folderPath:_})=>({id:v.id,name:v.name,folder:_,method:v.method,url:v.url,headers:(v.headers??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),query:(v.query??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),bodyExcerpt:v.body?.type==="raw"&&typeof v.body.content=="string"?v.body.content.slice(0,300):void 0}));return{collection:c.name,heuristicSuggestions:h.map(v=>({varName:v.varName,value:v.value,reason:v.reason,occurrences:v.occurrences.length})),requestSummary:g,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===J.applyEnvVars){let c=tt(e.collection,s),p=e.suggestions;if(!Array.isArray(p)||p.length===0)throw ye('"suggestions" must be a non-empty array of {value, varName} objects');let h=p,g=jy(c.items,h);await r.collection.saveCollection(c);let _=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(_)for(let E of h)r.environmentConfig.setEnvironmentVariable(E.varName,E.value,_);let w=Object.values(g).reduce((E,k)=>E+k,0);return{collection:c.name,applied:h.map(E=>({varName:E.varName,replacements:g[E.varName]??0})),totalReplacements:w,..._?{writtenToEnvironment:_}:{}}}if(t===J.getRequestsForEnhancement){let c=tt(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Ke(c).filter(({folderPath:w})=>!g||w.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),currentBody:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,w.id,"post-response")??void 0}));return{collection:c.name,total:v.length,offset:p,limit:h,requests:_,hasMore:p+h<v.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===J.applyRequestEnhancements){let c=tt(e.collection,s),p=e.enhancements;if(!Array.isArray(p)||p.length===0)throw ye('"enhancements" must be a non-empty array');let h=[];for(let g of p){let{requestId:v,body:_,testScript:w}=g;if(!Ke(c).find(({request:T})=>T.id===v)){h.push({requestId:v,applied:["skipped: request not found"]});continue}let k=[];typeof _=="string"&&(await r.collection.updateRequest(c.id,v,{body:{type:"raw",content:_,format:"json"}}),k.push("body")),typeof w=="string"&&(await r.collection.setRequestScript(c.id,v,"post-response",w),k.push("testScript")),h.push({requestId:v,applied:k})}return{collection:c.name,results:h,totalUpdated:h.filter(g=>g.applied.length>0&&!g.applied[0].startsWith("skipped")).length}}if(t===J.analyzeCoverage||t===J.aiAnalyzeCoverage){let c=tt(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=Ke(c).filter(({folderPath:N})=>!p||N.toLowerCase().includes(p)),g=h.map(({request:N,folderPath:$})=>{let G=((r.collection.getRequestScript(c.id,N.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:N.id,name:N.name,method:N.method,folder:$,hasAssertions:G>0,assertionCount:G}}),v=g.filter(N=>N.hasAssertions).length,_=g.length,w=_===0?100:Math.round(v/_*100),E=[],k=typeof e.specPath=="string"?e.specPath.trim():"";if(k)try{let N=r.workspaceFolder&&!Bi.isAbsolute(k)?Bi.join(r.workspaceFolder,k):k,$=Rp.readFileSync(N,"utf8"),{parse:j}=await Promise.resolve().then(()=>me(Vd())),O=(k.endsWith(".json")?JSON.parse($):j($)).paths??{},C=["get","post","put","patch","delete","head","options"];for(let[A,D]of Object.entries(O))for(let B of C){if(!(B in D))continue;let F=B.toUpperCase();h.some(({request:ee})=>ee.method.toUpperCase()===F&&(ee.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(A.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||E.push({method:F,path:A})}}catch{}let T=g.filter(N=>!N.hasAssertions);if(t===J.aiAnalyzeCoverage){let N=[];return T.length>0&&N.push(`${T.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${c.name}") to add assertions to all of them.`),E.length>0&&N.push(`${E.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${c.name}") to generate negative and edge-case requests for them.`),N.length===0&&N.push(`Coverage is ${w}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...N,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:c.name,coveragePct:w,covered:v,total:_,untestedRequests:T,untestedOperations:E,expectedCallAfterThis:T.length>0?"ai_enhance_collection":E.length>0?"generate_scenarios":null}}}return{collection:c.name,coveragePct:w,covered:v,total:_,requests:g,...E.length>0?{untestedOperations:E}:{}}}if(t===J.generateRequestFromIntent){let c=tt(e.collection,s),p=typeof e.intent=="string"?e.intent.trim():"";if(!p)throw ye('"intent" is required \u2014 describe what to test in plain English');let g=Ke(c).slice(0,20).map(({request:_,folderPath:w})=>({name:_.name,method:_.method,url:_.url??"",folder:w})),v=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${p}"`,"Using the collection context below, determine: method, full URL (reuse existing {{vars}} where possible), headers, request body (if applicable), and expected HTTP status.","Then immediately:"," 1. Call create_request with name, method, url, and body.",' 2. Call set_request_script (phase: "post-response") with pm.test() assertions that verify the intent.',"Do NOT ask for confirmation \u2014 implement the full request + assertions in one shot."],collection:c.name,intent:p,existingRequests:g,availableEnvVars:v,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===J.validateAgainstSpec){let c=tt(e.collection,s),p=typeof e.specPath=="string"?e.specPath.trim():"";if(!p)throw ye('"specPath" is required');let h=r.workspaceFolder&&!Bi.isAbsolute(p)?Bi.join(r.workspaceFolder,p):p,g;try{let j=Rp.readFileSync(h,"utf8"),{parse:G}=await Promise.resolve().then(()=>me(Vd()));g=p.endsWith(".json")?JSON.parse(j):G(j)}catch(j){throw new Error(`Could not load spec at "${h}": ${j instanceof Error?j.message:String(j)}`)}let v=g.paths??{},_=["get","post","put","patch","delete","head","options"],w=Ke(c),E=[],k=[],T=[],N=j=>j.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[j,G]of Object.entries(v))for(let O of _){if(!(O in G))continue;let C=G[O],A=O.toUpperCase(),D=N(j),B=w.find(({request:F})=>F.method.toUpperCase()===A&&N(F.url??"").includes(D));if(!B)E.push({method:A,path:j,operationId:C.operationId});else{let F=r.collection.getRequestScript(c.id,B.request.id,"post-response")??"";/pm\.test\s*\(/.test(F)||k.push({method:A,path:j,requestName:B.request.name})}}let $=new Set(Object.entries(v).flatMap(([j,G])=>_.filter(O=>O in G).map(O=>`${O.toUpperCase()}:${N(j)}`)));for(let{request:j}of w){let G=N(j.url??""),O=`${j.method.toUpperCase()}:`;[...$].some(A=>A.startsWith(O)&&G.includes(A.split(":")[1]))||T.push({method:j.method,url:j.url??"",requestName:j.name})}return{collection:c.name,spec:Bi.basename(p),summary:{untestedOperations:E.length,matchedWithoutAssertions:k.length,extraRequests:T.length},untestedOperations:E,matchedWithoutAssertions:k,extraRequests:T,hint:E.length>0?`Call generate_scenarios (collection="${c.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===J.generateScenarios){let c=tt(e.collection,s),p=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,h=typeof e.folder=="string"?e.folder.toLowerCase():void 0,g=typeof e.offset=="number"?Math.max(0,e.offset):0,v=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,_=Ke(c).filter(({request:E,folderPath:k})=>!(p&&E.name.toLowerCase()!==p&&!E.name.toLowerCase().includes(p)||h&&!k.toLowerCase().includes(h))),w=_.slice(g,g+v).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,method:E.method,url:E.url??"",folder:k,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),body:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0}));return{task:{action:"generate_scenarios",instructions:["For each request below, generate negative and edge-case test scenario variants.","Scenarios to generate per request (as applicable):"," - Missing required fields \u2192 expect 400 or 422"," - Invalid field type or format (e.g. string where number expected) \u2192 expect 400"," - No Authorization header (remove it) \u2192 expect 401"," - Valid auth but insufficient scope/role \u2192 expect 403"," - Non-existent resource ID in URL \u2192 expect 404"," - Boundary values: empty string, max-length string, 0, -1, very large number","For each scenario:",' 1. Call create_request with a descriptive name (e.g. "Create User - Missing Email \u2192 422"), method, url, and body.',' 2. Immediately call set_request_script (phase: "post-response") with the status assertion.'," 3. Place the new request in the same folder as the original (use folder argument in create_request).","If task.hasMore is true, call generate_scenarios again with task.nextOffset after finishing this batch.","Do NOT ask for confirmation \u2014 generate all scenarios autonomously."],collection:c.name,requests:w,total:_.length,offset:g,hasMore:g+v<_.length,nextOffset:g+v,expectedCallAfterThis:"create_request"}}}if(t===J.healAssertions){let c=tt(e.collection,s),p=Hi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"post-response")??"",g,v=typeof e.runId=="string"?e.runId.trim():void 0;if(v)try{let w=n.require(v).allResults.find(E=>typeof E.name=="string"&&E.name.toLowerCase()===p.name.toLowerCase());w&&(g={status:w.status,responseBody:w.responseBody,responseHeaders:w.responseHeaders,failedTests:w.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${p.method} ${p.url??""}`,"The current test script may have stale or incorrect assertions (e.g. wrong status code, missing/renamed fields).","Compare task.currentScript against task.lastResponse (if available).","Rewrite the complete post-response script so all assertions match the observed response while keeping valid checks.",'Call set_request_script (phase: "post-response") with the updated script immediately.',"Do NOT ask for confirmation."],collection:c.name,request:p.name,method:p.method,url:p.url??"",currentScript:h,lastResponse:g??null,note:g?"Last response data available \u2014 use it to align assertions with actual behavior.":"No run data available \u2014 run the request first with run_request, then call heal_assertions again with the runId.",expectedCallAfterThis:"set_request_script"}}}if(t===J.generateIterationData){let c=tt(e.collection,s),p=Hi(e.request,c),h=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,g=p.body?.type==="raw"&&typeof p.body.content=="string"?p.body.content:void 0,v=(p.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),_=(p.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),w=/\{\{([^}]+)\}\}/g,E=new Set;for(let k of[p.url??"",g??"",...v.map(T=>T.value),..._.map(T=>T.value)]){let T;for(w.lastIndex=0;(T=w.exec(k))!==null;)E.add(T[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${h} test data rows for: ${p.method} ${p.url??""}`,`The request uses these {{variable}} placeholders: ${[...E].join(", ")||"(none detected)"}`,"Each row must be a JSON object whose keys match the placeholder names.","Cover a mix of: (1) valid happy-path data, (2) boundary values, (3) invalid inputs that should fail, (4) edge cases.",'Return the rows as a JSON array in a code block labeled "iterationData".',"This data can be used with: http-forge run-request --collection ... --variables '[...]' or passed to run_request via the variables argument."],collection:c.name,request:p.name,method:p.method,url:p.url??"",body:g??null,headers:v,queryParams:_,placeholders:[...E],iterations:h}}}let o=e.suite;if(typeof o!="string"||!o.trim())throw ye('the "suite" argument is required');let l=await r.testSuite.getAllSuites(),f=l.find(c=>c.id===o||c.name===o)??l.find(c=>c.name.toLowerCase()===o.toLowerCase());if(!f)throw ye(`test suite not found: "${o}"`);return i.runSuite(f.id,f.name,e)}var Rp,Bi,Hy,wx=se(()=>{"use strict";Rp=me(require("fs")),Bi=me(require("path"));Sx();Ny();gi();_p();Hy=new Set([J.createCollection,J.renameCollection,J.deleteCollection,J.duplicateCollection,J.createFolder,J.deleteFolder,J.createRequest,J.updateRequest,J.deleteRequest,J.reorderCollectionItems,J.createSuite,J.updateSuiteConfig,J.duplicateSuite,J.deleteSuite])});function Mo(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
|
|
363
|
+
});`,rationale:"Response body was non-JSON text."})}return{collection:h.name,request:g.name,suggestions:_.slice(0,v),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===J.explainFailure){let c=typeof e.runId=="string"?e.runId.trim():void 0,p=typeof e.request=="string"?e.request.trim():"",h=typeof e.iteration=="number"?e.iteration:1;if(c){let w=n.require(c);if(w.status==="running")return{runId:c,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!p)throw ye('"request" is required when "runId" is provided');let E=w.allResults.find(j=>j.iteration===h&&(j.name===p||typeof j.name=="string"&&j.name.toLowerCase()===p.toLowerCase()));if(!E)throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c}".`);let k=E.assertions?.every(j=>j.passed)??!0,T=E.error,N=E.assertions?.filter(j=>!j.passed)??[],$="";return T?$=`The request itself failed to execute: ${T}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:N.length>0?$=`${N.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:k?$="No failures detected. The request appears to have passed.":$="The request was marked as failed but no specific errors were captured.",{runId:c,request:E.name,iteration:h,status:E.status??"unknown",passed:E.passed??!0,error:T??null,failedAssertions:N,allAssertions:E.assertions??[],requestDetails:{method:E.method,url:E.url,requestBody:E.requestBody},responseDetails:{status:E.responseStatus,headers:E.responseHeaders,body:E.responseBody},diagnosis:$,suggestedFixes:T?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:N.map(j=>`Fix assertion "${j.name}": ${j.message??"expected value mismatch"}`)}}let g=e.collection;if(!p)throw ye('"request" is required');let v=tt(g,s);return{request:Hi(e.request,v).name,collection:v.name,message:"No live run id provided. Run the request first using run_request, then call explain_failure with the runId from the result.",hint:'Use run_request or run_collection with include:["consoleOutput"] to capture a fresh run, then pass the runId here.'}}if(t===J.aiSuggestEnvVars){let c=tt(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,g=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,v=yp(c,p),_=Ke(c).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),bodyExcerpt:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content.slice(0,300):void 0}));return{task:{action:"analyze_and_apply_env_vars",instructions:["Review requestSummary. Find ALL hardcoded values: base URLs, API keys/tokens, tenant IDs, user IDs, secrets, repeated hostnames.","Skip placeholders ({{...}}), HTTP methods, standard header names, empty strings, booleans, short numbers.","Combine heuristicSuggestions with your own findings into one list.",`Call apply_env_vars immediately with: { collection: "${c.name}", suggestions: [...], ${g?`environment: "${g}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:c.name,heuristicSuggestions:v.map(w=>({varName:w.varName,value:w.value,reason:w.reason})),requestSummary:_,expectedCallAfterThis:"apply_env_vars"}}}if(t===J.aiEnhanceCollection){let c=tt(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Ke(c).filter(({folderPath:E})=>!g||E.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,folder:k,method:E.method,url:E.url,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),query:(E.query??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),currentBody:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0})),w=p+h<v.length;return{task:{action:"enhance_requests",instructions:["For each request in requests, produce body and/or testScript as appropriate:"," body: realistic JSON (or form) example matching the endpoint purpose. Only for POST/PUT/PATCH."," testScript: pm.test() assertions \u2014 check status code, response schema, key fields. Always provide this.",`Call apply_request_enhancements immediately with: { collection: "${c.name}", enhancements: [{ requestId, body?, testScript }] }`,w?`After applying, call ai_enhance_collection again with: { collection: "${c.name}", offset: ${p+h}, limit: ${h} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:c.name,total:v.length,offset:p,hasMore:w,nextOffset:w?p+h:void 0,requests:_,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===J.suggestEnvVars){let c=tt(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,h=yp(c,p),g=Ke(c).map(({request:v,folderPath:_})=>({id:v.id,name:v.name,folder:_,method:v.method,url:v.url,headers:(v.headers??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),query:(v.query??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),bodyExcerpt:v.body?.type==="raw"&&typeof v.body.content=="string"?v.body.content.slice(0,300):void 0}));return{collection:c.name,heuristicSuggestions:h.map(v=>({varName:v.varName,value:v.value,reason:v.reason,occurrences:v.occurrences.length})),requestSummary:g,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===J.applyEnvVars){let c=tt(e.collection,s),p=e.suggestions;if(!Array.isArray(p)||p.length===0)throw ye('"suggestions" must be a non-empty array of {value, varName} objects');let h=p,g=jy(c.items,h);await r.collection.saveCollection(c);let _=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(_)for(let E of h)r.environmentConfig.setEnvironmentVariable(E.varName,E.value,_);let w=Object.values(g).reduce((E,k)=>E+k,0);return{collection:c.name,applied:h.map(E=>({varName:E.varName,replacements:g[E.varName]??0})),totalReplacements:w,..._?{writtenToEnvironment:_}:{}}}if(t===J.getRequestsForEnhancement){let c=tt(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Ke(c).filter(({folderPath:w})=>!g||w.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),currentBody:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,w.id,"post-response")??void 0}));return{collection:c.name,total:v.length,offset:p,limit:h,requests:_,hasMore:p+h<v.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===J.applyRequestEnhancements){let c=tt(e.collection,s),p=e.enhancements;if(!Array.isArray(p)||p.length===0)throw ye('"enhancements" must be a non-empty array');let h=[];for(let g of p){let{requestId:v,body:_,testScript:w}=g;if(!Ke(c).find(({request:T})=>T.id===v)){h.push({requestId:v,applied:["skipped: request not found"]});continue}let k=[];typeof _=="string"&&(await r.collection.updateRequest(c.id,v,{body:{type:"raw",content:_,format:"json"}}),k.push("body")),typeof w=="string"&&(await r.collection.setRequestScript(c.id,v,"post-response",w),k.push("testScript")),h.push({requestId:v,applied:k})}return{collection:c.name,results:h,totalUpdated:h.filter(g=>g.applied.length>0&&!g.applied[0].startsWith("skipped")).length}}if(t===J.analyzeCoverage||t===J.aiAnalyzeCoverage){let c=tt(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=Ke(c).filter(({folderPath:N})=>!p||N.toLowerCase().includes(p)),g=h.map(({request:N,folderPath:$})=>{let G=((r.collection.getRequestScript(c.id,N.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:N.id,name:N.name,method:N.method,folder:$,hasAssertions:G>0,assertionCount:G}}),v=g.filter(N=>N.hasAssertions).length,_=g.length,w=_===0?100:Math.round(v/_*100),E=[],k=typeof e.specPath=="string"?e.specPath.trim():"";if(k)try{let N=r.workspaceFolder&&!Bi.isAbsolute(k)?Bi.join(r.workspaceFolder,k):k,$=Rp.readFileSync(N,"utf8"),{parse:j}=await Promise.resolve().then(()=>me(Vd())),q=(k.endsWith(".json")?JSON.parse($):j($)).paths??{},C=["get","post","put","patch","delete","head","options"];for(let[A,D]of Object.entries(q))for(let B of C){if(!(B in D))continue;let F=B.toUpperCase();h.some(({request:ee})=>ee.method.toUpperCase()===F&&(ee.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(A.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||E.push({method:F,path:A})}}catch{}let T=g.filter(N=>!N.hasAssertions);if(t===J.aiAnalyzeCoverage){let N=[];return T.length>0&&N.push(`${T.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${c.name}") to add assertions to all of them.`),E.length>0&&N.push(`${E.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${c.name}") to generate negative and edge-case requests for them.`),N.length===0&&N.push(`Coverage is ${w}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...N,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:c.name,coveragePct:w,covered:v,total:_,untestedRequests:T,untestedOperations:E,expectedCallAfterThis:T.length>0?"ai_enhance_collection":E.length>0?"generate_scenarios":null}}}return{collection:c.name,coveragePct:w,covered:v,total:_,requests:g,...E.length>0?{untestedOperations:E}:{}}}if(t===J.generateRequestFromIntent){let c=tt(e.collection,s),p=typeof e.intent=="string"?e.intent.trim():"";if(!p)throw ye('"intent" is required \u2014 describe what to test in plain English');let g=Ke(c).slice(0,20).map(({request:_,folderPath:w})=>({name:_.name,method:_.method,url:_.url??"",folder:w})),v=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${p}"`,"Using the collection context below, determine: method, full URL (reuse existing {{vars}} where possible), headers, request body (if applicable), and expected HTTP status.","Then immediately:"," 1. Call create_request with name, method, url, and body.",' 2. Call set_request_script (phase: "post-response") with pm.test() assertions that verify the intent.',"Do NOT ask for confirmation \u2014 implement the full request + assertions in one shot."],collection:c.name,intent:p,existingRequests:g,availableEnvVars:v,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===J.validateAgainstSpec){let c=tt(e.collection,s),p=typeof e.specPath=="string"?e.specPath.trim():"";if(!p)throw ye('"specPath" is required');let h=r.workspaceFolder&&!Bi.isAbsolute(p)?Bi.join(r.workspaceFolder,p):p,g;try{let j=Rp.readFileSync(h,"utf8"),{parse:G}=await Promise.resolve().then(()=>me(Vd()));g=p.endsWith(".json")?JSON.parse(j):G(j)}catch(j){throw new Error(`Could not load spec at "${h}": ${j instanceof Error?j.message:String(j)}`)}let v=g.paths??{},_=["get","post","put","patch","delete","head","options"],w=Ke(c),E=[],k=[],T=[],N=j=>j.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[j,G]of Object.entries(v))for(let q of _){if(!(q in G))continue;let C=G[q],A=q.toUpperCase(),D=N(j),B=w.find(({request:F})=>F.method.toUpperCase()===A&&N(F.url??"").includes(D));if(!B)E.push({method:A,path:j,operationId:C.operationId});else{let F=r.collection.getRequestScript(c.id,B.request.id,"post-response")??"";/pm\.test\s*\(/.test(F)||k.push({method:A,path:j,requestName:B.request.name})}}let $=new Set(Object.entries(v).flatMap(([j,G])=>_.filter(q=>q in G).map(q=>`${q.toUpperCase()}:${N(j)}`)));for(let{request:j}of w){let G=N(j.url??""),q=`${j.method.toUpperCase()}:`;[...$].some(A=>A.startsWith(q)&&G.includes(A.split(":")[1]))||T.push({method:j.method,url:j.url??"",requestName:j.name})}return{collection:c.name,spec:Bi.basename(p),summary:{untestedOperations:E.length,matchedWithoutAssertions:k.length,extraRequests:T.length},untestedOperations:E,matchedWithoutAssertions:k,extraRequests:T,hint:E.length>0?`Call generate_scenarios (collection="${c.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===J.generateScenarios){let c=tt(e.collection,s),p=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,h=typeof e.folder=="string"?e.folder.toLowerCase():void 0,g=typeof e.offset=="number"?Math.max(0,e.offset):0,v=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,_=Ke(c).filter(({request:E,folderPath:k})=>!(p&&E.name.toLowerCase()!==p&&!E.name.toLowerCase().includes(p)||h&&!k.toLowerCase().includes(h))),w=_.slice(g,g+v).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,method:E.method,url:E.url??"",folder:k,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),body:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0}));return{task:{action:"generate_scenarios",instructions:["For each request below, generate negative and edge-case test scenario variants.","Scenarios to generate per request (as applicable):"," - Missing required fields \u2192 expect 400 or 422"," - Invalid field type or format (e.g. string where number expected) \u2192 expect 400"," - No Authorization header (remove it) \u2192 expect 401"," - Valid auth but insufficient scope/role \u2192 expect 403"," - Non-existent resource ID in URL \u2192 expect 404"," - Boundary values: empty string, max-length string, 0, -1, very large number","For each scenario:",' 1. Call create_request with a descriptive name (e.g. "Create User - Missing Email \u2192 422"), method, url, and body.',' 2. Immediately call set_request_script (phase: "post-response") with the status assertion.'," 3. Place the new request in the same folder as the original (use folder argument in create_request).","If task.hasMore is true, call generate_scenarios again with task.nextOffset after finishing this batch.","Do NOT ask for confirmation \u2014 generate all scenarios autonomously."],collection:c.name,requests:w,total:_.length,offset:g,hasMore:g+v<_.length,nextOffset:g+v,expectedCallAfterThis:"create_request"}}}if(t===J.healAssertions){let c=tt(e.collection,s),p=Hi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"post-response")??"",g,v=typeof e.runId=="string"?e.runId.trim():void 0;if(v)try{let w=n.require(v).allResults.find(E=>typeof E.name=="string"&&E.name.toLowerCase()===p.name.toLowerCase());w&&(g={status:w.status,responseBody:w.responseBody,responseHeaders:w.responseHeaders,failedTests:w.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${p.method} ${p.url??""}`,"The current test script may have stale or incorrect assertions (e.g. wrong status code, missing/renamed fields).","Compare task.currentScript against task.lastResponse (if available).","Rewrite the complete post-response script so all assertions match the observed response while keeping valid checks.",'Call set_request_script (phase: "post-response") with the updated script immediately.',"Do NOT ask for confirmation."],collection:c.name,request:p.name,method:p.method,url:p.url??"",currentScript:h,lastResponse:g??null,note:g?"Last response data available \u2014 use it to align assertions with actual behavior.":"No run data available \u2014 run the request first with run_request, then call heal_assertions again with the runId.",expectedCallAfterThis:"set_request_script"}}}if(t===J.generateIterationData){let c=tt(e.collection,s),p=Hi(e.request,c),h=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,g=p.body?.type==="raw"&&typeof p.body.content=="string"?p.body.content:void 0,v=(p.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),_=(p.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),w=/\{\{([^}]+)\}\}/g,E=new Set;for(let k of[p.url??"",g??"",...v.map(T=>T.value),..._.map(T=>T.value)]){let T;for(w.lastIndex=0;(T=w.exec(k))!==null;)E.add(T[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${h} test data rows for: ${p.method} ${p.url??""}`,`The request uses these {{variable}} placeholders: ${[...E].join(", ")||"(none detected)"}`,"Each row must be a JSON object whose keys match the placeholder names.","Cover a mix of: (1) valid happy-path data, (2) boundary values, (3) invalid inputs that should fail, (4) edge cases.",'Return the rows as a JSON array in a code block labeled "iterationData".',"This data can be used with: http-forge run-request --collection ... --variables '[...]' or passed to run_request via the variables argument."],collection:c.name,request:p.name,method:p.method,url:p.url??"",body:g??null,headers:v,queryParams:_,placeholders:[...E],iterations:h}}}let o=e.suite;if(typeof o!="string"||!o.trim())throw ye('the "suite" argument is required');let l=await r.testSuite.getAllSuites(),f=l.find(c=>c.id===o||c.name===o)??l.find(c=>c.name.toLowerCase()===o.toLowerCase());if(!f)throw ye(`test suite not found: "${o}"`);return i.runSuite(f.id,f.name,e)}var Rp,Bi,Hy,wx=se(()=>{"use strict";Rp=me(require("fs")),Bi=me(require("path"));Sx();Ny();gi();_p();Hy=new Set([J.createCollection,J.renameCollection,J.deleteCollection,J.duplicateCollection,J.createFolder,J.deleteFolder,J.createRequest,J.updateRequest,J.deleteRequest,J.reorderCollectionItems,J.createSuite,J.updateSuiteConfig,J.duplicateSuite,J.deleteSuite])});function Mo(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
|
|
364
364
|
\u2026 (truncated, ${t.length-e} chars omitted)`}function Cp(t){return t.replace(/"(Authorization|authorization)"\s*:\s*"[^"]+"/g,'"Authorization": "[REDACTED]"').replace(/Bearer\s+[A-Za-z0-9\-._~+/]+=*/g,"Bearer [REDACTED]").replace(/"(password|secret|token|api[-_]?key)"\s*:\s*"[^"]+"/gi,'"$1": "[REDACTED]"')}function pN(t,e){let r=e.getAllCollections(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n)??r.find(s=>s.name.toLowerCase().includes(n));if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw new Error(`Collection "${t}" not found. Available: ${s||"(none)"}`)}return i}function S5(t,e){let r=t.runId,n=t.request?.toLowerCase(),i=e.get(r);if(!i)throw new Error(`Run "${r}" not found. It may have expired or never existed. Use get_run_status to see recent runs.`);if(i.status==="running")throw new Error(`Run "${r}" is still in progress. Wait for it to complete before analyzing.`);let o=(i.allResults??[]).filter(p=>n&&typeof p.name=="string"&&!p.name.toLowerCase().includes(n)?!1:p.passed===!1||Array.isArray(p.assertions)&&p.assertions.some(h=>!h.passed)),l=i.summary,f=o.length,c=`I ran an HTTP API test suite and got failures. Please analyze the results and provide:
|
|
365
365
|
|
|
366
366
|
1. **Root cause** for each failure
|
|
@@ -471,9 +471,9 @@ Please provide recommendations for:
|
|
|
471
471
|
5. **Authentication** \u2014 is auth consistent across requests that need it?
|
|
472
472
|
6. **Environment variables** \u2014 are URLs and credentials properly parameterized?
|
|
473
473
|
|
|
474
|
-
Be specific: name the exact requests or folders that need attention.`;return{description:`Review collection "${r.name}" (${n.length} requests, ${o.length} without assertions)`,messages:[{role:"user",content:{type:"text",text:p}}]}}async function Vy(t,e,r,n){switch(t){case"analyze-test-failure":return S5(e,n);case"suggest-assertions":return w5(e,r,n);case"review-collection":return _5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${xp.map(i=>i.name).join(", ")}`)}}var xp,_x=se(()=>{"use strict";gi();xp=[{name:"analyze-test-failure",description:"Analyze a failed API test run. Returns a structured prompt the LLM uses to diagnose each failure and suggest concrete fixes \u2014 no extra AI configuration needed.",arguments:[{name:"runId",description:"Run ID returned by run_suite, run_collection, or run_folder",required:!0},{name:"request",description:"Filter analysis to a specific request name (omit to analyze all failures)",required:!1}]},{name:"suggest-assertions",description:"Generate pm.test() assertion scripts for a request. The LLM writes Chai-style assertions based on the request definition and optionally an observed response.",arguments:[{name:"collection",description:"Collection name or id",required:!0},{name:"request",description:"Request name or id",required:!0},{name:"runId",description:"Run ID to use observed response data for more accurate assertions (optional)",required:!1}]},{name:"review-collection",description:"Get an AI review of a collection's structure, naming conventions, test coverage gaps, and assertion quality.",arguments:[{name:"collection",description:"Collection name or id",required:!0}]}]});var Ec,Rx=se(()=>{"use strict";Ec=class{store=new Map;newId(){return`run_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}create(e,r){this.prune();let n={id:this.newId(),status:"running",suiteName:e,startedAt:Date.now(),progress:{completed:0,total:r},summary:{passed:0,failed:0,total:0,allPassed:!1},failedRequests:[],allResults:[],reportPath:null};return this.store.set(n.id,n),n}get(e){return this.store.get(e)}require(e){if(typeof e!="string"||!e)throw new Error('"runId" is required');let r=this.store.get(e);if(!r)throw new Error(`Run "${e}" not found. It may have expired (1-hour TTL) or never existed.`);return r}prune(){let e=Date.now()-36e5;for(let[r,n]of this.store)n.startedAt<e&&this.store.delete(r)}values(){return this.store.values()}cancel(e){let r=this.store.get(e);return!r||r.status!=="running"?!1:(r.status="cancelled",r.completedAt=Date.now(),!0)}}});function Vi(t,e=40){let r=(0,hN.createHash)("sha256").update(t,"utf8").digest("hex").slice(0,R5);return t.substring(0,e)+"_"+r}function x5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function Fo(t,e=C5){return x5(t,e)?t:Vi(t,e-20)}function zy(t,e,r){let n=`${t}request__${Fo(e)}__${Fo(r)}`;return n.length<=Wy?n:`${t}request__${Vi(e)}__${Vi(r)}`}function Jy(t,e){let r=`${t}collection__${Fo(e,100)}`;return r.length<=Wy?r:`${t}collection__${Vi(e,80)}`}function Gy(t,e,r){let n=`${t}folder__${Fo(e)}__${Fo(r)}`;return n.length<=Wy?n:`${t}folder__${Vi(e)}__${Vi(r)}`}function Yy(t,e){let r=`${t}suite__${Fo(e,100)}`;return r.length<=Wy?r:`${t}suite__${Vi(e,80)}`}function Ky(t){for(let e of["request","collection","folder","suite"]){let r=`${e}__`;if(t.startsWith(r))return{kind:e,tokens:t.slice(r.length).split("__")}}throw new Error(`Unknown MCP tool name: ${t}`)}function al(t,e){for(let r of e)if(Vi(r)===t)return r;for(let r of e)if(r===t)return r}function Qy(t,e){let r=al(t,e);if(r!==void 0)return r;try{let n=Buffer.from(t,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function Zy(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function Xy(t,e){return`Run all ${e} requests in the "${t}" collection.`}function ev(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function tv(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var hN,R5,C5,Wy,rv=se(()=>{"use strict";hN=require("crypto"),R5=12,C5=60,Wy=126});function nv(t){let e=new Set,r=[];for(let n of t)e.has(n.name)||(e.add(n.name),r.push(n));return r}function iv(t){return Buffer.from(String(t)).toString("base64url")}function sv(t){if(!t)return 0;try{let e=parseInt(Buffer.from(t,"base64url").toString(),10);return Number.isFinite(e)&&e>=0?e:0}catch{return 0}}function ov(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let c of t)o+=Ke(c).length;let l=i==="drilldown"||i==="auto"&&o>s;if(i==="flat"&&o>500&&console.warn(`[http-forge MCP] WARNING: toolMode is "flat" but ${o} requests would produce ${o}+ tools. This will likely degrade AI tool-selection quality and bloat the context window. Consider setting toolMode to "auto" or "drilldown" in http-forge.config.json.`),l)return nv(Uy(n,t.map(c=>c.name),e.map(c=>c.name)).map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema,...c.annotations&&{annotations:c.annotations}})));let f=[];for(let c of t){let p=Ke(c);for(let{request:h,folderPath:g}of p)f.push({name:zy(n,c.id,h.id),description:Zy(h.method,h.name,c.name,g),inputSchema:vp});f.push({name:Jy(n,c.id),description:Xy(c.name,p.length),inputSchema:bp});for(let{folderPath:h,requestCount:g}of Ar(c))g!==0&&f.push({name:Gy(n,c.id,h),description:ev(h,c.name,g),inputSchema:Sp})}for(let c of e)f.push({name:Yy(n,c.id),description:tv(c.name,c.requests.length,c.config.iterations),inputSchema:wp});return nv(f)}var Cx=se(()=>{"use strict";gi();rv();_p()});var ll,xx=se(()=>{"use strict";ba();ll=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 o=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(o,s)}}getCookieHeader(e){let r=dt.extractDomain(e),n=dt.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return dt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function ul(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function mN(t){return{index:t.i,iteration:t.it,name:t.n,method:
|
|
474
|
+
Be specific: name the exact requests or folders that need attention.`;return{description:`Review collection "${r.name}" (${n.length} requests, ${o.length} without assertions)`,messages:[{role:"user",content:{type:"text",text:p}}]}}async function Vy(t,e,r,n){switch(t){case"analyze-test-failure":return S5(e,n);case"suggest-assertions":return w5(e,r,n);case"review-collection":return _5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${xp.map(i=>i.name).join(", ")}`)}}var xp,_x=se(()=>{"use strict";gi();xp=[{name:"analyze-test-failure",description:"Analyze a failed API test run. Returns a structured prompt the LLM uses to diagnose each failure and suggest concrete fixes \u2014 no extra AI configuration needed.",arguments:[{name:"runId",description:"Run ID returned by run_suite, run_collection, or run_folder",required:!0},{name:"request",description:"Filter analysis to a specific request name (omit to analyze all failures)",required:!1}]},{name:"suggest-assertions",description:"Generate pm.test() assertion scripts for a request. The LLM writes Chai-style assertions based on the request definition and optionally an observed response.",arguments:[{name:"collection",description:"Collection name or id",required:!0},{name:"request",description:"Request name or id",required:!0},{name:"runId",description:"Run ID to use observed response data for more accurate assertions (optional)",required:!1}]},{name:"review-collection",description:"Get an AI review of a collection's structure, naming conventions, test coverage gaps, and assertion quality.",arguments:[{name:"collection",description:"Collection name or id",required:!0}]}]});var Ec,Rx=se(()=>{"use strict";Ec=class{store=new Map;newId(){return`run_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}create(e,r){this.prune();let n={id:this.newId(),status:"running",suiteName:e,startedAt:Date.now(),progress:{completed:0,total:r},summary:{passed:0,failed:0,total:0,allPassed:!1},failedRequests:[],allResults:[],reportPath:null};return this.store.set(n.id,n),n}get(e){return this.store.get(e)}require(e){if(typeof e!="string"||!e)throw new Error('"runId" is required');let r=this.store.get(e);if(!r)throw new Error(`Run "${e}" not found. It may have expired (1-hour TTL) or never existed.`);return r}prune(){let e=Date.now()-36e5;for(let[r,n]of this.store)n.startedAt<e&&this.store.delete(r)}values(){return this.store.values()}cancel(e){let r=this.store.get(e);return!r||r.status!=="running"?!1:(r.status="cancelled",r.completedAt=Date.now(),!0)}}});function Vi(t,e=40){let r=(0,hN.createHash)("sha256").update(t,"utf8").digest("hex").slice(0,R5);return t.substring(0,e)+"_"+r}function x5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function Fo(t,e=C5){return x5(t,e)?t:Vi(t,e-20)}function zy(t,e,r){let n=`${t}request__${Fo(e)}__${Fo(r)}`;return n.length<=Wy?n:`${t}request__${Vi(e)}__${Vi(r)}`}function Jy(t,e){let r=`${t}collection__${Fo(e,100)}`;return r.length<=Wy?r:`${t}collection__${Vi(e,80)}`}function Gy(t,e,r){let n=`${t}folder__${Fo(e)}__${Fo(r)}`;return n.length<=Wy?n:`${t}folder__${Vi(e)}__${Vi(r)}`}function Yy(t,e){let r=`${t}suite__${Fo(e,100)}`;return r.length<=Wy?r:`${t}suite__${Vi(e,80)}`}function Ky(t){for(let e of["request","collection","folder","suite"]){let r=`${e}__`;if(t.startsWith(r))return{kind:e,tokens:t.slice(r.length).split("__")}}throw new Error(`Unknown MCP tool name: ${t}`)}function al(t,e){for(let r of e)if(Vi(r)===t)return r;for(let r of e)if(r===t)return r}function Qy(t,e){let r=al(t,e);if(r!==void 0)return r;try{let n=Buffer.from(t,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function Zy(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function Xy(t,e){return`Run all ${e} requests in the "${t}" collection.`}function ev(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function tv(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var hN,R5,C5,Wy,rv=se(()=>{"use strict";hN=require("crypto"),R5=12,C5=60,Wy=126});function nv(t){let e=new Set,r=[];for(let n of t)e.has(n.name)||(e.add(n.name),r.push(n));return r}function iv(t){return Buffer.from(String(t)).toString("base64url")}function sv(t){if(!t)return 0;try{let e=parseInt(Buffer.from(t,"base64url").toString(),10);return Number.isFinite(e)&&e>=0?e:0}catch{return 0}}function ov(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let c of t)o+=Ke(c).length;let l=i==="drilldown"||i==="auto"&&o>s;if(i==="flat"&&o>500&&console.warn(`[http-forge MCP] WARNING: toolMode is "flat" but ${o} requests would produce ${o}+ tools. This will likely degrade AI tool-selection quality and bloat the context window. Consider setting toolMode to "auto" or "drilldown" in http-forge.config.json.`),l)return nv(Uy(n,t.map(c=>c.name),e.map(c=>c.name)).map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema,...c.annotations&&{annotations:c.annotations}})));let f=[];for(let c of t){let p=Ke(c);for(let{request:h,folderPath:g}of p)f.push({name:zy(n,c.id,h.id),description:Zy(h.method,h.name,c.name,g),inputSchema:vp});f.push({name:Jy(n,c.id),description:Xy(c.name,p.length),inputSchema:bp});for(let{folderPath:h,requestCount:g}of Ar(c))g!==0&&f.push({name:Gy(n,c.id,h),description:ev(h,c.name,g),inputSchema:Sp})}for(let c of e)f.push({name:Yy(n,c.id),description:tv(c.name,c.requests.length,c.config.iterations),inputSchema:wp});return nv(f)}var Cx=se(()=>{"use strict";gi();rv();_p()});var ll,xx=se(()=>{"use strict";ba();ll=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 o=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(o,s)}}getCookieHeader(e){let r=dt.extractDomain(e),n=dt.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return dt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function ul(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function mN(t){return{index:t.i,iteration:t.it,name:t.n,method:Os[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:ul(t.i,t.it,t.r),error:t.e}}var av,Os,Ep=se(()=>{"use strict";av={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Os={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});function Wi(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function Ex(t){return(Math.max(0,t)/1e3).toFixed(3)}var Oc,Ic,cl,Ix=se(()=>{"use strict";Oc=me(require("fs/promises")),Ic=me(require("path"));Ep();cl=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Ic.join(this.basePath,e,r),i=JSON.parse(await Oc.readFile(Ic.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),o=await this.loadAllDetails(n,s),l=this.buildXml(i,s,o),f=Ic.join(n,"junit.xml");return await Oc.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Ic.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await Oc.readFile(s,"utf-8"));n.push(...o.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=ul(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await Oc.readFile(Ic.join(e,"results",s),"utf-8"));n.set(o,l)}catch{}}return n}buildGroups(e,r,n){let i=e.config?.iterations>1,s=[],o=new Map;for(let l of r){let f=n.get(`${l.i}-${l.it}`),c=l.cn||f?.collectionName||e.suiteName||"",p=l.fp||f?.folderPath||"",h=`${c}\0${p}`;if(!o.has(h)){let w=[c,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(h,{label:w,cases:[]}),s.push(h)}let g=l.n||f?.name||Os[l.m]||"request",v=i?`${g} (iteration ${l.it})`:g,_=(f?.assertions??[]).filter(w=>!w.passed).map(w=>({name:w.name,message:w.message}));_.length===0&&l.af>0&&_.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(h).cases.push({name:v,classname:[c,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??f?.error??null,failedAssertions:_,consoleOutput:f?.consoleOutput})}return s.map(l=>o.get(l))}buildXml(e,r,n){let i=this.buildGroups(e,r,n),s=0,o=0,l=0,f=0,c=[];i.forEach((g,v)=>{let _=0,w=0,E=0,k=0,T=[];for(let N of g.cases){_++,k+=N.durationMs;let $=!N.passed&&N.failedAssertions.length===0&&!!N.error,j=!N.passed&&!$;$&&E++,j&&w++;let G=[];if(j){let C=N.failedAssertions.length>0?N.failedAssertions.map(D=>D.name).join("; "):N.error||"Assertion failed",A=N.failedAssertions.map(D=>D.message?`${D.name}: ${D.message}`:D.name).join(`
|
|
475
475
|
`);G.push(` <failure message="${Wi(C)}" type="AssertionFailure">${Wi(A)}</failure>`)}$&&G.push(` <error message="${Wi(N.error)}" type="RequestError">${Wi(N.error)}</error>`),N.consoleOutput&&N.consoleOutput.length>0&&G.push(` <system-out>${Wi(N.consoleOutput.join(`
|
|
476
|
-
`))}</system-out>`);let
|
|
476
|
+
`))}</system-out>`);let q=` <testcase name="${Wi(N.name)}" classname="${Wi(N.classname)}" time="${Ex(N.durationMs)}"`;G.length===0?T.push(`${q} />`):T.push(`${q}>
|
|
477
477
|
${G.join(`
|
|
478
478
|
`)}
|
|
479
479
|
</testcase>`)}s+=_,o+=w,l+=E,f+=k,c.push(` <testsuite name="${Wi(g.label)}" tests="${_}" failures="${w}" errors="${E}" skipped="0" time="${Ex(k)}" timestamp="${Wi(e.startTime)}" id="${v}">
|
|
@@ -484,15 +484,15 @@ ${h}
|
|
|
484
484
|
${c.join(`
|
|
485
485
|
`)}
|
|
486
486
|
</testsuites>
|
|
487
|
-
`}}});function xt(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function fl(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function
|
|
487
|
+
`}}});function xt(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function fl(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function Ox(t){try{return new Date(t).toLocaleString()}catch{return t}}function lv(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function E5(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function vN(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}function gN(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">${xt(r)}</td><td class="kv-val">${xt(i)}</td></tr>`}).join("")}</table>`}function I5(t){return t==null||t===""?'<span class="dim">\u2014</span>':typeof t=="string"?xt(t):typeof t=="number"||typeof t=="boolean"?xt(String(t)):`<pre class="code">${xt(vN(t))}</pre>`}function qx(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])=>`
|
|
488
488
|
<tr>
|
|
489
489
|
<td class="kv-key">${xt(r)}</td>
|
|
490
490
|
<td class="kv-val">${I5(n)}</td>
|
|
491
|
-
</tr>`).join("")}</table>`}function
|
|
491
|
+
</tr>`).join("")}</table>`}function O5(t){return!t||t.length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${t.map(r=>`
|
|
492
492
|
<tr>
|
|
493
493
|
<td class="kv-key">${xt(r.name??"(unnamed)")}</td>
|
|
494
494
|
<td class="kv-val">${xt(r.value??"")}</td>
|
|
495
|
-
</tr>`).join("")}</table>`}function yN(t,e){if(t==null||t==="")return'<span class="dim">\u2014 empty \u2014</span>';let r=vN(t);return`<pre class="code">${xt(r)}</pre>`}var kc,
|
|
495
|
+
</tr>`).join("")}</table>`}function yN(t,e){if(t==null||t==="")return'<span class="dim">\u2014 empty \u2014</span>';let r=vN(t);return`<pre class="code">${xt(r)}</pre>`}var kc,qc,Pc,kx=se(()=>{"use strict";kc=me(require("fs/promises")),qc=me(require("path"));Ep();Pc=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=qc.join(this.basePath,e,r),i=JSON.parse(await kc.readFile(qc.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),o=await this.loadAllDetails(n,s),l=this.buildHtml(i,s,o),f=qc.join(n,"report.html");return await kc.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=qc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await kc.readFile(s,"utf-8"));n.push(...o.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=ul(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await kc.readFile(qc.join(e,"results",s),"utf-8"));n.set(o,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),o=i.cn||"",l=i.fp||"",f=`${o}\0${l}`;s.map.has(f)||(s.map.set(f,{cn:o,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(o=>s.map.get(o))}})}groupLabel(e,r,n){let i=String(n).padStart(2,"0"),s=e?xt(e):"";if(r){let o=r.split("/").map(l=>xt(l.replace(/^\s*\d+\s*-\s*/,""))).join("/");s=s?`${s}: ${o}`:o}return s||(s="(root)"),`${i} - ${s}`}renderGroupedDetails(e,r,n){let i=r.config.iterations>1;return this.groupByIterCollectionFolder(e).map(s=>{let o=s.groups.map((c,p)=>{let h=c.items.filter(w=>w.p).length,g=c.items.length,v=h<g,_=c.items.map(n).join("");return`
|
|
496
496
|
<details class="group-block${v?" group-fail":""}" open>
|
|
497
497
|
<summary class="group-head">
|
|
498
498
|
<span class="group-title">\u{1F4C1} ${this.groupLabel(c.cn,c.fp,p+1)}</span>
|
|
@@ -516,7 +516,7 @@ ${c.join(`
|
|
|
516
516
|
<td>${v.p90!==void 0?fl(v.p90):"\u2014"}</td>
|
|
517
517
|
<td>${v.p99!==void 0?fl(v.p99):"\u2014"}</td>
|
|
518
518
|
<td class="${v.failed>0?"fail":"pass"}">${_}</td>
|
|
519
|
-
</tr>`}).join(""),l=Math.max(...r.map(v=>v.d),1),f=v=>{let _=
|
|
519
|
+
</tr>`}).join(""),l=Math.max(...r.map(v=>v.d),1),f=v=>{let _=Os[v.m]??"GET",w=Math.max(2,Math.round(v.d/l*100)),E=v.p?"bar-pass":"bar-fail",k=v.p?"":' class="row-fail"',T=`req-${v.i}-${v.it}`;return`
|
|
520
520
|
<tr${k}>
|
|
521
521
|
<td class="dim">${v.i}</td>
|
|
522
522
|
<td>${v.it}</td>
|
|
@@ -526,12 +526,12 @@ ${c.join(`
|
|
|
526
526
|
<td>${fl(v.d)}</td>
|
|
527
527
|
<td><div class="bar-wrap"><div class="${E}" style="width:${w}%"></div></div></td>
|
|
528
528
|
<td class="${v.p?"pass":"fail"}">${v.p?"\u2713":"\u2717"}</td>
|
|
529
|
-
</tr>`},c=this.renderGroupedTimeline(r,e,f),p=v=>{let _=`${v.i}-${v.it}`,w=n.get(_),E=
|
|
529
|
+
</tr>`},c=this.renderGroupedTimeline(r,e,f),p=v=>{let _=`${v.i}-${v.it}`,w=n.get(_),E=Os[v.m]??"GET",k=`req-${v.i}-${v.it}`,T=v.p,N=T?"#1f6feb40":"#f8514940",$=w?.assertions?.length?`<ul class="assert-list">${w.assertions.map(_t=>`
|
|
530
530
|
<li class="${_t.passed?"pass":"fail"}">
|
|
531
531
|
<span class="assert-icon">${_t.passed?"\u2713":"\u2717"}</span>
|
|
532
532
|
${xt(_t.name)}
|
|
533
533
|
${_t.message?`<span class="assert-msg"> \u2014 ${xt(_t.message)}</span>`:""}
|
|
534
|
-
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',j=gN(w?.request?.headers),G=
|
|
534
|
+
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',j=gN(w?.request?.headers),G=qx(w?{method:w.request?.method,url:w.request?.url,query:w.request?.query,params:w.request?.params,bodyType:w.request?.body?.type,bodyFormat:w.request?.body?.format}:void 0),q=w?.request?.body,C=q&&typeof q=="object"?q.type:void 0,A=q&&typeof q=="object"&&"content"in q?q.content:q,D=C!=="none"&&!(A==null||A===""),B=D?yN(A):"",F=gN(w?.response?.headers),K=qx(w?{status:w.status,statusText:w.statusText,durationMs:w.duration,responseTimeMs:w.response?.time,responseSizeBytes:w.response?.size}:void 0),ee=w?.response?.body!==void 0&&w.response.body!==null?yN(w.response.body):'<span class="dim">\u2014 no body \u2014</span>',ie=O5(w?.response?.cookies),pe=qx(w?{timestamp:w.timestamp?new Date(w.timestamp).toISOString():void 0,nextRequest:w.nextRequest,visualizerTemplate:w.visualizerData?.template,visualizerData:w.visualizerData?.data}:void 0),Pe=`
|
|
535
535
|
<div class="detail-section">
|
|
536
536
|
<div class="pane-section-title">Assertions
|
|
537
537
|
<span class="assert-counts">
|
|
@@ -820,7 +820,7 @@ ${c.join(`
|
|
|
820
820
|
<div class="meta">
|
|
821
821
|
Environment: <strong>${xt(e.environment)}</strong> \xB7
|
|
822
822
|
Run ID: <code>${xt(e.runId)}</code> \xB7
|
|
823
|
-
${
|
|
823
|
+
${Ox(e.startTime)}${e.endTime?` \u2192 ${Ox(e.endTime)}`:""}
|
|
824
824
|
\xB7 Iterations: ${e.config.iterations}
|
|
825
825
|
</div>
|
|
826
826
|
</div>
|
|
@@ -911,7 +911,7 @@ ${c.join(`
|
|
|
911
911
|
<div id="tab-failures" class="tab-content">
|
|
912
912
|
<p class="dim" style="margin-bottom:12px">Jump to failing request details:</p>
|
|
913
913
|
<ul style="list-style:none;display:flex;flex-direction:column;gap:6px">
|
|
914
|
-
${r.filter(v=>!v.p).map(v=>{let _=
|
|
914
|
+
${r.filter(v=>!v.p).map(v=>{let _=Os[v.m]??"GET";return`<li>
|
|
915
915
|
<a href="#req-${v.i}-${v.it}" onclick="jumpToRequest('req-${v.i}-${v.it}')"
|
|
916
916
|
style="display:flex;align-items:center;gap:8px;background:#1c0f12;
|
|
917
917
|
border:1px solid #f8514940;border-radius:6px;padding:8px 12px">
|
|
@@ -926,7 +926,7 @@ ${c.join(`
|
|
|
926
926
|
</div>`:""}
|
|
927
927
|
|
|
928
928
|
<p class="dim" style="margin-top:20px;text-align:center">
|
|
929
|
-
Generated by HTTP Forge \xB7 ${
|
|
929
|
+
Generated by HTTP Forge \xB7 ${Ox(new Date().toISOString())}
|
|
930
930
|
</p>
|
|
931
931
|
</div>
|
|
932
932
|
<script>
|
|
@@ -1010,12 +1010,12 @@ ${c.join(`
|
|
|
1010
1010
|
});
|
|
1011
1011
|
</script>
|
|
1012
1012
|
</body>
|
|
1013
|
-
</html>`}}});function dl(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 zt,Xr,pl,Px=se(()=>{"use strict";zt=me(require("fs/promises")),Xr=me(require("path"));En();pd();kx();Ep();pl=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=Xr.join(this.basePath,e,s),await zt.mkdir(Xr.join(this.currentRunPath,"results"),{recursive:!0}),await zt.mkdir(Xr.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"),o=Tt(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,f=Xr.join(this.currentRunPath,"results",l),c={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(v=>({name:v.name,passed:v.passed,message:v.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await zt.writeFile(f,JSON.stringify(og(c),null,2),"utf-8");let p=r.assertions.filter(v=>v.passed).length,h=r.assertions.filter(v=>!v.passed).length,g={i:this.resultIndex,it:e,n:r.name,m:av[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:h,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(g),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()),g}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 f in this.currentManifest.requestStats){let c=this.currentManifest.requestStats[f],p=this.requestDurations[f]||[];c.count>0&&(c.avgDuration=Math.round(c.totalDuration/c.count)),c.minDuration===Number.MAX_SAFE_INTEGER&&(c.minDuration=0),p.length>0&&(p.sort((h,g)=>h-g),c.p50=dl(p,50),c.p90=dl(p,90),c.p95=dl(p,95),c.p99=dl(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((f,c)=>f-c),this.currentManifest.stats.p50=dl(n,50),this.currentManifest.stats.p95=dl(n,95),this.currentManifest.stats.p99=dl(n,99)),this.requestDurations={},await this.saveManifest();let i=null,s=this.currentRunPath,o=this.currentSuiteId,l=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&o&&l&&s)try{i=await new Pc(this.basePath).generate(o,l)}catch(f){console.warn("[ResultStorage] HTML report generation failed:",f)}return i}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=Xr.join(this.basePath,e,r,"results",n),s=await zt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Xr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await zt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Xr.join(this.basePath,e,r,"manifest.json"),i=await zt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Xr.join(this.basePath,e);try{let n=await zt.readdir(r),i=[];for(let s of n.sort().reverse())try{let o=await this.getManifest(e,s);i.push(o)}catch{}return i}catch{return[]}}async listSuites(){try{return(await zt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Xr.join(this.basePath,e,r);await zt.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,o=await this.listSuites();for(let l of o){let f=await this.listRuns(l);for(let c of f)if(new Date(c.startTime)<n){let p=Xr.join(this.basePath,l,c.runId),h=await this.getDirectorySize(p);await zt.rm(p,{recursive:!0,force:!0}),i++,s+=h}}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=Xr.join(this.currentRunPath,"manifest.json");await zt.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=Xr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await zt.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 zt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Xr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await zt.stat(s);r+=o.size}}}catch{}return r}}});var zi,Ip,Tx,uv,cv,fv,bN=se(()=>{"use strict";zi=me(require("fs")),Ip=me(require("path")),Tx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=zi.watch(n,{recursive:!0},(s,o)=>{if(o){let l=Ip.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:Ip.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=[]}},uv=class{createFileWatcher(e,r){return new Tx(e,r)}},cv=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(zi.existsSync(this.storeFile)){let e=zi.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=Ip.dirname(this.storeFile);zi.mkdirSync(e,{recursive:!0}),zi.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()}},fv=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});function Ax(t){let e=qp.resolve(t.workspaceFolder),{appInfo:r}=t,n=No.createFresh(),i=qp.join(e,".http-forge-cache","stores"),s=qp.join(i,"global-state.json"),o={workspaceFolder:e,fileWatcherFactory:new uv,notificationService:new fv,globalStore:new cv(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return hp(n,o),n}function hn(t){return Ax({workspaceFolder:t})}var qp,dv=se(()=>{"use strict";qp=me(require("path"));gx();vx();bN()});function O5(t){let e=[];return t.map(r=>{let n=cn(r,e);return e.push(n),n})}function SN(t,e,r,n){let i=t.find(c=>c.id===e);if(i)return{item:i,tier:"id"};let s=O5(t.map(c=>c.name)),o=t.filter((c,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Do(r,e,o.map(c=>({id:c.id,name:c.name,path:n(c)})));let l=e.toLowerCase(),f=t.filter(c=>c.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Do(r,e,f.map(c=>({id:c.id,name:c.name,path:n(c)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function pv(t,e){let{item:r,tier:n}=SN(t,e,"collection",()=>"");return{collection:r,tier:n}}function hv(t,e){let r=e.split("/").map(o=>o.trim()).filter(o=>o.length>0),n=t.items,i=[],s=[];for(let o of r){let l=n.filter(h=>h.type==="folder"),f=i.join("/"),{item:c,tier:p}=SN(l,o,"folder",h=>f?`${f}/${h.name}`:h.name);i.push(c.name),s.push(p),n=c.items??[]}return{folderPath:i.map(ur).join("/"),tiers:s}}function wN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=cn(i.name,n);n.push(s),r.push({item:i,folderPath:e,slug:s})}for(let i of t)if(i.type==="folder"){let s=i,o=e?`${e}/${ur(s.name)}`:ur(s.name);wN(s.items??[],o,r)}}function mv(t,e,r){let n=[];wN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(g=>g.folderPath===i||g.folderPath.startsWith(`${i}/`)):n,o=g=>g.folderPath?`${g.folderPath}/${g.item.name}`:g.item.name,l=s.find(g=>g.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(g=>g.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Do("request",e,f.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let c=e.toLowerCase(),p=s.filter(g=>g.item.name.toLowerCase()===c);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new Do("request",e,p.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let h=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${h}`)}var Do,$x=se(()=>{"use strict";va();gi();Do=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
|
|
1013
|
+
</html>`}}});function dl(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 zt,Xr,pl,Px=se(()=>{"use strict";zt=me(require("fs/promises")),Xr=me(require("path"));En();pd();kx();Ep();pl=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=Xr.join(this.basePath,e,s),await zt.mkdir(Xr.join(this.currentRunPath,"results"),{recursive:!0}),await zt.mkdir(Xr.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"),o=Tt(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,f=Xr.join(this.currentRunPath,"results",l),c={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(v=>({name:v.name,passed:v.passed,message:v.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await zt.writeFile(f,JSON.stringify(og(c),null,2),"utf-8");let p=r.assertions.filter(v=>v.passed).length,h=r.assertions.filter(v=>!v.passed).length,g={i:this.resultIndex,it:e,n:r.name,m:av[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:h,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(g),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()),g}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 f in this.currentManifest.requestStats){let c=this.currentManifest.requestStats[f],p=this.requestDurations[f]||[];c.count>0&&(c.avgDuration=Math.round(c.totalDuration/c.count)),c.minDuration===Number.MAX_SAFE_INTEGER&&(c.minDuration=0),p.length>0&&(p.sort((h,g)=>h-g),c.p50=dl(p,50),c.p90=dl(p,90),c.p95=dl(p,95),c.p99=dl(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((f,c)=>f-c),this.currentManifest.stats.p50=dl(n,50),this.currentManifest.stats.p95=dl(n,95),this.currentManifest.stats.p99=dl(n,99)),this.requestDurations={},await this.saveManifest();let i=null,s=this.currentRunPath,o=this.currentSuiteId,l=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&o&&l&&s)try{i=await new Pc(this.basePath).generate(o,l)}catch(f){console.warn("[ResultStorage] HTML report generation failed:",f)}return i}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=Xr.join(this.basePath,e,r,"results",n),s=await zt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Xr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await zt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Xr.join(this.basePath,e,r,"manifest.json"),i=await zt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Xr.join(this.basePath,e);try{let n=await zt.readdir(r),i=[];for(let s of n.sort().reverse())try{let o=await this.getManifest(e,s);i.push(o)}catch{}return i}catch{return[]}}async listSuites(){try{return(await zt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Xr.join(this.basePath,e,r);await zt.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,o=await this.listSuites();for(let l of o){let f=await this.listRuns(l);for(let c of f)if(new Date(c.startTime)<n){let p=Xr.join(this.basePath,l,c.runId),h=await this.getDirectorySize(p);await zt.rm(p,{recursive:!0,force:!0}),i++,s+=h}}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=Xr.join(this.currentRunPath,"manifest.json");await zt.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=Xr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await zt.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 zt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Xr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await zt.stat(s);r+=o.size}}}catch{}return r}}});var zi,Ip,Tx,uv,cv,fv,bN=se(()=>{"use strict";zi=me(require("fs")),Ip=me(require("path")),Tx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=zi.watch(n,{recursive:!0},(s,o)=>{if(o){let l=Ip.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:Ip.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=[]}},uv=class{createFileWatcher(e,r){return new Tx(e,r)}},cv=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(zi.existsSync(this.storeFile)){let e=zi.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=Ip.dirname(this.storeFile);zi.mkdirSync(e,{recursive:!0}),zi.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()}},fv=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});function Ax(t){let e=Op.resolve(t.workspaceFolder),{appInfo:r}=t,n=No.createFresh(),i=Op.join(e,".http-forge-cache","stores"),s=Op.join(i,"global-state.json"),o={workspaceFolder:e,fileWatcherFactory:new uv,notificationService:new fv,globalStore:new cv(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return hp(n,o),n}function hn(t){return Ax({workspaceFolder:t})}var Op,dv=se(()=>{"use strict";Op=me(require("path"));gx();vx();bN()});function q5(t){let e=[];return t.map(r=>{let n=cn(r,e);return e.push(n),n})}function SN(t,e,r,n){let i=t.find(c=>c.id===e);if(i)return{item:i,tier:"id"};let s=q5(t.map(c=>c.name)),o=t.filter((c,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Do(r,e,o.map(c=>({id:c.id,name:c.name,path:n(c)})));let l=e.toLowerCase(),f=t.filter(c=>c.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Do(r,e,f.map(c=>({id:c.id,name:c.name,path:n(c)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function pv(t,e){let{item:r,tier:n}=SN(t,e,"collection",()=>"");return{collection:r,tier:n}}function hv(t,e){let r=e.split("/").map(o=>o.trim()).filter(o=>o.length>0),n=t.items,i=[],s=[];for(let o of r){let l=n.filter(h=>h.type==="folder"),f=i.join("/"),{item:c,tier:p}=SN(l,o,"folder",h=>f?`${f}/${h.name}`:h.name);i.push(c.name),s.push(p),n=c.items??[]}return{folderPath:i.map(ur).join("/"),tiers:s}}function wN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=cn(i.name,n);n.push(s),r.push({item:i,folderPath:e,slug:s})}for(let i of t)if(i.type==="folder"){let s=i,o=e?`${e}/${ur(s.name)}`:ur(s.name);wN(s.items??[],o,r)}}function mv(t,e,r){let n=[];wN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(g=>g.folderPath===i||g.folderPath.startsWith(`${i}/`)):n,o=g=>g.folderPath?`${g.folderPath}/${g.item.name}`:g.item.name,l=s.find(g=>g.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(g=>g.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Do("request",e,f.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let c=e.toLowerCase(),p=s.filter(g=>g.item.name.toLowerCase()===c);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new Do("request",e,p.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let h=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${h}`)}var Do,$x=se(()=>{"use strict";va();gi();Do=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
|
|
1014
1014
|
`+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
|
|
1015
1015
|
`)+`
|
|
1016
|
-
Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var kp={};us(kp,{runCollection:()=>Os,runFolder:()=>N5,runRequest:()=>gv,runSuite:()=>Op});function Mx(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function RN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function k5(){return RN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function P5(){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 CN(t,e=[]){return RN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function Nx(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function T5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function xN(t){return ii(T5(t))}function EN(t){return s_((t??[]).map(e=>({name:e.name,value:e.value})))}function _N(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function IN(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 qN(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 ON(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function kN(t,e,r){if(t&&t.type&&t.type!=="inherit")return t.type==="none"?void 0:t;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i?.type&&i.type!=="inherit")return i.type==="none"?void 0:i}if(r&&r.type&&r.type!=="inherit")return r.type==="none"?void 0:r}function Fx(t,e,r=t.items,n=[],i=[]){for(let s of r){if(s.type==="request"&&s.id===e)return{request:s,folderScriptsChain:[...n],folderAuthChain:[...i]};if(s.type==="folder"){let o=s,l=o.scripts?[...n,o.scripts]:[...n],f=o.auth?[...i,o.auth]:[...i],c=Fx(t,e,o.items??[],l,f);if(c)return c}}}function PN(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.map(ur).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],f=[...n,o.name];i.push(...PN(t,o.items??[],l,f))}return i}function A5(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 $5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function TN(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=pv(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function AN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=hv(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function $N(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,o=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,f=Math.max(1,Math.min(50,r.concurrency??1)),c=r.requestFilter,p=r.include??[],h=r.reporters??[],g=h.includes("junit"),v=ON(r.variables),_=k5(),w=CN(p,h),E=e.requests.filter(de=>!(de.enabled===!1||c&&!c.some(le=>de.name.toLowerCase().includes(le.toLowerCase()))));if(_){let de=P5(),le=E.length*s;if(le>de)throw new Error(`Suite "${e.name}" would execute ${le} request calls (${E.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${de}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let k=new pl(t.config),T=await k.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),N=[],$=[],j=0,G=0,O=new Set,C=new AbortController,A=new ll;async function D(de){for(let le of E){if(C.signal.aborted)break;let be=t.collection.getCollection(le.collectionId);if(!be)continue;let ze=Fx(be,le.requestId);if(!ze)continue;let mt=kN(ze.request.auth,ze.folderAuthChain,be.auth),ce=new gs(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,A,be.scripts,ze.folderScriptsChain,void 0,be.name,be.auth,de,s),rr=qN(IN({...ze.request,auth:mt}),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),Ne=await ce.execute(rr,v,C.signal);if(Ne.folderPath=le.folderPath??"",Ne.collectionName=be.name,await k.saveResult(de,Ne),Ne.assertions?.length||O.add(le.name),Ne.passed?j++:G++,p.includes("perRequest")&&N.push({name:le.name,iteration:de,status:Ne.response?.status,ok:(Ne.response?.status??0)>=200&&(Ne.response?.status??0)<300,duration:`${Ne.duration}ms`,allPassed:Ne.passed,...p.includes("consoleOutput")&&Ne.consoleOutput?.length?{consoleOutput:Ne.consoleOutput}:{}}),!Ne.passed&&($.push({name:le.name,iteration:de,method:Ne.executedRequest?.method,url:Ne.executedRequest?.url,requestBody:Nx(Ne.executedRequest?.body?.content)??Ne.executedRequest?.body?.content??null,requestHeaders:ii(Ne.executedRequest?.headers??{}),status:Ne.response?.status,duration:`${Ne.duration}ms`,body:Nx(Ne.response?.body),headers:xN(Ne.response?.headers),cookies:EN(Ne.response?.cookies),failedTests:Ne.assertions?.filter(it=>!it.passed).map(it=>({name:it.name,...it.message?{message:it.message}:{}})),...Ne.error?{error:Ne.error}:{},...p.includes("consoleOutput")&&Ne.consoleOutput?.length?{consoleOutput:Ne.consoleOutput}:{}}),o)){C.abort();break}l>0&&!C.signal.aborted&&await new Promise(it=>setTimeout(it,l))}}for(let de=1;de<=s&&!C.signal.aborted;de+=f){let le=Math.min(de+f-1,s),be=Array.from({length:le-de+1},(ze,mt)=>de+mt);await Promise.all(be.map(D))}let B=await k.finalizeRun("completed",w),F=null;if(g)try{F=await new cl(k.getBasePath()).generate(e.id,T)}catch(de){console.warn("[direct-execution] JUnit report generation failed:",de)}let K=n==="collection"?"collection":"suite",ie=k.getCurrentStats()?.stats,pe=ie?{min:ie.minDuration,max:ie.maxDuration,avg:ie.avgDuration,p50:ie.p50??null,p95:ie.p95??null,p99:ie.p99??null}:null,Pe={[K]:e.name,environment:i,summary:{total:j+G,passed:j,failed:G,...s>1?{iterations:s}:{},...f>1?{concurrency:f}:{},allPassed:G===0,...pe?{durationMs:pe}:{}}};if((G>0||p.includes("failedOnly"))&&(Pe.failedRequests=$),p.includes("perRequest")&&(Pe.results=N),B!==null&&(Pe.report={uri:`file://${B}`,hint:"Click the URI to open the HTML report in your browser"}),F!==null&&(Pe.junitReport={path:F}),O.size>0){let de=E.length,le=O.size,be=Array.from(O).slice(0,5);Pe.noAssertionExamples=be;let ze=e.name;if(le/de>.5)Pe._suggestions=[`${le}/${de} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${ze}") for a full coverage analysis and to identify assertion gaps.`];else{let mt=be.map(ce=>`"${ce}"`).join(", ");Pe._suggestions=[`${le} request(s) have no pm.test() assertions: ${mt}. Invoke the "suggest-assertions" prompt (collection="${ze}") to generate test coverage for them.`]}}return Pe}async function gv(t){let e=hn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=CN(r,n);try{let o=e.collection,l=TN(o,t),f=AN(l,t),c=t.requestId;if(!c){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let $=mv(l,t.requestRef,f);c=$.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:$.tier,id:c,path:$.folderPath?`${$.folderPath}/${$.request.name}`:$.request.name})}let p=Fx(l,c);if(!p)throw new Error(`Request "${c}" not found in collection "${l.name}"`);let h=kN(p.request.auth,p.folderAuthChain,l.auth),g=t.environment||e.environmentConfig.getSelectedEnvironment(),v=qN(IN({...p.request,auth:h}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),w=await new gs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,g,new ll,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(v,ON(t.variables)),E=null,k=null;if(s||i){let $=new pl(e.config),j=`request-${_N(l.id)}-${_N(c)}`,G=`Request: ${p.request.name}`,O=await $.initializeRun(j,G,g,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await $.saveResult(1,w),E=await $.finalizeRun("completed",s),i)try{k=await new cl($.getBasePath()).generate(j,O)}catch(C){console.warn("[direct-execution] JUnit report generation failed:",C)}}let T=xN(w.response?.headers),N=EN(w.response?.cookies);return{request:p.request.name,status:w.response?.status||0,ok:(w.response?.status??0)>=200&&(w.response?.status??0)<300,duration:`${w.duration}ms`,body:Nx(w.response?.body),allPassed:w.passed,assertions:w.assertions?.map($=>({name:$.name,passed:$.passed,message:$.message})),...r.includes("headers")?{headers:T}:{},...r.includes("cookies")?{cookies:N}:{},...r.includes("tests")?{tests:w.assertions?.map($=>({name:$.name,passed:$.passed,...$.message?{message:$.message}:{}}))}:{},...Object.keys(w.modifiedVariables??{}).length?{modifiedVariables:w.modifiedVariables}:{},...r.includes("consoleOutput")&&w.consoleOutput?.length?{consoleOutput:w.consoleOutput}:{},...E!==null?{report:{uri:`file://${E}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...k!==null?{junitReport:{path:k}}:{},...w.error?{error:w.error}:{}}}catch(o){throw o}finally{Mx(e)}}async function Os(t){let e=hn(t.workspaceFolder);try{let r=e.collection,n=TN(r,t),i=AN(n,t),s=PN(n),o=A5(s,i,t.recursive);if(o.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=o.map(({request:c,folderPath:p})=>({id:c.id,slug:c.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:c.id,name:c.name,method:c.method,collectionName:n.name,folderPath:p,enabled:!0})),f={id:i?`temp-${n.id}-${$5(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return $N(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"collection")}catch(r){throw r}finally{Mx(e)}}async function N5(t){return Os({recursive:!0,...t})}async function Op(t){let e=hn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return $N(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"suite")}catch(r){throw r}finally{Mx(e)}}var Tc=se(()=>{"use strict";xx();eg();pd();Ix();Px();gi();dv();$x()});var LN={};us(LN,{createMcpRuntime:()=>G5});async function yi(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 Ac(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function D5(t,e){let r=jx.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=Dx.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(c,p)=>!!c?.length&&(c.includes(p.id)||c.includes(p.name)),l=e.collection.getAllCollections().filter(c=>!o(s.excludedCollections,c)),f=(await e.testSuite.getAllSuites()).filter(c=>!o(s.excludedSuites,c));return ov(l,f,s)})().then(s=>(jx.set(t,{tools:s,expiresAt:Date.now()+F5}),s)).finally(()=>Dx.delete(t));return Dx.set(t,i),i}function L5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function j5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function NN(t,e,r,n){hl(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function U5(t){return t.config.getMcpConfig().toolPageSize??200}async function H5(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{},prompts:{}},serverInfo:{name:"http-forge",version:"1.0.0"},instructions:"You are assisting with HTTP API testing via HTTP Forge. When a run_suite, run_collection, or run_folder call completes with failures (summary.failed > 0 or allPassed === false), automatically analyze the 'failedRequests' in the response and provide: (1) root cause for each failure, (2) specific fix recommendations, (3) updated pm.test() assertion scripts where relevant. Do not wait for the user to ask \u2014 proactively diagnose and suggest fixes. For async runs (status: 'running'), poll with get_run_status until complete, then call get_run_summary. When get_run_summary returns a _nextStep field you MUST execute it immediately \u2014 the failedRequests array is already included inline so no extra tool call is needed. Analyze the failures and provide diagnosis without waiting for the user."};case"tools/list":{let r=await D5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=U5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=sv(i),l=r.slice(o,o+s),f=o+s,c={tools:l};return f<r.length&&(c.nextCursor=iv(f)),c}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Ux(t,n,i??{}),o=s,l=o?.summary;l&&((l.failed??0)>0||l.allPassed===!1)&&(o._nextStep=`${l.failed??"Some"} request(s) failed. Please analyze the 'failedRequests' above: identify the root cause of each failure, suggest specific fixes (URL, auth, body, environment variables), and provide updated pm.test() assertion scripts where the assertions are incorrect.`);let f=JSON.stringify(s,null,2),c=j5(f,t.host,t.port),p=c.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),h=p?`
|
|
1016
|
+
Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var kp={};us(kp,{runCollection:()=>qs,runFolder:()=>N5,runRequest:()=>gv,runSuite:()=>qp});function Mx(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function RN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function k5(){return RN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function P5(){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 CN(t,e=[]){return RN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function Nx(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function T5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function xN(t){return ii(T5(t))}function EN(t){return s_((t??[]).map(e=>({name:e.name,value:e.value})))}function _N(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function IN(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 ON(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 qN(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function kN(t,e,r){if(t&&t.type&&t.type!=="inherit")return t.type==="none"?void 0:t;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i?.type&&i.type!=="inherit")return i.type==="none"?void 0:i}if(r&&r.type&&r.type!=="inherit")return r.type==="none"?void 0:r}function Fx(t,e,r=t.items,n=[],i=[]){for(let s of r){if(s.type==="request"&&s.id===e)return{request:s,folderScriptsChain:[...n],folderAuthChain:[...i]};if(s.type==="folder"){let o=s,l=o.scripts?[...n,o.scripts]:[...n],f=o.auth?[...i,o.auth]:[...i],c=Fx(t,e,o.items??[],l,f);if(c)return c}}}function PN(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.map(ur).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],f=[...n,o.name];i.push(...PN(t,o.items??[],l,f))}return i}function A5(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 $5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function TN(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=pv(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function AN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=hv(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function $N(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,o=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,f=Math.max(1,Math.min(50,r.concurrency??1)),c=r.requestFilter,p=r.include??[],h=r.reporters??[],g=h.includes("junit"),v=qN(r.variables),_=k5(),w=CN(p,h),E=e.requests.filter(de=>!(de.enabled===!1||c&&!c.some(le=>de.name.toLowerCase().includes(le.toLowerCase()))));if(_){let de=P5(),le=E.length*s;if(le>de)throw new Error(`Suite "${e.name}" would execute ${le} request calls (${E.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${de}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let k=new pl(t.config),T=await k.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),N=[],$=[],j=0,G=0,q=new Set,C=new AbortController,A=new ll;async function D(de){for(let le of E){if(C.signal.aborted)break;let be=t.collection.getCollection(le.collectionId);if(!be)continue;let ze=Fx(be,le.requestId);if(!ze)continue;let mt=kN(ze.request.auth,ze.folderAuthChain,be.auth),ce=new gs(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,A,be.scripts,ze.folderScriptsChain,void 0,be.name,be.auth,de,s),rr=ON(IN({...ze.request,auth:mt}),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),Ne=await ce.execute(rr,v,C.signal);if(Ne.folderPath=le.folderPath??"",Ne.collectionName=be.name,await k.saveResult(de,Ne),Ne.assertions?.length||q.add(le.name),Ne.passed?j++:G++,p.includes("perRequest")&&N.push({name:le.name,iteration:de,status:Ne.response?.status,ok:(Ne.response?.status??0)>=200&&(Ne.response?.status??0)<300,duration:`${Ne.duration}ms`,allPassed:Ne.passed,...p.includes("consoleOutput")&&Ne.consoleOutput?.length?{consoleOutput:Ne.consoleOutput}:{}}),!Ne.passed&&($.push({name:le.name,iteration:de,method:Ne.executedRequest?.method,url:Ne.executedRequest?.url,requestBody:Nx(Ne.executedRequest?.body?.content)??Ne.executedRequest?.body?.content??null,requestHeaders:ii(Ne.executedRequest?.headers??{}),status:Ne.response?.status,duration:`${Ne.duration}ms`,body:Nx(Ne.response?.body),headers:xN(Ne.response?.headers),cookies:EN(Ne.response?.cookies),failedTests:Ne.assertions?.filter(it=>!it.passed).map(it=>({name:it.name,...it.message?{message:it.message}:{}})),...Ne.error?{error:Ne.error}:{},...p.includes("consoleOutput")&&Ne.consoleOutput?.length?{consoleOutput:Ne.consoleOutput}:{}}),o)){C.abort();break}l>0&&!C.signal.aborted&&await new Promise(it=>setTimeout(it,l))}}for(let de=1;de<=s&&!C.signal.aborted;de+=f){let le=Math.min(de+f-1,s),be=Array.from({length:le-de+1},(ze,mt)=>de+mt);await Promise.all(be.map(D))}let B=await k.finalizeRun("completed",w),F=null;if(g)try{F=await new cl(k.getBasePath()).generate(e.id,T)}catch(de){console.warn("[direct-execution] JUnit report generation failed:",de)}let K=n==="collection"?"collection":"suite",ie=k.getCurrentStats()?.stats,pe=ie?{min:ie.minDuration,max:ie.maxDuration,avg:ie.avgDuration,p50:ie.p50??null,p95:ie.p95??null,p99:ie.p99??null}:null,Pe={[K]:e.name,environment:i,summary:{total:j+G,passed:j,failed:G,...s>1?{iterations:s}:{},...f>1?{concurrency:f}:{},allPassed:G===0,...pe?{durationMs:pe}:{}}};if((G>0||p.includes("failedOnly"))&&(Pe.failedRequests=$),p.includes("perRequest")&&(Pe.results=N),B!==null&&(Pe.report={uri:`file://${B}`,hint:"Click the URI to open the HTML report in your browser"}),F!==null&&(Pe.junitReport={path:F}),q.size>0){let de=E.length,le=q.size,be=Array.from(q).slice(0,5);Pe.noAssertionExamples=be;let ze=e.name;if(le/de>.5)Pe._suggestions=[`${le}/${de} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${ze}") for a full coverage analysis and to identify assertion gaps.`];else{let mt=be.map(ce=>`"${ce}"`).join(", ");Pe._suggestions=[`${le} request(s) have no pm.test() assertions: ${mt}. Invoke the "suggest-assertions" prompt (collection="${ze}") to generate test coverage for them.`]}}return Pe}async function gv(t){let e=hn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=CN(r,n);try{let o=e.collection,l=TN(o,t),f=AN(l,t),c=t.requestId;if(!c){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let $=mv(l,t.requestRef,f);c=$.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:$.tier,id:c,path:$.folderPath?`${$.folderPath}/${$.request.name}`:$.request.name})}let p=Fx(l,c);if(!p)throw new Error(`Request "${c}" not found in collection "${l.name}"`);let h=kN(p.request.auth,p.folderAuthChain,l.auth),g=t.environment||e.environmentConfig.getSelectedEnvironment(),v=ON(IN({...p.request,auth:h}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),w=await new gs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,g,new ll,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(v,qN(t.variables)),E=null,k=null;if(s||i){let $=new pl(e.config),j=`request-${_N(l.id)}-${_N(c)}`,G=`Request: ${p.request.name}`,q=await $.initializeRun(j,G,g,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await $.saveResult(1,w),E=await $.finalizeRun("completed",s),i)try{k=await new cl($.getBasePath()).generate(j,q)}catch(C){console.warn("[direct-execution] JUnit report generation failed:",C)}}let T=xN(w.response?.headers),N=EN(w.response?.cookies);return{request:p.request.name,status:w.response?.status||0,ok:(w.response?.status??0)>=200&&(w.response?.status??0)<300,duration:`${w.duration}ms`,body:Nx(w.response?.body),allPassed:w.passed,assertions:w.assertions?.map($=>({name:$.name,passed:$.passed,message:$.message})),...r.includes("headers")?{headers:T}:{},...r.includes("cookies")?{cookies:N}:{},...r.includes("tests")?{tests:w.assertions?.map($=>({name:$.name,passed:$.passed,...$.message?{message:$.message}:{}}))}:{},...Object.keys(w.modifiedVariables??{}).length?{modifiedVariables:w.modifiedVariables}:{},...r.includes("consoleOutput")&&w.consoleOutput?.length?{consoleOutput:w.consoleOutput}:{},...E!==null?{report:{uri:`file://${E}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...k!==null?{junitReport:{path:k}}:{},...w.error?{error:w.error}:{}}}catch(o){throw o}finally{Mx(e)}}async function qs(t){let e=hn(t.workspaceFolder);try{let r=e.collection,n=TN(r,t),i=AN(n,t),s=PN(n),o=A5(s,i,t.recursive);if(o.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=o.map(({request:c,folderPath:p})=>({id:c.id,slug:c.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:c.id,name:c.name,method:c.method,collectionName:n.name,folderPath:p,enabled:!0})),f={id:i?`temp-${n.id}-${$5(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return $N(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"collection")}catch(r){throw r}finally{Mx(e)}}async function N5(t){return qs({recursive:!0,...t})}async function qp(t){let e=hn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return $N(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"suite")}catch(r){throw r}finally{Mx(e)}}var Tc=se(()=>{"use strict";xx();eg();pd();Ix();Px();gi();dv();$x()});var LN={};us(LN,{createMcpRuntime:()=>G5});async function yi(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 Ac(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function D5(t,e){let r=jx.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=Dx.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(c,p)=>!!c?.length&&(c.includes(p.id)||c.includes(p.name)),l=e.collection.getAllCollections().filter(c=>!o(s.excludedCollections,c)),f=(await e.testSuite.getAllSuites()).filter(c=>!o(s.excludedSuites,c));return ov(l,f,s)})().then(s=>(jx.set(t,{tools:s,expiresAt:Date.now()+F5}),s)).finally(()=>Dx.delete(t));return Dx.set(t,i),i}function L5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function j5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function NN(t,e,r,n){hl(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function U5(t){return t.config.getMcpConfig().toolPageSize??200}async function H5(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{},prompts:{}},serverInfo:{name:"http-forge",version:"1.0.0"},instructions:"You are assisting with HTTP API testing via HTTP Forge. When a run_suite, run_collection, or run_folder call completes with failures (summary.failed > 0 or allPassed === false), automatically analyze the 'failedRequests' in the response and provide: (1) root cause for each failure, (2) specific fix recommendations, (3) updated pm.test() assertion scripts where relevant. Do not wait for the user to ask \u2014 proactively diagnose and suggest fixes. For async runs (status: 'running'), poll with get_run_status until complete, then call get_run_summary. When get_run_summary returns a _nextStep field you MUST execute it immediately \u2014 the failedRequests array is already included inline so no extra tool call is needed. Analyze the failures and provide diagnosis without waiting for the user."};case"tools/list":{let r=await D5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=U5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=sv(i),l=r.slice(o,o+s),f=o+s,c={tools:l};return f<r.length&&(c.nextCursor=iv(f)),c}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Ux(t,n,i??{}),o=s,l=o?.summary;l&&((l.failed??0)>0||l.allPassed===!1)&&(o._nextStep=`${l.failed??"Some"} request(s) failed. Please analyze the 'failedRequests' above: identify the root cause of each failure, suggest specific fixes (URL, auth, body, environment variables), and provide updated pm.test() assertion scripts where the assertions are incorrect.`);let f=JSON.stringify(s,null,2),c=j5(f,t.host,t.port),p=c.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),h=p?`
|
|
1017
1017
|
|
|
1018
|
-
[View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:c+h}]}}case"prompts/list":return{prompts:xp};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=hn(t.workspaceFolder);try{return await Vy(n,i,s.collection,t.runStore)}finally{Ac(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function B5(t,e,r){let n=!t.container,i=t.container??hn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&Ac(i)}let o=e.headers.origin??"",l=s.includes(o)?o:s[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",l),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function V5(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=ml.resolve(i),o=t.container?.config.getResultsPath(),l=o?ml.dirname(o):ml.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(l+ml.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}FN.readFile(s,"utf-8",(f,c)=>{if(f){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(c)})}function Lx(t,e,r,n){let i=t.create(e,r);return n().then(s=>{i.status!=="cancelled"&&(i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),s?.noAssertionExamples&&(i.noAssertionExamples=s.noAssertionExamples),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total)}).catch(s=>{i.status!=="cancelled"&&(i.status="failed",i.completedAt=Date.now(),i.error=s.message)}),{runId:i.id,status:"running",total:r,message:"Run started. Use get_run_status to poll."}}function W5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return yi(()=>gv({workspaceFolder:e,collectionId:r.id,requestId:n,environment:i.environment,variables:i.variables,headers:i.headers,query:i.query,body:i.body,include:i.include}))},async runFolder(r,n,i){let s=Ke(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?Lx(t.runStore,`${r.name} / ${Ui(n)}`,s,()=>yi(()=>Os({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))):yi(()=>Os({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))},async runCollection(r,n){let i=Ke(r).length;return n.async===!0?Lx(t.runStore,r.name,i,()=>yi(()=>Os({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):yi(()=>Os({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))},async runSuite(r,n,i){let s=hn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.requests.length??0)*(i.iterations??l?.config?.iterations??1)}finally{Ac(s)}return i.async===!0?Lx(t.runStore,n,o,()=>yi(()=>Op({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))):yi(()=>Op({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))}}}async function Ux(t,e,r={}){let n=t.workspaceFolder,i=L5(t.container,e);if(Object.values(J).includes(i)){let l=hn(n);try{let f=await By(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,W5(t));return z5.has(i)&&jx.delete(n),f}finally{Ac(l)}}let s=Ky(i),o=hn(n);try{let l=o.collection.getAllCollections(),f=l.map(v=>v.id),c=v=>{let _=al(v,f),w=_?l.find(E=>E.id===_):void 0;if(!w)throw new Error(`Collection not found for tool: ${e}`);return w};if(s.kind==="request"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed request tool: ${e}`);let w=c(v),E=Ke(w).map(T=>T.request.id),k=al(_,E);if(!k)throw new Error(`Request not found in collection "${w.name}" for tool: ${e}`);return yi(()=>gv({workspaceFolder:n,collectionId:w.id,requestId:k,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[v]=s.tokens;if(!v)throw new Error(`Malformed collection tool: ${e}`);let _=c(v);return yi(()=>Os({workspaceFolder:n,collectionId:_.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed folder tool: ${e}`);let w=c(v),E=(o.collection.getAllCollections().find(N=>N.id===w.id),void 0),k=Ke(w).map(N=>N.folderPath).filter((N,$,j)=>N&&j.indexOf(N)===$),T=Qy(_,k);if(!T)throw new Error(`Folder not found in collection "${w.name}" for tool: ${e}`);return yi(()=>Os({workspaceFolder:n,collectionId:w.id,folderPath:T,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[p]=s.tokens;if(!p)throw new Error(`Malformed suite tool: ${e}`);let h=await o.testSuite.getAllSuites(),g=al(p,h.map(v=>v.id));if(!g)throw new Error(`Test suite not found for tool: ${e}`);return yi(()=>Op({workspaceFolder:n,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{Ac(o)}}function hl(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function MN(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(new Error("Invalid JSON body"))}}),t.on("error",r)})}function J5(t){return(0,DN.createServer)(async(e,r)=>{try{if(B5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){hl(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){V5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await MN(e)}catch{NN(r,null,-32700,"Parse error");return}try{let i=await H5(t,n);hl(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){NN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await MN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){hl(r,400,{error:'Field "name" is required'});return}let i=await Ux(t,n.name,n.args??{});hl(r,200,{result:i});return}hl(r,405,{error:"Method not allowed"})}catch(n){hl(r,500,{error:n.message})}})}async function G5(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,runStore:new Ec};return M5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=hn(i.workspaceFolder));let s=J5(i);await new Promise((o,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),o()})}),i.server=s,i.isRunning=!0},async stop(){if(i.container&&(Ac(i.container),i.container=void 0),!i.server){i.isRunning=!1;return}await new Promise((s,o)=>{i.server.close(l=>{if(l){o(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,o){return Ux(i,s,o??{})}}}var FN,DN,ml,M5,F5,jx,Dx,z5,jN=se(()=>{"use strict";FN=me(require("fs")),DN=require("http"),ml=me(require("path"));Tc();gi();wx();_x();Rx();Cx();rv();_p();dv();M5=new Map;F5=3e3,jx=new Map,Dx=new Map;z5=Hy});var v7={};us(v7,{AmbiguousRefError:()=>Do,AwsSecretResolver:()=>ap,AzureKeyVaultResolver:()=>lp,BODY_FILE_MAP:()=>FS,CACHE_BUSTING_TOOLS:()=>Hy,COLLECTION_INPUT_SCHEMA:()=>bp,CONFIG_FILES:()=>Da,CollectionLoader:()=>ya,CollectionLoaderFactory:()=>Vu,CollectionRequestExecutor:()=>gs,CollectionService:()=>Wu,ConfigService:()=>La,CookieJar:()=>cu,CookieService:()=>zu,CookieUtils:()=>dt,DEFAULT_CONFIG:()=>Bt,DEFAULT_REQUEST_SETTINGS:()=>qn,DEFAULT_SUITE_CONFIG:()=>Cc,DYNAMIC_VARIABLES:()=>GS,DataFileParser:()=>mo,DopplerResolver:()=>dp,EnvironmentConfigService:()=>Gu,EnvironmentResolver:()=>qi,ExampleGenerator:()=>Ya,FOLDER_INPUT_SCHEMA:()=>Sp,FetchHttpClient:()=>Du,FolderCollectionLoader:()=>lu,FolderCollectionStore:()=>cs,ForgeContainer:()=>Zm,ForgeEnv:()=>fs,GENERIC_TOOL_NAMES:()=>J,GcpSecretResolver:()=>fp,GraphQLSchemaService:()=>Ku,HTTP_METHOD_MAP:()=>av,HTTP_METHOD_REVERSE:()=>qs,HashiCorpVaultResolver:()=>up,HistoryAnalyzer:()=>Ua,HtmlReportGenerator:()=>Pc,HttpForgeParser:()=>ho,HttpRequestService:()=>ki,InMemoryCookieJar:()=>ll,InterceptorChain:()=>Pi,JUnitReportGenerator:()=>cl,JsonCollectionLoader:()=>Fa,LoggingRequestInterceptor:()=>lm,MCP_PROMPTS:()=>xp,METADATA_FILES:()=>pr,McpRunStore:()=>Ec,ModuleLoader:()=>rd,NodeFileSystem:()=>Lu,NodeHttpClient:()=>io,OAuth2TokenManager:()=>Hu,OnePasswordResolver:()=>cp,OpenApiExporter:()=>Ga,OpenApiImporter:()=>Es,ParserRegistry:()=>uu,PersistentCookieJar:()=>Ju,REQUEST_INPUT_SCHEMA:()=>vp,ROOT_DIRECTORIES:()=>yo,RefResolver:()=>nl,RequestExecutor:()=>$a,RequestHistoryService:()=>Qu,RequestHistoryStore:()=>Fu,RequestPreparer:()=>Yu,RequestPreprocessor:()=>po,RequestScriptSession:()=>Mu,ResultStorageService:()=>pl,RetryErrorInterceptor:()=>cm,SCHEMA_FILES:()=>au,SCRIPTS_DIR:()=>Hr,SCRIPT_FILES:()=>yf,SUITE_INPUT_SCHEMA:()=>wp,SchemaInferenceService:()=>il,SchemaInferrer:()=>bs,ScriptAnalyzer:()=>sl,ScriptExecutor:()=>Ni,SecretResolverRegistry:()=>Rc,ServiceContainer:()=>No,ServiceIdentifiers:()=>ne,StatisticsService:()=>bv,TestSuiteService:()=>xc,TestSuiteStore:()=>Sv,TimingResponseInterceptor:()=>um,UrlBuilder:()=>In,VariableInterpolator:()=>no,VariableResolver:()=>ro,applyEnvSuggestionsToItems:()=>jy,applyExtractionPlan:()=>xk,applyFilterChain:()=>mu,augmentWithDynamicVars:()=>Xs,bootstrapNodeRuntime:()=>Ax,buildCollectionToolDescription:()=>Xy,buildCollectionToolName:()=>Jy,buildExtractionPlan:()=>Ck,buildFolderToolDescription:()=>ev,buildFolderToolName:()=>Gy,buildGenericTools:()=>Uy,buildMcpToolList:()=>ov,buildPromptResult:()=>Vy,buildRequestToolDescription:()=>Zy,buildRequestToolName:()=>zy,buildResultFileName:()=>ul,buildSuiteToolDescription:()=>tv,buildSuiteToolName:()=>Yy,cleanupOldBodyFiles:()=>jS,concatenateScripts:()=>sd,countRequests:()=>Dy,createExpectChain:()=>$u,createLodashShim:()=>F0,createMcpRuntime:()=>UN,createModuleLoader:()=>Wm,createMomentShim:()=>nd,createNodeContainer:()=>hn,createResponseObject:()=>id,createScriptConsole:()=>dk,createTestFunction:()=>Jm,createVariableResolver:()=>EI,decodeCursor:()=>sv,decodeFolderName:()=>px,decodeFolderPath:()=>Ui,dedupeToolsByName:()=>nv,deepClone:()=>dI,deleteItemFromTree:()=>Yh,detectEnvSuggestions:()=>yp,detectSensitiveData:()=>Rk,dispatchGenericTool:()=>By,encodeCursor:()=>iv,encodeFolderName:()=>ur,enhanceCollection:()=>YN,enumerateFolders:()=>Ar,evaluateExpression:()=>to,expandSummary:()=>mN,exportCollectionToRestClient:()=>vk,findItemById:()=>Gh,flattenRequests:()=>Ke,formatBytes:()=>mI,formatConsoleOutput:()=>Aa,formatDuration:()=>gI,generateId:()=>vt,generateSlug:()=>cn,generateUUID:()=>Jh,getCompletions:()=>tM,getRestClientExportFolder:()=>yk,getServiceContainer:()=>yx,hasChanged:()=>Nu,isExpression:()=>eo,isPlainObject:()=>pI,isSystemEnvironmentFile:()=>Sf,loadEnvironmentsFromFolder:()=>fu,mcpToolSegment:()=>Fo,mcpToolToken:()=>Vi,mergeHeadersCaseInsensitive:()=>ou,mergeRequestSettings:()=>am,normalizeFolderInput:()=>pp,normalizeHeaders:()=>Gm,parseCurlCommand:()=>GN,parseFilterChain:()=>hu,parseMcpToolName:()=>Ky,parsePostmanEnvironment:()=>ud,parsePostmanEnvironmentFile:()=>wk,parseQueryContext:()=>eM,prepareBodyForSave:()=>LS,readBodyFromDir:()=>DS,readSchemaFile:()=>US,readScriptsFromDir:()=>vf,redactBody:()=>ng,redactFullResponse:()=>sg,redactFullResultDetails:()=>og,redactHeaders:()=>ii,redactHistoryEntry:()=>ig,redactUrl:()=>dd,registerCoreServices:()=>hp,resolveCollectionRef:()=>pv,resolveDynamicVariable:()=>Oi,resolveDynamicVariablesInString:()=>CI,resolveFolderRef:()=>hv,resolveFolderToken:()=>Qy,resolveRequestRef:()=>mv,resolveToken:()=>al,runCollection:()=>BN,runFolder:()=>VN,runRequest:()=>HN,runSuite:()=>WN,safeJsonParse:()=>hI,sanitizeName:()=>Tt,scanCollectionForEnvVarsWithAi:()=>QN,searchForItemPath:()=>Kh,searchForItemPathById:()=>Qh,sortItemsByOrder:()=>BS,writeEnvFile:()=>Ma,writeFolderItems:()=>ld,writeSchemaFiles:()=>HS,writeScriptFile:()=>Bu,writeScriptsToDir:()=>bf});module.exports=ga(v7);var ya=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 o=await this.load(s);n.push(o)}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()}};Zh();va();function VS(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(yI),source:{format:"folder",filePath:e,version:t.version}}}function yI(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(yI)};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 o2(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(WS)}}function WS(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(WS)}:{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 lu=class{store;constructor(e){this.store=new cs(e)}loadAll(){return this.store.loadAll().map(r=>VS(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 VS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return VS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(o2(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,WS(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 uu=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()}};ba();var cu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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)}};em();var qi=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 o=this.getEnvironmentVariables(n.inherits);i={...i,...o}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};du();_f();var fs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new no,this.urlBuilder=new In}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=qi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};_f();xf();Ef();du();ad();od();var $a=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 o=s?.forgeRoot?[require("path").join(s.forgeRoot,"modules")]:[],l=new ki(new In,new Pi,e);this.scriptExecutor=new Ni(l,o,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},o={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},c=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),v={request:{url:c.url,method:c.method,headers:{...c.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(k,T,N)=>{k==="set"&&T&&N!==void 0?this.forgeEnv.setGlobal(T,N):k==="unset"&&T?this.forgeEnv.unsetGlobal(T):k==="clear"&&this.forgeEnv.clearGlobals()}},_=this.scriptExecutor.createRequestSession(v),w,E;try{if(!n.skipPreRequest&&g.preRequest.length>0){let $=await _.executePreRequest(g.preRequest);if(w={success:$.success,error:$.error,modifiedVariables:$.modifiedVariables,modifiedEnvironment:$.modifiedEnvironmentVariables,modifiedGlobals:$.modifiedGlobals,modifiedCollectionVariables:$.modifiedCollectionVariables,consoleOutput:$.consoleOutput,modifiedRequest:$.modifiedRequest?{url:$.modifiedRequest.url,method:$.modifiedRequest.method,headers:$.modifiedRequest.headers,body:$.modifiedRequest.body?.content}:void 0},$.modifiedVariables&&(l={...l,...$.localVariables??$.modifiedVariables}),$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables}),$.modifiedRequest){let j=$.modifiedRequest;j.url&&(c.url=j.url),j.method&&(c.method=j.method),j.headers&&(c.headers={...c.headers,...j.headers}),j.body!==void 0&&(c.body=j.body?.content||j.body)}if(!$.success)throw new Error(`Pre-request script failed: ${$.error}`)}let k={...f,...l};c=this.interpolateRequest(c,k);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&c.body!==void 0){let $=this.preprocessor.encodeBody({type:"graphql",content:c.body});$!=null&&(c.body=typeof $=="string"?$:JSON.stringify($))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(c.body)){let $=this.buildMultipartFormData({type:"form-data",content:c.body});$&&(c.body=$)}let N=await this.httpClient.send(c);if(!n.skipPostResponse&&g.postResponse.length>0){let $=await _.executePostResponse(g.postResponse,{status:N.status,statusText:N.statusText,headers:N.headers,body:N.body,cookies:Ym(N.headers,N.cookies,c.url),responseTime:N.time,responseSize:N.size,executedRequest:{url:c.url,method:c.method,headers:c.headers||{},body:c.body?typeof c.body=="string"?{type:"raw",content:c.body}:c.body:{type:"none",content:""},params:{},query:{}}});E={success:!0,assertions:$.testResults,consoleOutput:$.consoleOutput,modifiedEnvironment:$.modifiedEnvironmentVariables},$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables})}return{response:N,preRequestResult:w,postResponseResult:E,totalTime:Date.now()-i,finalRequest:c,variables:{environment:f,local:l}}}finally{_.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 p=new URLSearchParams;for(let h of e.query)h.enabled!==!1&&p.append(h.key,h.value);n+=(n.includes("?")?"&":"?")+p.toString()}let i=r?.url||n,s=r?.method||e.method,o={};if(e.headers&&Array.isArray(e.headers))for(let p of e.headers)p.enabled!==!1&&(o[p.key]=p.value);let l={...o,...r?.headers||{}},f,c=r?.body||e.body;if(c)if(typeof c=="string")f=c;else if(this.preprocessor&&c.type)if(c.type==="graphql")f=typeof c.content=="string"?c.content:JSON.stringify(c.content);else if(c.type==="form-data")f=this.buildMultipartFormData(c);else{let p=this.preprocessor.encodeBody(c);f=p!=null?String(p):void 0}else c.content&&(f=typeof c.content=="string"?c.content:JSON.stringify(c.content));return this.preprocessor&&c&&c.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,c),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=fs.create(r),i=e.body,s=i;return typeof i=="string"?s=n.resolve(i):i instanceof FormData||i instanceof URLSearchParams?s=i:i&&typeof i=="object"&&(s=n.resolve(i)),{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:s}}buildMultipartFormData(e){if(!e||e.type!=="form-data"||!Array.isArray(e.content))return;let r=new FormData;for(let n of e.content)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}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 o of n)o.scripts?.preRequest&&i.push(o.scripts.preRequest),o.scripts?.postResponse&&s.push(o.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,o)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...o),!0;if(l.type==="folder"){let f=[...o,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function Oz(){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 Fu=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 o=this.entries.get(s);o&&(!r||o.environment===r)&&i.push(o)}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 o=Oz(),l=Date.now(),f={id:o,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(o,f);let c=this.requestIndex.get(e)||[];for(c.unshift(o);c.length>this.maxEntriesPerRequest;){let p=c.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,c),this.storeFullResponses){let p={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(o,p)}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 Du=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let o={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?o.body=e.body:typeof e.body=="object"&&(o.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(o.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(o.redirect="manual");let l=await fetch(e.url,o),f=Date.now(),c;try{c=await l.text()}catch{c=null}let p={};return l.headers.forEach((h,g)=>{let v=p[g];v!==void 0?p[g]=Array.isArray(v)?[...v,h]:[v,h]:p[g]=h}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:c,time:f-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};xf();Ef();Cf();Km();du();var ho=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}}};Qm();var fn=me(require("fs/promises")),ju=me(require("path")),Lu=class{async readFile(e){return fn.readFile(e,"utf-8")}async writeFile(e,r){let n=ju.dirname(e);await this.mkdir(n),await fn.writeFile(e,r,"utf-8")}async exists(e){try{return await fn.access(e),!0}catch{return!1}}async mkdir(e){await fn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=ju.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return fn.readdir(e)}async isDirectory(e){try{return(await fn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await fn.readdir(e,{withFileTypes:!0});for(let i of n){let s=ju.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)}};ad();var Zm=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 no,this.fileSystem=e.fileSystem||new Lu,this.preprocessor=e.preprocessor||new po,this.dataFileParser=e.dataFileParser||new mo,this.cookieJar=e.cookieJar||new cu,e.enableHistory?this.requestHistory=e.requestHistory||new Fu({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 io(s)}else this.httpClient=new Du;let r=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new ki(new In,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Ni(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new uu,this.parserRegistry.register("http-forge",new ho),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new lu(s)}else this.collectionLoader=new ya(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new qi(e.environmentConfig):qi.fromVariables({}),this.forgeEnv=fs.fromResolver(this.environmentStore),this.requestExecutor=new $a(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Pi;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 ya)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 qi(e),this.forgeEnv=fs.fromResolver(this.environmentStore),this.requestExecutor=new $a(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=require("path"),i=n.join(e,"environments"),s,o=fu(i);if(Object.keys(o.environments).length>0||Object.keys(o.globalVariables).length>0){s={globalVariables:{...o.globalVariables,...o.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,c]of Object.entries(o.environments)){let p=o.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...c.variables,...p}}}}else{let f=require("fs"),c=n.join(i,"environments.json");if(f.existsSync(c))try{let p=f.readFileSync(c,"utf-8"),h=JSON.parse(p);if(s={globalVariables:h.globalVariables||{},environments:{},selectedEnvironment:h.selectedEnvironment},h.environments)for(let[g,v]of Object.entries(h.environments)){let _=v;s.environments[g]={name:_.name||g,variables:_.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${c}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};gx();vx();Ly();gi();wx();_x();Rx();Cx();rv();_p();async function UN(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(jN(),LN));return e(t)}async function HN(t){let{runRequest:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}async function BN(t){let{runCollection:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}async function VN(t){let{runFolder:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}async function WN(t){let{runSuite:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}dv();Z0();ba();xx();X0();xf();Ef();KS();Cf();Km();du();D0();U0();ad();zm();od();pd();J0();Y0();Zh();va();va();z0();function Y5(t){let e=t.replace(/\\\n/g," "),r=[],n="",i=0;for(;i<e.length;){let s=e[i];if(s==="\\"&&i+1<e.length)n+=e[++i],i++;else if(s==="'"){for(i++;i<e.length&&e[i]!=="'";)n+=e[i++];i++}else if(s==='"'){for(i++;i<e.length&&e[i]!=='"';)if(e[i]==="\\"&&i+1<e.length){let o=e[i+1];o==='"'||o==="\\"||o==="$"||o==="`"?(n+=o,i+=2):n+=e[i++]}else n+=e[i++];i++}else/\s/.test(s)?(n.length>0&&(r.push(n),n=""),i++):(n+=s,i++)}return n.length>0&&r.push(n),r}function K5(t){try{let e="__FV__",r=[],n=t.replace(/\{\{[^}]+\}\}/g,p=>(r.push(p),`${e}${r.length-1}`)),i=n.indexOf("?");if(i===-1)return{cleanUrl:t,params:[]};let s=n.slice(0,i),o=n.slice(i+1),l=p=>p.replace(new RegExp(`${e}(\\d+)`,"g"),(h,g)=>r[parseInt(g,10)]),f=l(s),c=o.split("&").filter(Boolean).map(p=>{let h=l(p),g=h.indexOf("=");return g===-1?{key:h,value:"",enabled:!0}:{key:decodeURIComponent(h.slice(0,g)),value:decodeURIComponent(h.slice(g+1)),enabled:!0}});return{cleanUrl:f,params:c}}catch{return{cleanUrl:t,params:[]}}}function Q5(t){try{let e=new URL(t.replace(/\{\{[^}]+\}\}/g,"placeholder")),r=e.pathname.split("/").filter(Boolean),n=r[r.length-1];return n&&!/^\d+$/.test(n)&&!n.startsWith("{")?n.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):r.length>1?r[r.length-2].replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):e.hostname.replace(/^www\./,"").split(".")[0]??"Request"}catch{return"Request"}}var Z5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),X5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function zN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function JN(t){return/\{\{[^}]+\}\}/.test(t)}function yv(t,e=16){return t.length>=e&&!JN(t)}function e7(t,e,r){let n=[],i=new Set,s=(o,l)=>{i.has(l)||(i.add(l),n.push({key:o,value:l}))};for(let o of t){let l=o.key.toLowerCase();if(l==="authorization"){let f=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&yv(f[2])?s(`${f[1].toUpperCase()}_TOKEN`,f[2]):yv(o.value)&&s("AUTH_TOKEN",o.value)}else Z5.has(l)&&yv(o.value)&&s(zN(o.key),o.value)}for(let o of e)X5.has(o.key.toLowerCase())&&yv(o.value)&&s(zN(o.key),o.value);try{let o=new URL(r.replace(/\{\{[^}]+\}\}/g,"placeholder"));if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)&&!JN(r)){let f=`${o.protocol}//${o.host}`;s("BASE_URL",f)}}catch{}return n}function GN(t){let e=Y5(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,f=!1,c=!1,p=[],h=[],g=0;for(;g<n.length;){let T=n[g];if(T==="-X"||T==="--request")i=n[++g]??"";else if(T==="-H"||T==="--header"){let N=n[++g]??"",$=N.indexOf(":");$>0&&o.push({key:N.slice(0,$).trim(),value:N.slice($+1).trim()})}else if(T==="-d"||T==="--data"||T==="--data-raw"||T==="--data-binary"||T==="--data-ascii")l=n[++g]??"";else if(T==="--json")l=n[++g]??"",f=!0;else if(T==="-u"||T==="--user"){let N=n[++g]??"",$=btoa(N);o.push({key:"Authorization",value:`Basic ${$}`})}else if(T==="-b"||T==="--cookie")o.push({key:"Cookie",value:n[++g]??""});else if(T==="--url")s=n[++g]??"";else if(T==="-G"||T==="--get")c=!0;else if(T==="-F"||T==="--form"){let N=n[++g]??"",$=N.indexOf("=");$>0&&p.push({key:N.slice(0,$),value:N.slice($+1)})}else T==="--data-urlencode"?h.push(n[++g]??""):T==="-A"||T==="--user-agent"?o.push({key:"User-Agent",value:n[++g]??""}):T==="-e"||T==="--referer"||T==="--referrer"?o.push({key:"Referer",value:n[++g]??""}):T==="--compressed"||T==="-L"||T==="--location"||T==="-v"||T==="--verbose"||T==="-s"||T==="--silent"||T==="-i"||T==="--include"||T==="-k"||T==="--insecure"||T==="--http1.1"||T==="--http2"||T==="--http3"||(T==="-o"||T==="--output"||T==="--max-time"||T==="--connect-timeout"||T==="-m"||T==="--limit-rate"||T==="--proxy"||T==="-x"?g++:!T.startsWith("-")&&!s&&(s=T));g++}c?i="GET":i||(i=l!==null||p.length>0||h.length>0?"POST":"GET");let{cleanUrl:v,params:_}=K5(s),w=null;if(p.length>0)w={type:"raw",format:"text",content:p.map(N=>`${encodeURIComponent(N.key)}=${encodeURIComponent(N.value)}`).join("&")},o.some(N=>N.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(h.length>0)w={type:"raw",format:"text",content:h.join("&")},o.some(T=>T.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let T=l.trim(),N=f||T.startsWith("{")||T.startsWith("[");w={type:"raw",format:N?"json":"text",content:l},N&&!o.some($=>$.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let E=o.map(T=>({...T,enabled:!0})),k=e7(o,_,v||s);return{name:Q5(v||s),method:i.toUpperCase(),url:v||s,headers:E,queryParams:_,body:w,suggestedVars:k}}async function YN(t,e,r,n){let i=KN(t.items);if(i.length===0)return;let s=Math.ceil(i.length/10);for(let o=0;o<i.length;o+=10){let l=i.slice(o,o+10),f=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${f}/${s})\u2026`,1/s*100);let c=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:i7(p),responseSchema:p.responseSchema?JSON.stringify(p.responseSchema).slice(0,500):void 0,description:p.description?.slice(0,200)}));try{let p=await r.complete(t7(c)),h=r7(p);n7(l,h)}catch{}}await e.saveCollection(t)}function t7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
|
|
1018
|
+
[View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:c+h}]}}case"prompts/list":return{prompts:xp};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=hn(t.workspaceFolder);try{return await Vy(n,i,s.collection,t.runStore)}finally{Ac(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function B5(t,e,r){let n=!t.container,i=t.container??hn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&Ac(i)}let o=e.headers.origin??"",l=s.includes(o)?o:s[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",l),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function V5(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=ml.resolve(i),o=t.container?.config.getResultsPath(),l=o?ml.dirname(o):ml.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(l+ml.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}FN.readFile(s,"utf-8",(f,c)=>{if(f){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(c)})}function Lx(t,e,r,n){let i=t.create(e,r);return n().then(s=>{i.status!=="cancelled"&&(i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),s?.noAssertionExamples&&(i.noAssertionExamples=s.noAssertionExamples),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total)}).catch(s=>{i.status!=="cancelled"&&(i.status="failed",i.completedAt=Date.now(),i.error=s.message)}),{runId:i.id,status:"running",total:r,message:"Run started. Use get_run_status to poll."}}function W5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return yi(()=>gv({workspaceFolder:e,collectionId:r.id,requestId:n,environment:i.environment,variables:i.variables,headers:i.headers,query:i.query,body:i.body,include:i.include}))},async runFolder(r,n,i){let s=Ke(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?Lx(t.runStore,`${r.name} / ${Ui(n)}`,s,()=>yi(()=>qs({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))):yi(()=>qs({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))},async runCollection(r,n){let i=Ke(r).length;return n.async===!0?Lx(t.runStore,r.name,i,()=>yi(()=>qs({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):yi(()=>qs({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))},async runSuite(r,n,i){let s=hn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.requests.length??0)*(i.iterations??l?.config?.iterations??1)}finally{Ac(s)}return i.async===!0?Lx(t.runStore,n,o,()=>yi(()=>qp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))):yi(()=>qp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))}}}async function Ux(t,e,r={}){let n=t.workspaceFolder,i=L5(t.container,e);if(Object.values(J).includes(i)){let l=hn(n);try{let f=await By(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,W5(t));return z5.has(i)&&jx.delete(n),f}finally{Ac(l)}}let s=Ky(i),o=hn(n);try{let l=o.collection.getAllCollections(),f=l.map(v=>v.id),c=v=>{let _=al(v,f),w=_?l.find(E=>E.id===_):void 0;if(!w)throw new Error(`Collection not found for tool: ${e}`);return w};if(s.kind==="request"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed request tool: ${e}`);let w=c(v),E=Ke(w).map(T=>T.request.id),k=al(_,E);if(!k)throw new Error(`Request not found in collection "${w.name}" for tool: ${e}`);return yi(()=>gv({workspaceFolder:n,collectionId:w.id,requestId:k,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[v]=s.tokens;if(!v)throw new Error(`Malformed collection tool: ${e}`);let _=c(v);return yi(()=>qs({workspaceFolder:n,collectionId:_.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed folder tool: ${e}`);let w=c(v),E=(o.collection.getAllCollections().find(N=>N.id===w.id),void 0),k=Ke(w).map(N=>N.folderPath).filter((N,$,j)=>N&&j.indexOf(N)===$),T=Qy(_,k);if(!T)throw new Error(`Folder not found in collection "${w.name}" for tool: ${e}`);return yi(()=>qs({workspaceFolder:n,collectionId:w.id,folderPath:T,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[p]=s.tokens;if(!p)throw new Error(`Malformed suite tool: ${e}`);let h=await o.testSuite.getAllSuites(),g=al(p,h.map(v=>v.id));if(!g)throw new Error(`Test suite not found for tool: ${e}`);return yi(()=>qp({workspaceFolder:n,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{Ac(o)}}function hl(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function MN(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(new Error("Invalid JSON body"))}}),t.on("error",r)})}function J5(t){return(0,DN.createServer)(async(e,r)=>{try{if(B5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){hl(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){V5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await MN(e)}catch{NN(r,null,-32700,"Parse error");return}try{let i=await H5(t,n);hl(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){NN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await MN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){hl(r,400,{error:'Field "name" is required'});return}let i=await Ux(t,n.name,n.args??{});hl(r,200,{result:i});return}hl(r,405,{error:"Method not allowed"})}catch(n){hl(r,500,{error:n.message})}})}async function G5(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,runStore:new Ec};return M5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=hn(i.workspaceFolder));let s=J5(i);await new Promise((o,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),o()})}),i.server=s,i.isRunning=!0},async stop(){if(i.container&&(Ac(i.container),i.container=void 0),!i.server){i.isRunning=!1;return}await new Promise((s,o)=>{i.server.close(l=>{if(l){o(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,o){return Ux(i,s,o??{})}}}var FN,DN,ml,M5,F5,jx,Dx,z5,jN=se(()=>{"use strict";FN=me(require("fs")),DN=require("http"),ml=me(require("path"));Tc();gi();wx();_x();Rx();Cx();rv();_p();dv();M5=new Map;F5=3e3,jx=new Map,Dx=new Map;z5=Hy});var v7={};us(v7,{AmbiguousRefError:()=>Do,AwsSecretResolver:()=>ap,AzureKeyVaultResolver:()=>lp,BODY_FILE_MAP:()=>FS,CACHE_BUSTING_TOOLS:()=>Hy,COLLECTION_INPUT_SCHEMA:()=>bp,CONFIG_FILES:()=>Da,CollectionLoader:()=>ya,CollectionLoaderFactory:()=>Vu,CollectionRequestExecutor:()=>gs,CollectionService:()=>Wu,ConfigService:()=>La,CookieJar:()=>cu,CookieService:()=>zu,CookieUtils:()=>dt,DEFAULT_CONFIG:()=>Bt,DEFAULT_REQUEST_SETTINGS:()=>On,DEFAULT_SUITE_CONFIG:()=>Cc,DYNAMIC_VARIABLES:()=>GS,DataFileParser:()=>mo,DopplerResolver:()=>dp,EnvironmentConfigService:()=>Gu,EnvironmentResolver:()=>Oi,ExampleGenerator:()=>Ya,FOLDER_INPUT_SCHEMA:()=>Sp,FetchHttpClient:()=>Du,FolderCollectionLoader:()=>lu,FolderCollectionStore:()=>cs,ForgeContainer:()=>Zm,ForgeEnv:()=>fs,GENERIC_TOOL_NAMES:()=>J,GcpSecretResolver:()=>fp,GraphQLSchemaService:()=>Ku,HTTP_METHOD_MAP:()=>av,HTTP_METHOD_REVERSE:()=>Os,HashiCorpVaultResolver:()=>up,HistoryAnalyzer:()=>Ua,HtmlReportGenerator:()=>Pc,HttpForgeParser:()=>ho,HttpRequestService:()=>ki,InMemoryCookieJar:()=>ll,InterceptorChain:()=>Pi,JUnitReportGenerator:()=>cl,JsonCollectionLoader:()=>Fa,LoggingRequestInterceptor:()=>lm,MCP_PROMPTS:()=>xp,METADATA_FILES:()=>pr,McpRunStore:()=>Ec,ModuleLoader:()=>rd,NodeFileSystem:()=>Lu,NodeHttpClient:()=>io,OAuth2TokenManager:()=>Hu,OnePasswordResolver:()=>cp,OpenApiExporter:()=>Ga,OpenApiImporter:()=>Es,ParserRegistry:()=>uu,PersistentCookieJar:()=>Ju,REQUEST_INPUT_SCHEMA:()=>vp,ROOT_DIRECTORIES:()=>yo,RefResolver:()=>nl,RequestExecutor:()=>$a,RequestHistoryService:()=>Qu,RequestHistoryStore:()=>Fu,RequestPreparer:()=>Yu,RequestPreprocessor:()=>po,RequestScriptSession:()=>Mu,ResultStorageService:()=>pl,RetryErrorInterceptor:()=>cm,SCHEMA_FILES:()=>au,SCRIPTS_DIR:()=>Hr,SCRIPT_FILES:()=>yf,SUITE_INPUT_SCHEMA:()=>wp,SchemaInferenceService:()=>il,SchemaInferrer:()=>bs,ScriptAnalyzer:()=>sl,ScriptExecutor:()=>Ni,SecretResolverRegistry:()=>Rc,ServiceContainer:()=>No,ServiceIdentifiers:()=>ne,StatisticsService:()=>bv,TestSuiteService:()=>xc,TestSuiteStore:()=>Sv,TimingResponseInterceptor:()=>um,UrlBuilder:()=>In,VariableInterpolator:()=>no,VariableResolver:()=>ro,applyEnvSuggestionsToItems:()=>jy,applyExtractionPlan:()=>xk,applyFilterChain:()=>mu,augmentWithDynamicVars:()=>Xs,bootstrapNodeRuntime:()=>Ax,buildCollectionToolDescription:()=>Xy,buildCollectionToolName:()=>Jy,buildExtractionPlan:()=>Ck,buildFolderToolDescription:()=>ev,buildFolderToolName:()=>Gy,buildGenericTools:()=>Uy,buildMcpToolList:()=>ov,buildPromptResult:()=>Vy,buildRequestToolDescription:()=>Zy,buildRequestToolName:()=>zy,buildResultFileName:()=>ul,buildSuiteToolDescription:()=>tv,buildSuiteToolName:()=>Yy,cleanupOldBodyFiles:()=>jS,concatenateScripts:()=>sd,countRequests:()=>Dy,createExpectChain:()=>$u,createLodashShim:()=>F0,createMcpRuntime:()=>UN,createModuleLoader:()=>Wm,createMomentShim:()=>nd,createNodeContainer:()=>hn,createResponseObject:()=>id,createScriptConsole:()=>dk,createTestFunction:()=>Jm,createVariableResolver:()=>EI,decodeCursor:()=>sv,decodeFolderName:()=>px,decodeFolderPath:()=>Ui,dedupeToolsByName:()=>nv,deepClone:()=>dI,deleteItemFromTree:()=>Yh,detectEnvSuggestions:()=>yp,detectSensitiveData:()=>Rk,dispatchGenericTool:()=>By,encodeCursor:()=>iv,encodeFolderName:()=>ur,enhanceCollection:()=>YN,enumerateFolders:()=>Ar,evaluateExpression:()=>to,expandSummary:()=>mN,exportCollectionToRestClient:()=>vk,findItemById:()=>Gh,flattenRequests:()=>Ke,formatBytes:()=>mI,formatConsoleOutput:()=>Aa,formatDuration:()=>gI,generateId:()=>vt,generateSlug:()=>cn,generateUUID:()=>Jh,getCompletions:()=>tM,getRestClientExportFolder:()=>yk,getServiceContainer:()=>yx,hasChanged:()=>Nu,isExpression:()=>eo,isPlainObject:()=>pI,isSystemEnvironmentFile:()=>Sf,loadEnvironmentsFromFolder:()=>fu,mcpToolSegment:()=>Fo,mcpToolToken:()=>Vi,mergeHeadersCaseInsensitive:()=>ou,mergeRequestSettings:()=>am,normalizeFolderInput:()=>pp,normalizeHeaders:()=>Gm,parseCurlCommand:()=>GN,parseFilterChain:()=>hu,parseMcpToolName:()=>Ky,parsePostmanEnvironment:()=>ud,parsePostmanEnvironmentFile:()=>wk,parseQueryContext:()=>eM,prepareBodyForSave:()=>LS,readBodyFromDir:()=>DS,readSchemaFile:()=>US,readScriptsFromDir:()=>vf,redactBody:()=>ng,redactFullResponse:()=>sg,redactFullResultDetails:()=>og,redactHeaders:()=>ii,redactHistoryEntry:()=>ig,redactUrl:()=>dd,registerCoreServices:()=>hp,resolveCollectionRef:()=>pv,resolveDynamicVariable:()=>qi,resolveDynamicVariablesInString:()=>CI,resolveFolderRef:()=>hv,resolveFolderToken:()=>Qy,resolveRequestRef:()=>mv,resolveToken:()=>al,runCollection:()=>BN,runFolder:()=>VN,runRequest:()=>HN,runSuite:()=>WN,safeJsonParse:()=>hI,sanitizeName:()=>Tt,scanCollectionForEnvVarsWithAi:()=>QN,searchForItemPath:()=>Kh,searchForItemPathById:()=>Qh,sortItemsByOrder:()=>BS,writeEnvFile:()=>Ma,writeFolderItems:()=>ld,writeSchemaFiles:()=>HS,writeScriptFile:()=>Bu,writeScriptsToDir:()=>bf});module.exports=ga(v7);var ya=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 o=await this.load(s);n.push(o)}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()}};Zh();va();function VS(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(yI),source:{format:"folder",filePath:e,version:t.version}}}function yI(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(yI)};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},...e.operationId&&{operationId:e.operationId},...e.summary&&{summary:e.summary},...e.tags&&e.tags.length>0&&{tags:e.tags},...e.examples&&e.examples.length>0&&{examples:e.examples},...e.responses&&Object.keys(e.responses).length>0&&{responses:e.responses},...e.security&&e.security.length>0&&{security:e.security}}}function o2(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(WS)}}function WS(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(WS)}:{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},...t.responseSchema&&{responseSchema:t.responseSchema},...t.bodySchema&&{bodySchema:t.bodySchema},...t.operationId&&{operationId:t.operationId},...t.summary&&{summary:t.summary},...t.tags&&{tags:t.tags},...t.examples&&{examples:t.examples},...t.responses&&{responses:t.responses},...t.security&&{security:t.security}}}var lu=class{store;constructor(e){this.store=new cs(e)}loadAll(){return this.store.loadAll().map(r=>VS(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 VS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return VS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(o2(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,WS(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 uu=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()}};ba();var cu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}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)}};em();var Oi=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 o=this.getEnvironmentVariables(n.inherits);i={...i,...o}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};du();_f();var fs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new no,this.urlBuilder=new In}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Oi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};_f();xf();Ef();du();ad();od();var $a=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 o=s?.forgeRoot?[require("path").join(s.forgeRoot,"modules")]:[],l=new ki(new In,new Pi,e);this.scriptExecutor=new Ni(l,o,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},o={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},c=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),v={request:{url:c.url,method:c.method,headers:{...c.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:f,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(k,T,N)=>{k==="set"&&T&&N!==void 0?this.forgeEnv.setGlobal(T,N):k==="unset"&&T?this.forgeEnv.unsetGlobal(T):k==="clear"&&this.forgeEnv.clearGlobals()}},_=this.scriptExecutor.createRequestSession(v),w,E;try{if(!n.skipPreRequest&&g.preRequest.length>0){let $=await _.executePreRequest(g.preRequest);if(w={success:$.success,error:$.error,modifiedVariables:$.modifiedVariables,modifiedEnvironment:$.modifiedEnvironmentVariables,modifiedGlobals:$.modifiedGlobals,modifiedCollectionVariables:$.modifiedCollectionVariables,consoleOutput:$.consoleOutput,modifiedRequest:$.modifiedRequest?{url:$.modifiedRequest.url,method:$.modifiedRequest.method,headers:$.modifiedRequest.headers,body:$.modifiedRequest.body?.content}:void 0},$.modifiedVariables&&(l={...l,...$.localVariables??$.modifiedVariables}),$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables}),$.modifiedRequest){let j=$.modifiedRequest;j.url&&(c.url=j.url),j.method&&(c.method=j.method),j.headers&&(c.headers={...c.headers,...j.headers}),j.body!==void 0&&(c.body=j.body?.content||j.body)}if(!$.success)throw new Error(`Pre-request script failed: ${$.error}`)}let k={...f,...l};c=this.interpolateRequest(c,k);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&c.body!==void 0){let $=this.preprocessor.encodeBody({type:"graphql",content:c.body});$!=null&&(c.body=typeof $=="string"?$:JSON.stringify($))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(c.body)){let $=this.buildMultipartFormData({type:"form-data",content:c.body});$&&(c.body=$)}let N=await this.httpClient.send(c);if(!n.skipPostResponse&&g.postResponse.length>0){let $=await _.executePostResponse(g.postResponse,{status:N.status,statusText:N.statusText,headers:N.headers,body:N.body,cookies:Ym(N.headers,N.cookies,c.url),responseTime:N.time,responseSize:N.size,executedRequest:{url:c.url,method:c.method,headers:c.headers||{},body:c.body?typeof c.body=="string"?{type:"raw",content:c.body}:c.body:{type:"none",content:""},params:{},query:{}}});E={success:!0,assertions:$.testResults,consoleOutput:$.consoleOutput,modifiedEnvironment:$.modifiedEnvironmentVariables},$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables})}return{response:N,preRequestResult:w,postResponseResult:E,totalTime:Date.now()-i,finalRequest:c,variables:{environment:f,local:l}}}finally{_.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 p=new URLSearchParams;for(let h of e.query)h.enabled!==!1&&p.append(h.key,h.value);n+=(n.includes("?")?"&":"?")+p.toString()}let i=r?.url||n,s=r?.method||e.method,o={};if(e.headers&&Array.isArray(e.headers))for(let p of e.headers)p.enabled!==!1&&(o[p.key]=p.value);let l={...o,...r?.headers||{}},f,c=r?.body||e.body;if(c)if(typeof c=="string")f=c;else if(this.preprocessor&&c.type)if(c.type==="graphql")f=typeof c.content=="string"?c.content:JSON.stringify(c.content);else if(c.type==="form-data")f=this.buildMultipartFormData(c);else{let p=this.preprocessor.encodeBody(c);f=p!=null?String(p):void 0}else c.content&&(f=typeof c.content=="string"?c.content:JSON.stringify(c.content));return this.preprocessor&&c&&c.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,c),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=fs.create(r),i=e.body,s=i;return typeof i=="string"?s=n.resolve(i):i instanceof FormData||i instanceof URLSearchParams?s=i:i&&typeof i=="object"&&(s=n.resolve(i)),{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:s}}buildMultipartFormData(e){if(!e||e.type!=="form-data"||!Array.isArray(e.content))return;let r=new FormData;for(let n of e.content)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}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 o of n)o.scripts?.preRequest&&i.push(o.scripts.preRequest),o.scripts?.postResponse&&s.push(o.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,o)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...o),!0;if(l.type==="folder"){let f=[...o,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function qz(){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 Fu=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 o=this.entries.get(s);o&&(!r||o.environment===r)&&i.push(o)}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 o=qz(),l=Date.now(),f={id:o,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(o,f);let c=this.requestIndex.get(e)||[];for(c.unshift(o);c.length>this.maxEntriesPerRequest;){let p=c.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,c),this.storeFullResponses){let p={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(o,p)}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 Du=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let o={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?o.body=e.body:typeof e.body=="object"&&(o.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(o.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(o.redirect="manual");let l=await fetch(e.url,o),f=Date.now(),c;try{c=await l.text()}catch{c=null}let p={};return l.headers.forEach((h,g)=>{let v=p[g];v!==void 0?p[g]=Array.isArray(v)?[...v,h]:[v,h]:p[g]=h}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:c,time:f-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};xf();Ef();Cf();Km();du();var ho=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}}};Qm();var fn=me(require("fs/promises")),ju=me(require("path")),Lu=class{async readFile(e){return fn.readFile(e,"utf-8")}async writeFile(e,r){let n=ju.dirname(e);await this.mkdir(n),await fn.writeFile(e,r,"utf-8")}async exists(e){try{return await fn.access(e),!0}catch{return!1}}async mkdir(e){await fn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=ju.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return fn.readdir(e)}async isDirectory(e){try{return(await fn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await fn.readdir(e,{withFileTypes:!0});for(let i of n){let s=ju.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)}};ad();var Zm=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 no,this.fileSystem=e.fileSystem||new Lu,this.preprocessor=e.preprocessor||new po,this.dataFileParser=e.dataFileParser||new mo,this.cookieJar=e.cookieJar||new cu,e.enableHistory?this.requestHistory=e.requestHistory||new Fu({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 io(s)}else this.httpClient=new Du;let r=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new ki(new In,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Ni(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new uu,this.parserRegistry.register("http-forge",new ho),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new lu(s)}else this.collectionLoader=new ya(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Oi(e.environmentConfig):Oi.fromVariables({}),this.forgeEnv=fs.fromResolver(this.environmentStore),this.requestExecutor=new $a(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Pi;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 ya)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 Oi(e),this.forgeEnv=fs.fromResolver(this.environmentStore),this.requestExecutor=new $a(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=require("path"),i=n.join(e,"environments"),s,o=fu(i);if(Object.keys(o.environments).length>0||Object.keys(o.globalVariables).length>0){s={globalVariables:{...o.globalVariables,...o.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,c]of Object.entries(o.environments)){let p=o.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...c.variables,...p}}}}else{let f=require("fs"),c=n.join(i,"environments.json");if(f.existsSync(c))try{let p=f.readFileSync(c,"utf-8"),h=JSON.parse(p);if(s={globalVariables:h.globalVariables||{},environments:{},selectedEnvironment:h.selectedEnvironment},h.environments)for(let[g,v]of Object.entries(h.environments)){let _=v;s.environments[g]={name:_.name||g,variables:_.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${c}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};gx();vx();Ly();gi();wx();_x();Rx();Cx();rv();_p();async function UN(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(jN(),LN));return e(t)}async function HN(t){let{runRequest:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}async function BN(t){let{runCollection:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}async function VN(t){let{runFolder:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}async function WN(t){let{runSuite:e}=await Promise.resolve().then(()=>(Tc(),kp));return e(t)}dv();Z0();ba();xx();X0();xf();Ef();KS();Cf();Km();du();D0();U0();ad();zm();od();pd();J0();Y0();Zh();va();va();z0();function Y5(t){let e=t.replace(/\\\n/g," "),r=[],n="",i=0;for(;i<e.length;){let s=e[i];if(s==="\\"&&i+1<e.length)n+=e[++i],i++;else if(s==="'"){for(i++;i<e.length&&e[i]!=="'";)n+=e[i++];i++}else if(s==='"'){for(i++;i<e.length&&e[i]!=='"';)if(e[i]==="\\"&&i+1<e.length){let o=e[i+1];o==='"'||o==="\\"||o==="$"||o==="`"?(n+=o,i+=2):n+=e[i++]}else n+=e[i++];i++}else/\s/.test(s)?(n.length>0&&(r.push(n),n=""),i++):(n+=s,i++)}return n.length>0&&r.push(n),r}function K5(t){try{let e="__FV__",r=[],n=t.replace(/\{\{[^}]+\}\}/g,p=>(r.push(p),`${e}${r.length-1}`)),i=n.indexOf("?");if(i===-1)return{cleanUrl:t,params:[]};let s=n.slice(0,i),o=n.slice(i+1),l=p=>p.replace(new RegExp(`${e}(\\d+)`,"g"),(h,g)=>r[parseInt(g,10)]),f=l(s),c=o.split("&").filter(Boolean).map(p=>{let h=l(p),g=h.indexOf("=");return g===-1?{key:h,value:"",enabled:!0}:{key:decodeURIComponent(h.slice(0,g)),value:decodeURIComponent(h.slice(g+1)),enabled:!0}});return{cleanUrl:f,params:c}}catch{return{cleanUrl:t,params:[]}}}function Q5(t){try{let e=new URL(t.replace(/\{\{[^}]+\}\}/g,"placeholder")),r=e.pathname.split("/").filter(Boolean),n=r[r.length-1];return n&&!/^\d+$/.test(n)&&!n.startsWith("{")?n.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):r.length>1?r[r.length-2].replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):e.hostname.replace(/^www\./,"").split(".")[0]??"Request"}catch{return"Request"}}var Z5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),X5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function zN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function JN(t){return/\{\{[^}]+\}\}/.test(t)}function yv(t,e=16){return t.length>=e&&!JN(t)}function e7(t,e,r){let n=[],i=new Set,s=(o,l)=>{i.has(l)||(i.add(l),n.push({key:o,value:l}))};for(let o of t){let l=o.key.toLowerCase();if(l==="authorization"){let f=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&yv(f[2])?s(`${f[1].toUpperCase()}_TOKEN`,f[2]):yv(o.value)&&s("AUTH_TOKEN",o.value)}else Z5.has(l)&&yv(o.value)&&s(zN(o.key),o.value)}for(let o of e)X5.has(o.key.toLowerCase())&&yv(o.value)&&s(zN(o.key),o.value);try{let o=new URL(r.replace(/\{\{[^}]+\}\}/g,"placeholder"));if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)&&!JN(r)){let f=`${o.protocol}//${o.host}`;s("BASE_URL",f)}}catch{}return n}function GN(t){let e=Y5(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,f=!1,c=!1,p=[],h=[],g=0;for(;g<n.length;){let T=n[g];if(T==="-X"||T==="--request")i=n[++g]??"";else if(T==="-H"||T==="--header"){let N=n[++g]??"",$=N.indexOf(":");$>0&&o.push({key:N.slice(0,$).trim(),value:N.slice($+1).trim()})}else if(T==="-d"||T==="--data"||T==="--data-raw"||T==="--data-binary"||T==="--data-ascii")l=n[++g]??"";else if(T==="--json")l=n[++g]??"",f=!0;else if(T==="-u"||T==="--user"){let N=n[++g]??"",$=btoa(N);o.push({key:"Authorization",value:`Basic ${$}`})}else if(T==="-b"||T==="--cookie")o.push({key:"Cookie",value:n[++g]??""});else if(T==="--url")s=n[++g]??"";else if(T==="-G"||T==="--get")c=!0;else if(T==="-F"||T==="--form"){let N=n[++g]??"",$=N.indexOf("=");$>0&&p.push({key:N.slice(0,$),value:N.slice($+1)})}else T==="--data-urlencode"?h.push(n[++g]??""):T==="-A"||T==="--user-agent"?o.push({key:"User-Agent",value:n[++g]??""}):T==="-e"||T==="--referer"||T==="--referrer"?o.push({key:"Referer",value:n[++g]??""}):T==="--compressed"||T==="-L"||T==="--location"||T==="-v"||T==="--verbose"||T==="-s"||T==="--silent"||T==="-i"||T==="--include"||T==="-k"||T==="--insecure"||T==="--http1.1"||T==="--http2"||T==="--http3"||(T==="-o"||T==="--output"||T==="--max-time"||T==="--connect-timeout"||T==="-m"||T==="--limit-rate"||T==="--proxy"||T==="-x"?g++:!T.startsWith("-")&&!s&&(s=T));g++}c?i="GET":i||(i=l!==null||p.length>0||h.length>0?"POST":"GET");let{cleanUrl:v,params:_}=K5(s),w=null;if(p.length>0)w={type:"raw",format:"text",content:p.map(N=>`${encodeURIComponent(N.key)}=${encodeURIComponent(N.value)}`).join("&")},o.some(N=>N.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(h.length>0)w={type:"raw",format:"text",content:h.join("&")},o.some(T=>T.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let T=l.trim(),N=f||T.startsWith("{")||T.startsWith("[");w={type:"raw",format:N?"json":"text",content:l},N&&!o.some($=>$.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let E=o.map(T=>({...T,enabled:!0})),k=e7(o,_,v||s);return{name:Q5(v||s),method:i.toUpperCase(),url:v||s,headers:E,queryParams:_,body:w,suggestedVars:k}}async function YN(t,e,r,n){let i=KN(t.items);if(i.length===0)return;let s=Math.ceil(i.length/10);for(let o=0;o<i.length;o+=10){let l=i.slice(o,o+10),f=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${f}/${s})\u2026`,1/s*100);let c=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:i7(p),responseSchema:p.responseSchema?JSON.stringify(p.responseSchema).slice(0,500):void 0,description:p.description?.slice(0,200)}));try{let p=await r.complete(t7(c)),h=r7(p);n7(l,h)}catch{}}await e.saveCollection(t)}function t7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
|
|
1019
1019
|
1. "body" \u2014 a realistic, human-readable JSON request body string (not schema placeholders like "string" or 0). If the request has no body or is a GET/HEAD/DELETE, return null.
|
|
1020
1020
|
2. "testScript" \u2014 a JavaScript postResponse test using pm.test() syntax. Always include a status code check. Add response body assertions if a responseSchema is provided.
|
|
1021
1021
|
|