@http-forge/core 0.6.22 → 0.6.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- var AL=Object.create;var Eh=Object.defineProperty;var TL=Object.getOwnPropertyDescriptor;var $L=Object.getOwnPropertyNames;var NL=Object.getPrototypeOf,ML=Object.prototype.hasOwnProperty;var wt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var le=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var V=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},io=(t,e)=>{for(var r in e)Eh(t,r,{get:e[r],enumerable:!0})},oq=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $L(e))!ML.call(t,i)&&i!==r&&Eh(t,i,{get:()=>e[i],enumerable:!(n=TL(e,i))||n.enumerable});return t};var Qc=(t,e,r)=>(r=t!=null?AL(NL(t)):{},oq(e||!t||!t.__esModule?Eh(r,"default",{value:t,enumerable:!0}):r,t)),Ql=t=>oq(Eh({},"__esModule",{value:!0}),t);function Wt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function Pt(t){let e=Date.now().toString(36)+(FL++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${Wt(t)}_${e}`:e}function rS(){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 Zc(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 DL(t){return JSON.parse(JSON.stringify(t))}function jL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function LL(t,e){try{return JSON.parse(t)}catch{return e}}function UL(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 HL(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var FL,jn=le(()=>{"use strict";FL=0});import*as pt from"fs";import*as Sn from"path";function Ih(t){if(!pt.existsSync(t))return;let e={},r=Sn.join(t,qh.preRequest);pt.existsSync(r)&&(e.preRequest=pt.readFileSync(r,"utf-8"));let n=Sn.join(t,qh.postResponse);return pt.existsSync(n)&&(e.postResponse=pt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function Oh(t,e){await pt.promises.mkdir(t,{recursive:!0});let r=Sn.join(t,qh.preRequest);e.preRequest?await pt.promises.writeFile(r,e.preRequest,"utf-8"):pt.existsSync(r)&&await pt.promises.unlink(r);let n=Sn.join(t,qh.postResponse);e.postResponse?await pt.promises.writeFile(n,e.postResponse,"utf-8"):pt.existsSync(n)&&await pt.promises.unlink(n)}function lq(t){for(let[e,r]of Object.entries(aq)){let n=Sn.join(t,e);if(pt.existsSync(n))try{let i=pt.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 uq(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 cq(t,e){for(let r of Object.keys(aq))if(r!==e){let n=Sn.join(t,r);if(pt.existsSync(n))try{await pt.promises.unlink(n)}catch{}}}function fq(t){if(pt.existsSync(t))try{let e=pt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function dq(t,e,r){let n=Sn.join(t,Xc.responseSchema),i=Sn.join(t,Xc.bodySchema);e?await pt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):pt.existsSync(n)&&await pt.promises.unlink(n),r?await pt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):pt.existsSync(i)&&await pt.promises.unlink(i)}function nS(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=nS(r.items,e);if(n)return n}}}function iS(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&&iS(n.items,e))return!0}return!1}function pq(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 sS(t,e){let r;try{r=pt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===wn)continue;if(n.name===e)return Sn.join(t,n.name);let i=sS(Sn.join(t,n.name),e);if(i)return i}}function BL(t){for(let e of[Hr.request,Hr.folder]){let r=Sn.join(t,e);if(pt.existsSync(r))try{let n=pt.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function oS(t,e){let r;try{r=pt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===wn)continue;let i=Sn.join(t,n.name);if(BL(i)===e)return i;let s=oS(i,e);if(s)return s}}function Ln(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 y of s){let b=parseInt(y.substring(1));b>o&&(o=b)}let l="";if(o>0)l=`t${o}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let c=r;n&&(c=c.substring(n[0].length)),c=c.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),c=c.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),c=c.replace(/\([^)]+\)/g,""),c=c.replace(/:[a-z_][a-z0-9_]*/gi,""),c=c.replace(/\{[^}]+\}/g,""),c=c.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=c.split("-").filter(y=>y.length>0),p=[];i&&p.push(i),p.push(...d),l&&p.push(l);let m=p.join("-");if(m||(m="item"),e.includes(m)){let y=2;for(;e.includes(`${m}-${y}`);)y++;m=`${m}-${y}`}return m}var qh,Hr,aq,Xc,wn,ma=le(()=>{"use strict";qh={preRequest:"pre-request.js",postResponse:"post-response.js"},Hr={collection:"collection.json",folder:"folder.json",request:"request.json"},aq={"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"}},Xc={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},wn="scripts"});import*as $e from"fs";import*as De from"path";var so,Ph=le(()=>{"use strict";jn();ma();so=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(){$e.existsSync(this.collectionsDir)||$e.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=$e.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(),!$e.existsSync(this.collectionsDir))return[];let e=$e.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=De.join(this.collectionsDir,e),n=De.join(r,Hr.collection);if(!$e.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(De.join(r,wn)),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=$e.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===wn)continue;let c=De.join(e,l.name);if($e.existsSync(De.join(c,Hr.folder))){let d=this.loadFolderFromDir(c,l.name);d&&s.set(l.name,d)}else if($e.existsSync(De.join(c,Hr.request))){let d=this.loadRequestFromDir(c,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let c=s.get(l);c&&(i.push(c),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=De.join(e,Hr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(De.join(e,wn)),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=De.join(e,Hr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(De.join(e,wn)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let c=this.loadSchemaFile(De.join(e,Xc.responseSchema)),d=this.loadSchemaFile(De.join(e,Xc.bodySchema)),p=De.join(e,"doc.md"),m=$e.existsSync(p)?$e.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,bodyContentType:i.bodyContentType,auth:i.auth,settings:i.settings,scripts:s,disabled:i.disabled,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...m&&{doc:m},...c&&{responseSchema:c},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Ih(e)}loadBodyFromDir(e){return lq(e)}loadSchemaFile(e){return fq(e)}async saveSchemaFiles(e,r){return dq(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=Pt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=$e.readdirSync(this.collectionsDir);r=Ln(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=De.join(this.collectionsDir,r),i=!$e.existsSync(n);await $e.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(De.join(n,wn),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await $e.promises.writeFile(De.join(n,Hr.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=Ln(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 c=De.join(e,l);await $e.promises.mkdir(c,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(c,o,n):await this.saveRequestToDir(c,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(De.join(e,wn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await $e.promises.writeFile(De.join(e,Hr.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,bodyContentType:r.bodyContentType,auth:r.auth,settings:r.settings,...r.disabled!==void 0&&{disabled:r.disabled},...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=[$e.promises.writeFile(De.join(e,Hr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push($e.promises.writeFile(De.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($e.promises.writeFile(De.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(De.join(e,wn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return uq(e)}async cleanupOldBodyFiles(e,r){return cq(e,r)}async saveScriptsToDir(e,r){return Oh(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=De.join(this.collectionsDir,r);if(!$e.existsSync(n))return!1;try{return await $e.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?$e.existsSync(De.join(this.collectionsDir,r,Hr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return De.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||Pt(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(De.join(s,wn),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(De.join(n,wn))}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=De.join(this.collectionsDir,i),o=De.join(s,Hr.collection),l=$e.readFileSync(o,"utf-8"),d={...JSON.parse(l),...r,id:e};await $e.promises.writeFile(o,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=De.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=$e.readdirSync(o).filter(m=>$e.statSync(De.join(o,m)).isDirectory()&&m!==wn);l=Ln(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let c=De.join(o,l);await $e.promises.mkdir(c,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(c,r):await this.saveRequestToDir(c,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,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||!$e.existsSync(i))return!1;try{await $e.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:c,items:d,...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||!$e.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=De.join(this.collectionsDir,s);let c=this.idToSlugMap.get(r);if(!c)return!1;let d=De.join(l,c);if($e.existsSync(d))return!1;try{await $e.promises.rename(o,d);let p=this.findItemById(i.items,r);if(p){let m=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(m))}else i.items.push(m)}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 c=this.idToSlugMap.get(l);c&&o.push(c)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let c=De.join(l,Hr.folder),d=$e.readFileSync(c,"utf-8"),p=JSON.parse(d);p.order=o,await $e.promises.writeFile(c,JSON.stringify(p,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let l=De.join(this.collectionsDir,s,Hr.collection),c=$e.readFileSync(l,"utf-8"),d=JSON.parse(c);d.order=o,await $e.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return pq(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=De.join(this.collectionsDir,n),s=oS(i,r);if(s)return s;let o=this.load(e);if(o){let c=this.buildSlugPath(o.items,r);if(c)return De.join(i,...c)}let l=this.idToSlugMap.get(r);if(l)return sS(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 nS(e,r)}deleteItemFromTree(e,r){return iS(e,r)}}});var Ct,ga=le(()=>{"use strict";Ct=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(),c=i.substring(o+1).trim(),d={name:l,value:c,domain:r};for(let p of s){let m=p.indexOf("="),y=(m===-1?p:p.substring(0,m)).toLowerCase(),b=m===-1?"":p.substring(m+1);switch(y){case"domain":d.domain=b.startsWith(".")?b.substring(1):b;break;case"path":d.path=b;break;case"expires":d.expires=b;break;case"max-age":d.maxAge=parseInt(b,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=b;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let 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"/"}}}});import*as oo from"fs";import*as ya from"path";function Ah(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function nf(t){if(!oo.existsSync(t))return WL();let e=kh(ya.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=oo.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!Ah(d)),s={};for(let d of i){let p=kh(ya.join(t,d))||{},m=ya.basename(d,".json");s[m]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(kh(ya.join(t,"_global.local.json"))||{}).variables||{},c={};for(let d of Object.keys(s)){let p=ya.join(t,`${d}.local.json`);if(oo.existsSync(p)){let m=kh(p)||{};c[d]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:c}}function WL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function kh(t){try{if(!oo.existsSync(t))return null;let e=oo.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 Th=le(()=>{"use strict"});var li,Xl=le(()=>{"use strict";li=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 c=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);c&&(n=c[1],i=c[2],s=c[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(d,(m,y,b)=>{let q=r[y];return q!==void 0&&q!==""?encodeURIComponent(q):b?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),m)});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[c,d]=e.split("?");n=c,d&&new URLSearchParams(d).forEach((m,y)=>{i[y]=m})}let s={...i,...r},o=new URLSearchParams;for(let[c,d]of Object.entries(s))d!=null&&o.append(c,d);let l=o.toString();return l?`${n}?${l}`:n}}});function mq(t,e=0){return(mr[t[e+0]]+mr[t[e+1]]+mr[t[e+2]]+mr[t[e+3]]+"-"+mr[t[e+4]]+mr[t[e+5]]+"-"+mr[t[e+6]]+mr[t[e+7]]+"-"+mr[t[e+8]]+mr[t[e+9]]+"-"+mr[t[e+10]]+mr[t[e+11]]+mr[t[e+12]]+mr[t[e+13]]+mr[t[e+14]]+mr[t[e+15]]).toLowerCase()}var mr,gq=le(()=>{mr=[];for(let t=0;t<256;++t)mr.push((t+256).toString(16).slice(1))});function uS(){return crypto.getRandomValues(zL)}var zL,yq=le(()=>{zL=new Uint8Array(16)});function JL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():GL(t,e,r)}function GL(t,e,r){t=t||{};let n=t.random??t.rng?.()??uS();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 mq(n)}var eu,vq=le(()=>{yq();gq();eu=JL});var cS=le(()=>{vq()});function YL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function KL(){return Date.now()}function bq(){return eu()}function QL(){return eu()}function Sq(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 ZL(){let t=Sq(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function XL(){return Math.random()<.5}function e2(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 t2(){return Math.floor(Date.now()/1e3)}function r2(){return new Date().toISOString()}function n2(){return new Date().toISOString().split("T")[0]}function i2(){return new Date().toISOString().split("T")[1].split(".")[0]}function s2(){return new Date().toISOString()}function o2(t=""){return Buffer.from(String(t)).toString("base64")}function a2(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function l2(t=""){return encodeURIComponent(String(t))}function u2(t=""){return decodeURIComponent(String(t))}function c2(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 ys(t,e){let r=wq[t];return r?e&&e.length>0?r(...e):r():null}function f2(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?c2(n):void 0,s=ys(r,i);return s===null?e:String(s)}catch{return e}})}function va(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=ys(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var wq,$h=le(()=>{"use strict";cS();wq={randomInt:YL,timestamp:KL,guid:QL,uuid:bq,randomUUID:bq,randomString:Sq,randomHexadecimal:e2,randomEmail:ZL,randomBoolean:XL,isoTimestamp:s2,timestamp_s:t2,datetime:r2,date:n2,time:i2,base64Encode:o2,base64Decode:a2,urlEncode:l2,urlDecode:u2}});import*as Nh from"vm";function ba(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ui(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=Nh.createContext(r);return Nh.runInContext(t,n,{timeout:d2,displayErrors:!1})}catch{return}}var d2,sf=le(()=>{"use strict";d2=100});import*as Mh from"crypto";function p2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function af(t){if(!t||!t.includes("|"))return null;let e=h2(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=m2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function h2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],c=o>0?t[o-1]:"",d=o<t.length-1?t[o+1]:"";if(c==="\\"){r+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function m2(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:g2(n)}}function g2(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 zt(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=p2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function lf(t,e,r={}){let n=t;for(let i of e)n=y2(n,i.name,i.args,r);return n}function y2(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=zt(r[0],n),s=r[1]!==void 0?zt(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(zt(r[0],n)):"",s=r[1]!==void 0?String(zt(r[1],n)):"";return String(t).replace(new RegExp(b2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(zt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(zt(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(zt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=zt(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=zt(r[0],n);return Number(t)+i}case"subtract":{let i=zt(r[0],n);return Number(t)-i}case"multiply":{let i=zt(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?zt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?zt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Mh.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(zt(r[0],n)):"",s=String(r[1]!==void 0?zt(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?zt(r[2],n):"base64"),c={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Mh.createHmac(c,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=zt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=zt(r[0],n),s=r[1]!==void 0?zt(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:v2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(zt(s,n)));return i.length===1?t.map(s=>of(s,i[0])):t.map(s=>{let o={};for(let l of i){let c=of(s,l);c!==void 0&&(o[l]=c)}return o})}case"prop":{let i=r[0]!==void 0?String(zt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>of(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?of(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 v2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=zt(o,r);return t.filter(c=>{let d=of(c,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function of(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function b2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Fh=le(()=>{"use strict"});function _q(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 S2(t){return new Sa(t)}var Sa,wa,uf=le(()=>{"use strict";$h();sf();Fh();Sa=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,(c,d)=>this.resolveTemplateContent(d.trim(),r,c));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let c=l[1].trim(),d=this.resolveTemplateContent(c,r,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(d),p):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,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=_q(i[2],r),c=ys(i[1],l);return c!==null?String(c):n}let s=af(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let c=lf(l,s.filters,r);return c!==void 0?String(c):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 c=this.deserializeValue(r[l]),d=o[2],p=this.resolvePropertyAccess(c,d);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];if(typeof l=="string"&&l.charCodeAt(0)===30){let c=l.slice(1);return c==="undefined"?"":c}return String(l)}if(ba(e)){let l=this.deserializeVariables(r),c=va(e,l),d=Ui(e,c);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=_q(n[2],r),o=ys(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(ba(e)){let s=this.deserializeVariables(r),o=va(e,s),l=Ui(e,o);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}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}},wa=class{interpolate(e,r){return!e||typeof e!="string"?e:new Sa({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 vs,cf=le(()=>{"use strict";vs=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r={},n;try{n=await this.interceptors.executeRequestInterceptors(e,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,e,r);if(s)return s;throw i}try{let i=await this.httpClient.send(n);return await this.interceptors.executeResponseInterceptors(i,n,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,n,r);if(s)return s;throw i}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var bs,fS,dS,pS,ff=le(()=>{"use strict";bs=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))}},fS=class{name="logging";priority=1e3;intercept(e,r){return e}},dS=class{name="timing";priority=1;intercept(e,r,n){return e}},pS=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 Rq=V((tu,df)=>{(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__",c=500,d="__lodash_placeholder__",p=1,m=2,y=4,b=1,q=2,x=1,v=2,_=4,E=8,k=16,P=32,M=64,j=128,I=256,R=512,A=30,F="...",U=800,D=16,J=1,Q=2,se=3,fe=1/0,He=9007199254740991,_e=17976931348623157e292,ye=NaN,Pe=4294967295,ht=Pe-1,Nt=Pe>>>1,he=[["ary",j],["bind",x],["bindKey",v],["curry",E],["curryRight",k],["flip",R],["partial",P],["partialRight",M],["rearg",I]],Yt="[object Arguments]",Ar="[object Array]",at="[object AsyncFunction]",Tr="[object Boolean]",wr="[object Date]",Rt="[object DOMException]",bt="[object Error]",Jr="[object Function]",Ms="[object GeneratorFunction]",At="[object Map]",Pi="[object Number]",qn="[object Null]",te="[object Object]",re="[object Promise]",Ae="[object Proxy]",ge="[object RegExp]",Se="[object Set]",Qe="[object String]",xt="[object Symbol]",sr="[object Undefined]",oe="[object WeakMap]",fr="[object WeakSet]",Lt="[object ArrayBuffer]",mt="[object DataView]",Ee="[object Float32Array]",In="[object Float64Array]",cl="[object Int8Array]",Fs="[object Int16Array]",Uo="[object Int32Array]",Ds="[object Uint8Array]",ki="[object Uint8ClampedArray]",js="[object Uint16Array]",mc="[object Uint32Array]",fl=/\b__p \+= '';/g,Uy=/\b(__p \+=) '' \+/g,Ho=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ts=/&(?:amp|lt|gt|quot|#39);/g,dl=/[&<>"']/g,pl=RegExp(ts.source),me=RegExp(dl.source),Hy=/<%-([\s\S]+?)%>/g,By=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,Gr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/,gc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ct=/[\\^$.*+?()[\]{}|]/g,Bo=RegExp(ct.source),yc=/^\s+/,hl=/\s/,dr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Kn=/\{\n\/\* \[wrapped with (.+)\] \*/,Pn=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Yr=/[()=,{}\[\]\/\s]/,Qn=/\\(\\)?/g,rs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mp=/\w*$/,Vy=/^[-+]0x[0-9a-f]+$/i,Vo=/^0b[01]+$/i,gp=/^\[object .+?Constructor\]$/,Wy=/^0o[0-7]+$/i,Ls=/^(?:0|[1-9]\d*)$/,Wo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zo=/($^)/,zy=/['\n\r\u2028\u2029\\]/g,ml="\\ud800-\\udfff",Jy="\\u0300-\\u036f",Ut="\\ufe20-\\ufe2f",vc="\\u20d0-\\u20ff",yp=Jy+Ut+vc,bc="\\u2700-\\u27bf",Sc="a-z\\xdf-\\xf6\\xf8-\\xff",Gy="\\xac\\xb1\\xd7\\xf7",Yy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ky="\\u2000-\\u206f",Qy=" \\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",vp="A-Z\\xc0-\\xd6\\xd8-\\xde",bp="\\ufe0e\\ufe0f",wc=Gy+Yy+Ky+Qy,gl="['\u2019]",Zy="["+ml+"]",Sp="["+wc+"]",yl="["+yp+"]",_c="\\d+",Xy="["+bc+"]",Us="["+Sc+"]",Jo="[^"+ml+wc+_c+bc+Sc+vp+"]",vl="\\ud83c[\\udffb-\\udfff]",Go="(?:"+yl+"|"+vl+")",kn="[^"+ml+"]",Rc="(?:\\ud83c[\\udde6-\\uddff]){2}",xc="[\\ud800-\\udbff][\\udc00-\\udfff]",Hs="["+vp+"]",wp="\\u200d",_p="(?:"+Us+"|"+Jo+")",ev="(?:"+Hs+"|"+Jo+")",Rp="(?:"+gl+"(?:d|ll|m|re|s|t|ve))?",xp="(?:"+gl+"(?:D|LL|M|RE|S|T|VE))?",bl=Go+"?",Cp="["+bp+"]?",Ep="(?:"+wp+"(?:"+[kn,Rc,xc].join("|")+")"+Cp+bl+")*",tv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qp=Cp+bl+Ep,nv="(?:"+[Xy,Rc,xc].join("|")+")"+qp,iv="(?:"+[kn+yl+"?",yl,Rc,xc,Zy].join("|")+")",sv=RegExp(gl,"g"),ov=RegExp(yl,"g"),Cc=RegExp(vl+"(?="+vl+")|"+iv+qp,"g"),av=RegExp([Hs+"?"+Us+"+"+Rp+"(?="+[Sp,Hs,"$"].join("|")+")",ev+"+"+xp+"(?="+[Sp,Hs+_p,"$"].join("|")+")",Hs+"?"+_p+"+"+Rp,Hs+"+"+xp,rv,tv,_c,nv].join("|"),"g"),lv=RegExp("["+wp+ml+yp+bp+"]"),uv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cv=["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"],fv=-1,Ot={};Ot[Ee]=Ot[In]=Ot[cl]=Ot[Fs]=Ot[Uo]=Ot[Ds]=Ot[ki]=Ot[js]=Ot[mc]=!0,Ot[Yt]=Ot[Ar]=Ot[Lt]=Ot[Tr]=Ot[mt]=Ot[wr]=Ot[bt]=Ot[Jr]=Ot[At]=Ot[Pi]=Ot[te]=Ot[ge]=Ot[Se]=Ot[Qe]=Ot[oe]=!1;var Et={};Et[Yt]=Et[Ar]=Et[Lt]=Et[mt]=Et[Tr]=Et[wr]=Et[Ee]=Et[In]=Et[cl]=Et[Fs]=Et[Uo]=Et[At]=Et[Pi]=Et[te]=Et[ge]=Et[Se]=Et[Qe]=Et[xt]=Et[Ds]=Et[ki]=Et[js]=Et[mc]=!0,Et[bt]=Et[Jr]=Et[oe]=!1;var Ec={\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"},qc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dv={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ip={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Op=parseFloat,pv=parseInt,Pp=typeof global=="object"&&global&&global.Object===Object&&global,hv=typeof self=="object"&&self&&self.Object===Object&&self,er=Pp||hv||Function("return this")(),Sl=typeof tu=="object"&&tu&&!tu.nodeType&&tu,ft=Sl&&typeof df=="object"&&df&&!df.nodeType&&df,Bs=ft&&ft.exports===Sl,ns=Bs&&Pp.process,Kr=(function(){try{var W=ft&&ft.require&&ft.require("util").types;return W||ns&&ns.binding&&ns.binding("util")}catch{}})(),Ic=Kr&&Kr.isArrayBuffer,kp=Kr&&Kr.isDate,Ap=Kr&&Kr.isMap,Yo=Kr&&Kr.isRegExp,Zn=Kr&&Kr.isSet,wl=Kr&&Kr.isTypedArray;function $r(W,Z,Y){switch(Y.length){case 0:return W.call(Z);case 1:return W.call(Z,Y[0]);case 2:return W.call(Z,Y[0],Y[1]);case 3:return W.call(Z,Y[0],Y[1],Y[2])}return W.apply(Z,Y)}function Xn(W,Z,Y,pe){for(var Ie=-1,lt=W==null?0:W.length;++Ie<lt;){var yt=W[Ie];Z(pe,yt,Y(yt),W)}return pe}function Nr(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe&&Z(W[Y],Y,W)!==!1;);return W}function Oc(W,Z){for(var Y=W==null?0:W.length;Y--&&Z(W[Y],Y,W)!==!1;);return W}function Tp(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(!Z(W[Y],Y,W))return!1;return!0}function Ai(W,Z){for(var Y=-1,pe=W==null?0:W.length,Ie=0,lt=[];++Y<pe;){var yt=W[Y];Z(yt,Y,W)&&(lt[Ie++]=yt)}return lt}function _l(W,Z){var Y=W==null?0:W.length;return!!Y&&is(W,Z,0)>-1}function Vs(W,Z,Y){for(var pe=-1,Ie=W==null?0:W.length;++pe<Ie;)if(Y(Z,W[pe]))return!0;return!1}function qt(W,Z){for(var Y=-1,pe=W==null?0:W.length,Ie=Array(pe);++Y<pe;)Ie[Y]=Z(W[Y],Y,W);return Ie}function Ti(W,Z){for(var Y=-1,pe=Z.length,Ie=W.length;++Y<pe;)W[Ie+Y]=Z[Y];return W}function Pc(W,Z,Y,pe){var Ie=-1,lt=W==null?0:W.length;for(pe&&lt&&(Y=W[++Ie]);++Ie<lt;)Y=Z(Y,W[Ie],Ie,W);return Y}function mv(W,Z,Y,pe){var Ie=W==null?0:W.length;for(pe&&Ie&&(Y=W[--Ie]);Ie--;)Y=Z(Y,W[Ie],Ie,W);return Y}function Rl(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(Z(W[Y],Y,W))return!0;return!1}var gv=Ko("length");function yv(W){return W.split("")}function vv(W){return W.match(Kt)||[]}function $p(W,Z,Y){var pe;return Y(W,function(Ie,lt,yt){if(Z(Ie,lt,yt))return pe=lt,!1}),pe}function xl(W,Z,Y,pe){for(var Ie=W.length,lt=Y+(pe?1:-1);pe?lt--:++lt<Ie;)if(Z(W[lt],lt,W))return lt;return-1}function is(W,Z,Y){return Z===Z?qv(W,Z,Y):xl(W,ss,Y)}function bv(W,Z,Y,pe){for(var Ie=Y-1,lt=W.length;++Ie<lt;)if(pe(W[Ie],Z))return Ie;return-1}function ss(W){return W!==W}function Np(W,Z){var Y=W==null?0:W.length;return Y?Ac(W,Z)/Y:ye}function Ko(W){return function(Z){return Z==null?t:Z[W]}}function kc(W){return function(Z){return W==null?t:W[Z]}}function Cl(W,Z,Y,pe,Ie){return Ie(W,function(lt,yt,Ze){Y=pe?(pe=!1,lt):Z(Y,lt,yt,Ze)}),Y}function Sv(W,Z){var Y=W.length;for(W.sort(Z);Y--;)W[Y]=W[Y].value;return W}function Ac(W,Z){for(var Y,pe=-1,Ie=W.length;++pe<Ie;){var lt=Z(W[pe]);lt!==t&&(Y=Y===t?lt:Y+lt)}return Y}function Tc(W,Z){for(var Y=-1,pe=Array(W);++Y<W;)pe[Y]=Z(Y);return pe}function wv(W,Z){return qt(Z,function(Y){return[Y,W[Y]]})}function $c(W){return W&&W.slice(0,Lp(W)+1).replace(yc,"")}function Mr(W){return function(Z){return W(Z)}}function El(W,Z){return qt(Z,function(Y){return W[Y]})}function gt(W,Z){return W.has(Z)}function Mp(W,Z){for(var Y=-1,pe=W.length;++Y<pe&&is(Z,W[Y],0)>-1;);return Y}function Fp(W,Z){for(var Y=W.length;Y--&&is(Z,W[Y],0)>-1;);return Y}function Dp(W,Z){for(var Y=W.length,pe=0;Y--;)W[Y]===Z&&++pe;return pe}var _v=kc(Ec),Rv=kc(qc);function xv(W){return"\\"+Ip[W]}function Qo(W,Z){return W==null?t:W[Z]}function Ws(W){return lv.test(W)}function Cv(W){return uv.test(W)}function Ev(W){for(var Z,Y=[];!(Z=W.next()).done;)Y.push(Z.value);return Y}function zs(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe,Ie){Y[++Z]=[Ie,pe]}),Y}function Zo(W,Z){return function(Y){return W(Z(Y))}}function An(W,Z){for(var Y=-1,pe=W.length,Ie=0,lt=[];++Y<pe;){var yt=W[Y];(yt===Z||yt===d)&&(W[Y]=d,lt[Ie++]=Y)}return lt}function ql(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=pe}),Y}function jp(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=[pe,pe]}),Y}function qv(W,Z,Y){for(var pe=Y-1,Ie=W.length;++pe<Ie;)if(W[pe]===Z)return pe;return-1}function Nc(W,Z,Y){for(var pe=Y+1;pe--;)if(W[pe]===Z)return pe;return pe}function $i(W){return Ws(W)?Ov(W):gv(W)}function Fr(W){return Ws(W)?Pv(W):yv(W)}function Lp(W){for(var Z=W.length;Z--&&hl.test(W.charAt(Z)););return Z}var Iv=kc(dv);function Ov(W){for(var Z=Cc.lastIndex=0;Cc.test(W);)++Z;return Z}function Pv(W){return W.match(Cc)||[]}function kv(W){return W.match(av)||[]}var Av=(function W(Z){Z=Z==null?er:Ni.defaults(er.Object(),Z,Ni.pick(er,cv));var Y=Z.Array,pe=Z.Date,Ie=Z.Error,lt=Z.Function,yt=Z.Math,Ze=Z.Object,Il=Z.RegExp,Tv=Z.String,Dr=Z.TypeError,Xo=Y.prototype,$v=lt.prototype,Js=Ze.prototype,ea=Z["__core-js_shared__"],Ol=$v.toString,dt=Js.hasOwnProperty,Nv=0,Up=(function(){var a=/[^.]+$/.exec(ea&&ea.keys&&ea.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Pl=Js.toString,Mv=Ol.call(Ze),Fv=er._,Dv=Il("^"+Ol.call(dt).replace(ct,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kl=Bs?Z.Buffer:t,Mi=Z.Symbol,Al=Z.Uint8Array,Hp=kl?kl.allocUnsafe:t,Tl=Zo(Ze.getPrototypeOf,Ze),Bp=Ze.create,ta=Js.propertyIsEnumerable,$l=Xo.splice,Vp=Mi?Mi.isConcatSpreadable:t,ra=Mi?Mi.iterator:t,os=Mi?Mi.toStringTag:t,Nl=(function(){try{var a=da(Ze,"defineProperty");return a({},"",{}),a}catch{}})(),jv=Z.clearTimeout!==er.clearTimeout&&Z.clearTimeout,Lv=pe&&pe.now!==er.Date.now&&pe.now,Uv=Z.setTimeout!==er.setTimeout&&Z.setTimeout,na=yt.ceil,ia=yt.floor,Ml=Ze.getOwnPropertySymbols,Fl=kl?kl.isBuffer:t,as=Z.isFinite,Dl=Xo.join,Wp=Zo(Ze.keys,Ze),Tt=yt.max,or=yt.min,zp=pe.now,Hv=Z.parseInt,Jp=yt.random,Bv=Xo.reverse,Mc=da(Z,"DataView"),sa=da(Z,"Map"),Fc=da(Z,"Promise"),Gs=da(Z,"Set"),oa=da(Z,"WeakMap"),aa=da(Ze,"create"),jl=oa&&new oa,Ys={},Vv=pa(Mc),Wv=pa(sa),zv=pa(Fc),Jv=pa(Gs),Gv=pa(oa),Ll=Mi?Mi.prototype:t,la=Ll?Ll.valueOf:t,Gp=Ll?Ll.toString:t;function $(a){if(Vt(a)&&!Te(a)&&!(a instanceof Ve)){if(a instanceof _r)return a;if(dt.call(a,"__wrapped__"))return xE(a)}return new _r(a)}var Ks=(function(){function a(){}return function(u){if(!Ht(u))return{};if(Bp)return Bp(u);a.prototype=u;var h=new a;return a.prototype=t,h}})();function Ul(){}function _r(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}$.templateSettings={escape:Hy,evaluate:By,interpolate:On,variable:"",imports:{_:$}},$.prototype=Ul.prototype,$.prototype.constructor=$,_r.prototype=Ks(Ul.prototype),_r.prototype.constructor=_r;function Ve(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Pe,this.__views__=[]}function Yv(){var a=new Ve(this.__wrapped__);return a.__actions__=Qr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Qr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Qr(this.__views__),a}function Kv(){if(this.__filtered__){var a=new Ve(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function Dc(){var a=this.__wrapped__.value(),u=this.__dir__,h=Te(a),S=u<0,O=h?a.length:0,N=oM(0,O,this.__views__),L=N.start,B=N.end,z=B-L,X=S?B:L-1,ee=this.__iteratees__,ne=ee.length,ce=0,ve=or(z,this.__takeCount__);if(!h||!S&&O==z&&ve==z)return JC(a,this.__actions__);var Ce=[];e:for(;z--&&ce<ve;){X+=u;for(var Fe=-1,Re=a[X];++Fe<ne;){var Ye=ee[Fe],Xe=Ye.iteratee,vn=Ye.type,Ur=Xe(Re);if(vn==Q)Re=Ur;else if(!Ur){if(vn==J)continue e;break e}}Ce[ce++]=Re}return Ce}Ve.prototype=Ks(Ul.prototype),Ve.prototype.constructor=Ve;function Tn(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Qv(){this.__data__=aa?aa(null):{},this.size=0}function Zv(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function Xv(a){var u=this.__data__;if(aa){var h=u[a];return h===l?t:h}return dt.call(u,a)?u[a]:t}function eb(a){var u=this.__data__;return aa?u[a]!==t:dt.call(u,a)}function tb(a,u){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=aa&&u===t?l:u,this}Tn.prototype.clear=Qv,Tn.prototype.delete=Zv,Tn.prototype.get=Xv,Tn.prototype.has=eb,Tn.prototype.set=tb;function ei(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Yp(){this.__data__=[],this.size=0}function rb(a){var u=this.__data__,h=Bl(u,a);if(h<0)return!1;var S=u.length-1;return h==S?u.pop():$l.call(u,h,1),--this.size,!0}function nb(a){var u=this.__data__,h=Bl(u,a);return h<0?t:u[h][1]}function Kp(a){return Bl(this.__data__,a)>-1}function ib(a,u){var h=this.__data__,S=Bl(h,a);return S<0?(++this.size,h.push([a,u])):h[S][1]=u,this}ei.prototype.clear=Yp,ei.prototype.delete=rb,ei.prototype.get=nb,ei.prototype.has=Kp,ei.prototype.set=ib;function ti(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function sb(){this.size=0,this.__data__={hash:new Tn,map:new(sa||ei),string:new Tn}}function Fi(a){var u=yh(this,a).delete(a);return this.size-=u?1:0,u}function Qp(a){return yh(this,a).get(a)}function ob(a){return yh(this,a).has(a)}function ab(a,u){var h=yh(this,a),S=h.size;return h.set(a,u),this.size+=h.size==S?0:1,this}ti.prototype.clear=sb,ti.prototype.delete=Fi,ti.prototype.get=Qp,ti.prototype.has=ob,ti.prototype.set=ab;function ls(a){var u=-1,h=a==null?0:a.length;for(this.__data__=new ti;++u<h;)this.add(a[u])}function ie(a){return this.__data__.set(a,l),this}function lb(a){return this.__data__.has(a)}ls.prototype.add=ls.prototype.push=ie,ls.prototype.has=lb;function pn(a){var u=this.__data__=new ei(a);this.size=u.size}function Zp(){this.__data__=new ei,this.size=0}function tt(a){var u=this.__data__,h=u.delete(a);return this.size=u.size,h}function Hl(a){return this.__data__.get(a)}function Xp(a){return this.__data__.has(a)}function jc(a,u){var h=this.__data__;if(h instanceof ei){var S=h.__data__;if(!sa||S.length<r-1)return S.push([a,u]),this.size=++h.size,this;h=this.__data__=new ti(S)}return h.set(a,u),this.size=h.size,this}pn.prototype.clear=Zp,pn.prototype.delete=tt,pn.prototype.get=Hl,pn.prototype.has=Xp,pn.prototype.set=jc;function eh(a,u){var h=Te(a),S=!h&&ha(a),O=!h&&!S&&no(a),N=!h&&!S&&!O&&Yl(a),L=h||S||O||N,B=L?Tc(a.length,Tv):[],z=B.length;for(var X in a)(u||dt.call(a,X))&&!(L&&(X=="length"||O&&(X=="offset"||X=="parent")||N&&(X=="buffer"||X=="byteLength"||X=="byteOffset")||ds(X,z)))&&B.push(X);return B}function th(a){var u=a.length;return u?a[wb(0,u-1)]:t}function ub(a,u){return vh(Qr(a),Di(u,0,a.length))}function cb(a){return vh(Qr(a))}function Lc(a,u,h){(h!==t&&!oi(a[u],h)||h===t&&!(u in a))&&hn(a,u,h)}function jr(a,u,h){var S=a[u];(!(dt.call(a,u)&&oi(S,h))||h===t&&!(u in a))&&hn(a,u,h)}function Bl(a,u){for(var h=a.length;h--;)if(oi(a[h][0],u))return h;return-1}function rh(a,u,h,S){return ji(a,function(O,N,L){u(S,O,h(O),L)}),S}function nh(a,u){return a&&Li(u,pr(u),a)}function fb(a,u){return a&&Li(u,Xr(u),a)}function hn(a,u,h){u=="__proto__"&&Nl?Nl(a,u,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[u]=h}function Uc(a,u){for(var h=-1,S=u.length,O=Y(S),N=a==null;++h<S;)O[h]=N?t:Jb(a,u[h]);return O}function Di(a,u,h){return a===a&&(h!==t&&(a=a<=h?a:h),u!==t&&(a=a>=u?a:u)),a}function Rr(a,u,h,S,O,N){var L,B=u&p,z=u&m,X=u&y;if(h&&(L=O?h(a,S,O,N):h(a)),L!==t)return L;if(!Ht(a))return a;var ee=Te(a);if(ee){if(L=lM(a),!B)return Qr(a,L)}else{var ne=xr(a),ce=ne==Jr||ne==Ms;if(no(a))return KC(a,B);if(ne==te||ne==Yt||ce&&!O){if(L=z||ce?{}:mE(a),!B)return z?QN(a,fb(L,a)):KN(a,nh(L,a))}else{if(!Et[ne])return O?a:{};L=uM(a,ne,B)}}N||(N=new pn);var ve=N.get(a);if(ve)return ve;N.set(a,L),VE(a)?a.forEach(function(Re){L.add(Rr(Re,u,h,Re,a,N))}):HE(a)&&a.forEach(function(Re,Ye){L.set(Ye,Rr(Re,u,h,Ye,a,N))});var Ce=X?z?Ab:kb:z?Xr:pr,Fe=ee?t:Ce(a);return Nr(Fe||a,function(Re,Ye){Fe&&(Ye=Re,Re=a[Ye]),jr(L,Ye,Rr(Re,u,h,Ye,a,N))}),L}function db(a){var u=pr(a);return function(h){return $n(h,a,u)}}function $n(a,u,h){var S=h.length;if(a==null)return!S;for(a=Ze(a);S--;){var O=h[S],N=u[O],L=a[O];if(L===t&&!(O in a)||!N(L))return!1}return!0}function Hc(a,u,h){if(typeof a!="function")throw new Dr(i);return Yc(function(){a.apply(t,h)},u)}function ua(a,u,h,S){var O=-1,N=_l,L=!0,B=a.length,z=[],X=u.length;if(!B)return z;h&&(u=qt(u,Mr(h))),S?(N=Vs,L=!1):u.length>=r&&(N=gt,L=!1,u=new ls(u));e:for(;++O<B;){var ee=a[O],ne=h==null?ee:h(ee);if(ee=S||ee!==0?ee:0,L&&ne===ne){for(var ce=X;ce--;)if(u[ce]===ne)continue e;z.push(ee)}else N(u,ne,S)||z.push(ee)}return z}var ji=tE(Nn),ih=tE(ri,!0);function pb(a,u){var h=!0;return ji(a,function(S,O,N){return h=!!u(S,O,N),h}),h}function Vl(a,u,h){for(var S=-1,O=a.length;++S<O;){var N=a[S],L=u(N);if(L!=null&&(B===t?L===L&&!yn(L):h(L,B)))var B=L,z=N}return z}function hb(a,u,h,S){var O=a.length;for(h=Ne(h),h<0&&(h=-h>O?0:O+h),S=S===t||S>O?O:Ne(S),S<0&&(S+=O),S=h>S?0:zE(S);h<S;)a[h++]=u;return a}function sh(a,u){var h=[];return ji(a,function(S,O,N){u(S,O,N)&&h.push(S)}),h}function ar(a,u,h,S,O){var N=-1,L=a.length;for(h||(h=fM),O||(O=[]);++N<L;){var B=a[N];u>0&&h(B)?u>1?ar(B,u-1,h,S,O):Ti(O,B):S||(O[O.length]=B)}return O}var Bc=rE(),oh=rE(!0);function Nn(a,u){return a&&Bc(a,u,pr)}function ri(a,u){return a&&oh(a,u,pr)}function Wl(a,u){return Ai(u,function(h){return ps(a[h])})}function us(a,u){u=to(u,a);for(var h=0,S=u.length;a!=null&&h<S;)a=a[si(u[h++])];return h&&h==S?a:t}function ah(a,u,h){var S=u(a);return Te(a)?S:Ti(S,h(a))}function hr(a){return a==null?a===t?sr:qn:os&&os in Ze(a)?sM(a):vM(a)}function Vc(a,u){return a>u}function mb(a,u){return a!=null&&dt.call(a,u)}function gb(a,u){return a!=null&&u in Ze(a)}function yb(a,u,h){return a>=or(u,h)&&a<Tt(u,h)}function mn(a,u,h){for(var S=h?Vs:_l,O=a[0].length,N=a.length,L=N,B=Y(N),z=1/0,X=[];L--;){var ee=a[L];L&&u&&(ee=qt(ee,Mr(u))),z=or(ee.length,z),B[L]=!h&&(u||O>=120&&ee.length>=120)?new ls(L&&ee):t}ee=a[0];var ne=-1,ce=B[0];e:for(;++ne<O&&X.length<z;){var ve=ee[ne],Ce=u?u(ve):ve;if(ve=h||ve!==0?ve:0,!(ce?gt(ce,Ce):S(X,Ce,h))){for(L=N;--L;){var Fe=B[L];if(!(Fe?gt(Fe,Ce):S(a[L],Ce,h)))continue e}ce&&ce.push(Ce),X.push(ve)}}return X}function Qs(a,u,h,S){return Nn(a,function(O,N,L){u(S,h(O),N,L)}),S}function ca(a,u,h){u=to(u,a),a=bE(a,u);var S=a==null?a:a[si(Fn(u))];return S==null?t:$r(S,a,h)}function lh(a){return Vt(a)&&hr(a)==Yt}function vb(a){return Vt(a)&&hr(a)==Lt}function bb(a){return Vt(a)&&hr(a)==wr}function fa(a,u,h,S,O){return a===u?!0:a==null||u==null||!Vt(a)&&!Vt(u)?a!==a&&u!==u:Wc(a,u,h,S,fa,O)}function Wc(a,u,h,S,O,N){var L=Te(a),B=Te(u),z=L?Ar:xr(a),X=B?Ar:xr(u);z=z==Yt?te:z,X=X==Yt?te:X;var ee=z==te,ne=X==te,ce=z==X;if(ce&&no(a)){if(!no(u))return!1;L=!0,ee=!1}if(ce&&!ee)return N||(N=new pn),L||Yl(a)?dE(a,u,h,S,O,N):nM(a,u,z,h,S,O,N);if(!(h&b)){var ve=ee&&dt.call(a,"__wrapped__"),Ce=ne&&dt.call(u,"__wrapped__");if(ve||Ce){var Fe=ve?a.value():a,Re=Ce?u.value():u;return N||(N=new pn),O(Fe,Re,h,S,N)}}return ce?(N||(N=new pn),iM(a,u,h,S,O,N)):!1}function Zs(a){return Vt(a)&&xr(a)==At}function Xs(a,u,h,S){var O=h.length,N=O,L=!S;if(a==null)return!N;for(a=Ze(a);O--;){var B=h[O];if(L&&B[2]?B[1]!==a[B[0]]:!(B[0]in a))return!1}for(;++O<N;){B=h[O];var z=B[0],X=a[z],ee=B[1];if(L&&B[2]){if(X===t&&!(z in a))return!1}else{var ne=new pn;if(S)var ce=S(X,ee,z,a,u,ne);if(!(ce===t?fa(ee,X,b|q,S,ne):ce))return!1}}return!0}function Ge(a){if(!Ht(a)||pM(a))return!1;var u=ps(a)?Dv:gp;return u.test(pa(a))}function f(a){return Vt(a)&&hr(a)==ge}function g(a){return Vt(a)&&xr(a)==Se}function w(a){return Vt(a)&&xh(a.length)&&!!Ot[hr(a)]}function C(a){return typeof a=="function"?a:a==null?en:typeof a=="object"?Te(a)?We(a[0],a[1]):qe(a):iq(a)}function T(a){if(!Gc(a))return Wp(a);var u=[];for(var h in Ze(a))dt.call(a,h)&&h!="constructor"&&u.push(h);return u}function H(a){if(!Ht(a))return yM(a);var u=Gc(a),h=[];for(var S in a)S=="constructor"&&(u||!dt.call(a,S))||h.push(S);return h}function K(a,u){return a<u}function de(a,u){var h=-1,S=Zr(a)?Y(a.length):[];return ji(a,function(O,N,L){S[++h]=u(O,N,L)}),S}function qe(a){var u=$b(a);return u.length==1&&u[0][2]?yE(u[0][0],u[0][1]):function(h){return h===a||Xs(h,a,u)}}function We(a,u){return Mb(a)&&gE(u)?yE(si(a),u):function(h){var S=Jb(h,a);return S===t&&S===u?Gb(h,a):fa(u,S,b|q)}}function tr(a,u,h,S,O){a!==u&&Bc(u,function(N,L){if(O||(O=new pn),Ht(N))ni(a,u,L,h,tr,S,O);else{var B=S?S(Db(a,L),N,L+"",a,u,O):t;B===t&&(B=N),Lc(a,L,B)}},Xr)}function ni(a,u,h,S,O,N,L){var B=Db(a,h),z=Db(u,h),X=L.get(z);if(X){Lc(a,h,X);return}var ee=N?N(B,z,h+"",a,u,L):t,ne=ee===t;if(ne){var ce=Te(z),ve=!ce&&no(z),Ce=!ce&&!ve&&Yl(z);ee=z,ce||ve||Ce?Te(B)?ee=B:Qt(B)?ee=Qr(B):ve?(ne=!1,ee=KC(z,!0)):Ce?(ne=!1,ee=QC(z,!0)):ee=[]:Kc(z)||ha(z)?(ee=B,ha(B)?ee=JE(B):(!Ht(B)||ps(B))&&(ee=mE(z))):ne=!1}ne&&(L.set(z,ee),O(ee,z,S,N,L),L.delete(z)),Lc(a,h,ee)}function ii(a,u){var h=a.length;if(h)return u+=u<0?h:0,ds(u,h)?a[u]:t}function LC(a,u,h){u.length?u=qt(u,function(N){return Te(N)?function(L){return us(L,N.length===1?N[0]:N)}:N}):u=[en];var S=-1;u=qt(u,Mr(xe()));var O=de(a,function(N,L,B){var z=qt(u,function(X){return X(N)});return{criteria:z,index:++S,value:N}});return Sv(O,function(N,L){return YN(N,L,h)})}function FN(a,u){return UC(a,u,function(h,S){return Gb(a,S)})}function UC(a,u,h){for(var S=-1,O=u.length,N={};++S<O;){var L=u[S],B=us(a,L);h(B,L)&&zc(N,to(L,a),B)}return N}function DN(a){return function(u){return us(u,a)}}function Sb(a,u,h,S){var O=S?bv:is,N=-1,L=u.length,B=a;for(a===u&&(u=Qr(u)),h&&(B=qt(a,Mr(h)));++N<L;)for(var z=0,X=u[N],ee=h?h(X):X;(z=O(B,ee,z,S))>-1;)B!==a&&$l.call(B,z,1),$l.call(a,z,1);return a}function HC(a,u){for(var h=a?u.length:0,S=h-1;h--;){var O=u[h];if(h==S||O!==N){var N=O;ds(O)?$l.call(a,O,1):xb(a,O)}}return a}function wb(a,u){return a+ia(Jp()*(u-a+1))}function jN(a,u,h,S){for(var O=-1,N=Tt(na((u-a)/(h||1)),0),L=Y(N);N--;)L[S?N:++O]=a,a+=h;return L}function _b(a,u){var h="";if(!a||u<1||u>He)return h;do u%2&&(h+=a),u=ia(u/2),u&&(a+=a);while(u);return h}function Le(a,u){return jb(vE(a,u,en),a+"")}function LN(a){return th(Kl(a))}function UN(a,u){var h=Kl(a);return vh(h,Di(u,0,h.length))}function zc(a,u,h,S){if(!Ht(a))return a;u=to(u,a);for(var O=-1,N=u.length,L=N-1,B=a;B!=null&&++O<N;){var z=si(u[O]),X=h;if(z==="__proto__"||z==="constructor"||z==="prototype")return a;if(O!=L){var ee=B[z];X=S?S(ee,z,B):t,X===t&&(X=Ht(ee)?ee:ds(u[O+1])?[]:{})}jr(B,z,X),B=B[z]}return a}var BC=jl?function(a,u){return jl.set(a,u),a}:en,HN=Nl?function(a,u){return Nl(a,"toString",{configurable:!0,enumerable:!1,value:Kb(u),writable:!0})}:en;function BN(a){return vh(Kl(a))}function Mn(a,u,h){var S=-1,O=a.length;u<0&&(u=-u>O?0:O+u),h=h>O?O:h,h<0&&(h+=O),O=u>h?0:h-u>>>0,u>>>=0;for(var N=Y(O);++S<O;)N[S]=a[S+u];return N}function VN(a,u){var h;return ji(a,function(S,O,N){return h=u(S,O,N),!h}),!!h}function uh(a,u,h){var S=0,O=a==null?S:a.length;if(typeof u=="number"&&u===u&&O<=Nt){for(;S<O;){var N=S+O>>>1,L=a[N];L!==null&&!yn(L)&&(h?L<=u:L<u)?S=N+1:O=N}return O}return Rb(a,u,en,h)}function Rb(a,u,h,S){var O=0,N=a==null?0:a.length;if(N===0)return 0;u=h(u);for(var L=u!==u,B=u===null,z=yn(u),X=u===t;O<N;){var ee=ia((O+N)/2),ne=h(a[ee]),ce=ne!==t,ve=ne===null,Ce=ne===ne,Fe=yn(ne);if(L)var Re=S||Ce;else X?Re=Ce&&(S||ce):B?Re=Ce&&ce&&(S||!ve):z?Re=Ce&&ce&&!ve&&(S||!Fe):ve||Fe?Re=!1:Re=S?ne<=u:ne<u;Re?O=ee+1:N=ee}return or(N,ht)}function VC(a,u){for(var h=-1,S=a.length,O=0,N=[];++h<S;){var L=a[h],B=u?u(L):L;if(!h||!oi(B,z)){var z=B;N[O++]=L===0?0:L}}return N}function WC(a){return typeof a=="number"?a:yn(a)?ye:+a}function gn(a){if(typeof a=="string")return a;if(Te(a))return qt(a,gn)+"";if(yn(a))return Gp?Gp.call(a):"";var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function eo(a,u,h){var S=-1,O=_l,N=a.length,L=!0,B=[],z=B;if(h)L=!1,O=Vs;else if(N>=r){var X=u?null:tM(a);if(X)return ql(X);L=!1,O=gt,z=new ls}else z=u?[]:B;e:for(;++S<N;){var ee=a[S],ne=u?u(ee):ee;if(ee=h||ee!==0?ee:0,L&&ne===ne){for(var ce=z.length;ce--;)if(z[ce]===ne)continue e;u&&z.push(ne),B.push(ee)}else O(z,ne,h)||(z!==B&&z.push(ne),B.push(ee))}return B}function xb(a,u){u=to(u,a);var h=-1,S=u.length;if(!S)return!0;for(;++h<S;){var O=si(u[h]);if(O==="__proto__"&&!dt.call(a,"__proto__")||(O==="constructor"||O==="prototype")&&h<S-1)return!1}var N=bE(a,u);return N==null||delete N[si(Fn(u))]}function zC(a,u,h,S){return zc(a,u,h(us(a,u)),S)}function ch(a,u,h,S){for(var O=a.length,N=S?O:-1;(S?N--:++N<O)&&u(a[N],N,a););return h?Mn(a,S?0:N,S?N+1:O):Mn(a,S?N+1:0,S?O:N)}function JC(a,u){var h=a;return h instanceof Ve&&(h=h.value()),Pc(u,function(S,O){return O.func.apply(O.thisArg,Ti([S],O.args))},h)}function Cb(a,u,h){var S=a.length;if(S<2)return S?eo(a[0]):[];for(var O=-1,N=Y(S);++O<S;)for(var L=a[O],B=-1;++B<S;)B!=O&&(N[O]=ua(N[O]||L,a[B],u,h));return eo(ar(N,1),u,h)}function GC(a,u,h){for(var S=-1,O=a.length,N=u.length,L={};++S<O;){var B=S<N?u[S]:t;h(L,a[S],B)}return L}function Eb(a){return Qt(a)?a:[]}function qb(a){return typeof a=="function"?a:en}function to(a,u){return Te(a)?a:Mb(a,u)?[a]:RE(St(a))}var WN=Le;function ro(a,u,h){var S=a.length;return h=h===t?S:h,!u&&h>=S?a:Mn(a,u,h)}var YC=jv||function(a){return er.clearTimeout(a)};function KC(a,u){if(u)return a.slice();var h=a.length,S=Hp?Hp(h):new a.constructor(h);return a.copy(S),S}function Ib(a){var u=new a.constructor(a.byteLength);return new Al(u).set(new Al(a)),u}function zN(a,u){var h=u?Ib(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.byteLength)}function JN(a){var u=new a.constructor(a.source,mp.exec(a));return u.lastIndex=a.lastIndex,u}function GN(a){return la?Ze(la.call(a)):{}}function QC(a,u){var h=u?Ib(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.length)}function ZC(a,u){if(a!==u){var h=a!==t,S=a===null,O=a===a,N=yn(a),L=u!==t,B=u===null,z=u===u,X=yn(u);if(!B&&!X&&!N&&a>u||N&&L&&z&&!B&&!X||S&&L&&z||!h&&z||!O)return 1;if(!S&&!N&&!X&&a<u||X&&h&&O&&!S&&!N||B&&h&&O||!L&&O||!z)return-1}return 0}function YN(a,u,h){for(var S=-1,O=a.criteria,N=u.criteria,L=O.length,B=h.length;++S<L;){var z=ZC(O[S],N[S]);if(z){if(S>=B)return z;var X=h[S];return z*(X=="desc"?-1:1)}}return a.index-u.index}function XC(a,u,h,S){for(var O=-1,N=a.length,L=h.length,B=-1,z=u.length,X=Tt(N-L,0),ee=Y(z+X),ne=!S;++B<z;)ee[B]=u[B];for(;++O<L;)(ne||O<N)&&(ee[h[O]]=a[O]);for(;X--;)ee[B++]=a[O++];return ee}function eE(a,u,h,S){for(var O=-1,N=a.length,L=-1,B=h.length,z=-1,X=u.length,ee=Tt(N-B,0),ne=Y(ee+X),ce=!S;++O<ee;)ne[O]=a[O];for(var ve=O;++z<X;)ne[ve+z]=u[z];for(;++L<B;)(ce||O<N)&&(ne[ve+h[L]]=a[O++]);return ne}function Qr(a,u){var h=-1,S=a.length;for(u||(u=Y(S));++h<S;)u[h]=a[h];return u}function Li(a,u,h,S){var O=!h;h||(h={});for(var N=-1,L=u.length;++N<L;){var B=u[N],z=S?S(h[B],a[B],B,h,a):t;z===t&&(z=a[B]),O?hn(h,B,z):jr(h,B,z)}return h}function KN(a,u){return Li(a,Nb(a),u)}function QN(a,u){return Li(a,pE(a),u)}function fh(a,u){return function(h,S){var O=Te(h)?Xn:rh,N=u?u():{};return O(h,a,xe(S,2),N)}}function zl(a){return Le(function(u,h){var S=-1,O=h.length,N=O>1?h[O-1]:t,L=O>2?h[2]:t;for(N=a.length>3&&typeof N=="function"?(O--,N):t,L&&Lr(h[0],h[1],L)&&(N=O<3?t:N,O=1),u=Ze(u);++S<O;){var B=h[S];B&&a(u,B,S,N)}return u})}function tE(a,u){return function(h,S){if(h==null)return h;if(!Zr(h))return a(h,S);for(var O=h.length,N=u?O:-1,L=Ze(h);(u?N--:++N<O)&&S(L[N],N,L)!==!1;);return h}}function rE(a){return function(u,h,S){for(var O=-1,N=Ze(u),L=S(u),B=L.length;B--;){var z=L[a?B:++O];if(h(N[z],z,N)===!1)break}return u}}function ZN(a,u,h){var S=u&x,O=Jc(a);function N(){var L=this&&this!==er&&this instanceof N?O:a;return L.apply(S?h:this,arguments)}return N}function nE(a){return function(u){u=St(u);var h=Ws(u)?Fr(u):t,S=h?h[0]:u.charAt(0),O=h?ro(h,1).join(""):u.slice(1);return S[a]()+O}}function Jl(a){return function(u){return Pc(rq(tq(u).replace(sv,"")),a,"")}}function Jc(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 h=Ks(a.prototype),S=a.apply(h,u);return Ht(S)?S:h}}function XN(a,u,h){var S=Jc(a);function O(){for(var N=arguments.length,L=Y(N),B=N,z=Gl(O);B--;)L[B]=arguments[B];var X=N<3&&L[0]!==z&&L[N-1]!==z?[]:An(L,z);if(N-=X.length,N<h)return lE(a,u,dh,O.placeholder,t,L,X,t,t,h-N);var ee=this&&this!==er&&this instanceof O?S:a;return $r(ee,this,L)}return O}function iE(a){return function(u,h,S){var O=Ze(u);if(!Zr(u)){var N=xe(h,3);u=pr(u),h=function(B){return N(O[B],B,O)}}var L=a(u,h,S);return L>-1?O[N?u[L]:L]:t}}function sE(a){return fs(function(u){var h=u.length,S=h,O=_r.prototype.thru;for(a&&u.reverse();S--;){var N=u[S];if(typeof N!="function")throw new Dr(i);if(O&&!L&&gh(N)=="wrapper")var L=new _r([],!0)}for(S=L?S:h;++S<h;){N=u[S];var B=gh(N),z=B=="wrapper"?Tb(N):t;z&&Fb(z[0])&&z[1]==(j|E|P|I)&&!z[4].length&&z[9]==1?L=L[gh(z[0])].apply(L,z[3]):L=N.length==1&&Fb(N)?L[B]():L.thru(N)}return function(){var X=arguments,ee=X[0];if(L&&X.length==1&&Te(ee))return L.plant(ee).value();for(var ne=0,ce=h?u[ne].apply(this,X):ee;++ne<h;)ce=u[ne].call(this,ce);return ce}})}function dh(a,u,h,S,O,N,L,B,z,X){var ee=u&j,ne=u&x,ce=u&v,ve=u&(E|k),Ce=u&R,Fe=ce?t:Jc(a);function Re(){for(var Ye=arguments.length,Xe=Y(Ye),vn=Ye;vn--;)Xe[vn]=arguments[vn];if(ve)var Ur=Gl(Re),bn=Dp(Xe,Ur);if(S&&(Xe=XC(Xe,S,O,ve)),N&&(Xe=eE(Xe,N,L,ve)),Ye-=bn,ve&&Ye<X){var Zt=An(Xe,Ur);return lE(a,u,dh,Re.placeholder,h,Xe,Zt,B,z,X-Ye)}var ai=ne?h:this,ms=ce?ai[a]:a;return Ye=Xe.length,B?Xe=bM(Xe,B):Ce&&Ye>1&&Xe.reverse(),ee&&z<Ye&&(Xe.length=z),this&&this!==er&&this instanceof Re&&(ms=Fe||Jc(ms)),ms.apply(ai,Xe)}return Re}function oE(a,u){return function(h,S){return Qs(h,a,u(S),{})}}function ph(a,u){return function(h,S){var O;if(h===t&&S===t)return u;if(h!==t&&(O=h),S!==t){if(O===t)return S;typeof h=="string"||typeof S=="string"?(h=gn(h),S=gn(S)):(h=WC(h),S=WC(S)),O=a(h,S)}return O}}function Ob(a){return fs(function(u){return u=qt(u,Mr(xe())),Le(function(h){var S=this;return a(u,function(O){return $r(O,S,h)})})})}function hh(a,u){u=u===t?" ":gn(u);var h=u.length;if(h<2)return h?_b(u,a):u;var S=_b(u,na(a/$i(u)));return Ws(u)?ro(Fr(S),0,a).join(""):S.slice(0,a)}function eM(a,u,h,S){var O=u&x,N=Jc(a);function L(){for(var B=-1,z=arguments.length,X=-1,ee=S.length,ne=Y(ee+z),ce=this&&this!==er&&this instanceof L?N:a;++X<ee;)ne[X]=S[X];for(;z--;)ne[X++]=arguments[++B];return $r(ce,O?h:this,ne)}return L}function aE(a){return function(u,h,S){return S&&typeof S!="number"&&Lr(u,h,S)&&(h=S=t),u=hs(u),h===t?(h=u,u=0):h=hs(h),S=S===t?u<h?1:-1:hs(S),jN(u,h,S,a)}}function mh(a){return function(u,h){return typeof u=="string"&&typeof h=="string"||(u=Dn(u),h=Dn(h)),a(u,h)}}function lE(a,u,h,S,O,N,L,B,z,X){var ee=u&E,ne=ee?L:t,ce=ee?t:L,ve=ee?N:t,Ce=ee?t:N;u|=ee?P:M,u&=~(ee?M:P),u&_||(u&=~(x|v));var Fe=[a,u,O,ve,ne,Ce,ce,B,z,X],Re=h.apply(t,Fe);return Fb(a)&&SE(Re,Fe),Re.placeholder=S,wE(Re,a,u)}function Pb(a){var u=yt[a];return function(h,S){if(h=Dn(h),S=S==null?0:or(Ne(S),292),S&&as(h)){var O=(St(h)+"e").split("e"),N=u(O[0]+"e"+(+O[1]+S));return O=(St(N)+"e").split("e"),+(O[0]+"e"+(+O[1]-S))}return u(h)}}var tM=Gs&&1/ql(new Gs([,-0]))[1]==fe?function(a){return new Gs(a)}:Xb;function uE(a){return function(u){var h=xr(u);return h==At?zs(u):h==Se?jp(u):wv(u,a(u))}}function cs(a,u,h,S,O,N,L,B){var z=u&v;if(!z&&typeof a!="function")throw new Dr(i);var X=S?S.length:0;if(X||(u&=~(P|M),S=O=t),L=L===t?L:Tt(Ne(L),0),B=B===t?B:Ne(B),X-=O?O.length:0,u&M){var ee=S,ne=O;S=O=t}var ce=z?t:Tb(a),ve=[a,u,h,S,O,ee,ne,N,L,B];if(ce&&gM(ve,ce),a=ve[0],u=ve[1],h=ve[2],S=ve[3],O=ve[4],B=ve[9]=ve[9]===t?z?0:a.length:Tt(ve[9]-X,0),!B&&u&(E|k)&&(u&=~(E|k)),!u||u==x)var Ce=ZN(a,u,h);else u==E||u==k?Ce=XN(a,u,B):(u==P||u==(x|P))&&!O.length?Ce=eM(a,u,h,S):Ce=dh.apply(t,ve);var Fe=ce?BC:SE;return wE(Fe(Ce,ve),a,u)}function cE(a,u,h,S){return a===t||oi(a,Js[h])&&!dt.call(S,h)?u:a}function fE(a,u,h,S,O,N){return Ht(a)&&Ht(u)&&(N.set(u,a),tr(a,u,t,fE,N),N.delete(u)),a}function rM(a){return Kc(a)?t:a}function dE(a,u,h,S,O,N){var L=h&b,B=a.length,z=u.length;if(B!=z&&!(L&&z>B))return!1;var X=N.get(a),ee=N.get(u);if(X&&ee)return X==u&&ee==a;var ne=-1,ce=!0,ve=h&q?new ls:t;for(N.set(a,u),N.set(u,a);++ne<B;){var Ce=a[ne],Fe=u[ne];if(S)var Re=L?S(Fe,Ce,ne,u,a,N):S(Ce,Fe,ne,a,u,N);if(Re!==t){if(Re)continue;ce=!1;break}if(ve){if(!Rl(u,function(Ye,Xe){if(!gt(ve,Xe)&&(Ce===Ye||O(Ce,Ye,h,S,N)))return ve.push(Xe)})){ce=!1;break}}else if(!(Ce===Fe||O(Ce,Fe,h,S,N))){ce=!1;break}}return N.delete(a),N.delete(u),ce}function nM(a,u,h,S,O,N,L){switch(h){case mt:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case Lt:return!(a.byteLength!=u.byteLength||!N(new Al(a),new Al(u)));case Tr:case wr:case Pi:return oi(+a,+u);case bt:return a.name==u.name&&a.message==u.message;case ge:case Qe:return a==u+"";case At:var B=zs;case Se:var z=S&b;if(B||(B=ql),a.size!=u.size&&!z)return!1;var X=L.get(a);if(X)return X==u;S|=q,L.set(a,u);var ee=dE(B(a),B(u),S,O,N,L);return L.delete(a),ee;case xt:if(la)return la.call(a)==la.call(u)}return!1}function iM(a,u,h,S,O,N){var L=h&b,B=kb(a),z=B.length,X=kb(u),ee=X.length;if(z!=ee&&!L)return!1;for(var ne=z;ne--;){var ce=B[ne];if(!(L?ce in u:dt.call(u,ce)))return!1}var ve=N.get(a),Ce=N.get(u);if(ve&&Ce)return ve==u&&Ce==a;var Fe=!0;N.set(a,u),N.set(u,a);for(var Re=L;++ne<z;){ce=B[ne];var Ye=a[ce],Xe=u[ce];if(S)var vn=L?S(Xe,Ye,ce,u,a,N):S(Ye,Xe,ce,a,u,N);if(!(vn===t?Ye===Xe||O(Ye,Xe,h,S,N):vn)){Fe=!1;break}Re||(Re=ce=="constructor")}if(Fe&&!Re){var Ur=a.constructor,bn=u.constructor;Ur!=bn&&"constructor"in a&&"constructor"in u&&!(typeof Ur=="function"&&Ur instanceof Ur&&typeof bn=="function"&&bn instanceof bn)&&(Fe=!1)}return N.delete(a),N.delete(u),Fe}function fs(a){return jb(vE(a,t,qE),a+"")}function kb(a){return ah(a,pr,Nb)}function Ab(a){return ah(a,Xr,pE)}var Tb=jl?function(a){return jl.get(a)}:Xb;function gh(a){for(var u=a.name+"",h=Ys[u],S=dt.call(Ys,u)?h.length:0;S--;){var O=h[S],N=O.func;if(N==null||N==a)return O.name}return u}function Gl(a){var u=dt.call($,"placeholder")?$:a;return u.placeholder}function xe(){var a=$.iteratee||Qb;return a=a===Qb?C:a,arguments.length?a(arguments[0],arguments[1]):a}function yh(a,u){var h=a.__data__;return dM(u)?h[typeof u=="string"?"string":"hash"]:h.map}function $b(a){for(var u=pr(a),h=u.length;h--;){var S=u[h],O=a[S];u[h]=[S,O,gE(O)]}return u}function da(a,u){var h=Qo(a,u);return Ge(h)?h:t}function sM(a){var u=dt.call(a,os),h=a[os];try{a[os]=t;var S=!0}catch{}var O=Pl.call(a);return S&&(u?a[os]=h:delete a[os]),O}var Nb=Ml?function(a){return a==null?[]:(a=Ze(a),Ai(Ml(a),function(u){return ta.call(a,u)}))}:eS,pE=Ml?function(a){for(var u=[];a;)Ti(u,Nb(a)),a=Tl(a);return u}:eS,xr=hr;(Mc&&xr(new Mc(new ArrayBuffer(1)))!=mt||sa&&xr(new sa)!=At||Fc&&xr(Fc.resolve())!=re||Gs&&xr(new Gs)!=Se||oa&&xr(new oa)!=oe)&&(xr=function(a){var u=hr(a),h=u==te?a.constructor:t,S=h?pa(h):"";if(S)switch(S){case Vv:return mt;case Wv:return At;case zv:return re;case Jv:return Se;case Gv:return oe}return u});function oM(a,u,h){for(var S=-1,O=h.length;++S<O;){var N=h[S],L=N.size;switch(N.type){case"drop":a+=L;break;case"dropRight":u-=L;break;case"take":u=or(u,a+L);break;case"takeRight":a=Tt(a,u-L);break}}return{start:a,end:u}}function aM(a){var u=a.match(Kn);return u?u[1].split(Pn):[]}function hE(a,u,h){u=to(u,a);for(var S=-1,O=u.length,N=!1;++S<O;){var L=si(u[S]);if(!(N=a!=null&&h(a,L)))break;a=a[L]}return N||++S!=O?N:(O=a==null?0:a.length,!!O&&xh(O)&&ds(L,O)&&(Te(a)||ha(a)))}function lM(a){var u=a.length,h=new a.constructor(u);return u&&typeof a[0]=="string"&&dt.call(a,"index")&&(h.index=a.index,h.input=a.input),h}function mE(a){return typeof a.constructor=="function"&&!Gc(a)?Ks(Tl(a)):{}}function uM(a,u,h){var S=a.constructor;switch(u){case Lt:return Ib(a);case Tr:case wr:return new S(+a);case mt:return zN(a,h);case Ee:case In:case cl:case Fs:case Uo:case Ds:case ki:case js:case mc:return QC(a,h);case At:return new S;case Pi:case Qe:return new S(a);case ge:return JN(a);case Se:return new S;case xt:return GN(a)}}function cM(a,u){var h=u.length;if(!h)return a;var S=h-1;return u[S]=(h>1?"& ":"")+u[S],u=u.join(h>2?", ":" "),a.replace(dr,`{
1
+ var AL=Object.create;var Eh=Object.defineProperty;var TL=Object.getOwnPropertyDescriptor;var $L=Object.getOwnPropertyNames;var NL=Object.getPrototypeOf,ML=Object.prototype.hasOwnProperty;var wt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var le=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var V=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},io=(t,e)=>{for(var r in e)Eh(t,r,{get:e[r],enumerable:!0})},oq=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $L(e))!ML.call(t,i)&&i!==r&&Eh(t,i,{get:()=>e[i],enumerable:!(n=TL(e,i))||n.enumerable});return t};var Qc=(t,e,r)=>(r=t!=null?AL(NL(t)):{},oq(e||!t||!t.__esModule?Eh(r,"default",{value:t,enumerable:!0}):r,t)),Ql=t=>oq(Eh({},"__esModule",{value:!0}),t);function Wt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function Pt(t){let e=Date.now().toString(36)+(FL++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${Wt(t)}_${e}`:e}function rS(){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 Zc(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 DL(t){return JSON.parse(JSON.stringify(t))}function jL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function LL(t,e){try{return JSON.parse(t)}catch{return e}}function UL(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 HL(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var FL,jn=le(()=>{"use strict";FL=0});import*as pt from"fs";import*as Sn from"path";function Ih(t){if(!pt.existsSync(t))return;let e={},r=Sn.join(t,qh.preRequest);pt.existsSync(r)&&(e.preRequest=pt.readFileSync(r,"utf-8"));let n=Sn.join(t,qh.postResponse);return pt.existsSync(n)&&(e.postResponse=pt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function Oh(t,e){await pt.promises.mkdir(t,{recursive:!0});let r=Sn.join(t,qh.preRequest);e.preRequest?await pt.promises.writeFile(r,e.preRequest,"utf-8"):pt.existsSync(r)&&await pt.promises.unlink(r);let n=Sn.join(t,qh.postResponse);e.postResponse?await pt.promises.writeFile(n,e.postResponse,"utf-8"):pt.existsSync(n)&&await pt.promises.unlink(n)}function lq(t){for(let[e,r]of Object.entries(aq)){let n=Sn.join(t,e);if(pt.existsSync(n))try{let i=pt.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 uq(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 cq(t,e){for(let r of Object.keys(aq))if(r!==e){let n=Sn.join(t,r);if(pt.existsSync(n))try{await pt.promises.unlink(n)}catch{}}}function fq(t){if(pt.existsSync(t))try{let e=pt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function dq(t,e,r){let n=Sn.join(t,Xc.responseSchema),i=Sn.join(t,Xc.bodySchema);e?await pt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):pt.existsSync(n)&&await pt.promises.unlink(n),r?await pt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):pt.existsSync(i)&&await pt.promises.unlink(i)}function nS(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=nS(r.items,e);if(n)return n}}}function iS(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&&iS(n.items,e))return!0}return!1}function pq(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 sS(t,e){let r;try{r=pt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===wn)continue;if(n.name===e)return Sn.join(t,n.name);let i=sS(Sn.join(t,n.name),e);if(i)return i}}function BL(t){for(let e of[Hr.request,Hr.folder]){let r=Sn.join(t,e);if(pt.existsSync(r))try{let n=pt.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function oS(t,e){let r;try{r=pt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===wn)continue;let i=Sn.join(t,n.name);if(BL(i)===e)return i;let s=oS(i,e);if(s)return s}}function Ln(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 y of s){let b=parseInt(y.substring(1));b>o&&(o=b)}let l="";if(o>0)l=`t${o}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let c=r;n&&(c=c.substring(n[0].length)),c=c.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),c=c.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),c=c.replace(/\([^)]+\)/g,""),c=c.replace(/:[a-z_][a-z0-9_]*/gi,""),c=c.replace(/\{[^}]+\}/g,""),c=c.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=c.split("-").filter(y=>y.length>0),p=[];i&&p.push(i),p.push(...d),l&&p.push(l);let m=p.join("-");if(m||(m="item"),e.includes(m)){let y=2;for(;e.includes(`${m}-${y}`);)y++;m=`${m}-${y}`}return m}var qh,Hr,aq,Xc,wn,ma=le(()=>{"use strict";qh={preRequest:"pre-request.js",postResponse:"post-response.js"},Hr={collection:"collection.json",folder:"folder.json",request:"request.json"},aq={"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"}},Xc={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},wn="scripts"});import*as $e from"fs";import*as De from"path";var so,Ph=le(()=>{"use strict";jn();ma();so=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(){$e.existsSync(this.collectionsDir)||$e.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=$e.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(),!$e.existsSync(this.collectionsDir))return[];let e=$e.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=De.join(this.collectionsDir,e),n=De.join(r,Hr.collection);if(!$e.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(De.join(r,wn)),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=$e.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===wn)continue;let c=De.join(e,l.name);if($e.existsSync(De.join(c,Hr.folder))){let d=this.loadFolderFromDir(c,l.name);d&&s.set(l.name,d)}else if($e.existsSync(De.join(c,Hr.request))){let d=this.loadRequestFromDir(c,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let c=s.get(l);c&&(i.push(c),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=De.join(e,Hr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(De.join(e,wn)),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=De.join(e,Hr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(De.join(e,wn)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let c=this.loadSchemaFile(De.join(e,Xc.responseSchema)),d=this.loadSchemaFile(De.join(e,Xc.bodySchema)),p=De.join(e,"doc.md"),m=$e.existsSync(p)?$e.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,bodyContentType:i.bodyContentType,auth:i.auth,settings:i.settings,scripts:s,disabled:i.disabled,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...m&&{doc:m},...c&&{responseSchema:c},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Ih(e)}loadBodyFromDir(e){return lq(e)}loadSchemaFile(e){return fq(e)}async saveSchemaFiles(e,r){return dq(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=Pt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=$e.readdirSync(this.collectionsDir);r=Ln(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=De.join(this.collectionsDir,r),i=!$e.existsSync(n);await $e.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(De.join(n,wn),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await $e.promises.writeFile(De.join(n,Hr.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=Ln(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 c=De.join(e,l);await $e.promises.mkdir(c,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(c,o,n):await this.saveRequestToDir(c,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(De.join(e,wn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await $e.promises.writeFile(De.join(e,Hr.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,bodyContentType:r.bodyContentType,auth:r.auth,settings:r.settings,...r.disabled!==void 0&&{disabled:r.disabled},...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=[$e.promises.writeFile(De.join(e,Hr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push($e.promises.writeFile(De.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($e.promises.writeFile(De.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(De.join(e,wn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return uq(e)}async cleanupOldBodyFiles(e,r){return cq(e,r)}async saveScriptsToDir(e,r){return Oh(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=De.join(this.collectionsDir,r);if(!$e.existsSync(n))return!1;try{return await $e.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?$e.existsSync(De.join(this.collectionsDir,r,Hr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return De.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||Pt(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(De.join(s,wn),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(De.join(n,wn))}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=De.join(this.collectionsDir,i),o=De.join(s,Hr.collection),l=$e.readFileSync(o,"utf-8"),d={...JSON.parse(l),...r,id:e};await $e.promises.writeFile(o,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=De.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=$e.readdirSync(o).filter(m=>$e.statSync(De.join(o,m)).isDirectory()&&m!==wn);l=Ln(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let c=De.join(o,l);await $e.promises.mkdir(c,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(c,r):await this.saveRequestToDir(c,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,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||!$e.existsSync(i))return!1;try{await $e.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:c,items:d,...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||!$e.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=De.join(this.collectionsDir,s);let c=this.idToSlugMap.get(r);if(!c)return!1;let d=De.join(l,c);if($e.existsSync(d))return!1;try{await $e.promises.rename(o,d);let p=this.findItemById(i.items,r);if(p){let m=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(m))}else i.items.push(m)}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 c=this.idToSlugMap.get(l);c&&o.push(c)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let c=De.join(l,Hr.folder),d=$e.readFileSync(c,"utf-8"),p=JSON.parse(d);p.order=o,await $e.promises.writeFile(c,JSON.stringify(p,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let l=De.join(this.collectionsDir,s,Hr.collection),c=$e.readFileSync(l,"utf-8"),d=JSON.parse(c);d.order=o,await $e.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return pq(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=De.join(this.collectionsDir,n),s=oS(i,r);if(s)return s;let o=this.load(e);if(o){let c=this.buildSlugPath(o.items,r);if(c)return De.join(i,...c)}let l=this.idToSlugMap.get(r);if(l)return sS(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 nS(e,r)}deleteItemFromTree(e,r){return iS(e,r)}}});var Ct,ga=le(()=>{"use strict";Ct=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(),c=i.substring(o+1).trim(),d={name:l,value:c,domain:r};for(let p of s){let m=p.indexOf("="),y=(m===-1?p:p.substring(0,m)).toLowerCase(),b=m===-1?"":p.substring(m+1);switch(y){case"domain":d.domain=b.startsWith(".")?b.substring(1):b;break;case"path":d.path=b;break;case"expires":d.expires=b;break;case"max-age":d.maxAge=parseInt(b,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=b;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let 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"/"}}}});import*as oo from"fs";import*as ya from"path";function Ah(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function nf(t){if(!oo.existsSync(t))return WL();let e=kh(ya.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=oo.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!Ah(d)),s={};for(let d of i){let p=kh(ya.join(t,d))||{},m=ya.basename(d,".json");s[m]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(kh(ya.join(t,"_global.local.json"))||{}).variables||{},c={};for(let d of Object.keys(s)){let p=ya.join(t,`${d}.local.json`);if(oo.existsSync(p)){let m=kh(p)||{};c[d]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:c}}function WL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function kh(t){try{if(!oo.existsSync(t))return null;let e=oo.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 Th=le(()=>{"use strict"});var li,Xl=le(()=>{"use strict";li=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 c=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);c&&(n=c[1],i=c[2],s=c[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(d,(m,y,b)=>{let q=r[y];return q!==void 0&&q!==""?encodeURIComponent(q):b?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),m)});return p=p.replace(/([^:])\/+/g,"$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[c,d]=e.split("?");n=c,d&&new URLSearchParams(d).forEach((m,y)=>{i[y]=m})}let s={...i,...r},o=new URLSearchParams;for(let[c,d]of Object.entries(s))d!=null&&o.append(c,d);let l=o.toString();return l?`${n}?${l}`:n}}});function mq(t,e=0){return(mr[t[e+0]]+mr[t[e+1]]+mr[t[e+2]]+mr[t[e+3]]+"-"+mr[t[e+4]]+mr[t[e+5]]+"-"+mr[t[e+6]]+mr[t[e+7]]+"-"+mr[t[e+8]]+mr[t[e+9]]+"-"+mr[t[e+10]]+mr[t[e+11]]+mr[t[e+12]]+mr[t[e+13]]+mr[t[e+14]]+mr[t[e+15]]).toLowerCase()}var mr,gq=le(()=>{mr=[];for(let t=0;t<256;++t)mr.push((t+256).toString(16).slice(1))});function uS(){return crypto.getRandomValues(zL)}var zL,yq=le(()=>{zL=new Uint8Array(16)});function JL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():GL(t,e,r)}function GL(t,e,r){t=t||{};let n=t.random??t.rng?.()??uS();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 mq(n)}var eu,vq=le(()=>{yq();gq();eu=JL});var cS=le(()=>{vq()});function YL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function KL(){return Date.now()}function bq(){return eu()}function QL(){return eu()}function Sq(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 ZL(){let t=Sq(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function XL(){return Math.random()<.5}function e2(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 t2(){return Math.floor(Date.now()/1e3)}function r2(){return new Date().toISOString()}function n2(){return new Date().toISOString().split("T")[0]}function i2(){return new Date().toISOString().split("T")[1].split(".")[0]}function s2(){return new Date().toISOString()}function o2(t=""){return Buffer.from(String(t)).toString("base64")}function a2(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function l2(t=""){return encodeURIComponent(String(t))}function u2(t=""){return decodeURIComponent(String(t))}function c2(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 ys(t,e){let r=wq[t];return r?e&&e.length>0?r(...e):r():null}function f2(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?c2(n):void 0,s=ys(r,i);return s===null?e:String(s)}catch{return e}})}function va(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=ys(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var wq,$h=le(()=>{"use strict";cS();wq={randomInt:YL,timestamp:KL,guid:QL,uuid:bq,randomUUID:bq,randomString:Sq,randomHexadecimal:e2,randomEmail:ZL,randomBoolean:XL,isoTimestamp:s2,timestamp_s:t2,datetime:r2,date:n2,time:i2,base64Encode:o2,base64Decode:a2,urlEncode:l2,urlDecode:u2}});import*as Nh from"vm";function ba(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ui(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=Nh.createContext(r);return Nh.runInContext(t,n,{timeout:d2,displayErrors:!1})}catch{return}}var d2,sf=le(()=>{"use strict";d2=100});import*as Mh from"crypto";function p2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function af(t){if(!t||!t.includes("|"))return null;let e=h2(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=m2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function h2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],c=o>0?t[o-1]:"",d=o<t.length-1?t[o+1]:"";if(c==="\\"){r+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function m2(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:g2(n)}}function g2(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 zt(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=p2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function lf(t,e,r={}){let n=t;for(let i of e)n=y2(n,i.name,i.args,r);return n}function y2(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=zt(r[0],n),s=r[1]!==void 0?zt(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(zt(r[0],n)):"",s=r[1]!==void 0?String(zt(r[1],n)):"";return String(t).replace(new RegExp(b2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(zt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(zt(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(zt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=zt(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=zt(r[0],n);return Number(t)+i}case"subtract":{let i=zt(r[0],n);return Number(t)-i}case"multiply":{let i=zt(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?zt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?zt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Mh.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(zt(r[0],n)):"",s=String(r[1]!==void 0?zt(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?zt(r[2],n):"base64"),c={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Mh.createHmac(c,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=zt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=zt(r[0],n),s=r[1]!==void 0?zt(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:v2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(zt(s,n)));return i.length===1?t.map(s=>of(s,i[0])):t.map(s=>{let o={};for(let l of i){let c=of(s,l);c!==void 0&&(o[l]=c)}return o})}case"prop":{let i=r[0]!==void 0?String(zt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>of(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?of(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 v2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=zt(o,r);return t.filter(c=>{let d=of(c,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function of(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function b2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Fh=le(()=>{"use strict"});function _q(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 S2(t){return new Sa(t)}var Sa,wa,uf=le(()=>{"use strict";$h();sf();Fh();Sa=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,(c,d)=>this.resolveTemplateContent(d.trim(),r,c));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let c=l[1].trim(),d=this.resolveTemplateContent(c,r,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(d),p):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,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=_q(i[2],r),c=ys(i[1],l);return c!==null?String(c):n}let s=af(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let c=lf(l,s.filters,r);return c!==void 0?String(c):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 c=this.deserializeValue(r[l]),d=o[2],p=this.resolvePropertyAccess(c,d);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];if(typeof l=="string"&&l.charCodeAt(0)===30){let c=l.slice(1);return c==="undefined"?"":c}return String(l)}if(ba(e)){let l=this.deserializeVariables(r),c=va(e,l),d=Ui(e,c);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=_q(n[2],r),o=ys(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(ba(e)){let s=this.deserializeVariables(r),o=va(e,s),l=Ui(e,o);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}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}},wa=class{interpolate(e,r){return!e||typeof e!="string"?e:new Sa({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 vs,cf=le(()=>{"use strict";vs=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r={},n;try{n=await this.interceptors.executeRequestInterceptors(e,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,e,r);if(s)return s;throw i}try{let i=await this.httpClient.send(n);return await this.interceptors.executeResponseInterceptors(i,n,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,n,r);if(s)return s;throw i}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var bs,fS,dS,pS,ff=le(()=>{"use strict";bs=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))}},fS=class{name="logging";priority=1e3;intercept(e,r){return e}},dS=class{name="timing";priority=1;intercept(e,r,n){return e}},pS=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 Rq=V((tu,df)=>{(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__",c=500,d="__lodash_placeholder__",p=1,m=2,y=4,b=1,q=2,x=1,v=2,R=4,E=8,k=16,P=32,M=64,j=128,I=256,_=512,A=30,F="...",U=800,D=16,J=1,Q=2,se=3,fe=1/0,He=9007199254740991,_e=17976931348623157e292,ye=NaN,Pe=4294967295,ht=Pe-1,Nt=Pe>>>1,he=[["ary",j],["bind",x],["bindKey",v],["curry",E],["curryRight",k],["flip",_],["partial",P],["partialRight",M],["rearg",I]],Yt="[object Arguments]",Ar="[object Array]",at="[object AsyncFunction]",Tr="[object Boolean]",wr="[object Date]",Rt="[object DOMException]",bt="[object Error]",Jr="[object Function]",Ms="[object GeneratorFunction]",At="[object Map]",Pi="[object Number]",qn="[object Null]",te="[object Object]",re="[object Promise]",Ae="[object Proxy]",ge="[object RegExp]",Se="[object Set]",Qe="[object String]",xt="[object Symbol]",sr="[object Undefined]",oe="[object WeakMap]",fr="[object WeakSet]",Lt="[object ArrayBuffer]",mt="[object DataView]",Ee="[object Float32Array]",In="[object Float64Array]",cl="[object Int8Array]",Fs="[object Int16Array]",Uo="[object Int32Array]",Ds="[object Uint8Array]",ki="[object Uint8ClampedArray]",js="[object Uint16Array]",mc="[object Uint32Array]",fl=/\b__p \+= '';/g,Uy=/\b(__p \+=) '' \+/g,Ho=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ts=/&(?:amp|lt|gt|quot|#39);/g,dl=/[&<>"']/g,pl=RegExp(ts.source),me=RegExp(dl.source),Hy=/<%-([\s\S]+?)%>/g,By=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,Gr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Be=/^\w*$/,gc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ct=/[\\^$.*+?()[\]{}|]/g,Bo=RegExp(ct.source),yc=/^\s+/,hl=/\s/,dr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Kn=/\{\n\/\* \[wrapped with (.+)\] \*/,Pn=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Yr=/[()=,{}\[\]\/\s]/,Qn=/\\(\\)?/g,rs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mp=/\w*$/,Vy=/^[-+]0x[0-9a-f]+$/i,Vo=/^0b[01]+$/i,gp=/^\[object .+?Constructor\]$/,Wy=/^0o[0-7]+$/i,Ls=/^(?:0|[1-9]\d*)$/,Wo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zo=/($^)/,zy=/['\n\r\u2028\u2029\\]/g,ml="\\ud800-\\udfff",Jy="\\u0300-\\u036f",Ut="\\ufe20-\\ufe2f",vc="\\u20d0-\\u20ff",yp=Jy+Ut+vc,bc="\\u2700-\\u27bf",Sc="a-z\\xdf-\\xf6\\xf8-\\xff",Gy="\\xac\\xb1\\xd7\\xf7",Yy="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ky="\\u2000-\\u206f",Qy=" \\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",vp="A-Z\\xc0-\\xd6\\xd8-\\xde",bp="\\ufe0e\\ufe0f",wc=Gy+Yy+Ky+Qy,gl="['\u2019]",Zy="["+ml+"]",Sp="["+wc+"]",yl="["+yp+"]",_c="\\d+",Xy="["+bc+"]",Us="["+Sc+"]",Jo="[^"+ml+wc+_c+bc+Sc+vp+"]",vl="\\ud83c[\\udffb-\\udfff]",Go="(?:"+yl+"|"+vl+")",kn="[^"+ml+"]",Rc="(?:\\ud83c[\\udde6-\\uddff]){2}",xc="[\\ud800-\\udbff][\\udc00-\\udfff]",Hs="["+vp+"]",wp="\\u200d",_p="(?:"+Us+"|"+Jo+")",ev="(?:"+Hs+"|"+Jo+")",Rp="(?:"+gl+"(?:d|ll|m|re|s|t|ve))?",xp="(?:"+gl+"(?:D|LL|M|RE|S|T|VE))?",bl=Go+"?",Cp="["+bp+"]?",Ep="(?:"+wp+"(?:"+[kn,Rc,xc].join("|")+")"+Cp+bl+")*",tv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qp=Cp+bl+Ep,nv="(?:"+[Xy,Rc,xc].join("|")+")"+qp,iv="(?:"+[kn+yl+"?",yl,Rc,xc,Zy].join("|")+")",sv=RegExp(gl,"g"),ov=RegExp(yl,"g"),Cc=RegExp(vl+"(?="+vl+")|"+iv+qp,"g"),av=RegExp([Hs+"?"+Us+"+"+Rp+"(?="+[Sp,Hs,"$"].join("|")+")",ev+"+"+xp+"(?="+[Sp,Hs+_p,"$"].join("|")+")",Hs+"?"+_p+"+"+Rp,Hs+"+"+xp,rv,tv,_c,nv].join("|"),"g"),lv=RegExp("["+wp+ml+yp+bp+"]"),uv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cv=["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"],fv=-1,Ot={};Ot[Ee]=Ot[In]=Ot[cl]=Ot[Fs]=Ot[Uo]=Ot[Ds]=Ot[ki]=Ot[js]=Ot[mc]=!0,Ot[Yt]=Ot[Ar]=Ot[Lt]=Ot[Tr]=Ot[mt]=Ot[wr]=Ot[bt]=Ot[Jr]=Ot[At]=Ot[Pi]=Ot[te]=Ot[ge]=Ot[Se]=Ot[Qe]=Ot[oe]=!1;var Et={};Et[Yt]=Et[Ar]=Et[Lt]=Et[mt]=Et[Tr]=Et[wr]=Et[Ee]=Et[In]=Et[cl]=Et[Fs]=Et[Uo]=Et[At]=Et[Pi]=Et[te]=Et[ge]=Et[Se]=Et[Qe]=Et[xt]=Et[Ds]=Et[ki]=Et[js]=Et[mc]=!0,Et[bt]=Et[Jr]=Et[oe]=!1;var Ec={\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"},qc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dv={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Ip={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Op=parseFloat,pv=parseInt,Pp=typeof global=="object"&&global&&global.Object===Object&&global,hv=typeof self=="object"&&self&&self.Object===Object&&self,er=Pp||hv||Function("return this")(),Sl=typeof tu=="object"&&tu&&!tu.nodeType&&tu,ft=Sl&&typeof df=="object"&&df&&!df.nodeType&&df,Bs=ft&&ft.exports===Sl,ns=Bs&&Pp.process,Kr=(function(){try{var W=ft&&ft.require&&ft.require("util").types;return W||ns&&ns.binding&&ns.binding("util")}catch{}})(),Ic=Kr&&Kr.isArrayBuffer,kp=Kr&&Kr.isDate,Ap=Kr&&Kr.isMap,Yo=Kr&&Kr.isRegExp,Zn=Kr&&Kr.isSet,wl=Kr&&Kr.isTypedArray;function $r(W,Z,Y){switch(Y.length){case 0:return W.call(Z);case 1:return W.call(Z,Y[0]);case 2:return W.call(Z,Y[0],Y[1]);case 3:return W.call(Z,Y[0],Y[1],Y[2])}return W.apply(Z,Y)}function Xn(W,Z,Y,pe){for(var Ie=-1,lt=W==null?0:W.length;++Ie<lt;){var yt=W[Ie];Z(pe,yt,Y(yt),W)}return pe}function Nr(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe&&Z(W[Y],Y,W)!==!1;);return W}function Oc(W,Z){for(var Y=W==null?0:W.length;Y--&&Z(W[Y],Y,W)!==!1;);return W}function Tp(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(!Z(W[Y],Y,W))return!1;return!0}function Ai(W,Z){for(var Y=-1,pe=W==null?0:W.length,Ie=0,lt=[];++Y<pe;){var yt=W[Y];Z(yt,Y,W)&&(lt[Ie++]=yt)}return lt}function _l(W,Z){var Y=W==null?0:W.length;return!!Y&&is(W,Z,0)>-1}function Vs(W,Z,Y){for(var pe=-1,Ie=W==null?0:W.length;++pe<Ie;)if(Y(Z,W[pe]))return!0;return!1}function qt(W,Z){for(var Y=-1,pe=W==null?0:W.length,Ie=Array(pe);++Y<pe;)Ie[Y]=Z(W[Y],Y,W);return Ie}function Ti(W,Z){for(var Y=-1,pe=Z.length,Ie=W.length;++Y<pe;)W[Ie+Y]=Z[Y];return W}function Pc(W,Z,Y,pe){var Ie=-1,lt=W==null?0:W.length;for(pe&&lt&&(Y=W[++Ie]);++Ie<lt;)Y=Z(Y,W[Ie],Ie,W);return Y}function mv(W,Z,Y,pe){var Ie=W==null?0:W.length;for(pe&&Ie&&(Y=W[--Ie]);Ie--;)Y=Z(Y,W[Ie],Ie,W);return Y}function Rl(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(Z(W[Y],Y,W))return!0;return!1}var gv=Ko("length");function yv(W){return W.split("")}function vv(W){return W.match(Kt)||[]}function $p(W,Z,Y){var pe;return Y(W,function(Ie,lt,yt){if(Z(Ie,lt,yt))return pe=lt,!1}),pe}function xl(W,Z,Y,pe){for(var Ie=W.length,lt=Y+(pe?1:-1);pe?lt--:++lt<Ie;)if(Z(W[lt],lt,W))return lt;return-1}function is(W,Z,Y){return Z===Z?qv(W,Z,Y):xl(W,ss,Y)}function bv(W,Z,Y,pe){for(var Ie=Y-1,lt=W.length;++Ie<lt;)if(pe(W[Ie],Z))return Ie;return-1}function ss(W){return W!==W}function Np(W,Z){var Y=W==null?0:W.length;return Y?Ac(W,Z)/Y:ye}function Ko(W){return function(Z){return Z==null?t:Z[W]}}function kc(W){return function(Z){return W==null?t:W[Z]}}function Cl(W,Z,Y,pe,Ie){return Ie(W,function(lt,yt,Ze){Y=pe?(pe=!1,lt):Z(Y,lt,yt,Ze)}),Y}function Sv(W,Z){var Y=W.length;for(W.sort(Z);Y--;)W[Y]=W[Y].value;return W}function Ac(W,Z){for(var Y,pe=-1,Ie=W.length;++pe<Ie;){var lt=Z(W[pe]);lt!==t&&(Y=Y===t?lt:Y+lt)}return Y}function Tc(W,Z){for(var Y=-1,pe=Array(W);++Y<W;)pe[Y]=Z(Y);return pe}function wv(W,Z){return qt(Z,function(Y){return[Y,W[Y]]})}function $c(W){return W&&W.slice(0,Lp(W)+1).replace(yc,"")}function Mr(W){return function(Z){return W(Z)}}function El(W,Z){return qt(Z,function(Y){return W[Y]})}function gt(W,Z){return W.has(Z)}function Mp(W,Z){for(var Y=-1,pe=W.length;++Y<pe&&is(Z,W[Y],0)>-1;);return Y}function Fp(W,Z){for(var Y=W.length;Y--&&is(Z,W[Y],0)>-1;);return Y}function Dp(W,Z){for(var Y=W.length,pe=0;Y--;)W[Y]===Z&&++pe;return pe}var _v=kc(Ec),Rv=kc(qc);function xv(W){return"\\"+Ip[W]}function Qo(W,Z){return W==null?t:W[Z]}function Ws(W){return lv.test(W)}function Cv(W){return uv.test(W)}function Ev(W){for(var Z,Y=[];!(Z=W.next()).done;)Y.push(Z.value);return Y}function zs(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe,Ie){Y[++Z]=[Ie,pe]}),Y}function Zo(W,Z){return function(Y){return W(Z(Y))}}function An(W,Z){for(var Y=-1,pe=W.length,Ie=0,lt=[];++Y<pe;){var yt=W[Y];(yt===Z||yt===d)&&(W[Y]=d,lt[Ie++]=Y)}return lt}function ql(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=pe}),Y}function jp(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=[pe,pe]}),Y}function qv(W,Z,Y){for(var pe=Y-1,Ie=W.length;++pe<Ie;)if(W[pe]===Z)return pe;return-1}function Nc(W,Z,Y){for(var pe=Y+1;pe--;)if(W[pe]===Z)return pe;return pe}function $i(W){return Ws(W)?Ov(W):gv(W)}function Fr(W){return Ws(W)?Pv(W):yv(W)}function Lp(W){for(var Z=W.length;Z--&&hl.test(W.charAt(Z)););return Z}var Iv=kc(dv);function Ov(W){for(var Z=Cc.lastIndex=0;Cc.test(W);)++Z;return Z}function Pv(W){return W.match(Cc)||[]}function kv(W){return W.match(av)||[]}var Av=(function W(Z){Z=Z==null?er:Ni.defaults(er.Object(),Z,Ni.pick(er,cv));var Y=Z.Array,pe=Z.Date,Ie=Z.Error,lt=Z.Function,yt=Z.Math,Ze=Z.Object,Il=Z.RegExp,Tv=Z.String,Dr=Z.TypeError,Xo=Y.prototype,$v=lt.prototype,Js=Ze.prototype,ea=Z["__core-js_shared__"],Ol=$v.toString,dt=Js.hasOwnProperty,Nv=0,Up=(function(){var a=/[^.]+$/.exec(ea&&ea.keys&&ea.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Pl=Js.toString,Mv=Ol.call(Ze),Fv=er._,Dv=Il("^"+Ol.call(dt).replace(ct,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kl=Bs?Z.Buffer:t,Mi=Z.Symbol,Al=Z.Uint8Array,Hp=kl?kl.allocUnsafe:t,Tl=Zo(Ze.getPrototypeOf,Ze),Bp=Ze.create,ta=Js.propertyIsEnumerable,$l=Xo.splice,Vp=Mi?Mi.isConcatSpreadable:t,ra=Mi?Mi.iterator:t,os=Mi?Mi.toStringTag:t,Nl=(function(){try{var a=da(Ze,"defineProperty");return a({},"",{}),a}catch{}})(),jv=Z.clearTimeout!==er.clearTimeout&&Z.clearTimeout,Lv=pe&&pe.now!==er.Date.now&&pe.now,Uv=Z.setTimeout!==er.setTimeout&&Z.setTimeout,na=yt.ceil,ia=yt.floor,Ml=Ze.getOwnPropertySymbols,Fl=kl?kl.isBuffer:t,as=Z.isFinite,Dl=Xo.join,Wp=Zo(Ze.keys,Ze),Tt=yt.max,or=yt.min,zp=pe.now,Hv=Z.parseInt,Jp=yt.random,Bv=Xo.reverse,Mc=da(Z,"DataView"),sa=da(Z,"Map"),Fc=da(Z,"Promise"),Gs=da(Z,"Set"),oa=da(Z,"WeakMap"),aa=da(Ze,"create"),jl=oa&&new oa,Ys={},Vv=pa(Mc),Wv=pa(sa),zv=pa(Fc),Jv=pa(Gs),Gv=pa(oa),Ll=Mi?Mi.prototype:t,la=Ll?Ll.valueOf:t,Gp=Ll?Ll.toString:t;function $(a){if(Vt(a)&&!Te(a)&&!(a instanceof Ve)){if(a instanceof _r)return a;if(dt.call(a,"__wrapped__"))return xE(a)}return new _r(a)}var Ks=(function(){function a(){}return function(u){if(!Ht(u))return{};if(Bp)return Bp(u);a.prototype=u;var h=new a;return a.prototype=t,h}})();function Ul(){}function _r(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}$.templateSettings={escape:Hy,evaluate:By,interpolate:On,variable:"",imports:{_:$}},$.prototype=Ul.prototype,$.prototype.constructor=$,_r.prototype=Ks(Ul.prototype),_r.prototype.constructor=_r;function Ve(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Pe,this.__views__=[]}function Yv(){var a=new Ve(this.__wrapped__);return a.__actions__=Qr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Qr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Qr(this.__views__),a}function Kv(){if(this.__filtered__){var a=new Ve(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function Dc(){var a=this.__wrapped__.value(),u=this.__dir__,h=Te(a),S=u<0,O=h?a.length:0,N=oM(0,O,this.__views__),L=N.start,B=N.end,z=B-L,X=S?B:L-1,ee=this.__iteratees__,ne=ee.length,ce=0,ve=or(z,this.__takeCount__);if(!h||!S&&O==z&&ve==z)return JC(a,this.__actions__);var Ce=[];e:for(;z--&&ce<ve;){X+=u;for(var Fe=-1,Re=a[X];++Fe<ne;){var Ye=ee[Fe],Xe=Ye.iteratee,vn=Ye.type,Ur=Xe(Re);if(vn==Q)Re=Ur;else if(!Ur){if(vn==J)continue e;break e}}Ce[ce++]=Re}return Ce}Ve.prototype=Ks(Ul.prototype),Ve.prototype.constructor=Ve;function Tn(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Qv(){this.__data__=aa?aa(null):{},this.size=0}function Zv(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function Xv(a){var u=this.__data__;if(aa){var h=u[a];return h===l?t:h}return dt.call(u,a)?u[a]:t}function eb(a){var u=this.__data__;return aa?u[a]!==t:dt.call(u,a)}function tb(a,u){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=aa&&u===t?l:u,this}Tn.prototype.clear=Qv,Tn.prototype.delete=Zv,Tn.prototype.get=Xv,Tn.prototype.has=eb,Tn.prototype.set=tb;function ei(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Yp(){this.__data__=[],this.size=0}function rb(a){var u=this.__data__,h=Bl(u,a);if(h<0)return!1;var S=u.length-1;return h==S?u.pop():$l.call(u,h,1),--this.size,!0}function nb(a){var u=this.__data__,h=Bl(u,a);return h<0?t:u[h][1]}function Kp(a){return Bl(this.__data__,a)>-1}function ib(a,u){var h=this.__data__,S=Bl(h,a);return S<0?(++this.size,h.push([a,u])):h[S][1]=u,this}ei.prototype.clear=Yp,ei.prototype.delete=rb,ei.prototype.get=nb,ei.prototype.has=Kp,ei.prototype.set=ib;function ti(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function sb(){this.size=0,this.__data__={hash:new Tn,map:new(sa||ei),string:new Tn}}function Fi(a){var u=yh(this,a).delete(a);return this.size-=u?1:0,u}function Qp(a){return yh(this,a).get(a)}function ob(a){return yh(this,a).has(a)}function ab(a,u){var h=yh(this,a),S=h.size;return h.set(a,u),this.size+=h.size==S?0:1,this}ti.prototype.clear=sb,ti.prototype.delete=Fi,ti.prototype.get=Qp,ti.prototype.has=ob,ti.prototype.set=ab;function ls(a){var u=-1,h=a==null?0:a.length;for(this.__data__=new ti;++u<h;)this.add(a[u])}function ie(a){return this.__data__.set(a,l),this}function lb(a){return this.__data__.has(a)}ls.prototype.add=ls.prototype.push=ie,ls.prototype.has=lb;function pn(a){var u=this.__data__=new ei(a);this.size=u.size}function Zp(){this.__data__=new ei,this.size=0}function tt(a){var u=this.__data__,h=u.delete(a);return this.size=u.size,h}function Hl(a){return this.__data__.get(a)}function Xp(a){return this.__data__.has(a)}function jc(a,u){var h=this.__data__;if(h instanceof ei){var S=h.__data__;if(!sa||S.length<r-1)return S.push([a,u]),this.size=++h.size,this;h=this.__data__=new ti(S)}return h.set(a,u),this.size=h.size,this}pn.prototype.clear=Zp,pn.prototype.delete=tt,pn.prototype.get=Hl,pn.prototype.has=Xp,pn.prototype.set=jc;function eh(a,u){var h=Te(a),S=!h&&ha(a),O=!h&&!S&&no(a),N=!h&&!S&&!O&&Yl(a),L=h||S||O||N,B=L?Tc(a.length,Tv):[],z=B.length;for(var X in a)(u||dt.call(a,X))&&!(L&&(X=="length"||O&&(X=="offset"||X=="parent")||N&&(X=="buffer"||X=="byteLength"||X=="byteOffset")||ds(X,z)))&&B.push(X);return B}function th(a){var u=a.length;return u?a[wb(0,u-1)]:t}function ub(a,u){return vh(Qr(a),Di(u,0,a.length))}function cb(a){return vh(Qr(a))}function Lc(a,u,h){(h!==t&&!oi(a[u],h)||h===t&&!(u in a))&&hn(a,u,h)}function jr(a,u,h){var S=a[u];(!(dt.call(a,u)&&oi(S,h))||h===t&&!(u in a))&&hn(a,u,h)}function Bl(a,u){for(var h=a.length;h--;)if(oi(a[h][0],u))return h;return-1}function rh(a,u,h,S){return ji(a,function(O,N,L){u(S,O,h(O),L)}),S}function nh(a,u){return a&&Li(u,pr(u),a)}function fb(a,u){return a&&Li(u,Xr(u),a)}function hn(a,u,h){u=="__proto__"&&Nl?Nl(a,u,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[u]=h}function Uc(a,u){for(var h=-1,S=u.length,O=Y(S),N=a==null;++h<S;)O[h]=N?t:Jb(a,u[h]);return O}function Di(a,u,h){return a===a&&(h!==t&&(a=a<=h?a:h),u!==t&&(a=a>=u?a:u)),a}function Rr(a,u,h,S,O,N){var L,B=u&p,z=u&m,X=u&y;if(h&&(L=O?h(a,S,O,N):h(a)),L!==t)return L;if(!Ht(a))return a;var ee=Te(a);if(ee){if(L=lM(a),!B)return Qr(a,L)}else{var ne=xr(a),ce=ne==Jr||ne==Ms;if(no(a))return KC(a,B);if(ne==te||ne==Yt||ce&&!O){if(L=z||ce?{}:mE(a),!B)return z?QN(a,fb(L,a)):KN(a,nh(L,a))}else{if(!Et[ne])return O?a:{};L=uM(a,ne,B)}}N||(N=new pn);var ve=N.get(a);if(ve)return ve;N.set(a,L),VE(a)?a.forEach(function(Re){L.add(Rr(Re,u,h,Re,a,N))}):HE(a)&&a.forEach(function(Re,Ye){L.set(Ye,Rr(Re,u,h,Ye,a,N))});var Ce=X?z?Ab:kb:z?Xr:pr,Fe=ee?t:Ce(a);return Nr(Fe||a,function(Re,Ye){Fe&&(Ye=Re,Re=a[Ye]),jr(L,Ye,Rr(Re,u,h,Ye,a,N))}),L}function db(a){var u=pr(a);return function(h){return $n(h,a,u)}}function $n(a,u,h){var S=h.length;if(a==null)return!S;for(a=Ze(a);S--;){var O=h[S],N=u[O],L=a[O];if(L===t&&!(O in a)||!N(L))return!1}return!0}function Hc(a,u,h){if(typeof a!="function")throw new Dr(i);return Yc(function(){a.apply(t,h)},u)}function ua(a,u,h,S){var O=-1,N=_l,L=!0,B=a.length,z=[],X=u.length;if(!B)return z;h&&(u=qt(u,Mr(h))),S?(N=Vs,L=!1):u.length>=r&&(N=gt,L=!1,u=new ls(u));e:for(;++O<B;){var ee=a[O],ne=h==null?ee:h(ee);if(ee=S||ee!==0?ee:0,L&&ne===ne){for(var ce=X;ce--;)if(u[ce]===ne)continue e;z.push(ee)}else N(u,ne,S)||z.push(ee)}return z}var ji=tE(Nn),ih=tE(ri,!0);function pb(a,u){var h=!0;return ji(a,function(S,O,N){return h=!!u(S,O,N),h}),h}function Vl(a,u,h){for(var S=-1,O=a.length;++S<O;){var N=a[S],L=u(N);if(L!=null&&(B===t?L===L&&!yn(L):h(L,B)))var B=L,z=N}return z}function hb(a,u,h,S){var O=a.length;for(h=Ne(h),h<0&&(h=-h>O?0:O+h),S=S===t||S>O?O:Ne(S),S<0&&(S+=O),S=h>S?0:zE(S);h<S;)a[h++]=u;return a}function sh(a,u){var h=[];return ji(a,function(S,O,N){u(S,O,N)&&h.push(S)}),h}function ar(a,u,h,S,O){var N=-1,L=a.length;for(h||(h=fM),O||(O=[]);++N<L;){var B=a[N];u>0&&h(B)?u>1?ar(B,u-1,h,S,O):Ti(O,B):S||(O[O.length]=B)}return O}var Bc=rE(),oh=rE(!0);function Nn(a,u){return a&&Bc(a,u,pr)}function ri(a,u){return a&&oh(a,u,pr)}function Wl(a,u){return Ai(u,function(h){return ps(a[h])})}function us(a,u){u=to(u,a);for(var h=0,S=u.length;a!=null&&h<S;)a=a[si(u[h++])];return h&&h==S?a:t}function ah(a,u,h){var S=u(a);return Te(a)?S:Ti(S,h(a))}function hr(a){return a==null?a===t?sr:qn:os&&os in Ze(a)?sM(a):vM(a)}function Vc(a,u){return a>u}function mb(a,u){return a!=null&&dt.call(a,u)}function gb(a,u){return a!=null&&u in Ze(a)}function yb(a,u,h){return a>=or(u,h)&&a<Tt(u,h)}function mn(a,u,h){for(var S=h?Vs:_l,O=a[0].length,N=a.length,L=N,B=Y(N),z=1/0,X=[];L--;){var ee=a[L];L&&u&&(ee=qt(ee,Mr(u))),z=or(ee.length,z),B[L]=!h&&(u||O>=120&&ee.length>=120)?new ls(L&&ee):t}ee=a[0];var ne=-1,ce=B[0];e:for(;++ne<O&&X.length<z;){var ve=ee[ne],Ce=u?u(ve):ve;if(ve=h||ve!==0?ve:0,!(ce?gt(ce,Ce):S(X,Ce,h))){for(L=N;--L;){var Fe=B[L];if(!(Fe?gt(Fe,Ce):S(a[L],Ce,h)))continue e}ce&&ce.push(Ce),X.push(ve)}}return X}function Qs(a,u,h,S){return Nn(a,function(O,N,L){u(S,h(O),N,L)}),S}function ca(a,u,h){u=to(u,a),a=bE(a,u);var S=a==null?a:a[si(Fn(u))];return S==null?t:$r(S,a,h)}function lh(a){return Vt(a)&&hr(a)==Yt}function vb(a){return Vt(a)&&hr(a)==Lt}function bb(a){return Vt(a)&&hr(a)==wr}function fa(a,u,h,S,O){return a===u?!0:a==null||u==null||!Vt(a)&&!Vt(u)?a!==a&&u!==u:Wc(a,u,h,S,fa,O)}function Wc(a,u,h,S,O,N){var L=Te(a),B=Te(u),z=L?Ar:xr(a),X=B?Ar:xr(u);z=z==Yt?te:z,X=X==Yt?te:X;var ee=z==te,ne=X==te,ce=z==X;if(ce&&no(a)){if(!no(u))return!1;L=!0,ee=!1}if(ce&&!ee)return N||(N=new pn),L||Yl(a)?dE(a,u,h,S,O,N):nM(a,u,z,h,S,O,N);if(!(h&b)){var ve=ee&&dt.call(a,"__wrapped__"),Ce=ne&&dt.call(u,"__wrapped__");if(ve||Ce){var Fe=ve?a.value():a,Re=Ce?u.value():u;return N||(N=new pn),O(Fe,Re,h,S,N)}}return ce?(N||(N=new pn),iM(a,u,h,S,O,N)):!1}function Zs(a){return Vt(a)&&xr(a)==At}function Xs(a,u,h,S){var O=h.length,N=O,L=!S;if(a==null)return!N;for(a=Ze(a);O--;){var B=h[O];if(L&&B[2]?B[1]!==a[B[0]]:!(B[0]in a))return!1}for(;++O<N;){B=h[O];var z=B[0],X=a[z],ee=B[1];if(L&&B[2]){if(X===t&&!(z in a))return!1}else{var ne=new pn;if(S)var ce=S(X,ee,z,a,u,ne);if(!(ce===t?fa(ee,X,b|q,S,ne):ce))return!1}}return!0}function Ge(a){if(!Ht(a)||pM(a))return!1;var u=ps(a)?Dv:gp;return u.test(pa(a))}function f(a){return Vt(a)&&hr(a)==ge}function g(a){return Vt(a)&&xr(a)==Se}function w(a){return Vt(a)&&xh(a.length)&&!!Ot[hr(a)]}function C(a){return typeof a=="function"?a:a==null?en:typeof a=="object"?Te(a)?We(a[0],a[1]):qe(a):iq(a)}function T(a){if(!Gc(a))return Wp(a);var u=[];for(var h in Ze(a))dt.call(a,h)&&h!="constructor"&&u.push(h);return u}function H(a){if(!Ht(a))return yM(a);var u=Gc(a),h=[];for(var S in a)S=="constructor"&&(u||!dt.call(a,S))||h.push(S);return h}function K(a,u){return a<u}function de(a,u){var h=-1,S=Zr(a)?Y(a.length):[];return ji(a,function(O,N,L){S[++h]=u(O,N,L)}),S}function qe(a){var u=$b(a);return u.length==1&&u[0][2]?yE(u[0][0],u[0][1]):function(h){return h===a||Xs(h,a,u)}}function We(a,u){return Mb(a)&&gE(u)?yE(si(a),u):function(h){var S=Jb(h,a);return S===t&&S===u?Gb(h,a):fa(u,S,b|q)}}function tr(a,u,h,S,O){a!==u&&Bc(u,function(N,L){if(O||(O=new pn),Ht(N))ni(a,u,L,h,tr,S,O);else{var B=S?S(Db(a,L),N,L+"",a,u,O):t;B===t&&(B=N),Lc(a,L,B)}},Xr)}function ni(a,u,h,S,O,N,L){var B=Db(a,h),z=Db(u,h),X=L.get(z);if(X){Lc(a,h,X);return}var ee=N?N(B,z,h+"",a,u,L):t,ne=ee===t;if(ne){var ce=Te(z),ve=!ce&&no(z),Ce=!ce&&!ve&&Yl(z);ee=z,ce||ve||Ce?Te(B)?ee=B:Qt(B)?ee=Qr(B):ve?(ne=!1,ee=KC(z,!0)):Ce?(ne=!1,ee=QC(z,!0)):ee=[]:Kc(z)||ha(z)?(ee=B,ha(B)?ee=JE(B):(!Ht(B)||ps(B))&&(ee=mE(z))):ne=!1}ne&&(L.set(z,ee),O(ee,z,S,N,L),L.delete(z)),Lc(a,h,ee)}function ii(a,u){var h=a.length;if(h)return u+=u<0?h:0,ds(u,h)?a[u]:t}function LC(a,u,h){u.length?u=qt(u,function(N){return Te(N)?function(L){return us(L,N.length===1?N[0]:N)}:N}):u=[en];var S=-1;u=qt(u,Mr(xe()));var O=de(a,function(N,L,B){var z=qt(u,function(X){return X(N)});return{criteria:z,index:++S,value:N}});return Sv(O,function(N,L){return YN(N,L,h)})}function FN(a,u){return UC(a,u,function(h,S){return Gb(a,S)})}function UC(a,u,h){for(var S=-1,O=u.length,N={};++S<O;){var L=u[S],B=us(a,L);h(B,L)&&zc(N,to(L,a),B)}return N}function DN(a){return function(u){return us(u,a)}}function Sb(a,u,h,S){var O=S?bv:is,N=-1,L=u.length,B=a;for(a===u&&(u=Qr(u)),h&&(B=qt(a,Mr(h)));++N<L;)for(var z=0,X=u[N],ee=h?h(X):X;(z=O(B,ee,z,S))>-1;)B!==a&&$l.call(B,z,1),$l.call(a,z,1);return a}function HC(a,u){for(var h=a?u.length:0,S=h-1;h--;){var O=u[h];if(h==S||O!==N){var N=O;ds(O)?$l.call(a,O,1):xb(a,O)}}return a}function wb(a,u){return a+ia(Jp()*(u-a+1))}function jN(a,u,h,S){for(var O=-1,N=Tt(na((u-a)/(h||1)),0),L=Y(N);N--;)L[S?N:++O]=a,a+=h;return L}function _b(a,u){var h="";if(!a||u<1||u>He)return h;do u%2&&(h+=a),u=ia(u/2),u&&(a+=a);while(u);return h}function Le(a,u){return jb(vE(a,u,en),a+"")}function LN(a){return th(Kl(a))}function UN(a,u){var h=Kl(a);return vh(h,Di(u,0,h.length))}function zc(a,u,h,S){if(!Ht(a))return a;u=to(u,a);for(var O=-1,N=u.length,L=N-1,B=a;B!=null&&++O<N;){var z=si(u[O]),X=h;if(z==="__proto__"||z==="constructor"||z==="prototype")return a;if(O!=L){var ee=B[z];X=S?S(ee,z,B):t,X===t&&(X=Ht(ee)?ee:ds(u[O+1])?[]:{})}jr(B,z,X),B=B[z]}return a}var BC=jl?function(a,u){return jl.set(a,u),a}:en,HN=Nl?function(a,u){return Nl(a,"toString",{configurable:!0,enumerable:!1,value:Kb(u),writable:!0})}:en;function BN(a){return vh(Kl(a))}function Mn(a,u,h){var S=-1,O=a.length;u<0&&(u=-u>O?0:O+u),h=h>O?O:h,h<0&&(h+=O),O=u>h?0:h-u>>>0,u>>>=0;for(var N=Y(O);++S<O;)N[S]=a[S+u];return N}function VN(a,u){var h;return ji(a,function(S,O,N){return h=u(S,O,N),!h}),!!h}function uh(a,u,h){var S=0,O=a==null?S:a.length;if(typeof u=="number"&&u===u&&O<=Nt){for(;S<O;){var N=S+O>>>1,L=a[N];L!==null&&!yn(L)&&(h?L<=u:L<u)?S=N+1:O=N}return O}return Rb(a,u,en,h)}function Rb(a,u,h,S){var O=0,N=a==null?0:a.length;if(N===0)return 0;u=h(u);for(var L=u!==u,B=u===null,z=yn(u),X=u===t;O<N;){var ee=ia((O+N)/2),ne=h(a[ee]),ce=ne!==t,ve=ne===null,Ce=ne===ne,Fe=yn(ne);if(L)var Re=S||Ce;else X?Re=Ce&&(S||ce):B?Re=Ce&&ce&&(S||!ve):z?Re=Ce&&ce&&!ve&&(S||!Fe):ve||Fe?Re=!1:Re=S?ne<=u:ne<u;Re?O=ee+1:N=ee}return or(N,ht)}function VC(a,u){for(var h=-1,S=a.length,O=0,N=[];++h<S;){var L=a[h],B=u?u(L):L;if(!h||!oi(B,z)){var z=B;N[O++]=L===0?0:L}}return N}function WC(a){return typeof a=="number"?a:yn(a)?ye:+a}function gn(a){if(typeof a=="string")return a;if(Te(a))return qt(a,gn)+"";if(yn(a))return Gp?Gp.call(a):"";var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function eo(a,u,h){var S=-1,O=_l,N=a.length,L=!0,B=[],z=B;if(h)L=!1,O=Vs;else if(N>=r){var X=u?null:tM(a);if(X)return ql(X);L=!1,O=gt,z=new ls}else z=u?[]:B;e:for(;++S<N;){var ee=a[S],ne=u?u(ee):ee;if(ee=h||ee!==0?ee:0,L&&ne===ne){for(var ce=z.length;ce--;)if(z[ce]===ne)continue e;u&&z.push(ne),B.push(ee)}else O(z,ne,h)||(z!==B&&z.push(ne),B.push(ee))}return B}function xb(a,u){u=to(u,a);var h=-1,S=u.length;if(!S)return!0;for(;++h<S;){var O=si(u[h]);if(O==="__proto__"&&!dt.call(a,"__proto__")||(O==="constructor"||O==="prototype")&&h<S-1)return!1}var N=bE(a,u);return N==null||delete N[si(Fn(u))]}function zC(a,u,h,S){return zc(a,u,h(us(a,u)),S)}function ch(a,u,h,S){for(var O=a.length,N=S?O:-1;(S?N--:++N<O)&&u(a[N],N,a););return h?Mn(a,S?0:N,S?N+1:O):Mn(a,S?N+1:0,S?O:N)}function JC(a,u){var h=a;return h instanceof Ve&&(h=h.value()),Pc(u,function(S,O){return O.func.apply(O.thisArg,Ti([S],O.args))},h)}function Cb(a,u,h){var S=a.length;if(S<2)return S?eo(a[0]):[];for(var O=-1,N=Y(S);++O<S;)for(var L=a[O],B=-1;++B<S;)B!=O&&(N[O]=ua(N[O]||L,a[B],u,h));return eo(ar(N,1),u,h)}function GC(a,u,h){for(var S=-1,O=a.length,N=u.length,L={};++S<O;){var B=S<N?u[S]:t;h(L,a[S],B)}return L}function Eb(a){return Qt(a)?a:[]}function qb(a){return typeof a=="function"?a:en}function to(a,u){return Te(a)?a:Mb(a,u)?[a]:RE(St(a))}var WN=Le;function ro(a,u,h){var S=a.length;return h=h===t?S:h,!u&&h>=S?a:Mn(a,u,h)}var YC=jv||function(a){return er.clearTimeout(a)};function KC(a,u){if(u)return a.slice();var h=a.length,S=Hp?Hp(h):new a.constructor(h);return a.copy(S),S}function Ib(a){var u=new a.constructor(a.byteLength);return new Al(u).set(new Al(a)),u}function zN(a,u){var h=u?Ib(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.byteLength)}function JN(a){var u=new a.constructor(a.source,mp.exec(a));return u.lastIndex=a.lastIndex,u}function GN(a){return la?Ze(la.call(a)):{}}function QC(a,u){var h=u?Ib(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.length)}function ZC(a,u){if(a!==u){var h=a!==t,S=a===null,O=a===a,N=yn(a),L=u!==t,B=u===null,z=u===u,X=yn(u);if(!B&&!X&&!N&&a>u||N&&L&&z&&!B&&!X||S&&L&&z||!h&&z||!O)return 1;if(!S&&!N&&!X&&a<u||X&&h&&O&&!S&&!N||B&&h&&O||!L&&O||!z)return-1}return 0}function YN(a,u,h){for(var S=-1,O=a.criteria,N=u.criteria,L=O.length,B=h.length;++S<L;){var z=ZC(O[S],N[S]);if(z){if(S>=B)return z;var X=h[S];return z*(X=="desc"?-1:1)}}return a.index-u.index}function XC(a,u,h,S){for(var O=-1,N=a.length,L=h.length,B=-1,z=u.length,X=Tt(N-L,0),ee=Y(z+X),ne=!S;++B<z;)ee[B]=u[B];for(;++O<L;)(ne||O<N)&&(ee[h[O]]=a[O]);for(;X--;)ee[B++]=a[O++];return ee}function eE(a,u,h,S){for(var O=-1,N=a.length,L=-1,B=h.length,z=-1,X=u.length,ee=Tt(N-B,0),ne=Y(ee+X),ce=!S;++O<ee;)ne[O]=a[O];for(var ve=O;++z<X;)ne[ve+z]=u[z];for(;++L<B;)(ce||O<N)&&(ne[ve+h[L]]=a[O++]);return ne}function Qr(a,u){var h=-1,S=a.length;for(u||(u=Y(S));++h<S;)u[h]=a[h];return u}function Li(a,u,h,S){var O=!h;h||(h={});for(var N=-1,L=u.length;++N<L;){var B=u[N],z=S?S(h[B],a[B],B,h,a):t;z===t&&(z=a[B]),O?hn(h,B,z):jr(h,B,z)}return h}function KN(a,u){return Li(a,Nb(a),u)}function QN(a,u){return Li(a,pE(a),u)}function fh(a,u){return function(h,S){var O=Te(h)?Xn:rh,N=u?u():{};return O(h,a,xe(S,2),N)}}function zl(a){return Le(function(u,h){var S=-1,O=h.length,N=O>1?h[O-1]:t,L=O>2?h[2]:t;for(N=a.length>3&&typeof N=="function"?(O--,N):t,L&&Lr(h[0],h[1],L)&&(N=O<3?t:N,O=1),u=Ze(u);++S<O;){var B=h[S];B&&a(u,B,S,N)}return u})}function tE(a,u){return function(h,S){if(h==null)return h;if(!Zr(h))return a(h,S);for(var O=h.length,N=u?O:-1,L=Ze(h);(u?N--:++N<O)&&S(L[N],N,L)!==!1;);return h}}function rE(a){return function(u,h,S){for(var O=-1,N=Ze(u),L=S(u),B=L.length;B--;){var z=L[a?B:++O];if(h(N[z],z,N)===!1)break}return u}}function ZN(a,u,h){var S=u&x,O=Jc(a);function N(){var L=this&&this!==er&&this instanceof N?O:a;return L.apply(S?h:this,arguments)}return N}function nE(a){return function(u){u=St(u);var h=Ws(u)?Fr(u):t,S=h?h[0]:u.charAt(0),O=h?ro(h,1).join(""):u.slice(1);return S[a]()+O}}function Jl(a){return function(u){return Pc(rq(tq(u).replace(sv,"")),a,"")}}function Jc(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 h=Ks(a.prototype),S=a.apply(h,u);return Ht(S)?S:h}}function XN(a,u,h){var S=Jc(a);function O(){for(var N=arguments.length,L=Y(N),B=N,z=Gl(O);B--;)L[B]=arguments[B];var X=N<3&&L[0]!==z&&L[N-1]!==z?[]:An(L,z);if(N-=X.length,N<h)return lE(a,u,dh,O.placeholder,t,L,X,t,t,h-N);var ee=this&&this!==er&&this instanceof O?S:a;return $r(ee,this,L)}return O}function iE(a){return function(u,h,S){var O=Ze(u);if(!Zr(u)){var N=xe(h,3);u=pr(u),h=function(B){return N(O[B],B,O)}}var L=a(u,h,S);return L>-1?O[N?u[L]:L]:t}}function sE(a){return fs(function(u){var h=u.length,S=h,O=_r.prototype.thru;for(a&&u.reverse();S--;){var N=u[S];if(typeof N!="function")throw new Dr(i);if(O&&!L&&gh(N)=="wrapper")var L=new _r([],!0)}for(S=L?S:h;++S<h;){N=u[S];var B=gh(N),z=B=="wrapper"?Tb(N):t;z&&Fb(z[0])&&z[1]==(j|E|P|I)&&!z[4].length&&z[9]==1?L=L[gh(z[0])].apply(L,z[3]):L=N.length==1&&Fb(N)?L[B]():L.thru(N)}return function(){var X=arguments,ee=X[0];if(L&&X.length==1&&Te(ee))return L.plant(ee).value();for(var ne=0,ce=h?u[ne].apply(this,X):ee;++ne<h;)ce=u[ne].call(this,ce);return ce}})}function dh(a,u,h,S,O,N,L,B,z,X){var ee=u&j,ne=u&x,ce=u&v,ve=u&(E|k),Ce=u&_,Fe=ce?t:Jc(a);function Re(){for(var Ye=arguments.length,Xe=Y(Ye),vn=Ye;vn--;)Xe[vn]=arguments[vn];if(ve)var Ur=Gl(Re),bn=Dp(Xe,Ur);if(S&&(Xe=XC(Xe,S,O,ve)),N&&(Xe=eE(Xe,N,L,ve)),Ye-=bn,ve&&Ye<X){var Zt=An(Xe,Ur);return lE(a,u,dh,Re.placeholder,h,Xe,Zt,B,z,X-Ye)}var ai=ne?h:this,ms=ce?ai[a]:a;return Ye=Xe.length,B?Xe=bM(Xe,B):Ce&&Ye>1&&Xe.reverse(),ee&&z<Ye&&(Xe.length=z),this&&this!==er&&this instanceof Re&&(ms=Fe||Jc(ms)),ms.apply(ai,Xe)}return Re}function oE(a,u){return function(h,S){return Qs(h,a,u(S),{})}}function ph(a,u){return function(h,S){var O;if(h===t&&S===t)return u;if(h!==t&&(O=h),S!==t){if(O===t)return S;typeof h=="string"||typeof S=="string"?(h=gn(h),S=gn(S)):(h=WC(h),S=WC(S)),O=a(h,S)}return O}}function Ob(a){return fs(function(u){return u=qt(u,Mr(xe())),Le(function(h){var S=this;return a(u,function(O){return $r(O,S,h)})})})}function hh(a,u){u=u===t?" ":gn(u);var h=u.length;if(h<2)return h?_b(u,a):u;var S=_b(u,na(a/$i(u)));return Ws(u)?ro(Fr(S),0,a).join(""):S.slice(0,a)}function eM(a,u,h,S){var O=u&x,N=Jc(a);function L(){for(var B=-1,z=arguments.length,X=-1,ee=S.length,ne=Y(ee+z),ce=this&&this!==er&&this instanceof L?N:a;++X<ee;)ne[X]=S[X];for(;z--;)ne[X++]=arguments[++B];return $r(ce,O?h:this,ne)}return L}function aE(a){return function(u,h,S){return S&&typeof S!="number"&&Lr(u,h,S)&&(h=S=t),u=hs(u),h===t?(h=u,u=0):h=hs(h),S=S===t?u<h?1:-1:hs(S),jN(u,h,S,a)}}function mh(a){return function(u,h){return typeof u=="string"&&typeof h=="string"||(u=Dn(u),h=Dn(h)),a(u,h)}}function lE(a,u,h,S,O,N,L,B,z,X){var ee=u&E,ne=ee?L:t,ce=ee?t:L,ve=ee?N:t,Ce=ee?t:N;u|=ee?P:M,u&=~(ee?M:P),u&R||(u&=~(x|v));var Fe=[a,u,O,ve,ne,Ce,ce,B,z,X],Re=h.apply(t,Fe);return Fb(a)&&SE(Re,Fe),Re.placeholder=S,wE(Re,a,u)}function Pb(a){var u=yt[a];return function(h,S){if(h=Dn(h),S=S==null?0:or(Ne(S),292),S&&as(h)){var O=(St(h)+"e").split("e"),N=u(O[0]+"e"+(+O[1]+S));return O=(St(N)+"e").split("e"),+(O[0]+"e"+(+O[1]-S))}return u(h)}}var tM=Gs&&1/ql(new Gs([,-0]))[1]==fe?function(a){return new Gs(a)}:Xb;function uE(a){return function(u){var h=xr(u);return h==At?zs(u):h==Se?jp(u):wv(u,a(u))}}function cs(a,u,h,S,O,N,L,B){var z=u&v;if(!z&&typeof a!="function")throw new Dr(i);var X=S?S.length:0;if(X||(u&=~(P|M),S=O=t),L=L===t?L:Tt(Ne(L),0),B=B===t?B:Ne(B),X-=O?O.length:0,u&M){var ee=S,ne=O;S=O=t}var ce=z?t:Tb(a),ve=[a,u,h,S,O,ee,ne,N,L,B];if(ce&&gM(ve,ce),a=ve[0],u=ve[1],h=ve[2],S=ve[3],O=ve[4],B=ve[9]=ve[9]===t?z?0:a.length:Tt(ve[9]-X,0),!B&&u&(E|k)&&(u&=~(E|k)),!u||u==x)var Ce=ZN(a,u,h);else u==E||u==k?Ce=XN(a,u,B):(u==P||u==(x|P))&&!O.length?Ce=eM(a,u,h,S):Ce=dh.apply(t,ve);var Fe=ce?BC:SE;return wE(Fe(Ce,ve),a,u)}function cE(a,u,h,S){return a===t||oi(a,Js[h])&&!dt.call(S,h)?u:a}function fE(a,u,h,S,O,N){return Ht(a)&&Ht(u)&&(N.set(u,a),tr(a,u,t,fE,N),N.delete(u)),a}function rM(a){return Kc(a)?t:a}function dE(a,u,h,S,O,N){var L=h&b,B=a.length,z=u.length;if(B!=z&&!(L&&z>B))return!1;var X=N.get(a),ee=N.get(u);if(X&&ee)return X==u&&ee==a;var ne=-1,ce=!0,ve=h&q?new ls:t;for(N.set(a,u),N.set(u,a);++ne<B;){var Ce=a[ne],Fe=u[ne];if(S)var Re=L?S(Fe,Ce,ne,u,a,N):S(Ce,Fe,ne,a,u,N);if(Re!==t){if(Re)continue;ce=!1;break}if(ve){if(!Rl(u,function(Ye,Xe){if(!gt(ve,Xe)&&(Ce===Ye||O(Ce,Ye,h,S,N)))return ve.push(Xe)})){ce=!1;break}}else if(!(Ce===Fe||O(Ce,Fe,h,S,N))){ce=!1;break}}return N.delete(a),N.delete(u),ce}function nM(a,u,h,S,O,N,L){switch(h){case mt:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case Lt:return!(a.byteLength!=u.byteLength||!N(new Al(a),new Al(u)));case Tr:case wr:case Pi:return oi(+a,+u);case bt:return a.name==u.name&&a.message==u.message;case ge:case Qe:return a==u+"";case At:var B=zs;case Se:var z=S&b;if(B||(B=ql),a.size!=u.size&&!z)return!1;var X=L.get(a);if(X)return X==u;S|=q,L.set(a,u);var ee=dE(B(a),B(u),S,O,N,L);return L.delete(a),ee;case xt:if(la)return la.call(a)==la.call(u)}return!1}function iM(a,u,h,S,O,N){var L=h&b,B=kb(a),z=B.length,X=kb(u),ee=X.length;if(z!=ee&&!L)return!1;for(var ne=z;ne--;){var ce=B[ne];if(!(L?ce in u:dt.call(u,ce)))return!1}var ve=N.get(a),Ce=N.get(u);if(ve&&Ce)return ve==u&&Ce==a;var Fe=!0;N.set(a,u),N.set(u,a);for(var Re=L;++ne<z;){ce=B[ne];var Ye=a[ce],Xe=u[ce];if(S)var vn=L?S(Xe,Ye,ce,u,a,N):S(Ye,Xe,ce,a,u,N);if(!(vn===t?Ye===Xe||O(Ye,Xe,h,S,N):vn)){Fe=!1;break}Re||(Re=ce=="constructor")}if(Fe&&!Re){var Ur=a.constructor,bn=u.constructor;Ur!=bn&&"constructor"in a&&"constructor"in u&&!(typeof Ur=="function"&&Ur instanceof Ur&&typeof bn=="function"&&bn instanceof bn)&&(Fe=!1)}return N.delete(a),N.delete(u),Fe}function fs(a){return jb(vE(a,t,qE),a+"")}function kb(a){return ah(a,pr,Nb)}function Ab(a){return ah(a,Xr,pE)}var Tb=jl?function(a){return jl.get(a)}:Xb;function gh(a){for(var u=a.name+"",h=Ys[u],S=dt.call(Ys,u)?h.length:0;S--;){var O=h[S],N=O.func;if(N==null||N==a)return O.name}return u}function Gl(a){var u=dt.call($,"placeholder")?$:a;return u.placeholder}function xe(){var a=$.iteratee||Qb;return a=a===Qb?C:a,arguments.length?a(arguments[0],arguments[1]):a}function yh(a,u){var h=a.__data__;return dM(u)?h[typeof u=="string"?"string":"hash"]:h.map}function $b(a){for(var u=pr(a),h=u.length;h--;){var S=u[h],O=a[S];u[h]=[S,O,gE(O)]}return u}function da(a,u){var h=Qo(a,u);return Ge(h)?h:t}function sM(a){var u=dt.call(a,os),h=a[os];try{a[os]=t;var S=!0}catch{}var O=Pl.call(a);return S&&(u?a[os]=h:delete a[os]),O}var Nb=Ml?function(a){return a==null?[]:(a=Ze(a),Ai(Ml(a),function(u){return ta.call(a,u)}))}:eS,pE=Ml?function(a){for(var u=[];a;)Ti(u,Nb(a)),a=Tl(a);return u}:eS,xr=hr;(Mc&&xr(new Mc(new ArrayBuffer(1)))!=mt||sa&&xr(new sa)!=At||Fc&&xr(Fc.resolve())!=re||Gs&&xr(new Gs)!=Se||oa&&xr(new oa)!=oe)&&(xr=function(a){var u=hr(a),h=u==te?a.constructor:t,S=h?pa(h):"";if(S)switch(S){case Vv:return mt;case Wv:return At;case zv:return re;case Jv:return Se;case Gv:return oe}return u});function oM(a,u,h){for(var S=-1,O=h.length;++S<O;){var N=h[S],L=N.size;switch(N.type){case"drop":a+=L;break;case"dropRight":u-=L;break;case"take":u=or(u,a+L);break;case"takeRight":a=Tt(a,u-L);break}}return{start:a,end:u}}function aM(a){var u=a.match(Kn);return u?u[1].split(Pn):[]}function hE(a,u,h){u=to(u,a);for(var S=-1,O=u.length,N=!1;++S<O;){var L=si(u[S]);if(!(N=a!=null&&h(a,L)))break;a=a[L]}return N||++S!=O?N:(O=a==null?0:a.length,!!O&&xh(O)&&ds(L,O)&&(Te(a)||ha(a)))}function lM(a){var u=a.length,h=new a.constructor(u);return u&&typeof a[0]=="string"&&dt.call(a,"index")&&(h.index=a.index,h.input=a.input),h}function mE(a){return typeof a.constructor=="function"&&!Gc(a)?Ks(Tl(a)):{}}function uM(a,u,h){var S=a.constructor;switch(u){case Lt:return Ib(a);case Tr:case wr:return new S(+a);case mt:return zN(a,h);case Ee:case In:case cl:case Fs:case Uo:case Ds:case ki:case js:case mc:return QC(a,h);case At:return new S;case Pi:case Qe:return new S(a);case ge:return JN(a);case Se:return new S;case xt:return GN(a)}}function cM(a,u){var h=u.length;if(!h)return a;var S=h-1;return u[S]=(h>1?"& ":"")+u[S],u=u.join(h>2?", ":" "),a.replace(dr,`{
2
2
  /* [wrapped with `+u+`] */
3
- `)}function fM(a){return Te(a)||ha(a)||!!(Vp&&a&&a[Vp])}function ds(a,u){var h=typeof a;return u=u??He,!!u&&(h=="number"||h!="symbol"&&Ls.test(a))&&a>-1&&a%1==0&&a<u}function Lr(a,u,h){if(!Ht(h))return!1;var S=typeof u;return(S=="number"?Zr(h)&&ds(u,h.length):S=="string"&&u in h)?oi(h[u],a):!1}function Mb(a,u){if(Te(a))return!1;var h=typeof a;return h=="number"||h=="symbol"||h=="boolean"||a==null||yn(a)?!0:Be.test(a)||!Gr.test(a)||u!=null&&a in Ze(u)}function dM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Fb(a){var u=gh(a),h=$[u];if(typeof h!="function"||!(u in Ve.prototype))return!1;if(a===h)return!0;var S=Tb(h);return!!S&&a===S[0]}function pM(a){return!!Up&&Up in a}var hM=ea?ps:tS;function Gc(a){var u=a&&a.constructor,h=typeof u=="function"&&u.prototype||Js;return a===h}function gE(a){return a===a&&!Ht(a)}function yE(a,u){return function(h){return h==null?!1:h[a]===u&&(u!==t||a in Ze(h))}}function mM(a){var u=_h(a,function(S){return h.size===c&&h.clear(),S}),h=u.cache;return u}function gM(a,u){var h=a[1],S=u[1],O=h|S,N=O<(x|v|j),L=S==j&&h==E||S==j&&h==I&&a[7].length<=u[8]||S==(j|I)&&u[7].length<=u[8]&&h==E;if(!(N||L))return a;S&x&&(a[2]=u[2],O|=h&x?0:_);var B=u[3];if(B){var z=a[3];a[3]=z?XC(z,B,u[4]):B,a[4]=z?An(a[3],d):u[4]}return B=u[5],B&&(z=a[5],a[5]=z?eE(z,B,u[6]):B,a[6]=z?An(a[5],d):u[6]),B=u[7],B&&(a[7]=B),S&j&&(a[8]=a[8]==null?u[8]:or(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=O,a}function yM(a){var u=[];if(a!=null)for(var h in Ze(a))u.push(h);return u}function vM(a){return Pl.call(a)}function vE(a,u,h){return u=Tt(u===t?a.length-1:u,0),function(){for(var S=arguments,O=-1,N=Tt(S.length-u,0),L=Y(N);++O<N;)L[O]=S[u+O];O=-1;for(var B=Y(u+1);++O<u;)B[O]=S[O];return B[u]=h(L),$r(a,this,B)}}function bE(a,u){return u.length<2?a:us(a,Mn(u,0,-1))}function bM(a,u){for(var h=a.length,S=or(u.length,h),O=Qr(a);S--;){var N=u[S];a[S]=ds(N,h)?O[N]:t}return a}function Db(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var SE=_E(BC),Yc=Uv||function(a,u){return er.setTimeout(a,u)},jb=_E(HN);function wE(a,u,h){var S=u+"";return jb(a,cM(S,SM(aM(S),h)))}function _E(a){var u=0,h=0;return function(){var S=zp(),O=D-(S-h);if(h=S,O>0){if(++u>=U)return arguments[0]}else u=0;return a.apply(t,arguments)}}function vh(a,u){var h=-1,S=a.length,O=S-1;for(u=u===t?S:u;++h<u;){var N=wb(h,O),L=a[N];a[N]=a[h],a[h]=L}return a.length=u,a}var RE=mM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(gc,function(h,S,O,N){u.push(O?N.replace(Qn,"$1"):S||h)}),u});function si(a){if(typeof a=="string"||yn(a))return a;var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function pa(a){if(a!=null){try{return Ol.call(a)}catch{}try{return a+""}catch{}}return""}function SM(a,u){return Nr(he,function(h){var S="_."+h[0];u&h[1]&&!_l(a,S)&&a.push(S)}),a.sort()}function xE(a){if(a instanceof Ve)return a.clone();var u=new _r(a.__wrapped__,a.__chain__);return u.__actions__=Qr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function wM(a,u,h){(h?Lr(a,u,h):u===t)?u=1:u=Tt(Ne(u),0);var S=a==null?0:a.length;if(!S||u<1)return[];for(var O=0,N=0,L=Y(na(S/u));O<S;)L[N++]=Mn(a,O,O+=u);return L}function _M(a){for(var u=-1,h=a==null?0:a.length,S=0,O=[];++u<h;){var N=a[u];N&&(O[S++]=N)}return O}function RM(){var a=arguments.length;if(!a)return[];for(var u=Y(a-1),h=arguments[0],S=a;S--;)u[S-1]=arguments[S];return Ti(Te(h)?Qr(h):[h],ar(u,1))}var xM=Le(function(a,u){return Qt(a)?ua(a,ar(u,1,Qt,!0)):[]}),CM=Le(function(a,u){var h=Fn(u);return Qt(h)&&(h=t),Qt(a)?ua(a,ar(u,1,Qt,!0),xe(h,2)):[]}),EM=Le(function(a,u){var h=Fn(u);return Qt(h)&&(h=t),Qt(a)?ua(a,ar(u,1,Qt,!0),t,h):[]});function qM(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Ne(u),Mn(a,u<0?0:u,S)):[]}function IM(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Ne(u),u=S-u,Mn(a,0,u<0?0:u)):[]}function OM(a,u){return a&&a.length?ch(a,xe(u,3),!0,!0):[]}function PM(a,u){return a&&a.length?ch(a,xe(u,3),!0):[]}function kM(a,u,h,S){var O=a==null?0:a.length;return O?(h&&typeof h!="number"&&Lr(a,u,h)&&(h=0,S=O),hb(a,u,h,S)):[]}function CE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Ne(h);return O<0&&(O=Tt(S+O,0)),xl(a,xe(u,3),O)}function EE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S-1;return h!==t&&(O=Ne(h),O=h<0?Tt(S+O,0):or(O,S-1)),xl(a,xe(u,3),O,!0)}function qE(a){var u=a==null?0:a.length;return u?ar(a,1):[]}function AM(a){var u=a==null?0:a.length;return u?ar(a,fe):[]}function TM(a,u){var h=a==null?0:a.length;return h?(u=u===t?1:Ne(u),ar(a,u)):[]}function $M(a){for(var u=-1,h=a==null?0:a.length,S={};++u<h;){var O=a[u];hn(S,O[0],O[1])}return S}function IE(a){return a&&a.length?a[0]:t}function NM(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Ne(h);return O<0&&(O=Tt(S+O,0)),is(a,u,O)}function MM(a){var u=a==null?0:a.length;return u?Mn(a,0,-1):[]}var FM=Le(function(a){var u=qt(a,Eb);return u.length&&u[0]===a[0]?mn(u):[]}),DM=Le(function(a){var u=Fn(a),h=qt(a,Eb);return u===Fn(h)?u=t:h.pop(),h.length&&h[0]===a[0]?mn(h,xe(u,2)):[]}),jM=Le(function(a){var u=Fn(a),h=qt(a,Eb);return u=typeof u=="function"?u:t,u&&h.pop(),h.length&&h[0]===a[0]?mn(h,t,u):[]});function LM(a,u){return a==null?"":Dl.call(a,u)}function Fn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function UM(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S;return h!==t&&(O=Ne(h),O=O<0?Tt(S+O,0):or(O,S-1)),u===u?Nc(a,u,O):xl(a,ss,O,!0)}function HM(a,u){return a&&a.length?ii(a,Ne(u)):t}var BM=Le(OE);function OE(a,u){return a&&a.length&&u&&u.length?Sb(a,u):a}function VM(a,u,h){return a&&a.length&&u&&u.length?Sb(a,u,xe(h,2)):a}function WM(a,u,h){return a&&a.length&&u&&u.length?Sb(a,u,t,h):a}var zM=fs(function(a,u){var h=a==null?0:a.length,S=Uc(a,u);return HC(a,qt(u,function(O){return ds(O,h)?+O:O}).sort(ZC)),S});function JM(a,u){var h=[];if(!(a&&a.length))return h;var S=-1,O=[],N=a.length;for(u=xe(u,3);++S<N;){var L=a[S];u(L,S,a)&&(h.push(L),O.push(S))}return HC(a,O),h}function Lb(a){return a==null?a:Bv.call(a)}function GM(a,u,h){var S=a==null?0:a.length;return S?(h&&typeof h!="number"&&Lr(a,u,h)?(u=0,h=S):(u=u==null?0:Ne(u),h=h===t?S:Ne(h)),Mn(a,u,h)):[]}function YM(a,u){return uh(a,u)}function KM(a,u,h){return Rb(a,u,xe(h,2))}function QM(a,u){var h=a==null?0:a.length;if(h){var S=uh(a,u);if(S<h&&oi(a[S],u))return S}return-1}function ZM(a,u){return uh(a,u,!0)}function XM(a,u,h){return Rb(a,u,xe(h,2),!0)}function eF(a,u){var h=a==null?0:a.length;if(h){var S=uh(a,u,!0)-1;if(oi(a[S],u))return S}return-1}function tF(a){return a&&a.length?VC(a):[]}function rF(a,u){return a&&a.length?VC(a,xe(u,2)):[]}function nF(a){var u=a==null?0:a.length;return u?Mn(a,1,u):[]}function iF(a,u,h){return a&&a.length?(u=h||u===t?1:Ne(u),Mn(a,0,u<0?0:u)):[]}function sF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Ne(u),u=S-u,Mn(a,u<0?0:u,S)):[]}function oF(a,u){return a&&a.length?ch(a,xe(u,3),!1,!0):[]}function aF(a,u){return a&&a.length?ch(a,xe(u,3)):[]}var lF=Le(function(a){return eo(ar(a,1,Qt,!0))}),uF=Le(function(a){var u=Fn(a);return Qt(u)&&(u=t),eo(ar(a,1,Qt,!0),xe(u,2))}),cF=Le(function(a){var u=Fn(a);return u=typeof u=="function"?u:t,eo(ar(a,1,Qt,!0),t,u)});function fF(a){return a&&a.length?eo(a):[]}function dF(a,u){return a&&a.length?eo(a,xe(u,2)):[]}function pF(a,u){return u=typeof u=="function"?u:t,a&&a.length?eo(a,t,u):[]}function Ub(a){if(!(a&&a.length))return[];var u=0;return a=Ai(a,function(h){if(Qt(h))return u=Tt(h.length,u),!0}),Tc(u,function(h){return qt(a,Ko(h))})}function PE(a,u){if(!(a&&a.length))return[];var h=Ub(a);return u==null?h:qt(h,function(S){return $r(u,t,S)})}var hF=Le(function(a,u){return Qt(a)?ua(a,u):[]}),mF=Le(function(a){return Cb(Ai(a,Qt))}),gF=Le(function(a){var u=Fn(a);return Qt(u)&&(u=t),Cb(Ai(a,Qt),xe(u,2))}),yF=Le(function(a){var u=Fn(a);return u=typeof u=="function"?u:t,Cb(Ai(a,Qt),t,u)}),vF=Le(Ub);function bF(a,u){return GC(a||[],u||[],jr)}function SF(a,u){return GC(a||[],u||[],zc)}var wF=Le(function(a){var u=a.length,h=u>1?a[u-1]:t;return h=typeof h=="function"?(a.pop(),h):t,PE(a,h)});function kE(a){var u=$(a);return u.__chain__=!0,u}function _F(a,u){return u(a),a}function bh(a,u){return u(a)}var RF=fs(function(a){var u=a.length,h=u?a[0]:0,S=this.__wrapped__,O=function(N){return Uc(N,a)};return u>1||this.__actions__.length||!(S instanceof Ve)||!ds(h)?this.thru(O):(S=S.slice(h,+h+(u?1:0)),S.__actions__.push({func:bh,args:[O],thisArg:t}),new _r(S,this.__chain__).thru(function(N){return u&&!N.length&&N.push(t),N}))});function xF(){return kE(this)}function CF(){return new _r(this.value(),this.__chain__)}function EF(){this.__values__===t&&(this.__values__=WE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function qF(){return this}function IF(a){for(var u,h=this;h instanceof Ul;){var S=xE(h);S.__index__=0,S.__values__=t,u?O.__wrapped__=S:u=S;var O=S;h=h.__wrapped__}return O.__wrapped__=a,u}function OF(){var a=this.__wrapped__;if(a instanceof Ve){var u=a;return this.__actions__.length&&(u=new Ve(this)),u=u.reverse(),u.__actions__.push({func:bh,args:[Lb],thisArg:t}),new _r(u,this.__chain__)}return this.thru(Lb)}function PF(){return JC(this.__wrapped__,this.__actions__)}var kF=fh(function(a,u,h){dt.call(a,h)?++a[h]:hn(a,h,1)});function AF(a,u,h){var S=Te(a)?Tp:pb;return h&&Lr(a,u,h)&&(u=t),S(a,xe(u,3))}function TF(a,u){var h=Te(a)?Ai:sh;return h(a,xe(u,3))}var $F=iE(CE),NF=iE(EE);function MF(a,u){return ar(Sh(a,u),1)}function FF(a,u){return ar(Sh(a,u),fe)}function DF(a,u,h){return h=h===t?1:Ne(h),ar(Sh(a,u),h)}function AE(a,u){var h=Te(a)?Nr:ji;return h(a,xe(u,3))}function TE(a,u){var h=Te(a)?Oc:ih;return h(a,xe(u,3))}var jF=fh(function(a,u,h){dt.call(a,h)?a[h].push(u):hn(a,h,[u])});function LF(a,u,h,S){a=Zr(a)?a:Kl(a),h=h&&!S?Ne(h):0;var O=a.length;return h<0&&(h=Tt(O+h,0)),Ch(a)?h<=O&&a.indexOf(u,h)>-1:!!O&&is(a,u,h)>-1}var UF=Le(function(a,u,h){var S=-1,O=typeof u=="function",N=Zr(a)?Y(a.length):[];return ji(a,function(L){N[++S]=O?$r(u,L,h):ca(L,u,h)}),N}),HF=fh(function(a,u,h){hn(a,h,u)});function Sh(a,u){var h=Te(a)?qt:de;return h(a,xe(u,3))}function BF(a,u,h,S){return a==null?[]:(Te(u)||(u=u==null?[]:[u]),h=S?t:h,Te(h)||(h=h==null?[]:[h]),LC(a,u,h))}var VF=fh(function(a,u,h){a[h?0:1].push(u)},function(){return[[],[]]});function WF(a,u,h){var S=Te(a)?Pc:Cl,O=arguments.length<3;return S(a,xe(u,4),h,O,ji)}function zF(a,u,h){var S=Te(a)?mv:Cl,O=arguments.length<3;return S(a,xe(u,4),h,O,ih)}function JF(a,u){var h=Te(a)?Ai:sh;return h(a,Rh(xe(u,3)))}function GF(a){var u=Te(a)?th:LN;return u(a)}function YF(a,u,h){(h?Lr(a,u,h):u===t)?u=1:u=Ne(u);var S=Te(a)?ub:UN;return S(a,u)}function KF(a){var u=Te(a)?cb:BN;return u(a)}function QF(a){if(a==null)return 0;if(Zr(a))return Ch(a)?$i(a):a.length;var u=xr(a);return u==At||u==Se?a.size:T(a).length}function ZF(a,u,h){var S=Te(a)?Rl:VN;return h&&Lr(a,u,h)&&(u=t),S(a,xe(u,3))}var XF=Le(function(a,u){if(a==null)return[];var h=u.length;return h>1&&Lr(a,u[0],u[1])?u=[]:h>2&&Lr(u[0],u[1],u[2])&&(u=[u[0]]),LC(a,ar(u,1),[])}),wh=Lv||function(){return er.Date.now()};function eD(a,u){if(typeof u!="function")throw new Dr(i);return a=Ne(a),function(){if(--a<1)return u.apply(this,arguments)}}function $E(a,u,h){return u=h?t:u,u=a&&u==null?a.length:u,cs(a,j,t,t,t,t,u)}function NE(a,u){var h;if(typeof u!="function")throw new Dr(i);return a=Ne(a),function(){return--a>0&&(h=u.apply(this,arguments)),a<=1&&(u=t),h}}var Hb=Le(function(a,u,h){var S=x;if(h.length){var O=An(h,Gl(Hb));S|=P}return cs(a,S,u,h,O)}),ME=Le(function(a,u,h){var S=x|v;if(h.length){var O=An(h,Gl(ME));S|=P}return cs(u,S,a,h,O)});function FE(a,u,h){u=h?t:u;var S=cs(a,E,t,t,t,t,t,u);return S.placeholder=FE.placeholder,S}function DE(a,u,h){u=h?t:u;var S=cs(a,k,t,t,t,t,t,u);return S.placeholder=DE.placeholder,S}function jE(a,u,h){var S,O,N,L,B,z,X=0,ee=!1,ne=!1,ce=!0;if(typeof a!="function")throw new Dr(i);u=Dn(u)||0,Ht(h)&&(ee=!!h.leading,ne="maxWait"in h,N=ne?Tt(Dn(h.maxWait)||0,u):N,ce="trailing"in h?!!h.trailing:ce);function ve(Zt){var ai=S,ms=O;return S=O=t,X=Zt,L=a.apply(ms,ai),L}function Ce(Zt){return X=Zt,B=Yc(Ye,u),ee?ve(Zt):L}function Fe(Zt){var ai=Zt-z,ms=Zt-X,sq=u-ai;return ne?or(sq,N-ms):sq}function Re(Zt){var ai=Zt-z,ms=Zt-X;return z===t||ai>=u||ai<0||ne&&ms>=N}function Ye(){var Zt=wh();if(Re(Zt))return Xe(Zt);B=Yc(Ye,Fe(Zt))}function Xe(Zt){return B=t,ce&&S?ve(Zt):(S=O=t,L)}function vn(){B!==t&&YC(B),X=0,S=z=O=B=t}function Ur(){return B===t?L:Xe(wh())}function bn(){var Zt=wh(),ai=Re(Zt);if(S=arguments,O=this,z=Zt,ai){if(B===t)return Ce(z);if(ne)return YC(B),B=Yc(Ye,u),ve(z)}return B===t&&(B=Yc(Ye,u)),L}return bn.cancel=vn,bn.flush=Ur,bn}var tD=Le(function(a,u){return Hc(a,1,u)}),rD=Le(function(a,u,h){return Hc(a,Dn(u)||0,h)});function nD(a){return cs(a,R)}function _h(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Dr(i);var h=function(){var S=arguments,O=u?u.apply(this,S):S[0],N=h.cache;if(N.has(O))return N.get(O);var L=a.apply(this,S);return h.cache=N.set(O,L)||N,L};return h.cache=new(_h.Cache||ti),h}_h.Cache=ti;function Rh(a){if(typeof a!="function")throw new Dr(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 iD(a){return NE(2,a)}var sD=WN(function(a,u){u=u.length==1&&Te(u[0])?qt(u[0],Mr(xe())):qt(ar(u,1),Mr(xe()));var h=u.length;return Le(function(S){for(var O=-1,N=or(S.length,h);++O<N;)S[O]=u[O].call(this,S[O]);return $r(a,this,S)})}),Bb=Le(function(a,u){var h=An(u,Gl(Bb));return cs(a,P,t,u,h)}),LE=Le(function(a,u){var h=An(u,Gl(LE));return cs(a,M,t,u,h)}),oD=fs(function(a,u){return cs(a,I,t,t,t,u)});function aD(a,u){if(typeof a!="function")throw new Dr(i);return u=u===t?u:Ne(u),Le(a,u)}function lD(a,u){if(typeof a!="function")throw new Dr(i);return u=u==null?0:Tt(Ne(u),0),Le(function(h){var S=h[u],O=ro(h,0,u);return S&&Ti(O,S),$r(a,this,O)})}function uD(a,u,h){var S=!0,O=!0;if(typeof a!="function")throw new Dr(i);return Ht(h)&&(S="leading"in h?!!h.leading:S,O="trailing"in h?!!h.trailing:O),jE(a,u,{leading:S,maxWait:u,trailing:O})}function cD(a){return $E(a,1)}function fD(a,u){return Bb(qb(u),a)}function dD(){if(!arguments.length)return[];var a=arguments[0];return Te(a)?a:[a]}function pD(a){return Rr(a,y)}function hD(a,u){return u=typeof u=="function"?u:t,Rr(a,y,u)}function mD(a){return Rr(a,p|y)}function gD(a,u){return u=typeof u=="function"?u:t,Rr(a,p|y,u)}function yD(a,u){return u==null||$n(a,u,pr(u))}function oi(a,u){return a===u||a!==a&&u!==u}var vD=mh(Vc),bD=mh(function(a,u){return a>=u}),ha=lh((function(){return arguments})())?lh:function(a){return Vt(a)&&dt.call(a,"callee")&&!ta.call(a,"callee")},Te=Y.isArray,SD=Ic?Mr(Ic):vb;function Zr(a){return a!=null&&xh(a.length)&&!ps(a)}function Qt(a){return Vt(a)&&Zr(a)}function wD(a){return a===!0||a===!1||Vt(a)&&hr(a)==Tr}var no=Fl||tS,_D=kp?Mr(kp):bb;function RD(a){return Vt(a)&&a.nodeType===1&&!Kc(a)}function xD(a){if(a==null)return!0;if(Zr(a)&&(Te(a)||typeof a=="string"||typeof a.splice=="function"||no(a)||Yl(a)||ha(a)))return!a.length;var u=xr(a);if(u==At||u==Se)return!a.size;if(Gc(a))return!T(a).length;for(var h in a)if(dt.call(a,h))return!1;return!0}function CD(a,u){return fa(a,u)}function ED(a,u,h){h=typeof h=="function"?h:t;var S=h?h(a,u):t;return S===t?fa(a,u,t,h):!!S}function Vb(a){if(!Vt(a))return!1;var u=hr(a);return u==bt||u==Rt||typeof a.message=="string"&&typeof a.name=="string"&&!Kc(a)}function qD(a){return typeof a=="number"&&as(a)}function ps(a){if(!Ht(a))return!1;var u=hr(a);return u==Jr||u==Ms||u==at||u==Ae}function UE(a){return typeof a=="number"&&a==Ne(a)}function xh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=He}function Ht(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Vt(a){return a!=null&&typeof a=="object"}var HE=Ap?Mr(Ap):Zs;function ID(a,u){return a===u||Xs(a,u,$b(u))}function OD(a,u,h){return h=typeof h=="function"?h:t,Xs(a,u,$b(u),h)}function PD(a){return BE(a)&&a!=+a}function kD(a){if(hM(a))throw new Ie(n);return Ge(a)}function AD(a){return a===null}function TD(a){return a==null}function BE(a){return typeof a=="number"||Vt(a)&&hr(a)==Pi}function Kc(a){if(!Vt(a)||hr(a)!=te)return!1;var u=Tl(a);if(u===null)return!0;var h=dt.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&Ol.call(h)==Mv}var Wb=Yo?Mr(Yo):f;function $D(a){return UE(a)&&a>=-He&&a<=He}var VE=Zn?Mr(Zn):g;function Ch(a){return typeof a=="string"||!Te(a)&&Vt(a)&&hr(a)==Qe}function yn(a){return typeof a=="symbol"||Vt(a)&&hr(a)==xt}var Yl=wl?Mr(wl):w;function ND(a){return a===t}function MD(a){return Vt(a)&&xr(a)==oe}function FD(a){return Vt(a)&&hr(a)==fr}var DD=mh(K),jD=mh(function(a,u){return a<=u});function WE(a){if(!a)return[];if(Zr(a))return Ch(a)?Fr(a):Qr(a);if(ra&&a[ra])return Ev(a[ra]());var u=xr(a),h=u==At?zs:u==Se?ql:Kl;return h(a)}function hs(a){if(!a)return a===0?a:0;if(a=Dn(a),a===fe||a===-fe){var u=a<0?-1:1;return u*_e}return a===a?a:0}function Ne(a){var u=hs(a),h=u%1;return u===u?h?u-h:u:0}function zE(a){return a?Di(Ne(a),0,Pe):0}function Dn(a){if(typeof a=="number")return a;if(yn(a))return ye;if(Ht(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Ht(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=$c(a);var h=Vo.test(a);return h||Wy.test(a)?pv(a.slice(2),h?2:8):Vy.test(a)?ye:+a}function JE(a){return Li(a,Xr(a))}function LD(a){return a?Di(Ne(a),-He,He):a===0?a:0}function St(a){return a==null?"":gn(a)}var UD=zl(function(a,u){if(Gc(u)||Zr(u)){Li(u,pr(u),a);return}for(var h in u)dt.call(u,h)&&jr(a,h,u[h])}),GE=zl(function(a,u){Li(u,Xr(u),a)}),YE=zl(function(a,u,h,S){Li(u,Xr(u),a,S)}),zb=zl(function(a,u,h,S){Li(u,pr(u),a,S)}),HD=fs(Uc);function BD(a,u){var h=Ks(a);return u==null?h:nh(h,u)}var VD=Le(function(a,u){a=Ze(a);var h=-1,S=u.length,O=S>2?u[2]:t;for(O&&Lr(u[0],u[1],O)&&(S=1);++h<S;)for(var N=u[h],L=Xr(N),B=-1,z=L.length;++B<z;){var X=L[B],ee=a[X];(ee===t||oi(ee,Js[X])&&!dt.call(a,X))&&(a[X]=N[X])}return a}),WD=Le(function(a){return a.push(t,fE),$r(KE,t,a)});function zD(a,u){return $p(a,xe(u,3),Nn)}function JD(a,u){return $p(a,xe(u,3),ri)}function GD(a,u){return a==null?a:Bc(a,xe(u,3),Xr)}function YD(a,u){return a==null?a:oh(a,xe(u,3),Xr)}function KD(a,u){return a&&Nn(a,xe(u,3))}function QD(a,u){return a&&ri(a,xe(u,3))}function ZD(a){return a==null?[]:Wl(a,pr(a))}function XD(a){return a==null?[]:Wl(a,Xr(a))}function Jb(a,u,h){var S=a==null?t:us(a,u);return S===t?h:S}function ej(a,u){return a!=null&&hE(a,u,mb)}function Gb(a,u){return a!=null&&hE(a,u,gb)}var tj=oE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Pl.call(u)),a[u]=h},Kb(en)),rj=oE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Pl.call(u)),dt.call(a,u)?a[u].push(h):a[u]=[h]},xe),nj=Le(ca);function pr(a){return Zr(a)?eh(a):T(a)}function Xr(a){return Zr(a)?eh(a,!0):H(a)}function ij(a,u){var h={};return u=xe(u,3),Nn(a,function(S,O,N){hn(h,u(S,O,N),S)}),h}function sj(a,u){var h={};return u=xe(u,3),Nn(a,function(S,O,N){hn(h,O,u(S,O,N))}),h}var oj=zl(function(a,u,h){tr(a,u,h)}),KE=zl(function(a,u,h,S){tr(a,u,h,S)}),aj=fs(function(a,u){var h={};if(a==null)return h;var S=!1;u=qt(u,function(N){return N=to(N,a),S||(S=N.length>1),N}),Li(a,Ab(a),h),S&&(h=Rr(h,p|m|y,rM));for(var O=u.length;O--;)xb(h,u[O]);return h});function lj(a,u){return QE(a,Rh(xe(u)))}var uj=fs(function(a,u){return a==null?{}:FN(a,u)});function QE(a,u){if(a==null)return{};var h=qt(Ab(a),function(S){return[S]});return u=xe(u),UC(a,h,function(S,O){return u(S,O[0])})}function cj(a,u,h){u=to(u,a);var S=-1,O=u.length;for(O||(O=1,a=t);++S<O;){var N=a==null?t:a[si(u[S])];N===t&&(S=O,N=h),a=ps(N)?N.call(a):N}return a}function fj(a,u,h){return a==null?a:zc(a,u,h)}function dj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:zc(a,u,h,S)}var ZE=uE(pr),XE=uE(Xr);function pj(a,u,h){var S=Te(a),O=S||no(a)||Yl(a);if(u=xe(u,4),h==null){var N=a&&a.constructor;O?h=S?new N:[]:Ht(a)?h=ps(N)?Ks(Tl(a)):{}:h={}}return(O?Nr:Nn)(a,function(L,B,z){return u(h,L,B,z)}),h}function hj(a,u){return a==null?!0:xb(a,u)}function mj(a,u,h){return a==null?a:zC(a,u,qb(h))}function gj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:zC(a,u,qb(h),S)}function Kl(a){return a==null?[]:El(a,pr(a))}function yj(a){return a==null?[]:El(a,Xr(a))}function vj(a,u,h){return h===t&&(h=u,u=t),h!==t&&(h=Dn(h),h=h===h?h:0),u!==t&&(u=Dn(u),u=u===u?u:0),Di(Dn(a),u,h)}function bj(a,u,h){return u=hs(u),h===t?(h=u,u=0):h=hs(h),a=Dn(a),yb(a,u,h)}function Sj(a,u,h){if(h&&typeof h!="boolean"&&Lr(a,u,h)&&(u=h=t),h===t&&(typeof u=="boolean"?(h=u,u=t):typeof a=="boolean"&&(h=a,a=t)),a===t&&u===t?(a=0,u=1):(a=hs(a),u===t?(u=a,a=0):u=hs(u)),a>u){var S=a;a=u,u=S}if(h||a%1||u%1){var O=Jp();return or(a+O*(u-a+Op("1e-"+((O+"").length-1))),u)}return wb(a,u)}var wj=Jl(function(a,u,h){return u=u.toLowerCase(),a+(h?eq(u):u)});function eq(a){return Yb(St(a).toLowerCase())}function tq(a){return a=St(a),a&&a.replace(Wo,_v).replace(ov,"")}function _j(a,u,h){a=St(a),u=gn(u);var S=a.length;h=h===t?S:Di(Ne(h),0,S);var O=h;return h-=u.length,h>=0&&a.slice(h,O)==u}function Rj(a){return a=St(a),a&&me.test(a)?a.replace(dl,Rv):a}function xj(a){return a=St(a),a&&Bo.test(a)?a.replace(ct,"\\$&"):a}var Cj=Jl(function(a,u,h){return a+(h?"-":"")+u.toLowerCase()}),Ej=Jl(function(a,u,h){return a+(h?" ":"")+u.toLowerCase()}),qj=nE("toLowerCase");function Ij(a,u,h){a=St(a),u=Ne(u);var S=u?$i(a):0;if(!u||S>=u)return a;var O=(u-S)/2;return hh(ia(O),h)+a+hh(na(O),h)}function Oj(a,u,h){a=St(a),u=Ne(u);var S=u?$i(a):0;return u&&S<u?a+hh(u-S,h):a}function Pj(a,u,h){a=St(a),u=Ne(u);var S=u?$i(a):0;return u&&S<u?hh(u-S,h)+a:a}function kj(a,u,h){return h||u==null?u=0:u&&(u=+u),Hv(St(a).replace(yc,""),u||0)}function Aj(a,u,h){return(h?Lr(a,u,h):u===t)?u=1:u=Ne(u),_b(St(a),u)}function Tj(){var a=arguments,u=St(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var $j=Jl(function(a,u,h){return a+(h?"_":"")+u.toLowerCase()});function Nj(a,u,h){return h&&typeof h!="number"&&Lr(a,u,h)&&(u=h=t),h=h===t?Pe:h>>>0,h?(a=St(a),a&&(typeof u=="string"||u!=null&&!Wb(u))&&(u=gn(u),!u&&Ws(a))?ro(Fr(a),0,h):a.split(u,h)):[]}var Mj=Jl(function(a,u,h){return a+(h?" ":"")+Yb(u)});function Fj(a,u,h){return a=St(a),h=h==null?0:Di(Ne(h),0,a.length),u=gn(u),a.slice(h,h+u.length)==u}function Dj(a,u,h){var S=$.templateSettings;h&&Lr(a,u,h)&&(u=t),a=St(a),u=zb({},u,S,cE);var O=zb({},u.imports,S.imports,cE),N=pr(O),L=El(O,N);Nr(N,function(Re){if(Yr.test(Re))throw new Ie(o)});var B,z,X=0,ee=u.interpolate||zo,ne="__p += '",ce=Il((u.escape||zo).source+"|"+ee.source+"|"+(ee===On?rs:zo).source+"|"+(u.evaluate||zo).source+"|$","g"),ve="//# sourceURL="+(dt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++fv+"]")+`
3
+ `)}function fM(a){return Te(a)||ha(a)||!!(Vp&&a&&a[Vp])}function ds(a,u){var h=typeof a;return u=u??He,!!u&&(h=="number"||h!="symbol"&&Ls.test(a))&&a>-1&&a%1==0&&a<u}function Lr(a,u,h){if(!Ht(h))return!1;var S=typeof u;return(S=="number"?Zr(h)&&ds(u,h.length):S=="string"&&u in h)?oi(h[u],a):!1}function Mb(a,u){if(Te(a))return!1;var h=typeof a;return h=="number"||h=="symbol"||h=="boolean"||a==null||yn(a)?!0:Be.test(a)||!Gr.test(a)||u!=null&&a in Ze(u)}function dM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Fb(a){var u=gh(a),h=$[u];if(typeof h!="function"||!(u in Ve.prototype))return!1;if(a===h)return!0;var S=Tb(h);return!!S&&a===S[0]}function pM(a){return!!Up&&Up in a}var hM=ea?ps:tS;function Gc(a){var u=a&&a.constructor,h=typeof u=="function"&&u.prototype||Js;return a===h}function gE(a){return a===a&&!Ht(a)}function yE(a,u){return function(h){return h==null?!1:h[a]===u&&(u!==t||a in Ze(h))}}function mM(a){var u=_h(a,function(S){return h.size===c&&h.clear(),S}),h=u.cache;return u}function gM(a,u){var h=a[1],S=u[1],O=h|S,N=O<(x|v|j),L=S==j&&h==E||S==j&&h==I&&a[7].length<=u[8]||S==(j|I)&&u[7].length<=u[8]&&h==E;if(!(N||L))return a;S&x&&(a[2]=u[2],O|=h&x?0:R);var B=u[3];if(B){var z=a[3];a[3]=z?XC(z,B,u[4]):B,a[4]=z?An(a[3],d):u[4]}return B=u[5],B&&(z=a[5],a[5]=z?eE(z,B,u[6]):B,a[6]=z?An(a[5],d):u[6]),B=u[7],B&&(a[7]=B),S&j&&(a[8]=a[8]==null?u[8]:or(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=O,a}function yM(a){var u=[];if(a!=null)for(var h in Ze(a))u.push(h);return u}function vM(a){return Pl.call(a)}function vE(a,u,h){return u=Tt(u===t?a.length-1:u,0),function(){for(var S=arguments,O=-1,N=Tt(S.length-u,0),L=Y(N);++O<N;)L[O]=S[u+O];O=-1;for(var B=Y(u+1);++O<u;)B[O]=S[O];return B[u]=h(L),$r(a,this,B)}}function bE(a,u){return u.length<2?a:us(a,Mn(u,0,-1))}function bM(a,u){for(var h=a.length,S=or(u.length,h),O=Qr(a);S--;){var N=u[S];a[S]=ds(N,h)?O[N]:t}return a}function Db(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var SE=_E(BC),Yc=Uv||function(a,u){return er.setTimeout(a,u)},jb=_E(HN);function wE(a,u,h){var S=u+"";return jb(a,cM(S,SM(aM(S),h)))}function _E(a){var u=0,h=0;return function(){var S=zp(),O=D-(S-h);if(h=S,O>0){if(++u>=U)return arguments[0]}else u=0;return a.apply(t,arguments)}}function vh(a,u){var h=-1,S=a.length,O=S-1;for(u=u===t?S:u;++h<u;){var N=wb(h,O),L=a[N];a[N]=a[h],a[h]=L}return a.length=u,a}var RE=mM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(gc,function(h,S,O,N){u.push(O?N.replace(Qn,"$1"):S||h)}),u});function si(a){if(typeof a=="string"||yn(a))return a;var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function pa(a){if(a!=null){try{return Ol.call(a)}catch{}try{return a+""}catch{}}return""}function SM(a,u){return Nr(he,function(h){var S="_."+h[0];u&h[1]&&!_l(a,S)&&a.push(S)}),a.sort()}function xE(a){if(a instanceof Ve)return a.clone();var u=new _r(a.__wrapped__,a.__chain__);return u.__actions__=Qr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function wM(a,u,h){(h?Lr(a,u,h):u===t)?u=1:u=Tt(Ne(u),0);var S=a==null?0:a.length;if(!S||u<1)return[];for(var O=0,N=0,L=Y(na(S/u));O<S;)L[N++]=Mn(a,O,O+=u);return L}function _M(a){for(var u=-1,h=a==null?0:a.length,S=0,O=[];++u<h;){var N=a[u];N&&(O[S++]=N)}return O}function RM(){var a=arguments.length;if(!a)return[];for(var u=Y(a-1),h=arguments[0],S=a;S--;)u[S-1]=arguments[S];return Ti(Te(h)?Qr(h):[h],ar(u,1))}var xM=Le(function(a,u){return Qt(a)?ua(a,ar(u,1,Qt,!0)):[]}),CM=Le(function(a,u){var h=Fn(u);return Qt(h)&&(h=t),Qt(a)?ua(a,ar(u,1,Qt,!0),xe(h,2)):[]}),EM=Le(function(a,u){var h=Fn(u);return Qt(h)&&(h=t),Qt(a)?ua(a,ar(u,1,Qt,!0),t,h):[]});function qM(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Ne(u),Mn(a,u<0?0:u,S)):[]}function IM(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Ne(u),u=S-u,Mn(a,0,u<0?0:u)):[]}function OM(a,u){return a&&a.length?ch(a,xe(u,3),!0,!0):[]}function PM(a,u){return a&&a.length?ch(a,xe(u,3),!0):[]}function kM(a,u,h,S){var O=a==null?0:a.length;return O?(h&&typeof h!="number"&&Lr(a,u,h)&&(h=0,S=O),hb(a,u,h,S)):[]}function CE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Ne(h);return O<0&&(O=Tt(S+O,0)),xl(a,xe(u,3),O)}function EE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S-1;return h!==t&&(O=Ne(h),O=h<0?Tt(S+O,0):or(O,S-1)),xl(a,xe(u,3),O,!0)}function qE(a){var u=a==null?0:a.length;return u?ar(a,1):[]}function AM(a){var u=a==null?0:a.length;return u?ar(a,fe):[]}function TM(a,u){var h=a==null?0:a.length;return h?(u=u===t?1:Ne(u),ar(a,u)):[]}function $M(a){for(var u=-1,h=a==null?0:a.length,S={};++u<h;){var O=a[u];hn(S,O[0],O[1])}return S}function IE(a){return a&&a.length?a[0]:t}function NM(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Ne(h);return O<0&&(O=Tt(S+O,0)),is(a,u,O)}function MM(a){var u=a==null?0:a.length;return u?Mn(a,0,-1):[]}var FM=Le(function(a){var u=qt(a,Eb);return u.length&&u[0]===a[0]?mn(u):[]}),DM=Le(function(a){var u=Fn(a),h=qt(a,Eb);return u===Fn(h)?u=t:h.pop(),h.length&&h[0]===a[0]?mn(h,xe(u,2)):[]}),jM=Le(function(a){var u=Fn(a),h=qt(a,Eb);return u=typeof u=="function"?u:t,u&&h.pop(),h.length&&h[0]===a[0]?mn(h,t,u):[]});function LM(a,u){return a==null?"":Dl.call(a,u)}function Fn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function UM(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S;return h!==t&&(O=Ne(h),O=O<0?Tt(S+O,0):or(O,S-1)),u===u?Nc(a,u,O):xl(a,ss,O,!0)}function HM(a,u){return a&&a.length?ii(a,Ne(u)):t}var BM=Le(OE);function OE(a,u){return a&&a.length&&u&&u.length?Sb(a,u):a}function VM(a,u,h){return a&&a.length&&u&&u.length?Sb(a,u,xe(h,2)):a}function WM(a,u,h){return a&&a.length&&u&&u.length?Sb(a,u,t,h):a}var zM=fs(function(a,u){var h=a==null?0:a.length,S=Uc(a,u);return HC(a,qt(u,function(O){return ds(O,h)?+O:O}).sort(ZC)),S});function JM(a,u){var h=[];if(!(a&&a.length))return h;var S=-1,O=[],N=a.length;for(u=xe(u,3);++S<N;){var L=a[S];u(L,S,a)&&(h.push(L),O.push(S))}return HC(a,O),h}function Lb(a){return a==null?a:Bv.call(a)}function GM(a,u,h){var S=a==null?0:a.length;return S?(h&&typeof h!="number"&&Lr(a,u,h)?(u=0,h=S):(u=u==null?0:Ne(u),h=h===t?S:Ne(h)),Mn(a,u,h)):[]}function YM(a,u){return uh(a,u)}function KM(a,u,h){return Rb(a,u,xe(h,2))}function QM(a,u){var h=a==null?0:a.length;if(h){var S=uh(a,u);if(S<h&&oi(a[S],u))return S}return-1}function ZM(a,u){return uh(a,u,!0)}function XM(a,u,h){return Rb(a,u,xe(h,2),!0)}function eF(a,u){var h=a==null?0:a.length;if(h){var S=uh(a,u,!0)-1;if(oi(a[S],u))return S}return-1}function tF(a){return a&&a.length?VC(a):[]}function rF(a,u){return a&&a.length?VC(a,xe(u,2)):[]}function nF(a){var u=a==null?0:a.length;return u?Mn(a,1,u):[]}function iF(a,u,h){return a&&a.length?(u=h||u===t?1:Ne(u),Mn(a,0,u<0?0:u)):[]}function sF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Ne(u),u=S-u,Mn(a,u<0?0:u,S)):[]}function oF(a,u){return a&&a.length?ch(a,xe(u,3),!1,!0):[]}function aF(a,u){return a&&a.length?ch(a,xe(u,3)):[]}var lF=Le(function(a){return eo(ar(a,1,Qt,!0))}),uF=Le(function(a){var u=Fn(a);return Qt(u)&&(u=t),eo(ar(a,1,Qt,!0),xe(u,2))}),cF=Le(function(a){var u=Fn(a);return u=typeof u=="function"?u:t,eo(ar(a,1,Qt,!0),t,u)});function fF(a){return a&&a.length?eo(a):[]}function dF(a,u){return a&&a.length?eo(a,xe(u,2)):[]}function pF(a,u){return u=typeof u=="function"?u:t,a&&a.length?eo(a,t,u):[]}function Ub(a){if(!(a&&a.length))return[];var u=0;return a=Ai(a,function(h){if(Qt(h))return u=Tt(h.length,u),!0}),Tc(u,function(h){return qt(a,Ko(h))})}function PE(a,u){if(!(a&&a.length))return[];var h=Ub(a);return u==null?h:qt(h,function(S){return $r(u,t,S)})}var hF=Le(function(a,u){return Qt(a)?ua(a,u):[]}),mF=Le(function(a){return Cb(Ai(a,Qt))}),gF=Le(function(a){var u=Fn(a);return Qt(u)&&(u=t),Cb(Ai(a,Qt),xe(u,2))}),yF=Le(function(a){var u=Fn(a);return u=typeof u=="function"?u:t,Cb(Ai(a,Qt),t,u)}),vF=Le(Ub);function bF(a,u){return GC(a||[],u||[],jr)}function SF(a,u){return GC(a||[],u||[],zc)}var wF=Le(function(a){var u=a.length,h=u>1?a[u-1]:t;return h=typeof h=="function"?(a.pop(),h):t,PE(a,h)});function kE(a){var u=$(a);return u.__chain__=!0,u}function _F(a,u){return u(a),a}function bh(a,u){return u(a)}var RF=fs(function(a){var u=a.length,h=u?a[0]:0,S=this.__wrapped__,O=function(N){return Uc(N,a)};return u>1||this.__actions__.length||!(S instanceof Ve)||!ds(h)?this.thru(O):(S=S.slice(h,+h+(u?1:0)),S.__actions__.push({func:bh,args:[O],thisArg:t}),new _r(S,this.__chain__).thru(function(N){return u&&!N.length&&N.push(t),N}))});function xF(){return kE(this)}function CF(){return new _r(this.value(),this.__chain__)}function EF(){this.__values__===t&&(this.__values__=WE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function qF(){return this}function IF(a){for(var u,h=this;h instanceof Ul;){var S=xE(h);S.__index__=0,S.__values__=t,u?O.__wrapped__=S:u=S;var O=S;h=h.__wrapped__}return O.__wrapped__=a,u}function OF(){var a=this.__wrapped__;if(a instanceof Ve){var u=a;return this.__actions__.length&&(u=new Ve(this)),u=u.reverse(),u.__actions__.push({func:bh,args:[Lb],thisArg:t}),new _r(u,this.__chain__)}return this.thru(Lb)}function PF(){return JC(this.__wrapped__,this.__actions__)}var kF=fh(function(a,u,h){dt.call(a,h)?++a[h]:hn(a,h,1)});function AF(a,u,h){var S=Te(a)?Tp:pb;return h&&Lr(a,u,h)&&(u=t),S(a,xe(u,3))}function TF(a,u){var h=Te(a)?Ai:sh;return h(a,xe(u,3))}var $F=iE(CE),NF=iE(EE);function MF(a,u){return ar(Sh(a,u),1)}function FF(a,u){return ar(Sh(a,u),fe)}function DF(a,u,h){return h=h===t?1:Ne(h),ar(Sh(a,u),h)}function AE(a,u){var h=Te(a)?Nr:ji;return h(a,xe(u,3))}function TE(a,u){var h=Te(a)?Oc:ih;return h(a,xe(u,3))}var jF=fh(function(a,u,h){dt.call(a,h)?a[h].push(u):hn(a,h,[u])});function LF(a,u,h,S){a=Zr(a)?a:Kl(a),h=h&&!S?Ne(h):0;var O=a.length;return h<0&&(h=Tt(O+h,0)),Ch(a)?h<=O&&a.indexOf(u,h)>-1:!!O&&is(a,u,h)>-1}var UF=Le(function(a,u,h){var S=-1,O=typeof u=="function",N=Zr(a)?Y(a.length):[];return ji(a,function(L){N[++S]=O?$r(u,L,h):ca(L,u,h)}),N}),HF=fh(function(a,u,h){hn(a,h,u)});function Sh(a,u){var h=Te(a)?qt:de;return h(a,xe(u,3))}function BF(a,u,h,S){return a==null?[]:(Te(u)||(u=u==null?[]:[u]),h=S?t:h,Te(h)||(h=h==null?[]:[h]),LC(a,u,h))}var VF=fh(function(a,u,h){a[h?0:1].push(u)},function(){return[[],[]]});function WF(a,u,h){var S=Te(a)?Pc:Cl,O=arguments.length<3;return S(a,xe(u,4),h,O,ji)}function zF(a,u,h){var S=Te(a)?mv:Cl,O=arguments.length<3;return S(a,xe(u,4),h,O,ih)}function JF(a,u){var h=Te(a)?Ai:sh;return h(a,Rh(xe(u,3)))}function GF(a){var u=Te(a)?th:LN;return u(a)}function YF(a,u,h){(h?Lr(a,u,h):u===t)?u=1:u=Ne(u);var S=Te(a)?ub:UN;return S(a,u)}function KF(a){var u=Te(a)?cb:BN;return u(a)}function QF(a){if(a==null)return 0;if(Zr(a))return Ch(a)?$i(a):a.length;var u=xr(a);return u==At||u==Se?a.size:T(a).length}function ZF(a,u,h){var S=Te(a)?Rl:VN;return h&&Lr(a,u,h)&&(u=t),S(a,xe(u,3))}var XF=Le(function(a,u){if(a==null)return[];var h=u.length;return h>1&&Lr(a,u[0],u[1])?u=[]:h>2&&Lr(u[0],u[1],u[2])&&(u=[u[0]]),LC(a,ar(u,1),[])}),wh=Lv||function(){return er.Date.now()};function eD(a,u){if(typeof u!="function")throw new Dr(i);return a=Ne(a),function(){if(--a<1)return u.apply(this,arguments)}}function $E(a,u,h){return u=h?t:u,u=a&&u==null?a.length:u,cs(a,j,t,t,t,t,u)}function NE(a,u){var h;if(typeof u!="function")throw new Dr(i);return a=Ne(a),function(){return--a>0&&(h=u.apply(this,arguments)),a<=1&&(u=t),h}}var Hb=Le(function(a,u,h){var S=x;if(h.length){var O=An(h,Gl(Hb));S|=P}return cs(a,S,u,h,O)}),ME=Le(function(a,u,h){var S=x|v;if(h.length){var O=An(h,Gl(ME));S|=P}return cs(u,S,a,h,O)});function FE(a,u,h){u=h?t:u;var S=cs(a,E,t,t,t,t,t,u);return S.placeholder=FE.placeholder,S}function DE(a,u,h){u=h?t:u;var S=cs(a,k,t,t,t,t,t,u);return S.placeholder=DE.placeholder,S}function jE(a,u,h){var S,O,N,L,B,z,X=0,ee=!1,ne=!1,ce=!0;if(typeof a!="function")throw new Dr(i);u=Dn(u)||0,Ht(h)&&(ee=!!h.leading,ne="maxWait"in h,N=ne?Tt(Dn(h.maxWait)||0,u):N,ce="trailing"in h?!!h.trailing:ce);function ve(Zt){var ai=S,ms=O;return S=O=t,X=Zt,L=a.apply(ms,ai),L}function Ce(Zt){return X=Zt,B=Yc(Ye,u),ee?ve(Zt):L}function Fe(Zt){var ai=Zt-z,ms=Zt-X,sq=u-ai;return ne?or(sq,N-ms):sq}function Re(Zt){var ai=Zt-z,ms=Zt-X;return z===t||ai>=u||ai<0||ne&&ms>=N}function Ye(){var Zt=wh();if(Re(Zt))return Xe(Zt);B=Yc(Ye,Fe(Zt))}function Xe(Zt){return B=t,ce&&S?ve(Zt):(S=O=t,L)}function vn(){B!==t&&YC(B),X=0,S=z=O=B=t}function Ur(){return B===t?L:Xe(wh())}function bn(){var Zt=wh(),ai=Re(Zt);if(S=arguments,O=this,z=Zt,ai){if(B===t)return Ce(z);if(ne)return YC(B),B=Yc(Ye,u),ve(z)}return B===t&&(B=Yc(Ye,u)),L}return bn.cancel=vn,bn.flush=Ur,bn}var tD=Le(function(a,u){return Hc(a,1,u)}),rD=Le(function(a,u,h){return Hc(a,Dn(u)||0,h)});function nD(a){return cs(a,_)}function _h(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Dr(i);var h=function(){var S=arguments,O=u?u.apply(this,S):S[0],N=h.cache;if(N.has(O))return N.get(O);var L=a.apply(this,S);return h.cache=N.set(O,L)||N,L};return h.cache=new(_h.Cache||ti),h}_h.Cache=ti;function Rh(a){if(typeof a!="function")throw new Dr(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 iD(a){return NE(2,a)}var sD=WN(function(a,u){u=u.length==1&&Te(u[0])?qt(u[0],Mr(xe())):qt(ar(u,1),Mr(xe()));var h=u.length;return Le(function(S){for(var O=-1,N=or(S.length,h);++O<N;)S[O]=u[O].call(this,S[O]);return $r(a,this,S)})}),Bb=Le(function(a,u){var h=An(u,Gl(Bb));return cs(a,P,t,u,h)}),LE=Le(function(a,u){var h=An(u,Gl(LE));return cs(a,M,t,u,h)}),oD=fs(function(a,u){return cs(a,I,t,t,t,u)});function aD(a,u){if(typeof a!="function")throw new Dr(i);return u=u===t?u:Ne(u),Le(a,u)}function lD(a,u){if(typeof a!="function")throw new Dr(i);return u=u==null?0:Tt(Ne(u),0),Le(function(h){var S=h[u],O=ro(h,0,u);return S&&Ti(O,S),$r(a,this,O)})}function uD(a,u,h){var S=!0,O=!0;if(typeof a!="function")throw new Dr(i);return Ht(h)&&(S="leading"in h?!!h.leading:S,O="trailing"in h?!!h.trailing:O),jE(a,u,{leading:S,maxWait:u,trailing:O})}function cD(a){return $E(a,1)}function fD(a,u){return Bb(qb(u),a)}function dD(){if(!arguments.length)return[];var a=arguments[0];return Te(a)?a:[a]}function pD(a){return Rr(a,y)}function hD(a,u){return u=typeof u=="function"?u:t,Rr(a,y,u)}function mD(a){return Rr(a,p|y)}function gD(a,u){return u=typeof u=="function"?u:t,Rr(a,p|y,u)}function yD(a,u){return u==null||$n(a,u,pr(u))}function oi(a,u){return a===u||a!==a&&u!==u}var vD=mh(Vc),bD=mh(function(a,u){return a>=u}),ha=lh((function(){return arguments})())?lh:function(a){return Vt(a)&&dt.call(a,"callee")&&!ta.call(a,"callee")},Te=Y.isArray,SD=Ic?Mr(Ic):vb;function Zr(a){return a!=null&&xh(a.length)&&!ps(a)}function Qt(a){return Vt(a)&&Zr(a)}function wD(a){return a===!0||a===!1||Vt(a)&&hr(a)==Tr}var no=Fl||tS,_D=kp?Mr(kp):bb;function RD(a){return Vt(a)&&a.nodeType===1&&!Kc(a)}function xD(a){if(a==null)return!0;if(Zr(a)&&(Te(a)||typeof a=="string"||typeof a.splice=="function"||no(a)||Yl(a)||ha(a)))return!a.length;var u=xr(a);if(u==At||u==Se)return!a.size;if(Gc(a))return!T(a).length;for(var h in a)if(dt.call(a,h))return!1;return!0}function CD(a,u){return fa(a,u)}function ED(a,u,h){h=typeof h=="function"?h:t;var S=h?h(a,u):t;return S===t?fa(a,u,t,h):!!S}function Vb(a){if(!Vt(a))return!1;var u=hr(a);return u==bt||u==Rt||typeof a.message=="string"&&typeof a.name=="string"&&!Kc(a)}function qD(a){return typeof a=="number"&&as(a)}function ps(a){if(!Ht(a))return!1;var u=hr(a);return u==Jr||u==Ms||u==at||u==Ae}function UE(a){return typeof a=="number"&&a==Ne(a)}function xh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=He}function Ht(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Vt(a){return a!=null&&typeof a=="object"}var HE=Ap?Mr(Ap):Zs;function ID(a,u){return a===u||Xs(a,u,$b(u))}function OD(a,u,h){return h=typeof h=="function"?h:t,Xs(a,u,$b(u),h)}function PD(a){return BE(a)&&a!=+a}function kD(a){if(hM(a))throw new Ie(n);return Ge(a)}function AD(a){return a===null}function TD(a){return a==null}function BE(a){return typeof a=="number"||Vt(a)&&hr(a)==Pi}function Kc(a){if(!Vt(a)||hr(a)!=te)return!1;var u=Tl(a);if(u===null)return!0;var h=dt.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&Ol.call(h)==Mv}var Wb=Yo?Mr(Yo):f;function $D(a){return UE(a)&&a>=-He&&a<=He}var VE=Zn?Mr(Zn):g;function Ch(a){return typeof a=="string"||!Te(a)&&Vt(a)&&hr(a)==Qe}function yn(a){return typeof a=="symbol"||Vt(a)&&hr(a)==xt}var Yl=wl?Mr(wl):w;function ND(a){return a===t}function MD(a){return Vt(a)&&xr(a)==oe}function FD(a){return Vt(a)&&hr(a)==fr}var DD=mh(K),jD=mh(function(a,u){return a<=u});function WE(a){if(!a)return[];if(Zr(a))return Ch(a)?Fr(a):Qr(a);if(ra&&a[ra])return Ev(a[ra]());var u=xr(a),h=u==At?zs:u==Se?ql:Kl;return h(a)}function hs(a){if(!a)return a===0?a:0;if(a=Dn(a),a===fe||a===-fe){var u=a<0?-1:1;return u*_e}return a===a?a:0}function Ne(a){var u=hs(a),h=u%1;return u===u?h?u-h:u:0}function zE(a){return a?Di(Ne(a),0,Pe):0}function Dn(a){if(typeof a=="number")return a;if(yn(a))return ye;if(Ht(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Ht(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=$c(a);var h=Vo.test(a);return h||Wy.test(a)?pv(a.slice(2),h?2:8):Vy.test(a)?ye:+a}function JE(a){return Li(a,Xr(a))}function LD(a){return a?Di(Ne(a),-He,He):a===0?a:0}function St(a){return a==null?"":gn(a)}var UD=zl(function(a,u){if(Gc(u)||Zr(u)){Li(u,pr(u),a);return}for(var h in u)dt.call(u,h)&&jr(a,h,u[h])}),GE=zl(function(a,u){Li(u,Xr(u),a)}),YE=zl(function(a,u,h,S){Li(u,Xr(u),a,S)}),zb=zl(function(a,u,h,S){Li(u,pr(u),a,S)}),HD=fs(Uc);function BD(a,u){var h=Ks(a);return u==null?h:nh(h,u)}var VD=Le(function(a,u){a=Ze(a);var h=-1,S=u.length,O=S>2?u[2]:t;for(O&&Lr(u[0],u[1],O)&&(S=1);++h<S;)for(var N=u[h],L=Xr(N),B=-1,z=L.length;++B<z;){var X=L[B],ee=a[X];(ee===t||oi(ee,Js[X])&&!dt.call(a,X))&&(a[X]=N[X])}return a}),WD=Le(function(a){return a.push(t,fE),$r(KE,t,a)});function zD(a,u){return $p(a,xe(u,3),Nn)}function JD(a,u){return $p(a,xe(u,3),ri)}function GD(a,u){return a==null?a:Bc(a,xe(u,3),Xr)}function YD(a,u){return a==null?a:oh(a,xe(u,3),Xr)}function KD(a,u){return a&&Nn(a,xe(u,3))}function QD(a,u){return a&&ri(a,xe(u,3))}function ZD(a){return a==null?[]:Wl(a,pr(a))}function XD(a){return a==null?[]:Wl(a,Xr(a))}function Jb(a,u,h){var S=a==null?t:us(a,u);return S===t?h:S}function ej(a,u){return a!=null&&hE(a,u,mb)}function Gb(a,u){return a!=null&&hE(a,u,gb)}var tj=oE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Pl.call(u)),a[u]=h},Kb(en)),rj=oE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Pl.call(u)),dt.call(a,u)?a[u].push(h):a[u]=[h]},xe),nj=Le(ca);function pr(a){return Zr(a)?eh(a):T(a)}function Xr(a){return Zr(a)?eh(a,!0):H(a)}function ij(a,u){var h={};return u=xe(u,3),Nn(a,function(S,O,N){hn(h,u(S,O,N),S)}),h}function sj(a,u){var h={};return u=xe(u,3),Nn(a,function(S,O,N){hn(h,O,u(S,O,N))}),h}var oj=zl(function(a,u,h){tr(a,u,h)}),KE=zl(function(a,u,h,S){tr(a,u,h,S)}),aj=fs(function(a,u){var h={};if(a==null)return h;var S=!1;u=qt(u,function(N){return N=to(N,a),S||(S=N.length>1),N}),Li(a,Ab(a),h),S&&(h=Rr(h,p|m|y,rM));for(var O=u.length;O--;)xb(h,u[O]);return h});function lj(a,u){return QE(a,Rh(xe(u)))}var uj=fs(function(a,u){return a==null?{}:FN(a,u)});function QE(a,u){if(a==null)return{};var h=qt(Ab(a),function(S){return[S]});return u=xe(u),UC(a,h,function(S,O){return u(S,O[0])})}function cj(a,u,h){u=to(u,a);var S=-1,O=u.length;for(O||(O=1,a=t);++S<O;){var N=a==null?t:a[si(u[S])];N===t&&(S=O,N=h),a=ps(N)?N.call(a):N}return a}function fj(a,u,h){return a==null?a:zc(a,u,h)}function dj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:zc(a,u,h,S)}var ZE=uE(pr),XE=uE(Xr);function pj(a,u,h){var S=Te(a),O=S||no(a)||Yl(a);if(u=xe(u,4),h==null){var N=a&&a.constructor;O?h=S?new N:[]:Ht(a)?h=ps(N)?Ks(Tl(a)):{}:h={}}return(O?Nr:Nn)(a,function(L,B,z){return u(h,L,B,z)}),h}function hj(a,u){return a==null?!0:xb(a,u)}function mj(a,u,h){return a==null?a:zC(a,u,qb(h))}function gj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:zC(a,u,qb(h),S)}function Kl(a){return a==null?[]:El(a,pr(a))}function yj(a){return a==null?[]:El(a,Xr(a))}function vj(a,u,h){return h===t&&(h=u,u=t),h!==t&&(h=Dn(h),h=h===h?h:0),u!==t&&(u=Dn(u),u=u===u?u:0),Di(Dn(a),u,h)}function bj(a,u,h){return u=hs(u),h===t?(h=u,u=0):h=hs(h),a=Dn(a),yb(a,u,h)}function Sj(a,u,h){if(h&&typeof h!="boolean"&&Lr(a,u,h)&&(u=h=t),h===t&&(typeof u=="boolean"?(h=u,u=t):typeof a=="boolean"&&(h=a,a=t)),a===t&&u===t?(a=0,u=1):(a=hs(a),u===t?(u=a,a=0):u=hs(u)),a>u){var S=a;a=u,u=S}if(h||a%1||u%1){var O=Jp();return or(a+O*(u-a+Op("1e-"+((O+"").length-1))),u)}return wb(a,u)}var wj=Jl(function(a,u,h){return u=u.toLowerCase(),a+(h?eq(u):u)});function eq(a){return Yb(St(a).toLowerCase())}function tq(a){return a=St(a),a&&a.replace(Wo,_v).replace(ov,"")}function _j(a,u,h){a=St(a),u=gn(u);var S=a.length;h=h===t?S:Di(Ne(h),0,S);var O=h;return h-=u.length,h>=0&&a.slice(h,O)==u}function Rj(a){return a=St(a),a&&me.test(a)?a.replace(dl,Rv):a}function xj(a){return a=St(a),a&&Bo.test(a)?a.replace(ct,"\\$&"):a}var Cj=Jl(function(a,u,h){return a+(h?"-":"")+u.toLowerCase()}),Ej=Jl(function(a,u,h){return a+(h?" ":"")+u.toLowerCase()}),qj=nE("toLowerCase");function Ij(a,u,h){a=St(a),u=Ne(u);var S=u?$i(a):0;if(!u||S>=u)return a;var O=(u-S)/2;return hh(ia(O),h)+a+hh(na(O),h)}function Oj(a,u,h){a=St(a),u=Ne(u);var S=u?$i(a):0;return u&&S<u?a+hh(u-S,h):a}function Pj(a,u,h){a=St(a),u=Ne(u);var S=u?$i(a):0;return u&&S<u?hh(u-S,h)+a:a}function kj(a,u,h){return h||u==null?u=0:u&&(u=+u),Hv(St(a).replace(yc,""),u||0)}function Aj(a,u,h){return(h?Lr(a,u,h):u===t)?u=1:u=Ne(u),_b(St(a),u)}function Tj(){var a=arguments,u=St(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var $j=Jl(function(a,u,h){return a+(h?"_":"")+u.toLowerCase()});function Nj(a,u,h){return h&&typeof h!="number"&&Lr(a,u,h)&&(u=h=t),h=h===t?Pe:h>>>0,h?(a=St(a),a&&(typeof u=="string"||u!=null&&!Wb(u))&&(u=gn(u),!u&&Ws(a))?ro(Fr(a),0,h):a.split(u,h)):[]}var Mj=Jl(function(a,u,h){return a+(h?" ":"")+Yb(u)});function Fj(a,u,h){return a=St(a),h=h==null?0:Di(Ne(h),0,a.length),u=gn(u),a.slice(h,h+u.length)==u}function Dj(a,u,h){var S=$.templateSettings;h&&Lr(a,u,h)&&(u=t),a=St(a),u=zb({},u,S,cE);var O=zb({},u.imports,S.imports,cE),N=pr(O),L=El(O,N);Nr(N,function(Re){if(Yr.test(Re))throw new Ie(o)});var B,z,X=0,ee=u.interpolate||zo,ne="__p += '",ce=Il((u.escape||zo).source+"|"+ee.source+"|"+(ee===On?rs:zo).source+"|"+(u.evaluate||zo).source+"|$","g"),ve="//# sourceURL="+(dt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++fv+"]")+`
4
4
  `;a.replace(ce,function(Re,Ye,Xe,vn,Ur,bn){return Xe||(Xe=vn),ne+=a.slice(X,bn).replace(zy,xv),Ye&&(B=!0,ne+=`' +
5
5
  __e(`+Ye+`) +
6
6
  '`),Ur&&(z=!0,ne+=`';
@@ -17,17 +17,17 @@ __p += '`),Xe&&(ne+=`' +
17
17
  function print() { __p += __j.call(arguments, '') }
18
18
  `:`;
19
19
  `)+ne+`return __p
20
- }`;var Fe=nq(function(){return lt(N,ve+"return "+ne).apply(t,L)});if(Fe.source=ne,Vb(Fe))throw Fe;return Fe}function jj(a){return St(a).toLowerCase()}function Lj(a){return St(a).toUpperCase()}function Uj(a,u,h){if(a=St(a),a&&(h||u===t))return $c(a);if(!a||!(u=gn(u)))return a;var S=Fr(a),O=Fr(u),N=Mp(S,O),L=Fp(S,O)+1;return ro(S,N,L).join("")}function Hj(a,u,h){if(a=St(a),a&&(h||u===t))return a.slice(0,Lp(a)+1);if(!a||!(u=gn(u)))return a;var S=Fr(a),O=Fp(S,Fr(u))+1;return ro(S,0,O).join("")}function Bj(a,u,h){if(a=St(a),a&&(h||u===t))return a.replace(yc,"");if(!a||!(u=gn(u)))return a;var S=Fr(a),O=Mp(S,Fr(u));return ro(S,O).join("")}function Vj(a,u){var h=A,S=F;if(Ht(u)){var O="separator"in u?u.separator:O;h="length"in u?Ne(u.length):h,S="omission"in u?gn(u.omission):S}a=St(a);var N=a.length;if(Ws(a)){var L=Fr(a);N=L.length}if(h>=N)return a;var B=h-$i(S);if(B<1)return S;var z=L?ro(L,0,B).join(""):a.slice(0,B);if(O===t)return z+S;if(L&&(B+=z.length-B),Wb(O)){if(a.slice(B).search(O)){var X,ee=z;for(O.global||(O=Il(O.source,St(mp.exec(O))+"g")),O.lastIndex=0;X=O.exec(ee);)var ne=X.index;z=z.slice(0,ne===t?B:ne)}}else if(a.indexOf(gn(O),B)!=B){var ce=z.lastIndexOf(O);ce>-1&&(z=z.slice(0,ce))}return z+S}function Wj(a){return a=St(a),a&&pl.test(a)?a.replace(ts,Iv):a}var zj=Jl(function(a,u,h){return a+(h?" ":"")+u.toUpperCase()}),Yb=nE("toUpperCase");function rq(a,u,h){return a=St(a),u=h?t:u,u===t?Cv(a)?kv(a):vv(a):a.match(u)||[]}var nq=Le(function(a,u){try{return $r(a,t,u)}catch(h){return Vb(h)?h:new Ie(h)}}),Jj=fs(function(a,u){return Nr(u,function(h){h=si(h),hn(a,h,Hb(a[h],a))}),a});function Gj(a){var u=a==null?0:a.length,h=xe();return a=u?qt(a,function(S){if(typeof S[1]!="function")throw new Dr(i);return[h(S[0]),S[1]]}):[],Le(function(S){for(var O=-1;++O<u;){var N=a[O];if($r(N[0],this,S))return $r(N[1],this,S)}})}function Yj(a){return db(Rr(a,p))}function Kb(a){return function(){return a}}function Kj(a,u){return a==null||a!==a?u:a}var Qj=sE(),Zj=sE(!0);function en(a){return a}function Qb(a){return C(typeof a=="function"?a:Rr(a,p))}function Xj(a){return qe(Rr(a,p))}function eL(a,u){return We(a,Rr(u,p))}var tL=Le(function(a,u){return function(h){return ca(h,a,u)}}),rL=Le(function(a,u){return function(h){return ca(a,h,u)}});function Zb(a,u,h){var S=pr(u),O=Wl(u,S);h==null&&!(Ht(u)&&(O.length||!S.length))&&(h=u,u=a,a=this,O=Wl(u,pr(u)));var N=!(Ht(h)&&"chain"in h)||!!h.chain,L=ps(a);return Nr(O,function(B){var z=u[B];a[B]=z,L&&(a.prototype[B]=function(){var X=this.__chain__;if(N||X){var ee=a(this.__wrapped__),ne=ee.__actions__=Qr(this.__actions__);return ne.push({func:z,args:arguments,thisArg:a}),ee.__chain__=X,ee}return z.apply(a,Ti([this.value()],arguments))})}),a}function nL(){return er._===this&&(er._=Fv),this}function Xb(){}function iL(a){return a=Ne(a),Le(function(u){return ii(u,a)})}var sL=Ob(qt),oL=Ob(Tp),aL=Ob(Rl);function iq(a){return Mb(a)?Ko(si(a)):DN(a)}function lL(a){return function(u){return a==null?t:us(a,u)}}var uL=aE(),cL=aE(!0);function eS(){return[]}function tS(){return!1}function fL(){return{}}function dL(){return""}function pL(){return!0}function hL(a,u){if(a=Ne(a),a<1||a>He)return[];var h=Pe,S=or(a,Pe);u=xe(u),a-=Pe;for(var O=Tc(S,u);++h<a;)u(h);return O}function mL(a){return Te(a)?qt(a,si):yn(a)?[a]:Qr(RE(St(a)))}function gL(a){var u=++Nv;return St(a)+u}var yL=ph(function(a,u){return a+u},0),vL=Pb("ceil"),bL=ph(function(a,u){return a/u},1),SL=Pb("floor");function wL(a){return a&&a.length?Vl(a,en,Vc):t}function _L(a,u){return a&&a.length?Vl(a,xe(u,2),Vc):t}function RL(a){return Np(a,en)}function xL(a,u){return Np(a,xe(u,2))}function CL(a){return a&&a.length?Vl(a,en,K):t}function EL(a,u){return a&&a.length?Vl(a,xe(u,2),K):t}var qL=ph(function(a,u){return a*u},1),IL=Pb("round"),OL=ph(function(a,u){return a-u},0);function PL(a){return a&&a.length?Ac(a,en):0}function kL(a,u){return a&&a.length?Ac(a,xe(u,2)):0}return $.after=eD,$.ary=$E,$.assign=UD,$.assignIn=GE,$.assignInWith=YE,$.assignWith=zb,$.at=HD,$.before=NE,$.bind=Hb,$.bindAll=Jj,$.bindKey=ME,$.castArray=dD,$.chain=kE,$.chunk=wM,$.compact=_M,$.concat=RM,$.cond=Gj,$.conforms=Yj,$.constant=Kb,$.countBy=kF,$.create=BD,$.curry=FE,$.curryRight=DE,$.debounce=jE,$.defaults=VD,$.defaultsDeep=WD,$.defer=tD,$.delay=rD,$.difference=xM,$.differenceBy=CM,$.differenceWith=EM,$.drop=qM,$.dropRight=IM,$.dropRightWhile=OM,$.dropWhile=PM,$.fill=kM,$.filter=TF,$.flatMap=MF,$.flatMapDeep=FF,$.flatMapDepth=DF,$.flatten=qE,$.flattenDeep=AM,$.flattenDepth=TM,$.flip=nD,$.flow=Qj,$.flowRight=Zj,$.fromPairs=$M,$.functions=ZD,$.functionsIn=XD,$.groupBy=jF,$.initial=MM,$.intersection=FM,$.intersectionBy=DM,$.intersectionWith=jM,$.invert=tj,$.invertBy=rj,$.invokeMap=UF,$.iteratee=Qb,$.keyBy=HF,$.keys=pr,$.keysIn=Xr,$.map=Sh,$.mapKeys=ij,$.mapValues=sj,$.matches=Xj,$.matchesProperty=eL,$.memoize=_h,$.merge=oj,$.mergeWith=KE,$.method=tL,$.methodOf=rL,$.mixin=Zb,$.negate=Rh,$.nthArg=iL,$.omit=aj,$.omitBy=lj,$.once=iD,$.orderBy=BF,$.over=sL,$.overArgs=sD,$.overEvery=oL,$.overSome=aL,$.partial=Bb,$.partialRight=LE,$.partition=VF,$.pick=uj,$.pickBy=QE,$.property=iq,$.propertyOf=lL,$.pull=BM,$.pullAll=OE,$.pullAllBy=VM,$.pullAllWith=WM,$.pullAt=zM,$.range=uL,$.rangeRight=cL,$.rearg=oD,$.reject=JF,$.remove=JM,$.rest=aD,$.reverse=Lb,$.sampleSize=YF,$.set=fj,$.setWith=dj,$.shuffle=KF,$.slice=GM,$.sortBy=XF,$.sortedUniq=tF,$.sortedUniqBy=rF,$.split=Nj,$.spread=lD,$.tail=nF,$.take=iF,$.takeRight=sF,$.takeRightWhile=oF,$.takeWhile=aF,$.tap=_F,$.throttle=uD,$.thru=bh,$.toArray=WE,$.toPairs=ZE,$.toPairsIn=XE,$.toPath=mL,$.toPlainObject=JE,$.transform=pj,$.unary=cD,$.union=lF,$.unionBy=uF,$.unionWith=cF,$.uniq=fF,$.uniqBy=dF,$.uniqWith=pF,$.unset=hj,$.unzip=Ub,$.unzipWith=PE,$.update=mj,$.updateWith=gj,$.values=Kl,$.valuesIn=yj,$.without=hF,$.words=rq,$.wrap=fD,$.xor=mF,$.xorBy=gF,$.xorWith=yF,$.zip=vF,$.zipObject=bF,$.zipObjectDeep=SF,$.zipWith=wF,$.entries=ZE,$.entriesIn=XE,$.extend=GE,$.extendWith=YE,Zb($,$),$.add=yL,$.attempt=nq,$.camelCase=wj,$.capitalize=eq,$.ceil=vL,$.clamp=vj,$.clone=pD,$.cloneDeep=mD,$.cloneDeepWith=gD,$.cloneWith=hD,$.conformsTo=yD,$.deburr=tq,$.defaultTo=Kj,$.divide=bL,$.endsWith=_j,$.eq=oi,$.escape=Rj,$.escapeRegExp=xj,$.every=AF,$.find=$F,$.findIndex=CE,$.findKey=zD,$.findLast=NF,$.findLastIndex=EE,$.findLastKey=JD,$.floor=SL,$.forEach=AE,$.forEachRight=TE,$.forIn=GD,$.forInRight=YD,$.forOwn=KD,$.forOwnRight=QD,$.get=Jb,$.gt=vD,$.gte=bD,$.has=ej,$.hasIn=Gb,$.head=IE,$.identity=en,$.includes=LF,$.indexOf=NM,$.inRange=bj,$.invoke=nj,$.isArguments=ha,$.isArray=Te,$.isArrayBuffer=SD,$.isArrayLike=Zr,$.isArrayLikeObject=Qt,$.isBoolean=wD,$.isBuffer=no,$.isDate=_D,$.isElement=RD,$.isEmpty=xD,$.isEqual=CD,$.isEqualWith=ED,$.isError=Vb,$.isFinite=qD,$.isFunction=ps,$.isInteger=UE,$.isLength=xh,$.isMap=HE,$.isMatch=ID,$.isMatchWith=OD,$.isNaN=PD,$.isNative=kD,$.isNil=TD,$.isNull=AD,$.isNumber=BE,$.isObject=Ht,$.isObjectLike=Vt,$.isPlainObject=Kc,$.isRegExp=Wb,$.isSafeInteger=$D,$.isSet=VE,$.isString=Ch,$.isSymbol=yn,$.isTypedArray=Yl,$.isUndefined=ND,$.isWeakMap=MD,$.isWeakSet=FD,$.join=LM,$.kebabCase=Cj,$.last=Fn,$.lastIndexOf=UM,$.lowerCase=Ej,$.lowerFirst=qj,$.lt=DD,$.lte=jD,$.max=wL,$.maxBy=_L,$.mean=RL,$.meanBy=xL,$.min=CL,$.minBy=EL,$.stubArray=eS,$.stubFalse=tS,$.stubObject=fL,$.stubString=dL,$.stubTrue=pL,$.multiply=qL,$.nth=HM,$.noConflict=nL,$.noop=Xb,$.now=wh,$.pad=Ij,$.padEnd=Oj,$.padStart=Pj,$.parseInt=kj,$.random=Sj,$.reduce=WF,$.reduceRight=zF,$.repeat=Aj,$.replace=Tj,$.result=cj,$.round=IL,$.runInContext=W,$.sample=GF,$.size=QF,$.snakeCase=$j,$.some=ZF,$.sortedIndex=YM,$.sortedIndexBy=KM,$.sortedIndexOf=QM,$.sortedLastIndex=ZM,$.sortedLastIndexBy=XM,$.sortedLastIndexOf=eF,$.startCase=Mj,$.startsWith=Fj,$.subtract=OL,$.sum=PL,$.sumBy=kL,$.template=Dj,$.times=hL,$.toFinite=hs,$.toInteger=Ne,$.toLength=zE,$.toLower=jj,$.toNumber=Dn,$.toSafeInteger=LD,$.toString=St,$.toUpper=Lj,$.trim=Uj,$.trimEnd=Hj,$.trimStart=Bj,$.truncate=Vj,$.unescape=Wj,$.uniqueId=gL,$.upperCase=zj,$.upperFirst=Yb,$.each=AE,$.eachRight=TE,$.first=IE,Zb($,(function(){var a={};return Nn($,function(u,h){dt.call($.prototype,h)||(a[h]=u)}),a})(),{chain:!1}),$.VERSION=e,Nr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),Nr(["drop","take"],function(a,u){Ve.prototype[a]=function(h){h=h===t?1:Tt(Ne(h),0);var S=this.__filtered__&&!u?new Ve(this):this.clone();return S.__filtered__?S.__takeCount__=or(h,S.__takeCount__):S.__views__.push({size:or(h,Pe),type:a+(S.__dir__<0?"Right":"")}),S},Ve.prototype[a+"Right"]=function(h){return this.reverse()[a](h).reverse()}}),Nr(["filter","map","takeWhile"],function(a,u){var h=u+1,S=h==J||h==se;Ve.prototype[a]=function(O){var N=this.clone();return N.__iteratees__.push({iteratee:xe(O,3),type:h}),N.__filtered__=N.__filtered__||S,N}}),Nr(["head","last"],function(a,u){var h="take"+(u?"Right":"");Ve.prototype[a]=function(){return this[h](1).value()[0]}}),Nr(["initial","tail"],function(a,u){var h="drop"+(u?"":"Right");Ve.prototype[a]=function(){return this.__filtered__?new Ve(this):this[h](1)}}),Ve.prototype.compact=function(){return this.filter(en)},Ve.prototype.find=function(a){return this.filter(a).head()},Ve.prototype.findLast=function(a){return this.reverse().find(a)},Ve.prototype.invokeMap=Le(function(a,u){return typeof a=="function"?new Ve(this):this.map(function(h){return ca(h,a,u)})}),Ve.prototype.reject=function(a){return this.filter(Rh(xe(a)))},Ve.prototype.slice=function(a,u){a=Ne(a);var h=this;return h.__filtered__&&(a>0||u<0)?new Ve(h):(a<0?h=h.takeRight(-a):a&&(h=h.drop(a)),u!==t&&(u=Ne(u),h=u<0?h.dropRight(-u):h.take(u-a)),h)},Ve.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ve.prototype.toArray=function(){return this.take(Pe)},Nn(Ve.prototype,function(a,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),O=$[S?"take"+(u=="last"?"Right":""):u],N=S||/^find/.test(u);O&&($.prototype[u]=function(){var L=this.__wrapped__,B=S?[1]:arguments,z=L instanceof Ve,X=B[0],ee=z||Te(L),ne=function(Ye){var Xe=O.apply($,Ti([Ye],B));return S&&ce?Xe[0]:Xe};ee&&h&&typeof X=="function"&&X.length!=1&&(z=ee=!1);var ce=this.__chain__,ve=!!this.__actions__.length,Ce=N&&!ce,Fe=z&&!ve;if(!N&&ee){L=Fe?L:new Ve(this);var Re=a.apply(L,B);return Re.__actions__.push({func:bh,args:[ne],thisArg:t}),new _r(Re,ce)}return Ce&&Fe?a.apply(this,B):(Re=this.thru(ne),Ce?S?Re.value()[0]:Re.value():Re)})}),Nr(["pop","push","shift","sort","splice","unshift"],function(a){var u=Xo[a],h=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",S=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var O=arguments;if(S&&!this.__chain__){var N=this.value();return u.apply(Te(N)?N:[],O)}return this[h](function(L){return u.apply(Te(L)?L:[],O)})}}),Nn(Ve.prototype,function(a,u){var h=$[u];if(h){var S=h.name+"";dt.call(Ys,S)||(Ys[S]=[]),Ys[S].push({name:u,func:h})}}),Ys[dh(t,v).name]=[{name:"wrapper",func:t}],Ve.prototype.clone=Yv,Ve.prototype.reverse=Kv,Ve.prototype.value=Dc,$.prototype.at=RF,$.prototype.chain=xF,$.prototype.commit=CF,$.prototype.next=EF,$.prototype.plant=IF,$.prototype.reverse=OF,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=PF,$.prototype.first=$.prototype.head,ra&&($.prototype[ra]=qF),$}),Ni=Av();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(er._=Ni,define(function(){return Ni})):ft?((ft.exports=Ni)._=Ni,Sl._=Ni):er._=Ni}).call(tu)});var xq=V((hS,ru)=>{(function(t,e){typeof hS=="object"&&typeof ru<"u"?ru.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(hS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(f){t=f}function n(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function i(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function s(f,g){return Object.prototype.hasOwnProperty.call(f,g)}function o(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var g;for(g in f)if(s(f,g))return!1;return!0}function l(f){return f===void 0}function c(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function d(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function p(f,g){var w=[],C,T=f.length;for(C=0;C<T;++C)w.push(g(f[C],C));return w}function m(f,g){for(var w in g)s(g,w)&&(f[w]=g[w]);return s(g,"toString")&&(f.toString=g.toString),s(g,"valueOf")&&(f.valueOf=g.valueOf),f}function y(f,g,w,C){return El(f,g,w,C,!0).utc()}function b(){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 q(f){return f._pf==null&&(f._pf=b()),f._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(f){var g=Object(this),w=g.length>>>0,C;for(C=0;C<w;C++)if(C in g&&f.call(this,g[C],C,g))return!0;return!1};function v(f){var g=null,w=!1,C=f._d&&!isNaN(f._d.getTime());if(C&&(g=q(f),w=x.call(g.parsedDateParts,function(T){return T!=null}),C=g.overflow<0&&!g.empty&&!g.invalidEra&&!g.invalidMonth&&!g.invalidWeekday&&!g.weekdayMismatch&&!g.nullInput&&!g.invalidFormat&&!g.userInvalidated&&(!g.meridiem||g.meridiem&&w),f._strict&&(C=C&&g.charsLeftOver===0&&g.unusedTokens.length===0&&g.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(f))f._isValid=C;else return C;return f._isValid}function _(f){var g=y(NaN);return f!=null?m(q(g),f):q(g).userInvalidated=!0,g}var E=e.momentProperties=[],k=!1;function P(f,g){var w,C,T,H=E.length;if(l(g._isAMomentObject)||(f._isAMomentObject=g._isAMomentObject),l(g._i)||(f._i=g._i),l(g._f)||(f._f=g._f),l(g._l)||(f._l=g._l),l(g._strict)||(f._strict=g._strict),l(g._tzm)||(f._tzm=g._tzm),l(g._isUTC)||(f._isUTC=g._isUTC),l(g._offset)||(f._offset=g._offset),l(g._pf)||(f._pf=q(g)),l(g._locale)||(f._locale=g._locale),H>0)for(w=0;w<H;w++)C=E[w],T=g[C],l(T)||(f[C]=T);return f}function M(f){P(this,f),this._d=new Date(f._d!=null?f._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),k===!1&&(k=!0,e.updateOffset(this),k=!1)}function j(f){return f instanceof M||f!=null&&f._isAMomentObject!=null}function I(f){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+f)}function R(f,g){var w=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,f),w){var C=[],T,H,K,de=arguments.length;for(H=0;H<de;H++){if(T="",typeof arguments[H]=="object"){T+=`
20
+ }`;var Fe=nq(function(){return lt(N,ve+"return "+ne).apply(t,L)});if(Fe.source=ne,Vb(Fe))throw Fe;return Fe}function jj(a){return St(a).toLowerCase()}function Lj(a){return St(a).toUpperCase()}function Uj(a,u,h){if(a=St(a),a&&(h||u===t))return $c(a);if(!a||!(u=gn(u)))return a;var S=Fr(a),O=Fr(u),N=Mp(S,O),L=Fp(S,O)+1;return ro(S,N,L).join("")}function Hj(a,u,h){if(a=St(a),a&&(h||u===t))return a.slice(0,Lp(a)+1);if(!a||!(u=gn(u)))return a;var S=Fr(a),O=Fp(S,Fr(u))+1;return ro(S,0,O).join("")}function Bj(a,u,h){if(a=St(a),a&&(h||u===t))return a.replace(yc,"");if(!a||!(u=gn(u)))return a;var S=Fr(a),O=Mp(S,Fr(u));return ro(S,O).join("")}function Vj(a,u){var h=A,S=F;if(Ht(u)){var O="separator"in u?u.separator:O;h="length"in u?Ne(u.length):h,S="omission"in u?gn(u.omission):S}a=St(a);var N=a.length;if(Ws(a)){var L=Fr(a);N=L.length}if(h>=N)return a;var B=h-$i(S);if(B<1)return S;var z=L?ro(L,0,B).join(""):a.slice(0,B);if(O===t)return z+S;if(L&&(B+=z.length-B),Wb(O)){if(a.slice(B).search(O)){var X,ee=z;for(O.global||(O=Il(O.source,St(mp.exec(O))+"g")),O.lastIndex=0;X=O.exec(ee);)var ne=X.index;z=z.slice(0,ne===t?B:ne)}}else if(a.indexOf(gn(O),B)!=B){var ce=z.lastIndexOf(O);ce>-1&&(z=z.slice(0,ce))}return z+S}function Wj(a){return a=St(a),a&&pl.test(a)?a.replace(ts,Iv):a}var zj=Jl(function(a,u,h){return a+(h?" ":"")+u.toUpperCase()}),Yb=nE("toUpperCase");function rq(a,u,h){return a=St(a),u=h?t:u,u===t?Cv(a)?kv(a):vv(a):a.match(u)||[]}var nq=Le(function(a,u){try{return $r(a,t,u)}catch(h){return Vb(h)?h:new Ie(h)}}),Jj=fs(function(a,u){return Nr(u,function(h){h=si(h),hn(a,h,Hb(a[h],a))}),a});function Gj(a){var u=a==null?0:a.length,h=xe();return a=u?qt(a,function(S){if(typeof S[1]!="function")throw new Dr(i);return[h(S[0]),S[1]]}):[],Le(function(S){for(var O=-1;++O<u;){var N=a[O];if($r(N[0],this,S))return $r(N[1],this,S)}})}function Yj(a){return db(Rr(a,p))}function Kb(a){return function(){return a}}function Kj(a,u){return a==null||a!==a?u:a}var Qj=sE(),Zj=sE(!0);function en(a){return a}function Qb(a){return C(typeof a=="function"?a:Rr(a,p))}function Xj(a){return qe(Rr(a,p))}function eL(a,u){return We(a,Rr(u,p))}var tL=Le(function(a,u){return function(h){return ca(h,a,u)}}),rL=Le(function(a,u){return function(h){return ca(a,h,u)}});function Zb(a,u,h){var S=pr(u),O=Wl(u,S);h==null&&!(Ht(u)&&(O.length||!S.length))&&(h=u,u=a,a=this,O=Wl(u,pr(u)));var N=!(Ht(h)&&"chain"in h)||!!h.chain,L=ps(a);return Nr(O,function(B){var z=u[B];a[B]=z,L&&(a.prototype[B]=function(){var X=this.__chain__;if(N||X){var ee=a(this.__wrapped__),ne=ee.__actions__=Qr(this.__actions__);return ne.push({func:z,args:arguments,thisArg:a}),ee.__chain__=X,ee}return z.apply(a,Ti([this.value()],arguments))})}),a}function nL(){return er._===this&&(er._=Fv),this}function Xb(){}function iL(a){return a=Ne(a),Le(function(u){return ii(u,a)})}var sL=Ob(qt),oL=Ob(Tp),aL=Ob(Rl);function iq(a){return Mb(a)?Ko(si(a)):DN(a)}function lL(a){return function(u){return a==null?t:us(a,u)}}var uL=aE(),cL=aE(!0);function eS(){return[]}function tS(){return!1}function fL(){return{}}function dL(){return""}function pL(){return!0}function hL(a,u){if(a=Ne(a),a<1||a>He)return[];var h=Pe,S=or(a,Pe);u=xe(u),a-=Pe;for(var O=Tc(S,u);++h<a;)u(h);return O}function mL(a){return Te(a)?qt(a,si):yn(a)?[a]:Qr(RE(St(a)))}function gL(a){var u=++Nv;return St(a)+u}var yL=ph(function(a,u){return a+u},0),vL=Pb("ceil"),bL=ph(function(a,u){return a/u},1),SL=Pb("floor");function wL(a){return a&&a.length?Vl(a,en,Vc):t}function _L(a,u){return a&&a.length?Vl(a,xe(u,2),Vc):t}function RL(a){return Np(a,en)}function xL(a,u){return Np(a,xe(u,2))}function CL(a){return a&&a.length?Vl(a,en,K):t}function EL(a,u){return a&&a.length?Vl(a,xe(u,2),K):t}var qL=ph(function(a,u){return a*u},1),IL=Pb("round"),OL=ph(function(a,u){return a-u},0);function PL(a){return a&&a.length?Ac(a,en):0}function kL(a,u){return a&&a.length?Ac(a,xe(u,2)):0}return $.after=eD,$.ary=$E,$.assign=UD,$.assignIn=GE,$.assignInWith=YE,$.assignWith=zb,$.at=HD,$.before=NE,$.bind=Hb,$.bindAll=Jj,$.bindKey=ME,$.castArray=dD,$.chain=kE,$.chunk=wM,$.compact=_M,$.concat=RM,$.cond=Gj,$.conforms=Yj,$.constant=Kb,$.countBy=kF,$.create=BD,$.curry=FE,$.curryRight=DE,$.debounce=jE,$.defaults=VD,$.defaultsDeep=WD,$.defer=tD,$.delay=rD,$.difference=xM,$.differenceBy=CM,$.differenceWith=EM,$.drop=qM,$.dropRight=IM,$.dropRightWhile=OM,$.dropWhile=PM,$.fill=kM,$.filter=TF,$.flatMap=MF,$.flatMapDeep=FF,$.flatMapDepth=DF,$.flatten=qE,$.flattenDeep=AM,$.flattenDepth=TM,$.flip=nD,$.flow=Qj,$.flowRight=Zj,$.fromPairs=$M,$.functions=ZD,$.functionsIn=XD,$.groupBy=jF,$.initial=MM,$.intersection=FM,$.intersectionBy=DM,$.intersectionWith=jM,$.invert=tj,$.invertBy=rj,$.invokeMap=UF,$.iteratee=Qb,$.keyBy=HF,$.keys=pr,$.keysIn=Xr,$.map=Sh,$.mapKeys=ij,$.mapValues=sj,$.matches=Xj,$.matchesProperty=eL,$.memoize=_h,$.merge=oj,$.mergeWith=KE,$.method=tL,$.methodOf=rL,$.mixin=Zb,$.negate=Rh,$.nthArg=iL,$.omit=aj,$.omitBy=lj,$.once=iD,$.orderBy=BF,$.over=sL,$.overArgs=sD,$.overEvery=oL,$.overSome=aL,$.partial=Bb,$.partialRight=LE,$.partition=VF,$.pick=uj,$.pickBy=QE,$.property=iq,$.propertyOf=lL,$.pull=BM,$.pullAll=OE,$.pullAllBy=VM,$.pullAllWith=WM,$.pullAt=zM,$.range=uL,$.rangeRight=cL,$.rearg=oD,$.reject=JF,$.remove=JM,$.rest=aD,$.reverse=Lb,$.sampleSize=YF,$.set=fj,$.setWith=dj,$.shuffle=KF,$.slice=GM,$.sortBy=XF,$.sortedUniq=tF,$.sortedUniqBy=rF,$.split=Nj,$.spread=lD,$.tail=nF,$.take=iF,$.takeRight=sF,$.takeRightWhile=oF,$.takeWhile=aF,$.tap=_F,$.throttle=uD,$.thru=bh,$.toArray=WE,$.toPairs=ZE,$.toPairsIn=XE,$.toPath=mL,$.toPlainObject=JE,$.transform=pj,$.unary=cD,$.union=lF,$.unionBy=uF,$.unionWith=cF,$.uniq=fF,$.uniqBy=dF,$.uniqWith=pF,$.unset=hj,$.unzip=Ub,$.unzipWith=PE,$.update=mj,$.updateWith=gj,$.values=Kl,$.valuesIn=yj,$.without=hF,$.words=rq,$.wrap=fD,$.xor=mF,$.xorBy=gF,$.xorWith=yF,$.zip=vF,$.zipObject=bF,$.zipObjectDeep=SF,$.zipWith=wF,$.entries=ZE,$.entriesIn=XE,$.extend=GE,$.extendWith=YE,Zb($,$),$.add=yL,$.attempt=nq,$.camelCase=wj,$.capitalize=eq,$.ceil=vL,$.clamp=vj,$.clone=pD,$.cloneDeep=mD,$.cloneDeepWith=gD,$.cloneWith=hD,$.conformsTo=yD,$.deburr=tq,$.defaultTo=Kj,$.divide=bL,$.endsWith=_j,$.eq=oi,$.escape=Rj,$.escapeRegExp=xj,$.every=AF,$.find=$F,$.findIndex=CE,$.findKey=zD,$.findLast=NF,$.findLastIndex=EE,$.findLastKey=JD,$.floor=SL,$.forEach=AE,$.forEachRight=TE,$.forIn=GD,$.forInRight=YD,$.forOwn=KD,$.forOwnRight=QD,$.get=Jb,$.gt=vD,$.gte=bD,$.has=ej,$.hasIn=Gb,$.head=IE,$.identity=en,$.includes=LF,$.indexOf=NM,$.inRange=bj,$.invoke=nj,$.isArguments=ha,$.isArray=Te,$.isArrayBuffer=SD,$.isArrayLike=Zr,$.isArrayLikeObject=Qt,$.isBoolean=wD,$.isBuffer=no,$.isDate=_D,$.isElement=RD,$.isEmpty=xD,$.isEqual=CD,$.isEqualWith=ED,$.isError=Vb,$.isFinite=qD,$.isFunction=ps,$.isInteger=UE,$.isLength=xh,$.isMap=HE,$.isMatch=ID,$.isMatchWith=OD,$.isNaN=PD,$.isNative=kD,$.isNil=TD,$.isNull=AD,$.isNumber=BE,$.isObject=Ht,$.isObjectLike=Vt,$.isPlainObject=Kc,$.isRegExp=Wb,$.isSafeInteger=$D,$.isSet=VE,$.isString=Ch,$.isSymbol=yn,$.isTypedArray=Yl,$.isUndefined=ND,$.isWeakMap=MD,$.isWeakSet=FD,$.join=LM,$.kebabCase=Cj,$.last=Fn,$.lastIndexOf=UM,$.lowerCase=Ej,$.lowerFirst=qj,$.lt=DD,$.lte=jD,$.max=wL,$.maxBy=_L,$.mean=RL,$.meanBy=xL,$.min=CL,$.minBy=EL,$.stubArray=eS,$.stubFalse=tS,$.stubObject=fL,$.stubString=dL,$.stubTrue=pL,$.multiply=qL,$.nth=HM,$.noConflict=nL,$.noop=Xb,$.now=wh,$.pad=Ij,$.padEnd=Oj,$.padStart=Pj,$.parseInt=kj,$.random=Sj,$.reduce=WF,$.reduceRight=zF,$.repeat=Aj,$.replace=Tj,$.result=cj,$.round=IL,$.runInContext=W,$.sample=GF,$.size=QF,$.snakeCase=$j,$.some=ZF,$.sortedIndex=YM,$.sortedIndexBy=KM,$.sortedIndexOf=QM,$.sortedLastIndex=ZM,$.sortedLastIndexBy=XM,$.sortedLastIndexOf=eF,$.startCase=Mj,$.startsWith=Fj,$.subtract=OL,$.sum=PL,$.sumBy=kL,$.template=Dj,$.times=hL,$.toFinite=hs,$.toInteger=Ne,$.toLength=zE,$.toLower=jj,$.toNumber=Dn,$.toSafeInteger=LD,$.toString=St,$.toUpper=Lj,$.trim=Uj,$.trimEnd=Hj,$.trimStart=Bj,$.truncate=Vj,$.unescape=Wj,$.uniqueId=gL,$.upperCase=zj,$.upperFirst=Yb,$.each=AE,$.eachRight=TE,$.first=IE,Zb($,(function(){var a={};return Nn($,function(u,h){dt.call($.prototype,h)||(a[h]=u)}),a})(),{chain:!1}),$.VERSION=e,Nr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),Nr(["drop","take"],function(a,u){Ve.prototype[a]=function(h){h=h===t?1:Tt(Ne(h),0);var S=this.__filtered__&&!u?new Ve(this):this.clone();return S.__filtered__?S.__takeCount__=or(h,S.__takeCount__):S.__views__.push({size:or(h,Pe),type:a+(S.__dir__<0?"Right":"")}),S},Ve.prototype[a+"Right"]=function(h){return this.reverse()[a](h).reverse()}}),Nr(["filter","map","takeWhile"],function(a,u){var h=u+1,S=h==J||h==se;Ve.prototype[a]=function(O){var N=this.clone();return N.__iteratees__.push({iteratee:xe(O,3),type:h}),N.__filtered__=N.__filtered__||S,N}}),Nr(["head","last"],function(a,u){var h="take"+(u?"Right":"");Ve.prototype[a]=function(){return this[h](1).value()[0]}}),Nr(["initial","tail"],function(a,u){var h="drop"+(u?"":"Right");Ve.prototype[a]=function(){return this.__filtered__?new Ve(this):this[h](1)}}),Ve.prototype.compact=function(){return this.filter(en)},Ve.prototype.find=function(a){return this.filter(a).head()},Ve.prototype.findLast=function(a){return this.reverse().find(a)},Ve.prototype.invokeMap=Le(function(a,u){return typeof a=="function"?new Ve(this):this.map(function(h){return ca(h,a,u)})}),Ve.prototype.reject=function(a){return this.filter(Rh(xe(a)))},Ve.prototype.slice=function(a,u){a=Ne(a);var h=this;return h.__filtered__&&(a>0||u<0)?new Ve(h):(a<0?h=h.takeRight(-a):a&&(h=h.drop(a)),u!==t&&(u=Ne(u),h=u<0?h.dropRight(-u):h.take(u-a)),h)},Ve.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ve.prototype.toArray=function(){return this.take(Pe)},Nn(Ve.prototype,function(a,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),O=$[S?"take"+(u=="last"?"Right":""):u],N=S||/^find/.test(u);O&&($.prototype[u]=function(){var L=this.__wrapped__,B=S?[1]:arguments,z=L instanceof Ve,X=B[0],ee=z||Te(L),ne=function(Ye){var Xe=O.apply($,Ti([Ye],B));return S&&ce?Xe[0]:Xe};ee&&h&&typeof X=="function"&&X.length!=1&&(z=ee=!1);var ce=this.__chain__,ve=!!this.__actions__.length,Ce=N&&!ce,Fe=z&&!ve;if(!N&&ee){L=Fe?L:new Ve(this);var Re=a.apply(L,B);return Re.__actions__.push({func:bh,args:[ne],thisArg:t}),new _r(Re,ce)}return Ce&&Fe?a.apply(this,B):(Re=this.thru(ne),Ce?S?Re.value()[0]:Re.value():Re)})}),Nr(["pop","push","shift","sort","splice","unshift"],function(a){var u=Xo[a],h=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",S=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var O=arguments;if(S&&!this.__chain__){var N=this.value();return u.apply(Te(N)?N:[],O)}return this[h](function(L){return u.apply(Te(L)?L:[],O)})}}),Nn(Ve.prototype,function(a,u){var h=$[u];if(h){var S=h.name+"";dt.call(Ys,S)||(Ys[S]=[]),Ys[S].push({name:u,func:h})}}),Ys[dh(t,v).name]=[{name:"wrapper",func:t}],Ve.prototype.clone=Yv,Ve.prototype.reverse=Kv,Ve.prototype.value=Dc,$.prototype.at=RF,$.prototype.chain=xF,$.prototype.commit=CF,$.prototype.next=EF,$.prototype.plant=IF,$.prototype.reverse=OF,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=PF,$.prototype.first=$.prototype.head,ra&&($.prototype[ra]=qF),$}),Ni=Av();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(er._=Ni,define(function(){return Ni})):ft?((ft.exports=Ni)._=Ni,Sl._=Ni):er._=Ni}).call(tu)});var xq=V((hS,ru)=>{(function(t,e){typeof hS=="object"&&typeof ru<"u"?ru.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(hS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(f){t=f}function n(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function i(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function s(f,g){return Object.prototype.hasOwnProperty.call(f,g)}function o(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var g;for(g in f)if(s(f,g))return!1;return!0}function l(f){return f===void 0}function c(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function d(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function p(f,g){var w=[],C,T=f.length;for(C=0;C<T;++C)w.push(g(f[C],C));return w}function m(f,g){for(var w in g)s(g,w)&&(f[w]=g[w]);return s(g,"toString")&&(f.toString=g.toString),s(g,"valueOf")&&(f.valueOf=g.valueOf),f}function y(f,g,w,C){return El(f,g,w,C,!0).utc()}function b(){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 q(f){return f._pf==null&&(f._pf=b()),f._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(f){var g=Object(this),w=g.length>>>0,C;for(C=0;C<w;C++)if(C in g&&f.call(this,g[C],C,g))return!0;return!1};function v(f){var g=null,w=!1,C=f._d&&!isNaN(f._d.getTime());if(C&&(g=q(f),w=x.call(g.parsedDateParts,function(T){return T!=null}),C=g.overflow<0&&!g.empty&&!g.invalidEra&&!g.invalidMonth&&!g.invalidWeekday&&!g.weekdayMismatch&&!g.nullInput&&!g.invalidFormat&&!g.userInvalidated&&(!g.meridiem||g.meridiem&&w),f._strict&&(C=C&&g.charsLeftOver===0&&g.unusedTokens.length===0&&g.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(f))f._isValid=C;else return C;return f._isValid}function R(f){var g=y(NaN);return f!=null?m(q(g),f):q(g).userInvalidated=!0,g}var E=e.momentProperties=[],k=!1;function P(f,g){var w,C,T,H=E.length;if(l(g._isAMomentObject)||(f._isAMomentObject=g._isAMomentObject),l(g._i)||(f._i=g._i),l(g._f)||(f._f=g._f),l(g._l)||(f._l=g._l),l(g._strict)||(f._strict=g._strict),l(g._tzm)||(f._tzm=g._tzm),l(g._isUTC)||(f._isUTC=g._isUTC),l(g._offset)||(f._offset=g._offset),l(g._pf)||(f._pf=q(g)),l(g._locale)||(f._locale=g._locale),H>0)for(w=0;w<H;w++)C=E[w],T=g[C],l(T)||(f[C]=T);return f}function M(f){P(this,f),this._d=new Date(f._d!=null?f._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),k===!1&&(k=!0,e.updateOffset(this),k=!1)}function j(f){return f instanceof M||f!=null&&f._isAMomentObject!=null}function I(f){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+f)}function _(f,g){var w=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,f),w){var C=[],T,H,K,de=arguments.length;for(H=0;H<de;H++){if(T="",typeof arguments[H]=="object"){T+=`
21
21
  [`+H+"] ";for(K in arguments[0])s(arguments[0],K)&&(T+=K+": "+arguments[0][K]+", ");T=T.slice(0,-2)}else T=arguments[H];C.push(T)}I(f+`
22
22
  Arguments: `+Array.prototype.slice.call(C).join("")+`
23
- `+new Error().stack),w=!1}return g.apply(this,arguments)},g)}var A={};function F(f,g){e.deprecationHandler!=null&&e.deprecationHandler(f,g),A[f]||(I(g),A[f]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function U(f){return typeof Function<"u"&&f instanceof Function||Object.prototype.toString.call(f)==="[object Function]"}function D(f){var g,w;for(w in f)s(f,w)&&(g=f[w],U(g)?this[w]=g:this["_"+w]=g);this._config=f,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function J(f,g){var w=m({},f),C;for(C in g)s(g,C)&&(i(f[C])&&i(g[C])?(w[C]={},m(w[C],f[C]),m(w[C],g[C])):g[C]!=null?w[C]=g[C]:delete w[C]);for(C in f)s(f,C)&&!s(g,C)&&i(f[C])&&(w[C]=m({},w[C]));return w}function Q(f){f!=null&&this.set(f)}var se;Object.keys?se=Object.keys:se=function(f){var g,w=[];for(g in f)s(f,g)&&w.push(g);return w};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function He(f,g,w){var C=this._calendar[f]||this._calendar.sameElse;return U(C)?C.call(g,w):C}function _e(f,g,w){var C=""+Math.abs(f),T=g-C.length,H=f>=0;return(H?w?"+":"":"-")+Math.pow(10,Math.max(0,T)).toString().substr(1)+C}var ye=/(\[[^\[]*\])|(\\)?([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,Pe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ht={},Nt={};function he(f,g,w,C){var T=C;typeof C=="string"&&(T=function(){return this[C]()}),f&&(Nt[f]=T),g&&(Nt[g[0]]=function(){return _e(T.apply(this,arguments),g[1],g[2])}),w&&(Nt[w]=function(){return this.localeData().ordinal(T.apply(this,arguments),f)})}function Yt(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function Ar(f){var g=f.match(ye),w,C;for(w=0,C=g.length;w<C;w++)Nt[g[w]]?g[w]=Nt[g[w]]:g[w]=Yt(g[w]);return function(T){var H="",K;for(K=0;K<C;K++)H+=U(g[K])?g[K].call(T,f):g[K];return H}}function at(f,g){return f.isValid()?(g=Tr(g,f.localeData()),ht[g]=ht[g]||Ar(g),ht[g](f)):f.localeData().invalidDate()}function Tr(f,g){var w=5;function C(T){return g.longDateFormat(T)||T}for(Pe.lastIndex=0;w>=0&&Pe.test(f);)f=f.replace(Pe,C),Pe.lastIndex=0,w-=1;return f}var wr={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 Rt(f){var g=this._longDateFormat[f],w=this._longDateFormat[f.toUpperCase()];return g||!w?g:(this._longDateFormat[f]=w.match(ye).map(function(C){return C==="MMMM"||C==="MM"||C==="DD"||C==="dddd"?C.slice(1):C}).join(""),this._longDateFormat[f])}var bt="Invalid date";function Jr(){return this._invalidDate}var Ms="%d",At=/\d{1,2}/;function Pi(f){return this._ordinal.replace("%d",f)}var qn={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 te(f,g,w,C){var T=this._relativeTime[w];return U(T)?T(f,g,w,C):T.replace(/%d/i,f)}function re(f,g){var w=this._relativeTime[f>0?"future":"past"];return U(w)?w(g):w.replace(/%s/i,g)}var Ae={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 ge(f){return typeof f=="string"?Ae[f]||Ae[f.toLowerCase()]:void 0}function Se(f){var g={},w,C;for(C in f)s(f,C)&&(w=ge(C),w&&(g[w]=f[C]));return g}var Qe={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 xt(f){var g=[],w;for(w in f)s(f,w)&&g.push({unit:w,priority:Qe[w]});return g.sort(function(C,T){return C.priority-T.priority}),g}var sr=/\d/,oe=/\d\d/,fr=/\d{3}/,Lt=/\d{4}/,mt=/[+-]?\d{6}/,Ee=/\d\d?/,In=/\d\d\d\d?/,cl=/\d\d\d\d\d\d?/,Fs=/\d{1,3}/,Uo=/\d{1,4}/,Ds=/[+-]?\d{1,6}/,ki=/\d+/,js=/[+-]?\d+/,mc=/Z|[+-]\d\d:?\d\d/gi,fl=/Z|[+-]\d\d(?::?\d\d)?/gi,Uy=/[+-]?\d+(\.\d{1,3})?/,Ho=/[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,ts=/^[1-9]\d?/,dl=/^([1-9]\d|\d)/,pl;pl={};function me(f,g,w){pl[f]=U(g)?g:function(C,T){return C&&w?w:g}}function Hy(f,g){return s(pl,f)?pl[f](g._strict,g._locale):new RegExp(By(f))}function By(f){return On(f.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(g,w,C,T,H){return w||C||T||H}))}function On(f){return f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Gr(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Be(f){var g=+f,w=0;return g!==0&&isFinite(g)&&(w=Gr(g)),w}var gc={};function ct(f,g){var w,C=g,T;for(typeof f=="string"&&(f=[f]),c(g)&&(C=function(H,K){K[g]=Be(H)}),T=f.length,w=0;w<T;w++)gc[f[w]]=C}function Bo(f,g){ct(f,function(w,C,T,H){T._w=T._w||{},g(w,T._w,T,H)})}function yc(f,g,w){g!=null&&s(gc,f)&&gc[f](g,w._a,w,f)}function hl(f){return f%4===0&&f%100!==0||f%400===0}var dr=0,Kn=1,Pn=2,Kt=3,Yr=4,Qn=5,rs=6,mp=7,Vy=8;he("Y",0,0,function(){var f=this.year();return f<=9999?_e(f,4):"+"+f}),he(0,["YY",2],0,function(){return this.year()%100}),he(0,["YYYY",4],0,"year"),he(0,["YYYYY",5],0,"year"),he(0,["YYYYYY",6,!0],0,"year"),me("Y",js),me("YY",Ee,oe),me("YYYY",Uo,Lt),me("YYYYY",Ds,mt),me("YYYYYY",Ds,mt),ct(["YYYYY","YYYYYY"],dr),ct("YYYY",function(f,g){g[dr]=f.length===2?e.parseTwoDigitYear(f):Be(f)}),ct("YY",function(f,g){g[dr]=e.parseTwoDigitYear(f)}),ct("Y",function(f,g){g[dr]=parseInt(f,10)});function Vo(f){return hl(f)?366:365}e.parseTwoDigitYear=function(f){return Be(f)+(Be(f)>68?1900:2e3)};var gp=Ls("FullYear",!0);function Wy(){return hl(this.year())}function Ls(f,g){return function(w){return w!=null?(zo(this,f,w),e.updateOffset(this,g),this):Wo(this,f)}}function Wo(f,g){if(!f.isValid())return NaN;var w=f._d,C=f._isUTC;switch(g){case"Milliseconds":return C?w.getUTCMilliseconds():w.getMilliseconds();case"Seconds":return C?w.getUTCSeconds():w.getSeconds();case"Minutes":return C?w.getUTCMinutes():w.getMinutes();case"Hours":return C?w.getUTCHours():w.getHours();case"Date":return C?w.getUTCDate():w.getDate();case"Day":return C?w.getUTCDay():w.getDay();case"Month":return C?w.getUTCMonth():w.getMonth();case"FullYear":return C?w.getUTCFullYear():w.getFullYear();default:return NaN}}function zo(f,g,w){var C,T,H,K,de;if(!(!f.isValid()||isNaN(w))){switch(C=f._d,T=f._isUTC,g){case"Milliseconds":return void(T?C.setUTCMilliseconds(w):C.setMilliseconds(w));case"Seconds":return void(T?C.setUTCSeconds(w):C.setSeconds(w));case"Minutes":return void(T?C.setUTCMinutes(w):C.setMinutes(w));case"Hours":return void(T?C.setUTCHours(w):C.setHours(w));case"Date":return void(T?C.setUTCDate(w):C.setDate(w));case"FullYear":break;default:return}H=w,K=f.month(),de=f.date(),de=de===29&&K===1&&!hl(H)?28:de,T?C.setUTCFullYear(H,K,de):C.setFullYear(H,K,de)}}function zy(f){return f=ge(f),U(this[f])?this[f]():this}function ml(f,g){if(typeof f=="object"){f=Se(f);var w=xt(f),C,T=w.length;for(C=0;C<T;C++)this[w[C].unit](f[w[C].unit])}else if(f=ge(f),U(this[f]))return this[f](g);return this}function Jy(f,g){return(f%g+g)%g}var Ut;Array.prototype.indexOf?Ut=Array.prototype.indexOf:Ut=function(f){var g;for(g=0;g<this.length;++g)if(this[g]===f)return g;return-1};function vc(f,g){if(isNaN(f)||isNaN(g))return NaN;var w=Jy(g,12);return f+=(g-w)/12,w===1?hl(f)?29:28:31-w%7%2}he("M",["MM",2],"Mo",function(){return this.month()+1}),he("MMM",0,0,function(f){return this.localeData().monthsShort(this,f)}),he("MMMM",0,0,function(f){return this.localeData().months(this,f)}),me("M",Ee,ts),me("MM",Ee,oe),me("MMM",function(f,g){return g.monthsShortRegex(f)}),me("MMMM",function(f,g){return g.monthsRegex(f)}),ct(["M","MM"],function(f,g){g[Kn]=Be(f)-1}),ct(["MMM","MMMM"],function(f,g,w,C){var T=w._locale.monthsParse(f,C,w._strict);T!=null?g[Kn]=T:q(w).invalidMonth=f});var yp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),bc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Sc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Gy=Ho,Yy=Ho;function Ky(f,g){return f?n(this._months)?this._months[f.month()]:this._months[(this._months.isFormat||Sc).test(g)?"format":"standalone"][f.month()]:n(this._months)?this._months:this._months.standalone}function Qy(f,g){return f?n(this._monthsShort)?this._monthsShort[f.month()]:this._monthsShort[Sc.test(g)?"format":"standalone"][f.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function vp(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],C=0;C<12;++C)H=y([2e3,C]),this._shortMonthsParse[C]=this.monthsShort(H,"").toLocaleLowerCase(),this._longMonthsParse[C]=this.months(H,"").toLocaleLowerCase();return w?g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null):g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null)):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null))}function bp(f,g,w){var C,T,H;if(this._monthsParseExact)return vp.call(this,f,g,w);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),C=0;C<12;C++){if(T=y([2e3,C]),w&&!this._longMonthsParse[C]&&(this._longMonthsParse[C]=new RegExp("^"+this.months(T,"").replace(".","")+"$","i"),this._shortMonthsParse[C]=new RegExp("^"+this.monthsShort(T,"").replace(".","")+"$","i")),!w&&!this._monthsParse[C]&&(H="^"+this.months(T,"")+"|^"+this.monthsShort(T,""),this._monthsParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="MMMM"&&this._longMonthsParse[C].test(f))return C;if(w&&g==="MMM"&&this._shortMonthsParse[C].test(f))return C;if(!w&&this._monthsParse[C].test(f))return C}}function wc(f,g){if(!f.isValid())return f;if(typeof g=="string"){if(/^\d+$/.test(g))g=Be(g);else if(g=f.localeData().monthsParse(g),!c(g))return f}var w=g,C=f.date();return C=C<29?C:Math.min(C,vc(f.year(),w)),f._isUTC?f._d.setUTCMonth(w,C):f._d.setMonth(w,C),f}function gl(f){return f!=null?(wc(this,f),e.updateOffset(this,!0),this):Wo(this,"Month")}function Zy(){return vc(this.year(),this.month())}function Sp(f){return this._monthsParseExact?(s(this,"_monthsRegex")||_c.call(this),f?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Gy),this._monthsShortStrictRegex&&f?this._monthsShortStrictRegex:this._monthsShortRegex)}function yl(f){return this._monthsParseExact?(s(this,"_monthsRegex")||_c.call(this),f?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Yy),this._monthsStrictRegex&&f?this._monthsStrictRegex:this._monthsRegex)}function _c(){function f(qe,We){return We.length-qe.length}var g=[],w=[],C=[],T,H,K,de;for(T=0;T<12;T++)H=y([2e3,T]),K=On(this.monthsShort(H,"")),de=On(this.months(H,"")),g.push(K),w.push(de),C.push(de),C.push(K);g.sort(f),w.sort(f),C.sort(f),this._monthsRegex=new RegExp("^("+C.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+g.join("|")+")","i")}function Xy(f,g,w,C,T,H,K){var de;return f<100&&f>=0?(de=new Date(f+400,g,w,C,T,H,K),isFinite(de.getFullYear())&&de.setFullYear(f)):de=new Date(f,g,w,C,T,H,K),de}function Us(f){var g,w;return f<100&&f>=0?(w=Array.prototype.slice.call(arguments),w[0]=f+400,g=new Date(Date.UTC.apply(null,w)),isFinite(g.getUTCFullYear())&&g.setUTCFullYear(f)):g=new Date(Date.UTC.apply(null,arguments)),g}function Jo(f,g,w){var C=7+g-w,T=(7+Us(f,0,C).getUTCDay()-g)%7;return-T+C-1}function vl(f,g,w,C,T){var H=(7+w-C)%7,K=Jo(f,C,T),de=1+7*(g-1)+H+K,qe,We;return de<=0?(qe=f-1,We=Vo(qe)+de):de>Vo(f)?(qe=f+1,We=de-Vo(f)):(qe=f,We=de),{year:qe,dayOfYear:We}}function Go(f,g,w){var C=Jo(f.year(),g,w),T=Math.floor((f.dayOfYear()-C-1)/7)+1,H,K;return T<1?(K=f.year()-1,H=T+kn(K,g,w)):T>kn(f.year(),g,w)?(H=T-kn(f.year(),g,w),K=f.year()+1):(K=f.year(),H=T),{week:H,year:K}}function kn(f,g,w){var C=Jo(f,g,w),T=Jo(f+1,g,w);return(Vo(f)-C+T)/7}he("w",["ww",2],"wo","week"),he("W",["WW",2],"Wo","isoWeek"),me("w",Ee,ts),me("ww",Ee,oe),me("W",Ee,ts),me("WW",Ee,oe),Bo(["w","ww","W","WW"],function(f,g,w,C){g[C.substr(0,1)]=Be(f)});function Rc(f){return Go(f,this._week.dow,this._week.doy).week}var xc={dow:0,doy:6};function Hs(){return this._week.dow}function wp(){return this._week.doy}function _p(f){var g=this.localeData().week(this);return f==null?g:this.add((f-g)*7,"d")}function ev(f){var g=Go(this,1,4).week;return f==null?g:this.add((f-g)*7,"d")}he("d",0,"do","day"),he("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),he("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),he("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),he("e",0,0,"weekday"),he("E",0,0,"isoWeekday"),me("d",Ee),me("e",Ee),me("E",Ee),me("dd",function(f,g){return g.weekdaysMinRegex(f)}),me("ddd",function(f,g){return g.weekdaysShortRegex(f)}),me("dddd",function(f,g){return g.weekdaysRegex(f)}),Bo(["dd","ddd","dddd"],function(f,g,w,C){var T=w._locale.weekdaysParse(f,C,w._strict);T!=null?g.d=T:q(w).invalidWeekday=f}),Bo(["d","e","E"],function(f,g,w,C){g[C]=Be(f)});function Rp(f,g){return typeof f!="string"?f:isNaN(f)?(f=g.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function xp(f,g){return typeof f=="string"?g.weekdaysParse(f)%7||7:isNaN(f)?null:f}function bl(f,g){return f.slice(g,7).concat(f.slice(0,g))}var Cp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ep="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tv="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),rv=Ho,qp=Ho,nv=Ho;function iv(f,g){var w=n(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(g)?"format":"standalone"];return f===!0?bl(w,this._week.dow):f?w[f.day()]:w}function sv(f){return f===!0?bl(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function ov(f){return f===!0?bl(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function Cc(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],C=0;C<7;++C)H=y([2e3,1]).day(C),this._minWeekdaysParse[C]=this.weekdaysMin(H,"").toLocaleLowerCase(),this._shortWeekdaysParse[C]=this.weekdaysShort(H,"").toLocaleLowerCase(),this._weekdaysParse[C]=this.weekdays(H,"").toLocaleLowerCase();return w?g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1?T:null):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null):(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null):g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1||(T=Ut.call(this._shortWeekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):(T=Ut.call(this._minWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null))}function av(f,g,w){var C,T,H;if(this._weekdaysParseExact)return Cc.call(this,f,g,w);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),C=0;C<7;C++){if(T=y([2e3,1]).day(C),w&&!this._fullWeekdaysParse[C]&&(this._fullWeekdaysParse[C]=new RegExp("^"+this.weekdays(T,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[C]=new RegExp("^"+this.weekdaysShort(T,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[C]=new RegExp("^"+this.weekdaysMin(T,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[C]||(H="^"+this.weekdays(T,"")+"|^"+this.weekdaysShort(T,"")+"|^"+this.weekdaysMin(T,""),this._weekdaysParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="dddd"&&this._fullWeekdaysParse[C].test(f))return C;if(w&&g==="ddd"&&this._shortWeekdaysParse[C].test(f))return C;if(w&&g==="dd"&&this._minWeekdaysParse[C].test(f))return C;if(!w&&this._weekdaysParse[C].test(f))return C}}function lv(f){if(!this.isValid())return f!=null?this:NaN;var g=Wo(this,"Day");return f!=null?(f=Rp(f,this.localeData()),this.add(f-g,"d")):g}function uv(f){if(!this.isValid())return f!=null?this:NaN;var g=(this.day()+7-this.localeData()._week.dow)%7;return f==null?g:this.add(f-g,"d")}function cv(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var g=xp(f,this.localeData());return this.day(this.day()%7?g:g-7)}else return this.day()||7}function fv(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ec.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=rv),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ot(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ec.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qp),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Et(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ec.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nv),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ec(){function f(tr,ni){return ni.length-tr.length}var g=[],w=[],C=[],T=[],H,K,de,qe,We;for(H=0;H<7;H++)K=y([2e3,1]).day(H),de=On(this.weekdaysMin(K,"")),qe=On(this.weekdaysShort(K,"")),We=On(this.weekdays(K,"")),g.push(de),w.push(qe),C.push(We),T.push(de),T.push(qe),T.push(We);g.sort(f),w.sort(f),C.sort(f),T.sort(f),this._weekdaysRegex=new RegExp("^("+T.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+C.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function qc(){return this.hours()%12||12}function dv(){return this.hours()||24}he("H",["HH",2],0,"hour"),he("h",["hh",2],0,qc),he("k",["kk",2],0,dv),he("hmm",0,0,function(){return""+qc.apply(this)+_e(this.minutes(),2)}),he("hmmss",0,0,function(){return""+qc.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),he("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),he("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function Ip(f,g){he(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),g)})}Ip("a",!0),Ip("A",!1);function Op(f,g){return g._meridiemParse}me("a",Op),me("A",Op),me("H",Ee,dl),me("h",Ee,ts),me("k",Ee,ts),me("HH",Ee,oe),me("hh",Ee,oe),me("kk",Ee,oe),me("hmm",In),me("hmmss",cl),me("Hmm",In),me("Hmmss",cl),ct(["H","HH"],Kt),ct(["k","kk"],function(f,g,w){var C=Be(f);g[Kt]=C===24?0:C}),ct(["a","A"],function(f,g,w){w._isPm=w._locale.isPM(f),w._meridiem=f}),ct(["h","hh"],function(f,g,w){g[Kt]=Be(f),q(w).bigHour=!0}),ct("hmm",function(f,g,w){var C=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C)),q(w).bigHour=!0}),ct("hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C,2)),g[Qn]=Be(f.substr(T)),q(w).bigHour=!0}),ct("Hmm",function(f,g,w){var C=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C))}),ct("Hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C,2)),g[Qn]=Be(f.substr(T))});function pv(f){return(f+"").toLowerCase().charAt(0)==="p"}var Pp=/[ap]\.?m?\.?/i,hv=Ls("Hours",!0);function er(f,g,w){return f>11?w?"pm":"PM":w?"am":"AM"}var Sl={calendar:fe,longDateFormat:wr,invalidDate:bt,ordinal:Ms,dayOfMonthOrdinalParse:At,relativeTime:qn,months:yp,monthsShort:bc,week:xc,weekdays:Cp,weekdaysMin:tv,weekdaysShort:Ep,meridiemParse:Pp},ft={},Bs={},ns;function Kr(f,g){var w,C=Math.min(f.length,g.length);for(w=0;w<C;w+=1)if(f[w]!==g[w])return w;return C}function Ic(f){return f&&f.toLowerCase().replace("_","-")}function kp(f){for(var g=0,w,C,T,H;g<f.length;){for(H=Ic(f[g]).split("-"),w=H.length,C=Ic(f[g+1]),C=C?C.split("-"):null;w>0;){if(T=Yo(H.slice(0,w).join("-")),T)return T;if(C&&C.length>=w&&Kr(H,C)>=w-1)break;w--}g++}return ns}function Ap(f){return!!(f&&f.match("^[^/\\\\]*$"))}function Yo(f){var g=null,w;if(ft[f]===void 0&&typeof ru<"u"&&ru&&ru.exports&&Ap(f))try{g=ns._abbr,w=wt,w("./locale/"+f),Zn(g)}catch{ft[f]=null}return ft[f]}function Zn(f,g){var w;return f&&(l(g)?w=Xn(f):w=wl(f,g),w?ns=w:typeof console<"u"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),ns._abbr}function wl(f,g){if(g!==null){var w,C=Sl;if(g.abbr=f,ft[f]!=null)F("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."),C=ft[f]._config;else if(g.parentLocale!=null)if(ft[g.parentLocale]!=null)C=ft[g.parentLocale]._config;else if(w=Yo(g.parentLocale),w!=null)C=w._config;else return Bs[g.parentLocale]||(Bs[g.parentLocale]=[]),Bs[g.parentLocale].push({name:f,config:g}),null;return ft[f]=new Q(J(C,g)),Bs[f]&&Bs[f].forEach(function(T){wl(T.name,T.config)}),Zn(f),ft[f]}else return delete ft[f],null}function $r(f,g){if(g!=null){var w,C,T=Sl;ft[f]!=null&&ft[f].parentLocale!=null?ft[f].set(J(ft[f]._config,g)):(C=Yo(f),C!=null&&(T=C._config),g=J(T,g),C==null&&(g.abbr=f),w=new Q(g),w.parentLocale=ft[f],ft[f]=w),Zn(f)}else ft[f]!=null&&(ft[f].parentLocale!=null?(ft[f]=ft[f].parentLocale,f===Zn()&&Zn(f)):ft[f]!=null&&delete ft[f]);return ft[f]}function Xn(f){var g;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return ns;if(!n(f)){if(g=Yo(f),g)return g;f=[f]}return kp(f)}function Nr(){return se(ft)}function Oc(f){var g,w=f._a;return w&&q(f).overflow===-2&&(g=w[Kn]<0||w[Kn]>11?Kn:w[Pn]<1||w[Pn]>vc(w[dr],w[Kn])?Pn:w[Kt]<0||w[Kt]>24||w[Kt]===24&&(w[Yr]!==0||w[Qn]!==0||w[rs]!==0)?Kt:w[Yr]<0||w[Yr]>59?Yr:w[Qn]<0||w[Qn]>59?Qn:w[rs]<0||w[rs]>999?rs:-1,q(f)._overflowDayOfYear&&(g<dr||g>Pn)&&(g=Pn),q(f)._overflowWeeks&&g===-1&&(g=mp),q(f)._overflowWeekday&&g===-1&&(g=Vy),q(f).overflow=g),f}var Tp=/^\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)?)?$/,Ai=/^\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)?)?$/,_l=/Z|[+-]\d\d(?::?\d\d)?/,Vs=[["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]],qt=[["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/]],Ti=/^\/?Date\((-?\d+)/i,Pc=/^(?:(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}))$/,mv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Rl(f){var g,w,C=f._i,T=Tp.exec(C)||Ai.exec(C),H,K,de,qe,We=Vs.length,tr=qt.length;if(T){for(q(f).iso=!0,g=0,w=We;g<w;g++)if(Vs[g][1].exec(T[1])){K=Vs[g][0],H=Vs[g][2]!==!1;break}if(K==null){f._isValid=!1;return}if(T[3]){for(g=0,w=tr;g<w;g++)if(qt[g][1].exec(T[3])){de=(T[2]||" ")+qt[g][0];break}if(de==null){f._isValid=!1;return}}if(!H&&de!=null){f._isValid=!1;return}if(T[4])if(_l.exec(T[4]))qe="Z";else{f._isValid=!1;return}f._f=K+(de||"")+(qe||""),Cl(f)}else f._isValid=!1}function gv(f,g,w,C,T,H){var K=[yv(f),bc.indexOf(g),parseInt(w,10),parseInt(C,10),parseInt(T,10)];return H&&K.push(parseInt(H,10)),K}function yv(f){var g=parseInt(f,10);return g<=49?2e3+g:g<=999?1900+g:g}function vv(f){return f.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function $p(f,g,w){if(f){var C=Ep.indexOf(f),T=new Date(g[0],g[1],g[2]).getDay();if(C!==T)return q(w).weekdayMismatch=!0,w._isValid=!1,!1}return!0}function xl(f,g,w){if(f)return mv[f];if(g)return 0;var C=parseInt(w,10),T=C%100,H=(C-T)/100;return H*60+T}function is(f){var g=Pc.exec(vv(f._i)),w;if(g){if(w=gv(g[4],g[3],g[2],g[5],g[6],g[7]),!$p(g[1],w,f))return;f._a=w,f._tzm=xl(g[8],g[9],g[10]),f._d=Us.apply(null,f._a),f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),q(f).rfc2822=!0}else f._isValid=!1}function bv(f){var g=Ti.exec(f._i);if(g!==null){f._d=new Date(+g[1]);return}if(Rl(f),f._isValid===!1)delete f._isValid;else return;if(is(f),f._isValid===!1)delete f._isValid;else return;f._strict?f._isValid=!1:e.createFromInputFallback(f)}e.createFromInputFallback=R("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(f){f._d=new Date(f._i+(f._useUTC?" UTC":""))});function ss(f,g,w){return f??g??w}function Np(f){var g=new Date(e.now());return f._useUTC?[g.getUTCFullYear(),g.getUTCMonth(),g.getUTCDate()]:[g.getFullYear(),g.getMonth(),g.getDate()]}function Ko(f){var g,w,C=[],T,H,K;if(!f._d){for(T=Np(f),f._w&&f._a[Pn]==null&&f._a[Kn]==null&&kc(f),f._dayOfYear!=null&&(K=ss(f._a[dr],T[dr]),(f._dayOfYear>Vo(K)||f._dayOfYear===0)&&(q(f)._overflowDayOfYear=!0),w=Us(K,0,f._dayOfYear),f._a[Kn]=w.getUTCMonth(),f._a[Pn]=w.getUTCDate()),g=0;g<3&&f._a[g]==null;++g)f._a[g]=C[g]=T[g];for(;g<7;g++)f._a[g]=C[g]=f._a[g]==null?g===2?1:0:f._a[g];f._a[Kt]===24&&f._a[Yr]===0&&f._a[Qn]===0&&f._a[rs]===0&&(f._nextDay=!0,f._a[Kt]=0),f._d=(f._useUTC?Us:Xy).apply(null,C),H=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Kt]=24),f._w&&typeof f._w.d<"u"&&f._w.d!==H&&(q(f).weekdayMismatch=!0)}}function kc(f){var g,w,C,T,H,K,de,qe,We;g=f._w,g.GG!=null||g.W!=null||g.E!=null?(H=1,K=4,w=ss(g.GG,f._a[dr],Go(gt(),1,4).year),C=ss(g.W,1),T=ss(g.E,1),(T<1||T>7)&&(qe=!0)):(H=f._locale._week.dow,K=f._locale._week.doy,We=Go(gt(),H,K),w=ss(g.gg,f._a[dr],We.year),C=ss(g.w,We.week),g.d!=null?(T=g.d,(T<0||T>6)&&(qe=!0)):g.e!=null?(T=g.e+H,(g.e<0||g.e>6)&&(qe=!0)):T=H),C<1||C>kn(w,H,K)?q(f)._overflowWeeks=!0:qe!=null?q(f)._overflowWeekday=!0:(de=vl(w,C,T,H,K),f._a[dr]=de.year,f._dayOfYear=de.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Cl(f){if(f._f===e.ISO_8601){Rl(f);return}if(f._f===e.RFC_2822){is(f);return}f._a=[],q(f).empty=!0;var g=""+f._i,w,C,T,H,K,de=g.length,qe=0,We,tr;for(T=Tr(f._f,f._locale).match(ye)||[],tr=T.length,w=0;w<tr;w++)H=T[w],C=(g.match(Hy(H,f))||[])[0],C&&(K=g.substr(0,g.indexOf(C)),K.length>0&&q(f).unusedInput.push(K),g=g.slice(g.indexOf(C)+C.length),qe+=C.length),Nt[H]?(C?q(f).empty=!1:q(f).unusedTokens.push(H),yc(H,C,f)):f._strict&&!C&&q(f).unusedTokens.push(H);q(f).charsLeftOver=de-qe,g.length>0&&q(f).unusedInput.push(g),f._a[Kt]<=12&&q(f).bigHour===!0&&f._a[Kt]>0&&(q(f).bigHour=void 0),q(f).parsedDateParts=f._a.slice(0),q(f).meridiem=f._meridiem,f._a[Kt]=Sv(f._locale,f._a[Kt],f._meridiem),We=q(f).era,We!==null&&(f._a[dr]=f._locale.erasConvertYear(We,f._a[dr])),Ko(f),Oc(f)}function Sv(f,g,w){var C;return w==null?g:f.meridiemHour!=null?f.meridiemHour(g,w):(f.isPM!=null&&(C=f.isPM(w),C&&g<12&&(g+=12),!C&&g===12&&(g=0)),g)}function Ac(f){var g,w,C,T,H,K,de=!1,qe=f._f.length;if(qe===0){q(f).invalidFormat=!0,f._d=new Date(NaN);return}for(T=0;T<qe;T++)H=0,K=!1,g=P({},f),f._useUTC!=null&&(g._useUTC=f._useUTC),g._f=f._f[T],Cl(g),v(g)&&(K=!0),H+=q(g).charsLeftOver,H+=q(g).unusedTokens.length*10,q(g).score=H,de?H<C&&(C=H,w=g):(C==null||H<C||K)&&(C=H,w=g,K&&(de=!0));m(f,w||g)}function Tc(f){if(!f._d){var g=Se(f._i),w=g.day===void 0?g.date:g.day;f._a=p([g.year,g.month,w,g.hour,g.minute,g.second,g.millisecond],function(C){return C&&parseInt(C,10)}),Ko(f)}}function wv(f){var g=new M(Oc($c(f)));return g._nextDay&&(g.add(1,"d"),g._nextDay=void 0),g}function $c(f){var g=f._i,w=f._f;return f._locale=f._locale||Xn(f._l),g===null||w===void 0&&g===""?_({nullInput:!0}):(typeof g=="string"&&(f._i=g=f._locale.preparse(g)),j(g)?new M(Oc(g)):(d(g)?f._d=g:n(w)?Ac(f):w?Cl(f):Mr(f),v(f)||(f._d=null),f))}function Mr(f){var g=f._i;l(g)?f._d=new Date(e.now()):d(g)?f._d=new Date(g.valueOf()):typeof g=="string"?bv(f):n(g)?(f._a=p(g.slice(0),function(w){return parseInt(w,10)}),Ko(f)):i(g)?Tc(f):c(g)?f._d=new Date(g):e.createFromInputFallback(f)}function El(f,g,w,C,T){var H={};return(g===!0||g===!1)&&(C=g,g=void 0),(w===!0||w===!1)&&(C=w,w=void 0),(i(f)&&o(f)||n(f)&&f.length===0)&&(f=void 0),H._isAMomentObject=!0,H._useUTC=H._isUTC=T,H._l=w,H._i=f,H._f=g,H._strict=C,wv(H)}function gt(f,g,w,C){return El(f,g,w,C,!1)}var Mp=R("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=gt.apply(null,arguments);return this.isValid()&&f.isValid()?f<this?this:f:_()}),Fp=R("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=gt.apply(null,arguments);return this.isValid()&&f.isValid()?f>this?this:f:_()});function Dp(f,g){var w,C;if(g.length===1&&n(g[0])&&(g=g[0]),!g.length)return gt();for(w=g[0],C=1;C<g.length;++C)(!g[C].isValid()||g[C][f](w))&&(w=g[C]);return w}function _v(){var f=[].slice.call(arguments,0);return Dp("isBefore",f)}function Rv(){var f=[].slice.call(arguments,0);return Dp("isAfter",f)}var xv=function(){return Date.now?Date.now():+new Date},Qo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ws(f){var g,w=!1,C,T=Qo.length;for(g in f)if(s(f,g)&&!(Ut.call(Qo,g)!==-1&&(f[g]==null||!isNaN(f[g]))))return!1;for(C=0;C<T;++C)if(f[Qo[C]]){if(w)return!1;parseFloat(f[Qo[C]])!==Be(f[Qo[C]])&&(w=!0)}return!0}function Cv(){return this._isValid}function Ev(){return yt(NaN)}function zs(f){var g=Se(f),w=g.year||0,C=g.quarter||0,T=g.month||0,H=g.week||g.isoWeek||0,K=g.day||0,de=g.hour||0,qe=g.minute||0,We=g.second||0,tr=g.millisecond||0;this._isValid=Ws(g),this._milliseconds=+tr+We*1e3+qe*6e4+de*1e3*60*60,this._days=+K+H*7,this._months=+T+C*3+w*12,this._data={},this._locale=Xn(),this._bubble()}function Zo(f){return f instanceof zs}function An(f){return f<0?Math.round(-1*f)*-1:Math.round(f)}function ql(f,g,w){var C=Math.min(f.length,g.length),T=Math.abs(f.length-g.length),H=0,K;for(K=0;K<C;K++)(w&&f[K]!==g[K]||!w&&Be(f[K])!==Be(g[K]))&&H++;return H+T}function jp(f,g){he(f,0,0,function(){var w=this.utcOffset(),C="+";return w<0&&(w=-w,C="-"),C+_e(~~(w/60),2)+g+_e(~~w%60,2)})}jp("Z",":"),jp("ZZ",""),me("Z",fl),me("ZZ",fl),ct(["Z","ZZ"],function(f,g,w){w._useUTC=!0,w._tzm=Nc(fl,f)});var qv=/([\+\-]|\d\d)/gi;function Nc(f,g){var w=(g||"").match(f),C,T,H;return w===null?null:(C=w[w.length-1]||[],T=(C+"").match(qv)||["-",0,0],H=+(T[1]*60)+Be(T[2]),H===0?0:T[0]==="+"?H:-H)}function $i(f,g){var w,C;return g._isUTC?(w=g.clone(),C=(j(f)||d(f)?f.valueOf():gt(f).valueOf())-w.valueOf(),w._d.setTime(w._d.valueOf()+C),e.updateOffset(w,!1),w):gt(f).local()}function Fr(f){return-Math.round(f._d.getTimezoneOffset())}e.updateOffset=function(){};function Lp(f,g,w){var C=this._offset||0,T;if(!this.isValid())return f!=null?this:NaN;if(f!=null){if(typeof f=="string"){if(f=Nc(fl,f),f===null)return this}else Math.abs(f)<16&&!w&&(f=f*60);return!this._isUTC&&g&&(T=Fr(this)),this._offset=f,this._isUTC=!0,T!=null&&this.add(T,"m"),C!==f&&(!g||this._changeInProgress?Xo(this,yt(f-C,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?C:Fr(this)}function Iv(f,g){return f!=null?(typeof f!="string"&&(f=-f),this.utcOffset(f,g),this):-this.utcOffset()}function Ov(f){return this.utcOffset(0,f)}function Pv(f){return this._isUTC&&(this.utcOffset(0,f),this._isUTC=!1,f&&this.subtract(Fr(this),"m")),this}function kv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var f=Nc(mc,this._i);f!=null?this.utcOffset(f):this.utcOffset(0,!0)}return this}function Av(f){return this.isValid()?(f=f?gt(f).utcOffset():0,(this.utcOffset()-f)%60===0):!1}function Ni(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function W(){if(!l(this._isDSTShifted))return this._isDSTShifted;var f={},g;return P(f,this),f=$c(f),f._a?(g=f._isUTC?y(f._a):gt(f._a),this._isDSTShifted=this.isValid()&&ql(f._a,g.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Z(){return this.isValid()?!this._isUTC:!1}function Y(){return this.isValid()?this._isUTC:!1}function pe(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ie=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,lt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function yt(f,g){var w=f,C=null,T,H,K;return Zo(f)?w={ms:f._milliseconds,d:f._days,M:f._months}:c(f)||!isNaN(+f)?(w={},g?w[g]=+f:w.milliseconds=+f):(C=Ie.exec(f))?(T=C[1]==="-"?-1:1,w={y:0,d:Be(C[Pn])*T,h:Be(C[Kt])*T,m:Be(C[Yr])*T,s:Be(C[Qn])*T,ms:Be(An(C[rs]*1e3))*T}):(C=lt.exec(f))?(T=C[1]==="-"?-1:1,w={y:Ze(C[2],T),M:Ze(C[3],T),w:Ze(C[4],T),d:Ze(C[5],T),h:Ze(C[6],T),m:Ze(C[7],T),s:Ze(C[8],T)}):w==null?w={}:typeof w=="object"&&("from"in w||"to"in w)&&(K=Tv(gt(w.from),gt(w.to)),w={},w.ms=K.milliseconds,w.M=K.months),H=new zs(w),Zo(f)&&s(f,"_locale")&&(H._locale=f._locale),Zo(f)&&s(f,"_isValid")&&(H._isValid=f._isValid),H}yt.fn=zs.prototype,yt.invalid=Ev;function Ze(f,g){var w=f&&parseFloat(f.replace(",","."));return(isNaN(w)?0:w)*g}function Il(f,g){var w={};return w.months=g.month()-f.month()+(g.year()-f.year())*12,f.clone().add(w.months,"M").isAfter(g)&&--w.months,w.milliseconds=+g-+f.clone().add(w.months,"M"),w}function Tv(f,g){var w;return f.isValid()&&g.isValid()?(g=$i(g,f),f.isBefore(g)?w=Il(f,g):(w=Il(g,f),w.milliseconds=-w.milliseconds,w.months=-w.months),w):{milliseconds:0,months:0}}function Dr(f,g){return function(w,C){var T,H;return C!==null&&!isNaN(+C)&&(F(g,"moment()."+g+"(period, number) is deprecated. Please use moment()."+g+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),H=w,w=C,C=H),T=yt(w,C),Xo(this,T,f),this}}function Xo(f,g,w,C){var T=g._milliseconds,H=An(g._days),K=An(g._months);f.isValid()&&(C=C??!0,K&&wc(f,Wo(f,"Month")+K*w),H&&zo(f,"Date",Wo(f,"Date")+H*w),T&&f._d.setTime(f._d.valueOf()+T*w),C&&e.updateOffset(f,H||K))}var $v=Dr(1,"add"),Js=Dr(-1,"subtract");function ea(f){return typeof f=="string"||f instanceof String}function Ol(f){return j(f)||d(f)||ea(f)||c(f)||Nv(f)||dt(f)||f===null||f===void 0}function dt(f){var g=i(f)&&!o(f),w=!1,C=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],T,H,K=C.length;for(T=0;T<K;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Nv(f){var g=n(f),w=!1;return g&&(w=f.filter(function(C){return!c(C)&&ea(f)}).length===0),g&&w}function Up(f){var g=i(f)&&!o(f),w=!1,C=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],T,H;for(T=0;T<C.length;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Pl(f,g){var w=f.diff(g,"days",!0);return w<-6?"sameElse":w<-1?"lastWeek":w<0?"lastDay":w<1?"sameDay":w<2?"nextDay":w<7?"nextWeek":"sameElse"}function Mv(f,g){arguments.length===1&&(arguments[0]?Ol(arguments[0])?(f=arguments[0],g=void 0):Up(arguments[0])&&(g=arguments[0],f=void 0):(f=void 0,g=void 0));var w=f||gt(),C=$i(w,this).startOf("day"),T=e.calendarFormat(this,C)||"sameElse",H=g&&(U(g[T])?g[T].call(this,w):g[T]);return this.format(H||this.localeData().calendar(T,this,gt(w)))}function Fv(){return new M(this)}function Dv(f,g){var w=j(f)?f:gt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()>w.valueOf():w.valueOf()<this.clone().startOf(g).valueOf()):!1}function kl(f,g){var w=j(f)?f:gt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()<w.valueOf():this.clone().endOf(g).valueOf()<w.valueOf()):!1}function Mi(f,g,w,C){var T=j(f)?f:gt(f),H=j(g)?g:gt(g);return this.isValid()&&T.isValid()&&H.isValid()?(C=C||"()",(C[0]==="("?this.isAfter(T,w):!this.isBefore(T,w))&&(C[1]===")"?this.isBefore(H,w):!this.isAfter(H,w))):!1}function Al(f,g){var w=j(f)?f:gt(f),C;return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()===w.valueOf():(C=w.valueOf(),this.clone().startOf(g).valueOf()<=C&&C<=this.clone().endOf(g).valueOf())):!1}function Hp(f,g){return this.isSame(f,g)||this.isAfter(f,g)}function Tl(f,g){return this.isSame(f,g)||this.isBefore(f,g)}function Bp(f,g,w){var C,T,H;if(!this.isValid())return NaN;if(C=$i(f,this),!C.isValid())return NaN;switch(T=(C.utcOffset()-this.utcOffset())*6e4,g=ge(g),g){case"year":H=ta(this,C)/12;break;case"month":H=ta(this,C);break;case"quarter":H=ta(this,C)/3;break;case"second":H=(this-C)/1e3;break;case"minute":H=(this-C)/6e4;break;case"hour":H=(this-C)/36e5;break;case"day":H=(this-C-T)/864e5;break;case"week":H=(this-C-T)/6048e5;break;default:H=this-C}return w?H:Gr(H)}function ta(f,g){if(f.date()<g.date())return-ta(g,f);var w=(g.year()-f.year())*12+(g.month()-f.month()),C=f.clone().add(w,"months"),T,H;return g-C<0?(T=f.clone().add(w-1,"months"),H=(g-C)/(C-T)):(T=f.clone().add(w+1,"months"),H=(g-C)/(T-C)),-(w+H)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function $l(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Vp(f){if(!this.isValid())return null;var g=f!==!0,w=g?this.clone().utc():this;return w.year()<0||w.year()>9999?at(w,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):U(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",at(w,"Z")):at(w,g?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ra(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",g="",w,C,T,H;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",g="Z"),w="["+f+'("]',C=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",T="-MM-DD[T]HH:mm:ss.SSS",H=g+'[")]',this.format(w+C+T+H)}function os(f){f||(f=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var g=at(this,f);return this.localeData().postformat(g)}function Nl(f,g){return this.isValid()&&(j(f)&&f.isValid()||gt(f).isValid())?yt({to:this,from:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function jv(f){return this.from(gt(),f)}function Lv(f,g){return this.isValid()&&(j(f)&&f.isValid()||gt(f).isValid())?yt({from:this,to:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function Uv(f){return this.to(gt(),f)}function na(f){var g;return f===void 0?this._locale._abbr:(g=Xn(f),g!=null&&(this._locale=g),this)}var ia=R("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function Ml(){return this._locale}var Fl=1e3,as=60*Fl,Dl=60*as,Wp=(365*400+97)*24*Dl;function Tt(f,g){return(f%g+g)%g}function or(f,g,w){return f<100&&f>=0?new Date(f+400,g,w)-Wp:new Date(f,g,w).valueOf()}function zp(f,g,w){return f<100&&f>=0?Date.UTC(f+400,g,w)-Wp:Date.UTC(f,g,w)}function Hv(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?zp:or,f){case"year":g=w(this.year(),0,1);break;case"quarter":g=w(this.year(),this.month()-this.month()%3,1);break;case"month":g=w(this.year(),this.month(),1);break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":g=w(this.year(),this.month(),this.date());break;case"hour":g=this._d.valueOf(),g-=Tt(g+(this._isUTC?0:this.utcOffset()*as),Dl);break;case"minute":g=this._d.valueOf(),g-=Tt(g,as);break;case"second":g=this._d.valueOf(),g-=Tt(g,Fl);break}return this._d.setTime(g),e.updateOffset(this,!0),this}function Jp(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?zp:or,f){case"year":g=w(this.year()+1,0,1)-1;break;case"quarter":g=w(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":g=w(this.year(),this.month()+1,1)-1;break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":g=w(this.year(),this.month(),this.date()+1)-1;break;case"hour":g=this._d.valueOf(),g+=Dl-Tt(g+(this._isUTC?0:this.utcOffset()*as),Dl)-1;break;case"minute":g=this._d.valueOf(),g+=as-Tt(g,as)-1;break;case"second":g=this._d.valueOf(),g+=Fl-Tt(g,Fl)-1;break}return this._d.setTime(g),e.updateOffset(this,!0),this}function Bv(){return this._d.valueOf()-(this._offset||0)*6e4}function Mc(){return Math.floor(this.valueOf()/1e3)}function sa(){return new Date(this.valueOf())}function Fc(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function Gs(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function oa(){return this.isValid()?this.toISOString():null}function aa(){return v(this)}function jl(){return m({},q(this))}function Ys(){return q(this).overflow}function Vv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}he("N",0,0,"eraAbbr"),he("NN",0,0,"eraAbbr"),he("NNN",0,0,"eraAbbr"),he("NNNN",0,0,"eraName"),he("NNNNN",0,0,"eraNarrow"),he("y",["y",1],"yo","eraYear"),he("y",["yy",2],0,"eraYear"),he("y",["yyy",3],0,"eraYear"),he("y",["yyyy",4],0,"eraYear"),me("N",_r),me("NN",_r),me("NNN",_r),me("NNNN",Ve),me("NNNNN",Yv),ct(["N","NN","NNN","NNNN","NNNNN"],function(f,g,w,C){var T=w._locale.erasParse(f,C,w._strict);T?q(w).era=T:q(w).invalidEra=f}),me("y",ki),me("yy",ki),me("yyy",ki),me("yyyy",ki),me("yo",Kv),ct(["y","yy","yyy","yyyy"],dr),ct(["yo"],function(f,g,w,C){var T;w._locale._eraYearOrdinalRegex&&(T=f.match(w._locale._eraYearOrdinalRegex)),w._locale.eraYearOrdinalParse?g[dr]=w._locale.eraYearOrdinalParse(f,T):g[dr]=parseInt(f,10)});function Wv(f,g){var w,C,T,H=this._eras||Xn("en")._eras;for(w=0,C=H.length;w<C;++w)switch(typeof H[w].since==="string"&&(T=e(H[w].since).startOf("day"),H[w].since=T.valueOf()),typeof H[w].until){case"undefined":H[w].until=1/0;break;case"string":T=e(H[w].until).startOf("day").valueOf(),H[w].until=T.valueOf();break}return H}function zv(f,g,w){var C,T,H=this.eras(),K,de,qe;for(f=f.toUpperCase(),C=0,T=H.length;C<T;++C)if(K=H[C].name.toUpperCase(),de=H[C].abbr.toUpperCase(),qe=H[C].narrow.toUpperCase(),w)switch(g){case"N":case"NN":case"NNN":if(de===f)return H[C];break;case"NNNN":if(K===f)return H[C];break;case"NNNNN":if(qe===f)return H[C];break}else if([K,de,qe].indexOf(f)>=0)return H[C]}function Jv(f,g){var w=f.since<=f.until?1:-1;return g===void 0?e(f.since).year():e(f.since).year()+(g-f.offset)*w}function Gv(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].name;return""}function Ll(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].narrow;return""}function la(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].abbr;return""}function Gp(){var f,g,w,C,T=this.localeData().eras();for(f=0,g=T.length;f<g;++f)if(w=T[f].since<=T[f].until?1:-1,C=this.clone().startOf("day").valueOf(),T[f].since<=C&&C<=T[f].until||T[f].until<=C&&C<=T[f].since)return(this.year()-e(T[f].since).year())*w+T[f].offset;return this.year()}function $(f){return s(this,"_erasNameRegex")||Dc.call(this),f?this._erasNameRegex:this._erasRegex}function Ks(f){return s(this,"_erasAbbrRegex")||Dc.call(this),f?this._erasAbbrRegex:this._erasRegex}function Ul(f){return s(this,"_erasNarrowRegex")||Dc.call(this),f?this._erasNarrowRegex:this._erasRegex}function _r(f,g){return g.erasAbbrRegex(f)}function Ve(f,g){return g.erasNameRegex(f)}function Yv(f,g){return g.erasNarrowRegex(f)}function Kv(f,g){return g._eraYearOrdinalRegex||ki}function Dc(){var f=[],g=[],w=[],C=[],T,H,K,de,qe,We=this.eras();for(T=0,H=We.length;T<H;++T)K=On(We[T].name),de=On(We[T].abbr),qe=On(We[T].narrow),g.push(K),f.push(de),w.push(qe),C.push(K),C.push(de),C.push(qe);this._erasRegex=new RegExp("^("+C.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+g.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+f.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+w.join("|")+")","i")}he(0,["gg",2],0,function(){return this.weekYear()%100}),he(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Tn(f,g){he(0,[f,f.length],0,g)}Tn("gggg","weekYear"),Tn("ggggg","weekYear"),Tn("GGGG","isoWeekYear"),Tn("GGGGG","isoWeekYear"),me("G",js),me("g",js),me("GG",Ee,oe),me("gg",Ee,oe),me("GGGG",Uo,Lt),me("gggg",Uo,Lt),me("GGGGG",Ds,mt),me("ggggg",Ds,mt),Bo(["gggg","ggggg","GGGG","GGGGG"],function(f,g,w,C){g[C.substr(0,2)]=Be(f)}),Bo(["gg","GG"],function(f,g,w,C){g[C]=e.parseTwoDigitYear(f)});function Qv(f){return Yp.call(this,f,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Zv(f){return Yp.call(this,f,this.isoWeek(),this.isoWeekday(),1,4)}function Xv(){return kn(this.year(),1,4)}function eb(){return kn(this.isoWeekYear(),1,4)}function tb(){var f=this.localeData()._week;return kn(this.year(),f.dow,f.doy)}function ei(){var f=this.localeData()._week;return kn(this.weekYear(),f.dow,f.doy)}function Yp(f,g,w,C,T){var H;return f==null?Go(this,C,T).year:(H=kn(f,C,T),g>H&&(g=H),rb.call(this,f,g,w,C,T))}function rb(f,g,w,C,T){var H=vl(f,g,w,C,T),K=Us(H.year,0,H.dayOfYear);return this.year(K.getUTCFullYear()),this.month(K.getUTCMonth()),this.date(K.getUTCDate()),this}he("Q",0,"Qo","quarter"),me("Q",sr),ct("Q",function(f,g){g[Kn]=(Be(f)-1)*3});function nb(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}he("D",["DD",2],"Do","date"),me("D",Ee,ts),me("DD",Ee,oe),me("Do",function(f,g){return f?g._dayOfMonthOrdinalParse||g._ordinalParse:g._dayOfMonthOrdinalParseLenient}),ct(["D","DD"],Pn),ct("Do",function(f,g){g[Pn]=Be(f.match(Ee)[0])});var Kp=Ls("Date",!0);he("DDD",["DDDD",3],"DDDo","dayOfYear"),me("DDD",Fs),me("DDDD",fr),ct(["DDD","DDDD"],function(f,g,w){w._dayOfYear=Be(f)});function ib(f){var g=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?g:this.add(f-g,"d")}he("m",["mm",2],0,"minute"),me("m",Ee,dl),me("mm",Ee,oe),ct(["m","mm"],Yr);var ti=Ls("Minutes",!1);he("s",["ss",2],0,"second"),me("s",Ee,dl),me("ss",Ee,oe),ct(["s","ss"],Qn);var sb=Ls("Seconds",!1);he("S",0,0,function(){return~~(this.millisecond()/100)}),he(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),he(0,["SSS",3],0,"millisecond"),he(0,["SSSS",4],0,function(){return this.millisecond()*10}),he(0,["SSSSS",5],0,function(){return this.millisecond()*100}),he(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),he(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),he(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),he(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),me("S",Fs,sr),me("SS",Fs,oe),me("SSS",Fs,fr);var Fi,Qp;for(Fi="SSSS";Fi.length<=9;Fi+="S")me(Fi,ki);function ob(f,g){g[rs]=Be(("0."+f)*1e3)}for(Fi="S";Fi.length<=9;Fi+="S")ct(Fi,ob);Qp=Ls("Milliseconds",!1),he("z",0,0,"zoneAbbr"),he("zz",0,0,"zoneName");function ab(){return this._isUTC?"UTC":""}function ls(){return this._isUTC?"Coordinated Universal Time":""}var ie=M.prototype;ie.add=$v,ie.calendar=Mv,ie.clone=Fv,ie.diff=Bp,ie.endOf=Jp,ie.format=os,ie.from=Nl,ie.fromNow=jv,ie.to=Lv,ie.toNow=Uv,ie.get=zy,ie.invalidAt=Ys,ie.isAfter=Dv,ie.isBefore=kl,ie.isBetween=Mi,ie.isSame=Al,ie.isSameOrAfter=Hp,ie.isSameOrBefore=Tl,ie.isValid=aa,ie.lang=ia,ie.locale=na,ie.localeData=Ml,ie.max=Fp,ie.min=Mp,ie.parsingFlags=jl,ie.set=ml,ie.startOf=Hv,ie.subtract=Js,ie.toArray=Fc,ie.toObject=Gs,ie.toDate=sa,ie.toISOString=Vp,ie.inspect=ra,typeof Symbol<"u"&&Symbol.for!=null&&(ie[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ie.toJSON=oa,ie.toString=$l,ie.unix=Mc,ie.valueOf=Bv,ie.creationData=Vv,ie.eraName=Gv,ie.eraNarrow=Ll,ie.eraAbbr=la,ie.eraYear=Gp,ie.year=gp,ie.isLeapYear=Wy,ie.weekYear=Qv,ie.isoWeekYear=Zv,ie.quarter=ie.quarters=nb,ie.month=gl,ie.daysInMonth=Zy,ie.week=ie.weeks=_p,ie.isoWeek=ie.isoWeeks=ev,ie.weeksInYear=tb,ie.weeksInWeekYear=ei,ie.isoWeeksInYear=Xv,ie.isoWeeksInISOWeekYear=eb,ie.date=Kp,ie.day=ie.days=lv,ie.weekday=uv,ie.isoWeekday=cv,ie.dayOfYear=ib,ie.hour=ie.hours=hv,ie.minute=ie.minutes=ti,ie.second=ie.seconds=sb,ie.millisecond=ie.milliseconds=Qp,ie.utcOffset=Lp,ie.utc=Ov,ie.local=Pv,ie.parseZone=kv,ie.hasAlignedHourOffset=Av,ie.isDST=Ni,ie.isLocal=Z,ie.isUtcOffset=Y,ie.isUtc=pe,ie.isUTC=pe,ie.zoneAbbr=ab,ie.zoneName=ls,ie.dates=R("dates accessor is deprecated. Use date instead.",Kp),ie.months=R("months accessor is deprecated. Use month instead",gl),ie.years=R("years accessor is deprecated. Use year instead",gp),ie.zone=R("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Iv),ie.isDSTShifted=R("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",W);function lb(f){return gt(f*1e3)}function pn(){return gt.apply(null,arguments).parseZone()}function Zp(f){return f}var tt=Q.prototype;tt.calendar=He,tt.longDateFormat=Rt,tt.invalidDate=Jr,tt.ordinal=Pi,tt.preparse=Zp,tt.postformat=Zp,tt.relativeTime=te,tt.pastFuture=re,tt.set=D,tt.eras=Wv,tt.erasParse=zv,tt.erasConvertYear=Jv,tt.erasAbbrRegex=Ks,tt.erasNameRegex=$,tt.erasNarrowRegex=Ul,tt.months=Ky,tt.monthsShort=Qy,tt.monthsParse=bp,tt.monthsRegex=yl,tt.monthsShortRegex=Sp,tt.week=Rc,tt.firstDayOfYear=wp,tt.firstDayOfWeek=Hs,tt.weekdays=iv,tt.weekdaysMin=ov,tt.weekdaysShort=sv,tt.weekdaysParse=av,tt.weekdaysRegex=fv,tt.weekdaysShortRegex=Ot,tt.weekdaysMinRegex=Et,tt.isPM=pv,tt.meridiem=er;function Hl(f,g,w,C){var T=Xn(),H=y().set(C,g);return T[w](H,f)}function Xp(f,g,w){if(c(f)&&(g=f,f=void 0),f=f||"",g!=null)return Hl(f,g,w,"month");var C,T=[];for(C=0;C<12;C++)T[C]=Hl(f,C,w,"month");return T}function jc(f,g,w,C){typeof f=="boolean"?(c(g)&&(w=g,g=void 0),g=g||""):(g=f,w=g,f=!1,c(g)&&(w=g,g=void 0),g=g||"");var T=Xn(),H=f?T._week.dow:0,K,de=[];if(w!=null)return Hl(g,(w+H)%7,C,"day");for(K=0;K<7;K++)de[K]=Hl(g,(K+H)%7,C,"day");return de}function eh(f,g){return Xp(f,g,"months")}function th(f,g){return Xp(f,g,"monthsShort")}function ub(f,g,w){return jc(f,g,w,"weekdays")}function cb(f,g,w){return jc(f,g,w,"weekdaysShort")}function Lc(f,g,w){return jc(f,g,w,"weekdaysMin")}Zn("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(f){var g=f%10,w=Be(f%100/10)===1?"th":g===1?"st":g===2?"nd":g===3?"rd":"th";return f+w}}),e.lang=R("moment.lang is deprecated. Use moment.locale instead.",Zn),e.langData=R("moment.langData is deprecated. Use moment.localeData instead.",Xn);var jr=Math.abs;function Bl(){var f=this._data;return this._milliseconds=jr(this._milliseconds),this._days=jr(this._days),this._months=jr(this._months),f.milliseconds=jr(f.milliseconds),f.seconds=jr(f.seconds),f.minutes=jr(f.minutes),f.hours=jr(f.hours),f.months=jr(f.months),f.years=jr(f.years),this}function rh(f,g,w,C){var T=yt(g,w);return f._milliseconds+=C*T._milliseconds,f._days+=C*T._days,f._months+=C*T._months,f._bubble()}function nh(f,g){return rh(this,f,g,1)}function fb(f,g){return rh(this,f,g,-1)}function hn(f){return f<0?Math.floor(f):Math.ceil(f)}function Uc(){var f=this._milliseconds,g=this._days,w=this._months,C=this._data,T,H,K,de,qe;return f>=0&&g>=0&&w>=0||f<=0&&g<=0&&w<=0||(f+=hn(Rr(w)+g)*864e5,g=0,w=0),C.milliseconds=f%1e3,T=Gr(f/1e3),C.seconds=T%60,H=Gr(T/60),C.minutes=H%60,K=Gr(H/60),C.hours=K%24,g+=Gr(K/24),qe=Gr(Di(g)),w+=qe,g-=hn(Rr(qe)),de=Gr(w/12),w%=12,C.days=g,C.months=w,C.years=de,this}function Di(f){return f*4800/146097}function Rr(f){return f*146097/4800}function db(f){if(!this.isValid())return NaN;var g,w,C=this._milliseconds;if(f=ge(f),f==="month"||f==="quarter"||f==="year")switch(g=this._days+C/864e5,w=this._months+Di(g),f){case"month":return w;case"quarter":return w/3;case"year":return w/12}else switch(g=this._days+Math.round(Rr(this._months)),f){case"week":return g/7+C/6048e5;case"day":return g+C/864e5;case"hour":return g*24+C/36e5;case"minute":return g*1440+C/6e4;case"second":return g*86400+C/1e3;case"millisecond":return Math.floor(g*864e5)+C;default:throw new Error("Unknown unit "+f)}}function $n(f){return function(){return this.as(f)}}var Hc=$n("ms"),ua=$n("s"),ji=$n("m"),ih=$n("h"),pb=$n("d"),Vl=$n("w"),hb=$n("M"),sh=$n("Q"),ar=$n("y"),Bc=Hc;function oh(){return yt(this)}function Nn(f){return f=ge(f),this.isValid()?this[f+"s"]():NaN}function ri(f){return function(){return this.isValid()?this._data[f]:NaN}}var Wl=ri("milliseconds"),us=ri("seconds"),ah=ri("minutes"),hr=ri("hours"),Vc=ri("days"),mb=ri("months"),gb=ri("years");function yb(){return Gr(this.days()/7)}var mn=Math.round,Qs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ca(f,g,w,C,T){return T.relativeTime(g||1,!!w,f,C)}function lh(f,g,w,C){var T=yt(f).abs(),H=mn(T.as("s")),K=mn(T.as("m")),de=mn(T.as("h")),qe=mn(T.as("d")),We=mn(T.as("M")),tr=mn(T.as("w")),ni=mn(T.as("y")),ii=H<=w.ss&&["s",H]||H<w.s&&["ss",H]||K<=1&&["m"]||K<w.m&&["mm",K]||de<=1&&["h"]||de<w.h&&["hh",de]||qe<=1&&["d"]||qe<w.d&&["dd",qe];return w.w!=null&&(ii=ii||tr<=1&&["w"]||tr<w.w&&["ww",tr]),ii=ii||We<=1&&["M"]||We<w.M&&["MM",We]||ni<=1&&["y"]||["yy",ni],ii[2]=g,ii[3]=+f>0,ii[4]=C,ca.apply(null,ii)}function vb(f){return f===void 0?mn:typeof f=="function"?(mn=f,!0):!1}function bb(f,g){return Qs[f]===void 0?!1:g===void 0?Qs[f]:(Qs[f]=g,f==="s"&&(Qs.ss=g-1),!0)}function fa(f,g){if(!this.isValid())return this.localeData().invalidDate();var w=!1,C=Qs,T,H;return typeof f=="object"&&(g=f,f=!1),typeof f=="boolean"&&(w=f),typeof g=="object"&&(C=Object.assign({},Qs,g),g.s!=null&&g.ss==null&&(C.ss=g.s-1)),T=this.localeData(),H=lh(this,!w,C,T),w&&(H=T.pastFuture(+this,H)),T.postformat(H)}var Wc=Math.abs;function Zs(f){return(f>0)-(f<0)||+f}function Xs(){if(!this.isValid())return this.localeData().invalidDate();var f=Wc(this._milliseconds)/1e3,g=Wc(this._days),w=Wc(this._months),C,T,H,K,de=this.asSeconds(),qe,We,tr,ni;return de?(C=Gr(f/60),T=Gr(C/60),f%=60,C%=60,H=Gr(w/12),w%=12,K=f?f.toFixed(3).replace(/\.?0+$/,""):"",qe=de<0?"-":"",We=Zs(this._months)!==Zs(de)?"-":"",tr=Zs(this._days)!==Zs(de)?"-":"",ni=Zs(this._milliseconds)!==Zs(de)?"-":"",qe+"P"+(H?We+H+"Y":"")+(w?We+w+"M":"")+(g?tr+g+"D":"")+(T||C||f?"T":"")+(T?ni+T+"H":"")+(C?ni+C+"M":"")+(f?ni+K+"S":"")):"P0D"}var Ge=zs.prototype;Ge.isValid=Cv,Ge.abs=Bl,Ge.add=nh,Ge.subtract=fb,Ge.as=db,Ge.asMilliseconds=Hc,Ge.asSeconds=ua,Ge.asMinutes=ji,Ge.asHours=ih,Ge.asDays=pb,Ge.asWeeks=Vl,Ge.asMonths=hb,Ge.asQuarters=sh,Ge.asYears=ar,Ge.valueOf=Bc,Ge._bubble=Uc,Ge.clone=oh,Ge.get=Nn,Ge.milliseconds=Wl,Ge.seconds=us,Ge.minutes=ah,Ge.hours=hr,Ge.days=Vc,Ge.weeks=yb,Ge.months=mb,Ge.years=gb,Ge.humanize=fa,Ge.toISOString=Xs,Ge.toString=Xs,Ge.toJSON=Xs,Ge.locale=na,Ge.localeData=Ml,Ge.toIsoString=R("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xs),Ge.lang=ia,he("X",0,0,"unix"),he("x",0,0,"valueOf"),me("x",js),me("X",Uy),ct("X",function(f,g,w){w._d=new Date(parseFloat(f)*1e3)}),ct("x",function(f,g,w){w._d=new Date(Be(f))});return e.version="2.30.1",r(gt),e.fn=ie,e.min=_v,e.max=Rv,e.now=xv,e.utc=y,e.unix=lb,e.months=eh,e.isDate=d,e.locale=Zn,e.invalid=_,e.duration=yt,e.isMoment=j,e.weekdays=ub,e.parseZone=pn,e.localeData=Xn,e.isDuration=Zo,e.monthsShort=th,e.weekdaysMin=Lc,e.defineLocale=wl,e.updateLocale=$r,e.locales=Nr,e.weekdaysShort=cb,e.normalizeUnits=ge,e.relativeTimeRounding=vb,e.relativeTimeThreshold=bb,e.calendarFormat=Pl,e.prototype=ie,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 Eq=V((Cq,Dh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Dh<"u"&&Dh.exports?Dh.exports=e():t.tv4=e()})(Cq,function(){Object.keys||(Object.keys=(function(){var I=Object.prototype.hasOwnProperty,R=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],F=A.length;return function(U){if(typeof U!="object"&&typeof U!="function"||U===null)throw new TypeError("Object.keys called on non-object");var D=[];for(var J in U)I.call(U,J)&&D.push(J);if(R)for(var Q=0;Q<F;Q++)I.call(U,A[Q])&&D.push(A[Q]);return D}})()),Object.create||(Object.create=(function(){function I(){}return function(R){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return I.prototype=R,new I}})()),Array.isArray||(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(I){if(this===null)throw new TypeError;var R=Object(this),A=R.length>>>0;if(A===0)return-1;var F=0;if(arguments.length>1&&(F=Number(arguments[1]),F!==F?F=0:F!==0&&F!==1/0&&F!==-1/0&&(F=(F>0||-1)*Math.floor(Math.abs(F)))),F>=A)return-1;for(var U=F>=0?F:Math.max(A-Math.abs(F),0);U<A;U++)if(U in R&&R[U]===I)return U;return-1}),Object.isFrozen||(Object.isFrozen=function(I){for(var R="tv4_test_frozen_key";I.hasOwnProperty(R);)R+=Math.random();try{return I[R]=!0,delete I[R],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(I){return encodeURI(I).replace(/%25[0-9][0-9]/g,function(R){return"%"+R.substring(3)})}function n(I){var R="";t[I.charAt(0)]&&(R=I.charAt(0),I=I.substring(1));var A="",F="",U=!0,D=!1,J=!1;R==="+"?U=!1:R==="."?(F=".",A="."):R==="/"?(F="/",A="/"):R==="#"?(F="#",U=!1):R===";"?(F=";",A=";",D=!0,J=!0):R==="?"?(F="?",A="&",D=!0):R==="&"&&(F="&",A="&",D=!0);for(var Q=[],se=I.split(","),fe=[],He={},_e=0;_e<se.length;_e++){var ye=se[_e],Pe=null;if(ye.indexOf(":")!==-1){var ht=ye.split(":");ye=ht[0],Pe=parseInt(ht[1],10)}for(var Nt={};e[ye.charAt(ye.length-1)];)Nt[ye.charAt(ye.length-1)]=!0,ye=ye.substring(0,ye.length-1);var he={truncate:Pe,name:ye,suffices:Nt};fe.push(he),He[ye]=he,Q.push(ye)}var Yt=function(Ar){for(var at="",Tr=0,wr=0;wr<fe.length;wr++){var Rt=fe[wr],bt=Ar(Rt.name);if(bt==null||Array.isArray(bt)&&bt.length===0||typeof bt=="object"&&Object.keys(bt).length===0){Tr++;continue}if(wr===Tr?at+=F:at+=A||",",Array.isArray(bt)){D&&(at+=Rt.name+"=");for(var Jr=0;Jr<bt.length;Jr++)Jr>0&&(at+=Rt.suffices["*"]&&A||",",Rt.suffices["*"]&&D&&(at+=Rt.name+"=")),at+=U?encodeURIComponent(bt[Jr]).replace(/!/g,"%21"):r(bt[Jr])}else if(typeof bt=="object"){D&&!Rt.suffices["*"]&&(at+=Rt.name+"=");var Ms=!0;for(var At in bt)Ms||(at+=Rt.suffices["*"]&&A||","),Ms=!1,at+=U?encodeURIComponent(At).replace(/!/g,"%21"):r(At),at+=Rt.suffices["*"]?"=":",",at+=U?encodeURIComponent(bt[At]).replace(/!/g,"%21"):r(bt[At])}else D&&(at+=Rt.name,(!J||bt!=="")&&(at+="=")),Rt.truncate!=null&&(bt=bt.substring(0,Rt.truncate)),at+=U?encodeURIComponent(bt).replace(/!/g,"%21"):r(bt)}return at};return Yt.varNames=Q,{prefix:F,substitution:Yt}}function i(I){if(!(this instanceof i))return new i(I);for(var R=I.split("{"),A=[R.shift()],F=[],U=[],D=[];R.length>0;){var J=R.shift(),Q=J.split("}")[0],se=J.substring(Q.length+1),fe=n(Q);U.push(fe.substitution),F.push(fe.prefix),A.push(se),D=D.concat(fe.substitution.varNames)}this.fill=function(He){for(var _e=A[0],ye=0;ye<U.length;ye++){var Pe=U[ye];_e+=Pe(He),_e+=A[ye+1]}return _e},this.varNames=D,this.template=I}i.prototype={toString:function(){return this.template},fillFromObject:function(I){return this.fill(function(R){return I[R]})}};var s=function(R,A,F,U,D){if(this.missing=[],this.missingMap={},this.formatValidators=R?Object.create(R.formatValidators):{},this.schemas=R?Object.create(R.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,U&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),D&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=F||b("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},R)for(var J in R.definedKeywords)this.definedKeywords[J]=R.definedKeywords[J].slice(0)};s.prototype.defineKeyword=function(I,R){this.definedKeywords[I]=this.definedKeywords[I]||[],this.definedKeywords[I].push(R)},s.prototype.createError=function(I,R,A,F,U,D,J){var Q=new E(I,R,A,F,U);return Q.message=this.errorReporter(Q,D,J),Q},s.prototype.returnError=function(I){return I},s.prototype.collectError=function(I){return I&&this.errors.push(I),null},s.prototype.prefixErrors=function(I,R,A){for(var F=I;F<this.errors.length;F++)this.errors[F]=this.errors[F].prefixWith(R,A);return this},s.prototype.banUnknownProperties=function(I,R){for(var A in this.unknownPropertyPaths){var F=this.createError(q.UNKNOWN_PROPERTY,{path:A},A,"",null,I,R),U=this.handleError(F);if(U)return U}return null},s.prototype.addFormat=function(I,R){if(typeof I=="object"){for(var A in I)this.addFormat(A,I[A]);return this}this.formatValidators[I]=R},s.prototype.resolveRefs=function(I,R){if(I.$ref!==void 0){if(R=R||{},R[I.$ref])return this.createError(q.CIRCULAR_REFERENCE,{urls:Object.keys(R).join(", ")},"","",null,void 0,I);R[I.$ref]=!0,I=this.getSchema(I.$ref,R)}return I},s.prototype.getSchema=function(I,R){var A;if(this.schemas[I]!==void 0)return A=this.schemas[I],this.resolveRefs(A,R);var F=I,U="";if(I.indexOf("#")!==-1&&(U=I.substring(I.indexOf("#")+1),F=I.substring(0,I.indexOf("#"))),typeof this.schemas[F]=="object"){A=this.schemas[F];var D=decodeURIComponent(U);if(D==="")return this.resolveRefs(A,R);if(D.charAt(0)!=="/")return;for(var J=D.split("/").slice(1),Q=0;Q<J.length;Q++){var se=J[Q].replace(/~1/g,"/").replace(/~0/g,"~");if(A[se]===void 0){A=void 0;break}A=A[se]}if(A!==void 0)return this.resolveRefs(A,R)}this.missing[F]===void 0&&(this.missing.push(F),this.missing[F]=F,this.missingMap[F]=F)},s.prototype.searchSchemas=function(I,R){if(Array.isArray(I))for(var A=0;A<I.length;A++)this.searchSchemas(I[A],R);else if(I&&typeof I=="object"){typeof I.id=="string"&&k(R,I.id)&&this.schemas[I.id]===void 0&&(this.schemas[I.id]=I);for(var F in I)if(F!=="enum"){if(typeof I[F]=="object")this.searchSchemas(I[F],R);else if(F==="$ref"){var U=m(I[F]);U&&this.schemas[U]===void 0&&this.missingMap[U]===void 0&&(this.missingMap[U]=U)}}}},s.prototype.addSchema=function(I,R){if(typeof I!="string"||typeof R>"u")if(typeof I=="object"&&typeof I.id=="string")R=I,I=R.id;else return;I===m(I)+"#"&&(I=m(I)),this.schemas[I]=R,delete this.missingMap[I],y(R,I),this.searchSchemas(R,I)},s.prototype.getSchemaMap=function(){var I={};for(var R in this.schemas)I[R]=this.schemas[R];return I},s.prototype.getSchemaUris=function(I){var R=[];for(var A in this.schemas)(!I||I.test(A))&&R.push(A);return R},s.prototype.getMissingUris=function(I){var R=[];for(var A in this.missingMap)(!I||I.test(A))&&R.push(A);return R},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(I,R,A,F,U){var D;if(R=this.resolveRefs(R),R){if(R instanceof E)return this.errors.push(R),R}else return null;var J=this.errors.length,Q,se=null,fe=null;if(this.checkRecursive&&I&&typeof I=="object"){if(D=!this.scanned.length,I[this.validatedSchemasKey]){var He=I[this.validatedSchemasKey].indexOf(R);if(He!==-1)return this.errors=this.errors.concat(I[this.validationErrorsKey][He]),null}if(Object.isFrozen(I)&&(Q=this.scannedFrozen.indexOf(I),Q!==-1)){var _e=this.scannedFrozenSchemas[Q].indexOf(R);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Q][_e]),null}if(this.scanned.push(I),Object.isFrozen(I))Q===-1&&(Q=this.scannedFrozen.length,this.scannedFrozen.push(I),this.scannedFrozenSchemas.push([])),se=this.scannedFrozenSchemas[Q].length,this.scannedFrozenSchemas[Q][se]=R,this.scannedFrozenValidationErrors[Q][se]=[];else{if(!I[this.validatedSchemasKey])try{Object.defineProperty(I,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(I,this.validationErrorsKey,{value:[],configurable:!0})}catch{I[this.validatedSchemasKey]=[],I[this.validationErrorsKey]=[]}fe=I[this.validatedSchemasKey].length,I[this.validatedSchemasKey][fe]=R,I[this.validationErrorsKey][fe]=[]}}var ye=this.errors.length,Pe=this.validateBasic(I,R,U)||this.validateNumeric(I,R,U)||this.validateString(I,R,U)||this.validateArray(I,R,U)||this.validateObject(I,R,U)||this.validateCombinations(I,R,U)||this.validateHypermedia(I,R,U)||this.validateFormat(I,R,U)||this.validateDefinedKeywords(I,R,U)||null;if(D){for(;this.scanned.length;){var ht=this.scanned.pop();delete ht[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Pe||ye!==this.errors.length)for(;A&&A.length||F&&F.length;){var Nt=A&&A.length?""+A.pop():null,he=F&&F.length?""+F.pop():null;Pe&&(Pe=Pe.prefixWith(Nt,he)),this.prefixErrors(ye,Nt,he)}return se!==null?this.scannedFrozenValidationErrors[Q][se]=this.errors.slice(J):fe!==null&&(I[this.validationErrorsKey][fe]=this.errors.slice(J)),this.handleError(Pe)},s.prototype.validateFormat=function(I,R){if(typeof R.format!="string"||!this.formatValidators[R.format])return null;var A=this.formatValidators[R.format].call(null,I,R);return typeof A=="string"||typeof A=="number"?this.createError(q.FORMAT_CUSTOM,{message:A},"","/format",null,I,R):A&&typeof A=="object"?this.createError(q.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,I,R):null},s.prototype.validateDefinedKeywords=function(I,R,A){for(var F in this.definedKeywords)if(!(typeof R[F]>"u"))for(var U=this.definedKeywords[F],D=0;D<U.length;D++){var J=U[D],Q=J(I,R[F],R,A);if(typeof Q=="string"||typeof Q=="number")return this.createError(q.KEYWORD_CUSTOM,{key:F,message:Q},"","",null,I,R).prefixWith(null,F);if(Q&&typeof Q=="object"){var se=Q.code;if(typeof se=="string"){if(!q[se])throw new Error("Undefined error code (use defineError): "+se);se=q[se]}else typeof se!="number"&&(se=q.KEYWORD_CUSTOM);var fe=typeof Q.message=="object"?Q.message:{key:F,message:Q.message||"?"},He=Q.schemaPath||"/"+F.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(se,fe,Q.dataPath||null,He,null,I,R)}}return null};function o(I,R){if(I===R)return!0;if(I&&R&&typeof I=="object"&&typeof R=="object"){if(Array.isArray(I)!==Array.isArray(R))return!1;if(Array.isArray(I)){if(I.length!==R.length)return!1;for(var A=0;A<I.length;A++)if(!o(I[A],R[A]))return!1}else{var F;for(F in I)if(R[F]===void 0&&I[F]!==void 0)return!1;for(F in R)if(I[F]===void 0&&R[F]!==void 0)return!1;for(F in I)if(!o(I[F],R[F]))return!1}return!0}return!1}s.prototype.validateBasic=function(R,A,F){var U;return(U=this.validateType(R,A,F))||(U=this.validateEnum(R,A,F))?U.prefixWith(null,"type"):null},s.prototype.validateType=function(R,A){if(A.type===void 0)return null;var F=typeof R;R===null?F="null":Array.isArray(R)&&(F="array");var U=A.type;Array.isArray(U)||(U=[U]);for(var D=0;D<U.length;D++){var J=U[D];if(J===F||J==="integer"&&F==="number"&&R%1===0)return null}return this.createError(q.INVALID_TYPE,{type:F,expected:U.join("/")},"","",null,R,A)},s.prototype.validateEnum=function(R,A){if(A.enum===void 0)return null;for(var F=0;F<A.enum.length;F++){var U=A.enum[F];if(o(R,U))return null}return this.createError(q.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(R):R},"","",null,R,A)},s.prototype.validateNumeric=function(R,A,F){return this.validateMultipleOf(R,A,F)||this.validateMinMax(R,A,F)||this.validateNaN(R,A,F)||null};var l=Math.pow(2,-51),c=1-l;s.prototype.validateMultipleOf=function(R,A){var F=A.multipleOf||A.divisibleBy;if(F===void 0)return null;if(typeof R=="number"){var U=R/F%1;if(U>=l&&U<c)return this.createError(q.NUMBER_MULTIPLE_OF,{value:R,multipleOf:F},"","",null,R,A)}return null},s.prototype.validateMinMax=function(R,A){if(typeof R!="number")return null;if(A.minimum!==void 0){if(R<A.minimum)return this.createError(q.NUMBER_MINIMUM,{value:R,minimum:A.minimum},"","/minimum",null,R,A);if(A.exclusiveMinimum&&R===A.minimum)return this.createError(q.NUMBER_MINIMUM_EXCLUSIVE,{value:R,minimum:A.minimum},"","/exclusiveMinimum",null,R,A)}if(A.maximum!==void 0){if(R>A.maximum)return this.createError(q.NUMBER_MAXIMUM,{value:R,maximum:A.maximum},"","/maximum",null,R,A);if(A.exclusiveMaximum&&R===A.maximum)return this.createError(q.NUMBER_MAXIMUM_EXCLUSIVE,{value:R,maximum:A.maximum},"","/exclusiveMaximum",null,R,A)}return null},s.prototype.validateNaN=function(R,A){return typeof R!="number"?null:isNaN(R)===!0||R===1/0||R===-1/0?this.createError(q.NUMBER_NOT_A_NUMBER,{value:R},"","/type",null,R,A):null},s.prototype.validateString=function(R,A,F){return this.validateStringLength(R,A,F)||this.validateStringPattern(R,A,F)||null},s.prototype.validateStringLength=function(R,A){return typeof R!="string"?null:A.minLength!==void 0&&R.length<A.minLength?this.createError(q.STRING_LENGTH_SHORT,{length:R.length,minimum:A.minLength},"","/minLength",null,R,A):A.maxLength!==void 0&&R.length>A.maxLength?this.createError(q.STRING_LENGTH_LONG,{length:R.length,maximum:A.maxLength},"","/maxLength",null,R,A):null},s.prototype.validateStringPattern=function(R,A){if(typeof R!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var F;if(A.pattern instanceof RegExp)F=A.pattern;else{var U,D="",J=A.pattern.match(/^\/(.+)\/([img]*)$/);J?(U=J[1],D=J[2]):U=A.pattern,F=new RegExp(U,D)}return F.test(R)?null:this.createError(q.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,R,A)},s.prototype.validateArray=function(R,A,F){return Array.isArray(R)&&(this.validateArrayLength(R,A,F)||this.validateArrayUniqueItems(R,A,F)||this.validateArrayItems(R,A,F))||null},s.prototype.validateArrayLength=function(R,A){var F;return A.minItems!==void 0&&R.length<A.minItems&&(F=this.createError(q.ARRAY_LENGTH_SHORT,{length:R.length,minimum:A.minItems},"","/minItems",null,R,A),this.handleError(F))||A.maxItems!==void 0&&R.length>A.maxItems&&(F=this.createError(q.ARRAY_LENGTH_LONG,{length:R.length,maximum:A.maxItems},"","/maxItems",null,R,A),this.handleError(F))?F:null},s.prototype.validateArrayUniqueItems=function(R,A){if(A.uniqueItems){for(var F=0;F<R.length;F++)for(var U=F+1;U<R.length;U++)if(o(R[F],R[U])){var D=this.createError(q.ARRAY_UNIQUE,{match1:F,match2:U},"","/uniqueItems",null,R,A);if(this.handleError(D))return D}}return null},s.prototype.validateArrayItems=function(R,A,F){if(A.items===void 0)return null;var U,D;if(Array.isArray(A.items)){for(D=0;D<R.length;D++)if(D<A.items.length){if(U=this.validateAll(R[D],A.items[D],[D],["items",D],F+"/"+D))return U}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(U=this.createError(q.ARRAY_ADDITIONAL_ITEMS,{},"/"+D,"/additionalItems",null,R,A),this.handleError(U)))return U}else if(U=this.validateAll(R[D],A.additionalItems,[D],["additionalItems"],F+"/"+D))return U}}else for(D=0;D<R.length;D++)if(U=this.validateAll(R[D],A.items,[D],["items"],F+"/"+D))return U;return null},s.prototype.validateObject=function(R,A,F){return typeof R!="object"||R===null||Array.isArray(R)?null:this.validateObjectMinMaxProperties(R,A,F)||this.validateObjectRequiredProperties(R,A,F)||this.validateObjectProperties(R,A,F)||this.validateObjectDependencies(R,A,F)||null},s.prototype.validateObjectMinMaxProperties=function(R,A){var F=Object.keys(R),U;return A.minProperties!==void 0&&F.length<A.minProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MINIMUM,{propertyCount:F.length,minimum:A.minProperties},"","/minProperties",null,R,A),this.handleError(U))||A.maxProperties!==void 0&&F.length>A.maxProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:F.length,maximum:A.maxProperties},"","/maxProperties",null,R,A),this.handleError(U))?U:null},s.prototype.validateObjectRequiredProperties=function(R,A){if(A.required!==void 0)for(var F=0;F<A.required.length;F++){var U=A.required[F];if(R[U]===void 0){var D=this.createError(q.OBJECT_REQUIRED,{key:U},"","/required/"+F,null,R,A);if(this.handleError(D))return D}}return null},s.prototype.validateObjectProperties=function(R,A,F){var U;for(var D in R){var J=F+"/"+D.replace(/~/g,"~0").replace(/\//g,"~1"),Q=!1;if(A.properties!==void 0&&A.properties[D]!==void 0&&(Q=!0,U=this.validateAll(R[D],A.properties[D],[D],["properties",D],J)))return U;if(A.patternProperties!==void 0)for(var se in A.patternProperties){var fe=new RegExp(se);if(fe.test(D)&&(Q=!0,U=this.validateAll(R[D],A.patternProperties[se],[D],["patternProperties",se],J)))return U}if(Q)this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(U=this.createError(q.OBJECT_ADDITIONAL_PROPERTIES,{key:D},"","/additionalProperties",null,R,A).prefixWith(D,null),this.handleError(U)))return U}else if(U=this.validateAll(R[D],A.additionalProperties,[D],["additionalProperties"],J))return U}else this.trackUnknownProperties&&!this.knownPropertyPaths[J]&&(this.unknownPropertyPaths[J]=!0)}return null},s.prototype.validateObjectDependencies=function(R,A,F){var U;if(A.dependencies!==void 0){for(var D in A.dependencies)if(R[D]!==void 0){var J=A.dependencies[D];if(typeof J=="string"){if(R[J]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:J},"","",null,R,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(Array.isArray(J))for(var Q=0;Q<J.length;Q++){var se=J[Q];if(R[se]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:se},"","/"+Q,null,R,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(U=this.validateAll(R,J,[],["dependencies",D],F))return U}}return null},s.prototype.validateCombinations=function(R,A,F){return this.validateAllOf(R,A,F)||this.validateAnyOf(R,A,F)||this.validateOneOf(R,A,F)||this.validateNot(R,A,F)||null},s.prototype.validateAllOf=function(R,A,F){if(A.allOf===void 0)return null;for(var U,D=0;D<A.allOf.length;D++){var J=A.allOf[D];if(U=this.validateAll(R,J,[],["allOf",D],F))return U}return null},s.prototype.validateAnyOf=function(R,A,F){if(A.anyOf===void 0)return null;var U=[],D=this.errors.length,J,Q;this.trackUnknownProperties&&(J=this.unknownPropertyPaths,Q=this.knownPropertyPaths);for(var se=!0,fe=0;fe<A.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var He=A.anyOf[fe],_e=this.errors.length,ye=this.validateAll(R,He,[],["anyOf",fe],F);if(ye===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,D),this.trackUnknownProperties){for(var Pe in this.knownPropertyPaths)Q[Pe]=!0,delete J[Pe];for(var ht in this.unknownPropertyPaths)Q[ht]||(J[ht]=!0);se=!1;continue}return null}ye&&U.push(ye.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=J,this.knownPropertyPaths=Q),se)return U=U.concat(this.errors.slice(D)),this.errors=this.errors.slice(0,D),this.createError(q.ANY_OF_MISSING,{},"","/anyOf",U,R,A)},s.prototype.validateOneOf=function(R,A,F){if(A.oneOf===void 0)return null;var U=null,D=[],J=this.errors.length,Q,se;this.trackUnknownProperties&&(Q=this.unknownPropertyPaths,se=this.knownPropertyPaths);for(var fe=0;fe<A.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var He=A.oneOf[fe],_e=this.errors.length,ye=this.validateAll(R,He,[],["oneOf",fe],F);if(ye===null&&_e===this.errors.length){if(U===null)U=fe;else return this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MULTIPLE,{index1:U,index2:fe},"","/oneOf",null,R,A);if(this.trackUnknownProperties){for(var Pe in this.knownPropertyPaths)se[Pe]=!0,delete Q[Pe];for(var ht in this.unknownPropertyPaths)se[ht]||(Q[ht]=!0)}}else ye&&D.push(ye)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Q,this.knownPropertyPaths=se),U===null?(D=D.concat(this.errors.slice(J)),this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MISSING,{},"","/oneOf",D,R,A)):(this.errors=this.errors.slice(0,J),null)},s.prototype.validateNot=function(R,A,F){if(A.not===void 0)return null;var U=this.errors.length,D,J;this.trackUnknownProperties&&(D=this.unknownPropertyPaths,J=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Q=this.validateAll(R,A.not,null,null,F),se=this.errors.slice(U);return this.errors=this.errors.slice(0,U),this.trackUnknownProperties&&(this.unknownPropertyPaths=D,this.knownPropertyPaths=J),Q===null&&se.length===0?this.createError(q.NOT_PASSED,{},"","/not",null,R,A):null},s.prototype.validateHypermedia=function(R,A,F){if(!A.links)return null;for(var U,D=0;D<A.links.length;D++){var J=A.links[D];if(J.rel==="describedby"){for(var Q=new i(J.href),se=!0,fe=0;fe<Q.varNames.length;fe++)if(!(Q.varNames[fe]in R)){se=!1;break}if(se){var He=Q.fillFromObject(R),_e={$ref:He};if(U=this.validateAll(R,_e,[],["links",D],F))return U}}}};function d(I){var R=String(I).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return R?{href:R[0]||"",protocol:R[1]||"",authority:R[2]||"",host:R[3]||"",hostname:R[4]||"",port:R[5]||"",pathname:R[6]||"",search:R[7]||"",hash:R[8]||""}:null}function p(I,R){function A(F){var U=[];return F.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(D){D==="/.."?U.pop():U.push(D)}),U.join("").replace(/^\//,F.charAt(0)==="/"?"/":"")}return R=d(R||""),I=d(I||""),!R||!I?null:(R.protocol||I.protocol)+(R.protocol||R.authority?R.authority:I.authority)+A(R.protocol||R.authority||R.pathname.charAt(0)==="/"?R.pathname:R.pathname?(I.authority&&!I.pathname?"/":"")+I.pathname.slice(0,I.pathname.lastIndexOf("/")+1)+R.pathname:I.pathname)+(R.protocol||R.authority||R.pathname?R.search:R.search||I.search)+R.hash}function m(I){return I.split("#")[0]}function y(I,R){if(I&&typeof I=="object")if(R===void 0?R=I.id:typeof I.id=="string"&&(R=p(R,I.id),I.id=R),Array.isArray(I))for(var A=0;A<I.length;A++)y(I[A],R);else{typeof I.$ref=="string"&&(I.$ref=p(R,I.$ref));for(var F in I)F!=="enum"&&y(I[F],R)}}function b(I){I=I||"en";var R=P[I];return function(A){var F=R[A.code]||_[A.code];if(typeof F!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var U=A.params;return F.replace(/\{([^{}]*)\}/g,function(D,J){var Q=U[J];return typeof Q=="string"||typeof Q=="number"?Q:D})}}var q={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var v in q)x[q[v]]=v;var _={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 E(I,R,A,F,U){if(Error.call(this),I===void 0)throw new Error("No error code supplied: "+F);this.message="",this.params=R,this.code=I,this.dataPath=A||"",this.schemaPath=F||"",this.subErrors=U||null;var D=new Error(this.message);if(this.stack=D.stack||D.stacktrace,!this.stack)try{throw D}catch(J){this.stack=J.stack||J.stacktrace}}E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,E.prototype.name="ValidationError",E.prototype.prefixWith=function(I,R){if(I!==null&&(I=I.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+I+this.dataPath),R!==null&&(R=R.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+R+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(I,R);return this};function k(I,R){if(R.substring(0,I.length)===I){var A=R.substring(I.length);if(R.length>0&&R.charAt(I.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var P={};function M(I){var R=new s,A,F,U={setErrorReporter:function(D){return typeof D=="string"?this.language(D):(F=D,!0)},addFormat:function(){R.addFormat.apply(R,arguments)},language:function(D){return D?(P[D]||(D=D.split("-")[0]),P[D]?(A=D,D):!1):A},addLanguage:function(D,J){var Q;for(Q in q)J[Q]&&!J[q[Q]]&&(J[q[Q]]=J[Q]);var se=D.split("-")[0];if(!P[se])P[D]=J,P[se]=J;else{P[D]=Object.create(P[se]);for(Q in J)typeof P[se][Q]>"u"&&(P[se][Q]=J[Q]),P[D][Q]=J[Q]}return this},freshApi:function(D){var J=M();return D&&J.language(D),J},validate:function(D,J,Q,se){var fe=b(A),He=F?function(Pe,ht,Nt){return F(Pe,ht,Nt)||fe(Pe,ht,Nt)}:fe,_e=new s(R,!1,He,Q,se);typeof J=="string"&&(J={$ref:J}),_e.addSchema("",J);var ye=_e.validateAll(D,J,null,null,"");return!ye&&se&&(ye=_e.banUnknownProperties(D,J)),this.error=ye,this.missing=_e.missing,this.valid=ye===null,this.valid},validateResult:function(){var D={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(D,arguments),D},validateMultiple:function(D,J,Q,se){var fe=b(A),He=F?function(Pe,ht,Nt){return F(Pe,ht,Nt)||fe(Pe,ht,Nt)}:fe,_e=new s(R,!0,He,Q,se);typeof J=="string"&&(J={$ref:J}),_e.addSchema("",J),_e.validateAll(D,J,null,null,""),se&&_e.banUnknownProperties(D,J);var ye={toString:function(){return this.valid?"valid":this.error.message}};return ye.errors=_e.errors,ye.missing=_e.missing,ye.valid=ye.errors.length===0,ye},addSchema:function(){return R.addSchema.apply(R,arguments)},getSchema:function(){return R.getSchema.apply(R,arguments)},getSchemaMap:function(){return R.getSchemaMap.apply(R,arguments)},getSchemaUris:function(){return R.getSchemaUris.apply(R,arguments)},getMissingUris:function(){return R.getMissingUris.apply(R,arguments)},dropSchemas:function(){R.dropSchemas.apply(R,arguments)},defineKeyword:function(){R.defineKeyword.apply(R,arguments)},defineError:function(D,J,Q){if(typeof D!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(D))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof J!="number"||J%1!==0||J<1e4)throw new Error("Code number must be an integer > 10000");if(typeof q[D]<"u")throw new Error("Error already defined: "+D+" as "+q[D]);if(typeof x[J]<"u")throw new Error("Error code already used: "+x[J]+" as "+J);q[D]=J,x[J]=D,_[D]=_[J]=Q;for(var se in P){var fe=P[se];fe[D]&&(fe[J]=fe[J]||fe[D])}},reset:function(){R.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:p,getDocumentUri:m,errorCodes:q};return U.language(I||"en"),U}var j=M();return j.addLanguage("en-gb",_),j.tv4=j,j})});var mf=V(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.regexpCode=ut.getEsmExportName=ut.getProperty=ut.safeStringify=ut.stringify=ut.strConcat=ut.addCodeArg=ut.str=ut._=ut.nil=ut._Code=ut.Name=ut.IDENTIFIER=ut._CodeOrName=void 0;var pf=class{};ut._CodeOrName=pf;ut.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var _a=class extends pf{constructor(e){if(super(),!ut.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}}};ut.Name=_a;var Un=class extends pf{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 _a&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ut._Code=Un;ut.nil=new Un("");function qq(t,...e){let r=[t[0]],n=0;for(;n<e.length;)gS(r,e[n]),r.push(t[++n]);return new Un(r)}ut._=qq;var mS=new Un("+");function Iq(t,...e){let r=[hf(t[0])],n=0;for(;n<e.length;)r.push(mS),gS(r,e[n]),r.push(mS,hf(t[++n]));return w2(r),new Un(r)}ut.str=Iq;function gS(t,e){e instanceof Un?t.push(...e._items):e instanceof _a?t.push(e):t.push(x2(e))}ut.addCodeArg=gS;function w2(t){let e=1;for(;e<t.length-1;){if(t[e]===mS){let r=_2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function _2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof _a||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 _a))return`"${t}${e.slice(1)}`}function R2(t,e){return e.emptyStr()?t:t.emptyStr()?e:Iq`${t}${e}`}ut.strConcat=R2;function x2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:hf(Array.isArray(t)?t.join(","):t)}function C2(t){return new Un(hf(t))}ut.stringify=C2;function hf(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ut.safeStringify=hf;function E2(t){return typeof t=="string"&&ut.IDENTIFIER.test(t)?new Un(`.${t}`):qq`[${t}]`}ut.getProperty=E2;function q2(t){if(typeof t=="string"&&ut.IDENTIFIER.test(t))return new Un(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ut.getEsmExportName=q2;function I2(t){return new Un(t.toString())}ut.regexpCode=I2});var bS=V(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.ValueScope=rn.ValueScopeName=rn.Scope=rn.varKinds=rn.UsedValueState=void 0;var tn=mf(),yS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},jh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(jh||(rn.UsedValueState=jh={}));rn.varKinds={const:new tn.Name("const"),let:new tn.Name("let"),var:new tn.Name("var")};var Lh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof tn.Name?e:this.name(e)}name(e){return new tn.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}}};rn.Scope=Lh;var Uh=class extends tn.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,tn._)`.${new tn.Name(r)}[${n}]`}};rn.ValueScopeName=Uh;var O2=(0,tn._)`\n`,vS=class extends Lh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?O2:tn.nil}}get(){return this._scope}name(e){return new Uh(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 c=this._scope[s]||(this._scope[s]=[]),d=c.length;return c[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,tn._)`${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=tn.nil;for(let o in e){let l=e[o];if(!l)continue;let c=n[o]=n[o]||new Map;l.forEach(d=>{if(c.has(d))return;c.set(d,jh.Started);let p=r(d);if(p){let m=this.opts.es5?rn.varKinds.var:rn.varKinds.const;s=(0,tn._)`${s}${m} ${d} = ${p};${this.opts._n}`}else if(p=i?.(d))s=(0,tn._)`${s}${p}${this.opts._n}`;else throw new yS(d);c.set(d,jh.Completed)})}return s}};rn.ValueScope=vS});var ze=V(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.or=Ue.and=Ue.not=Ue.CodeGen=Ue.operators=Ue.varKinds=Ue.ValueScopeName=Ue.ValueScope=Ue.Scope=Ue.Name=Ue.regexpCode=Ue.stringify=Ue.getProperty=Ue.nil=Ue.strConcat=Ue.str=Ue._=void 0;var et=mf(),ui=bS(),lo=mf();Object.defineProperty(Ue,"_",{enumerable:!0,get:function(){return lo._}});Object.defineProperty(Ue,"str",{enumerable:!0,get:function(){return lo.str}});Object.defineProperty(Ue,"strConcat",{enumerable:!0,get:function(){return lo.strConcat}});Object.defineProperty(Ue,"nil",{enumerable:!0,get:function(){return lo.nil}});Object.defineProperty(Ue,"getProperty",{enumerable:!0,get:function(){return lo.getProperty}});Object.defineProperty(Ue,"stringify",{enumerable:!0,get:function(){return lo.stringify}});Object.defineProperty(Ue,"regexpCode",{enumerable:!0,get:function(){return lo.regexpCode}});Object.defineProperty(Ue,"Name",{enumerable:!0,get:function(){return lo.Name}});var Wh=bS();Object.defineProperty(Ue,"Scope",{enumerable:!0,get:function(){return Wh.Scope}});Object.defineProperty(Ue,"ValueScope",{enumerable:!0,get:function(){return Wh.ValueScope}});Object.defineProperty(Ue,"ValueScopeName",{enumerable:!0,get:function(){return Wh.ValueScopeName}});Object.defineProperty(Ue,"varKinds",{enumerable:!0,get:function(){return Wh.varKinds}});Ue.operators={GT:new et._Code(">"),GTE:new et._Code(">="),LT:new et._Code("<"),LTE:new et._Code("<="),EQ:new et._Code("==="),NEQ:new et._Code("!=="),NOT:new et._Code("!"),OR:new et._Code("||"),AND:new et._Code("&&"),ADD:new et._Code("+")};var Ss=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},SS=class extends Ss{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?ui.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=iu(this.rhs,e,r)),this}get names(){return this.rhs instanceof et._CodeOrName?this.rhs.names:{}}},Hh=class extends Ss{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 et.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=iu(this.rhs,e,r),this}get names(){let e=this.lhs instanceof et.Name?{}:{...this.lhs.names};return Vh(e,this.rhs)}},wS=class extends Hh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},_S=class extends Ss{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},RS=class extends Ss{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},xS=class extends Ss{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},CS=class extends Ss{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=iu(this.code,e,r),this}get names(){return this.code instanceof et._CodeOrName?this.code.names:{}}},gf=class extends Ss{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)||(P2(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),{})}},ws=class extends gf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},ES=class extends gf{},nu=class extends ws{};nu.kind="else";var Ra=class t extends ws{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 nu(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Oq(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=iu(this.condition,e,r),this}get names(){let e=super.names;return Vh(e,this.condition),this.else&&Ca(e,this.else.names),e}};Ra.kind="if";var xa=class extends ws{};xa.kind="for";var qS=class extends xa{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=iu(this.iteration,e,r),this}get names(){return Ca(super.names,this.iteration.names)}},IS=class extends xa{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?ui.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=Vh(super.names,this.from);return Vh(e,this.to)}},Bh=class extends xa{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=iu(this.iterable,e,r),this}get names(){return Ca(super.names,this.iterable.names)}},yf=class extends ws{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)}};yf.kind="func";var vf=class extends gf{render(e){return"return "+super.render(e)}};vf.kind="return";var OS=class extends ws{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}},bf=class extends ws{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};bf.kind="catch";var Sf=class extends ws{render(e){return"finally"+super.render(e)}};Sf.kind="finally";var PS=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
23
+ `+new Error().stack),w=!1}return g.apply(this,arguments)},g)}var A={};function F(f,g){e.deprecationHandler!=null&&e.deprecationHandler(f,g),A[f]||(I(g),A[f]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function U(f){return typeof Function<"u"&&f instanceof Function||Object.prototype.toString.call(f)==="[object Function]"}function D(f){var g,w;for(w in f)s(f,w)&&(g=f[w],U(g)?this[w]=g:this["_"+w]=g);this._config=f,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function J(f,g){var w=m({},f),C;for(C in g)s(g,C)&&(i(f[C])&&i(g[C])?(w[C]={},m(w[C],f[C]),m(w[C],g[C])):g[C]!=null?w[C]=g[C]:delete w[C]);for(C in f)s(f,C)&&!s(g,C)&&i(f[C])&&(w[C]=m({},w[C]));return w}function Q(f){f!=null&&this.set(f)}var se;Object.keys?se=Object.keys:se=function(f){var g,w=[];for(g in f)s(f,g)&&w.push(g);return w};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function He(f,g,w){var C=this._calendar[f]||this._calendar.sameElse;return U(C)?C.call(g,w):C}function _e(f,g,w){var C=""+Math.abs(f),T=g-C.length,H=f>=0;return(H?w?"+":"":"-")+Math.pow(10,Math.max(0,T)).toString().substr(1)+C}var ye=/(\[[^\[]*\])|(\\)?([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,Pe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ht={},Nt={};function he(f,g,w,C){var T=C;typeof C=="string"&&(T=function(){return this[C]()}),f&&(Nt[f]=T),g&&(Nt[g[0]]=function(){return _e(T.apply(this,arguments),g[1],g[2])}),w&&(Nt[w]=function(){return this.localeData().ordinal(T.apply(this,arguments),f)})}function Yt(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function Ar(f){var g=f.match(ye),w,C;for(w=0,C=g.length;w<C;w++)Nt[g[w]]?g[w]=Nt[g[w]]:g[w]=Yt(g[w]);return function(T){var H="",K;for(K=0;K<C;K++)H+=U(g[K])?g[K].call(T,f):g[K];return H}}function at(f,g){return f.isValid()?(g=Tr(g,f.localeData()),ht[g]=ht[g]||Ar(g),ht[g](f)):f.localeData().invalidDate()}function Tr(f,g){var w=5;function C(T){return g.longDateFormat(T)||T}for(Pe.lastIndex=0;w>=0&&Pe.test(f);)f=f.replace(Pe,C),Pe.lastIndex=0,w-=1;return f}var wr={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 Rt(f){var g=this._longDateFormat[f],w=this._longDateFormat[f.toUpperCase()];return g||!w?g:(this._longDateFormat[f]=w.match(ye).map(function(C){return C==="MMMM"||C==="MM"||C==="DD"||C==="dddd"?C.slice(1):C}).join(""),this._longDateFormat[f])}var bt="Invalid date";function Jr(){return this._invalidDate}var Ms="%d",At=/\d{1,2}/;function Pi(f){return this._ordinal.replace("%d",f)}var qn={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 te(f,g,w,C){var T=this._relativeTime[w];return U(T)?T(f,g,w,C):T.replace(/%d/i,f)}function re(f,g){var w=this._relativeTime[f>0?"future":"past"];return U(w)?w(g):w.replace(/%s/i,g)}var Ae={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 ge(f){return typeof f=="string"?Ae[f]||Ae[f.toLowerCase()]:void 0}function Se(f){var g={},w,C;for(C in f)s(f,C)&&(w=ge(C),w&&(g[w]=f[C]));return g}var Qe={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 xt(f){var g=[],w;for(w in f)s(f,w)&&g.push({unit:w,priority:Qe[w]});return g.sort(function(C,T){return C.priority-T.priority}),g}var sr=/\d/,oe=/\d\d/,fr=/\d{3}/,Lt=/\d{4}/,mt=/[+-]?\d{6}/,Ee=/\d\d?/,In=/\d\d\d\d?/,cl=/\d\d\d\d\d\d?/,Fs=/\d{1,3}/,Uo=/\d{1,4}/,Ds=/[+-]?\d{1,6}/,ki=/\d+/,js=/[+-]?\d+/,mc=/Z|[+-]\d\d:?\d\d/gi,fl=/Z|[+-]\d\d(?::?\d\d)?/gi,Uy=/[+-]?\d+(\.\d{1,3})?/,Ho=/[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,ts=/^[1-9]\d?/,dl=/^([1-9]\d|\d)/,pl;pl={};function me(f,g,w){pl[f]=U(g)?g:function(C,T){return C&&w?w:g}}function Hy(f,g){return s(pl,f)?pl[f](g._strict,g._locale):new RegExp(By(f))}function By(f){return On(f.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(g,w,C,T,H){return w||C||T||H}))}function On(f){return f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Gr(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Be(f){var g=+f,w=0;return g!==0&&isFinite(g)&&(w=Gr(g)),w}var gc={};function ct(f,g){var w,C=g,T;for(typeof f=="string"&&(f=[f]),c(g)&&(C=function(H,K){K[g]=Be(H)}),T=f.length,w=0;w<T;w++)gc[f[w]]=C}function Bo(f,g){ct(f,function(w,C,T,H){T._w=T._w||{},g(w,T._w,T,H)})}function yc(f,g,w){g!=null&&s(gc,f)&&gc[f](g,w._a,w,f)}function hl(f){return f%4===0&&f%100!==0||f%400===0}var dr=0,Kn=1,Pn=2,Kt=3,Yr=4,Qn=5,rs=6,mp=7,Vy=8;he("Y",0,0,function(){var f=this.year();return f<=9999?_e(f,4):"+"+f}),he(0,["YY",2],0,function(){return this.year()%100}),he(0,["YYYY",4],0,"year"),he(0,["YYYYY",5],0,"year"),he(0,["YYYYYY",6,!0],0,"year"),me("Y",js),me("YY",Ee,oe),me("YYYY",Uo,Lt),me("YYYYY",Ds,mt),me("YYYYYY",Ds,mt),ct(["YYYYY","YYYYYY"],dr),ct("YYYY",function(f,g){g[dr]=f.length===2?e.parseTwoDigitYear(f):Be(f)}),ct("YY",function(f,g){g[dr]=e.parseTwoDigitYear(f)}),ct("Y",function(f,g){g[dr]=parseInt(f,10)});function Vo(f){return hl(f)?366:365}e.parseTwoDigitYear=function(f){return Be(f)+(Be(f)>68?1900:2e3)};var gp=Ls("FullYear",!0);function Wy(){return hl(this.year())}function Ls(f,g){return function(w){return w!=null?(zo(this,f,w),e.updateOffset(this,g),this):Wo(this,f)}}function Wo(f,g){if(!f.isValid())return NaN;var w=f._d,C=f._isUTC;switch(g){case"Milliseconds":return C?w.getUTCMilliseconds():w.getMilliseconds();case"Seconds":return C?w.getUTCSeconds():w.getSeconds();case"Minutes":return C?w.getUTCMinutes():w.getMinutes();case"Hours":return C?w.getUTCHours():w.getHours();case"Date":return C?w.getUTCDate():w.getDate();case"Day":return C?w.getUTCDay():w.getDay();case"Month":return C?w.getUTCMonth():w.getMonth();case"FullYear":return C?w.getUTCFullYear():w.getFullYear();default:return NaN}}function zo(f,g,w){var C,T,H,K,de;if(!(!f.isValid()||isNaN(w))){switch(C=f._d,T=f._isUTC,g){case"Milliseconds":return void(T?C.setUTCMilliseconds(w):C.setMilliseconds(w));case"Seconds":return void(T?C.setUTCSeconds(w):C.setSeconds(w));case"Minutes":return void(T?C.setUTCMinutes(w):C.setMinutes(w));case"Hours":return void(T?C.setUTCHours(w):C.setHours(w));case"Date":return void(T?C.setUTCDate(w):C.setDate(w));case"FullYear":break;default:return}H=w,K=f.month(),de=f.date(),de=de===29&&K===1&&!hl(H)?28:de,T?C.setUTCFullYear(H,K,de):C.setFullYear(H,K,de)}}function zy(f){return f=ge(f),U(this[f])?this[f]():this}function ml(f,g){if(typeof f=="object"){f=Se(f);var w=xt(f),C,T=w.length;for(C=0;C<T;C++)this[w[C].unit](f[w[C].unit])}else if(f=ge(f),U(this[f]))return this[f](g);return this}function Jy(f,g){return(f%g+g)%g}var Ut;Array.prototype.indexOf?Ut=Array.prototype.indexOf:Ut=function(f){var g;for(g=0;g<this.length;++g)if(this[g]===f)return g;return-1};function vc(f,g){if(isNaN(f)||isNaN(g))return NaN;var w=Jy(g,12);return f+=(g-w)/12,w===1?hl(f)?29:28:31-w%7%2}he("M",["MM",2],"Mo",function(){return this.month()+1}),he("MMM",0,0,function(f){return this.localeData().monthsShort(this,f)}),he("MMMM",0,0,function(f){return this.localeData().months(this,f)}),me("M",Ee,ts),me("MM",Ee,oe),me("MMM",function(f,g){return g.monthsShortRegex(f)}),me("MMMM",function(f,g){return g.monthsRegex(f)}),ct(["M","MM"],function(f,g){g[Kn]=Be(f)-1}),ct(["MMM","MMMM"],function(f,g,w,C){var T=w._locale.monthsParse(f,C,w._strict);T!=null?g[Kn]=T:q(w).invalidMonth=f});var yp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),bc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Sc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Gy=Ho,Yy=Ho;function Ky(f,g){return f?n(this._months)?this._months[f.month()]:this._months[(this._months.isFormat||Sc).test(g)?"format":"standalone"][f.month()]:n(this._months)?this._months:this._months.standalone}function Qy(f,g){return f?n(this._monthsShort)?this._monthsShort[f.month()]:this._monthsShort[Sc.test(g)?"format":"standalone"][f.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function vp(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],C=0;C<12;++C)H=y([2e3,C]),this._shortMonthsParse[C]=this.monthsShort(H,"").toLocaleLowerCase(),this._longMonthsParse[C]=this.months(H,"").toLocaleLowerCase();return w?g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null):g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null)):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null))}function bp(f,g,w){var C,T,H;if(this._monthsParseExact)return vp.call(this,f,g,w);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),C=0;C<12;C++){if(T=y([2e3,C]),w&&!this._longMonthsParse[C]&&(this._longMonthsParse[C]=new RegExp("^"+this.months(T,"").replace(".","")+"$","i"),this._shortMonthsParse[C]=new RegExp("^"+this.monthsShort(T,"").replace(".","")+"$","i")),!w&&!this._monthsParse[C]&&(H="^"+this.months(T,"")+"|^"+this.monthsShort(T,""),this._monthsParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="MMMM"&&this._longMonthsParse[C].test(f))return C;if(w&&g==="MMM"&&this._shortMonthsParse[C].test(f))return C;if(!w&&this._monthsParse[C].test(f))return C}}function wc(f,g){if(!f.isValid())return f;if(typeof g=="string"){if(/^\d+$/.test(g))g=Be(g);else if(g=f.localeData().monthsParse(g),!c(g))return f}var w=g,C=f.date();return C=C<29?C:Math.min(C,vc(f.year(),w)),f._isUTC?f._d.setUTCMonth(w,C):f._d.setMonth(w,C),f}function gl(f){return f!=null?(wc(this,f),e.updateOffset(this,!0),this):Wo(this,"Month")}function Zy(){return vc(this.year(),this.month())}function Sp(f){return this._monthsParseExact?(s(this,"_monthsRegex")||_c.call(this),f?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Gy),this._monthsShortStrictRegex&&f?this._monthsShortStrictRegex:this._monthsShortRegex)}function yl(f){return this._monthsParseExact?(s(this,"_monthsRegex")||_c.call(this),f?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Yy),this._monthsStrictRegex&&f?this._monthsStrictRegex:this._monthsRegex)}function _c(){function f(qe,We){return We.length-qe.length}var g=[],w=[],C=[],T,H,K,de;for(T=0;T<12;T++)H=y([2e3,T]),K=On(this.monthsShort(H,"")),de=On(this.months(H,"")),g.push(K),w.push(de),C.push(de),C.push(K);g.sort(f),w.sort(f),C.sort(f),this._monthsRegex=new RegExp("^("+C.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+g.join("|")+")","i")}function Xy(f,g,w,C,T,H,K){var de;return f<100&&f>=0?(de=new Date(f+400,g,w,C,T,H,K),isFinite(de.getFullYear())&&de.setFullYear(f)):de=new Date(f,g,w,C,T,H,K),de}function Us(f){var g,w;return f<100&&f>=0?(w=Array.prototype.slice.call(arguments),w[0]=f+400,g=new Date(Date.UTC.apply(null,w)),isFinite(g.getUTCFullYear())&&g.setUTCFullYear(f)):g=new Date(Date.UTC.apply(null,arguments)),g}function Jo(f,g,w){var C=7+g-w,T=(7+Us(f,0,C).getUTCDay()-g)%7;return-T+C-1}function vl(f,g,w,C,T){var H=(7+w-C)%7,K=Jo(f,C,T),de=1+7*(g-1)+H+K,qe,We;return de<=0?(qe=f-1,We=Vo(qe)+de):de>Vo(f)?(qe=f+1,We=de-Vo(f)):(qe=f,We=de),{year:qe,dayOfYear:We}}function Go(f,g,w){var C=Jo(f.year(),g,w),T=Math.floor((f.dayOfYear()-C-1)/7)+1,H,K;return T<1?(K=f.year()-1,H=T+kn(K,g,w)):T>kn(f.year(),g,w)?(H=T-kn(f.year(),g,w),K=f.year()+1):(K=f.year(),H=T),{week:H,year:K}}function kn(f,g,w){var C=Jo(f,g,w),T=Jo(f+1,g,w);return(Vo(f)-C+T)/7}he("w",["ww",2],"wo","week"),he("W",["WW",2],"Wo","isoWeek"),me("w",Ee,ts),me("ww",Ee,oe),me("W",Ee,ts),me("WW",Ee,oe),Bo(["w","ww","W","WW"],function(f,g,w,C){g[C.substr(0,1)]=Be(f)});function Rc(f){return Go(f,this._week.dow,this._week.doy).week}var xc={dow:0,doy:6};function Hs(){return this._week.dow}function wp(){return this._week.doy}function _p(f){var g=this.localeData().week(this);return f==null?g:this.add((f-g)*7,"d")}function ev(f){var g=Go(this,1,4).week;return f==null?g:this.add((f-g)*7,"d")}he("d",0,"do","day"),he("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),he("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),he("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),he("e",0,0,"weekday"),he("E",0,0,"isoWeekday"),me("d",Ee),me("e",Ee),me("E",Ee),me("dd",function(f,g){return g.weekdaysMinRegex(f)}),me("ddd",function(f,g){return g.weekdaysShortRegex(f)}),me("dddd",function(f,g){return g.weekdaysRegex(f)}),Bo(["dd","ddd","dddd"],function(f,g,w,C){var T=w._locale.weekdaysParse(f,C,w._strict);T!=null?g.d=T:q(w).invalidWeekday=f}),Bo(["d","e","E"],function(f,g,w,C){g[C]=Be(f)});function Rp(f,g){return typeof f!="string"?f:isNaN(f)?(f=g.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function xp(f,g){return typeof f=="string"?g.weekdaysParse(f)%7||7:isNaN(f)?null:f}function bl(f,g){return f.slice(g,7).concat(f.slice(0,g))}var Cp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ep="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tv="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),rv=Ho,qp=Ho,nv=Ho;function iv(f,g){var w=n(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(g)?"format":"standalone"];return f===!0?bl(w,this._week.dow):f?w[f.day()]:w}function sv(f){return f===!0?bl(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function ov(f){return f===!0?bl(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function Cc(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],C=0;C<7;++C)H=y([2e3,1]).day(C),this._minWeekdaysParse[C]=this.weekdaysMin(H,"").toLocaleLowerCase(),this._shortWeekdaysParse[C]=this.weekdaysShort(H,"").toLocaleLowerCase(),this._weekdaysParse[C]=this.weekdays(H,"").toLocaleLowerCase();return w?g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1?T:null):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null):(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null):g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1||(T=Ut.call(this._shortWeekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):(T=Ut.call(this._minWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null))}function av(f,g,w){var C,T,H;if(this._weekdaysParseExact)return Cc.call(this,f,g,w);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),C=0;C<7;C++){if(T=y([2e3,1]).day(C),w&&!this._fullWeekdaysParse[C]&&(this._fullWeekdaysParse[C]=new RegExp("^"+this.weekdays(T,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[C]=new RegExp("^"+this.weekdaysShort(T,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[C]=new RegExp("^"+this.weekdaysMin(T,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[C]||(H="^"+this.weekdays(T,"")+"|^"+this.weekdaysShort(T,"")+"|^"+this.weekdaysMin(T,""),this._weekdaysParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="dddd"&&this._fullWeekdaysParse[C].test(f))return C;if(w&&g==="ddd"&&this._shortWeekdaysParse[C].test(f))return C;if(w&&g==="dd"&&this._minWeekdaysParse[C].test(f))return C;if(!w&&this._weekdaysParse[C].test(f))return C}}function lv(f){if(!this.isValid())return f!=null?this:NaN;var g=Wo(this,"Day");return f!=null?(f=Rp(f,this.localeData()),this.add(f-g,"d")):g}function uv(f){if(!this.isValid())return f!=null?this:NaN;var g=(this.day()+7-this.localeData()._week.dow)%7;return f==null?g:this.add(f-g,"d")}function cv(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var g=xp(f,this.localeData());return this.day(this.day()%7?g:g-7)}else return this.day()||7}function fv(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ec.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=rv),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ot(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ec.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qp),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Et(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ec.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nv),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ec(){function f(tr,ni){return ni.length-tr.length}var g=[],w=[],C=[],T=[],H,K,de,qe,We;for(H=0;H<7;H++)K=y([2e3,1]).day(H),de=On(this.weekdaysMin(K,"")),qe=On(this.weekdaysShort(K,"")),We=On(this.weekdays(K,"")),g.push(de),w.push(qe),C.push(We),T.push(de),T.push(qe),T.push(We);g.sort(f),w.sort(f),C.sort(f),T.sort(f),this._weekdaysRegex=new RegExp("^("+T.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+C.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function qc(){return this.hours()%12||12}function dv(){return this.hours()||24}he("H",["HH",2],0,"hour"),he("h",["hh",2],0,qc),he("k",["kk",2],0,dv),he("hmm",0,0,function(){return""+qc.apply(this)+_e(this.minutes(),2)}),he("hmmss",0,0,function(){return""+qc.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),he("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),he("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function Ip(f,g){he(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),g)})}Ip("a",!0),Ip("A",!1);function Op(f,g){return g._meridiemParse}me("a",Op),me("A",Op),me("H",Ee,dl),me("h",Ee,ts),me("k",Ee,ts),me("HH",Ee,oe),me("hh",Ee,oe),me("kk",Ee,oe),me("hmm",In),me("hmmss",cl),me("Hmm",In),me("Hmmss",cl),ct(["H","HH"],Kt),ct(["k","kk"],function(f,g,w){var C=Be(f);g[Kt]=C===24?0:C}),ct(["a","A"],function(f,g,w){w._isPm=w._locale.isPM(f),w._meridiem=f}),ct(["h","hh"],function(f,g,w){g[Kt]=Be(f),q(w).bigHour=!0}),ct("hmm",function(f,g,w){var C=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C)),q(w).bigHour=!0}),ct("hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C,2)),g[Qn]=Be(f.substr(T)),q(w).bigHour=!0}),ct("Hmm",function(f,g,w){var C=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C))}),ct("Hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Be(f.substr(0,C)),g[Yr]=Be(f.substr(C,2)),g[Qn]=Be(f.substr(T))});function pv(f){return(f+"").toLowerCase().charAt(0)==="p"}var Pp=/[ap]\.?m?\.?/i,hv=Ls("Hours",!0);function er(f,g,w){return f>11?w?"pm":"PM":w?"am":"AM"}var Sl={calendar:fe,longDateFormat:wr,invalidDate:bt,ordinal:Ms,dayOfMonthOrdinalParse:At,relativeTime:qn,months:yp,monthsShort:bc,week:xc,weekdays:Cp,weekdaysMin:tv,weekdaysShort:Ep,meridiemParse:Pp},ft={},Bs={},ns;function Kr(f,g){var w,C=Math.min(f.length,g.length);for(w=0;w<C;w+=1)if(f[w]!==g[w])return w;return C}function Ic(f){return f&&f.toLowerCase().replace("_","-")}function kp(f){for(var g=0,w,C,T,H;g<f.length;){for(H=Ic(f[g]).split("-"),w=H.length,C=Ic(f[g+1]),C=C?C.split("-"):null;w>0;){if(T=Yo(H.slice(0,w).join("-")),T)return T;if(C&&C.length>=w&&Kr(H,C)>=w-1)break;w--}g++}return ns}function Ap(f){return!!(f&&f.match("^[^/\\\\]*$"))}function Yo(f){var g=null,w;if(ft[f]===void 0&&typeof ru<"u"&&ru&&ru.exports&&Ap(f))try{g=ns._abbr,w=wt,w("./locale/"+f),Zn(g)}catch{ft[f]=null}return ft[f]}function Zn(f,g){var w;return f&&(l(g)?w=Xn(f):w=wl(f,g),w?ns=w:typeof console<"u"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),ns._abbr}function wl(f,g){if(g!==null){var w,C=Sl;if(g.abbr=f,ft[f]!=null)F("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."),C=ft[f]._config;else if(g.parentLocale!=null)if(ft[g.parentLocale]!=null)C=ft[g.parentLocale]._config;else if(w=Yo(g.parentLocale),w!=null)C=w._config;else return Bs[g.parentLocale]||(Bs[g.parentLocale]=[]),Bs[g.parentLocale].push({name:f,config:g}),null;return ft[f]=new Q(J(C,g)),Bs[f]&&Bs[f].forEach(function(T){wl(T.name,T.config)}),Zn(f),ft[f]}else return delete ft[f],null}function $r(f,g){if(g!=null){var w,C,T=Sl;ft[f]!=null&&ft[f].parentLocale!=null?ft[f].set(J(ft[f]._config,g)):(C=Yo(f),C!=null&&(T=C._config),g=J(T,g),C==null&&(g.abbr=f),w=new Q(g),w.parentLocale=ft[f],ft[f]=w),Zn(f)}else ft[f]!=null&&(ft[f].parentLocale!=null?(ft[f]=ft[f].parentLocale,f===Zn()&&Zn(f)):ft[f]!=null&&delete ft[f]);return ft[f]}function Xn(f){var g;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return ns;if(!n(f)){if(g=Yo(f),g)return g;f=[f]}return kp(f)}function Nr(){return se(ft)}function Oc(f){var g,w=f._a;return w&&q(f).overflow===-2&&(g=w[Kn]<0||w[Kn]>11?Kn:w[Pn]<1||w[Pn]>vc(w[dr],w[Kn])?Pn:w[Kt]<0||w[Kt]>24||w[Kt]===24&&(w[Yr]!==0||w[Qn]!==0||w[rs]!==0)?Kt:w[Yr]<0||w[Yr]>59?Yr:w[Qn]<0||w[Qn]>59?Qn:w[rs]<0||w[rs]>999?rs:-1,q(f)._overflowDayOfYear&&(g<dr||g>Pn)&&(g=Pn),q(f)._overflowWeeks&&g===-1&&(g=mp),q(f)._overflowWeekday&&g===-1&&(g=Vy),q(f).overflow=g),f}var Tp=/^\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)?)?$/,Ai=/^\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)?)?$/,_l=/Z|[+-]\d\d(?::?\d\d)?/,Vs=[["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]],qt=[["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/]],Ti=/^\/?Date\((-?\d+)/i,Pc=/^(?:(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}))$/,mv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Rl(f){var g,w,C=f._i,T=Tp.exec(C)||Ai.exec(C),H,K,de,qe,We=Vs.length,tr=qt.length;if(T){for(q(f).iso=!0,g=0,w=We;g<w;g++)if(Vs[g][1].exec(T[1])){K=Vs[g][0],H=Vs[g][2]!==!1;break}if(K==null){f._isValid=!1;return}if(T[3]){for(g=0,w=tr;g<w;g++)if(qt[g][1].exec(T[3])){de=(T[2]||" ")+qt[g][0];break}if(de==null){f._isValid=!1;return}}if(!H&&de!=null){f._isValid=!1;return}if(T[4])if(_l.exec(T[4]))qe="Z";else{f._isValid=!1;return}f._f=K+(de||"")+(qe||""),Cl(f)}else f._isValid=!1}function gv(f,g,w,C,T,H){var K=[yv(f),bc.indexOf(g),parseInt(w,10),parseInt(C,10),parseInt(T,10)];return H&&K.push(parseInt(H,10)),K}function yv(f){var g=parseInt(f,10);return g<=49?2e3+g:g<=999?1900+g:g}function vv(f){return f.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function $p(f,g,w){if(f){var C=Ep.indexOf(f),T=new Date(g[0],g[1],g[2]).getDay();if(C!==T)return q(w).weekdayMismatch=!0,w._isValid=!1,!1}return!0}function xl(f,g,w){if(f)return mv[f];if(g)return 0;var C=parseInt(w,10),T=C%100,H=(C-T)/100;return H*60+T}function is(f){var g=Pc.exec(vv(f._i)),w;if(g){if(w=gv(g[4],g[3],g[2],g[5],g[6],g[7]),!$p(g[1],w,f))return;f._a=w,f._tzm=xl(g[8],g[9],g[10]),f._d=Us.apply(null,f._a),f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),q(f).rfc2822=!0}else f._isValid=!1}function bv(f){var g=Ti.exec(f._i);if(g!==null){f._d=new Date(+g[1]);return}if(Rl(f),f._isValid===!1)delete f._isValid;else return;if(is(f),f._isValid===!1)delete f._isValid;else return;f._strict?f._isValid=!1:e.createFromInputFallback(f)}e.createFromInputFallback=_("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(f){f._d=new Date(f._i+(f._useUTC?" UTC":""))});function ss(f,g,w){return f??g??w}function Np(f){var g=new Date(e.now());return f._useUTC?[g.getUTCFullYear(),g.getUTCMonth(),g.getUTCDate()]:[g.getFullYear(),g.getMonth(),g.getDate()]}function Ko(f){var g,w,C=[],T,H,K;if(!f._d){for(T=Np(f),f._w&&f._a[Pn]==null&&f._a[Kn]==null&&kc(f),f._dayOfYear!=null&&(K=ss(f._a[dr],T[dr]),(f._dayOfYear>Vo(K)||f._dayOfYear===0)&&(q(f)._overflowDayOfYear=!0),w=Us(K,0,f._dayOfYear),f._a[Kn]=w.getUTCMonth(),f._a[Pn]=w.getUTCDate()),g=0;g<3&&f._a[g]==null;++g)f._a[g]=C[g]=T[g];for(;g<7;g++)f._a[g]=C[g]=f._a[g]==null?g===2?1:0:f._a[g];f._a[Kt]===24&&f._a[Yr]===0&&f._a[Qn]===0&&f._a[rs]===0&&(f._nextDay=!0,f._a[Kt]=0),f._d=(f._useUTC?Us:Xy).apply(null,C),H=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Kt]=24),f._w&&typeof f._w.d<"u"&&f._w.d!==H&&(q(f).weekdayMismatch=!0)}}function kc(f){var g,w,C,T,H,K,de,qe,We;g=f._w,g.GG!=null||g.W!=null||g.E!=null?(H=1,K=4,w=ss(g.GG,f._a[dr],Go(gt(),1,4).year),C=ss(g.W,1),T=ss(g.E,1),(T<1||T>7)&&(qe=!0)):(H=f._locale._week.dow,K=f._locale._week.doy,We=Go(gt(),H,K),w=ss(g.gg,f._a[dr],We.year),C=ss(g.w,We.week),g.d!=null?(T=g.d,(T<0||T>6)&&(qe=!0)):g.e!=null?(T=g.e+H,(g.e<0||g.e>6)&&(qe=!0)):T=H),C<1||C>kn(w,H,K)?q(f)._overflowWeeks=!0:qe!=null?q(f)._overflowWeekday=!0:(de=vl(w,C,T,H,K),f._a[dr]=de.year,f._dayOfYear=de.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Cl(f){if(f._f===e.ISO_8601){Rl(f);return}if(f._f===e.RFC_2822){is(f);return}f._a=[],q(f).empty=!0;var g=""+f._i,w,C,T,H,K,de=g.length,qe=0,We,tr;for(T=Tr(f._f,f._locale).match(ye)||[],tr=T.length,w=0;w<tr;w++)H=T[w],C=(g.match(Hy(H,f))||[])[0],C&&(K=g.substr(0,g.indexOf(C)),K.length>0&&q(f).unusedInput.push(K),g=g.slice(g.indexOf(C)+C.length),qe+=C.length),Nt[H]?(C?q(f).empty=!1:q(f).unusedTokens.push(H),yc(H,C,f)):f._strict&&!C&&q(f).unusedTokens.push(H);q(f).charsLeftOver=de-qe,g.length>0&&q(f).unusedInput.push(g),f._a[Kt]<=12&&q(f).bigHour===!0&&f._a[Kt]>0&&(q(f).bigHour=void 0),q(f).parsedDateParts=f._a.slice(0),q(f).meridiem=f._meridiem,f._a[Kt]=Sv(f._locale,f._a[Kt],f._meridiem),We=q(f).era,We!==null&&(f._a[dr]=f._locale.erasConvertYear(We,f._a[dr])),Ko(f),Oc(f)}function Sv(f,g,w){var C;return w==null?g:f.meridiemHour!=null?f.meridiemHour(g,w):(f.isPM!=null&&(C=f.isPM(w),C&&g<12&&(g+=12),!C&&g===12&&(g=0)),g)}function Ac(f){var g,w,C,T,H,K,de=!1,qe=f._f.length;if(qe===0){q(f).invalidFormat=!0,f._d=new Date(NaN);return}for(T=0;T<qe;T++)H=0,K=!1,g=P({},f),f._useUTC!=null&&(g._useUTC=f._useUTC),g._f=f._f[T],Cl(g),v(g)&&(K=!0),H+=q(g).charsLeftOver,H+=q(g).unusedTokens.length*10,q(g).score=H,de?H<C&&(C=H,w=g):(C==null||H<C||K)&&(C=H,w=g,K&&(de=!0));m(f,w||g)}function Tc(f){if(!f._d){var g=Se(f._i),w=g.day===void 0?g.date:g.day;f._a=p([g.year,g.month,w,g.hour,g.minute,g.second,g.millisecond],function(C){return C&&parseInt(C,10)}),Ko(f)}}function wv(f){var g=new M(Oc($c(f)));return g._nextDay&&(g.add(1,"d"),g._nextDay=void 0),g}function $c(f){var g=f._i,w=f._f;return f._locale=f._locale||Xn(f._l),g===null||w===void 0&&g===""?R({nullInput:!0}):(typeof g=="string"&&(f._i=g=f._locale.preparse(g)),j(g)?new M(Oc(g)):(d(g)?f._d=g:n(w)?Ac(f):w?Cl(f):Mr(f),v(f)||(f._d=null),f))}function Mr(f){var g=f._i;l(g)?f._d=new Date(e.now()):d(g)?f._d=new Date(g.valueOf()):typeof g=="string"?bv(f):n(g)?(f._a=p(g.slice(0),function(w){return parseInt(w,10)}),Ko(f)):i(g)?Tc(f):c(g)?f._d=new Date(g):e.createFromInputFallback(f)}function El(f,g,w,C,T){var H={};return(g===!0||g===!1)&&(C=g,g=void 0),(w===!0||w===!1)&&(C=w,w=void 0),(i(f)&&o(f)||n(f)&&f.length===0)&&(f=void 0),H._isAMomentObject=!0,H._useUTC=H._isUTC=T,H._l=w,H._i=f,H._f=g,H._strict=C,wv(H)}function gt(f,g,w,C){return El(f,g,w,C,!1)}var Mp=_("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=gt.apply(null,arguments);return this.isValid()&&f.isValid()?f<this?this:f:R()}),Fp=_("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=gt.apply(null,arguments);return this.isValid()&&f.isValid()?f>this?this:f:R()});function Dp(f,g){var w,C;if(g.length===1&&n(g[0])&&(g=g[0]),!g.length)return gt();for(w=g[0],C=1;C<g.length;++C)(!g[C].isValid()||g[C][f](w))&&(w=g[C]);return w}function _v(){var f=[].slice.call(arguments,0);return Dp("isBefore",f)}function Rv(){var f=[].slice.call(arguments,0);return Dp("isAfter",f)}var xv=function(){return Date.now?Date.now():+new Date},Qo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ws(f){var g,w=!1,C,T=Qo.length;for(g in f)if(s(f,g)&&!(Ut.call(Qo,g)!==-1&&(f[g]==null||!isNaN(f[g]))))return!1;for(C=0;C<T;++C)if(f[Qo[C]]){if(w)return!1;parseFloat(f[Qo[C]])!==Be(f[Qo[C]])&&(w=!0)}return!0}function Cv(){return this._isValid}function Ev(){return yt(NaN)}function zs(f){var g=Se(f),w=g.year||0,C=g.quarter||0,T=g.month||0,H=g.week||g.isoWeek||0,K=g.day||0,de=g.hour||0,qe=g.minute||0,We=g.second||0,tr=g.millisecond||0;this._isValid=Ws(g),this._milliseconds=+tr+We*1e3+qe*6e4+de*1e3*60*60,this._days=+K+H*7,this._months=+T+C*3+w*12,this._data={},this._locale=Xn(),this._bubble()}function Zo(f){return f instanceof zs}function An(f){return f<0?Math.round(-1*f)*-1:Math.round(f)}function ql(f,g,w){var C=Math.min(f.length,g.length),T=Math.abs(f.length-g.length),H=0,K;for(K=0;K<C;K++)(w&&f[K]!==g[K]||!w&&Be(f[K])!==Be(g[K]))&&H++;return H+T}function jp(f,g){he(f,0,0,function(){var w=this.utcOffset(),C="+";return w<0&&(w=-w,C="-"),C+_e(~~(w/60),2)+g+_e(~~w%60,2)})}jp("Z",":"),jp("ZZ",""),me("Z",fl),me("ZZ",fl),ct(["Z","ZZ"],function(f,g,w){w._useUTC=!0,w._tzm=Nc(fl,f)});var qv=/([\+\-]|\d\d)/gi;function Nc(f,g){var w=(g||"").match(f),C,T,H;return w===null?null:(C=w[w.length-1]||[],T=(C+"").match(qv)||["-",0,0],H=+(T[1]*60)+Be(T[2]),H===0?0:T[0]==="+"?H:-H)}function $i(f,g){var w,C;return g._isUTC?(w=g.clone(),C=(j(f)||d(f)?f.valueOf():gt(f).valueOf())-w.valueOf(),w._d.setTime(w._d.valueOf()+C),e.updateOffset(w,!1),w):gt(f).local()}function Fr(f){return-Math.round(f._d.getTimezoneOffset())}e.updateOffset=function(){};function Lp(f,g,w){var C=this._offset||0,T;if(!this.isValid())return f!=null?this:NaN;if(f!=null){if(typeof f=="string"){if(f=Nc(fl,f),f===null)return this}else Math.abs(f)<16&&!w&&(f=f*60);return!this._isUTC&&g&&(T=Fr(this)),this._offset=f,this._isUTC=!0,T!=null&&this.add(T,"m"),C!==f&&(!g||this._changeInProgress?Xo(this,yt(f-C,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?C:Fr(this)}function Iv(f,g){return f!=null?(typeof f!="string"&&(f=-f),this.utcOffset(f,g),this):-this.utcOffset()}function Ov(f){return this.utcOffset(0,f)}function Pv(f){return this._isUTC&&(this.utcOffset(0,f),this._isUTC=!1,f&&this.subtract(Fr(this),"m")),this}function kv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var f=Nc(mc,this._i);f!=null?this.utcOffset(f):this.utcOffset(0,!0)}return this}function Av(f){return this.isValid()?(f=f?gt(f).utcOffset():0,(this.utcOffset()-f)%60===0):!1}function Ni(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function W(){if(!l(this._isDSTShifted))return this._isDSTShifted;var f={},g;return P(f,this),f=$c(f),f._a?(g=f._isUTC?y(f._a):gt(f._a),this._isDSTShifted=this.isValid()&&ql(f._a,g.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Z(){return this.isValid()?!this._isUTC:!1}function Y(){return this.isValid()?this._isUTC:!1}function pe(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ie=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,lt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function yt(f,g){var w=f,C=null,T,H,K;return Zo(f)?w={ms:f._milliseconds,d:f._days,M:f._months}:c(f)||!isNaN(+f)?(w={},g?w[g]=+f:w.milliseconds=+f):(C=Ie.exec(f))?(T=C[1]==="-"?-1:1,w={y:0,d:Be(C[Pn])*T,h:Be(C[Kt])*T,m:Be(C[Yr])*T,s:Be(C[Qn])*T,ms:Be(An(C[rs]*1e3))*T}):(C=lt.exec(f))?(T=C[1]==="-"?-1:1,w={y:Ze(C[2],T),M:Ze(C[3],T),w:Ze(C[4],T),d:Ze(C[5],T),h:Ze(C[6],T),m:Ze(C[7],T),s:Ze(C[8],T)}):w==null?w={}:typeof w=="object"&&("from"in w||"to"in w)&&(K=Tv(gt(w.from),gt(w.to)),w={},w.ms=K.milliseconds,w.M=K.months),H=new zs(w),Zo(f)&&s(f,"_locale")&&(H._locale=f._locale),Zo(f)&&s(f,"_isValid")&&(H._isValid=f._isValid),H}yt.fn=zs.prototype,yt.invalid=Ev;function Ze(f,g){var w=f&&parseFloat(f.replace(",","."));return(isNaN(w)?0:w)*g}function Il(f,g){var w={};return w.months=g.month()-f.month()+(g.year()-f.year())*12,f.clone().add(w.months,"M").isAfter(g)&&--w.months,w.milliseconds=+g-+f.clone().add(w.months,"M"),w}function Tv(f,g){var w;return f.isValid()&&g.isValid()?(g=$i(g,f),f.isBefore(g)?w=Il(f,g):(w=Il(g,f),w.milliseconds=-w.milliseconds,w.months=-w.months),w):{milliseconds:0,months:0}}function Dr(f,g){return function(w,C){var T,H;return C!==null&&!isNaN(+C)&&(F(g,"moment()."+g+"(period, number) is deprecated. Please use moment()."+g+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),H=w,w=C,C=H),T=yt(w,C),Xo(this,T,f),this}}function Xo(f,g,w,C){var T=g._milliseconds,H=An(g._days),K=An(g._months);f.isValid()&&(C=C??!0,K&&wc(f,Wo(f,"Month")+K*w),H&&zo(f,"Date",Wo(f,"Date")+H*w),T&&f._d.setTime(f._d.valueOf()+T*w),C&&e.updateOffset(f,H||K))}var $v=Dr(1,"add"),Js=Dr(-1,"subtract");function ea(f){return typeof f=="string"||f instanceof String}function Ol(f){return j(f)||d(f)||ea(f)||c(f)||Nv(f)||dt(f)||f===null||f===void 0}function dt(f){var g=i(f)&&!o(f),w=!1,C=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],T,H,K=C.length;for(T=0;T<K;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Nv(f){var g=n(f),w=!1;return g&&(w=f.filter(function(C){return!c(C)&&ea(f)}).length===0),g&&w}function Up(f){var g=i(f)&&!o(f),w=!1,C=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],T,H;for(T=0;T<C.length;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Pl(f,g){var w=f.diff(g,"days",!0);return w<-6?"sameElse":w<-1?"lastWeek":w<0?"lastDay":w<1?"sameDay":w<2?"nextDay":w<7?"nextWeek":"sameElse"}function Mv(f,g){arguments.length===1&&(arguments[0]?Ol(arguments[0])?(f=arguments[0],g=void 0):Up(arguments[0])&&(g=arguments[0],f=void 0):(f=void 0,g=void 0));var w=f||gt(),C=$i(w,this).startOf("day"),T=e.calendarFormat(this,C)||"sameElse",H=g&&(U(g[T])?g[T].call(this,w):g[T]);return this.format(H||this.localeData().calendar(T,this,gt(w)))}function Fv(){return new M(this)}function Dv(f,g){var w=j(f)?f:gt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()>w.valueOf():w.valueOf()<this.clone().startOf(g).valueOf()):!1}function kl(f,g){var w=j(f)?f:gt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()<w.valueOf():this.clone().endOf(g).valueOf()<w.valueOf()):!1}function Mi(f,g,w,C){var T=j(f)?f:gt(f),H=j(g)?g:gt(g);return this.isValid()&&T.isValid()&&H.isValid()?(C=C||"()",(C[0]==="("?this.isAfter(T,w):!this.isBefore(T,w))&&(C[1]===")"?this.isBefore(H,w):!this.isAfter(H,w))):!1}function Al(f,g){var w=j(f)?f:gt(f),C;return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()===w.valueOf():(C=w.valueOf(),this.clone().startOf(g).valueOf()<=C&&C<=this.clone().endOf(g).valueOf())):!1}function Hp(f,g){return this.isSame(f,g)||this.isAfter(f,g)}function Tl(f,g){return this.isSame(f,g)||this.isBefore(f,g)}function Bp(f,g,w){var C,T,H;if(!this.isValid())return NaN;if(C=$i(f,this),!C.isValid())return NaN;switch(T=(C.utcOffset()-this.utcOffset())*6e4,g=ge(g),g){case"year":H=ta(this,C)/12;break;case"month":H=ta(this,C);break;case"quarter":H=ta(this,C)/3;break;case"second":H=(this-C)/1e3;break;case"minute":H=(this-C)/6e4;break;case"hour":H=(this-C)/36e5;break;case"day":H=(this-C-T)/864e5;break;case"week":H=(this-C-T)/6048e5;break;default:H=this-C}return w?H:Gr(H)}function ta(f,g){if(f.date()<g.date())return-ta(g,f);var w=(g.year()-f.year())*12+(g.month()-f.month()),C=f.clone().add(w,"months"),T,H;return g-C<0?(T=f.clone().add(w-1,"months"),H=(g-C)/(C-T)):(T=f.clone().add(w+1,"months"),H=(g-C)/(T-C)),-(w+H)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function $l(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Vp(f){if(!this.isValid())return null;var g=f!==!0,w=g?this.clone().utc():this;return w.year()<0||w.year()>9999?at(w,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):U(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",at(w,"Z")):at(w,g?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ra(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",g="",w,C,T,H;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",g="Z"),w="["+f+'("]',C=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",T="-MM-DD[T]HH:mm:ss.SSS",H=g+'[")]',this.format(w+C+T+H)}function os(f){f||(f=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var g=at(this,f);return this.localeData().postformat(g)}function Nl(f,g){return this.isValid()&&(j(f)&&f.isValid()||gt(f).isValid())?yt({to:this,from:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function jv(f){return this.from(gt(),f)}function Lv(f,g){return this.isValid()&&(j(f)&&f.isValid()||gt(f).isValid())?yt({from:this,to:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function Uv(f){return this.to(gt(),f)}function na(f){var g;return f===void 0?this._locale._abbr:(g=Xn(f),g!=null&&(this._locale=g),this)}var ia=_("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function Ml(){return this._locale}var Fl=1e3,as=60*Fl,Dl=60*as,Wp=(365*400+97)*24*Dl;function Tt(f,g){return(f%g+g)%g}function or(f,g,w){return f<100&&f>=0?new Date(f+400,g,w)-Wp:new Date(f,g,w).valueOf()}function zp(f,g,w){return f<100&&f>=0?Date.UTC(f+400,g,w)-Wp:Date.UTC(f,g,w)}function Hv(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?zp:or,f){case"year":g=w(this.year(),0,1);break;case"quarter":g=w(this.year(),this.month()-this.month()%3,1);break;case"month":g=w(this.year(),this.month(),1);break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":g=w(this.year(),this.month(),this.date());break;case"hour":g=this._d.valueOf(),g-=Tt(g+(this._isUTC?0:this.utcOffset()*as),Dl);break;case"minute":g=this._d.valueOf(),g-=Tt(g,as);break;case"second":g=this._d.valueOf(),g-=Tt(g,Fl);break}return this._d.setTime(g),e.updateOffset(this,!0),this}function Jp(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?zp:or,f){case"year":g=w(this.year()+1,0,1)-1;break;case"quarter":g=w(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":g=w(this.year(),this.month()+1,1)-1;break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":g=w(this.year(),this.month(),this.date()+1)-1;break;case"hour":g=this._d.valueOf(),g+=Dl-Tt(g+(this._isUTC?0:this.utcOffset()*as),Dl)-1;break;case"minute":g=this._d.valueOf(),g+=as-Tt(g,as)-1;break;case"second":g=this._d.valueOf(),g+=Fl-Tt(g,Fl)-1;break}return this._d.setTime(g),e.updateOffset(this,!0),this}function Bv(){return this._d.valueOf()-(this._offset||0)*6e4}function Mc(){return Math.floor(this.valueOf()/1e3)}function sa(){return new Date(this.valueOf())}function Fc(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function Gs(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function oa(){return this.isValid()?this.toISOString():null}function aa(){return v(this)}function jl(){return m({},q(this))}function Ys(){return q(this).overflow}function Vv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}he("N",0,0,"eraAbbr"),he("NN",0,0,"eraAbbr"),he("NNN",0,0,"eraAbbr"),he("NNNN",0,0,"eraName"),he("NNNNN",0,0,"eraNarrow"),he("y",["y",1],"yo","eraYear"),he("y",["yy",2],0,"eraYear"),he("y",["yyy",3],0,"eraYear"),he("y",["yyyy",4],0,"eraYear"),me("N",_r),me("NN",_r),me("NNN",_r),me("NNNN",Ve),me("NNNNN",Yv),ct(["N","NN","NNN","NNNN","NNNNN"],function(f,g,w,C){var T=w._locale.erasParse(f,C,w._strict);T?q(w).era=T:q(w).invalidEra=f}),me("y",ki),me("yy",ki),me("yyy",ki),me("yyyy",ki),me("yo",Kv),ct(["y","yy","yyy","yyyy"],dr),ct(["yo"],function(f,g,w,C){var T;w._locale._eraYearOrdinalRegex&&(T=f.match(w._locale._eraYearOrdinalRegex)),w._locale.eraYearOrdinalParse?g[dr]=w._locale.eraYearOrdinalParse(f,T):g[dr]=parseInt(f,10)});function Wv(f,g){var w,C,T,H=this._eras||Xn("en")._eras;for(w=0,C=H.length;w<C;++w)switch(typeof H[w].since==="string"&&(T=e(H[w].since).startOf("day"),H[w].since=T.valueOf()),typeof H[w].until){case"undefined":H[w].until=1/0;break;case"string":T=e(H[w].until).startOf("day").valueOf(),H[w].until=T.valueOf();break}return H}function zv(f,g,w){var C,T,H=this.eras(),K,de,qe;for(f=f.toUpperCase(),C=0,T=H.length;C<T;++C)if(K=H[C].name.toUpperCase(),de=H[C].abbr.toUpperCase(),qe=H[C].narrow.toUpperCase(),w)switch(g){case"N":case"NN":case"NNN":if(de===f)return H[C];break;case"NNNN":if(K===f)return H[C];break;case"NNNNN":if(qe===f)return H[C];break}else if([K,de,qe].indexOf(f)>=0)return H[C]}function Jv(f,g){var w=f.since<=f.until?1:-1;return g===void 0?e(f.since).year():e(f.since).year()+(g-f.offset)*w}function Gv(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].name;return""}function Ll(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].narrow;return""}function la(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].abbr;return""}function Gp(){var f,g,w,C,T=this.localeData().eras();for(f=0,g=T.length;f<g;++f)if(w=T[f].since<=T[f].until?1:-1,C=this.clone().startOf("day").valueOf(),T[f].since<=C&&C<=T[f].until||T[f].until<=C&&C<=T[f].since)return(this.year()-e(T[f].since).year())*w+T[f].offset;return this.year()}function $(f){return s(this,"_erasNameRegex")||Dc.call(this),f?this._erasNameRegex:this._erasRegex}function Ks(f){return s(this,"_erasAbbrRegex")||Dc.call(this),f?this._erasAbbrRegex:this._erasRegex}function Ul(f){return s(this,"_erasNarrowRegex")||Dc.call(this),f?this._erasNarrowRegex:this._erasRegex}function _r(f,g){return g.erasAbbrRegex(f)}function Ve(f,g){return g.erasNameRegex(f)}function Yv(f,g){return g.erasNarrowRegex(f)}function Kv(f,g){return g._eraYearOrdinalRegex||ki}function Dc(){var f=[],g=[],w=[],C=[],T,H,K,de,qe,We=this.eras();for(T=0,H=We.length;T<H;++T)K=On(We[T].name),de=On(We[T].abbr),qe=On(We[T].narrow),g.push(K),f.push(de),w.push(qe),C.push(K),C.push(de),C.push(qe);this._erasRegex=new RegExp("^("+C.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+g.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+f.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+w.join("|")+")","i")}he(0,["gg",2],0,function(){return this.weekYear()%100}),he(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Tn(f,g){he(0,[f,f.length],0,g)}Tn("gggg","weekYear"),Tn("ggggg","weekYear"),Tn("GGGG","isoWeekYear"),Tn("GGGGG","isoWeekYear"),me("G",js),me("g",js),me("GG",Ee,oe),me("gg",Ee,oe),me("GGGG",Uo,Lt),me("gggg",Uo,Lt),me("GGGGG",Ds,mt),me("ggggg",Ds,mt),Bo(["gggg","ggggg","GGGG","GGGGG"],function(f,g,w,C){g[C.substr(0,2)]=Be(f)}),Bo(["gg","GG"],function(f,g,w,C){g[C]=e.parseTwoDigitYear(f)});function Qv(f){return Yp.call(this,f,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Zv(f){return Yp.call(this,f,this.isoWeek(),this.isoWeekday(),1,4)}function Xv(){return kn(this.year(),1,4)}function eb(){return kn(this.isoWeekYear(),1,4)}function tb(){var f=this.localeData()._week;return kn(this.year(),f.dow,f.doy)}function ei(){var f=this.localeData()._week;return kn(this.weekYear(),f.dow,f.doy)}function Yp(f,g,w,C,T){var H;return f==null?Go(this,C,T).year:(H=kn(f,C,T),g>H&&(g=H),rb.call(this,f,g,w,C,T))}function rb(f,g,w,C,T){var H=vl(f,g,w,C,T),K=Us(H.year,0,H.dayOfYear);return this.year(K.getUTCFullYear()),this.month(K.getUTCMonth()),this.date(K.getUTCDate()),this}he("Q",0,"Qo","quarter"),me("Q",sr),ct("Q",function(f,g){g[Kn]=(Be(f)-1)*3});function nb(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}he("D",["DD",2],"Do","date"),me("D",Ee,ts),me("DD",Ee,oe),me("Do",function(f,g){return f?g._dayOfMonthOrdinalParse||g._ordinalParse:g._dayOfMonthOrdinalParseLenient}),ct(["D","DD"],Pn),ct("Do",function(f,g){g[Pn]=Be(f.match(Ee)[0])});var Kp=Ls("Date",!0);he("DDD",["DDDD",3],"DDDo","dayOfYear"),me("DDD",Fs),me("DDDD",fr),ct(["DDD","DDDD"],function(f,g,w){w._dayOfYear=Be(f)});function ib(f){var g=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?g:this.add(f-g,"d")}he("m",["mm",2],0,"minute"),me("m",Ee,dl),me("mm",Ee,oe),ct(["m","mm"],Yr);var ti=Ls("Minutes",!1);he("s",["ss",2],0,"second"),me("s",Ee,dl),me("ss",Ee,oe),ct(["s","ss"],Qn);var sb=Ls("Seconds",!1);he("S",0,0,function(){return~~(this.millisecond()/100)}),he(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),he(0,["SSS",3],0,"millisecond"),he(0,["SSSS",4],0,function(){return this.millisecond()*10}),he(0,["SSSSS",5],0,function(){return this.millisecond()*100}),he(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),he(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),he(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),he(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),me("S",Fs,sr),me("SS",Fs,oe),me("SSS",Fs,fr);var Fi,Qp;for(Fi="SSSS";Fi.length<=9;Fi+="S")me(Fi,ki);function ob(f,g){g[rs]=Be(("0."+f)*1e3)}for(Fi="S";Fi.length<=9;Fi+="S")ct(Fi,ob);Qp=Ls("Milliseconds",!1),he("z",0,0,"zoneAbbr"),he("zz",0,0,"zoneName");function ab(){return this._isUTC?"UTC":""}function ls(){return this._isUTC?"Coordinated Universal Time":""}var ie=M.prototype;ie.add=$v,ie.calendar=Mv,ie.clone=Fv,ie.diff=Bp,ie.endOf=Jp,ie.format=os,ie.from=Nl,ie.fromNow=jv,ie.to=Lv,ie.toNow=Uv,ie.get=zy,ie.invalidAt=Ys,ie.isAfter=Dv,ie.isBefore=kl,ie.isBetween=Mi,ie.isSame=Al,ie.isSameOrAfter=Hp,ie.isSameOrBefore=Tl,ie.isValid=aa,ie.lang=ia,ie.locale=na,ie.localeData=Ml,ie.max=Fp,ie.min=Mp,ie.parsingFlags=jl,ie.set=ml,ie.startOf=Hv,ie.subtract=Js,ie.toArray=Fc,ie.toObject=Gs,ie.toDate=sa,ie.toISOString=Vp,ie.inspect=ra,typeof Symbol<"u"&&Symbol.for!=null&&(ie[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ie.toJSON=oa,ie.toString=$l,ie.unix=Mc,ie.valueOf=Bv,ie.creationData=Vv,ie.eraName=Gv,ie.eraNarrow=Ll,ie.eraAbbr=la,ie.eraYear=Gp,ie.year=gp,ie.isLeapYear=Wy,ie.weekYear=Qv,ie.isoWeekYear=Zv,ie.quarter=ie.quarters=nb,ie.month=gl,ie.daysInMonth=Zy,ie.week=ie.weeks=_p,ie.isoWeek=ie.isoWeeks=ev,ie.weeksInYear=tb,ie.weeksInWeekYear=ei,ie.isoWeeksInYear=Xv,ie.isoWeeksInISOWeekYear=eb,ie.date=Kp,ie.day=ie.days=lv,ie.weekday=uv,ie.isoWeekday=cv,ie.dayOfYear=ib,ie.hour=ie.hours=hv,ie.minute=ie.minutes=ti,ie.second=ie.seconds=sb,ie.millisecond=ie.milliseconds=Qp,ie.utcOffset=Lp,ie.utc=Ov,ie.local=Pv,ie.parseZone=kv,ie.hasAlignedHourOffset=Av,ie.isDST=Ni,ie.isLocal=Z,ie.isUtcOffset=Y,ie.isUtc=pe,ie.isUTC=pe,ie.zoneAbbr=ab,ie.zoneName=ls,ie.dates=_("dates accessor is deprecated. Use date instead.",Kp),ie.months=_("months accessor is deprecated. Use month instead",gl),ie.years=_("years accessor is deprecated. Use year instead",gp),ie.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Iv),ie.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",W);function lb(f){return gt(f*1e3)}function pn(){return gt.apply(null,arguments).parseZone()}function Zp(f){return f}var tt=Q.prototype;tt.calendar=He,tt.longDateFormat=Rt,tt.invalidDate=Jr,tt.ordinal=Pi,tt.preparse=Zp,tt.postformat=Zp,tt.relativeTime=te,tt.pastFuture=re,tt.set=D,tt.eras=Wv,tt.erasParse=zv,tt.erasConvertYear=Jv,tt.erasAbbrRegex=Ks,tt.erasNameRegex=$,tt.erasNarrowRegex=Ul,tt.months=Ky,tt.monthsShort=Qy,tt.monthsParse=bp,tt.monthsRegex=yl,tt.monthsShortRegex=Sp,tt.week=Rc,tt.firstDayOfYear=wp,tt.firstDayOfWeek=Hs,tt.weekdays=iv,tt.weekdaysMin=ov,tt.weekdaysShort=sv,tt.weekdaysParse=av,tt.weekdaysRegex=fv,tt.weekdaysShortRegex=Ot,tt.weekdaysMinRegex=Et,tt.isPM=pv,tt.meridiem=er;function Hl(f,g,w,C){var T=Xn(),H=y().set(C,g);return T[w](H,f)}function Xp(f,g,w){if(c(f)&&(g=f,f=void 0),f=f||"",g!=null)return Hl(f,g,w,"month");var C,T=[];for(C=0;C<12;C++)T[C]=Hl(f,C,w,"month");return T}function jc(f,g,w,C){typeof f=="boolean"?(c(g)&&(w=g,g=void 0),g=g||""):(g=f,w=g,f=!1,c(g)&&(w=g,g=void 0),g=g||"");var T=Xn(),H=f?T._week.dow:0,K,de=[];if(w!=null)return Hl(g,(w+H)%7,C,"day");for(K=0;K<7;K++)de[K]=Hl(g,(K+H)%7,C,"day");return de}function eh(f,g){return Xp(f,g,"months")}function th(f,g){return Xp(f,g,"monthsShort")}function ub(f,g,w){return jc(f,g,w,"weekdays")}function cb(f,g,w){return jc(f,g,w,"weekdaysShort")}function Lc(f,g,w){return jc(f,g,w,"weekdaysMin")}Zn("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(f){var g=f%10,w=Be(f%100/10)===1?"th":g===1?"st":g===2?"nd":g===3?"rd":"th";return f+w}}),e.lang=_("moment.lang is deprecated. Use moment.locale instead.",Zn),e.langData=_("moment.langData is deprecated. Use moment.localeData instead.",Xn);var jr=Math.abs;function Bl(){var f=this._data;return this._milliseconds=jr(this._milliseconds),this._days=jr(this._days),this._months=jr(this._months),f.milliseconds=jr(f.milliseconds),f.seconds=jr(f.seconds),f.minutes=jr(f.minutes),f.hours=jr(f.hours),f.months=jr(f.months),f.years=jr(f.years),this}function rh(f,g,w,C){var T=yt(g,w);return f._milliseconds+=C*T._milliseconds,f._days+=C*T._days,f._months+=C*T._months,f._bubble()}function nh(f,g){return rh(this,f,g,1)}function fb(f,g){return rh(this,f,g,-1)}function hn(f){return f<0?Math.floor(f):Math.ceil(f)}function Uc(){var f=this._milliseconds,g=this._days,w=this._months,C=this._data,T,H,K,de,qe;return f>=0&&g>=0&&w>=0||f<=0&&g<=0&&w<=0||(f+=hn(Rr(w)+g)*864e5,g=0,w=0),C.milliseconds=f%1e3,T=Gr(f/1e3),C.seconds=T%60,H=Gr(T/60),C.minutes=H%60,K=Gr(H/60),C.hours=K%24,g+=Gr(K/24),qe=Gr(Di(g)),w+=qe,g-=hn(Rr(qe)),de=Gr(w/12),w%=12,C.days=g,C.months=w,C.years=de,this}function Di(f){return f*4800/146097}function Rr(f){return f*146097/4800}function db(f){if(!this.isValid())return NaN;var g,w,C=this._milliseconds;if(f=ge(f),f==="month"||f==="quarter"||f==="year")switch(g=this._days+C/864e5,w=this._months+Di(g),f){case"month":return w;case"quarter":return w/3;case"year":return w/12}else switch(g=this._days+Math.round(Rr(this._months)),f){case"week":return g/7+C/6048e5;case"day":return g+C/864e5;case"hour":return g*24+C/36e5;case"minute":return g*1440+C/6e4;case"second":return g*86400+C/1e3;case"millisecond":return Math.floor(g*864e5)+C;default:throw new Error("Unknown unit "+f)}}function $n(f){return function(){return this.as(f)}}var Hc=$n("ms"),ua=$n("s"),ji=$n("m"),ih=$n("h"),pb=$n("d"),Vl=$n("w"),hb=$n("M"),sh=$n("Q"),ar=$n("y"),Bc=Hc;function oh(){return yt(this)}function Nn(f){return f=ge(f),this.isValid()?this[f+"s"]():NaN}function ri(f){return function(){return this.isValid()?this._data[f]:NaN}}var Wl=ri("milliseconds"),us=ri("seconds"),ah=ri("minutes"),hr=ri("hours"),Vc=ri("days"),mb=ri("months"),gb=ri("years");function yb(){return Gr(this.days()/7)}var mn=Math.round,Qs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ca(f,g,w,C,T){return T.relativeTime(g||1,!!w,f,C)}function lh(f,g,w,C){var T=yt(f).abs(),H=mn(T.as("s")),K=mn(T.as("m")),de=mn(T.as("h")),qe=mn(T.as("d")),We=mn(T.as("M")),tr=mn(T.as("w")),ni=mn(T.as("y")),ii=H<=w.ss&&["s",H]||H<w.s&&["ss",H]||K<=1&&["m"]||K<w.m&&["mm",K]||de<=1&&["h"]||de<w.h&&["hh",de]||qe<=1&&["d"]||qe<w.d&&["dd",qe];return w.w!=null&&(ii=ii||tr<=1&&["w"]||tr<w.w&&["ww",tr]),ii=ii||We<=1&&["M"]||We<w.M&&["MM",We]||ni<=1&&["y"]||["yy",ni],ii[2]=g,ii[3]=+f>0,ii[4]=C,ca.apply(null,ii)}function vb(f){return f===void 0?mn:typeof f=="function"?(mn=f,!0):!1}function bb(f,g){return Qs[f]===void 0?!1:g===void 0?Qs[f]:(Qs[f]=g,f==="s"&&(Qs.ss=g-1),!0)}function fa(f,g){if(!this.isValid())return this.localeData().invalidDate();var w=!1,C=Qs,T,H;return typeof f=="object"&&(g=f,f=!1),typeof f=="boolean"&&(w=f),typeof g=="object"&&(C=Object.assign({},Qs,g),g.s!=null&&g.ss==null&&(C.ss=g.s-1)),T=this.localeData(),H=lh(this,!w,C,T),w&&(H=T.pastFuture(+this,H)),T.postformat(H)}var Wc=Math.abs;function Zs(f){return(f>0)-(f<0)||+f}function Xs(){if(!this.isValid())return this.localeData().invalidDate();var f=Wc(this._milliseconds)/1e3,g=Wc(this._days),w=Wc(this._months),C,T,H,K,de=this.asSeconds(),qe,We,tr,ni;return de?(C=Gr(f/60),T=Gr(C/60),f%=60,C%=60,H=Gr(w/12),w%=12,K=f?f.toFixed(3).replace(/\.?0+$/,""):"",qe=de<0?"-":"",We=Zs(this._months)!==Zs(de)?"-":"",tr=Zs(this._days)!==Zs(de)?"-":"",ni=Zs(this._milliseconds)!==Zs(de)?"-":"",qe+"P"+(H?We+H+"Y":"")+(w?We+w+"M":"")+(g?tr+g+"D":"")+(T||C||f?"T":"")+(T?ni+T+"H":"")+(C?ni+C+"M":"")+(f?ni+K+"S":"")):"P0D"}var Ge=zs.prototype;Ge.isValid=Cv,Ge.abs=Bl,Ge.add=nh,Ge.subtract=fb,Ge.as=db,Ge.asMilliseconds=Hc,Ge.asSeconds=ua,Ge.asMinutes=ji,Ge.asHours=ih,Ge.asDays=pb,Ge.asWeeks=Vl,Ge.asMonths=hb,Ge.asQuarters=sh,Ge.asYears=ar,Ge.valueOf=Bc,Ge._bubble=Uc,Ge.clone=oh,Ge.get=Nn,Ge.milliseconds=Wl,Ge.seconds=us,Ge.minutes=ah,Ge.hours=hr,Ge.days=Vc,Ge.weeks=yb,Ge.months=mb,Ge.years=gb,Ge.humanize=fa,Ge.toISOString=Xs,Ge.toString=Xs,Ge.toJSON=Xs,Ge.locale=na,Ge.localeData=Ml,Ge.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xs),Ge.lang=ia,he("X",0,0,"unix"),he("x",0,0,"valueOf"),me("x",js),me("X",Uy),ct("X",function(f,g,w){w._d=new Date(parseFloat(f)*1e3)}),ct("x",function(f,g,w){w._d=new Date(Be(f))});return e.version="2.30.1",r(gt),e.fn=ie,e.min=_v,e.max=Rv,e.now=xv,e.utc=y,e.unix=lb,e.months=eh,e.isDate=d,e.locale=Zn,e.invalid=R,e.duration=yt,e.isMoment=j,e.weekdays=ub,e.parseZone=pn,e.localeData=Xn,e.isDuration=Zo,e.monthsShort=th,e.weekdaysMin=Lc,e.defineLocale=wl,e.updateLocale=$r,e.locales=Nr,e.weekdaysShort=cb,e.normalizeUnits=ge,e.relativeTimeRounding=vb,e.relativeTimeThreshold=bb,e.calendarFormat=Pl,e.prototype=ie,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 Eq=V((Cq,Dh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Dh<"u"&&Dh.exports?Dh.exports=e():t.tv4=e()})(Cq,function(){Object.keys||(Object.keys=(function(){var I=Object.prototype.hasOwnProperty,_=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],F=A.length;return function(U){if(typeof U!="object"&&typeof U!="function"||U===null)throw new TypeError("Object.keys called on non-object");var D=[];for(var J in U)I.call(U,J)&&D.push(J);if(_)for(var Q=0;Q<F;Q++)I.call(U,A[Q])&&D.push(A[Q]);return D}})()),Object.create||(Object.create=(function(){function I(){}return function(_){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return I.prototype=_,new I}})()),Array.isArray||(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(I){if(this===null)throw new TypeError;var _=Object(this),A=_.length>>>0;if(A===0)return-1;var F=0;if(arguments.length>1&&(F=Number(arguments[1]),F!==F?F=0:F!==0&&F!==1/0&&F!==-1/0&&(F=(F>0||-1)*Math.floor(Math.abs(F)))),F>=A)return-1;for(var U=F>=0?F:Math.max(A-Math.abs(F),0);U<A;U++)if(U in _&&_[U]===I)return U;return-1}),Object.isFrozen||(Object.isFrozen=function(I){for(var _="tv4_test_frozen_key";I.hasOwnProperty(_);)_+=Math.random();try{return I[_]=!0,delete I[_],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(I){return encodeURI(I).replace(/%25[0-9][0-9]/g,function(_){return"%"+_.substring(3)})}function n(I){var _="";t[I.charAt(0)]&&(_=I.charAt(0),I=I.substring(1));var A="",F="",U=!0,D=!1,J=!1;_==="+"?U=!1:_==="."?(F=".",A="."):_==="/"?(F="/",A="/"):_==="#"?(F="#",U=!1):_===";"?(F=";",A=";",D=!0,J=!0):_==="?"?(F="?",A="&",D=!0):_==="&"&&(F="&",A="&",D=!0);for(var Q=[],se=I.split(","),fe=[],He={},_e=0;_e<se.length;_e++){var ye=se[_e],Pe=null;if(ye.indexOf(":")!==-1){var ht=ye.split(":");ye=ht[0],Pe=parseInt(ht[1],10)}for(var Nt={};e[ye.charAt(ye.length-1)];)Nt[ye.charAt(ye.length-1)]=!0,ye=ye.substring(0,ye.length-1);var he={truncate:Pe,name:ye,suffices:Nt};fe.push(he),He[ye]=he,Q.push(ye)}var Yt=function(Ar){for(var at="",Tr=0,wr=0;wr<fe.length;wr++){var Rt=fe[wr],bt=Ar(Rt.name);if(bt==null||Array.isArray(bt)&&bt.length===0||typeof bt=="object"&&Object.keys(bt).length===0){Tr++;continue}if(wr===Tr?at+=F:at+=A||",",Array.isArray(bt)){D&&(at+=Rt.name+"=");for(var Jr=0;Jr<bt.length;Jr++)Jr>0&&(at+=Rt.suffices["*"]&&A||",",Rt.suffices["*"]&&D&&(at+=Rt.name+"=")),at+=U?encodeURIComponent(bt[Jr]).replace(/!/g,"%21"):r(bt[Jr])}else if(typeof bt=="object"){D&&!Rt.suffices["*"]&&(at+=Rt.name+"=");var Ms=!0;for(var At in bt)Ms||(at+=Rt.suffices["*"]&&A||","),Ms=!1,at+=U?encodeURIComponent(At).replace(/!/g,"%21"):r(At),at+=Rt.suffices["*"]?"=":",",at+=U?encodeURIComponent(bt[At]).replace(/!/g,"%21"):r(bt[At])}else D&&(at+=Rt.name,(!J||bt!=="")&&(at+="=")),Rt.truncate!=null&&(bt=bt.substring(0,Rt.truncate)),at+=U?encodeURIComponent(bt).replace(/!/g,"%21"):r(bt)}return at};return Yt.varNames=Q,{prefix:F,substitution:Yt}}function i(I){if(!(this instanceof i))return new i(I);for(var _=I.split("{"),A=[_.shift()],F=[],U=[],D=[];_.length>0;){var J=_.shift(),Q=J.split("}")[0],se=J.substring(Q.length+1),fe=n(Q);U.push(fe.substitution),F.push(fe.prefix),A.push(se),D=D.concat(fe.substitution.varNames)}this.fill=function(He){for(var _e=A[0],ye=0;ye<U.length;ye++){var Pe=U[ye];_e+=Pe(He),_e+=A[ye+1]}return _e},this.varNames=D,this.template=I}i.prototype={toString:function(){return this.template},fillFromObject:function(I){return this.fill(function(_){return I[_]})}};var s=function(_,A,F,U,D){if(this.missing=[],this.missingMap={},this.formatValidators=_?Object.create(_.formatValidators):{},this.schemas=_?Object.create(_.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,U&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),D&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=F||b("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},_)for(var J in _.definedKeywords)this.definedKeywords[J]=_.definedKeywords[J].slice(0)};s.prototype.defineKeyword=function(I,_){this.definedKeywords[I]=this.definedKeywords[I]||[],this.definedKeywords[I].push(_)},s.prototype.createError=function(I,_,A,F,U,D,J){var Q=new E(I,_,A,F,U);return Q.message=this.errorReporter(Q,D,J),Q},s.prototype.returnError=function(I){return I},s.prototype.collectError=function(I){return I&&this.errors.push(I),null},s.prototype.prefixErrors=function(I,_,A){for(var F=I;F<this.errors.length;F++)this.errors[F]=this.errors[F].prefixWith(_,A);return this},s.prototype.banUnknownProperties=function(I,_){for(var A in this.unknownPropertyPaths){var F=this.createError(q.UNKNOWN_PROPERTY,{path:A},A,"",null,I,_),U=this.handleError(F);if(U)return U}return null},s.prototype.addFormat=function(I,_){if(typeof I=="object"){for(var A in I)this.addFormat(A,I[A]);return this}this.formatValidators[I]=_},s.prototype.resolveRefs=function(I,_){if(I.$ref!==void 0){if(_=_||{},_[I.$ref])return this.createError(q.CIRCULAR_REFERENCE,{urls:Object.keys(_).join(", ")},"","",null,void 0,I);_[I.$ref]=!0,I=this.getSchema(I.$ref,_)}return I},s.prototype.getSchema=function(I,_){var A;if(this.schemas[I]!==void 0)return A=this.schemas[I],this.resolveRefs(A,_);var F=I,U="";if(I.indexOf("#")!==-1&&(U=I.substring(I.indexOf("#")+1),F=I.substring(0,I.indexOf("#"))),typeof this.schemas[F]=="object"){A=this.schemas[F];var D=decodeURIComponent(U);if(D==="")return this.resolveRefs(A,_);if(D.charAt(0)!=="/")return;for(var J=D.split("/").slice(1),Q=0;Q<J.length;Q++){var se=J[Q].replace(/~1/g,"/").replace(/~0/g,"~");if(A[se]===void 0){A=void 0;break}A=A[se]}if(A!==void 0)return this.resolveRefs(A,_)}this.missing[F]===void 0&&(this.missing.push(F),this.missing[F]=F,this.missingMap[F]=F)},s.prototype.searchSchemas=function(I,_){if(Array.isArray(I))for(var A=0;A<I.length;A++)this.searchSchemas(I[A],_);else if(I&&typeof I=="object"){typeof I.id=="string"&&k(_,I.id)&&this.schemas[I.id]===void 0&&(this.schemas[I.id]=I);for(var F in I)if(F!=="enum"){if(typeof I[F]=="object")this.searchSchemas(I[F],_);else if(F==="$ref"){var U=m(I[F]);U&&this.schemas[U]===void 0&&this.missingMap[U]===void 0&&(this.missingMap[U]=U)}}}},s.prototype.addSchema=function(I,_){if(typeof I!="string"||typeof _>"u")if(typeof I=="object"&&typeof I.id=="string")_=I,I=_.id;else return;I===m(I)+"#"&&(I=m(I)),this.schemas[I]=_,delete this.missingMap[I],y(_,I),this.searchSchemas(_,I)},s.prototype.getSchemaMap=function(){var I={};for(var _ in this.schemas)I[_]=this.schemas[_];return I},s.prototype.getSchemaUris=function(I){var _=[];for(var A in this.schemas)(!I||I.test(A))&&_.push(A);return _},s.prototype.getMissingUris=function(I){var _=[];for(var A in this.missingMap)(!I||I.test(A))&&_.push(A);return _},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(I,_,A,F,U){var D;if(_=this.resolveRefs(_),_){if(_ instanceof E)return this.errors.push(_),_}else return null;var J=this.errors.length,Q,se=null,fe=null;if(this.checkRecursive&&I&&typeof I=="object"){if(D=!this.scanned.length,I[this.validatedSchemasKey]){var He=I[this.validatedSchemasKey].indexOf(_);if(He!==-1)return this.errors=this.errors.concat(I[this.validationErrorsKey][He]),null}if(Object.isFrozen(I)&&(Q=this.scannedFrozen.indexOf(I),Q!==-1)){var _e=this.scannedFrozenSchemas[Q].indexOf(_);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Q][_e]),null}if(this.scanned.push(I),Object.isFrozen(I))Q===-1&&(Q=this.scannedFrozen.length,this.scannedFrozen.push(I),this.scannedFrozenSchemas.push([])),se=this.scannedFrozenSchemas[Q].length,this.scannedFrozenSchemas[Q][se]=_,this.scannedFrozenValidationErrors[Q][se]=[];else{if(!I[this.validatedSchemasKey])try{Object.defineProperty(I,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(I,this.validationErrorsKey,{value:[],configurable:!0})}catch{I[this.validatedSchemasKey]=[],I[this.validationErrorsKey]=[]}fe=I[this.validatedSchemasKey].length,I[this.validatedSchemasKey][fe]=_,I[this.validationErrorsKey][fe]=[]}}var ye=this.errors.length,Pe=this.validateBasic(I,_,U)||this.validateNumeric(I,_,U)||this.validateString(I,_,U)||this.validateArray(I,_,U)||this.validateObject(I,_,U)||this.validateCombinations(I,_,U)||this.validateHypermedia(I,_,U)||this.validateFormat(I,_,U)||this.validateDefinedKeywords(I,_,U)||null;if(D){for(;this.scanned.length;){var ht=this.scanned.pop();delete ht[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Pe||ye!==this.errors.length)for(;A&&A.length||F&&F.length;){var Nt=A&&A.length?""+A.pop():null,he=F&&F.length?""+F.pop():null;Pe&&(Pe=Pe.prefixWith(Nt,he)),this.prefixErrors(ye,Nt,he)}return se!==null?this.scannedFrozenValidationErrors[Q][se]=this.errors.slice(J):fe!==null&&(I[this.validationErrorsKey][fe]=this.errors.slice(J)),this.handleError(Pe)},s.prototype.validateFormat=function(I,_){if(typeof _.format!="string"||!this.formatValidators[_.format])return null;var A=this.formatValidators[_.format].call(null,I,_);return typeof A=="string"||typeof A=="number"?this.createError(q.FORMAT_CUSTOM,{message:A},"","/format",null,I,_):A&&typeof A=="object"?this.createError(q.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,I,_):null},s.prototype.validateDefinedKeywords=function(I,_,A){for(var F in this.definedKeywords)if(!(typeof _[F]>"u"))for(var U=this.definedKeywords[F],D=0;D<U.length;D++){var J=U[D],Q=J(I,_[F],_,A);if(typeof Q=="string"||typeof Q=="number")return this.createError(q.KEYWORD_CUSTOM,{key:F,message:Q},"","",null,I,_).prefixWith(null,F);if(Q&&typeof Q=="object"){var se=Q.code;if(typeof se=="string"){if(!q[se])throw new Error("Undefined error code (use defineError): "+se);se=q[se]}else typeof se!="number"&&(se=q.KEYWORD_CUSTOM);var fe=typeof Q.message=="object"?Q.message:{key:F,message:Q.message||"?"},He=Q.schemaPath||"/"+F.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(se,fe,Q.dataPath||null,He,null,I,_)}}return null};function o(I,_){if(I===_)return!0;if(I&&_&&typeof I=="object"&&typeof _=="object"){if(Array.isArray(I)!==Array.isArray(_))return!1;if(Array.isArray(I)){if(I.length!==_.length)return!1;for(var A=0;A<I.length;A++)if(!o(I[A],_[A]))return!1}else{var F;for(F in I)if(_[F]===void 0&&I[F]!==void 0)return!1;for(F in _)if(I[F]===void 0&&_[F]!==void 0)return!1;for(F in I)if(!o(I[F],_[F]))return!1}return!0}return!1}s.prototype.validateBasic=function(_,A,F){var U;return(U=this.validateType(_,A,F))||(U=this.validateEnum(_,A,F))?U.prefixWith(null,"type"):null},s.prototype.validateType=function(_,A){if(A.type===void 0)return null;var F=typeof _;_===null?F="null":Array.isArray(_)&&(F="array");var U=A.type;Array.isArray(U)||(U=[U]);for(var D=0;D<U.length;D++){var J=U[D];if(J===F||J==="integer"&&F==="number"&&_%1===0)return null}return this.createError(q.INVALID_TYPE,{type:F,expected:U.join("/")},"","",null,_,A)},s.prototype.validateEnum=function(_,A){if(A.enum===void 0)return null;for(var F=0;F<A.enum.length;F++){var U=A.enum[F];if(o(_,U))return null}return this.createError(q.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(_):_},"","",null,_,A)},s.prototype.validateNumeric=function(_,A,F){return this.validateMultipleOf(_,A,F)||this.validateMinMax(_,A,F)||this.validateNaN(_,A,F)||null};var l=Math.pow(2,-51),c=1-l;s.prototype.validateMultipleOf=function(_,A){var F=A.multipleOf||A.divisibleBy;if(F===void 0)return null;if(typeof _=="number"){var U=_/F%1;if(U>=l&&U<c)return this.createError(q.NUMBER_MULTIPLE_OF,{value:_,multipleOf:F},"","",null,_,A)}return null},s.prototype.validateMinMax=function(_,A){if(typeof _!="number")return null;if(A.minimum!==void 0){if(_<A.minimum)return this.createError(q.NUMBER_MINIMUM,{value:_,minimum:A.minimum},"","/minimum",null,_,A);if(A.exclusiveMinimum&&_===A.minimum)return this.createError(q.NUMBER_MINIMUM_EXCLUSIVE,{value:_,minimum:A.minimum},"","/exclusiveMinimum",null,_,A)}if(A.maximum!==void 0){if(_>A.maximum)return this.createError(q.NUMBER_MAXIMUM,{value:_,maximum:A.maximum},"","/maximum",null,_,A);if(A.exclusiveMaximum&&_===A.maximum)return this.createError(q.NUMBER_MAXIMUM_EXCLUSIVE,{value:_,maximum:A.maximum},"","/exclusiveMaximum",null,_,A)}return null},s.prototype.validateNaN=function(_,A){return typeof _!="number"?null:isNaN(_)===!0||_===1/0||_===-1/0?this.createError(q.NUMBER_NOT_A_NUMBER,{value:_},"","/type",null,_,A):null},s.prototype.validateString=function(_,A,F){return this.validateStringLength(_,A,F)||this.validateStringPattern(_,A,F)||null},s.prototype.validateStringLength=function(_,A){return typeof _!="string"?null:A.minLength!==void 0&&_.length<A.minLength?this.createError(q.STRING_LENGTH_SHORT,{length:_.length,minimum:A.minLength},"","/minLength",null,_,A):A.maxLength!==void 0&&_.length>A.maxLength?this.createError(q.STRING_LENGTH_LONG,{length:_.length,maximum:A.maxLength},"","/maxLength",null,_,A):null},s.prototype.validateStringPattern=function(_,A){if(typeof _!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var F;if(A.pattern instanceof RegExp)F=A.pattern;else{var U,D="",J=A.pattern.match(/^\/(.+)\/([img]*)$/);J?(U=J[1],D=J[2]):U=A.pattern,F=new RegExp(U,D)}return F.test(_)?null:this.createError(q.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,_,A)},s.prototype.validateArray=function(_,A,F){return Array.isArray(_)&&(this.validateArrayLength(_,A,F)||this.validateArrayUniqueItems(_,A,F)||this.validateArrayItems(_,A,F))||null},s.prototype.validateArrayLength=function(_,A){var F;return A.minItems!==void 0&&_.length<A.minItems&&(F=this.createError(q.ARRAY_LENGTH_SHORT,{length:_.length,minimum:A.minItems},"","/minItems",null,_,A),this.handleError(F))||A.maxItems!==void 0&&_.length>A.maxItems&&(F=this.createError(q.ARRAY_LENGTH_LONG,{length:_.length,maximum:A.maxItems},"","/maxItems",null,_,A),this.handleError(F))?F:null},s.prototype.validateArrayUniqueItems=function(_,A){if(A.uniqueItems){for(var F=0;F<_.length;F++)for(var U=F+1;U<_.length;U++)if(o(_[F],_[U])){var D=this.createError(q.ARRAY_UNIQUE,{match1:F,match2:U},"","/uniqueItems",null,_,A);if(this.handleError(D))return D}}return null},s.prototype.validateArrayItems=function(_,A,F){if(A.items===void 0)return null;var U,D;if(Array.isArray(A.items)){for(D=0;D<_.length;D++)if(D<A.items.length){if(U=this.validateAll(_[D],A.items[D],[D],["items",D],F+"/"+D))return U}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(U=this.createError(q.ARRAY_ADDITIONAL_ITEMS,{},"/"+D,"/additionalItems",null,_,A),this.handleError(U)))return U}else if(U=this.validateAll(_[D],A.additionalItems,[D],["additionalItems"],F+"/"+D))return U}}else for(D=0;D<_.length;D++)if(U=this.validateAll(_[D],A.items,[D],["items"],F+"/"+D))return U;return null},s.prototype.validateObject=function(_,A,F){return typeof _!="object"||_===null||Array.isArray(_)?null:this.validateObjectMinMaxProperties(_,A,F)||this.validateObjectRequiredProperties(_,A,F)||this.validateObjectProperties(_,A,F)||this.validateObjectDependencies(_,A,F)||null},s.prototype.validateObjectMinMaxProperties=function(_,A){var F=Object.keys(_),U;return A.minProperties!==void 0&&F.length<A.minProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MINIMUM,{propertyCount:F.length,minimum:A.minProperties},"","/minProperties",null,_,A),this.handleError(U))||A.maxProperties!==void 0&&F.length>A.maxProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:F.length,maximum:A.maxProperties},"","/maxProperties",null,_,A),this.handleError(U))?U:null},s.prototype.validateObjectRequiredProperties=function(_,A){if(A.required!==void 0)for(var F=0;F<A.required.length;F++){var U=A.required[F];if(_[U]===void 0){var D=this.createError(q.OBJECT_REQUIRED,{key:U},"","/required/"+F,null,_,A);if(this.handleError(D))return D}}return null},s.prototype.validateObjectProperties=function(_,A,F){var U;for(var D in _){var J=F+"/"+D.replace(/~/g,"~0").replace(/\//g,"~1"),Q=!1;if(A.properties!==void 0&&A.properties[D]!==void 0&&(Q=!0,U=this.validateAll(_[D],A.properties[D],[D],["properties",D],J)))return U;if(A.patternProperties!==void 0)for(var se in A.patternProperties){var fe=new RegExp(se);if(fe.test(D)&&(Q=!0,U=this.validateAll(_[D],A.patternProperties[se],[D],["patternProperties",se],J)))return U}if(Q)this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(U=this.createError(q.OBJECT_ADDITIONAL_PROPERTIES,{key:D},"","/additionalProperties",null,_,A).prefixWith(D,null),this.handleError(U)))return U}else if(U=this.validateAll(_[D],A.additionalProperties,[D],["additionalProperties"],J))return U}else this.trackUnknownProperties&&!this.knownPropertyPaths[J]&&(this.unknownPropertyPaths[J]=!0)}return null},s.prototype.validateObjectDependencies=function(_,A,F){var U;if(A.dependencies!==void 0){for(var D in A.dependencies)if(_[D]!==void 0){var J=A.dependencies[D];if(typeof J=="string"){if(_[J]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:J},"","",null,_,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(Array.isArray(J))for(var Q=0;Q<J.length;Q++){var se=J[Q];if(_[se]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:se},"","/"+Q,null,_,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(U=this.validateAll(_,J,[],["dependencies",D],F))return U}}return null},s.prototype.validateCombinations=function(_,A,F){return this.validateAllOf(_,A,F)||this.validateAnyOf(_,A,F)||this.validateOneOf(_,A,F)||this.validateNot(_,A,F)||null},s.prototype.validateAllOf=function(_,A,F){if(A.allOf===void 0)return null;for(var U,D=0;D<A.allOf.length;D++){var J=A.allOf[D];if(U=this.validateAll(_,J,[],["allOf",D],F))return U}return null},s.prototype.validateAnyOf=function(_,A,F){if(A.anyOf===void 0)return null;var U=[],D=this.errors.length,J,Q;this.trackUnknownProperties&&(J=this.unknownPropertyPaths,Q=this.knownPropertyPaths);for(var se=!0,fe=0;fe<A.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var He=A.anyOf[fe],_e=this.errors.length,ye=this.validateAll(_,He,[],["anyOf",fe],F);if(ye===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,D),this.trackUnknownProperties){for(var Pe in this.knownPropertyPaths)Q[Pe]=!0,delete J[Pe];for(var ht in this.unknownPropertyPaths)Q[ht]||(J[ht]=!0);se=!1;continue}return null}ye&&U.push(ye.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=J,this.knownPropertyPaths=Q),se)return U=U.concat(this.errors.slice(D)),this.errors=this.errors.slice(0,D),this.createError(q.ANY_OF_MISSING,{},"","/anyOf",U,_,A)},s.prototype.validateOneOf=function(_,A,F){if(A.oneOf===void 0)return null;var U=null,D=[],J=this.errors.length,Q,se;this.trackUnknownProperties&&(Q=this.unknownPropertyPaths,se=this.knownPropertyPaths);for(var fe=0;fe<A.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var He=A.oneOf[fe],_e=this.errors.length,ye=this.validateAll(_,He,[],["oneOf",fe],F);if(ye===null&&_e===this.errors.length){if(U===null)U=fe;else return this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MULTIPLE,{index1:U,index2:fe},"","/oneOf",null,_,A);if(this.trackUnknownProperties){for(var Pe in this.knownPropertyPaths)se[Pe]=!0,delete Q[Pe];for(var ht in this.unknownPropertyPaths)se[ht]||(Q[ht]=!0)}}else ye&&D.push(ye)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Q,this.knownPropertyPaths=se),U===null?(D=D.concat(this.errors.slice(J)),this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MISSING,{},"","/oneOf",D,_,A)):(this.errors=this.errors.slice(0,J),null)},s.prototype.validateNot=function(_,A,F){if(A.not===void 0)return null;var U=this.errors.length,D,J;this.trackUnknownProperties&&(D=this.unknownPropertyPaths,J=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Q=this.validateAll(_,A.not,null,null,F),se=this.errors.slice(U);return this.errors=this.errors.slice(0,U),this.trackUnknownProperties&&(this.unknownPropertyPaths=D,this.knownPropertyPaths=J),Q===null&&se.length===0?this.createError(q.NOT_PASSED,{},"","/not",null,_,A):null},s.prototype.validateHypermedia=function(_,A,F){if(!A.links)return null;for(var U,D=0;D<A.links.length;D++){var J=A.links[D];if(J.rel==="describedby"){for(var Q=new i(J.href),se=!0,fe=0;fe<Q.varNames.length;fe++)if(!(Q.varNames[fe]in _)){se=!1;break}if(se){var He=Q.fillFromObject(_),_e={$ref:He};if(U=this.validateAll(_,_e,[],["links",D],F))return U}}}};function d(I){var _=String(I).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return _?{href:_[0]||"",protocol:_[1]||"",authority:_[2]||"",host:_[3]||"",hostname:_[4]||"",port:_[5]||"",pathname:_[6]||"",search:_[7]||"",hash:_[8]||""}:null}function p(I,_){function A(F){var U=[];return F.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(D){D==="/.."?U.pop():U.push(D)}),U.join("").replace(/^\//,F.charAt(0)==="/"?"/":"")}return _=d(_||""),I=d(I||""),!_||!I?null:(_.protocol||I.protocol)+(_.protocol||_.authority?_.authority:I.authority)+A(_.protocol||_.authority||_.pathname.charAt(0)==="/"?_.pathname:_.pathname?(I.authority&&!I.pathname?"/":"")+I.pathname.slice(0,I.pathname.lastIndexOf("/")+1)+_.pathname:I.pathname)+(_.protocol||_.authority||_.pathname?_.search:_.search||I.search)+_.hash}function m(I){return I.split("#")[0]}function y(I,_){if(I&&typeof I=="object")if(_===void 0?_=I.id:typeof I.id=="string"&&(_=p(_,I.id),I.id=_),Array.isArray(I))for(var A=0;A<I.length;A++)y(I[A],_);else{typeof I.$ref=="string"&&(I.$ref=p(_,I.$ref));for(var F in I)F!=="enum"&&y(I[F],_)}}function b(I){I=I||"en";var _=P[I];return function(A){var F=_[A.code]||R[A.code];if(typeof F!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var U=A.params;return F.replace(/\{([^{}]*)\}/g,function(D,J){var Q=U[J];return typeof Q=="string"||typeof Q=="number"?Q:D})}}var q={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var v in q)x[q[v]]=v;var R={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 E(I,_,A,F,U){if(Error.call(this),I===void 0)throw new Error("No error code supplied: "+F);this.message="",this.params=_,this.code=I,this.dataPath=A||"",this.schemaPath=F||"",this.subErrors=U||null;var D=new Error(this.message);if(this.stack=D.stack||D.stacktrace,!this.stack)try{throw D}catch(J){this.stack=J.stack||J.stacktrace}}E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,E.prototype.name="ValidationError",E.prototype.prefixWith=function(I,_){if(I!==null&&(I=I.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+I+this.dataPath),_!==null&&(_=_.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+_+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(I,_);return this};function k(I,_){if(_.substring(0,I.length)===I){var A=_.substring(I.length);if(_.length>0&&_.charAt(I.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var P={};function M(I){var _=new s,A,F,U={setErrorReporter:function(D){return typeof D=="string"?this.language(D):(F=D,!0)},addFormat:function(){_.addFormat.apply(_,arguments)},language:function(D){return D?(P[D]||(D=D.split("-")[0]),P[D]?(A=D,D):!1):A},addLanguage:function(D,J){var Q;for(Q in q)J[Q]&&!J[q[Q]]&&(J[q[Q]]=J[Q]);var se=D.split("-")[0];if(!P[se])P[D]=J,P[se]=J;else{P[D]=Object.create(P[se]);for(Q in J)typeof P[se][Q]>"u"&&(P[se][Q]=J[Q]),P[D][Q]=J[Q]}return this},freshApi:function(D){var J=M();return D&&J.language(D),J},validate:function(D,J,Q,se){var fe=b(A),He=F?function(Pe,ht,Nt){return F(Pe,ht,Nt)||fe(Pe,ht,Nt)}:fe,_e=new s(_,!1,He,Q,se);typeof J=="string"&&(J={$ref:J}),_e.addSchema("",J);var ye=_e.validateAll(D,J,null,null,"");return!ye&&se&&(ye=_e.banUnknownProperties(D,J)),this.error=ye,this.missing=_e.missing,this.valid=ye===null,this.valid},validateResult:function(){var D={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(D,arguments),D},validateMultiple:function(D,J,Q,se){var fe=b(A),He=F?function(Pe,ht,Nt){return F(Pe,ht,Nt)||fe(Pe,ht,Nt)}:fe,_e=new s(_,!0,He,Q,se);typeof J=="string"&&(J={$ref:J}),_e.addSchema("",J),_e.validateAll(D,J,null,null,""),se&&_e.banUnknownProperties(D,J);var ye={toString:function(){return this.valid?"valid":this.error.message}};return ye.errors=_e.errors,ye.missing=_e.missing,ye.valid=ye.errors.length===0,ye},addSchema:function(){return _.addSchema.apply(_,arguments)},getSchema:function(){return _.getSchema.apply(_,arguments)},getSchemaMap:function(){return _.getSchemaMap.apply(_,arguments)},getSchemaUris:function(){return _.getSchemaUris.apply(_,arguments)},getMissingUris:function(){return _.getMissingUris.apply(_,arguments)},dropSchemas:function(){_.dropSchemas.apply(_,arguments)},defineKeyword:function(){_.defineKeyword.apply(_,arguments)},defineError:function(D,J,Q){if(typeof D!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(D))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof J!="number"||J%1!==0||J<1e4)throw new Error("Code number must be an integer > 10000");if(typeof q[D]<"u")throw new Error("Error already defined: "+D+" as "+q[D]);if(typeof x[J]<"u")throw new Error("Error code already used: "+x[J]+" as "+J);q[D]=J,x[J]=D,R[D]=R[J]=Q;for(var se in P){var fe=P[se];fe[D]&&(fe[J]=fe[J]||fe[D])}},reset:function(){_.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:p,getDocumentUri:m,errorCodes:q};return U.language(I||"en"),U}var j=M();return j.addLanguage("en-gb",R),j.tv4=j,j})});var mf=V(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.regexpCode=ut.getEsmExportName=ut.getProperty=ut.safeStringify=ut.stringify=ut.strConcat=ut.addCodeArg=ut.str=ut._=ut.nil=ut._Code=ut.Name=ut.IDENTIFIER=ut._CodeOrName=void 0;var pf=class{};ut._CodeOrName=pf;ut.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var _a=class extends pf{constructor(e){if(super(),!ut.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}}};ut.Name=_a;var Un=class extends pf{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 _a&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ut._Code=Un;ut.nil=new Un("");function qq(t,...e){let r=[t[0]],n=0;for(;n<e.length;)gS(r,e[n]),r.push(t[++n]);return new Un(r)}ut._=qq;var mS=new Un("+");function Iq(t,...e){let r=[hf(t[0])],n=0;for(;n<e.length;)r.push(mS),gS(r,e[n]),r.push(mS,hf(t[++n]));return w2(r),new Un(r)}ut.str=Iq;function gS(t,e){e instanceof Un?t.push(...e._items):e instanceof _a?t.push(e):t.push(x2(e))}ut.addCodeArg=gS;function w2(t){let e=1;for(;e<t.length-1;){if(t[e]===mS){let r=_2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function _2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof _a||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 _a))return`"${t}${e.slice(1)}`}function R2(t,e){return e.emptyStr()?t:t.emptyStr()?e:Iq`${t}${e}`}ut.strConcat=R2;function x2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:hf(Array.isArray(t)?t.join(","):t)}function C2(t){return new Un(hf(t))}ut.stringify=C2;function hf(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ut.safeStringify=hf;function E2(t){return typeof t=="string"&&ut.IDENTIFIER.test(t)?new Un(`.${t}`):qq`[${t}]`}ut.getProperty=E2;function q2(t){if(typeof t=="string"&&ut.IDENTIFIER.test(t))return new Un(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ut.getEsmExportName=q2;function I2(t){return new Un(t.toString())}ut.regexpCode=I2});var bS=V(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.ValueScope=rn.ValueScopeName=rn.Scope=rn.varKinds=rn.UsedValueState=void 0;var tn=mf(),yS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},jh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(jh||(rn.UsedValueState=jh={}));rn.varKinds={const:new tn.Name("const"),let:new tn.Name("let"),var:new tn.Name("var")};var Lh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof tn.Name?e:this.name(e)}name(e){return new tn.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}}};rn.Scope=Lh;var Uh=class extends tn.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,tn._)`.${new tn.Name(r)}[${n}]`}};rn.ValueScopeName=Uh;var O2=(0,tn._)`\n`,vS=class extends Lh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?O2:tn.nil}}get(){return this._scope}name(e){return new Uh(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 c=this._scope[s]||(this._scope[s]=[]),d=c.length;return c[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,tn._)`${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=tn.nil;for(let o in e){let l=e[o];if(!l)continue;let c=n[o]=n[o]||new Map;l.forEach(d=>{if(c.has(d))return;c.set(d,jh.Started);let p=r(d);if(p){let m=this.opts.es5?rn.varKinds.var:rn.varKinds.const;s=(0,tn._)`${s}${m} ${d} = ${p};${this.opts._n}`}else if(p=i?.(d))s=(0,tn._)`${s}${p}${this.opts._n}`;else throw new yS(d);c.set(d,jh.Completed)})}return s}};rn.ValueScope=vS});var ze=V(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.or=Ue.and=Ue.not=Ue.CodeGen=Ue.operators=Ue.varKinds=Ue.ValueScopeName=Ue.ValueScope=Ue.Scope=Ue.Name=Ue.regexpCode=Ue.stringify=Ue.getProperty=Ue.nil=Ue.strConcat=Ue.str=Ue._=void 0;var et=mf(),ui=bS(),lo=mf();Object.defineProperty(Ue,"_",{enumerable:!0,get:function(){return lo._}});Object.defineProperty(Ue,"str",{enumerable:!0,get:function(){return lo.str}});Object.defineProperty(Ue,"strConcat",{enumerable:!0,get:function(){return lo.strConcat}});Object.defineProperty(Ue,"nil",{enumerable:!0,get:function(){return lo.nil}});Object.defineProperty(Ue,"getProperty",{enumerable:!0,get:function(){return lo.getProperty}});Object.defineProperty(Ue,"stringify",{enumerable:!0,get:function(){return lo.stringify}});Object.defineProperty(Ue,"regexpCode",{enumerable:!0,get:function(){return lo.regexpCode}});Object.defineProperty(Ue,"Name",{enumerable:!0,get:function(){return lo.Name}});var Wh=bS();Object.defineProperty(Ue,"Scope",{enumerable:!0,get:function(){return Wh.Scope}});Object.defineProperty(Ue,"ValueScope",{enumerable:!0,get:function(){return Wh.ValueScope}});Object.defineProperty(Ue,"ValueScopeName",{enumerable:!0,get:function(){return Wh.ValueScopeName}});Object.defineProperty(Ue,"varKinds",{enumerable:!0,get:function(){return Wh.varKinds}});Ue.operators={GT:new et._Code(">"),GTE:new et._Code(">="),LT:new et._Code("<"),LTE:new et._Code("<="),EQ:new et._Code("==="),NEQ:new et._Code("!=="),NOT:new et._Code("!"),OR:new et._Code("||"),AND:new et._Code("&&"),ADD:new et._Code("+")};var Ss=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},SS=class extends Ss{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?ui.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=iu(this.rhs,e,r)),this}get names(){return this.rhs instanceof et._CodeOrName?this.rhs.names:{}}},Hh=class extends Ss{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 et.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=iu(this.rhs,e,r),this}get names(){let e=this.lhs instanceof et.Name?{}:{...this.lhs.names};return Vh(e,this.rhs)}},wS=class extends Hh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},_S=class extends Ss{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},RS=class extends Ss{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},xS=class extends Ss{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},CS=class extends Ss{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=iu(this.code,e,r),this}get names(){return this.code instanceof et._CodeOrName?this.code.names:{}}},gf=class extends Ss{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)||(P2(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),{})}},ws=class extends gf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},ES=class extends gf{},nu=class extends ws{};nu.kind="else";var Ra=class t extends ws{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 nu(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Oq(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=iu(this.condition,e,r),this}get names(){let e=super.names;return Vh(e,this.condition),this.else&&Ca(e,this.else.names),e}};Ra.kind="if";var xa=class extends ws{};xa.kind="for";var qS=class extends xa{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=iu(this.iteration,e,r),this}get names(){return Ca(super.names,this.iteration.names)}},IS=class extends xa{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?ui.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=Vh(super.names,this.from);return Vh(e,this.to)}},Bh=class extends xa{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=iu(this.iterable,e,r),this}get names(){return Ca(super.names,this.iterable.names)}},yf=class extends ws{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)}};yf.kind="func";var vf=class extends gf{render(e){return"return "+super.render(e)}};vf.kind="return";var OS=class extends ws{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}},bf=class extends ws{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};bf.kind="catch";var Sf=class extends ws{render(e){return"finally"+super.render(e)}};Sf.kind="finally";var PS=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
24
24
  `:""},this._extScope=e,this._scope=new ui.Scope({parent:e}),this._nodes=[new ES]}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 SS(e,s,n)),s}const(e,r,n){return this._def(ui.varKinds.const,e,r,n)}let(e,r,n){return this._def(ui.varKinds.let,e,r,n)}var(e,r,n){return this._def(ui.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Hh(e,r,n))}add(e,r){return this._leafNode(new wS(e,Ue.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==et.nil&&this._leafNode(new CS(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,et.addCodeArg)(r,i));return r.push("}"),new et._Code(r)}if(e,r,n){if(this._blockNode(new Ra(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 Ra(e))}else(){return this._elseNode(new nu)}endIf(){return this._endBlockNode(Ra,nu)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new qS(e),r)}forRange(e,r,n,i,s=this.opts.es5?ui.varKinds.var:ui.varKinds.let){let o=this._scope.toName(e);return this._for(new IS(s,o,r,n),()=>i(o))}forOf(e,r,n,i=ui.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof et.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,et._)`${o}.length`,l=>{this.var(s,(0,et._)`${o}[${l}]`),n(s)})}return this._for(new Bh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?ui.varKinds.var:ui.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,et._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Bh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(xa)}label(e){return this._leafNode(new _S(e))}break(e){return this._leafNode(new RS(e))}return(e){let r=new vf;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(vf)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new OS;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new bf(s),r(s)}return n&&(this._currNode=i.finally=new Sf,this.code(n)),this._endBlockNode(bf,Sf)}throw(e){return this._leafNode(new xS(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=et.nil,n,i){return this._blockNode(new yf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(yf)}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 Ra))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}};Ue.CodeGen=PS;function Ca(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Vh(t,e){return e instanceof et._CodeOrName?Ca(t,e.names):t}function iu(t,e,r){if(t instanceof et.Name)return n(t);if(!i(t))return t;return new et._Code(t._items.reduce((s,o)=>(o instanceof et.Name&&(o=n(o)),o instanceof et._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 et._Code&&s._items.some(o=>o instanceof et.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function P2(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Oq(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,et._)`!${kS(t)}`}Ue.not=Oq;var k2=Pq(Ue.operators.AND);function A2(...t){return t.reduce(k2)}Ue.and=A2;var T2=Pq(Ue.operators.OR);function $2(...t){return t.reduce(T2)}Ue.or=$2;function Pq(t){return(e,r)=>e===et.nil?r:r===et.nil?e:(0,et._)`${kS(e)} ${t} ${kS(r)}`}function kS(t){return t instanceof et.Name?t:(0,et._)`(${t})`}});var rt=V(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.checkStrictMode=Je.getErrorPath=Je.Type=Je.useFunc=Je.setEvaluated=Je.evaluatedPropsToName=Je.mergeEvaluated=Je.eachItem=Je.unescapeJsonPointer=Je.escapeJsonPointer=Je.escapeFragment=Je.unescapeFragment=Je.schemaRefOrVal=Je.schemaHasRulesButRef=Je.schemaHasRules=Je.checkUnknownRules=Je.alwaysValidSchema=Je.toHash=void 0;var kt=ze(),N2=mf();function M2(t){let e={};for(let r of t)e[r]=!0;return e}Je.toHash=M2;function F2(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Tq(t,e),!$q(e,t.self.RULES.all))}Je.alwaysValidSchema=F2;function Tq(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]||Fq(t,`unknown keyword: "${s}"`)}Je.checkUnknownRules=Tq;function $q(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Je.schemaHasRules=$q;function D2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Je.schemaHasRulesButRef=D2;function j2({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,kt._)`${r}`}return(0,kt._)`${t}${e}${(0,kt.getProperty)(n)}`}Je.schemaRefOrVal=j2;function L2(t){return Nq(decodeURIComponent(t))}Je.unescapeFragment=L2;function U2(t){return encodeURIComponent(TS(t))}Je.escapeFragment=U2;function TS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Je.escapeJsonPointer=TS;function Nq(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Je.unescapeJsonPointer=Nq;function H2(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Je.eachItem=H2;function kq({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let c=o===void 0?s:o instanceof kt.Name?(s instanceof kt.Name?t(i,s,o):e(i,s,o),o):s instanceof kt.Name?(e(i,o,s),s):r(s,o);return l===kt.Name&&!(c instanceof kt.Name)?n(i,c):c}}Je.mergeEvaluated={props:kq({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,kt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,kt._)`${r} || {}`).code((0,kt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,kt._)`${r} || {}`),$S(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Mq}),items:kq({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,kt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,kt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Mq(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,kt._)`{}`);return e!==void 0&&$S(t,r,e),r}Je.evaluatedPropsToName=Mq;function $S(t,e,r){Object.keys(r).forEach(n=>t.assign((0,kt._)`${e}${(0,kt.getProperty)(n)}`,!0))}Je.setEvaluated=$S;var Aq={};function B2(t,e){return t.scopeValue("func",{ref:e,code:Aq[e.code]||(Aq[e.code]=new N2._Code(e.code))})}Je.useFunc=B2;var AS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(AS||(Je.Type=AS={}));function V2(t,e,r){if(t instanceof kt.Name){let n=e===AS.Num;return r?n?(0,kt._)`"[" + ${t} + "]"`:(0,kt._)`"['" + ${t} + "']"`:n?(0,kt._)`"/" + ${t}`:(0,kt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,kt.getProperty)(t).toString():"/"+TS(t)}Je.getErrorPath=V2;function Fq(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Je.checkStrictMode=Fq});var _s=V(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var Cr=ze(),W2={data:new Cr.Name("data"),valCxt:new Cr.Name("valCxt"),instancePath:new Cr.Name("instancePath"),parentData:new Cr.Name("parentData"),parentDataProperty:new Cr.Name("parentDataProperty"),rootData:new Cr.Name("rootData"),dynamicAnchors:new Cr.Name("dynamicAnchors"),vErrors:new Cr.Name("vErrors"),errors:new Cr.Name("errors"),this:new Cr.Name("this"),self:new Cr.Name("self"),scope:new Cr.Name("scope"),json:new Cr.Name("json"),jsonPos:new Cr.Name("jsonPos"),jsonLen:new Cr.Name("jsonLen"),jsonPart:new Cr.Name("jsonPart")};NS.default=W2});var wf=V(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.extendErrors=Er.resetErrorsCount=Er.reportExtraError=Er.reportError=Er.keyword$DataError=Er.keywordError=void 0;var nt=ze(),zh=rt(),Br=_s();Er.keywordError={message:({keyword:t})=>(0,nt.str)`must pass "${t}" keyword validation`};Er.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,nt.str)`"${t}" keyword must be ${e} ($data)`:(0,nt.str)`"${t}" keyword is invalid ($data)`};function z2(t,e=Er.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,c=Lq(t,e,r);n??(o||l)?Dq(s,c):jq(i,(0,nt._)`[${c}]`)}Er.reportError=z2;function J2(t,e=Er.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=Lq(t,e,r);Dq(i,l),s||o||jq(n,Br.default.vErrors)}Er.reportExtraError=J2;function G2(t,e){t.assign(Br.default.errors,e),t.if((0,nt._)`${Br.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,nt._)`${Br.default.vErrors}.length`,e),()=>t.assign(Br.default.vErrors,null)))}Er.resetErrorsCount=G2;function Y2({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,Br.default.errors,l=>{t.const(o,(0,nt._)`${Br.default.vErrors}[${l}]`),t.if((0,nt._)`${o}.instancePath === undefined`,()=>t.assign((0,nt._)`${o}.instancePath`,(0,nt.strConcat)(Br.default.instancePath,s.errorPath))),t.assign((0,nt._)`${o}.schemaPath`,(0,nt.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,nt._)`${o}.schema`,r),t.assign((0,nt._)`${o}.data`,n))})}Er.extendErrors=Y2;function Dq(t,e){let r=t.const("err",e);t.if((0,nt._)`${Br.default.vErrors} === null`,()=>t.assign(Br.default.vErrors,(0,nt._)`[${r}]`),(0,nt._)`${Br.default.vErrors}.push(${r})`),t.code((0,nt._)`${Br.default.errors}++`)}function jq(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,nt._)`new ${t.ValidationError}(${e})`):(r.assign((0,nt._)`${n}.errors`,e),r.return(!1))}var Ea={keyword:new nt.Name("keyword"),schemaPath:new nt.Name("schemaPath"),params:new nt.Name("params"),propertyName:new nt.Name("propertyName"),message:new nt.Name("message"),schema:new nt.Name("schema"),parentSchema:new nt.Name("parentSchema")};function Lq(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,nt._)`{}`:K2(t,e,r)}function K2(t,e,r={}){let{gen:n,it:i}=t,s=[Q2(i,r),Z2(t,r)];return X2(t,e,s),n.object(...s)}function Q2({errorPath:t},{instancePath:e}){let r=e?(0,nt.str)`${t}${(0,zh.getErrorPath)(e,zh.Type.Str)}`:t;return[Br.default.instancePath,(0,nt.strConcat)(Br.default.instancePath,r)]}function Z2({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,nt.str)`${e}/${t}`;return r&&(i=(0,nt.str)`${i}${(0,zh.getErrorPath)(r,zh.Type.Str)}`),[Ea.schemaPath,i]}function X2(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:c,propertyName:d,topSchemaRef:p,schemaPath:m}=l;n.push([Ea.keyword,i],[Ea.params,typeof e=="function"?e(t):e||(0,nt._)`{}`]),c.messages&&n.push([Ea.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Ea.schema,o],[Ea.parentSchema,(0,nt._)`${p}${m}`],[Br.default.data,s]),d&&n.push([Ea.propertyName,d])}});var Hq=V(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.boolOrEmptySchema=su.topBoolOrEmptySchema=void 0;var eU=wf(),tU=ze(),rU=_s(),nU={message:"boolean schema is false"};function iU(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Uq(t,!1):typeof r=="object"&&r.$async===!0?e.return(rU.default.data):(e.assign((0,tU._)`${n}.errors`,null),e.return(!0))}su.topBoolOrEmptySchema=iU;function sU(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Uq(t)):r.var(e,!0)}su.boolOrEmptySchema=sU;function Uq(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,eU.reportError)(i,nU,void 0,e)}});var MS=V(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.getRules=ou.isJSONType=void 0;var oU=["string","number","integer","boolean","null","object","array"],aU=new Set(oU);function lU(t){return typeof t=="string"&&aU.has(t)}ou.isJSONType=lU;function uU(){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:{}}}ou.getRules=uU});var FS=V(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.shouldUseRule=uo.shouldUseGroup=uo.schemaHasRulesForType=void 0;function cU({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Bq(t,n)}uo.schemaHasRulesForType=cU;function Bq(t,e){return e.rules.some(r=>Vq(t,r))}uo.shouldUseGroup=Bq;function Vq(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))}uo.shouldUseRule=Vq});var _f=V(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.reportTypeError=qr.checkDataTypes=qr.checkDataType=qr.coerceAndCheckDataType=qr.getJSONTypes=qr.getSchemaTypes=qr.DataType=void 0;var fU=MS(),dU=FS(),pU=wf(),Me=ze(),Wq=rt(),au;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(au||(qr.DataType=au={}));function hU(t){let e=zq(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}qr.getSchemaTypes=hU;function zq(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(fU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}qr.getJSONTypes=zq;function mU(t,e){let{gen:r,data:n,opts:i}=t,s=gU(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,dU.schemaHasRulesForType)(t,e[0]));if(o){let l=jS(e,n,i.strictNumbers,au.Wrong);r.if(l,()=>{s.length?yU(t,e,s):LS(t)})}return o}qr.coerceAndCheckDataType=mU;var Jq=new Set(["string","number","integer","boolean","null"]);function gU(t,e){return e?t.filter(r=>Jq.has(r)||e==="array"&&r==="array"):[]}function yU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,Me._)`typeof ${i}`),l=n.let("coerced",(0,Me._)`undefined`);s.coerceTypes==="array"&&n.if((0,Me._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Me._)`${i}[0]`).assign(o,(0,Me._)`typeof ${i}`).if(jS(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Me._)`${l} !== undefined`);for(let d of r)(Jq.has(d)||d==="array"&&s.coerceTypes==="array")&&c(d);n.else(),LS(t),n.endIf(),n.if((0,Me._)`${l} !== undefined`,()=>{n.assign(i,l),vU(t,l)});function c(d){switch(d){case"string":n.elseIf((0,Me._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,Me._)`"" + ${i}`).elseIf((0,Me._)`${i} === null`).assign(l,(0,Me._)`""`);return;case"number":n.elseIf((0,Me._)`${o} == "boolean" || ${i} === null
25
25
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,Me._)`+${i}`);return;case"integer":n.elseIf((0,Me._)`${o} === "boolean" || ${i} === null
26
26
  || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,Me._)`+${i}`);return;case"boolean":n.elseIf((0,Me._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,Me._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,Me._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,Me._)`${o} === "string" || ${o} === "number"
27
- || ${o} === "boolean" || ${i} === null`).assign(l,(0,Me._)`[${i}]`)}}}function vU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Me._)`${e} !== undefined`,()=>t.assign((0,Me._)`${e}[${r}]`,n))}function DS(t,e,r,n=au.Correct){let i=n===au.Correct?Me.operators.EQ:Me.operators.NEQ,s;switch(t){case"null":return(0,Me._)`${e} ${i} null`;case"array":s=(0,Me._)`Array.isArray(${e})`;break;case"object":s=(0,Me._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,Me._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,Me._)`typeof ${e} ${i} ${t}`}return n===au.Correct?s:(0,Me.not)(s);function o(l=Me.nil){return(0,Me.and)((0,Me._)`typeof ${e} == "number"`,l,r?(0,Me._)`isFinite(${e})`:Me.nil)}}qr.checkDataType=DS;function jS(t,e,r,n){if(t.length===1)return DS(t[0],e,r,n);let i,s=(0,Wq.toHash)(t);if(s.array&&s.object){let o=(0,Me._)`typeof ${e} != "object"`;i=s.null?o:(0,Me._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=Me.nil;s.number&&delete s.integer;for(let o in s)i=(0,Me.and)(i,DS(o,e,r,n));return i}qr.checkDataTypes=jS;var bU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Me._)`{type: ${t}}`:(0,Me._)`{type: ${e}}`};function LS(t){let e=SU(t);(0,pU.reportError)(e,bU)}qr.reportTypeError=LS;function SU(t){let{gen:e,data:r,schema:n}=t,i=(0,Wq.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Yq=V(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.assignDefaults=void 0;var lu=ze(),wU=rt();function _U(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Gq(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Gq(t,s,i.default))}Jh.assignDefaults=_U;function Gq(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,lu._)`${s}${(0,lu.getProperty)(e)}`;if(i){(0,wU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let c=(0,lu._)`${l} === undefined`;o.useDefaults==="empty"&&(c=(0,lu._)`${c} || ${l} === null || ${l} === ""`),n.if(c,(0,lu._)`${l} = ${(0,lu.stringify)(r)}`)}});var Hn=V(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateUnion=It.validateArray=It.usePattern=It.callValidateCode=It.schemaProperties=It.allSchemaProperties=It.noPropertyInData=It.propertyInData=It.isOwnProperty=It.hasPropFunc=It.reportMissingProp=It.checkMissingProp=It.checkReportMissingProp=void 0;var Mt=ze(),US=rt(),co=_s(),RU=rt();function xU(t,e){let{gen:r,data:n,it:i}=t;r.if(BS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Mt._)`${e}`},!0),t.error()})}It.checkReportMissingProp=xU;function CU({gen:t,data:e,it:{opts:r}},n,i){return(0,Mt.or)(...n.map(s=>(0,Mt.and)(BS(t,e,s,r.ownProperties),(0,Mt._)`${i} = ${s}`)))}It.checkMissingProp=CU;function EU(t,e){t.setParams({missingProperty:e},!0),t.error()}It.reportMissingProp=EU;function Kq(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Mt._)`Object.prototype.hasOwnProperty`})}It.hasPropFunc=Kq;function HS(t,e,r){return(0,Mt._)`${Kq(t)}.call(${e}, ${r})`}It.isOwnProperty=HS;function qU(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} !== undefined`;return n?(0,Mt._)`${i} && ${HS(t,e,r)}`:i}It.propertyInData=qU;function BS(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} === undefined`;return n?(0,Mt.or)(i,(0,Mt.not)(HS(t,e,r))):i}It.noPropertyInData=BS;function Qq(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}It.allSchemaProperties=Qq;function IU(t,e){return Qq(e).filter(r=>!(0,US.alwaysValidSchema)(t,e[r]))}It.schemaProperties=IU;function OU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,c,d){let p=d?(0,Mt._)`${t}, ${e}, ${n}${i}`:e,m=[[co.default.instancePath,(0,Mt.strConcat)(co.default.instancePath,s)],[co.default.parentData,o.parentData],[co.default.parentDataProperty,o.parentDataProperty],[co.default.rootData,co.default.rootData]];o.opts.dynamicRef&&m.push([co.default.dynamicAnchors,co.default.dynamicAnchors]);let y=(0,Mt._)`${p}, ${r.object(...m)}`;return c!==Mt.nil?(0,Mt._)`${l}.call(${c}, ${y})`:(0,Mt._)`${l}(${y})`}It.callValidateCode=OU;var PU=(0,Mt._)`new RegExp`;function kU({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,Mt._)`${i.code==="new RegExp"?PU:(0,RU.useFunc)(t,i)}(${r}, ${n})`})}It.usePattern=kU;function AU(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 c=e.const("len",(0,Mt._)`${r}.length`);e.forRange("i",0,c,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:US.Type.Num},s),e.if((0,Mt.not)(s),l)})}}It.validateArray=AU;function TU(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,US.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((c,d)=>{let p=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(o,(0,Mt._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Mt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}It.validateUnion=TU});var eI=V(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.validateKeywordUsage=Hi.validSchemaType=Hi.funcKeywordCode=Hi.macroKeywordCode=void 0;var Vr=ze(),qa=_s(),$U=Hn(),NU=wf();function MU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),c=Xq(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Vr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}Hi.macroKeywordCode=MU;function FU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:c}=t;jU(c,e);let d=!l&&e.compile?e.compile.call(c.self,s,o,c):e.validate,p=Xq(n,i,d),m=n.let("valid");t.block$data(m,y),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function y(){if(e.errors===!1)x(),e.modifying&&Zq(t),v(()=>t.error());else{let _=e.async?b():q();e.modifying&&Zq(t),v(()=>DU(t,_))}}function b(){let _=n.let("ruleErrs",null);return n.try(()=>x((0,Vr._)`await `),E=>n.assign(m,!1).if((0,Vr._)`${E} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Vr._)`${E}.errors`),()=>n.throw(E))),_}function q(){let _=(0,Vr._)`${p}.errors`;return n.assign(_,null),x(Vr.nil),_}function x(_=e.async?(0,Vr._)`await `:Vr.nil){let E=c.opts.passContext?qa.default.this:qa.default.self,k=!("compile"in e&&!l||e.schema===!1);n.assign(m,(0,Vr._)`${_}${(0,$U.callValidateCode)(t,p,E,k)}`,e.modifying)}function v(_){var E;n.if((0,Vr.not)((E=e.valid)!==null&&E!==void 0?E:m),_)}}Hi.funcKeywordCode=FU;function Zq(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Vr._)`${n.parentData}[${n.parentDataProperty}]`))}function DU(t,e){let{gen:r}=t;r.if((0,Vr._)`Array.isArray(${e})`,()=>{r.assign(qa.default.vErrors,(0,Vr._)`${qa.default.vErrors} === null ? ${e} : ${qa.default.vErrors}.concat(${e})`).assign(qa.default.errors,(0,Vr._)`${qa.default.vErrors}.length`),(0,NU.extendErrors)(t)},()=>t.error())}function jU({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Xq(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,Vr.stringify)(r)})}function LU(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")}Hi.validSchemaType=LU;function UU({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 c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Hi.validateKeywordUsage=UU});var rI=V(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.extendSubschemaMode=fo.extendSubschemaData=fo.getSubschema=void 0;var Bi=ze(),tI=rt();function HU(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,Bi._)`${t.schemaPath}${(0,Bi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Bi._)`${t.schemaPath}${(0,Bi.getProperty)(e)}${(0,Bi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,tI.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')}fo.getSubschema=HU;function BU(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:d,dataPathArr:p,opts:m}=e,y=l.let("data",(0,Bi._)`${e.data}${(0,Bi.getProperty)(r)}`,!0);c(y),t.errorPath=(0,Bi.str)`${d}${(0,tI.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,Bi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let d=i instanceof Bi.Name?i:l.let("data",i,!0);c(d),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}fo.extendSubschemaData=BU;function VU(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}fo.extendSubschemaMode=VU});var VS=V((AQ,nI)=>{"use strict";nI.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 sI=V((TQ,iI)=>{"use strict";var po=iI.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(){};Gh(e,n,i,t,"",t)};po.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};po.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};po.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};po.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 Gh(t,e,r,n,i,s,o,l,c,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,c,d);for(var p in n){var m=n[p];if(Array.isArray(m)){if(p in po.arrayKeywords)for(var y=0;y<m.length;y++)Gh(t,e,r,m[y],i+"/"+p+"/"+y,s,i,p,n,y)}else if(p in po.propsKeywords){if(m&&typeof m=="object")for(var b in m)Gh(t,e,r,m[b],i+"/"+p+"/"+WU(b),s,i,p,n,b)}else(p in po.keywords||t.allKeys&&!(p in po.skipKeywords))&&Gh(t,e,r,m,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,c,d)}}function WU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Rf=V(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.getSchemaRefs=nn.resolveUrl=nn.normalizeId=nn._getFullPath=nn.getFullPath=nn.inlineRef=void 0;var zU=rt(),JU=VS(),GU=sI(),YU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function KU(t,e=!0){return typeof t=="boolean"?!0:e===!0?!WS(t):e?oI(t)<=e:!1}nn.inlineRef=KU;var QU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function WS(t){for(let e in t){if(QU.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(WS)||typeof r=="object"&&WS(r))return!0}return!1}function oI(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!YU.has(r)&&(typeof t[r]=="object"&&(0,zU.eachItem)(t[r],n=>e+=oI(n)),e===1/0))return 1/0}return e}function aI(t,e="",r){r!==!1&&(e=uu(e));let n=t.parse(e);return lI(t,n)}nn.getFullPath=aI;function lI(t,e){return t.serialize(e).split("#")[0]+"#"}nn._getFullPath=lI;var ZU=/#\/?$/;function uu(t){return t?t.replace(ZU,""):""}nn.normalizeId=uu;function XU(t,e,r){return r=uu(r),t.resolve(e,r)}nn.resolveUrl=XU;var eH=/^[a-z_][-a-z0-9._]*$/i;function tH(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=uu(t[r]||e),s={"":i},o=aI(n,i,!1),l={},c=new Set;return GU(t,{allKeys:!0},(m,y,b,q)=>{if(q===void 0)return;let x=o+y,v=s[q];typeof m[r]=="string"&&(v=_.call(this,m[r])),E.call(this,m.$anchor),E.call(this,m.$dynamicAnchor),s[y]=v;function _(k){let P=this.opts.uriResolver.resolve;if(k=uu(v?P(v,k):k),c.has(k))throw p(k);c.add(k);let M=this.refs[k];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?d(m,M.schema,k):k!==uu(x)&&(k[0]==="#"?(d(m,l[k],k),l[k]=m):this.refs[k]=x),k}function E(k){if(typeof k=="string"){if(!eH.test(k))throw new Error(`invalid anchor "${k}"`);_.call(this,`#${k}`)}}}),l;function d(m,y,b){if(y!==void 0&&!JU(m,y))throw p(b)}function p(m){return new Error(`reference "${m}" resolves to more than one schema`)}}nn.getSchemaRefs=tH});var Ef=V(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.getData=ho.KeywordCxt=ho.validateFunctionCode=void 0;var pI=Hq(),uI=_f(),JS=FS(),Yh=_f(),rH=Yq(),Cf=eI(),zS=rI(),we=ze(),Oe=_s(),nH=Rf(),Rs=rt(),xf=wf();function iH(t){if(gI(t)&&(yI(t),mI(t))){aH(t);return}hI(t,()=>(0,pI.topBoolOrEmptySchema)(t))}ho.validateFunctionCode=iH;function hI({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,we._)`${Oe.default.data}, ${Oe.default.valCxt}`,n.$async,()=>{t.code((0,we._)`"use strict"; ${cI(r,i)}`),oH(t,i),t.code(s)}):t.func(e,(0,we._)`${Oe.default.data}, ${sH(i)}`,n.$async,()=>t.code(cI(r,i)).code(s))}function sH(t){return(0,we._)`{${Oe.default.instancePath}="", ${Oe.default.parentData}, ${Oe.default.parentDataProperty}, ${Oe.default.rootData}=${Oe.default.data}${t.dynamicRef?(0,we._)`, ${Oe.default.dynamicAnchors}={}`:we.nil}}={}`}function oH(t,e){t.if(Oe.default.valCxt,()=>{t.var(Oe.default.instancePath,(0,we._)`${Oe.default.valCxt}.${Oe.default.instancePath}`),t.var(Oe.default.parentData,(0,we._)`${Oe.default.valCxt}.${Oe.default.parentData}`),t.var(Oe.default.parentDataProperty,(0,we._)`${Oe.default.valCxt}.${Oe.default.parentDataProperty}`),t.var(Oe.default.rootData,(0,we._)`${Oe.default.valCxt}.${Oe.default.rootData}`),e.dynamicRef&&t.var(Oe.default.dynamicAnchors,(0,we._)`${Oe.default.valCxt}.${Oe.default.dynamicAnchors}`)},()=>{t.var(Oe.default.instancePath,(0,we._)`""`),t.var(Oe.default.parentData,(0,we._)`undefined`),t.var(Oe.default.parentDataProperty,(0,we._)`undefined`),t.var(Oe.default.rootData,Oe.default.data),e.dynamicRef&&t.var(Oe.default.dynamicAnchors,(0,we._)`{}`)})}function aH(t){let{schema:e,opts:r,gen:n}=t;hI(t,()=>{r.$comment&&e.$comment&&bI(t),dH(t),n.let(Oe.default.vErrors,null),n.let(Oe.default.errors,0),r.unevaluated&&lH(t),vI(t),mH(t)})}function lH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,we._)`${r}.evaluated`),e.if((0,we._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,we._)`${t.evaluated}.props`,(0,we._)`undefined`)),e.if((0,we._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,we._)`${t.evaluated}.items`,(0,we._)`undefined`))}function cI(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,we._)`/*# sourceURL=${r} */`:we.nil}function uH(t,e){if(gI(t)&&(yI(t),mI(t))){cH(t,e);return}(0,pI.boolOrEmptySchema)(t,e)}function mI({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 gI(t){return typeof t.schema!="boolean"}function cH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&bI(t),pH(t),hH(t);let s=n.const("_errs",Oe.default.errors);vI(t,s),n.var(e,(0,we._)`${s} === ${Oe.default.errors}`)}function yI(t){(0,Rs.checkUnknownRules)(t),fH(t)}function vI(t,e){if(t.opts.jtd)return fI(t,[],!1,e);let r=(0,uI.getSchemaTypes)(t.schema),n=(0,uI.coerceAndCheckDataType)(t,r);fI(t,r,!n,e)}function fH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Rs.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function dH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Rs.checkStrictMode)(t,"default is ignored in the schema root")}function pH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,nH.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function hH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function bI({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,we._)`${Oe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,we.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,we._)`${Oe.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function mH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,we._)`${Oe.default.errors} === 0`,()=>e.return(Oe.default.data),()=>e.throw((0,we._)`new ${i}(${Oe.default.vErrors})`)):(e.assign((0,we._)`${n}.errors`,Oe.default.vErrors),s.unevaluated&&gH(t),e.return((0,we._)`${Oe.default.errors} === 0`))}function gH({gen:t,evaluated:e,props:r,items:n}){r instanceof we.Name&&t.assign((0,we._)`${e}.props`,r),n instanceof we.Name&&t.assign((0,we._)`${e}.items`,n)}function fI(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:c,self:d}=t,{RULES:p}=d;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Rs.schemaHasRulesButRef)(s,p))){i.block(()=>wI(t,"$ref",p.all.$ref.definition));return}c.jtd||yH(t,e),i.block(()=>{for(let y of p.rules)m(y);m(p.post)});function m(y){(0,JS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,Yh.checkDataType)(y.type,o,c.strictNumbers)),dI(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,Yh.reportTypeError)(t)),i.endIf()):dI(t,y),l||i.if((0,we._)`${Oe.default.errors} === ${n||0}`))}}function dI(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,rH.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,JS.shouldUseRule)(n,s)&&wI(t,s.keyword,s.definition,e.type)})}function yH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(vH(t,e),t.opts.allowUnionTypes||bH(t,e),SH(t,t.dataTypes))}function vH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{SI(t.dataTypes,r)||GS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),_H(t,e)}}function bH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&GS(t,"use allowUnionTypes to allow union type keyword")}function SH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,JS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>wH(e,o))&&GS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function wH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function SI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function _H(t,e){let r=[];for(let n of t.dataTypes)SI(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function GS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Rs.checkStrictMode)(t,e,t.opts.strictTypes)}var Kh=class{constructor(e,r,n){if((0,Cf.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,Rs.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",_I(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Cf.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",Oe.default.errors))}result(e,r,n){this.failResult((0,we.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,we.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,we._)`${r} !== undefined && (${(0,we.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?xf.reportExtraError:xf.reportError)(this,this.def.error,r)}$dataError(){(0,xf.reportError)(this,this.def.$dataError||xf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,xf.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=we.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=we.nil,r=we.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,we.or)((0,we._)`${i} === undefined`,r)),e!==we.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==we.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,we.or)(o(),l());function o(){if(n.length){if(!(r instanceof we.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,we._)`${(0,Yh.checkDataTypes)(c,r,s.opts.strictNumbers,Yh.DataType.Wrong)}`}return we.nil}function l(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,we._)`!${c}(${r})`}return we.nil}}subschema(e,r){let n=(0,zS.getSubschema)(this.it,e);(0,zS.extendSubschemaData)(n,this.it,e),(0,zS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return uH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Rs.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Rs.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,we.Name)),!0}};ho.KeywordCxt=Kh;function wI(t,e,r,n){let i=new Kh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Cf.funcKeywordCode)(i,r):"macro"in r?(0,Cf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Cf.funcKeywordCode)(i,r)}var RH=/^\/(?:[^~]|~0|~1)*$/,xH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _I(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Oe.default.rootData;if(t[0]==="/"){if(!RH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Oe.default.rootData}else{let d=xH.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+d[1];if(i=d[2],i==="#"){if(p>=e)throw new Error(c("property/index",p));return n[e-p]}if(p>e)throw new Error(c("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let d of l)d&&(s=(0,we._)`${s}${(0,we.getProperty)((0,Rs.unescapeJsonPointer)(d))}`,o=(0,we._)`${o} && ${s}`);return o;function c(d,p){return`Cannot access ${d} ${p} levels up, current level is ${e}`}}ho.getData=_I});var Qh=V(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var YS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};KS.default=YS});var qf=V(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});var QS=Rf(),ZS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,QS.resolveUrl)(e,r,n),this.missingSchema=(0,QS.normalizeId)((0,QS.getFullPath)(e,this.missingRef))}};XS.default=ZS});var Xh=V(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.resolveSchema=Bn.getCompilingSchema=Bn.resolveRef=Bn.compileSchema=Bn.SchemaEnv=void 0;var ci=ze(),CH=Qh(),Ia=_s(),fi=Rf(),RI=rt(),EH=Ef(),cu=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,fi.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Bn.SchemaEnv=cu;function tw(t){let e=xI.call(this,t);if(e)return e;let r=(0,fi.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new ci.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:CH.default,code:(0,ci._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let d={gen:o,allErrors:this.opts.allErrors,data:Ia.default.data,parentData:Ia.default.parentData,parentDataProperty:Ia.default.parentDataProperty,dataNames:[Ia.default.data],dataPathArr:[ci.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,ci.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ci.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ci._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,EH.validateFunctionCode)(d),o.optimize(this.opts.code.optimize);let m=o.toString();p=`${o.scopeRefs(Ia.default.scope)}return ${m}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let b=new Function(`${Ia.default.self}`,`${Ia.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:b}),b.errors=null,b.schema=t.schema,b.schemaEnv=t,t.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:c,validateCode:m,scopeValues:o._values}),this.opts.unevaluated){let{props:q,items:x}=d;b.evaluated={props:q instanceof ci.Name?void 0:q,items:x instanceof ci.Name?void 0:x,dynamicProps:q instanceof ci.Name,dynamicItems:x instanceof ci.Name},b.source&&(b.source.evaluated=(0,ci.stringify)(b.evaluated))}return t.validate=b,t}catch(m){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),m}finally{this._compilations.delete(t)}}Bn.compileSchema=tw;function qH(t,e,r){var n;r=(0,fi.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=PH.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 cu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=IH.call(this,s)}Bn.resolveRef=qH;function IH(t){return(0,fi.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tw.call(this,t)}function xI(t){for(let e of this._compilations)if(OH(e,t))return e}Bn.getCompilingSchema=xI;function OH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function PH(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Zh.call(this,t,e)}function Zh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,fi._getFullPath)(this.opts.uriResolver,r),i=(0,fi.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return ew.call(this,r,t);let s=(0,fi.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=Zh.call(this,t,o);return typeof l?.schema!="object"?void 0:ew.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||tw.call(this,o),s===(0,fi.normalizeId)(e)){let{schema:l}=o,{schemaId:c}=this.opts,d=l[c];return d&&(i=(0,fi.resolveUrl)(this.opts.uriResolver,i,d)),new cu({schema:l,schemaId:c,root:t,baseId:i})}return ew.call(this,r,o)}}Bn.resolveSchema=Zh;var kH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ew(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 c=r[(0,RI.unescapeFragment)(l)];if(c===void 0)return;r=c;let d=typeof r=="object"&&r[this.opts.schemaId];!kH.has(l)&&d&&(e=(0,fi.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,RI.schemaHasRulesButRef)(r,this.RULES)){let l=(0,fi.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Zh.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new cu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var CI=V((jQ,AH)=>{AH.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 iw=V((LQ,kI)=>{"use strict";var TH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qI=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),rw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),II=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),$H=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function nw(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 NH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function EI(t){return t.length=0,!0}function MH(t,e,r){if(t.length){let n=nw(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function FH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=MH;for(let c=0;c<t.length;c++){let d=t[c];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,r))break;l=EI}else{i.push(d);continue}}return i.length&&(l===EI?r.zone=i.join(""):o?n.push(i.join("")):n.push(nw(i))),r.address=n.join(""),r}function OI(t){if(DH(t,":")<2)return{host:t,isIPV6:!1};let e=FH(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 DH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function jH(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 LH={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},UH=/[@/?#:]/g,HH=/[@/?#]/g;function PI(t,e){let r=e?HH:UH;return r.lastIndex=0,t.replace(r,n=>LH[n])}function BH(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(rw(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&II(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function VH(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(rw(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&II(s)?e+=s:e+="%"+i,r+=2;continue}}$H(t[r])?e+=t[r]:e+=escape(t[r])}return e}function WH(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(rw(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function zH(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!qI(r)){let n=OI(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=PI(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}kI.exports={nonSimpleDomain:NH,recomposeAuthority:zH,reescapeHostDelimiters:PI,normalizePercentEncoding:BH,normalizePathEncoding:VH,escapePreservingEscapes:WH,removeDotSegments:jH,isIPv4:qI,isUUID:TH,normalizeIPv6:OI,stringArrayToHexStripped:nw}});var MI=V((UQ,NI)=>{"use strict";var{isUUID:JH}=iw(),GH=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,YH=["http","https","ws","wss","urn","urn:uuid"];function KH(t){return YH.indexOf(t)!==-1}function sw(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 AI(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function TI(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 QH(t){return t.secure=sw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ZH(t){if((t.port===(sw(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 XH(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(GH);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=ow(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function eB(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=ow(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 tB(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!JH(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function rB(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var $I={scheme:"http",domainHost:!0,parse:AI,serialize:TI},nB={scheme:"https",domainHost:$I.domainHost,parse:AI,serialize:TI},em={scheme:"ws",domainHost:!0,parse:QH,serialize:ZH},iB={scheme:"wss",domainHost:em.domainHost,parse:em.parse,serialize:em.serialize},sB={scheme:"urn",parse:XH,serialize:eB,skipNormalize:!0},oB={scheme:"urn:uuid",parse:tB,serialize:rB,skipNormalize:!0},tm={http:$I,https:nB,ws:em,wss:iB,urn:sB,"urn:uuid":oB};Object.setPrototypeOf(tm,null);function ow(t){return t&&(tm[t]||tm[t.toLowerCase()])||void 0}NI.exports={wsIsSecure:sw,SCHEMES:tm,isValidSchemeName:KH,getSchemeHandler:ow}});var HI=V((HQ,rm)=>{"use strict";var{normalizeIPv6:aB,removeDotSegments:If,recomposeAuthority:lB,normalizePercentEncoding:uB,normalizePathEncoding:cB,escapePreservingEscapes:fB,reescapeHostDelimiters:dB,isIPv4:pB,nonSimpleDomain:hB}=iw(),{SCHEMES:mB,getSchemeHandler:DI}=MI();function gB(t,e){return typeof t=="string"?t=wB(t,e):typeof t=="object"&&(t=fu(Oa(t,e),e)),t}function yB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=jI(fu(t,n),fu(e,n),n,!0);return n.skipEscape=!0,Oa(i,n)}function jI(t,e,r,n){let i={};return n||(t=fu(Oa(t,r),r),e=fu(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=If(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=If(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=If(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=If(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 vB(t,e,r){let n=FI(t,r),i=FI(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=DI(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=uB(r.path):(r.path=fB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=lB(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=If(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 bB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function SB(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 LI(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(bB);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=SB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(pB(n.host)===!1){let p=aB(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 c=DI(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&hB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=dB(unescape(n.host),s))),n.path&&(n.path=cB(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function fu(t,e){return LI(t,e).parsed}function wB(t,e){return UI(t,e).normalized}function UI(t,e){let{parsed:r,malformedAuthorityOrPort:n}=LI(t,e);return{normalized:n?t:Oa(r,e),malformedAuthorityOrPort:n}}function FI(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=UI(t,e);return n?void 0:r}if(typeof t=="object")return Oa(t,e)}var aw={SCHEMES:mB,normalize:gB,resolve:yB,resolveComponent:jI,equal:vB,serialize:Oa,parse:fu};rm.exports=aw;rm.exports.default=aw;rm.exports.fastUri=aw});var VI=V(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});var BI=HI();BI.code='require("ajv/dist/runtime/uri").default';lw.default=BI});var ZI=V(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.CodeGen=gr.Name=gr.nil=gr.stringify=gr.str=gr._=gr.KeywordCxt=void 0;var _B=Ef();Object.defineProperty(gr,"KeywordCxt",{enumerable:!0,get:function(){return _B.KeywordCxt}});var du=ze();Object.defineProperty(gr,"_",{enumerable:!0,get:function(){return du._}});Object.defineProperty(gr,"str",{enumerable:!0,get:function(){return du.str}});Object.defineProperty(gr,"stringify",{enumerable:!0,get:function(){return du.stringify}});Object.defineProperty(gr,"nil",{enumerable:!0,get:function(){return du.nil}});Object.defineProperty(gr,"Name",{enumerable:!0,get:function(){return du.Name}});Object.defineProperty(gr,"CodeGen",{enumerable:!0,get:function(){return du.CodeGen}});var RB=Qh(),YI=qf(),xB=MS(),Of=Xh(),CB=ze(),Pf=Rf(),nm=_f(),cw=rt(),WI=CI(),EB=VI(),KI=(t,e)=>new RegExp(t,e);KI.code="new RegExp";var qB=["removeAdditional","useDefaults","coerceTypes"],IB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),OB={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."},PB={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},zI=200;function kB(t){var e,r,n,i,s,o,l,c,d,p,m,y,b,q,x,v,_,E,k,P,M,j,I,R,A;let F=t.strict,U=(e=t.code)===null||e===void 0?void 0:e.optimize,D=U===!0||U===void 0?1:U||0,J=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:KI,Q=(i=t.uriResolver)!==null&&i!==void 0?i:EB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(l=t.strictNumbers)!==null&&l!==void 0?l:F)!==null&&c!==void 0?c:!0,strictTypes:(p=(d=t.strictTypes)!==null&&d!==void 0?d:F)!==null&&p!==void 0?p:"log",strictTuples:(y=(m=t.strictTuples)!==null&&m!==void 0?m:F)!==null&&y!==void 0?y:"log",strictRequired:(q=(b=t.strictRequired)!==null&&b!==void 0?b:F)!==null&&q!==void 0?q:!1,code:t.code?{...t.code,optimize:D,regExp:J}:{optimize:D,regExp:J},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:zI,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:zI,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(E=t.messages)!==null&&E!==void 0?E:!0,inlineRefs:(k=t.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(P=t.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(M=t.addUsedSchema)!==null&&M!==void 0?M:!0,validateSchema:(j=t.validateSchema)!==null&&j!==void 0?j:!0,validateFormats:(I=t.validateFormats)!==null&&I!==void 0?I:!0,unicodeRegExp:(R=t.unicodeRegExp)!==null&&R!==void 0?R:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:Q}}var kf=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,...kB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new CB.ValueScope({scope:{},prefixes:IB,es5:r,lines:n}),this.logger=FB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,xB.getRules)(),JI.call(this,OB,e,"NOT SUPPORTED"),JI.call(this,PB,e,"DEPRECATED","warn"),this._metaOpts=NB.call(this),e.formats&&TB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&$B.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),AB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=WI;n==="id"&&(i={...WI},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,m){await s.call(this,p.$schema);let y=this._addSchema(p,m);return y.validate||o.call(this,y)}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(m){if(!(m instanceof YI.default))throw m;return l.call(this,m),await c.call(this,m.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:m}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${m} cannot be resolved`)}async function c(p){let m=await d.call(this,p);this.refs[p]||await s.call(this,m.$schema),this.refs[p]||this.addSchema(m,p,r)}async function d(p){let m=this._loading[p];if(m)return m;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,Pf.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=GI.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Of.SchemaEnv({schema:{},schemaId:n});if(r=Of.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=GI.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,Pf.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(jB.call(this,n,r),!r)return(0,cw.eachItem)(n,s=>uw.call(this,s)),this;UB.call(this,r);let i={...r,type:(0,nm.getJSONTypes)(r.type),schemaType:(0,nm.getJSONTypes)(r.schemaType)};return(0,cw.eachItem)(n,i.type.length===0?s=>uw.call(this,s,i):s=>i.type.forEach(o=>uw.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 c=n[l];if(typeof c!="object")continue;let{$data:d}=c.definition,p=o[l];d&&p&&(o[l]=QI(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 c=this._cache.get(e);if(c!==void 0)return c;n=(0,Pf.normalizeId)(o||n);let d=Pf.getSchemaRefs.call(this,e,n);return c=new Of.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_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):Of.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{Of.compileSchema.call(this,e)}finally{this.opts=r}}};kf.ValidationError=RB.default;kf.MissingRefError=YI.default;gr.default=kf;function JI(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 GI(t){return t=(0,Pf.normalizeId)(t),this.schemas[t]||this.refs[t]}function AB(){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 TB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function $B(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 NB(){let t={...this.opts};for(let e of qB)delete t[e];return t}var MB={log(){},warn(){},error(){}};function FB(t){if(t===!1)return MB;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 DB=/^[a-z_$][a-z0-9_$:-]*$/i;function jB(t,e){let{RULES:r}=this;if((0,cw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!DB.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 uw(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:c})=>c===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,nm.getJSONTypes)(e.type),schemaType:(0,nm.getJSONTypes)(e.schemaType)}};e.before?LB.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function LB(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 UB(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=QI(e)),t.validateSchema=this.compile(e,!0))}var HB={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function QI(t){return{anyOf:[t,HB]}}});var XI=V(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});var BB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};fw.default=BB});var nO=V(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.callRef=Pa.getValidate=void 0;var VB=qf(),eO=Hn(),sn=ze(),pu=_s(),tO=Xh(),im=rt(),WB={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:c}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return m();let p=tO.resolveRef.call(c,d,i,r);if(p===void 0)throw new VB.default(n.opts.uriResolver,i,r);if(p instanceof tO.SchemaEnv)return y(p);return b(p);function m(){if(s===d)return sm(t,o,s,s.$async);let q=e.scopeValue("root",{ref:d});return sm(t,(0,sn._)`${q}.validate`,d,d.$async)}function y(q){let x=rO(t,q);sm(t,x,q,q.$async)}function b(q){let x=e.scopeValue("schema",l.code.source===!0?{ref:q,code:(0,sn.stringify)(q)}:{ref:q}),v=e.name("valid"),_=t.subschema({schema:q,dataTypes:[],schemaPath:sn.nil,topSchemaRef:x,errSchemaPath:r},v);t.mergeEvaluated(_),t.ok(v)}}};function rO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,sn._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Pa.getValidate=rO;function sm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:c}=s,d=c.passContext?pu.default.this:sn.nil;n?p():m();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let q=i.let("valid");i.try(()=>{i.code((0,sn._)`await ${(0,eO.callValidateCode)(t,e,d)}`),b(e),o||i.assign(q,!0)},x=>{i.if((0,sn._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),y(x),o||i.assign(q,!1)}),t.ok(q)}function m(){t.result((0,eO.callValidateCode)(t,e,d),()=>b(e),()=>y(e))}function y(q){let x=(0,sn._)`${q}.errors`;i.assign(pu.default.vErrors,(0,sn._)`${pu.default.vErrors} === null ? ${x} : ${pu.default.vErrors}.concat(${x})`),i.assign(pu.default.errors,(0,sn._)`${pu.default.vErrors}.length`)}function b(q){var x;if(!s.opts.unevaluated)return;let v=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=im.mergeEvaluated.props(i,v.props,s.props));else{let _=i.var("props",(0,sn._)`${q}.evaluated.props`);s.props=im.mergeEvaluated.props(i,_,s.props,sn.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=im.mergeEvaluated.items(i,v.items,s.items));else{let _=i.var("items",(0,sn._)`${q}.evaluated.items`);s.items=im.mergeEvaluated.items(i,_,s.items,sn.Name)}}}Pa.callRef=sm;Pa.default=WB});var iO=V(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});var zB=XI(),JB=nO(),GB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",zB.default,JB.default];dw.default=GB});var sO=V(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});var om=ze(),mo=om.operators,am={maximum:{okStr:"<=",ok:mo.LTE,fail:mo.GT},minimum:{okStr:">=",ok:mo.GTE,fail:mo.LT},exclusiveMaximum:{okStr:"<",ok:mo.LT,fail:mo.GTE},exclusiveMinimum:{okStr:">",ok:mo.GT,fail:mo.LTE}},YB={message:({keyword:t,schemaCode:e})=>(0,om.str)`must be ${am[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,om._)`{comparison: ${am[t].okStr}, limit: ${e}}`},KB={keyword:Object.keys(am),type:"number",schemaType:"number",$data:!0,error:YB,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,om._)`${r} ${am[e].fail} ${n} || isNaN(${r})`)}};pw.default=KB});var oO=V(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});var Af=ze(),QB={message:({schemaCode:t})=>(0,Af.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Af._)`{multipleOf: ${t}}`},ZB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:QB,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Af._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Af._)`${o} !== parseInt(${o})`;t.fail$data((0,Af._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};hw.default=ZB});var lO=V(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});function aO(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}mw.default=aO;aO.code='require("ajv/dist/runtime/ucs2length").default'});var uO=V(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var ka=ze(),XB=rt(),eV=lO(),tV={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}}`},rV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:tV,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,XB.useFunc)(t.gen,eV.default)}(${r})`;t.fail$data((0,ka._)`${o} ${s} ${n}`)}};gw.default=rV});var cO=V(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});var nV=Hn(),iV=rt(),hu=ze(),sV={message:({schemaCode:t})=>(0,hu.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,hu._)`{pattern: ${t}}`},oV={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:c}=o.opts.code,d=c.code==="new RegExp"?(0,hu._)`new RegExp`:(0,iV.useFunc)(e,c),p=e.let("valid");e.try(()=>e.assign(p,(0,hu._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,hu._)`!${p}`)}else{let c=(0,nV.usePattern)(t,i);t.fail$data((0,hu._)`!${c}.test(${r})`)}}};yw.default=oV});var fO=V(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var Tf=ze(),aV={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Tf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Tf._)`{limit: ${t}}`},lV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:aV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Tf.operators.GT:Tf.operators.LT;t.fail$data((0,Tf._)`Object.keys(${r}).length ${i} ${n}`)}};vw.default=lV});var dO=V(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});var $f=Hn(),Nf=ze(),uV=rt(),cV={message:({params:{missingProperty:t}})=>(0,Nf.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Nf._)`{missingProperty: ${t}}`},fV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:cV,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 c=r.length>=l.loopRequired;if(o.allErrors?d():p(),l.strictRequired){let b=t.parentSchema.properties,{definedProperties:q}=t.it;for(let x of r)if(b?.[x]===void 0&&!q.has(x)){let v=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${x}" is not defined at "${v}" (strictRequired)`;(0,uV.checkStrictMode)(o,_,o.opts.strictRequired)}}function d(){if(c||s)t.block$data(Nf.nil,m);else for(let b of r)(0,$f.checkReportMissingProp)(t,b)}function p(){let b=e.let("missing");if(c||s){let q=e.let("valid",!0);t.block$data(q,()=>y(b,q)),t.ok(q)}else e.if((0,$f.checkMissingProp)(t,r,b)),(0,$f.reportMissingProp)(t,b),e.else()}function m(){e.forOf("prop",n,b=>{t.setParams({missingProperty:b}),e.if((0,$f.noPropertyInData)(e,i,b,l.ownProperties),()=>t.error())})}function y(b,q){t.setParams({missingProperty:b}),e.forOf(b,n,()=>{e.assign(q,(0,$f.propertyInData)(e,i,b,l.ownProperties)),e.if((0,Nf.not)(q),()=>{t.error(),e.break()})},Nf.nil)}}};bw.default=fV});var pO=V(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});var Mf=ze(),dV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Mf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Mf._)`{limit: ${t}}`},pV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:dV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Mf.operators.GT:Mf.operators.LT;t.fail$data((0,Mf._)`${r}.length ${i} ${n}`)}};Sw.default=pV});var lm=V(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var hO=VS();hO.code='require("ajv/dist/runtime/equal").default';ww.default=hO});var mO=V(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var _w=_f(),yr=ze(),hV=rt(),mV=lm(),gV={message:({params:{i:t,j:e}})=>(0,yr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,yr._)`{i: ${t}, j: ${e}}`},yV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:gV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let c=e.let("valid"),d=s.items?(0,_w.getSchemaTypes)(s.items):[];t.block$data(c,p,(0,yr._)`${o} === false`),t.ok(c);function p(){let q=e.let("i",(0,yr._)`${r}.length`),x=e.let("j");t.setParams({i:q,j:x}),e.assign(c,!0),e.if((0,yr._)`${q} > 1`,()=>(m()?y:b)(q,x))}function m(){return d.length>0&&!d.some(q=>q==="object"||q==="array")}function y(q,x){let v=e.name("item"),_=(0,_w.checkDataTypes)(d,v,l.opts.strictNumbers,_w.DataType.Wrong),E=e.const("indices",(0,yr._)`{}`);e.for((0,yr._)`;${q}--;`,()=>{e.let(v,(0,yr._)`${r}[${q}]`),e.if(_,(0,yr._)`continue`),d.length>1&&e.if((0,yr._)`typeof ${v} == "string"`,(0,yr._)`${v} += "_"`),e.if((0,yr._)`typeof ${E}[${v}] == "number"`,()=>{e.assign(x,(0,yr._)`${E}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,yr._)`${E}[${v}] = ${q}`)})}function b(q,x){let v=(0,hV.useFunc)(e,mV.default),_=e.name("outer");e.label(_).for((0,yr._)`;${q}--;`,()=>e.for((0,yr._)`${x} = ${q}; ${x}--;`,()=>e.if((0,yr._)`${v}(${r}[${q}], ${r}[${x}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};Rw.default=yV});var gO=V(Cw=>{"use strict";Object.defineProperty(Cw,"__esModule",{value:!0});var xw=ze(),vV=rt(),bV=lm(),SV={message:"must be equal to constant",params:({schemaCode:t})=>(0,xw._)`{allowedValue: ${t}}`},wV={keyword:"const",$data:!0,error:SV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,xw._)`!${(0,vV.useFunc)(e,bV.default)}(${r}, ${i})`):t.fail((0,xw._)`${s} !== ${r}`)}};Cw.default=wV});var yO=V(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});var Ff=ze(),_V=rt(),RV=lm(),xV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Ff._)`{allowedValues: ${t}}`},CV={keyword:"enum",schemaType:"array",$data:!0,error:xV,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,c,d=()=>c??(c=(0,_V.useFunc)(e,RV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let b=e.const("vSchema",s);p=(0,Ff.or)(...i.map((q,x)=>y(b,x)))}t.pass(p);function m(){e.assign(p,!1),e.forOf("v",s,b=>e.if((0,Ff._)`${d()}(${r}, ${b})`,()=>e.assign(p,!0).break()))}function y(b,q){let x=i[q];return typeof x=="object"&&x!==null?(0,Ff._)`${d()}(${r}, ${b}[${q}])`:(0,Ff._)`${r} === ${x}`}}};Ew.default=CV});var vO=V(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});var EV=sO(),qV=oO(),IV=uO(),OV=cO(),PV=fO(),kV=dO(),AV=pO(),TV=mO(),$V=gO(),NV=yO(),MV=[EV.default,qV.default,IV.default,OV.default,PV.default,kV.default,AV.default,TV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$V.default,NV.default];qw.default=MV});var Ow=V(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.validateAdditionalItems=void 0;var Aa=ze(),Iw=rt(),FV={message:({params:{len:t}})=>(0,Aa.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Aa._)`{limit: ${t}}`},DV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:FV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Iw.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}bO(t,n)}};function bO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,Aa._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Aa._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Iw.alwaysValidSchema)(o,n)){let d=r.var("valid",(0,Aa._)`${l} <= ${e.length}`);r.if((0,Aa.not)(d),()=>c(d)),t.ok(d)}function c(d){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:Iw.Type.Num},d),o.allErrors||r.if((0,Aa.not)(d),()=>r.break())})}}Df.validateAdditionalItems=bO;Df.default=DV});var Pw=V(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.validateTuple=void 0;var SO=ze(),um=rt(),jV=Hn(),LV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return wO(t,"additionalItems",e);r.items=!0,!(0,um.alwaysValidSchema)(r,e)&&t.ok((0,jV.validateArray)(t))}};function wO(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=um.mergeEvaluated.items(n,r.length,l.items));let c=n.name("valid"),d=n.const("len",(0,SO._)`${s}.length`);r.forEach((m,y)=>{(0,um.alwaysValidSchema)(l,m)||(n.if((0,SO._)`${d} > ${y}`,()=>t.subschema({keyword:o,schemaProp:y,dataProp:y},c)),t.ok(c))});function p(m){let{opts:y,errSchemaPath:b}=l,q=r.length,x=q===m.minItems&&(q===m.maxItems||m[e]===!1);if(y.strictTuples&&!x){let v=`"${o}" is ${q}-tuple, but minItems or maxItems/${e} are not specified or different at path "${b}"`;(0,um.checkStrictMode)(l,v,y.strictTuples)}}}jf.validateTuple=wO;jf.default=LV});var _O=V(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});var UV=Pw(),HV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,UV.validateTuple)(t,"items")};kw.default=HV});var xO=V(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});var RO=ze(),BV=rt(),VV=Hn(),WV=Ow(),zV={message:({params:{len:t}})=>(0,RO.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,RO._)`{limit: ${t}}`},JV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:zV,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,BV.alwaysValidSchema)(n,e)&&(i?(0,WV.validateAdditionalItems)(t,i):t.ok((0,VV.validateArray)(t)))}};Aw.default=JV});var CO=V(Tw=>{"use strict";Object.defineProperty(Tw,"__esModule",{value:!0});var Vn=ze(),cm=rt(),GV={message:({params:{min:t,max:e}})=>e===void 0?(0,Vn.str)`must contain at least ${t} valid item(s)`:(0,Vn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Vn._)`{minContains: ${t}}`:(0,Vn._)`{minContains: ${t}, maxContains: ${e}}`},YV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:GV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:c,maxContains:d}=n;s.opts.next?(o=c===void 0?1:c,l=d):o=1;let p=e.const("len",(0,Vn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,cm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,cm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,cm.alwaysValidSchema)(s,r)){let x=(0,Vn._)`${p} >= ${o}`;l!==void 0&&(x=(0,Vn._)`${x} && ${p} <= ${l}`),t.pass(x);return}s.items=!0;let m=e.name("valid");l===void 0&&o===1?b(m,()=>e.if(m,()=>e.break())):o===0?(e.let(m,!0),l!==void 0&&e.if((0,Vn._)`${i}.length > 0`,y)):(e.let(m,!1),y()),t.result(m,()=>t.reset());function y(){let x=e.name("_valid"),v=e.let("count",0);b(x,()=>e.if(x,()=>q(v)))}function b(x,v){e.forRange("i",0,p,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:cm.Type.Num,compositeRule:!0},x),v()})}function q(x){e.code((0,Vn._)`${x}++`),l===void 0?e.if((0,Vn._)`${x} >= ${o}`,()=>e.assign(m,!0).break()):(e.if((0,Vn._)`${x} > ${l}`,()=>e.assign(m,!1).break()),o===1?e.assign(m,!0):e.if((0,Vn._)`${x} >= ${o}`,()=>e.assign(m,!0)))}}};Tw.default=YV});var IO=V(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.validateSchemaDeps=Vi.validatePropertyDeps=Vi.error=void 0;var $w=ze(),KV=rt(),Lf=Hn();Vi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,$w.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,$w._)`{property: ${t},
27
+ || ${o} === "boolean" || ${i} === null`).assign(l,(0,Me._)`[${i}]`)}}}function vU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Me._)`${e} !== undefined`,()=>t.assign((0,Me._)`${e}[${r}]`,n))}function DS(t,e,r,n=au.Correct){let i=n===au.Correct?Me.operators.EQ:Me.operators.NEQ,s;switch(t){case"null":return(0,Me._)`${e} ${i} null`;case"array":s=(0,Me._)`Array.isArray(${e})`;break;case"object":s=(0,Me._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,Me._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,Me._)`typeof ${e} ${i} ${t}`}return n===au.Correct?s:(0,Me.not)(s);function o(l=Me.nil){return(0,Me.and)((0,Me._)`typeof ${e} == "number"`,l,r?(0,Me._)`isFinite(${e})`:Me.nil)}}qr.checkDataType=DS;function jS(t,e,r,n){if(t.length===1)return DS(t[0],e,r,n);let i,s=(0,Wq.toHash)(t);if(s.array&&s.object){let o=(0,Me._)`typeof ${e} != "object"`;i=s.null?o:(0,Me._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=Me.nil;s.number&&delete s.integer;for(let o in s)i=(0,Me.and)(i,DS(o,e,r,n));return i}qr.checkDataTypes=jS;var bU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Me._)`{type: ${t}}`:(0,Me._)`{type: ${e}}`};function LS(t){let e=SU(t);(0,pU.reportError)(e,bU)}qr.reportTypeError=LS;function SU(t){let{gen:e,data:r,schema:n}=t,i=(0,Wq.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Yq=V(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.assignDefaults=void 0;var lu=ze(),wU=rt();function _U(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Gq(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Gq(t,s,i.default))}Jh.assignDefaults=_U;function Gq(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,lu._)`${s}${(0,lu.getProperty)(e)}`;if(i){(0,wU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let c=(0,lu._)`${l} === undefined`;o.useDefaults==="empty"&&(c=(0,lu._)`${c} || ${l} === null || ${l} === ""`),n.if(c,(0,lu._)`${l} = ${(0,lu.stringify)(r)}`)}});var Hn=V(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateUnion=It.validateArray=It.usePattern=It.callValidateCode=It.schemaProperties=It.allSchemaProperties=It.noPropertyInData=It.propertyInData=It.isOwnProperty=It.hasPropFunc=It.reportMissingProp=It.checkMissingProp=It.checkReportMissingProp=void 0;var Mt=ze(),US=rt(),co=_s(),RU=rt();function xU(t,e){let{gen:r,data:n,it:i}=t;r.if(BS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Mt._)`${e}`},!0),t.error()})}It.checkReportMissingProp=xU;function CU({gen:t,data:e,it:{opts:r}},n,i){return(0,Mt.or)(...n.map(s=>(0,Mt.and)(BS(t,e,s,r.ownProperties),(0,Mt._)`${i} = ${s}`)))}It.checkMissingProp=CU;function EU(t,e){t.setParams({missingProperty:e},!0),t.error()}It.reportMissingProp=EU;function Kq(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Mt._)`Object.prototype.hasOwnProperty`})}It.hasPropFunc=Kq;function HS(t,e,r){return(0,Mt._)`${Kq(t)}.call(${e}, ${r})`}It.isOwnProperty=HS;function qU(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} !== undefined`;return n?(0,Mt._)`${i} && ${HS(t,e,r)}`:i}It.propertyInData=qU;function BS(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} === undefined`;return n?(0,Mt.or)(i,(0,Mt.not)(HS(t,e,r))):i}It.noPropertyInData=BS;function Qq(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}It.allSchemaProperties=Qq;function IU(t,e){return Qq(e).filter(r=>!(0,US.alwaysValidSchema)(t,e[r]))}It.schemaProperties=IU;function OU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,c,d){let p=d?(0,Mt._)`${t}, ${e}, ${n}${i}`:e,m=[[co.default.instancePath,(0,Mt.strConcat)(co.default.instancePath,s)],[co.default.parentData,o.parentData],[co.default.parentDataProperty,o.parentDataProperty],[co.default.rootData,co.default.rootData]];o.opts.dynamicRef&&m.push([co.default.dynamicAnchors,co.default.dynamicAnchors]);let y=(0,Mt._)`${p}, ${r.object(...m)}`;return c!==Mt.nil?(0,Mt._)`${l}.call(${c}, ${y})`:(0,Mt._)`${l}(${y})`}It.callValidateCode=OU;var PU=(0,Mt._)`new RegExp`;function kU({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,Mt._)`${i.code==="new RegExp"?PU:(0,RU.useFunc)(t,i)}(${r}, ${n})`})}It.usePattern=kU;function AU(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 c=e.const("len",(0,Mt._)`${r}.length`);e.forRange("i",0,c,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:US.Type.Num},s),e.if((0,Mt.not)(s),l)})}}It.validateArray=AU;function TU(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,US.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((c,d)=>{let p=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(o,(0,Mt._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Mt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}It.validateUnion=TU});var eI=V(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.validateKeywordUsage=Hi.validSchemaType=Hi.funcKeywordCode=Hi.macroKeywordCode=void 0;var Vr=ze(),qa=_s(),$U=Hn(),NU=wf();function MU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),c=Xq(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Vr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}Hi.macroKeywordCode=MU;function FU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:c}=t;jU(c,e);let d=!l&&e.compile?e.compile.call(c.self,s,o,c):e.validate,p=Xq(n,i,d),m=n.let("valid");t.block$data(m,y),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function y(){if(e.errors===!1)x(),e.modifying&&Zq(t),v(()=>t.error());else{let R=e.async?b():q();e.modifying&&Zq(t),v(()=>DU(t,R))}}function b(){let R=n.let("ruleErrs",null);return n.try(()=>x((0,Vr._)`await `),E=>n.assign(m,!1).if((0,Vr._)`${E} instanceof ${c.ValidationError}`,()=>n.assign(R,(0,Vr._)`${E}.errors`),()=>n.throw(E))),R}function q(){let R=(0,Vr._)`${p}.errors`;return n.assign(R,null),x(Vr.nil),R}function x(R=e.async?(0,Vr._)`await `:Vr.nil){let E=c.opts.passContext?qa.default.this:qa.default.self,k=!("compile"in e&&!l||e.schema===!1);n.assign(m,(0,Vr._)`${R}${(0,$U.callValidateCode)(t,p,E,k)}`,e.modifying)}function v(R){var E;n.if((0,Vr.not)((E=e.valid)!==null&&E!==void 0?E:m),R)}}Hi.funcKeywordCode=FU;function Zq(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Vr._)`${n.parentData}[${n.parentDataProperty}]`))}function DU(t,e){let{gen:r}=t;r.if((0,Vr._)`Array.isArray(${e})`,()=>{r.assign(qa.default.vErrors,(0,Vr._)`${qa.default.vErrors} === null ? ${e} : ${qa.default.vErrors}.concat(${e})`).assign(qa.default.errors,(0,Vr._)`${qa.default.vErrors}.length`),(0,NU.extendErrors)(t)},()=>t.error())}function jU({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Xq(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,Vr.stringify)(r)})}function LU(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")}Hi.validSchemaType=LU;function UU({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 c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Hi.validateKeywordUsage=UU});var rI=V(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.extendSubschemaMode=fo.extendSubschemaData=fo.getSubschema=void 0;var Bi=ze(),tI=rt();function HU(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,Bi._)`${t.schemaPath}${(0,Bi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Bi._)`${t.schemaPath}${(0,Bi.getProperty)(e)}${(0,Bi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,tI.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')}fo.getSubschema=HU;function BU(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:d,dataPathArr:p,opts:m}=e,y=l.let("data",(0,Bi._)`${e.data}${(0,Bi.getProperty)(r)}`,!0);c(y),t.errorPath=(0,Bi.str)`${d}${(0,tI.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,Bi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let d=i instanceof Bi.Name?i:l.let("data",i,!0);c(d),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}fo.extendSubschemaData=BU;function VU(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}fo.extendSubschemaMode=VU});var VS=V((AQ,nI)=>{"use strict";nI.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 sI=V((TQ,iI)=>{"use strict";var po=iI.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(){};Gh(e,n,i,t,"",t)};po.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};po.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};po.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};po.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 Gh(t,e,r,n,i,s,o,l,c,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,c,d);for(var p in n){var m=n[p];if(Array.isArray(m)){if(p in po.arrayKeywords)for(var y=0;y<m.length;y++)Gh(t,e,r,m[y],i+"/"+p+"/"+y,s,i,p,n,y)}else if(p in po.propsKeywords){if(m&&typeof m=="object")for(var b in m)Gh(t,e,r,m[b],i+"/"+p+"/"+WU(b),s,i,p,n,b)}else(p in po.keywords||t.allKeys&&!(p in po.skipKeywords))&&Gh(t,e,r,m,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,c,d)}}function WU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Rf=V(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.getSchemaRefs=nn.resolveUrl=nn.normalizeId=nn._getFullPath=nn.getFullPath=nn.inlineRef=void 0;var zU=rt(),JU=VS(),GU=sI(),YU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function KU(t,e=!0){return typeof t=="boolean"?!0:e===!0?!WS(t):e?oI(t)<=e:!1}nn.inlineRef=KU;var QU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function WS(t){for(let e in t){if(QU.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(WS)||typeof r=="object"&&WS(r))return!0}return!1}function oI(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!YU.has(r)&&(typeof t[r]=="object"&&(0,zU.eachItem)(t[r],n=>e+=oI(n)),e===1/0))return 1/0}return e}function aI(t,e="",r){r!==!1&&(e=uu(e));let n=t.parse(e);return lI(t,n)}nn.getFullPath=aI;function lI(t,e){return t.serialize(e).split("#")[0]+"#"}nn._getFullPath=lI;var ZU=/#\/?$/;function uu(t){return t?t.replace(ZU,""):""}nn.normalizeId=uu;function XU(t,e,r){return r=uu(r),t.resolve(e,r)}nn.resolveUrl=XU;var eH=/^[a-z_][-a-z0-9._]*$/i;function tH(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=uu(t[r]||e),s={"":i},o=aI(n,i,!1),l={},c=new Set;return GU(t,{allKeys:!0},(m,y,b,q)=>{if(q===void 0)return;let x=o+y,v=s[q];typeof m[r]=="string"&&(v=R.call(this,m[r])),E.call(this,m.$anchor),E.call(this,m.$dynamicAnchor),s[y]=v;function R(k){let P=this.opts.uriResolver.resolve;if(k=uu(v?P(v,k):k),c.has(k))throw p(k);c.add(k);let M=this.refs[k];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?d(m,M.schema,k):k!==uu(x)&&(k[0]==="#"?(d(m,l[k],k),l[k]=m):this.refs[k]=x),k}function E(k){if(typeof k=="string"){if(!eH.test(k))throw new Error(`invalid anchor "${k}"`);R.call(this,`#${k}`)}}}),l;function d(m,y,b){if(y!==void 0&&!JU(m,y))throw p(b)}function p(m){return new Error(`reference "${m}" resolves to more than one schema`)}}nn.getSchemaRefs=tH});var Ef=V(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.getData=ho.KeywordCxt=ho.validateFunctionCode=void 0;var pI=Hq(),uI=_f(),JS=FS(),Yh=_f(),rH=Yq(),Cf=eI(),zS=rI(),we=ze(),Oe=_s(),nH=Rf(),Rs=rt(),xf=wf();function iH(t){if(gI(t)&&(yI(t),mI(t))){aH(t);return}hI(t,()=>(0,pI.topBoolOrEmptySchema)(t))}ho.validateFunctionCode=iH;function hI({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,we._)`${Oe.default.data}, ${Oe.default.valCxt}`,n.$async,()=>{t.code((0,we._)`"use strict"; ${cI(r,i)}`),oH(t,i),t.code(s)}):t.func(e,(0,we._)`${Oe.default.data}, ${sH(i)}`,n.$async,()=>t.code(cI(r,i)).code(s))}function sH(t){return(0,we._)`{${Oe.default.instancePath}="", ${Oe.default.parentData}, ${Oe.default.parentDataProperty}, ${Oe.default.rootData}=${Oe.default.data}${t.dynamicRef?(0,we._)`, ${Oe.default.dynamicAnchors}={}`:we.nil}}={}`}function oH(t,e){t.if(Oe.default.valCxt,()=>{t.var(Oe.default.instancePath,(0,we._)`${Oe.default.valCxt}.${Oe.default.instancePath}`),t.var(Oe.default.parentData,(0,we._)`${Oe.default.valCxt}.${Oe.default.parentData}`),t.var(Oe.default.parentDataProperty,(0,we._)`${Oe.default.valCxt}.${Oe.default.parentDataProperty}`),t.var(Oe.default.rootData,(0,we._)`${Oe.default.valCxt}.${Oe.default.rootData}`),e.dynamicRef&&t.var(Oe.default.dynamicAnchors,(0,we._)`${Oe.default.valCxt}.${Oe.default.dynamicAnchors}`)},()=>{t.var(Oe.default.instancePath,(0,we._)`""`),t.var(Oe.default.parentData,(0,we._)`undefined`),t.var(Oe.default.parentDataProperty,(0,we._)`undefined`),t.var(Oe.default.rootData,Oe.default.data),e.dynamicRef&&t.var(Oe.default.dynamicAnchors,(0,we._)`{}`)})}function aH(t){let{schema:e,opts:r,gen:n}=t;hI(t,()=>{r.$comment&&e.$comment&&bI(t),dH(t),n.let(Oe.default.vErrors,null),n.let(Oe.default.errors,0),r.unevaluated&&lH(t),vI(t),mH(t)})}function lH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,we._)`${r}.evaluated`),e.if((0,we._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,we._)`${t.evaluated}.props`,(0,we._)`undefined`)),e.if((0,we._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,we._)`${t.evaluated}.items`,(0,we._)`undefined`))}function cI(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,we._)`/*# sourceURL=${r} */`:we.nil}function uH(t,e){if(gI(t)&&(yI(t),mI(t))){cH(t,e);return}(0,pI.boolOrEmptySchema)(t,e)}function mI({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 gI(t){return typeof t.schema!="boolean"}function cH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&bI(t),pH(t),hH(t);let s=n.const("_errs",Oe.default.errors);vI(t,s),n.var(e,(0,we._)`${s} === ${Oe.default.errors}`)}function yI(t){(0,Rs.checkUnknownRules)(t),fH(t)}function vI(t,e){if(t.opts.jtd)return fI(t,[],!1,e);let r=(0,uI.getSchemaTypes)(t.schema),n=(0,uI.coerceAndCheckDataType)(t,r);fI(t,r,!n,e)}function fH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Rs.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function dH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Rs.checkStrictMode)(t,"default is ignored in the schema root")}function pH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,nH.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function hH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function bI({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,we._)`${Oe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,we.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,we._)`${Oe.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function mH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,we._)`${Oe.default.errors} === 0`,()=>e.return(Oe.default.data),()=>e.throw((0,we._)`new ${i}(${Oe.default.vErrors})`)):(e.assign((0,we._)`${n}.errors`,Oe.default.vErrors),s.unevaluated&&gH(t),e.return((0,we._)`${Oe.default.errors} === 0`))}function gH({gen:t,evaluated:e,props:r,items:n}){r instanceof we.Name&&t.assign((0,we._)`${e}.props`,r),n instanceof we.Name&&t.assign((0,we._)`${e}.items`,n)}function fI(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:c,self:d}=t,{RULES:p}=d;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Rs.schemaHasRulesButRef)(s,p))){i.block(()=>wI(t,"$ref",p.all.$ref.definition));return}c.jtd||yH(t,e),i.block(()=>{for(let y of p.rules)m(y);m(p.post)});function m(y){(0,JS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,Yh.checkDataType)(y.type,o,c.strictNumbers)),dI(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,Yh.reportTypeError)(t)),i.endIf()):dI(t,y),l||i.if((0,we._)`${Oe.default.errors} === ${n||0}`))}}function dI(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,rH.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,JS.shouldUseRule)(n,s)&&wI(t,s.keyword,s.definition,e.type)})}function yH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(vH(t,e),t.opts.allowUnionTypes||bH(t,e),SH(t,t.dataTypes))}function vH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{SI(t.dataTypes,r)||GS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),_H(t,e)}}function bH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&GS(t,"use allowUnionTypes to allow union type keyword")}function SH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,JS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>wH(e,o))&&GS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function wH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function SI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function _H(t,e){let r=[];for(let n of t.dataTypes)SI(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function GS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Rs.checkStrictMode)(t,e,t.opts.strictTypes)}var Kh=class{constructor(e,r,n){if((0,Cf.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,Rs.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",_I(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Cf.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",Oe.default.errors))}result(e,r,n){this.failResult((0,we.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,we.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,we._)`${r} !== undefined && (${(0,we.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?xf.reportExtraError:xf.reportError)(this,this.def.error,r)}$dataError(){(0,xf.reportError)(this,this.def.$dataError||xf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,xf.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=we.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=we.nil,r=we.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,we.or)((0,we._)`${i} === undefined`,r)),e!==we.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==we.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,we.or)(o(),l());function o(){if(n.length){if(!(r instanceof we.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,we._)`${(0,Yh.checkDataTypes)(c,r,s.opts.strictNumbers,Yh.DataType.Wrong)}`}return we.nil}function l(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,we._)`!${c}(${r})`}return we.nil}}subschema(e,r){let n=(0,zS.getSubschema)(this.it,e);(0,zS.extendSubschemaData)(n,this.it,e),(0,zS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return uH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Rs.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Rs.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,we.Name)),!0}};ho.KeywordCxt=Kh;function wI(t,e,r,n){let i=new Kh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Cf.funcKeywordCode)(i,r):"macro"in r?(0,Cf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Cf.funcKeywordCode)(i,r)}var RH=/^\/(?:[^~]|~0|~1)*$/,xH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _I(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Oe.default.rootData;if(t[0]==="/"){if(!RH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Oe.default.rootData}else{let d=xH.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+d[1];if(i=d[2],i==="#"){if(p>=e)throw new Error(c("property/index",p));return n[e-p]}if(p>e)throw new Error(c("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let d of l)d&&(s=(0,we._)`${s}${(0,we.getProperty)((0,Rs.unescapeJsonPointer)(d))}`,o=(0,we._)`${o} && ${s}`);return o;function c(d,p){return`Cannot access ${d} ${p} levels up, current level is ${e}`}}ho.getData=_I});var Qh=V(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var YS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};KS.default=YS});var qf=V(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});var QS=Rf(),ZS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,QS.resolveUrl)(e,r,n),this.missingSchema=(0,QS.normalizeId)((0,QS.getFullPath)(e,this.missingRef))}};XS.default=ZS});var Xh=V(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.resolveSchema=Bn.getCompilingSchema=Bn.resolveRef=Bn.compileSchema=Bn.SchemaEnv=void 0;var ci=ze(),CH=Qh(),Ia=_s(),fi=Rf(),RI=rt(),EH=Ef(),cu=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,fi.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Bn.SchemaEnv=cu;function tw(t){let e=xI.call(this,t);if(e)return e;let r=(0,fi.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new ci.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:CH.default,code:(0,ci._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let d={gen:o,allErrors:this.opts.allErrors,data:Ia.default.data,parentData:Ia.default.parentData,parentDataProperty:Ia.default.parentDataProperty,dataNames:[Ia.default.data],dataPathArr:[ci.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,ci.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:ci.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ci._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,EH.validateFunctionCode)(d),o.optimize(this.opts.code.optimize);let m=o.toString();p=`${o.scopeRefs(Ia.default.scope)}return ${m}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let b=new Function(`${Ia.default.self}`,`${Ia.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:b}),b.errors=null,b.schema=t.schema,b.schemaEnv=t,t.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:c,validateCode:m,scopeValues:o._values}),this.opts.unevaluated){let{props:q,items:x}=d;b.evaluated={props:q instanceof ci.Name?void 0:q,items:x instanceof ci.Name?void 0:x,dynamicProps:q instanceof ci.Name,dynamicItems:x instanceof ci.Name},b.source&&(b.source.evaluated=(0,ci.stringify)(b.evaluated))}return t.validate=b,t}catch(m){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),m}finally{this._compilations.delete(t)}}Bn.compileSchema=tw;function qH(t,e,r){var n;r=(0,fi.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=PH.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 cu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=IH.call(this,s)}Bn.resolveRef=qH;function IH(t){return(0,fi.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tw.call(this,t)}function xI(t){for(let e of this._compilations)if(OH(e,t))return e}Bn.getCompilingSchema=xI;function OH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function PH(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Zh.call(this,t,e)}function Zh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,fi._getFullPath)(this.opts.uriResolver,r),i=(0,fi.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return ew.call(this,r,t);let s=(0,fi.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=Zh.call(this,t,o);return typeof l?.schema!="object"?void 0:ew.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||tw.call(this,o),s===(0,fi.normalizeId)(e)){let{schema:l}=o,{schemaId:c}=this.opts,d=l[c];return d&&(i=(0,fi.resolveUrl)(this.opts.uriResolver,i,d)),new cu({schema:l,schemaId:c,root:t,baseId:i})}return ew.call(this,r,o)}}Bn.resolveSchema=Zh;var kH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ew(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 c=r[(0,RI.unescapeFragment)(l)];if(c===void 0)return;r=c;let d=typeof r=="object"&&r[this.opts.schemaId];!kH.has(l)&&d&&(e=(0,fi.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,RI.schemaHasRulesButRef)(r,this.RULES)){let l=(0,fi.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Zh.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new cu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var CI=V((jQ,AH)=>{AH.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 iw=V((LQ,kI)=>{"use strict";var TH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qI=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),rw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),II=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),$H=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function nw(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 NH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function EI(t){return t.length=0,!0}function MH(t,e,r){if(t.length){let n=nw(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function FH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=MH;for(let c=0;c<t.length;c++){let d=t[c];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,r))break;l=EI}else{i.push(d);continue}}return i.length&&(l===EI?r.zone=i.join(""):o?n.push(i.join("")):n.push(nw(i))),r.address=n.join(""),r}function OI(t){if(DH(t,":")<2)return{host:t,isIPV6:!1};let e=FH(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 DH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function jH(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 LH={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},UH=/[@/?#:]/g,HH=/[@/?#]/g;function PI(t,e){let r=e?HH:UH;return r.lastIndex=0,t.replace(r,n=>LH[n])}function BH(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(rw(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&II(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function VH(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(rw(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&II(s)?e+=s:e+="%"+i,r+=2;continue}}$H(t[r])?e+=t[r]:e+=escape(t[r])}return e}function WH(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(rw(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function zH(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!qI(r)){let n=OI(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=PI(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}kI.exports={nonSimpleDomain:NH,recomposeAuthority:zH,reescapeHostDelimiters:PI,normalizePercentEncoding:BH,normalizePathEncoding:VH,escapePreservingEscapes:WH,removeDotSegments:jH,isIPv4:qI,isUUID:TH,normalizeIPv6:OI,stringArrayToHexStripped:nw}});var MI=V((UQ,NI)=>{"use strict";var{isUUID:JH}=iw(),GH=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,YH=["http","https","ws","wss","urn","urn:uuid"];function KH(t){return YH.indexOf(t)!==-1}function sw(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 AI(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function TI(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 QH(t){return t.secure=sw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ZH(t){if((t.port===(sw(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 XH(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(GH);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=ow(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function eB(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=ow(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 tB(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!JH(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function rB(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var $I={scheme:"http",domainHost:!0,parse:AI,serialize:TI},nB={scheme:"https",domainHost:$I.domainHost,parse:AI,serialize:TI},em={scheme:"ws",domainHost:!0,parse:QH,serialize:ZH},iB={scheme:"wss",domainHost:em.domainHost,parse:em.parse,serialize:em.serialize},sB={scheme:"urn",parse:XH,serialize:eB,skipNormalize:!0},oB={scheme:"urn:uuid",parse:tB,serialize:rB,skipNormalize:!0},tm={http:$I,https:nB,ws:em,wss:iB,urn:sB,"urn:uuid":oB};Object.setPrototypeOf(tm,null);function ow(t){return t&&(tm[t]||tm[t.toLowerCase()])||void 0}NI.exports={wsIsSecure:sw,SCHEMES:tm,isValidSchemeName:KH,getSchemeHandler:ow}});var HI=V((HQ,rm)=>{"use strict";var{normalizeIPv6:aB,removeDotSegments:If,recomposeAuthority:lB,normalizePercentEncoding:uB,normalizePathEncoding:cB,escapePreservingEscapes:fB,reescapeHostDelimiters:dB,isIPv4:pB,nonSimpleDomain:hB}=iw(),{SCHEMES:mB,getSchemeHandler:DI}=MI();function gB(t,e){return typeof t=="string"?t=wB(t,e):typeof t=="object"&&(t=fu(Oa(t,e),e)),t}function yB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=jI(fu(t,n),fu(e,n),n,!0);return n.skipEscape=!0,Oa(i,n)}function jI(t,e,r,n){let i={};return n||(t=fu(Oa(t,r),r),e=fu(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=If(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=If(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=If(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=If(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 vB(t,e,r){let n=FI(t,r),i=FI(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=DI(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=uB(r.path):(r.path=fB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=lB(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=If(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 bB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function SB(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 LI(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(bB);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=SB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(pB(n.host)===!1){let p=aB(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 c=DI(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&hB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=dB(unescape(n.host),s))),n.path&&(n.path=cB(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function fu(t,e){return LI(t,e).parsed}function wB(t,e){return UI(t,e).normalized}function UI(t,e){let{parsed:r,malformedAuthorityOrPort:n}=LI(t,e);return{normalized:n?t:Oa(r,e),malformedAuthorityOrPort:n}}function FI(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=UI(t,e);return n?void 0:r}if(typeof t=="object")return Oa(t,e)}var aw={SCHEMES:mB,normalize:gB,resolve:yB,resolveComponent:jI,equal:vB,serialize:Oa,parse:fu};rm.exports=aw;rm.exports.default=aw;rm.exports.fastUri=aw});var VI=V(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});var BI=HI();BI.code='require("ajv/dist/runtime/uri").default';lw.default=BI});var ZI=V(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.CodeGen=gr.Name=gr.nil=gr.stringify=gr.str=gr._=gr.KeywordCxt=void 0;var _B=Ef();Object.defineProperty(gr,"KeywordCxt",{enumerable:!0,get:function(){return _B.KeywordCxt}});var du=ze();Object.defineProperty(gr,"_",{enumerable:!0,get:function(){return du._}});Object.defineProperty(gr,"str",{enumerable:!0,get:function(){return du.str}});Object.defineProperty(gr,"stringify",{enumerable:!0,get:function(){return du.stringify}});Object.defineProperty(gr,"nil",{enumerable:!0,get:function(){return du.nil}});Object.defineProperty(gr,"Name",{enumerable:!0,get:function(){return du.Name}});Object.defineProperty(gr,"CodeGen",{enumerable:!0,get:function(){return du.CodeGen}});var RB=Qh(),YI=qf(),xB=MS(),Of=Xh(),CB=ze(),Pf=Rf(),nm=_f(),cw=rt(),WI=CI(),EB=VI(),KI=(t,e)=>new RegExp(t,e);KI.code="new RegExp";var qB=["removeAdditional","useDefaults","coerceTypes"],IB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),OB={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."},PB={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},zI=200;function kB(t){var e,r,n,i,s,o,l,c,d,p,m,y,b,q,x,v,R,E,k,P,M,j,I,_,A;let F=t.strict,U=(e=t.code)===null||e===void 0?void 0:e.optimize,D=U===!0||U===void 0?1:U||0,J=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:KI,Q=(i=t.uriResolver)!==null&&i!==void 0?i:EB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(l=t.strictNumbers)!==null&&l!==void 0?l:F)!==null&&c!==void 0?c:!0,strictTypes:(p=(d=t.strictTypes)!==null&&d!==void 0?d:F)!==null&&p!==void 0?p:"log",strictTuples:(y=(m=t.strictTuples)!==null&&m!==void 0?m:F)!==null&&y!==void 0?y:"log",strictRequired:(q=(b=t.strictRequired)!==null&&b!==void 0?b:F)!==null&&q!==void 0?q:!1,code:t.code?{...t.code,optimize:D,regExp:J}:{optimize:D,regExp:J},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:zI,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:zI,meta:(R=t.meta)!==null&&R!==void 0?R:!0,messages:(E=t.messages)!==null&&E!==void 0?E:!0,inlineRefs:(k=t.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(P=t.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(M=t.addUsedSchema)!==null&&M!==void 0?M:!0,validateSchema:(j=t.validateSchema)!==null&&j!==void 0?j:!0,validateFormats:(I=t.validateFormats)!==null&&I!==void 0?I:!0,unicodeRegExp:(_=t.unicodeRegExp)!==null&&_!==void 0?_:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:Q}}var kf=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,...kB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new CB.ValueScope({scope:{},prefixes:IB,es5:r,lines:n}),this.logger=FB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,xB.getRules)(),JI.call(this,OB,e,"NOT SUPPORTED"),JI.call(this,PB,e,"DEPRECATED","warn"),this._metaOpts=NB.call(this),e.formats&&TB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&$B.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),AB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=WI;n==="id"&&(i={...WI},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,m){await s.call(this,p.$schema);let y=this._addSchema(p,m);return y.validate||o.call(this,y)}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(m){if(!(m instanceof YI.default))throw m;return l.call(this,m),await c.call(this,m.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:m}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${m} cannot be resolved`)}async function c(p){let m=await d.call(this,p);this.refs[p]||await s.call(this,m.$schema),this.refs[p]||this.addSchema(m,p,r)}async function d(p){let m=this._loading[p];if(m)return m;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,Pf.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=GI.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Of.SchemaEnv({schema:{},schemaId:n});if(r=Of.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=GI.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,Pf.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(jB.call(this,n,r),!r)return(0,cw.eachItem)(n,s=>uw.call(this,s)),this;UB.call(this,r);let i={...r,type:(0,nm.getJSONTypes)(r.type),schemaType:(0,nm.getJSONTypes)(r.schemaType)};return(0,cw.eachItem)(n,i.type.length===0?s=>uw.call(this,s,i):s=>i.type.forEach(o=>uw.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 c=n[l];if(typeof c!="object")continue;let{$data:d}=c.definition,p=o[l];d&&p&&(o[l]=QI(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 c=this._cache.get(e);if(c!==void 0)return c;n=(0,Pf.normalizeId)(o||n);let d=Pf.getSchemaRefs.call(this,e,n);return c=new Of.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_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):Of.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{Of.compileSchema.call(this,e)}finally{this.opts=r}}};kf.ValidationError=RB.default;kf.MissingRefError=YI.default;gr.default=kf;function JI(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 GI(t){return t=(0,Pf.normalizeId)(t),this.schemas[t]||this.refs[t]}function AB(){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 TB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function $B(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 NB(){let t={...this.opts};for(let e of qB)delete t[e];return t}var MB={log(){},warn(){},error(){}};function FB(t){if(t===!1)return MB;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 DB=/^[a-z_$][a-z0-9_$:-]*$/i;function jB(t,e){let{RULES:r}=this;if((0,cw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!DB.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 uw(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:c})=>c===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,nm.getJSONTypes)(e.type),schemaType:(0,nm.getJSONTypes)(e.schemaType)}};e.before?LB.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function LB(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 UB(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=QI(e)),t.validateSchema=this.compile(e,!0))}var HB={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function QI(t){return{anyOf:[t,HB]}}});var XI=V(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});var BB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};fw.default=BB});var nO=V(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.callRef=Pa.getValidate=void 0;var VB=qf(),eO=Hn(),sn=ze(),pu=_s(),tO=Xh(),im=rt(),WB={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:c}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return m();let p=tO.resolveRef.call(c,d,i,r);if(p===void 0)throw new VB.default(n.opts.uriResolver,i,r);if(p instanceof tO.SchemaEnv)return y(p);return b(p);function m(){if(s===d)return sm(t,o,s,s.$async);let q=e.scopeValue("root",{ref:d});return sm(t,(0,sn._)`${q}.validate`,d,d.$async)}function y(q){let x=rO(t,q);sm(t,x,q,q.$async)}function b(q){let x=e.scopeValue("schema",l.code.source===!0?{ref:q,code:(0,sn.stringify)(q)}:{ref:q}),v=e.name("valid"),R=t.subschema({schema:q,dataTypes:[],schemaPath:sn.nil,topSchemaRef:x,errSchemaPath:r},v);t.mergeEvaluated(R),t.ok(v)}}};function rO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,sn._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Pa.getValidate=rO;function sm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:c}=s,d=c.passContext?pu.default.this:sn.nil;n?p():m();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let q=i.let("valid");i.try(()=>{i.code((0,sn._)`await ${(0,eO.callValidateCode)(t,e,d)}`),b(e),o||i.assign(q,!0)},x=>{i.if((0,sn._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),y(x),o||i.assign(q,!1)}),t.ok(q)}function m(){t.result((0,eO.callValidateCode)(t,e,d),()=>b(e),()=>y(e))}function y(q){let x=(0,sn._)`${q}.errors`;i.assign(pu.default.vErrors,(0,sn._)`${pu.default.vErrors} === null ? ${x} : ${pu.default.vErrors}.concat(${x})`),i.assign(pu.default.errors,(0,sn._)`${pu.default.vErrors}.length`)}function b(q){var x;if(!s.opts.unevaluated)return;let v=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=im.mergeEvaluated.props(i,v.props,s.props));else{let R=i.var("props",(0,sn._)`${q}.evaluated.props`);s.props=im.mergeEvaluated.props(i,R,s.props,sn.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=im.mergeEvaluated.items(i,v.items,s.items));else{let R=i.var("items",(0,sn._)`${q}.evaluated.items`);s.items=im.mergeEvaluated.items(i,R,s.items,sn.Name)}}}Pa.callRef=sm;Pa.default=WB});var iO=V(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});var zB=XI(),JB=nO(),GB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",zB.default,JB.default];dw.default=GB});var sO=V(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});var om=ze(),mo=om.operators,am={maximum:{okStr:"<=",ok:mo.LTE,fail:mo.GT},minimum:{okStr:">=",ok:mo.GTE,fail:mo.LT},exclusiveMaximum:{okStr:"<",ok:mo.LT,fail:mo.GTE},exclusiveMinimum:{okStr:">",ok:mo.GT,fail:mo.LTE}},YB={message:({keyword:t,schemaCode:e})=>(0,om.str)`must be ${am[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,om._)`{comparison: ${am[t].okStr}, limit: ${e}}`},KB={keyword:Object.keys(am),type:"number",schemaType:"number",$data:!0,error:YB,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,om._)`${r} ${am[e].fail} ${n} || isNaN(${r})`)}};pw.default=KB});var oO=V(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});var Af=ze(),QB={message:({schemaCode:t})=>(0,Af.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Af._)`{multipleOf: ${t}}`},ZB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:QB,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Af._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Af._)`${o} !== parseInt(${o})`;t.fail$data((0,Af._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};hw.default=ZB});var lO=V(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});function aO(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}mw.default=aO;aO.code='require("ajv/dist/runtime/ucs2length").default'});var uO=V(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var ka=ze(),XB=rt(),eV=lO(),tV={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}}`},rV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:tV,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,XB.useFunc)(t.gen,eV.default)}(${r})`;t.fail$data((0,ka._)`${o} ${s} ${n}`)}};gw.default=rV});var cO=V(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});var nV=Hn(),iV=rt(),hu=ze(),sV={message:({schemaCode:t})=>(0,hu.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,hu._)`{pattern: ${t}}`},oV={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:c}=o.opts.code,d=c.code==="new RegExp"?(0,hu._)`new RegExp`:(0,iV.useFunc)(e,c),p=e.let("valid");e.try(()=>e.assign(p,(0,hu._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,hu._)`!${p}`)}else{let c=(0,nV.usePattern)(t,i);t.fail$data((0,hu._)`!${c}.test(${r})`)}}};yw.default=oV});var fO=V(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var Tf=ze(),aV={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Tf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Tf._)`{limit: ${t}}`},lV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:aV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Tf.operators.GT:Tf.operators.LT;t.fail$data((0,Tf._)`Object.keys(${r}).length ${i} ${n}`)}};vw.default=lV});var dO=V(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});var $f=Hn(),Nf=ze(),uV=rt(),cV={message:({params:{missingProperty:t}})=>(0,Nf.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Nf._)`{missingProperty: ${t}}`},fV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:cV,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 c=r.length>=l.loopRequired;if(o.allErrors?d():p(),l.strictRequired){let b=t.parentSchema.properties,{definedProperties:q}=t.it;for(let x of r)if(b?.[x]===void 0&&!q.has(x)){let v=o.schemaEnv.baseId+o.errSchemaPath,R=`required property "${x}" is not defined at "${v}" (strictRequired)`;(0,uV.checkStrictMode)(o,R,o.opts.strictRequired)}}function d(){if(c||s)t.block$data(Nf.nil,m);else for(let b of r)(0,$f.checkReportMissingProp)(t,b)}function p(){let b=e.let("missing");if(c||s){let q=e.let("valid",!0);t.block$data(q,()=>y(b,q)),t.ok(q)}else e.if((0,$f.checkMissingProp)(t,r,b)),(0,$f.reportMissingProp)(t,b),e.else()}function m(){e.forOf("prop",n,b=>{t.setParams({missingProperty:b}),e.if((0,$f.noPropertyInData)(e,i,b,l.ownProperties),()=>t.error())})}function y(b,q){t.setParams({missingProperty:b}),e.forOf(b,n,()=>{e.assign(q,(0,$f.propertyInData)(e,i,b,l.ownProperties)),e.if((0,Nf.not)(q),()=>{t.error(),e.break()})},Nf.nil)}}};bw.default=fV});var pO=V(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});var Mf=ze(),dV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Mf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Mf._)`{limit: ${t}}`},pV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:dV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Mf.operators.GT:Mf.operators.LT;t.fail$data((0,Mf._)`${r}.length ${i} ${n}`)}};Sw.default=pV});var lm=V(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var hO=VS();hO.code='require("ajv/dist/runtime/equal").default';ww.default=hO});var mO=V(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var _w=_f(),yr=ze(),hV=rt(),mV=lm(),gV={message:({params:{i:t,j:e}})=>(0,yr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,yr._)`{i: ${t}, j: ${e}}`},yV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:gV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let c=e.let("valid"),d=s.items?(0,_w.getSchemaTypes)(s.items):[];t.block$data(c,p,(0,yr._)`${o} === false`),t.ok(c);function p(){let q=e.let("i",(0,yr._)`${r}.length`),x=e.let("j");t.setParams({i:q,j:x}),e.assign(c,!0),e.if((0,yr._)`${q} > 1`,()=>(m()?y:b)(q,x))}function m(){return d.length>0&&!d.some(q=>q==="object"||q==="array")}function y(q,x){let v=e.name("item"),R=(0,_w.checkDataTypes)(d,v,l.opts.strictNumbers,_w.DataType.Wrong),E=e.const("indices",(0,yr._)`{}`);e.for((0,yr._)`;${q}--;`,()=>{e.let(v,(0,yr._)`${r}[${q}]`),e.if(R,(0,yr._)`continue`),d.length>1&&e.if((0,yr._)`typeof ${v} == "string"`,(0,yr._)`${v} += "_"`),e.if((0,yr._)`typeof ${E}[${v}] == "number"`,()=>{e.assign(x,(0,yr._)`${E}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,yr._)`${E}[${v}] = ${q}`)})}function b(q,x){let v=(0,hV.useFunc)(e,mV.default),R=e.name("outer");e.label(R).for((0,yr._)`;${q}--;`,()=>e.for((0,yr._)`${x} = ${q}; ${x}--;`,()=>e.if((0,yr._)`${v}(${r}[${q}], ${r}[${x}])`,()=>{t.error(),e.assign(c,!1).break(R)})))}}};Rw.default=yV});var gO=V(Cw=>{"use strict";Object.defineProperty(Cw,"__esModule",{value:!0});var xw=ze(),vV=rt(),bV=lm(),SV={message:"must be equal to constant",params:({schemaCode:t})=>(0,xw._)`{allowedValue: ${t}}`},wV={keyword:"const",$data:!0,error:SV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,xw._)`!${(0,vV.useFunc)(e,bV.default)}(${r}, ${i})`):t.fail((0,xw._)`${s} !== ${r}`)}};Cw.default=wV});var yO=V(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});var Ff=ze(),_V=rt(),RV=lm(),xV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Ff._)`{allowedValues: ${t}}`},CV={keyword:"enum",schemaType:"array",$data:!0,error:xV,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,c,d=()=>c??(c=(0,_V.useFunc)(e,RV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let b=e.const("vSchema",s);p=(0,Ff.or)(...i.map((q,x)=>y(b,x)))}t.pass(p);function m(){e.assign(p,!1),e.forOf("v",s,b=>e.if((0,Ff._)`${d()}(${r}, ${b})`,()=>e.assign(p,!0).break()))}function y(b,q){let x=i[q];return typeof x=="object"&&x!==null?(0,Ff._)`${d()}(${r}, ${b}[${q}])`:(0,Ff._)`${r} === ${x}`}}};Ew.default=CV});var vO=V(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});var EV=sO(),qV=oO(),IV=uO(),OV=cO(),PV=fO(),kV=dO(),AV=pO(),TV=mO(),$V=gO(),NV=yO(),MV=[EV.default,qV.default,IV.default,OV.default,PV.default,kV.default,AV.default,TV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$V.default,NV.default];qw.default=MV});var Ow=V(Df=>{"use strict";Object.defineProperty(Df,"__esModule",{value:!0});Df.validateAdditionalItems=void 0;var Aa=ze(),Iw=rt(),FV={message:({params:{len:t}})=>(0,Aa.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Aa._)`{limit: ${t}}`},DV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:FV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Iw.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}bO(t,n)}};function bO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,Aa._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Aa._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Iw.alwaysValidSchema)(o,n)){let d=r.var("valid",(0,Aa._)`${l} <= ${e.length}`);r.if((0,Aa.not)(d),()=>c(d)),t.ok(d)}function c(d){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:Iw.Type.Num},d),o.allErrors||r.if((0,Aa.not)(d),()=>r.break())})}}Df.validateAdditionalItems=bO;Df.default=DV});var Pw=V(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.validateTuple=void 0;var SO=ze(),um=rt(),jV=Hn(),LV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return wO(t,"additionalItems",e);r.items=!0,!(0,um.alwaysValidSchema)(r,e)&&t.ok((0,jV.validateArray)(t))}};function wO(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=um.mergeEvaluated.items(n,r.length,l.items));let c=n.name("valid"),d=n.const("len",(0,SO._)`${s}.length`);r.forEach((m,y)=>{(0,um.alwaysValidSchema)(l,m)||(n.if((0,SO._)`${d} > ${y}`,()=>t.subschema({keyword:o,schemaProp:y,dataProp:y},c)),t.ok(c))});function p(m){let{opts:y,errSchemaPath:b}=l,q=r.length,x=q===m.minItems&&(q===m.maxItems||m[e]===!1);if(y.strictTuples&&!x){let v=`"${o}" is ${q}-tuple, but minItems or maxItems/${e} are not specified or different at path "${b}"`;(0,um.checkStrictMode)(l,v,y.strictTuples)}}}jf.validateTuple=wO;jf.default=LV});var _O=V(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});var UV=Pw(),HV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,UV.validateTuple)(t,"items")};kw.default=HV});var xO=V(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});var RO=ze(),BV=rt(),VV=Hn(),WV=Ow(),zV={message:({params:{len:t}})=>(0,RO.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,RO._)`{limit: ${t}}`},JV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:zV,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,BV.alwaysValidSchema)(n,e)&&(i?(0,WV.validateAdditionalItems)(t,i):t.ok((0,VV.validateArray)(t)))}};Aw.default=JV});var CO=V(Tw=>{"use strict";Object.defineProperty(Tw,"__esModule",{value:!0});var Vn=ze(),cm=rt(),GV={message:({params:{min:t,max:e}})=>e===void 0?(0,Vn.str)`must contain at least ${t} valid item(s)`:(0,Vn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Vn._)`{minContains: ${t}}`:(0,Vn._)`{minContains: ${t}, maxContains: ${e}}`},YV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:GV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:c,maxContains:d}=n;s.opts.next?(o=c===void 0?1:c,l=d):o=1;let p=e.const("len",(0,Vn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,cm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,cm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,cm.alwaysValidSchema)(s,r)){let x=(0,Vn._)`${p} >= ${o}`;l!==void 0&&(x=(0,Vn._)`${x} && ${p} <= ${l}`),t.pass(x);return}s.items=!0;let m=e.name("valid");l===void 0&&o===1?b(m,()=>e.if(m,()=>e.break())):o===0?(e.let(m,!0),l!==void 0&&e.if((0,Vn._)`${i}.length > 0`,y)):(e.let(m,!1),y()),t.result(m,()=>t.reset());function y(){let x=e.name("_valid"),v=e.let("count",0);b(x,()=>e.if(x,()=>q(v)))}function b(x,v){e.forRange("i",0,p,R=>{t.subschema({keyword:"contains",dataProp:R,dataPropType:cm.Type.Num,compositeRule:!0},x),v()})}function q(x){e.code((0,Vn._)`${x}++`),l===void 0?e.if((0,Vn._)`${x} >= ${o}`,()=>e.assign(m,!0).break()):(e.if((0,Vn._)`${x} > ${l}`,()=>e.assign(m,!1).break()),o===1?e.assign(m,!0):e.if((0,Vn._)`${x} >= ${o}`,()=>e.assign(m,!0)))}}};Tw.default=YV});var IO=V(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.validateSchemaDeps=Vi.validatePropertyDeps=Vi.error=void 0;var $w=ze(),KV=rt(),Lf=Hn();Vi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,$w.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,$w._)`{property: ${t},
28
28
  missingProperty: ${n},
29
29
  depsCount: ${e},
30
- deps: ${r}}`};var QV={keyword:"dependencies",type:"object",schemaType:"object",error:Vi.error,code(t){let[e,r]=ZV(t);EO(t,e),qO(t,r)}};function ZV({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 EO(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 c=(0,Lf.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(c,()=>{for(let d of l)(0,Lf.checkReportMissingProp)(t,d)}):(r.if((0,$w._)`${c} && (${(0,Lf.checkMissingProp)(t,l,s)})`),(0,Lf.reportMissingProp)(t,s),r.else())}}Vi.validatePropertyDeps=EO;function qO(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,KV.alwaysValidSchema)(s,e[l])||(r.if((0,Lf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}Vi.validateSchemaDeps=qO;Vi.default=QV});var PO=V(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});var OO=ze(),XV=rt(),eW={message:"property name must be valid",params:({params:t})=>(0,OO._)`{propertyName: ${t.propertyName}}`},tW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:eW,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,XV.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,OO.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};Nw.default=tW});var Fw=V(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var fm=Hn(),di=ze(),rW=_s(),dm=rt(),nW={message:"must NOT have additional properties",params:({params:t})=>(0,di._)`{additionalProperty: ${t.additionalProperty}}`},iW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nW,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:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,dm.alwaysValidSchema)(o,r))return;let d=(0,fm.allSchemaProperties)(n.properties),p=(0,fm.allSchemaProperties)(n.patternProperties);m(),t.ok((0,di._)`${s} === ${rW.default.errors}`);function m(){e.forIn("key",i,v=>{!d.length&&!p.length?q(v):e.if(y(v),()=>q(v))})}function y(v){let _;if(d.length>8){let E=(0,dm.schemaRefOrVal)(o,n.properties,"properties");_=(0,fm.isOwnProperty)(e,E,v)}else d.length?_=(0,di.or)(...d.map(E=>(0,di._)`${v} === ${E}`)):_=di.nil;return p.length&&(_=(0,di.or)(_,...p.map(E=>(0,di._)`${(0,fm.usePattern)(t,E)}.test(${v})`))),(0,di.not)(_)}function b(v){e.code((0,di._)`delete ${i}[${v}]`)}function q(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){b(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,dm.alwaysValidSchema)(o,r)){let _=e.name("valid");c.removeAdditional==="failing"?(x(v,_,!1),e.if((0,di.not)(_),()=>{t.reset(),b(v)})):(x(v,_),l||e.if((0,di.not)(_),()=>e.break()))}}function x(v,_,E){let k={keyword:"additionalProperties",dataProp:v,dataPropType:dm.Type.Str};E===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(k,_)}}};Mw.default=iW});var TO=V(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});var sW=Ef(),kO=Hn(),Dw=rt(),AO=Fw(),oW={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&&AO.default.code(new sW.KeywordCxt(s,AO.default,"additionalProperties"));let o=(0,kO.allSchemaProperties)(r);for(let m of o)s.definedProperties.add(m);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=Dw.mergeEvaluated.props(e,(0,Dw.toHash)(o),s.props));let l=o.filter(m=>!(0,Dw.alwaysValidSchema)(s,r[m]));if(l.length===0)return;let c=e.name("valid");for(let m of l)d(m)?p(m):(e.if((0,kO.propertyInData)(e,i,m,s.opts.ownProperties)),p(m),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(c);function d(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function p(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},c)}}};jw.default=oW});var FO=V(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var $O=Hn(),pm=ze(),NO=rt(),MO=rt(),aW={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,$O.allSchemaProperties)(r),c=l.filter(x=>(0,NO.alwaysValidSchema)(s,r[x]));if(l.length===0||c.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof pm.Name)&&(s.props=(0,MO.evaluatedPropsToName)(e,s.props));let{props:m}=s;y();function y(){for(let x of l)d&&b(x),s.allErrors?q(x):(e.var(p,!0),q(x),e.if(p))}function b(x){for(let v in d)new RegExp(x).test(v)&&(0,NO.checkStrictMode)(s,`property ${v} matches pattern ${x} (use allowMatchingProperties)`)}function q(x){e.forIn("key",n,v=>{e.if((0,pm._)`${(0,$O.usePattern)(t,x)}.test(${v})`,()=>{let _=c.includes(x);_||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:v,dataPropType:MO.Type.Str},p),s.opts.unevaluated&&m!==!0?e.assign((0,pm._)`${m}[${v}]`,!0):!_&&!s.allErrors&&e.if((0,pm.not)(p),()=>e.break())})})}}};Lw.default=aW});var DO=V(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var lW=rt(),uW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,lW.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"}};Uw.default=uW});var jO=V(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});var cW=Hn(),fW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cW.validateUnion,error:{message:"must match a schema in anyOf"}};Hw.default=fW});var LO=V(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});var hm=ze(),dW=rt(),pW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,hm._)`{passingSchemas: ${t.passing}}`},hW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:pW,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),c=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(o,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((p,m)=>{let y;(0,dW.alwaysValidSchema)(i,p)?e.var(c,!0):y=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},c),m>0&&e.if((0,hm._)`${c} && ${o}`).assign(o,!1).assign(l,(0,hm._)`[${l}, ${m}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(l,m),y&&t.mergeEvaluated(y,hm.Name)})})}}};Bw.default=hW});var UO=V(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});var mW=rt(),gW={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,mW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};Vw.default=gW});var VO=V(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var mm=ze(),BO=rt(),yW={message:({params:t})=>(0,mm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,mm._)`{failingKeyword: ${t.ifClause}}`},vW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:yW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,BO.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=HO(n,"then"),s=HO(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(c(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,d("then",p),d("else",p))}else i?e.if(l,d("then")):e.if((0,mm.not)(l),d("else"));t.pass(o,()=>t.error(!0));function c(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function d(p,m){return()=>{let y=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(y,o),m?e.assign(m,(0,mm._)`${p}`):t.setParams({ifClause:p})}}}};function HO(t,e){let r=t.schema[e];return r!==void 0&&!(0,BO.alwaysValidSchema)(t,r)}Ww.default=vW});var WO=V(zw=>{"use strict";Object.defineProperty(zw,"__esModule",{value:!0});var bW=rt(),SW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,bW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};zw.default=SW});var zO=V(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var wW=Ow(),_W=_O(),RW=Pw(),xW=xO(),CW=CO(),EW=IO(),qW=PO(),IW=Fw(),OW=TO(),PW=FO(),kW=DO(),AW=jO(),TW=LO(),$W=UO(),NW=VO(),MW=WO();function FW(t=!1){let e=[kW.default,AW.default,TW.default,$W.default,NW.default,MW.default,qW.default,IW.default,EW.default,OW.default,PW.default];return t?e.push(_W.default,xW.default):e.push(wW.default,RW.default),e.push(CW.default),e}Jw.default=FW});var JO=V(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});var Xt=ze(),DW={message:({schemaCode:t})=>(0,Xt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Xt._)`{format: ${t}}`},jW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:DW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:c,errSchemaPath:d,schemaEnv:p,self:m}=l;if(!c.validateFormats)return;i?y():b();function y(){let q=r.scopeValue("formats",{ref:m.formats,code:c.code.formats}),x=r.const("fDef",(0,Xt._)`${q}[${o}]`),v=r.let("fType"),_=r.let("format");r.if((0,Xt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(v,(0,Xt._)`${x}.type || "string"`).assign(_,(0,Xt._)`${x}.validate`),()=>r.assign(v,(0,Xt._)`"string"`).assign(_,x)),t.fail$data((0,Xt.or)(E(),k()));function E(){return c.strictSchema===!1?Xt.nil:(0,Xt._)`${o} && !${_}`}function k(){let P=p.$async?(0,Xt._)`(${x}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,Xt._)`${_}(${n})`,M=(0,Xt._)`(typeof ${_} == "function" ? ${P} : ${_}.test(${n}))`;return(0,Xt._)`${_} && ${_} !== true && ${v} === ${e} && !${M}`}}function b(){let q=m.formats[s];if(!q){E();return}if(q===!0)return;let[x,v,_]=k(q);x===e&&t.pass(P());function E(){if(c.strictSchema===!1){m.logger.warn(M());return}throw new Error(M());function M(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function k(M){let j=M instanceof RegExp?(0,Xt.regexpCode)(M):c.code.formats?(0,Xt._)`${c.code.formats}${(0,Xt.getProperty)(s)}`:void 0,I=r.scopeValue("formats",{key:s,ref:M,code:j});return typeof M=="object"&&!(M instanceof RegExp)?[M.type||"string",M.validate,(0,Xt._)`${I}.validate`]:["string",M,I]}function P(){if(typeof q=="object"&&!(q instanceof RegExp)&&q.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Xt._)`await ${_}(${n})`}return typeof v=="function"?(0,Xt._)`${_}(${n})`:(0,Xt._)`${_}.test(${n})`}}}};Gw.default=jW});var GO=V(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});var LW=JO(),UW=[LW.default];Yw.default=UW});var YO=V(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.contentVocabulary=mu.metadataVocabulary=void 0;mu.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];mu.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var QO=V(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});var HW=iO(),BW=vO(),VW=zO(),WW=GO(),KO=YO(),zW=[HW.default,BW.default,(0,VW.default)(),WW.default,KO.metadataVocabulary,KO.contentVocabulary];Kw.default=zW});var XO=V(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.DiscrError=void 0;var ZO;(function(t){t.Tag="tag",t.Mapping="mapping"})(ZO||(gm.DiscrError=ZO={}))});var tP=V(Zw=>{"use strict";Object.defineProperty(Zw,"__esModule",{value:!0});var gu=ze(),Qw=XO(),eP=Xh(),JW=qf(),GW=rt(),YW={message:({params:{discrError:t,tagName:e}})=>t===Qw.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,gu._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},KW={keyword:"discriminator",type:"object",schemaType:"object",error:YW,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 c=e.let("valid",!1),d=e.const("tag",(0,gu._)`${r}${(0,gu.getProperty)(l)}`);e.if((0,gu._)`typeof ${d} == "string"`,()=>p(),()=>t.error(!1,{discrError:Qw.DiscrError.Tag,tag:d,tagName:l})),t.ok(c);function p(){let b=y();e.if(!1);for(let q in b)e.elseIf((0,gu._)`${d} === ${q}`),e.assign(c,m(b[q]));e.else(),t.error(!1,{discrError:Qw.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function m(b){let q=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:b},q);return t.mergeEvaluated(x,gu.Name),q}function y(){var b;let q={},x=_(i),v=!0;for(let P=0;P<o.length;P++){let M=o[P];if(M?.$ref&&!(0,GW.schemaHasRulesButRef)(M,s.self.RULES)){let I=M.$ref;if(M=eP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,I),M instanceof eP.SchemaEnv&&(M=M.schema),M===void 0)throw new JW.default(s.opts.uriResolver,s.baseId,I)}let j=(b=M?.properties)===null||b===void 0?void 0:b[l];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);v=v&&(x||_(M)),E(j,P)}if(!v)throw new Error(`discriminator: "${l}" must be required`);return q;function _({required:P}){return Array.isArray(P)&&P.includes(l)}function E(P,M){if(P.const)k(P.const,M);else if(P.enum)for(let j of P.enum)k(j,M);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function k(P,M){if(typeof P!="string"||P in q)throw new Error(`discriminator: "${l}" values must be unique strings`);q[P]=M}}}};Zw.default=KW});var rP=V((PZ,QW)=>{QW.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 iP=V((Ft,Xw)=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.MissingRefError=Ft.ValidationError=Ft.CodeGen=Ft.Name=Ft.nil=Ft.stringify=Ft.str=Ft._=Ft.KeywordCxt=Ft.Ajv=void 0;var ZW=ZI(),XW=QO(),ez=tP(),nP=rP(),tz=["/properties"],ym="http://json-schema.org/draft-07/schema",yu=class extends ZW.default{_addVocabularies(){super._addVocabularies(),XW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(ez.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(nP,tz):nP;this.addMetaSchema(e,ym,!1),this.refs["http://json-schema.org/schema"]=ym}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ym)?ym:void 0)}};Ft.Ajv=yu;Xw.exports=Ft=yu;Xw.exports.Ajv=yu;Object.defineProperty(Ft,"__esModule",{value:!0});Ft.default=yu;var rz=Ef();Object.defineProperty(Ft,"KeywordCxt",{enumerable:!0,get:function(){return rz.KeywordCxt}});var vu=ze();Object.defineProperty(Ft,"_",{enumerable:!0,get:function(){return vu._}});Object.defineProperty(Ft,"str",{enumerable:!0,get:function(){return vu.str}});Object.defineProperty(Ft,"stringify",{enumerable:!0,get:function(){return vu.stringify}});Object.defineProperty(Ft,"nil",{enumerable:!0,get:function(){return vu.nil}});Object.defineProperty(Ft,"Name",{enumerable:!0,get:function(){return vu.Name}});Object.defineProperty(Ft,"CodeGen",{enumerable:!0,get:function(){return vu.CodeGen}});var nz=Qh();Object.defineProperty(Ft,"ValidationError",{enumerable:!0,get:function(){return nz.default}});var iz=qf();Object.defineProperty(Ft,"MissingRefError",{enumerable:!0,get:function(){return iz.default}})});import*as sz from"crypto";import*as Ta from"fs";import{createRequire as oz}from"module";import*as pi from"path";function bm(){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 sP(){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 e0(t,e){return new vm(t,e)}var vm,t0=le(()=>{"use strict";cS();vm=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:eu}),crypto:()=>sz,path:()=>pi,querystring:()=>wt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>Rq(),sP),moment:()=>this.loadOptionalModule("moment",()=>xq(),bm),tv4:()=>this.loadOptionalModule("tv4",()=>Eq()),ajv:()=>this.loadOptionalModule("ajv",()=>iP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>wt("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=pi.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 QV={keyword:"dependencies",type:"object",schemaType:"object",error:Vi.error,code(t){let[e,r]=ZV(t);EO(t,e),qO(t,r)}};function ZV({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 EO(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 c=(0,Lf.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(c,()=>{for(let d of l)(0,Lf.checkReportMissingProp)(t,d)}):(r.if((0,$w._)`${c} && (${(0,Lf.checkMissingProp)(t,l,s)})`),(0,Lf.reportMissingProp)(t,s),r.else())}}Vi.validatePropertyDeps=EO;function qO(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,KV.alwaysValidSchema)(s,e[l])||(r.if((0,Lf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}Vi.validateSchemaDeps=qO;Vi.default=QV});var PO=V(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});var OO=ze(),XV=rt(),eW={message:"property name must be valid",params:({params:t})=>(0,OO._)`{propertyName: ${t.propertyName}}`},tW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:eW,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,XV.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,OO.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};Nw.default=tW});var Fw=V(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var fm=Hn(),di=ze(),rW=_s(),dm=rt(),nW={message:"must NOT have additional properties",params:({params:t})=>(0,di._)`{additionalProperty: ${t.additionalProperty}}`},iW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nW,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:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,dm.alwaysValidSchema)(o,r))return;let d=(0,fm.allSchemaProperties)(n.properties),p=(0,fm.allSchemaProperties)(n.patternProperties);m(),t.ok((0,di._)`${s} === ${rW.default.errors}`);function m(){e.forIn("key",i,v=>{!d.length&&!p.length?q(v):e.if(y(v),()=>q(v))})}function y(v){let R;if(d.length>8){let E=(0,dm.schemaRefOrVal)(o,n.properties,"properties");R=(0,fm.isOwnProperty)(e,E,v)}else d.length?R=(0,di.or)(...d.map(E=>(0,di._)`${v} === ${E}`)):R=di.nil;return p.length&&(R=(0,di.or)(R,...p.map(E=>(0,di._)`${(0,fm.usePattern)(t,E)}.test(${v})`))),(0,di.not)(R)}function b(v){e.code((0,di._)`delete ${i}[${v}]`)}function q(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){b(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,dm.alwaysValidSchema)(o,r)){let R=e.name("valid");c.removeAdditional==="failing"?(x(v,R,!1),e.if((0,di.not)(R),()=>{t.reset(),b(v)})):(x(v,R),l||e.if((0,di.not)(R),()=>e.break()))}}function x(v,R,E){let k={keyword:"additionalProperties",dataProp:v,dataPropType:dm.Type.Str};E===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(k,R)}}};Mw.default=iW});var TO=V(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});var sW=Ef(),kO=Hn(),Dw=rt(),AO=Fw(),oW={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&&AO.default.code(new sW.KeywordCxt(s,AO.default,"additionalProperties"));let o=(0,kO.allSchemaProperties)(r);for(let m of o)s.definedProperties.add(m);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=Dw.mergeEvaluated.props(e,(0,Dw.toHash)(o),s.props));let l=o.filter(m=>!(0,Dw.alwaysValidSchema)(s,r[m]));if(l.length===0)return;let c=e.name("valid");for(let m of l)d(m)?p(m):(e.if((0,kO.propertyInData)(e,i,m,s.opts.ownProperties)),p(m),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(c);function d(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function p(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},c)}}};jw.default=oW});var FO=V(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var $O=Hn(),pm=ze(),NO=rt(),MO=rt(),aW={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,$O.allSchemaProperties)(r),c=l.filter(x=>(0,NO.alwaysValidSchema)(s,r[x]));if(l.length===0||c.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof pm.Name)&&(s.props=(0,MO.evaluatedPropsToName)(e,s.props));let{props:m}=s;y();function y(){for(let x of l)d&&b(x),s.allErrors?q(x):(e.var(p,!0),q(x),e.if(p))}function b(x){for(let v in d)new RegExp(x).test(v)&&(0,NO.checkStrictMode)(s,`property ${v} matches pattern ${x} (use allowMatchingProperties)`)}function q(x){e.forIn("key",n,v=>{e.if((0,pm._)`${(0,$O.usePattern)(t,x)}.test(${v})`,()=>{let R=c.includes(x);R||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:v,dataPropType:MO.Type.Str},p),s.opts.unevaluated&&m!==!0?e.assign((0,pm._)`${m}[${v}]`,!0):!R&&!s.allErrors&&e.if((0,pm.not)(p),()=>e.break())})})}}};Lw.default=aW});var DO=V(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var lW=rt(),uW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,lW.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"}};Uw.default=uW});var jO=V(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});var cW=Hn(),fW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cW.validateUnion,error:{message:"must match a schema in anyOf"}};Hw.default=fW});var LO=V(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});var hm=ze(),dW=rt(),pW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,hm._)`{passingSchemas: ${t.passing}}`},hW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:pW,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),c=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(o,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((p,m)=>{let y;(0,dW.alwaysValidSchema)(i,p)?e.var(c,!0):y=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},c),m>0&&e.if((0,hm._)`${c} && ${o}`).assign(o,!1).assign(l,(0,hm._)`[${l}, ${m}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(l,m),y&&t.mergeEvaluated(y,hm.Name)})})}}};Bw.default=hW});var UO=V(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});var mW=rt(),gW={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,mW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};Vw.default=gW});var VO=V(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var mm=ze(),BO=rt(),yW={message:({params:t})=>(0,mm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,mm._)`{failingKeyword: ${t.ifClause}}`},vW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:yW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,BO.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=HO(n,"then"),s=HO(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(c(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,d("then",p),d("else",p))}else i?e.if(l,d("then")):e.if((0,mm.not)(l),d("else"));t.pass(o,()=>t.error(!0));function c(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function d(p,m){return()=>{let y=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(y,o),m?e.assign(m,(0,mm._)`${p}`):t.setParams({ifClause:p})}}}};function HO(t,e){let r=t.schema[e];return r!==void 0&&!(0,BO.alwaysValidSchema)(t,r)}Ww.default=vW});var WO=V(zw=>{"use strict";Object.defineProperty(zw,"__esModule",{value:!0});var bW=rt(),SW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,bW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};zw.default=SW});var zO=V(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var wW=Ow(),_W=_O(),RW=Pw(),xW=xO(),CW=CO(),EW=IO(),qW=PO(),IW=Fw(),OW=TO(),PW=FO(),kW=DO(),AW=jO(),TW=LO(),$W=UO(),NW=VO(),MW=WO();function FW(t=!1){let e=[kW.default,AW.default,TW.default,$W.default,NW.default,MW.default,qW.default,IW.default,EW.default,OW.default,PW.default];return t?e.push(_W.default,xW.default):e.push(wW.default,RW.default),e.push(CW.default),e}Jw.default=FW});var JO=V(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});var Xt=ze(),DW={message:({schemaCode:t})=>(0,Xt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Xt._)`{format: ${t}}`},jW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:DW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:c,errSchemaPath:d,schemaEnv:p,self:m}=l;if(!c.validateFormats)return;i?y():b();function y(){let q=r.scopeValue("formats",{ref:m.formats,code:c.code.formats}),x=r.const("fDef",(0,Xt._)`${q}[${o}]`),v=r.let("fType"),R=r.let("format");r.if((0,Xt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(v,(0,Xt._)`${x}.type || "string"`).assign(R,(0,Xt._)`${x}.validate`),()=>r.assign(v,(0,Xt._)`"string"`).assign(R,x)),t.fail$data((0,Xt.or)(E(),k()));function E(){return c.strictSchema===!1?Xt.nil:(0,Xt._)`${o} && !${R}`}function k(){let P=p.$async?(0,Xt._)`(${x}.async ? await ${R}(${n}) : ${R}(${n}))`:(0,Xt._)`${R}(${n})`,M=(0,Xt._)`(typeof ${R} == "function" ? ${P} : ${R}.test(${n}))`;return(0,Xt._)`${R} && ${R} !== true && ${v} === ${e} && !${M}`}}function b(){let q=m.formats[s];if(!q){E();return}if(q===!0)return;let[x,v,R]=k(q);x===e&&t.pass(P());function E(){if(c.strictSchema===!1){m.logger.warn(M());return}throw new Error(M());function M(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function k(M){let j=M instanceof RegExp?(0,Xt.regexpCode)(M):c.code.formats?(0,Xt._)`${c.code.formats}${(0,Xt.getProperty)(s)}`:void 0,I=r.scopeValue("formats",{key:s,ref:M,code:j});return typeof M=="object"&&!(M instanceof RegExp)?[M.type||"string",M.validate,(0,Xt._)`${I}.validate`]:["string",M,I]}function P(){if(typeof q=="object"&&!(q instanceof RegExp)&&q.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Xt._)`await ${R}(${n})`}return typeof v=="function"?(0,Xt._)`${R}(${n})`:(0,Xt._)`${R}.test(${n})`}}}};Gw.default=jW});var GO=V(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});var LW=JO(),UW=[LW.default];Yw.default=UW});var YO=V(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.contentVocabulary=mu.metadataVocabulary=void 0;mu.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];mu.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var QO=V(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});var HW=iO(),BW=vO(),VW=zO(),WW=GO(),KO=YO(),zW=[HW.default,BW.default,(0,VW.default)(),WW.default,KO.metadataVocabulary,KO.contentVocabulary];Kw.default=zW});var XO=V(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.DiscrError=void 0;var ZO;(function(t){t.Tag="tag",t.Mapping="mapping"})(ZO||(gm.DiscrError=ZO={}))});var tP=V(Zw=>{"use strict";Object.defineProperty(Zw,"__esModule",{value:!0});var gu=ze(),Qw=XO(),eP=Xh(),JW=qf(),GW=rt(),YW={message:({params:{discrError:t,tagName:e}})=>t===Qw.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,gu._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},KW={keyword:"discriminator",type:"object",schemaType:"object",error:YW,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 c=e.let("valid",!1),d=e.const("tag",(0,gu._)`${r}${(0,gu.getProperty)(l)}`);e.if((0,gu._)`typeof ${d} == "string"`,()=>p(),()=>t.error(!1,{discrError:Qw.DiscrError.Tag,tag:d,tagName:l})),t.ok(c);function p(){let b=y();e.if(!1);for(let q in b)e.elseIf((0,gu._)`${d} === ${q}`),e.assign(c,m(b[q]));e.else(),t.error(!1,{discrError:Qw.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function m(b){let q=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:b},q);return t.mergeEvaluated(x,gu.Name),q}function y(){var b;let q={},x=R(i),v=!0;for(let P=0;P<o.length;P++){let M=o[P];if(M?.$ref&&!(0,GW.schemaHasRulesButRef)(M,s.self.RULES)){let I=M.$ref;if(M=eP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,I),M instanceof eP.SchemaEnv&&(M=M.schema),M===void 0)throw new JW.default(s.opts.uriResolver,s.baseId,I)}let j=(b=M?.properties)===null||b===void 0?void 0:b[l];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);v=v&&(x||R(M)),E(j,P)}if(!v)throw new Error(`discriminator: "${l}" must be required`);return q;function R({required:P}){return Array.isArray(P)&&P.includes(l)}function E(P,M){if(P.const)k(P.const,M);else if(P.enum)for(let j of P.enum)k(j,M);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function k(P,M){if(typeof P!="string"||P in q)throw new Error(`discriminator: "${l}" values must be unique strings`);q[P]=M}}}};Zw.default=KW});var rP=V((PZ,QW)=>{QW.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 iP=V((Ft,Xw)=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.MissingRefError=Ft.ValidationError=Ft.CodeGen=Ft.Name=Ft.nil=Ft.stringify=Ft.str=Ft._=Ft.KeywordCxt=Ft.Ajv=void 0;var ZW=ZI(),XW=QO(),ez=tP(),nP=rP(),tz=["/properties"],ym="http://json-schema.org/draft-07/schema",yu=class extends ZW.default{_addVocabularies(){super._addVocabularies(),XW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(ez.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(nP,tz):nP;this.addMetaSchema(e,ym,!1),this.refs["http://json-schema.org/schema"]=ym}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ym)?ym:void 0)}};Ft.Ajv=yu;Xw.exports=Ft=yu;Xw.exports.Ajv=yu;Object.defineProperty(Ft,"__esModule",{value:!0});Ft.default=yu;var rz=Ef();Object.defineProperty(Ft,"KeywordCxt",{enumerable:!0,get:function(){return rz.KeywordCxt}});var vu=ze();Object.defineProperty(Ft,"_",{enumerable:!0,get:function(){return vu._}});Object.defineProperty(Ft,"str",{enumerable:!0,get:function(){return vu.str}});Object.defineProperty(Ft,"stringify",{enumerable:!0,get:function(){return vu.stringify}});Object.defineProperty(Ft,"nil",{enumerable:!0,get:function(){return vu.nil}});Object.defineProperty(Ft,"Name",{enumerable:!0,get:function(){return vu.Name}});Object.defineProperty(Ft,"CodeGen",{enumerable:!0,get:function(){return vu.CodeGen}});var nz=Qh();Object.defineProperty(Ft,"ValidationError",{enumerable:!0,get:function(){return nz.default}});var iz=qf();Object.defineProperty(Ft,"MissingRefError",{enumerable:!0,get:function(){return iz.default}})});import*as sz from"crypto";import*as Ta from"fs";import{createRequire as oz}from"module";import*as pi from"path";function bm(){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 sP(){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 e0(t,e){return new vm(t,e)}var vm,t0=le(()=>{"use strict";cS();vm=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:eu}),crypto:()=>sz,path:()=>pi,querystring:()=>wt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>Rq(),sP),moment:()=>this.loadOptionalModule("moment",()=>xq(),bm),tv4:()=>this.loadOptionalModule("tv4",()=>Eq()),ajv:()=>this.loadOptionalModule("ajv",()=>iP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>wt("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=pi.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": {
@@ -49,10 +49,10 @@ ${i}
49
49
 
50
50
  // --- Next Script ---
51
51
 
52
- `)}function Uf(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Su(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 fz(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 r0(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 n0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function xm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=Ct.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 Hf=le(()=>{"use strict";ga()});import*as i0 from"vm";function dz(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 Bf,s0=le(()=>{"use strict";aP();_m();Hf();Bf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=oP(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,c)=>{e.cookieJar&&e.cookieJar.set({name:l,value:c,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),c={};for(let d of l)c[d.name]=d.value;return c},jar:()=>{let l=e.cookieJar,c=d=>{if(d==null)return;let p=typeof d=="string"?d:typeof d=="object"||typeof d=="number"||typeof d=="boolean"?String(d):void 0;if(!p)return;let m=p.trim();if(m)try{return new URL(m).hostname}catch{return m}};return{getAll(d,p){try{if(!l){p(null,[]);return}let m=c(d),y=l.getAll(m).map(b=>({name:b.name,value:b.value,domain:b.domain,path:b.path,httpOnly:b.httpOnly,secure:b.secure}));p(null,y)}catch(m){p(m,[])}},get(d,p,m){try{if(!l){m(null,void 0);return}let y=c(d),b=l.get(p,y);m(null,b?{name:b.name,value:b.value,domain:b.domain}:void 0)}catch(y){m(y,void 0)}},set(d,p,m,y){try{if(!l){(y||m)?.(null);return}let b=c(d);typeof p=="string"&&typeof m=="string"?(l.set({name:p,value:m,domain:b}),y?.(null)):typeof p=="object"&&(l.set({...p,domain:b}),m?.(null))}catch(b){(y||m)?.(b)}},unset(d,p,m){try{if(!l){m?.(null);return}let y=c(d);l.delete(p,y),m?.(null)}catch(y){m?.(y)}},clear(d,p){try{let m=typeof d=="function"?d:p;if(!l){m?.(null);return}let y=typeof d=="function"?void 0:c(d);y&&typeof l.clearDomain=="function"?l.clearDomain(y):l.clear(),m?.(null)}catch(m){(typeof d=="function"?d:p)?.(m)}}}},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:r0(this.assertions),expect:bu,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,c){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let m=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(m),b=Array.isArray(y?.cookies)?y.cookies.filter(v=>v?.name):[],q=y?.body,x=0;if(typeof q=="string")x=Buffer.byteLength(q,"utf8");else if(Buffer.isBuffer(q))x=q.length;else if(q!=null)try{x=Buffer.byteLength(JSON.stringify(q),"utf8")}catch{}return wm({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:q,cookies:b,responseTime:y?.time,responseSize:x})})();if(typeof c=="function"){p.then(m=>c(null,m),m=>c(m));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,c){o._visualizerData={template:l,data:c}},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[c,d]of Object.entries(e.headers))if(c.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase()){delete e.headers[c];break}},update:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&(l[c]=d);return l},each:l=>{for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&l({key:c,value:d})}},o={get mode(){return n(e.body?.type)},set mode(l){let c=i(l);e.body?e.body.type=c:e.body={type:c,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 dz(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 c=l.mode?i(l.mode):l.type||"raw";e.body={type:c,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 c={};for(let[d,p]of Object.entries(e.headers))typeof p=="string"&&(c[d]=p);return c},addQueryParams(l){if(typeof l=="string"){let c=new URLSearchParams(l);for(let[d,p]of c)e.query||(e.query={}),e.query[d]=p}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(c=>{c.key&&(e.query[c.key]=c.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(c=>{let d=typeof c=="string"?c:c.key;d&&delete e.query[d]}))},authorizeUsing(l,c){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,c&&(r.request.auth.parameters=c)):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,c){r.request&&(r.request.description={content:l,type:c||"text/plain"})},setHeader(l,c){e.headers[l]=c},addHeader(l,c){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=c},removeHeader(l){delete e.headers[l]},setBody(l,c,d){e.body={type:c||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[b,q]of Object.entries(s?.headers||{}))typeof q=="string"&&(o[b]=q);let l=s?.body,c=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:c},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 m=r.statusText||"";n.responseCode={code:r.status,name:m,detail:m},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(b=>({...b}));let y=this;n.tests=new Proxy({},{set(b,q,x){return y.assertions.push({name:String(q),passed:!!x,message:x?void 0:`"${String(q)}" was false`}),!0}})}async executePreRequest(e){let r=Rm(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=i0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Su(this.consoleMessages),c=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,c);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Uf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:Uf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Uf(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=[...Su(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=Rm(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=wm(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=i0.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 c=Su(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:c.length>0?c:void 0,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},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=[...Su(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as vr from"crypto";import*as pz from"querystring";import*as cP from"vm";function fP(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 dP(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function hz(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=fP(r[2],e),i=ys(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return dP(e[t]);if(ba(t)){let n=va(t,e),i=Ui(t,n);if(i!==void 0)return i}}function uP(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=vr.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 o0(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 Ke?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let c=vr.randomBytes(8),{key:d,iv:p}=uP(s,e,r,c),m=vr.createCipheriv(n(e),d,p),y=Buffer.concat([m.update(l),m.final()]),b=Buffer.concat([Buffer.from("Salted__"),c,y]);return{ciphertext:new Ke(y),salt:new Ke(c),toString:q=>q?q.stringify(new Ke(b)):b.toString("base64")}}else{let c=s.toBuffer(),d=o?.iv&&o.iv instanceof Ke?o.iv.toBuffer():Buffer.alloc(r),p=vr.createCipheriv(n(c.length),c,d);o?.padding===!1&&p.setAutoPadding(!1);let m=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Ke(m),toString:y=>y?y.stringify(new Ke(m)):m.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),c,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),c=l.subarray(16)):(d=Buffer.alloc(0),c=l);let{key:p,iv:m}=uP(s,e,r,d),y=vr.createDecipheriv(n(e),p,m);return new Ke(Buffer.concat([y.update(c),y.final()]))}else{let l=s.toBuffer(),c=o?.iv&&o.iv instanceof Ke?o.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=vr.createDecipheriv(n(l.length),l,c);return o?.padding===!1&&p.setAutoPadding(!1),new Ke(Buffer.concat([p.update(d),p.final()]))}}}}function mz(){let t=r=>n=>{let i=n instanceof Ke?n.toBuffer():Buffer.from(String(n),"utf8");return new Ke(vr.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Ke?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Ke?i.toBuffer():Buffer.from(String(i),"utf8");return new Ke(vr.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:o0("aes",32,16),DES:o0("des",8,8),TripleDES:o0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Ke?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Ke?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,c=i?.iterations||1;return new Ke(vr.pbkdf2Sync(s,o,c,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Ke.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Ke.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Ke.fromHex(r)},Latin1:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Ke(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Ke(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Ke(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Ke(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Ke(r):new Ke(Buffer.from(String(r))):new Ke(Buffer.alloc(0)),random:r=>new Ke(vr.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ke,xs,Vf=le(()=>{"use strict";$h();sf();Fh();t0();s0();_m();Ke=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"))}};xs=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=e0(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Bf({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:vr,_:s("lodash"),require:s,moment:bm(),querystring:pz,CryptoJS:mz(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,c)=>e.globals?.set(l,c),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,c)=>e.environment?.set(l,c),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let c=e.response?.headers?.get?.(l);return c===void 0?null:c},getResponseCookie:l=>{let c=e.response?.cookies;if(c&&typeof c[Symbol.iterator]=="function"){for(let d of c)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,c,d)=>JSON.stringify(l,c,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let c=this.moduleLoader.createRequireFunction()("xml2js"),d;return c.parseString(l,{explicitArray:!1},(p,m)=>{if(p)throw p;d=m}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return cP.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},c=this.createMergedVariableScope(n,o,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),m=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),y={...m,set:(x,v)=>{let _=this.serializeValue(v);m.set(x,_),n[x]=_},unset(x){m.unset(x),delete n[x]},clear(){let x=Object.keys(o);m.clear();for(let v of x)delete n[v]}},b={...d,set:(x,v)=>{let _=this.serializeValue(v);d.set(x,_),n[x]=_},unset(x){d.unset(x),delete n[x]},clear(){let x=Object.keys(s);d.clear();for(let v of x)delete n[v]}};return b.replaceIn=c.replaceIn,p.replaceIn=c.replaceIn,y.replaceIn=c.replaceIn,{globals:b,collectionVariables:p,variables:c,environment:y,iterationData:{get:x=>l[x],has:x=>x in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:bu,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:e===void 0?t.JSON_TYPE_MARKER+"undefined":t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}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,c)=>{e[l]=this.serializeValue(c)},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 c=o.toObject(),d=20,p=y=>y.replace(/\{\{([^}]+)\}\}/g,(b,q)=>{let x=q.trim(),v=x.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(v)try{let E=fP(v[2],c),k=ys(v[1],E);return k!==null?String(k):b}catch{return b}let _=af(x);if(_){let E=hz(_.input,c);if(E!==void 0){let k=lf(E,_.filters,c);return k!==void 0?String(k):b}return b}if(o.has(x)){let E=o.get(x);return E===void 0?"":String(E)}if(ba(x)){let E={};for(let[M,j]of Object.entries(c))E[M]=dP(j);let k=va(x,E),P=Ui(x,k);if(P!==void 0)return String(P)}return b}),m=l;for(let y=0;y<d;y++){let b=p(m);if(b===m)break;m=b}return m}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,c)=>{n&&(i?n(o,l,c):n(l||"",o==="set"?c:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let c=this.serializeValue(l);e[o]=c,s("set",o,c)},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)}}}});import*as hP from"fs";import*as yz from"http";import*as a0 from"https";import*as Cm from"path";import{URL as pP}from"url";import*as Em from"zlib";var _n,Na,Jf=le(()=>{"use strict";_n={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1,tls:{},certificates:[]},Na=class{settings;version;basePath;constructor(e,r=process.cwd()){this.settings={..._n,...e},this.basePath=r;try{this.version=wt("../../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,tls:e?.tls??this.settings.tls??{},certificates:e?.certificates??this.settings.certificates??[]}}async executeInternal(e,r,n,i){let s=Date.now(),o=new pP(e.url),l=o.protocol==="https:",c=this.sanitizeHeaders(e.headers||{});Object.keys(c).some(m=>m.toLowerCase()==="user-agent")||(c["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:{...c},timeout:r.timeout||void 0};if(r.decompress&&!c["accept-encoding"]&&!c["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l){let m=this.resolveTlsSettings(o,r),y=p;y.rejectUnauthorized=r.strictSSL;let b={rejectUnauthorized:r.strictSSL},q=this.readOptionalFile(m.caPath,"CA certificate");q&&(b.ca=q);let x=this.readOptionalFile(m.certPath,"client certificate");x&&(b.cert=x);let v=this.readOptionalFile(m.keyPath,"client private key");v&&(b.key=v);let _=this.readOptionalFile(m.pfxPath,"client pfx");_&&(b.pfx=_),m.passphrase&&(b.passphrase=m.passphrase),m.servername&&(y.servername=m.servername),y.agent=new a0.Agent(b)}return new Promise((m,y)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",y(x);return}let q=(l?a0:yz).request(p,async x=>{let v=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(v)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let E=x.headers.location;if(!E){y(new Error("Redirect response missing Location header"));return}let k=new pP(E,e.url).toString(),P=e.method;!r.followOriginalMethod&&[301,302,303].includes(v)&&(P="GET");let M={...e.headers};r.followAuthHeader||(delete M.authorization,delete M.Authorization);try{let j=await this.executeInternal({...e,url:k,method:P,headers:M,body:P==="GET"?void 0:e.body},r,n+1,i),I=Date.now();j.time=I-s,m(j)}catch(j){y(j)}return}let _=[];x.on("data",E=>_.push(E)),x.on("end",()=>{let E=Date.now(),k=Buffer.concat(_),P=x.headers["content-encoding"];if(r.decompress&&P)try{P==="gzip"?k=Em.gunzipSync(k):P==="deflate"&&(k=Em.inflateSync(k))}catch(R){console.warn("[NodeHttpClient] Decompression failed:",R)}let M=k.toString("utf-8"),j={};for(let[R,A]of Object.entries(x.headers))(typeof A=="string"||Array.isArray(A))&&(j[R]=A);let I=this.parseCookies(x.headers["set-cookie"],o.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:j,cookies:I,body:M,time:E-s,size:k.length})})});if(i&&i.addEventListener("abort",()=>{q.destroy();let x=new Error("Request cancelled");x.name="AbortError",y(x)}),q.on("error",x=>{y(x)}),q.on("timeout",()=>{q.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);q.write(x)}q.end()})}resolveTlsSettings(e,r){let n=r.tls||{};if(!!(n.caPath||n.certPath||n.keyPath||n.pfxPath||n.servername||n.passphrase))return n;let s=this.findCertificateMapping(e,r.certificates||[]);return s?{caPath:s.caPath,certPath:s.certPath,keyPath:s.keyPath,pfxPath:s.pfxPath,passphrase:s.passphrase,servername:s.servername}:n}findCertificateMapping(e,r){if(!Array.isArray(r)||r.length===0)return;let n=e.hostname,i=e.port?Number(e.port):443,s=r.find(o=>this.mappingMatchesHost(o,n,i,!0));return s||r.find(o=>this.mappingMatchesHost(o,n,i,!1))}mappingMatchesHost(e,r,n,i){if(!e||e.enabled===!1)return!1;let s=String(e.host||"").trim().toLowerCase();if(!s||e.port!=null&&Number(e.port)!==n)return!1;let o=r.toLowerCase();if(i)return s!=="*"&&!s.startsWith("*.")&&o===s;if(s==="*")return!0;if(s.startsWith("*.")){let l=s.slice(2);return o===l||o.endsWith(`.${l}`)}return o===s}readOptionalFile(e,r){if(!e)return;let n=Cm.isAbsolute(e)?e:Cm.resolve(this.basePath,e);try{return hP.readFileSync(n)}catch(i){throw new Error(`[NodeHttpClient] Failed to read ${r} file at ${n}: ${i?.message||"Unknown error"}`)}}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,c]=s.split("="),d={name:l.trim(),value:c?.trim()||"",domain:r};for(let p of o){let[m,y]=p.split("=");switch(m.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});var l0,Ma,qm=le(()=>{"use strict";l0={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"},Ma=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=l0["x-www-form-urlencoded"];break;case"raw":s=r.format?l0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=l0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var Da,Im=le(()=>{"use strict";Da=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let o=this.parseCsvLine(r[s]),l={};n.forEach((c,d)=>{l[c]=o[d]||""}),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}}});import*as Ru from"crypto";var vz,Yf,c0=le(()=>{"use strict";vz=3e4,Yf=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 c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,l,s,o,n);let d=await this.httpService.execute({method:"POST",url:i,headers:c,body:l.toString()}),p=this.parseTokenResponse(d.body,e);p.refreshToken||(p.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,p),p.refreshToken&&await this.storeRefreshToken(m,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 c=e.usePkce!==!1,d,p,m;if(c){d=this.generateCodeVerifier();let j=e.pkceMethod||"S256";p=j==="S256"?this.generateCodeChallengeS256(d):d,m=j}let y=e.state||Ru.randomBytes(16).toString("hex"),b=await this.getCallbackUri(),q=new URL(n);if(q.searchParams.set("response_type","code"),q.searchParams.set("client_id",s),q.searchParams.set("redirect_uri",b),l&&q.searchParams.set("scope",l),q.searchParams.set("state",y),p&&(q.searchParams.set("code_challenge",p),q.searchParams.set("code_challenge_method",m)),e.audience&&q.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&q.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[j,I]of Object.entries(e.extraParams))q.searchParams.set(j,this.resolve(I,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((j,I)=>{this.pendingAuthCallback={resolve:j,reject:I,state:y}});await this.browserService.openExternal(q.toString());let v;try{v=await Promise.race([x,new Promise((j,I)=>setTimeout(()=>{this.pendingAuthCallback=null,I(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(v.state&&v.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let _=new URLSearchParams;_.append("grant_type","authorization_code"),_.append("code",v.code),_.append("redirect_uri",b),d&&_.append("code_verifier",d);let E={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,E,_,s,o,r);let k=await this.httpService.execute({method:"POST",url:i,headers:E,body:_.toString()}),P=this.parseTokenResponse(k.body,e),M=this.buildCacheKeyString(e);return this.tokenCache.set(M,P),P.refreshToken&&await this.storeRefreshToken(M,P.refreshToken),P}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||Ru.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),c=new URL(n);if(c.searchParams.set("response_type","token"),c.searchParams.set("client_id",i),c.searchParams.set("redirect_uri",l),s&&c.searchParams.set("scope",s),c.searchParams.set("state",o),e.audience&&c.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&c.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[b,q]of Object.entries(e.extraParams))c.searchParams.set(b,this.resolve(q,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((b,q)=>{this.pendingImplicitCallback={resolve:b,reject:q,state:o}});await this.browserService.openExternal(c.toString());let p;try{p=await Promise.race([d,new Promise((b,q)=>setTimeout(()=>{this.pendingImplicitCallback=null,q(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 m={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}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,m),m}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,c=new URLSearchParams;if(c.append("grant_type",n),l&&c.append("scope",l),n==="password"){let m=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");c.append("username",m),c.append("password",y)}if(e.audience&&c.append("audience",this.resolve(e.audience,r)),e.resource&&c.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,y]of Object.entries(e.extraParams))c.append(m,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,c,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:d,body:c.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-vz:!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 Ru.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ru.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as ja from"fs";import*as go from"path";function xu(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&ja.writeFileSync(t,r.join(`
52
+ `)}function Uf(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Su(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 fz(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 r0(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 n0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function xm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=Ct.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 Hf=le(()=>{"use strict";ga()});import*as i0 from"vm";function dz(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 Bf,s0=le(()=>{"use strict";aP();_m();Hf();Bf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=oP(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,c)=>{e.cookieJar&&e.cookieJar.set({name:l,value:c,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),c={};for(let d of l)c[d.name]=d.value;return c},jar:()=>{let l=e.cookieJar,c=d=>{if(d==null)return;let p=typeof d=="string"?d:typeof d=="object"||typeof d=="number"||typeof d=="boolean"?String(d):void 0;if(!p)return;let m=p.trim();if(m)try{return new URL(m).hostname}catch{return m}};return{getAll(d,p){try{if(!l){p(null,[]);return}let m=c(d),y=l.getAll(m).map(b=>({name:b.name,value:b.value,domain:b.domain,path:b.path,httpOnly:b.httpOnly,secure:b.secure}));p(null,y)}catch(m){p(m,[])}},get(d,p,m){try{if(!l){m(null,void 0);return}let y=c(d),b=l.get(p,y);m(null,b?{name:b.name,value:b.value,domain:b.domain}:void 0)}catch(y){m(y,void 0)}},set(d,p,m,y){try{if(!l){(y||m)?.(null);return}let b=c(d);typeof p=="string"&&typeof m=="string"?(l.set({name:p,value:m,domain:b}),y?.(null)):typeof p=="object"&&(l.set({...p,domain:b}),m?.(null))}catch(b){(y||m)?.(b)}},unset(d,p,m){try{if(!l){m?.(null);return}let y=c(d);l.delete(p,y),m?.(null)}catch(y){m?.(y)}},clear(d,p){try{let m=typeof d=="function"?d:p;if(!l){m?.(null);return}let y=typeof d=="function"?void 0:c(d);y&&typeof l.clearDomain=="function"?l.clearDomain(y):l.clear(),m?.(null)}catch(m){(typeof d=="function"?d:p)?.(m)}}}},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:r0(this.assertions),expect:bu,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,c){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let m=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(m),b=Array.isArray(y?.cookies)?y.cookies.filter(v=>v?.name):[],q=y?.body,x=0;if(typeof q=="string")x=Buffer.byteLength(q,"utf8");else if(Buffer.isBuffer(q))x=q.length;else if(q!=null)try{x=Buffer.byteLength(JSON.stringify(q),"utf8")}catch{}return wm({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:q,cookies:b,responseTime:y?.time,responseSize:x})})();if(typeof c=="function"){p.then(m=>c(null,m),m=>c(m));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,c){o._visualizerData={template:l,data:c}},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[c,d]of Object.entries(e.headers))if(c.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase()){delete e.headers[c];break}},update:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&(l[c]=d);return l},each:l=>{for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&l({key:c,value:d})}},o={get mode(){return n(e.body?.type)},set mode(l){let c=i(l);e.body?e.body.type=c:e.body={type:c,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 dz(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 c=l.mode?i(l.mode):l.type||"raw";e.body={type:c,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 c={};for(let[d,p]of Object.entries(e.headers))typeof p=="string"&&(c[d]=p);return c},addQueryParams(l){if(typeof l=="string"){let c=new URLSearchParams(l);for(let[d,p]of c)e.query||(e.query={}),e.query[d]=p}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(c=>{c.key&&(e.query[c.key]=c.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(c=>{let d=typeof c=="string"?c:c.key;d&&delete e.query[d]}))},authorizeUsing(l,c){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,c&&(r.request.auth.parameters=c)):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,c){r.request&&(r.request.description={content:l,type:c||"text/plain"})},setHeader(l,c){e.headers[l]=c},addHeader(l,c){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=c},removeHeader(l){delete e.headers[l]},setBody(l,c,d){e.body={type:c||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[b,q]of Object.entries(s?.headers||{}))typeof q=="string"&&(o[b]=q);let l=s?.body,c=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:c},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 m=r.statusText||"";n.responseCode={code:r.status,name:m,detail:m},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(b=>({...b}));let y=this;n.tests=new Proxy({},{set(b,q,x){return y.assertions.push({name:String(q),passed:!!x,message:x?void 0:`"${String(q)}" was false`}),!0}})}async executePreRequest(e){let r=Rm(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=i0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Su(this.consoleMessages),c=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,c);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Uf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:Uf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Uf(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=[...Su(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=Rm(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=wm(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=i0.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 c=Su(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:c.length>0?c:void 0,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},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=[...Su(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as vr from"crypto";import*as pz from"querystring";import*as cP from"vm";function fP(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 dP(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function hz(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=fP(r[2],e),i=ys(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return dP(e[t]);if(ba(t)){let n=va(t,e),i=Ui(t,n);if(i!==void 0)return i}}function uP(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=vr.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 o0(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 Ke?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let c=vr.randomBytes(8),{key:d,iv:p}=uP(s,e,r,c),m=vr.createCipheriv(n(e),d,p),y=Buffer.concat([m.update(l),m.final()]),b=Buffer.concat([Buffer.from("Salted__"),c,y]);return{ciphertext:new Ke(y),salt:new Ke(c),toString:q=>q?q.stringify(new Ke(b)):b.toString("base64")}}else{let c=s.toBuffer(),d=o?.iv&&o.iv instanceof Ke?o.iv.toBuffer():Buffer.alloc(r),p=vr.createCipheriv(n(c.length),c,d);o?.padding===!1&&p.setAutoPadding(!1);let m=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Ke(m),toString:y=>y?y.stringify(new Ke(m)):m.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),c,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),c=l.subarray(16)):(d=Buffer.alloc(0),c=l);let{key:p,iv:m}=uP(s,e,r,d),y=vr.createDecipheriv(n(e),p,m);return new Ke(Buffer.concat([y.update(c),y.final()]))}else{let l=s.toBuffer(),c=o?.iv&&o.iv instanceof Ke?o.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=vr.createDecipheriv(n(l.length),l,c);return o?.padding===!1&&p.setAutoPadding(!1),new Ke(Buffer.concat([p.update(d),p.final()]))}}}}function mz(){let t=r=>n=>{let i=n instanceof Ke?n.toBuffer():Buffer.from(String(n),"utf8");return new Ke(vr.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Ke?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Ke?i.toBuffer():Buffer.from(String(i),"utf8");return new Ke(vr.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:o0("aes",32,16),DES:o0("des",8,8),TripleDES:o0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Ke?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Ke?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,c=i?.iterations||1;return new Ke(vr.pbkdf2Sync(s,o,c,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Ke.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Ke.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Ke.fromHex(r)},Latin1:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Ke(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Ke(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Ke?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Ke(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Ke(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Ke(r):new Ke(Buffer.from(String(r))):new Ke(Buffer.alloc(0)),random:r=>new Ke(vr.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ke,xs,Vf=le(()=>{"use strict";$h();sf();Fh();t0();s0();_m();Ke=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"))}};xs=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=e0(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Bf({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:vr,_:s("lodash"),require:s,moment:bm(),querystring:pz,CryptoJS:mz(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,c)=>e.globals?.set(l,c),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,c)=>e.environment?.set(l,c),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let c=e.response?.headers?.get?.(l);return c===void 0?null:c},getResponseCookie:l=>{let c=e.response?.cookies;if(c&&typeof c[Symbol.iterator]=="function"){for(let d of c)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,c,d)=>JSON.stringify(l,c,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let c=this.moduleLoader.createRequireFunction()("xml2js"),d;return c.parseString(l,{explicitArray:!1},(p,m)=>{if(p)throw p;d=m}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return cP.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},c=this.createMergedVariableScope(n,o,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),m=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),y={...m,set:(x,v)=>{let R=this.serializeValue(v);m.set(x,R),n[x]=R},unset(x){m.unset(x),delete n[x]},clear(){let x=Object.keys(o);m.clear();for(let v of x)delete n[v]}},b={...d,set:(x,v)=>{let R=this.serializeValue(v);d.set(x,R),n[x]=R},unset(x){d.unset(x),delete n[x]},clear(){let x=Object.keys(s);d.clear();for(let v of x)delete n[v]}};return b.replaceIn=c.replaceIn,p.replaceIn=c.replaceIn,y.replaceIn=c.replaceIn,{globals:b,collectionVariables:p,variables:c,environment:y,iterationData:{get:x=>l[x],has:x=>x in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:bu,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:e===void 0?t.JSON_TYPE_MARKER+"undefined":t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}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,c)=>{e[l]=this.serializeValue(c)},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 c=o.toObject(),d=20,p=y=>y.replace(/\{\{([^}]+)\}\}/g,(b,q)=>{let x=q.trim(),v=x.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(v)try{let E=fP(v[2],c),k=ys(v[1],E);return k!==null?String(k):b}catch{return b}let R=af(x);if(R){let E=hz(R.input,c);if(E!==void 0){let k=lf(E,R.filters,c);return k!==void 0?String(k):b}return b}if(o.has(x)){let E=o.get(x);return E===void 0?"":String(E)}if(ba(x)){let E={};for(let[M,j]of Object.entries(c))E[M]=dP(j);let k=va(x,E),P=Ui(x,k);if(P!==void 0)return String(P)}return b}),m=l;for(let y=0;y<d;y++){let b=p(m);if(b===m)break;m=b}return m}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,c)=>{n&&(i?n(o,l,c):n(l||"",o==="set"?c:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let c=this.serializeValue(l);e[o]=c,s("set",o,c)},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)}}}});import*as hP from"fs";import*as yz from"http";import*as a0 from"https";import*as Cm from"path";import{URL as pP}from"url";import*as Em from"zlib";var _n,Na,Jf=le(()=>{"use strict";_n={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1,tls:{},certificates:[]},Na=class{settings;version;basePath;constructor(e,r=process.cwd()){this.settings={..._n,...e},this.basePath=r;try{this.version=wt("../../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,tls:e?.tls??this.settings.tls??{},certificates:e?.certificates??this.settings.certificates??[]}}async executeInternal(e,r,n,i){let s=Date.now(),o=new pP(e.url),l=o.protocol==="https:",c=this.sanitizeHeaders(e.headers||{});Object.keys(c).some(m=>m.toLowerCase()==="user-agent")||(c["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:{...c},timeout:r.timeout||void 0};if(r.decompress&&!c["accept-encoding"]&&!c["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l){let m=this.resolveTlsSettings(o,r),y=p;y.rejectUnauthorized=r.strictSSL;let b={rejectUnauthorized:r.strictSSL},q=this.readOptionalFile(m.caPath,"CA certificate");q&&(b.ca=q);let x=this.readOptionalFile(m.certPath,"client certificate");x&&(b.cert=x);let v=this.readOptionalFile(m.keyPath,"client private key");v&&(b.key=v);let R=this.readOptionalFile(m.pfxPath,"client pfx");R&&(b.pfx=R),m.passphrase&&(b.passphrase=m.passphrase),m.servername&&(y.servername=m.servername),y.agent=new a0.Agent(b)}return new Promise((m,y)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",y(x);return}let q=(l?a0:yz).request(p,async x=>{let v=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(v)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let E=x.headers.location;if(!E){y(new Error("Redirect response missing Location header"));return}let k=new pP(E,e.url).toString(),P=e.method;!r.followOriginalMethod&&[301,302,303].includes(v)&&(P="GET");let M={...e.headers};r.followAuthHeader||(delete M.authorization,delete M.Authorization);try{let j=await this.executeInternal({...e,url:k,method:P,headers:M,body:P==="GET"?void 0:e.body},r,n+1,i),I=Date.now();j.time=I-s,m(j)}catch(j){y(j)}return}let R=[];x.on("data",E=>R.push(E)),x.on("end",()=>{let E=Date.now(),k=Buffer.concat(R),P=x.headers["content-encoding"];if(r.decompress&&P)try{P==="gzip"?k=Em.gunzipSync(k):P==="deflate"&&(k=Em.inflateSync(k))}catch(_){console.warn("[NodeHttpClient] Decompression failed:",_)}let M=k.toString("utf-8"),j={};for(let[_,A]of Object.entries(x.headers))(typeof A=="string"||Array.isArray(A))&&(j[_]=A);let I=this.parseCookies(x.headers["set-cookie"],o.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:j,cookies:I,body:M,time:E-s,size:k.length})})});if(i&&i.addEventListener("abort",()=>{q.destroy();let x=new Error("Request cancelled");x.name="AbortError",y(x)}),q.on("error",x=>{y(x)}),q.on("timeout",()=>{q.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);q.write(x)}q.end()})}resolveTlsSettings(e,r){let n=r.tls||{};if(!!(n.caPath||n.certPath||n.keyPath||n.pfxPath||n.servername||n.passphrase))return n;let s=this.findCertificateMapping(e,r.certificates||[]);return s?{caPath:s.caPath,certPath:s.certPath,keyPath:s.keyPath,pfxPath:s.pfxPath,passphrase:s.passphrase,servername:s.servername}:n}findCertificateMapping(e,r){if(!Array.isArray(r)||r.length===0)return;let n=e.hostname,i=e.port?Number(e.port):443,s=r.find(o=>this.mappingMatchesHost(o,n,i,!0));return s||r.find(o=>this.mappingMatchesHost(o,n,i,!1))}mappingMatchesHost(e,r,n,i){if(!e||e.enabled===!1)return!1;let s=String(e.host||"").trim().toLowerCase();if(!s||e.port!=null&&Number(e.port)!==n)return!1;let o=r.toLowerCase();if(i)return s!=="*"&&!s.startsWith("*.")&&o===s;if(s==="*")return!0;if(s.startsWith("*.")){let l=s.slice(2);return o===l||o.endsWith(`.${l}`)}return o===s}readOptionalFile(e,r){if(!e)return;let n=Cm.isAbsolute(e)?e:Cm.resolve(this.basePath,e);try{return hP.readFileSync(n)}catch(i){throw new Error(`[NodeHttpClient] Failed to read ${r} file at ${n}: ${i?.message||"Unknown error"}`)}}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,c]=s.split("="),d={name:l.trim(),value:c?.trim()||"",domain:r};for(let p of o){let[m,y]=p.split("=");switch(m.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});var l0,Ma,qm=le(()=>{"use strict";l0={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"},Ma=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=l0["x-www-form-urlencoded"];break;case"raw":s=r.format?l0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=l0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var Da,Im=le(()=>{"use strict";Da=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let o=this.parseCsvLine(r[s]),l={};n.forEach((c,d)=>{l[c]=o[d]||""}),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}}});import*as Ru from"crypto";var vz,Yf,c0=le(()=>{"use strict";vz=3e4,Yf=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 c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,l,s,o,n);let d=await this.httpService.execute({method:"POST",url:i,headers:c,body:l.toString()}),p=this.parseTokenResponse(d.body,e);p.refreshToken||(p.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,p),p.refreshToken&&await this.storeRefreshToken(m,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 c=e.usePkce!==!1,d,p,m;if(c){d=this.generateCodeVerifier();let j=e.pkceMethod||"S256";p=j==="S256"?this.generateCodeChallengeS256(d):d,m=j}let y=e.state||Ru.randomBytes(16).toString("hex"),b=await this.getCallbackUri(),q=new URL(n);if(q.searchParams.set("response_type","code"),q.searchParams.set("client_id",s),q.searchParams.set("redirect_uri",b),l&&q.searchParams.set("scope",l),q.searchParams.set("state",y),p&&(q.searchParams.set("code_challenge",p),q.searchParams.set("code_challenge_method",m)),e.audience&&q.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&q.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[j,I]of Object.entries(e.extraParams))q.searchParams.set(j,this.resolve(I,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((j,I)=>{this.pendingAuthCallback={resolve:j,reject:I,state:y}});await this.browserService.openExternal(q.toString());let v;try{v=await Promise.race([x,new Promise((j,I)=>setTimeout(()=>{this.pendingAuthCallback=null,I(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(v.state&&v.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let R=new URLSearchParams;R.append("grant_type","authorization_code"),R.append("code",v.code),R.append("redirect_uri",b),d&&R.append("code_verifier",d);let E={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,E,R,s,o,r);let k=await this.httpService.execute({method:"POST",url:i,headers:E,body:R.toString()}),P=this.parseTokenResponse(k.body,e),M=this.buildCacheKeyString(e);return this.tokenCache.set(M,P),P.refreshToken&&await this.storeRefreshToken(M,P.refreshToken),P}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||Ru.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),c=new URL(n);if(c.searchParams.set("response_type","token"),c.searchParams.set("client_id",i),c.searchParams.set("redirect_uri",l),s&&c.searchParams.set("scope",s),c.searchParams.set("state",o),e.audience&&c.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&c.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[b,q]of Object.entries(e.extraParams))c.searchParams.set(b,this.resolve(q,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((b,q)=>{this.pendingImplicitCallback={resolve:b,reject:q,state:o}});await this.browserService.openExternal(c.toString());let p;try{p=await Promise.race([d,new Promise((b,q)=>setTimeout(()=>{this.pendingImplicitCallback=null,q(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 m={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}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,m),m}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,c=new URLSearchParams;if(c.append("grant_type",n),l&&c.append("scope",l),n==="password"){let m=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");c.append("username",m),c.append("password",y)}if(e.audience&&c.append("audience",this.resolve(e.audience,r)),e.resource&&c.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,y]of Object.entries(e.extraParams))c.append(m,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,c,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:d,body:c.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-vz:!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 Ru.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ru.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as ja from"fs";import*as go from"path";function xu(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&ja.writeFileSync(t,r.join(`
53
53
  `),"utf-8")}function Kf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&ja.writeFileSync(go.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&ja.writeFileSync(go.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function bz(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return go.isAbsolute(n)?n:go.join(t,n)}async function Sz(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Om(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=go.join(e,Wt(n.name));ja.mkdirSync(i,{recursive:!0}),Kf(i,Wt(n.name),n.scripts),Om(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=Wt(i.name)+".http",o=go.join(e,s),l=wz(i,r);ja.writeFileSync(o,l,"utf-8"),Kf(e,Wt(i.name),i.scripts)}})}function wz(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${Wt(e.name)}.env`),r.push(`# request scripts: ${Wt(t.name)}.pre.js and .post.js`);let n=_z(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(`
54
- `)}function _z(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 Pm=le(()=>{"use strict";jn()});import*as Ir from"fs";import*as f0 from"path";var Cu,d0=le(()=>{"use strict";jn();Cu=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){Ir.existsSync(this.collectionsDir)||Ir.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!Ir.existsSync(this.collectionsDir))return[];let e=Ir.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=f0.join(this.collectionsDir,n),s=Ir.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(Ir.existsSync(r))try{let n=Ir.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=Pt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await Ir.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!Ir.existsSync(r))return!1;try{return await Ir.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return Ir.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return f0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||Pt(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,...c}=n;return Object.assign(s,c),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 c=this.findItemById(i.items,r);if(!c||!c.items)return!1;s=c.items}else s=i.items;let o=new Map(s.map(c=>[c.id,c])),l=[];for(let c of n){let d=o.get(c);d&&(l.push(d),o.delete(c))}for(let c of o.values())l.push(c);if(r){let c=this.findItemById(i.items,r);c&&(c.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 Qf,p0=le(()=>{"use strict";Ph();d0();Qf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new so(n):new Cu(n)}static createForFormat(e,r){return e==="folder"?new so(r):new Cu(r)}}});import*as Dt from"fs";import*as hi from"path";function mP(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 Rz(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=>gP(e)),event:h0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function gP(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(gP):[],event:h0(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).map(xz),url:Cz(e),body:Ez(e),auth:qz(e.auth),description:e.description},event:h0(e.scripts),protocolProfileBehavior:Iz(e.settings)}}}function xz(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 Cz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let d=o[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let p={key:d.key,value:d.value};return d.enabled===!1&&(p.disabled=!0),d.description!==void 0&&(p.description=d.description),d.type!==void 0&&(p.type=d.type),d.required!==void 0&&(p.required=d.required),d.format!==void 0&&(p.format=d.format),d.enum!==void 0&&(p.enum=d.enum),d.deprecated!==void 0&&(p.deprecated=d.deprecated),d.pattern!==void 0&&(p.pattern=d.pattern),d.minLength!==void 0&&(p.minLength=d.minLength),d.maxLength!==void 0&&(p.maxLength=d.maxLength),d.minimum!==void 0&&(p.minimum=d.minimum),d.maximum!==void 0&&(p.maximum=d.maximum),d.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=d.exclusiveMinimum),d.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=d.exclusiveMaximum),d.multipleOf!==void 0&&(p.multipleOf=d.multipleOf),d.minItems!==void 0&&(p.minItems=d.minItems),d.maxItems!==void 0&&(p.maxItems=d.maxItems),d.uniqueItems!==void 0&&(p.uniqueItems=d.uniqueItems),d.nullable!==void 0&&(p.nullable=d.nullable),d.oneOf!==void 0&&(p.oneOf=d.oneOf),p});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(m=>{let[y,...b]=m.split("=");return{key:y,value:b.join("=")}}))}let c;return t.params&&typeof t.params=="object"&&(c=Object.entries(t.params).map(([d,p])=>({key:d,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:c&&c.length>0?c:void 0}}function Ez(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=mP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||mP(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 qz(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 Iz(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 h0(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 Zf,m0=le(()=>{"use strict";jn();Pm();p0();Zf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Qf.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(){Dt.existsSync(this.collectionsDir)||Dt.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=Pt(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:c,...d}=n;Object.assign(o,d)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=Pt(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:Pt(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=Pt(r),s=this.loader.getCollectionPath(e),o=hi.join(this.collectionsDir,i);if(!Dt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=hi.join(o,"collection.json");if(Dt.existsSync(l)){let d=JSON.parse(Dt.readFileSync(l,"utf-8"));d.id=i,d.name=r,Dt.writeFileSync(l,JSON.stringify(d,null,2))}else Dt.writeFileSync(l,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let c=this.collections.get(i);if(!c)throw new Error("Failed to load duplicated collection");return c}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:Pt(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||!Dt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=hi.dirname(s),l=Pt(n),c=hi.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,c);let d=hi.join(c,"folder.json");if(Dt.existsSync(d)){let y=JSON.parse(Dt.readFileSync(d,"utf-8"));y.id=l,y.name=n,Dt.writeFileSync(d,JSON.stringify(y,null,2))}else Dt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),m=p?this.findItemById(p.items,l):void 0;return m||{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||Pt(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,d={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=d,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,d),!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){Dt.existsSync(r)||Dt.mkdirSync(r,{recursive:!0});for(let n of Dt.readdirSync(e,{withFileTypes:!0})){let i=hi.join(e,n.name),s=hi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Dt.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=Dt.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||Pt(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(E=>E.key==="token")?.value||""};case"basic":let b=p.basic?.find(E=>E.key==="username"),q=p.basic?.find(E=>E.key==="password");return{type:"basic",basicAuth:{username:b?.value||"",password:q?.value||""}};case"apikey":let x=p.apikey?.find(E=>E.key==="key"),v=p.apikey?.find(E=>E.key==="value"),_=p.apikey?.find(E=>E.key==="in");return{type:"apikey",apikey:{key:x?.value||"",value:v?.value||"",in:_?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let m={};for(let y of p){let b=y.script?.exec;if(!b)continue;let q=Array.isArray(b)?b.join(`
55
- `):b;y.listen==="prerequest"?m.preRequest=q:y.listen==="test"&&(m.postResponse=q)}return m.preRequest||m.postResponse?m:void 0},i=p=>{if(!p||typeof p!="object")return;let m={};return p.followRedirects===!1&&(m.followRedirects=!1),p.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),p.maxRedirects!==void 0&&(m.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(m.timeout=p.requestTimeout),Object.keys(m).length>0?m:void 0},s=p=>{if(!p||typeof p=="string")return;let m=p.query;if(!(!Array.isArray(m)||m.length===0))return m.map(y=>({key:y.key||"",value:y.value||"",enabled:y.disabled!==!0,...y.description!==void 0?{description:y.description}:{},...y.type!==void 0?{type:y.type}:{},...y.required!==void 0?{required:y.required}:{},...y.format!==void 0?{format:y.format}:{},...y.enum!==void 0?{enum:y.enum}:{},...y.deprecated!==void 0?{deprecated:y.deprecated}:{},...y.pattern!==void 0?{pattern:y.pattern}:{},...y.minLength!==void 0?{minLength:y.minLength}:{},...y.maxLength!==void 0?{maxLength:y.maxLength}:{},...y.minimum!==void 0?{minimum:y.minimum}:{},...y.maximum!==void 0?{maximum:y.maximum}:{},...y.exclusiveMinimum!==void 0?{exclusiveMinimum:y.exclusiveMinimum}:{},...y.exclusiveMaximum!==void 0?{exclusiveMaximum:y.exclusiveMaximum}:{},...y.multipleOf!==void 0?{multipleOf:y.multipleOf}:{},...y.minItems!==void 0?{minItems:y.minItems}:{},...y.maxItems!==void 0?{maxItems:y.maxItems}:{},...y.uniqueItems!==void 0?{uniqueItems:y.uniqueItems}:{},...y.nullable!==void 0?{nullable:y.nullable}:{},...y.oneOf!==void 0?{oneOf:y.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let m=new Set;if(Array.isArray(p.variable))for(let b of p.variable)b.key&&m.add(b.key);if(m.size===0&&p.raw)return p.raw;let y="";if(p.protocol&&(y+=p.protocol+"://"),p.host&&(y+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(y+=":"+p.port),p.path){let q=(Array.isArray(p.path)?p.path:[p.path]).map(x=>{let v=x.startsWith(":")?x.substring(1):x;return m.has(v)?":"+v:(x.startsWith(":"),x)});y+="/"+q.join("/")}return!y&&p.raw?p.raw:y},l=p=>{if(!Array.isArray(p)||p.length===0)return;let m={responses:{}};for(let y of p){let b=String(y.code||200),q,x={};if(Array.isArray(y.header))for(let P of y.header)!P.key||P.disabled||(P.key.toLowerCase()==="content-type"?q=P.value?.split(";")[0]?.trim():x[P.key]={description:String(P.value??""),schema:{type:"string"}});let v=y.body;if(typeof y.body=="string"&&y.body)try{v=JSON.parse(y.body)}catch{}let _=y.originalRequest,E;if(_){let P=typeof _.url=="string"?_.url:_.url?.raw??"";E=`${_.method||""} ${P}`.trim()||void 0}let k=y.name?y.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${b}`:`example_${b}`;if(m.responses[b]){let P=m.responses[b];P.examples=P.examples??{},P.examples[k]={summary:E,value:v}}else m.responses[b]={description:y.name,contentType:q,examples:{[k]:{summary:E,value:v}},...Object.keys(x).length>0?{headers:x}:{}}}return Object.keys(m.responses).length>0?m:void 0},c=p=>p.map(m=>{if(m.item)return{id:Pt(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:c(m.item)};{let y=m.request||{};return{id:Pt(m.name),type:"request",name:m.name,description:m.description||y.description,method:typeof y.method=="string"?y.method:"GET",url:o(y.url),query:s(y.url),headers:Array.isArray(y.header)?y.header.map(b=>({key:b.key||b.name||"",value:b.value||b.value||"",enabled:b.disabled!==!0,...b.description!==void 0?{description:b.description}:{},...b.type!==void 0?{type:b.type}:{},...b.required!==void 0?{required:b.required}:{},...b.format!==void 0?{format:b.format}:{},...b.enum!==void 0?{enum:b.enum}:{},...b.deprecated!==void 0?{deprecated:b.deprecated}:{},...b.pattern!==void 0?{pattern:b.pattern}:{},...b.minLength!==void 0?{minLength:b.minLength}:{},...b.maxLength!==void 0?{maxLength:b.maxLength}:{},...b.minimum!==void 0?{minimum:b.minimum}:{},...b.maximum!==void 0?{maximum:b.maximum}:{},...b.exclusiveMinimum!==void 0?{exclusiveMinimum:b.exclusiveMinimum}:{},...b.exclusiveMaximum!==void 0?{exclusiveMaximum:b.exclusiveMaximum}:{},...b.multipleOf!==void 0?{multipleOf:b.multipleOf}:{},...b.minItems!==void 0?{minItems:b.minItems}:{},...b.maxItems!==void 0?{maxItems:b.maxItems}:{},...b.uniqueItems!==void 0?{uniqueItems:b.uniqueItems}:{},...b.nullable!==void 0?{nullable:b.nullable}:{},...b.oneOf!==void 0?{oneOf:b.oneOf}:{}})):[],body:(()=>{let b=y.body;if(b){if(b.mode==="raw"&&b.raw){let q=b.options?.raw?.language;return{type:"raw",format:q==="xml"?"xml":q==="html"?"html":q==="javascript"?"javascript":q==="text"?"text":"json",content:b.raw}}if(b.mode==="urlencoded"&&Array.isArray(b.urlencoded))return{type:"x-www-form-urlencoded",content:b.urlencoded.map(q=>({key:q.key||"",value:q.value||"",enabled:q.disabled!==!0}))};if(b.mode==="formdata"&&Array.isArray(b.formdata))return{type:"form-data",content:b.formdata.map(q=>({key:q.key||"",value:q.value||"",type:q.type||"text",enabled:q.disabled!==!0}))};if(b.mode==="graphql"&&b.graphql){let q;if(b.graphql.variables)try{q=JSON.parse(b.graphql.variables)}catch{q=void 0}return{type:"graphql",content:{query:b.graphql.query||"",variables:q}}}if(b.mode==="binary")return{type:"binary",content:""}}})(),auth:r(y.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior),responseSchema:l(m.response)}}}),d={id:Pt(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,m])=>[p,String(m??"")])):void 0,items:c(e.item||[])};return await this.saveCollection(d),d}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Rz(n),s=JSON.stringify(i,null,2);Dt.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=hi.join(r,Wt(n.name));Dt.mkdirSync(i,{recursive:!0});let s=n.variables||{};xu(hi.join(i,`${Wt(n.name)}.env`),s),Kf(i,Wt(n.name),n.scripts),Om(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var lr,La,yo,g0=le(()=>{"use strict";lr={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,tls:{},certificates:[]},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:{port:3100,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"}}}},La={preferred:".http-forge/http-forge.config.json",legacy:"http-forge.config.json"},yo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Bt from"fs";import*as Jt from"path";var vo,km=le(()=>{"use strict";g0();vo=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=this.resolveConfigPath(),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatchers=[];resolveConfigPath(){let e=Jt.join(this.workspacePath,La.preferred);if(Bt.existsSync(e))return e;let r=Jt.join(this.workspacePath,La.legacy);return Bt.existsSync(r)?r:e}loadConfig(){if(this.configPath=this.resolveConfigPath(),!Bt.existsSync(this.configPath))return{...lr};try{let e=Bt.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 ${Jt.relative(this.workspacePath,this.configPath)}. Using default configuration.`),{...lr}}}mergeWithDefaults(e){return{version:e.version??lr.version,storage:{...lr.storage,...e.storage},request:{...lr.request,...e.request},scripts:{...lr.scripts,...e.scripts},runner:{...lr.runner,...e.runner},environments:{...lr.environments,...e.environments},restClientExport:{...lr.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:lr.proxy,mcp:{...lr.mcp,...e.mcp,cors:{...lr.mcp.cors,...e.mcp?.cors}},secrets:{...lr.secrets,...e.secrets,providers:{...lr.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;let e=()=>{this.reload()};for(let r of[La.preferred,La.legacy]){let n=this.fileWatcherFactory.createFileWatcher(this.workspacePath,r);n.onDidChange(e),n.onDidCreate(e),n.onDidDelete(e),this.fileWatchers.push(n)}}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 Jt.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??lr.mcp,r=["flat","drilldown","auto"];return{...e,port:Math.min(65535,Math.max(1,Math.floor(e.port??3100))),toolMode:r.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 Jt.join(this.workspacePath,...r.split("/"))}hasFolderCollectionsAtRoot(e){let r=Jt.join(e,yo.collections);if(!Bt.existsSync(r))return!1;let n;try{n=Bt.readdirSync(r,{withFileTypes:!0})}catch{return!1}return n.some(i=>{if(!i.isDirectory())return!1;let s=Jt.join(r,i.name,"collection.json");return Bt.existsSync(s)})}hasAnyEntries(e){if(!Bt.existsSync(e))return!1;try{return Bt.readdirSync(e).length>0}catch{return!1}}resolveStorageRootPath(){let e=this.resolvePath(this.config.storage.root);return this.configExists()||this.hasFolderCollectionsAtRoot(e)?e:[Jt.join(this.workspacePath,"http-forge-assets")].find(i=>this.hasFolderCollectionsAtRoot(i))||e}getRootPath(){return this.resolveStorageRootPath()}getCollectionsPath(){return Jt.join(this.getRootPath(),yo.collections)}getEnvironmentsPath(){return Jt.join(this.getRootPath(),yo.environments)}getFlowsPath(){return Jt.join(this.getRootPath(),yo.flows)}getHistoryPath(){let e=this.resolvePath(this.config.storage.history);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","histories");return this.hasAnyEntries(r)?r:e}getResultsPath(){let e=this.resolvePath(this.config.storage.results);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","results");return this.hasAnyEntries(r)?r:e}getSuitesPath(){return Jt.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.configPath=this.resolveConfigPath(),this.config=this.loadConfig()}configExists(){return Bt.existsSync(this.resolveConfigPath())}async createDefaultConfig(){await Bt.promises.mkdir(Jt.dirname(this.configPath),{recursive:!0});let e=JSON.stringify(lr,null,2);await Bt.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Bt.existsSync(i)||await Bt.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Bt.existsSync(i)||await Bt.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 Bt.promises.writeFile(Jt.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 Bt.promises.writeFile(Jt.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 Bt.promises.writeFile(Jt.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){for(let e of this.fileWatchers)e.dispose();this.fileWatchers=[]}}});var Oz,Xf,y0=le(()=>{"use strict";ga();Oz="httpForge.cookies",Xf=class{constructor(e,r=Oz){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 Ct.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 Ct.parseCookieHeaders(e,r)}isExpired(e){return Ct.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 Ct.domainMatches(e,r)}get count(){return this.cookies.size}}});var ed,v0=le(()=>{"use strict";ga();ed=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=>!(Ct.isExpired(s)||s.domain&&!Ct.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return Ct.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 Am(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 c=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;c&&d!==!1&&(s[c]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,c]of Object.entries(i))s[l]=String(c??"");let o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function Pz(t,e){try{let r=await e.readFile(t);return Am(r)}catch{return null}}var b0=le(()=>{"use strict"});import*as ur from"fs";import*as xn from"path";var td,rd,S0=le(()=>{"use strict";jn();b0();Pm();Th();uf();td={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},rd=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=xn.join(l,"_global.json"),this.localConfigPath=xn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(td.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||!ur.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(!ur.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(td.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`${td.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||{},c=o?.variables||{},d=o&&o.headers||{},p=Zc(n.defaultHeaders||{},d),m=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},b={...s.variables||{},...c,...m,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:b}}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=xn.join(e,"globals.env");xu(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let c={...l.variables||{}};r&&(c={...s,...c});let d=xn.join(e,`${Wt(o)}.env`);xu(d,c)})}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 xn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return ur.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=ur.readFileSync(e,"utf-8"),n=Am(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 xn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=nf(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 i=this.getResolvedEnvironment(e)?.variables||{},s=this.getGlobalVariables(),o=this.getGlobalVariableLocals();return new Sa({globals:s,collectionVariables:{},environmentVariables:i,variables:{...o,...r||{}}})}saveFolderSharedConfig(e){ur.existsSync(this.environmentsPath)||ur.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=ur.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Ah(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=xn.basename(s,".json");if(!i.has(o))try{ur.unlinkSync(xn.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(xn.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(td.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(td.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(!ur.existsSync(e))return null;let r=ur.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=xn.dirname(e);ur.existsSync(n)||ur.mkdirSync(n,{recursive:!0}),ur.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var bo,Tm=le(()=>{"use strict";Hf();bo=class t{constructor(e,r,n,i,s,o,l,c,d,p,m,y,b){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=c;this.onConsoleOutput=d;this.collectionName=p;this.collectionAuth=m;this.iteration=y;this.iterationCount=b}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 c=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...c},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setEnvironmentVariable(b,q,this.environment):y==="unset"&&b?this.envConfigService.deleteEnvironmentVariable(b,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setGlobalVariable(b,q):y==="unset"&&b?this.envConfigService.deleteGlobalVariable(b):y==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(d),m=null;try{let y={...r},b={...e},q;if((!b.auth||b.auth.type==="inherit")&&(b.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let D=await p.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),D.nextRequest!==void 0&&(q=D.nextRequest),D.skipRequest){let J={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:J,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:q}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(b.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(b.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(b.params=D.modifiedRequest.params),D.modifiedRequest.query&&(b.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(b.body=D.modifiedRequest.body)),(D.localVariables??D.modifiedVariables)&&(y=D.localVariables??D.modifiedVariables))}m=await this.requestPreparer.prepareRequest(b,this.environment,l,y);let{url:x,headers:v,body:_,method:E}=m,k={};for(let D in v)Object.prototype.hasOwnProperty.call(v,D)&&(k[D.toUpperCase()]=v[D]);if(!k.COOKIE&&b.settings?.includeCookies!==!1&&this.cookieJar){let J=this.cookieJar.getCookieHeader(x);J&&(k.COOKIE=J)}let P={method:E,url:x,headers:k,body:_.content,signal:n,settings:b.settings?{...b.settings}:void 0},M=await this.httpService.execute(P);this.cookieJar&&M.headers&&await this.cookieJar.setCookiesFromResponse(x,M.headers);let j=Date.now()-i,I=[],R={},A;if(o.length>0){let D=0;if(M.body)if(typeof M.body=="string")D=Buffer.byteLength(M.body,"utf8");else if(Buffer.isBuffer(M.body))D=M.body.length;else try{D=Buffer.byteLength(JSON.stringify(M.body),"utf8")}catch{D=0}let J=xm(M.headers,M.cookies,m.url),Q={executedRequest:m,status:M.status,statusText:M.statusText,headers:n0(M.headers||{}),body:M.body,cookies:J,responseTime:M.time,responseSize:D},se=await p.executePostResponse(o,Q);I=se.testResults,R=se.modifiedEnvironmentVariables||{},A=se.visualizerData,(se.localVariables??se.modifiedVariables)&&(y=se.localVariables??se.modifiedVariables),se.nextRequest!==void 0&&(q=se.nextRequest),se.consoleOutput&&se.consoleOutput.length>0&&this.onConsoleOutput?.(se.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let F=I.length===0||I.every(D=>D.passed),U=I.length>0?F:M.status>=200&&M.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...m,headers:k},response:{status:M.status,statusText:M.statusText,headers:M.headers||{},body:M.body,time:M.time||j,cookies:M.cookies||[]},duration:j,timestamp:Date.now(),passed:U,assertions:I,modifiedVariables:y,modifiedEnvironmentVariables:R,nextRequest:q,visualizerData:A}}catch(y){return this.handleError(e,m,y,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 c=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",p=this.errorBodyFormat,m,y;p==="html"||p==="both"?(m=t.formatErrorAsHtml(c,d),y={"content-type":"text/html; charset=utf-8"}):(m=c,y={});let b={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||b,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:c}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");return`<!doctype html>
54
+ `)}function _z(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 Pm=le(()=>{"use strict";jn()});import*as Ir from"fs";import*as f0 from"path";var Cu,d0=le(()=>{"use strict";jn();Cu=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){Ir.existsSync(this.collectionsDir)||Ir.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!Ir.existsSync(this.collectionsDir))return[];let e=Ir.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=f0.join(this.collectionsDir,n),s=Ir.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(Ir.existsSync(r))try{let n=Ir.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=Pt(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await Ir.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!Ir.existsSync(r))return!1;try{return await Ir.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return Ir.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return f0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||Pt(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,...c}=n;return Object.assign(s,c),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 c=this.findItemById(i.items,r);if(!c||!c.items)return!1;s=c.items}else s=i.items;let o=new Map(s.map(c=>[c.id,c])),l=[];for(let c of n){let d=o.get(c);d&&(l.push(d),o.delete(c))}for(let c of o.values())l.push(c);if(r){let c=this.findItemById(i.items,r);c&&(c.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 Qf,p0=le(()=>{"use strict";Ph();d0();Qf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new so(n):new Cu(n)}static createForFormat(e,r){return e==="folder"?new so(r):new Cu(r)}}});import*as Dt from"fs";import*as hi from"path";function mP(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 Rz(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=>gP(e)),event:h0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function gP(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(gP):[],event:h0(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).map(xz),url:Cz(e),body:Ez(e),auth:qz(e.auth),description:e.description},event:h0(e.scripts),protocolProfileBehavior:Iz(e.settings)}}}function xz(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 Cz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let d=o[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let p={key:d.key,value:d.value};return d.enabled===!1&&(p.disabled=!0),d.description!==void 0&&(p.description=d.description),d.type!==void 0&&(p.type=d.type),d.required!==void 0&&(p.required=d.required),d.format!==void 0&&(p.format=d.format),d.enum!==void 0&&(p.enum=d.enum),d.deprecated!==void 0&&(p.deprecated=d.deprecated),d.pattern!==void 0&&(p.pattern=d.pattern),d.minLength!==void 0&&(p.minLength=d.minLength),d.maxLength!==void 0&&(p.maxLength=d.maxLength),d.minimum!==void 0&&(p.minimum=d.minimum),d.maximum!==void 0&&(p.maximum=d.maximum),d.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=d.exclusiveMinimum),d.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=d.exclusiveMaximum),d.multipleOf!==void 0&&(p.multipleOf=d.multipleOf),d.minItems!==void 0&&(p.minItems=d.minItems),d.maxItems!==void 0&&(p.maxItems=d.maxItems),d.uniqueItems!==void 0&&(p.uniqueItems=d.uniqueItems),d.nullable!==void 0&&(p.nullable=d.nullable),d.oneOf!==void 0&&(p.oneOf=d.oneOf),p});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(m=>{let[y,...b]=m.split("=");return{key:y,value:b.join("=")}}))}let c;return t.params&&typeof t.params=="object"&&(c=Object.entries(t.params).map(([d,p])=>({key:d,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:c&&c.length>0?c:void 0}}function Ez(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=mP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||mP(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 qz(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 Iz(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 h0(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 Zf,m0=le(()=>{"use strict";jn();Pm();p0();Zf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Qf.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(){Dt.existsSync(this.collectionsDir)||Dt.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=Pt(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:c,...d}=n;Object.assign(o,d)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=Pt(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:Pt(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=Pt(r),s=this.loader.getCollectionPath(e),o=hi.join(this.collectionsDir,i);if(!Dt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=hi.join(o,"collection.json");if(Dt.existsSync(l)){let d=JSON.parse(Dt.readFileSync(l,"utf-8"));d.id=i,d.name=r,Dt.writeFileSync(l,JSON.stringify(d,null,2))}else Dt.writeFileSync(l,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let c=this.collections.get(i);if(!c)throw new Error("Failed to load duplicated collection");return c}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:Pt(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||!Dt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=hi.dirname(s),l=Pt(n),c=hi.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,c);let d=hi.join(c,"folder.json");if(Dt.existsSync(d)){let y=JSON.parse(Dt.readFileSync(d,"utf-8"));y.id=l,y.name=n,Dt.writeFileSync(d,JSON.stringify(y,null,2))}else Dt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),m=p?this.findItemById(p.items,l):void 0;return m||{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||Pt(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,d={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=d,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,d),!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){Dt.existsSync(r)||Dt.mkdirSync(r,{recursive:!0});for(let n of Dt.readdirSync(e,{withFileTypes:!0})){let i=hi.join(e,n.name),s=hi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Dt.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=Dt.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||Pt(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(E=>E.key==="token")?.value||""};case"basic":let b=p.basic?.find(E=>E.key==="username"),q=p.basic?.find(E=>E.key==="password");return{type:"basic",basicAuth:{username:b?.value||"",password:q?.value||""}};case"apikey":let x=p.apikey?.find(E=>E.key==="key"),v=p.apikey?.find(E=>E.key==="value"),R=p.apikey?.find(E=>E.key==="in");return{type:"apikey",apikey:{key:x?.value||"",value:v?.value||"",in:R?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let m={};for(let y of p){let b=y.script?.exec;if(!b)continue;let q=Array.isArray(b)?b.join(`
55
+ `):b;y.listen==="prerequest"?m.preRequest=q:y.listen==="test"&&(m.postResponse=q)}return m.preRequest||m.postResponse?m:void 0},i=p=>{if(!p||typeof p!="object")return;let m={};return p.followRedirects===!1&&(m.followRedirects=!1),p.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),p.maxRedirects!==void 0&&(m.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(m.timeout=p.requestTimeout),Object.keys(m).length>0?m:void 0},s=p=>{if(!p||typeof p=="string")return;let m=p.query;if(!(!Array.isArray(m)||m.length===0))return m.map(y=>({key:y.key||"",value:y.value||"",enabled:y.disabled!==!0,...y.description!==void 0?{description:y.description}:{},...y.type!==void 0?{type:y.type}:{},...y.required!==void 0?{required:y.required}:{},...y.format!==void 0?{format:y.format}:{},...y.enum!==void 0?{enum:y.enum}:{},...y.deprecated!==void 0?{deprecated:y.deprecated}:{},...y.pattern!==void 0?{pattern:y.pattern}:{},...y.minLength!==void 0?{minLength:y.minLength}:{},...y.maxLength!==void 0?{maxLength:y.maxLength}:{},...y.minimum!==void 0?{minimum:y.minimum}:{},...y.maximum!==void 0?{maximum:y.maximum}:{},...y.exclusiveMinimum!==void 0?{exclusiveMinimum:y.exclusiveMinimum}:{},...y.exclusiveMaximum!==void 0?{exclusiveMaximum:y.exclusiveMaximum}:{},...y.multipleOf!==void 0?{multipleOf:y.multipleOf}:{},...y.minItems!==void 0?{minItems:y.minItems}:{},...y.maxItems!==void 0?{maxItems:y.maxItems}:{},...y.uniqueItems!==void 0?{uniqueItems:y.uniqueItems}:{},...y.nullable!==void 0?{nullable:y.nullable}:{},...y.oneOf!==void 0?{oneOf:y.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let m=new Set;if(Array.isArray(p.variable))for(let b of p.variable)b.key&&m.add(b.key);if(m.size===0&&p.raw)return p.raw;let y="";if(p.protocol&&(y+=p.protocol+"://"),p.host&&(y+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(y+=":"+p.port),p.path){let q=(Array.isArray(p.path)?p.path:[p.path]).map(x=>{let v=x.startsWith(":")?x.substring(1):x;return m.has(v)?":"+v:(x.startsWith(":"),x)});y+="/"+q.join("/")}return!y&&p.raw?p.raw:y},l=p=>{if(!Array.isArray(p)||p.length===0)return;let m={responses:{}};for(let y of p){let b=String(y.code||200),q,x={};if(Array.isArray(y.header))for(let P of y.header)!P.key||P.disabled||(P.key.toLowerCase()==="content-type"?q=P.value?.split(";")[0]?.trim():x[P.key]={description:String(P.value??""),schema:{type:"string"}});let v=y.body;if(typeof y.body=="string"&&y.body)try{v=JSON.parse(y.body)}catch{}let R=y.originalRequest,E;if(R){let P=typeof R.url=="string"?R.url:R.url?.raw??"";E=`${R.method||""} ${P}`.trim()||void 0}let k=y.name?y.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${b}`:`example_${b}`;if(m.responses[b]){let P=m.responses[b];P.examples=P.examples??{},P.examples[k]={summary:E,value:v}}else m.responses[b]={description:y.name,contentType:q,examples:{[k]:{summary:E,value:v}},...Object.keys(x).length>0?{headers:x}:{}}}return Object.keys(m.responses).length>0?m:void 0},c=p=>p.map(m=>{if(m.item)return{id:Pt(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:c(m.item)};{let y=m.request||{};return{id:Pt(m.name),type:"request",name:m.name,description:m.description||y.description,method:typeof y.method=="string"?y.method:"GET",url:o(y.url),query:s(y.url),headers:Array.isArray(y.header)?y.header.map(b=>({key:b.key||b.name||"",value:b.value||b.value||"",enabled:b.disabled!==!0,...b.description!==void 0?{description:b.description}:{},...b.type!==void 0?{type:b.type}:{},...b.required!==void 0?{required:b.required}:{},...b.format!==void 0?{format:b.format}:{},...b.enum!==void 0?{enum:b.enum}:{},...b.deprecated!==void 0?{deprecated:b.deprecated}:{},...b.pattern!==void 0?{pattern:b.pattern}:{},...b.minLength!==void 0?{minLength:b.minLength}:{},...b.maxLength!==void 0?{maxLength:b.maxLength}:{},...b.minimum!==void 0?{minimum:b.minimum}:{},...b.maximum!==void 0?{maximum:b.maximum}:{},...b.exclusiveMinimum!==void 0?{exclusiveMinimum:b.exclusiveMinimum}:{},...b.exclusiveMaximum!==void 0?{exclusiveMaximum:b.exclusiveMaximum}:{},...b.multipleOf!==void 0?{multipleOf:b.multipleOf}:{},...b.minItems!==void 0?{minItems:b.minItems}:{},...b.maxItems!==void 0?{maxItems:b.maxItems}:{},...b.uniqueItems!==void 0?{uniqueItems:b.uniqueItems}:{},...b.nullable!==void 0?{nullable:b.nullable}:{},...b.oneOf!==void 0?{oneOf:b.oneOf}:{}})):[],body:(()=>{let b=y.body;if(b){if(b.mode==="raw"&&b.raw){let q=b.options?.raw?.language;return{type:"raw",format:q==="xml"?"xml":q==="html"?"html":q==="javascript"?"javascript":q==="text"?"text":"json",content:b.raw}}if(b.mode==="urlencoded"&&Array.isArray(b.urlencoded))return{type:"x-www-form-urlencoded",content:b.urlencoded.map(q=>({key:q.key||"",value:q.value||"",enabled:q.disabled!==!0}))};if(b.mode==="formdata"&&Array.isArray(b.formdata))return{type:"form-data",content:b.formdata.map(q=>({key:q.key||"",value:q.value||"",type:q.type||"text",enabled:q.disabled!==!0}))};if(b.mode==="graphql"&&b.graphql){let q;if(b.graphql.variables)try{q=JSON.parse(b.graphql.variables)}catch{q=void 0}return{type:"graphql",content:{query:b.graphql.query||"",variables:q}}}if(b.mode==="binary")return{type:"binary",content:""}}})(),auth:r(y.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior),responseSchema:l(m.response)}}}),d={id:Pt(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,m])=>[p,String(m??"")])):void 0,items:c(e.item||[])};return await this.saveCollection(d),d}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Rz(n),s=JSON.stringify(i,null,2);Dt.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=hi.join(r,Wt(n.name));Dt.mkdirSync(i,{recursive:!0});let s=n.variables||{};xu(hi.join(i,`${Wt(n.name)}.env`),s),Kf(i,Wt(n.name),n.scripts),Om(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var lr,La,yo,g0=le(()=>{"use strict";lr={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,tls:{},certificates:[]},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:{port:3100,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"}}}},La={preferred:".http-forge/http-forge.config.json",legacy:"http-forge.config.json"},yo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Bt from"fs";import*as Jt from"path";var vo,km=le(()=>{"use strict";g0();vo=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=this.resolveConfigPath(),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatchers=[];resolveConfigPath(){let e=Jt.join(this.workspacePath,La.preferred);if(Bt.existsSync(e))return e;let r=Jt.join(this.workspacePath,La.legacy);return Bt.existsSync(r)?r:e}loadConfig(){if(this.configPath=this.resolveConfigPath(),!Bt.existsSync(this.configPath))return{...lr};try{let e=Bt.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 ${Jt.relative(this.workspacePath,this.configPath)}. Using default configuration.`),{...lr}}}mergeWithDefaults(e){return{version:e.version??lr.version,storage:{...lr.storage,...e.storage},request:{...lr.request,...e.request},scripts:{...lr.scripts,...e.scripts},runner:{...lr.runner,...e.runner},environments:{...lr.environments,...e.environments},restClientExport:{...lr.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:lr.proxy,mcp:{...lr.mcp,...e.mcp,cors:{...lr.mcp.cors,...e.mcp?.cors}},secrets:{...lr.secrets,...e.secrets,providers:{...lr.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;let e=()=>{this.reload()};for(let r of[La.preferred,La.legacy]){let n=this.fileWatcherFactory.createFileWatcher(this.workspacePath,r);n.onDidChange(e),n.onDidCreate(e),n.onDidDelete(e),this.fileWatchers.push(n)}}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 Jt.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??lr.mcp,r=["flat","drilldown","auto"];return{...e,port:Math.min(65535,Math.max(1,Math.floor(e.port??3100))),toolMode:r.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 Jt.join(this.workspacePath,...r.split("/"))}hasFolderCollectionsAtRoot(e){let r=Jt.join(e,yo.collections);if(!Bt.existsSync(r))return!1;let n;try{n=Bt.readdirSync(r,{withFileTypes:!0})}catch{return!1}return n.some(i=>{if(!i.isDirectory())return!1;let s=Jt.join(r,i.name,"collection.json");return Bt.existsSync(s)})}hasAnyEntries(e){if(!Bt.existsSync(e))return!1;try{return Bt.readdirSync(e).length>0}catch{return!1}}resolveStorageRootPath(){let e=this.resolvePath(this.config.storage.root);return this.configExists()||this.hasFolderCollectionsAtRoot(e)?e:[Jt.join(this.workspacePath,"http-forge-assets")].find(i=>this.hasFolderCollectionsAtRoot(i))||e}getRootPath(){return this.resolveStorageRootPath()}getCollectionsPath(){return Jt.join(this.getRootPath(),yo.collections)}getEnvironmentsPath(){return Jt.join(this.getRootPath(),yo.environments)}getFlowsPath(){return Jt.join(this.getRootPath(),yo.flows)}getHistoryPath(){let e=this.resolvePath(this.config.storage.history);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","histories");return this.hasAnyEntries(r)?r:e}getResultsPath(){let e=this.resolvePath(this.config.storage.results);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","results");return this.hasAnyEntries(r)?r:e}getSuitesPath(){return Jt.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.configPath=this.resolveConfigPath(),this.config=this.loadConfig()}configExists(){return Bt.existsSync(this.resolveConfigPath())}async createDefaultConfig(){await Bt.promises.mkdir(Jt.dirname(this.configPath),{recursive:!0});let e=JSON.stringify(lr,null,2);await Bt.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Bt.existsSync(i)||await Bt.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Bt.existsSync(i)||await Bt.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 Bt.promises.writeFile(Jt.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 Bt.promises.writeFile(Jt.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 Bt.promises.writeFile(Jt.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){for(let e of this.fileWatchers)e.dispose();this.fileWatchers=[]}}});var Oz,Xf,y0=le(()=>{"use strict";ga();Oz="httpForge.cookies",Xf=class{constructor(e,r=Oz){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 Ct.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 Ct.parseCookieHeaders(e,r)}isExpired(e){return Ct.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 Ct.domainMatches(e,r)}get count(){return this.cookies.size}}});var ed,v0=le(()=>{"use strict";ga();ed=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=>!(Ct.isExpired(s)||s.domain&&!Ct.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return Ct.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 Am(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 c=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;c&&d!==!1&&(s[c]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,c]of Object.entries(i))s[l]=String(c??"");let o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function Pz(t,e){try{let r=await e.readFile(t);return Am(r)}catch{return null}}var b0=le(()=>{"use strict"});import*as ur from"fs";import*as xn from"path";var td,rd,S0=le(()=>{"use strict";jn();b0();Pm();Th();uf();td={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},rd=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=xn.join(l,"_global.json"),this.localConfigPath=xn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(td.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||!ur.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(!ur.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(td.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`${td.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||{},c=o?.variables||{},d=o&&o.headers||{},p=Zc(n.defaultHeaders||{},d),m=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},b={...s.variables||{},...c,...m,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:b}}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=xn.join(e,"globals.env");xu(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let c={...l.variables||{}};r&&(c={...s,...c});let d=xn.join(e,`${Wt(o)}.env`);xu(d,c)})}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 xn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return ur.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=ur.readFileSync(e,"utf-8"),n=Am(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 xn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=nf(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 i=this.getResolvedEnvironment(e)?.variables||{},s=this.getGlobalVariables(),o=this.getGlobalVariableLocals();return new Sa({globals:s,collectionVariables:{},environmentVariables:i,variables:{...o,...r||{}}})}saveFolderSharedConfig(e){ur.existsSync(this.environmentsPath)||ur.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=ur.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Ah(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=xn.basename(s,".json");if(!i.has(o))try{ur.unlinkSync(xn.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(xn.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(td.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(td.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(!ur.existsSync(e))return null;let r=ur.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=xn.dirname(e);ur.existsSync(n)||ur.mkdirSync(n,{recursive:!0}),ur.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var bo,Tm=le(()=>{"use strict";Hf();bo=class t{constructor(e,r,n,i,s,o,l,c,d,p,m,y,b){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=c;this.onConsoleOutput=d;this.collectionName=p;this.collectionAuth=m;this.iteration=y;this.iterationCount=b}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 c=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...c},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setEnvironmentVariable(b,q,this.environment):y==="unset"&&b?this.envConfigService.deleteEnvironmentVariable(b,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setGlobalVariable(b,q):y==="unset"&&b?this.envConfigService.deleteGlobalVariable(b):y==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(d),m=null;try{let y={...r},b={...e},q;if((!b.auth||b.auth.type==="inherit")&&(b.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let D=await p.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),D.nextRequest!==void 0&&(q=D.nextRequest),D.skipRequest){let J={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:J,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:q}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(b.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(b.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(b.params=D.modifiedRequest.params),D.modifiedRequest.query&&(b.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(b.body=D.modifiedRequest.body)),(D.localVariables??D.modifiedVariables)&&(y=D.localVariables??D.modifiedVariables))}m=await this.requestPreparer.prepareRequest(b,this.environment,l,y);let{url:x,headers:v,body:R,method:E}=m,k={};for(let D in v)Object.prototype.hasOwnProperty.call(v,D)&&(k[D.toUpperCase()]=v[D]);if(!k.COOKIE&&b.settings?.includeCookies!==!1&&this.cookieJar){let J=this.cookieJar.getCookieHeader(x);J&&(k.COOKIE=J)}let P={method:E,url:x,headers:k,body:R.content,signal:n,settings:b.settings?{...b.settings}:void 0},M=await this.httpService.execute(P);this.cookieJar&&M.headers&&await this.cookieJar.setCookiesFromResponse(x,M.headers);let j=Date.now()-i,I=[],_={},A;if(o.length>0){let D=0;if(M.body)if(typeof M.body=="string")D=Buffer.byteLength(M.body,"utf8");else if(Buffer.isBuffer(M.body))D=M.body.length;else try{D=Buffer.byteLength(JSON.stringify(M.body),"utf8")}catch{D=0}let J=xm(M.headers,M.cookies,m.url),Q={executedRequest:m,status:M.status,statusText:M.statusText,headers:n0(M.headers||{}),body:M.body,cookies:J,responseTime:M.time,responseSize:D},se=await p.executePostResponse(o,Q);I=se.testResults,_=se.modifiedEnvironmentVariables||{},A=se.visualizerData,(se.localVariables??se.modifiedVariables)&&(y=se.localVariables??se.modifiedVariables),se.nextRequest!==void 0&&(q=se.nextRequest),se.consoleOutput&&se.consoleOutput.length>0&&this.onConsoleOutput?.(se.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let F=I.length===0||I.every(D=>D.passed),U=I.length>0?F:M.status>=200&&M.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...m,headers:k},response:{status:M.status,statusText:M.statusText,headers:M.headers||{},body:M.body,time:M.time||j,cookies:M.cookies||[]},duration:j,timestamp:Date.now(),passed:U,assertions:I,modifiedVariables:y,modifiedEnvironmentVariables:_,nextRequest:q,visualizerData:A}}catch(y){return this.handleError(e,m,y,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 c=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",p=this.errorBodyFormat,m,y;p==="html"||p==="both"?(m=t.formatErrorAsHtml(c,d),y={"content-type":"text/html; charset=utf-8"}):(m=c,y={});let b={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||b,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:c}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");return`<!doctype html>
56
56
  <html>
57
57
  <body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
58
58
  <h2 style="margin-top:0;color:#a94442">Request Error</h2>
@@ -61,7 +61,7 @@ ${i}
61
61
  ${n(r)}
62
62
  </pre>`:""}
63
63
  </body>
64
- </html>`}}});var nd,w0=le(()=>{"use strict";jn();nd=class{constructor(e,r,n,i,s,o){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=o}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,r,n,i){if(this.secretRegistry?.hasProviders){let _=await this.secretRegistry.resolveSecretTokens(e);Object.keys(_).length>0&&(i={..._,...i??{}})}let s=i&&Object.keys(i).length>0,o=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),l=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),c=Zc(n?.headers||{},e.headers||{}),d=s?this.envConfigService.resolveVariablesInObjectWithExtra(c,i,r):this.envConfigService.resolveVariablesInObject(c,r);if(d=this.preprocessor.sanitizeHeaders(d),!Object.keys(d).some(_=>_.toLowerCase()==="user-agent")){let _=this.appInfo?.version||"0.0.0",E=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${E}/${_}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let _=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);d.Authorization=`Bearer ${_}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let _=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),E=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),k=Buffer.from(`${_}:${E}`).toString("base64");d.Authorization=`Basic ${k}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,d,l,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,d,r);let m=null;if(e.body&&e.body.type!=="none"){let _=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof _=="string")try{_=JSON.parse(_)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let E={type:e.body.type,format:e.body.format,content:_};e.body.type==="form-data"?m=this.buildMultipartFormData(E.content):m=this.preprocessor.encodeBody(E)}e.body?.type!=="form-data"&&this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",b=e.url||"",q=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(b,i,r):this.envConfigService.resolveVariables(b,r),x=this.httpService.buildUrl(q,o,l),v={type:e.body?.type||"none",format:e.body?.format,content:m};return{url:x,method:y,headers:d,body:v,params:o,query:l}}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),o=e.tokenPrefix||"Bearer";r.Authorization=`${o} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let o=s&&Object.keys(s).length>0,l=o?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),c=o?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[l]=c:r[l]=c}buildMultipartFormData(e){if(!Array.isArray(e))return;let r=new FormData;for(let n of e)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}}});var kz,id,_0=le(()=>{"use strict";kz=`
64
+ </html>`}}});var nd,w0=le(()=>{"use strict";jn();nd=class{constructor(e,r,n,i,s,o){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=o}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,r,n,i){if(this.secretRegistry?.hasProviders){let E=await this.secretRegistry.resolveSecretTokens(e);Object.keys(E).length>0&&(i={...E,...i??{}})}let s=i&&Object.keys(i).length>0,o=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),l=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),c=Zc(n?.headers||{},e.headers||{}),d=s?this.envConfigService.resolveVariablesInObjectWithExtra(c,i,r):this.envConfigService.resolveVariablesInObject(c,r);if(d=this.preprocessor.sanitizeHeaders(d),!Object.keys(d).some(E=>E.toLowerCase()==="user-agent")){let E=this.appInfo?.version||"0.0.0",k=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${k}/${E}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let E=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);d.Authorization=`Bearer ${E}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let E=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),k=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),P=Buffer.from(`${E}:${k}`).toString("base64");d.Authorization=`Basic ${P}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,d,l,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,d,r);let m=null;if(e.body&&e.body.type!=="none"){let E=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof E=="string")try{E=JSON.parse(E)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let k={type:e.body.type,format:e.body.format,content:E};e.body.type==="form-data"?m=this.buildMultipartFormData(k.content):m=this.preprocessor.encodeBody(k)}e.body?.type!=="form-data"&&this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",b=e.url||"",q=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(b,i,r):this.envConfigService.resolveVariables(b,r),x=this.httpService.buildUrl(q,o,l),v=this.extractQueryFromUrl(x),R={type:e.body?.type||"none",format:e.body?.format,content:m};return{url:x,method:y,headers:d,body:R,params:o,query:v}}extractQueryFromUrl(e){let r=e.indexOf("?");if(r===-1)return{};let n=e.indexOf("#",r),i=n===-1?e.slice(r+1):e.slice(r+1,n);if(!i)return{};let s={};return new URLSearchParams(i).forEach((l,c)=>{s[c]=l}),s}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),o=e.tokenPrefix||"Bearer";r.Authorization=`${o} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let o=s&&Object.keys(s).length>0,l=o?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),c=o?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[l]=c:r[l]=c}buildMultipartFormData(e){if(!Array.isArray(e))return;let r=new FormData;for(let n of e)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}}});var kz,id,_0=le(()=>{"use strict";kz=`
65
65
  query IntrospectionQuery {
66
66
  __schema {
67
67
  queryType { name }
@@ -98,10 +98,10 @@ fragment TypeRef on __Type {
98
98
  `)}};ud.defaultYaml={explicit:!1,version:"1.2"};ud.defaultTags={"!!":"tag:yaml.org,2002:"};qP.Directives=ud});var Um=V(cd=>{"use strict";var IP=it(),Yz=ld();function Kz(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 OP(t){let e=new Set;return Yz.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function PP(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Qz(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=OP(t));let o=PP(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(IP.isScalar(o.node)||IP.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}}cd.anchorIsValid=Kz;cd.anchorNames=OP;cd.createNodeAnchors=Qz;cd.findNewAnchor=PP});var N0=V(kP=>{"use strict";function fd(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=fd(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=fd(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=fd(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=fd(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}kP.applyReviver=fd});var wo=V(TP=>{"use strict";var Zz=it();function AP(t,e,r){if(Array.isArray(t))return t.map((n,i)=>AP(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Zz.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}TP.toJS=AP});var Hm=V(NP=>{"use strict";var Xz=N0(),$P=it(),eJ=wo(),M0=class{constructor(e){Object.defineProperty(this,$P.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(!$P.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=eJ.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:d}of o.anchors.values())i(d,c);return typeof s=="function"?Xz.applyReviver(s,{"":l},"",l):l}};NP.NodeBase=M0});var dd=V(MP=>{"use strict";var tJ=Um(),rJ=ld(),Ou=it(),nJ=Hm(),iJ=wo(),F0=class extends nJ.NodeBase{constructor(e){super(Ou.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=[],rJ.visit(e,{Node:(s,o)=>{(Ou.isAlias(o)||Ou.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 c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=n.get(o);if(l||(iJ.toJS(o,null,r),l=n.get(o)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Bm(i,o,n)),l.count*l.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(tJ.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 Bm(t,e,r){if(Ou.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Ou.isCollection(e)){let n=0;for(let i of e.items){let s=Bm(t,i,r);s>n&&(n=s)}return n}else if(Ou.isPair(e)){let n=Bm(t,e.key,r),i=Bm(t,e.value,r);return Math.max(n,i)}return 1}MP.Alias=F0});var rr=V(D0=>{"use strict";var sJ=it(),oJ=Hm(),aJ=wo(),lJ=t=>!t||typeof t!="function"&&typeof t!="object",_o=class extends oJ.NodeBase{constructor(e){super(sJ.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:aJ.toJS(this.value,e,r)}toString(){return String(this.value)}};_o.BLOCK_FOLDED="BLOCK_FOLDED";_o.BLOCK_LITERAL="BLOCK_LITERAL";_o.PLAIN="PLAIN";_o.QUOTE_DOUBLE="QUOTE_DOUBLE";_o.QUOTE_SINGLE="QUOTE_SINGLE";D0.Scalar=_o;D0.isScalarValue=lJ});var pd=V(DP=>{"use strict";var uJ=dd(),Ha=it(),FP=rr(),cJ="tag:yaml.org,2002:";function fJ(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 dJ(t,e,r){if(Ha.isDocument(t)&&(t=t.contents),Ha.isNode(t))return t;if(Ha.isPair(t)){let m=r.schema[Ha.MAP].createNode?.(r.schema,null,r);return m.items.push(t),m}(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,c;if(n&&t&&typeof t=="object"){if(c=l.get(t),c)return c.anchor??(c.anchor=i(t)),new uJ.Alias(c.anchor);c={anchor:null,node:null},l.set(t,c)}e?.startsWith("!!")&&(e=cJ+e.slice(2));let d=fJ(t,e,o.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let m=new FP.Scalar(t);return c&&(c.node=m),m}d=t instanceof Map?o[Ha.MAP]:Symbol.iterator in Object(t)?o[Ha.SEQ]:o[Ha.MAP]}s&&(s(d),delete r.onTagObj);let p=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new FP.Scalar(t);return e?p.tag=e:d.default||(p.tag=d.tag),c&&(c.node=p),p}DP.createNode=dJ});var Wm=V(Vm=>{"use strict";var pJ=pd(),Ji=it(),hJ=Hm();function j0(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 pJ.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 jP=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,L0=class extends hJ.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=>Ji.isNode(n)||Ji.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(jP(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Ji.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,j0(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(Ji.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&&Ji.isScalar(s)?s.value:s:Ji.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ji.isPair(r))return!1;let n=r.value;return n==null||e&&Ji.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 Ji.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(Ji.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,j0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Vm.Collection=L0;Vm.collectionFromPath=j0;Vm.isEmptyPath=jP});var hd=V(zm=>{"use strict";var mJ=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function U0(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var gJ=(t,e,r)=>t.endsWith(`
99
99
  `)?U0(r,e):r.includes(`
100
100
  `)?`
101
- `+U0(r,e):(t.endsWith(" ")?"":" ")+r;zm.indentComment=U0;zm.lineComment=gJ;zm.stringifyComment=mJ});var UP=V(md=>{"use strict";var yJ="flow",H0="block",Jm="quoted";function vJ(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let d=[],p={},m=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):m=i-n);let y,b,q=!1,x=-1,v=-1,_=-1;r===H0&&(x=LP(t,x,e.length),x!==-1&&(m=x+c));for(let k;k=t[x+=1];){if(r===Jm&&k==="\\"){switch(v=x,t[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}_=x}if(k===`
101
+ `+U0(r,e):(t.endsWith(" ")?"":" ")+r;zm.indentComment=U0;zm.lineComment=gJ;zm.stringifyComment=mJ});var UP=V(md=>{"use strict";var yJ="flow",H0="block",Jm="quoted";function vJ(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let d=[],p={},m=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):m=i-n);let y,b,q=!1,x=-1,v=-1,R=-1;r===H0&&(x=LP(t,x,e.length),x!==-1&&(m=x+c));for(let k;k=t[x+=1];){if(r===Jm&&k==="\\"){switch(v=x,t[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}R=x}if(k===`
102
102
  `)r===H0&&(x=LP(t,x,e.length)),m=x+e.length+c,y=void 0;else{if(k===" "&&b&&b!==" "&&b!==`
103
103
  `&&b!==" "){let P=t[x+1];P&&P!==" "&&P!==`
104
- `&&P!==" "&&(y=x)}if(x>=m)if(y)d.push(y),m=y+c,y=void 0;else if(r===Jm){for(;b===" "||b===" ";)b=k,k=t[x+=1],q=!0;let P=x>_+1?x-2:v-1;if(p[P])return t;d.push(P),p[P]=!0,m=P+c,y=void 0}else q=!0}b=k}if(q&&l&&l(),d.length===0)return t;o&&o();let E=t.slice(0,d[0]);for(let k=0;k<d.length;++k){let P=d[k],M=d[k+1]||t.length;P===0?E=`
104
+ `&&P!==" "&&(y=x)}if(x>=m)if(y)d.push(y),m=y+c,y=void 0;else if(r===Jm){for(;b===" "||b===" ";)b=k,k=t[x+=1],q=!0;let P=x>R+1?x-2:v-1;if(p[P])return t;d.push(P),p[P]=!0,m=P+c,y=void 0}else q=!0}b=k}if(q&&l&&l(),d.length===0)return t;o&&o();let E=t.slice(0,d[0]);for(let k=0;k<d.length;++k){let P=d[k],M=d[k+1]||t.length;P===0?E=`
105
105
  ${e}${t.slice(0,M)}`:(r===Jm&&p[P]&&(E+=`${t[P]}\\`),E+=`
106
106
  ${e}${t.slice(P+1,M)}`)}return E}function LP(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
107
107
  `);n=e,i=e+1,s=t[i]}return n}md.FOLD_BLOCK=H0;md.FOLD_FLOW=yJ;md.FOLD_QUOTED=Jm;md.foldFlowLines=vJ});var yd=V(HP=>{"use strict";var mi=rr(),Ro=UP(),Ym=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Km=t=>/^(%|---|\.\.\.)/m.test(t);function bJ(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
@@ -118,30 +118,30 @@ ${r}`)+"'";return e.implicitKey?n:Ro.foldFlowLines(n,r,Ro.FOLD_FLOW,Ym(e,!1))}fu
118
118
  `;let m,y;for(y=r.length;y>0;--y){let M=r[y-1];if(M!==`
119
119
  `&&M!==" "&&M!==" ")break}let b=r.substring(y),q=b.indexOf(`
120
120
  `);q===-1?m="-":r===b||q!==b.length-1?(m="+",s&&s()):m="",b&&(r=r.slice(0,-b.length),b[b.length-1]===`
121
- `&&(b=b.slice(0,-1)),b=b.replace(V0,`$&${d}`));let x=!1,v,_=-1;for(v=0;v<r.length;++v){let M=r[v];if(M===" ")x=!0;else if(M===`
122
- `)_=v;else break}let E=r.substring(0,_<v?_+1:v);E&&(r=r.substring(E.length),E=E.replace(/\n+/g,`$&${d}`));let P=(x?d?"2":"1":"")+m;if(t&&(P+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let M=r.replace(/\n+/g,`
123
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),j=!1,I=Ym(n,!0);o!=="folded"&&e!==mi.Scalar.BLOCK_FOLDED&&(I.onOverflow=()=>{j=!0});let R=Ro.foldFlowLines(`${E}${M}${b}`,d,Ro.FOLD_BLOCK,I);if(!j)return`>${P}
124
- ${d}${R}`}return r=r.replace(/\n+/g,`$&${d}`),`|${P}
121
+ `&&(b=b.slice(0,-1)),b=b.replace(V0,`$&${d}`));let x=!1,v,R=-1;for(v=0;v<r.length;++v){let M=r[v];if(M===" ")x=!0;else if(M===`
122
+ `)R=v;else break}let E=r.substring(0,R<v?R+1:v);E&&(r=r.substring(E.length),E=E.replace(/\n+/g,`$&${d}`));let P=(x?d?"2":"1":"")+m;if(t&&(P+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let M=r.replace(/\n+/g,`
123
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),j=!1,I=Ym(n,!0);o!=="folded"&&e!==mi.Scalar.BLOCK_FOLDED&&(I.onOverflow=()=>{j=!0});let _=Ro.foldFlowLines(`${E}${M}${b}`,d,Ro.FOLD_BLOCK,I);if(!j)return`>${P}
124
+ ${d}${_}`}return r=r.replace(/\n+/g,`$&${d}`),`|${P}
125
125
  ${d}${E}${r}${b}`}function SJ(t,e,r,n){let{type:i,value:s}=t,{actualString:o,implicitKey:l,indent:c,indentStep:d,inFlow:p}=e;if(l&&s.includes(`
126
126
  `)||p&&/[[\]{},]/.test(s))return Pu(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||p||!s.includes(`
127
127
  `)?Pu(s,e):Gm(t,e,r,n);if(!l&&!p&&i!==mi.Scalar.PLAIN&&s.includes(`
128
128
  `))return Gm(t,e,r,n);if(Km(s)){if(c==="")return e.forceBlockIndent=!0,Gm(t,e,r,n);if(l&&c===d)return Pu(s,e)}let m=s.replace(/\n+/g,`$&
129
129
  ${c}`);if(o){let y=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(m),{compat:b,tags:q}=e.doc.schema;if(q.some(y)||b?.some(y))return Pu(s,e)}return l?m:Ro.foldFlowLines(m,c,Ro.FOLD_FLOW,Ym(e,!1))}function wJ(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!==mi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=mi.Scalar.QUOTE_DOUBLE);let c=p=>{switch(p){case mi.Scalar.BLOCK_FOLDED:case mi.Scalar.BLOCK_LITERAL:return i||s?Pu(o.value,e):Gm(o,e,r,n);case mi.Scalar.QUOTE_DOUBLE:return gd(o.value,e);case mi.Scalar.QUOTE_SINGLE:return B0(o.value,e);case mi.Scalar.PLAIN:return SJ(o,e,r,n);default:return null}},d=c(l);if(d===null){let{defaultKeyType:p,defaultStringType:m}=e.options,y=i&&p||m;if(d=c(y),d===null)throw new Error(`Unsupported default string type ${y}`)}return d}HP.stringifyString=wJ});var vd=V(W0=>{"use strict";var _J=Um(),xo=it(),RJ=hd(),xJ=yd();function CJ(t,e){let r=Object.assign({blockQuote:!0,commentString:RJ.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 EJ(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(xo.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 qJ(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(xo.isScalar(t)||xo.isCollection(t))&&t.anchor;s&&_J.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 IJ(t,e,r,n){if(xo.isPair(t))return t.toString(e,r,n);if(xo.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=xo.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=EJ(e.doc.schema.tags,s));let o=qJ(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):xo.isScalar(s)?xJ.stringifyString(s,e,r,n):s.toString(e,r,n);return o?xo.isScalar(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
130
130
  ${e.indent}${l}`:l}W0.createStringifyContext=CJ;W0.stringify=IJ});var zP=V(WP=>{"use strict";var Es=it(),BP=rr(),VP=vd(),bd=hd();function OJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:d,indentSeq:p,simpleKeys:m}}=r,y=Es.isNode(t)&&t.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(Es.isCollection(t)||!Es.isNode(t)&&typeof t=="object"){let I="With simple keys, collection cannot be used as a key value";throw new Error(I)}}let b=!m&&(!t||y&&e==null&&!r.inFlow||Es.isCollection(t)||(Es.isScalar(t)?t.type===BP.Scalar.BLOCK_FOLDED||t.type===BP.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!b&&(m||!s),indent:l+c});let q=!1,x=!1,v=VP.stringify(t,r,()=>q=!0,()=>x=!0);if(!b&&!r.inFlow&&v.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(r.inFlow){if(s||e==null)return q&&n&&n(),v===""?"?":b?`? ${v}`:v}else if(s&&!m||e==null&&b)return v=`? ${v}`,y&&!q?v+=bd.lineComment(v,r.indent,d(y)):x&&i&&i(),v;q&&(y=null),b?(y&&(v+=bd.lineComment(v,r.indent,d(y))),v=`? ${v}
131
- ${l}:`):(v=`${v}:`,y&&(v+=bd.lineComment(v,r.indent,d(y))));let _,E,k;Es.isNode(e)?(_=!!e.spaceBefore,E=e.commentBefore,k=e.comment):(_=!1,E=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!b&&!y&&Es.isScalar(e)&&(r.indentAtStart=v.length+1),x=!1,!p&&c.length>=2&&!r.inFlow&&!b&&Es.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let P=!1,M=VP.stringify(e,r,()=>P=!0,()=>x=!0),j=" ";if(y||_||E){if(j=_?`
131
+ ${l}:`):(v=`${v}:`,y&&(v+=bd.lineComment(v,r.indent,d(y))));let R,E,k;Es.isNode(e)?(R=!!e.spaceBefore,E=e.commentBefore,k=e.comment):(R=!1,E=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!b&&!y&&Es.isScalar(e)&&(r.indentAtStart=v.length+1),x=!1,!p&&c.length>=2&&!r.inFlow&&!b&&Es.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let P=!1,M=VP.stringify(e,r,()=>P=!0,()=>x=!0),j=" ";if(y||R||E){if(j=R?`
132
132
  `:"",E){let I=d(E);j+=`
133
133
  ${bd.indentComment(I,r.indent)}`}M===""&&!r.inFlow?j===`
134
134
  `&&k&&(j=`
135
135
 
136
136
  `):j+=`
137
- ${r.indent}`}else if(!b&&Es.isCollection(e)){let I=M[0],R=M.indexOf(`
138
- `),A=R!==-1,F=r.inFlow??e.flow??e.items.length===0;if(A||!F){let U=!1;if(A&&(I==="&"||I==="!")){let D=M.indexOf(" ");I==="&"&&D!==-1&&D<R&&M[D+1]==="!"&&(D=M.indexOf(" ",D+1)),(D===-1||R<D)&&(U=!0)}U||(j=`
137
+ ${r.indent}`}else if(!b&&Es.isCollection(e)){let I=M[0],_=M.indexOf(`
138
+ `),A=_!==-1,F=r.inFlow??e.flow??e.items.length===0;if(A||!F){let U=!1;if(A&&(I==="&"||I==="!")){let D=M.indexOf(" ");I==="&"&&D!==-1&&D<_&&M[D+1]==="!"&&(D=M.indexOf(" ",D+1)),(D===-1||_<D)&&(U=!0)}U||(j=`
139
139
  ${r.indent}`)}}else(M===""||M[0]===`
140
- `)&&(j="");return v+=j+M,r.inFlow?P&&n&&n():k&&!P?v+=bd.lineComment(v,r.indent,d(k)):x&&i&&i(),v}WP.stringifyPair=OJ});var J0=V(z0=>{"use strict";var JP=wt("process");function PJ(t,...e){t==="debug"&&console.log(...e)}function kJ(t,e){(t==="debug"||t==="warn")&&(typeof JP.emitWarning=="function"?JP.emitWarning(e):console.warn(e))}z0.debug=PJ;z0.warn=kJ});var tg=V(eg=>{"use strict";var Xm=it(),GP=rr(),Qm="<<",Zm={identify:t=>t===Qm||typeof t=="symbol"&&t.description===Qm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new GP.Scalar(Symbol(Qm)),{addToJSMap:YP}),stringify:()=>Qm},AJ=(t,e)=>(Zm.identify(e)||Xm.isScalar(e)&&(!e.type||e.type===GP.Scalar.PLAIN)&&Zm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Zm.tag&&r.default);function YP(t,e,r){let n=KP(t,r);if(Xm.isSeq(n))for(let i of n.items)G0(t,e,i);else if(Array.isArray(n))for(let i of n)G0(t,e,i);else G0(t,e,n)}function G0(t,e,r){let n=KP(t,r);if(!Xm.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 KP(t,e){return t&&Xm.isAlias(e)?e.resolve(t.doc,t):e}eg.addMergeToJSMap=YP;eg.isMergeKey=AJ;eg.merge=Zm});var K0=V(XP=>{"use strict";var TJ=J0(),QP=tg(),$J=vd(),ZP=it(),Y0=wo();function NJ(t,e,{key:r,value:n}){if(ZP.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(QP.isMergeKey(t,r))QP.addMergeToJSMap(t,e,n);else{let i=Y0.toJS(r,"",t);if(e instanceof Map)e.set(i,Y0.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=MJ(r,i,t),o=Y0.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 MJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(ZP.isNode(t)&&r?.doc){let n=$J.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)+'..."'),TJ.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)}XP.addPairToJSMap=NJ});var Co=V(Q0=>{"use strict";var ek=pd(),FJ=zP(),DJ=K0(),rg=it();function jJ(t,e,r){let n=ek.createNode(t,void 0,r),i=ek.createNode(e,void 0,r);return new ng(n,i)}var ng=class t{constructor(e,r=null){Object.defineProperty(this,rg.NODE_TYPE,{value:rg.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return rg.isNode(r)&&(r=r.clone(e)),rg.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return DJ.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?FJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};Q0.Pair=ng;Q0.createPair=jJ});var Z0=V(rk=>{"use strict";var Ba=it(),tk=vd(),ig=hd();function LJ(t,e,r){return(e.inFlow??t.flow?HJ:UJ)(t,e,r)}function UJ({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:c,options:{commentString:d}}=r,p=Object.assign({},r,{indent:s,type:null}),m=!1,y=[];for(let q=0;q<e.length;++q){let x=e[q],v=null;if(Ba.isNode(x))!m&&x.spaceBefore&&y.push(""),sg(r,y,x.commentBefore,m),x.comment&&(v=x.comment);else if(Ba.isPair(x)){let E=Ba.isNode(x.key)?x.key:null;E&&(!m&&E.spaceBefore&&y.push(""),sg(r,y,E.commentBefore,m))}m=!1;let _=tk.stringify(x,p,()=>v=null,()=>m=!0);v&&(_+=ig.lineComment(_,s,d(v))),m&&v&&(m=!1),y.push(n+_)}let b;if(y.length===0)b=i.start+i.end;else{b=y[0];for(let q=1;q<y.length;++q){let x=y[q];b+=x?`
140
+ `)&&(j="");return v+=j+M,r.inFlow?P&&n&&n():k&&!P?v+=bd.lineComment(v,r.indent,d(k)):x&&i&&i(),v}WP.stringifyPair=OJ});var J0=V(z0=>{"use strict";var JP=wt("process");function PJ(t,...e){t==="debug"&&console.log(...e)}function kJ(t,e){(t==="debug"||t==="warn")&&(typeof JP.emitWarning=="function"?JP.emitWarning(e):console.warn(e))}z0.debug=PJ;z0.warn=kJ});var tg=V(eg=>{"use strict";var Xm=it(),GP=rr(),Qm="<<",Zm={identify:t=>t===Qm||typeof t=="symbol"&&t.description===Qm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new GP.Scalar(Symbol(Qm)),{addToJSMap:YP}),stringify:()=>Qm},AJ=(t,e)=>(Zm.identify(e)||Xm.isScalar(e)&&(!e.type||e.type===GP.Scalar.PLAIN)&&Zm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Zm.tag&&r.default);function YP(t,e,r){let n=KP(t,r);if(Xm.isSeq(n))for(let i of n.items)G0(t,e,i);else if(Array.isArray(n))for(let i of n)G0(t,e,i);else G0(t,e,n)}function G0(t,e,r){let n=KP(t,r);if(!Xm.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 KP(t,e){return t&&Xm.isAlias(e)?e.resolve(t.doc,t):e}eg.addMergeToJSMap=YP;eg.isMergeKey=AJ;eg.merge=Zm});var K0=V(XP=>{"use strict";var TJ=J0(),QP=tg(),$J=vd(),ZP=it(),Y0=wo();function NJ(t,e,{key:r,value:n}){if(ZP.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(QP.isMergeKey(t,r))QP.addMergeToJSMap(t,e,n);else{let i=Y0.toJS(r,"",t);if(e instanceof Map)e.set(i,Y0.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=MJ(r,i,t),o=Y0.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 MJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(ZP.isNode(t)&&r?.doc){let n=$J.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)+'..."'),TJ.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)}XP.addPairToJSMap=NJ});var Co=V(Q0=>{"use strict";var ek=pd(),FJ=zP(),DJ=K0(),rg=it();function jJ(t,e,r){let n=ek.createNode(t,void 0,r),i=ek.createNode(e,void 0,r);return new ng(n,i)}var ng=class t{constructor(e,r=null){Object.defineProperty(this,rg.NODE_TYPE,{value:rg.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return rg.isNode(r)&&(r=r.clone(e)),rg.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return DJ.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?FJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};Q0.Pair=ng;Q0.createPair=jJ});var Z0=V(rk=>{"use strict";var Ba=it(),tk=vd(),ig=hd();function LJ(t,e,r){return(e.inFlow??t.flow?HJ:UJ)(t,e,r)}function UJ({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:c,options:{commentString:d}}=r,p=Object.assign({},r,{indent:s,type:null}),m=!1,y=[];for(let q=0;q<e.length;++q){let x=e[q],v=null;if(Ba.isNode(x))!m&&x.spaceBefore&&y.push(""),sg(r,y,x.commentBefore,m),x.comment&&(v=x.comment);else if(Ba.isPair(x)){let E=Ba.isNode(x.key)?x.key:null;E&&(!m&&E.spaceBefore&&y.push(""),sg(r,y,E.commentBefore,m))}m=!1;let R=tk.stringify(x,p,()=>v=null,()=>m=!0);v&&(R+=ig.lineComment(R,s,d(v))),m&&v&&(m=!1),y.push(n+R)}let b;if(y.length===0)b=i.start+i.end;else{b=y[0];for(let q=1;q<y.length;++q){let x=y[q];b+=x?`
141
141
  ${c}${x}`:`
142
142
  `}}return t?(b+=`
143
- `+ig.indentComment(d(t),c),l&&l()):m&&o&&o(),b}function HJ({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;n+=s;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,p=0,m=[];for(let q=0;q<t.length;++q){let x=t[q],v=null;if(Ba.isNode(x))x.spaceBefore&&m.push(""),sg(e,m,x.commentBefore,!1),x.comment&&(v=x.comment);else if(Ba.isPair(x)){let E=Ba.isNode(x.key)?x.key:null;E&&(E.spaceBefore&&m.push(""),sg(e,m,E.commentBefore,!1),E.comment&&(d=!0));let k=Ba.isNode(x.value)?x.value:null;k?(k.comment&&(v=k.comment),k.commentBefore&&(d=!0)):x.value==null&&E?.comment&&(v=E.comment)}v&&(d=!0);let _=tk.stringify(x,c,()=>v=null);d||(d=m.length>p||_.includes(`
144
- `)),q<t.length-1?_+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=m.reduce((E,k)=>E+k.length+2,2)+(_.length+2)>e.options.lineWidth)),d&&(_+=",")),v&&(_+=ig.lineComment(_,n,l(v))),m.push(_),p=m.length}let{start:y,end:b}=r;if(m.length===0)return y+b;if(!d){let q=m.reduce((x,v)=>x+v.length+2,2);d=e.options.lineWidth>0&&q>e.options.lineWidth}if(d){let q=y;for(let x of m)q+=x?`
143
+ `+ig.indentComment(d(t),c),l&&l()):m&&o&&o(),b}function HJ({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;n+=s;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,p=0,m=[];for(let q=0;q<t.length;++q){let x=t[q],v=null;if(Ba.isNode(x))x.spaceBefore&&m.push(""),sg(e,m,x.commentBefore,!1),x.comment&&(v=x.comment);else if(Ba.isPair(x)){let E=Ba.isNode(x.key)?x.key:null;E&&(E.spaceBefore&&m.push(""),sg(e,m,E.commentBefore,!1),E.comment&&(d=!0));let k=Ba.isNode(x.value)?x.value:null;k?(k.comment&&(v=k.comment),k.commentBefore&&(d=!0)):x.value==null&&E?.comment&&(v=E.comment)}v&&(d=!0);let R=tk.stringify(x,c,()=>v=null);d||(d=m.length>p||R.includes(`
144
+ `)),q<t.length-1?R+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=m.reduce((E,k)=>E+k.length+2,2)+(R.length+2)>e.options.lineWidth)),d&&(R+=",")),v&&(R+=ig.lineComment(R,n,l(v))),m.push(R),p=m.length}let{start:y,end:b}=r;if(m.length===0)return y+b;if(!d){let q=m.reduce((x,v)=>x+v.length+2,2);d=e.options.lineWidth>0&&q>e.options.lineWidth}if(d){let q=y;for(let x of m)q+=x?`
145
145
  ${s}${i}${x}`:`
146
146
  `;return`${q}
147
147
  ${i}${b}`}else return`${y}${o}${m.join(" ")}${o}${b}`}function sg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=ig.indentComment(e(n),t);r.push(s.trimStart())}}rk.stringifyCollection=LJ});var qo=V(e_=>{"use strict";var BJ=Z0(),VJ=K0(),WJ=Wm(),Eo=it(),og=Co(),zJ=rr();function Sd(t,e){let r=Eo.isScalar(e)?e.value:e;for(let n of t)if(Eo.isPair(n)&&(n.key===e||n.key===r||Eo.isScalar(n.key)&&n.key.value===r))return n}var X0=class extends WJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Eo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),l=(c,d)=>{if(typeof s=="function")d=s.call(r,c,d);else if(Array.isArray(s)&&!s.includes(c))return;(d!==void 0||i)&&o.items.push(og.createPair(c,d,n))};if(r instanceof Map)for(let[c,d]of r)l(c,d);else if(r&&typeof r=="object")for(let c of Object.keys(r))l(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;Eo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new og.Pair(e,e?.value):n=new og.Pair(e.key,e.value);let i=Sd(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Eo.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=Sd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Sd(this.items,e)?.value;return(!r&&Eo.isScalar(i)?i.value:i)??void 0}has(e){return!!Sd(this.items,e)}set(e,r){this.add(new og.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)VJ.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Eo.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})),BJ.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};e_.YAMLMap=X0;e_.findPair=Sd});var ku=V(ik=>{"use strict";var JJ=it(),nk=qo(),GJ={collection:"map",default:!0,nodeClass:nk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return JJ.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>nk.YAMLMap.from(t,e,r)};ik.map=GJ});var Io=V(sk=>{"use strict";var YJ=pd(),KJ=Z0(),QJ=Wm(),lg=it(),ZJ=rr(),XJ=wo(),t_=class extends QJ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(lg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=ag(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=ag(e);if(typeof n!="number")return;let i=this.items[n];return!r&&lg.isScalar(i)?i.value:i}has(e){let r=ag(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=ag(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];lg.isScalar(i)&&ZJ.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(XJ.toJS(s,String(i++),r));return n}toString(e,r,n){return e?KJ.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 c=r instanceof Set?l:String(o++);l=i.call(r,c,l)}s.items.push(YJ.createNode(l,void 0,n))}}return s}};function ag(t){let e=lg.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}sk.YAMLSeq=t_});var Au=V(ak=>{"use strict";var eG=it(),ok=Io(),tG={collection:"seq",default:!0,nodeClass:ok.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return eG.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>ok.YAMLSeq.from(t,e,r)};ak.seq=tG});var wd=V(lk=>{"use strict";var rG=yd(),nG={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),rG.stringifyString(t,e,r,n)}};lk.string=nG});var ug=V(fk=>{"use strict";var uk=rr(),ck={identify:t=>t==null,createNode:()=>new uk.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new uk.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&ck.test.test(t)?t:e.options.nullStr};fk.nullTag=ck});var r_=V(pk=>{"use strict";var iG=rr(),dk={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new iG.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&dk.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};pk.boolTag=dk});var Tu=V(hk=>{"use strict";function sG({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}hk.stringifyNumber=sG});var i_=V(cg=>{"use strict";var oG=rr(),n_=Tu(),aG={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:n_.stringifyNumber},lG={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():n_.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 oG.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:n_.stringifyNumber};cg.float=uG;cg.floatExp=lG;cg.floatNaN=aG});var o_=V(dg=>{"use strict";var mk=Tu(),fg=t=>typeof t=="bigint"||Number.isInteger(t),s_=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function gk(t,e,r){let{value:n}=t;return fg(n)&&n>=0?r+n.toString(e):mk.stringifyNumber(t)}var cG={identify:t=>fg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>s_(t,2,8,r),stringify:t=>gk(t,8,"0o")},fG={identify:fg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>s_(t,0,10,r),stringify:mk.stringifyNumber},dG={identify:t=>fg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>s_(t,2,16,r),stringify:t=>gk(t,16,"0x")};dg.int=fG;dg.intHex=dG;dg.intOct=cG});var vk=V(yk=>{"use strict";var pG=ku(),hG=ug(),mG=Au(),gG=wd(),yG=r_(),a_=i_(),l_=o_(),vG=[pG.map,mG.seq,gG.string,hG.nullTag,yG.boolTag,l_.intOct,l_.int,l_.intHex,a_.floatNaN,a_.floatExp,a_.float];yk.schema=vG});var wk=V(Sk=>{"use strict";var bG=rr(),SG=ku(),wG=Au();function bk(t){return typeof t=="bigint"||Number.isInteger(t)}var pg=({value:t})=>JSON.stringify(t),_G=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:pg},{identify:t=>t==null,createNode:()=>new bG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:pg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:pg},{identify:bk,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})=>bk(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:pg}],RG={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},xG=[SG.map,wG.seq].concat(_G,RG);Sk.schema=xG});var c_=V(_k=>{"use strict";var _d=wt("buffer"),u_=rr(),CG=yd(),EG={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof _d.Buffer=="function")return _d.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 _d.Buffer=="function")l=o instanceof _d.Buffer?o.toString("base64"):_d.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let d=0;d<o.length;++d)c+=String.fromCharCode(o[d]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=u_.Scalar.BLOCK_LITERAL),e!==u_.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),d=Math.ceil(l.length/c),p=new Array(d);for(let m=0,y=0;m<d;++m,y+=c)p[m]=l.substr(y,c);l=p.join(e===u_.Scalar.BLOCK_LITERAL?`
@@ -150,30 +150,30 @@ ${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comme
150
150
  ${s.comment}`:n.comment}n=i}t.items[r]=hg.isPair(n)?n:new f_.Pair(n)}}else e("Expected a sequence for this tag");return t}function xk(t,e,r){let{replacer:n}=r,i=new IG.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,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let d=Object.keys(o);if(d.length===1)l=d[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=o;i.items.push(f_.createPair(l,c,r))}return i}var OG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Rk,createNode:xk};mg.createPairs=xk;mg.pairs=OG;mg.resolvePairs=Rk});var h_=V(p_=>{"use strict";var Ck=it(),d_=wo(),Rd=qo(),PG=Io(),Ek=gg(),Va=class t extends PG.YAMLSeq{constructor(){super(),this.add=Rd.YAMLMap.prototype.add.bind(this),this.delete=Rd.YAMLMap.prototype.delete.bind(this),this.get=Rd.YAMLMap.prototype.get.bind(this),this.has=Rd.YAMLMap.prototype.has.bind(this),this.set=Rd.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(Ck.isPair(i)?(s=d_.toJS(i.key,"",r),o=d_.toJS(i.value,s,r)):s=d_.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=Ek.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Va.tag="tag:yaml.org,2002:omap";var kG={collection:"seq",identify:t=>t instanceof Map,nodeClass:Va,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Ek.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Ck.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)};p_.YAMLOMap=Va;p_.omap=kG});var kk=V(m_=>{"use strict";var qk=rr();function Ik({value:t,source:e},r){return e&&(t?Ok:Pk).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Ok={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 qk.Scalar(!0),stringify:Ik},Pk={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 qk.Scalar(!1),stringify:Ik};m_.falseTag=Pk;m_.trueTag=Ok});var Ak=V(yg=>{"use strict";var AG=rr(),g_=Tu(),TG={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:g_.stringifyNumber},$G={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():g_.stringifyNumber(t)}},NG={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 AG.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:g_.stringifyNumber};yg.float=NG;yg.floatExp=$G;yg.floatNaN=TG});var $k=V(Cd=>{"use strict";var Tk=Tu(),xd=t=>typeof t=="bigint"||Number.isInteger(t);function vg(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 y_(t,e,r){let{value:n}=t;if(xd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Tk.stringifyNumber(t)}var MG={identify:xd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>vg(t,2,2,r),stringify:t=>y_(t,2,"0b")},FG={identify:xd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>vg(t,1,8,r),stringify:t=>y_(t,8,"0")},DG={identify:xd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>vg(t,0,10,r),stringify:Tk.stringifyNumber},jG={identify:xd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>vg(t,2,16,r),stringify:t=>y_(t,16,"0x")};Cd.int=DG;Cd.intBin=MG;Cd.intHex=jG;Cd.intOct=FG});var b_=V(v_=>{"use strict";var wg=it(),bg=Co(),Sg=qo(),Wa=class t extends Sg.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),Sg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Sg.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=Sg.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 LG={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}};v_.YAMLSet=Wa;v_.set=LG});var w_=V(_g=>{"use strict";var UG=Tu();function S_(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 Nk(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return UG.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 HG={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})=>S_(t,r),stringify:Nk},BG={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=>S_(t,!1),stringify:Nk},Mk={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(Mk.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),c=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,i,s||0,o||0,l||0,c),p=e[8];if(p&&p!=="Z"){let m=S_(p,!1);Math.abs(m)<30&&(m*=60),d-=6e4*m}return new Date(d)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};_g.floatTime=BG;_g.intTime=HG;_g.timestamp=Mk});var jk=V(Dk=>{"use strict";var VG=ku(),WG=ug(),zG=Au(),JG=wd(),GG=c_(),Fk=kk(),__=Ak(),Rg=$k(),YG=tg(),KG=h_(),QG=gg(),ZG=b_(),R_=w_(),XG=[VG.map,zG.seq,JG.string,WG.nullTag,Fk.trueTag,Fk.falseTag,Rg.intBin,Rg.intOct,Rg.int,Rg.intHex,__.floatNaN,__.floatExp,__.float,GG.binary,YG.merge,KG.omap,QG.pairs,ZG.set,R_.intTime,R_.floatTime,R_.timestamp];Dk.schema=XG});var Yk=V(E_=>{"use strict";var Bk=ku(),eY=ug(),Vk=Au(),tY=wd(),rY=r_(),x_=i_(),C_=o_(),nY=vk(),iY=wk(),Wk=c_(),Ed=tg(),zk=h_(),Jk=gg(),Lk=jk(),Gk=b_(),xg=w_(),Uk=new Map([["core",nY.schema],["failsafe",[Bk.map,Vk.seq,tY.string]],["json",iY.schema],["yaml11",Lk.schema],["yaml-1.1",Lk.schema]]),Hk={binary:Wk.binary,bool:rY.boolTag,float:x_.float,floatExp:x_.floatExp,floatNaN:x_.floatNaN,floatTime:xg.floatTime,int:C_.int,intHex:C_.intHex,intOct:C_.intOct,intTime:xg.intTime,map:Bk.map,merge:Ed.merge,null:eY.nullTag,omap:zk.omap,pairs:Jk.pairs,seq:Vk.seq,set:Gk.set,timestamp:xg.timestamp},sY={"tag:yaml.org,2002:binary":Wk.binary,"tag:yaml.org,2002:merge":Ed.merge,"tag:yaml.org,2002:omap":zk.omap,"tag:yaml.org,2002:pairs":Jk.pairs,"tag:yaml.org,2002:set":Gk.set,"tag:yaml.org,2002:timestamp":xg.timestamp};function oY(t,e,r){let n=Uk.get(e);if(n&&!t)return r&&!n.includes(Ed.merge)?n.concat(Ed.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(Uk.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(Ed.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?Hk[o]:o;if(!l){let c=JSON.stringify(o),d=Object.keys(Hk).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}E_.coreKnownTags=sY;E_.getTags=oY});var O_=V(Kk=>{"use strict";var q_=it(),aY=ku(),lY=Au(),uY=wd(),Cg=Yk(),cY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,I_=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Cg.getTags(e,"compat"):e?Cg.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Cg.coreKnownTags:{},this.tags=Cg.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,q_.MAP,{value:aY.map}),Object.defineProperty(this,q_.SCALAR,{value:uY.string}),Object.defineProperty(this,q_.SEQ,{value:lY.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?cY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Kk.Schema=I_});var Zk=V(Qk=>{"use strict";var fY=it(),P_=vd(),qd=hd();function dY(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=P_.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=s(t.commentBefore);r.unshift(qd.indentComment(c,""))}let o=!1,l=null;if(t.contents){if(fY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(qd.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let c=l?void 0:()=>o=!0,d=P_.stringify(t.contents,i,()=>l=null,c);l&&(d+=qd.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(P_.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
151
151
  `)?(r.push("..."),r.push(qd.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&r[r.length-1]!==""&&r.push(""),r.push(qd.indentComment(s(c),"")))}return r.join(`
152
152
  `)+`
153
- `}Qk.stringifyDocument=dY});var Id=V(Xk=>{"use strict";var pY=dd(),$u=Wm(),Wn=it(),hY=Co(),mY=wo(),gY=O_(),yY=Zk(),k_=Um(),vY=N0(),bY=pd(),A_=$0(),T_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wn.NODE_TYPE,{value:Wn.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 A_.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,{[Wn.NODE_TYPE]:{value:Wn.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=Wn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Nu(this.contents)&&this.contents.add(e)}addIn(e,r){Nu(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=k_.anchorNames(this);e.anchor=!r||n.has(r)?k_.findNewAnchor(r||"a",n):r}return new pY.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 v=E=>typeof E=="number"||E instanceof String||E instanceof Number,_=r.filter(v).map(String);_.length>0&&(r=r.concat(_)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:d,tag:p}=n??{},{onAnchor:m,setAnchors:y,sourceObjects:b}=k_.createNodeAnchors(this,o||"a"),q={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:m,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:b},x=bY.createNode(e,p,q);return l&&Wn.isCollection(x)&&(x.flow=!0),y(),x}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new hY.Pair(i,s)}delete(e){return Nu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return $u.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Nu(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Wn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return $u.isEmptyPath(e)?!r&&Wn.isScalar(this.contents)?this.contents.value:this.contents:Wn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Wn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return $u.isEmptyPath(e)?this.contents!==void 0:Wn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=$u.collectionFromPath(this.schema,[e],r):Nu(this.contents)&&this.contents.set(e,r)}setIn(e,r){$u.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=$u.collectionFromPath(this.schema,Array.from(e),r):Nu(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 A_.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 A_.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 gY.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},c=mY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:p}of l.anchors.values())s(p,d);return typeof o=="function"?vY.applyReviver(o,{"":c},"",c):c}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 yY.stringifyDocument(this,e)}};function Nu(t){if(Wn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Xk.Document=T_});var kd=V(Pd=>{"use strict";var Od=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},$_=class extends Od{constructor(e,r,n){super("YAMLParseError",e,r,n)}},N_=class extends Od{constructor(e,r,n){super("YAMLWarning",e,r,n)}},SY=(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
+ `}Qk.stringifyDocument=dY});var Id=V(Xk=>{"use strict";var pY=dd(),$u=Wm(),Wn=it(),hY=Co(),mY=wo(),gY=O_(),yY=Zk(),k_=Um(),vY=N0(),bY=pd(),A_=$0(),T_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wn.NODE_TYPE,{value:Wn.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 A_.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,{[Wn.NODE_TYPE]:{value:Wn.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=Wn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Nu(this.contents)&&this.contents.add(e)}addIn(e,r){Nu(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=k_.anchorNames(this);e.anchor=!r||n.has(r)?k_.findNewAnchor(r||"a",n):r}return new pY.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 v=E=>typeof E=="number"||E instanceof String||E instanceof Number,R=r.filter(v).map(String);R.length>0&&(r=r.concat(R)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:d,tag:p}=n??{},{onAnchor:m,setAnchors:y,sourceObjects:b}=k_.createNodeAnchors(this,o||"a"),q={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:m,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:b},x=bY.createNode(e,p,q);return l&&Wn.isCollection(x)&&(x.flow=!0),y(),x}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new hY.Pair(i,s)}delete(e){return Nu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return $u.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Nu(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Wn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return $u.isEmptyPath(e)?!r&&Wn.isScalar(this.contents)?this.contents.value:this.contents:Wn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Wn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return $u.isEmptyPath(e)?this.contents!==void 0:Wn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=$u.collectionFromPath(this.schema,[e],r):Nu(this.contents)&&this.contents.set(e,r)}setIn(e,r){$u.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=$u.collectionFromPath(this.schema,Array.from(e),r):Nu(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 A_.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 A_.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 gY.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},c=mY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:p}of l.anchors.values())s(p,d);return typeof o=="function"?vY.applyReviver(o,{"":c},"",c):c}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 yY.stringifyDocument(this,e)}};function Nu(t){if(Wn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Xk.Document=T_});var kd=V(Pd=>{"use strict";var Od=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},$_=class extends Od{constructor(e,r,n){super("YAMLParseError",e,r,n)}},N_=class extends Od{constructor(e,r,n){super("YAMLWarning",e,r,n)}},SY=(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
154
154
  `),o=l+o}if(/[^ ]/.test(o)){let l=1,c=r.linePos[1];c?.line===n&&c.col>i&&(l=Math.max(1,Math.min(c.col-i,80-s)));let d=" ".repeat(s)+"^".repeat(l);r.message+=`:
155
155
 
156
156
  ${o}
157
157
  ${d}
158
- `}};Pd.YAMLError=Od;Pd.YAMLParseError=$_;Pd.YAMLWarning=N_;Pd.prettifyError=SY});var Ad=V(eA=>{"use strict";function wY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,d=l,p=l,m="",y="",b=!1,q=!1,x=null,v=null,_=null,E=null,k=null,P=null,M=null;for(let R of t)switch(q&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&s(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),q=!1),x&&(d&&R.type!=="comment"&&R.type!=="newline"&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),R.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&R.source.includes(" ")&&(x=R),p=!0;break;case"comment":{p||s(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=R.source.substring(1)||" ";m?m+=y+A:m=A,y="",d=!1;break}case"newline":d?m?m+=R.source:(!P||r!=="seq-item-ind")&&(c=!0):y+=R.source,d=!0,b=!0,(v||_)&&(E=R),p=!0;break;case"anchor":v&&s(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&s(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=R,M??(M=R.offset),d=!1,p=!1,q=!0;break;case"tag":{_&&s(R,"MULTIPLE_TAGS","A node can have at most one tag"),_=R,M??(M=R.offset),d=!1,p=!1,q=!0;break}case r:(v||_)&&s(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),P&&s(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${e??"collection"}`),P=R,d=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){k&&s(R,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=R,d=!1,p=!1;break}default:s(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),d=!1,p=!1}let j=t[t.length-1],I=j?j.offset+j.source.length:i;return q&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(d&&x.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:P,spaceBefore:c,comment:m,hasNewline:b,anchor:v,tag:_,newlineAfterProp:E,end:I,start:M??I}}eA.resolveProps=wY});var Eg=V(tA=>{"use strict";function M_(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
158
+ `}};Pd.YAMLError=Od;Pd.YAMLParseError=$_;Pd.YAMLWarning=N_;Pd.prettifyError=SY});var Ad=V(eA=>{"use strict";function wY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,d=l,p=l,m="",y="",b=!1,q=!1,x=null,v=null,R=null,E=null,k=null,P=null,M=null;for(let _ of t)switch(q&&(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma"&&s(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),q=!1),x&&(d&&_.type!=="comment"&&_.type!=="newline"&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),_.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&_.source.includes(" ")&&(x=_),p=!0;break;case"comment":{p||s(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=_.source.substring(1)||" ";m?m+=y+A:m=A,y="",d=!1;break}case"newline":d?m?m+=_.source:(!P||r!=="seq-item-ind")&&(c=!0):y+=_.source,d=!0,b=!0,(v||R)&&(E=_),p=!0;break;case"anchor":v&&s(_,"MULTIPLE_ANCHORS","A node can have at most one anchor"),_.source.endsWith(":")&&s(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=_,M??(M=_.offset),d=!1,p=!1,q=!0;break;case"tag":{R&&s(_,"MULTIPLE_TAGS","A node can have at most one tag"),R=_,M??(M=_.offset),d=!1,p=!1,q=!0;break}case r:(v||R)&&s(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`),P&&s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${e??"collection"}`),P=_,d=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){k&&s(_,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=_,d=!1,p=!1;break}default:s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),d=!1,p=!1}let j=t[t.length-1],I=j?j.offset+j.source.length:i;return q&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(d&&x.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:P,spaceBefore:c,comment:m,hasNewline:b,anchor:v,tag:R,newlineAfterProp:E,end:I,start:M??I}}eA.resolveProps=wY});var Eg=V(tA=>{"use strict";function M_(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
159
159
  `))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(M_(e.key)||M_(e.value))return!0}return!1;default:return!0}}tA.containsNewline=M_});var F_=V(rA=>{"use strict";var _Y=Eg();function RY(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&_Y.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}rA.flowIndentCheck=RY});var D_=V(iA=>{"use strict";var nA=it();function xY(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||nA.isScalar(s)&&nA.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}iA.mapIncludes=xY});var cA=V(uA=>{"use strict";var sA=Co(),CY=qo(),oA=Ad(),EY=Eg(),aA=F_(),qY=D_(),lA="All mapping items must start at the same column";function IY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??CY.YAMLMap,l=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,d=null;for(let p of n.items){let{start:m,key:y,sep:b,value:q}=p,x=oA.resolveProps(m,{indicator:"explicit-key-ind",next:y??b?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),v=!x.found;if(v){if(y&&(y.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(c,"BAD_INDENT",lA)),!x.anchor&&!x.tag&&!b){d=x.end,x.comment&&(l.comment?l.comment+=`
160
- `+x.comment:l.comment=x.comment);continue}(x.newlineAfterProp||EY.containsNewline(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==n.indent&&i(c,"BAD_INDENT",lA);r.atKey=!0;let _=x.end,E=y?t(r,y,x,i):e(r,_,m,null,x,i);r.schema.compat&&aA.flowIndentCheck(n.indent,y,i),r.atKey=!1,qY.mapIncludes(r,l.items,E)&&i(_,"DUPLICATE_KEY","Map keys must be unique");let k=oA.resolveProps(b??[],{indicator:"map-value-ind",next:q,offset:E.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(c=k.end,k.found){v&&(q?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&x.start<k.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let P=q?t(r,q,k,i):e(r,c,b,null,k,i);r.schema.compat&&aA.flowIndentCheck(n.indent,q,i),c=P.range[2];let M=new sA.Pair(E,P);r.options.keepSourceTokens&&(M.srcToken=p),l.items.push(M)}else{v&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(E.comment?E.comment+=`
161
- `+k.comment:E.comment=k.comment);let P=new sA.Pair(E);r.options.keepSourceTokens&&(P.srcToken=p),l.items.push(P)}}return d&&d<c&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,c,d??c],l}uA.resolveBlockMap=IY});var dA=V(fA=>{"use strict";var OY=Io(),PY=Ad(),kY=F_();function AY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??OY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,d=null;for(let{start:p,value:m}of n.items){let y=PY.resolveProps(p,{indicator:"seq-item-ind",next:m,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let b=m?t(r,m,y,i):e(r,y.end,p,null,y,i);r.schema.compat&&kY.flowIndentCheck(n.indent,m,i),c=b.range[2],l.items.push(b)}return l.range=[n.offset,c,d??c],l}fA.resolveBlockSeq=AY});var Mu=V(pA=>{"use strict";function TY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:c,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=c.length}}return{comment:i,offset:e}}pA.resolveEnd=TY});var yA=V(gA=>{"use strict";var $Y=it(),NY=Co(),hA=qo(),MY=Io(),FY=Mu(),mA=Ad(),DY=Eg(),jY=D_(),j_="Block collections are not allowed within flow collections",L_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function LY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",c=s?.nodeClass??(o?hA.YAMLMap:MY.YAMLSeq),d=new c(r.schema);d.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let m=n.offset+n.start.source.length;for(let v=0;v<n.items.length;++v){let _=n.items[v],{start:E,key:k,sep:P,value:M}=_,j=mA.resolveProps(E,{flow:l,indicator:"explicit-key-ind",next:k??P?.[0],offset:m,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!P&&!M){v===0&&j.comma?i(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):v<n.items.length-1&&i(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),j.comment&&(d.comment?d.comment+=`
162
- `+j.comment:d.comment=j.comment),m=j.end;continue}!o&&r.options.strict&&DY.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)j.comma&&i(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(j.comma||i(j.start,"MISSING_CHAR",`Missing , between ${l} items`),j.comment){let I="";e:for(let R of E)switch(R.type){case"comma":case"space":break;case"comment":I=R.source.substring(1);break e;default:break e}if(I){let R=d.items[d.items.length-1];$Y.isPair(R)&&(R=R.value??R.key),R.comment?R.comment+=`
163
- `+I:R.comment=I,j.comment=j.comment.substring(I.length+1)}}if(!o&&!P&&!j.found){let I=M?t(r,M,j,i):e(r,j.end,P,null,j,i);d.items.push(I),m=I.range[2],L_(M)&&i(I.range,"BLOCK_IN_FLOW",j_)}else{r.atKey=!0;let I=j.end,R=k?t(r,k,j,i):e(r,I,E,null,j,i);L_(k)&&i(R.range,"BLOCK_IN_FLOW",j_),r.atKey=!1;let A=mA.resolveProps(P??[],{flow:l,indicator:"map-value-ind",next:M,offset:R.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!j.found&&r.options.strict){if(P)for(let D of P){if(D===A.found)break;if(D.type==="newline"){i(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}j.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 M&&("source"in M&&M.source?.[0]===":"?i(M,"MISSING_CHAR",`Missing space after : in ${l}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let F=M?t(r,M,A,i):A.found?e(r,A.end,P,null,A,i):null;F?L_(M)&&i(F.range,"BLOCK_IN_FLOW",j_):A.comment&&(R.comment?R.comment+=`
164
- `+A.comment:R.comment=A.comment);let U=new NY.Pair(R,F);if(r.options.keepSourceTokens&&(U.srcToken=_),o){let D=d;jY.mapIncludes(r,D.items,R)&&i(I,"DUPLICATE_KEY","Map keys must be unique"),D.items.push(U)}else{let D=new hA.YAMLMap(r.schema);D.flow=!0,D.items.push(U);let J=(F??R).range;D.range=[R.range[0],J[1],J[2]],d.items.push(D)}m=F?F.range[2]:A.end}}let y=o?"}":"]",[b,...q]=n.end,x=m;if(b?.source===y)x=b.offset+b.source.length;else{let v=l[0].toUpperCase()+l.substring(1),_=p?`${v} must end with a ${y}`:`${v} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",_),b&&b.source.length!==1&&q.unshift(b)}if(q.length>0){let v=FY.resolveEnd(q,x,r.options.strict,i);v.comment&&(d.comment?d.comment+=`
160
+ `+x.comment:l.comment=x.comment);continue}(x.newlineAfterProp||EY.containsNewline(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==n.indent&&i(c,"BAD_INDENT",lA);r.atKey=!0;let R=x.end,E=y?t(r,y,x,i):e(r,R,m,null,x,i);r.schema.compat&&aA.flowIndentCheck(n.indent,y,i),r.atKey=!1,qY.mapIncludes(r,l.items,E)&&i(R,"DUPLICATE_KEY","Map keys must be unique");let k=oA.resolveProps(b??[],{indicator:"map-value-ind",next:q,offset:E.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(c=k.end,k.found){v&&(q?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&x.start<k.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let P=q?t(r,q,k,i):e(r,c,b,null,k,i);r.schema.compat&&aA.flowIndentCheck(n.indent,q,i),c=P.range[2];let M=new sA.Pair(E,P);r.options.keepSourceTokens&&(M.srcToken=p),l.items.push(M)}else{v&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(E.comment?E.comment+=`
161
+ `+k.comment:E.comment=k.comment);let P=new sA.Pair(E);r.options.keepSourceTokens&&(P.srcToken=p),l.items.push(P)}}return d&&d<c&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,c,d??c],l}uA.resolveBlockMap=IY});var dA=V(fA=>{"use strict";var OY=Io(),PY=Ad(),kY=F_();function AY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??OY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,d=null;for(let{start:p,value:m}of n.items){let y=PY.resolveProps(p,{indicator:"seq-item-ind",next:m,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let b=m?t(r,m,y,i):e(r,y.end,p,null,y,i);r.schema.compat&&kY.flowIndentCheck(n.indent,m,i),c=b.range[2],l.items.push(b)}return l.range=[n.offset,c,d??c],l}fA.resolveBlockSeq=AY});var Mu=V(pA=>{"use strict";function TY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:c,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=c.length}}return{comment:i,offset:e}}pA.resolveEnd=TY});var yA=V(gA=>{"use strict";var $Y=it(),NY=Co(),hA=qo(),MY=Io(),FY=Mu(),mA=Ad(),DY=Eg(),jY=D_(),j_="Block collections are not allowed within flow collections",L_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function LY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",c=s?.nodeClass??(o?hA.YAMLMap:MY.YAMLSeq),d=new c(r.schema);d.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let m=n.offset+n.start.source.length;for(let v=0;v<n.items.length;++v){let R=n.items[v],{start:E,key:k,sep:P,value:M}=R,j=mA.resolveProps(E,{flow:l,indicator:"explicit-key-ind",next:k??P?.[0],offset:m,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!P&&!M){v===0&&j.comma?i(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):v<n.items.length-1&&i(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),j.comment&&(d.comment?d.comment+=`
162
+ `+j.comment:d.comment=j.comment),m=j.end;continue}!o&&r.options.strict&&DY.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)j.comma&&i(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(j.comma||i(j.start,"MISSING_CHAR",`Missing , between ${l} items`),j.comment){let I="";e:for(let _ of E)switch(_.type){case"comma":case"space":break;case"comment":I=_.source.substring(1);break e;default:break e}if(I){let _=d.items[d.items.length-1];$Y.isPair(_)&&(_=_.value??_.key),_.comment?_.comment+=`
163
+ `+I:_.comment=I,j.comment=j.comment.substring(I.length+1)}}if(!o&&!P&&!j.found){let I=M?t(r,M,j,i):e(r,j.end,P,null,j,i);d.items.push(I),m=I.range[2],L_(M)&&i(I.range,"BLOCK_IN_FLOW",j_)}else{r.atKey=!0;let I=j.end,_=k?t(r,k,j,i):e(r,I,E,null,j,i);L_(k)&&i(_.range,"BLOCK_IN_FLOW",j_),r.atKey=!1;let A=mA.resolveProps(P??[],{flow:l,indicator:"map-value-ind",next:M,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!j.found&&r.options.strict){if(P)for(let D of P){if(D===A.found)break;if(D.type==="newline"){i(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}j.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 M&&("source"in M&&M.source?.[0]===":"?i(M,"MISSING_CHAR",`Missing space after : in ${l}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let F=M?t(r,M,A,i):A.found?e(r,A.end,P,null,A,i):null;F?L_(M)&&i(F.range,"BLOCK_IN_FLOW",j_):A.comment&&(_.comment?_.comment+=`
164
+ `+A.comment:_.comment=A.comment);let U=new NY.Pair(_,F);if(r.options.keepSourceTokens&&(U.srcToken=R),o){let D=d;jY.mapIncludes(r,D.items,_)&&i(I,"DUPLICATE_KEY","Map keys must be unique"),D.items.push(U)}else{let D=new hA.YAMLMap(r.schema);D.flow=!0,D.items.push(U);let J=(F??_).range;D.range=[_.range[0],J[1],J[2]],d.items.push(D)}m=F?F.range[2]:A.end}}let y=o?"}":"]",[b,...q]=n.end,x=m;if(b?.source===y)x=b.offset+b.source.length;else{let v=l[0].toUpperCase()+l.substring(1),R=p?`${v} must end with a ${y}`:`${v} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",R),b&&b.source.length!==1&&q.unshift(b)}if(q.length>0){let v=FY.resolveEnd(q,x,r.options.strict,i);v.comment&&(d.comment?d.comment+=`
165
165
  `+v.comment:d.comment=v.comment),d.range=[n.offset,x,v.offset]}else d.range=[n.offset,x,x];return d}gA.resolveFlowCollection=LY});var bA=V(vA=>{"use strict";var UY=it(),HY=rr(),BY=qo(),VY=Io(),WY=cA(),zY=dA(),JY=yA();function U_(t,e,r,n,i,s){let o=r.type==="block-map"?WY.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?zY.resolveBlockSeq(t,e,r,n,s):JY.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 GY(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(r.type==="block-seq"){let{anchor:y,newlineAfterProp:b}=n,q=y&&s?y.offset>s.offset?y:s:y??s;q&&(!b||b.offset<q.offset)&&i(q,"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===BY.YAMLMap.tagName&&l==="map"||o===VY.YAMLSeq.tagName&&l==="seq")return U_(t,e,r,i,o);let c=e.schema.tags.find(y=>y.tag===o&&y.collection===l);if(!c){let y=e.schema.knownTags[o];if(y?.collection===l)e.schema.tags.push(Object.assign({},y,{default:!1})),c=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),U_(t,e,r,i,o)}let d=U_(t,e,r,i,o,c),p=c.resolve?.(d,y=>i(s,"TAG_RESOLVE_FAILED",y),e.options)??d,m=UY.isNode(p)?p:new HY.Scalar(p);return m.range=d.range,m.tag=o,c?.format&&(m.format=c.format),m}vA.composeCollection=GY});var B_=V(SA=>{"use strict";var H_=rr();function YY(t,e,r){let n=e.offset,i=KY(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?H_.Scalar.BLOCK_FOLDED:H_.Scalar.BLOCK_LITERAL,o=e.source?QY(e.source):[],l=o.length;for(let x=o.length-1;x>=0;--x){let v=o[x][1];if(v===""||v==="\r")l=x;else break}if(l===0){let x=i.chomp==="+"&&o.length>0?`
166
- `.repeat(Math.max(1,o.length-1)):"",v=n+i.length;return e.source&&(v+=e.source.length),{value:x,type:s,comment:i.comment,range:[n,v,v]}}let c=e.indent+i.indent,d=e.offset+i.length,p=0;for(let x=0;x<l;++x){let[v,_]=o[x];if(_===""||_==="\r")i.indent===0&&v.length>c&&(c=v.length);else{v.length<c&&r(d+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=v.length),p=x,c===0&&!t.atRoot&&r(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=v.length+_.length+1}for(let x=o.length-1;x>=l;--x)o[x][0].length>c&&(l=x+1);let m="",y="",b=!1;for(let x=0;x<p;++x)m+=o[x][0].slice(c)+`
167
- `;for(let x=p;x<l;++x){let[v,_]=o[x];d+=v.length+_.length+1;let E=_[_.length-1]==="\r";if(E&&(_=_.slice(0,-1)),_&&v.length<c){let P=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(d-_.length-(E?2:1),"BAD_INDENT",P),v=""}s===H_.Scalar.BLOCK_LITERAL?(m+=y+v.slice(c)+_,y=`
168
- `):v.length>c||_[0]===" "?(y===" "?y=`
166
+ `.repeat(Math.max(1,o.length-1)):"",v=n+i.length;return e.source&&(v+=e.source.length),{value:x,type:s,comment:i.comment,range:[n,v,v]}}let c=e.indent+i.indent,d=e.offset+i.length,p=0;for(let x=0;x<l;++x){let[v,R]=o[x];if(R===""||R==="\r")i.indent===0&&v.length>c&&(c=v.length);else{v.length<c&&r(d+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=v.length),p=x,c===0&&!t.atRoot&&r(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=v.length+R.length+1}for(let x=o.length-1;x>=l;--x)o[x][0].length>c&&(l=x+1);let m="",y="",b=!1;for(let x=0;x<p;++x)m+=o[x][0].slice(c)+`
167
+ `;for(let x=p;x<l;++x){let[v,R]=o[x];d+=v.length+R.length+1;let E=R[R.length-1]==="\r";if(E&&(R=R.slice(0,-1)),R&&v.length<c){let P=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(d-R.length-(E?2:1),"BAD_INDENT",P),v=""}s===H_.Scalar.BLOCK_LITERAL?(m+=y+v.slice(c)+R,y=`
168
+ `):v.length>c||R[0]===" "?(y===" "?y=`
169
169
  `:!b&&y===`
170
170
  `&&(y=`
171
171
 
172
- `),m+=y+v.slice(c)+_,y=`
173
- `,b=!0):_===""?y===`
172
+ `),m+=y+v.slice(c)+R,y=`
173
+ `,b=!0):R===""?y===`
174
174
  `?m+=`
175
175
  `:y=`
176
- `:(m+=y+_,y=" ",b=!1)}switch(i.chomp){case"-":break;case"+":for(let x=l;x<o.length;++x)m+=`
176
+ `:(m+=y+R,y=" ",b=!1)}switch(i.chomp){case"-":break;case"+":for(let x=l;x<o.length;++x)m+=`
177
177
  `+o[x][0].slice(c);m[m.length-1]!==`
178
178
  `&&(m+=`
179
179
  `);break;default:m+=`
@@ -232,7 +232,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
232
232
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
233
233
  `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Tg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let l=0;l<r.sep.length;++l){let c=r.sep[l];switch(c.type){case"newline":o.push(l);break;case"space":break;case"comment":c.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(Oo(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(ZA(r.key)&&!Oo(r.sep,"newline")){let o=Fu(r.start),l=r.key,c=r.sep;c.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:c}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(Oo(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=Fu(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]}):Oo(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&&!Oo(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)){Tg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Oo(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=Ag(n),s=Fu(i);QA(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(`
234
234
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
235
- `,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=Ag(e),n=Fu(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=Ag(e),n=Fu(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())}}};XA.Parser=lR});var iT=V(Fd=>{"use strict";var eT=Y_(),JK=Id(),Md=kd(),GK=J0(),YK=it(),KK=aR(),tT=uR();function rT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new KK.LineCounter||null,prettyErrors:e}}function QK(t,e={}){let{lineCounter:r,prettyErrors:n}=rT(e),i=new tT.Parser(r?.addNewLine),s=new eT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Md.prettifyError(t,r)),l.warnings.forEach(Md.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function nT(t,e={}){let{lineCounter:r,prettyErrors:n}=rT(e),i=new tT.Parser(r?.addNewLine),s=new eT.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 Md.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Md.prettifyError(t,r)),o.warnings.forEach(Md.prettifyError(t,r))),o}function ZK(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=nT(t,r);if(!i)return null;if(i.warnings.forEach(s=>GK.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 XK(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 YK.isDocument(t)&&!n?t.toString(r):new JK.Document(t,n,r).toString(r)}Fd.parse=ZK;Fd.parseAllDocuments=QK;Fd.parseDocument=nT;Fd.stringify=XK});var Dd=V(_t=>{"use strict";var e4=Y_(),t4=Id(),r4=O_(),cR=kd(),n4=dd(),Po=it(),i4=Co(),s4=rr(),o4=qo(),a4=Io(),l4=Pg(),u4=sR(),c4=aR(),f4=uR(),$g=iT(),sT=ld();_t.Composer=e4.Composer;_t.Document=t4.Document;_t.Schema=r4.Schema;_t.YAMLError=cR.YAMLError;_t.YAMLParseError=cR.YAMLParseError;_t.YAMLWarning=cR.YAMLWarning;_t.Alias=n4.Alias;_t.isAlias=Po.isAlias;_t.isCollection=Po.isCollection;_t.isDocument=Po.isDocument;_t.isMap=Po.isMap;_t.isNode=Po.isNode;_t.isPair=Po.isPair;_t.isScalar=Po.isScalar;_t.isSeq=Po.isSeq;_t.Pair=i4.Pair;_t.Scalar=s4.Scalar;_t.YAMLMap=o4.YAMLMap;_t.YAMLSeq=a4.YAMLSeq;_t.CST=l4;_t.Lexer=u4.Lexer;_t.LineCounter=c4.LineCounter;_t.Parser=f4.Parser;_t.parse=$g.parse;_t.parseAllDocuments=$g.parseAllDocuments;_t.parseDocument=$g.parseDocument;_t.stringify=$g.stringify;_t.visit=sT.visit;_t.visitAsync=sT.visitAsync});var d4,p4,h4,m4,g4,y4,v4,ko,Ng=le(()=>{"use strict";d4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,p4=/^\d{4}-\d{2}-\d{2}$/,h4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,m4=/^https?:\/\/[^\s]+$/,g4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,y4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,v4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,ko=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(d4.test(e))return"date-time";if(p4.test(e))return"date";if(h4.test(e))return"email";if(g4.test(e))return"uuid";if(m4.test(e))return"uri";if(y4.test(e))return"ipv4";if(v4.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 m of l)s[m]&&o[m]?i.properties[m]=this.mergeSchemas(s[m],o[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...o[m]};let c=new Set(e.required||Object.keys(s)),d=new Set(r.required||Object.keys(o)),p=[...l].filter(m=>c.has(m)&&d.has(m));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 oT,b4,Du,fR=le(()=>{"use strict";oT=Qc(Dd());Ng();b4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Du=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new ko}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 c=this.mapAuthToSecurityScheme(n.auth);if(c){let{schemeName:d,scheme:p,requirement:m}=c;s.set(d,p),i.security=[m]}}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[c,d]of s)i.components.securitySchemes[c]=d;else delete i.components.securitySchemes;return i.tags=[...o].map(c=>({name:c})),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"?oT.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,c){for(let d of e)if(d.type==="folder"){let p=d,m=o||p.name;i.add(m),p.items&&await this.processItems(p.items,r,n,i,s,m,l,c)}else{let p=d;await this.processRequest(p,r,n,i,s,o,l,c)}}async processRequest(e,r,n,i,s,o,l,c){let{path:d,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let m=(e.method||"GET").toLowerCase();r.paths[d]||(r.paths[d]={});let y={};y.operationId=e.operationId||this.generateOperationId(e,m,d,r),y.summary=e.summary||this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let b=e.tags;if(b&&b.length>0){y.tags=b;for(let k of b)i.add(k)}else o&&(y.tags=[o]);let q=this.buildParameters(e);q.length>0&&(y.parameters=q);let x=await this.buildRequestBody(e,c);x&&(y.requestBody=x);let v=e.responses;v&&Object.keys(v).length>0?y.responses=this.mapResponseDefinitions(v):y.responses=await this.buildResponses(e,l.id,c);let _=e.security;if(_&&_.length>0)y.security=_;else{let k=this.buildOperationSecurity(e,l,n);k!==void 0&&(y.security=k)}let E=r.paths[d][m];E?this.mergeOperation(E,y,e.name):r.paths[d][m]=y}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
235
+ `,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=Ag(e),n=Fu(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=Ag(e),n=Fu(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())}}};XA.Parser=lR});var iT=V(Fd=>{"use strict";var eT=Y_(),JK=Id(),Md=kd(),GK=J0(),YK=it(),KK=aR(),tT=uR();function rT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new KK.LineCounter||null,prettyErrors:e}}function QK(t,e={}){let{lineCounter:r,prettyErrors:n}=rT(e),i=new tT.Parser(r?.addNewLine),s=new eT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Md.prettifyError(t,r)),l.warnings.forEach(Md.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function nT(t,e={}){let{lineCounter:r,prettyErrors:n}=rT(e),i=new tT.Parser(r?.addNewLine),s=new eT.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 Md.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Md.prettifyError(t,r)),o.warnings.forEach(Md.prettifyError(t,r))),o}function ZK(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=nT(t,r);if(!i)return null;if(i.warnings.forEach(s=>GK.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 XK(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 YK.isDocument(t)&&!n?t.toString(r):new JK.Document(t,n,r).toString(r)}Fd.parse=ZK;Fd.parseAllDocuments=QK;Fd.parseDocument=nT;Fd.stringify=XK});var Dd=V(_t=>{"use strict";var e4=Y_(),t4=Id(),r4=O_(),cR=kd(),n4=dd(),Po=it(),i4=Co(),s4=rr(),o4=qo(),a4=Io(),l4=Pg(),u4=sR(),c4=aR(),f4=uR(),$g=iT(),sT=ld();_t.Composer=e4.Composer;_t.Document=t4.Document;_t.Schema=r4.Schema;_t.YAMLError=cR.YAMLError;_t.YAMLParseError=cR.YAMLParseError;_t.YAMLWarning=cR.YAMLWarning;_t.Alias=n4.Alias;_t.isAlias=Po.isAlias;_t.isCollection=Po.isCollection;_t.isDocument=Po.isDocument;_t.isMap=Po.isMap;_t.isNode=Po.isNode;_t.isPair=Po.isPair;_t.isScalar=Po.isScalar;_t.isSeq=Po.isSeq;_t.Pair=i4.Pair;_t.Scalar=s4.Scalar;_t.YAMLMap=o4.YAMLMap;_t.YAMLSeq=a4.YAMLSeq;_t.CST=l4;_t.Lexer=u4.Lexer;_t.LineCounter=c4.LineCounter;_t.Parser=f4.Parser;_t.parse=$g.parse;_t.parseAllDocuments=$g.parseAllDocuments;_t.parseDocument=$g.parseDocument;_t.stringify=$g.stringify;_t.visit=sT.visit;_t.visitAsync=sT.visitAsync});var d4,p4,h4,m4,g4,y4,v4,ko,Ng=le(()=>{"use strict";d4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,p4=/^\d{4}-\d{2}-\d{2}$/,h4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,m4=/^https?:\/\/[^\s]+$/,g4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,y4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,v4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,ko=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(d4.test(e))return"date-time";if(p4.test(e))return"date";if(h4.test(e))return"email";if(g4.test(e))return"uuid";if(m4.test(e))return"uri";if(y4.test(e))return"ipv4";if(v4.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 m of l)s[m]&&o[m]?i.properties[m]=this.mergeSchemas(s[m],o[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...o[m]};let c=new Set(e.required||Object.keys(s)),d=new Set(r.required||Object.keys(o)),p=[...l].filter(m=>c.has(m)&&d.has(m));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 oT,b4,Du,fR=le(()=>{"use strict";oT=Qc(Dd());Ng();b4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Du=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new ko}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 c=this.mapAuthToSecurityScheme(n.auth);if(c){let{schemeName:d,scheme:p,requirement:m}=c;s.set(d,p),i.security=[m]}}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[c,d]of s)i.components.securitySchemes[c]=d;else delete i.components.securitySchemes;return i.tags=[...o].map(c=>({name:c})),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"?oT.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,c){for(let d of e)if(d.type==="folder"){let p=d,m=o||p.name;i.add(m),p.items&&await this.processItems(p.items,r,n,i,s,m,l,c)}else{let p=d;await this.processRequest(p,r,n,i,s,o,l,c)}}async processRequest(e,r,n,i,s,o,l,c){let{path:d,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let m=(e.method||"GET").toLowerCase();r.paths[d]||(r.paths[d]={});let y={};y.operationId=e.operationId||this.generateOperationId(e,m,d,r),y.summary=e.summary||this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let b=e.tags;if(b&&b.length>0){y.tags=b;for(let k of b)i.add(k)}else o&&(y.tags=[o]);let q=this.buildParameters(e);q.length>0&&(y.parameters=q);let x=await this.buildRequestBody(e,c);x&&(y.requestBody=x);let v=e.responses;v&&Object.keys(v).length>0?y.responses=this.mapResponseDefinitions(v):y.responses=await this.buildResponses(e,l.id,c);let R=e.security;if(R&&R.length>0)y.security=R;else{let k=this.buildOperationSecurity(e,l,n);k!==void 0&&(y.security=k)}let E=r.paths[d][m];E?this.mergeOperation(E,y,e.name):r.paths[d][m]=y}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
236
236
 
237
237
  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 c=this.buildVariantSchema(s);i.oneOf.some(d=>JSON.stringify(d)===JSON.stringify(c))||i.oneOf.push(c)}else if(s.oneOf){let c=this.buildVariantSchema(i);i.oneOf=[c,...s.oneOf]}else{let c=this.buildVariantSchema(i),d=this.buildVariantSchema(s);i.oneOf=[c,d]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let c=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[c]={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(c=>c&&!c.startsWith("{"));s=r+l.map(c=>c.charAt(0).toUpperCase()+c.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||b4.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,c;if(e.bodySchema){if(e.bodySchema.content){for(let[m,y]of Object.entries(e.bodySchema.content)){let b={};y.schema&&(b.schema=y.schema),y.examples&&(b.examples=y.examples),y.encoding&&(b.encoding=y.encoding),i.content[m]=b}let p=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(p&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[p]&&(i.content[p].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),o=e.bodySchema.schema,e.bodySchema.components,l=this.tryParseBodyContent(n),e.bodySchema.encoding&&(c=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 d={};return o&&(d.schema=o),l!==void 0&&(d.example=l),c&&(d.encoding=c),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,o]of Object.entries(e.responseSchema.responses)){let l={description:o.description||`Status ${s}`};if(o.content){l.content={};for(let[c,d]of Object.entries(o.content)){let p={};d.schema&&(p.schema=d.schema),d.examples&&(p.examples=d.examples),l.content[c]=p}}else if(o.schema){let c=o.contentType||"application/json",d={schema:o.schema};o.examples&&(d.examples=o.examples),l.content={[c]:d}}if(o.headers){l.headers={};for(let[c,d]of Object.entries(o.headers))l.headers[c]={...d.description&&{description:d.description},schema:d.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 c=l;s.headers[o]={...c.description&&{description:c.description},...c.schema&&{schema:c.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 c=l;if(c.responses){for(let[d,p]of Object.entries(c.responses))if(p.content)for(let m of Object.values(p.content))m.schema&&this.trackSchema(m.schema,`${o}${i}Response${d}`,r,n)}if(c.requestBody?.content)for(let d of Object.values(c.requestBody.content))d.schema&&this.trackSchema(d.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 c of Object.values(l.content))c.schema&&JSON.stringify(c.schema)===i&&(c.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}}}`,c=!1;for(let d of s){let p=this.envConfigService.resolveVariables(l,d);p&&p!==l&&!i.has(p)&&(r.push({url:p,description:d}),i.add(p),c=!0)}if(!c){let d=`{${o}}`;i.has(d)||(r.push({url:d,variables:{[o]:{default:""}}}),i.add(d))}}}}});var ju,dR=le(()=>{"use strict";ju=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 Mg=V(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.getDeepKeys=Lu.toJSON=void 0;var S4=["function","symbol","undefined"],w4=["constructor","prototype","__proto__"],_4=Object.getPrototypeOf({});function R4(){let t={},e=this;for(let r of aT(e))if(typeof r=="string"){let n=e[r],i=typeof n;S4.includes(i)||(t[r]=n)}return t}Lu.toJSON=R4;function aT(t,e=[]){let r=[];for(;t&&t!==_4;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(w4))n.delete(i);return n}Lu.getDeepKeys=aT});var pR=V(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.addInspectMethod=Uu.format=void 0;var lT=wt("util"),x4=Mg(),uT=lT.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Uu.format=lT.format;function C4(t){t[uT]=E4}Uu.addInspectMethod=C4;function E4(){let t={},e=this;for(let r of x4.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[uT],t}});var dT=V(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.lazyJoinStacks=Gi.joinStacks=Gi.isWritableStack=Gi.isLazyStack=void 0;var q4=/\r?\n/,I4=/\bono[ @]/;function O4(t){return!!(t&&t.configurable&&typeof t.get=="function")}Gi.isLazyStack=O4;function P4(t){return!!(!t||t.writable||typeof t.set=="function")}Gi.isWritableStack=P4;function cT(t,e){let r=fT(t.stack),n=e?e.stack:void 0;return r&&n?r+`
238
238
 
@@ -251,13 +251,13 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Ya.Unma
251
251
  `}return l.replace(/\n$/,"")}WT.exports=G3});var Pr=V((_re,GT)=>{"use strict";var JT=Ju(),Y3=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],K3=["scalar","sequence","mapping"];function Q3(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function Z3(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(Y3.indexOf(r)===-1)throw new JT('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=Q3(e.styleAliases||null),K3.indexOf(this.kind)===-1)throw new JT('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}GT.exports=Z3});var UR=V((Rre,KT)=>{"use strict";var Bd=Ju(),jR=Pr();function YT(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 X3(){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 LR(t){return this.extend(t)}LR.prototype.extend=function(e){let r=[],n=[];if(e instanceof jR)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 Bd("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof jR))throw new Bd("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Bd("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 Bd("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 jR))throw new Bd("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(LR.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=YT(i,"implicit"),i.compiledExplicit=YT(i,"explicit"),i.compiledTypeMap=X3(i.compiledImplicit,i.compiledExplicit),i};KT.exports=LR});var HR=V((xre,QT)=>{"use strict";var e6=Pr();QT.exports=new e6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var BR=V((Cre,ZT)=>{"use strict";var t6=Pr();ZT.exports=new t6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var VR=V((Ere,XT)=>{"use strict";var r6=Pr();XT.exports=new r6("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var WR=V((qre,e$)=>{"use strict";var n6=UR();e$.exports=new n6({explicit:[HR(),BR(),VR()]})});var zR=V((Ire,t$)=>{"use strict";var i6=Pr();function s6(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function o6(){return null}function a6(t){return t===null}t$.exports=new i6("tag:yaml.org,2002:null",{kind:"scalar",resolve:s6,construct:o6,predicate:a6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var JR=V((Ore,r$)=>{"use strict";var l6=Pr();function u6(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 c6(t){return t==="true"||t==="True"||t==="TRUE"}function f6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}r$.exports=new l6("tag:yaml.org,2002:bool",{kind:"scalar",resolve:u6,construct:c6,predicate:f6,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 GR=V((Pre,n$)=>{"use strict";var d6=zu(),p6=Pr();function h6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function m6(t){return t>=48&&t<=55}function g6(t){return t>=48&&t<=57}function y6(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(Vd(t))}if(i==="x"){for(r++;r<e;r++){if(!h6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Vd(t))}if(i==="o"){for(r++;r<e;r++){if(!m6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Vd(t))}}for(;r<e;r++){if(!g6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(Vd(t)):!1}function Vd(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 v6(t){return Vd(t)}function b6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!d6.isNegativeZero(t)}n$.exports=new p6("tag:yaml.org,2002:int",{kind:"scalar",resolve:y6,construct:v6,predicate:b6,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 YR=V((kre,s$)=>{"use strict";var i$=zu(),S6=Pr(),w6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),_6=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function R6(t){return t===null||!w6.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:_6.test(t)}function x6(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 C6=/^[-+]?[0-9]+e/;function E6(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(i$.isNegativeZero(t))return"-0.0";let r=t.toString(10);return C6.test(r)?r.replace("e",".e"):r}function q6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||i$.isNegativeZero(t))}s$.exports=new S6("tag:yaml.org,2002:float",{kind:"scalar",resolve:R6,construct:x6,predicate:q6,represent:E6,defaultStyle:"lowercase"})});var KR=V((Are,o$)=>{"use strict";o$.exports=WR().extend({implicit:[zR(),JR(),GR(),YR()]})});var QR=V((Tre,a$)=>{"use strict";a$.exports=KR()});var ZR=V(($re,c$)=>{"use strict";var I6=Pr(),l$=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),u$=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 O6(t){return t===null?!1:l$.exec(t)!==null||u$.exec(t)!==null}function P6(t){let e=0,r=null,n=l$.exec(t);if(n===null&&(n=u$.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],c=+n[5],d=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let m=+n[10],y=+(n[11]||0);r=(m*60+y)*6e4,n[9]==="-"&&(r=-r)}let p=new Date(Date.UTC(i,s,o,l,c,d,e));return r&&p.setTime(p.getTime()-r),p}function k6(t){return t.toISOString()}c$.exports=new I6("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:O6,construct:P6,instanceOf:Date,represent:k6})});var XR=V((Nre,f$)=>{"use strict";var A6=Pr();function T6(t){return t==="<<"||t===null}f$.exports=new A6("tag:yaml.org,2002:merge",{kind:"scalar",resolve:T6})});var tx=V((Mre,d$)=>{"use strict";var $6=Pr(),ex=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
252
252
  \r`;function N6(t){if(t===null)return!1;let e=0,r=t.length,n=ex;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 M6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=ex,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 F6(t){let e="",r=0,n=t.length,i=ex;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 D6(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}d$.exports=new $6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:N6,construct:M6,predicate:D6,represent:F6})});var rx=V((Fre,p$)=>{"use strict";var j6=Pr(),L6=Object.prototype.hasOwnProperty,U6=Object.prototype.toString;function H6(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(U6.call(s)!=="[object Object]")return!1;let l;for(l in s)if(L6.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 B6(t){return t!==null?t:[]}p$.exports=new j6("tag:yaml.org,2002:omap",{kind:"sequence",resolve:H6,construct:B6})});var nx=V((Dre,h$)=>{"use strict";var V6=Pr(),W6=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(W6.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 J6(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}h$.exports=new V6("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:z6,construct:J6})});var ix=V((jre,m$)=>{"use strict";var G6=Pr(),Y6=Object.prototype.hasOwnProperty;function K6(t){if(t===null)return!0;let e=t;for(let r in e)if(Y6.call(e,r)&&e[r]!==null)return!1;return!0}function Q6(t){return t!==null?t:{}}m$.exports=new G6("tag:yaml.org,2002:set",{kind:"mapping",resolve:K6,construct:Q6})});var Zg=V((Lre,g$)=>{"use strict";g$.exports=QR().extend({implicit:[ZR(),XR()],explicit:[tx(),rx(),nx(),ix()]})});var M$=V((Ure,lx)=>{"use strict";var Qa=zu(),x$=Ju(),Z6=zT(),X6=Zg(),Si=Object.prototype.hasOwnProperty,Xg=1,C$=2,E$=3,ey=4,sx=1,e9=2,y$=3,t9=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,r9=/[\x85\u2028\u2029]/,n9=/[,\[\]{}]/,q$=/^(?:!|!!|![0-9A-Za-z-]+!)$/,I$=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function v$(t){return Object.prototype.toString.call(t)}function Ki(t){return t===10||t===13}function Os(t){return t===9||t===32}function cn(t){return t===9||t===32||t===10||t===13}function Gu(t){return t===44||t===91||t===93||t===123||t===125}function i9(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function s9(t){return t===120?2:t===117?4:t===85?8:0}function o9(t){return t>=48&&t<=57?t-48:-1}function b$(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
253
253
  `;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 a9(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function O$(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var P$=new Array(256),k$=new Array(256);for(let t=0;t<256;t++)P$[t]=b$(t)?1:0,k$[t]=b$(t);function l9(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||X6,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function A$(t,e){let r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=Z6(r),new x$(e,r)}function be(t,e){throw A$(t,e)}function ty(t,e){t.onWarning&&t.onWarning.call(null,A$(t,e))}function Za(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];Si.call(i,e)||(i[e]={existed:Si.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function u9(t){t.anchorMapTransactions.push(Object.create(null))}function c9(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];Si.call(n,l)||(n[l]=e[l])}}function f9(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 T$(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 S$(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 w$={YAML:function(e,r,n){e.version!==null&&be(e,"duplication of %YAML directive"),n.length!==1&&be(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&be(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),o=parseInt(i[2],10);s!==1&&be(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&ty(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&be(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],q$.test(s)||be(e,"ill-formed tag handle (first argument) of the TAG directive"),Si.call(e.tagMap,s)&&be(e,'there is a previously declared suffix for "'+s+'" tag handle'),I$.test(i)||be(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{be(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function No(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,o=i.length;s<o;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||be(t,"expected valid JSON character")}else t9.test(i)&&be(t,"the stream contains non-printable characters");t.result+=i}}function _$(t,e,r,n){Qa.isObject(r)||be(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];Si.call(e,l)||(O$(e,l,r[l]),n[l]=!0)}}function Yu(t,e,r,n,i,s,o,l,c){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let d=0,p=i.length;d<p;d+=1)Array.isArray(i[d])&&be(t,"nested arrays are not supported inside keys"),typeof i=="object"&&v$(i[d])==="[object Object]"&&(i[d]="[object Object]")}if(typeof i=="object"&&v$(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&&be(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let d=new Set;for(let p=0,m=s.length;p<m;p+=1){let y=s[p];d.has(y)||(d.add(y),_$(t,e,y,r))}}else _$(t,e,s,r);else!t.json&&!Si.call(r,i)&&Si.call(e,i)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=c||t.position,be(t,"duplicated mapping key")),O$(e,i,s),delete r[i];return e}function ox(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):be(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function nr(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;Os(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(Ki(i))for(ox(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&&ty(t,"deficient indentation"),n}function ry(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||cn(r)))}function ax(t,e){e===1?t.result+=" ":e>1&&(t.result+=Qa.repeat(`
254
- `,e-1))}function d9(t,e,r){let n,i,s,o,l,c,d=t.kind,p=t.result,m=t.input.charCodeAt(t.position);if(cn(m)||Gu(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96)return!1;if(m===63||m===45){let y=t.input.charCodeAt(t.position+1);if(cn(y)||r&&Gu(y))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;m!==0;){if(m===58){let y=t.input.charCodeAt(t.position+1);if(cn(y)||r&&Gu(y))break}else if(m===35){let y=t.input.charCodeAt(t.position-1);if(cn(y))break}else{if(t.position===t.lineStart&&ry(t)||r&&Gu(m))break;if(Ki(m))if(o=t.line,l=t.lineStart,c=t.lineIndent,nr(t,!1,-1),t.lineIndent>=e){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(No(t,n,i,!1),ax(t,t.line-o),n=i=t.position,s=!1),Os(m)||(i=t.position+1),m=t.input.charCodeAt(++t.position)}return No(t,n,i,!1),t.result?!0:(t.kind=d,t.result=p,!1)}function p9(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(No(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else Ki(i)?(No(t,r,n,!0),ax(t,nr(t,!1,e)),r=n=t.position):t.position===t.lineStart&&ry(t)?be(t,"unexpected end of the document within a single quoted scalar"):(t.position++,Os(i)||(n=t.position));be(t,"unexpected end of the stream within a single quoted scalar")}function h9(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return No(t,r,t.position,!0),t.position++,!0;if(s===92){if(No(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ki(s))nr(t,!1,e);else if(s<256&&P$[s])t.result+=k$[s],t.position++;else if((i=s9(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=i9(s))>=0?l=(l<<4)+i:be(t,"expected hexadecimal character");t.result+=a9(l),t.position++}else be(t,"unknown escape sequence");r=n=t.position}else Ki(s)?(No(t,r,n,!0),ax(t,nr(t,!1,e)),r=n=t.position):t.position===t.lineStart&&ry(t)?be(t,"unexpected end of the document within a double quoted scalar"):(t.position++,Os(s)||(n=t.position))}be(t,"unexpected end of the stream within a double quoted scalar")}function m9(t,e){let r=!0,n,i,s,o=t.tag,l,c=t.anchor,d,p,m,y,b=Object.create(null),q,x,v,_=t.input.charCodeAt(t.position);if(_===91)d=93,y=!1,l=[];else if(_===123)d=125,y=!0,l={};else return!1;for(t.anchor!==null&&Za(t,t.anchor,l),_=t.input.charCodeAt(++t.position);_!==0;){if(nr(t,!0,e),_=t.input.charCodeAt(t.position),_===d)return t.position++,t.tag=o,t.anchor=c,t.kind=y?"mapping":"sequence",t.result=l,!0;if(r?_===44&&be(t,"expected the node content, but found ','"):be(t,"missed comma between flow collection entries"),x=q=v=null,p=m=!1,_===63){let E=t.input.charCodeAt(t.position+1);cn(E)&&(p=m=!0,t.position++,nr(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Ku(t,e,Xg,!1,!0),x=t.tag,q=t.result,nr(t,!0,e),_=t.input.charCodeAt(t.position),(m||t.line===n)&&_===58&&(p=!0,_=t.input.charCodeAt(++t.position),nr(t,!0,e),Ku(t,e,Xg,!1,!0),v=t.result),y?Yu(t,l,b,x,q,v,n,i,s):p?l.push(Yu(t,null,b,x,q,v,n,i,s)):l.push(q),nr(t,!0,e),_=t.input.charCodeAt(t.position),_===44?(r=!0,_=t.input.charCodeAt(++t.position)):r=!1}be(t,"unexpected end of the stream within a flow collection")}function g9(t,e){let r,n=sx,i=!1,s=!1,o=e,l=0,c=!1,d,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)sx===n?n=p===43?y$:e9:be(t,"repeat of a chomping mode identifier");else if((d=o9(p))>=0)d===0?be(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?be(t,"repeat of an indentation width identifier"):(o=e+d-1,s=!0);else break;if(Os(p)){do p=t.input.charCodeAt(++t.position);while(Os(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!Ki(p)&&p!==0)}for(;p!==0;){for(ox(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),Ki(p)){l++;continue}if(!s&&o===0&&be(t,"missing indentation for block scalar"),t.lineIndent<o){n===y$?t.result+=Qa.repeat(`
254
+ `,e-1))}function d9(t,e,r){let n,i,s,o,l,c,d=t.kind,p=t.result,m=t.input.charCodeAt(t.position);if(cn(m)||Gu(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96)return!1;if(m===63||m===45){let y=t.input.charCodeAt(t.position+1);if(cn(y)||r&&Gu(y))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;m!==0;){if(m===58){let y=t.input.charCodeAt(t.position+1);if(cn(y)||r&&Gu(y))break}else if(m===35){let y=t.input.charCodeAt(t.position-1);if(cn(y))break}else{if(t.position===t.lineStart&&ry(t)||r&&Gu(m))break;if(Ki(m))if(o=t.line,l=t.lineStart,c=t.lineIndent,nr(t,!1,-1),t.lineIndent>=e){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(No(t,n,i,!1),ax(t,t.line-o),n=i=t.position,s=!1),Os(m)||(i=t.position+1),m=t.input.charCodeAt(++t.position)}return No(t,n,i,!1),t.result?!0:(t.kind=d,t.result=p,!1)}function p9(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(No(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else Ki(i)?(No(t,r,n,!0),ax(t,nr(t,!1,e)),r=n=t.position):t.position===t.lineStart&&ry(t)?be(t,"unexpected end of the document within a single quoted scalar"):(t.position++,Os(i)||(n=t.position));be(t,"unexpected end of the stream within a single quoted scalar")}function h9(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return No(t,r,t.position,!0),t.position++,!0;if(s===92){if(No(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ki(s))nr(t,!1,e);else if(s<256&&P$[s])t.result+=k$[s],t.position++;else if((i=s9(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=i9(s))>=0?l=(l<<4)+i:be(t,"expected hexadecimal character");t.result+=a9(l),t.position++}else be(t,"unknown escape sequence");r=n=t.position}else Ki(s)?(No(t,r,n,!0),ax(t,nr(t,!1,e)),r=n=t.position):t.position===t.lineStart&&ry(t)?be(t,"unexpected end of the document within a double quoted scalar"):(t.position++,Os(s)||(n=t.position))}be(t,"unexpected end of the stream within a double quoted scalar")}function m9(t,e){let r=!0,n,i,s,o=t.tag,l,c=t.anchor,d,p,m,y,b=Object.create(null),q,x,v,R=t.input.charCodeAt(t.position);if(R===91)d=93,y=!1,l=[];else if(R===123)d=125,y=!0,l={};else return!1;for(t.anchor!==null&&Za(t,t.anchor,l),R=t.input.charCodeAt(++t.position);R!==0;){if(nr(t,!0,e),R=t.input.charCodeAt(t.position),R===d)return t.position++,t.tag=o,t.anchor=c,t.kind=y?"mapping":"sequence",t.result=l,!0;if(r?R===44&&be(t,"expected the node content, but found ','"):be(t,"missed comma between flow collection entries"),x=q=v=null,p=m=!1,R===63){let E=t.input.charCodeAt(t.position+1);cn(E)&&(p=m=!0,t.position++,nr(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Ku(t,e,Xg,!1,!0),x=t.tag,q=t.result,nr(t,!0,e),R=t.input.charCodeAt(t.position),(m||t.line===n)&&R===58&&(p=!0,R=t.input.charCodeAt(++t.position),nr(t,!0,e),Ku(t,e,Xg,!1,!0),v=t.result),y?Yu(t,l,b,x,q,v,n,i,s):p?l.push(Yu(t,null,b,x,q,v,n,i,s)):l.push(q),nr(t,!0,e),R=t.input.charCodeAt(t.position),R===44?(r=!0,R=t.input.charCodeAt(++t.position)):r=!1}be(t,"unexpected end of the stream within a flow collection")}function g9(t,e){let r,n=sx,i=!1,s=!1,o=e,l=0,c=!1,d,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)sx===n?n=p===43?y$:e9:be(t,"repeat of a chomping mode identifier");else if((d=o9(p))>=0)d===0?be(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?be(t,"repeat of an indentation width identifier"):(o=e+d-1,s=!0);else break;if(Os(p)){do p=t.input.charCodeAt(++t.position);while(Os(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!Ki(p)&&p!==0)}for(;p!==0;){for(ox(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),Ki(p)){l++;continue}if(!s&&o===0&&be(t,"missing indentation for block scalar"),t.lineIndent<o){n===y$?t.result+=Qa.repeat(`
255
255
  `,i?1+l:l):n===sx&&i&&(t.result+=`
256
256
  `);break}r?Os(p)?(c=!0,t.result+=Qa.repeat(`
257
257
  `,i?1+l:l)):c?(c=!1,t.result+=Qa.repeat(`
258
258
  `,l+1)):l===0?i&&(t.result+=" "):t.result+=Qa.repeat(`
259
259
  `,l):t.result+=Qa.repeat(`
260
- `,i?1+l:l),i=!0,s=!0,l=0;let m=t.position;for(;!Ki(p)&&p!==0;)p=t.input.charCodeAt(++t.position);No(t,m,t.position,!1)}return!0}function R$(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Za(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,be(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!cn(l))break;if(s=!0,t.position++,nr(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let c=t.line;if(Ku(t,e,E$,!1,!0),i.push(t.result),nr(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===c||t.lineIndent>e)&&o!==0)be(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 $$(t,e,r){let n,i,s,o,l=t.tag,c=t.anchor,d={},p=Object.create(null),m=null,y=null,b=null,q=!1,x=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Za(t,t.anchor,d);let v=t.input.charCodeAt(t.position);for(;v!==0;){!q&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,be(t,"tab characters must not be used in indentation"));let _=t.input.charCodeAt(t.position+1),E=t.line;if((v===63||v===58)&&cn(_))v===63?(q&&(Yu(t,d,p,m,y,null,i,s,o),m=y=b=null),x=!0,q=!0,n=!0):q?(q=!1,n=!0):be(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,v=_;else{if(i=t.line,s=t.lineStart,o=t.position,!Ku(t,r,C$,!1,!0))break;if(t.line===E){for(v=t.input.charCodeAt(t.position);Os(v);)v=t.input.charCodeAt(++t.position);if(v===58)v=t.input.charCodeAt(++t.position),cn(v)||be(t,"a whitespace character is expected after the key-value separator within a block mapping"),q&&(Yu(t,d,p,m,y,null,i,s,o),m=y=b=null),x=!0,q=!1,n=!1,m=t.tag,y=t.result;else if(x)be(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=c,!0}else if(x)be(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=c,!0}if((t.line===E||t.lineIndent>e)&&(q&&(i=t.line,s=t.lineStart,o=t.position),Ku(t,e,ey,!0,n)&&(q?y=t.result:b=t.result),q||(Yu(t,d,p,m,y,b,i,s,o),m=y=b=null),nr(t,!0,-1),v=t.input.charCodeAt(t.position)),(t.line===E||t.lineIndent>e)&&v!==0)be(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return q&&Yu(t,d,p,m,y,null,i,s,o),x&&(t.tag=l,t.anchor=c,t.kind="mapping",t.result=d),x}function y9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&be(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)):be(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!cn(s);)s===33&&(r?be(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),q$.test(n)||be(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),n9.test(i)&&be(t,"tag suffix cannot contain flow indicator characters")}i&&!I$.test(i)&&be(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{be(t,"tag name is malformed: "+i)}return e?t.tag=i:Si.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:be(t,'undeclared tag handle "'+n+'"'),!0}function v9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&be(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!cn(e)&&!Gu(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&be(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function b9(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&&!cn(e)&&!Gu(e);)e=t.input.charCodeAt(++t.position);t.position===r&&be(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return Si.call(t.anchorMap,n)||be(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],nr(t,!0,-1),!0}function S9(t,e,r,n){let i=T$(t);return u9(t),S$(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,$$(t,r,n)&&t.kind==="mapping"?(c9(t),!0):(f9(t),S$(t,i),!1)}function Ku(t,e,r,n,i){let s,o,l=1,c=!1,d=!1,p=null,m,y,b;t.depth>=t.maxDepth&&be(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 q=s=o=ey===r||E$===r;if(n&&nr(t,!0,-1)&&(c=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let x=t.input.charCodeAt(t.position),v=T$(t);if(c&&(x===33&&t.tag!==null||x===38&&t.anchor!==null)||!y9(t)&&!v9(t))break;p===null&&(p=v),nr(t,!0,-1)?(c=!0,o=q,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1}if(o&&(o=c||i),l===1||ey===r)if(Xg===r||C$===r?y=e:y=e+1,b=t.position-t.lineStart,l===1)if(o&&(R$(t,b)||$$(t,b,y))||m9(t,y))d=!0;else{let x=t.input.charCodeAt(t.position);p!==null&&q&&!o&&x!==124&&x!==62&&S9(t,p,p.position-p.lineStart,y)||s&&g9(t,y)||p9(t,y)||h9(t,y)?d=!0:b9(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&be(t,"alias node should not have any properties")):d9(t,y,Xg===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&Za(t,t.anchor,t.result)}else l===0&&(d=o&&R$(t,b));if(t.tag===null)t.anchor!==null&&Za(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&be(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let x=0,v=t.implicitTypes.length;x<v;x+=1)if(m=t.implicitTypes[x],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&Za(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(Si.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else{m=null;let x=t.typeMap.multi[t.kind||"fallback"];for(let v=0,_=x.length;v<_;v+=1)if(t.tag.slice(0,x[v].tag.length)===x[v].tag){m=x[v];break}}m||be(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&be(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&Za(t,t.anchor,t.result)):be(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||d}function w9(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&&(nr(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&&!cn(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),o=[];for(s.length<1&&be(t,"directive name must not be less than one character in length");n!==0;){for(;Os(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ki(n));break}if(Ki(n))break;for(i=t.position;n!==0&&!cn(n);)n=t.input.charCodeAt(++t.position);o.push(t.input.slice(i,t.position))}n!==0&&ox(t),Si.call(w$,s)?w$[s](t,s,o):ty(t,'unknown document directive "'+s+'"')}if(nr(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,nr(t,!0,-1)):r&&be(t,"directives end mark is expected"),Ku(t,t.lineIndent-1,ey,!1,!0),nr(t,!0,-1),t.checkLineBreaks&&r9.test(t.input.slice(e,t.position))&&ty(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&ry(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,nr(t,!0,-1));return}t.position<t.length-1&&be(t,"end of the stream or a document separator is expected")}function N$(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
260
+ `,i?1+l:l),i=!0,s=!0,l=0;let m=t.position;for(;!Ki(p)&&p!==0;)p=t.input.charCodeAt(++t.position);No(t,m,t.position,!1)}return!0}function R$(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Za(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,be(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!cn(l))break;if(s=!0,t.position++,nr(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let c=t.line;if(Ku(t,e,E$,!1,!0),i.push(t.result),nr(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===c||t.lineIndent>e)&&o!==0)be(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 $$(t,e,r){let n,i,s,o,l=t.tag,c=t.anchor,d={},p=Object.create(null),m=null,y=null,b=null,q=!1,x=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Za(t,t.anchor,d);let v=t.input.charCodeAt(t.position);for(;v!==0;){!q&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,be(t,"tab characters must not be used in indentation"));let R=t.input.charCodeAt(t.position+1),E=t.line;if((v===63||v===58)&&cn(R))v===63?(q&&(Yu(t,d,p,m,y,null,i,s,o),m=y=b=null),x=!0,q=!0,n=!0):q?(q=!1,n=!0):be(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,v=R;else{if(i=t.line,s=t.lineStart,o=t.position,!Ku(t,r,C$,!1,!0))break;if(t.line===E){for(v=t.input.charCodeAt(t.position);Os(v);)v=t.input.charCodeAt(++t.position);if(v===58)v=t.input.charCodeAt(++t.position),cn(v)||be(t,"a whitespace character is expected after the key-value separator within a block mapping"),q&&(Yu(t,d,p,m,y,null,i,s,o),m=y=b=null),x=!0,q=!1,n=!1,m=t.tag,y=t.result;else if(x)be(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=c,!0}else if(x)be(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=c,!0}if((t.line===E||t.lineIndent>e)&&(q&&(i=t.line,s=t.lineStart,o=t.position),Ku(t,e,ey,!0,n)&&(q?y=t.result:b=t.result),q||(Yu(t,d,p,m,y,b,i,s,o),m=y=b=null),nr(t,!0,-1),v=t.input.charCodeAt(t.position)),(t.line===E||t.lineIndent>e)&&v!==0)be(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return q&&Yu(t,d,p,m,y,null,i,s,o),x&&(t.tag=l,t.anchor=c,t.kind="mapping",t.result=d),x}function y9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&be(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)):be(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!cn(s);)s===33&&(r?be(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),q$.test(n)||be(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),n9.test(i)&&be(t,"tag suffix cannot contain flow indicator characters")}i&&!I$.test(i)&&be(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{be(t,"tag name is malformed: "+i)}return e?t.tag=i:Si.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:be(t,'undeclared tag handle "'+n+'"'),!0}function v9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&be(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!cn(e)&&!Gu(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&be(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function b9(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&&!cn(e)&&!Gu(e);)e=t.input.charCodeAt(++t.position);t.position===r&&be(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return Si.call(t.anchorMap,n)||be(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],nr(t,!0,-1),!0}function S9(t,e,r,n){let i=T$(t);return u9(t),S$(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,$$(t,r,n)&&t.kind==="mapping"?(c9(t),!0):(f9(t),S$(t,i),!1)}function Ku(t,e,r,n,i){let s,o,l=1,c=!1,d=!1,p=null,m,y,b;t.depth>=t.maxDepth&&be(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 q=s=o=ey===r||E$===r;if(n&&nr(t,!0,-1)&&(c=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let x=t.input.charCodeAt(t.position),v=T$(t);if(c&&(x===33&&t.tag!==null||x===38&&t.anchor!==null)||!y9(t)&&!v9(t))break;p===null&&(p=v),nr(t,!0,-1)?(c=!0,o=q,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1}if(o&&(o=c||i),l===1||ey===r)if(Xg===r||C$===r?y=e:y=e+1,b=t.position-t.lineStart,l===1)if(o&&(R$(t,b)||$$(t,b,y))||m9(t,y))d=!0;else{let x=t.input.charCodeAt(t.position);p!==null&&q&&!o&&x!==124&&x!==62&&S9(t,p,p.position-p.lineStart,y)||s&&g9(t,y)||p9(t,y)||h9(t,y)?d=!0:b9(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&be(t,"alias node should not have any properties")):d9(t,y,Xg===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&Za(t,t.anchor,t.result)}else l===0&&(d=o&&R$(t,b));if(t.tag===null)t.anchor!==null&&Za(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&be(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let x=0,v=t.implicitTypes.length;x<v;x+=1)if(m=t.implicitTypes[x],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&Za(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(Si.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else{m=null;let x=t.typeMap.multi[t.kind||"fallback"];for(let v=0,R=x.length;v<R;v+=1)if(t.tag.slice(0,x[v].tag.length)===x[v].tag){m=x[v];break}}m||be(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&be(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&Za(t,t.anchor,t.result)):be(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||d}function w9(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&&(nr(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&&!cn(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),o=[];for(s.length<1&&be(t,"directive name must not be less than one character in length");n!==0;){for(;Os(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ki(n));break}if(Ki(n))break;for(i=t.position;n!==0&&!cn(n);)n=t.input.charCodeAt(++t.position);o.push(t.input.slice(i,t.position))}n!==0&&ox(t),Si.call(w$,s)?w$[s](t,s,o):ty(t,'unknown document directive "'+s+'"')}if(nr(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,nr(t,!0,-1)):r&&be(t,"directives end mark is expected"),Ku(t,t.lineIndent-1,ey,!1,!0),nr(t,!0,-1),t.checkLineBreaks&&r9.test(t.input.slice(e,t.position))&&ty(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&ry(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,nr(t,!0,-1));return}t.position<t.length-1&&be(t,"end of the stream or a document separator is expected")}function N$(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
261
261
  `),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new l9(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,be(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;)w9(r);return r.documents}function _9(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=N$(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function R9(t,e){let r=N$(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new x$("expected a single document in the stream, but found more")}}lx.exports.loadAll=_9;lx.exports.load=R9});var n1=V((Hre,r1)=>{"use strict";var sy=zu(),Yd=Ju(),x9=Zg(),W$=Object.prototype.toString,z$=Object.prototype.hasOwnProperty,px=65279,C9=9,zd=10,E9=13,q9=32,I9=33,O9=34,ux=35,P9=37,k9=38,A9=39,T9=42,J$=44,$9=45,ny=58,N9=61,M9=62,F9=63,D9=64,G$=91,Y$=93,j9=96,K$=123,L9=124,Q$=125,kr={};kr[0]="\\0";kr[7]="\\a";kr[8]="\\b";kr[9]="\\t";kr[10]="\\n";kr[11]="\\v";kr[12]="\\f";kr[13]="\\r";kr[27]="\\e";kr[34]='\\"';kr[92]="\\\\";kr[133]="\\N";kr[160]="\\_";kr[8232]="\\L";kr[8233]="\\P";var U9=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],H9=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function B9(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 c=t.compiledTypeMap.fallback[o];c&&z$.call(c.styleAliases,l)&&(l=c.styleAliases[l]),r[o]=l}return r}function V9(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 Yd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+sy.repeat("0",r-n.length)+n}var W9=1,Jd=2;function z9(t){this.schema=t.schema||x9,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=sy.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=B9(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==='"'?Jd:W9,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 F$(t,e){let r=sy.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let o,l=t.indexOf(`
262
262
  `,n);l===-1?(o=t.slice(n),n=s):(o=t.slice(n,l+1),n=l+1),o.length&&o!==`
263
263
  `&&(i+=r),i+=o}return i}function cx(t,e){return`
@@ -276,7 +276,7 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new Ya.Unma
276
276
  `:""}r1.exports.dump=i8});var mx=V((Bre,Wr)=>{"use strict";var i1=M$(),s8=n1();function hx(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.")}}Wr.exports.Type=Pr();Wr.exports.Schema=UR();Wr.exports.FAILSAFE_SCHEMA=WR();Wr.exports.JSON_SCHEMA=KR();Wr.exports.CORE_SCHEMA=QR();Wr.exports.DEFAULT_SCHEMA=Zg();Wr.exports.load=i1.load;Wr.exports.loadAll=i1.loadAll;Wr.exports.dump=s8.dump;Wr.exports.YAMLException=Ju();Wr.exports.types={binary:tx(),float:YR(),map:VR(),null:zR(),pairs:nx(),set:ix(),timestamp:ZR(),bool:JR(),int:GR(),merge:XR(),omap:rx(),seq:BR(),str:HR()};Wr.exports.safeLoad=hx("safeLoad","load");Wr.exports.safeLoadAll=hx("safeLoadAll","loadAll");Wr.exports.safeDump=hx("safeDump","dump")});var s1=V(Kd=>{"use strict";var o8=Kd&&Kd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kd,"__esModule",{value:!0});var a8=Jn(),l8=o8(mx()),u8=mx();Kd.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 l8.default.load(e,{schema:u8.JSON_SCHEMA})}catch(r){throw new a8.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var o1=V(gx=>{"use strict";Object.defineProperty(gx,"__esModule",{value:!0});var c8=Jn(),f8=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;gx.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&f8.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 c8.ParserError("data is not text",t.url)}}});var a1=V(yx=>{"use strict";Object.defineProperty(yx,"__esModule",{value:!0});var d8=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;yx.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&d8.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var f1=V(wi=>{"use strict";var p8=wi&&wi.__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]})),h8=wi&&wi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),m8=wi&&wi.__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"&&p8(r,e,n[i]);return h8(r,e),r}})(),g8=wi&&wi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wi,"__esModule",{value:!0});var y8=g8(wt("fs")),l1=Ao(),u1=m8(zn()),c1=Jn();wi.default={order:100,canRead(t){return u1.isFileSystemPath(t.url)},async read(t){let e;try{e=u1.toFileSystemPath(t.url)}catch(r){throw new c1.ResolverError(l1.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await y8.default.promises.readFile(e)}catch(r){throw new c1.ResolverError((0,l1.ono)(r,`Error opening file "${e}"`),e)}}}});var h1=V(ks=>{"use strict";var v8=ks&&ks.__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]})),b8=ks&&ks.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),S8=ks&&ks.__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"&&v8(r,e,n[i]);return b8(r,e),r}})();Object.defineProperty(ks,"__esModule",{value:!0});var oy=Ao(),Qd=S8(zn()),d1=Jn();ks.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Qd.isHttp(t.url)},read(t){let e=Qd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Qd.parse(location.href).protocol),p1(e,this)}};async function p1(t,e,r){t=Qd.parse(t);let n=r||[];n.push(t.href);try{let i=await w8(t,e);if(i.status>=400)throw(0,oy.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new d1.ResolverError((0,oy.ono)({status:i.status},`Error downloading ${n[0]}.
277
277
  Too many redirects:
278
278
  ${n.join(`
279
- `)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,oy.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Qd.resolve(t.href,i.headers.location);return p1(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new d1.ResolverError((0,oy.ono)(i,`Error downloading ${t.href}`),t.href)}}async function w8(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 vx=V(As=>{"use strict";var Zu=As&&As.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(As,"__esModule",{value:!0});As.getNewOptions=As.getJsonSchemaRefParserDefaultOptions=void 0;var _8=Zu(UT()),R8=Zu(s1()),x8=Zu(o1()),C8=Zu(a1()),E8=Zu(f1()),q8=Zu(h1()),I8=()=>({parse:{json:{..._8.default},yaml:{...R8.default},text:{...x8.default},binary:{...C8.default}},resolve:{file:{...E8.default},http:{...q8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});As.getJsonSchemaRefParserDefaultOptions=I8;var O8=t=>{let e=(0,As.getJsonSchemaRefParserDefaultOptions)();return t&&g1(e,t),e};As.getNewOptions=O8;function g1(t,e){if(m1(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];m1(s)?t[i]=g1(o||{},s):s!==void 0&&(t[i]=s)}}return t}function m1(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var v1=V(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.normalizeArgs=y1;var P8=vx();function y1(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,P8.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}}ay.default=y1});var b1=V(_i=>{"use strict";var k8=_i&&_i.__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]})),A8=_i&&_i.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T8=_i&&_i.__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"&&k8(r,e,n[i]);return A8(r,e),r}})(),bx=_i&&_i.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_i,"__esModule",{value:!0});var $8=bx(Vu()),N8=bx(Ld()),M8=bx(NR()),Xu=T8(zn()),F8=Jn();function D8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=Sx(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function Sx(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),$8.default.isExternal$Ref(t)&&o.push(j8(t,e,r,n));let l=Object.keys(t);for(let c of l){let d=N8.default.join(e,c),p=t[c];o=o.concat(Sx(p,d,r,n,i,s))}}return o}async function j8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Xu.resolve(i?Xu.cwd():e,t.$ref),o=Xu.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let c=await(0,M8.default)(s,r,n),d=Sx(c,o+"#",r,n,new Set,!0);return Promise.all(d)}catch(c){if(!n?.continueOnError||!(0,F8.isHandledError)(c))throw c;return r._$refs[o]&&(c.source=decodeURI(Xu.stripHash(e)),c.path=Xu.safePointerToPath(Xu.getHash(e))),[]}}_i.default=D8});var _1=V(Ri=>{"use strict";var L8=Ri&&Ri.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),U8=Ri&&Ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),H8=Ri&&Ri.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&L8(r,e,n[i]);return U8(r,e),r}})(),w1=Ri&&Ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ri,"__esModule",{value:!0});var ly=w1(Vu()),Zd=w1(Ld()),wx=H8(zn());function B8(t,e){let r=[];_x(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),V8(r)}function _x(t,e,r,n,i,s,o,l){let c=e===null?t:t[e];if(c&&typeof c=="object"&&!ArrayBuffer.isView(c))if(ly.default.isAllowed$Ref(c))S1(t,e,r,n,i,s,o,l);else{let d=Object.keys(c).sort((p,m)=>p==="definitions"?-1:m==="definitions"?1:p.length-m.length);for(let p of d){let m=Zd.default.join(r,p),y=Zd.default.join(n,p),b=c[p];ly.default.isAllowed$Ref(b)?S1(c,p,r,y,i,s,o,l):_x(c,p,m,y,i,s,o,l)}}}function S1(t,e,r,n,i,s,o,l){let c=e===null?t:t[e],d=wx.resolve(r,c.$ref),p=o._resolve(d,n,l);if(p===null)return;let y=Zd.default.parse(n).length,b=wx.stripHash(p.path),q=wx.getHash(p.path),x=b!==o._root$Ref.path,v=ly.default.isExtended$Ref(c);i+=p.indirections;let _=W8(s,t,e);if(_)if(y<_.depth||i<_.indirections)z8(s,_);else return;s.push({$ref:c,parent:t,key:e,pathFromRoot:n,depth:y,file:b,hash:q,value:p.value,circular:p.circular,extended:v,external:x,indirections:i}),(!_||x)&&_x(p.value,null,p.path,n,i+1,s,o,l)}function V8(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=Zd.default.join(n,Zd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=ly.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function W8(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)}Ri.default=B8});var I1=V(xi=>{"use strict";var J8=xi&&xi.__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]})),G8=xi&&xi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xi&&xi.__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"&&J8(r,e,n[i]);return G8(r,e),r}})(),E1=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xi,"__esModule",{value:!0});var uy=E1(Vu()),R1=E1(Ld()),K8=Ao(),x1=Y8(zn()),Q8=Jn();xi.default=Z8;function Z8(t,e){let r=Date.now(),n=Rx(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 Rx(t,e,r,n,i,s,o,l,c){let d,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-c>l.timeoutMs)throw new Q8.TimeoutError(l.timeoutMs);let m=l.dereference||{},y=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),uy.default.isAllowed$Ref(t,l))d=C1(t,e,r,n,i,s,o,l,c),p.circular=d.circular,p.value=d.value;else for(let b of Object.keys(t)){let q=R1.default.join(e,b),x=R1.default.join(r,b);if(y(x))continue;let v=t[b],_=!1;if(uy.default.isAllowed$Ref(v,l)){if(d=C1(v,q,x,n,i,s,o,l,c),_=d.circular,t[b]!==d.value){let E=new Map;m?.preservedProperties&&typeof t[b]=="object"&&!Array.isArray(t[b])&&m?.preservedProperties.forEach(k=>{k in t[b]&&E.set(k,t[b][k])}),t[b]=d.value,m?.preservedProperties&&E.size&&typeof t[b]=="object"&&!Array.isArray(t[b])&&E.forEach((k,P)=>{t[b][P]=k}),m?.onDereference?.(v.$ref,t[b],t,b)}}else n.has(v)?_=q1(q,o,l):(d=Rx(v,q,x,n,i,s,o,l,c),_=d.circular,t[b]!==d.value&&(t[b]=d.value));p.circular=p.circular||_}n.delete(t)}return p}function C1(t,e,r,n,i,s,o,l,c){let p=uy.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",m=x1.resolve(p?x1.cwd():e,t.$ref),y=s.get(m);if(y&&!y.circular){let E=Object.keys(t);if(E.length>1){let k={};for(let P of E)P!=="$ref"&&!(P in y.value)&&(k[P]=t[P]);return{circular:y.circular,value:Object.assign({},y.value,k)}}return y}let b=o._resolve(m,e,l);if(b===null)return{circular:!1,value:null};let q=b.circular,x=q||n.has(b.value);x&&q1(e,o,l);let v=uy.default.dereference(t,b.value);if(!x){let E=Rx(v,b.path,r,n,i,s,o,l,c);x=E.circular,v=E.value}x&&!q&&l.dereference?.circular==="ignore"&&(v=t),q&&(v.$ref=r);let _={circular:x,value:v};return Object.keys(t).length===1&&s.set(m,_),_}function q1(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw K8.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var O1=V(xx=>{"use strict";Object.defineProperty(xx,"__esModule",{value:!0});function X8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}xx.default=X8()});var k1=V(Xd=>{"use strict";var e5=Xd&&Xd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xd,"__esModule",{value:!0});Xd.default=t5;var P1=e5(O1());function t5(t,e){if(t){e.then(function(r){(0,P1.default)(function(){t(null,r)})},function(r){(0,P1.default)(function(){t(r)})});return}else return e}});var N1=V(ke=>{"use strict";var r5=ke&&ke.__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]})),n5=ke&&ke.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),i5=ke&&ke.__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"&&r5(r,e,n[i]);return n5(r,e),r}})(),el=ke&&ke.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ke,"__esModule",{value:!0});ke.getJsonSchemaRefParserDefaultOptions=ke.jsonSchemaParserNormalizeArgs=ke.dereferenceInternal=ke.JSONParserErrorGroup=ke.isHandledError=ke.UnmatchedParserError=ke.ParserError=ke.ResolverError=ke.MissingPointerError=ke.InvalidPointerError=ke.JSONParserError=ke.UnmatchedResolverError=ke.dereference=ke.bundle=ke.resolve=ke.parse=ke.$RefParser=void 0;var A1=el(MT()),s5=el(NR()),ep=el(v1());ke.jsonSchemaParserNormalizeArgs=ep.default;var o5=el(b1()),a5=el(_1()),$1=el(I1());ke.dereferenceInternal=$1.default;var Xa=i5(zn()),Gn=Jn();Object.defineProperty(ke,"JSONParserError",{enumerable:!0,get:function(){return Gn.JSONParserError}});Object.defineProperty(ke,"InvalidPointerError",{enumerable:!0,get:function(){return Gn.InvalidPointerError}});Object.defineProperty(ke,"MissingPointerError",{enumerable:!0,get:function(){return Gn.MissingPointerError}});Object.defineProperty(ke,"ResolverError",{enumerable:!0,get:function(){return Gn.ResolverError}});Object.defineProperty(ke,"ParserError",{enumerable:!0,get:function(){return Gn.ParserError}});Object.defineProperty(ke,"UnmatchedParserError",{enumerable:!0,get:function(){return Gn.UnmatchedParserError}});Object.defineProperty(ke,"UnmatchedResolverError",{enumerable:!0,get:function(){return Gn.UnmatchedResolverError}});Object.defineProperty(ke,"isHandledError",{enumerable:!0,get:function(){return Gn.isHandledError}});Object.defineProperty(ke,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Gn.JSONParserErrorGroup}});var T1=Ao(),Ci=el(k1()),l5=vx();Object.defineProperty(ke,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return l5.getJsonSchemaRefParserDefaultOptions}});var Mo=class t{constructor(){this.schema=null,this.$refs=new A1.default}async parse(){let e=(0,ep.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,T1.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Ci.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new A1.default;let n="http";if(Xa.isFileSystemPath(e.path))e.path=Xa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Xa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Xa.resolve(Xa.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,s5.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,Ci.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Ci.default)(e.callback,Promise.resolve(this.schema));throw T1.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Gn.isHandledError)(i)?(0,Ci.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Xa.stripHash(e.path)]&&this.$refs._$refs[Xa.stripHash(e.path)].addError(i),(0,Ci.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,ep.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,o5.default)(this,e.options),Cx(this),(0,Ci.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,Ci.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,ep.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,a5.default)(this,e.options),Cx(this),(0,Ci.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Ci.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,ep.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,$1.default)(this,e.options),Cx(this),(0,Ci.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Ci.default)(e.callback,Promise.reject(r))}}};ke.$RefParser=Mo;ke.default=Mo;function Cx(t){if(Gn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Gn.JSONParserErrorGroup(t)}ke.parse=Mo.parse;ke.resolve=Mo.resolve;ke.bundle=Mo.bundle;ke.dereference=Mo.dereference});var cy,ec,Ex=le(()=>{"use strict";cy=Qc(N1()),ec=class{async resolve(e){try{return await cy.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 cy.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await cy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as M1 from"fs";var F1,u5,Fo,fy=le(()=>{"use strict";F1=Qc(Dd());jn();dR();Ex();u5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Fo=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new ju,this.refResolver=new ec}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await M1.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=F1.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",c={id:Pt(o),name:o,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(c.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(c.auth=m)}let d=new Map;if(i.tags)for(let m of i.tags){let y={type:"folder",id:Pt(m.name),name:m.name,description:m.description,items:[]};d.set(m.name,y),c.items.push(y)}if(i.paths)for(let[m,y]of Object.entries(i.paths))for(let b of["get","post","put","patch","delete","head","options","trace"]){let q=y[b];if(!q)continue;let x=this.processOperation(b,m,q,y,i,s),v=q.tags?.[0];if(v&&d.has(v))d.get(v).items.push(x);else if(v){let _={type:"folder",id:Pt(v),name:v,items:[x]};d.set(v,_),c.items.push(_)}else c.items.push(x)}await this.collectionService.saveCollection(c);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:c,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=Pt(n.operationId||`${e}-${r}`),c=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(d=`[DEPRECATED] ${d}`);let m={type:"request",id:l,name:d,method:e.toUpperCase(),url:c,description:n.description||"",deprecated:p},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,y,o),n.requestBody&&this.processRequestBody(m,n.requestBody,o),n.responses&&(m.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let b=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);b&&(m.auth=b)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let c of r){let d=c.name,p=c.in,m=c.schema||{},y=c.example!==void 0?String(c.example):this.generateExampleForParam(m,n),b=c.deprecated===!0;switch(p){case"path":{if(c.description||m.type||m.format||m.enum||b||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:y};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),c.description&&(x.description=c.description),b&&(x.deprecated=!0),o[d]=x}else o[d]=y;break}case"query":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),s.push(q);break}case"header":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),i.push(q);break}case"cookie":{l.push(`${d}={{${d}}}`);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:c}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...c&&{format:c},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 d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of u5)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 c=l,d=c.type==="string"&&c.format==="binary",p={key:o,value:d?"":String(this.exampleGenerator.generate(c,{components:r})||""),type:d?"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 c of i){let d=e.content[c],p={};d.schema&&(p.schema=d.schema),d.examples&&(p.examples=d.examples),d.encoding&&(p.encoding=d.encoding),o.content[c]=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,c={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let p=d[0],m=l.content[p];c.contentType=p,m.schema&&(c.schema=m.schema),m.examples&&(c.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{c.content={};for(let p of d){let m=l.content[p],y={};m.schema&&(y.schema=m.schema),m.examples&&(y.examples=m.examples),c.content[p]=y,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(l.headers){c.headers={};for(let[d,p]of Object.entries(l.headers)){let m=p;c.headers[d]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=c}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 tc,qx=le(()=>{"use strict";tc=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 c=e;if(typeof e=="string")try{c=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(c),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,c=i?`${i}.${s}`:s,d=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[c];e.properties[l]={type:p||"string"};return}if(d.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,d,n,c)}}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 D1,dy,j1,L1,U1,H1,B1,rc,Ix=le(()=>{"use strict";D1=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,dy="(?:pm|hf|ctx)",j1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),L1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),U1=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,H1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),B1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),rc=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(D1.source,D1.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(j1.source,j1.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(L1.source,L1.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(H1.source,H1.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(B1.source,B1.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(U1.source,U1.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 V1={};io(V1,{AwsSecretResolver:()=>py});var py,Ox=le(()=>{"use strict";py=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=>wt(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"),c=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),d=c.SecretString??(c.SecretBinary?Buffer.from(c.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let p=JSON.parse(d);return p[i]!==void 0?String(p[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var W1={};io(W1,{AzureKeyVaultResolver:()=>hy});var hy,Px=le(()=>{"use strict";hy=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=>wt(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 z1={};io(z1,{HashiCorpVaultResolver:()=>my});var my,kx=le(()=>{"use strict";my=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 c;try{c=await fetch(o,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(c.status===404)return;if(!c.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${c.status} for path: ${n}`);let p=(await c.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 m=Object.keys(p);return m.length===1?String(p[m[0]]):void 0}}});var J1={};io(J1,{OnePasswordResolver:()=>gy});import{execFile as c5}from"child_process";import{promisify as f5}from"util";var d5,gy,Ax=le(()=>{"use strict";d5=f5(c5),gy=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}=wt("@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 d5("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 G1={};io(G1,{GcpSecretResolver:()=>yy});var yy,Tx=le(()=>{"use strict";yy=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=>wt(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}`,[c]=await o.accessSecretVersion({name:l}),d=c.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var K1={};io(K1,{DopplerResolver:()=>vy});import*as Y1 from"https";var vy,$x=le(()=>{"use strict";vy=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=Y1.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},c=>{let d=[];c.on("data",p=>d.push(p)),c.on("end",()=>{let p=Buffer.concat(d).toString("utf-8");if(c.statusCode===404){s(void 0);return}if(c.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${c.statusCode} for secret "${r}": ${p}`));return}try{let y=JSON.parse(p)?.value?.computed;s(y!=null?String(y):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});import*as by from"fs";import{createRequire as p5}from"module";import*as Q1 from"path";var tp,Nx=le(()=>{"use strict";tp=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),c=l.indexOf("/");if(c<0)return;let d=l.slice(0,c),p=l.slice(c+1),m=this.resolvers.get(d);if(m)try{let y=await m.resolve(p);y!==void 0&&n.set(o,y)}catch(y){let b=y?.message??String(y);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${b}`)}}));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(),Ql(V1));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(Px(),Ql(W1));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(kx(),Ql(z1));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(Ax(),Ql(J1));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(Tx(),Ql(G1));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=($x(),Ql(K1));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>wt(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=Q1.resolve(i,"package.json");if(by.existsSync(s)){let o=by.realpathSync(s),l=p5(o);return c=>{try{return l(c)}catch{return r(c)}}}}catch{}return r}}});function Sr(t){return t.replace(/\//g,"%2F")}function Z1(t){return t.replace(/%2F/gi,"/")}function Ts(t){return t?t.split("/").map(Z1).join(" / "):""}function Sy(t){return t.includes(" / ")?t.split(" / ").map(e=>Sr(e.trim())).join("/"):Sr(t)}function st(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=Sr(s.name),l=r?`${r}/${o}`:o;n.push(...st(t,s.items??[],l))}return n}function fn(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=Sr(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:Mx(s.items??[])}),n.push(...fn(t,s.items??[],l))}return n}function Mx(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Mx(r.items??[]);return e}var Ei=le(()=>{"use strict"});var tl,Fx=le(()=>{"use strict";tl={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as vt from"fs";import*as qi from"path";var rp,Dx=le(()=>{"use strict";Ei();jn();Fx();rp=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(){vt.existsSync(this.suitesDir)||vt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=vt.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(),!vt.existsSync(this.suitesDir))return;let e=vt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=qi.join(this.suitesDir,r),i=vt.readFileSync(n,"utf-8"),s=JSON.parse(i),o=Array.isArray(s.nodes)&&s.nodes.length>0?s.nodes:(Array.isArray(s.requests)?s.requests:[]).map(c=>({type:"request",name:c.description||c.name,request:c,enabled:c.enabled!==!1})),l={id:s.id,name:s.name,description:s.description,scripts:s.scripts,nodes:o,config:s.config??{...tl},isTemporary:s.isTemporary,createdAt:s.createdAt??Date.now(),updatedAt:s.updatedAt??Date.now()};l.id&&l.name&&this.suites.set(l.id,l)}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){let r=Date.now(),n={id:Pt(e),name:e,nodes:[],config:{...tl},createdAt:r,updatedAt:r};return await this.saveSuiteToDisk(n),this.suites.set(n.id,n),n}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=n.nodes||[],s=await this.createSuite(r);s.nodes=i.map(c=>({...c})),s.config={...n.config},s.description=n.description;let o=qi.join(this.suitesDir,e),l=qi.join(this.suitesDir,s.id);return vt.existsSync(o)&&this.copyDirRecursive(o,l),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}copyDirRecursive(e,r){vt.existsSync(r)||vt.mkdirSync(r,{recursive:!0});for(let n of vt.readdirSync(e,{withFileTypes:!0})){let i=qi.join(e,n.name),s=qi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):vt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=qi.join(this.suitesDir,n),s=qi.join(this.suitesDir,r.id);try{return vt.existsSync(i)&&vt.unlinkSync(i),vt.existsSync(s)&&vt.rmSync(s,{recursive:!0,force:!0}),this.suites.delete(e),!0}catch(o){return console.error("[TestSuiteService] Failed to delete suite:",o),!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=n.map(l=>({type:"request",name:l.description||l.name,request:l,enabled:l.enabled!==!1})),s=Date.now();return{id:`temp-${e}`,name:r.name,nodes:i,config:{...tl},isTemporary:!0,createdAt:s,updatedAt:s}}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(m=>n?m.folderPath===o||m.folderPath.startsWith(`${o}/`):m.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let c=l.map(m=>({type:"request",name:m.description||m.name,request:m,enabled:m.enabled!==!1})),d=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${Ts(o)}`,nodes:c,config:{...tl},isTemporary:!0,createdAt:d,updatedAt:d}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i=qi.join(this.suitesDir,e.id),s={...e,id:Pt(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n},o=qi.join(this.suitesDir,s.id);return vt.existsSync(i)&&(vt.existsSync(o)&&vt.rmSync(o,{recursive:!0,force:!0}),vt.renameSync(i,o)),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}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}/${Sr(o.name)}`:Sr(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}/${Sr(o.name)}`:Sr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=qi.join(this.suitesDir,r),i=`${n}.tmp-${process.pid}-${Date.now()}`,s={id:e.id,name:e.name,description:e.description,scripts:e.scripts,nodes:Array.isArray(e.nodes)?e.nodes:[],config:e.config??{...tl},isTemporary:e.isTemporary,createdAt:e.createdAt??Date.now(),updatedAt:e.updatedAt??Date.now()},o=JSON.stringify(s,null,2);vt.writeFileSync(i,o,"utf-8"),vt.renameSync(i,n)}}});var ae,wy=le(()=>{"use strict";ae={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});import*as X1 from"path";function _y(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:c,applicationInfo:d,consoleService:p}=e;t.registerValue(ae.WorkspaceFolder,r),t.registerSingleton(ae.Config,()=>new vo(r,n,i)),t.registerSingleton(ae.Console,()=>p??h5),t.registerSingleton(ae.EnvironmentConfig,y=>new rd(r,s,y.resolve(ae.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ae.Cookie,()=>new Xf(o)),t.registerSingleton(ae.Collection,y=>new Zf(r,y.resolve(ae.Config),n)),t.registerSingleton(ae.TestSuite,y=>new rp(y.resolve(ae.Collection),y.resolve(ae.Config))),t.registerSingleton(ae.HttpClient,y=>{let b=y.resolve(ae.Config);return new Na(b.getRequestConfig(),r)}),t.registerSingleton(ae.UrlBuilder,()=>new li),t.registerSingleton(ae.InterceptorChain,()=>new bs),t.registerSingleton(ae.HttpRequest,y=>new vs(y.resolve(ae.UrlBuilder),y.resolve(ae.InterceptorChain),y.resolve(ae.HttpClient))),t.registerSingleton(ae.RequestPreprocessor,()=>new Ma),t.registerSingleton(ae.RequestHistory,y=>{let b=y.resolve(ae.EnvironmentConfig);return new ad(b.getHistoriesPath(),X1.join(b.getRootPath(),"shared-histories"))}),l&&c&&t.registerSingleton(ae.OAuth2TokenManager,y=>new Yf(l,c,y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest))),t.registerSingleton(ae.GraphQLSchemaService,y=>new id(y.resolve(ae.HttpClient))),t.registerSingleton(ae.SecretResolverRegistry,y=>new tp(y.resolve(ae.Config)));let m=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ae.RequestPreparer,y=>new nd(y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest),y.resolve(ae.RequestPreprocessor),y.has(ae.OAuth2TokenManager)?y.resolve(ae.OAuth2TokenManager):void 0,m,y.resolve(ae.SecretResolverRegistry))),t.registerSingleton(ae.ScriptExecutor,y=>{let b=y.resolve(ae.Config);return new xs(y.resolve(ae.HttpRequest),b.getModulePaths(),y.resolve(ae.SecretResolverRegistry),b.getScriptScope(),b.getScriptTimeout())}),t.registerSingleton(ae.DataFileParser,()=>new Da),t.registerSingleton(ae.CollectionRequestExecutor,y=>new bo(y.resolve(ae.HttpRequest),y.resolve(ae.ScriptExecutor),y.resolve(ae.EnvironmentConfig),y.resolve(ae.RequestPreparer),"")),t.registerSingleton(ae.PersistentCookieJar,y=>new ed(y.resolve(ae.Cookie))),t.registerSingleton(ae.SchemaInferrer,()=>new ko),t.registerSingleton(ae.HistoryAnalyzer,y=>new Eu(y.resolve(ae.RequestHistory),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.ScriptAnalyzer,()=>new rc),t.registerSingleton(ae.SchemaInferenceService,y=>new tc(y.resolve(ae.HistoryAnalyzer),y.resolve(ae.ScriptAnalyzer),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.OpenApiExporter,y=>new Du(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig),y.resolve(ae.SchemaInferenceService))),t.registerSingleton(ae.OpenApiImporter,y=>new Fo(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig)))}var h5,jx=le(()=>{"use strict";c0();m0();km();y0();v0();S0();Tm();w0();_0();O0();cf();ff();Jf();qm();Xl();P0();fR();fy();qx();Ng();Ix();Im();Vf();Nx();Dx();wy();h5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function eN(){return rl.instance}var rl,Lx=le(()=>{"use strict";wy();rl=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(ae.Config)}get console(){return this.resolve(ae.Console)}get environmentConfig(){return this.resolve(ae.EnvironmentConfig)}get collection(){return this.resolve(ae.Collection)}get httpRequest(){return this.resolve(ae.HttpRequest)}get httpClient(){return this.resolve(ae.HttpClient)}get cookie(){return this.resolve(ae.Cookie)}get requestHistory(){return this.resolve(ae.RequestHistory)}get dataFileParser(){return this.resolve(ae.DataFileParser)}get scriptExecutor(){return this.resolve(ae.ScriptExecutor)}get requestPreparer(){return this.resolve(ae.RequestPreparer)}get persistentCookieJar(){return this.resolve(ae.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ae.OAuth2TokenManager)?this.resolve(ae.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ae.GraphQLSchemaService)}get testSuite(){return this.resolve(ae.TestSuite)}}});function tN(t){return/\{\{[^}]+\}\}/.test(t)}function np(t,e=16){return!!t&&t.length>=e&&!tN(t)}function Ux(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function ip(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(c=>`${c.requestId}::${c.field}`===l)||o.occurrences.push(i)}function Ry(t,e=1){let r=st(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 c=l.key.toLowerCase(),d=l.value;if(c==="authorization"){let p=d.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&np(p[2])?ip(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):np(d)&&ip(n,d,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else m5.has(c)&&np(d)?ip(n,d,Ux(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):np(d,20)&&!d.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(d)&&ip(n,d,Ux(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&&g5.has(l.key.toLowerCase())&&np(l.value)&&ip(n,l.value,Ux(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||tN(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let c=`${o.protocol}//${o.host}`,d=i.get(c)??[];d.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(c,d)}}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 Hx(t,e){let r={};return rN(t,e,r),r}function rN(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&rN(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 c=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&c[2]===s.value?(l.value=`${c[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 m5,g5,Bx=le(()=>{"use strict";Ei();m5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),g5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function zr(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Vx(t,e,r){let n=i=>zr("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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.'},...xy.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.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").'},...Ey.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Cy.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:zr("Name of the test suite to run.",r),...qy.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.getSuite}`,description:"Get full details of a test suite including flow nodes (suite.nodes) and a flattened request list.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.createSuite}`,description:"Create a new test suite (empty, pre-populated from a collection/folder, or initialized with an explicit flow nodes graph).",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."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph. If provided, this becomes the suite flow definition."},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}${G.updateSuiteConfig}`,description:"Change a suite's name/description/run configuration and optionally replace the full suite.nodes flow graph.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph replacement."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getSuiteNode}`,description:'Get a single suite flow node by path (for example: "2.then.0" or "1.cases.0.nodes.1").',inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),path:{type:"string",description:"Node path to read (dot notation)."}},required:["suite","path"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.listSuiteNodePaths}`,description:"List all node paths and editable branch-array paths for a suite flow graph. Use before add/update/remove/move_suite_node.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),includeBranches:{type:"boolean",description:"Include branch-array paths (default: true)."}},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.addSuiteNode}`,description:"Add a flow node to a suite. Insert at root or into a branch array of a parent node.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),node:{type:"object",description:"Node object to insert (request/script/if/switch/for/while/block)."},parentPath:{type:"string",description:'Optional parent node path (for example: "2" or "1.cases.0"). Omit to insert at root.'},branch:{type:"string",description:'Branch array on parent node (for example: "nodes", "then", "else", "default", "cases.0.nodes"). Required when parentPath is provided.'},index:{type:"number",description:"Optional insertion index inside target array. Omit to append."}},required:["suite","node"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateSuiteNode}`,description:"Replace a flow node at a specific path in suite.nodes.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),path:{type:"string",description:'Node path to replace (for example: "0" or "2.then.1").'},node:{type:"object",description:"Full replacement node object."}},required:["suite","path","node"]},annotations:{idempotentHint:!0}},{name:`${t}${G.removeSuiteNode}`,description:"Remove a flow node at a specific path from suite.nodes.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),path:{type:"string",description:'Node path to remove (for example: "0" or "2.else.0").'}},required:["suite","path"]},annotations:{destructiveHint:!0}},{name:`${t}${G.moveSuiteNode}`,description:"Move a flow node from one path to another parent/branch/index within suite.nodes.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),fromPath:{type:"string",description:'Source node path (for example: "1.then.0").'},toParentPath:{type:"string",description:"Optional destination parent node path. Omit to move to root."},toBranch:{type:"string",description:"Destination branch array on parent node. Required when toParentPath is provided."},toIndex:{type:"number",description:"Optional destination index in target array. Omit to append."}},required:["suite","fromPath"]},annotations:{idempotentHint:!1}},{name:`${t}${G.addSuiteRequests}`,description:'Legacy compatibility helper. Add one or more request nodes at the suite root, using the same insertion semantics as add_suite_node with type:"request".',inputSchema:{type:"object",properties:{suite:zr("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 root nodes-array index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${G.removeSuiteRequest}`,description:"Remove a request from a request-only root suite by position (0-based) or by name. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:zr("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}${G.reorderSuiteRequests}`,description:"Reorder requests in a request-only root suite. Requests not listed are moved to the end. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:zr("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}${G.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:zr("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}${G.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:zr("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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.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}${G.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}${G.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}${G.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
279
+ `)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,oy.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Qd.resolve(t.href,i.headers.location);return p1(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new d1.ResolverError((0,oy.ono)(i,`Error downloading ${t.href}`),t.href)}}async function w8(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 vx=V(As=>{"use strict";var Zu=As&&As.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(As,"__esModule",{value:!0});As.getNewOptions=As.getJsonSchemaRefParserDefaultOptions=void 0;var _8=Zu(UT()),R8=Zu(s1()),x8=Zu(o1()),C8=Zu(a1()),E8=Zu(f1()),q8=Zu(h1()),I8=()=>({parse:{json:{..._8.default},yaml:{...R8.default},text:{...x8.default},binary:{...C8.default}},resolve:{file:{...E8.default},http:{...q8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});As.getJsonSchemaRefParserDefaultOptions=I8;var O8=t=>{let e=(0,As.getJsonSchemaRefParserDefaultOptions)();return t&&g1(e,t),e};As.getNewOptions=O8;function g1(t,e){if(m1(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];m1(s)?t[i]=g1(o||{},s):s!==void 0&&(t[i]=s)}}return t}function m1(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var v1=V(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.normalizeArgs=y1;var P8=vx();function y1(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,P8.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}}ay.default=y1});var b1=V(_i=>{"use strict";var k8=_i&&_i.__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]})),A8=_i&&_i.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),T8=_i&&_i.__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"&&k8(r,e,n[i]);return A8(r,e),r}})(),bx=_i&&_i.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_i,"__esModule",{value:!0});var $8=bx(Vu()),N8=bx(Ld()),M8=bx(NR()),Xu=T8(zn()),F8=Jn();function D8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=Sx(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function Sx(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),$8.default.isExternal$Ref(t)&&o.push(j8(t,e,r,n));let l=Object.keys(t);for(let c of l){let d=N8.default.join(e,c),p=t[c];o=o.concat(Sx(p,d,r,n,i,s))}}return o}async function j8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Xu.resolve(i?Xu.cwd():e,t.$ref),o=Xu.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let c=await(0,M8.default)(s,r,n),d=Sx(c,o+"#",r,n,new Set,!0);return Promise.all(d)}catch(c){if(!n?.continueOnError||!(0,F8.isHandledError)(c))throw c;return r._$refs[o]&&(c.source=decodeURI(Xu.stripHash(e)),c.path=Xu.safePointerToPath(Xu.getHash(e))),[]}}_i.default=D8});var _1=V(Ri=>{"use strict";var L8=Ri&&Ri.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),U8=Ri&&Ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),H8=Ri&&Ri.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&L8(r,e,n[i]);return U8(r,e),r}})(),w1=Ri&&Ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ri,"__esModule",{value:!0});var ly=w1(Vu()),Zd=w1(Ld()),wx=H8(zn());function B8(t,e){let r=[];_x(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),V8(r)}function _x(t,e,r,n,i,s,o,l){let c=e===null?t:t[e];if(c&&typeof c=="object"&&!ArrayBuffer.isView(c))if(ly.default.isAllowed$Ref(c))S1(t,e,r,n,i,s,o,l);else{let d=Object.keys(c).sort((p,m)=>p==="definitions"?-1:m==="definitions"?1:p.length-m.length);for(let p of d){let m=Zd.default.join(r,p),y=Zd.default.join(n,p),b=c[p];ly.default.isAllowed$Ref(b)?S1(c,p,r,y,i,s,o,l):_x(c,p,m,y,i,s,o,l)}}}function S1(t,e,r,n,i,s,o,l){let c=e===null?t:t[e],d=wx.resolve(r,c.$ref),p=o._resolve(d,n,l);if(p===null)return;let y=Zd.default.parse(n).length,b=wx.stripHash(p.path),q=wx.getHash(p.path),x=b!==o._root$Ref.path,v=ly.default.isExtended$Ref(c);i+=p.indirections;let R=W8(s,t,e);if(R)if(y<R.depth||i<R.indirections)z8(s,R);else return;s.push({$ref:c,parent:t,key:e,pathFromRoot:n,depth:y,file:b,hash:q,value:p.value,circular:p.circular,extended:v,external:x,indirections:i}),(!R||x)&&_x(p.value,null,p.path,n,i+1,s,o,l)}function V8(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=Zd.default.join(n,Zd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=ly.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function W8(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)}Ri.default=B8});var I1=V(xi=>{"use strict";var J8=xi&&xi.__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]})),G8=xi&&xi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xi&&xi.__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"&&J8(r,e,n[i]);return G8(r,e),r}})(),E1=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xi,"__esModule",{value:!0});var uy=E1(Vu()),R1=E1(Ld()),K8=Ao(),x1=Y8(zn()),Q8=Jn();xi.default=Z8;function Z8(t,e){let r=Date.now(),n=Rx(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 Rx(t,e,r,n,i,s,o,l,c){let d,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-c>l.timeoutMs)throw new Q8.TimeoutError(l.timeoutMs);let m=l.dereference||{},y=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),uy.default.isAllowed$Ref(t,l))d=C1(t,e,r,n,i,s,o,l,c),p.circular=d.circular,p.value=d.value;else for(let b of Object.keys(t)){let q=R1.default.join(e,b),x=R1.default.join(r,b);if(y(x))continue;let v=t[b],R=!1;if(uy.default.isAllowed$Ref(v,l)){if(d=C1(v,q,x,n,i,s,o,l,c),R=d.circular,t[b]!==d.value){let E=new Map;m?.preservedProperties&&typeof t[b]=="object"&&!Array.isArray(t[b])&&m?.preservedProperties.forEach(k=>{k in t[b]&&E.set(k,t[b][k])}),t[b]=d.value,m?.preservedProperties&&E.size&&typeof t[b]=="object"&&!Array.isArray(t[b])&&E.forEach((k,P)=>{t[b][P]=k}),m?.onDereference?.(v.$ref,t[b],t,b)}}else n.has(v)?R=q1(q,o,l):(d=Rx(v,q,x,n,i,s,o,l,c),R=d.circular,t[b]!==d.value&&(t[b]=d.value));p.circular=p.circular||R}n.delete(t)}return p}function C1(t,e,r,n,i,s,o,l,c){let p=uy.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",m=x1.resolve(p?x1.cwd():e,t.$ref),y=s.get(m);if(y&&!y.circular){let E=Object.keys(t);if(E.length>1){let k={};for(let P of E)P!=="$ref"&&!(P in y.value)&&(k[P]=t[P]);return{circular:y.circular,value:Object.assign({},y.value,k)}}return y}let b=o._resolve(m,e,l);if(b===null)return{circular:!1,value:null};let q=b.circular,x=q||n.has(b.value);x&&q1(e,o,l);let v=uy.default.dereference(t,b.value);if(!x){let E=Rx(v,b.path,r,n,i,s,o,l,c);x=E.circular,v=E.value}x&&!q&&l.dereference?.circular==="ignore"&&(v=t),q&&(v.$ref=r);let R={circular:x,value:v};return Object.keys(t).length===1&&s.set(m,R),R}function q1(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw K8.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var O1=V(xx=>{"use strict";Object.defineProperty(xx,"__esModule",{value:!0});function X8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}xx.default=X8()});var k1=V(Xd=>{"use strict";var e5=Xd&&Xd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xd,"__esModule",{value:!0});Xd.default=t5;var P1=e5(O1());function t5(t,e){if(t){e.then(function(r){(0,P1.default)(function(){t(null,r)})},function(r){(0,P1.default)(function(){t(r)})});return}else return e}});var N1=V(ke=>{"use strict";var r5=ke&&ke.__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]})),n5=ke&&ke.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),i5=ke&&ke.__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"&&r5(r,e,n[i]);return n5(r,e),r}})(),el=ke&&ke.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ke,"__esModule",{value:!0});ke.getJsonSchemaRefParserDefaultOptions=ke.jsonSchemaParserNormalizeArgs=ke.dereferenceInternal=ke.JSONParserErrorGroup=ke.isHandledError=ke.UnmatchedParserError=ke.ParserError=ke.ResolverError=ke.MissingPointerError=ke.InvalidPointerError=ke.JSONParserError=ke.UnmatchedResolverError=ke.dereference=ke.bundle=ke.resolve=ke.parse=ke.$RefParser=void 0;var A1=el(MT()),s5=el(NR()),ep=el(v1());ke.jsonSchemaParserNormalizeArgs=ep.default;var o5=el(b1()),a5=el(_1()),$1=el(I1());ke.dereferenceInternal=$1.default;var Xa=i5(zn()),Gn=Jn();Object.defineProperty(ke,"JSONParserError",{enumerable:!0,get:function(){return Gn.JSONParserError}});Object.defineProperty(ke,"InvalidPointerError",{enumerable:!0,get:function(){return Gn.InvalidPointerError}});Object.defineProperty(ke,"MissingPointerError",{enumerable:!0,get:function(){return Gn.MissingPointerError}});Object.defineProperty(ke,"ResolverError",{enumerable:!0,get:function(){return Gn.ResolverError}});Object.defineProperty(ke,"ParserError",{enumerable:!0,get:function(){return Gn.ParserError}});Object.defineProperty(ke,"UnmatchedParserError",{enumerable:!0,get:function(){return Gn.UnmatchedParserError}});Object.defineProperty(ke,"UnmatchedResolverError",{enumerable:!0,get:function(){return Gn.UnmatchedResolverError}});Object.defineProperty(ke,"isHandledError",{enumerable:!0,get:function(){return Gn.isHandledError}});Object.defineProperty(ke,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Gn.JSONParserErrorGroup}});var T1=Ao(),Ci=el(k1()),l5=vx();Object.defineProperty(ke,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return l5.getJsonSchemaRefParserDefaultOptions}});var Mo=class t{constructor(){this.schema=null,this.$refs=new A1.default}async parse(){let e=(0,ep.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,T1.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Ci.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new A1.default;let n="http";if(Xa.isFileSystemPath(e.path))e.path=Xa.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Xa.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Xa.resolve(Xa.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,s5.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,Ci.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Ci.default)(e.callback,Promise.resolve(this.schema));throw T1.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Gn.isHandledError)(i)?(0,Ci.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Xa.stripHash(e.path)]&&this.$refs._$refs[Xa.stripHash(e.path)].addError(i),(0,Ci.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,ep.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,o5.default)(this,e.options),Cx(this),(0,Ci.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,Ci.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,ep.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,a5.default)(this,e.options),Cx(this),(0,Ci.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Ci.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,ep.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,$1.default)(this,e.options),Cx(this),(0,Ci.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Ci.default)(e.callback,Promise.reject(r))}}};ke.$RefParser=Mo;ke.default=Mo;function Cx(t){if(Gn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Gn.JSONParserErrorGroup(t)}ke.parse=Mo.parse;ke.resolve=Mo.resolve;ke.bundle=Mo.bundle;ke.dereference=Mo.dereference});var cy,ec,Ex=le(()=>{"use strict";cy=Qc(N1()),ec=class{async resolve(e){try{return await cy.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 cy.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await cy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as M1 from"fs";var F1,u5,Fo,fy=le(()=>{"use strict";F1=Qc(Dd());jn();dR();Ex();u5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Fo=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new ju,this.refResolver=new ec}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await M1.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=F1.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",c={id:Pt(o),name:o,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(c.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(c.auth=m)}let d=new Map;if(i.tags)for(let m of i.tags){let y={type:"folder",id:Pt(m.name),name:m.name,description:m.description,items:[]};d.set(m.name,y),c.items.push(y)}if(i.paths)for(let[m,y]of Object.entries(i.paths))for(let b of["get","post","put","patch","delete","head","options","trace"]){let q=y[b];if(!q)continue;let x=this.processOperation(b,m,q,y,i,s),v=q.tags?.[0];if(v&&d.has(v))d.get(v).items.push(x);else if(v){let R={type:"folder",id:Pt(v),name:v,items:[x]};d.set(v,R),c.items.push(R)}else c.items.push(x)}await this.collectionService.saveCollection(c);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:c,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=Pt(n.operationId||`${e}-${r}`),c=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(d=`[DEPRECATED] ${d}`);let m={type:"request",id:l,name:d,method:e.toUpperCase(),url:c,description:n.description||"",deprecated:p},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,y,o),n.requestBody&&this.processRequestBody(m,n.requestBody,o),n.responses&&(m.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let b=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);b&&(m.auth=b)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let c of r){let d=c.name,p=c.in,m=c.schema||{},y=c.example!==void 0?String(c.example):this.generateExampleForParam(m,n),b=c.deprecated===!0;switch(p){case"path":{if(c.description||m.type||m.format||m.enum||b||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:y};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),c.description&&(x.description=c.description),b&&(x.deprecated=!0),o[d]=x}else o[d]=y;break}case"query":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),s.push(q);break}case"header":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),i.push(q);break}case"cookie":{l.push(`${d}={{${d}}}`);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:c}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...c&&{format:c},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 d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of u5)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 c=l,d=c.type==="string"&&c.format==="binary",p={key:o,value:d?"":String(this.exampleGenerator.generate(c,{components:r})||""),type:d?"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 c of i){let d=e.content[c],p={};d.schema&&(p.schema=d.schema),d.examples&&(p.examples=d.examples),d.encoding&&(p.encoding=d.encoding),o.content[c]=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,c={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let p=d[0],m=l.content[p];c.contentType=p,m.schema&&(c.schema=m.schema),m.examples&&(c.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{c.content={};for(let p of d){let m=l.content[p],y={};m.schema&&(y.schema=m.schema),m.examples&&(y.examples=m.examples),c.content[p]=y,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(l.headers){c.headers={};for(let[d,p]of Object.entries(l.headers)){let m=p;c.headers[d]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=c}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 tc,qx=le(()=>{"use strict";tc=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 c=e;if(typeof e=="string")try{c=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(c),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,c=i?`${i}.${s}`:s,d=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[c];e.properties[l]={type:p||"string"};return}if(d.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,d,n,c)}}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 D1,dy,j1,L1,U1,H1,B1,rc,Ix=le(()=>{"use strict";D1=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,dy="(?:pm|hf|ctx)",j1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),L1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),U1=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,H1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),B1=new RegExp(`${dy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),rc=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(D1.source,D1.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(j1.source,j1.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(L1.source,L1.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(H1.source,H1.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(B1.source,B1.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(U1.source,U1.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 V1={};io(V1,{AwsSecretResolver:()=>py});var py,Ox=le(()=>{"use strict";py=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=>wt(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"),c=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),d=c.SecretString??(c.SecretBinary?Buffer.from(c.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let p=JSON.parse(d);return p[i]!==void 0?String(p[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var W1={};io(W1,{AzureKeyVaultResolver:()=>hy});var hy,Px=le(()=>{"use strict";hy=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=>wt(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 z1={};io(z1,{HashiCorpVaultResolver:()=>my});var my,kx=le(()=>{"use strict";my=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 c;try{c=await fetch(o,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(c.status===404)return;if(!c.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${c.status} for path: ${n}`);let p=(await c.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 m=Object.keys(p);return m.length===1?String(p[m[0]]):void 0}}});var J1={};io(J1,{OnePasswordResolver:()=>gy});import{execFile as c5}from"child_process";import{promisify as f5}from"util";var d5,gy,Ax=le(()=>{"use strict";d5=f5(c5),gy=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}=wt("@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 d5("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 G1={};io(G1,{GcpSecretResolver:()=>yy});var yy,Tx=le(()=>{"use strict";yy=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=>wt(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}`,[c]=await o.accessSecretVersion({name:l}),d=c.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var K1={};io(K1,{DopplerResolver:()=>vy});import*as Y1 from"https";var vy,$x=le(()=>{"use strict";vy=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=Y1.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},c=>{let d=[];c.on("data",p=>d.push(p)),c.on("end",()=>{let p=Buffer.concat(d).toString("utf-8");if(c.statusCode===404){s(void 0);return}if(c.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${c.statusCode} for secret "${r}": ${p}`));return}try{let y=JSON.parse(p)?.value?.computed;s(y!=null?String(y):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});import*as by from"fs";import{createRequire as p5}from"module";import*as Q1 from"path";var tp,Nx=le(()=>{"use strict";tp=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),c=l.indexOf("/");if(c<0)return;let d=l.slice(0,c),p=l.slice(c+1),m=this.resolvers.get(d);if(m)try{let y=await m.resolve(p);y!==void 0&&n.set(o,y)}catch(y){let b=y?.message??String(y);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${b}`)}}));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(),Ql(V1));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(Px(),Ql(W1));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(kx(),Ql(z1));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(Ax(),Ql(J1));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(Tx(),Ql(G1));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=($x(),Ql(K1));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>wt(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=Q1.resolve(i,"package.json");if(by.existsSync(s)){let o=by.realpathSync(s),l=p5(o);return c=>{try{return l(c)}catch{return r(c)}}}}catch{}return r}}});function Sr(t){return t.replace(/\//g,"%2F")}function Z1(t){return t.replace(/%2F/gi,"/")}function Ts(t){return t?t.split("/").map(Z1).join(" / "):""}function Sy(t){return t.includes(" / ")?t.split(" / ").map(e=>Sr(e.trim())).join("/"):Sr(t)}function st(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=Sr(s.name),l=r?`${r}/${o}`:o;n.push(...st(t,s.items??[],l))}return n}function fn(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=Sr(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:Mx(s.items??[])}),n.push(...fn(t,s.items??[],l))}return n}function Mx(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Mx(r.items??[]);return e}var Ei=le(()=>{"use strict"});var tl,Fx=le(()=>{"use strict";tl={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as vt from"fs";import*as qi from"path";var rp,Dx=le(()=>{"use strict";Ei();jn();Fx();rp=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(){vt.existsSync(this.suitesDir)||vt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=vt.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(),!vt.existsSync(this.suitesDir))return;let e=vt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=qi.join(this.suitesDir,r),i=vt.readFileSync(n,"utf-8"),s=JSON.parse(i),o=Array.isArray(s.nodes)&&s.nodes.length>0?s.nodes:(Array.isArray(s.requests)?s.requests:[]).map(c=>({type:"request",name:c.description||c.name,request:c,enabled:c.enabled!==!1})),l={id:s.id,name:s.name,description:s.description,scripts:s.scripts,nodes:o,config:s.config??{...tl},isTemporary:s.isTemporary,createdAt:s.createdAt??Date.now(),updatedAt:s.updatedAt??Date.now()};l.id&&l.name&&this.suites.set(l.id,l)}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){let r=Date.now(),n={id:Pt(e),name:e,nodes:[],config:{...tl},createdAt:r,updatedAt:r};return await this.saveSuiteToDisk(n),this.suites.set(n.id,n),n}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=n.nodes||[],s=await this.createSuite(r);s.nodes=i.map(c=>({...c})),s.config={...n.config},s.description=n.description;let o=qi.join(this.suitesDir,e),l=qi.join(this.suitesDir,s.id);return vt.existsSync(o)&&this.copyDirRecursive(o,l),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}copyDirRecursive(e,r){vt.existsSync(r)||vt.mkdirSync(r,{recursive:!0});for(let n of vt.readdirSync(e,{withFileTypes:!0})){let i=qi.join(e,n.name),s=qi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):vt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=qi.join(this.suitesDir,n),s=qi.join(this.suitesDir,r.id);try{return vt.existsSync(i)&&vt.unlinkSync(i),vt.existsSync(s)&&vt.rmSync(s,{recursive:!0,force:!0}),this.suites.delete(e),!0}catch(o){return console.error("[TestSuiteService] Failed to delete suite:",o),!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=n.map(l=>({type:"request",name:l.description||l.name,request:l,enabled:l.enabled!==!1})),s=Date.now();return{id:`temp-${e}`,name:r.name,nodes:i,config:{...tl},isTemporary:!0,createdAt:s,updatedAt:s}}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(m=>n?m.folderPath===o||m.folderPath.startsWith(`${o}/`):m.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let c=l.map(m=>({type:"request",name:m.description||m.name,request:m,enabled:m.enabled!==!1})),d=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${Ts(o)}`,nodes:c,config:{...tl},isTemporary:!0,createdAt:d,updatedAt:d}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i=qi.join(this.suitesDir,e.id),s={...e,id:Pt(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n},o=qi.join(this.suitesDir,s.id);return vt.existsSync(i)&&(vt.existsSync(o)&&vt.rmSync(o,{recursive:!0,force:!0}),vt.renameSync(i,o)),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}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}/${Sr(o.name)}`:Sr(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}/${Sr(o.name)}`:Sr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=qi.join(this.suitesDir,r),i=`${n}.tmp-${process.pid}-${Date.now()}`,s={id:e.id,name:e.name,description:e.description,scripts:e.scripts,nodes:Array.isArray(e.nodes)?e.nodes:[],config:e.config??{...tl},isTemporary:e.isTemporary,createdAt:e.createdAt??Date.now(),updatedAt:e.updatedAt??Date.now()},o=JSON.stringify(s,null,2);vt.writeFileSync(i,o,"utf-8"),vt.renameSync(i,n)}}});var ae,wy=le(()=>{"use strict";ae={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});import*as X1 from"path";function _y(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:c,applicationInfo:d,consoleService:p}=e;t.registerValue(ae.WorkspaceFolder,r),t.registerSingleton(ae.Config,()=>new vo(r,n,i)),t.registerSingleton(ae.Console,()=>p??h5),t.registerSingleton(ae.EnvironmentConfig,y=>new rd(r,s,y.resolve(ae.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ae.Cookie,()=>new Xf(o)),t.registerSingleton(ae.Collection,y=>new Zf(r,y.resolve(ae.Config),n)),t.registerSingleton(ae.TestSuite,y=>new rp(y.resolve(ae.Collection),y.resolve(ae.Config))),t.registerSingleton(ae.HttpClient,y=>{let b=y.resolve(ae.Config);return new Na(b.getRequestConfig(),r)}),t.registerSingleton(ae.UrlBuilder,()=>new li),t.registerSingleton(ae.InterceptorChain,()=>new bs),t.registerSingleton(ae.HttpRequest,y=>new vs(y.resolve(ae.UrlBuilder),y.resolve(ae.InterceptorChain),y.resolve(ae.HttpClient))),t.registerSingleton(ae.RequestPreprocessor,()=>new Ma),t.registerSingleton(ae.RequestHistory,y=>{let b=y.resolve(ae.EnvironmentConfig);return new ad(b.getHistoriesPath(),X1.join(b.getRootPath(),"shared-histories"))}),l&&c&&t.registerSingleton(ae.OAuth2TokenManager,y=>new Yf(l,c,y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest))),t.registerSingleton(ae.GraphQLSchemaService,y=>new id(y.resolve(ae.HttpClient))),t.registerSingleton(ae.SecretResolverRegistry,y=>new tp(y.resolve(ae.Config)));let m=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ae.RequestPreparer,y=>new nd(y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest),y.resolve(ae.RequestPreprocessor),y.has(ae.OAuth2TokenManager)?y.resolve(ae.OAuth2TokenManager):void 0,m,y.resolve(ae.SecretResolverRegistry))),t.registerSingleton(ae.ScriptExecutor,y=>{let b=y.resolve(ae.Config);return new xs(y.resolve(ae.HttpRequest),b.getModulePaths(),y.resolve(ae.SecretResolverRegistry),b.getScriptScope(),b.getScriptTimeout())}),t.registerSingleton(ae.DataFileParser,()=>new Da),t.registerSingleton(ae.CollectionRequestExecutor,y=>new bo(y.resolve(ae.HttpRequest),y.resolve(ae.ScriptExecutor),y.resolve(ae.EnvironmentConfig),y.resolve(ae.RequestPreparer),"")),t.registerSingleton(ae.PersistentCookieJar,y=>new ed(y.resolve(ae.Cookie))),t.registerSingleton(ae.SchemaInferrer,()=>new ko),t.registerSingleton(ae.HistoryAnalyzer,y=>new Eu(y.resolve(ae.RequestHistory),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.ScriptAnalyzer,()=>new rc),t.registerSingleton(ae.SchemaInferenceService,y=>new tc(y.resolve(ae.HistoryAnalyzer),y.resolve(ae.ScriptAnalyzer),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.OpenApiExporter,y=>new Du(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig),y.resolve(ae.SchemaInferenceService))),t.registerSingleton(ae.OpenApiImporter,y=>new Fo(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig)))}var h5,jx=le(()=>{"use strict";c0();m0();km();y0();v0();S0();Tm();w0();_0();O0();cf();ff();Jf();qm();Xl();P0();fR();fy();qx();Ng();Ix();Im();Vf();Nx();Dx();wy();h5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function eN(){return rl.instance}var rl,Lx=le(()=>{"use strict";wy();rl=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(ae.Config)}get console(){return this.resolve(ae.Console)}get environmentConfig(){return this.resolve(ae.EnvironmentConfig)}get collection(){return this.resolve(ae.Collection)}get httpRequest(){return this.resolve(ae.HttpRequest)}get httpClient(){return this.resolve(ae.HttpClient)}get cookie(){return this.resolve(ae.Cookie)}get requestHistory(){return this.resolve(ae.RequestHistory)}get dataFileParser(){return this.resolve(ae.DataFileParser)}get scriptExecutor(){return this.resolve(ae.ScriptExecutor)}get requestPreparer(){return this.resolve(ae.RequestPreparer)}get persistentCookieJar(){return this.resolve(ae.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ae.OAuth2TokenManager)?this.resolve(ae.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ae.GraphQLSchemaService)}get testSuite(){return this.resolve(ae.TestSuite)}}});function tN(t){return/\{\{[^}]+\}\}/.test(t)}function np(t,e=16){return!!t&&t.length>=e&&!tN(t)}function Ux(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function ip(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(c=>`${c.requestId}::${c.field}`===l)||o.occurrences.push(i)}function Ry(t,e=1){let r=st(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 c=l.key.toLowerCase(),d=l.value;if(c==="authorization"){let p=d.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&np(p[2])?ip(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):np(d)&&ip(n,d,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else m5.has(c)&&np(d)?ip(n,d,Ux(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):np(d,20)&&!d.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(d)&&ip(n,d,Ux(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&&g5.has(l.key.toLowerCase())&&np(l.value)&&ip(n,l.value,Ux(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||tN(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let c=`${o.protocol}//${o.host}`,d=i.get(c)??[];d.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(c,d)}}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 Hx(t,e){let r={};return rN(t,e,r),r}function rN(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&rN(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 c=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&c[2]===s.value?(l.value=`${c[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 m5,g5,Bx=le(()=>{"use strict";Ei();m5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),g5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function zr(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Vx(t,e,r){let n=i=>zr("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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.'},...xy.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.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").'},...Ey.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Cy.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:zr("Name of the test suite to run.",r),...qy.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.getSuite}`,description:"Get full details of a test suite including flow nodes (suite.nodes) and a flattened request list.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.createSuite}`,description:"Create a new test suite (empty, pre-populated from a collection/folder, or initialized with an explicit flow nodes graph).",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."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph. If provided, this becomes the suite flow definition."},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}${G.updateSuiteConfig}`,description:"Change a suite's name/description/run configuration and optionally replace the full suite.nodes flow graph.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph replacement."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getSuiteNode}`,description:'Get a single suite flow node by path (for example: "2.then.0" or "1.cases.0.nodes.1").',inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),path:{type:"string",description:"Node path to read (dot notation)."}},required:["suite","path"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.listSuiteNodePaths}`,description:"List all node paths and editable branch-array paths for a suite flow graph. Use before add/update/remove/move_suite_node.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),includeBranches:{type:"boolean",description:"Include branch-array paths (default: true)."}},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.addSuiteNode}`,description:"Add a flow node to a suite. Insert at root or into a branch array of a parent node.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),node:{type:"object",description:"Node object to insert (request/script/if/switch/for/while/block)."},parentPath:{type:"string",description:'Optional parent node path (for example: "2" or "1.cases.0"). Omit to insert at root.'},branch:{type:"string",description:'Branch array on parent node (for example: "nodes", "then", "else", "default", "cases.0.nodes"). Required when parentPath is provided.'},index:{type:"number",description:"Optional insertion index inside target array. Omit to append."}},required:["suite","node"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateSuiteNode}`,description:"Replace a flow node at a specific path in suite.nodes.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),path:{type:"string",description:'Node path to replace (for example: "0" or "2.then.1").'},node:{type:"object",description:"Full replacement node object."}},required:["suite","path","node"]},annotations:{idempotentHint:!0}},{name:`${t}${G.removeSuiteNode}`,description:"Remove a flow node at a specific path from suite.nodes.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),path:{type:"string",description:'Node path to remove (for example: "0" or "2.else.0").'}},required:["suite","path"]},annotations:{destructiveHint:!0}},{name:`${t}${G.moveSuiteNode}`,description:"Move a flow node from one path to another parent/branch/index within suite.nodes.",inputSchema:{type:"object",properties:{suite:zr("Name or id of the suite.",r),fromPath:{type:"string",description:'Source node path (for example: "1.then.0").'},toParentPath:{type:"string",description:"Optional destination parent node path. Omit to move to root."},toBranch:{type:"string",description:"Destination branch array on parent node. Required when toParentPath is provided."},toIndex:{type:"number",description:"Optional destination index in target array. Omit to append."}},required:["suite","fromPath"]},annotations:{idempotentHint:!1}},{name:`${t}${G.addSuiteRequests}`,description:'Legacy compatibility helper. Add one or more request nodes at the suite root, using the same insertion semantics as add_suite_node with type:"request".',inputSchema:{type:"object",properties:{suite:zr("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 root nodes-array index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${G.removeSuiteRequest}`,description:"Remove a request from a request-only root suite by position (0-based) or by name. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:zr("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}${G.reorderSuiteRequests}`,description:"Reorder requests in a request-only root suite. Requests not listed are moved to the end. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:zr("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}${G.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:zr("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}${G.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:zr("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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.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}${G.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.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}${G.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}${G.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}${G.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
280
280
 
281
281
  Returns:
282
282
  \u2022 heuristicSuggestions \u2014 values identified by pattern-matching rules (ready to apply)
@@ -349,20 +349,20 @@ This tool returns request details AND a structured task. You MUST:
349
349
  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.
350
350
  4. Respond with the JSON array directly so the user can pass it to run_collection or the CLI --variables flag.
351
351
 
352
- 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 xy,Cy,Ey,qy,G,sp=le(()=>{"use strict";xy={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)"}}},Cy={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."}}},Ey={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."}}},qy={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)"}}},G={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",getSuiteNode:"get_suite_node",listSuiteNodePaths:"list_suite_node_paths",addSuiteNode:"add_suite_node",updateSuiteNode:"update_suite_node",removeSuiteNode:"remove_suite_node",moveSuiteNode:"move_suite_node",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"}});import*as op from"fs";import*as Zi from"path";function ue(t){return new Error(`Bad request: ${t}`)}function ot(t,e){if(typeof t!="string"||!t.trim())throw ue('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 ue(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Qi(t,e){if(typeof t!="string"||!t.trim())throw ue('the "request" argument is required');let r=st(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 ue(`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 nN(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=nN(n.items??[],e);if(i)return i}}async function En(t,e){if(typeof t!="string"||!t.trim())throw ue('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 ue(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function zx(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===G.listCollections)return{collections:s.map(v=>({name:v.name,id:v.id,description:v.description??"",requestCount:st(v).length}))};if(t===G.listFolders){let v=ot(e.collection,s);return{collection:v.name,folders:fn(v).map(({folderPath:_,requestCount:E})=>({path:Ts(_),requestCount:E}))}}if(t===G.listRequests){let v=ot(e.collection,s),_=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=typeof e.offset=="number"?Math.max(0,e.offset):0,k=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,P=st(v).filter(({folderPath:M})=>!_||M.toLowerCase().includes(_)).map(({request:M,folderPath:j})=>({id:M.id,name:M.name,method:M.method,folder:Ts(j),description:M.description??""}));return{collection:v.name,total:P.length,offset:E,limit:k,requests:P.slice(E,E+k)}}if(t===G.searchRequests){let v=ot(e.collection,s),_=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!_)throw ue('the "query" argument is required');let E=st(v).filter(({request:k,folderPath:P})=>k.name.toLowerCase().includes(_)||(k.url??"").toLowerCase().includes(_)||k.method.toLowerCase().includes(_)||P.toLowerCase().includes(_)||(k.description??"").toLowerCase().includes(_)).map(({request:k,folderPath:P})=>({id:k.id,name:k.name,method:k.method,url:k.url??"",folder:Ts(P),description:k.description??""}));return{collection:v.name,query:e.query,total:E.length,requests:E}}if(t===G.getRequest){let v=ot(e.collection,s),_=Qi(e.request,v),E=r.collection.getRequestScript(v.id,_.id,"pre-request")??"",k=r.collection.getRequestScript(v.id,_.id,"post-response")??"";return{id:_.id,name:_.name,method:_.method,url:_.url??"",description:_.description??"",headers:_.headers??[],body:_.body??null,auth:_.auth??null,scripts:{preRequest:E,postResponse:k},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===G.getEnvironment){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),_=r.environmentConfig.getResolvedEnvironment(v);if(!_)throw ue(`environment "${v}" not found`);return{name:_.name,variables:_.variables}}if(t===G.setVariable){let v=typeof e.key=="string"?e.key.trim():"",_=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(v,_,E),{set:!0,key:v,environment:E}}if(t===G.getRunStatus){let v=n.require(e.runId);return{runId:v.id,status:v.status,suiteName:v.suiteName,progress:v.progress,...v.error?{error:v.error}:{}}}if(t===G.getRunSummary){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress};let _=(v.summary.failed??0)>0||v.summary.allPassed===!1,E=v.noAssertionExamples??[],k=E.length,P=v.summary.total,M=k>0?k/(P||1)>.5?`${k}/${P} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${v.suiteName}") for a full coverage analysis.`:`${k} request(s) have no pm.test() assertions (e.g. ${E.slice(0,3).map(j=>`"${j}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${v.suiteName}") to add test coverage.`:null;return{runId:v.id,status:v.status,suiteName:v.suiteName,summary:v.summary,...v.reportPath?{report:{uri:`file://${v.reportPath}`}}:{},..._?{failedRequests:v.failedRequests}:{},..._?{_nextStep:`REQUIRED ACTION: ${v.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.`}:{},...M?{_suggestions:[M]}:{}}}if(t===G.getFailedRequests){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress,failedSoFar:v.failedRequests.length};let _=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:v.id,status:v.status,totalFailed:v.failedRequests.length,offset:_,limit:E,failedRequests:v.failedRequests.slice(_,_+E)}}if(t===G.getRequestResult){let v=n.require(e.runId),_=e.request;if(typeof _!="string"||!_)throw ue('"request" is required');let E=typeof e.iteration=="number"?e.iteration:1,k=v.allResults.find(P=>P.iteration===E&&(P.name===_||P.name.toLowerCase()===_.toLowerCase()));if(!k){if(v.status==="running")return{runId:v.id,status:"running",message:`Request "${_}" has not completed yet.`};throw new Error(`Request "${_}" (iteration ${E}) not found in run "${v.id}".`)}return{runId:v.id,...k}}if(t===G.cancelRun){let v=n.require(e.runId);if(v.status!=="running")return{runId:v.id,status:v.status,cancelled:!1,message:`Run is already "${v.status}" \u2014 nothing to cancel.`};let _=n.cancel(String(e.runId));return{runId:v.id,status:"cancelled",cancelled:_,progress:v.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===G.runRequest){let v=ot(e.collection,s),_=st(v),E=typeof e.requestId=="string"?e.requestId.trim():void 0,k=e.request,P;if(E){if(P=_.find(M=>M.request.id===E),!P)throw ue(`request with id "${E}" not found in collection "${v.name}"`)}else{if(typeof k!="string"||!k.trim())throw ue('the "request" or "requestId" argument is required');if(P=_.find(M=>M.request.name===k)??_.find(M=>M.request.name.toLowerCase()===k.toLowerCase()),!P)throw ue(`request "${k}" not found in collection "${v.name}"`)}return i.runRequest(v,P.request.id,e)}if(t===G.runFolder){let v=ot(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('the "folder" argument is required');let _=e.folder.toLowerCase(),E=Sy(e.folder),k=E.toLowerCase(),P=fn(v).map(j=>j.folderPath),M=P.find(j=>j===E)??P.find(j=>j.toLowerCase()===k)??P.find(j=>j.toLowerCase().includes(k))??P.find(j=>j.split("/").some(I=>I.toLowerCase().includes(k)));if(!M){let j=P.map(I=>`"${I}"`).join(", ");throw ue(`folder "${e.folder}" not found in collection "${v.name}". Available folders: ${j||"(none)"}. Call list_folders to see all.`)}return i.runFolder(v,M,e)}if(t===G.runCollection){let v=ot(e.collection,s);return i.runCollection(v,e)}if(t===G.createCollection){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let _=await r.collection.createCollection(v);return{id:_.id,name:_.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===G.renameCollection){let v=ot(e.collection,s),_=typeof e.newName=="string"?e.newName.trim():"";if(!_)throw ue('"newName" is required');return await r.collection.renameCollection(v.id,_),{id:v.id,oldName:v.name,newName:_,renamed:!0}}if(t===G.deleteCollection){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a collection');let v=ot(e.collection,s);return await r.collection.deleteCollection(v.id),{deleted:!0,collection:v.name}}if(t===G.duplicateCollection){let v=ot(e.collection,s),_=typeof e.newName=="string"?e.newName.trim():"";if(!_)throw ue('"newName" is required');let E=await r.collection.duplicateCollection(v.id,_);return{id:E.id,name:E.name,duplicatedFrom:v.name}}if(t===G.createFolder){let v=ot(e.collection,s),_=typeof e.name=="string"?e.name.trim():"";if(!_)throw ue('"name" is required');let E;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let P=e.parentFolder.toLowerCase(),M=fn(v);if(st(v).map(I=>I.folderPath)&&M.find(I=>I.folderPath===e.parentFolder||I.folderPath.toLowerCase()===P)){let R=fn(v).find(A=>A.folderPath===e.parentFolder||A.folderPath.toLowerCase()===P);if(R){let A=v.items,F=(D,J)=>{for(let Q of D)if(Q.type==="folder"){let se=Q;if(se.name===J||J.endsWith("/"+se.name))return se;let fe=F(se.items??[],J);if(fe)return fe}};E=F(A,R.folderPath)?.id}}}let k=await r.collection.createFolder({collectionId:v.id,name:_,parentId:E});return{id:k.id,name:k.name,created:!0,collection:v.name}}if(t===G.deleteFolder){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a folder');let v=ot(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('"folder" is required');let _=e.folder.toLowerCase(),E=fn(v).find(M=>M.folderPath===e.folder||M.folderPath.toLowerCase()===_);if(!E)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);let k=nN(v.items,E.folderId);if(!k)throw ue(`folder "${e.folder}" could not be resolved`);let P=E.requestCount;return await r.collection.deleteFolder(v.id,k.id),{deleted:!0,folder:E.folderPath,requestsRemoved:P}}if(t===G.createRequest){let v=ot(e.collection,s),_=typeof e.name=="string"?e.name.trim():"";if(!_)throw ue('"name" is required');let E=typeof e.method=="string"?e.method.toUpperCase():"GET",k=typeof e.url=="string"?e.url:"";if(!k)throw ue('"url" is required');let P;if(typeof e.folder=="string"&&e.folder.trim()){let I=e.folder.toLowerCase(),R=fn(v).find(A=>A.folderPath===e.folder||A.folderPath.toLowerCase()===I);R&&(P=R.folderId)}let M={collectionId:v.id,parentId:P,name:_,method:E,url:k,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},j=await r.collection.createRequest(M);return{id:j.id,name:j.name,created:!0,collection:v.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===G.updateRequest){let v=ot(e.collection,s),_=Qi(e.request,v),E={};return typeof e.name=="string"&&(E.name=e.name),typeof e.method=="string"&&(E.method=e.method.toUpperCase()),typeof e.url=="string"&&(E.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(E.headers=Object.entries(e.headers).map(([k,P])=>({name:k,value:String(P),enabled:!0}))),typeof e.body=="string"&&(E.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(E.description=e.description),await r.collection.updateRequest(v.id,_.id,E),{updated:!0,request:_.name}}if(t===G.deleteRequest){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a request');let v=ot(e.collection,s),_=Qi(e.request,v);return await r.collection.deleteRequest(v.id,_.id),{deleted:!0,request:_.name}}if(t===G.getRequestScript){let v=ot(e.collection,s),_=Qi(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');let k=r.collection.getRequestScript(v.id,_.id,E);return{collection:v.name,request:_.name,phase:E,script:k??""}}if(t===G.setRequestScript){let v=ot(e.collection,s),_=Qi(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ue('"script" is required');return await r.collection.setRequestScript(v.id,_.id,E,e.script),{updated:!0,collection:v.name,request:_.name,phase:E}}if(t===G.reorderCollectionItems){let v=ot(e.collection,s);if(!Array.isArray(e.order))throw ue('"order" must be an array');let _;if(typeof e.folder=="string"&&e.folder.trim()){let P=e.folder.toLowerCase(),M=fn(v).find(j=>j.folderPath===e.folder||j.folderPath.toLowerCase()===P);if(!M)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);_=M.folderId}let E=_?v.items.find(P=>P.id===_)?.items??[]:v.items,k=e.order.map(P=>E.find(j=>j.id===P||j.name===P)?.id??P);return await r.collection.reorderItems(v.id,_,k),{reordered:!0,collection:v.name,order:e.order}}let o=v=>(Array.isArray(v.nodes)?v.nodes:[]).every(E=>E?.type==="request"),l=(v,_="")=>{let E=[];if(!Array.isArray(v))return E;for(let k=0;k<v.length;k+=1){let P=v[k],M=_?`${_}.${k}`:`${k}`;!P||typeof P!="object"||(P.type==="request"&&E.push({node:P,path:M}),Array.isArray(P.nodes)&&E.push(...l(P.nodes,`${M}.nodes`)),Array.isArray(P.then)&&E.push(...l(P.then,`${M}.then`)),Array.isArray(P.else)&&E.push(...l(P.else,`${M}.else`)),Array.isArray(P.default)&&E.push(...l(P.default,`${M}.default`)),Array.isArray(P.elseif)&&P.elseif.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.elseif.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.elseif.${I}.then`))}),Array.isArray(P.cases)&&P.cases.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.cases.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.cases.${I}.then`))}))}return E},c=(v,_)=>{if(typeof v!="string"||!v.trim())throw ue(`"${_}" is required`);let E=v.trim(),k=E.split(".");if(k.some(P=>P===""))throw ue(`"${_}" is invalid: "${E}"`);return k.map(P=>/^\d+$/.test(P)?Number(P):P)},d=(v,_)=>{let E=c(_,"path"),k=v;for(let P of E)if(typeof P=="number"){if(!Array.isArray(k)||P<0||P>=k.length)throw ue(`node path not found: "${String(_)}"`);k=k[P]}else{if(!k||typeof k!="object"||!(P in k))throw ue(`node path not found: "${String(_)}"`);k=k[P]}return k},p=(v,_)=>{let E=c(_,"path"),k=E[E.length-1];if(typeof k!="number")throw ue(`"path" must end with a numeric index: "${String(_)}"`);let P=v;for(let M=0;M<E.length-1;M+=1){let j=E[M];if(typeof j=="number"){if(!Array.isArray(P)||j<0||j>=P.length)throw ue(`node path not found: "${String(_)}"`);P=P[j]}else{if(!P||typeof P!="object"||!(j in P))throw ue(`node path not found: "${String(_)}"`);P=P[j]}}if(!Array.isArray(P)||k<0||k>=P.length)throw ue(`node path not found: "${String(_)}"`);return{array:P,index:k}},m=(v,_,E,k)=>{if(_==null||_===""){if(E!=null&&E!=="")throw ue(`"${k}" is only valid when a parent path is provided`);return{array:v,pathPrefix:""}}if(typeof E!="string"||!E.trim())throw ue(`"${k}" is required when parent path is provided`);let P=String(_).trim(),M=E.trim(),j=d(v,P),I=c(M,k),R=j;for(let A=0;A<I.length;A+=1){let F=I[A],U=A===I.length-1;if(typeof F=="number"){if(!Array.isArray(R)||F<0||F>=R.length)throw ue(`branch path not found: "${M}"`);R=R[F]}else{if(!R||typeof R!="object")throw ue(`branch path not found: "${M}"`);if(!(F in R))if(U)R[F]=[];else throw ue(`branch path not found: "${M}"`);R=R[F]}}if(!Array.isArray(R))throw ue(`target branch must be an array: "${M}"`);return{array:R,pathPrefix:`${P}.${M}`}},y=(v,_="")=>{let E=[],k=[],P=(M,j)=>{if(Array.isArray(M)){j&&k.push(j);for(let I=0;I<M.length;I+=1){let R=M[I],A=j?`${j}.${I}`:`${I}`;E.push({path:A,type:R?.type,name:R?.name}),!(!R||typeof R!="object")&&(Array.isArray(R.nodes)&&P(R.nodes,`${A}.nodes`),Array.isArray(R.then)&&P(R.then,`${A}.then`),Array.isArray(R.else)&&P(R.else,`${A}.else`),Array.isArray(R.default)&&P(R.default,`${A}.default`),Array.isArray(R.cases)&&R.cases.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.cases.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.cases.${U}.then`)}),Array.isArray(R.elseif)&&R.elseif.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.elseif.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.elseif.${U}.then`)}))}}};return P(v,_),{nodePaths:E,branchPaths:k}};if(t===G.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(_=>({id:_.id,name:_.name,description:_.description??"",requestCount:l(_.nodes||[]).length,flowNodeCount:_.nodes?.length??0,iterations:_.config?.iterations??1}))};if(t===G.getSuite){let v=await En(e.suite,r),_=l(v.nodes||[]);return{id:v.id,name:v.name,description:v.description??"",config:{iterations:v.config?.iterations??1,delayBetweenRequests:v.config?.delayBetweenRequests??0,stopOnError:v.config?.stopOnError??!1},nodes:v.nodes||[],requests:_.map(({node:E,path:k})=>{let P=E.request;return{nodePath:k,slug:P.slug??P.requestId,collectionId:P.collectionId,requestId:P.requestId,name:P.name,method:P.method,folderPath:P.folderPath??"",enabled:E.enabled!==!1}})}}if(t===G.createSuite){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let _;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let E=ot(e.fromCollection,s),k=await r.testSuite.createTempSuiteFromCollection(E.id);if(!k)throw new Error(`Could not build suite from collection "${E.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let P=Sy(e.fromFolder),M=k.nodes||[];k.nodes=M.filter(j=>{if(j.type!=="request")return!0;let I=j.request?.folderPath||"";return I===P||I.startsWith(`${P}/`)})}_=await r.testSuite.saveTempSuite(k,v)}else _=await r.testSuite.createSuite(v);if(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0||e.nodes!==void 0){if(e.description!==void 0&&(_.description=String(e.description)),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');_.nodes=e.nodes}_.config={..._.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(_)}return{id:_.id,name:_.name,requestCount:_.nodes?.filter(E=>E.type==="request").length??0,created:!0,hint:(_.nodes?.filter(E=>E.type==="request").length??0)===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===G.updateSuiteConfig){let v=await En(e.suite,r);if(typeof e.name=="string"&&e.name.trim()&&(v.name=e.name.trim()),typeof e.description=="string"&&(v.description=e.description),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');v.nodes=e.nodes}return v.config={...v.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(v),{updated:!0,suite:v.name}}if(t===G.getSuiteNode){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=d(v.nodes,e.path);return{suite:v.name,path:String(e.path),node:_}}if(t===G.listSuiteNodePaths){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=e.includeBranches!==!1,E=y(v.nodes);return{suite:v.name,nodeCount:E.nodePaths.length,nodePaths:E.nodePaths,branchPaths:_?E.branchPaths:void 0,rootBranchPath:""}}if(t===G.addSuiteNode){let v=await En(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let{array:_,pathPrefix:E}=m(v.nodes,e.parentPath,e.branch,"branch"),k=typeof e.index=="number"?Math.max(0,Math.min(e.index,_.length)):_.length;_.splice(k,0,e.node),await r.testSuite.updateSuite(v);let P=E?`${E}.${k}`:`${k}`;return{added:!0,suite:v.name,path:P}}if(t===G.updateSuiteNode){let v=await En(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let _=p(v.nodes,e.path);return _.array[_.index]=e.node,await r.testSuite.updateSuite(v),{updated:!0,suite:v.name,path:String(e.path)}}if(t===G.removeSuiteNode){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=p(v.nodes,e.path),[E]=_.array.splice(_.index,1);return await r.testSuite.updateSuite(v),{removed:!0,suite:v.name,path:String(e.path),removedType:E?.type}}if(t===G.moveSuiteNode){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=p(v.nodes,e.fromPath),E=_.array[_.index];_.array.splice(_.index,1);let{array:k,pathPrefix:P}=m(v.nodes,e.toParentPath,e.toBranch,"toBranch"),M=typeof e.toIndex=="number"?Math.max(0,Math.min(e.toIndex,k.length)):k.length;_.array===k&&_.index<M&&(M-=1),k.splice(M,0,E),await r.testSuite.updateSuite(v);let j=P?`${P}.${M}`:`${M}`;return{moved:!0,suite:v.name,fromPath:String(e.fromPath),toPath:j}}if(t===G.addSuiteRequests){let v=await En(e.suite,r),_=Array.isArray(e.requests)?e.requests:[];if(_.length===0)throw ue('"requests" array is required and must not be empty');let E=[];for(let M of _){let j=ot(M.collection,s),I=Qi(M.request,j),R=st(j).find(A=>A.request.id===I.id)?.folderPath??"";E.push({slug:I.id,collectionId:j.id,requestId:I.id,name:I.name,method:I.method,collectionName:j.name,folderPath:R,enabled:!0})}v.nodes||(v.nodes=[]);let k=E.map(M=>({type:"request",name:M.name,request:M,enabled:!0})),P=typeof e.insertAt=="number"?Math.max(0,Math.min(e.insertAt,v.nodes.length)):v.nodes.length;return v.nodes.splice(P,0,...k),await r.testSuite.updateSuite(v),{added:E.length,suite:v.name,insertAt:P,addedPaths:k.map((M,j)=>`${P+j}`),newRequestCount:l(v.nodes||[]).length}}if(t===G.removeSuiteRequest){let v=await En(e.suite,r);if(!o(v))throw ue('remove_suite_request currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');v.nodes||(v.nodes=[]);let _=v.nodes.filter(k=>k.type==="request"),E;if(typeof e.index=="number"){if(e.index<0||e.index>=_.length)throw ue(`index ${e.index} is out of range`);let k=_[e.index];E=k.name||k.request?.name,v.nodes=v.nodes.filter(P=>P!==k)}else if(typeof e.request=="string"){let k=e.request.toLowerCase(),P=_.find(M=>{let j=M.request?.name||M.name||"";return j===e.request||j.toLowerCase()===k});if(!P)throw ue(`request "${e.request}" not found in suite "${v.name}"`);E=P.name||P.request?.name,v.nodes=v.nodes.filter(M=>M!==P)}else throw ue('either "index" or "request" is required');return await r.testSuite.updateSuite(v),{removed:!0,request:E,newRequestCount:v.nodes.filter(k=>k.type==="request").length}}if(t===G.reorderSuiteRequests){let v=await En(e.suite,r);if(!o(v))throw ue('reorder_suite_requests currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');if(!Array.isArray(e.order))throw ue('"order" must be an array of request names');let _=e.order,E=(v.nodes||[]).filter(M=>M.type==="request"),k=(v.nodes||[]).filter(M=>M.type!=="request"),P=[...E].sort((M,j)=>{let I=M.request?.name||M.name||"",R=j.request?.name||j.name||"",A=_.findIndex(J=>J===I||J.toLowerCase()===I.toLowerCase()),F=_.findIndex(J=>J===R||J.toLowerCase()===R.toLowerCase());return(A===-1?1/0:A)-(F===-1?1/0:F)});return v.nodes=[...P,...k],await r.testSuite.updateSuite(v),{reordered:!0,suite:v.name,newOrder:P.map(M=>M.request?.name||M.name)}}if(t===G.duplicateSuite){let v=await En(e.suite,r),_=typeof e.newName=="string"?e.newName.trim():"";if(!_)throw ue('"newName" is required');let E=await r.testSuite.duplicateSuite(v.id,_);return{id:E.id,name:E.name,duplicatedFrom:v.name,requestCount:E.nodes?.filter(k=>k.type==="request").length??0}}if(t===G.deleteSuite){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a suite');let v=await En(e.suite,r);return await r.testSuite.deleteSuite(v.id),{deleted:!0,suite:v.name}}if(t===G.listEnvironments){let v=r.environmentConfig.getAllEnvironments(),_=r.environmentConfig.getSelectedEnvironment();return{environments:v.map(E=>({name:E.name,active:E.active,variableKeys:Object.keys(E.variables)})),active:_}}if(t===G.getEnvironmentVariables){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),_=r.environmentConfig.getResolvedEnvironment(v);if(!_)throw ue(`environment "${v}" not found`);let k=r.environmentConfig.getSharedConfig()?.environments?.[v]?.variables??{},P=r.environmentConfig.getEnvironmentVariableLocals();return{environment:v,active:r.environmentConfig.getSelectedEnvironment()===v,fileVariables:k,sessionOverrides:P,resolved:_.variables}}if(t===G.selectEnvironment){let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(v),{selected:!0,environment:v}}if(t===G.createEnvironment){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');if(await r.environmentConfig.createEnvironment(v),e.variables&&typeof e.variables=="object"){let _=e.variables,E=r.environmentConfig.getSharedConfig();E&&(E.environments=E.environments??{},E.environments[v]={...E.environments[v]??{},variables:{...E.environments[v]?.variables??{},..._}},r.environmentConfig.saveSharedConfig(E))}return{created:!0,environment:v}}if(t===G.deleteEnvironment){if(e.confirm!==!0)throw ue('"confirm" must be true to delete an environment');let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');let _=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(v),{deleted:!0,environment:v,newActive:_===v?void 0:_}}if(t===G.setEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"",_=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),k=e.scope==="permanent"?"permanent":"session";if(k==="permanent"){let P=r.environmentConfig.getSharedConfig();P&&(P.environments=P.environments??{},P.environments[E]=P.environments[E]??{variables:{}},P.environments[E].variables=P.environments[E].variables??{},P.environments[E].variables[v]=_,r.environmentConfig.saveSharedConfig(P))}else r.environmentConfig.setEnvironmentVariable(v,_,E);return{set:!0,key:v,environment:E,scope:k}}if(t===G.unsetEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"";if(!v)throw ue('"key" is required');let _=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(v,_),{unset:!0,key:v,environment:_}}if(t===G.setGlobalVariable){let v=typeof e.key=="string"?e.key.trim():"",_=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=e.scope==="permanent"?"permanent":"session";if(E==="permanent"){let k=r.environmentConfig.getSharedConfig();k&&(k.globalVariables=k.globalVariables??{},k.globalVariables[v]=_,r.environmentConfig.saveSharedConfig(k))}else r.environmentConfig.setGlobalVariable(v,_);return{set:!0,key:v,scope:E}}if(t===G.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===G.scaffoldCollectionFromOpenApi){let v=typeof e.specPath=="string"?e.specPath.trim():"";if(!v)throw ue('"specPath" is required');let _=r.workspaceFolder&&!Zi.isAbsolute(v)?Zi.join(r.workspaceFolder,v):v;if(!op.existsSync(_))throw ue(`OpenAPI spec file not found: "${_}"`);let k=await new Fo(r.collection,r.environmentConfig).import(_,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:k.collection.id,collectionName:k.collection.name,requestCount:k.collection.items.filter(P=>P.type==="request").length,environmentCreated:k.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===G.suggestAssertions){let v=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ue('"request" is required');let E=ot(v,s),k=Qi(e.request,E),P=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,M=[],I=Array.from(n.values()).filter(U=>U.status!=="running").flatMap(U=>U.allResults??[]).filter(U=>U.name===k.name||typeof U.name=="string"&&U.name.toLowerCase()===k.name.toLowerCase()),R=I[I.length-1],A=R?.status;A?M.push({snippet:`pm.test("Status code is ${A}", function () {
352
+ 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 xy,Cy,Ey,qy,G,sp=le(()=>{"use strict";xy={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)"}}},Cy={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."}}},Ey={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."}}},qy={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)"}}},G={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",getSuiteNode:"get_suite_node",listSuiteNodePaths:"list_suite_node_paths",addSuiteNode:"add_suite_node",updateSuiteNode:"update_suite_node",removeSuiteNode:"remove_suite_node",moveSuiteNode:"move_suite_node",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"}});import*as op from"fs";import*as Zi from"path";function ue(t){return new Error(`Bad request: ${t}`)}function ot(t,e){if(typeof t!="string"||!t.trim())throw ue('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 ue(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Qi(t,e){if(typeof t!="string"||!t.trim())throw ue('the "request" argument is required');let r=st(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 ue(`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 nN(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=nN(n.items??[],e);if(i)return i}}async function En(t,e){if(typeof t!="string"||!t.trim())throw ue('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 ue(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function zx(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===G.listCollections)return{collections:s.map(v=>({name:v.name,id:v.id,description:v.description??"",requestCount:st(v).length}))};if(t===G.listFolders){let v=ot(e.collection,s);return{collection:v.name,folders:fn(v).map(({folderPath:R,requestCount:E})=>({path:Ts(R),requestCount:E}))}}if(t===G.listRequests){let v=ot(e.collection,s),R=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=typeof e.offset=="number"?Math.max(0,e.offset):0,k=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,P=st(v).filter(({folderPath:M})=>!R||M.toLowerCase().includes(R)).map(({request:M,folderPath:j})=>({id:M.id,name:M.name,method:M.method,folder:Ts(j),description:M.description??""}));return{collection:v.name,total:P.length,offset:E,limit:k,requests:P.slice(E,E+k)}}if(t===G.searchRequests){let v=ot(e.collection,s),R=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!R)throw ue('the "query" argument is required');let E=st(v).filter(({request:k,folderPath:P})=>k.name.toLowerCase().includes(R)||(k.url??"").toLowerCase().includes(R)||k.method.toLowerCase().includes(R)||P.toLowerCase().includes(R)||(k.description??"").toLowerCase().includes(R)).map(({request:k,folderPath:P})=>({id:k.id,name:k.name,method:k.method,url:k.url??"",folder:Ts(P),description:k.description??""}));return{collection:v.name,query:e.query,total:E.length,requests:E}}if(t===G.getRequest){let v=ot(e.collection,s),R=Qi(e.request,v),E=r.collection.getRequestScript(v.id,R.id,"pre-request")??"",k=r.collection.getRequestScript(v.id,R.id,"post-response")??"";return{id:R.id,name:R.name,method:R.method,url:R.url??"",description:R.description??"",headers:R.headers??[],body:R.body??null,auth:R.auth??null,scripts:{preRequest:E,postResponse:k},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===G.getEnvironment){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),R=r.environmentConfig.getResolvedEnvironment(v);if(!R)throw ue(`environment "${v}" not found`);return{name:R.name,variables:R.variables}}if(t===G.setVariable){let v=typeof e.key=="string"?e.key.trim():"",R=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(v,R,E),{set:!0,key:v,environment:E}}if(t===G.getRunStatus){let v=n.require(e.runId);return{runId:v.id,status:v.status,suiteName:v.suiteName,progress:v.progress,...v.error?{error:v.error}:{}}}if(t===G.getRunSummary){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress};let R=(v.summary.failed??0)>0||v.summary.allPassed===!1,E=v.noAssertionExamples??[],k=E.length,P=v.summary.total,M=k>0?k/(P||1)>.5?`${k}/${P} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${v.suiteName}") for a full coverage analysis.`:`${k} request(s) have no pm.test() assertions (e.g. ${E.slice(0,3).map(j=>`"${j}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${v.suiteName}") to add test coverage.`:null;return{runId:v.id,status:v.status,suiteName:v.suiteName,summary:v.summary,...v.reportPath?{report:{uri:`file://${v.reportPath}`}}:{},...R?{failedRequests:v.failedRequests}:{},...R?{_nextStep:`REQUIRED ACTION: ${v.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.`}:{},...M?{_suggestions:[M]}:{}}}if(t===G.getFailedRequests){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress,failedSoFar:v.failedRequests.length};let R=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:v.id,status:v.status,totalFailed:v.failedRequests.length,offset:R,limit:E,failedRequests:v.failedRequests.slice(R,R+E)}}if(t===G.getRequestResult){let v=n.require(e.runId),R=e.request;if(typeof R!="string"||!R)throw ue('"request" is required');let E=typeof e.iteration=="number"?e.iteration:1,k=v.allResults.find(P=>P.iteration===E&&(P.name===R||P.name.toLowerCase()===R.toLowerCase()));if(!k){if(v.status==="running")return{runId:v.id,status:"running",message:`Request "${R}" has not completed yet.`};throw new Error(`Request "${R}" (iteration ${E}) not found in run "${v.id}".`)}return{runId:v.id,...k}}if(t===G.cancelRun){let v=n.require(e.runId);if(v.status!=="running")return{runId:v.id,status:v.status,cancelled:!1,message:`Run is already "${v.status}" \u2014 nothing to cancel.`};let R=n.cancel(String(e.runId));return{runId:v.id,status:"cancelled",cancelled:R,progress:v.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===G.runRequest){let v=ot(e.collection,s),R=st(v),E=typeof e.requestId=="string"?e.requestId.trim():void 0,k=e.request,P;if(E){if(P=R.find(M=>M.request.id===E),!P)throw ue(`request with id "${E}" not found in collection "${v.name}"`)}else{if(typeof k!="string"||!k.trim())throw ue('the "request" or "requestId" argument is required');if(P=R.find(M=>M.request.name===k)??R.find(M=>M.request.name.toLowerCase()===k.toLowerCase()),!P)throw ue(`request "${k}" not found in collection "${v.name}"`)}return i.runRequest(v,P.request.id,e)}if(t===G.runFolder){let v=ot(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('the "folder" argument is required');let R=e.folder.toLowerCase(),E=Sy(e.folder),k=E.toLowerCase(),P=fn(v).map(j=>j.folderPath),M=P.find(j=>j===E)??P.find(j=>j.toLowerCase()===k)??P.find(j=>j.toLowerCase().includes(k))??P.find(j=>j.split("/").some(I=>I.toLowerCase().includes(k)));if(!M){let j=P.map(I=>`"${I}"`).join(", ");throw ue(`folder "${e.folder}" not found in collection "${v.name}". Available folders: ${j||"(none)"}. Call list_folders to see all.`)}return i.runFolder(v,M,e)}if(t===G.runCollection){let v=ot(e.collection,s);return i.runCollection(v,e)}if(t===G.createCollection){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let R=await r.collection.createCollection(v);return{id:R.id,name:R.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===G.renameCollection){let v=ot(e.collection,s),R=typeof e.newName=="string"?e.newName.trim():"";if(!R)throw ue('"newName" is required');return await r.collection.renameCollection(v.id,R),{id:v.id,oldName:v.name,newName:R,renamed:!0}}if(t===G.deleteCollection){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a collection');let v=ot(e.collection,s);return await r.collection.deleteCollection(v.id),{deleted:!0,collection:v.name}}if(t===G.duplicateCollection){let v=ot(e.collection,s),R=typeof e.newName=="string"?e.newName.trim():"";if(!R)throw ue('"newName" is required');let E=await r.collection.duplicateCollection(v.id,R);return{id:E.id,name:E.name,duplicatedFrom:v.name}}if(t===G.createFolder){let v=ot(e.collection,s),R=typeof e.name=="string"?e.name.trim():"";if(!R)throw ue('"name" is required');let E;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let P=e.parentFolder.toLowerCase(),M=fn(v);if(st(v).map(I=>I.folderPath)&&M.find(I=>I.folderPath===e.parentFolder||I.folderPath.toLowerCase()===P)){let _=fn(v).find(A=>A.folderPath===e.parentFolder||A.folderPath.toLowerCase()===P);if(_){let A=v.items,F=(D,J)=>{for(let Q of D)if(Q.type==="folder"){let se=Q;if(se.name===J||J.endsWith("/"+se.name))return se;let fe=F(se.items??[],J);if(fe)return fe}};E=F(A,_.folderPath)?.id}}}let k=await r.collection.createFolder({collectionId:v.id,name:R,parentId:E});return{id:k.id,name:k.name,created:!0,collection:v.name}}if(t===G.deleteFolder){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a folder');let v=ot(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('"folder" is required');let R=e.folder.toLowerCase(),E=fn(v).find(M=>M.folderPath===e.folder||M.folderPath.toLowerCase()===R);if(!E)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);let k=nN(v.items,E.folderId);if(!k)throw ue(`folder "${e.folder}" could not be resolved`);let P=E.requestCount;return await r.collection.deleteFolder(v.id,k.id),{deleted:!0,folder:E.folderPath,requestsRemoved:P}}if(t===G.createRequest){let v=ot(e.collection,s),R=typeof e.name=="string"?e.name.trim():"";if(!R)throw ue('"name" is required');let E=typeof e.method=="string"?e.method.toUpperCase():"GET",k=typeof e.url=="string"?e.url:"";if(!k)throw ue('"url" is required');let P;if(typeof e.folder=="string"&&e.folder.trim()){let I=e.folder.toLowerCase(),_=fn(v).find(A=>A.folderPath===e.folder||A.folderPath.toLowerCase()===I);_&&(P=_.folderId)}let M={collectionId:v.id,parentId:P,name:R,method:E,url:k,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},j=await r.collection.createRequest(M);return{id:j.id,name:j.name,created:!0,collection:v.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===G.updateRequest){let v=ot(e.collection,s),R=Qi(e.request,v),E={};return typeof e.name=="string"&&(E.name=e.name),typeof e.method=="string"&&(E.method=e.method.toUpperCase()),typeof e.url=="string"&&(E.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(E.headers=Object.entries(e.headers).map(([k,P])=>({name:k,value:String(P),enabled:!0}))),typeof e.body=="string"&&(E.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(E.description=e.description),await r.collection.updateRequest(v.id,R.id,E),{updated:!0,request:R.name}}if(t===G.deleteRequest){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a request');let v=ot(e.collection,s),R=Qi(e.request,v);return await r.collection.deleteRequest(v.id,R.id),{deleted:!0,request:R.name}}if(t===G.getRequestScript){let v=ot(e.collection,s),R=Qi(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');let k=r.collection.getRequestScript(v.id,R.id,E);return{collection:v.name,request:R.name,phase:E,script:k??""}}if(t===G.setRequestScript){let v=ot(e.collection,s),R=Qi(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ue('"script" is required');return await r.collection.setRequestScript(v.id,R.id,E,e.script),{updated:!0,collection:v.name,request:R.name,phase:E}}if(t===G.reorderCollectionItems){let v=ot(e.collection,s);if(!Array.isArray(e.order))throw ue('"order" must be an array');let R;if(typeof e.folder=="string"&&e.folder.trim()){let P=e.folder.toLowerCase(),M=fn(v).find(j=>j.folderPath===e.folder||j.folderPath.toLowerCase()===P);if(!M)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);R=M.folderId}let E=R?v.items.find(P=>P.id===R)?.items??[]:v.items,k=e.order.map(P=>E.find(j=>j.id===P||j.name===P)?.id??P);return await r.collection.reorderItems(v.id,R,k),{reordered:!0,collection:v.name,order:e.order}}let o=v=>(Array.isArray(v.nodes)?v.nodes:[]).every(E=>E?.type==="request"),l=(v,R="")=>{let E=[];if(!Array.isArray(v))return E;for(let k=0;k<v.length;k+=1){let P=v[k],M=R?`${R}.${k}`:`${k}`;!P||typeof P!="object"||(P.type==="request"&&E.push({node:P,path:M}),Array.isArray(P.nodes)&&E.push(...l(P.nodes,`${M}.nodes`)),Array.isArray(P.then)&&E.push(...l(P.then,`${M}.then`)),Array.isArray(P.else)&&E.push(...l(P.else,`${M}.else`)),Array.isArray(P.default)&&E.push(...l(P.default,`${M}.default`)),Array.isArray(P.elseif)&&P.elseif.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.elseif.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.elseif.${I}.then`))}),Array.isArray(P.cases)&&P.cases.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.cases.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.cases.${I}.then`))}))}return E},c=(v,R)=>{if(typeof v!="string"||!v.trim())throw ue(`"${R}" is required`);let E=v.trim(),k=E.split(".");if(k.some(P=>P===""))throw ue(`"${R}" is invalid: "${E}"`);return k.map(P=>/^\d+$/.test(P)?Number(P):P)},d=(v,R)=>{let E=c(R,"path"),k=v;for(let P of E)if(typeof P=="number"){if(!Array.isArray(k)||P<0||P>=k.length)throw ue(`node path not found: "${String(R)}"`);k=k[P]}else{if(!k||typeof k!="object"||!(P in k))throw ue(`node path not found: "${String(R)}"`);k=k[P]}return k},p=(v,R)=>{let E=c(R,"path"),k=E[E.length-1];if(typeof k!="number")throw ue(`"path" must end with a numeric index: "${String(R)}"`);let P=v;for(let M=0;M<E.length-1;M+=1){let j=E[M];if(typeof j=="number"){if(!Array.isArray(P)||j<0||j>=P.length)throw ue(`node path not found: "${String(R)}"`);P=P[j]}else{if(!P||typeof P!="object"||!(j in P))throw ue(`node path not found: "${String(R)}"`);P=P[j]}}if(!Array.isArray(P)||k<0||k>=P.length)throw ue(`node path not found: "${String(R)}"`);return{array:P,index:k}},m=(v,R,E,k)=>{if(R==null||R===""){if(E!=null&&E!=="")throw ue(`"${k}" is only valid when a parent path is provided`);return{array:v,pathPrefix:""}}if(typeof E!="string"||!E.trim())throw ue(`"${k}" is required when parent path is provided`);let P=String(R).trim(),M=E.trim(),j=d(v,P),I=c(M,k),_=j;for(let A=0;A<I.length;A+=1){let F=I[A],U=A===I.length-1;if(typeof F=="number"){if(!Array.isArray(_)||F<0||F>=_.length)throw ue(`branch path not found: "${M}"`);_=_[F]}else{if(!_||typeof _!="object")throw ue(`branch path not found: "${M}"`);if(!(F in _))if(U)_[F]=[];else throw ue(`branch path not found: "${M}"`);_=_[F]}}if(!Array.isArray(_))throw ue(`target branch must be an array: "${M}"`);return{array:_,pathPrefix:`${P}.${M}`}},y=(v,R="")=>{let E=[],k=[],P=(M,j)=>{if(Array.isArray(M)){j&&k.push(j);for(let I=0;I<M.length;I+=1){let _=M[I],A=j?`${j}.${I}`:`${I}`;E.push({path:A,type:_?.type,name:_?.name}),!(!_||typeof _!="object")&&(Array.isArray(_.nodes)&&P(_.nodes,`${A}.nodes`),Array.isArray(_.then)&&P(_.then,`${A}.then`),Array.isArray(_.else)&&P(_.else,`${A}.else`),Array.isArray(_.default)&&P(_.default,`${A}.default`),Array.isArray(_.cases)&&_.cases.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.cases.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.cases.${U}.then`)}),Array.isArray(_.elseif)&&_.elseif.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.elseif.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.elseif.${U}.then`)}))}}};return P(v,R),{nodePaths:E,branchPaths:k}};if(t===G.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(R=>({id:R.id,name:R.name,description:R.description??"",requestCount:l(R.nodes||[]).length,flowNodeCount:R.nodes?.length??0,iterations:R.config?.iterations??1}))};if(t===G.getSuite){let v=await En(e.suite,r),R=l(v.nodes||[]);return{id:v.id,name:v.name,description:v.description??"",config:{iterations:v.config?.iterations??1,delayBetweenRequests:v.config?.delayBetweenRequests??0,stopOnError:v.config?.stopOnError??!1},nodes:v.nodes||[],requests:R.map(({node:E,path:k})=>{let P=E.request;return{nodePath:k,slug:P.slug??P.requestId,collectionId:P.collectionId,requestId:P.requestId,name:P.name,method:P.method,folderPath:P.folderPath??"",enabled:E.enabled!==!1}})}}if(t===G.createSuite){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let R;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let E=ot(e.fromCollection,s),k=await r.testSuite.createTempSuiteFromCollection(E.id);if(!k)throw new Error(`Could not build suite from collection "${E.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let P=Sy(e.fromFolder),M=k.nodes||[];k.nodes=M.filter(j=>{if(j.type!=="request")return!0;let I=j.request?.folderPath||"";return I===P||I.startsWith(`${P}/`)})}R=await r.testSuite.saveTempSuite(k,v)}else R=await r.testSuite.createSuite(v);if(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0||e.nodes!==void 0){if(e.description!==void 0&&(R.description=String(e.description)),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');R.nodes=e.nodes}R.config={...R.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(R)}return{id:R.id,name:R.name,requestCount:R.nodes?.filter(E=>E.type==="request").length??0,created:!0,hint:(R.nodes?.filter(E=>E.type==="request").length??0)===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===G.updateSuiteConfig){let v=await En(e.suite,r);if(typeof e.name=="string"&&e.name.trim()&&(v.name=e.name.trim()),typeof e.description=="string"&&(v.description=e.description),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');v.nodes=e.nodes}return v.config={...v.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(v),{updated:!0,suite:v.name}}if(t===G.getSuiteNode){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=d(v.nodes,e.path);return{suite:v.name,path:String(e.path),node:R}}if(t===G.listSuiteNodePaths){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=e.includeBranches!==!1,E=y(v.nodes);return{suite:v.name,nodeCount:E.nodePaths.length,nodePaths:E.nodePaths,branchPaths:R?E.branchPaths:void 0,rootBranchPath:""}}if(t===G.addSuiteNode){let v=await En(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let{array:R,pathPrefix:E}=m(v.nodes,e.parentPath,e.branch,"branch"),k=typeof e.index=="number"?Math.max(0,Math.min(e.index,R.length)):R.length;R.splice(k,0,e.node),await r.testSuite.updateSuite(v);let P=E?`${E}.${k}`:`${k}`;return{added:!0,suite:v.name,path:P}}if(t===G.updateSuiteNode){let v=await En(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let R=p(v.nodes,e.path);return R.array[R.index]=e.node,await r.testSuite.updateSuite(v),{updated:!0,suite:v.name,path:String(e.path)}}if(t===G.removeSuiteNode){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=p(v.nodes,e.path),[E]=R.array.splice(R.index,1);return await r.testSuite.updateSuite(v),{removed:!0,suite:v.name,path:String(e.path),removedType:E?.type}}if(t===G.moveSuiteNode){let v=await En(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=p(v.nodes,e.fromPath),E=R.array[R.index];R.array.splice(R.index,1);let{array:k,pathPrefix:P}=m(v.nodes,e.toParentPath,e.toBranch,"toBranch"),M=typeof e.toIndex=="number"?Math.max(0,Math.min(e.toIndex,k.length)):k.length;R.array===k&&R.index<M&&(M-=1),k.splice(M,0,E),await r.testSuite.updateSuite(v);let j=P?`${P}.${M}`:`${M}`;return{moved:!0,suite:v.name,fromPath:String(e.fromPath),toPath:j}}if(t===G.addSuiteRequests){let v=await En(e.suite,r),R=Array.isArray(e.requests)?e.requests:[];if(R.length===0)throw ue('"requests" array is required and must not be empty');let E=[];for(let M of R){let j=ot(M.collection,s),I=Qi(M.request,j),_=st(j).find(A=>A.request.id===I.id)?.folderPath??"";E.push({slug:I.id,collectionId:j.id,requestId:I.id,name:I.name,method:I.method,collectionName:j.name,folderPath:_,enabled:!0})}v.nodes||(v.nodes=[]);let k=E.map(M=>({type:"request",name:M.name,request:M,enabled:!0})),P=typeof e.insertAt=="number"?Math.max(0,Math.min(e.insertAt,v.nodes.length)):v.nodes.length;return v.nodes.splice(P,0,...k),await r.testSuite.updateSuite(v),{added:E.length,suite:v.name,insertAt:P,addedPaths:k.map((M,j)=>`${P+j}`),newRequestCount:l(v.nodes||[]).length}}if(t===G.removeSuiteRequest){let v=await En(e.suite,r);if(!o(v))throw ue('remove_suite_request currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');v.nodes||(v.nodes=[]);let R=v.nodes.filter(k=>k.type==="request"),E;if(typeof e.index=="number"){if(e.index<0||e.index>=R.length)throw ue(`index ${e.index} is out of range`);let k=R[e.index];E=k.name||k.request?.name,v.nodes=v.nodes.filter(P=>P!==k)}else if(typeof e.request=="string"){let k=e.request.toLowerCase(),P=R.find(M=>{let j=M.request?.name||M.name||"";return j===e.request||j.toLowerCase()===k});if(!P)throw ue(`request "${e.request}" not found in suite "${v.name}"`);E=P.name||P.request?.name,v.nodes=v.nodes.filter(M=>M!==P)}else throw ue('either "index" or "request" is required');return await r.testSuite.updateSuite(v),{removed:!0,request:E,newRequestCount:v.nodes.filter(k=>k.type==="request").length}}if(t===G.reorderSuiteRequests){let v=await En(e.suite,r);if(!o(v))throw ue('reorder_suite_requests currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');if(!Array.isArray(e.order))throw ue('"order" must be an array of request names');let R=e.order,E=(v.nodes||[]).filter(M=>M.type==="request"),k=(v.nodes||[]).filter(M=>M.type!=="request"),P=[...E].sort((M,j)=>{let I=M.request?.name||M.name||"",_=j.request?.name||j.name||"",A=R.findIndex(J=>J===I||J.toLowerCase()===I.toLowerCase()),F=R.findIndex(J=>J===_||J.toLowerCase()===_.toLowerCase());return(A===-1?1/0:A)-(F===-1?1/0:F)});return v.nodes=[...P,...k],await r.testSuite.updateSuite(v),{reordered:!0,suite:v.name,newOrder:P.map(M=>M.request?.name||M.name)}}if(t===G.duplicateSuite){let v=await En(e.suite,r),R=typeof e.newName=="string"?e.newName.trim():"";if(!R)throw ue('"newName" is required');let E=await r.testSuite.duplicateSuite(v.id,R);return{id:E.id,name:E.name,duplicatedFrom:v.name,requestCount:E.nodes?.filter(k=>k.type==="request").length??0}}if(t===G.deleteSuite){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a suite');let v=await En(e.suite,r);return await r.testSuite.deleteSuite(v.id),{deleted:!0,suite:v.name}}if(t===G.listEnvironments){let v=r.environmentConfig.getAllEnvironments(),R=r.environmentConfig.getSelectedEnvironment();return{environments:v.map(E=>({name:E.name,active:E.active,variableKeys:Object.keys(E.variables)})),active:R}}if(t===G.getEnvironmentVariables){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),R=r.environmentConfig.getResolvedEnvironment(v);if(!R)throw ue(`environment "${v}" not found`);let k=r.environmentConfig.getSharedConfig()?.environments?.[v]?.variables??{},P=r.environmentConfig.getEnvironmentVariableLocals();return{environment:v,active:r.environmentConfig.getSelectedEnvironment()===v,fileVariables:k,sessionOverrides:P,resolved:R.variables}}if(t===G.selectEnvironment){let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(v),{selected:!0,environment:v}}if(t===G.createEnvironment){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');if(await r.environmentConfig.createEnvironment(v),e.variables&&typeof e.variables=="object"){let R=e.variables,E=r.environmentConfig.getSharedConfig();E&&(E.environments=E.environments??{},E.environments[v]={...E.environments[v]??{},variables:{...E.environments[v]?.variables??{},...R}},r.environmentConfig.saveSharedConfig(E))}return{created:!0,environment:v}}if(t===G.deleteEnvironment){if(e.confirm!==!0)throw ue('"confirm" must be true to delete an environment');let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');let R=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(v),{deleted:!0,environment:v,newActive:R===v?void 0:R}}if(t===G.setEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"",R=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),k=e.scope==="permanent"?"permanent":"session";if(k==="permanent"){let P=r.environmentConfig.getSharedConfig();P&&(P.environments=P.environments??{},P.environments[E]=P.environments[E]??{variables:{}},P.environments[E].variables=P.environments[E].variables??{},P.environments[E].variables[v]=R,r.environmentConfig.saveSharedConfig(P))}else r.environmentConfig.setEnvironmentVariable(v,R,E);return{set:!0,key:v,environment:E,scope:k}}if(t===G.unsetEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"";if(!v)throw ue('"key" is required');let R=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(v,R),{unset:!0,key:v,environment:R}}if(t===G.setGlobalVariable){let v=typeof e.key=="string"?e.key.trim():"",R=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=e.scope==="permanent"?"permanent":"session";if(E==="permanent"){let k=r.environmentConfig.getSharedConfig();k&&(k.globalVariables=k.globalVariables??{},k.globalVariables[v]=R,r.environmentConfig.saveSharedConfig(k))}else r.environmentConfig.setGlobalVariable(v,R);return{set:!0,key:v,scope:E}}if(t===G.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===G.scaffoldCollectionFromOpenApi){let v=typeof e.specPath=="string"?e.specPath.trim():"";if(!v)throw ue('"specPath" is required');let R=r.workspaceFolder&&!Zi.isAbsolute(v)?Zi.join(r.workspaceFolder,v):v;if(!op.existsSync(R))throw ue(`OpenAPI spec file not found: "${R}"`);let k=await new Fo(r.collection,r.environmentConfig).import(R,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:k.collection.id,collectionName:k.collection.name,requestCount:k.collection.items.filter(P=>P.type==="request").length,environmentCreated:k.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===G.suggestAssertions){let v=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ue('"request" is required');let E=ot(v,s),k=Qi(e.request,E),P=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,M=[],I=Array.from(n.values()).filter(U=>U.status!=="running").flatMap(U=>U.allResults??[]).filter(U=>U.name===k.name||typeof U.name=="string"&&U.name.toLowerCase()===k.name.toLowerCase()),_=I[I.length-1],A=_?.status;A?M.push({snippet:`pm.test("Status code is ${A}", function () {
353
353
  pm.response.to.have.status(${A});
354
354
  });`,rationale:`Observed status ${A} in the most recent run.`}):M.push({snippet:`pm.test("Status code is 2xx", function () {
355
355
  pm.expect(pm.response.code).to.be.within(200, 299);
356
356
  });`,rationale:"No run history in this session \u2014 asserting a generic 2xx success."}),M.push({snippet:`pm.test("Response time is under 2000ms", function () {
357
357
  pm.expect(pm.response.responseTime).to.be.below(2000);
358
- });`,rationale:"Good practice to gate on response time in CI."});let F=R?.responseBody;if(F)try{let U=JSON.parse(F);if(U&&typeof U=="object"){M.push({snippet:`pm.test("Content-Type is application/json", function () {
358
+ });`,rationale:"Good practice to gate on response time in CI."});let F=_?.responseBody;if(F)try{let U=JSON.parse(F);if(U&&typeof U=="object"){M.push({snippet:`pm.test("Content-Type is application/json", function () {
359
359
  pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
360
360
  });`,rationale:"Response body was valid JSON \u2014 assert Content-Type accordingly."});let D=Object.keys(Array.isArray(U)&&U.length>0?U[0]:U).slice(0,5);for(let J of D){if(M.length>=P)break;let Q=Array.isArray(U)?"body[0]":"body";M.push({snippet:`pm.test("Response has field '${J}'", function () {
361
361
  const body = pm.response.json();
362
362
  pm.expect(${Q}).to.have.property("${J}");
363
363
  });`,rationale:`Field "${J}" was present in the observed response body.`})}}}catch{M.push({snippet:`pm.test("Response body is not empty", function () {
364
364
  pm.expect(pm.response.text()).to.not.be.empty;
365
- });`,rationale:"Response body was non-JSON text."})}return{collection:E.name,request:k.name,suggestions:M.slice(0,P),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===G.explainFailure){let v=typeof e.runId=="string"?e.runId.trim():void 0,_=typeof e.request=="string"?e.request.trim():"",E=typeof e.iteration=="number"?e.iteration:1;if(v){let j=n.require(v);if(j.status==="running")return{runId:v,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!_)throw ue('"request" is required when "runId" is provided');let I=j.allResults.find(D=>D.iteration===E&&(D.name===_||typeof D.name=="string"&&D.name.toLowerCase()===_.toLowerCase()));if(!I)throw new Error(`Request "${_}" (iteration ${E}) not found in run "${v}".`);let R=I.assertions?.every(D=>D.passed)??!0,A=I.error,F=I.assertions?.filter(D=>!D.passed)??[],U="";return A?U=`The request itself failed to execute: ${A}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:F.length>0?U=`${F.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:R?U="No failures detected. The request appears to have passed.":U="The request was marked as failed but no specific errors were captured.",{runId:v,request:I.name,iteration:E,status:I.status??"unknown",passed:I.passed??!0,error:A??null,failedAssertions:F,allAssertions:I.assertions??[],requestDetails:{method:I.method,url:I.url,requestBody:I.requestBody},responseDetails:{status:I.responseStatus,headers:I.responseHeaders,body:I.responseBody},diagnosis:U,suggestedFixes:A?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:F.map(D=>`Fix assertion "${D.name}": ${D.message??"expected value mismatch"}`)}}let k=e.collection;if(!_)throw ue('"request" is required');let P=ot(k,s);return{request:Qi(e.request,P).name,collection:P.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===G.aiSuggestEnvVars){let v=ot(e.collection,s),_=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,k=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,P=Ry(v,_),M=st(v).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),query:(j.query??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),bodyExcerpt:j.body?.type==="raw"&&typeof j.body.content=="string"?j.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: "${v.name}", suggestions: [...], ${k?`environment: "${k}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:v.name,heuristicSuggestions:P.map(j=>({varName:j.varName,value:j.value,reason:j.reason})),requestSummary:M,expectedCallAfterThis:"apply_env_vars"}}}if(t===G.aiEnhanceCollection){let v=ot(e.collection,s),_=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=st(v).filter(({folderPath:I})=>!k||I.toLowerCase().includes(k)),M=P.slice(_,_+E).map(({request:I,folderPath:R})=>({id:I.id,name:I.name,folder:R,method:I.method,url:I.url,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),query:(I.query??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),currentBody:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.id,"post-response")??void 0})),j=_+E<P.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: "${v.name}", enhancements: [{ requestId, body?, testScript }] }`,j?`After applying, call ai_enhance_collection again with: { collection: "${v.name}", offset: ${_+E}, limit: ${E} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:v.name,total:P.length,offset:_,hasMore:j,nextOffset:j?_+E:void 0,requests:M,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===G.suggestEnvVars){let v=ot(e.collection,s),_=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,E=Ry(v,_),k=st(v).map(({request:P,folderPath:M})=>({id:P.id,name:P.name,folder:M,method:P.method,url:P.url,headers:(P.headers??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),query:(P.query??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),bodyExcerpt:P.body?.type==="raw"&&typeof P.body.content=="string"?P.body.content.slice(0,300):void 0}));return{collection:v.name,heuristicSuggestions:E.map(P=>({varName:P.varName,value:P.value,reason:P.reason,occurrences:P.occurrences.length})),requestSummary:k,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===G.applyEnvVars){let v=ot(e.collection,s),_=e.suggestions;if(!Array.isArray(_)||_.length===0)throw ue('"suggestions" must be a non-empty array of {value, varName} objects');let E=_,k=Hx(v.items,E);await r.collection.saveCollection(v);let M=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(M)for(let I of E)r.environmentConfig.setEnvironmentVariable(I.varName,I.value,M);let j=Object.values(k).reduce((I,R)=>I+R,0);return{collection:v.name,applied:E.map(I=>({varName:I.varName,replacements:k[I.varName]??0})),totalReplacements:j,...M?{writtenToEnvironment:M}:{}}}if(t===G.getRequestsForEnhancement){let v=ot(e.collection,s),_=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=st(v).filter(({folderPath:j})=>!k||j.toLowerCase().includes(k)),M=P.slice(_,_+E).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),query:(j.query??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),currentBody:j.body?.type==="raw"&&typeof j.body.content=="string"?j.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,j.id,"post-response")??void 0}));return{collection:v.name,total:P.length,offset:_,limit:E,requests:M,hasMore:_+E<P.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===G.applyRequestEnhancements){let v=ot(e.collection,s),_=e.enhancements;if(!Array.isArray(_)||_.length===0)throw ue('"enhancements" must be a non-empty array');let E=[];for(let k of _){let{requestId:P,body:M,testScript:j}=k;if(!st(v).find(({request:A})=>A.id===P)){E.push({requestId:P,applied:["skipped: request not found"]});continue}let R=[];typeof M=="string"&&(await r.collection.updateRequest(v.id,P,{body:{type:"raw",content:M,format:"json"}}),R.push("body")),typeof j=="string"&&(await r.collection.setRequestScript(v.id,P,"post-response",j),R.push("testScript")),E.push({requestId:P,applied:R})}return{collection:v.name,results:E,totalUpdated:E.filter(k=>k.applied.length>0&&!k.applied[0].startsWith("skipped")).length}}if(t===G.analyzeCoverage||t===G.aiAnalyzeCoverage){let v=ot(e.collection,s),_=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=st(v).filter(({folderPath:F})=>!_||F.toLowerCase().includes(_)),k=E.map(({request:F,folderPath:U})=>{let J=((r.collection.getRequestScript(v.id,F.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:F.id,name:F.name,method:F.method,folder:U,hasAssertions:J>0,assertionCount:J}}),P=k.filter(F=>F.hasAssertions).length,M=k.length,j=M===0?100:Math.round(P/M*100),I=[],R=typeof e.specPath=="string"?e.specPath.trim():"";if(R)try{let F=r.workspaceFolder&&!Zi.isAbsolute(R)?Zi.join(r.workspaceFolder,R):R,U=op.readFileSync(F,"utf8"),{parse:D}=await Promise.resolve().then(()=>Qc(Dd())),Q=(R.endsWith(".json")?JSON.parse(U):D(U)).paths??{},se=["get","post","put","patch","delete","head","options"];for(let[fe,He]of Object.entries(Q))for(let _e of se){if(!(_e in He))continue;let ye=_e.toUpperCase();E.some(({request:ht})=>ht.method.toUpperCase()===ye&&(ht.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(fe.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||I.push({method:ye,path:fe})}}catch{}let A=k.filter(F=>!F.hasAssertions);if(t===G.aiAnalyzeCoverage){let F=[];return A.length>0&&F.push(`${A.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${v.name}") to add assertions to all of them.`),I.length>0&&F.push(`${I.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${v.name}") to generate negative and edge-case requests for them.`),F.length===0&&F.push(`Coverage is ${j}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...F,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:v.name,coveragePct:j,covered:P,total:M,untestedRequests:A,untestedOperations:I,expectedCallAfterThis:A.length>0?"ai_enhance_collection":I.length>0?"generate_scenarios":null}}}return{collection:v.name,coveragePct:j,covered:P,total:M,requests:k,...I.length>0?{untestedOperations:I}:{}}}if(t===G.generateRequestFromIntent){let v=ot(e.collection,s),_=typeof e.intent=="string"?e.intent.trim():"";if(!_)throw ue('"intent" is required \u2014 describe what to test in plain English');let k=st(v).slice(0,20).map(({request:M,folderPath:j})=>({name:M.name,method:M.method,url:M.url??"",folder:j})),P=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${_}"`,"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:v.name,intent:_,existingRequests:k,availableEnvVars:P,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===G.validateAgainstSpec){let v=ot(e.collection,s),_=typeof e.specPath=="string"?e.specPath.trim():"";if(!_)throw ue('"specPath" is required');let E=r.workspaceFolder&&!Zi.isAbsolute(_)?Zi.join(r.workspaceFolder,_):_,k;try{let D=op.readFileSync(E,"utf8"),{parse:J}=await Promise.resolve().then(()=>Qc(Dd()));k=_.endsWith(".json")?JSON.parse(D):J(D)}catch(D){throw new Error(`Could not load spec at "${E}": ${D instanceof Error?D.message:String(D)}`)}let P=k.paths??{},M=["get","post","put","patch","delete","head","options"],j=st(v),I=[],R=[],A=[],F=D=>D.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[D,J]of Object.entries(P))for(let Q of M){if(!(Q in J))continue;let se=J[Q],fe=Q.toUpperCase(),He=F(D),_e=j.find(({request:ye})=>ye.method.toUpperCase()===fe&&F(ye.url??"").includes(He));if(!_e)I.push({method:fe,path:D,operationId:se.operationId});else{let ye=r.collection.getRequestScript(v.id,_e.request.id,"post-response")??"";/pm\.test\s*\(/.test(ye)||R.push({method:fe,path:D,requestName:_e.request.name})}}let U=new Set(Object.entries(P).flatMap(([D,J])=>M.filter(Q=>Q in J).map(Q=>`${Q.toUpperCase()}:${F(D)}`)));for(let{request:D}of j){let J=F(D.url??""),Q=`${D.method.toUpperCase()}:`;[...U].some(fe=>fe.startsWith(Q)&&J.includes(fe.split(":")[1]))||A.push({method:D.method,url:D.url??"",requestName:D.name})}return{collection:v.name,spec:Zi.basename(_),summary:{untestedOperations:I.length,matchedWithoutAssertions:R.length,extraRequests:A.length},untestedOperations:I,matchedWithoutAssertions:R,extraRequests:A,hint:I.length>0?`Call generate_scenarios (collection="${v.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===G.generateScenarios){let v=ot(e.collection,s),_=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,E=typeof e.folder=="string"?e.folder.toLowerCase():void 0,k=typeof e.offset=="number"?Math.max(0,e.offset):0,P=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,M=st(v).filter(({request:I,folderPath:R})=>!(_&&I.name.toLowerCase()!==_&&!I.name.toLowerCase().includes(_)||E&&!R.toLowerCase().includes(E))),j=M.slice(k,k+P).map(({request:I,folderPath:R})=>({id:I.id,name:I.name,method:I.method,url:I.url??"",folder:R,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),body:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.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:v.name,requests:j,total:M.length,offset:k,hasMore:k+P<M.length,nextOffset:k+P,expectedCallAfterThis:"create_request"}}}if(t===G.healAssertions){let v=ot(e.collection,s),_=Qi(e.request,v),E=r.collection.getRequestScript(v.id,_.id,"post-response")??"",k,P=typeof e.runId=="string"?e.runId.trim():void 0;if(P)try{let j=n.require(P).allResults.find(I=>typeof I.name=="string"&&I.name.toLowerCase()===_.name.toLowerCase());j&&(k={status:j.status,responseBody:j.responseBody,responseHeaders:j.responseHeaders,failedTests:j.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${_.method} ${_.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:v.name,request:_.name,method:_.method,url:_.url??"",currentScript:E,lastResponse:k??null,note:k?"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===G.generateIterationData){let v=ot(e.collection,s),_=Qi(e.request,v),E=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,k=_.body?.type==="raw"&&typeof _.body.content=="string"?_.body.content:void 0,P=(_.headers??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),M=(_.query??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),j=/\{\{([^}]+)\}\}/g,I=new Set;for(let R of[_.url??"",k??"",...P.map(A=>A.value),...M.map(A=>A.value)]){let A;for(j.lastIndex=0;(A=j.exec(R))!==null;)I.add(A[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${E} test data rows for: ${_.method} ${_.url??""}`,`The request uses these {{variable}} placeholders: ${[...I].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:v.name,request:_.name,method:_.method,url:_.url??"",body:k??null,headers:P,queryParams:M,placeholders:[...I],iterations:E}}}let b=e.suite;if(typeof b!="string"||!b.trim())throw ue('the "suite" argument is required');let q=await r.testSuite.getAllSuites(),x=q.find(v=>v.id===b||v.name===b)??q.find(v=>v.name.toLowerCase()===b.toLowerCase());if(!x)throw ue(`test suite not found: "${b}"`);return i.runSuite(x.id,x.name,e)}var Wx,Jx=le(()=>{"use strict";Bx();fy();Ei();sp();Wx=new Set([G.createCollection,G.renameCollection,G.deleteCollection,G.duplicateCollection,G.createFolder,G.deleteFolder,G.createRequest,G.updateRequest,G.deleteRequest,G.reorderCollectionItems,G.createSuite,G.updateSuiteConfig,G.addSuiteNode,G.updateSuiteNode,G.removeSuiteNode,G.moveSuiteNode,G.duplicateSuite,G.deleteSuite])});function Do(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
365
+ });`,rationale:"Response body was non-JSON text."})}return{collection:E.name,request:k.name,suggestions:M.slice(0,P),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===G.explainFailure){let v=typeof e.runId=="string"?e.runId.trim():void 0,R=typeof e.request=="string"?e.request.trim():"",E=typeof e.iteration=="number"?e.iteration:1;if(v){let j=n.require(v);if(j.status==="running")return{runId:v,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!R)throw ue('"request" is required when "runId" is provided');let I=j.allResults.find(D=>D.iteration===E&&(D.name===R||typeof D.name=="string"&&D.name.toLowerCase()===R.toLowerCase()));if(!I)throw new Error(`Request "${R}" (iteration ${E}) not found in run "${v}".`);let _=I.assertions?.every(D=>D.passed)??!0,A=I.error,F=I.assertions?.filter(D=>!D.passed)??[],U="";return A?U=`The request itself failed to execute: ${A}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:F.length>0?U=`${F.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:_?U="No failures detected. The request appears to have passed.":U="The request was marked as failed but no specific errors were captured.",{runId:v,request:I.name,iteration:E,status:I.status??"unknown",passed:I.passed??!0,error:A??null,failedAssertions:F,allAssertions:I.assertions??[],requestDetails:{method:I.method,url:I.url,requestBody:I.requestBody},responseDetails:{status:I.responseStatus,headers:I.responseHeaders,body:I.responseBody},diagnosis:U,suggestedFixes:A?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:F.map(D=>`Fix assertion "${D.name}": ${D.message??"expected value mismatch"}`)}}let k=e.collection;if(!R)throw ue('"request" is required');let P=ot(k,s);return{request:Qi(e.request,P).name,collection:P.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===G.aiSuggestEnvVars){let v=ot(e.collection,s),R=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,k=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,P=Ry(v,R),M=st(v).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),query:(j.query??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),bodyExcerpt:j.body?.type==="raw"&&typeof j.body.content=="string"?j.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: "${v.name}", suggestions: [...], ${k?`environment: "${k}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:v.name,heuristicSuggestions:P.map(j=>({varName:j.varName,value:j.value,reason:j.reason})),requestSummary:M,expectedCallAfterThis:"apply_env_vars"}}}if(t===G.aiEnhanceCollection){let v=ot(e.collection,s),R=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=st(v).filter(({folderPath:I})=>!k||I.toLowerCase().includes(k)),M=P.slice(R,R+E).map(({request:I,folderPath:_})=>({id:I.id,name:I.name,folder:_,method:I.method,url:I.url,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),query:(I.query??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),currentBody:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.id,"post-response")??void 0})),j=R+E<P.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: "${v.name}", enhancements: [{ requestId, body?, testScript }] }`,j?`After applying, call ai_enhance_collection again with: { collection: "${v.name}", offset: ${R+E}, limit: ${E} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:v.name,total:P.length,offset:R,hasMore:j,nextOffset:j?R+E:void 0,requests:M,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===G.suggestEnvVars){let v=ot(e.collection,s),R=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,E=Ry(v,R),k=st(v).map(({request:P,folderPath:M})=>({id:P.id,name:P.name,folder:M,method:P.method,url:P.url,headers:(P.headers??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),query:(P.query??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),bodyExcerpt:P.body?.type==="raw"&&typeof P.body.content=="string"?P.body.content.slice(0,300):void 0}));return{collection:v.name,heuristicSuggestions:E.map(P=>({varName:P.varName,value:P.value,reason:P.reason,occurrences:P.occurrences.length})),requestSummary:k,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===G.applyEnvVars){let v=ot(e.collection,s),R=e.suggestions;if(!Array.isArray(R)||R.length===0)throw ue('"suggestions" must be a non-empty array of {value, varName} objects');let E=R,k=Hx(v.items,E);await r.collection.saveCollection(v);let M=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(M)for(let I of E)r.environmentConfig.setEnvironmentVariable(I.varName,I.value,M);let j=Object.values(k).reduce((I,_)=>I+_,0);return{collection:v.name,applied:E.map(I=>({varName:I.varName,replacements:k[I.varName]??0})),totalReplacements:j,...M?{writtenToEnvironment:M}:{}}}if(t===G.getRequestsForEnhancement){let v=ot(e.collection,s),R=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=st(v).filter(({folderPath:j})=>!k||j.toLowerCase().includes(k)),M=P.slice(R,R+E).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),query:(j.query??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),currentBody:j.body?.type==="raw"&&typeof j.body.content=="string"?j.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,j.id,"post-response")??void 0}));return{collection:v.name,total:P.length,offset:R,limit:E,requests:M,hasMore:R+E<P.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===G.applyRequestEnhancements){let v=ot(e.collection,s),R=e.enhancements;if(!Array.isArray(R)||R.length===0)throw ue('"enhancements" must be a non-empty array');let E=[];for(let k of R){let{requestId:P,body:M,testScript:j}=k;if(!st(v).find(({request:A})=>A.id===P)){E.push({requestId:P,applied:["skipped: request not found"]});continue}let _=[];typeof M=="string"&&(await r.collection.updateRequest(v.id,P,{body:{type:"raw",content:M,format:"json"}}),_.push("body")),typeof j=="string"&&(await r.collection.setRequestScript(v.id,P,"post-response",j),_.push("testScript")),E.push({requestId:P,applied:_})}return{collection:v.name,results:E,totalUpdated:E.filter(k=>k.applied.length>0&&!k.applied[0].startsWith("skipped")).length}}if(t===G.analyzeCoverage||t===G.aiAnalyzeCoverage){let v=ot(e.collection,s),R=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=st(v).filter(({folderPath:F})=>!R||F.toLowerCase().includes(R)),k=E.map(({request:F,folderPath:U})=>{let J=((r.collection.getRequestScript(v.id,F.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:F.id,name:F.name,method:F.method,folder:U,hasAssertions:J>0,assertionCount:J}}),P=k.filter(F=>F.hasAssertions).length,M=k.length,j=M===0?100:Math.round(P/M*100),I=[],_=typeof e.specPath=="string"?e.specPath.trim():"";if(_)try{let F=r.workspaceFolder&&!Zi.isAbsolute(_)?Zi.join(r.workspaceFolder,_):_,U=op.readFileSync(F,"utf8"),{parse:D}=await Promise.resolve().then(()=>Qc(Dd())),Q=(_.endsWith(".json")?JSON.parse(U):D(U)).paths??{},se=["get","post","put","patch","delete","head","options"];for(let[fe,He]of Object.entries(Q))for(let _e of se){if(!(_e in He))continue;let ye=_e.toUpperCase();E.some(({request:ht})=>ht.method.toUpperCase()===ye&&(ht.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(fe.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||I.push({method:ye,path:fe})}}catch{}let A=k.filter(F=>!F.hasAssertions);if(t===G.aiAnalyzeCoverage){let F=[];return A.length>0&&F.push(`${A.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${v.name}") to add assertions to all of them.`),I.length>0&&F.push(`${I.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${v.name}") to generate negative and edge-case requests for them.`),F.length===0&&F.push(`Coverage is ${j}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...F,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:v.name,coveragePct:j,covered:P,total:M,untestedRequests:A,untestedOperations:I,expectedCallAfterThis:A.length>0?"ai_enhance_collection":I.length>0?"generate_scenarios":null}}}return{collection:v.name,coveragePct:j,covered:P,total:M,requests:k,...I.length>0?{untestedOperations:I}:{}}}if(t===G.generateRequestFromIntent){let v=ot(e.collection,s),R=typeof e.intent=="string"?e.intent.trim():"";if(!R)throw ue('"intent" is required \u2014 describe what to test in plain English');let k=st(v).slice(0,20).map(({request:M,folderPath:j})=>({name:M.name,method:M.method,url:M.url??"",folder:j})),P=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${R}"`,"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:v.name,intent:R,existingRequests:k,availableEnvVars:P,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===G.validateAgainstSpec){let v=ot(e.collection,s),R=typeof e.specPath=="string"?e.specPath.trim():"";if(!R)throw ue('"specPath" is required');let E=r.workspaceFolder&&!Zi.isAbsolute(R)?Zi.join(r.workspaceFolder,R):R,k;try{let D=op.readFileSync(E,"utf8"),{parse:J}=await Promise.resolve().then(()=>Qc(Dd()));k=R.endsWith(".json")?JSON.parse(D):J(D)}catch(D){throw new Error(`Could not load spec at "${E}": ${D instanceof Error?D.message:String(D)}`)}let P=k.paths??{},M=["get","post","put","patch","delete","head","options"],j=st(v),I=[],_=[],A=[],F=D=>D.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[D,J]of Object.entries(P))for(let Q of M){if(!(Q in J))continue;let se=J[Q],fe=Q.toUpperCase(),He=F(D),_e=j.find(({request:ye})=>ye.method.toUpperCase()===fe&&F(ye.url??"").includes(He));if(!_e)I.push({method:fe,path:D,operationId:se.operationId});else{let ye=r.collection.getRequestScript(v.id,_e.request.id,"post-response")??"";/pm\.test\s*\(/.test(ye)||_.push({method:fe,path:D,requestName:_e.request.name})}}let U=new Set(Object.entries(P).flatMap(([D,J])=>M.filter(Q=>Q in J).map(Q=>`${Q.toUpperCase()}:${F(D)}`)));for(let{request:D}of j){let J=F(D.url??""),Q=`${D.method.toUpperCase()}:`;[...U].some(fe=>fe.startsWith(Q)&&J.includes(fe.split(":")[1]))||A.push({method:D.method,url:D.url??"",requestName:D.name})}return{collection:v.name,spec:Zi.basename(R),summary:{untestedOperations:I.length,matchedWithoutAssertions:_.length,extraRequests:A.length},untestedOperations:I,matchedWithoutAssertions:_,extraRequests:A,hint:I.length>0?`Call generate_scenarios (collection="${v.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===G.generateScenarios){let v=ot(e.collection,s),R=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,E=typeof e.folder=="string"?e.folder.toLowerCase():void 0,k=typeof e.offset=="number"?Math.max(0,e.offset):0,P=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,M=st(v).filter(({request:I,folderPath:_})=>!(R&&I.name.toLowerCase()!==R&&!I.name.toLowerCase().includes(R)||E&&!_.toLowerCase().includes(E))),j=M.slice(k,k+P).map(({request:I,folderPath:_})=>({id:I.id,name:I.name,method:I.method,url:I.url??"",folder:_,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),body:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.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:v.name,requests:j,total:M.length,offset:k,hasMore:k+P<M.length,nextOffset:k+P,expectedCallAfterThis:"create_request"}}}if(t===G.healAssertions){let v=ot(e.collection,s),R=Qi(e.request,v),E=r.collection.getRequestScript(v.id,R.id,"post-response")??"",k,P=typeof e.runId=="string"?e.runId.trim():void 0;if(P)try{let j=n.require(P).allResults.find(I=>typeof I.name=="string"&&I.name.toLowerCase()===R.name.toLowerCase());j&&(k={status:j.status,responseBody:j.responseBody,responseHeaders:j.responseHeaders,failedTests:j.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${R.method} ${R.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:v.name,request:R.name,method:R.method,url:R.url??"",currentScript:E,lastResponse:k??null,note:k?"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===G.generateIterationData){let v=ot(e.collection,s),R=Qi(e.request,v),E=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,k=R.body?.type==="raw"&&typeof R.body.content=="string"?R.body.content:void 0,P=(R.headers??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),M=(R.query??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),j=/\{\{([^}]+)\}\}/g,I=new Set;for(let _ of[R.url??"",k??"",...P.map(A=>A.value),...M.map(A=>A.value)]){let A;for(j.lastIndex=0;(A=j.exec(_))!==null;)I.add(A[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${E} test data rows for: ${R.method} ${R.url??""}`,`The request uses these {{variable}} placeholders: ${[...I].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:v.name,request:R.name,method:R.method,url:R.url??"",body:k??null,headers:P,queryParams:M,placeholders:[...I],iterations:E}}}let b=e.suite;if(typeof b!="string"||!b.trim())throw ue('the "suite" argument is required');let q=await r.testSuite.getAllSuites(),x=q.find(v=>v.id===b||v.name===b)??q.find(v=>v.name.toLowerCase()===b.toLowerCase());if(!x)throw ue(`test suite not found: "${b}"`);return i.runSuite(x.id,x.name,e)}var Wx,Jx=le(()=>{"use strict";Bx();fy();Ei();sp();Wx=new Set([G.createCollection,G.renameCollection,G.deleteCollection,G.duplicateCollection,G.createFolder,G.deleteFolder,G.createRequest,G.updateRequest,G.deleteRequest,G.reorderCollectionItems,G.createSuite,G.updateSuiteConfig,G.addSuiteNode,G.updateSuiteNode,G.removeSuiteNode,G.moveSuiteNode,G.duplicateSuite,G.deleteSuite])});function Do(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
366
366
  \u2026 (truncated, ${t.length-e} chars omitted)`}function ap(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 iN(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 y5(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(m=>!m.passed)),l=i.summary,c=o.length,d=`I ran an HTTP API test suite and got failures. Please analyze the results and provide:
367
367
 
368
368
  1. **Root cause** for each failure
@@ -378,7 +378,7 @@ Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and i
378
378
  ## Failed Requests
379
379
  `;if(c===0)d+=`
380
380
  (No failures found`,n&&(d+=` matching "${t.request}"`),d+=`. The run may have passed entirely or the filter matched nothing.)
381
- `;else{for(let p of o.slice(0,20)){let m=String(p.name??"(unknown)"),y=String(p.method??""),b=String(p.url??""),q=p.responseStatus??p.status??"?",x=p.error,_=(p.assertions??[]).filter(M=>!M.passed),E=p.failedTests??_,k=typeof p.body=="string"?Do(ap(p.body),600):p.body?Do(ap(JSON.stringify(p.body)),600):"",P=typeof p.requestBody=="string"?Do(ap(p.requestBody),400):p.requestBody?Do(ap(JSON.stringify(p.requestBody)),400):"";if(d+=`
381
+ `;else{for(let p of o.slice(0,20)){let m=String(p.name??"(unknown)"),y=String(p.method??""),b=String(p.url??""),q=p.responseStatus??p.status??"?",x=p.error,R=(p.assertions??[]).filter(M=>!M.passed),E=p.failedTests??R,k=typeof p.body=="string"?Do(ap(p.body),600):p.body?Do(ap(JSON.stringify(p.body)),600):"",P=typeof p.requestBody=="string"?Do(ap(p.requestBody),400):p.requestBody?Do(ap(JSON.stringify(p.requestBody)),400):"";if(d+=`
382
382
  ### ${m}`,(y||b)&&(d+=` [${y} ${b}]`),d+=`
383
383
  - HTTP status received: ${q}`,x&&(d+=`
384
384
  - Request error: ${x}`),P&&(d+=`
@@ -395,9 +395,9 @@ ${k}
395
395
  `}c>20&&(d+=`
396
396
  _(${c-20} more failures omitted \u2014 fix the above first)_
397
397
  `)}return d+=`
398
- Please diagnose each failure and provide concrete, actionable fixes.`,{description:`Analyze ${c} failure(s) from run "${r}"`,messages:[{role:"user",content:{type:"text",text:d}}]}}async function v5(t,e,r){let n=iN(t.collection,e),i=st(n),s=t.request.toLowerCase(),o=i.find(q=>q.request.id===t.request||q.request.name===t.request)??i.find(q=>q.request.name.toLowerCase()===s)??i.find(q=>q.request.name.toLowerCase().includes(s));if(!o)throw new Error(`Request "${t.request}" not found in collection "${n.name}"`);let l=o.request,c=e.getRequestScript(n.id,l.id,"pre-request")??"",d=e.getRequestScript(n.id,l.id,"post-response")??"",p="";if(t.runId){let q=r.get(t.runId);if(q&&q.status!=="running"){let v=(q.allResults??[]).find(_=>typeof _.name=="string"&&_.name.toLowerCase()===l.name.toLowerCase());if(v){let _=v.responseStatus??v.status,E=typeof v.responseBody=="string"?Do(ap(v.responseBody),1500):"",k=v.responseHeaders?Do(JSON.stringify(v.responseHeaders,null,2),500):"";p=`
398
+ Please diagnose each failure and provide concrete, actionable fixes.`,{description:`Analyze ${c} failure(s) from run "${r}"`,messages:[{role:"user",content:{type:"text",text:d}}]}}async function v5(t,e,r){let n=iN(t.collection,e),i=st(n),s=t.request.toLowerCase(),o=i.find(q=>q.request.id===t.request||q.request.name===t.request)??i.find(q=>q.request.name.toLowerCase()===s)??i.find(q=>q.request.name.toLowerCase().includes(s));if(!o)throw new Error(`Request "${t.request}" not found in collection "${n.name}"`);let l=o.request,c=e.getRequestScript(n.id,l.id,"pre-request")??"",d=e.getRequestScript(n.id,l.id,"post-response")??"",p="";if(t.runId){let q=r.get(t.runId);if(q&&q.status!=="running"){let v=(q.allResults??[]).find(R=>typeof R.name=="string"&&R.name.toLowerCase()===l.name.toLowerCase());if(v){let R=v.responseStatus??v.status,E=typeof v.responseBody=="string"?Do(ap(v.responseBody),1500):"",k=v.responseHeaders?Do(JSON.stringify(v.responseHeaders,null,2),500):"";p=`
399
399
  ## Observed Response (run ${t.runId})
400
- - Status: ${_}
400
+ - Status: ${R}
401
401
  `,k&&(p+=`- Headers:
402
402
  \`\`\`json
403
403
  ${k}
@@ -473,12 +473,12 @@ Please provide recommendations for:
473
473
  5. **Authentication** \u2014 is auth consistent across requests that need it?
474
474
  6. **Environment variables** \u2014 are URLs and credentials properly parameterized?
475
475
 
476
- 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 Gx(t,e,r,n){switch(t){case"analyze-test-failure":return y5(e,n);case"suggest-assertions":return v5(e,r,n);case"review-collection":return b5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${Iy.map(i=>i.name).join(", ")}`)}}var Iy,Yx=le(()=>{"use strict";Ei();Iy=[{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 lp,Kx=le(()=>{"use strict";lp=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)}}});import{createHash as S5}from"crypto";function sN(t){return S5("sha256").update(t,"utf8").digest("hex").slice(0,w5)}function x5(t){let e=t.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/__+/g,"_").replace(/^_+|_+$/g,"").toLowerCase();return e?e.slice(0,_5):"id"}function $s(t){return`${x5(t)}_${sN(t)}`}function C5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function nl(t,e=R5){return C5(t,e)?t:$s(t)}function Qx(t,e,r){let n=`${t}request__${nl(e)}__${nl(r)}`;return n.length<=Oy?n:`${t}request__${$s(e)}__${$s(r)}`}function Zx(t,e){let r=`${t}collection__${nl(e,100)}`;return r.length<=Oy?r:`${t}collection__${$s(e)}`}function Xx(t,e,r){let n=`${t}folder__${nl(e)}__${nl(r)}`;return n.length<=Oy?n:`${t}folder__${$s(e)}__${$s(r)}`}function eC(t,e){let r=`${t}suite__${nl(e,100)}`;return r.length<=Oy?r:`${t}suite__${$s(e)}`}function tC(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 nc(t,e){let r=t.includes("_")?t.slice(t.lastIndexOf("_")+1):t;for(let n of e)if(sN(n)===r)return n;for(let n of e)if($s(n)===t)return n;for(let n of e)if(n===t)return n}function rC(t,e){let r=nc(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 nC(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function iC(t,e){return`Run all ${e} requests in the "${t}" collection.`}function sC(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function oC(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var w5,_5,R5,Oy,Py=le(()=>{"use strict";w5=12,_5=16,R5=60,Oy=126});function aC(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 lC(t){return Buffer.from(String(t)).toString("base64url")}function uC(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 cC(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let d of t)o+=st(d).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 aC(Vx(n,t.map(d=>d.name),e.map(d=>d.name)).map(d=>({name:d.name,description:d.description,inputSchema:d.inputSchema,...d.annotations&&{annotations:d.annotations}})));let c=[];for(let d of t){let p=st(d);for(let{request:m,folderPath:y}of p)c.push({name:Qx(n,d.id,m.id),description:nC(m.method,m.name,d.name,y),inputSchema:xy});c.push({name:Zx(n,d.id),description:iC(d.name,p.length),inputSchema:Cy});for(let{folderPath:m,requestCount:y}of fn(d))y!==0&&c.push({name:Xx(n,d.id,m),description:sC(m,d.name,y),inputSchema:Ey})}for(let d of e)c.push({name:eC(n,d.id),description:oC(d.name,d.nodes.filter(p=>p.type==="request").length,d.config.iterations),inputSchema:qy});return aC(c)}var fC=le(()=>{"use strict";Ei();Py();sp()});function ky(t){let e=typeof t.blockLabel=="string"?t.blockLabel.trim():"";if(e)return{groupPath:e,groupType:"block"};let r=typeof t.collectionName=="string"?t.collectionName.trim():"",n=typeof t.folderPath=="string"?t.folderPath.trim():"";return r?{groupPath:n?`${r}/${n}`:r,groupType:"folder"}:{groupPath:n,groupType:n?"folder":void 0}}var dC=le(()=>{"use strict"});var ic,pC=le(()=>{"use strict";ga();ic=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())Ct.isExpired(n)||(!n.domain||Ct.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&&!Ct.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())Ct.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=Ct.extractDomain(e),i=Ct.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=Ct.extractDomain(e),n=Ct.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return Ct.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function sc(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function E5(t){return{index:t.i,iteration:t.it,name:t.n,method:jo[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:sc(t.i,t.it,t.r),error:t.e}}var hC,jo,up=le(()=>{"use strict";hC={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},jo={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as ac from"fs/promises";import*as oc from"path";function Xi(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function mC(t){return(Math.max(0,t)/1e3).toFixed(3)}var lc,gC=le(()=>{"use strict";up();lc=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=oc.join(this.basePath,e,r),i=JSON.parse(await ac.readFile(oc.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),c=oc.join(n,"junit.xml");return await ac.writeFile(c,l,"utf-8"),c}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=oc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await ac.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=sc(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await ac.readFile(oc.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 c=n.get(`${l.i}-${l.it}`),d=l.cn||c?.collectionName||e.suiteName||"",p=l.fp||c?.folderPath||"",m=`${d}\0${p}`;if(!o.has(m)){let x=[d,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(m,{label:x,cases:[]}),s.push(m)}let y=l.n||c?.name||jo[l.m]||"request",b=i?`${y} (iteration ${l.it})`:y,q=(c?.assertions??[]).filter(x=>!x.passed).map(x=>({name:x.name,message:x.message}));q.length===0&&l.af>0&&q.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(m).cases.push({name:b,classname:[d,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??c?.error??null,failedAssertions:q,consoleOutput:c?.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,c=0,d=[];i.forEach((y,b)=>{let q=0,x=0,v=0,_=0,E=[];for(let k of y.cases){q++,_+=k.durationMs;let P=!k.passed&&k.failedAssertions.length===0&&!!k.error,M=!k.passed&&!P;P&&v++,M&&x++;let j=[];if(M){let R=k.failedAssertions.length>0?k.failedAssertions.map(F=>F.name).join("; "):k.error||"Assertion failed",A=k.failedAssertions.map(F=>F.message?`${F.name}: ${F.message}`:F.name).join(`
477
- `);j.push(` <failure message="${Xi(R)}" type="AssertionFailure">${Xi(A)}</failure>`)}P&&j.push(` <error message="${Xi(k.error)}" type="RequestError">${Xi(k.error)}</error>`),k.consoleOutput&&k.consoleOutput.length>0&&j.push(` <system-out>${Xi(k.consoleOutput.join(`
476
+ 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 Gx(t,e,r,n){switch(t){case"analyze-test-failure":return y5(e,n);case"suggest-assertions":return v5(e,r,n);case"review-collection":return b5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${Iy.map(i=>i.name).join(", ")}`)}}var Iy,Yx=le(()=>{"use strict";Ei();Iy=[{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 lp,Kx=le(()=>{"use strict";lp=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)}}});import{createHash as S5}from"crypto";function sN(t){return S5("sha256").update(t,"utf8").digest("hex").slice(0,w5)}function x5(t){let e=t.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/__+/g,"_").replace(/^_+|_+$/g,"").toLowerCase();return e?e.slice(0,_5):"id"}function $s(t){return`${x5(t)}_${sN(t)}`}function C5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function nl(t,e=R5){return C5(t,e)?t:$s(t)}function Qx(t,e,r){let n=`${t}request__${nl(e)}__${nl(r)}`;return n.length<=Oy?n:`${t}request__${$s(e)}__${$s(r)}`}function Zx(t,e){let r=`${t}collection__${nl(e,100)}`;return r.length<=Oy?r:`${t}collection__${$s(e)}`}function Xx(t,e,r){let n=`${t}folder__${nl(e)}__${nl(r)}`;return n.length<=Oy?n:`${t}folder__${$s(e)}__${$s(r)}`}function eC(t,e){let r=`${t}suite__${nl(e,100)}`;return r.length<=Oy?r:`${t}suite__${$s(e)}`}function tC(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 nc(t,e){let r=t.includes("_")?t.slice(t.lastIndexOf("_")+1):t;for(let n of e)if(sN(n)===r)return n;for(let n of e)if($s(n)===t)return n;for(let n of e)if(n===t)return n}function rC(t,e){let r=nc(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 nC(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function iC(t,e){return`Run all ${e} requests in the "${t}" collection.`}function sC(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function oC(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var w5,_5,R5,Oy,Py=le(()=>{"use strict";w5=12,_5=16,R5=60,Oy=126});function aC(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 lC(t){return Buffer.from(String(t)).toString("base64url")}function uC(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 cC(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let d of t)o+=st(d).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 aC(Vx(n,t.map(d=>d.name),e.map(d=>d.name)).map(d=>({name:d.name,description:d.description,inputSchema:d.inputSchema,...d.annotations&&{annotations:d.annotations}})));let c=[];for(let d of t){let p=st(d);for(let{request:m,folderPath:y}of p)c.push({name:Qx(n,d.id,m.id),description:nC(m.method,m.name,d.name,y),inputSchema:xy});c.push({name:Zx(n,d.id),description:iC(d.name,p.length),inputSchema:Cy});for(let{folderPath:m,requestCount:y}of fn(d))y!==0&&c.push({name:Xx(n,d.id,m),description:sC(m,d.name,y),inputSchema:Ey})}for(let d of e)c.push({name:eC(n,d.id),description:oC(d.name,d.nodes.filter(p=>p.type==="request").length,d.config.iterations),inputSchema:qy});return aC(c)}var fC=le(()=>{"use strict";Ei();Py();sp()});function ky(t){let e=typeof t.blockLabel=="string"?t.blockLabel.trim():"";if(e)return{groupPath:e,groupType:"block"};let r=typeof t.collectionName=="string"?t.collectionName.trim():"",n=typeof t.folderPath=="string"?t.folderPath.trim():"";return r?{groupPath:n?`${r}/${n}`:r,groupType:"folder"}:{groupPath:n,groupType:n?"folder":void 0}}var dC=le(()=>{"use strict"});var ic,pC=le(()=>{"use strict";ga();ic=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())Ct.isExpired(n)||(!n.domain||Ct.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&&!Ct.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())Ct.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=Ct.extractDomain(e),i=Ct.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=Ct.extractDomain(e),n=Ct.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return Ct.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function sc(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function E5(t){return{index:t.i,iteration:t.it,name:t.n,method:jo[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:sc(t.i,t.it,t.r),error:t.e}}var hC,jo,up=le(()=>{"use strict";hC={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},jo={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as ac from"fs/promises";import*as oc from"path";function Xi(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function mC(t){return(Math.max(0,t)/1e3).toFixed(3)}var lc,gC=le(()=>{"use strict";up();lc=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=oc.join(this.basePath,e,r),i=JSON.parse(await ac.readFile(oc.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),c=oc.join(n,"junit.xml");return await ac.writeFile(c,l,"utf-8"),c}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=oc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await ac.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=sc(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await ac.readFile(oc.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 c=n.get(`${l.i}-${l.it}`),d=l.cn||c?.collectionName||e.suiteName||"",p=l.fp||c?.folderPath||"",m=`${d}\0${p}`;if(!o.has(m)){let x=[d,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(m,{label:x,cases:[]}),s.push(m)}let y=l.n||c?.name||jo[l.m]||"request",b=i?`${y} (iteration ${l.it})`:y,q=(c?.assertions??[]).filter(x=>!x.passed).map(x=>({name:x.name,message:x.message}));q.length===0&&l.af>0&&q.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(m).cases.push({name:b,classname:[d,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??c?.error??null,failedAssertions:q,consoleOutput:c?.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,c=0,d=[];i.forEach((y,b)=>{let q=0,x=0,v=0,R=0,E=[];for(let k of y.cases){q++,R+=k.durationMs;let P=!k.passed&&k.failedAssertions.length===0&&!!k.error,M=!k.passed&&!P;P&&v++,M&&x++;let j=[];if(M){let _=k.failedAssertions.length>0?k.failedAssertions.map(F=>F.name).join("; "):k.error||"Assertion failed",A=k.failedAssertions.map(F=>F.message?`${F.name}: ${F.message}`:F.name).join(`
477
+ `);j.push(` <failure message="${Xi(_)}" type="AssertionFailure">${Xi(A)}</failure>`)}P&&j.push(` <error message="${Xi(k.error)}" type="RequestError">${Xi(k.error)}</error>`),k.consoleOutput&&k.consoleOutput.length>0&&j.push(` <system-out>${Xi(k.consoleOutput.join(`
478
478
  `))}</system-out>`);let I=` <testcase name="${Xi(k.name)}" classname="${Xi(k.classname)}" time="${mC(k.durationMs)}"`;j.length===0?E.push(`${I} />`):E.push(`${I}>
479
479
  ${j.join(`
480
480
  `)}
481
- </testcase>`)}s+=q,o+=x,l+=v,c+=_,d.push(` <testsuite name="${Xi(y.label)}" tests="${q}" failures="${x}" errors="${v}" skipped="0" time="${mC(_)}" timestamp="${Xi(e.startTime)}" id="${b}">
481
+ </testcase>`)}s+=q,o+=x,l+=v,c+=R,d.push(` <testsuite name="${Xi(y.label)}" tests="${q}" failures="${x}" errors="${v}" skipped="0" time="${mC(R)}" timestamp="${Xi(e.startTime)}" id="${b}">
482
482
  ${E.join(`
483
483
  `)}
484
484
  </testsuite>`)});let p='<?xml version="1.0" encoding="UTF-8"?>',m=`<testsuites name="${Xi(e.suiteName)}" tests="${s}" failures="${o}" errors="${l}" skipped="0" time="${mC(c)}">`;return`${p}
@@ -518,8 +518,8 @@ ${d.join(`
518
518
  <td>${b.p90!==void 0?il(b.p90):"\u2014"}</td>
519
519
  <td>${b.p99!==void 0?il(b.p99):"\u2014"}</td>
520
520
  <td class="${b.failed>0?"fail":"pass"}">${q}</td>
521
- </tr>`}).join(""),l=Math.max(...r.map(b=>b.d),1),c=b=>{let q=jo[b.m]??"GET",x=Math.max(2,Math.round(b.d/l*100)),v=b.p?"bar-pass":"bar-fail",_=b.p?"":' class="row-fail"',E=`req-${b.i}-${b.it}`;return`
522
- <tr${_}>
521
+ </tr>`}).join(""),l=Math.max(...r.map(b=>b.d),1),c=b=>{let q=jo[b.m]??"GET",x=Math.max(2,Math.round(b.d/l*100)),v=b.p?"bar-pass":"bar-fail",R=b.p?"":' class="row-fail"',E=`req-${b.i}-${b.it}`;return`
522
+ <tr${R}>
523
523
  <td class="dim">${b.i}</td>
524
524
  <td>${b.it}</td>
525
525
  <td><span class="method method-${q.toLowerCase()}">${q}</span></td>
@@ -528,12 +528,12 @@ ${d.join(`
528
528
  <td>${il(b.d)}</td>
529
529
  <td><div class="bar-wrap"><div class="${v}" style="width:${x}%"></div></div></td>
530
530
  <td class="${b.p?"pass":"fail"}">${b.p?"\u2713":"\u2717"}</td>
531
- </tr>`},d=this.renderGroupedTimeline(r,e,c),p=b=>{let q=`${b.i}-${b.it}`,x=n.get(q),v=jo[b.m]??"GET",_=`req-${b.i}-${b.it}`,E=b.p,k=E?"#1f6feb40":"#f8514940",P=x?.assertions?.length?`<ul class="assert-list">${x.assertions.map(Rt=>`
531
+ </tr>`},d=this.renderGroupedTimeline(r,e,c),p=b=>{let q=`${b.i}-${b.it}`,x=n.get(q),v=jo[b.m]??"GET",R=`req-${b.i}-${b.it}`,E=b.p,k=E?"#1f6feb40":"#f8514940",P=x?.assertions?.length?`<ul class="assert-list">${x.assertions.map(Rt=>`
532
532
  <li class="${Rt.passed?"pass":"fail"}">
533
533
  <span class="assert-icon">${Rt.passed?"\u2713":"\u2717"}</span>
534
534
  ${$t(Rt.name)}
535
535
  ${Rt.message?`<span class="assert-msg"> \u2014 ${$t(Rt.message)}</span>`:""}
536
- </li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',M=oN(x?.request?.headers),j=vC(x?{method:x.request?.method,url:x.request?.url,query:x.request?.query,params:x.request?.params,bodyType:x.request?.body?.type,bodyFormat:x.request?.body?.format}:void 0),I=x?.request?.body,R=I&&typeof I=="object"?I.type:void 0,A=I&&typeof I=="object"&&"content"in I?I.content:I,F=R!=="none"&&!(A==null||A===""),U=F?aN(A):"",D=oN(x?.response?.headers),J=vC(x?{status:x.status,statusText:x.statusText,durationMs:x.duration,responseTimeMs:x.response?.time,responseSizeBytes:x.response?.size}:void 0),Q=x?.response?.body!==void 0&&x.response.body!==null?aN(x.response.body):'<span class="dim">\u2014 no body \u2014</span>',se=O5(x?.response?.cookies),fe=vC(x?{timestamp:x.timestamp?new Date(x.timestamp).toISOString():void 0,nextRequest:x.nextRequest,visualizerTemplate:x.visualizerData?.template,visualizerData:x.visualizerData?.data}:void 0),He=`
536
+ </li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',M=oN(x?.request?.headers),j=vC(x?{method:x.request?.method,url:x.request?.url,query:x.request?.query,params:x.request?.params,bodyType:x.request?.body?.type,bodyFormat:x.request?.body?.format}:void 0),I=x?.request?.body,_=I&&typeof I=="object"?I.type:void 0,A=I&&typeof I=="object"&&"content"in I?I.content:I,F=_!=="none"&&!(A==null||A===""),U=F?aN(A):"",D=oN(x?.response?.headers),J=vC(x?{status:x.status,statusText:x.statusText,durationMs:x.duration,responseTimeMs:x.response?.time,responseSizeBytes:x.response?.size}:void 0),Q=x?.response?.body!==void 0&&x.response.body!==null?aN(x.response.body):'<span class="dim">\u2014 no body \u2014</span>',se=O5(x?.response?.cookies),fe=vC(x?{timestamp:x.timestamp?new Date(x.timestamp).toISOString():void 0,nextRequest:x.nextRequest,visualizerTemplate:x.visualizerData?.template,visualizerData:x.visualizerData?.data}:void 0),He=`
537
537
  <div class="detail-section">
538
538
  <div class="pane-section-title">Assertions
539
539
  <span class="assert-counts">
@@ -584,7 +584,7 @@ ${d.join(`
584
584
  ${Q}
585
585
  </div>`,ht=ye.length<=Pe.length,Nt=ht?_e:"",he=ht?"":_e,Yt=x?.consoleOutput?.length?`<div class="console-block"><pre class="code console-code">${x.consoleOutput.map(Rt=>$t(typeof Rt=="string"?Rt:JSON.stringify(Rt))).join(`
586
586
  `)}</pre></div>`:"",Ar=x?.error?`<div class="error-box">\u26A0 ${$t(x.error)}</div>`:"",at=x?`<span class="${Ay(x.status)} status-badge">${x.status} ${$t(x.statusText??"")}</span>`:"",Tr=`<span class="dur-badge">${il(b.d)}</span>`,wr=e.config.iterations>1?`<span class="iter-badge">iter ${b.it}</span>`:"";return`
587
- <details class="req-detail ${E?"req-pass":"req-fail"}" id="${_}" style="--border:${k}">
587
+ <details class="req-detail ${E?"req-pass":"req-fail"}" id="${R}" style="--border:${k}">
588
588
  <summary class="req-summary">
589
589
  <span class="toggle-icon">\u25B6</span>
590
590
  <span class="req-index dim">#${b.i}</span>
@@ -1015,10 +1015,10 @@ ${d.join(`
1015
1015
  </html>`}}});import*as ir from"fs/promises";import*as dn from"path";function sl(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 fc,SC=le(()=>{"use strict";jn();od();bC();up();fc=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=dn.join(this.basePath,e,s),await ir.mkdir(dn.join(this.currentRunPath,"results"),{recursive:!0}),await ir.mkdir(dn.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=Wt(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,c=dn.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",groupPath:r.groupPath||r.folderPath||"",groupType:r.groupType,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(b=>({name:b.name,passed:b.passed,message:b.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 ir.writeFile(c,JSON.stringify(I0(d),null,2),"utf-8");let p=r.assertions.filter(b=>b.passed).length,m=r.assertions.filter(b=>!b.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:hC[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:m,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",gp:r.groupPath||r.folderPath||"",gt:r.groupType,cn:r.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",r=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let c in this.currentManifest.requestStats){let d=this.currentManifest.requestStats[c],p=this.requestDurations[c]||[];d.count>0&&(d.avgDuration=Math.round(d.totalDuration/d.count)),d.minDuration===Number.MAX_SAFE_INTEGER&&(d.minDuration=0),p.length>0&&(p.sort((m,y)=>m-y),d.p50=sl(p,50),d.p90=sl(p,90),d.p95=sl(p,95),d.p99=sl(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((c,d)=>c-d),this.currentManifest.stats.p50=sl(n,50),this.currentManifest.stats.p95=sl(n,95),this.currentManifest.stats.p99=sl(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 cp(this.basePath).generate(o,l)}catch(c){console.warn("[ResultStorage] HTML report generation failed:",c)}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=dn.join(this.basePath,e,r,"results",n),s=await ir.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=dn.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await ir.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=dn.join(this.basePath,e,r,"manifest.json"),i=await ir.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=dn.join(this.basePath,e);try{let n=await ir.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 ir.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=dn.join(this.basePath,e,r);await ir.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 c=await this.listRuns(l);for(let d of c)if(new Date(d.startTime)<n){let p=dn.join(this.basePath,l,d.runId),m=await this.getDirectorySize(p);await ir.rm(p,{recursive:!0,force:!0}),i++,s+=m}}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=dn.join(this.currentRunPath,"manifest.json");await ir.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=dn.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await ir.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 ir.readdir(e,{withFileTypes:!0});for(let i of n){let s=dn.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await ir.stat(s);r+=o.size}}}catch{}return r}}});function fp(t){return typeof t=="string"?t:""+JSON.stringify(t)}function dc(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function wC(t){if(!t)return{};let e={};for(let[r,n]of Object.entries(t))e[r]=dc(n);return e}var _C=le(()=>{"use strict"});import*as es from"fs";import*as dp from"path";var RC,Ty,$y,Ny,uN=le(()=>{"use strict";RC=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=es.watch(n,{recursive:!0},(s,o)=>{if(o){let l=dp.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:dp.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=[]}},Ty=class{createFileWatcher(e,r){return new RC(e,r)}},$y=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(es.existsSync(this.storeFile)){let e=es.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=dp.dirname(this.storeFile);es.mkdirSync(e,{recursive:!0}),es.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()}},Ny=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as ol from"path";function cN(t){let e=ol.resolve(t.workspaceFolder),{appInfo:r}=t,n=rl.createFresh(),i=ol.join(e,".http-forge",".cache","stores","global-state.json"),s=t.globalStorePath?ol.isAbsolute(t.globalStorePath)?t.globalStorePath:ol.resolve(e,t.globalStorePath):i,o={workspaceFolder:e,fileWatcherFactory:new Ty,notificationService:new Ny,globalStore:new $y(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return _y(n,o),n}function Yn(t){return cN({workspaceFolder:t})}var My=le(()=>{"use strict";jx();Lx();uN()});function P5(t){let e=[];return t.map(r=>{let n=Ln(r,e);return e.push(n),n})}function fN(t,e,r,n){let i=t.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=P5(t.map(d=>d.name)),o=t.filter((d,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new al(r,e,o.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),c=t.filter(d=>d.name.toLowerCase()===l);if(c.length===1)return{item:c[0],tier:"name"};throw c.length>1?new al(r,e,c.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function xC(t,e){let{item:r,tier:n}=fN(t,e,"collection",()=>"");return{collection:r,tier:n}}function CC(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(m=>m.type==="folder"),c=i.join("/"),{item:d,tier:p}=fN(l,o,"folder",m=>c?`${c}/${m.name}`:m.name);i.push(d.name),s.push(p),n=d.items??[]}return{folderPath:i.map(Sr).join("/"),tiers:s}}function dN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=Ln(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}/${Sr(s.name)}`:Sr(s.name);dN(s.items??[],o,r)}}function EC(t,e,r){let n=[];dN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,o=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let c=s.filter(y=>y.slug===e);if(c.length===1)return{request:c[0].item,tier:"slug",folderPath:c[0].folderPath};if(c.length>1)throw new al("request",e,c.map(y=>({id:y.item.id,name:y.item.name,path:o(y)})));let d=e.toLowerCase(),p=s.filter(y=>y.item.name.toLowerCase()===d);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new al("request",e,p.map(y=>({id:y.item.id,name:y.item.name,path:o(y)})));let m=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${m}`)}var al,qC=le(()=>{"use strict";ma();Ei();al=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
1016
1016
  `+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
1017
1017
  `)+`
1018
- Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var hp={};io(hp,{runCollection:()=>Ns,runFolder:()=>M5,runRequest:()=>Dy,runSuite:()=>pp});function OC(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function hN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function k5(){return hN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function A5(){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 mN(t,e=[]){return hN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function IC(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 gN(t){return Wi(T5(t))}function yN(t){return x0((t??[]).map(e=>({name:e.name,value:e.value})))}function pN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function vN(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 bN(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 Fy(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function SN(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 PC(t,e,r=t.items,n=[],i=[],s=[]){for(let o of r){if(o.type==="request"&&o.id===e)return{request:o,folderScriptsChain:[...n],folderAuthChain:[...i],folderPath:s.map(Sr).join("/")};if(o.type==="folder"){let l=o,c=l.scripts?[...n,l.scripts]:[...n],d=l.auth?[...i,l.auth]:[...i],p=[...s,l.name],m=PC(t,e,l.items??[],c,d,p);if(m)return m}}}function wN(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(Sr).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],c=[...n,o.name];i.push(...wN(t,o.items??[],l,c))}return i}function $5(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 N5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function _N(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}=xC(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 RN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=CC(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function xN(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,c=Math.max(1,Math.min(50,r.concurrency??1)),d=r.requestFilter,p=r.include??[],m=r.reporters??[],y=m.includes("junit"),b=Fy(r.variables),q=k5(),x=mN(p,m),v=Math.max(1,Math.min(1e4,Number(r.maxNodeLoopIterations??100))),_={vars:{...b}};function E(te){if(typeof te=="string")return te;if(Array.isArray(te))return te.filter(Ae=>typeof Ae=="string").join(`
1019
- `)}function k(te){if(!(!te||typeof te!="object")){if(te.script!==void 0)return te.script;if(typeof te.scriptRef=="string"&&te.scriptRef.trim()){let re=e?.scripts;if(re&&typeof re=="object")return re[te.scriptRef]}}}function P(te){return te?.name||te?.label||te?.id||"flow-node"}function M(te,re){let Ae=t.environmentConfig.getResolvedEnvironment(i),ge=wC(_.vars),sr={variables:{get:oe=>dc(_.vars[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&(_.vars[oe]=fp(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&delete _.vars[oe]},has:oe=>Object.prototype.hasOwnProperty.call(_.vars,oe),toObject:()=>({...ge})},environment:{get:oe=>dc(Ae?.variables?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setEnvironmentVariable(oe,fp(fr),i)},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteEnvironmentVariable(oe,i)},clear:()=>{t.environmentConfig.clearEnvironmentVariables(i)}},globals:{get:oe=>dc(t.environmentConfig.getGlobalVariables()?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setGlobalVariable(oe,fp(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteGlobalVariable(oe)},clear:()=>{t.environmentConfig.clearGlobalVariables()}}};return{vars:ge,lastResult:_.lastResult,iteration:re,node:te,pm:sr,ctx:sr,hf:sr}}function j(te,re,Ae){return typeof te!="string"||!te.trim()?!0:!!Ui(te,M(re,Ae))}function I(te){if(!te)return{};let re={};for(let[Ae,ge]of Object.entries(te))re[Ae]=Array.isArray(ge)?ge.join("; "):String(ge);return re}function R(te){return{executedRequest:te.executedRequest,status:te.response?.status??0,statusText:te.response?.statusText??"",headers:I(te.response?.headers),body:te.response?.body,cookies:te.response?.cookies,responseTime:te.duration,responseSize:typeof te.response?.body=="string"?Buffer.byteLength(te.response.body,"utf8"):0}}async function A(te,re,Ae,ge,Se){let Qe=E(te);if(!Qe||!Qe.trim())return;let xt=t.environmentConfig.getResolvedEnvironment(i),sr=t.environmentConfig.getGlobalVariables(),fr={request:{url:Se?.request?.url??_.lastResult?.executedRequest?.url??"http://flow.local/node",method:Se?.request?.method??_.lastResult?.executedRequest?.method??"GET",headers:I(Se?.request?.headers),body:Se?.request?.body??null,params:Se?.request?.params??{},query:Se?.request?.query??{}},variables:Fy(_.vars),environmentVariables:xt?.variables||{},globals:{...sr},environmentName:i,info:{eventName:ge==="post"?"test":"prerequest",requestName:P(re),requestId:String(re?.id??P(re)),collectionName:e.name,iteration:Ae,iterationCount:s},onEnvironmentChange:(mt,Ee,In)=>{mt==="set"&&Ee&&In!==void 0?t.environmentConfig.setEnvironmentVariable(Ee,In,i):mt==="unset"&&Ee?t.environmentConfig.deleteEnvironmentVariable(Ee,i):mt==="clear"&&t.environmentConfig.clearEnvironmentVariables(i)},onGlobalsChange:(mt,Ee,In)=>{mt==="set"&&Ee&&In!==void 0?t.environmentConfig.setGlobalVariable(Ee,In):mt==="unset"&&Ee?t.environmentConfig.deleteGlobalVariable(Ee):mt==="clear"&&t.environmentConfig.clearGlobalVariables()}},Lt=t.scriptExecutor.createRequestSession(fr);try{if(ge==="post"&&Se?.response){let mt=await Lt.executePostResponse(Qe,Se.response),Ee=mt.localVariables??mt.modifiedVariables;Ee&&typeof Ee=="object"&&(_.vars={...Ee})}else{let mt=await Lt.executePreRequest(Qe);if(!mt.success)throw new Error(mt.error||"Script execution failed");let Ee=mt.localVariables??mt.modifiedVariables;Ee&&typeof Ee=="object"&&(_.vars={...Ee})}}catch(mt){let Ee=mt instanceof Error?mt.message:String(mt);throw new Error(`Suite ${ge}-script failed on node "${P(re)}": ${Ee}`)}finally{Lt.dispose?.()}}function F(te){let re=te?.type==="request"&&te?.request?te.request:te;if(!(!re||typeof re!="object")&&!(!re.collectionId||!re.requestId||!re.name))return{collectionId:re.collectionId,requestId:re.requestId,name:re.name,folderPath:re.folderPath,enabled:re.enabled}}function U(te){return!te||typeof te!="object"?!1:te.type==="request"?!!F(te):!!(te.collectionId&&te.requestId&&te.name)}function D(te,re){for(let Ae of re){let ge=te?.[Ae];if(Array.isArray(ge))return ge}return[]}async function J(te,re,Ae){if(at.signal.aborted||re.enabled===!1||d&&!d.some(Lt=>re.name.toLowerCase().includes(Lt.toLowerCase())))return;let ge=t.collection.getCollection(re.collectionId);if(!ge)return;let Se=PC(ge,re.requestId);if(!Se)return;let Qe=SN(Se.request.auth,Se.folderAuthChain,ge.auth),xt=new bo(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,Tr,ge.scripts,Se.folderScriptsChain,void 0,ge.name,ge.auth,te,s),sr=bN(vN({...Se.request,auth:Qe}),{headers:r.headers,query:r.query,body:r.body,variables:{..._.vars,...r.variables}}),oe=await xt.execute(sr,Fy(_.vars),at.signal);_.lastResult=oe,oe.modifiedVariables&&typeof oe.modifiedVariables=="object"&&(_.vars={...oe.modifiedVariables});let fr=ky({collectionName:ge.name,folderPath:re.folderPath??"",blockLabel:Ae});oe.folderPath=re.folderPath??"",oe.collectionName=ge.name,oe.groupPath=fr.groupPath,oe.groupType=fr.groupType,await ye.saveResult(te,oe),oe.assertions?.length||Ar.add(re.name),oe.passed?he++:Yt++,p.includes("perRequest")&&ht.push({name:re.name,iteration:te,status:oe.response?.status,ok:(oe.response?.status??0)>=200&&(oe.response?.status??0)<300,duration:`${oe.duration}ms`,allPassed:oe.passed,...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),oe.passed||(Nt.push({name:re.name,iteration:te,method:oe.executedRequest?.method,url:oe.executedRequest?.url,requestBody:IC(oe.executedRequest?.body?.content)??oe.executedRequest?.body?.content??null,requestHeaders:Wi(oe.executedRequest?.headers??{}),status:oe.response?.status,duration:`${oe.duration}ms`,body:IC(oe.response?.body),headers:gN(oe.response?.headers),cookies:yN(oe.response?.cookies),failedTests:oe.assertions?.filter(Lt=>!Lt.passed).map(Lt=>({name:Lt.name,...Lt.message?{message:Lt.message}:{}})),...oe.error?{error:oe.error}:{},...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),o&&at.abort()),l>0&&!at.signal.aborted&&await new Promise(Lt=>setTimeout(Lt,l))}async function Q(te,re,Ae){for(let ge of re){if(at.signal.aborted)break;await se(te,ge,Ae)}}async function se(te,re,Ae){if(!re||typeof re!="object"||re.enabled===!1||!j(re.condition,re,te))return;if(U(re)){let Qe=F(re);Qe&&await J(te,Qe,Ae);return}let ge=typeof re.type=="string"?re.type.toLowerCase():"",Se=D(re,["then","nodes","body"]);if(ge==="block"){let Qe=typeof re.name=="string"?re.name.trim():"";await Q(te,Se,Qe||Ae);return}if(ge==="script"){let Qe=k(re),xt=re.phase==="post"?"post":"pre";await A(Qe,re,te,xt);return}if(ge==="if"){let Qe=typeof re.if=="string"?re.if:re.condition;if(j(Qe,re,te)){await Q(te,Se,Ae);return}if(Array.isArray(re.elseif)){for(let xt of re.elseif)if(j(xt?.condition,xt,te)){await Q(te,D(xt,["then","nodes","body"]),Ae);return}}await Q(te,D(re,["else","elseNodes"]),Ae);return}if(ge==="switch"){let Qe=Ui(String(re.expression??""),M(re,te));if(Array.isArray(re.cases)){for(let xt of re.cases)if(Object.prototype.hasOwnProperty.call(xt??{},"equals")?xt.equals===Qe:j(xt?.condition,xt,te)){await Q(te,D(xt,["then","nodes","body"]),Ae);return}}await Q(te,D(re,["default","defaultNodes"]),Ae);return}if(ge==="while"){let Qe=typeof re.while=="string"?re.while:re.condition,xt=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),sr=0;for(;j(Qe,re,te);){if(sr+=1,sr>xt)throw new Error(`Suite while loop exceeded maxIterations (${xt}) on node "${P(re)}"`);if(await Q(te,Se,Ae),at.signal.aborted)break}return}if(ge==="for"){let Qe=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),xt=E(re.init),sr=E(re.update),oe=typeof re.loopCondition=="string"&&re.loopCondition.trim()?re.loopCondition:typeof re.condition=="string"&&re.condition.trim()?re.condition:"true";xt&&await A(xt,re,te,"pre");let fr=0;for(;j(oe,re,te);){if(fr+=1,fr>Qe)throw new Error(`Suite for loop exceeded maxIterations (${Qe}) on node "${P(re)}"`);if(await Q(te,Se,Ae),at.signal.aborted)break;sr&&await A(sr,re,te,"post")}return}Se.length>0&&await Q(te,Se,Ae)}function fe(te){let re=0,Ae=[...te];for(;Ae.length>0;){let ge=Ae.pop();if(!(!ge||typeof ge!="object"||ge.enabled===!1)){if(U(ge)){let Se=F(ge);Se&&(!d||d.some(Qe=>Se.name.toLowerCase().includes(Qe.toLowerCase())))&&(re+=1);continue}for(let Se of["nodes","then","body","else","elseNodes","default","defaultNodes"])Array.isArray(ge[Se])&&Ae.push(...ge[Se]);if(Array.isArray(ge.elseif))for(let Se of ge.elseif)Array.isArray(Se?.nodes)&&Ae.push(...Se.nodes),Array.isArray(Se?.then)&&Ae.push(...Se.then);if(Array.isArray(ge.cases))for(let Se of ge.cases)Array.isArray(Se?.nodes)&&Ae.push(...Se.nodes),Array.isArray(Se?.then)&&Ae.push(...Se.then)}}return re}let He=Array.isArray(e.nodes)?e.nodes:Array.isArray(e.requests)?e.requests.map(te=>({type:"request",request:te})):[],_e=fe(He);if(q){let te=A5(),re=_e*s;if(re>te)throw new Error(`Suite "${e.name}" would execute ${re} request calls (${_e} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${te}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let ye=new fc(t.config),Pe=await ye.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),ht=[],Nt=[],he=0,Yt=0,Ar=new Set,at=new AbortController,Tr=new ic;async function wr(te){await Q(te,He)}for(let te=1;te<=s&&!at.signal.aborted;te+=c){let re=Math.min(te+c-1,s),Ae=Array.from({length:re-te+1},(ge,Se)=>te+Se);await Promise.all(Ae.map(wr))}let Rt=await ye.finalizeRun("completed",x),bt=null;if(y)try{bt=await new lc(ye.getBasePath()).generate(e.id,Pe)}catch(te){console.warn("[direct-execution] JUnit report generation failed:",te)}let Jr=n==="collection"?"collection":"suite",At=ye.getCurrentStats()?.stats,Pi=At?{min:At.minDuration,max:At.maxDuration,avg:At.avgDuration,p50:At.p50??null,p95:At.p95??null,p99:At.p99??null}:null,qn={[Jr]:e.name,environment:i,summary:{total:he+Yt,passed:he,failed:Yt,...s>1?{iterations:s}:{},...c>1?{concurrency:c}:{},allPassed:Yt===0,...Pi?{durationMs:Pi}:{}}};if((Yt>0||p.includes("failedOnly"))&&(qn.failedRequests=Nt),p.includes("perRequest")&&(qn.results=ht),Rt!==null&&(qn.report={uri:`file://${Rt}`,hint:"Click the URI to open the HTML report in your browser"}),bt!==null&&(qn.junitReport={path:bt}),Ar.size>0){let te=Math.max(_e,1),re=Ar.size,Ae=Array.from(Ar).slice(0,5);qn.noAssertionExamples=Ae;let ge=e.name;if(re/te>.5)qn._suggestions=[`${re}/${te} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${ge}") for a full coverage analysis and to identify assertion gaps.`];else{let Se=Ae.map(Qe=>`"${Qe}"`).join(", ");qn._suggestions=[`${re} request(s) have no pm.test() assertions: ${Se}. Invoke the "suggest-assertions" prompt (collection="${ge}") to generate test coverage for them.`]}}return qn}async function Dy(t){let e=Yn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=mN(r,n);try{let o=e.collection,l=_N(o,t),c=RN(l,t),d=t.requestId;if(!d){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let M=EC(l,t.requestRef,c);d=M.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:M.tier,id:d,path:M.folderPath?`${M.folderPath}/${M.request.name}`:M.request.name})}let p=PC(l,d);if(!p)throw new Error(`Request "${d}" not found in collection "${l.name}"`);let m=SN(p.request.auth,p.folderAuthChain,l.auth),y=t.environment||e.environmentConfig.getSelectedEnvironment(),b=bN(vN({...p.request,auth:m}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),x=await new bo(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,y,new ic,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(b,Fy(t.variables)),v=ky({collectionName:l.name,folderPath:p.folderPath});x.folderPath=p.folderPath,x.collectionName=l.name,x.groupPath=v.groupPath,x.groupType=v.groupType;let _=null,E=null;if(s||i){let M=new fc(e.config),j=`request-${pN(l.id)}-${pN(d)}`,I=`Request: ${p.request.name}`,R=await M.initializeRun(j,I,y,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await M.saveResult(1,x),_=await M.finalizeRun("completed",s),i)try{E=await new lc(M.getBasePath()).generate(j,R)}catch(A){console.warn("[direct-execution] JUnit report generation failed:",A)}}let k=gN(x.response?.headers),P=yN(x.response?.cookies);return{request:p.request.name,status:x.response?.status||0,ok:(x.response?.status??0)>=200&&(x.response?.status??0)<300,duration:`${x.duration}ms`,body:IC(x.response?.body),allPassed:x.passed,assertions:x.assertions?.map(M=>({name:M.name,passed:M.passed,message:M.message})),...r.includes("headers")?{headers:k}:{},...r.includes("cookies")?{cookies:P}:{},...r.includes("tests")?{tests:x.assertions?.map(M=>({name:M.name,passed:M.passed,...M.message?{message:M.message}:{}}))}:{},...Object.keys(x.modifiedVariables??{}).length?{modifiedVariables:x.modifiedVariables}:{},...r.includes("consoleOutput")&&x.consoleOutput?.length?{consoleOutput:x.consoleOutput}:{},..._!==null?{report:{uri:`file://${_}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...E!==null?{junitReport:{path:E}}:{},...x.error?{error:x.error}:{}}}catch(o){throw o}finally{OC(e)}}async function Ns(t){let e=Yn(t.workspaceFolder);try{let r=e.collection,n=_N(r,t),i=RN(n,t),s=wN(n),o=$5(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:d,folderPath:p})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:p,enabled:!0})),c={id:i?`temp-${n.id}-${N5(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 xN(e,c,{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{OC(e)}}async function M5(t){return Ns({recursive:!0,...t})}async function pp(t){let e=Yn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return xN(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{OC(e)}}var pc=le(()=>{"use strict";pC();Tm();od();gC();SC();sf();_C();Ei();My();qC();dC()});var IN={};io(IN,{createMcpRuntime:()=>Q5});import*as qN from"fs";import{createServer as F5}from"http";import*as Lo from"path";async function Ii(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 hc(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function L5(t,e){let r=TC.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=kC.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(d,p)=>!!d?.length&&(d.includes(p.id)||d.includes(p.name)),l=e.collection.getAllCollections().filter(d=>!o(s.excludedCollections,d)),c=(await e.testSuite.getAllSuites()).filter(d=>!o(s.excludedSuites,d));return cC(l,c,s)})().then(s=>(TC.set(t,{tools:s,expiresAt:Date.now()+j5}),s)).finally(()=>kC.delete(t));return kC.set(t,i),i}function U5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function H5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function CN(t,e,r,n){ll(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function B5(t){return t.config.getMcpConfig().toolPageSize??200}async function V5(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 L5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=B5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=uC(i),l=r.slice(o,o+s),c=o+s,d={tools:l};return c<r.length&&(d.nextCursor=lC(c)),d}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await $C(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 c=JSON.stringify(s,null,2),d=H5(c,t.host,t.port),p=d.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),m=p?`
1018
+ Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var hp={};io(hp,{runCollection:()=>Ns,runFolder:()=>M5,runRequest:()=>Dy,runSuite:()=>pp});function OC(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function hN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function k5(){return hN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function A5(){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 mN(t,e=[]){return hN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function IC(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 gN(t){return Wi(T5(t))}function yN(t){return x0((t??[]).map(e=>({name:e.name,value:e.value})))}function pN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function vN(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 bN(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 Fy(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function SN(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 PC(t,e,r=t.items,n=[],i=[],s=[]){for(let o of r){if(o.type==="request"&&o.id===e)return{request:o,folderScriptsChain:[...n],folderAuthChain:[...i],folderPath:s.map(Sr).join("/")};if(o.type==="folder"){let l=o,c=l.scripts?[...n,l.scripts]:[...n],d=l.auth?[...i,l.auth]:[...i],p=[...s,l.name],m=PC(t,e,l.items??[],c,d,p);if(m)return m}}}function wN(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(Sr).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],c=[...n,o.name];i.push(...wN(t,o.items??[],l,c))}return i}function $5(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 N5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function _N(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}=xC(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 RN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=CC(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function xN(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,c=Math.max(1,Math.min(50,r.concurrency??1)),d=r.requestFilter,p=r.include??[],m=r.reporters??[],y=m.includes("junit"),b=Fy(r.variables),q=k5(),x=mN(p,m),v=Math.max(1,Math.min(1e4,Number(r.maxNodeLoopIterations??100))),R={vars:{...b}};function E(te){if(typeof te=="string")return te;if(Array.isArray(te))return te.filter(Ae=>typeof Ae=="string").join(`
1019
+ `)}function k(te){if(!(!te||typeof te!="object")){if(te.script!==void 0)return te.script;if(typeof te.scriptRef=="string"&&te.scriptRef.trim()){let re=e?.scripts;if(re&&typeof re=="object")return re[te.scriptRef]}}}function P(te){return te?.name||te?.label||te?.id||"flow-node"}function M(te,re){let Ae=t.environmentConfig.getResolvedEnvironment(i),ge=wC(R.vars),sr={variables:{get:oe=>dc(R.vars[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&(R.vars[oe]=fp(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&delete R.vars[oe]},has:oe=>Object.prototype.hasOwnProperty.call(R.vars,oe),toObject:()=>({...ge})},environment:{get:oe=>dc(Ae?.variables?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setEnvironmentVariable(oe,fp(fr),i)},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteEnvironmentVariable(oe,i)},clear:()=>{t.environmentConfig.clearEnvironmentVariables(i)}},globals:{get:oe=>dc(t.environmentConfig.getGlobalVariables()?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setGlobalVariable(oe,fp(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteGlobalVariable(oe)},clear:()=>{t.environmentConfig.clearGlobalVariables()}}};return{vars:ge,lastResult:R.lastResult,iteration:re,node:te,pm:sr,ctx:sr,hf:sr}}function j(te,re,Ae){return typeof te!="string"||!te.trim()?!0:!!Ui(te,M(re,Ae))}function I(te){if(!te)return{};let re={};for(let[Ae,ge]of Object.entries(te))re[Ae]=Array.isArray(ge)?ge.join("; "):String(ge);return re}function _(te){return{executedRequest:te.executedRequest,status:te.response?.status??0,statusText:te.response?.statusText??"",headers:I(te.response?.headers),body:te.response?.body,cookies:te.response?.cookies,responseTime:te.duration,responseSize:typeof te.response?.body=="string"?Buffer.byteLength(te.response.body,"utf8"):0}}async function A(te,re,Ae,ge,Se){let Qe=E(te);if(!Qe||!Qe.trim())return;let xt=t.environmentConfig.getResolvedEnvironment(i),sr=t.environmentConfig.getGlobalVariables(),fr={request:{url:Se?.request?.url??R.lastResult?.executedRequest?.url??"http://flow.local/node",method:Se?.request?.method??R.lastResult?.executedRequest?.method??"GET",headers:I(Se?.request?.headers),body:Se?.request?.body??null,params:Se?.request?.params??{},query:Se?.request?.query??{}},variables:Fy(R.vars),environmentVariables:xt?.variables||{},globals:{...sr},environmentName:i,info:{eventName:ge==="post"?"test":"prerequest",requestName:P(re),requestId:String(re?.id??P(re)),collectionName:e.name,iteration:Ae,iterationCount:s},onEnvironmentChange:(mt,Ee,In)=>{mt==="set"&&Ee&&In!==void 0?t.environmentConfig.setEnvironmentVariable(Ee,In,i):mt==="unset"&&Ee?t.environmentConfig.deleteEnvironmentVariable(Ee,i):mt==="clear"&&t.environmentConfig.clearEnvironmentVariables(i)},onGlobalsChange:(mt,Ee,In)=>{mt==="set"&&Ee&&In!==void 0?t.environmentConfig.setGlobalVariable(Ee,In):mt==="unset"&&Ee?t.environmentConfig.deleteGlobalVariable(Ee):mt==="clear"&&t.environmentConfig.clearGlobalVariables()}},Lt=t.scriptExecutor.createRequestSession(fr);try{if(ge==="post"&&Se?.response){let mt=await Lt.executePostResponse(Qe,Se.response),Ee=mt.localVariables??mt.modifiedVariables;Ee&&typeof Ee=="object"&&(R.vars={...Ee})}else{let mt=await Lt.executePreRequest(Qe);if(!mt.success)throw new Error(mt.error||"Script execution failed");let Ee=mt.localVariables??mt.modifiedVariables;Ee&&typeof Ee=="object"&&(R.vars={...Ee})}}catch(mt){let Ee=mt instanceof Error?mt.message:String(mt);throw new Error(`Suite ${ge}-script failed on node "${P(re)}": ${Ee}`)}finally{Lt.dispose?.()}}function F(te){let re=te?.type==="request"&&te?.request?te.request:te;if(!(!re||typeof re!="object")&&!(!re.collectionId||!re.requestId||!re.name))return{collectionId:re.collectionId,requestId:re.requestId,name:re.name,folderPath:re.folderPath,enabled:re.enabled}}function U(te){return!te||typeof te!="object"?!1:te.type==="request"?!!F(te):!!(te.collectionId&&te.requestId&&te.name)}function D(te,re){for(let Ae of re){let ge=te?.[Ae];if(Array.isArray(ge))return ge}return[]}async function J(te,re,Ae){if(at.signal.aborted||re.enabled===!1||d&&!d.some(Lt=>re.name.toLowerCase().includes(Lt.toLowerCase())))return;let ge=t.collection.getCollection(re.collectionId);if(!ge)return;let Se=PC(ge,re.requestId);if(!Se)return;let Qe=SN(Se.request.auth,Se.folderAuthChain,ge.auth),xt=new bo(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,Tr,ge.scripts,Se.folderScriptsChain,void 0,ge.name,ge.auth,te,s),sr=bN(vN({...Se.request,auth:Qe}),{headers:r.headers,query:r.query,body:r.body,variables:{...R.vars,...r.variables}}),oe=await xt.execute(sr,Fy(R.vars),at.signal);R.lastResult=oe,oe.modifiedVariables&&typeof oe.modifiedVariables=="object"&&(R.vars={...oe.modifiedVariables});let fr=ky({collectionName:ge.name,folderPath:re.folderPath??"",blockLabel:Ae});oe.folderPath=re.folderPath??"",oe.collectionName=ge.name,oe.groupPath=fr.groupPath,oe.groupType=fr.groupType,await ye.saveResult(te,oe),oe.assertions?.length||Ar.add(re.name),oe.passed?he++:Yt++,p.includes("perRequest")&&ht.push({name:re.name,iteration:te,status:oe.response?.status,ok:(oe.response?.status??0)>=200&&(oe.response?.status??0)<300,duration:`${oe.duration}ms`,allPassed:oe.passed,...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),oe.passed||(Nt.push({name:re.name,iteration:te,method:oe.executedRequest?.method,url:oe.executedRequest?.url,requestBody:IC(oe.executedRequest?.body?.content)??oe.executedRequest?.body?.content??null,requestHeaders:Wi(oe.executedRequest?.headers??{}),status:oe.response?.status,duration:`${oe.duration}ms`,body:IC(oe.response?.body),headers:gN(oe.response?.headers),cookies:yN(oe.response?.cookies),failedTests:oe.assertions?.filter(Lt=>!Lt.passed).map(Lt=>({name:Lt.name,...Lt.message?{message:Lt.message}:{}})),...oe.error?{error:oe.error}:{},...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),o&&at.abort()),l>0&&!at.signal.aborted&&await new Promise(Lt=>setTimeout(Lt,l))}async function Q(te,re,Ae){for(let ge of re){if(at.signal.aborted)break;await se(te,ge,Ae)}}async function se(te,re,Ae){if(!re||typeof re!="object"||re.enabled===!1||!j(re.condition,re,te))return;if(U(re)){let Qe=F(re);Qe&&await J(te,Qe,Ae);return}let ge=typeof re.type=="string"?re.type.toLowerCase():"",Se=D(re,["then","nodes","body"]);if(ge==="block"){let Qe=typeof re.name=="string"?re.name.trim():"";await Q(te,Se,Qe||Ae);return}if(ge==="script"){let Qe=k(re),xt=re.phase==="post"?"post":"pre";await A(Qe,re,te,xt);return}if(ge==="if"){let Qe=typeof re.if=="string"?re.if:re.condition;if(j(Qe,re,te)){await Q(te,Se,Ae);return}if(Array.isArray(re.elseif)){for(let xt of re.elseif)if(j(xt?.condition,xt,te)){await Q(te,D(xt,["then","nodes","body"]),Ae);return}}await Q(te,D(re,["else","elseNodes"]),Ae);return}if(ge==="switch"){let Qe=Ui(String(re.expression??""),M(re,te));if(Array.isArray(re.cases)){for(let xt of re.cases)if(Object.prototype.hasOwnProperty.call(xt??{},"equals")?xt.equals===Qe:j(xt?.condition,xt,te)){await Q(te,D(xt,["then","nodes","body"]),Ae);return}}await Q(te,D(re,["default","defaultNodes"]),Ae);return}if(ge==="while"){let Qe=typeof re.while=="string"?re.while:re.condition,xt=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),sr=0;for(;j(Qe,re,te);){if(sr+=1,sr>xt)throw new Error(`Suite while loop exceeded maxIterations (${xt}) on node "${P(re)}"`);if(await Q(te,Se,Ae),at.signal.aborted)break}return}if(ge==="for"){let Qe=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),xt=E(re.init),sr=E(re.update),oe=typeof re.loopCondition=="string"&&re.loopCondition.trim()?re.loopCondition:typeof re.condition=="string"&&re.condition.trim()?re.condition:"true";xt&&await A(xt,re,te,"pre");let fr=0;for(;j(oe,re,te);){if(fr+=1,fr>Qe)throw new Error(`Suite for loop exceeded maxIterations (${Qe}) on node "${P(re)}"`);if(await Q(te,Se,Ae),at.signal.aborted)break;sr&&await A(sr,re,te,"post")}return}Se.length>0&&await Q(te,Se,Ae)}function fe(te){let re=0,Ae=[...te];for(;Ae.length>0;){let ge=Ae.pop();if(!(!ge||typeof ge!="object"||ge.enabled===!1)){if(U(ge)){let Se=F(ge);Se&&(!d||d.some(Qe=>Se.name.toLowerCase().includes(Qe.toLowerCase())))&&(re+=1);continue}for(let Se of["nodes","then","body","else","elseNodes","default","defaultNodes"])Array.isArray(ge[Se])&&Ae.push(...ge[Se]);if(Array.isArray(ge.elseif))for(let Se of ge.elseif)Array.isArray(Se?.nodes)&&Ae.push(...Se.nodes),Array.isArray(Se?.then)&&Ae.push(...Se.then);if(Array.isArray(ge.cases))for(let Se of ge.cases)Array.isArray(Se?.nodes)&&Ae.push(...Se.nodes),Array.isArray(Se?.then)&&Ae.push(...Se.then)}}return re}let He=Array.isArray(e.nodes)?e.nodes:Array.isArray(e.requests)?e.requests.map(te=>({type:"request",request:te})):[],_e=fe(He);if(q){let te=A5(),re=_e*s;if(re>te)throw new Error(`Suite "${e.name}" would execute ${re} request calls (${_e} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${te}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let ye=new fc(t.config),Pe=await ye.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),ht=[],Nt=[],he=0,Yt=0,Ar=new Set,at=new AbortController,Tr=new ic;async function wr(te){await Q(te,He)}for(let te=1;te<=s&&!at.signal.aborted;te+=c){let re=Math.min(te+c-1,s),Ae=Array.from({length:re-te+1},(ge,Se)=>te+Se);await Promise.all(Ae.map(wr))}let Rt=await ye.finalizeRun("completed",x),bt=null;if(y)try{bt=await new lc(ye.getBasePath()).generate(e.id,Pe)}catch(te){console.warn("[direct-execution] JUnit report generation failed:",te)}let Jr=n==="collection"?"collection":"suite",At=ye.getCurrentStats()?.stats,Pi=At?{min:At.minDuration,max:At.maxDuration,avg:At.avgDuration,p50:At.p50??null,p95:At.p95??null,p99:At.p99??null}:null,qn={[Jr]:e.name,environment:i,summary:{total:he+Yt,passed:he,failed:Yt,...s>1?{iterations:s}:{},...c>1?{concurrency:c}:{},allPassed:Yt===0,...Pi?{durationMs:Pi}:{}}};if((Yt>0||p.includes("failedOnly"))&&(qn.failedRequests=Nt),p.includes("perRequest")&&(qn.results=ht),Rt!==null&&(qn.report={uri:`file://${Rt}`,hint:"Click the URI to open the HTML report in your browser"}),bt!==null&&(qn.junitReport={path:bt}),Ar.size>0){let te=Math.max(_e,1),re=Ar.size,Ae=Array.from(Ar).slice(0,5);qn.noAssertionExamples=Ae;let ge=e.name;if(re/te>.5)qn._suggestions=[`${re}/${te} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${ge}") for a full coverage analysis and to identify assertion gaps.`];else{let Se=Ae.map(Qe=>`"${Qe}"`).join(", ");qn._suggestions=[`${re} request(s) have no pm.test() assertions: ${Se}. Invoke the "suggest-assertions" prompt (collection="${ge}") to generate test coverage for them.`]}}return qn}async function Dy(t){let e=Yn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=mN(r,n);try{let o=e.collection,l=_N(o,t),c=RN(l,t),d=t.requestId;if(!d){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let M=EC(l,t.requestRef,c);d=M.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:M.tier,id:d,path:M.folderPath?`${M.folderPath}/${M.request.name}`:M.request.name})}let p=PC(l,d);if(!p)throw new Error(`Request "${d}" not found in collection "${l.name}"`);let m=SN(p.request.auth,p.folderAuthChain,l.auth),y=t.environment||e.environmentConfig.getSelectedEnvironment(),b=bN(vN({...p.request,auth:m}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),x=await new bo(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,y,new ic,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(b,Fy(t.variables)),v=ky({collectionName:l.name,folderPath:p.folderPath});x.folderPath=p.folderPath,x.collectionName=l.name,x.groupPath=v.groupPath,x.groupType=v.groupType;let R=null,E=null;if(s||i){let M=new fc(e.config),j=`request-${pN(l.id)}-${pN(d)}`,I=`Request: ${p.request.name}`,_=await M.initializeRun(j,I,y,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await M.saveResult(1,x),R=await M.finalizeRun("completed",s),i)try{E=await new lc(M.getBasePath()).generate(j,_)}catch(A){console.warn("[direct-execution] JUnit report generation failed:",A)}}let k=gN(x.response?.headers),P=yN(x.response?.cookies);return{request:p.request.name,status:x.response?.status||0,ok:(x.response?.status??0)>=200&&(x.response?.status??0)<300,duration:`${x.duration}ms`,body:IC(x.response?.body),allPassed:x.passed,assertions:x.assertions?.map(M=>({name:M.name,passed:M.passed,message:M.message})),...r.includes("headers")?{headers:k}:{},...r.includes("cookies")?{cookies:P}:{},...r.includes("tests")?{tests:x.assertions?.map(M=>({name:M.name,passed:M.passed,...M.message?{message:M.message}:{}}))}:{},...Object.keys(x.modifiedVariables??{}).length?{modifiedVariables:x.modifiedVariables}:{},...r.includes("consoleOutput")&&x.consoleOutput?.length?{consoleOutput:x.consoleOutput}:{},...R!==null?{report:{uri:`file://${R}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...E!==null?{junitReport:{path:E}}:{},...x.error?{error:x.error}:{}}}catch(o){throw o}finally{OC(e)}}async function Ns(t){let e=Yn(t.workspaceFolder);try{let r=e.collection,n=_N(r,t),i=RN(n,t),s=wN(n),o=$5(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:d,folderPath:p})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:p,enabled:!0})),c={id:i?`temp-${n.id}-${N5(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 xN(e,c,{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{OC(e)}}async function M5(t){return Ns({recursive:!0,...t})}async function pp(t){let e=Yn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return xN(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{OC(e)}}var pc=le(()=>{"use strict";pC();Tm();od();gC();SC();sf();_C();Ei();My();qC();dC()});var IN={};io(IN,{createMcpRuntime:()=>Q5});import*as qN from"fs";import{createServer as F5}from"http";import*as Lo from"path";async function Ii(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 hc(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function L5(t,e){let r=TC.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=kC.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(d,p)=>!!d?.length&&(d.includes(p.id)||d.includes(p.name)),l=e.collection.getAllCollections().filter(d=>!o(s.excludedCollections,d)),c=(await e.testSuite.getAllSuites()).filter(d=>!o(s.excludedSuites,d));return cC(l,c,s)})().then(s=>(TC.set(t,{tools:s,expiresAt:Date.now()+j5}),s)).finally(()=>kC.delete(t));return kC.set(t,i),i}function U5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function H5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function CN(t,e,r,n){ll(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function B5(t){return t.config.getMcpConfig().toolPageSize??200}async function V5(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 L5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=B5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=uC(i),l=r.slice(o,o+s),c=o+s,d={tools:l};return c<r.length&&(d.nextCursor=lC(c)),d}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await $C(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 c=JSON.stringify(s,null,2),d=H5(c,t.host,t.port),p=d.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),m=p?`
1020
1020
 
1021
- [View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:d+m}]}}case"prompts/list":return{prompts:Iy};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=Yn(t.workspaceFolder);try{return await Gx(n,i,s.collection,t.runStore)}finally{hc(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function W5(t,e,r){let n=!t.container,i=t.container??Yn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&hc(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 z5(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=Lo.resolve(i),o=t.container?.config.getResultsPath(),l=o?Lo.dirname(o):Lo.resolve(t.workspaceFolder,".http-forge",".cache");if(!s.startsWith(l+Lo.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}qN.readFile(s,"utf-8",(c,d)=>{if(c){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(d)})}function AC(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 J5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return Ii(()=>Dy({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=st(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?AC(t.runStore,`${r.name} / ${Ts(n)}`,s,()=>Ii(()=>Ns({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}))):Ii(()=>Ns({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=st(r).length;return n.async===!0?AC(t.runStore,r.name,i,()=>Ii(()=>Ns({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):Ii(()=>Ns({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=Yn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.nodes.filter(d=>d.type==="request").length??0)*(i.iterations??l?.config?.iterations??1)}finally{hc(s)}return i.async===!0?AC(t.runStore,n,o,()=>Ii(()=>pp({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}))):Ii(()=>pp({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 $C(t,e,r={}){let n=t.workspaceFolder,i=U5(t.container,e);if(Object.values(G).includes(i)){let l=Yn(n);try{let c=await zx(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,J5(t));return G5.has(i)&&TC.delete(n),c}finally{hc(l)}}let s=tC(i),o=Yn(n);try{let l=o.collection.getAllCollections(),c=l.map(b=>b.id),d=b=>{let q=nc(b,c),x=q?l.find(v=>v.id===q):void 0;if(!x)throw new Error(`Collection not found for tool: ${e}`);return x};if(s.kind==="request"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed request tool: ${e}`);let x=d(b),v=st(x).map(E=>E.request.id),_=nc(q,v);if(!_)throw new Error(`Request not found in collection "${x.name}" for tool: ${e}`);return Ii(()=>Dy({workspaceFolder:n,collectionId:x.id,requestId:_,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[b]=s.tokens;if(!b)throw new Error(`Malformed collection tool: ${e}`);let q=d(b);return Ii(()=>Ns({workspaceFolder:n,collectionId:q.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed folder tool: ${e}`);let x=d(b),v=(o.collection.getAllCollections().find(k=>k.id===x.id),void 0),_=st(x).map(k=>k.folderPath).filter((k,P,M)=>k&&M.indexOf(k)===P),E=rC(q,_);if(!E)throw new Error(`Folder not found in collection "${x.name}" for tool: ${e}`);return Ii(()=>Ns({workspaceFolder:n,collectionId:x.id,folderPath:E,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 m=await o.testSuite.getAllSuites(),y=nc(p,m.map(b=>b.id));if(!y)throw new Error(`Test suite not found for tool: ${e}`);return Ii(()=>pp({workspaceFolder:n,suiteId:y,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{hc(o)}}function ll(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function EN(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 Y5(t){return F5(async(e,r)=>{try{if(W5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){ll(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){z5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await EN(e)}catch{CN(r,null,-32700,"Parse error");return}try{let i=await V5(t,n);ll(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){CN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await EN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){ll(r,400,{error:'Field "name" is required'});return}let i=await $C(t,n.name,n.args??{});ll(r,200,{result:i});return}ll(r,405,{error:"Method not allowed"})}catch(n){ll(r,500,{error:n.message})}})}function K5(t){if(typeof t.port=="number"&&Number.isFinite(t.port))return Math.min(65535,Math.max(1,Math.floor(t.port)));let r=new vo(Lo.resolve(t.workspaceFolder)).getMcpConfig().port;return Math.min(65535,Math.max(1,Math.floor(r||3100)))}async function Q5(t){let e=K5(t),r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new lp};return D5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=Yn(i.workspaceFolder));let s=Y5(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&&(hc(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 $C(i,s,o??{})}}}var D5,j5,TC,kC,G5,ON=le(()=>{"use strict";km();pc();Ei();Jx();Yx();Kx();fC();Py();sp();My();D5=new Map;j5=3e3,TC=new Map,kC=new Map;G5=Wx});var Zl=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()}};Ph();ma();function aS(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(hq),source:{format:"folder",filePath:e,version:t.version}}}function hq(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(hq)};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 VL(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(lS)}}function lS(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(lS)}:{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 ef=class{store;constructor(e){this.store=new so(e)}loadAll(){return this.store.loadAll().map(r=>aS(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 aS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return aS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(VL(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,lS(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 tf=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()}};ga();var rf=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 Ct.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 Ct.parseCookieHeaders(e,r)}isExpired(e){return Ct.isExpired(e)}domainMatches(e,r){return Ct.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)}};Th();var gs=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})}};Xl();uf();var ao=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new wa,this.urlBuilder=new li}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=gs.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};uf();cf();ff();Xl();Vf();Hf();var wu=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?[wt("path").join(s.forgeRoot,"modules")]:[],l=new vs(new li,new bs,e);this.scriptExecutor=new xs(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||{}},c={...s},d=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,m=this.findFolderPath(r,e.id),y=this.buildScriptChain(e,r,m),b={request:{url:d.url,method:d.method,headers:{...d.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:c,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:(_,E,k)=>{_==="set"&&E&&k!==void 0?this.forgeEnv.setGlobal(E,k):_==="unset"&&E?this.forgeEnv.unsetGlobal(E):_==="clear"&&this.forgeEnv.clearGlobals()}},q=this.scriptExecutor.createRequestSession(b),x,v;try{if(!n.skipPreRequest&&y.preRequest.length>0){let P=await q.executePreRequest(y.preRequest);if(x={success:P.success,error:P.error,modifiedVariables:P.modifiedVariables,modifiedEnvironment:P.modifiedEnvironmentVariables,modifiedGlobals:P.modifiedGlobals,modifiedCollectionVariables:P.modifiedCollectionVariables,consoleOutput:P.consoleOutput,modifiedRequest:P.modifiedRequest?{url:P.modifiedRequest.url,method:P.modifiedRequest.method,headers:P.modifiedRequest.headers,body:P.modifiedRequest.body?.content}:void 0},P.modifiedVariables&&(l={...l,...P.localVariables??P.modifiedVariables}),P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables}),P.modifiedRequest){let M=P.modifiedRequest;M.url&&(d.url=M.url),M.method&&(d.method=M.method),M.headers&&(d.headers={...d.headers,...M.headers}),M.body!==void 0&&(d.body=M.body?.content||M.body)}if(!P.success)throw new Error(`Pre-request script failed: ${P.error}`)}let _={...c,...l};d=this.interpolateRequest(d,_);let E=n.overrides?.body||e.body;if(this.preprocessor&&E&&typeof E!="string"&&E.type==="graphql"&&d.body!==void 0){let P=this.preprocessor.encodeBody({type:"graphql",content:d.body});P!=null&&(d.body=typeof P=="string"?P:JSON.stringify(P))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(d.body)){let P=this.buildMultipartFormData({type:"form-data",content:d.body});P&&(d.body=P)}let k=await this.httpClient.send(d);if(!n.skipPostResponse&&y.postResponse.length>0){let P=await q.executePostResponse(y.postResponse,{status:k.status,statusText:k.statusText,headers:k.headers,body:k.body,cookies:xm(k.headers,k.cookies,d.url),responseTime:k.time,responseSize:k.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});v={success:!0,assertions:P.testResults,consoleOutput:P.consoleOutput,modifiedEnvironment:P.modifiedEnvironmentVariables},P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables})}return{response:k,preRequestResult:x,postResponseResult:v,totalTime:Date.now()-i,finalRequest:d,variables:{environment:c,local:l}}}finally{q.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 m of e.query)m.enabled!==!1&&p.append(m.key,m.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||{}},c,d=r?.body||e.body;if(d)if(typeof d=="string")c=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")c=typeof d.content=="string"?d.content:JSON.stringify(d.content);else if(d.type==="form-data")c=this.buildMultipartFormData(d);else{let p=this.preprocessor.encodeBody(d);c=p!=null?String(p):void 0}else d.content&&(c=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&d.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:c,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=ao.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 c=[...o,l];if(i(l.items,c))return!0}}return!1};return i(e.items,[]),n}};function gz(){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 Wf=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=gz(),l=Date.now(),c={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,c);let d=this.requestIndex.get(e)||[];for(d.unshift(o);d.length>this.maxEntriesPerRequest;){let p=d.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,d),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 c}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 zf=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),c=Date.now(),d;try{d=await l.text()}catch{d=null}let p={};return l.headers.forEach((m,y)=>{let b=p[y];b!==void 0?p[y]=Array.isArray(b)?[...b,m]:[b,m]:p[y]=m}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:d,time:c-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};cf();ff();Jf();qm();Xl();var Fa=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};Im();import*as Rn from"fs/promises";import*as _u from"path";var Gf=class{async readFile(e){return Rn.readFile(e,"utf-8")}async writeFile(e,r){let n=_u.dirname(e);await this.mkdir(n),await Rn.writeFile(e,r,"utf-8")}async exists(e){try{return await Rn.access(e),!0}catch{return!1}}async mkdir(e){await Rn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=_u.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return Rn.readdir(e)}async isDirectory(e){try{return(await Rn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await Rn.readdir(e,{withFileTypes:!0});for(let i of n){let s=_u.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};Vf();var u0=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 wa,this.fileSystem=e.fileSystem||new Gf,this.preprocessor=e.preprocessor||new Ma,this.dataFileParser=e.dataFileParser||new Da,this.cookieJar=e.cookieJar||new rf,e.enableHistory?this.requestHistory=e.requestHistory||new Wf({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 Na(s)}else this.httpClient=new zf;let r=e.forgeRoot?[wt("path").join(e.forgeRoot,"modules")]:[],n=new vs(new li,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new xs(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new tf,this.parserRegistry.register("http-forge",new Fa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=wt("path").join(e.forgeRoot,"collections");this.collectionLoader=new ef(s)}else this.collectionLoader=new Zl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new gs(e.environmentConfig):gs.fromVariables({}),this.forgeEnv=ao.fromResolver(this.environmentStore),this.requestExecutor=new wu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new bs;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 Zl)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 gs(e),this.forgeEnv=ao.fromResolver(this.environmentStore),this.requestExecutor=new wu(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=wt("path"),i=n.join(e,"environments"),s,o=nf(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[c,d]of Object.entries(o.environments)){let p=o.localCredentials[c]?.variables||{};s.environments[c]={name:c,variables:{...d.variables,...p}}}}else{let c=wt("fs"),d=n.join(i,"environments.json");if(c.existsSync(d))try{let p=c.readFileSync(d,"utf-8"),m=JSON.parse(p);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[y,b]of Object.entries(m.environments)){let q=b;s.environments[y]={name:q.name||y,variables:q.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};jx();Lx();wy();Ei();Jx();Yx();Kx();fC();Py();sp();dC();async function Z5(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(ON(),IN));return e(t)}async function X5(t){let{runRequest:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}async function e7(t){let{runCollection:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}async function t7(t){let{runFolder:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}async function r7(t){let{runSuite:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}My();y0();ga();pC();v0();cf();ff();Jf();function n7(t){return{timeout:t?.timeout??_n.timeout,followRedirects:t?.followRedirects??_n.followRedirects,followOriginalMethod:t?.followOriginalMethod??_n.followOriginalMethod,followAuthHeader:t?.followAuthHeader??_n.followAuthHeader,maxRedirects:t?.maxRedirects??_n.maxRedirects,strictSSL:t?.strictSSL??_n.strictSSL,decompress:t?.decompress??_n.decompress,includeCookies:t?.includeCookies??_n.includeCookies,tls:t?.tls??_n.tls,certificates:t?.certificates??_n.certificates}}Jf();qm();Xl();t0();s0();Vf();_m();Hf();od();p0();m0();Ph();ma();ma();d0();function i7(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 s7(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"),(m,y)=>r[parseInt(y,10)]),c=l(s),d=o.split("&").filter(Boolean).map(p=>{let m=l(p),y=m.indexOf("=");return y===-1?{key:m,value:"",enabled:!0}:{key:decodeURIComponent(m.slice(0,y)),value:decodeURIComponent(m.slice(y+1)),enabled:!0}});return{cleanUrl:c,params:d}}catch{return{cleanUrl:t,params:[]}}}function o7(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 a7=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),l7=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function PN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function kN(t){return/\{\{[^}]+\}\}/.test(t)}function jy(t,e=16){return t.length>=e&&!kN(t)}function u7(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 c=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&jy(c[2])?s(`${c[1].toUpperCase()}_TOKEN`,c[2]):jy(o.value)&&s("AUTH_TOKEN",o.value)}else a7.has(l)&&jy(o.value)&&s(PN(o.key),o.value)}for(let o of e)l7.has(o.key.toLowerCase())&&jy(o.value)&&s(PN(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)&&!kN(r)){let c=`${o.protocol}//${o.host}`;s("BASE_URL",c)}}catch{}return n}function c7(t){let e=i7(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,c=!1,d=!1,p=[],m=[],y=0;for(;y<n.length;){let E=n[y];if(E==="-X"||E==="--request")i=n[++y]??"";else if(E==="-H"||E==="--header"){let k=n[++y]??"",P=k.indexOf(":");P>0&&o.push({key:k.slice(0,P).trim(),value:k.slice(P+1).trim()})}else if(E==="-d"||E==="--data"||E==="--data-raw"||E==="--data-binary"||E==="--data-ascii")l=n[++y]??"";else if(E==="--json")l=n[++y]??"",c=!0;else if(E==="-u"||E==="--user"){let k=n[++y]??"",P=btoa(k);o.push({key:"Authorization",value:`Basic ${P}`})}else if(E==="-b"||E==="--cookie")o.push({key:"Cookie",value:n[++y]??""});else if(E==="--url")s=n[++y]??"";else if(E==="-G"||E==="--get")d=!0;else if(E==="-F"||E==="--form"){let k=n[++y]??"",P=k.indexOf("=");P>0&&p.push({key:k.slice(0,P),value:k.slice(P+1)})}else E==="--data-urlencode"?m.push(n[++y]??""):E==="-A"||E==="--user-agent"?o.push({key:"User-Agent",value:n[++y]??""}):E==="-e"||E==="--referer"||E==="--referrer"?o.push({key:"Referer",value:n[++y]??""}):E==="--compressed"||E==="-L"||E==="--location"||E==="-v"||E==="--verbose"||E==="-s"||E==="--silent"||E==="-i"||E==="--include"||E==="-k"||E==="--insecure"||E==="--http1.1"||E==="--http2"||E==="--http3"||(E==="-o"||E==="--output"||E==="--max-time"||E==="--connect-timeout"||E==="-m"||E==="--limit-rate"||E==="--proxy"||E==="-x"?y++:!E.startsWith("-")&&!s&&(s=E));y++}d?i="GET":i||(i=l!==null||p.length>0||m.length>0?"POST":"GET");let{cleanUrl:b,params:q}=s7(s),x=null;if(p.length>0)x={type:"raw",format:"text",content:p.map(k=>`${encodeURIComponent(k.key)}=${encodeURIComponent(k.value)}`).join("&")},o.some(k=>k.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(m.length>0)x={type:"raw",format:"text",content:m.join("&")},o.some(E=>E.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let E=l.trim(),k=c||E.startsWith("{")||E.startsWith("[");x={type:"raw",format:k?"json":"text",content:l},k&&!o.some(P=>P.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let v=o.map(E=>({...E,enabled:!0})),_=u7(o,q,b||s);return{name:o7(b||s),method:i.toUpperCase(),url:b||s,headers:v,queryParams:q,body:x,suggestedVars:_}}async function f7(t,e,r,n){let i=AN(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),c=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${c}/${s})\u2026`,1/s*100);let d=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:m7(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(d7(d)),m=p7(p);h7(l,m)}catch{}}await e.saveCollection(t)}function d7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
1021
+ [View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:d+m}]}}case"prompts/list":return{prompts:Iy};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=Yn(t.workspaceFolder);try{return await Gx(n,i,s.collection,t.runStore)}finally{hc(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function W5(t,e,r){let n=!t.container,i=t.container??Yn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&hc(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 z5(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=Lo.resolve(i),o=t.container?.config.getResultsPath(),l=o?Lo.dirname(o):Lo.resolve(t.workspaceFolder,".http-forge",".cache");if(!s.startsWith(l+Lo.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}qN.readFile(s,"utf-8",(c,d)=>{if(c){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(d)})}function AC(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 J5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return Ii(()=>Dy({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=st(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?AC(t.runStore,`${r.name} / ${Ts(n)}`,s,()=>Ii(()=>Ns({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}))):Ii(()=>Ns({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=st(r).length;return n.async===!0?AC(t.runStore,r.name,i,()=>Ii(()=>Ns({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):Ii(()=>Ns({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=Yn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.nodes.filter(d=>d.type==="request").length??0)*(i.iterations??l?.config?.iterations??1)}finally{hc(s)}return i.async===!0?AC(t.runStore,n,o,()=>Ii(()=>pp({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}))):Ii(()=>pp({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 $C(t,e,r={}){let n=t.workspaceFolder,i=U5(t.container,e);if(Object.values(G).includes(i)){let l=Yn(n);try{let c=await zx(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,J5(t));return G5.has(i)&&TC.delete(n),c}finally{hc(l)}}let s=tC(i),o=Yn(n);try{let l=o.collection.getAllCollections(),c=l.map(b=>b.id),d=b=>{let q=nc(b,c),x=q?l.find(v=>v.id===q):void 0;if(!x)throw new Error(`Collection not found for tool: ${e}`);return x};if(s.kind==="request"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed request tool: ${e}`);let x=d(b),v=st(x).map(E=>E.request.id),R=nc(q,v);if(!R)throw new Error(`Request not found in collection "${x.name}" for tool: ${e}`);return Ii(()=>Dy({workspaceFolder:n,collectionId:x.id,requestId:R,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[b]=s.tokens;if(!b)throw new Error(`Malformed collection tool: ${e}`);let q=d(b);return Ii(()=>Ns({workspaceFolder:n,collectionId:q.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed folder tool: ${e}`);let x=d(b),v=(o.collection.getAllCollections().find(k=>k.id===x.id),void 0),R=st(x).map(k=>k.folderPath).filter((k,P,M)=>k&&M.indexOf(k)===P),E=rC(q,R);if(!E)throw new Error(`Folder not found in collection "${x.name}" for tool: ${e}`);return Ii(()=>Ns({workspaceFolder:n,collectionId:x.id,folderPath:E,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 m=await o.testSuite.getAllSuites(),y=nc(p,m.map(b=>b.id));if(!y)throw new Error(`Test suite not found for tool: ${e}`);return Ii(()=>pp({workspaceFolder:n,suiteId:y,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{hc(o)}}function ll(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function EN(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 Y5(t){return F5(async(e,r)=>{try{if(W5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){ll(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){z5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await EN(e)}catch{CN(r,null,-32700,"Parse error");return}try{let i=await V5(t,n);ll(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){CN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await EN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){ll(r,400,{error:'Field "name" is required'});return}let i=await $C(t,n.name,n.args??{});ll(r,200,{result:i});return}ll(r,405,{error:"Method not allowed"})}catch(n){ll(r,500,{error:n.message})}})}function K5(t){if(typeof t.port=="number"&&Number.isFinite(t.port))return Math.min(65535,Math.max(1,Math.floor(t.port)));let r=new vo(Lo.resolve(t.workspaceFolder)).getMcpConfig().port;return Math.min(65535,Math.max(1,Math.floor(r||3100)))}async function Q5(t){let e=K5(t),r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new lp};return D5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=Yn(i.workspaceFolder));let s=Y5(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&&(hc(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 $C(i,s,o??{})}}}var D5,j5,TC,kC,G5,ON=le(()=>{"use strict";km();pc();Ei();Jx();Yx();Kx();fC();Py();sp();My();D5=new Map;j5=3e3,TC=new Map,kC=new Map;G5=Wx});var Zl=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()}};Ph();ma();function aS(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(hq),source:{format:"folder",filePath:e,version:t.version}}}function hq(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(hq)};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 VL(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(lS)}}function lS(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(lS)}:{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 ef=class{store;constructor(e){this.store=new so(e)}loadAll(){return this.store.loadAll().map(r=>aS(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 aS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return aS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(VL(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,lS(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 tf=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()}};ga();var rf=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 Ct.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 Ct.parseCookieHeaders(e,r)}isExpired(e){return Ct.isExpired(e)}domainMatches(e,r){return Ct.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)}};Th();var gs=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})}};Xl();uf();var ao=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new wa,this.urlBuilder=new li}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=gs.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};uf();cf();ff();Xl();Vf();Hf();var wu=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?[wt("path").join(s.forgeRoot,"modules")]:[],l=new vs(new li,new bs,e);this.scriptExecutor=new xs(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||{}},c={...s},d=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,m=this.findFolderPath(r,e.id),y=this.buildScriptChain(e,r,m),b={request:{url:d.url,method:d.method,headers:{...d.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:c,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:(R,E,k)=>{R==="set"&&E&&k!==void 0?this.forgeEnv.setGlobal(E,k):R==="unset"&&E?this.forgeEnv.unsetGlobal(E):R==="clear"&&this.forgeEnv.clearGlobals()}},q=this.scriptExecutor.createRequestSession(b),x,v;try{if(!n.skipPreRequest&&y.preRequest.length>0){let P=await q.executePreRequest(y.preRequest);if(x={success:P.success,error:P.error,modifiedVariables:P.modifiedVariables,modifiedEnvironment:P.modifiedEnvironmentVariables,modifiedGlobals:P.modifiedGlobals,modifiedCollectionVariables:P.modifiedCollectionVariables,consoleOutput:P.consoleOutput,modifiedRequest:P.modifiedRequest?{url:P.modifiedRequest.url,method:P.modifiedRequest.method,headers:P.modifiedRequest.headers,body:P.modifiedRequest.body?.content}:void 0},P.modifiedVariables&&(l={...l,...P.localVariables??P.modifiedVariables}),P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables}),P.modifiedRequest){let M=P.modifiedRequest;M.url&&(d.url=M.url),M.method&&(d.method=M.method),M.headers&&(d.headers={...d.headers,...M.headers}),M.body!==void 0&&(d.body=M.body?.content||M.body)}if(!P.success)throw new Error(`Pre-request script failed: ${P.error}`)}let R={...c,...l};d=this.interpolateRequest(d,R);let E=n.overrides?.body||e.body;if(this.preprocessor&&E&&typeof E!="string"&&E.type==="graphql"&&d.body!==void 0){let P=this.preprocessor.encodeBody({type:"graphql",content:d.body});P!=null&&(d.body=typeof P=="string"?P:JSON.stringify(P))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(d.body)){let P=this.buildMultipartFormData({type:"form-data",content:d.body});P&&(d.body=P)}let k=await this.httpClient.send(d);if(!n.skipPostResponse&&y.postResponse.length>0){let P=await q.executePostResponse(y.postResponse,{status:k.status,statusText:k.statusText,headers:k.headers,body:k.body,cookies:xm(k.headers,k.cookies,d.url),responseTime:k.time,responseSize:k.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});v={success:!0,assertions:P.testResults,consoleOutput:P.consoleOutput,modifiedEnvironment:P.modifiedEnvironmentVariables},P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables})}return{response:k,preRequestResult:x,postResponseResult:v,totalTime:Date.now()-i,finalRequest:d,variables:{environment:c,local:l}}}finally{q.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 m of e.query)m.enabled!==!1&&p.append(m.key,m.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||{}},c,d=r?.body||e.body;if(d)if(typeof d=="string")c=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")c=typeof d.content=="string"?d.content:JSON.stringify(d.content);else if(d.type==="form-data")c=this.buildMultipartFormData(d);else{let p=this.preprocessor.encodeBody(d);c=p!=null?String(p):void 0}else d.content&&(c=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&d.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:c,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=ao.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 c=[...o,l];if(i(l.items,c))return!0}}return!1};return i(e.items,[]),n}};function gz(){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 Wf=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=gz(),l=Date.now(),c={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,c);let d=this.requestIndex.get(e)||[];for(d.unshift(o);d.length>this.maxEntriesPerRequest;){let p=d.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,d),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 c}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 zf=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),c=Date.now(),d;try{d=await l.text()}catch{d=null}let p={};return l.headers.forEach((m,y)=>{let b=p[y];b!==void 0?p[y]=Array.isArray(b)?[...b,m]:[b,m]:p[y]=m}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:d,time:c-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};cf();ff();Jf();qm();Xl();var Fa=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};Im();import*as Rn from"fs/promises";import*as _u from"path";var Gf=class{async readFile(e){return Rn.readFile(e,"utf-8")}async writeFile(e,r){let n=_u.dirname(e);await this.mkdir(n),await Rn.writeFile(e,r,"utf-8")}async exists(e){try{return await Rn.access(e),!0}catch{return!1}}async mkdir(e){await Rn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=_u.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return Rn.readdir(e)}async isDirectory(e){try{return(await Rn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await Rn.readdir(e,{withFileTypes:!0});for(let i of n){let s=_u.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};Vf();var u0=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 wa,this.fileSystem=e.fileSystem||new Gf,this.preprocessor=e.preprocessor||new Ma,this.dataFileParser=e.dataFileParser||new Da,this.cookieJar=e.cookieJar||new rf,e.enableHistory?this.requestHistory=e.requestHistory||new Wf({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 Na(s)}else this.httpClient=new zf;let r=e.forgeRoot?[wt("path").join(e.forgeRoot,"modules")]:[],n=new vs(new li,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new xs(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new tf,this.parserRegistry.register("http-forge",new Fa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=wt("path").join(e.forgeRoot,"collections");this.collectionLoader=new ef(s)}else this.collectionLoader=new Zl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new gs(e.environmentConfig):gs.fromVariables({}),this.forgeEnv=ao.fromResolver(this.environmentStore),this.requestExecutor=new wu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new bs;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 Zl)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 gs(e),this.forgeEnv=ao.fromResolver(this.environmentStore),this.requestExecutor=new wu(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=wt("path"),i=n.join(e,"environments"),s,o=nf(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[c,d]of Object.entries(o.environments)){let p=o.localCredentials[c]?.variables||{};s.environments[c]={name:c,variables:{...d.variables,...p}}}}else{let c=wt("fs"),d=n.join(i,"environments.json");if(c.existsSync(d))try{let p=c.readFileSync(d,"utf-8"),m=JSON.parse(p);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[y,b]of Object.entries(m.environments)){let q=b;s.environments[y]={name:q.name||y,variables:q.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};jx();Lx();wy();Ei();Jx();Yx();Kx();fC();Py();sp();dC();async function Z5(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(ON(),IN));return e(t)}async function X5(t){let{runRequest:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}async function e7(t){let{runCollection:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}async function t7(t){let{runFolder:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}async function r7(t){let{runSuite:e}=await Promise.resolve().then(()=>(pc(),hp));return e(t)}My();y0();ga();pC();v0();cf();ff();Jf();function n7(t){return{timeout:t?.timeout??_n.timeout,followRedirects:t?.followRedirects??_n.followRedirects,followOriginalMethod:t?.followOriginalMethod??_n.followOriginalMethod,followAuthHeader:t?.followAuthHeader??_n.followAuthHeader,maxRedirects:t?.maxRedirects??_n.maxRedirects,strictSSL:t?.strictSSL??_n.strictSSL,decompress:t?.decompress??_n.decompress,includeCookies:t?.includeCookies??_n.includeCookies,tls:t?.tls??_n.tls,certificates:t?.certificates??_n.certificates}}Jf();qm();Xl();t0();s0();Vf();_m();Hf();od();p0();m0();Ph();ma();ma();d0();function i7(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 s7(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"),(m,y)=>r[parseInt(y,10)]),c=l(s),d=o.split("&").filter(Boolean).map(p=>{let m=l(p),y=m.indexOf("=");return y===-1?{key:m,value:"",enabled:!0}:{key:decodeURIComponent(m.slice(0,y)),value:decodeURIComponent(m.slice(y+1)),enabled:!0}});return{cleanUrl:c,params:d}}catch{return{cleanUrl:t,params:[]}}}function o7(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 a7=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),l7=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function PN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function kN(t){return/\{\{[^}]+\}\}/.test(t)}function jy(t,e=16){return t.length>=e&&!kN(t)}function u7(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 c=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&jy(c[2])?s(`${c[1].toUpperCase()}_TOKEN`,c[2]):jy(o.value)&&s("AUTH_TOKEN",o.value)}else a7.has(l)&&jy(o.value)&&s(PN(o.key),o.value)}for(let o of e)l7.has(o.key.toLowerCase())&&jy(o.value)&&s(PN(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)&&!kN(r)){let c=`${o.protocol}//${o.host}`;s("BASE_URL",c)}}catch{}return n}function c7(t){let e=i7(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,c=!1,d=!1,p=[],m=[],y=0;for(;y<n.length;){let E=n[y];if(E==="-X"||E==="--request")i=n[++y]??"";else if(E==="-H"||E==="--header"){let k=n[++y]??"",P=k.indexOf(":");P>0&&o.push({key:k.slice(0,P).trim(),value:k.slice(P+1).trim()})}else if(E==="-d"||E==="--data"||E==="--data-raw"||E==="--data-binary"||E==="--data-ascii")l=n[++y]??"";else if(E==="--json")l=n[++y]??"",c=!0;else if(E==="-u"||E==="--user"){let k=n[++y]??"",P=btoa(k);o.push({key:"Authorization",value:`Basic ${P}`})}else if(E==="-b"||E==="--cookie")o.push({key:"Cookie",value:n[++y]??""});else if(E==="--url")s=n[++y]??"";else if(E==="-G"||E==="--get")d=!0;else if(E==="-F"||E==="--form"){let k=n[++y]??"",P=k.indexOf("=");P>0&&p.push({key:k.slice(0,P),value:k.slice(P+1)})}else E==="--data-urlencode"?m.push(n[++y]??""):E==="-A"||E==="--user-agent"?o.push({key:"User-Agent",value:n[++y]??""}):E==="-e"||E==="--referer"||E==="--referrer"?o.push({key:"Referer",value:n[++y]??""}):E==="--compressed"||E==="-L"||E==="--location"||E==="-v"||E==="--verbose"||E==="-s"||E==="--silent"||E==="-i"||E==="--include"||E==="-k"||E==="--insecure"||E==="--http1.1"||E==="--http2"||E==="--http3"||(E==="-o"||E==="--output"||E==="--max-time"||E==="--connect-timeout"||E==="-m"||E==="--limit-rate"||E==="--proxy"||E==="-x"?y++:!E.startsWith("-")&&!s&&(s=E));y++}d?i="GET":i||(i=l!==null||p.length>0||m.length>0?"POST":"GET");let{cleanUrl:b,params:q}=s7(s),x=null;if(p.length>0)x={type:"raw",format:"text",content:p.map(k=>`${encodeURIComponent(k.key)}=${encodeURIComponent(k.value)}`).join("&")},o.some(k=>k.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(m.length>0)x={type:"raw",format:"text",content:m.join("&")},o.some(E=>E.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let E=l.trim(),k=c||E.startsWith("{")||E.startsWith("[");x={type:"raw",format:k?"json":"text",content:l},k&&!o.some(P=>P.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let v=o.map(E=>({...E,enabled:!0})),R=u7(o,q,b||s);return{name:o7(b||s),method:i.toUpperCase(),url:b||s,headers:v,queryParams:q,body:x,suggestedVars:R}}async function f7(t,e,r,n){let i=AN(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),c=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${c}/${s})\u2026`,1/s*100);let d=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:m7(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(d7(d)),m=p7(p);h7(l,m)}catch{}}await e.saveCollection(t)}function d7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
1022
1022
  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.
1023
1023
  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.
1024
1024