apitestcenter 0.18.3 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +1 -1
  3. package/dist/THIRD-PARTY-NOTICES-UI.txt +40 -10
  4. package/dist/THIRD-PARTY-NOTICES.txt +3 -3
  5. package/dist/cli.mjs +796 -548
  6. package/dist/ui/404/index.html +1 -1
  7. package/dist/ui/404.html +1 -1
  8. package/dist/ui/__next.__PAGE__.txt +17 -17
  9. package/dist/ui/__next._full.txt +18 -18
  10. package/dist/ui/__next._tree.txt +2 -2
  11. package/dist/ui/_next/static/chunks/06kdixojb32u6.js +27 -0
  12. package/dist/ui/_next/static/chunks/0a2q6cpe_c4k-.js +3 -0
  13. package/dist/ui/_next/static/chunks/0faedhifzwobh.js +31 -0
  14. package/dist/ui/_next/static/chunks/{0q8iq_7i4ohjr.js → 0glo5t3rr5ux5.js} +2 -2
  15. package/dist/ui/_next/static/chunks/0jq6xbzrkaewp.js +2 -0
  16. package/dist/ui/_next/static/chunks/1-9ymrwk2b425.js +1 -0
  17. package/dist/ui/_next/static/chunks/13ez75q2t6tkt.js +51 -0
  18. package/dist/ui/_next/static/chunks/1r8qtltx9mmfv.js +2 -0
  19. package/dist/ui/_next/static/chunks/{12whdxhkvkd-y.js → 1s068j2ev364j.js} +1 -1
  20. package/dist/ui/_next/static/chunks/1v2mgl5t1qg1g.js +50 -0
  21. package/dist/ui/_next/static/chunks/1y7u7u9moxxxk.js +1 -0
  22. package/dist/ui/_next/static/chunks/{3wtqdtu331_vc.js → 2-ccpn24ve6pz.js} +3 -3
  23. package/dist/ui/_next/static/chunks/2db3njpc0xw6w.js +1 -0
  24. package/dist/ui/_next/static/chunks/2gs5hczs3bpq_.css +3 -0
  25. package/dist/ui/_next/static/chunks/2pqt6mieje__r.js +123 -0
  26. package/dist/ui/_next/static/chunks/33purk5k-9o6l.js +1 -0
  27. package/dist/ui/_next/static/chunks/3ooomvul846zs.js +3 -0
  28. package/dist/ui/_next/static/chunks/3ps_0myey2cxz.js +22 -0
  29. package/dist/ui/_next/static/chunks/3rptf3gr286c3.js +1056 -0
  30. package/dist/ui/_next/static/chunks/3yvd9c8pue6u7.js +50 -0
  31. package/dist/ui/_next/static/chunks/45bkmnyf6ozrx.js +50 -0
  32. package/dist/ui/_not-found/__next._full.txt +13 -13
  33. package/dist/ui/_not-found/__next._not-found.__PAGE__.txt +12 -12
  34. package/dist/ui/_not-found/__next._tree.txt +2 -2
  35. package/dist/ui/_not-found/index.html +1 -1
  36. package/dist/ui/_not-found/index.txt +13 -13
  37. package/dist/ui/compare/__next._full.txt +18 -18
  38. package/dist/ui/compare/__next._tree.txt +2 -2
  39. package/dist/ui/compare/__next.compare.__PAGE__.txt +17 -17
  40. package/dist/ui/compare/index.html +1 -1
  41. package/dist/ui/compare/index.txt +18 -18
  42. package/dist/ui/connections/__next._full.txt +16 -16
  43. package/dist/ui/connections/__next._tree.txt +2 -2
  44. package/dist/ui/connections/__next.connections.__PAGE__.txt +15 -15
  45. package/dist/ui/connections/index.html +2 -2
  46. package/dist/ui/connections/index.txt +16 -16
  47. package/dist/ui/history/__next._full.txt +29 -28
  48. package/dist/ui/history/__next._tree.txt +2 -2
  49. package/dist/ui/history/__next.history.__PAGE__.txt +30 -29
  50. package/dist/ui/history/index.html +1 -1
  51. package/dist/ui/history/index.txt +29 -28
  52. package/dist/ui/home/__next._full.txt +18 -18
  53. package/dist/ui/home/__next._tree.txt +2 -2
  54. package/dist/ui/home/__next.home.__PAGE__.txt +17 -17
  55. package/dist/ui/home/index.html +1 -1
  56. package/dist/ui/home/index.txt +18 -18
  57. package/dist/ui/index.html +1 -1
  58. package/dist/ui/index.txt +18 -18
  59. package/dist/ui/preview/__next._full.txt +17 -17
  60. package/dist/ui/preview/__next._tree.txt +2 -2
  61. package/dist/ui/preview/__next.preview.__PAGE__.txt +16 -16
  62. package/dist/ui/preview/index.html +1 -1
  63. package/dist/ui/preview/index.txt +17 -17
  64. package/dist/ui/suite/__next._full.txt +15 -15
  65. package/dist/ui/suite/__next._tree.txt +2 -2
  66. package/dist/ui/suite/__next.suite.__PAGE__.txt +14 -14
  67. package/dist/ui/suite/index.html +1 -1
  68. package/dist/ui/suite/index.txt +15 -15
  69. package/dist/ui/tests/__next._full.txt +13 -13
  70. package/dist/ui/tests/__next._tree.txt +2 -2
  71. package/dist/ui/tests/__next.tests.__PAGE__.txt +12 -12
  72. package/dist/ui/tests/index.html +1 -1
  73. package/dist/ui/tests/index.txt +13 -13
  74. package/package.json +2 -2
  75. package/dist/ui/_next/static/chunks/0-zga2d528cxt.js +0 -50
  76. package/dist/ui/_next/static/chunks/03ligbvtk7nsc.js +0 -123
  77. package/dist/ui/_next/static/chunks/03y58w9gmwqc-.js +0 -50
  78. package/dist/ui/_next/static/chunks/08rlo-0gnct9m.js +0 -50
  79. package/dist/ui/_next/static/chunks/0bgmfb8f3pd8e.js +0 -1
  80. package/dist/ui/_next/static/chunks/0g9k0swrer6i5.js +0 -1
  81. package/dist/ui/_next/static/chunks/1-t79a3q7gmjn.js +0 -31
  82. package/dist/ui/_next/static/chunks/14dtemzsvcfmn.js +0 -50
  83. package/dist/ui/_next/static/chunks/1snbdq1z951ks.js +0 -906
  84. package/dist/ui/_next/static/chunks/20j4wusnbtqa2.js +0 -4
  85. package/dist/ui/_next/static/chunks/243c1-49gb3pr.js +0 -1
  86. package/dist/ui/_next/static/chunks/2sjog4to0fmbb.css +0 -3
  87. package/dist/ui/_next/static/chunks/2sr5dm3__ghgo.js +0 -27
  88. package/dist/ui/_next/static/chunks/2su0ql-zu4q0_.js +0 -3
  89. package/dist/ui/_next/static/chunks/3-rdixjnndtyk.js +0 -51
  90. package/dist/ui/_next/static/chunks/32_tmz8ibsdo3.js +0 -22
  91. package/dist/ui/_next/static/chunks/3eti_s9gpiis0.js +0 -2
  92. package/dist/ui/_next/static/chunks/3wzu1zkfqdmn6.js +0 -2
  93. /package/dist/ui/_next/static/{lomhkNrlljr9WxdUu6_Mc → XNta4K_1tCu7sU6jlccSS}/_buildManifest.js +0 -0
  94. /package/dist/ui/_next/static/{lomhkNrlljr9WxdUu6_Mc → XNta4K_1tCu7sU6jlccSS}/_clientMiddlewareManifest.js +0 -0
  95. /package/dist/ui/_next/static/{lomhkNrlljr9WxdUu6_Mc → XNta4K_1tCu7sU6jlccSS}/_ssgManifest.js +0 -0
@@ -0,0 +1,1056 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[22543,e=>{var t=e.i(51487),r=e.i(77306),n=e.i(30597),s=e.i(14865);e.s(["f",0,function({text:e,label:a="More information"}){let i=(0,r.useRef)(null),o=(0,r.useRef)(null),[l,u]=(0,r.useState)(!1),[c,d]=(0,r.useState)(!1),[p,h]=(0,r.useState)(null),f=l||c;return(0,r.useLayoutEffect)(()=>{if(!f)return h(null);let e=()=>{if(!i.current)return;let e=(0,s.C)(i.current),t=(0,s.v)(),r=Math.min(256,t.width-32),n=o.current?.offsetHeight??80,a=Math.min(Math.max(16,e.left),t.width-r-16);h({top:e.bottom+6+n<=t.height-8?e.bottom+6:Math.max(8,e.top-6-n),left:a})};e();let t=requestAnimationFrame(e);return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{cancelAnimationFrame(t),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[f]),(0,r.useEffect)(()=>{if(!l)return;let e=e=>{let t=e.target;i.current?.contains(t)||o.current?.contains(t)||u(!1)},t=e=>{"Escape"===e.key&&u(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[l]),(0,t.jsxs)("span",{ref:i,className:"relative inline-flex align-middle",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[(0,t.jsx)("button",{type:"button",className:"grid h-4 w-4 place-items-center rounded-full border border-line text-[11px] leading-none text-mute hover:border-accent hover:text-accent","aria-label":a,"aria-expanded":f,onClick:e=>{e.stopPropagation(),u(e=>!e)},onFocus:()=>d(!0),onBlur:()=>d(!1),children:"?"}),f&&"u">typeof document?(0,n.createPortal)((0,t.jsx)("span",{ref:o,role:"tooltip",style:{width:"min(256px, calc(100vw - 2rem))",top:p?.top??-9999,left:p?.left??-9999},className:"fixed z-[80] rounded-md border border-line bg-panel-2 px-2.5 py-2 text-xs leading-5 font-normal tracking-normal text-ink normal-case shadow-lg",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:e}),document.body):null]})}])},39170,e=>{var t=e.i(51487),r=e.i(23986),n=e.i(77306);let s=(0,n.createContext)(async()=>!1);function a({options:e,onClose:s}){let i=(0,n.useRef)(null),o=(0,n.useRef)(null),l=(0,n.useRef)(null),u="danger"===e.tone;return(0,n.useEffect)(()=>{let e=document.activeElement;return(u?o:l).current?.focus(),()=>e?.focus()},[u]),(0,t.jsx)("div",{className:"fixed inset-0 z-[95] grid place-items-center bg-black/50 p-4 backdrop-blur-sm",onMouseDown:e=>{e.target===e.currentTarget&&s(!1)},children:(0,t.jsxs)("div",{ref:i,role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title",onKeyDown:function(e){if("Escape"===e.key&&(e.stopPropagation(),s(!1)),"Tab"===e.key){let t=i.current?.querySelectorAll("button");if(!t||0===t.length)return;let r=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n||(e.preventDefault(),r.focus())}},className:"w-full max-w-md rounded-xl border border-line bg-panel p-5 shadow-2xl",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[u?(0,t.jsx)("span",{className:"mt-0.5 grid h-8 w-8 shrink-0 place-items-center rounded-full bg-warn/15 text-warn",children:(0,t.jsx)(r.f,{size:16})}):null,(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{id:"confirm-title",className:"text-base font-medium text-ink",children:e.title}),e.body?(0,t.jsx)("div",{className:"mt-2 text-sm text-mute",children:e.body}):null]})]}),(0,t.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,t.jsx)("button",{ref:o,type:"button",className:"btn btn-secondary",onClick:()=>s(!1),children:e.cancelLabel??"Cancel"}),(0,t.jsx)("button",{ref:l,type:"button",className:"btn btn-primary",onClick:()=>s(!0),children:e.confirmLabel??"Continue"})]})]})})}e.s(["a",0,function({children:e}){let[r,i]=(0,n.useState)(null),o=(0,n.useCallback)(e=>new Promise(t=>i({...e,resolve:t})),[]);return(0,t.jsxs)(s.Provider,{value:o,children:[e,r?(0,t.jsx)(a,{options:r,onClose:function(e){r?.resolve(e),i(null)}}):null]})},"L",0,function(){return(0,n.useContext)(s)}])},28867,e=>{var t=e.i(51487);e.s(["f",0,function({value:e,options:r,onChange:n,label:s,size:a="sm"}){return(0,t.jsx)("div",{role:"group","aria-label":s,className:"inline-flex flex-wrap rounded-md border border-line bg-panel-2 p-0.5",children:r.map(r=>{let s=r.value===e;return(0,t.jsx)("button",{type:"button","aria-pressed":s,title:r.title,onClick:()=>n(r.value),className:`rounded px-2.5 ${"md"===a?"py-1.5 text-sm":"py-1 text-xs"} transition-colors ${s?"bg-panel text-ink shadow-sm":"text-mute hover:text-ink"}`,children:r.label},r.value)})})}])},56396,e=>{var t=e.i(51487),r=e.i(75380),n=e.i(39024),s=e.i(62620),a=e.i(9219),i=e.i(77306);let o=(0,i.createContext)(()=>{}),l=1;e.s(["N",0,function({children:e}){let[u,c]=(0,i.useState)([]),d=(0,i.useCallback)(e=>c(t=>t.filter(t=>t.id!==e)),[]),p=(0,i.useCallback)((e,t="info")=>{let r=l++;c(n=>[...n.slice(-3),{id:r,tone:t,message:e}]),window.setTimeout(()=>d(r),"error"===t?6e3:3200)},[d]);return(0,t.jsxs)(o.Provider,{value:p,children:[e,(0,t.jsx)("div",{"aria-live":"polite",className:"pointer-events-none fixed right-4 bottom-4 z-50 flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2",children:u.map(e=>{let i="success"===e.tone?r.f:"error"===e.tone?a.f:n.f,o="success"===e.tone?"text-ok":"error"===e.tone?"text-bad":"text-accent";return(0,t.jsxs)("div",{role:"error"===e.tone?"alert":"status",className:"pointer-events-auto flex items-start gap-2 rounded-lg border border-line bg-panel px-3 py-2.5 text-sm text-ink shadow-xl",children:[(0,t.jsx)(i,{size:16,className:`mt-0.5 shrink-0 ${o}`}),(0,t.jsx)("span",{className:"min-w-0 flex-1",children:e.message}),(0,t.jsx)("button",{type:"button","aria-label":"Dismiss",className:"shrink-0 rounded p-0.5 text-mute hover:text-ink",onClick:()=>d(e.id),children:(0,t.jsx)(s.X,{size:14})})]},e.id)})})]})},"d",0,function(){return(0,i.useContext)(o)}])},44505,e=>{e.s(["f",0,function(){return window.atcDesktop??null}])},15060,e=>{function t(e,t){let r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=e,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(r),6e4)}e.s(["h",0,t,"N",0,function(e,r,n){t(e,new Blob([r],{type:n}))}])},19656,e=>{e.s(["L",0,function(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`},"B",0,function(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})},"W",0,function(e){return new Intl.NumberFormat("en-US").format(Math.round(e))},"M",0,function(e,t){let r=Math.max(0,Math.round((Date.parse(t)-Date.parse(e))/1e3));if(r<60)return`${r}s`;let n=Math.floor(r/60),s=r%60;return s?`${n}m ${s}s`:`${n}m`},"E",0,function(e){return Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:`${Math.round(e)} ms`:"—"},"Z",0,function(e){return`${(100*e).toFixed(e<.01?2:1)}%`},"m",0,function(e){return Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—"}])},59180,76134,e=>{var t=e.i(51487),r=e.i(77306),n=e.i(24170);e.i(24856);var s=e.i(65510);let a="library",i="records";function o(){return new Promise((e,t)=>{let r=indexedDB.open("apitestcenter-report-viewer",1);r.onupgradeneeded=()=>r.result.createObjectStore(a),r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}async function l(){try{let e=await o();return await new Promise(t=>{let r=e.transaction(a,"readonly").objectStore(a).get(i);r.onsuccess=()=>t(Array.isArray(r.result)?r.result:[]),r.onerror=()=>t([])})}catch{return[]}}async function u(e){try{let t=await o();await new Promise(r=>{let n=t.transaction(a,"readwrite");n.objectStore(a).put(e,i),n.oncomplete=()=>r(),n.onerror=()=>r(),n.onabort=()=>r()})}catch{}}let c=new s.e,d=null;function p(){return d??="u"<typeof indexedDB?Promise.resolve():l().then(e=>c.restore(e))}async function h(e){await p();let t=e();return await u(c.records()),t}let f=e=>Error(`That ${e} is no longer in the viewer`),m={index:async()=>(await p(),c.index()),run:async e=>{await p();let t=c.run(e);if(!t)throw f("report");return t},compare:async e=>{await p();let t=c.compare(e);if(!t)throw f("compare");return t},updateRun:(e,t)=>h(()=>{let r=c.updateRun(e,t);if(!r)throw f("report");return r}),updateCompare:(e,t)=>h(()=>{let r=c.updateCompare(e,t);if(!r)throw f("compare");return r}),remove:e=>h(()=>({removed:c.remove(e)})),saveCompare:e=>h(()=>c.saveCompare(e)),import:e=>h(()=>{let t=c.add("imported.json",e,JSON.stringify(e??null).length);if("run"!==t.kind&&"compare"!==t.kind)throw Error(t.reason);let r=c.index(),n="run"===t.kind?r.runs.find(e=>e.id===t.id):r.compares.find(e=>e.id===t.id);return{kind:t.kind,summary:n}}),reveal:async()=>({path:""})};async function y(e){let t=await (0,s.V)(await Promise.all(e.map(async e=>({name:e.name,bytes:new Uint8Array(await e.arrayBuffer())}))));return h(()=>t.map(e=>"text"in e?c.addText(e.name,e.text):c.unreadable(e.name,e.error)))}async function g(e){let t=await e.text(),r=null;try{r=t?JSON.parse(t):null}catch{}if(!e.ok)throw Error(r?.error??`Engine error (${e.status})`);return r}e.s(["u",0,function(){return h(()=>c.clear())},"q",0,y,"H",0,function(){return h(()=>(0,s.i)().map(e=>c.addText(e.name,e.text)))},"B",0,m],76134);let b=(e,t)=>fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),v=n.G?m:{index:()=>fetch("/engine/history",{cache:"no-store"}).then(e=>g(e)),run:e=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>g(e)),compare:e=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{cache:"no-store"}).then(e=>g(e)),updateRun:(e,t)=>fetch(`/engine/history/runs/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>g(e)),updateCompare:(e,t)=>fetch(`/engine/history/compares/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(e=>g(e)),remove:e=>b("/engine/history/delete",e).then(e=>g(e)),saveCompare:e=>b("/engine/history/compares",e).then(e=>g(e)),import:e=>b("/engine/history/import",e).then(e=>g(e)),reveal:e=>b("/engine/history/reveal",e??{}).then(e=>g(e))},w=(0,r.createContext)({index:null,error:null,loading:!0,refresh:async()=>null,baselineFor:()=>void 0}),k="apitestcenter-history-migrated";async function x(){try{if(localStorage.getItem(k))return;let e=JSON.parse(sessionStorage.getItem("apitestcenter-session-runs")??"[]"),t=JSON.parse(sessionStorage.getItem("apitestcenter-compare-history")??"[]");for(let t of Array.isArray(e)?e:[])await v.import({report:t}).catch(()=>void 0);for(let e of Array.isArray(t)?t:[])e?.apis&&!(e.apis.length<2)&&await v.import({kind:"compare",mode:"parallel"===e.mode?"parallel":"sequence",apis:e.apis,meta:{name:e.title}}).catch(()=>void 0);sessionStorage.removeItem("apitestcenter-session-runs"),sessionStorage.removeItem("apitestcenter-compare-history"),localStorage.setItem(k,new Date().toISOString())}catch{}}e.s(["w",0,function({children:e}){let[s,a]=(0,r.useState)(null),[i,o]=(0,r.useState)(null),[l,u]=(0,r.useState)(!0),c=(0,r.useRef)(null),d=(0,r.useCallback)(()=>{if(c.current)return c.current;let e=v.index().then(e=>(a(e),o(null),e)).catch(e=>(o(e instanceof Error?e.message:"History unavailable"),null)).finally(()=>{u(!1),c.current=null});return c.current=e,e},[]);(0,r.useEffect)(()=>{(n.G?Promise.resolve():x()).finally(()=>void d());let e=()=>void d();return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[d]);let p=(0,r.useMemo)(()=>{let e=new Map;for(let t of s?.runs??[])t.baseline&&e.set(t.endpoint,t);return{index:s,error:i,loading:l,refresh:d,baselineFor:t=>e.get(t)}},[s,i,l,d]);return(0,t.jsx)(w.Provider,{value:p,children:e})},"c",0,v,"K",0,function(){return(0,r.useContext)(w)}],59180)},14865,e=>{var t=e.i(51487),r=e.i(77306);let n=[.8,.9,1,1.1,1.25,1.4,1.6],s="apitestcenter-zoom",a="apitestcenter-density",i="apitestcenter-layout",o=(0,r.createContext)({zoom:1,zoomIn:()=>{},zoomOut:()=>{},resetZoom:()=>{},density:"comfortable",setDensity:()=>{},layout:"beside",setLayout:()=>{}});function l(e){try{return localStorage.getItem(e)}catch{return null}}function u(e,t){try{localStorage.setItem(e,t)}catch{}}e.s(["c",0,function({children:e}){let[c,d]=(0,r.useState)(1),[p,h]=(0,r.useState)("comfortable"),[f,m]=(0,r.useState)("beside");(0,r.useEffect)(()=>{let e=Number(l(s));n.includes(e)&&d(e),"compact"===l(a)&&h("compact"),"below"===l(i)&&m("below")},[]),(0,r.useEffect)(()=>{document.documentElement.style.setProperty("--zoom",String(c)),document.documentElement.style.zoom=1===c?"":String(c)},[c]),(0,r.useEffect)(()=>{document.documentElement.dataset.density=p},[p]);let y=(0,r.useCallback)(e=>{d(t=>{let r=n.findIndex(e=>e>=t-.001),a=n[Math.min(n.length-1,Math.max(0,(r<0?2:r)+e))];return u(s,String(a)),a})},[]),g=(0,r.useCallback)(()=>{d(1),u(s,"1")},[]),b=(0,r.useCallback)(e=>{h(e),u(a,e)},[]),v=(0,r.useCallback)(e=>{m(e),u(i,e)},[]);(0,r.useEffect)(()=>{let e=e=>{if((e.ctrlKey||e.metaKey)&&!e.altKey){if("="===e.key||"+"===e.key)y(1);else if("-"===e.key||"_"===e.key)y(-1);else{if("0"!==e.key)return;g()}e.preventDefault()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,g]);let w=(0,r.useMemo)(()=>({zoom:c,zoomIn:()=>y(1),zoomOut:()=>y(-1),resetZoom:g,density:p,setDensity:b,layout:f,setLayout:v}),[c,y,g,p,b,f,v]);return(0,t.jsx)(o.Provider,{value:w,children:e})},"C",0,function(e){let t=Number(document.documentElement.style.zoom)||1,r=e.getBoundingClientRect();return{top:r.top/t,left:r.left/t,bottom:r.bottom/t,right:r.right/t,width:r.width/t,height:r.height/t}},"v",0,function(){let e=Number(document.documentElement.style.zoom)||1;return{width:window.innerWidth/e,height:window.innerHeight/e}},"x",0,()=>(0,r.useContext)(o)])},56003,24170,e=>{var t=e.i(77306);let r=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},s=(0,t.createContext)({}),a=(0,t.forwardRef)(({color:e,size:a,width:i,height:o,strokeWidth:l,absoluteStrokeWidth:u,nonScalingStroke:c,className:d="",children:p,iconNode:h=[],icon:f={node:h,aliases:[],size:24},...m},y)=>{let{size:g=24,strokeWidth:b=2,absoluteStrokeWidth:v=!1,nonScalingStroke:w=!1,color:k="currentColor",className:x=""}=(0,t.useContext)(s)??{},$=!!p||(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(m),[S,_,A=[]]=function(e,t={}){return function(e,t={}){let s=t.attributeNames??{},a=e=>s[e]??e,i=e.size??e.width??n.width,o=e.size??e.height??n.height,l=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...l],c=t.className?.split(" ").filter(Boolean)??[],d=!1===t.includeDefaultClasses?r(...c):r("lucide",...u,...c),p=t.absoluteStrokeWidth?Number(t.strokeWidth??n["stroke-width"])*Number(e.size??e.width??n.width)/Number(t.size??t.width??n.width):t.strokeWidth??n["stroke-width"];return["svg",{...Object.entries(n).reduce((e,[t,r])=>(e[a(t)]=r,e),{}),..."color"in t&&t.color&&{[a("stroke")]:t.color},..."size"in t&&null!=t.size&&{[a("width")]:t.size,[a("height")]:t.size},..."width"in t&&null!=t.width&&{[a("width")]:t.width},..."height"in t&&null!=t.height&&{[a("height")]:t.height},[a("stroke-width")]:p,...d&&{[a("class")]:d},[a("viewBox")]:`0 0 ${i} ${o}`,...!1===t.hasA11yProp?{[a("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{let[r,n,s]=e,i=t.nonScalingStroke?{[a("vector-effect")]:"non-scaling-stroke",...n}:n;return s?[r,i,s]:[r,i]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(f,{color:e??k,width:i??a??g,height:o??a??g,strokeWidth:l??b,absoluteStrokeWidth:u??v,nonScalingStroke:c??w,className:r(x,d),hasA11yProp:$,attributes:m});return(0,t.createElement)(S,{ref:y,..._},[...A.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(p)?p:[p]])});e.s(["f",0,function(e,r=[],n=[]){let s,i="string"==typeof e?function(e,t,r=[]){if(null==t)throw Error("[lucide]: iconNode is required when icon name is used");return{name:e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),size:24,node:t,...r.length>0?{aliases:r}:{}}}(e,r,n):e,o=(0,t.forwardRef)(({className:e,...r},n)=>(0,t.createElement)(a,{ref:n,icon:i,className:e,...r}));return i.name&&(o.displayName=(s=(e=>{let t="",r=!1;for(let n of e){if("-"===n||"_"===n||n<=" "){r=t.length>0;continue}0===t.length?t+=n.toLowerCase():t+=r?n.toUpperCase():n,r=!1}return t})(i.name)).charAt(0).toUpperCase()+s.slice(1)),o}],56003);let i="1"===(e.i(31746)).default.env.NEXT_PUBLIC_ATC_VIEWER;e.s(["C",0,"https://apitestcenter.com/","G",0,i],24170)},59780,e=>{var t=e.i(56003);let r={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],59780)},30932,e=>{var t=e.i(56003);let r={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],30932)},72971,e=>{var t=e.i(56003);let r={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n])},75380,e=>{var t=e.i(72971);e.s(["f",()=>t.f])},9219,e=>{var t=e.i(56003);let r={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],9219)},55919,e=>{var t=e.i(56003);let r={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],55919)},87953,e=>{var t=e.i(56003);let r={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],87953)},15275,e=>{var t=e.i(56003);let r={name:"file-up",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],15275)},39024,e=>{var t=e.i(56003);let r={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],39024)},97424,e=>{var t=e.i(56003);let r={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],97424)},87399,e=>{var t=e.i(56003);let r={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],87399)},2810,e=>{var t=e.i(56003);let r={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],2810)},54812,e=>{var t=e.i(56003);let r={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],54812)},23986,60125,e=>{var t=e.i(56003);let r={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};r.node;let n=(0,t.f)(r);e.s(["f",0,n],60125),e.s(["f",0,n],23986)},62620,e=>{var t=e.i(56003);let r={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};r.node;let n=(0,t.f)(r);e.s(["X",0,n],62620)},24856,86483,70632,15487,59100,99112,75606,64478,89662,36163,78451,5305,25949,36851,90372,28251,2385,94122,54608,55658,46306,60617,88491,94713,19166,30340,54185,35540,16587,504,65510,e=>{let t,r,n,s,a,i,o,l,u,c,d;e.s(["BIGINT_FORMAT_RANGES",()=>eS,"CONSTANT_CATCH",()=>e7,"Class",()=>e0,"NUMBER_FORMAT_RANGES",()=>e$,"aborted",()=>eq,"allowsEval",()=>ec,"assert",()=>P,"assertEqual",()=>N,"assertIs",()=>C,"assertNever",()=>z,"assertNotEqual",()=>I,"assignProp",()=>V,"attachSchema",()=>eL,"base64ToUint8Array",()=>eW,"base64urlToUint8Array",()=>eG,"cached",()=>D,"captureStackTrace",()=>el,"cleanEnum",()=>eH,"cleanRegex",()=>K,"clone",()=>eb,"cloneDef",()=>er,"codePointLength",()=>eB,"constantCatch",()=>te,"createTransparentProxy",()=>ew,"defineLazy",()=>H,"defineLazyInternal",()=>e3,"derived",()=>e9,"esc",()=>ei,"escapeRegex",()=>eg,"explicitlyAborted",()=>eC,"extend",()=>eO,"finalizeIssue",()=>eU,"floatSafeRemainder",()=>Z,"getElementAtPath",()=>en,"getEnumValues",()=>R,"getLengthableOrigin",()=>eK,"getParsedType",()=>ef,"getSizableOrigin",()=>eF,"hexToUint8Array",()=>eY,"hide",()=>e5,"installLazyProp",()=>e8,"isObject",()=>eu,"isPlainObject",()=>ed,"issue",()=>eJ,"joinValues",()=>L,"jsonStringifyReplacer",()=>U,"members",()=>e1,"merge",()=>eM,"mergeDefs",()=>et,"normalizeParams",()=>ev,"nullish",()=>B,"numKeys",()=>eh,"objectClone",()=>W,"omit",()=>eT,"optionalKeys",()=>ex,"own",()=>e2,"parsedType",()=>eZ,"partial",()=>eN,"pick",()=>e_,"prefixIssues",()=>ez,"primitiveTypes",()=>ey,"promiseAllObject",()=>es,"propertyKeyTypes",()=>em,"randomString",()=>ea,"rawShape",()=>G,"required",()=>eI,"safeExtend",()=>ej,"shallowClone",()=>ep,"sizeCaps",()=>eR,"slugify",()=>eo,"stringifyPrimitive",()=>ek,"toZod",()=>q,"uint8ArrayToBase64",()=>eV,"uint8ArrayToBase64url",()=>eX,"uint8ArrayToHex",()=>eQ,"unwrapMessage",()=>eP],22210),e.s(["_",()=>lM,"j",()=>lL,"n",()=>lq],25949),e.s(["y",()=>d0,"g",()=>d1,"w",()=>d4],90372);let p=Date.parse("2026-08-20T10:00:00.000Z");function h(e,t=2){let r=10**t;return Math.round(e*r)/r}function f(e,t=.35){return{min:h(e*(1-t)),max:h(e*(1+2*t)),avg:h(e),p95:h(e*(1+t))}}function m(e={}){let t=e.latencyScale??1,r=e.startedAt?Date.parse(e.startedAt):p,n=[],s=0,a=0,i=0,o=0,l={200:0,401:0,500:0,0:0},u=[],c=[],d=[];for(let p=0;p<=90;p++){var y,g;let f=h((y=p)<=15?y/15*25:y<=60?25:y<=75?25+(y-60)/15*25:y<=90?Math.max(0,50*(1-(y-75)/15)):0,1),m=!1!==e.spike&&(g=p)>=60&&g<75,b=h((48+1.35*f+(m?55+(p-60)*3.2:0))*t),v=h(1.55*b+(m?40:8)),w=h(1.42*v+(m?90:12)),k=!1===e.errors?0:m?h(.035+(p-60)/15*.05,4):p<8?.002:.001,x=Math.max(b,40),$=h(f>.2?1e3*f/x:0,1),S=Math.max(0,Math.round($)),_=Math.round(S*k),A=m?Math.round(.75*_):0,T=m?_-A:Math.round(.4*_),O=m?Math.max(0,_-A-T):Math.max(0,_-T),E=Math.max(0,S-A-T-O);l["200"]+=E,l["500"]+=A,l["401"]+=T,l["0"]+=O,s+=S,a+=A+T+O,i+=1840*E+(S-E)*420,o+=96*S,u.push(v),c.push(f),d.push($),n.push({elapsedS:p,ts:new Date(r+1e3*p).toISOString(),vus:f,rps:$,p50Ms:b,p95Ms:v,p99Ms:w,failedRate:k,http2xx:E,http4xx:T,http5xx:A,http0:O,bytesIn:1840*E,bytesOut:96*S})}let b=e=>e.reduce((e,t)=>e+t,0)/e.length,v=[...u].sort((e,t)=>e-t),w=e=>v[Math.min(v.length-1,Math.floor(e/100*v.length))]??0,k=0===s?0:a/s,x=[{name:"p95(http_req_duration) < 250ms",ok:250>w(50)},{name:"http_req_failed < 1%",ok:k<.01},{name:"http_reqs > 100",ok:s>100}];return{id:e.id??"demo-run-001",testName:e.testName??"Orders API — Get order by id",status:"completed",sloPassed:x.every(e=>e.ok),startedAt:new Date(r).toISOString(),endedAt:new Date(r+9e4).toISOString(),definition:{method:"GET",url:e.url??"https://api.uat.example.com/v1/orders/{id}",auth:{mode:"bearer",profileName:"UAT service account"},load:{executor:"ramping-vus",stages:[{duration:"15s",target:25},{duration:"45s",target:25},{duration:"15s",target:50},{duration:"15s",target:0}]},thresholds:x},summary:{http:{requests:s,rps:{min:h(Math.min(...d.filter(e=>e>0))),max:h(Math.max(...d)),avg:h(b(d)),p95:h(w(95))},failed:{count:a,rate:h(k,4)},status:l},latencyMs:{min:h(.55*Math.min(...n.map(e=>e.p50Ms))),max:h(Math.max(...n.map(e=>e.p99Ms))),mean:h(1.08*b(n.map(e=>e.p50Ms))),median:h(b(n.map(e=>e.p50Ms))),p90:h(w(40)),p95:h(.72*Math.max(...n.map(e=>e.p95Ms))),p99:h(.85*Math.max(...n.map(e=>e.p99Ms))),p99_9:h(Math.max(...n.map(e=>e.p99Ms))),stdDev:38.4},phasesMs:{blocked:f(2.1,.8),dns:f(1.4,.5),tcp:f(4.6,.4),tls:f(16.8,.35),ttfb:f(62.4*t,.45),send:f(1.1,.3),download:f(3.2,.4)},data:{bytesIn:i,bytesOut:o},vus:{max:h(Math.max(...c),1),avg:h(b(c),1)},iterations:{count:s},thresholds:x,checks:[{name:"status is 200",passes:l["200"],fails:a}]},buckets:n}}let y=["p50","p90","p95","p99","p999","max"],g={p50:"Typical (p50)",p90:"Most requests (p90)",p95:"95% of requests (p95)",p99:"Slowest 1% (p99)",p999:"Slowest 0.1% (p99.9)",max:"Slowest (max)"},b=["throughput","peakRps","p95","p50","avg","p99","max","ttfb","errors","checks","vus","requests","dropped","apdex","data","sent","duration"],v={throughput:"Requests per second",p95:"Response time",p99:"Slowest 1%",errors:"Failed requests",vus:"Simulated users",requests:"Total requests",dropped:"Requests not sent",apdex:"User satisfaction",data:"Data received",peakRps:"Peak requests per second",p50:"Typical response time",avg:"Average response time",max:"Slowest response",ttfb:"Server time",checks:"Checks passing",sent:"Data sent",duration:"Test length"},w={throughput:"throughput · RPS",p95:"p95 latency",p99:"p99 latency",errors:"error rate",vus:"VUs",requests:"HTTP requests",dropped:"dropped iterations",apdex:"Apdex",data:"bytes in",peakRps:"max throughput",p50:"p50 · median",avg:"mean latency",max:"max latency",ttfb:"TTFB average",checks:"check pass rate",sent:"bytes out",duration:"run duration"},k=["ttfb","connect","tls","blocked"],x={kpis:{id:"kpis",autoHeight:!0,label:"Key numbers",description:"The headline numbers — speed, response time, failures, users. Pick which ones.",group:"Summary",kinds:["stat","table"],size:{w:12,h:3},min:{w:3,h:3},compare:!0,defaults:{kpis:["throughput","p95","errors","vus","requests"]}},number:{id:"number",autoHeight:!0,label:"Single number",description:"One number, big — place and size it anywhere. Shows the change against your reference run.",group:"Summary",kinds:["stat"],size:{w:3,h:3},min:{w:2,h:2},compare:!0,defaults:{kpis:["p95"]}},heading:{id:"heading",autoHeight:!0,bare:!0,label:"Section heading",description:"A title that groups the widgets under it — like “Speed” or “Reliability”.",group:"Layout",kinds:["panel"],size:{w:12,h:2},min:{w:3,h:1},compare:!0,defaults:{note:""}},verdict:{id:"verdict",autoHeight:!0,label:"Result",tech:"verdict",description:"Pass / warn / fail in plain words, with the reasons.",group:"Summary",kinds:["panel"],size:{w:12,h:3},min:{w:4,h:2},compare:!0},apdex:{id:"apdex",autoHeight:!0,label:"User satisfaction score",tech:"Apdex",description:"0–1 user-satisfaction score from response times against your p95 target (or 500 ms).",group:"Summary",kinds:["stat"],size:{w:3,h:4},min:{w:2,h:3},compare:!0,recent:!0},latency:{id:"latency",label:"Response time",tech:"latency percentiles",description:"Percentiles per second. Pick which percentiles to draw.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{percentiles:["p50","p95","p99"],showTarget:!0}},throughput:{id:"throughput",label:"Requests per second",tech:"throughput",description:"Requests per second, with the target rate in rate mode.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,defaults:{showTarget:!0}},vus:{id:"vus",label:"Simulated users",tech:"VUs",description:"How many simulated users were sending requests at each moment.",group:"Over time",kinds:["area","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},errors:{id:"errors",label:"Failed requests",tech:"error rate",description:"Share of failed requests per second.",group:"Over time",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,defaults:{showTarget:!0}},status:{id:"status",label:"Responses by outcome",tech:"HTTP status",description:"Responses per second by outcome: 2xx, 4xx, 5xx, network failures.",group:"Over time",kinds:["stacked-area","stacked-bar"],size:{w:6,h:8},min:{w:3,h:5},compare:!1},data:{id:"data",label:"Data transfer",tech:"bytes in / out",description:"Bytes received and sent per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:6},min:{w:3,h:4},compare:!0},serverTime:{id:"serverTime",label:"Server and connection time",tech:"TTFB · TCP · TLS",description:"Average server time (TTFB), connect, TLS, and wait time per second.",group:"Over time",kinds:["line","area"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0,defaults:{phases:["ttfb","connect","tls"]}},checksRate:{id:"checksRate",label:"Checks passing",tech:"check pass rate",description:"Share of checks passing each second.",group:"Correctness",kinds:["line","area","bar"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},dropped:{id:"dropped",label:"Requests not sent",tech:"dropped iterations",description:"Requests a rate-mode run could not start each second.",group:"Over time",kinds:["bar","line"],size:{w:6,h:6},min:{w:3,h:4},compare:!0,recent:!0},histogram:{id:"histogram",label:"Response time spread",tech:"latency histogram",description:"How many requests fell into each response-time band.",group:"Distribution",kinds:["histogram"],size:{w:6,h:8},min:{w:3,h:5},compare:!0,recent:!0},heatmap:{id:"heatmap",label:"Response time over time, by speed",tech:"latency heatmap",description:"Response-time bands over time; darker = more requests. Shows bimodal or drifting latency.",group:"Distribution",kinds:["heatmap"],size:{w:12,h:8},min:{w:4,h:5},compare:!1,recent:!0},percentiles:{id:"percentiles",label:"Response time distribution",tech:"min · p50 · p95 · p99 · max",description:"min, p50, p90, p95, p99, max over the whole run.",group:"Distribution",kinds:["ladder","table","bar"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},phases:{id:"phases",autoHeight:!0,label:"Where the time went",tech:"timing phases",description:"Average split of each request: DNS, connect, TLS, server, download.",group:"Distribution",kinds:["breakdown","table"],size:{w:6,h:7},min:{w:3,h:4},compare:!0},concurrency:{id:"concurrency",label:"Load vs response time",tech:"VUs or RPS vs p95",description:"Each second as a dot: load against response time. Where the dots bend upward is the point the API starts to struggle.",group:"Distribution",kinds:["scatter"],size:{w:6,h:8},min:{w:3,h:5},compare:!0},targets:{id:"targets",autoHeight:!0,label:"Pass/fail goals",tech:"thresholds and checks",description:"Each target met or missed, and each check's pass rate.",group:"Correctness",kinds:["panel"],size:{w:6,h:7},min:{w:3,h:4},compare:!1},statusTable:{id:"statusTable",autoHeight:!0,label:"Response codes",tech:"HTTP status codes",description:"Count of every HTTP status code returned.",group:"Details",kinds:["table","bar"],size:{w:4,h:6},min:{w:3,h:4},compare:!0},config:{id:"config",autoHeight:!0,label:"Test settings",tech:"run configuration",description:"Method, URL, auth type, load shape, times, bytes.",group:"Details",kinds:["panel"],size:{w:12,h:5},min:{w:4,h:3},compare:!1}},$=Object.keys(x);function S(e,t,r,n,s={}){let a=x[t];return{id:e,metric:t,kind:a.kinds[0],x:r,y:n,w:a.size.w,h:a.size.h,options:a.defaults,...s}}let _=[{id:"builtin-overview",name:"Overview",scope:"run",builtIn:!0,widgets:[S("kpis","kpis",0,0),S("verdict","verdict",0,3),S("latency","latency",0,6),S("throughput","throughput",6,6),S("status","status",0,14),S("percentiles","percentiles",6,14,{h:8}),S("phases","phases",0,22),S("targets","targets",6,22),S("config","config",0,29)]},{id:"builtin-developer",name:"Developer",scope:"run",builtIn:!0,widgets:[S("latency","latency",0,0,{w:12,options:{percentiles:["p50","p90","p95","p99","max"],showTarget:!0}}),S("server","serverTime",0,8),S("phases","phases",6,8,{h:8}),S("histogram","histogram",0,16),S("status","status",6,16),S("heatmap","heatmap",0,24),S("targets","targets",0,32),S("codes","statusTable",6,32,{w:6,h:7})]},{id:"builtin-capacity",name:"Capacity",scope:"run",builtIn:!0,widgets:[S("kpis","kpis",0,0,{options:{kpis:["throughput","p95","errors","vus","dropped"]}}),S("concurrency","concurrency",0,3),S("throughput","throughput",6,3),S("latency","latency",0,11,{options:{percentiles:["p95","p99"],showTarget:!0}}),S("vus","vus",6,11,{h:8}),S("errors","errors",0,19),S("dropped","dropped",6,19)]},{id:"builtin-executive",name:"Executive",scope:"run",builtIn:!0,widgets:[S("verdict","verdict",0,0),S("kpis","kpis",0,3,{w:9,options:{kpis:["p95","errors","throughput","requests"]}}),S("apdex","apdex",9,3,{h:3}),S("latency","latency",0,6,{options:{percentiles:["p95"],showTarget:!0}}),S("targets","targets",6,6,{h:8})]},{id:"builtin-topics",name:"By topic",scope:"run",builtIn:!0,widgets:[S("verdict","verdict",0,0),S("h-speed","heading",0,3,{title:"Speed",options:{note:"How fast the API answers"}}),S("n-p95","number",0,5,{options:{kpis:["p95"]}}),S("n-p50","number",3,5,{options:{kpis:["p50"]}}),S("n-max","number",6,5,{options:{kpis:["max"]}}),S("n-ttfb","number",9,5,{options:{kpis:["ttfb"]}}),S("latency","latency",0,8,{options:{percentiles:["p50","p95","p99"],showTarget:!0}}),S("percentiles","percentiles",6,8),S("h-rel","heading",0,18,{title:"Reliability",options:{note:"Did it answer correctly, every time?"}}),S("n-errors","number",0,20,{options:{kpis:["errors"]}}),S("n-checks","number",3,20,{options:{kpis:["checks"]}}),S("status","status",6,20,{w:6}),S("targets","targets",0,23,{w:6}),S("h-load","heading",0,33,{title:"Load",options:{note:"How much traffic it handled"}}),S("n-rps","number",0,35,{options:{kpis:["throughput"]}}),S("n-peak","number",3,35,{options:{kpis:["peakRps"]}}),S("n-vus","number",6,35,{options:{kpis:["vus"]}}),S("n-total","number",9,35,{options:{kpis:["requests"]}}),S("throughput","throughput",0,38),S("concurrency","concurrency",6,38)]},{id:"builtin-compare",name:"Compare overview",scope:"compare",builtIn:!0,widgets:[S("kpis","kpis",0,0,{kind:"table",h:6,options:{kpis:["throughput","p95","p99","errors","requests"]}}),S("verdict","verdict",0,6,{h:7}),S("latency","latency",0,13,{options:{percentiles:["p95"],showTarget:!0}}),S("throughput","throughput",6,13),S("errors","errors",0,21,{h:7}),S("vus","vus",6,21,{h:7}),S("phases","phases",0,28,{w:12,kind:"table"})]}];function A(e){return _.find(t=>t.scope===e)}let T=(e,t,r)=>Math.min(r,Math.max(t,Math.round(e)));function O(e){if(!e||"object"!=typeof e||"string"!=typeof e.id||!e.id||"string"!=typeof e.name)return null;let t="compare"===e.scope?"compare":"run",r=new Set,n=[];for(let s of Array.isArray(e.widgets)?e.widgets:[]){let e=x[s.metric];if(!e||"compare"===t&&!e.compare)continue;let a="string"==typeof s.id&&s.id?s.id:`${e.id}-${n.length}`;for(;r.has(a);)a=`${a}-x`;r.add(a);let i=e.kinds.includes(s.kind)?s.kind:e.kinds[0],o=T(s.w??e.size.w,e.min.w,12);n.push({id:a,metric:e.id,kind:i,title:"string"==typeof s.title&&s.title.trim()?s.title.trim().slice(0,80):void 0,options:function(e,t){let r=t&&"object"==typeof t?t:{},n=(e,t,r)=>{let n=Array.isArray(e)?e.filter(e=>t.includes(e)):[];return n.length?n:r},s={};if(e.defaults?.percentiles&&(s.percentiles=n(r.percentiles,y,e.defaults.percentiles)),e.defaults?.kpis){let t=[...new Set(n(r.kpis,b,e.defaults.kpis))];s.kpis="number"===e.id?t.slice(0,1):t}return e.defaults?.note!==void 0&&(s.note="string"==typeof r.note?r.note.slice(0,200):""),e.defaults?.phases&&(s.phases=n(r.phases,k,e.defaults.phases)),e.defaults?.showTarget!==void 0&&(s.showTarget=r.showTarget??e.defaults.showTarget),Object.keys(s).length?s:void 0}(e,s.options),x:T(s.x??0,0,12-o),y:T(s.y??0,0,1e4),w:o,h:T(s.h??e.size.h,e.min.h,40)})}return{id:e.id,name:e.name.trim().slice(0,60)||"Untitled view",scope:t,builtIn:!0===e.builtIn,widgets:n}}function E(e){return e.title?e.title:"number"===e.metric?v[e.options?.kpis?.[0]??"p95"]:x[e.metric].label}function j(e){if(!e.title)return"number"===e.metric?w[e.options?.kpis?.[0]??"p95"]:x[e.metric].tech}function M(e){return[...e].sort((e,t)=>e.y-t.y||e.x-t.x)}function N(e){return e}function I(e){return e}function q(){return e=>e}function C(e){}function z(e){throw Error("Unexpected value in exhaustive check")}function P(e){}function R(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function L(e,t="|"){return e.map(e=>ek(e)).join(t)}function U(e,t){return"bigint"==typeof t?t.toString():t}e.s(["W",0,_,"Z",0,{line:"Line",area:"Area",bar:"Bars","stacked-area":"Stacked area","stacked-bar":"Stacked bars",stat:"Numbers",table:"Table",histogram:"Histogram",heatmap:"Heatmap",ladder:"Percentile ladder",breakdown:"Breakdown bar",scatter:"Scatter",panel:"Panel"},"c",0,12,"B",0,36,"f",0,b,"O",0,v,"t",0,w,"U",0,x,"r",0,y,"T",0,g,"E",0,k,"J",0,{ttfb:"Server time (TTFB)",connect:"TCP connect",tls:"TLS handshake",blocked:"Waiting for a connection"},"g",0,A,"s",0,function(e){let t={latency:"latency",throughput:"throughput",status:"status",phases:"phase",percentiles:"percentiles",targets:"thresholds"},r=[];for(let n of M(e.widgets)){let e=t[n.metric];!e||r.some(t=>t.id===e)||r.push({id:e,w:n.w>=9?2:1,h:n.h>=12?2:1})}return r},"x",0,function(e){return $.map(e=>x[e]).filter(t=>"run"===e||t.compare)},"A",0,function(e,t,r){let n=M(e),s=n.findIndex(e=>e.id===t);if(s<0)return e;if("first"===r||"last"===r){let e=n[s],a=n.filter(e=>e.id!==t);if("first"===r)return[{...e,x:0,y:0},...a.map(t=>({...t,y:t.y+e.h}))];let i=a.reduce((e,t)=>Math.max(e,t.y+t.h),0);return[...a,{...e,x:0,y:i}]}let a="earlier"===r?s-1:s+1;if(a<0||a>=n.length)return e;let i=n[s],o=n[a];return e.map(e=>e.id===i.id?{...e,x:Math.min(o.x,12-e.w),y:o.y}:e.id===o.id?{...e,x:Math.min(i.x,12-e.w),y:i.y}:e)},"V",0,function(e,t){let r=x[e],n=t.reduce((e,t)=>Math.max(e,t.y+t.h),0),s=t.length+1,a=new Set(t.map(e=>e.id));for(;a.has(`${e}-${s}`);)s++;return{id:`${e}-${s}`,metric:e,kind:r.kinds[0],title:"heading"===e?"New section":void 0,x:0,y:n,w:r.size.w,h:r.size.h,options:r.defaults}},"R",0,O,"e",0,function(e){let t=e&&"object"==typeof e?e:{},r=(Array.isArray(t.views)?t.views:[]).map(O).filter(e=>!!e&&!e.builtIn&&!e.id.startsWith("builtin-")),n=[..._,...r],s=(e,t)=>"string"==typeof t&&n.some(r=>r.id===t&&r.scope===e)?t:A(e).id;return{version:1,defaults:{run:s("run",t.defaults?.run),compare:s("compare",t.defaults?.compare)},views:r}},"F",0,M,"u",0,function(e,t,r,n){return e.map(e=>{if(e.id!==t)return e;let s=x[e.metric],a=T(e.w+r,s.min.w,12);return{...e,w:a,h:T(e.h+n,s.min.h,40),x:Math.min(e.x,12-a)}})},"X",0,j,"L",0,E],86483);class F{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function D(e){return new F(e)}function B(e){return null==e}function K(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Z(e,t){let r=e/t,n=Math.round(r),s=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<s?0:r-n}let J=Symbol("evaluating");function H(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==J)return void 0===n&&(n=J,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function W(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function V(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function G(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function X(e){return G(e._zod.def)??e._zod.def.shape}function Y(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return V(this,t,e),e},enumerable:!0,configurable:!0})}function Q(e,t,r){t in e?V(e,t,r):e[t]=r}function ee(e,t,r,n){let s=X(t);for(let a of r){let r=Object.getOwnPropertyDescriptor(s,a);r.enumerable&&(r.get?Y(e,a,()=>{let e=t._zod.def.shape[a];return n?n(e,a):e}):Q(e,a,n?n(r.value,a):r.value))}}function et(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function er(e){return et(e._zod.def)}function en(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function es(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let r={};for(let n=0;n<t.length;n++)r[t[n]]=e[n];return r})}function ea(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function ei(e){return JSON.stringify(e)}function eo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let el="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eu(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ec=D(()=>{if(ti.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function ed(e){if(!1===eu(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eu(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function ep(e){return ed(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function eh(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}let ef=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},em=new Set(["string","number","symbol"]),ey=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eb(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function ev(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function ew(e){let t;return new Proxy({},{get:(r,n,s)=>(t??(t=e()),Reflect.get(t,n,s)),set:(r,n,s,a)=>(t??(t=e()),Reflect.set(t,n,s,a)),has:(r,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(r,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:r=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(r,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(r,n,s)=>(t??(t=e()),Reflect.defineProperty(t,n,s))})}function ek(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function ex(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let e$={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eS={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function e_(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return ee(s,e,eA(e,t)),eb(e,et(r,{shape:s,checks:[]}))}function eA(e,t){let r=X(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function eT(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(eA(e,t)),a={};return ee(a,e,Reflect.ownKeys(X(e)).filter(e=>!s.has(e))),eb(e,et(r,{shape:a,checks:[]}))}function eO(e,t){if(!ed(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=X(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return eb(e,et(e._zod.def,{shape:eE(e,t)}))}function eE(e,t){let r={};ee(r,e,Reflect.ownKeys(X(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?Y(r,e,()=>t[e]):Q(r,e,n.value))}return r}function ej(e,t){if(!ed(t))throw Error("Invalid input to safeExtend: expected a plain object");return eb(e,et(e._zod.def,{shape:eE(e,t)}))}function eM(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ee(r,e,Reflect.ownKeys(X(e))),ee(r,t,Reflect.ownKeys(X(t)));let n=et(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return eb(e,n)}function eN(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(eA(t,r)):void 0,i={};return ee(i,t,Reflect.ownKeys(X(t)),e&&((t,r)=>a&&!a.has(r)?t:new e({type:"optional",innerType:t}))),eb(t,et(t._zod.def,{shape:i,checks:[]}))}function eI(e,t,r){let n=r?new Set(eA(t,r)):void 0,s={};return ee(s,t,Reflect.ownKeys(X(t)),(t,r)=>n&&!n.has(r)?t:new e({type:"nonoptional",innerType:t})),eb(t,et(t._zod.def,{shape:s}))}function eq(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eC(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ez(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eP(e){return"string"==typeof e?e:e?.message}function eR(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let n=e.maximum??e.length??e.size;n>=0&&t.push([n,r])}return t}function eL(e,t,r){var n;for(let s=t;s<e.length;s++)(n=e[s]).schema??(n.schema=r)}function eU(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:eP(e.inst?._zod.def?.error?.(e))??eP(s?.(e))??eP(t?.error?.(e))??eP(r.customError?.(e))??eP(r.localeError?.(e))??"Invalid input",i={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(i[t]=e[t]);return i.path??(i.path=[]),i.message=a,t?.reportInput&&(i.input=e.input),i}function eF(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let eD=/[\uD800-\uDBFF]/;function eB(e){let t=e.length;if(!eD.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function eK(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eZ(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function eJ(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eH(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function eW(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function eV(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function eG(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return eW(t+r)}function eX(e){return eV(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eY(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)r[e/2]=Number.parseInt(t.slice(e,e+2),16);return r}function eQ(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class e0{constructor(...e){}}function e1(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:e2(this,t,r.bind(this))},set(e){e2(this,t,e)}})}(e,r,n.value)}}function e2(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function e5(e,t,r){return e2(e,t,r,!1)}function e9(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return e2(this,r,n(this))},set(e){e2(this,r,e)}})}return t}let e4=!1,e6={configurable:!0,get(){e4=!0}};function e3(e,r,n){let s=Object.getPrototypeOf(e._zod);if(r in s&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(s,r,{configurable:!0,get(){Object.defineProperty(this,r,e6);let e=e4;e4=!1;try{let t=n(this);return e4?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),e4=e4||e,t}catch(t){throw delete this[r],e4=e4||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}function e8(e,t,r,n){let s,a=t in(s=Object.getPrototypeOf(e))?void 0:s;a&&Object.defineProperty(a,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,e),e.value=r(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:e})}})}let e7="~constantCatch";function te(e){let t=()=>e;return t[e7]=!0,t}let tt={value:void 0,enumerable:!1},tr="captureStackTrace"in Error?Error:null;function tn(e,t,r,n){function s(e){this.def=e,this.constr=u,this.traits=new Set}s.prototype={};let a=r&&new WeakSet;function i(n,i){if(n._zod){if(n._zod.traits.has(e))return}else{tt.value=new s(i);try{Object.defineProperty(n,"_zod",tt)}finally{tt.value=void 0}}if(n._zod.traits.add(e),t(n,i),a){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,s=e;for(;s&&s!==t;)s=Object.getPrototypeOf(s);let i=s??e;a.has(i)||(a.add(i),e1(i,r))}let o=u.prototype;for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&(e in n||(n[e]=o[e].bind(n)))}let o=n?.Parent??Object;class l extends o{}function u(e){let t=n?.Parent?function(e){let t=tr;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return tr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;i(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let s=globalThis.__zod_globalConfig?.postProcessor;return s&&s(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:i}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class ts extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ta extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(sx=globalThis).__zod_globalConfig??(sx.__zod_globalConfig={});let ti=globalThis.__zod_globalConfig;function to(e){return e&&Object.assign(ti,e),ti}class tl extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let tu="~memo",tc=[];function td(e){return null!==e&&"object"==typeof e}function tp(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let th=new WeakMap,tf=[],tm={alloc(e,t,n){let s=r;if(!s)return n;r=void 0;let a={value:n,issues:null};return s.set(t.value,a),tf.push(a),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,s;let a;if("backward"!==r.direction&&(n=r,s=e.value,void 0!==(a=n[tu]?.backEdges)&&td(s)&&a.has(s)))throw new tl;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var t;let n,s,a,i=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(l,u)=>{let c;if(void 0===n){let r=function e(t,r,n){var s,a;let i=th.get(t);if(void 0!==i)return 2*!!i;if(r.has(t))return 2;r.add(t);let o=0,l=t=>{if(2!==o&&t?._zod){let s=e(t,r,n);s>o&&(o=s)}},u=e=>{e>o&&(o=e)},c=t._zod.def;switch(c.type){case"object":{let t=G(c);u(t?((t,s)=>{let a=0;for(let i of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,i);if(s&&!o.enumerable)continue;let l=o.get?1:o.value?._zod?e(o.value,r,n):0;l>a&&(a=l)}return a})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let s=c._cachedInner??(n?t._zod.innerType:void 0);u(s?e(s,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),s=t,1!==(a=o)&&th.set(s,2===a),a}(e,new Set,!1);if(0===r)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(l,u);2===r||i?n=!0:i=!0}let d=l.value;if(!td(d))return t(l,u);let p=u[tu];if(p||(p={buckets:new WeakMap,backEdges:void 0},u[tu]=p),s===u)c=a;else{var h;let t;(t=(h=p).buckets.get(e))||(t=new WeakMap,h.buckets.set(e,t)),c=t,s=u,a=c}let f=c.get(d);if(f)return l.value=f.value,f.issues?f.issues.length&&l.issues.push(...tp(f.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(f.value)),l;r=c;let m=tf.length,y=t(l,u);r=void 0;let g=tf.length>m?tf.pop():void 0;return y instanceof Promise?y.then(e=>(g&&(g.issues=e.issues.length?tp(e.issues):tc),e)):(g&&(g.issues=y.issues.length?tp(y.issues):tc),y)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};(s$=globalThis).__zod_globalRegistry??(s$.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let ty=globalThis.__zod_globalRegistry,tg=/^[cC][0-9a-z]{6,}$/,tb=/^[0-9a-z]+$/,tv=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,tw=/^[0-9a-vA-V]{20}$/,tk=/^[A-Za-z0-9]{27}$/,tx=/^[a-zA-Z0-9_-]{21}$/;function t$(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let tS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tA=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tT=tA(4),tO=tA(6),tE=tA(7),tj=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tM=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function tN(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let tI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tq=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,tC=e=>{let t=eg(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tL=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,tU=/^https?$/,tF=/^\+[1-9]\d{6,14}$/,tD=/^\d(?:[ -]?\d){11,18}$/,tB=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tK="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",tZ=RegExp(`^${tK}$`);function tJ(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tH(e){return RegExp(`^${tJ(e)}$`)}function tW(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${tJ({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${tJ({precision:e.precision})}`:r;return RegExp(`^${tK}T(?:${n})$`)}let tV=/^[\s\S]{0,}$/,tG=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tX=/^-?\d+n?$/,tY=/^-?\d+$/,tQ=/^-?\d+(?:\.\d+)?$/,t0=/^(?:true|false)$/i,t1=/^null$/i,t2=/^undefined$/i,t5=/^[^A-Z]*$/,t9=/^[^a-z]*$/;function t4(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function t6(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let t3=t4(22,"=="),t8=t6(22),t7=t4(27,"="),re=t6(27),rt=t4(43,"="),rr=t6(43),rn=t4(64,""),rs=t6(64),ra=t4(86,"=="),ri=t6(86);e.s(["anyString",0,tV,"base64",0,tR,"base64url",0,tL,"bigint",0,tX,"boolean",0,t0,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,tz,"cidrv6",0,tP,"creditCard",0,tD,"cuid",0,tg,"cuid2",0,tb,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,tZ,"datetime",0,tW,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,tS,"e164",0,tF,"email",0,tj,"emoji",0,tN,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,t_,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,tU,"iban",0,tB,"idnEmail",0,tM,"integer",0,tY,"ipv4",0,tI,"ipv6",0,tq,"ksuid",0,tk,"lowercase",0,t5,"mac",0,tC,"md5_base64",0,t3,"md5_base64url",0,t8,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,tx,"nanoidOfLength",0,t$,"null",0,t1,"number",0,tQ,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,t7,"sha1_base64url",0,re,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,rt,"sha256_base64url",0,rr,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,rn,"sha384_base64url",0,rs,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,ra,"sha512_base64url",0,ri,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tG,"time",0,tH,"ulid",0,tv,"undefined",0,t2,"unicodeEmail",0,tM,"uppercase",0,t9,"uuid",0,tA,"uuid4",0,tT,"uuid6",0,tO,"uuid7",0,tE,"xid",0,tw],79692);let ro=tn("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),rl=e=>{let t=e.value;return!B(t)&&void 0!==t.size},ru=e=>{let t=e.value;return!B(t)&&void 0!==t.length},rc={number:"number",bigint:"bigint",object:"date"},rd=tn("$ZodCheckLessThan",(e,t)=>{ro.init(e,t);let r=rc[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:rc[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rp=tn("$ZodCheckGreaterThan",(e,t)=>{ro.init(e,t);let r=rc[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:rc[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rh=tn("$ZodCheckMultipleOf",(e,t)=>{ro.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0===Z(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),rf=tn("$ZodCheckNumberFormat",(e,t)=>{ro.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[s,a]=e$[t.format];e._zod.check=i=>{let o=i.value;if(r){if(!Number.isInteger(o))return void i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?i.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}o<s&&i.issues.push({origin:"number",input:o,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),o>a&&i.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),rm=tn("$ZodCheckBigIntFormat",(e,t)=>{ro.init(e,t);let[r,n]=eS[t.format];e._zod.check=s=>{let a=s.value;a<r&&s.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>n&&s.issues.push({origin:"bigint",input:a,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),ry=tn("$ZodCheckMaxSize",(e,t)=>{var r;ro.init(e,t),(r=e._zod.def).when??(r.when=rl),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:eF(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rg=tn("$ZodCheckMinSize",(e,t)=>{var r;ro.init(e,t),(r=e._zod.def).when??(r.when=rl),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:eF(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rb=tn("$ZodCheckSizeEquals",(e,t)=>{var r;ro.init(e,t),(r=e._zod.def).when??(r.when=rl),e._zod.check=r=>{let n=r.value,s=n.size;if(s===t.size)return;let a=s>t.size;r.issues.push({origin:eF(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rv=tn("$ZodCheckMaxLength",(e,t)=>{var r;ro.init(e,t),(r=e._zod.def).when??(r.when=ru),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>t.maximum?eB(n):s)<=t.maximum)return;let a=eK(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rw=tn("$ZodCheckMinLength",(e,t)=>{var r;ro.init(e,t),(r=e._zod.def).when??(r.when=ru),e._zod.check=r=>{let n=r.value,s=n.length;if(("string"==typeof n&&s>=t.minimum&&s<2*t.minimum?eB(n):s)>=t.minimum)return;let a=eK(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rk=tn("$ZodCheckLengthEquals",(e,t)=>{var r;ro.init(e,t),(r=e._zod.def).when??(r.when=ru),e._zod.check=r=>{let n=r.value,s=n.length,a="string"==typeof n&&s>=t.length&&s<=2*t.length?eB(n):s;if(a===t.length)return;let i=eK(n),o=a>t.length;r.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),rx=tn("$ZodCheckStringFormat",(e,t)=>{var r,n;ro.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),r$=tn("$ZodCheckRegex",(e,t)=>{rx.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rS=tn("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=t5),rx.init(e,t)}),r_=tn("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=t9),rx.init(e,t)}),rA=tn("$ZodCheckIncludes",(e,t)=>{ro.init(e,t);let r=eg(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),rT=tn("$ZodCheckStartsWith",(e,t)=>{ro.init(e,t);let r=RegExp(`^${eg(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),rO=tn("$ZodCheckEndsWith",(e,t)=>{ro.init(e,t);let r=RegExp(`.*${eg(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function rE(e,t,r){e.issues.length&&t.issues.push(...ez(r,e.issues))}(e,t)=>{let r;ro.init(e,t),e5(e,Symbol.iterator,function*(){yield e}),e._zod.check=n=>{let s;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let a=n.value;for(let[e,t]of r){let r=t._zod.run({value:a[e],issues:[]},{});r instanceof Promise?(s??(s=[]),s.push(r.then(t=>rE(t,n,e)))):rE(r,n,e)}if(s)return Promise.all(s).then(()=>void 0)}},(e,t)=>{ro.init(e,t);let r=new Set(t.mime);e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}};let rj=tn("$ZodCheckOverwrite",(e,t)=>{ro.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class rM{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
2
+ ${t.join("\n")}
3
+ };`)(...Object.values(this.closed))}}let rN={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,U,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},rI={value:void 0,enumerable:!1},rq=new WeakSet([Object.prototype,Error.prototype]),rC=(e,t)=>{e.name="$ZodError",rI.value=t,Object.defineProperty(e,"issues",rI),rI.value=void 0,Object.defineProperty(e,"message",rN);let r=Object.getPrototypeOf(e);rq.has(r)||(rq.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},rz=tn("$ZodError",rC),rP=tn("$ZodError",rC,void 0,{Parent:Error});function rR(e,t){return{callee:t?.callee??e,Err:t?.Err}}let rL=e=>{let t=(r,n,s,a)=>{let i=s?{...s,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new ts;if(o.issues.length){let r=new(a?.Err??e)(o.issues.map(e=>eU(e,i,to())));throw el(r,a?.callee??t),r}return o.value};return t},rU=rL(rP),rF=e=>{let t=async(r,n,s,a)=>{let i=s?{...s,async:!0}:{async:!0},o=r._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){let r=new(a?.Err??e)(o.issues.map(e=>eU(e,i,to())));throw el(r,a?.callee??t),r}return o.value};return t},rD=rF(rP),rB=e=>(t,r,n)=>{let s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new ts;return a.issues.length?rK(e,a.issues,s):{success:!0,data:a.value}};function rK(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(e=>eU(e,r,to()))),t=void 0,r=void 0),n},set error(e){n=e,t=void 0,r=void 0}}}let rZ=e=>async(t,r,n)=>{let s=n?{...n,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?rK(e,a.issues,s):{success:!0,data:a.value}},rJ=Symbol.for("zod.compile.invalid"),rH=Symbol.for("zod.compile.fallback"),rW=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},s=e._zod.run({value:t,issues:[]},n);return s instanceof Promise&&(s=await s),0===s.issues.length},rV={major:4,minor:6,patch:7},rG=tn("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=rV;let n=e._zod.def.checks,s=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of s)for(let r of t._zod.onattach)r(e);if(0===s.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,n)=>{let s;if(t.memo)return t;let a=eq(t);for(let i of r){if(i._zod.def.when){if(eC(t)||!i._zod.def.when(t))continue}else if(a)continue;let r=t.issues.length,o=i._zod.check(t);if(o instanceof Promise&&n?.async===!1)throw new ts;if(s||o instanceof Promise)s=(s??Promise.resolve()).then(async()=>{await o,t.issues.length!==r&&(eL(t.issues,r,e),a||(a=eq(t,r)))});else{if(t.issues.length===r)continue;eL(t.issues,r,e),a||(a=eq(t,r))}}return s?s.then(()=>t):t},r=(r,n,a)=>{if(eq(r))return r.aborted=!0,r;let i=t(n,s,a);if(i instanceof Promise){if(!1===a.async)throw new ts;return i.then(t=>e._zod.parse(t,a))}return e._zod.parse(i,a)};e._zod.run=(n,a)=>{if(a.skipChecks)return e._zod.parse(n,a);if("backward"===a.direction){let t=e._zod.parse({value:n.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,a)):r(t,n,a)}let i=e._zod.parse(n,a);if(i instanceof Promise){if(!1===a.async)throw new ts;return i.then(e=>t(e,s,a))}return t(i,s,a)}}},{get"~standard"(){return e5(this,"~standard",rQ(this))},set"~standard"(e){e2(this,"~standard",e)}}),rX=(e,t)=>e.issues.length?{issues:e.issues.map(e=>eU(e,t,to()))}:{value:e.value};async function rY(e,t){let r={async:!0};return rX(await e._zod.run({value:t,issues:[]},r),r)}function rQ(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return rX(n,r)}catch(e){}return rY(e,t)},vendor:"zod",version:1}}let r0=tn("$ZodString",(e,t)=>{rG.init(e,t),e._zod.pattern=t.pattern??tV,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),r1=tn("$ZodStringFormat",(e,t)=>{rx.init(e,t),r0.init(e,t)}),r2=tn("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=t_),r1.init(e,t)}),r5=tn("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tA(e))}else t.pattern??(t.pattern=tA());r1.init(e,t)}),r9=tn("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tj),r1.init(e,t)});function r4(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let r6=/[\t\n\r]/g;function r3(e){return e.replace(r6,"")}let r8=tn("$ZodURL",(e,t)=>{r1.init(e,t),e._zod.check=r=>{try{var n,s;let a=r.value.trim(),i="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===tU.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(a,t):r4(a)||2;if(1===i)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===i)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===i){r.value=r3(a);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(i.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&((s=t.protocol).lastIndex=0,!s.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?i.href:r3(a);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),r7=tn("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tN()),r1.init(e,t)}),ne=tn("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?tx:t$(t.length)),r1.init(e,t)}),nt=tn("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tg),r1.init(e,t)}),nr=tn("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tb),r1.init(e,t)}),nn=tn("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tv),r1.init(e,t)}),ns=tn("$ZodXID",(e,t)=>{t.pattern??(t.pattern=tw),r1.init(e,t)}),na=tn("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tk),r1.init(e,t)}),ni=tn("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tW(t)),r1.init(e,t)}),no=tn("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tZ),r1.init(e,t)}),nl=tn("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=tH(t)),r1.init(e,t)}),nu=tn("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tS),r1.init(e,t)}),nc=tn("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tI),r1.init(e,t)}),nd=/^[0-9a-fA-F:.]+$/;function np(e){return!!nd.test(e)&&r4(`http://[${e}]`)}let nh=tn("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tq),r1.init(e,t),e._zod.check=r=>{np(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),nf=((e,t)=>{t.pattern??(t.pattern=tC(t.delimiter)),r1.init(e,t)},tn("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tz),r1.init(e,t)})),nm=tn("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tP),r1.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,n]=t;if(!n)return!1;let s=Number(n);return`${s}`===n&&!(s<0)&&!(s>128)&&np(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function ny(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ng=/^[0-9a-zA-Z+/]*={0,2}$/,nb=tn("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ng),r1.init(e,t),e._zod.check=r=>{ny(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),nv=/^[A-Za-z0-9_-]*$/,nw=tn("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nv),r1.init(e,t),e._zod.check=r=>{!function(e){if(!nv.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ny(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),nk=tn("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tF),r1.init(e,t)}),nx=/[- ]/g,n$=((e,t)=>{t.pattern??(t.pattern=tD),r1.init(e,t),e._zod.check=r=>{var n;n=r.value,tD.test(n)&&function(e){let t=e.length,r=1,n=0;for(;t;){let s=e.charCodeAt(--t)-48;r^=1,n+=r?[0,2,4,6,8,1,3,5,7,9][s]:s}return n%10==0}(n.replace(nx,""))||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}},tn("$ZodJWT",(e,t)=>{r1.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let s=JSON.parse(atob(n));if("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}})),nS=((e,t)=>{r1.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}},tn("$ZodNumber",(e,t)=>{rG.init(e,t),e._zod.pattern=tQ,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let s=r.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return r;let a="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:String(s):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),r}})),n_=tn("$ZodNumberFormat",(e,t)=>{rf.init(e,t),nS.init(e,t)}),nA=tn("$ZodBoolean",(e,t)=>{rG.init(e,t),e._zod.pattern=t0,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let s=r.value;return"boolean"==typeof s||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),nT=tn("$ZodBigInt",(e,t)=>{rG.init(e,t),e._zod.pattern=tX,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),nO=((e,t)=>{rm.init(e,t),nT.init(e,t)},tn("$ZodUnknown",(e,t)=>{rG.init(e,t),e._zod.parse=e=>e})),nE=tn("$ZodNever",(e,t)=>{rG.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function nj(e,t){let r=eR(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(e=>e[0])),s=e._zod.parse;e._zod.parse=(r,a)=>{let i=t(r.value);if(i>n&&!a?.skipChecks&&a?.direction!=="backward"){for(let[t,n]of eR(e._zod.def.checks))if(i>t&&n._zod.def.when(r)){let t=r.issues.length;return n._zod.check(r),r.issues[t].continue=!1,eL(r.issues,t,e),r}}return s(r,a)}}(e,t)=>{rG.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}},(e,t)=>{rG.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let s=r.value,a=s instanceof Date;return a&&!Number.isNaN(s.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:s,...a?{received:"Invalid Date"}:{},inst:e}),r}};let nM=e=>Array.isArray(e)?e.length:-1,nN=e=>e instanceof Map?e.size:-1,nI=e=>e instanceof Set?e.size:-1;function nq(e,t,r){e.issues.length&&t.issues.push(...ez(r,e.issues)),t.value[r]=e.value}let nC=tn("$ZodArray",(e,t)=>{rG.init(e,t);let r=ti.memoizer;r?.attach(e),e._zod.parse=(n,s)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),n;n.value=r?r.alloc(e,n,Array(a.length),s):Array(a.length);let i=[],o=s?.abortEarly;for(let e=0;e<a.length;e++){let r=a[e],l=t.element._zod.run({value:r,issues:[]},s);if(l instanceof Promise)i.push(l.then(t=>nq(t,n,e)));else if(nq(l,n,e),o&&0!==l.issues.length&&eq(l))break}return i.length?Promise.all(i).then(()=>n):n},nj(e,nM)});function nz(e,t,r,n,s,a){let i=r in n,o="optional"===a;if(i||!o||"optional"!==s){if(e.issues.length){if(void 0!==s&&o&&!i)return;t.issues.push(...ez(r,e.issues))}if(!i&&void 0===s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(i||"defaulted"===s&&!o)&&(t.value[r]=void 0):t.value[r]=e.value}}let nP=[];function nR(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:nP,s=n.length?[...t,...n]:t;for(let t of s)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ex(e.shape);return{...e,allKeys:s,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function nL(e,t,r,n,s,a,i){let o=[],l=s.keySet,u=s.catchall._zod,c=u.def.type,d=u.optin,p=u.optout,h=0;for(let s in t){if(i&&r.issues.length!==h){if(eq(r,h))break;h=r.issues.length}if(l.has(s))continue;if("__proto__"===s){"never"===c&&o.push(s);continue}if("never"===c){o.push(s);continue}let a=u.run({value:t[s],issues:[]},n);a instanceof Promise?e.push(a.then(e=>nz(e,r,s,t,d,p))):nz(a,r,s,t,d,p)}return(o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let nU=tn("$ZodObject",(e,t)=>{let r;rG.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),s=n?.get?n.get.raw:t.shape??{};if(s){let e=()=>{let r={...s};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=s,Object.defineProperty(t,"shape",{get:e})}let a=D(()=>nR(t));e3(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||V(r,e,new Set),n.values))r[e].add(t);void 0!==n.optin&&r[e].add(void 0)}}return r});let i=t.catchall,o=ti.memoizer;o?.attach(e),e._zod.parse=(t,n)=>{r??(r=a.value);let s=t.value;if(!eu(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value=o?o.alloc(e,t,{},n):{};let l=[],u=r.shape,c=n?.abortEarly,d=t.issues.length;for(let e of r.allKeys){if(c&&t.issues.length!==d){if(eq(t,d))break;d=t.issues.length}if("__proto__"===e)continue;let r=u[e],a=r._zod.optin,i=r._zod.optout,o=r._zod.run({value:s[e],issues:[]},n);o instanceof Promise?l.push(o.then(r=>nz(r,t,e,s,a,i))):nz(o,t,e,s,a,i)}return i?nL(l,s,t,n,a.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),nF=tn("$ZodObjectJIT",(e,t)=>{let r,n;nU.init(e,t);let s=e._zod.parse,a=D(()=>nR(t)),i=ti.memoizer,o=!ti.jitless,l=o&&ec.value,u=t.catchall;e._zod.parse=(c,d)=>{n??(n=a.value);let p=c.value;return eu(p)?o&&l&&d?.async===!1&&!0!==d.jitless?(r||(r=(t=>{let r=a.value,n=r.symbolKeys,s=new rM(["payload","ctx"],{shape:t,inst:e,memo:i,syms:n}),o=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
4
+ let ${e}_ab = false;
5
+ for (let i = 0; i < ${e}.issues.length; i++) {
6
+ const iss = ${e}.issues[i];
7
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
8
+ payload.issues.push(iss);
9
+ if (iss.continue !== true) ${e}_ab = true;
10
+ }
11
+ if (${e}_ab && ctx && ctx.abortEarly) {
12
+ payload.value = newResult;
13
+ return payload;
14
+ }`;s.write("const input = payload.value;");let u=Object.create(null),c=0;for(let e of r.allKeys)u[e]=`key_${c++}`;for(let e of(s.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};"),r.allKeys)){if("__proto__"===e)continue;let r=u[e],a="symbol"==typeof e?`syms[${n.indexOf(e)}]`:ei(e),i=`${a} in input`,c=t[e],d=c?._zod?.optin,p=void 0!==d,h=c?._zod?.optout==="optional";if(s.write(`const ${r} = ${o(a)};`),p&&h){let e="optional"===d?`${r}_present`:`${r}.value !== undefined || ${r}_present`;s.write(`
15
+ const ${r}_present = ${i};
16
+ if (!${r}.issues.length || ${r}_present) {
17
+ if (${r}.issues.length) {${l(r,a)}
18
+ }
19
+
20
+ if (${e}) {
21
+ newResult[${a}] = ${r}.value;
22
+ }
23
+ }
24
+
25
+ `)}else p?(s.write(`
26
+ if (${r}.issues.length) {${l(r,a)}
27
+ }
28
+ `),"defaulted"===d?s.write(`newResult[${a}] = ${r}.value;`):s.write(`
29
+ if (${r}.value !== undefined || ${i}) {
30
+ newResult[${a}] = ${r}.value;
31
+ }
32
+ `)):s.write(`
33
+ const ${r}_present = ${i};
34
+ if (${r}.issues.length) {${l(r,a)}
35
+ }
36
+ if (!${r}_present && !${r}.issues.length) {
37
+ payload.issues.push({
38
+ code: "invalid_type",
39
+ expected: "nonoptional",
40
+ input: undefined,
41
+ path: [${a}]
42
+ });
43
+ if (ctx && ctx.abortEarly) {
44
+ payload.value = newResult;
45
+ return payload;
46
+ }
47
+ }
48
+
49
+ if (${r}_present) {
50
+ newResult[${a}] = ${r}.value;
51
+ }
52
+
53
+ `)}return s.write("payload.value = newResult;"),s.write("return payload;"),s.compile()})(t.shape)),c=r(c,d),u)?nL([],p,c,d,n,e,d?.abortEarly===!0):c:s(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),c)}});function nD(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let s=e.filter(e=>!eq(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>eU(e,n,to())))}),t)}let nB=tn("$ZodUnion",(e,t)=>{rG.init(e,t),e3(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),e3(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),e3(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),e3(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>K(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(r)return r(n,s);let a=!1,i=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},s);if(t instanceof Promise)i.push(t),a=!0;else{if(0===t.issues.length)return t;i.push(t)}}return a?Promise.all(i).then(t=>nD(t,n,e,s)):nD(i,n,e,s)}});function nK(e,t,r,n){let s=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&s.push(t);return 1===s.length?t.value=e[s[0]].value:0===s.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>eU(e,n,to())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:s}),t}(e,t)=>{nB.init(e,t),t.inclusive=!1;let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(r)return r(n,s);let a=!1,i=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},s);t instanceof Promise?(i.push(t),a=!0):i.push(t)}return a?Promise.all(i).then(t=>nK(t,n,e,s)):nK(i,n,e,s)}};let nZ=tn("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,nB.init(e,t);let r=e._zod.parse;e3(e,"propValues",e=>{let t={},r=0;for(let n of e.def.options){let s=n._zod.propValues;if(!s||0===Object.keys(s).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[n,a]of(s[e.def.discriminator]?.has(void 0)&&r++,Object.entries(s)))for(let e of(Object.prototype.hasOwnProperty.call(t,n)||V(t,n,new Set),a))t[n].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let n=G(e._zod.def);if(n&&!Object.prototype.hasOwnProperty.call(n,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let n=D(()=>(function(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||0===n.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of n)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(s,a)=>{let i=s.value;if(!eu(i))return s.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),s;let o=i?.[t.discriminator],l=n.value.get(o);return l&&(void 0!==o||"backward"!==a.direction)?l._zod.run(s,a):t.unionFallback||"backward"===a.direction?r(s,a):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(e=>null!==n.value.get(e)),input:i,path:[t.discriminator],inst:e}),s)}}),nJ=tn("$ZodIntersection",(e,t)=>{rG.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,s=t.left._zod.run({value:n,issues:[]},r),a=t.right._zod.run({value:n,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([t,r])=>nH(e,t,r)):nH(e,s,a)}});function nH(e,t,r){let n,s=new Map,a=new Map,i=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);a.has(t)||a.set(t,e),r=[t]}else n??(n=e),r=e.keys;for(let e of r)s.has(e)||s.set(e,{}),s.get(e)[t]=!0;return!0};for(let r of t.issues)i(r,"l")||e.issues.push(r);for(let t of r.issues)i(t,"r")||e.issues.push(t);let o=[...s].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length){let t=n?o.filter(e=>n.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...n,keys:t}),o))!t.includes(r)&&a.has(r)&&e.issues.push(a.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(ed(t)&&ed(r)){let n=Object.keys(r),s=Object.keys(t).filter(e=>-1!==n.indexOf(e)),a={...t,...r};for(let n of(Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__,s)){if("__proto__"===n)continue;let s=e(t[n],r[n]);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};a[n]=s.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let s=0;s<t.length;s++){let a=e(t[s],r[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!l.valid){if(eq(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let nW=tn("$ZodTuple",(e,t)=>{rG.init(e,t);let r=t.items,n=ti.memoizer;n?.attach(e),e._zod.parse=(s,a)=>{let i=s.value;if(!Array.isArray(i))return s.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),s;s.value=n?n.alloc(e,s,[],a):[];let o=[],l=nV(r,"optin"),u=nV(r,"optout");if(!t.rest){if(i.length<l)return s.issues.push({code:"too_small",minimum:l,inclusive:!0,input:i,inst:e,origin:"array"}),s;i.length>r.length&&s.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let c=Array(r.length),d=t.rest?a?.abortEarly:void 0,p=!1;for(let e=0;e<r.length;e++){let t=r[e]._zod.run({value:i[e],issues:[]},a);t instanceof Promise?o.push(t.then(t=>{c[e]=t})):(c[e]=t,d&&!p&&t.issues.length&&(p=eq(t)))}if(t.rest&&!p){let e=r.length-1,n=i.slice(r.length),l=s.issues.length;for(let r of n){if(d&&s.issues.length!==l){if(eq(s,l))break;l=s.issues.length}e++;let n=t.rest._zod.run({value:r,issues:[]},a);n instanceof Promise?o.push(n.then(t=>nG(t,s,e))):nG(n,s,e)}}return o.length?Promise.all(o).then(()=>nX(c,s,r,i,u)):nX(c,s,r,i,u)}});function nV(e,t){for(let r=e.length-1;r>=0;r--)if(!("optin"===t?void 0!==e[r]._zod.optin:"optional"===e[r]._zod.optout))return r+1;return 0}function nG(e,t,r){e.issues.length&&t.issues.push(...ez(r,e.issues)),t.value[r]=e.value}function nX(e,t,r,n,s){for(let a=0;a<r.length;a++){let i=e[a],o=a<n.length;if(!o&&a>=s&&"optional"===r[a]._zod.optin){t.value.length=a;break}if(i.issues.length){if(!o&&a>=s){t.value.length=a;break}t.issues.push(...ez(a,i.issues))}t.value[a]=i.value}for(let e=t.value.length-1;e>=n.length;e--)if("optional"===r[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}function nY(e,t,r,n,s,a,i){e.issues.length&&(em.has(typeof n)?r.issues.push(...ez(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:s,inst:a,issues:e.issues.map(e=>eU(e,i,to()))})),t.issues.length&&(em.has(typeof n)?r.issues.push(...ez(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:s,inst:a,key:n,issues:t.issues.map(e=>eU(e,i,to()))})),r.value.set(e.value,t.value)}function nQ(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{rG.init(e,t);let r=ti.memoizer;r?.attach(e),e._zod.parse=(n,s)=>{let a=n.value;if(!ed(a))return n.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),n;let i=[],o=t.keyType._zod.values;if(o&&!t.partial){let l;n.value=r?r.alloc(e,n,{},s):{};let u=new Set;for(let r of o)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(u.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let o=t.keyType._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>eU(e,s,to())),input:r,path:[r],inst:e});continue}let l=o.value;if("__proto__"===l)continue;let c=t.valueType._zod.run({value:a[r],issues:[]},s);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...ez(r,e.issues)),n.value[l]=e.value})):(c.issues.length&&n.issues.push(...ez(r,c.issues)),n.value[l]=c.value)}for(let e in a)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;n.value[e]=a[e]}else(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:l,continue:!0})}else{let l;for(let u of(n.value=r?r.alloc(e,n,{},s):{},Reflect.ownKeys(a))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(a,u))continue;let r=t.keyType._zod.run({value:u,issues:[]},s);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&tQ.test(u)&&r.issues.length){let e=t.keyType._zod.run({value:Number(u),issues:[]},s);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?n.value[u]=a[u]:o?(l=l??[]).push(u):n.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>eU(e,s,to())),input:u,path:[u],inst:e});continue}let c=r.value;if("__proto__"===c)continue;let d=t.valueType._zod.run({value:a[u],issues:[]},s);d instanceof Promise?i.push(d.then(e=>{e.issues.length&&n.issues.push(...ez(u,e.issues)),n.value[c]=e.value})):(d.issues.length&&n.issues.push(...ez(u,d.issues)),n.value[c]=d.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:l,continue:!0})}return i.length?Promise.all(i).then(()=>n):n}},(e,t)=>{rG.init(e,t);let r=ti.memoizer;r?.attach(e),e._zod.parse=(n,s)=>{let a=n.value;if(!(a instanceof Set))return n.issues.push({input:a,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=r?r.alloc(e,n,new Set,s):new Set;let o=s?.abortEarly,l=n.issues.length;for(let e of a){if(o&&n.issues.length!==l){if(eq(n,l))break;l=n.issues.length}let r=t.valueType._zod.run({value:e,issues:[]},s);r instanceof Promise?i.push(r.then(e=>nQ(e,n))):nQ(r,n)}return i.length?Promise.all(i).then(()=>n):n},nj(e,nI)};let n0=tn("$ZodEnum",(e,t)=>{rG.init(e,t);let r=R(t.entries),n=new Set(r);e._zod.values=n,e3(e,"pattern",e=>{let t=R(e.def.entries).filter(e=>em.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>eg(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,s)=>{let a=t.value;return n.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),n1=tn("$ZodLiteral",(e,t)=>{rG.init(e,t);let r=new Set(t.values);e._zod.values=r,e3(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?eg(e):e?eg(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),n2=((e,t)=>{rG.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),t}},tn("$ZodTransform",(e,t)=>{rG.init(e,t),e._zod.optin="optional",ti.memoizer?.guard(e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ta(e.constructor.name);let s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(r.value=e,r));if(s instanceof Promise)throw new ts;return r.value=s,r}}));function n5(e,t){return e.value=t.issues.length?void 0:t.value,e}let n9=tn("$ZodOptional",(e,t)=>{rG.init(e,t),e3(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",e3(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),e3(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${K(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(t=>n5(e,t)):n5(e,n)}return t.innerType._zod.run(e,r)}}),n4=tn("$ZodExactOptional",(e,t)=>{n9.init(e,t),e3(e,"values",e=>e.def.innerType._zod.values),e3(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),n6=tn("$ZodNullable",(e,t)=>{rG.init(e,t),e3(e,"optin",e=>e.def.innerType._zod.optin),e3(e,"optout",e=>e.def.innerType._zod.optout),e3(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${K(t.source)}|null)$`):void 0}),e3(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),n3=tn("$ZodDefault",(e,t)=>{rG.init(e,t),e._zod.optin="defaulted",e3(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>n8(e,t)):n8(n,t)}});function n8(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let n7=tn("$ZodPrefault",(e,t)=>{rG.init(e,t),e._zod.optin="defaulted",e3(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),se=tn("$ZodNonOptional",(e,t)=>{rG.init(e,t),e3(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(t=>st(t,e)):st(s,e)}});function st(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function sr(e,t,r,n){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>eU(e,n,to()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{rG.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new ta("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}};let sn=tn("$ZodCatch",(e,t)=>{rG.init(e,t),e3(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e3(e,"optout",e=>e.def.innerType._zod.optout),e3(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(n=>sr(e,n,t,r)):sr(e,n,t,r)}}),ss=((e,t)=>{rG.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},tn("$ZodPipe",(e,t)=>{rG.init(e,t),e3(e,"values",e=>e.def.in._zod.values),e3(e,"optin",e=>e.def.in._zod.optin),e3(e,"optout",e=>e.def.out._zod.optout),e3(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sa(e,t.in,r)):sa(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sa(e,t.out,r)):sa(n,t.out,r)}}));function sa(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function si(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>so(e,n,t.out,r)):so(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>so(e,n,t.in,r)):so(e,n,t.in,r)}}function so(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}(e,t)=>{rG.init(e,t),e3(e,"values",e=>e.def.in._zod.values),e3(e,"optin",e=>e.def.in._zod.optin),e3(e,"optout",e=>e.def.out._zod.optout),e3(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>si(e,t,r)):si(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>si(e,t,r)):si(n,t,r)}}},(e,t)=>{ss.init(e,t)};let sl=tn("$ZodReadonly",(e,t)=>{rG.init(e,t),e3(e,"propValues",e=>e.def.innerType._zod.propValues),e3(e,"values",e=>e.def.innerType._zod.values),e3(e,"optin",e=>e.def.innerType?._zod?.optin),e3(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(su):su(n)}});function su(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{rG.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let r=t._zod.def,n=t._zod.pattern?.source,s=r.innerType??t._zod.innerType;if(s){let t=s._zod.pattern?.source,r=e(s);return n&&t&&r&&r!==t?n.replace(K(t),()=>K(r)):n}if(r.options){let t=r.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>K(e)).join("|")})$`}return function(e){let t,r,n=e._zod.def,s=n.pattern,a=!!n.format?.includes("int");for(let e of n.checks??[]){let n=e._zod.def;n.pattern&&(s=n.pattern),a||(a=!!n.format?.includes("int"));let i=n.minimum??n.length,o=n.maximum??n.length;void 0!==i&&(void 0===t||i>t)&&(t=i),void 0!==o&&(void 0===r||o<r)&&(r=o)}if(s)return s.source;if(void 0!==t&&void 0!==r&&t>r)return"(?!)";if(void 0!==t||void 0!==r)return tG({minimum:t,maximum:r}).source;let i=e._zod.pattern;return(a&&i===tQ?tY:i)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);r.push(K(t))}else if(null===e||ey.has(typeof e))r.push(eg(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)},(e,t)=>{rG.init(e,t),H(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),e3(e,"pattern",e=>e.innerType?._zod?.pattern),e3(e,"propValues",e=>e.innerType?._zod?.propValues),e3(e,"optin",e=>e.innerType?._zod?.optin??void 0),e3(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)};let sc=tn("$ZodCustom",(e,t)=>{ro.init(e,t),rG.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(t=>sd(t,r,n,e));sd(s,r,n,e)}});function sd(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(eJ(e))}}function sp(e){return e.checks&&(e.checks=[...e.checks]),e}function sh(e,t){return new rd({check:"less_than",...ev(t),value:e,inclusive:!1})}function sf(e,t){return new rd({check:"less_than",...ev(t),value:e,inclusive:!0})}function sm(e,t){return new rp({check:"greater_than",...ev(t),value:e,inclusive:!1})}function sy(e,t){return new rp({check:"greater_than",...ev(t),value:e,inclusive:!0})}function sg(e,t){return new rh({check:"multiple_of",...ev(t),value:e})}function sb(e,t){return new rv({check:"max_length",...ev(t),maximum:e})}function sv(e,t){return new rw({check:"min_length",...ev(t),minimum:e})}function sw(e,t){return new rk({check:"length_equals",...ev(t),length:e})}function sk(e){return new rj({check:"overwrite",tx:e})}e.i(79692);var sx,s$,sS,s_=e.i(22210),s_=s_,sA=s_,sT=s_,sO=s_,sE=s_,sj=s_,sM=s_,sN=s_,sI=s_,sq=s_,sC=s_,sz=s_,sP=s_,sR=s_,sL=s_,sU=s_;function sF(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&V(e,t,r[t]);return e}function sD(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ty,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function sB(e,t,r,n,s){let a="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:n.path,message:s}):t.unrepresentable;if("any"===a)return!1;if(void 0===a||"throw"===a)throw Error(s);return Object.assign(r,a),!0}function sK(e,t,r={path:[],schemaPath:[]}){var n;let s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,n);else{let r=i.schema,a=t.processors[s.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);a(e,t,r,n)}let a=e._zod.parent;a&&(i.ref||(i.ref=a),sK(a,t,n),t.seen.get(a).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&sF(i.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let s=t._zod.def;if("transform"===s.type)return!0;if("array"===s.type)return e(s.element,n);if("set"===s.type)return e(s.valueType,n);if("lazy"===s.type)return e(s.getter(),n);if("promise"===s.type||"optional"===s.type||"nonoptional"===s.type||"nullable"===s.type||"readonly"===s.type||"default"===s.type||"prefault"===s.type||"catch"===s.type)return e(s.innerType,n);if("intersection"===s.type)return e(s.left,n)||e(s.right,n);if("record"===s.type||"map"===s.type)return e(s.keyType,n)||e(s.valueType,n);if("pipe"===s.type)return!!t._zod.traits.has("$ZodCodec")||e(s.in,n)||e(s.out,n);if("object"===s.type){for(let t in s.shape)if(e(s.shape[t],n))return!0;return!1}if("union"===s.type){for(let t of s.options)if(e(t,n))return!0;return!1}if("tuple"===s.type){for(let t of s.items)if(e(t,n))return!0;if(s.rest&&e(s.rest,n))return!0}return!1}(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function sZ(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function sJ(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let s=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:s,defId:a}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(r)return{ref:s(r)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${s("__shared")}#/${n}/${sZ(a)}`}}let s=`#/${n}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:s+sZ(a)}})(t);n.def={...n.schema},a&&(n.defId=a);let i=n.schema;for(let e in i)delete i[e];i.$ref=s};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
54
+
55
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){s(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle){s(r);continue}n.count>1&&"ref"===e.reused&&s(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let sH=new Set(["type","properties","required","additionalProperties"]),sW=["oneOf","anyOf"];function sV(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function sG(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!sH.has(e))return null;t.push(r)}let r={},n=new Set;for(let e of t){for(let n in e.properties){if(Object.prototype.hasOwnProperty.call(r,n))continue;let e=[];for(let r of t){let t=r.properties?.[n]??sV(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}V(r,n,1===e.length?e[0]:sG(e)??{allOf:e})}for(let t of e.required??[])n.add(t)}let s={type:"object",properties:r};if(n.size&&(s.required=[...n]),t.every(e=>!1===e.additionalProperties))s.additionalProperties=!1;else{let e=[];for(let r of t){let t=sV(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?s.additionalProperties=e[0]:e.length>1&&(s.additionalProperties={allOf:e})}return s}function sX(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let s=r.def??r.schema,a={...s},i=r.ref;if(r.ref=null,i){n(i);let r=e.seen.get(i),o=r.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(s.allOf=s.allOf??[],s.allOf.push(o)):sF(s,o),sF(s,a),t._zod.parent===i)for(let e in s)"$ref"!==e&&"allOf"!==e&&(e in a||delete s[e]);if(o.$ref&&r.def)for(let e in s)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(s[e])===JSON.stringify(r.def[e])&&delete s[e]}let o=t._zod.parent;if(o&&o!==i){n(o);let t=e.seen.get(o);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(let e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:r.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())n(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let n=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let s=t.type;for(let e of Array.isArray(s)?s:[s]){if("string"!=typeof e)return;n.includes(e)||n.push(e)}}delete t.anyOf,t.type=1===n.length?n[0]:n}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let n=t.get(r);n?n.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of sH)if(t in e)return;let r=t.filter(e=>sW.some(t=>Array.isArray(e[t]))),n=null;if(r.length){let e=r[0],s=sW.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let a=t.filter(t=>t!==e),i=e[s].map(e=>sG([...a,e]));if(i.some(e=>!e))return;n={[s]:i}}else n=sG(t);n&&(delete e.allOf,sF(e,n))}(e)}}let s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");s.$id=e.external.uri(r)}sF(s,r.defId?r.schema:r.def??r.schema);let a=e.metadataRegistry.get(t)?.id;void 0!==a&&s.id===a&&delete s.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,V(i,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?s.$defs=i:s.definitions=i);try{let r=JSON.parse(JSON.stringify(s));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:sY(t,"input",e.processors),output:sY(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let sY=(e,t,r={})=>n=>{let{libraryOptions:s,target:a}=n??{},i=sD({...s??{},target:a,io:t,processors:r});return sK(e,i),sJ(i,e),sX(i,e)},sQ=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},s0=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},s1=(e,t)=>{sQ(e,"minimum",t),s0(e,"maximum",t)},s2=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},s5=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},s9=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},s4=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},s6=(e,t)=>sQ(e,"minimum",t.minimum),s3=(e,t)=>s0(e,"maximum",t.maximum),s8=e=>(t,r)=>{s4(t,r.format);let[n,s]=e[r.format];sQ(t,"minimum",n),s0(t,"maximum",s)},s7={greater_than:(e,t)=>sQ(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>s0(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>s2(e,t.value),number_format:s8(e$),bigint_format:s8(eS),min_length:s6,max_length:s3,length_equals:(e,t)=>s1(e,t.length),min_size:s6,max_size:s3,size_equals:(e,t)=>s1(e,t.size),string_format:(e,t)=>{s4(e,t.format),t.pattern&&s5(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>s9(e,t.mime)};function ae(e){let t={},r=e._zod.def;for(let n of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])s7[n._zod.def.check]?.(t,n._zod.def);let n=e._zod.bag;for(let e of(void 0!==n.minimum&&sQ(t,"minimum",n.minimum),void 0!==n.exclusiveMinimum&&sQ(t,"exclusiveMinimum",n.exclusiveMinimum),void 0!==n.maximum&&s0(t,"maximum",n.maximum),void 0!==n.exclusiveMaximum&&s0(t,"exclusiveMaximum",n.exclusiveMaximum),void 0!==n.multipleOf&&s2(t,n.multipleOf),void 0!==n.format&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&s9(t,n.mime),n.patterns??[]))s5(t,e);return t}let at={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ar=new Map([[ng,tR],[nv,tL]]),an=e=>ar.get(e)??e;new WeakMap;let as=Symbol();function aa(e,t,r,n,s){let a=!1,i=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(a=!0,null));return a?(sB(t,r,n,s,"BigInt defaults cannot be represented in JSON Schema"),as):JSON.parse(i)}let ai=(e,t,r,n)=>{let s=e._zod.def;sK(s.innerType,t,n),t.seen.get(e).ref=s.innerType},ao=new WeakSet([Object.prototype,Error.prototype]);function al(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let au=tn("ZodError",(e,t)=>{rz.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);ao.has(r)||(ao.add(r),al(r,"format",e=>t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,s=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e},[...s,...a.path]));else if("invalid_key"===a.code)n({issues:a.issues},[...s,...a.path]);else if("invalid_element"===a.code)n({issues:a.issues},[...s,...a.path]);else{let e=[...s,...a.path];if(0===e.length)r._errors.push(t(a));else{let n=r,s=0;for(;s<e.length;){let r=e[s],i=s===e.length-1;if("_errors"===r){i&&n._errors.push(t(a)),s++;continue}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let o=n[r];i&&o._errors.push(t(a)),n=o,s++}}}};return n(e),r})(e,t)),al(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)if(i.path.length>0){var s,a;(s=i.path[0],a=()=>[],!Object.prototype.hasOwnProperty.call(r,s)&&("__proto__"===s?Object.defineProperty(r,s,{value:a(),writable:!0,enumerable:!0,configurable:!0}):r[s]=a()),r[s]).push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}})(e,t)),al(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,U,2)}),al(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,U,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,au],75214);let ac=rL(au),ad=rF(au),ap=rB(au),ah=rZ(au),af=(s=rL(au),a=(e,t,r,n)=>s(e,t,r?{...r,direction:"backward"}:{direction:"backward"},rR(a,n))),am=(i=rL(au),o=(e,t,r,n)=>i(e,t,r,rR(o,n))),ay=(l=rF(au),u=async(e,t,r,n)=>{let s=r?{...r,direction:"backward"}:{direction:"backward"};return await l(e,t,s,rR(u,n))}),ag=(c=rF(au),d=async(e,t,r,n)=>await c(e,t,r,rR(d,n))),ab=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rB(au)(e,t,n)},av=(e,t,r)=>rB(au)(e,t,r),aw=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return rZ(au)(e,t,n)},ak=async(e,t,r)=>rZ(au)(e,t,r);function ax(){ti.memoizer||to({memoizer:tm})}let a$=tn("ZodType",(e,t)=>(ti.localeError||to({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function n(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=n(r.expected),t=n(eZ(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${ek(r.values[0])}`;return`Invalid option: expected one of ${L(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}),rG.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(sA.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return eb(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new i$({type:"custom",check:"custom",fn:e,...ev(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,s;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eJ(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(eJ(e)))},e(t.value,t)),(s=new ro({check:"custom",...ev(t)}))._zod.check=r,n=s}(e,t))},overwrite(e){return this.check(sk(e))},optional(){return id(this)},exactOptional(){var e;return e=this,new ip({type:"optional",innerType:e})},nullable(){return im(this)},nullish(){return id(im(this))},nonoptional(e){var t,r;return t=this,r=e,new ib({type:"nonoptional",innerType:t,...sj.normalizeParams(r)})},array(){return a3(this)},or(e){return new ie({type:"union",options:[this,e],...sj.normalizeParams(void 0)})},and(e){var t;return t=this,new is({type:"intersection",left:t,right:e})},transform(e){return ik(this,new iu({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new iy({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():sU.shallowClone(r)}})},prefault(e){var t,r;return t=this,r=e,new ig({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():sU.shallowClone(r)}})},catch(e){var t,r;return t=this,new iv({type:"catch",innerType:t,catchValue:"function"==typeof(r=e)?r:s_.constantCatch(r)})},pipe(e){return ik(this,e)},readonly(){var e;return e=this,new ix({type:"readonly",innerType:e})},describe(e){let t=this.clone();return ty.add(t,{description:e}),t},meta(...e){if(0===e.length)return ty.get(this);let t=this.clone();return ty.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return sT.hide(this,"~standard",{...rQ(this),jsonSchema:{input:sY(this,"input"),output:sY(this,"output")}})},set"~standard"(e){sO.own(this,"~standard",e)},parse:function e(t,r){return ac(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await ad(this,t,r,{callee:e})},safeParse(e,t){return ap(this,e,t)},async safeParseAsync(e,t){return ah(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){sO.own(this,"spa",e)},validate(e,t){let r=this._zod.bag.validator;if(void 0!==r){if(r(e)!==rJ)return!0;if(!0===r.definite&&void 0===t)return!1}return function(e,t,r){let n,s=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},a=e._zod.bag.fallbackRun;if(a?(s[rH]=!0,n=a({value:t,issues:[]},s)):n=e._zod.run({value:t,issues:[]},s),n instanceof Promise)throw new ts;return 0===n.issues.length}(this,e,t)},validateAsync(e,t){return rW(this,e,t)},encode:function e(t,r){return af(this,t,r,{callee:e})},decode:function e(t,r){return am(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ay(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ag(this,t,r,{callee:e})},safeEncode(e,t){return ab(this,e,t)},safeDecode(e,t){return av(this,e,t)},async safeEncodeAsync(e,t){return aw(this,e,t)},async safeDecodeAsync(e,t){return ak(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let n=sD({...r,processors:t});return sK(e,n),sJ(n,e),sX(n,e)})(this,{})(e)},get description(){return ty.get(this)?.description},get _def(){return this._zod.def}}),aS=tn("_ZodString",(e,t)=>{r0.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{r.type="string";let{minimum:n,maximum:s,format:a,patterns:i,contentEncoding:o,laxFormat:l}=ae(e);if("number"==typeof n&&(r.minLength=n),"number"==typeof s&&(r.maxLength=s),a&&(r.format=at[a]??a,""===r.format&&delete r.format,("time"===a||l)&&delete r.format),o&&(r.contentEncoding=o),i&&i.size>0){let e=[...i].map(an);1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r)},sE.derived({format:e=>ae(e).format??null,minLength:e=>ae(e).minimum??null,maxLength:e=>ae(e).maximum??null},{regex(...e){return this.check(function(e,t){return new r$({check:"string_format",format:"regex",...ev(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new rA({check:"string_format",format:"includes",...ev(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new rT({check:"string_format",format:"starts_with",...ev(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new rO({check:"string_format",format:"ends_with",...ev(t),suffix:e})}(...e))},min(...e){return this.check(sv(...e))},max(...e){return this.check(sb(...e))},length(...e){return this.check(sw(...e))},nonempty(...e){return this.check(sv(1,...e))},lowercase(e){return this.check(new rS({check:"string_format",format:"lowercase",...ev(e)}))},uppercase(e){return this.check(new r_({check:"string_format",format:"uppercase",...ev(e)}))},trim(){return this.check(sk(e=>e.trim()))},normalize(...e){return this.check(function(e){return sk(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(sk(e=>e.toLowerCase()))},toUpperCase(){return this.check(sk(e=>e.toUpperCase()))},slugify(){return this.check(sk(e=>eo(e)))}})),a_=tn("ZodString",(e,t)=>{r0.init(e,t),aS.init(e,t)},{email(e){return this.check(new aN({type:"string",format:"email",check:"string_format",abort:!1,...ev(e)}))},url(e){return this.check(new aC({type:"string",format:"url",check:"string_format",abort:!1,...ev(e)}))},jwt(e){return this.check(new aG({type:"string",format:"jwt",check:"string_format",abort:!1,...ev(e)}))},emoji(e){return this.check(new az({type:"string",format:"emoji",check:"string_format",abort:!1,...ev(e)}))},guid(e){return this.check(new aI({type:"string",format:"guid",check:"string_format",abort:!1,...ev(e)}))},uuid(e){return this.check(new aq({type:"string",format:"uuid",check:"string_format",abort:!1,...ev(e)}))},uuidv4(e){return this.check(new aq({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ev(e)}))},uuidv6(e){return this.check(new aq({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ev(e)}))},uuidv7(e){return this.check(new aq({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ev(e)}))},nanoid(e){return this.check(new aP({type:"string",format:"nanoid",check:"string_format",abort:!1,...ev(e)}))},cuid(e){return this.check(new aR({type:"string",format:"cuid",check:"string_format",abort:!1,...ev(e)}))},cuid2(e){return this.check(new aL({type:"string",format:"cuid2",check:"string_format",abort:!1,...ev(e)}))},ulid(e){return this.check(new aU({type:"string",format:"ulid",check:"string_format",abort:!1,...ev(e)}))},base64(e){return this.check(new aH({type:"string",format:"base64",check:"string_format",abort:!1,...ev(e)}))},base64url(e){return this.check(new aW({type:"string",format:"base64url",check:"string_format",abort:!1,...ev(e)}))},xid(e){return this.check(new aF({type:"string",format:"xid",check:"string_format",abort:!1,...ev(e)}))},ksuid(e){return this.check(new aD({type:"string",format:"ksuid",check:"string_format",abort:!1,...ev(e)}))},ipv4(e){return this.check(new aB({type:"string",format:"ipv4",check:"string_format",abort:!1,...ev(e)}))},ipv6(e){return this.check(new aK({type:"string",format:"ipv6",check:"string_format",abort:!1,...ev(e)}))},cidrv4(e){return this.check(new aZ({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ev(e)}))},cidrv6(e){return this.check(new aJ({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ev(e)}))},e164(e){return this.check(new aV({type:"string",format:"e164",check:"string_format",abort:!1,...ev(e)}))},datetime(e){return this.check(new aO({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ev(e)}))},date(e){return this.check(new aE({type:"string",format:"date",check:"string_format",...ev(e)}))},time(e){return this.check(new aj({type:"string",format:"time",check:"string_format",precision:null,...ev(e)}))},duration(e){return this.check(new aM({type:"string",format:"duration",check:"string_format",...ev(e)}))}});function aA(e){return new a_(sp({type:"string",...ev(e)}))}let aT=tn("ZodStringFormat",(e,t)=>{r1.init(e,t),aS.init(e,t)}),aO=tn("ZodISODateTime",(e,t)=>{ni.init(e,t),aT.init(e,t)}),aE=tn("ZodISODate",(e,t)=>{no.init(e,t),aT.init(e,t)}),aj=tn("ZodISOTime",(e,t)=>{nl.init(e,t),aT.init(e,t)}),aM=tn("ZodISODuration",(e,t)=>{nu.init(e,t),aT.init(e,t)}),aN=tn("ZodEmail",(e,t)=>{r9.init(e,t),aT.init(e,t)}),aI=tn("ZodGUID",(e,t)=>{r2.init(e,t),aT.init(e,t)}),aq=tn("ZodUUID",(e,t)=>{r5.init(e,t),aT.init(e,t)}),aC=tn("ZodURL",(e,t)=>{r8.init(e,t),aT.init(e,t)}),az=tn("ZodEmoji",(e,t)=>{r7.init(e,t),aT.init(e,t)}),aP=tn("ZodNanoID",(e,t)=>{ne.init(e,t),aT.init(e,t)}),aR=tn("ZodCUID",(e,t)=>{nt.init(e,t),aT.init(e,t)}),aL=tn("ZodCUID2",(e,t)=>{nr.init(e,t),aT.init(e,t)}),aU=tn("ZodULID",(e,t)=>{nn.init(e,t),aT.init(e,t)}),aF=tn("ZodXID",(e,t)=>{ns.init(e,t),aT.init(e,t)}),aD=tn("ZodKSUID",(e,t)=>{na.init(e,t),aT.init(e,t)}),aB=tn("ZodIPv4",(e,t)=>{nc.init(e,t),aT.init(e,t)}),aK=tn("ZodIPv6",(e,t)=>{nh.init(e,t),aT.init(e,t)}),aZ=tn("ZodCIDRv4",(e,t)=>{nf.init(e,t),aT.init(e,t)}),aJ=tn("ZodCIDRv6",(e,t)=>{nm.init(e,t),aT.init(e,t)}),aH=tn("ZodBase64",(e,t)=>{nb.init(e,t),aT.init(e,t)}),aW=tn("ZodBase64URL",(e,t)=>{nw.init(e,t),aT.init(e,t)}),aV=tn("ZodE164",(e,t)=>{nk.init(e,t),aT.init(e,t)}),aG=tn("ZodJWT",(e,t)=>{n$.init(e,t),aT.init(e,t)}),aX=tn("ZodNumber",(e,t)=>{nS.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:s,maximum:a,multipleOf:i,exclusiveMaximum:o,exclusiveMinimum:l,isInt:u}=ae(e);r.type=u?"integer":"number";let c="number"==typeof l&&l>=(s??-1/0),d="number"==typeof o&&o<=(a??1/0),p="draft-04"===t.target||"openapi-3.0"===t.target;if(c?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof s&&(r.minimum=s),d?p?(r.maximum=o,r.exclusiveMaximum=!0):r.exclusiveMaximum=o:"number"==typeof a&&(r.maximum=a),i){let s=new Set;for(let a of i)Number.isFinite(a)&&0!==a?s.add(Math.abs(a)):sB(e,t,r,n,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=s;void 0!==a&&(r.multipleOf=a),o.length&&(r.allOf=[...r.allOf??[],...o.map(e=>({multipleOf:e}))])}})(e,t,r,n),e.isFinite=!0},sE.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=ae(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=ae(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=ae(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>ae(e).format??null},{gt(e,t){return this.check(sm(e,t))},gte(e,t){return this.check(sy(e,t))},min(e,t){return this.check(sy(e,t))},lt(e,t){return this.check(sh(e,t))},lte(e,t){return this.check(sf(e,t))},max(e,t){return this.check(sf(e,t))},int(e){return this.check(a0(e))},safe(e){return this.check(a0(e))},positive(e){return this.check(sm(0,e))},nonnegative(e){return this.check(sy(0,e))},negative(e){return this.check(sh(0,e))},nonpositive(e){return this.check(sf(0,e))},multipleOf(e,t){return this.check(sg(e,t))},step(e,t){return this.check(sg(e,t))},finite(){return this}}));function aY(e){return new aX(sp({type:"number",checks:[],...ev(e)}))}let aQ=tn("ZodNumberFormat",(e,t)=>{n_.init(e,t),aX.init(e,t)});function a0(e){return new aQ({type:"number",check:"number_format",abort:!1,format:"safeint",...ev(e)})}let a1=tn("ZodBoolean",(e,t)=>{nA.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}});function a2(e){return new a1({type:"boolean",...ev(e)})}(e,t)=>{nT.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sB(e,t,r,n,"BigInt cannot be represented in JSON Schema")}};let a5=tn("ZodUnknown",(e,t)=>{nO.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(e,t,r)=>void 0});function a9(){return new a5({type:"unknown"})}let a4=tn("ZodNever",(e,t)=>{nE.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}}),a6=tn("ZodArray",(e,t)=>{ax(),nC.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def,{minimum:a,maximum:i}=ae(e);"number"==typeof a&&(r.minItems=a),"number"==typeof i&&(r.maxItems=i),r.type="array",r.items=sK(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element},{min(e,t){return this.check(sv(e,t))},nonempty(e){return this.check(sv(1,e))},max(e,t){return this.check(sb(e,t))},length(e,t){return this.check(sw(e,t))},unwrap(){return this.element}});function a3(e,t){return new a6({type:"array",element:e,...ev(t)})}let a8=tn("ZodObject",(e,t)=>{ax(),nF.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def,a=s.shape;if(Object.getOwnPropertySymbols(a).length&&sB(e,t,r,n,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},a)V(r.properties,e,sK(a[e],t,{...n,path:[...n.path,"properties",e]}));let i=[];for(let e of Object.keys(a)){let r=s.shape[e];("input"===t.io?void 0===function e(t){let r=t._zod.def;return"pipe"===r.type&&r.in._zod.traits.has("$ZodTransform")?e(r.out):"catch"===r.type?e(r.innerType):t._zod.optin}(r):void 0===r._zod.optout)&&i.push(e)}i.length>0&&(r.required=i),s.catchall?._zod.def.type==="never"?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=sK(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),sR.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return ii(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(sA.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(sA.mergeDefs(this._zod.def,{catchall:a9()}))},loose(){return this.clone(sA.mergeDefs(this._zod.def,{catchall:a9()}))},strict(){return this.clone(sA.mergeDefs(this._zod.def,{catchall:new a4({type:"never",...ev(void 0)})}))},strip(){return this.clone(sA.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return sM.extend(this,e)},safeExtend(e){return sN.safeExtend(this,e)},merge(e){return sI.merge(this,e)},pick(e){return sq.pick(this,e)},omit(e){return sC.omit(this,e)},partial(...e){return sz.partial(ic,this,e[0])},exactPartial(...e){return sz.partial(ip,this,e[0],"exactPartial")},required(...e){return sP.required(ib,this,e[0])}});function a7(e,t){return new a8({type:"object",shape:e??{},...sj.normalizeParams(t)})}let ie=tn("ZodUnion",(e,t)=>{nB.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{var s,a,i,o;let l,u,c;return s=e,a=t,i=r,o=n,u=!1===(l=s._zod.def).inclusive,c=l.options.map((e,t)=>sK(e,a,{...o,path:[...o.path,u?"oneOf":"anyOf",t]})),void(u?i.oneOf=c:i.anyOf=c)},e.options=t.options}),it=tn("ZodDiscriminatedUnion",(e,t)=>{ie.init(e,t),nZ.init(e,t)});function ir(e,t,r){return new it({type:"union",options:t,discriminator:e,...sj.normalizeParams(r)})}let is=tn("ZodIntersection",(e,t)=>{nJ.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,a,i,o,l;return a=sK((s=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),i=sK(s.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=l=[...(o=e=>"allOf"in e&&1===Object.keys(e).length)(a)?a.allOf:[a],...o(i)?i.allOf:[i]],t.intersections.push(l))}}),ia=tn("ZodEnum",(e,t)=>{n0.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t)=>{let r=R(e._zod.def.entries);if(0===r.length){t.not={};return}r.every(e=>"number"==typeof e)&&(t.type="number"),r.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=r})(e,r),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let s={};for(let n of e)if(r.has(n))s[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new ia({...t,checks:[],...sj.normalizeParams(n),entries:s})},e.exclude=(e,n)=>{let s={...t.entries};for(let t of e)if(r.has(t))delete s[t];else throw Error(`Key ${t} not found in enum`);return new ia({...t,checks:[],...sj.normalizeParams(n),entries:s})}});function ii(e,t){return new ia({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...sj.normalizeParams(t)})}let io=tn("ZodLiteral",(e,t)=>{n1.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def;if(0===s.values.length){r.not={};return}let a=[];for(let i of s.values)if(void 0===i){if(sB(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof i){if(sB(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;a.push(Number(i))}else a.push(i);if(0===a.length);else if(1===a.length){let e=a[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else a.every(e=>"number"==typeof e)&&(r.type="number"),a.every(e=>"string"==typeof e)&&(r.type="string"),a.every(e=>"boolean"==typeof e)&&(r.type="boolean"),a.every(e=>null===e)&&(r.type="null"),r.enum=a})(e,t,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function il(e,t){return new io({type:"literal",values:Array.isArray(e)?e:[e],...sj.normalizeParams(t)})}let iu=tn("ZodTransform",(e,t)=>{ax(),n2.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sB(e,t,r,n,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new ta(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(sL.issue(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=r.value),n.inst??(n.inst=e),r.issues.push(sL.issue(n)))};let s=t.transform(r.value,r);return s instanceof Promise?s.then(e=>(r.value=e,r)):(r.value=s,r)}}),ic=tn("ZodOptional",(e,t)=>{n9.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ai(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function id(e){return new ic({type:"optional",innerType:e})}let ip=tn("ZodExactOptional",(e,t)=>{n4.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ai(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),ih=tn("ZodNullable",(e,t)=>{n6.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,a,i;return a=sK((s=e._zod.def).innerType,t,n),i=t.seen.get(e),void("openapi-3.0"===t.target?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function im(e){return new ih({type:"nullable",innerType:e})}let iy=tn("ZodDefault",(e,t)=>{n3.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,a;return sK((s=e._zod.def).innerType,t,n),t.seen.get(e).ref=s.innerType,void((a=aa(s.defaultValue,e,t,r,n))!==as&&(r.default=a))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ig=tn("ZodPrefault",(e,t)=>{n7.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s=e._zod.def;if(sK(s.innerType,t,n),t.seen.get(e).ref=s.innerType,"input"!==t.io)return;let a=aa(s.defaultValue,e,t,r,n);a!==as&&(r._prefault=a)})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),ib=tn("ZodNonOptional",(e,t)=>{se.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s;sK((s=e._zod.def).innerType,t,n),t.seen.get(e).ref=s.innerType},e.unwrap=()=>e._zod.def.innerType}),iv=tn("ZodCatch",(e,t)=>{sn.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let s,a=e._zod.def;sK(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{s=a.catchValue(void 0)}catch{sB(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),iw=tn("ZodPipe",(e,t)=>{ss.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s,a,i;return a=(s=e._zod.def).in._zod.traits.has("$ZodTransform"),void(sK(i="input"===t.io?a?s.out:s.in:s.out,t,n),t.seen.get(e).ref=i)},e.in=t.in,e.out=t.out});function ik(e,t){return new iw({type:"pipe",in:e,out:t})}let ix=tn("ZodReadonly",(e,t)=>{sl.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let s;sK((s=e._zod.def).innerType,t,n),t.seen.get(e).ref=s.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),i$=tn("ZodCustom",(e,t)=>{sc.init(e,t),a$.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{sB(e,t,r,n,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,a3,"boolean",0,a2,"discriminatedUnion",0,ir,"enum",0,ii,"literal",0,il,"number",0,aY,"object",0,a7,"string",0,aA,"unknown",0,a9],86752),e.i(86752),e.s([],4435),e.i(4435),e.i(75214),e.s([],68959),e.i(68959);let iS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};sS||(sS={}),e.s(["ZodIssueCode",0,iS],38220),e.i(38220),e.s(["ZodIssueCode",0,iS,"array",0,a3,"boolean",0,a2,"discriminatedUnion",0,ir,"enum",0,ii,"literal",0,il,"number",0,aY,"object",0,a7,"string",0,aA,"unknown",0,a9],77698);var i_=e.i(77698),i_=i_,iA=i_,iT=i_,iO=i_,iE=i_,ij=i_,iM=i_;let iN=i_.discriminatedUnion("type",[iA.object({type:iT.literal("status"),expect:iO.string().min(1).max(100)}).strict(),iA.object({type:iT.literal("body"),op:iE.enum(["contains","not_contains","matches","is_json"]),value:iO.string().max(2e3).default("")}).strict(),iA.object({type:iT.literal("json"),path:iO.string().min(1).max(300),op:iE.enum(["exists","not_exists","equals","not_equals","contains","greater","less","matches","type","length"]),value:iO.string().max(2e3).default("")}).strict(),iA.object({type:iT.literal("header"),name:iO.string().min(1).max(200),op:iE.enum(["exists","not_exists","equals","contains","matches"]),value:iO.string().max(2e3).default("")}).strict(),iA.object({type:iT.literal("time"),maxMs:ij.number().positive().max(6e5)}).strict(),iA.object({type:iT.literal("schema"),schema:iO.string().max(2e5)}).strict(),iA.object({type:iT.literal("fields"),rows:iM.array(iA.object({path:iO.string().max(300),value:iO.string().max(2e3).default(""),as:iE.enum(["text","loose","number","date"]).default("text"),map:iO.string().max(2e3).default("")}).strict()).max(100)}).strict()]);function iI(e){switch(e.type){case"status":return`status is ${e.expect.replace(/\s+/g,"")}`;case"body":if("is_json"===e.op)return"body is JSON";if("matches"===e.op)return`body matches /${iq(e.value)}/`;return`body ${"contains"===e.op?"contains":"does not contain"} "${iq(e.value)}"`;case"json":{let t,r=(t=e.path.trim().replace(/^\$\.?/,""))?`$.${t}`:"$";switch(e.op){case"exists":return`${r} exists`;case"not_exists":return`${r} does not exist`;case"greater":return`${r} > ${iq(e.value)}`;case"less":return`${r} < ${iq(e.value)}`;case"matches":return`${r} matches /${iq(e.value)}/`;case"type":return`${r} is ${/^[aeiou]/.test(e.value)?"an":"a"} ${e.value||"?"}`;case"length":return`length of ${r} ${function(e){let t=/^\s*(>=|<=|!=|>|<|=)?\s*(\d+)\s*$/.exec(e);if(!t)return{label:`is ${e.trim()||"?"}`};let r=t[1]??"=";return{label:`${"="===r?"=":"!="===r?"≠":">="===r?"≥":"<="===r?"≤":r} ${t[2]}`}}(e.value).label}`;default:return`${r} ${"equals"===e.op?"=":"not_equals"===e.op?"≠":"contains"} "${iq(e.value)}"`}}case"header":if("exists"===e.op)return`header ${e.name} exists`;if("not_exists"===e.op)return`header ${e.name} does not exist`;if("matches"===e.op)return`header ${e.name} matches /${iq(e.value)}/`;return`header ${e.name} ${"equals"===e.op?"=":"contains"} "${iq(e.value)}"`;case"time":return`responds within ${e.maxMs} ms`;case"schema":{let t=function(e){try{let t=JSON.parse(e);return"string"==typeof t?.title&&t.title.trim()?t.title.trim():void 0}catch{return}}(e.schema);return t?`body matches schema "${iq(t)}"`:"body matches the JSON schema"}case"fields":{let t=e.rows.filter(e=>e.path.trim()).length;return`field mapping (${t} ${1===t?"field":"fields"})`}}}function iq(e){return e.length>40?`${e.slice(0,39)}…`:e}let iC=String.raw`
56
+ function __atcStatusOk(expect, status) {
57
+ var parts = String(expect).split(",");
58
+ for (var i = 0; i < parts.length; i++) {
59
+ var p = parts[i].trim().toLowerCase();
60
+ if (!p) continue;
61
+ var cls = p.match(/^([1-5])xx$/);
62
+ if (cls) { if (Math.floor(status / 100) === Number(cls[1])) return true; continue; }
63
+ var range = p.match(/^(\d{3})\s*-\s*(\d{3})$/);
64
+ if (range) { if (status >= Number(range[1]) && status <= Number(range[2])) return true; continue; }
65
+ if (/^\d{3}$/.test(p) && Number(p) === status) return true;
66
+ }
67
+ return false;
68
+ }
69
+ // An XML answer (SOAP, older SAP and NetSuite APIs) as the same kind of tree a JSON answer gives,
70
+ // so paths, checks, saved values and field mapping read both: <soap:Envelope><soap:Body>
71
+ // <GetEmployeeResponse><Employee><FirstName>Ana</FirstName>… is Envelope.Body.GetEmployeeResponse
72
+ // .Employee.FirstName. Prefixes are dropped; an element seen twice is a list (Item[1]); attributes
73
+ // are "@name"; an element with attributes keeps its text as "#text"; xsi:nil="true" is null.
74
+ function __atcXmlText(s) {
75
+ return s.replace(/&(#x[0-9a-fA-F]+|#\d+|amp|lt|gt|quot|apos);/g, function (all, e) {
76
+ if (e.charAt(0) === "#") return String.fromCharCode(e.charAt(1) === "x" || e.charAt(1) === "X" ? parseInt(e.slice(2), 16) : Number(e.slice(1)));
77
+ return { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'" }[e];
78
+ });
79
+ }
80
+ function __atcXmlTree(xml) {
81
+ var local = function (n) { return n.slice(n.indexOf(":") + 1); };
82
+ var root = { kids: [], attrs: {}, text: "" };
83
+ var stack = [root];
84
+ var i = 0;
85
+ while (i < xml.length) {
86
+ var lt = xml.indexOf("<", i);
87
+ var top = stack[stack.length - 1];
88
+ if (lt < 0) break;
89
+ if (lt > i) top.text += __atcXmlText(xml.slice(i, lt));
90
+ if (xml.substr(lt, 9) === "<![CDATA[") {
91
+ var cend = xml.indexOf("]]>", lt + 9);
92
+ if (cend < 0) throw new Error("bad xml");
93
+ top.text += xml.slice(lt + 9, cend);
94
+ i = cend + 3;
95
+ continue;
96
+ }
97
+ if (xml.substr(lt, 4) === "<!--") { var c = xml.indexOf("-->", lt + 4); i = c < 0 ? xml.length : c + 3; continue; }
98
+ var gt = lt + 1, quote = "";
99
+ for (; gt < xml.length; gt++) {
100
+ var ch = xml.charAt(gt);
101
+ if (quote) { if (ch === quote) quote = ""; } else if (ch === '"' || ch === "'") quote = ch; else if (ch === ">") break;
102
+ }
103
+ if (gt >= xml.length) throw new Error("bad xml");
104
+ var body = xml.slice(lt + 1, gt);
105
+ i = gt + 1;
106
+ var first = body.charAt(0);
107
+ if (first === "?" || first === "!") continue;
108
+ if (first === "/") {
109
+ if (stack.length < 2 || stack[stack.length - 1].name !== local(body.slice(1).replace(/\s+$/, ""))) throw new Error("bad xml");
110
+ stack.pop();
111
+ continue;
112
+ }
113
+ var self = body.charAt(body.length - 1) === "/";
114
+ var inner = self ? body.slice(0, -1) : body;
115
+ var nameEnd = inner.search(/\s|$/);
116
+ var node = { name: local(inner.slice(0, nameEnd)), kids: [], attrs: {}, text: "" };
117
+ var re = /([^\s=]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g, m;
118
+ var rest = inner.slice(nameEnd);
119
+ while ((m = re.exec(rest)) !== null) node.attrs[m[1]] = __atcXmlText(m[2] !== undefined ? m[2] : m[3]);
120
+ top.kids.push(node);
121
+ if (!self) stack.push(node);
122
+ }
123
+ if (stack.length > 1 || root.kids.length !== 1) throw new Error("bad xml");
124
+ var value = function (n) {
125
+ var out = {}, any = false, k, many = {};
126
+ for (k in n.attrs) {
127
+ if (k === "xmlns" || k.indexOf("xmlns:") === 0) continue;
128
+ if (local(k) === "nil" && n.attrs[k] === "true") return null;
129
+ if (k.indexOf(":") >= 0 && local(k) === "type") continue;
130
+ out["@" + local(k)] = n.attrs[k];
131
+ any = true;
132
+ }
133
+ if (!n.kids.length && !any) return n.text;
134
+ for (var j = 0; j < n.kids.length; j++) {
135
+ var kid = n.kids[j], v = value(kid);
136
+ if (!Object.prototype.hasOwnProperty.call(out, kid.name)) out[kid.name] = v;
137
+ else if (many[kid.name]) out[kid.name].push(v);
138
+ else { out[kid.name] = [out[kid.name], v]; many[kid.name] = true; }
139
+ }
140
+ if (n.text.replace(/\s+/g, "")) out["#text"] = n.kids.length ? n.text.replace(/^\s+|\s+$/g, "") : n.text;
141
+ return out;
142
+ };
143
+ var tree = {};
144
+ tree[root.kids[0].name] = value(root.kids[0]);
145
+ return tree;
146
+ }
147
+ // The answer as a tree: JSON, or XML when it starts with "<". Throws when it is neither.
148
+ function __atcParseBody(body) {
149
+ try { return JSON.parse(body); } catch (e) {
150
+ if (/^\s*</.test(body)) return __atcXmlTree(body);
151
+ throw e;
152
+ }
153
+ }
154
+ function __atcJsonGet(root, path) {
155
+ var text = String(path).trim().replace(/^\$\.?/, "");
156
+ if (!text) return { found: true, value: root };
157
+ var tokens = [];
158
+ var re = /([^.\[\]]+)|\[(\d+)\]/g;
159
+ var m;
160
+ while ((m = re.exec(text)) !== null) tokens.push(m[1] !== undefined ? m[1] : Number(m[2]));
161
+ var cur = root;
162
+ for (var i = 0; i < tokens.length; i++) {
163
+ // [0] on one element means that element (in XML, a single Item is not a list).
164
+ if (tokens[i] === 0 && cur !== null && typeof cur === "object" && Object.prototype.toString.call(cur) !== "[object Array]") continue;
165
+ if (cur === null || typeof cur !== "object" || !(tokens[i] in cur)) return { found: false, value: undefined };
166
+ cur = cur[tokens[i]];
167
+ }
168
+ return { found: true, value: cur };
169
+ }
170
+ function __atcAsText(value) {
171
+ if (typeof value === "string") return value;
172
+ if (value === undefined) return "";
173
+ return JSON.stringify(value);
174
+ }
175
+ function __atcTypeOf(value) {
176
+ if (value === null) return "null";
177
+ if (Array.isArray(value)) return "array";
178
+ return typeof value;
179
+ }
180
+ function __atcIsType(value, type) {
181
+ if (type === "integer") return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
182
+ if (type === "number") return typeof value === "number" && isFinite(value);
183
+ return __atcTypeOf(value) === type;
184
+ }
185
+ function __atcMatches(pattern, text) {
186
+ try { return new RegExp(pattern).test(text); } catch (e) { return false; }
187
+ }
188
+ function __atcLengthOk(rule, n) {
189
+ var m = String(rule).match(/^\s*(>=|<=|!=|>|<|=)?\s*(\d+)\s*$/);
190
+ if (!m) return false;
191
+ var want = Number(m[2]);
192
+ var op = m[1] || "=";
193
+ if (op === ">") return n > want;
194
+ if (op === "<") return n < want;
195
+ if (op === ">=") return n >= want;
196
+ if (op === "<=") return n <= want;
197
+ if (op === "!=") return n !== want;
198
+ return n === want;
199
+ }
200
+ function __atcPathText(path) { return path === "" ? "$" : "$" + path; }
201
+ // JSON Schema, the parts APIs use: type (and nullable), enum, const, properties, required,
202
+ // additionalProperties, items, min/max (Length, Items, imum), pattern, allOf/anyOf/oneOf,
203
+ // local $ref. Returns the first problem as "$.items[0].id should be number", or null.
204
+ function __atcSchemaError(schema, value, path, root, depth) {
205
+ if (schema === true || schema === undefined || schema === null) return null;
206
+ if (schema === false) return __atcPathText(path) + " should not be there";
207
+ if (depth > 60) return null;
208
+ if (typeof schema.$ref === "string") {
209
+ var ref = schema.$ref.replace(/^#\/?/, "").split("/");
210
+ var target = root;
211
+ for (var r = 0; r < ref.length && target; r++) if (ref[r]) target = target[ref[r].replace(/~1/g, "/").replace(/~0/g, "~")];
212
+ return target ? __atcSchemaError(target, value, path, root, depth + 1) : null;
213
+ }
214
+ var where = __atcPathText(path);
215
+ if (schema.type !== undefined) {
216
+ var types = Array.isArray(schema.type) ? schema.type : [schema.type];
217
+ if (schema.nullable === true) types = types.concat(["null"]);
218
+ var okType = false;
219
+ for (var t = 0; t < types.length; t++) if (__atcIsType(value, types[t])) okType = true;
220
+ if (!okType) return where + " should be " + types.join(" or ") + " (it is " + __atcTypeOf(value) + ")";
221
+ }
222
+ if (schema.enum && Array.isArray(schema.enum)) {
223
+ var inEnum = false;
224
+ for (var e = 0; e < schema.enum.length; e++) if (JSON.stringify(schema.enum[e]) === JSON.stringify(value)) inEnum = true;
225
+ if (!inEnum) return where + " should be one of " + JSON.stringify(schema.enum);
226
+ }
227
+ if (schema.const !== undefined && JSON.stringify(schema.const) !== JSON.stringify(value)) return where + " should be " + JSON.stringify(schema.const);
228
+ if (typeof value === "string") {
229
+ if (typeof schema.minLength === "number" && value.length < schema.minLength) return where + " should be at least " + schema.minLength + " characters";
230
+ if (typeof schema.maxLength === "number" && value.length > schema.maxLength) return where + " should be at most " + schema.maxLength + " characters";
231
+ if (typeof schema.pattern === "string" && !__atcMatches(schema.pattern, value)) return where + " should match /" + schema.pattern + "/";
232
+ }
233
+ if (typeof value === "number") {
234
+ if (typeof schema.minimum === "number" && value < schema.minimum) return where + " should be at least " + schema.minimum;
235
+ if (typeof schema.maximum === "number" && value > schema.maximum) return where + " should be at most " + schema.maximum;
236
+ if (typeof schema.exclusiveMinimum === "number" && value <= schema.exclusiveMinimum) return where + " should be more than " + schema.exclusiveMinimum;
237
+ if (typeof schema.exclusiveMaximum === "number" && value >= schema.exclusiveMaximum) return where + " should be less than " + schema.exclusiveMaximum;
238
+ }
239
+ if (Array.isArray(value)) {
240
+ if (typeof schema.minItems === "number" && value.length < schema.minItems) return where + " should have at least " + schema.minItems + " items";
241
+ if (typeof schema.maxItems === "number" && value.length > schema.maxItems) return where + " should have at most " + schema.maxItems + " items";
242
+ if (schema.items && typeof schema.items === "object" && !Array.isArray(schema.items)) {
243
+ for (var i = 0; i < value.length; i++) {
244
+ var itemErr = __atcSchemaError(schema.items, value[i], path + "[" + i + "]", root, depth + 1);
245
+ if (itemErr) return itemErr;
246
+ }
247
+ }
248
+ }
249
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
250
+ var req = Array.isArray(schema.required) ? schema.required : [];
251
+ for (var q = 0; q < req.length; q++) if (!Object.prototype.hasOwnProperty.call(value, req[q])) return where + " should have " + req[q];
252
+ var props = schema.properties && typeof schema.properties === "object" ? schema.properties : {};
253
+ for (var key in value) {
254
+ if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
255
+ var sub = path + (/^[A-Za-z_$][\w$]*$/.test(key) ? "." + key : "[" + JSON.stringify(key) + "]");
256
+ if (Object.prototype.hasOwnProperty.call(props, key)) {
257
+ var propErr = __atcSchemaError(props[key], value[key], sub, root, depth + 1);
258
+ if (propErr) return propErr;
259
+ } else if (schema.additionalProperties === false) {
260
+ return __atcPathText(sub) + " is not expected";
261
+ } else if (schema.additionalProperties && typeof schema.additionalProperties === "object") {
262
+ var addErr = __atcSchemaError(schema.additionalProperties, value[key], sub, root, depth + 1);
263
+ if (addErr) return addErr;
264
+ }
265
+ }
266
+ }
267
+ if (Array.isArray(schema.allOf)) {
268
+ for (var a = 0; a < schema.allOf.length; a++) {
269
+ var allErr = __atcSchemaError(schema.allOf[a], value, path, root, depth + 1);
270
+ if (allErr) return allErr;
271
+ }
272
+ }
273
+ var some = schema.anyOf || schema.oneOf;
274
+ if (Array.isArray(some) && some.length) {
275
+ var first = null;
276
+ var matched = 0;
277
+ for (var s = 0; s < some.length; s++) {
278
+ var someErr = __atcSchemaError(some[s], value, path, root, depth + 1);
279
+ if (!someErr) matched++;
280
+ else if (!first) first = someErr;
281
+ }
282
+ if (!matched) return first;
283
+ if (schema.oneOf && matched > 1) return where + " matches more than one of oneOf";
284
+ }
285
+ return null;
286
+ }
287
+ function __atcParsedSchema(check) {
288
+ if (check.__parsed === undefined) {
289
+ try { check.__parsed = JSON.parse(check.schema); } catch (e) { check.__parsed = null; }
290
+ }
291
+ return check.__parsed;
292
+ }
293
+ // Field mapping. A date as the same calendar day: ISO, /Date(ms)/ (SAP OData v2), epoch ms,
294
+ // 31.01.2024 (day first, with dots) or 1/31/2024 (month first, with slashes).
295
+ function __atcDay(v) {
296
+ var s = String(v).trim();
297
+ var m = /^\/Date\((-?\d+)(?:[+-]\d+)?\)\/$/.exec(s);
298
+ var d = null;
299
+ if (m) d = new Date(Number(m[1]));
300
+ else if (/^-?\d{11,}$/.test(s)) d = new Date(Number(s));
301
+ else if ((m = /^(\d{1,2})\.(\d{1,2})\.(\d{4})$/.exec(s))) d = new Date(Date.UTC(Number(m[3]), Number(m[2]) - 1, Number(m[1])));
302
+ else if ((m = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(s))) d = new Date(Date.UTC(Number(m[3]), Number(m[1]) - 1, Number(m[2])));
303
+ else if ((m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s))) d = new Date(Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3])));
304
+ else if (s) d = new Date(s);
305
+ return d && !isNaN(d.getTime()) ? d.toISOString().slice(0, 10) : null;
306
+ }
307
+ function __atcMapped(map, v) {
308
+ var pairs = String(map || "").split(/[,\n]/);
309
+ for (var i = 0; i < pairs.length; i++) {
310
+ var at = pairs[i].indexOf("=");
311
+ if (at > 0 && pairs[i].slice(0, at).trim() === String(v).trim()) return pairs[i].slice(at + 1).trim();
312
+ }
313
+ return v;
314
+ }
315
+ // { ok, got, want, why } for one row; got/want as shown to people.
316
+ function __atcFieldRow(parsed, row) {
317
+ var hit = __atcJsonGet(parsed, row.path);
318
+ var want = __atcMapped(row.map, row.value);
319
+ if (/\{\{\s*[A-Za-z_][\w.-]*\s*\}\}/.test(want)) return { ok: false, want: want, why: "no value" };
320
+ if (!hit.found) return { ok: false, want: want, why: "not found" };
321
+ var got = hit.value === null ? "" : __atcAsText(hit.value);
322
+ var ok;
323
+ if (row.as === "loose") ok = got.replace(/\s+/g, " ").trim().toLowerCase() === String(want).replace(/\s+/g, " ").trim().toLowerCase();
324
+ else if (row.as === "number") ok = String(got).trim() !== "" && String(want).trim() !== "" && isFinite(Number(got)) && Math.abs(Number(got) - Number(want)) < 1e-9;
325
+ else if (row.as === "date") { var a = __atcDay(got); ok = a !== null && a === __atcDay(want); }
326
+ else ok = got === want;
327
+ return { ok: ok, got: got, want: want };
328
+ }
329
+ function __atcCheck(check, res) {
330
+ if (check.type === "status") return __atcStatusOk(check.expect, res.status);
331
+ if (check.type === "time") return res.durationMs <= check.maxMs;
332
+ if (check.type === "header") {
333
+ var h = res.headers[String(check.name).toLowerCase()];
334
+ if (check.op === "exists") return h !== undefined;
335
+ if (check.op === "not_exists") return h === undefined;
336
+ if (h === undefined) return false;
337
+ if (check.op === "matches") return __atcMatches(check.value, h);
338
+ return check.op === "equals" ? h === check.value : h.indexOf(check.value) >= 0;
339
+ }
340
+ if (res.body === null || res.body === undefined) return false;
341
+ if (check.type === "body") {
342
+ if (check.op === "is_json") { try { JSON.parse(res.body); return true; } catch (e) { return false; } }
343
+ if (check.op === "matches") return __atcMatches(check.value, res.body);
344
+ var has = res.body.indexOf(check.value) >= 0;
345
+ return check.op === "contains" ? has : !has;
346
+ }
347
+ var parsed;
348
+ try { parsed = check.type === "schema" ? JSON.parse(res.body) : __atcParseBody(res.body); } catch (e) { return false; }
349
+ if (check.type === "fields") {
350
+ var rows = check.rows || [];
351
+ for (var r = 0; r < rows.length; r++) if (String(rows[r].path).trim() && !__atcFieldRow(parsed, rows[r]).ok) return false;
352
+ return true;
353
+ }
354
+ if (check.type === "schema") {
355
+ var schema = __atcParsedSchema(check);
356
+ return schema !== null && __atcSchemaError(schema, parsed, "", schema, 0) === null;
357
+ }
358
+ if (check.type === "json") {
359
+ var got = __atcJsonGet(parsed, check.path);
360
+ if (check.op === "exists") return got.found;
361
+ if (check.op === "not_exists") return !got.found;
362
+ if (!got.found) return check.op === "not_equals";
363
+ if (check.op === "type") return __atcIsType(got.value, String(check.value).trim().toLowerCase());
364
+ if (check.op === "length") {
365
+ var v = got.value;
366
+ var n = typeof v === "string" || Array.isArray(v) ? v.length : v !== null && typeof v === "object" ? Object.keys(v).length : -1;
367
+ return n >= 0 && __atcLengthOk(check.value, n);
368
+ }
369
+ if (check.op === "greater" || check.op === "less") {
370
+ var num = Number(got.value);
371
+ var lim = Number(check.value);
372
+ if (got.value === null || got.value === "" || typeof got.value === "boolean" || !isFinite(num) || String(check.value).trim() === "" || !isFinite(lim)) return false;
373
+ return check.op === "greater" ? num > lim : num < lim;
374
+ }
375
+ var text = __atcAsText(got.value);
376
+ if (check.op === "matches") return __atcMatches(check.value, text);
377
+ if (check.op === "equals") return text === check.value;
378
+ if (check.op === "not_equals") return text !== check.value;
379
+ return text.indexOf(check.value) >= 0;
380
+ }
381
+ return false;
382
+ }
383
+ `,iz=null,iP=["expect","path","name","value"];function iR(e,t){return e.map(e=>{if("fields"===e.type)return{...e,rows:e.rows.map(e=>e.value.includes("{{")?{...e,value:t(e.value)}:e)};let r={...e};for(let e of iP)"string"==typeof r[e]&&r[e].includes("{{")&&(r[e]=t(r[e]));return r})}e.s(["Q",0,{text:"Exact",loose:"Ignore case",number:"Number",date:"Same day"},"t",0,["string","number","integer","boolean","array","object","null"],"w",0,iI,"A",0,iR,"k",0,function(e){return(iz??=Function(`${iC}
384
+ return { check: __atcCheck, schemaError: __atcSchemaError, jsonGet: __atcJsonGet, fieldRow: __atcFieldRow, parseBody: __atcParseBody };`)()).parseBody(e)},"U",0,iN,"s",0,function(e){return{$schema:"http://json-schema.org/draft-07/schema#",...function e(t,r){if(r>30)return{};if(null===t)return{type:"null"};if(Array.isArray(t)){let n=t.slice(0,50).map(t=>e(t,r+1));return n.length?{type:"array",items:n.reduce(function e(t,r){let n=e=>Array.isArray(e.type)?e.type:e.type?[e.type]:[],s=[...new Set([...n(t),...n(r)])];s.includes("integer")&&s.includes("number")&&(s=s.filter(e=>"integer"!==e));let a={type:1===s.length?s[0]:s};if(t.properties||r.properties){let n=t.properties??{},s=r.properties??{},i=[...new Set([...Object.keys(n),...Object.keys(s)])];a.properties=Object.fromEntries(i.map(t=>[t,n[t]&&s[t]?e(n[t],s[t]):n[t]??s[t]]));let o=new Set(t.required??(t.properties?[]:Object.keys(s))),l=new Set(r.required??(r.properties?[]:Object.keys(n)));a.required=i.filter(e=>o.has(e)&&l.has(e))}return(t.items||r.items)&&(a.items=t.items&&r.items?e(t.items,r.items):t.items??r.items),a})}:{type:"array"}}if("object"==typeof t){let n=Object.entries(t);return{type:"object",properties:Object.fromEntries(n.map(([t,n])=>[t,e(n,r+1)])),required:n.map(([e])=>e)}}return"number"==typeof t?{type:"number"}:{type:typeof t}}(e,0)}}],70632);var iE=i_,iO=i_,iA=i_,ij=i_,i_=i_,iT=i_,iL=i_,iM=i_,iU=i_,iF=i_;function iD(e){let t=new Set;for(let r of e.matchAll(/(?:pm\.(?:environment|variables|collectionVariables|globals)\.set|postman\.set(?:Environment|Global)Variable)\(\s*(["'`])([A-Za-z_][\w.-]*)\1/g))t.add(r[2]);return[...t]}String.raw`
385
+ function __atcScriptText(v) {
386
+ if (typeof v === "string") return v;
387
+ if (v === undefined) return "undefined";
388
+ try { return JSON.stringify(v); } catch (e) { return String(v); }
389
+ }
390
+ function __atcDeepEqual(a, b) {
391
+ if (a === b) return true;
392
+ if (typeof a !== typeof b || a === null || b === null || typeof a !== "object") return a !== a && b !== b;
393
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
394
+ var ka = Object.keys(a), kb = Object.keys(b);
395
+ if (ka.length !== kb.length) return false;
396
+ for (var i = 0; i < ka.length; i++) if (!__atcDeepEqual(a[ka[i]], b[ka[i]])) return false;
397
+ return true;
398
+ }
399
+ function __atcTypeName(v) {
400
+ if (v === null) return "null";
401
+ if (Array.isArray(v)) return "array";
402
+ if (v instanceof RegExp) return "regexp";
403
+ return typeof v;
404
+ }
405
+ function __atcExpect(actual) {
406
+ var flags = { not: false, deep: false };
407
+ var self = {};
408
+ function check(ok, message, negMessage) {
409
+ if (flags.not ? ok : !ok) throw new Error(flags.not ? negMessage : message);
410
+ return self;
411
+ }
412
+ // Long values (a whole response) are cut, so the message stays readable.
413
+ var show = function (v) { var t = __atcScriptText(v); return t.length > 120 ? t.slice(0, 119) + "…" : t; };
414
+ var chain = ["to", "be", "been", "is", "that", "which", "and", "has", "have", "with", "at", "of", "same", "but", "does", "still"];
415
+ for (var c = 0; c < chain.length; c++) Object.defineProperty(self, chain[c], { get: function () { return self; } });
416
+ Object.defineProperty(self, "not", { get: function () { flags.not = !flags.not; return self; } });
417
+ Object.defineProperty(self, "deep", { get: function () { flags.deep = true; return self; } });
418
+ var props = {
419
+ ok: function () { return check(!!actual, "expected " + show(actual) + " to be truthy", "expected " + show(actual) + " to be falsy"); },
420
+ true: function () { return check(actual === true, "expected " + show(actual) + " to be true", "expected " + show(actual) + " not to be true"); },
421
+ false: function () { return check(actual === false, "expected " + show(actual) + " to be false", "expected " + show(actual) + " not to be false"); },
422
+ null: function () { return check(actual === null, "expected " + show(actual) + " to be null", "expected value not to be null"); },
423
+ undefined: function () { return check(actual === undefined, "expected " + show(actual) + " to be undefined", "expected value not to be undefined"); },
424
+ exist: function () { return check(actual !== null && actual !== undefined, "expected value to exist", "expected " + show(actual) + " not to exist"); },
425
+ empty: function () {
426
+ var n = typeof actual === "string" || Array.isArray(actual) ? actual.length : actual && typeof actual === "object" ? Object.keys(actual).length : -1;
427
+ return check(n === 0, "expected " + show(actual) + " to be empty", "expected " + show(actual) + " not to be empty");
428
+ },
429
+ NaN: function () { return check(actual !== actual, "expected " + show(actual) + " to be NaN", "expected value not to be NaN"); }
430
+ };
431
+ for (var p in props) (function (name, fn) { Object.defineProperty(self, name, { get: fn }); })(p, props[p]);
432
+ self.equal = self.equals = self.eq = function (v) {
433
+ var ok = flags.deep ? __atcDeepEqual(actual, v) : actual === v;
434
+ return check(ok, "expected " + show(actual) + " to equal " + show(v), "expected " + show(actual) + " not to equal " + show(v));
435
+ };
436
+ self.eql = self.eqls = function (v) { return check(__atcDeepEqual(actual, v), "expected " + show(actual) + " to deeply equal " + show(v), "expected " + show(actual) + " not to deeply equal " + show(v)); };
437
+ self.above = self.gt = self.greaterThan = function (n) { return check(actual > n, "expected " + show(actual) + " to be above " + n, "expected " + show(actual) + " to be at most " + n); };
438
+ self.below = self.lt = self.lessThan = function (n) { return check(actual < n, "expected " + show(actual) + " to be below " + n, "expected " + show(actual) + " to be at least " + n); };
439
+ self.least = self.gte = function (n) { return check(actual >= n, "expected " + show(actual) + " to be at least " + n, "expected " + show(actual) + " to be below " + n); };
440
+ self.most = self.lte = function (n) { return check(actual <= n, "expected " + show(actual) + " to be at most " + n, "expected " + show(actual) + " to be above " + n); };
441
+ self.within = function (a, b) { return check(actual >= a && actual <= b, "expected " + show(actual) + " to be within " + a + ".." + b, "expected " + show(actual) + " not to be within " + a + ".." + b); };
442
+ self.a = self.an = function (type) {
443
+ var t = String(type).toLowerCase();
444
+ return check(__atcTypeName(actual) === t, "expected " + show(actual) + " to be " + (/^[aeiou]/.test(t) ? "an " : "a ") + t, "expected " + show(actual) + " not to be " + (/^[aeiou]/.test(t) ? "an " : "a ") + t);
445
+ };
446
+ self.include = self.includes = self.contain = self.contains = function (v) {
447
+ var ok;
448
+ if (typeof actual === "string") ok = actual.indexOf(String(v)) >= 0;
449
+ else if (Array.isArray(actual)) { ok = false; for (var i = 0; i < actual.length; i++) if (flags.deep ? __atcDeepEqual(actual[i], v) : actual[i] === v) ok = true; }
450
+ else if (actual && typeof actual === "object" && v && typeof v === "object") { ok = true; for (var k in v) if (!__atcDeepEqual(actual[k], v[k])) ok = false; }
451
+ else ok = false;
452
+ return check(ok, "expected " + show(actual) + " to include " + show(v), "expected " + show(actual) + " not to include " + show(v));
453
+ };
454
+ self.property = function (name, value) {
455
+ var has = actual !== null && actual !== undefined && typeof actual === "object" && name in actual;
456
+ if (arguments.length < 2) return check(has, "expected " + show(actual) + " to have property " + name, "expected " + show(actual) + " not to have property " + name);
457
+ return check(has && __atcDeepEqual(actual[name], value), "expected property " + name + " to be " + show(value) + " (it is " + show(has ? actual[name] : undefined) + ")", "expected property " + name + " not to be " + show(value));
458
+ };
459
+ self.lengthOf = self.length = function (n) {
460
+ var len = actual === null || actual === undefined ? undefined : actual.length;
461
+ return check(len === n, "expected length " + n + " (it is " + len + ")", "expected length not to be " + n);
462
+ };
463
+ self.match = self.matches = function (re) { return check(re instanceof RegExp ? re.test(String(actual)) : new RegExp(re).test(String(actual)), "expected " + show(actual) + " to match " + re, "expected " + show(actual) + " not to match " + re); };
464
+ self.oneOf = function (list) { var ok = false; for (var i = 0; i < list.length; i++) if (__atcDeepEqual(list[i], actual)) ok = true; return check(ok, "expected " + show(actual) + " to be one of " + show(list), "expected " + show(actual) + " not to be one of " + show(list)); };
465
+ self.keys = self.key = function () {
466
+ var want = arguments.length === 1 && Array.isArray(arguments[0]) ? arguments[0] : Array.prototype.slice.call(arguments);
467
+ var ok = actual && typeof actual === "object";
468
+ for (var i = 0; ok && i < want.length; i++) if (!(want[i] in actual)) ok = false;
469
+ return check(!!ok, "expected " + show(actual) + " to have keys " + show(want), "expected " + show(actual) + " not to have keys " + show(want));
470
+ };
471
+ self.status = function (code) { return check(actual && actual.code === code, "expected status " + code + " (it is " + (actual && actual.code) + ")", "expected status not to be " + code); };
472
+ return self;
473
+ }
474
+ function __atcScriptStart(fn, input, host) {
475
+ var out = { request: input.request, set: {}, unset: [], tests: [], logs: [] };
476
+ var vars = {};
477
+ for (var k in input.vars) vars[k] = input.vars[k];
478
+ function log() {
479
+ if (out.logs.length >= 200) return;
480
+ var parts = [];
481
+ for (var i = 0; i < arguments.length; i++) parts.push(__atcScriptText(arguments[i]));
482
+ out.logs.push(parts.join(" ").slice(0, 2000));
483
+ }
484
+ var store = {
485
+ get: function (name) { return Object.prototype.hasOwnProperty.call(vars, name) ? vars[name] : undefined; },
486
+ has: function (name) { return Object.prototype.hasOwnProperty.call(vars, name); },
487
+ set: function (name, value) {
488
+ var v = typeof value === "string" ? value : __atcScriptText(value);
489
+ vars[name] = v; out.set[name] = v;
490
+ var i = out.unset.indexOf(name); if (i >= 0) out.unset.splice(i, 1);
491
+ },
492
+ unset: function (name) { delete vars[name]; delete out.set[name]; if (out.unset.indexOf(name) < 0) out.unset.push(name); },
493
+ toObject: function () { var o = {}; for (var k in vars) o[k] = vars[k]; return o; },
494
+ replaceIn: function (text) { return String(text).replace(/\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/g, function (w, n) { return Object.prototype.hasOwnProperty.call(vars, n) ? vars[n] : w; }); }
495
+ };
496
+ function headerList(list, editable) {
497
+ var find = function (name) { for (var i = 0; i < list.length; i++) if (list[i][0].toLowerCase() === String(name).toLowerCase()) return i; return -1; };
498
+ var api = {
499
+ get: function (name) { var i = find(name); return i < 0 ? undefined : list[i][1]; },
500
+ has: function (name) { return find(name) >= 0; },
501
+ toObject: function () { var o = {}; for (var i = 0; i < list.length; i++) o[list[i][0]] = list[i][1]; return o; },
502
+ all: function () { var a = []; for (var i = 0; i < list.length; i++) a.push({ key: list[i][0], value: list[i][1] }); return a; },
503
+ each: function (cb) { for (var i = 0; i < list.length; i++) cb({ key: list[i][0], value: list[i][1] }); },
504
+ count: function () { return list.length; }
505
+ };
506
+ if (editable) {
507
+ api.add = function (h) { if (h && h.key) list.push([String(h.key), String(h.value === undefined ? "" : h.value)]); };
508
+ api.upsert = function (h) { if (!h || !h.key) return; var i = find(h.key); if (i < 0) list.push([String(h.key), String(h.value === undefined ? "" : h.value)]); else list[i][1] = String(h.value === undefined ? "" : h.value); };
509
+ api.remove = function (name) { var i = find(name); while (i >= 0) { list.splice(i, 1); i = find(name); } };
510
+ }
511
+ return api;
512
+ }
513
+ var req = out.request;
514
+ var request = {
515
+ get method() { return req.method; },
516
+ set method(v) { req.method = String(v).toUpperCase(); },
517
+ url: {
518
+ toString: function () { return req.url; },
519
+ update: function (v) { req.url = String(v); },
520
+ getHost: function () { var m = /^[a-z]+:\/\/([^/:?#]+)/i.exec(req.url); return m ? m[1] : ""; },
521
+ getPath: function () { var m = /^[a-z]+:\/\/[^/?#]*([^?#]*)/i.exec(req.url); return m ? m[1] || "/" : ""; }
522
+ },
523
+ headers: headerList(req.headers, input.phase === "pre"),
524
+ body: {
525
+ get raw() { return req.body === undefined ? "" : req.body; },
526
+ set raw(v) { req.body = String(v); },
527
+ update: function (v) { req.body = typeof v === "string" ? v : __atcScriptText(v); },
528
+ toString: function () { return req.body === undefined ? "" : req.body; }
529
+ },
530
+ addHeader: function (h) { request.headers.add ? request.headers.add(h) : null; },
531
+ removeHeader: function (name) { request.headers.remove ? request.headers.remove(name) : null; }
532
+ };
533
+ function makeResponse(r) {
534
+ var rh = [];
535
+ for (var hk in r.headers) rh.push([hk, r.headers[hk]]);
536
+ var parsed;
537
+ var response = {
538
+ code: r.code,
539
+ status: String(r.code),
540
+ responseTime: r.responseTime,
541
+ responseSize: r.body.length,
542
+ headers: headerList(rh, false),
543
+ text: function () { return r.body; },
544
+ json: function () { if (parsed === undefined) parsed = JSON.parse(r.body); return parsed; }
545
+ };
546
+ var to = {};
547
+ var be = {
548
+ get ok() { if (!(r.code >= 200 && r.code < 300)) throw new Error("expected a 2xx status (it is " + r.code + ")"); return true; },
549
+ get success() { return be.ok; },
550
+ get json() { try { JSON.parse(r.body); } catch (e) { throw new Error("expected the body to be JSON"); } return true; },
551
+ get notFound() { if (r.code !== 404) throw new Error("expected status 404 (it is " + r.code + ")"); return true; },
552
+ get error() { if (r.code < 400) throw new Error("expected a 4xx or 5xx status (it is " + r.code + ")"); return true; }
553
+ };
554
+ to.be = be;
555
+ to.have = {
556
+ status: function (code) {
557
+ if (typeof code === "number" ? r.code !== code : false) throw new Error("expected status " + code + " (it is " + r.code + ")");
558
+ return true;
559
+ },
560
+ header: function (name, value) {
561
+ var v = response.headers.get(name);
562
+ if (v === undefined) throw new Error("expected header " + name);
563
+ if (arguments.length > 1 && v !== String(value)) throw new Error("expected header " + name + " to be " + value + " (it is " + v + ")");
564
+ return true;
565
+ },
566
+ body: function (text) { if (r.body.indexOf(String(text)) < 0) throw new Error("expected the body to contain " + text); return true; },
567
+ jsonBody: function (path) { var o = response.json(); if (arguments.length && !(path in o)) throw new Error("expected the JSON body to have " + path); return true; }
568
+ };
569
+ to.not = { have: { status: function (code) { if (r.code === code) throw new Error("expected status not to be " + code); return true; } } };
570
+ response.to = to;
571
+ return response;
572
+ }
573
+ var response = input.response ? makeResponse(input.response) : undefined;
574
+ var legacyTests = {};
575
+ var state = { out: out, done: false, bodyDone: false, pending: 0, sends: 0, listeners: [] };
576
+ function fail(e) { if (!out.error) out.error = String(e && e.message || e).slice(0, 500); }
577
+ // Finished when the script body has run (an async one: settled) and nothing is outstanding.
578
+ function settle() {
579
+ if (state.done || !state.bodyDone || state.pending > 0) return;
580
+ state.done = true;
581
+ for (var t in legacyTests) out.tests.push({ name: t, ok: !!legacyTests[t] });
582
+ for (var i = 0; i < state.listeners.length; i++) state.listeners[i](out);
583
+ }
584
+ // pm.sendRequest(url | { url, method, header, body }, callback?) — Postman's, both styles.
585
+ function normRequest(req) {
586
+ if (typeof req === "string") return { method: "GET", url: store.replaceIn(req), headers: {} };
587
+ if (!req || typeof req !== "object") throw new Error("pm.sendRequest needs an address or { url, method, header, body }");
588
+ var url = typeof req.url === "string" ? req.url : req.url && typeof req.url.raw === "string" ? req.url.raw : req.url && req.url.toString ? req.url.toString() : "";
589
+ if (!url) throw new Error("pm.sendRequest: the request has no url");
590
+ var headers = {};
591
+ var h = req.header !== undefined ? req.header : req.headers;
592
+ if (Array.isArray(h)) { for (var i = 0; i < h.length; i++) if (h[i] && h[i].key && !h[i].disabled) headers[h[i].key] = store.replaceIn(String(h[i].value === undefined ? "" : h[i].value)); }
593
+ else if (typeof h === "string") { var lines = h.split(/\r?\n/); for (var l = 0; l < lines.length; l++) { var c = lines[l].indexOf(":"); if (c > 0) headers[lines[l].slice(0, c).trim()] = store.replaceIn(lines[l].slice(c + 1).trim()); } }
594
+ else if (h && typeof h === "object") { for (var k in h) headers[k] = store.replaceIn(String(h[k])); }
595
+ var hasType = function () { for (var n in headers) if (n.toLowerCase() === "content-type") return true; return false; };
596
+ var body;
597
+ var b = req.body;
598
+ if (typeof b === "string") body = b;
599
+ else if (b && typeof b === "object") {
600
+ if (b.mode === "raw" || (b.mode === undefined && typeof b.raw === "string")) body = String(b.raw === undefined ? "" : b.raw);
601
+ else if (b.mode === "urlencoded" || b.mode === "formdata") {
602
+ var pairs = Array.isArray(b[b.mode]) ? b[b.mode] : [];
603
+ var parts = [];
604
+ for (var q = 0; q < pairs.length; q++) if (pairs[q] && pairs[q].key && !pairs[q].disabled && pairs[q].type !== "file") parts.push(encodeURIComponent(pairs[q].key) + "=" + encodeURIComponent(store.replaceIn(String(pairs[q].value === undefined ? "" : pairs[q].value))));
605
+ body = parts.join("&");
606
+ if (!hasType()) headers["Content-Type"] = "application/x-www-form-urlencoded";
607
+ } else if (b.mode === "graphql" && b.graphql) {
608
+ body = JSON.stringify({ query: b.graphql.query, variables: typeof b.graphql.variables === "string" ? JSON.parse(b.graphql.variables || "{}") : b.graphql.variables || {} });
609
+ if (!hasType()) headers["Content-Type"] = "application/json";
610
+ }
611
+ if (body !== undefined) body = store.replaceIn(body);
612
+ }
613
+ return { method: String(req.method || "GET").toUpperCase(), url: store.replaceIn(url), headers: headers, body: body };
614
+ }
615
+ function sendRequest(req, cb) {
616
+ if (!host || typeof host.send !== "function") throw new Error("pm.sendRequest isn't available here");
617
+ if (++state.sends > 20) throw new Error("A script can make at most 20 requests with pm.sendRequest");
618
+ var norm = normRequest(req);
619
+ state.pending++;
620
+ return new Promise(function (resolve, reject) {
621
+ host.send(norm, function (err, raw) {
622
+ var res = raw ? makeResponse(raw) : undefined;
623
+ var e = err ? new Error(String(err)) : null;
624
+ if (typeof cb === "function") {
625
+ try { cb(e, res); } catch (x) { fail(x); }
626
+ resolve(res);
627
+ } else if (e) reject(e);
628
+ else resolve(res);
629
+ state.pending--;
630
+ settle();
631
+ });
632
+ });
633
+ }
634
+ var pm = {
635
+ environment: store, variables: store, collectionVariables: store, globals: store,
636
+ iterationData: { get: store.get, has: store.has, toObject: store.toObject },
637
+ request: request,
638
+ response: response,
639
+ info: { requestName: input.name, iteration: input.iteration, eventName: input.phase === "pre" ? "prerequest" : "test" },
640
+ test: function (name, f) {
641
+ var at = out.tests.length;
642
+ var bad = function (e) { out.tests[at] = { name: String(name), ok: false, error: String(e && e.message || e).slice(0, 300) }; };
643
+ out.tests.push({ name: String(name), ok: true });
644
+ try {
645
+ var ret = f();
646
+ // An async test (it awaits pm.sendRequest, say) counts when it settles.
647
+ if (ret && typeof ret.then === "function") {
648
+ state.pending++;
649
+ ret.then(function () { state.pending--; settle(); }, function (e) { bad(e); state.pending--; settle(); });
650
+ }
651
+ } catch (e) { bad(e); }
652
+ },
653
+ expect: __atcExpect,
654
+ sendRequest: sendRequest,
655
+ require: function (name) { throw new Error("require(\"" + name + "\") isn't available in scripts"); }
656
+ };
657
+ pm.test.skip = function (name) { out.tests.push({ name: String(name) + " (skipped)", ok: true }); };
658
+ var con = { log: log, info: log, warn: log, error: log, debug: log };
659
+ var postman = {
660
+ setEnvironmentVariable: store.set, getEnvironmentVariable: store.get, clearEnvironmentVariable: store.unset,
661
+ setGlobalVariable: store.set, getGlobalVariable: store.get, clearGlobalVariable: store.unset
662
+ };
663
+ var r0 = input.response;
664
+ try {
665
+ var ret = fn(pm, con, postman, legacyTests,
666
+ r0 ? r0.body : undefined, r0 ? { code: r0.code } : undefined, r0 ? r0.responseTime : undefined, r0 ? r0.headers : undefined,
667
+ store.toObject(), store.toObject());
668
+ if (ret && typeof ret.then === "function") ret.then(function () { state.bodyDone = true; settle(); }, function (e) { fail(e); state.bodyDone = true; settle(); });
669
+ else state.bodyDone = true;
670
+ } catch (e) {
671
+ fail(e);
672
+ state.bodyDone = true;
673
+ }
674
+ // Old-style tests["name"] = true are added in settle().
675
+ settle();
676
+ return state;
677
+ }
678
+ /** Run to the end when nothing is asynchronous (tests, and sendRequest answered at once). */
679
+ function __atcScriptRun(fn, input, host) {
680
+ return __atcScriptStart(fn, input, host).out;
681
+ }
682
+ /** Run, and resolve when the script and every pm.sendRequest it made have finished. */
683
+ function __atcScriptRunAsync(fn, input, host) {
684
+ var st = __atcScriptStart(fn, input, host);
685
+ if (st.done) return Promise.resolve(st.out);
686
+ return new Promise(function (resolve) { st.listeners.push(resolve); });
687
+ }
688
+ `,String.raw`
689
+ function __atcScriptCompile(code) {
690
+ var params = ["pm", "console", "postman", "tests", "responseBody", "responseCode", "responseTime", "responseHeaders", "environment", "globals"];
691
+ // A script that awaits (const res = await pm.sendRequest(…)) runs as an async function.
692
+ if (/\bawait\b/.test(code)) {
693
+ var AsyncFunction = Object.getPrototypeOf(async function () {}).constructor;
694
+ return AsyncFunction.apply(null, params.concat([code]));
695
+ }
696
+ return Function.apply(null, params.concat([code]));
697
+ }
698
+ `,e.s(["b",0,1e5,"$",0,iD],15487);let iB=iE.enum(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),iK=iO.string().regex(/^\d+(\.\d+)?(ms|s|m|h)$/,"Use a duration like 30s, 5m, or 1h"),iZ=iO.string().min(1).refine(e=>!/^authorization$/i.test(e)&&!/^cookie$/i.test(e),{message:"Put credentials on auth, not on request headers"}),iJ=iA.object({key:iO.string().min(1),value:iO.string()}),iH=iA.object({key:iZ,value:iO.string()}),iW=iA.object({id:iO.string().regex(/^[a-z0-9-]{8,64}$/,"not a file id"),name:iO.string().min(1).max(255),size:ij.number().int().nonnegative(),contentType:iO.string().max(200).default("application/octet-stream")}),iV=i_.discriminatedUnion("kind",[iA.object({kind:iT.literal("text"),key:iO.string().min(1),value:iO.string()}).strict(),iA.object({kind:iT.literal("file"),key:iO.string().min(1),file:iW}).strict()]),iG=i_.discriminatedUnion("mode",[iA.object({mode:iT.literal("none")}).strict(),iA.object({mode:iT.literal("json"),json:iL.unknown()}).strict(),iA.object({mode:iT.literal("text"),text:iO.string()}).strict(),iA.object({mode:iT.literal("form"),fields:iM.array(iJ)}).strict(),iA.object({mode:iT.literal("raw"),raw:iO.string(),contentType:iO.string().min(1)}).strict(),iA.object({mode:iT.literal("multipart"),parts:iM.array(iV).max(100)}).strict(),iA.object({mode:iT.literal("file"),file:iW,contentType:iO.string().min(1)}).strict()]),iX=iA.object({method:iB,url:iO.string().min(1).refine(e=>e.startsWith("/")||/^https?:\/\//i.test(e),{message:"URL must be http(s) or a path starting with /"}),query:iM.array(iJ).default([]),headers:iM.array(iH).default([]),body:iG.default({mode:"none"}),expectedStatus:iM.array(ij.number().int().min(0).max(599)).default([]),checks:iM.array(iN).max(20).default([])}).strict(),iY=iA.object({duration:iK,target:ij.number().int().min(0).max(1e5)}).strict();function iQ(e){return"constant-arrival-rate"===e||"ramping-arrival-rate"===e}let i0=iA.object({executor:iE.enum(["constant-vus","ramping-vus","constant-arrival-rate","ramping-arrival-rate"]),vus:ij.number().int().min(1).max(500).default(10),rate:ij.number().int().min(1).max(1e5).optional(),maxVUs:ij.number().int().min(1).max(2e3).optional(),startVUs:ij.number().int().min(0).max(500).default(0),duration:iK.default("30s"),stages:iM.array(iY).default([]),thinkTimeMs:ij.number().min(0).default(0),thinkJitterMs:ij.number().min(0).default(0),gracefulStop:iK.default("10s"),testType:iE.enum(["smoke","average","stress","spike","soak","breakpoint","custom"]).optional()}).strict().superRefine((e,t)=>{("ramping-vus"===e.executor||"ramping-arrival-rate"===e.executor)&&0===e.stages.length&&t.addIssue({code:iU.ZodIssueCode.custom,message:`${e.executor} requires at least one stage`,path:["stages"]}),"constant-arrival-rate"!==e.executor||e.rate||t.addIssue({code:iU.ZodIssueCode.custom,message:"constant-arrival-rate needs a rate",path:["rate"]}),!iQ(e.executor)&&e.stages.some(e=>e.target>500)&&t.addIssue({code:iU.ZodIssueCode.custom,message:"A stage can use at most 500 virtual users",path:["stages"]})}),i1=iA.object({p95Ms:ij.number().positive().optional(),p99Ms:ij.number().positive().optional(),errorRate:ij.number().min(0).max(1).optional(),checksRate:ij.number().min(0).max(1).optional(),abortOnFail:iF.boolean().default(!1)}).strict(),i2=iA.object({source:iE.enum(["http_req_duration","http_req_failed","http_reqs"]),agg:iE.enum(["p95","p99","rate","count"]),op:iE.enum(["<","<=",">",">="]),value:ij.number()}).strict(),i5=iA.object({timeout:iK.default("60s"),maxRedirects:ij.number().int().min(0).max(20).default(5),httpVersion:iE.enum(["1.1","2"]).default("1.1"),tlsSkipVerify:iF.boolean().default(!1),connectionReuse:iF.boolean().default(!0),cookies:iF.boolean().default(!0)}).strict(),i9=iA.object({grant:iE.enum(["client_credentials","password","authorization_code","jwt_bearer","saml_bearer"]),tokenUrl:iO.string().url(),authUrl:iO.string().default(""),redirectUri:iO.string().default(""),clientId:iO.string().default(""),clientSecret:iO.string().default(""),scope:iO.string().default(""),username:iO.string().default(""),password:iO.string().default(""),clientAuth:iE.enum(["basic","body","private_key_jwt"]).default("basic"),privateKey:iO.string().default(""),assertionAlgorithm:iE.enum(["RS256","RS384","RS512","PS256","ES256","ES384"]).default("RS256"),issuer:iO.string().default(""),subject:iO.string().default(""),audience:iO.string().default(""),kid:iO.string().default(""),certificate:iO.string().default(""),extraClaims:iO.string().default(""),samlSource:iE.enum(["idp","assertion"]).default("idp"),idpUrl:iO.string().default(""),userId:iO.string().default(""),companyId:iO.string().default(""),assertion:iO.string().default(""),pkce:iF.boolean().default(!0),extra:iM.array(iJ).max(20).default([])}).strict(),i4=i_.discriminatedUnion("mode",[iA.object({mode:iT.literal("oauth2"),oauth:i9}).strict(),iA.object({mode:iT.literal("digest"),username:iO.string().min(1),password:iO.string()}).strict(),iA.object({mode:iT.literal("ntlm"),username:iO.string().min(1),password:iO.string(),domain:iO.string().default("")}).strict(),iA.object({mode:iT.literal("jwt"),algorithm:iE.enum(["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"]),key:iO.string().min(1),payload:iO.string().max(2e4).default("{}"),lifetimeSec:ij.number().int().min(10).max(31536e3).default(3600),kid:iO.string().default(""),headerName:iO.string().min(1).default("Authorization"),prefix:iO.string().default("Bearer")}).strict(),iA.object({mode:iT.literal("oauth1"),consumerKey:iO.string().min(1),consumerSecret:iO.string(),token:iO.string().default(""),tokenSecret:iO.string().default(""),signatureMethod:iE.enum(["HMAC-SHA256","HMAC-SHA1","PLAINTEXT"]).default("HMAC-SHA256"),realm:iO.string().default(""),addTo:iE.enum(["header","query"]).default("header")}).strict(),iA.object({mode:iT.literal("aws_sigv4"),accessKeyId:iO.string().min(1),secretAccessKey:iO.string().min(1),sessionToken:iO.string().default(""),region:iO.string().min(1),service:iO.string().min(1)}).strict(),iA.object({mode:iT.literal("none")}).strict(),iA.object({mode:iT.literal("bearer"),token:iO.string().min(1)}).strict(),iA.object({mode:iT.literal("basic"),username:iO.string().min(1),password:iO.string()}).strict(),iA.object({mode:iT.literal("api_key"),name:iO.string().min(1),value:iO.string().min(1),in:iE.enum(["header","query"]).default("header")}).strict()]),i6=/^[A-Za-z_][\w.-]*$/,i3=iO.string().max(60).regex(i6,"Use letters, numbers, _ . or - (start with a letter)"),i8=iA.object({name:i3,from:iE.enum(["json","header","body"]),path:iO.string().min(1).max(300)}).strict(),i7=iA.object({label:iO.string().min(1).max(120),request:iX,auth:i4.default({mode:"none"}),options:i5.prefault({}),extract:iM.array(i8).min(1).max(20)}).strict(),oe=iA.object({fileName:iO.string().max(200).default("data.csv"),columns:iM.array(i3).min(1).max(50),rows:iM.array(iM.array(iO.string().max(1e4))).min(1).max(1e5),order:iE.enum(["sequential","random","per-user"]).default("sequential")}).strict();function ot(e,t){if(/^https?:\/\//i.test(e.request.url)||t.addIssue({code:"custom",message:"Use an absolute http(s) URL",path:["request","url"]}),e.setup&&!/^https?:\/\//i.test(e.setup.request.url)&&t.addIssue({code:"custom",message:"The run-first request needs an absolute http(s) URL",path:["setup","request","url"]}),e.data){let r=e.data.columns.length,n=e.data.rows.findIndex(e=>e.length!==r);n>=0&&t.addIssue({code:"custom",message:`Test data row ${n+1} has ${e.data.rows[n].length} values, expected ${r}`,path:["data","rows",n]}),new Set(e.data.columns).size!==r&&t.addIssue({code:"custom",message:"Test data has two columns with the same name",path:["data","columns"]})}let r=new Set(e.setup?.extract.map(e=>e.name)??[]);r.size!==(e.setup?.extract.length??0)&&t.addIssue({code:"custom",message:"Two run-first values have the same name",path:["setup","extract"]});let n=e.data?.columns.find(e=>r.has(e));n&&t.addIssue({code:"custom",message:`{{${n}}} comes from both the run-first step and the test data`,path:["data","columns"]})}iA.object({id:iO.string().uuid().optional(),name:iO.string().min(1).max(120),request:iX,auth:i4.default({mode:"none"}),load:i0,thresholds:iM.array(i2).default([]),options:i5.prefault({})}).strict();let or=iA.object({pre:iO.string().max(1e5).default(""),post:iO.string().max(1e5).default("")}).strict();function on(e){return e.replace(/^\s*Bearer\s+/i,"").trim()}function os(e){let t=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)$/);if(!t)return 6e4;let r=Number(t[1]);switch(t[2]){case"ms":return r;case"s":return 1e3*r;case"m":return 6e4*r;case"h":return 36e5*r;default:return 6e4}}iA.object({request:iX,auth:i4.default({mode:"none"}),options:i5.prefault({}),setup:i7.optional(),data:oe.optional(),save:iM.array(i8).max(20).optional(),scripts:or.optional(),live:iF.boolean().optional(),contract:iO.string().regex(/^[\w-]{1,80}$/).optional()}).strict().superRefine(ot),iA.object({name:iO.string().min(1).max(120).default("Lab run"),request:iX,auth:i4.default({mode:"none"}),options:i5.prefault({}),load:i0,targets:i1.optional(),setup:i7.optional(),data:oe.optional(),save:iM.array(i8).max(20).optional(),scripts:or.optional(),contract:iO.string().regex(/^[\w-]{1,80}$/).optional()}).strict().superRefine(ot);let oa={thinkTimeMs:0,thinkJitterMs:0,gracefulStop:"10s"},oi=["smoke","average","stress","spike","soak","breakpoint"],oo={smoke:{vus:2,duration:"30s",rampUp:"0s",rampDown:"0s",...oa},average:{vus:10,duration:"5m",rampUp:"0s",rampDown:"0s",...oa},stress:{vus:20,duration:"1m",rampUp:"30s",rampDown:"30s",...oa},spike:{vus:50,duration:"1m",rampUp:"10s",rampDown:"10s",...oa,stages:[{duration:"10s",target:5},{duration:"30s",target:5},{duration:"10s",target:50},{duration:"1m",target:50},{duration:"10s",target:5},{duration:"30s",target:5},{duration:"10s",target:0}]},soak:{vus:10,duration:"30m",rampUp:"1m",rampDown:"1m",...oa},breakpoint:{vus:200,duration:"10m",rampUp:"0s",rampDown:"0s",...oa,stages:[{duration:"10m",target:200}]}};function ol(e){let t={thinkTimeMs:e.thinkTimeMs,thinkJitterMs:e.thinkJitterMs,gracefulStop:e.gracefulStop},r=os(e.rampUp),n=os(e.rampDown),s=e.stages&&e.stages.length>0?e.stages:null;if("rate"===e.mode){let a=Math.max(1,Math.min(2e3,e.maxVus??100)),i=s?Math.max(1,...s.map(e=>e.target)):Math.max(1,e.rps??10),o={vus:Math.max(1,Math.min(a,500,Math.ceil(i/10))),maxVUs:a,startVUs:0,duration:e.duration,...t};if(s)return{executor:"ramping-arrival-rate",...o,stages:s};if(r<=0&&n<=0)return{executor:"constant-arrival-rate",...o,rate:i,stages:[]};let l=[];return r>0&&l.push({duration:e.rampUp,target:i}),l.push({duration:e.duration,target:i}),n>0&&l.push({duration:e.rampDown,target:0}),{executor:"ramping-arrival-rate",...o,stages:l}}if(s)return{executor:"ramping-vus",vus:Math.max(1,...s.map(e=>e.target)),startVUs:0,duration:e.duration,stages:s,...t};if(r<=0&&n<=0)return{executor:"constant-vus",vus:e.vus,startVUs:0,duration:e.duration,stages:[],...t};let a=[];return r>0&&a.push({duration:e.rampUp,target:e.vus}),a.push({duration:e.duration,target:e.vus}),n>0&&a.push({duration:e.rampDown,target:0}),{executor:"ramping-vus",vus:e.vus,startVUs:r>0?0:e.vus,duration:e.duration,stages:a,...t}}e.s(["a",0,oo,"G",0,oi,"y",0,i6,"L",0,os,"W",0,i8,"b",0,iW,"V",0,iQ,"E",0,ol,"X",0,on,"_",0,oe],59100);let ou=String.raw`
699
+ var __ATC_FIRST = ["Alex", "Maria", "Sam", "Priya", "Omar", "Lena", "Kofi", "Yuki", "Diego", "Emma", "Noah", "Aisha", "Ivan", "Sofia", "Liam", "Mei"];
700
+ var __ATC_LAST = ["Smith", "Garcia", "Kim", "Patel", "Muller", "Silva", "Nguyen", "Okafor", "Rossi", "Cohen", "Tanaka", "Novak", "Brown", "Khan", "Lopez", "Berg"];
701
+ function __atcRand(n) { return Math.floor(Math.random() * n); }
702
+ function __atcRandText(len, chars) {
703
+ var out = "";
704
+ for (var i = 0; i < len; i++) out += chars.charAt(__atcRand(chars.length));
705
+ return out;
706
+ }
707
+ function __atcBuiltin(name, arg) {
708
+ var args = arg === undefined || String(arg).trim() === "" ? [] : String(arg).split(",");
709
+ for (var i = 0; i < args.length; i++) args[i] = Number(String(args[i]).trim());
710
+ switch (name.slice(1).toLowerCase()) {
711
+ case "uuid": case "guid": case "randomuuid":
712
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = __atcRand(16); return (c === "x" ? r : (r & 3) | 8).toString(16); });
713
+ case "timestamp": return String(Math.floor(Date.now() / 1000));
714
+ case "timestampms": return String(Date.now());
715
+ case "isotimestamp": return new Date().toISOString();
716
+ case "isodate": return new Date().toISOString().slice(0, 10);
717
+ case "randomint": {
718
+ var lo = args.length > 1 ? args[0] : 0;
719
+ var hi = args.length > 1 ? args[1] : args.length ? args[0] : 1000;
720
+ if (!isFinite(lo) || !isFinite(hi)) return undefined;
721
+ var min = Math.ceil(Math.min(lo, hi)), max = Math.floor(Math.max(lo, hi));
722
+ return String(min + __atcRand(max - min + 1));
723
+ }
724
+ case "randomstring": {
725
+ var len = args.length && isFinite(args[0]) ? Math.max(1, Math.min(1000, Math.floor(args[0]))) : 8;
726
+ return __atcRandText(len, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
727
+ }
728
+ case "randomemail": return "user." + __atcRandText(8, "abcdefghijklmnopqrstuvwxyz0123456789") + "@example.com";
729
+ case "randomfirstname": return __ATC_FIRST[__atcRand(__ATC_FIRST.length)];
730
+ case "randomlastname": return __ATC_LAST[__atcRand(__ATC_LAST.length)];
731
+ case "randomfullname": return __ATC_FIRST[__atcRand(__ATC_FIRST.length)] + " " + __ATC_LAST[__atcRand(__ATC_LAST.length)];
732
+ case "randomboolean": return Math.random() < 0.5 ? "true" : "false";
733
+ }
734
+ return undefined;
735
+ }
736
+ // {{employee.firstName}}: one field of a saved JSON value (employee = the whole record);
737
+ // items.0.id for a list. Undefined when there is no such value.
738
+ function __atcDotted(vars, name) {
739
+ var parts = name.split(".");
740
+ for (var i = parts.length - 1; i > 0; i--) {
741
+ var head = parts.slice(0, i).join(".");
742
+ if (!Object.prototype.hasOwnProperty.call(vars, head)) continue;
743
+ var cur;
744
+ try { cur = JSON.parse(vars[head]); } catch (e) { return undefined; }
745
+ for (var j = i; j < parts.length; j++) {
746
+ if (cur === null || typeof cur !== "object" || !Object.prototype.hasOwnProperty.call(cur, parts[j])) return undefined;
747
+ cur = cur[parts[j]];
748
+ }
749
+ return cur === null || cur === undefined ? "" : typeof cur === "string" ? cur : JSON.stringify(cur);
750
+ }
751
+ return undefined;
752
+ }
753
+ function __atcFill(text, vars, mode, builtins) {
754
+ if (typeof text !== "string") return text;
755
+ return text.replace(/\{\{\s*(\$?[A-Za-z_][\w.-]*)(?:\(([^(){}]*)\))?\s*\}\}|%7B%7B(\$?[A-Za-z_][\w.-]*)(?:\(([^(){}]*)\))?%7D%7D/gi, function (whole, a, aArg, b, bArg) {
756
+ var name = a || b;
757
+ var arg = a ? aArg : bArg;
758
+ var v;
759
+ if (name.charAt(0) === "$") {
760
+ if (builtins === false) return whole;
761
+ if (b && arg !== undefined) { try { arg = decodeURIComponent(arg); } catch (e) {} }
762
+ v = __atcBuiltin(name, arg);
763
+ if (v === undefined) return whole;
764
+ } else {
765
+ if (arg !== undefined) return whole;
766
+ if (Object.prototype.hasOwnProperty.call(vars, name)) v = String(vars[name]);
767
+ else if ((v = __atcDotted(vars, name)) === undefined) return whole;
768
+ }
769
+ if (mode === "url") return encodeURIComponent(v);
770
+ if (mode === "json") return JSON.stringify(v).slice(1, -1);
771
+ return v;
772
+ });
773
+ }
774
+ `,oc=null;function od(e,t,r="raw",n=!0){return(oc??=Function(`${ou}
775
+ return __atcFill;`)())(e,t,r,n)}function op(e){return[...e.setup?.extract.map(e=>e.name)??[],...e.data?.columns??[]]}e.s(["Z",0,[{name:"$uuid",example:"{{$uuid}}",description:"A random UUID (v4). Also {{$guid}}."},{name:"$timestamp",example:"{{$timestamp}}",description:"Now, in seconds since 1970 (Unix time)."},{name:"$timestampMs",example:"{{$timestampMs}}",description:"Now, in milliseconds since 1970."},{name:"$isoTimestamp",example:"{{$isoTimestamp}}",description:"Now, as 2026-10-19T09:30:00.000Z (UTC)."},{name:"$isoDate",example:"{{$isoDate}}",description:"Today, as 2026-10-19 (UTC)."},{name:"$randomInt",example:"{{$randomInt(1,100)}}",description:"A whole number from 0 to 1000, or between the two numbers you give."},{name:"$randomString",example:"{{$randomString(12)}}",description:"Letters and digits, 8 long or as long as you give."},{name:"$randomEmail",example:"{{$randomEmail}}",description:"An address at example.com, e.g. user.k3x9q2ma@example.com."},{name:"$randomFirstName",example:"{{$randomFirstName}}",description:"A first name, e.g. Maria."},{name:"$randomLastName",example:"{{$randomLastName}}",description:"A last name, e.g. Okafor."},{name:"$randomFullName",example:"{{$randomFullName}}",description:"A first and last name."},{name:"$randomBoolean",example:"{{$randomBoolean}}",description:"true or false."}],"H",0,od,"v",0,function(e){let t=e.replace(/^/,""),r=t.split(/\r?\n/,1)[0]??"",n=[",",";"," "].map(e=>[e,r.split(e).length]).sort((e,t)=>t[1]-e[1])[0][0],s=[],a="",i=[],o=!1;for(let e=0;e<t.length;e++){let r=t[e];o?'"'===r?'"'===t[e+1]?(a+='"',e++):o=!1:a+=r:'"'===r&&""===a?o=!0:r===n?(i.push(a),a=""):"\n"===r||"\r"===r?("\r"===r&&"\n"===t[e+1]&&e++,i.push(a),s.push(i),i=[],a=""):a+=r}(""!==a||i.length)&&(i.push(a),s.push(i));let l=s.filter(e=>e.some(e=>""!==e.trim())),u=[],c=(l.shift()??[]).map(e=>e.trim()).map((e,t)=>{let r=e.replace(/\s+/g,"_").replace(/[^\w.-]/g,""),n=i6.test(r)?r:`column${t+1}`;return n!==e&&u.push(e?`Column “${e}” is used as {{${n}}}`:`Column ${t+1} has no name; it is used as {{${n}}}`),n}),d=new Set;c.forEach((e,t)=>{d.has(e)&&(c[t]=`${e}_${t+1}`,u.push(`Two columns are called “${e}”; the second is used as {{${c[t]}}}`)),d.add(c[t])});let p=0,h=l.map(e=>(e.length!==c.length&&p++,c.map((t,r)=>e[r]??"")));return p&&u.push(`${p} row${1===p?" has":"s have"} a different number of values than the header; missing values are left empty`),{columns:c,rows:h,problems:u}},"C",0,op],99112);let oh="<hidden>",of=new Set(["host","content-length","connection","accept-encoding"]);function om(e){return e.headers.filter(([e,t])=>!of.has(e.toLowerCase())&&!("user-agent"===e.toLowerCase()&&t.startsWith("ApiTestCenter/")))}let oy=e=>JSON.stringify(e),og=e=>`'${e.replace(/'/g,"'\\''")}'`,ob=e=>`'${e.replace(/'/g,"''")}'`,ov=e=>`@"${e.replace(/"/g,'""')}"`;function ow(e,t){if(t.form||t.file)return function(e,t){let r=t.form,n=t.file,s=om(t).filter(([e])=>!(r&&"content-type"===e.toLowerCase())),a=t.method.toUpperCase(),i=(r??[]).filter(e=>void 0!==e.file),o=i.length+ +!!n===1,l=e=>`${e} ${o?"The file name stands for the file you chose: put its path there.":"File names stand for the files you chose: put their paths there."}`,u=e=>e.replace(/["\\\r\n]/g,"_"),c=[];switch(e){case"curl":for(let[e,r]of(c.push(`curl -X ${a} ${og(t.url)}`),s))c.push(` -H ${og(`${e}: ${r}`)}`);for(let e of r??[])c.push(void 0!==e.file?` -F ${og(`${e.name}=@${e.file}${e.contentType?`;type=${e.contentType}`:""}`)}`:` --form-string ${og(`${e.name}=${e.value??""}`)}`);return n&&c.push(` --data-binary ${og(`@${n.name}`)}`),t.insecure&&c.push(" -k"),`${l("#")}
776
+ ${c.join(" \\\n")}`;case"powershell":{let e=s.filter(([e])=>"content-type"!==e.toLowerCase());if(c.push(l("#"),"# PowerShell 7 or later."),e.length){for(let[t,r]of(c.push("$headers = @{"),e))c.push(` ${ob(t)} = ${ob(r)}`);c.push("}")}let i=[`-Uri ${ob(t.url)}`,`-Method ${a}`];if(e.length&&i.push("-Headers $headers"),r){for(let e of(c.push("$form = @{"),r))c.push(` ${ob(e.name)} = ${void 0!==e.file?`Get-Item -Path ${ob(e.file)}`:ob(e.value??"")}`);c.push("}"),i.push("-Form $form")}return n&&i.push(`-InFile ${ob(n.name)}`,`-ContentType ${ob(n.contentType)}`),t.insecure&&i.push("-SkipCertificateCheck"),c.push(`$response = Invoke-WebRequest ${i.join(" ")}`,"$response.StatusCode","$response.Content"),c.join("\n")}case"javascript":if(c.push(l("//"),'import { openAsBlob } from "node:fs";',""),r)for(let e of(c.push("const form = new FormData();"),r))c.push(void 0!==e.file?`form.append(${oy(e.name)}, await openAsBlob(${oy(e.file)}${e.contentType?`, { type: ${oy(e.contentType)} }`:""}), ${oy(e.file)});`:`form.append(${oy(e.name)}, ${oy(e.value??"")});`);if(c.push(`const response = await fetch(${oy(t.url)}, {`,` method: ${oy(a)},`),s.length){for(let[e,t]of(c.push(" headers: {"),s))c.push(` ${oy(e)}: ${oy(t)},`);c.push(" },")}return c.push(r?" body: form,":` body: await openAsBlob(${oy(n.name)}),`),c.push("});","console.log(response.status);","console.log(await response.text());"),c.join("\n");case"python":{if(c.push(l("#"),"import requests","",`url = ${oy(t.url)}`),s.length){for(let[e,t]of(c.push("headers = {"),s))c.push(` ${oy(e)}: ${oy(t)},`);c.push("}")}let e=[oy(a),"url"];if(s.length&&e.push("headers=headers"),r){let t=r.filter(e=>void 0===e.file);if(t.length){for(let e of(c.push("data = ["),t))c.push(` (${oy(e.name)}, ${oy(e.value??"")}),`);c.push("]"),e.push("data=data")}for(let e of(c.push("files = ["),i))c.push(` (${oy(e.name)}, (${oy(e.file)}, open(${oy(e.file)}, "rb")${e.contentType?`, ${oy(e.contentType)}`:""})),`);c.push("]"),e.push("files=files")}return n&&e.push(`data=open(${oy(n.name)}, "rb")`),t.insecure&&e.push("verify=False"),c.push("",`response = requests.request(${e.join(", ")})`,"print(response.status_code)","print(response.text)"),c.join("\n")}case"csharp":{let e=s.filter(([e])=>"content-type"!==e.toLowerCase());for(let[r,n]of(c.push(l("//"),"using System.Net.Http.Headers;",""),c.push(t.insecure?"using var client = new HttpClient(new HttpClientHandler { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator });":"using var client = new HttpClient();"),c.push(`var request = new HttpRequestMessage(new HttpMethod(${ov(a)}), ${ov(t.url)});`),e))c.push(`request.Headers.TryAddWithoutValidation(${ov(r)}, ${ov(n)});`);return r&&(c.push("var form = new MultipartFormDataContent();"),r.forEach((e,t)=>{void 0===e.file?c.push(`form.Add(new StringContent(${ov(e.value??"")}), ${ov(e.name)});`):(c.push(`var file${t} = new ByteArrayContent(File.ReadAllBytes(${ov(e.file)}));`),e.contentType&&c.push(`file${t}.Headers.ContentType = MediaTypeHeaderValue.Parse(${ov(e.contentType)});`),c.push(`form.Add(file${t}, ${ov(e.name)}, ${ov(e.file)});`))}),c.push("request.Content = form;")),n&&c.push(`request.Content = new ByteArrayContent(File.ReadAllBytes(${ov(n.name)}));`,`request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(${ov(n.contentType)});`),c.push("var response = await client.SendAsync(request);","Console.WriteLine((int)response.StatusCode);","Console.WriteLine(await response.Content.ReadAsStringAsync());"),c.join("\n")}case"java":if(c.push(l("//"),"import java.net.URI;","import java.net.http.HttpClient;","import java.net.http.HttpRequest;","import java.net.http.HttpResponse;","import java.nio.file.Files;","import java.nio.file.Path;"),r&&c.push("import java.util.ArrayList;"),c.push(""),r){for(let e of(c.push('String boundary = "----ApiTestCenter" + System.currentTimeMillis();',"var parts = new ArrayList<byte[]>();"),r)){let t=`form-data; name="${u(e.name)}"`;void 0===e.file?c.push(`parts.add(("--" + boundary + ${oy(`\r
777
+ Content-Disposition: ${t}\r
778
+ \r
779
+ `)} + ${oy(e.value??"")} + "\\r\\n").getBytes("UTF-8"));`):(c.push(`parts.add(("--" + boundary + ${oy(`\r
780
+ Content-Disposition: ${t}; filename="${u(e.file)}"\r
781
+ Content-Type: ${e.contentType??"application/octet-stream"}\r
782
+ \r
783
+ `)}).getBytes("UTF-8"));`),c.push(`parts.add(Files.readAllBytes(Path.of(${oy(e.file)})));`,'parts.add("\\r\\n".getBytes("UTF-8"));'))}c.push('parts.add(("--" + boundary + "--\\r\\n").getBytes("UTF-8"));',"")}for(let[e,r]of(t.insecure&&c.push("// The certificate check was skipped in the app; Java's HttpClient needs an SSLContext that trusts the test server."),c.push("HttpClient client = HttpClient.newHttpClient();","HttpRequest request = HttpRequest.newBuilder()",` .uri(URI.create(${oy(t.url)}))`),s))c.push(` .header(${oy(e)}, ${oy(r)})`);return r&&c.push(' .header("Content-Type", "multipart/form-data; boundary=" + boundary)'),c.push(` .method(${oy(a)}, ${r?"HttpRequest.BodyPublishers.ofByteArrays(parts)":`HttpRequest.BodyPublishers.ofFile(Path.of(${oy(n.name)}))`})`," .build();"),c.push("HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());","System.out.println(response.statusCode());","System.out.println(response.body());"),c.join("\n");case"go":{let e=['"fmt"','"io"','"net/http"','"os"',...r?['"bytes"','"mime/multipart"','"net/textproto"']:[],...t.insecure?['"crypto/tls"']:[]].sort();if(c.push(l("//"),"package main","","import (",...e.map(e=>` ${e}`),")","","func main() {"),r){for(let e of(c.push(" var body bytes.Buffer"," w := multipart.NewWriter(&body)"),r)){if(void 0===e.file){c.push(` w.WriteField(${oy(e.name)}, ${oy(e.value??"")})`);continue}c.push(" {"," h := make(textproto.MIMEHeader)",` h.Set("Content-Disposition", ${oy(`form-data; name="${u(e.name)}"; filename="${u(e.file)}"`)})`,` h.Set("Content-Type", ${oy(e.contentType??"application/octet-stream")})`," part, _ := w.CreatePart(h)",` data, err := os.ReadFile(${oy(e.file)})`," if err != nil {"," panic(err)"," }"," part.Write(data)"," }")}c.push(" w.Close()")}else c.push(` body, err := os.Open(${oy(n.name)})`," if err != nil {"," panic(err)"," }"," defer body.Close()");for(let[e,n]of(c.push(` req, err := http.NewRequest(${oy(a)}, ${oy(t.url)}, ${r?"&body":"body"})`," if err != nil {"," panic(err)"," }"),s))c.push(` req.Header.Set(${oy(e)}, ${oy(n)})`);return r&&c.push(' req.Header.Set("Content-Type", w.FormDataContentType())'),c.push(t.insecure?" client := &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}}":" client := http.DefaultClient"," res, err := client.Do(req)"," if err != nil {"," panic(err)"," }"," defer res.Body.Close()"," data, _ := io.ReadAll(res.Body)"," fmt.Println(res.StatusCode)"," fmt.Println(string(data))","}"),c.join("\n")}case"k6":if(c.push(l("//"),'import http from "k6/http";','import { check, sleep } from "k6";',""),i.forEach((e,t)=>c.push(`const file${t} = open(${oy(e.file)}, "b");`)),n&&c.push(`const body = open(${oy(n.name)}, "b");`),c.push("",`export const options = { vus: 5, duration: "30s"${t.insecure?", insecureSkipTLSVerify: true":""} };`,""),c.push("export default function () {"),r){let e=0;for(let t of(c.push(" const body = {"),r))c.push(` ${oy(t.name)}: ${void 0!==t.file?`http.file(file${e++}, ${oy(t.file)}${t.contentType?`, ${oy(t.contentType)}`:""})`:oy(t.value??"")},`);c.push(" };")}if(c.push(` const res = http.request(${oy(a)}, ${oy(t.url)}, body, {`),s.length){for(let[e,t]of(c.push(" headers: {"),s))c.push(` ${oy(e)}: ${oy(t)},`);c.push(" },")}return c.push(" });",' check(res, { "status is 2xx": (r) => r.status >= 200 && r.status < 300 });'," sleep(1);","}"),c.join("\n")}}(e,t);let r=om(t),n=t.body,s=t.method.toUpperCase(),a=[];switch(e){case"curl":for(let[e,i]of(a.push(`curl${"GET"===s&&void 0===n?"":` -X ${s}`} ${og(t.url)}`),r))a.push(` -H ${og(`${e}: ${i}`)}`);return void 0!==n&&a.push(` --data-raw ${og(n)}`),t.insecure&&a.push(" -k"),a.join(" \\\n");case"powershell":{let e=r.find(([e])=>"content-type"===e.toLowerCase())?.[1],i=r.filter(([e])=>"content-type"!==e.toLowerCase());if(i.length){for(let[e,t]of(a.push("$headers = @{"),i))a.push(` ${ob(e)} = ${ob(t)}`);a.push("}")}let o=[`-Uri ${ob(t.url)}`,`-Method ${s}`];return i.length&&o.push("-Headers $headers"),e&&o.push(`-ContentType ${ob(e)}`),void 0!==n&&o.push(/^[\x20-\x7e\r\n\t]*$/.test(n)?`-Body ${ob(n)}`:`-Body ([System.Text.Encoding]::UTF8.GetBytes(${ob(n)}))`),t.insecure&&o.push("-SkipCertificateCheck"),a.push(`$response = Invoke-WebRequest ${o.join(" ")}`,"$response.StatusCode","$response.Content"),a.join("\n")}case"javascript":if(a.push(`const response = await fetch(${oy(t.url)}, {`,` method: ${oy(s)},`),r.length){for(let[e,t]of(a.push(" headers: {"),r))a.push(` ${oy(e)}: ${oy(t)},`);a.push(" },")}return void 0!==n&&a.push(` body: ${oy(n)},`),a.push("});","console.log(response.status);","console.log(await response.text());"),t.insecure&&a.unshift("// The certificate check was skipped in the app; in Node.js run with NODE_TLS_REJECT_UNAUTHORIZED=0 for a test server only."),a.join("\n");case"python":{if(a.push("import requests","",`url = ${oy(t.url)}`),r.length){for(let[e,t]of(a.push("headers = {"),r))a.push(` ${oy(e)}: ${oy(t)},`);a.push("}")}void 0!==n&&a.push(`payload = ${oy(n)}`);let e=[oy(s),"url"];return r.length&&e.push("headers=headers"),void 0!==n&&e.push('data=payload.encode("utf-8")'),t.insecure&&e.push("verify=False"),a.push("",`response = requests.request(${e.join(", ")})`,"print(response.status_code)","print(response.text)"),a.join("\n")}case"csharp":{let e=r.find(([e])=>"content-type"===e.toLowerCase())?.[1],i=r.filter(([e])=>"content-type"!==e.toLowerCase());for(let[e,r]of(a.push("using System.Net.Http.Headers;",""),a.push(t.insecure?"using var client = new HttpClient(new HttpClientHandler { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator });":"using var client = new HttpClient();"),a.push(`var request = new HttpRequestMessage(new HttpMethod(${ov(s)}), ${ov(t.url)});`),i))a.push(`request.Headers.TryAddWithoutValidation(${ov(e)}, ${ov(r)});`);return void 0!==n&&(a.push(`request.Content = new StringContent(${ov(n)});`),e&&a.push(`request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(${ov(e)});`)),a.push("var response = await client.SendAsync(request);","Console.WriteLine((int)response.StatusCode);","Console.WriteLine(await response.Content.ReadAsStringAsync());"),a.join("\n")}case"java":for(let[e,n]of(a.push("import java.net.URI;","import java.net.http.HttpClient;","import java.net.http.HttpRequest;","import java.net.http.HttpResponse;",""),t.insecure&&a.push("// The certificate check was skipped in the app; Java's HttpClient needs an SSLContext that trusts the test server."),a.push("HttpClient client = HttpClient.newHttpClient();","HttpRequest request = HttpRequest.newBuilder()",` .uri(URI.create(${oy(t.url)}))`),r))a.push(` .header(${oy(e)}, ${oy(n)})`);return a.push(` .method(${oy(s)}, ${void 0!==n?`HttpRequest.BodyPublishers.ofString(${oy(n)})`:"HttpRequest.BodyPublishers.noBody()"})`," .build();"),a.push("HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());","System.out.println(response.statusCode());","System.out.println(response.body());"),a.join("\n");case"go":{let e=['"fmt"','"io"','"net/http"',...void 0!==n?['"strings"']:[],...t.insecure?['"crypto/tls"']:[]].sort();for(let[i,o]of(a.push("package main","","import (",...e.map(e=>` ${e}`),")","","func main() {"),a.push(` req, err := http.NewRequest(${oy(s)}, ${oy(t.url)}, ${void 0!==n?`strings.NewReader(${oy(n)})`:"nil"})`),a.push(" if err != nil {"," panic(err)"," }"),r))a.push(` req.Header.Set(${oy(i)}, ${oy(o)})`);return a.push(t.insecure?" client := &http.Client{Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}}":" client := http.DefaultClient"," res, err := client.Do(req)"," if err != nil {"," panic(err)"," }"," defer res.Body.Close()"," data, _ := io.ReadAll(res.Body)"," fmt.Println(res.StatusCode)"," fmt.Println(string(data))","}"),a.join("\n")}case"k6":if(a.push('import http from "k6/http";','import { check, sleep } from "k6";',""),a.push(`export const options = { vus: 5, duration: "30s"${t.insecure?", insecureSkipTLSVerify: true":""} };`,""),a.push("export default function () {"),a.push(` const res = http.request(${oy(s)}, ${oy(t.url)}, ${void 0!==n?oy(n):"null"}, {`),r.length){for(let[e,t]of(a.push(" headers: {"),r))a.push(` ${oy(e)}: ${oy(t)},`);a.push(" },")}return a.push(" });",' check(res, { "status is 2xx": (r) => r.status >= 200 && r.status < 300 });'," sleep(1);","}"),a.join("\n")}}e.s(["X",0,[{id:"curl",label:"curl"},{id:"powershell",label:"PowerShell"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"csharp",label:"C#"},{id:"java",label:"Java"},{id:"go",label:"Go"},{id:"k6",label:"k6 load test"}],"Z",0,oh,"T",0,ow,"A",0,function(e){let t=new Set(e.secretHeaders.map(e=>e.toLowerCase())),r=e.headers.map(([e,r])=>[e,t.has(e.toLowerCase())?function(e,t){if("authorization"===e.toLowerCase()||"proxy-authorization"===e.toLowerCase()){let e=/^(\w+)\s+/.exec(t);if(e)return`${e[1]} ${oh}`}return oh}(e,r):r]),n=e.url;if(e.secretQuery.length)try{let t=new URL(e.url);for(let r of e.secretQuery)t.searchParams.has(r)&&t.searchParams.set(r,oh);n=t.toString().replace(/%3Chidden%3E/g,oh)}catch{}return{...e,url:n,headers:r}}],75606);let ok=/^---\n([\s\S]*?)\n---[ \t]*(?:\n|$)/;function ox(e,t){let r=e=>e.replace(/^v/,"").split("-")[0].split(".").map(e=>Number.parseInt(e,10)||0),[n,s]=[r(e),r(t)];for(let e=0;e<Math.max(n.length,s.length);e++)if((n[e]??0)!==(s[e]??0))return(n[e]??0)-(s[e]??0);return 0}let o$=e=>!!(e&&/^v?\d+\.\d+/.test(e)),oS=/`([^`]+)`|\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)\s]+)\)|(?<=^|[\s(])\*([^*\s][^*]*?)\*/;function o_(e){let t=[],r=e;for(;r;){let e=oS.exec(r);if(!e)break;e.index&&t.push({kind:"text",text:r.slice(0,e.index)}),null!=e[1]?t.push({kind:"code",text:e[1]}):null!=e[2]?t.push({kind:"strong",parts:o_(e[2])}):null!=e[3]?/^(https?:|mailto:)/i.test(e[4])?t.push({kind:"link",href:e[4],parts:o_(e[3])}):t.push(...o_(e[3])):t.push({kind:"em",parts:o_(e[5])}),r=r.slice(e.index+e[0].length)}return r&&t.push({kind:"text",text:r}),t}e.s(["U",0,function(e){let t=[],r=[],n=null,s=()=>{r.length&&t.push({kind:"paragraph",parts:o_(r.join(" "))}),n&&t.push({kind:"list",ordered:n.ordered,items:n.items.map(o_)}),r=[],n=null};for(let a of e.replace(/\r\n/g,"\n").split("\n")){let e=/^(#{1,4})\s+(.*)$/.exec(a),i=/^\s*(?:([-*])|\d+\.)\s+(.*)$/.exec(a);if(e)s(),t.push({kind:"heading",level:Math.min(4,Math.max(2,e[1].length)),parts:o_(e[2])});else if(i){let e=!i[1];(r.length||n&&n.ordered!==e)&&s(),(n??={ordered:e,items:[]}).items.push(i[2])}else!a.trim()||/^\|/.test(a)?s():n?n.items[n.items.length-1]+=` ${a.trim()}`:r.push(a.trim())}return s(),t},"J",0,function(e,t){return o$(t)?e.find(e=>0===ox(e.version,t)):[...e].sort((e,t)=>ox(t.version,e.version))[0]},"n",0,o_,"K",0,function(e){return Object.entries(e).map(([e,t])=>(function(e,t){let r=t.replace(/\r\n/g,"\n"),n={};for(let e of ok.exec(r)?.[1]?.split("\n")??[]){let t=/^(\w+):\s*(.*)$/.exec(e.trim());t&&(n[t[1].toLowerCase()]=t[2].replace(/^["']|["']$/g,"").trim())}let s=r.replace(/\r\n/g,"\n").replace(ok,"").trimStart().split(/\n## Download\b/)[0].replace(/^## What's new in [^\n]*\n/i,"").trim();return{version:e,level:"important"===n.level?"important":"optional",...n.why?{why:n.why}:{},markdown:s}})(e,t)).sort((e,t)=>ox(t.version,e.version))},"R",0,function(e,t,r,n){if(!o$(t))return[];let s=e.filter(e=>0>=ox(e.version,t)).sort((e,t)=>ox(t.version,e.version));return o$(r)?s.filter(e=>ox(e.version,r)>0):n?s.filter(e=>0===ox(e.version,t)):[]}],64478);let oA=/^\s*(```|~~~)\s*([\w+#.-]*)/,oT=/^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/,oO=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/,oE=/^\s*(?:([-*+])|\d+[.)])\s+(.*)$/,oj=/^\s{0,3}>\s?(.*)$/,oM=/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;function oN(e){return e.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,"").split(/(?<!\\)\|/).map(e=>e.trim().replace(/\\\|/g,"|"))}function oI(e){let t=e.slice(0,5e4).replace(/\r\n?/g,"\n").split("\n"),r=[],n=[],s=null,a=null,i=()=>{n.length&&r.push({kind:"paragraph",parts:o_(n.join(" "))}),s&&r.push({kind:"list",ordered:s.ordered,items:s.items.map(o_)}),a&&r.push({kind:"quote",parts:o_(a.join(" "))}),n=[],s=null,a=null};for(let e=0;e<t.length;e++){let o=t[e],l=oA.exec(o);if(l){i();let n=[];for(e++;e<t.length&&!t[e].trim().startsWith(l[1]);e++)n.push(t[e]);r.push({kind:"code",lang:l[2]??"",text:n.join("\n")});continue}let u=oT.exec(o);if(u){i(),r.push({kind:"heading",level:Math.min(4,u[1].length),parts:o_(u[2])});continue}if(oO.test(o)&&!(n.length&&/^\s*-+\s*$/.test(o))){i(),r.push({kind:"rule"});continue}if(n.length&&/^\s*(-+|=+)\s*$/.test(o)){let e=n.join(" ");n=[],i(),r.push({kind:"heading",level:o.includes("=")?1:2,parts:o_(e)});continue}if(o.includes("|")&&e+1<t.length&&oM.test(t[e+1])){i();let n=oN(o),s=[];for(e+=2;e<t.length&&t[e].includes("|")&&t[e].trim();e++)s.push(oN(t[e]));e--,r.push({kind:"table",head:n.map(o_),rows:s.map(e=>n.map((t,r)=>o_(e[r]??"")))});continue}let c=oj.exec(o);if(c){a||i(),a??=[],c[1].trim()&&a.push(c[1].trim());continue}let d=oE.exec(o);if(d){let e=!d[1];(n.length||a||s&&s.ordered!==e)&&i(),(s??={ordered:e,items:[]}).items.push(d[2]);continue}o.trim()?s&&/^\s+/.test(o)?s.items[s.items.length-1]+=` ${o.trim()}`:a?a.push(o.trim()):(s&&i(),n.push(o.trim())):i()}return i(),r}function oq(e,t=140){let r=oI(e).find(e=>"paragraph"===e.kind);if(!r||"paragraph"!==r.kind)return"";let n=(function e(t){return t.map(t=>"text"===t.kind||"code"===t.kind?t.text:e(t.parts)).join("")})(r.parts).replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t-1).trimEnd()}…`:n}let oC=e=>e.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function oz(e){return e.map(e=>"text"===e.kind?oC(e.text):"code"===e.kind?`<code>${oC(e.text)}</code>`:"strong"===e.kind?`<strong>${oz(e.parts)}</strong>`:"em"===e.kind?`<em>${oz(e.parts)}</em>`:`<a href="${oC(e.href)}" target="_blank" rel="noreferrer">${oz(e.parts)}</a>`).join("")}function oP(e,t=0){return e.map(e=>{switch(e.kind){case"heading":{let r=Math.min(6,e.level+t);return`<h${r}>${oz(e.parts)}</h${r}>`}case"paragraph":return`<p>${oz(e.parts)}</p>`;case"list":{let t=e.ordered?"ol":"ul";return`<${t}>${e.items.map(e=>`<li>${oz(e)}</li>`).join("")}</${t}>`}case"code":return`<pre><code${e.lang?` data-lang="${oC(e.lang)}"`:""}>${oC(e.text)}</code></pre>`;case"table":return`<table><thead><tr>${e.head.map(e=>`<th>${oz(e)}</th>`).join("")}</tr></thead><tbody>${e.rows.map(e=>`<tr>${e.map(e=>`<td>${oz(e)}</td>`).join("")}</tr>`).join("")}</tbody></table>`;case"quote":return`<blockquote><p>${oz(e.parts)}</p></blockquote>`;case"rule":return"<hr>"}}).join("\n")}let oR=(e,t=0)=>oP(oI(e),t);e.s(["o",0,5e4,"y",0,oP,"s",0,oI,"q",0,oq,"e",0,oC,"K",0,oR],89662);var oL=e.i(11367);let oU={baseUrl:"",endpoint:"",params:[],valid:!1};function oF(e){let t=e.trim();if(!t)return oU;try{let e=new URL(t);if("http:"!==e.protocol&&"https:"!==e.protocol)return oU;let r=[];return e.searchParams.forEach((e,t)=>{r.push({key:t,value:e})}),{baseUrl:e.origin,endpoint:e.pathname||"/",params:r,valid:!0}}catch{return oU}}function oD(e){let t=e.baseUrl.trim();if(!t)return"";try{let r=new URL(t.includes("://")?t:`https://${t}`);if("http:"!==r.protocol&&"https:"!==r.protocol)return"";let n=e.endpoint.trim()||"/";for(let t of(n.startsWith("/")||(n=`/${n}`),r.pathname=n,r.search="",r.hash="",e.params)){let e=t.key.trim();e&&!1!==t.enabled&&r.searchParams.append(e,t.value)}return r.toString()}catch{return""}}let oB=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]);function oK(e){if(!e)return;let t=e.toUpperCase();return oB.has(t)?t:void 0}function oZ(e){return e.replace(/[),.;]+$/g,"").replace(/[<>]/g,"")}let oJ=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),oH=new Set(["-d","--data","--data-raw","--data-binary","--data-ascii","--data-urlencode","--json"]),oW=new Set(["-A","--user-agent","-b","--cookie","-e","--referer","-o","--output","-m","--max-time","--connect-timeout","-x","--proxy","-w","--write-out"]);function oV(e){if(!e||"object"!=typeof e)return null;let t=Number(e.status);if(!Number.isInteger(t)||t<100||t>599)return null;let r=Array.isArray(e.headers)?e.headers.flatMap(e=>Array.isArray(e)&&"string"==typeof e[0]&&"string"==typeof e[1]&&e[0].trim()?[[e[0],e[1]]]:[]):[],n=Number(e.delayMs);return{status:t,headers:r.slice(0,50),body:"string"==typeof e.body?e.body.slice(0,1e6):"",delayMs:Number.isFinite(n)?Math.max(0,Math.min(3e4,Math.round(n))):0}}let oG=/^(content-type|location|cache-control|etag|x-[\w-]+|link|retry-after|www-authenticate)$/i;e.s(["j",0,function(e,t,r){return{status:e,headers:Object.entries(t).filter(([e,t])=>oG.test(e)&&"[redacted]"!==t).slice(0,50),body:(function(e,t){let r=Object.entries(t).find(([e])=>"content-type"===e.toLowerCase())?.[1]??"";if(!/json/i.test(r)&&!/^\s*[[{]/.test(e))return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}})(r,t).slice(0,1e6),delayMs:0}},"S",0,oV],36163);let oX=["token","password","apiValue"],oY=/\{\{\s*([A-Za-z_][\w.-]*)\s*\}\}/g;function oQ(e){return/^\s*\{\{\s*[A-Za-z_][\w.-]*\s*\}\}\s*$/.test(e)}function o0(e,t){let r=new Set;return{text:e.replace(oY,(e,n)=>{if(Object.prototype.hasOwnProperty.call(t,n))return t[n];let s=function(e,t){let r=t.split(".");for(let n=r.length-1;n>0;n--){let s,a=r.slice(0,n).join(".");if(!Object.prototype.hasOwnProperty.call(e,a))continue;let i=e[a];if(i===`{{${a}}}`)return`{{${t}}}`;try{s=JSON.parse(i)}catch{break}for(let e of r.slice(n)){if(null===s||"object"!=typeof s||!Object.prototype.hasOwnProperty.call(s,e))return;s=s[e]}return null==s?"":"string"==typeof s?s:JSON.stringify(s)}}(t,n);return void 0!==s?s:(r.add(n),e)}),missing:[...r]}}function o1(e,t){let r=new Set,n=e=>{if("string"==typeof e){let n=o0(e,t);return n.missing.forEach(e=>r.add(e)),n.text}return Array.isArray(e)?e.map(n):e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,n(t)])):e};return{value:n(e),missing:[...r]}}function o2(){return{grant:"client_credentials",tokenUrl:"",authUrl:"",redirectUri:"http://127.0.0.1:53682/callback",clientId:"",clientSecret:"",scope:"",username:"",password:"",clientAuth:"basic",pkce:!0,extra:[],privateKey:"",assertionAlgorithm:"RS256",issuer:"",subject:"",audience:"",kid:"",certificate:"",extraClaims:"",samlSource:"idp",idpUrl:"",userId:"",companyId:"",assertion:""}}function o5(e){let t=o2();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t;return{grant:["client_credentials","password","authorization_code","jwt_bearer","saml_bearer"].includes(e.grant)?e.grant:t.grant,tokenUrl:r(e.tokenUrl,""),authUrl:r(e.authUrl,""),redirectUri:r(e.redirectUri,t.redirectUri),clientId:r(e.clientId,""),clientSecret:r(e.clientSecret,""),scope:r(e.scope,""),username:r(e.username,""),password:r(e.password,""),clientAuth:"body"===e.clientAuth?"body":"private_key_jwt"===e.clientAuth?"private_key_jwt":"basic",pkce:!1!==e.pkce,privateKey:r(e.privateKey,""),assertionAlgorithm:["RS256","RS384","RS512","PS256","ES256","ES384"].includes(e.assertionAlgorithm)?e.assertionAlgorithm:"RS256",issuer:r(e.issuer,""),subject:r(e.subject,""),audience:r(e.audience,""),kid:r(e.kid,""),certificate:r(e.certificate,""),extraClaims:r(e.extraClaims,""),samlSource:"assertion"===e.samlSource?"assertion":"idp",idpUrl:r(e.idpUrl,""),userId:r(e.userId,""),companyId:r(e.companyId,""),assertion:r(e.assertion,""),extra:(Array.isArray(e.extra)?e.extra:[]).flatMap(e=>e&&"string"==typeof e.key?[{key:e.key,value:r(e.value,"")}]:[])}}function o9(){return{accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"us-east-1",service:"execute-api"}}function o4(e){let t=o9();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t;return{accessKeyId:r(e.accessKeyId,""),secretAccessKey:r(e.secretAccessKey,""),sessionToken:r(e.sessionToken,""),region:r(e.region,t.region),service:r(e.service,t.service)}}function o6(){return{algorithm:"HS256",secret:"",privateKey:"",payload:'{\n "sub": "load-test-user"\n}',lifetimeSec:3600,kid:"",headerName:"Authorization",prefix:"Bearer"}}function o3(e){let t=o6();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t,n=Number(e.lifetimeSec);return{algorithm:["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"].includes(e.algorithm)?e.algorithm:t.algorithm,secret:r(e.secret,""),privateKey:r(e.privateKey,""),payload:r(e.payload,t.payload),lifetimeSec:Number.isFinite(n)&&n>=10?Math.round(n):t.lifetimeSec,kid:r(e.kid,""),headerName:r(e.headerName,t.headerName),prefix:r(e.prefix,t.prefix)}}function o8(){return{consumerKey:"",consumerSecret:"",token:"",tokenSecret:"",signatureMethod:"HMAC-SHA256",realm:"",addTo:"header"}}function o7(e){let t=o8();if(!e||"object"!=typeof e)return t;let r=(e,t)=>"string"==typeof e?e:t;return{consumerKey:r(e.consumerKey,""),consumerSecret:r(e.consumerSecret,""),token:r(e.token,""),tokenSecret:r(e.tokenSecret,""),signatureMethod:["HMAC-SHA256","HMAC-SHA1","PLAINTEXT"].includes(e.signatureMethod)?e.signatureMethod:t.signatureMethod,realm:r(e.realm,""),addTo:"query"===e.addTo?"query":"header"}}let le={oauth:["clientSecret","password","privateKey","assertion"],aws:["secretAccessKey","sessionToken"],jwt:["secret","privateKey"],oauth1:["consumerSecret","tokenSecret"]};function lt(){return{auth:{authMode:"inherit",oauth:o2(),oauth1:o8(),aws:o9(),jwt:o6(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header"},headers:[],variables:[],preScript:"",postScript:""}}function lr(e){return"inherit"===e.auth.authMode&&!e.headers.some(e=>e.key.trim())&&0===e.variables.length&&!e.preScript.trim()&&!e.postScript.trim()&&!e.contract&&!e.description?.trim()}function ln(e){return e.split(/[\\/]/).map(e=>e.trim()).filter(Boolean).slice(0,6).map(e=>(function(e,t="untitled"){return e.normalize("NFKD").replace(/[<>:"/\\|?*\u0000-\u001f]/g," ").replace(/\s+/g," ").trim().replace(/[. ]+$/,"").slice(0,60)||t})(e)).join("/")}e.s(["c",0,6,"F",0,le,"m",0,oX,"d",0,o4,"j",0,o9,"k",0,o6,"Z",0,o2,"s",0,o8,"I",0,lt,"n",0,function(e){let t=new Set;for(let r of e.matchAll(oY))t.add(r[1]);return[...t]},"W",0,function(e){let t=e?e.split("/"):[];return t.map((e,r)=>t.slice(0,r+1).join("/"))},"g",0,function(e){return e.split("/").at(-1)??""},"y",0,ln,"T",0,function(e,t){return""===t||e===t||e.startsWith(`${t}/`)},"u",0,lr,"e",0,oQ,"v",0,o3,"t",0,o7,"X",0,o5,"L",0,function(e){return e.split("/").slice(0,-1).join("/")},"M",0,function(e){let t={...e};for(let e=0;e<5;e++){let e=!1,r={};for(let[n,s]of Object.entries(t)){let a=s.includes("{{")?o0(s,Object.fromEntries(Object.entries(t).filter(([e])=>e!==n))).text:s;a!==s&&(e=!0),r[n]=a}if(t=r,!e)break}return t},"N",0,o0,"J",0,o1,"Q",0,function(e){let t={};for(let r of e?.variables??[])r.key.trim()&&(t[r.key.trim()]=r.value);return t}],78451);let ls=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],la=e=>!!e.key.trim()&&!1!==e.enabled,li=["none","json","text","graphql","form","multipart","file"],lo=["smoke","average","stress","spike","soak","custom"],ll={preset:"smoke",...oo.smoke},lu={},lc="smoke";function ld(){return{...lp(),...lu}}function lp(){return{method:"GET",url:"",baseUrl:"",endpoint:"",params:[],headers:[],bodyMode:"none",graphqlQuery:"",graphqlVariables:"",graphqlOperation:"",graphqlErrorsFail:!0,bodyText:"",formRows:[],bodyFile:null,bodyFileType:"",authMode:"inherit",oauth:o2(),oauth1:o8(),aws:o9(),jwt:o6(),domain:"",token:"",username:"",password:"",apiName:"X-API-Key",apiValue:"",apiIn:"header",timeout:"5m",maxRedirects:5,connectionReuse:!0,useCookies:!0,tlsSkip:!0,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:"",mock:null,description:""}}function lh(e){let t=iW.safeParse(e);return t.success?t.data:null}function lf(e){return Array.isArray(e)?e.map(e=>({key:"string"==typeof e?.key?e.key:"",value:"string"==typeof e?.value?e.value:"",...e?.enabled===!1?{enabled:!1}:{},..."string"==typeof e?.description&&e.description?{description:e.description}:{}})).filter(e=>e.key||e.value):[]}let lm=(e,t)=>"string"==typeof e?e:t,ly=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t;function lg(e){var t,r;let n=lp();if(!e||"object"!=typeof e)return n;let s=li.includes(e.bodyMode)?e.bodyMode:"none",a="bearer"===e.authMode||"basic"===e.authMode||"api_key"===e.authMode||"inherit"===e.authMode||"oauth2"===e.authMode||"digest"===e.authMode||"ntlm"===e.authMode||"aws_sigv4"===e.authMode||"jwt"===e.authMode||"oauth1"===e.authMode?e.authMode:void 0===e.authMode?"inherit":"none";return{method:ls.includes(e.method)?e.method:"GET",url:lm(e.url,""),baseUrl:lm(e.baseUrl,""),endpoint:lm(e.endpoint,""),params:lf(e.params),headers:lf(e.headers),bodyMode:s,bodyText:lm(e.bodyText,""),formRows:Array.isArray(t=e.formRows)?t.slice(0,100).map(e=>{let t=e??{};return{key:"string"==typeof t.key?t.key:"",value:"string"==typeof t.value?t.value:"",kind:"file"===t.kind?"file":"text",file:lh(t.file)}}):[],bodyFile:lh(e.bodyFile),bodyFileType:lm(e.bodyFileType,""),graphqlQuery:lm(e.graphqlQuery,""),graphqlVariables:lm(e.graphqlVariables,""),graphqlOperation:lm(e.graphqlOperation,""),graphqlErrorsFail:!1!==e.graphqlErrorsFail,authMode:a,oauth:o5(e.oauth),oauth1:o7(e.oauth1),aws:o4(e.aws),jwt:o3(e.jwt),domain:lm(e.domain,""),token:lm(e.token,""),username:lm(e.username,""),password:lm(e.password,""),apiName:lm(e.apiName,n.apiName),apiValue:lm(e.apiValue,""),apiIn:"query"===e.apiIn?"query":"header",timeout:lm(e.timeout,n.timeout),maxRedirects:ly(e.maxRedirects,n.maxRedirects),connectionReuse:!1!==e.connectionReuse,useCookies:!1!==e.useCookies,tlsSkip:!0===e.tlsSkip,checks:Array.isArray(r=e.checks)?r.flatMap(e=>{let t=iN.safeParse(e);return t.success?[t.data]:[]}):[],before:function(e){if(!e||"string"!=typeof e.requestId||!e.requestId)return null;let t=(Array.isArray(e.extract)?e.extract:[]).flatMap(e=>{let t=i8.safeParse(e);return t.success?[t.data]:[]});return{requestId:e.requestId,requestName:"string"==typeof e.requestName?e.requestName:"Saved request",extract:t}}(e.before),testData:function(e){if(!e)return null;let t=oe.safeParse(e);return t.success?t.data:null}(e.testData),saveValues:(Array.isArray(e.saveValues)?e.saveValues:[]).flatMap(e=>{let t=i8.safeParse(e);return t.success?[t.data]:[]}),preScript:lm(e.preScript,"").slice(0,1e5),postScript:lm(e.postScript,"").slice(0,1e5),mock:oV(e.mock),description:lm(e.description,"").slice(0,5e4)}}let lb=e=>e.split(/(\{\{[^}]*\}\})/).map(e=>e.startsWith("{{")?e:encodeURIComponent(e)).join(""),lv=e=>{try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}};function lw(e,t){return e.map(e=>{let r=t.find(t=>t.key===e.key&&!1!==t.enabled)?.description;return r?{key:e.key,value:e.value,description:r}:{key:e.key,value:e.value}})}function lk(e,t){if(!t.trim())return{...e,url:"",baseUrl:"",endpoint:"",params:[]};let r=oF(t);if(!r.valid){let r=t.indexOf("?"),n=r<0?[]:t.slice(r+1).split("&").filter(Boolean).map(e=>{let t=e.indexOf("=");return{key:lv(t<0?e:e.slice(0,t)),value:lv(t<0?"":e.slice(t+1))}}),s=e.params.filter(e=>!1===e.enabled);return{...e,url:t,params:[...lw(n,e.params),...s]}}let n=e.params.filter(e=>!1===e.enabled);return{...e,url:t,baseUrl:r.baseUrl,endpoint:r.endpoint,params:[...lw(r.params,e.params),...n]}}function lx(e,t){let r={...e,...t},n=oD({baseUrl:r.baseUrl,endpoint:r.endpoint,params:r.params});if(n)return{...r,url:n};if(t.params&&void 0===t.baseUrl&&void 0===t.endpoint){let t=e.url.split("?")[0]??"",n=r.params.filter(la).map(e=>`${lb(e.key.trim())}=${lb(e.value)}`).join("&");return{...r,url:n?`${t}?${n}`:t}}return{...r,url:e.url}}function l$(e){return"GET"!==e&&"HEAD"!==e}function lS(e){return[...op({setup:e.before,data:e.testData}),...iD(e.preScript??"")]}function l_(e){let t=oF(e.url),r=t.valid?t:oD({baseUrl:e.baseUrl,endpoint:e.endpoint,params:e.params})?{baseUrl:e.baseUrl,endpoint:e.endpoint,params:e.params}:null;if(!r)throw Error(e.url.trim().startsWith("/")?"That's a path, not a full address — pick a Base URL next to the method, or add a variable like baseUrl (https://…) under Manage and start the URL with {{baseUrl}}":"Enter a full http:// or https:// URL");let n=oD({baseUrl:r.baseUrl,endpoint:r.endpoint,params:[]}),s={mode:"none"};if("bearer"===e.authMode){let t=on(e.token);if(!t)throw Error("Bearer auth is on but the token is empty");s={mode:"bearer",token:t}}else if("basic"===e.authMode){if(!e.username)throw Error("Basic auth needs a username");s={mode:"basic",username:e.username,password:e.password}}else if("api_key"===e.authMode){if(!e.apiName.trim()||!e.apiValue)throw Error("API key auth needs a name and a value");s={mode:"api_key",name:e.apiName.trim(),value:e.apiValue,in:e.apiIn}}else if("oauth2"===e.authMode)s={mode:"oauth2",oauth:lE(e.oauth)};else if("digest"===e.authMode){if(!e.username)throw Error("Digest auth needs a username");s={mode:"digest",username:e.username,password:e.password}}else if("ntlm"===e.authMode){if(!e.username)throw Error("NTLM needs a username");let[t,r]=e.username.includes("\\")?e.username.split("\\",2):[e.domain,e.username];s={mode:"ntlm",username:r,password:e.password,domain:t.trim()}}else if("aws_sigv4"===e.authMode){let t=e.aws;if(!t.accessKeyId.trim()||!t.secretAccessKey)throw Error("AWS signing needs the access key ID and the secret access key");if(!t.region.trim()||!t.service.trim())throw Error("AWS signing needs the region (like eu-west-1) and the service (like execute-api or s3)");s={mode:"aws_sigv4",accessKeyId:t.accessKeyId.trim(),secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken.trim(),region:t.region.trim(),service:t.service.trim()}}else if("oauth1"===e.authMode){let t=e.oauth1;if(!t.consumerKey.trim())throw Error("OAuth 1.0 needs the consumer key");if(t.token.trim()&&!t.tokenSecret)throw Error("OAuth 1.0: the token needs its token secret");s={mode:"oauth1",consumerKey:t.consumerKey.trim(),consumerSecret:t.consumerSecret,token:t.token.trim(),tokenSecret:t.tokenSecret,signatureMethod:t.signatureMethod,realm:t.realm.trim(),addTo:t.addTo}}else if("jwt"===e.authMode){let t=e.jwt,r=t.algorithm.startsWith("HS"),n=r?t.secret:t.privateKey.trim();if(!n)throw Error(r?"JWT needs the secret to sign with":"JWT needs the private key (PEM) to sign with");try{let e=JSON.parse(t.payload||"{}");if(!e||"object"!=typeof e||Array.isArray(e))throw Error("not an object")}catch{throw Error('The JWT claims must be a JSON object, like { "sub": "user-1" }')}s={mode:"jwt",algorithm:t.algorithm,key:n,payload:t.payload||"{}",lifetimeSec:t.lifetimeSec,kid:t.kid.trim(),headerName:t.headerName.trim()||"Authorization",prefix:t.prefix.trim()}}let a={mode:"none"};if(l$(e.method)&&"json"===e.bodyMode)try{a={mode:"json",json:e.bodyText.trim()?JSON.parse(e.bodyText):{}}}catch(n){let t=lS(e).find(t=>RegExp(`(^|[^"])\\{\\{\\s*${t.replace(/[.-]/g,"\\$&")}\\s*\\}\\}(?!")`).test(e.bodyText));if(t)throw Error(`Put quotes around {{${t}}} in the JSON body — values from test data and run-first steps are filled in as text`);let r=/(^|[^"])\{\{\s*(\$[A-Za-z]+)/.exec(e.bodyText)?.[2];if(r)throw Error(`Put quotes around {{${r}}} in the JSON body — built-in values are filled in as text`);throw Error(`Body is not valid JSON: ${n instanceof Error?n.message:"parse error"}`)}else if(l$(e.method)&&"graphql"===e.bodyMode){if(!e.graphqlQuery.trim())throw Error("Write the GraphQL query");let t={};if(e.graphqlVariables.trim())try{t=JSON.parse(e.graphqlVariables)}catch(e){throw Error(`GraphQL variables are not valid JSON: ${e instanceof Error?e.message:"parse error"} — put quotes around "{{values}}" from test data`)}a={mode:"json",json:{query:e.graphqlQuery,variables:t,...e.graphqlOperation.trim()?{operationName:e.graphqlOperation.trim()}:{}}}}else if(l$(e.method)&&"text"===e.bodyMode)a={mode:"text",text:e.bodyText};else if(l$(e.method)&&"form"===e.bodyMode)a={mode:"form",fields:e.formRows.filter(e=>"text"===e.kind&&e.key.trim()).map(e=>({key:e.key,value:e.value}))};else if(l$(e.method)&&"multipart"===e.bodyMode){let t=[];for(let r of e.formRows)if(r.key.trim())if("text"===r.kind)t.push({kind:"text",key:r.key,value:r.value});else if(r.file)t.push({kind:"file",key:r.key,file:r.file});else throw Error(`Choose a file for "${r.key}" in the body`);a={mode:"multipart",parts:t}}else if(l$(e.method)&&"file"===e.bodyMode){if(!e.bodyFile)throw Error("Choose the file to send as the body");a={mode:"file",file:e.bodyFile,contentType:e.bodyFileType.trim()||e.bodyFile.contentType||"application/octet-stream"}}return{request:{method:e.method,url:n,query:r.params.filter(la),headers:e.headers.filter(la),body:a,expectedStatus:[],checks:[...e.checks.filter(e=>{if("status"===e.type)return e.expect.trim().length>0;if("body"===e.type)return"is_json"===e.op||e.value.length>0;if("json"===e.type)return e.path.trim().length>0;if("header"===e.type)return e.name.trim().length>0;if("schema"===e.type){var t=e.schema;try{let e=JSON.parse(t);return!!e&&"object"==typeof e&&!Array.isArray(e)}catch{return!1}}return"fields"===e.type?e.rows.some(e=>e.path.trim()):e.maxMs>0}),...l$(e.method)&&"graphql"===e.bodyMode&&e.graphqlErrorsFail?[{type:"json",path:"errors",op:"not_exists",value:""}]:[]]},auth:s,options:{timeout:e.timeout,maxRedirects:e.maxRedirects,httpVersion:"1.1",tlsSkipVerify:e.tlsSkip,connectionReuse:e.connectionReuse,cookies:e.useCookies}}}let lA=["url","baseUrl","endpoint","params","headers","bodyText","graphqlQuery","graphqlVariables","token","username","password","apiName","apiValue","oauth","oauth1","aws","jwt","domain"],lT=/^\d+(\.\d+)?(ms|s|m|h)$/;function lO(e,t=!0){return lT.test(e.trim())?!t&&/^0+(\.0+)?(ms|s|m|h)$/.test(e.trim())?"Must be longer than 0":void 0:"Use a duration like 30s, 5m, or 1h"}function lE(e){let t=e.tokenUrl.trim();if(!/^https?:\/\//i.test(t))throw Error("OAuth 2.0 needs the token URL (https://…/token)");if("password"===e.grant&&!e.username.trim())throw Error("OAuth 2.0 password grant needs a username");if("authorization_code"===e.grant&&!/^https?:\/\//i.test(e.authUrl.trim()))throw Error("OAuth 2.0 authorization code needs the authorization URL (https://…/authorize)");if("authorization_code"===e.grant&&!/^http:\/\/(127\.0\.0\.1|localhost)(:\d+)?\//i.test(e.redirectUri.trim()))throw Error("The redirect URL must be on this computer, like http://127.0.0.1:53682/callback — add the same one in your OAuth app");if(!e.clientId.trim())throw Error("OAuth 2.0 needs a client ID");if(("jwt_bearer"===e.grant||"private_key_jwt"===e.clientAuth||"saml_bearer"===e.grant&&"idp"===e.samlSource)&&!e.privateKey.trim())throw Error("OAuth 2.0: this sign-in needs the private key (PEM)");if("jwt_bearer"===e.grant&&e.extraClaims.trim())try{let t=JSON.parse(e.extraClaims);if(!t||"object"!=typeof t||Array.isArray(t))throw Error("x")}catch{throw Error("OAuth 2.0: the extra claims must be a JSON object")}if("saml_bearer"===e.grant&&"idp"===e.samlSource&&(!/^https?:\/\//i.test(e.idpUrl.trim())||!e.userId.trim()))throw Error("SAML bearer needs the assertion URL (SuccessFactors: https://<api-server>/oauth/idp) and the user ID");if("saml_bearer"===e.grant&&"assertion"===e.samlSource&&!e.assertion.trim())throw Error("SAML bearer needs the assertion (base64)");return{grant:e.grant,tokenUrl:t,authUrl:e.authUrl.trim(),redirectUri:e.redirectUri.trim(),clientId:e.clientId.trim(),clientSecret:e.clientSecret,scope:e.scope.trim(),username:e.username,password:e.password,clientAuth:e.clientAuth,pkce:e.pkce,extra:e.extra.filter(e=>e.key.trim()),privateKey:e.privateKey.trim(),assertionAlgorithm:e.assertionAlgorithm,issuer:e.issuer.trim(),subject:e.subject.trim(),audience:e.audience.trim(),kid:e.kid.trim(),certificate:e.certificate.trim(),extraClaims:e.extraClaims.trim(),samlSource:e.samlSource,idpUrl:e.idpUrl.trim(),userId:e.userId.trim(),companyId:e.companyId.trim(),assertion:e.assertion.trim()}}e.s(["J",0,ll,"C",0,ls,"y",0,function(e,t){let r=e,n=null,s=!1;if("inherit"===e.authMode){let e=[...t].reverse().find(e=>"inherit"!==e.settings.auth.authMode),a=e?.settings.auth;e&&a&&"none"!==a.authMode?(n=e.path,s=!!e.connection,r={...r,authMode:a.authMode,oauth:a.oauth,oauth1:a.oauth1,aws:a.aws,jwt:a.jwt,domain:a.domain,token:a.token,username:a.username,password:a.password,apiName:a.apiName,apiValue:a.apiValue,apiIn:a.apiIn}):r={...r,authMode:"none"}}let a=new Set(e.headers.filter(la).map(e=>e.key.trim().toLowerCase())),i=new Map;for(let e of t)for(let t of e.settings.headers)la(t)&&i.set(t.key.trim().toLowerCase(),{key:t.key.trim(),value:t.value});let o=[...i.entries()].filter(([e])=>!a.has(e)).map(([,e])=>e);o.length&&(r={...r,headers:[...o,...r.headers]});let l=t.filter(e=>e.settings.preScript.trim()||e.settings.postScript.trim()).map(e=>e.path),u=(e,r)=>{let n=t.filter(e=>r(e.settings).trim()).map(e=>`// From the ${e.connection?"connection":"folder"} “${e.path}”
784
+ {
785
+ ${r(e.settings)}
786
+ }`);return n.length?[...n,...e.trim()?[`// This request's own
787
+ {
788
+ ${e}
789
+ }`]:[]].join("\n\n"):e};r={...r,preScript:u(e.preScript,e=>e.preScript),postScript:u(e.postScript,e=>e.postScript)};let c={};for(let e of t)for(let t of e.settings.variables)c[t.key]=t.value;let d=[...t].reverse().find(e=>e.settings.contract),p=d?{id:d.settings.contract,from:d.path}:void 0;return{draft:r,vars:c,inherited:{authFrom:n,...s?{authFromConnection:s}:{},headers:o.map(e=>e.key),scripts:l,...p?{contract:p}:{}}}},"V",0,function(e,t){return"custom"===t?{...e,preset:t}:{preset:t,mode:"users",rps:e.rps,maxVus:e.maxVus,stages:null,...oo[t]}},"m",0,function(e,t){let r=e.endpoint.trim();if(!r&&/^\s*\{\{[^}]+\}\}/.test(e.url)&&(r=e.url.replace(/^\s*\{\{[^}]+\}\}/,"").split("?")[0]||"/"),!r)try{r=new URL(e.url).pathname}catch{r=e.url}let n=new Date().toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});return`${t?`${t} \xb7 `:""}${e.method} ${r||"/"} \xb7 ${n}`},"M",0,function(e,t,r,n){let s,a=l_(e);return{name:r.slice(0,120),...a,load:t,targets:n,setup:void 0,contract:void 0,data:e.testData&&e.testData.rows.length?e.testData:void 0,save:(s=e.saveValues.filter(e=>e.name.trim()&&e.path.trim()&&i6.test(e.name.trim()))).length?s.map(e=>({...e,name:e.name.trim(),path:e.path.trim()})):void 0,scripts:e.preScript.trim()||e.postScript.trim()?{pre:e.preScript,post:e.postScript}:void 0}},"d",0,function(e,t){if(!e.extract.length)throw Error(`Run first: choose at least one value to take from “${e.requestName}”`);for(let t of e.extract){if(!t.name.trim())throw Error("Run first: every value needs a name, like token");if(!t.path.trim())throw Error(`Run first: say where to find {{${t.name}}} in the answer of “${e.requestName}”`)}let r=l_({...t,checks:[],before:null,testData:null,saveValues:[],preScript:"",postScript:""});return{label:e.requestName.slice(0,120)||"Run first",...r,extract:e.extract}},"j",0,function(){return{preset:lc,...oo[lc]}},"t",0,ld,"b",0,function(e){return{params:e.params.filter(la).length,headers:e.headers.filter(la).length,auth:"none"!==e.authMode&&"inherit"!==e.authMode,body:l$(e.method)&&function(e){switch(e.bodyMode){case"none":return!1;case"graphql":return e.graphqlQuery.trim().length>0;case"form":case"multipart":return e.formRows.some(e=>e.key.trim());case"file":return null!==e.bodyFile;default:return e.bodyText.trim().length>0}}(e),checks:e.checks.length,before:null!==e.before,testData:e.testData?.rows.length??0,saveValues:e.saveValues.filter(e=>e.name.trim()&&e.path.trim()).length,scripts:+!!e.preScript.trim()+ +!!e.postScript.trim()}},"h",0,lS,"R",0,lO,"T",0,l$,"o",0,la,"k",0,function(e){return oF(e.url).valid||!!oD(e)||/\{\{.+\}\}/.test(e.url)},"W",0,function(e){return e&&"object"==typeof e?{preset:lo.includes(e.preset)?e.preset:"smoke",vus:ly(e.vus,ll.vus),duration:lm(e.duration,ll.duration),rampUp:lm(e.rampUp,ll.rampUp),rampDown:lm(e.rampDown,ll.rampDown),thinkTimeMs:ly(e.thinkTimeMs,ll.thinkTimeMs),thinkJitterMs:ly(e.thinkJitterMs,ll.thinkJitterMs),gracefulStop:lm(e.gracefulStop,ll.gracefulStop),mode:"rate"===e.mode?"rate":"users",rps:ly(e.rps,20),maxVus:ly(e.maxVus,100),stages:function(e){if(!Array.isArray(e)||0===e.length)return null;let t=e.map(e=>e).filter(e=>"string"==typeof e.duration&&"number"==typeof e.target).map(e=>({duration:e.duration,target:e.target}));return t.length?t:null}(e.stages)}:{...ll}},"w",0,function(e){if(e.stages&&e.stages.length){for(let[t,r]of e.stages.entries()){let n=lO(r.duration,!1);if(n)return`Stage ${t+1}: ${n}`;if(!(r.target>=0))return`Stage ${t+1}: target must be 0 or more`;if("rate"!==e.mode&&r.target>500)return`Stage ${t+1}: at most 500 virtual users`}return e.stages.some(e=>e.target>0)?lO(e.gracefulStop)??null:"At least one stage needs a target above 0"}if("rate"===e.mode){if(!(e.rps>=1&&e.rps<=1e5))return"Requests per second must be 1–100,000";if(!(e.maxVus>=1&&e.maxVus<=2e3))return"Max virtual users must be 1–2,000"}else if(!(e.vus>=1&&e.vus<=500))return"Virtual users must be 1–500";return lO(e.duration,!1)??lO(e.rampUp)??lO(e.rampDown)??lO(e.gracefulStop)??null},"A",0,lE,"i",0,lg,"x",0,function(e,t,r){let n=Object.fromEntries(lA.map(t=>[t,e[t]])),s=new Set(lS(e)),a={...t};for(let e of s)a[e]=`{{${e}}}`;n.formRows=e.formRows.map(e=>({key:e.key,value:"text"===e.kind?e.value:""}));let{value:i,missing:o}=o1(n,a);if(o.length){let e=o.map(e=>`{{${e}}}`).join(", ");throw Error(r?`${e} ${1===o.length?"is":"are"} not defined in ${r}`:`${e} needs an environment — pick one next to the URL`)}let l=i.formRows;i.checks=iR(e.checks,e=>od(e,t,"raw",!1));let u={...e,...i,formRows:e.formRows.map((e,t)=>({...e,key:l[t].key,..."text"===e.kind?{value:l[t].value}:{}}))};return u.url!==e.url?lk(u,u.url):u},"P",0,function(e){e.requests&&(lu={...e.requests}),e.loadPreset&&(lc=e.loadPreset)},"n",0,function(e){if(e)return{p95Ms:e.p95Ms,p99Ms:e.p99Ms||void 0,errorRate:e.errorRate,checksRate:e.checksRate,abortOnFail:!0===e.abortOnFail}},"S",0,function(e){let{preset:t,...r}=e;return{...ol(r),testType:t}},"K",0,lx,"X",0,function(e,t){let r=function(e){let t,r,n,s,a=function(e){let t=/\^\s*\r?\n/.test(e)||/\^"/.test(e)?e.replace(/\^\s*\r?\n/g," ").replace(/\^(.)/g,"$1"):e.replace(/\\\r?\n/g," "),r=[],n="",s=!1,a=null;for(let e=0;e<t.length;e++){let i=t[e];if("'"===a){"'"===i?a=null:n+=i;continue}if('"'===a){'"'===i?a=null:"\\"===i&&e+1<t.length&&'"\\$`'.includes(t[e+1])?n+=t[++e]:n+=i;continue}if("'"===i||'"'===i){a=i,s=!0;continue}if("\\"===i&&e+1<t.length){n+=t[++e],s=!0;continue}if(/\s/.test(i)){(s||n)&&r.push(n),n="",s=!1;continue}n+=i,s=!0}return(s||n)&&r.push(n),r}(e.trim());if(0===a.length||!/^curl(\.exe)?$/i.test(a[0]))return null;let i=[],o=[],l=!1,u=!1,c=!1,d=[];for(let e=1;e<a.length;e++){let s=a[e],p=()=>a[++e]??"",[h,f]=s.startsWith("--")&&s.includes("=")?[s.slice(0,s.indexOf("=")),s.slice(s.indexOf("=")+1)]:[s,void 0],m=()=>f??p();if("-X"===h||"--request"===h)t=m().toUpperCase();else if(/^-X[A-Za-z]+$/.test(s))t=s.slice(2).toUpperCase();else if("-H"===h||"--header"===h){let e=m(),t=e.indexOf(":");t>0&&i.push({key:e.slice(0,t).trim(),value:e.slice(t+1).trim()})}else if(oH.has(h))"--json"===h&&(c=!0),o.push(m());else if("-F"===h||"--form"===h||"--form-string"===h){let e=m(),t=e.indexOf("=");if(t>0){let r=e.slice(0,t),n=e.slice(t+1);"--form-string"!==h&&/^[@<]/.test(n)?d.push({key:r,value:"",file:n.slice(1).split(";")[0].replace(/^.*[\/]/,"")||"file"}):d.push({key:r,value:"--form-string"===h?n:n.replace(/;type=[^;]*$/,"")})}}else if("-u"===h||"--user"===h){let e=m(),t=e.indexOf(":");n={mode:"basic",username:t<0?e:e.slice(0,t),password:t<0?"":e.slice(t+1)}}else"-k"===h||"--insecure"===h?l=!0:"-G"===h||"--get"===h?u=!0:"--url"===h?r=m():oW.has(h)?m():!s.startsWith("-")&&!r&&/^https?:\/\//i.test(s)&&(r=s)}if(!r||!oF(r).valid)return null;let p=[];for(let e of i){if("authorization"===e.key.toLowerCase()){let[t,...r]=e.value.split(/\s+/),s=r.join(" ");if(/^bearer$/i.test(t??"")&&s){n={mode:"bearer",token:s};continue}if(/^basic$/i.test(t??"")&&s){let e=function(e){try{let t="function"==typeof atob?atob(e):oL.Buffer.from(e,"base64").toString("utf8"),r=t.indexOf(":");if(r<0)return;return{mode:"basic",username:t.slice(0,r),password:t.slice(r+1)}}catch{return}}(s);if(e){n=e;continue}}}p.push(e)}let h=o.join("&"),f=p.find(e=>"content-type"===e.key.toLowerCase())?.value??"",m=r;return h&&u?m=`${r}${r.includes("?")?"&":"?"}${h}`:h&&(s={mode:c||f.includes("json")||function(e){let t=e.trim();if(!(t.startsWith("{")||t.startsWith("[")))return!1;try{return JSON.parse(t),!0}catch{return!1}}(h)?"json":"text",text:h}),{method:t&&oJ.has(t)?t:s||d.length?"POST":"GET",url:m,headers:d.length?p.filter(e=>!("content-type"===e.key.toLowerCase()&&/multipart/i.test(e.value))):p,body:s,...d.length?{form:d}:{},auth:n,tlsSkip:l}}(t);if(r){let t=lk({...e,method:r.method},r.url);t={...t,headers:r.headers,tlsSkip:r.tlsSkip||t.tlsSkip},r.body&&(t={...t,bodyMode:r.body.mode,bodyText:function(e,t){if("json"!==t)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}(r.body.text,r.body.mode)}),r.form&&(t={...t,bodyMode:"multipart",formRows:r.form.map(e=>({key:e.key,value:e.value,kind:void 0!==e.file?"file":"text",file:null}))}),r.auth?.mode==="bearer"&&(t={...t,authMode:"bearer",token:r.auth.token}),r.auth?.mode==="basic"&&(t={...t,authMode:"basic",username:r.auth.username,password:r.auth.password});let n=[r.headers.length?`${r.headers.length} header${1===r.headers.length?"":"s"}`:null,r.body?"body":null,r.form?"form":null,r.auth?`${r.auth.mode} auth`:null].filter(Boolean),s=r.form?.filter(e=>void 0!==e.file).length??0,a=s?` — choose the file${1===s?"":"s"} in the Body tab`:"";return{draft:t,note:`Imported curl${n.length?`: ${n.join(", ")}`:""}${a}`}}let n=function(e){let t=e.trim().replace(/^['"]+|['"]+$/g,"");if(!t)return null;let r=t.match(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(https?:\/\/\S+)/i);if(r){let e=oZ(r[2]??"");if(oF(e).valid)return{url:e,method:oK(r[1])}}if(/\bcurl\b/i.test(t)){let e=t.match(/https?:\/\/[^\s'"]+/),r=t.match(/\s-X\s*['"]?([A-Za-z]+)/);if(e){let t=oZ(e[0]);if(oF(t).valid)return{url:t,method:oK(r?.[1])??"GET"}}}let n=t.match(/https?:\/\/[^\s'"]+/);if(n){let e=oZ(n[0]);if(oF(e).valid)return{url:e}}return null}(t);return n?{draft:lk(n.method?{...e,method:n.method}:e,n.url)}:null},"e",0,lk],5305);let lj="apitestcenter.collection/1",lM=[{id:"apitestcenter",label:"APITestCenter",note:"Everything; double-click opens it in the app",extension:".apitestcenter",mime:"application/json"},{id:"postman",label:"Postman v2.1",note:"For teammates on Postman or Insomnia",extension:".postman_collection.json",mime:"application/json"},{id:"openapi",label:"OpenAPI 3.1",note:"For docs, gateways and code generators",extension:".openapi.json",mime:"application/json"},{id:"http",label:".http file",note:"VS Code REST Client and JetBrains",extension:".http",mime:"text/plain"},{id:"docs",label:"API docs (HTML)",note:"One page to share or host: every request, an example answer, code",extension:".html",mime:"text/html"},{id:"markdown",label:"Markdown docs",note:"For a README or a wiki",extension:".md",mime:"text/markdown"}],lN=/^(authorization|proxy-authorization|cookie|x-api-key|api-key|x-auth-token|x-access-token)$/i,lI=e=>"string"==typeof e&&""!==e&&!oQ(e);function lq(e){let t=structuredClone(e);for(let e of oX)lI(t[e])&&(t[e]="");for(let[e,r]of Object.entries(le)){let n=t[e];if(n)for(let e of r)lI(n[e])&&(n[e]="")}return t.headers=t.headers.map(e=>lN.test(e.key.trim())&&lI(e.value)&&!/\{\{/.test(e.value)?{...e,value:""}:e),t}function lC(e,t){return t?e===t?"":e.startsWith(`${t}/`)?e.slice(t.length+1):e:e}let lz=e=>(e?.variables??[]).map(e=>({key:e.key,value:e.secret?"":e.value,secret:e.secret}));function lP(e){let t,r=e.headers.filter(e=>e.key.trim()).map(e=>({key:e.key,value:e.value,...!1===e.enabled?{disabled:!0}:{},...e.description?{description:e.description}:{}}));"json"===e.bodyMode||"text"===e.bodyMode?t={mode:"raw",raw:e.bodyText,options:{raw:{language:"json"===e.bodyMode?"json":"text"}}}:"form"===e.bodyMode?t={mode:"urlencoded",urlencoded:e.formRows.filter(e=>e.key).map(e=>({key:e.key,value:e.value}))}:"multipart"===e.bodyMode?t={mode:"formdata",formdata:e.formRows.filter(e=>e.key).map(e=>"file"===e.kind?{key:e.key,type:"file",src:[]}:{key:e.key,value:e.value,type:"text"})}:"graphql"===e.bodyMode&&(t={mode:"graphql",graphql:{query:e.graphqlQuery,variables:e.graphqlVariables}});let n="bearer"===e.authMode?{type:"bearer",bearer:[{key:"token",value:e.token,type:"string"}]}:"basic"===e.authMode?{type:"basic",basic:[{key:"username",value:e.username,type:"string"},{key:"password",value:e.password,type:"string"}]}:"api_key"===e.authMode?{type:"apikey",apikey:[{key:"key",value:e.apiName},{key:"value",value:e.apiValue},{key:"in",value:e.apiIn}]}:"none"===e.authMode?{type:"noauth"}:void 0;return{method:e.method,header:r,url:{raw:e.url},...t?{body:t}:{},...n?{auth:n}:{},...e.description.trim()?{description:e.description}:{}}}let lR=e=>{try{return JSON.parse(e)}catch{return e}};function lL(e,t){let r=function(e){let{examples:t=!0,checks:r=!0,scripts:n=!0}=e.include??{};return t&&r&&n?e:{...e,requests:e.requests.map(e=>({...e,request:{...e.request,...t?{}:{mock:null},...r?{}:{checks:[]},...n?{}:{preScript:"",postScript:""}}}))}}(t);switch(e){case"apitestcenter":let n,s,a,i;return`${JSON.stringify((n=new Set(r.requests.map(e=>e.id)),s=e=>`r-${e.slice(0,8)}`,a=new Set(r.requests.flatMap(e=>e.request.before&&n.has(e.request.before.requestId)?[e.request.before.requestId]:[])),i=r.requests.map(e=>{let t=lq(e.request),i=t.before&&n.has(t.before.requestId)?t.before:null;return{...a.has(e.id)?{ref:s(e.id)}:{},...lC(e.collection,r.root)?{folder:lC(e.collection,r.root)}:{},name:e.name,request:function(e){let t=ld(),r={};for(let[n,s]of Object.entries(e))"before"!==n&&JSON.stringify(s)!==JSON.stringify(t[n])&&(r[n]=s);return r}(t),...i?{runFirst:{ref:s(i.requestId),extract:i.extract}}:{}}}),{format:lj,name:r.title,...r.environment?{variables:lz(r.environment)}:{},requests:i}),null,2)}
790
+ `;case"postman":return`${JSON.stringify(function(e){let t={name:e.title,item:[]},r=r=>{let n=t,s=r?r.split("/"):[];return s.forEach((t,r)=>{let a=n.item.find(e=>e.item&&e.name===t);if(!a){let i=e.folders?.[[e.root,...s.slice(0,r+1)].filter(Boolean).join("/")];n.item.push(a={name:t,item:[],...i?.trim()?{description:i}:{}})}n=a}),n};for(let t of e.requests){let n=lq(t.request),s=[...n.preScript.trim()?[{listen:"prerequest",script:{type:"text/javascript",exec:n.preScript.split("\n")}}]:[],...n.postScript.trim()?[{listen:"test",script:{type:"text/javascript",exec:n.postScript.split("\n")}}]:[]],a=n.mock?[{name:"Example",originalRequest:lP(n),code:n.mock.status,header:n.mock.headers.map(([e,t])=>({key:e,value:t})),body:n.mock.body}]:void 0;r(lC(t.collection,e.root)).item.push({name:t.name,request:lP(n),...s.length?{event:s}:{},...a?{response:a}:{}})}return{info:{name:e.title,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json",description:e.description?.trim()||"Exported from APITestCenter. Secret values are left empty."},item:t.item,...e.environment?{variable:lz(e.environment).map(e=>({key:e.key,value:e.value}))}:{}}}(r),null,2)}
791
+ `;case"openapi":return`${JSON.stringify(function(e){let t={},r=new Map,n=new Set;for(let s of e.requests){let a=lq(s.request),i=function(e){let[t,r=""]=e.split("?",2),n=/^(\{\{\s*[\w.-]+\s*\}\}|[a-z][a-z0-9+.-]*:\/\/[^/]+)?(.*)$/i.exec(t.trim()),s=[],a=(n[2]||"/").replace(/\{\{\s*([\w.-]+)\s*\}\}/g,(e,t)=>(s.push(t),`{${t}}`))||"/",i=r?r.split("&").map(e=>decodeURIComponent(e.split("=")[0]??"")).filter(Boolean):[];return{origin:n[1]??"",path:a.startsWith("/")?a:`/${a}`,pathParams:s,query:i}}(a.url);i.origin&&r.set(i.origin,(r.get(i.origin)??0)+1);let o=lC(s.collection,e.root)||s.collection;o&&n.add(o);let l=[...i.pathParams.map(e=>({name:e,in:"path",required:!0,schema:{type:"string"}})),...i.query.map(e=>({name:e,in:"query",schema:{type:"string"}})),...a.headers.filter(e=>la(e)&&!lN.test(e.key.trim())&&!/^content-type$/i.test(e.key.trim())).map(e=>({name:e.key.trim(),in:"header",schema:{type:"string"},example:e.value,...e.description?{description:e.description}:{}}))],u="json"===a.bodyMode?{"application/json":{example:lR(a.bodyText)}}:"text"===a.bodyMode?{"text/plain":{example:a.bodyText}}:"graphql"===a.bodyMode?{"application/json":{example:{query:a.graphqlQuery,variables:lR(a.graphqlVariables||"{}"),operationName:a.graphqlOperation||void 0}}}:"form"===a.bodyMode||"multipart"===a.bodyMode?{["form"===a.bodyMode?"application/x-www-form-urlencoded":"multipart/form-data"]:{schema:{type:"object",properties:Object.fromEntries(a.formRows.filter(e=>e.key).map(e=>[e.key,"file"===e.kind?{type:"string",format:"binary"}:{type:"string",example:e.value}]))}}}:null,c=a.mock?{[String(a.mock.status)]:{description:"Example answer",content:a.mock.body?{"application/json":{example:lR(a.mock.body)}}:void 0}}:{200:{description:"OK"}},d="bearer"===a.authMode?[{bearerAuth:[]}]:"basic"===a.authMode?[{basicAuth:[]}]:"api_key"===a.authMode?[{apiKeyAuth:[]}]:void 0,p=t[i.path]??(t[i.path]={});p[a.method.toLowerCase()]||(p[a.method.toLowerCase()]={summary:s.name,...a.description.trim()?{description:a.description}:{},...o?{tags:[o]}:{},...l.length?{parameters:l}:{},...u?{requestBody:{content:u}}:{},responses:c,...d?{security:d}:{}})}let s=new Map((e.environment?.variables??[]).map(e=>[e.key,e.secret?"":e.value])),a=[...r.keys()].sort((e,t)=>r.get(t)-r.get(e)).map(e=>{let t=/^\{\{\s*([\w.-]+)\s*\}\}$/.exec(e);return t?{url:`{${t[1]}}`,variables:{[t[1]]:{default:s.get(t[1])||"https://api.example.com"}}}:{url:e}});return{openapi:"3.1.0",info:{title:e.title,version:"1.0.0",description:e.description?.trim()||"Exported from APITestCenter."},...a.length?{servers:a}:{},...n.size?{tags:[...n].sort().map(t=>{let r=e.folders?.[e.root?`${e.root}/${t}`:t];return{name:t,...r?.trim()?{description:r}:{}}})}:{},paths:t,components:{securitySchemes:{bearerAuth:{type:"http",scheme:"bearer"},basicAuth:{type:"http",scheme:"basic"},apiKeyAuth:{type:"apiKey",in:"header",name:"X-API-Key"}}}}}(r),null,2)}
792
+ `;case"http":let o=[`# ${r.title} — exported from APITestCenter. Secret values are left empty.`,""];for(let e of lz(r.environment))o.push(`@${e.key} = ${e.value}${e.secret?" # secret: fill in":""}`);for(let e of(r.environment?.variables.length&&o.push(""),r.requests)){let t=lq(e.request),n=lC(e.collection,r.root);for(let r of(o.push(`### ${n?`${n} / `:""}${e.name}`,`${t.method} ${t.url}`),t.headers.filter(la)))o.push(`${r.key}: ${r.value}`);"bearer"===t.authMode&&o.push(`Authorization: Bearer ${t.token}`),"basic"===t.authMode&&o.push(`Authorization: Basic ${t.username} ${t.password}`),"api_key"===t.authMode&&"header"===t.apiIn&&o.push(`${t.apiName}: ${t.apiValue}`);let s="json"===t.bodyMode||"text"===t.bodyMode?t.bodyText:"graphql"===t.bodyMode?JSON.stringify({query:t.graphqlQuery,variables:lR(t.graphqlVariables||"{}")},null,2):"form"===t.bodyMode?t.formRows.filter(e=>e.key).map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join("&"):"";"json"!==t.bodyMode&&"graphql"!==t.bodyMode||t.headers.some(e=>/^content-type$/i.test(e.key))||o.push("Content-Type: application/json"),"form"!==t.bodyMode||t.headers.some(e=>/^content-type$/i.test(e.key))||o.push("Content-Type: application/x-www-form-urlencoded"),s&&o.push("",s),"multipart"===t.bodyMode&&o.push("","# A form with files: add the parts by hand (this format writes them differently in each editor)."),o.push("")}return`${o.join("\n").trimEnd()}
793
+ `;case"markdown":return function(e){let t=[`# ${e.title}`,""];e.description?.trim()&&t.push(e.description.trim(),""),t.push(`${e.requests.length} request${1===e.requests.length?"":"s"}, exported from APITestCenter. Secret values are left out.`,"");let r=lz(e.environment);if(r.length){for(let n of(t.push(`## Environment: ${e.environment.name}`,"","| Variable | Value |","| --- | --- |"),r))t.push(`| \`${n.key}\` | ${n.secret?"*secret*":n.value?`\`${n.value}\``:""} |`);t.push("")}let n=new Map;for(let t of e.requests){let r=lC(t.collection,e.root);n.set(r,[...n.get(r)??[],t])}for(let[r,s]of[...n].sort(([e],[t])=>e.localeCompare(t))){r&&t.push(`## ${r}`,"");let n=e.folders?.[[e.root,r].filter(Boolean).join("/")];for(let e of(r&&n?.trim()&&t.push(n.trim(),""),s)){let n=lq(e.request);t.push(`${r?"###":"##"} ${e.name}`,"",`**${n.method}** \`${n.url}\``,""),n.description.trim()&&t.push(n.description.trim(),"");let s=n.headers.filter(la);s.length&&t.push("| Header | Value |","| --- | --- |",...s.map(e=>`| \`${e.key}\` | \`${e.value||" "}\` |`),""),"none"!==n.authMode&&"inherit"!==n.authMode&&t.push(`Auth: ${n.authMode.replace("_"," ")}`,""),n.before&&t.push(`Runs **${n.before.requestName}** first${n.before.extract.length?`, keeping ${n.before.extract.map(e=>`\`{{${e.name}}}\``).join(", ")}`:""}.`,"");let a="json"===n.bodyMode||"text"===n.bodyMode?n.bodyText:"graphql"===n.bodyMode?n.graphqlQuery:"";a.trim()&&t.push("```"+("json"===n.bodyMode?"json":"graphql"===n.bodyMode?"graphql":""),a,"```",""),n.checks.length&&t.push("Checks:","",...n.checks.map(e=>`- ${iI(e)}`),"")}}return`${t.join("\n").trimEnd()}
794
+ `}(r);case"docs":return function(e){let t=new Set(["top"]),r=t=>e.root?t===e.root?"":t.startsWith(`${e.root}/`)?t.slice(e.root.length+1):t:t,n=new Map;for(let t of e.requests)n.set(r(t.collection),[...n.get(r(t.collection))??[],t]);let s=new Set;for(let e of n.keys()){let t=e?e.split("/"):[];for(let e=0;e<=t.length;e++)s.add(t.slice(0,e).join("/"))}let a=[...s].sort((e,t)=>""===e?-1:""===t?1:e.localeCompare(t)),i=t=>e.folders?.[e.root?t?`${e.root}/${t}`:e.root:t]??"",o=[],l=[];for(let e of a){let r=n.get(e)??[],s=e?e.split("/").length:0,a=e?e.split("/").at(-1):"",u=e?lD(`folder-${e}`,t):"";if(e){o.push(`<li class="folder" style="--depth:${s-1}"><a href="#${u}">${oC(a)}</a></li>`),l.push(`<section class="folder" id="${u}"><h2>${oC(e.split("/").join(" › "))}</h2>`);let t=i(e);t.trim()&&l.push(`<div class="desc">${oR(t,2)}</div>`)}else r.length&&l.push('<section class="folder">');for(let e of r){let r=lD(e.name,t);o.push(`<li class="req" style="--depth:${s}" data-search="${oC(`${e.name} ${e.request.method} ${e.request.url}`.toLowerCase())}"><a href="#${r}"><span class="method m-${e.request.method.toLowerCase()}">${e.request.method}</span>${oC(e.name)}</a></li>`),l.push(function(e,t){let r=lq(e.request),n=[];n.push(`<section class="request" id="${t}" data-search="${oC(`${e.name} ${r.method} ${r.url}`.toLowerCase())}">`),n.push(`<h3><span class="method m-${r.method.toLowerCase()}">${r.method}</span> ${oC(e.name)}</h3>`),n.push(`<p class="url">${lK(r.url||"(no address)")}</p>`),r.description.trim()&&n.push(`<div class="desc">${oR(r.description,3)}</div>`),"inherit"===r.authMode?n.push('<p class="note">Auth: from its folder.</p>'):"none"!==r.authMode&&n.push(`<p class="note">Auth: ${oC(lF[r.authMode]??r.authMode)}.</p>`),r.before&&n.push(`<p class="note">Runs <strong>${oC(r.before.requestName)}</strong> first${r.before.extract.length?`, for ${r.before.extract.map(e=>lK(`{{${e.name}}}`)).join(", ")}`:""}.</p>`);let s=r.params.filter(la);s.length&&n.push("<h4>Query parameters</h4>",lB(["Name","Value","About"],s.map(e=>[lK(e.key),e.value?lK(e.value):"",oC(e.description??"")])));let a=r.headers.filter(la);if(a.length&&n.push("<h4>Headers</h4>",lB(["Name","Value","About"],a.map(e=>[lK(e.key),e.value?lK(e.value):"<em>secret</em>",oC(e.description??"")]))),"GET"!==r.method&&"HEAD"!==r.method)if(("json"===r.bodyMode||"text"===r.bodyMode)&&r.bodyText.trim()){let e="json"===r.bodyMode?lJ(r.bodyText):{text:r.bodyText,json:!1};n.push("<h4>Body</h4>",lZ(e.text,e.json?"json":""))}else if("graphql"===r.bodyMode&&r.graphqlQuery.trim())n.push("<h4>GraphQL query</h4>",lZ(r.graphqlQuery,"graphql")),r.graphqlVariables.trim()&&n.push("<h4>Variables</h4>",lZ(lJ(r.graphqlVariables).text,"json"));else if("form"===r.bodyMode||"multipart"===r.bodyMode){let e=r.formRows.filter(e=>e.key.trim());e.length&&n.push(`<h4>${"form"===r.bodyMode?"Form":"Form with files"}</h4>`,lB(["Field","Value"],e.map(e=>[lK(e.key),e.file?`<em>file</em> ${oC(e.file.name)}`:e.value?lK(e.value):""])))}else"file"===r.bodyMode&&r.bodyFile&&n.push("<h4>Body</h4>",`<p>A file: ${oC(r.bodyFile.name)}</p>`);if(r.mock){let e=lJ(r.mock.body);n.push(`<h4>Example answer <span class="status s${String(r.mock.status)[0]}">${r.mock.status}</span></h4>`),r.mock.body.trim()&&n.push(lZ(e.text,e.json?"json":""))}r.checks.length&&n.push("<h4>What it checks</h4>",`<ul>${r.checks.map(e=>`<li>${oC(iI(e))}</li>`).join("")}</ul>`);let i=function(e){let t=e.headers.filter(la).map(e=>[e.key.trim(),e.value]),r=e=>t.some(([t])=>t.toLowerCase()===e.toLowerCase()),n=e.url;"bearer"!==e.authMode||r("authorization")||t.push(["Authorization",`Bearer ${e.token||"<token>"}`]),"basic"!==e.authMode||r("authorization")||t.push(["Authorization","Basic <user name:password, base64>"]),"api_key"===e.authMode&&e.apiName&&("query"===e.apiIn?n+=`${n.includes("?")?"&":"?"}${encodeURIComponent(e.apiName)}=${e.apiValue||"<api key>"}`:r(e.apiName)||t.push([e.apiName,e.apiValue||"<api key>"])),"oauth2"!==e.authMode||r("authorization")||t.push(["Authorization","Bearer <access token>"]);let s={method:e.method,url:n,headers:t,secretHeaders:[],secretQuery:[]};if("GET"===e.method||"HEAD"===e.method)return s;if("json"===e.bodyMode||"text"===e.bodyMode)e.bodyText.trim()&&(s.body=e.bodyText,"json"!==e.bodyMode||r("content-type")||t.push(["Content-Type","application/json"]));else if("graphql"===e.bodyMode){let n;try{n=e.graphqlVariables.trim()?JSON.parse(e.graphqlVariables):void 0}catch{n=void 0}s.body=JSON.stringify({query:e.graphqlQuery,...n?{variables:n}:{},...e.graphqlOperation?{operationName:e.graphqlOperation}:{}}),r("content-type")||t.push(["Content-Type","application/json"])}else"form"===e.bodyMode?(s.body=e.formRows.filter(e=>e.key.trim()).map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`).join("&"),r("content-type")||t.push(["Content-Type","application/x-www-form-urlencoded"])):"multipart"===e.bodyMode?s.form=e.formRows.filter(e=>e.key.trim()).map(e=>e.file?{name:e.key,file:e.file.name,...e.file.contentType?{contentType:e.file.contentType}:{}}:{name:e.key,value:e.value}):"file"===e.bodyMode&&e.bodyFile&&(s.file={name:e.bodyFile.name,contentType:e.bodyFileType||e.bodyFile.contentType||"application/octet-stream"});return s}(r);return n.push('<div class="code" role="group" aria-label="Code that sends it">'),lU.forEach((e,t)=>n.push(`<details${0===t?" open":""}><summary>${e.label}</summary>${lZ(ow(e.id,i),e.id)}</details>`)),n.push("</div></section>"),n.join("\n")}(e,r))}(e||r.length)&&l.push("</section>")}let u=(e.environment?.variables??[]).filter(e=>e.key.trim()),c=e.description??i(""),d=`${e.requests.length} request${1===e.requests.length?"":"s"}`,p=oq(c)||`${d}: what each one sends, what comes back, and code that sends it.`,h=[`<header id="top"><h1>${oC(e.title)}</h1>`,c.trim()?`<div class="desc">${oP(oI(c),1)}</div>`:`<p class="lead">${oC(p)}</p>`,u.length?`<h2>Variables${e.environment?.name?` <span class="muted">(${oC(e.environment.name)})</span>`:""}</h2><p class="note">Write them as ${lK("{{name}}")}; the requests below use them.</p>${lB(["Name","Value"],u.map(e=>[lK(e.key),e.secret?"<em>secret</em>":e.value?lK(e.value):""]))}`:"","</header>"].join("\n");return`<!doctype html>
795
+ <html lang="en">
796
+ <head>
797
+ <meta charset="utf-8">
798
+ <meta name="viewport" content="width=device-width, initial-scale=1">
799
+ <title>${oC(e.title)} — API docs</title>
800
+ <meta name="description" content="${oC(p)}">
801
+ <meta name="generator" content="APITestCenter">
802
+ <style>${lH}</style>
803
+ </head>
804
+ <body>
805
+ <nav aria-label="Requests">
806
+ <a class="brand" href="#top">${oC(e.title)}</a>
807
+ <input type="search" placeholder="Find a request" aria-label="Find a request" oninput="find(this.value)">
808
+ <ul>${o.join("")}</ul>
809
+ </nav>
810
+ <main>
811
+ ${h}
812
+ ${l.join("\n")}
813
+ <footer>${d}${e.generatedAt?` \xb7 made ${oC(e.generatedAt)}`:""} \xb7 with <a href="https://apitestcenter.com" target="_blank" rel="noreferrer">APITestCenter</a>. Secret values are left out.</footer>
814
+ </main>
815
+ <script>
816
+ function find(q) {
817
+ q = q.trim().toLowerCase();
818
+ for (const el of document.querySelectorAll("[data-search]")) el.hidden = !!q && !el.dataset.search.includes(q);
819
+ }
820
+ </script>
821
+ </body>
822
+ </html>
823
+ `}(r)}}let lU=[{id:"curl",label:"curl"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"}],lF={bearer:"Bearer token",basic:"Basic (user name and password)",api_key:"API key",oauth2:"OAuth 2.0",oauth1:"OAuth 1.0",digest:"Digest",ntlm:"NTLM (Windows)",aws_sigv4:"AWS Signature",jwt:"JWT"},lD=(e,t)=>{let r=e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")||"request",n=r;for(let e=2;t.has(n);e++)n=`${r}-${e}`;return t.add(n),n};function lB(e,t){return`<table><thead><tr>${e.map(e=>`<th>${e}</th>`).join("")}</tr></thead><tbody>${t.map(e=>`<tr>${e.map(e=>`<td>${e}</td>`).join("")}</tr>`).join("")}</tbody></table>`}let lK=e=>`<code>${oC(e)}</code>`,lZ=(e,t="")=>`<pre><code${t?` data-lang="${t}"`:""}>${oC(e)}</code></pre>`;function lJ(e){try{return{text:JSON.stringify(JSON.parse(e),null,2),json:!0}}catch{return{text:e,json:!1}}}let lH=`
824
+ :root{color-scheme:light dark;--bg:#f4f5f2;--panel:#fff;--ink:#16191f;--mute:#5b6270;--line:#dfe2dc;--accent:#3f6212;--code:#eef0ea;
825
+ --get:#15803d;--post:#a16207;--put:#1d4ed8;--patch:#7c3aed;--delete:#b91c1c;--other:#4b5563}
826
+ @media (prefers-color-scheme:dark){:root{--bg:#0d0f12;--panel:#16191f;--ink:#e7e9ed;--mute:#9aa1ad;--line:#2a2f38;--accent:#c8f560;--code:#1d2129;
827
+ --get:#4ade80;--post:#facc15;--put:#60a5fa;--patch:#c084fc;--delete:#f87171;--other:#9ca3af}}
828
+ *{box-sizing:border-box}
829
+ body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;display:flex;min-height:100vh}
830
+ nav{position:sticky;top:0;height:100vh;overflow-y:auto;width:280px;flex-shrink:0;border-right:1px solid var(--line);padding:16px 12px;background:var(--panel)}
831
+ nav .brand{display:block;font-weight:600;color:var(--ink);text-decoration:none;padding:4px 8px 12px}
832
+ nav input{width:100%;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font:inherit;font-size:14px;margin-bottom:10px}
833
+ nav ul{list-style:none;margin:0;padding:0}
834
+ nav li a{display:flex;gap:8px;align-items:baseline;padding:4px 8px 4px calc(8px + var(--depth,0) * 14px);border-radius:6px;color:var(--ink);text-decoration:none;font-size:14px}
835
+ nav li a:hover{background:var(--code)}
836
+ nav li.folder a{color:var(--mute);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;margin-top:10px}
837
+ main{flex:1;min-width:0;max-width:900px;margin:0 auto;padding:32px 40px 64px}
838
+ h1{font-size:30px;line-height:1.2;margin:0 0 12px}
839
+ h2{font-size:22px;margin:40px 0 8px;padding-top:8px;border-top:1px solid var(--line)}
840
+ h3{font-size:18px;margin:0 0 8px;display:flex;gap:10px;align-items:center}
841
+ h4{font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--mute);margin:20px 0 6px}
842
+ .desc h4,.desc h5,.desc h6{text-transform:none;letter-spacing:0;color:var(--ink);font-size:15px}
843
+ .lead,.muted,.note{color:var(--mute)}
844
+ .note{font-size:14px;margin:4px 0}
845
+ section.request{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px 22px;margin:18px 0}
846
+ .url code{font-size:14px;word-break:break-all}
847
+ .method{font:600 11px/1 ui-monospace,SFMono-Regular,Consolas,monospace;padding:4px 6px;border-radius:5px;border:1px solid currentColor;flex-shrink:0;color:var(--other)}
848
+ nav .method{border:0;padding:0;min-width:44px;font-size:10px}
849
+ .m-get{color:var(--get)}.m-post{color:var(--post)}.m-put{color:var(--put)}.m-patch{color:var(--patch)}.m-delete{color:var(--delete)}
850
+ .status{font:600 12px ui-monospace,monospace;padding:2px 6px;border-radius:5px;background:var(--code);color:var(--ink);text-transform:none;letter-spacing:0}
851
+ .s2{color:var(--get)}.s4,.s5{color:var(--delete)}
852
+ code{font:13px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;background:var(--code);padding:1px 5px;border-radius:4px}
853
+ pre{background:var(--code);border-radius:8px;padding:12px 14px;overflow-x:auto;margin:6px 0}
854
+ pre code{background:none;padding:0;white-space:pre}
855
+ table{border-collapse:collapse;width:100%;font-size:14px;margin:6px 0}
856
+ th,td{text-align:left;padding:6px 10px;border-bottom:1px solid var(--line);vertical-align:top}
857
+ th{color:var(--mute);font-weight:500}
858
+ blockquote{margin:8px 0;padding:2px 14px;border-left:3px solid var(--accent);color:var(--mute)}
859
+ a{color:var(--accent)}
860
+ .code{margin-top:18px}
861
+ details{border:1px solid var(--line);border-radius:8px;margin:6px 0;padding:0 10px}
862
+ summary{cursor:pointer;padding:6px 0;font-size:14px;color:var(--mute)}
863
+ details[open] summary{color:var(--ink)}
864
+ footer{margin-top:48px;color:var(--mute);font-size:13px}
865
+ [hidden]{display:none!important}
866
+ @media (max-width:800px){body{display:block}nav{position:static;height:auto;width:auto;border-right:0;border-bottom:1px solid var(--line)}main{padding:20px 16px 48px}}
867
+ @media print{nav{display:none}section.request{break-inside:avoid;border:0;padding:0}details{border:0}details:not([open]){display:none}}
868
+ `,lW=Symbol.for("yaml.alias"),lV=Symbol.for("yaml.document"),lG=Symbol.for("yaml.map"),lX=Symbol.for("yaml.pair"),lY=Symbol.for("yaml.scalar"),lQ=Symbol.for("yaml.seq"),l0=Symbol.for("yaml.node.type"),l1=e=>!!e&&"object"==typeof e&&e[l0]===lW,l2=e=>!!e&&"object"==typeof e&&e[l0]===lV,l5=e=>!!e&&"object"==typeof e&&e[l0]===lG,l9=e=>!!e&&"object"==typeof e&&e[l0]===lX,l4=e=>!!e&&"object"==typeof e&&e[l0]===lY,l6=e=>!!e&&"object"==typeof e&&e[l0]===lQ;function l3(e){if(e&&"object"==typeof e)switch(e[l0]){case lG:case lQ:return!0}return!1}function l8(e){if(e&&"object"==typeof e)switch(e[l0]){case lW:case lG:case lY:case lQ:return!0}return!1}let l7=e=>(l4(e)||l3(e))&&!!e.anchor,ue=Symbol("break visit"),ut=Symbol("skip children"),ur=Symbol("remove node");function un(e,t){let r=uo(t);l2(e)?us(null,e.contents,r,Object.freeze([e]))===ur&&(e.contents=null):us(null,e,r,Object.freeze([]))}function us(e,t,r,n){let s=ul(e,t,r,n);if(l8(s)||l9(s))return uu(e,n,s),us(e,s,r,n);if("symbol"!=typeof s){if(l3(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let s=us(e,t.items[e],r,n);if("number"==typeof s)e=s-1;else{if(s===ue)return ue;s===ur&&(t.items.splice(e,1),e-=1)}}}else if(l9(t)){n=Object.freeze(n.concat(t));let e=us("key",t.key,r,n);if(e===ue)return ue;e===ur&&(t.key=null);let s=us("value",t.value,r,n);if(s===ue)return ue;s===ur&&(t.value=null)}}return s}async function ua(e,t){let r=uo(t);l2(e)?await ui(null,e.contents,r,Object.freeze([e]))===ur&&(e.contents=null):await ui(null,e,r,Object.freeze([]))}async function ui(e,t,r,n){let s=await ul(e,t,r,n);if(l8(s)||l9(s))return uu(e,n,s),ui(e,s,r,n);if("symbol"!=typeof s){if(l3(t)){n=Object.freeze(n.concat(t));for(let e=0;e<t.items.length;++e){let s=await ui(e,t.items[e],r,n);if("number"==typeof s)e=s-1;else{if(s===ue)return ue;s===ur&&(t.items.splice(e,1),e-=1)}}}else if(l9(t)){n=Object.freeze(n.concat(t));let e=await ui("key",t.key,r,n);if(e===ue)return ue;e===ur&&(t.key=null);let s=await ui("value",t.value,r,n);if(s===ue)return ue;s===ur&&(t.value=null)}}return s}function uo(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function ul(e,t,r,n){return"function"==typeof r?r(e,t,n):l5(t)?r.Map?.(e,t,n):l6(t)?r.Seq?.(e,t,n):l9(t)?r.Pair?.(e,t,n):l4(t)?r.Scalar?.(e,t,n):l1(t)?r.Alias?.(e,t,n):void 0}function uu(e,t,r){let n=t[t.length-1];if(l3(n))n.items[e]=r;else if(l9(n))"key"===e?n.key=r:n.value=r;else if(l2(n))n.contents=r;else{let e=l1(n)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}un.BREAK=ue,un.SKIP=ut,un.REMOVE=ur,ua.BREAK=ue,ua.SKIP=ut,ua.REMOVE=ur;let uc={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ud=e=>e.replace(/[!,[\]{}]/g,e=>uc[e]);class up{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},up.defaultYaml,e),this.tags=Object.assign({},up.defaultTags,t)}clone(){let e=new up(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new up(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:up.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},up.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:up.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},up.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(2!==r.length&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[e,n]=r;return this.tags[e]=n,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==r.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=r;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let r=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,r),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let r=e.slice(2,-1);return"!"===r||"!!"===r?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),r)}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(n)}catch(e){return t(String(e)),null}return"!"===r?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+ud(e.substring(r.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);if(e&&n.length>0&&l8(e.contents)){let r={};un(e.contents,(e,t)=>{l8(t)&&t.tag&&(r[t.tag]=!0)}),t=Object.keys(r)}else t=[];for(let[s,a]of n)("!!"!==s||"tag:yaml.org,2002:"!==a)&&(!e||t.some(e=>e.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join("\n")}}function uh(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function uf(e){let t=new Set;return un(e,{Value(e,r){r.anchor&&t.add(r.anchor)}}),t}function um(e,t){for(let r=1;;++r){let n=`${e}${r}`;if(!t.has(n))return n}}function uy(e,t,r,n){if(n&&"object"==typeof n)if(Array.isArray(n))for(let t=0,r=n.length;t<r;++t){let r=n[t],s=uy(e,n,String(t),r);void 0===s?delete n[t]:s!==r&&(n[t]=s)}else if(n instanceof Map)for(let t of Array.from(n.keys())){let r=n.get(t),s=uy(e,n,t,r);void 0===s?n.delete(t):s!==r&&n.set(t,s)}else if(n instanceof Set)for(let t of Array.from(n)){let r=uy(e,n,t,t);void 0===r?n.delete(t):r!==t&&(n.delete(t),n.add(r))}else for(let[t,r]of Object.entries(n)){let s=uy(e,n,t,r);void 0===s?delete n[t]:s!==r&&(n[t]=s)}return e.call(t,r,n)}function ug(e,t,r){if(Array.isArray(e))return e.map((e,t)=>ug(e,String(t),r));if(e&&"function"==typeof e.toJSON){if(!r||!l7(e))return e.toJSON(t,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=e=>{n.res=e,delete r.onCreate};let s=e.toJSON(t,r);return r.onCreate&&r.onCreate(s),s}return"bigint"!=typeof e||r?.keep?e:Number(e)}up.defaultYaml={explicit:!1,version:"1.2"},up.defaultTags={"!!":"tag:yaml.org,2002:"};class ub{constructor(e){Object.defineProperty(this,l0,{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:t,maxAliasCount:r,onAnchor:n,reviver:s}={}){if(!l2(e))throw TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},i=ug(this,"",a);if("function"==typeof n)for(let{count:e,res:t}of a.anchors.values())n(t,e);return"function"==typeof s?uy(s,{"":i},"",i):i}}class uv extends ub{constructor(e){super(lW),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let r,n;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let s of(t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],un(e,{Node:(e,t)=>{(l1(t)||l7(t))&&r.push(t)}}),t&&(t.aliasResolveCache=r)),r)){if(s===this)break;s.anchor===this.source&&(n=s)}if(n&&t){let{anchors:e,doc:r,maxAliasCount:s}=t,a=e.get(n);if(a||(ug(n,null,t),a=e.get(n)),a?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(s>=0&&(a.count+=1,0===a.aliasCount&&(a.aliasCount=function e(t,r,n){if(l1(r)){let e=r.resolve(t),s=n&&e&&n.get(e);return s?s.count*s.aliasCount:0}if(l3(r)){let s=0;for(let a of r.items){let r=e(t,a,n);r>s&&(s=r)}return s}return l9(r)?Math.max(e(t,r.key,n),e(t,r.value,n)):1}(r,n,e)),a.count*a.aliasCount>s))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return n}toJSON(e,t){if(!t)return{source:this.source};let r=this.resolve(t.doc,t);if(!r)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);return t.anchors.get(r).res}toString(e,t,r){let n=`*${this.source}`;if(e){if(uh(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${n} `}return n}}let uw=e=>!e||"function"!=typeof e&&"object"!=typeof e;class uk extends ub{constructor(e){super(lY),this.value=e}toJSON(e,t){return t?.keep?this.value:ug(this.value,e,t)}toString(){return String(this.value)}}function ux(e,t,r){let n;if(l2(e)&&(e=e.contents),l8(e))return e;if(l9(e)){let t=r.schema[lG].createNode?.(r.schema,null,r);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:a,onTagObj:i,schema:o,sourceObjects:l}=r;if(s&&e&&"object"==typeof e){if(n=l.get(e))return n.anchor??(n.anchor=a(e)),new uv(n.anchor);n={anchor:null,node:null},l.set(e,n)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let u=function(e,t,r){if(t){let e=r.filter(e=>e.tag===t),n=e.find(e=>!e.format)??e[0];if(!n)throw Error(`Tag ${t} not found`);return n}return r.find(t=>t.identify?.(e)&&!t.format)}(e,t,o.tags);if(!u){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new uk(e);return n&&(n.node=t),t}u=e instanceof Map?o[lG]:Symbol.iterator in Object(e)?o[lQ]:o[lG]}i&&(i(u),delete r.onTagObj);let c=u?.createNode?u.createNode(r.schema,e,r):"function"==typeof u?.nodeClass?.from?u.nodeClass.from(r.schema,e,r):new uk(e);return t?c.tag=t:u.default||(c.tag=u.tag),n&&(n.node=c),c}function u$(e,t,r){let n=r;for(let e=t.length-1;e>=0;--e){let r=t[e];if("number"==typeof r&&Number.isInteger(r)&&r>=0){let e=[];e[r]=n,n=e}else n=new Map([[r,n]])}return ux(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}uk.BLOCK_FOLDED="BLOCK_FOLDED",uk.BLOCK_LITERAL="BLOCK_LITERAL",uk.PLAIN="PLAIN",uk.QUOTE_DOUBLE="QUOTE_DOUBLE",uk.QUOTE_SINGLE="QUOTE_SINGLE";let uS=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class u_ extends ub{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>l8(t)||l9(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(uS(e))this.add(t);else{let[r,...n]=e,s=this.get(r,!0);if(l3(s))s.addIn(n,t);else if(void 0===s&&this.schema)this.set(r,u$(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[t,...r]=e;if(0===r.length)return this.delete(t);let n=this.get(t,!0);if(l3(n))return n.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...n]=e,s=this.get(r,!0);return 0===n.length?!t&&l4(s)?s.value:s:l3(s)?s.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!l9(t))return!1;let r=t.value;return null==r||e&&l4(r)&&null==r.value&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(0===r.length)return this.has(t);let n=this.get(t,!0);return!!l3(n)&&n.hasIn(r)}setIn(e,t){let[r,...n]=e;if(0===n.length)this.set(r,t);else{let e=this.get(r,!0);if(l3(e))e.setIn(n,t);else if(void 0===e&&this.schema)this.set(r,u$(this.schema,n,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}}let uA=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function uT(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let uO=(e,t,r)=>e.endsWith("\n")?uT(r,t):r.includes("\n")?"\n"+uT(r,t):(e.endsWith(" ")?"":" ")+r,uE="flow",uj="block",uM="quoted";function uN(e,t,r="flow",{indentAtStart:n,lineWidth:s=80,minContentWidth:a=20,onFold:i,onOverflow:o}={}){let l,u,c;if(!s||s<0)return e;s<a&&(a=0);let d=Math.max(1+a,1+s-t.length);if(e.length<=d)return e;let p=[],h={},f=s-t.length;"number"==typeof n&&(n>s-Math.max(2,a)?p.push(0):f=s-n);let m=!1,y=-1,g=-1,b=-1;for(r===uj&&-1!==(y=uI(e,y,t.length))&&(f=y+d);c=e[y+=1];){if(r===uM&&"\\"===c){switch(g=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}b=y}if("\n"===c)r===uj&&(y=uI(e,y,t.length)),f=y+t.length+d,l=void 0;else{if(" "===c&&u&&" "!==u&&"\n"!==u&&" "!==u){let t=e[y+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(l=y)}if(y>=f)if(l)p.push(l),f=l+d,l=void 0;else if(r===uM){for(;" "===u||" "===u;)u=c,c=e[y+=1],m=!0;let t=y>b+1?y-2:g-1;if(h[t])return e;p.push(t),h[t]=!0,f=t+d,l=void 0}else m=!0}u=c}if(m&&o&&o(),0===p.length)return e;i&&i();let v=e.slice(0,p[0]);for(let n=0;n<p.length;++n){let s=p[n],a=p[n+1]||e.length;0===s?v=`
869
+ ${t}${e.slice(0,a)}`:(r===uM&&h[s]&&(v+=`${e[s]}\\`),v+=`
870
+ ${t}${e.slice(s+1,a)}`)}return v}function uI(e,t,r){let n=t,s=t+1,a=e[s];for(;" "===a||" "===a;)if(t<s+r)a=e[++t];else{do a=e[++t];while(a&&"\n"!==a)n=t,a=e[s=t+1]}return n}let uq=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});function uC(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=t,s=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),i="",o=0;for(let e=0,t=r[e];t;t=r[++e])if(" "===t&&"\\"===r[e+1]&&"n"===r[e+2]&&(i+=r.slice(o,e)+"\\ ",e+=1,o=e,t="\\"),"\\"===t)switch(r[e+1]){case"u":{i+=r.slice(o,e);let t=r.substr(e+2,4);switch(t){case"0000":i+="\\0";break;case"0007":i+="\\a";break;case"000b":i+="\\v";break;case"001b":i+="\\e";break;case"0085":i+="\\N";break;case"00a0":i+="\\_";break;case"2028":i+="\\L";break;case"2029":i+="\\P";break;default:"00"===t.substr(0,2)?i+="\\x"+t.substr(2):i+=r.substr(e,6)}e+=5,o=e+1}break;case"n":if(n||'"'===r[e+2]||r.length<s)e+=1;else{for(i+=r.slice(o,e)+"\n\n";"\\"===r[e+2]&&"n"===r[e+3]&&'"'!==r[e+4];)i+="\n",e+=2;i+=a," "===r[e+2]&&(i+="\\"),e+=1,o=e+1}break;default:e+=1}return i=o?i+r.slice(o):r,n?i:uN(i,a,uM,uq(t,!1))}function uz(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return uC(e,t);let r=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),n="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
871
+ ${r}`)+"'";return t.implicitKey?n:uN(n,r,uE,uq(t,!1))}function uP(e,t){let r,{singleQuote:n}=t.options;if(!1===n)r=uC;else{let t=e.includes('"'),s=e.includes("'");r=t&&!s?uz:s&&!t?uC:n?uz:uC}return r(e,t)}try{n=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{n=/\n+(?!\n|$)/g}function uR({comment:e,type:t,value:r},s,a,i){let o,l,u,c,{blockQuote:d,commentString:p,lineWidth:h}=s.options;if(!d||/\n[\t ]+$/.test(r))return uP(r,s);let f=s.indent||(s.forceBlockIndent||(c=r,/^(%|---|\.\.\.)/m.test(c))?" ":""),m="literal"===d||"folded"!==d&&t!==uk.BLOCK_FOLDED&&(t===uk.BLOCK_LITERAL||!function(e,t,r){if(!t||t<0)return!1;let n=t-r,s=e.length;if(s<=n)return!1;for(let t=0,r=0;t<s;++t)if("\n"===e[t]){if(t-r>n)return!0;if(s-(r=t+1)<=n)return!1}return!0}(r,h,f.length));if(!r)return m?"|\n":">\n";for(l=r.length;l>0;--l){let e=r[l-1];if("\n"!==e&&" "!==e&&" "!==e)break}let y=r.substring(l),g=y.indexOf("\n");-1===g?o="-":r===y||g!==y.length-1?(o="+",i&&i()):o="",y&&(r=r.slice(0,-y.length),"\n"===y[y.length-1]&&(y=y.slice(0,-1)),y=y.replace(n,`$&${f}`));let b=!1,v=-1;for(u=0;u<r.length;++u){let e=r[u];if(" "===e)b=!0;else if("\n"===e)v=u;else break}let w=r.substring(0,v<u?v+1:u);w&&(r=r.substring(w.length),w=w.replace(/\n+/g,`$&${f}`));let k=f?"2":"1",x=(b?k:"")+o;if(e&&(x+=" "+p(e.replace(/ ?[\r\n]+/g," ")),a&&a()),!m){let e=r.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`),n=!1,a=uq(s,!0);"folded"!==d&&t!==uk.BLOCK_FOLDED&&(a.onOverflow=()=>{n=!0});let i=uN(`${w}${e}${y}`,f,uj,a);if(!n)return`>${x}
872
+ ${f}${i}`}return r=r.replace(/\n+/g,`$&${f}`),`|${x}
873
+ ${f}${w}${r}${y}`}function uL(e,t,r,n){let{implicitKey:s,inFlow:a}=t,i="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)}),{type:o}=e;o!==uk.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(i.value)&&(o=uk.QUOTE_DOUBLE);let l=e=>{switch(e){case uk.BLOCK_FOLDED:case uk.BLOCK_LITERAL:return s||a?uP(i.value,t):uR(i,t,r,n);case uk.QUOTE_DOUBLE:return uC(i.value,t);case uk.QUOTE_SINGLE:return uz(i.value,t);case uk.PLAIN:return function(e,t,r,n){let{type:s,value:a}=e,{actualString:i,implicitKey:o,indent:l,indentStep:u,inFlow:c}=t;if(o&&a.includes("\n")||c&&/[[\]{},]/.test(a))return uP(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return o||c||!a.includes("\n")?uP(a,t):uR(e,t,r,n);if(!o&&!c&&s!==uk.PLAIN&&a.includes("\n"))return uR(e,t,r,n);if(/^(%|---|\.\.\.)/m.test(a)){if(""===l)return t.forceBlockIndent=!0,uR(e,t,r,n);else if(o&&l===u)return uP(a,t)}let d=a.replace(/\n+/g,`$&
874
+ ${l}`);if(i){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(d),{compat:r,tags:n}=t.doc.schema;if(n.some(e)||r?.some(e))return uP(a,t)}return o?d:uN(d,l,uE,uq(t,!1))}(i,t,r,n);default:return null}},u=l(o);if(null===u){let{defaultKeyType:e,defaultStringType:r}=t.options,n=s&&e||r;if(null===(u=l(n)))throw Error(`Unsupported default string type ${n}`)}return u}function uU(e,t){let r,n=Object.assign({blockQuote:!0,commentString:uA,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},e.schema.toStringOptions,t);switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function uF(e,t,r,n){let s;if(l9(e))return e.toString(t,r,n);if(l1(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let a=l8(e)?e:t.doc.createNode(e,{onTagObj:e=>s=e});s??(s=function(e,t){let r,n;if(t.tag){let r=e.filter(e=>e.tag===t.tag);if(r.length>0)return r.find(e=>e.format===t.format)??r[0]}if(l4(t)){r=t.value;let s=e.filter(e=>e.identify?.(r));if(s.length>1){let e=s.filter(e=>e.test);e.length>0&&(s=e)}n=s.find(e=>e.format===t.format)??s.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(null===r?"null":typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}(t.doc.schema.tags,a));let i=function(e,t,{anchors:r,doc:n}){if(!n.directives)return"";let s=[],a=(l4(e)||l3(e))&&e.anchor;a&&uh(a)&&(r.add(a),s.push(`&${a}`));let i=e.tag??(t.default?null:t.tag);return i&&s.push(n.directives.tagString(i)),s.join(" ")}(a,s,t);i.length>0&&(t.indentAtStart=(t.indentAtStart??0)+i.length+1);let o="function"==typeof s.stringify?s.stringify(a,t,r,n):l4(a)?uL(a,t,r,n):a.toString(t,r,n);return i?l4(a)||"{"===o[0]||"["===o[0]?`${i} ${o}`:`${i}
875
+ ${t.indent}${o}`:o}function uD(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let uB={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new uk(Symbol("<<")),{addToJSMap:uK}),stringify:()=>"<<"};function uK(e,t,r){let n=uJ(e,r);if(l6(n))for(let r of n.items)uZ(e,t,r);else if(Array.isArray(n))for(let r of n)uZ(e,t,r);else uZ(e,t,n)}function uZ(e,t,r){let n=uJ(e,r);if(!l5(n))throw Error("Merge sources must be maps or map aliases");for(let[r,s]of n.toJSON(null,e,Map))t instanceof Map?t.has(r)||t.set(r,s):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function uJ(e,t){return e&&l1(t)?t.resolve(e.doc,e):t}function uH(e,t,{key:r,value:n}){if(l8(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if((uB.identify(r)||l4(r)&&(!r.type||r.type===uk.PLAIN)&&uB.identify(r.value))&&e?.doc.schema.tags.some(e=>e.tag===uB.tag&&e.default))uK(e,t,n);else{let s=ug(r,"",e);if(t instanceof Map)t.set(s,ug(n,s,e));else if(t instanceof Set)t.add(s);else{let a=function(e,t,r){if(null===t)return"";if("object"!=typeof t)return String(t);if(l8(e)&&r?.doc){let t=uU(r.doc,{});for(let e of(t.anchors=new Set,r.anchors.keys()))t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let n=e.toString(t);if(!r.mapKeyWarned){let e=JSON.stringify(n);e.length>40&&(e=e.substring(0,36)+'..."'),uD(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(t)}(r,s,e),i=ug(n,a,e);a in t?Object.defineProperty(t,a,{value:i,writable:!0,enumerable:!0,configurable:!0}):t[a]=i}}return t}function uW(e,t,r){return new uV(ux(e,void 0,r),ux(t,void 0,r))}class uV{constructor(e,t=null){Object.defineProperty(this,l0,{value:lX}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return l8(t)&&(t=t.clone(e)),l8(r)&&(r=r.clone(e)),new uV(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return uH(t,r,this)}toString(e,t,r){return e?.doc?function({key:e,value:t},r,n,s){let a,i,o,{allNullValues:l,doc:u,indent:c,indentStep:d,options:{commentString:p,indentSeq:h,simpleKeys:f}}=r,m=l8(e)&&e.comment||null;if(f){if(m)throw Error("With simple keys, key nodes cannot have comments");if(l3(e)||!l8(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let y=!f&&(!e||m&&null==t&&!r.inFlow||l3(e)||(l4(e)?e.type===uk.BLOCK_FOLDED||e.type===uk.BLOCK_LITERAL:"object"==typeof e));r=Object.assign({},r,{allNullValues:!1,implicitKey:!y&&(f||!l),indent:c+d});let g=!1,b=!1,v=uF(e,r,()=>g=!0,()=>b=!0);if(!y&&!r.inFlow&&v.length>1024){if(f)throw Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(r.inFlow){if(l||null==t)return g&&n&&n(),""===v?"?":y?`? ${v}`:v}else if(l&&!f||null==t&&y)return v=`? ${v}`,m&&!g?v+=uO(v,r.indent,p(m)):b&&s&&s(),v;g&&(m=null),y?(m&&(v+=uO(v,r.indent,p(m))),v=`? ${v}
876
+ ${c}:`):(v=`${v}:`,m&&(v+=uO(v,r.indent,p(m)))),l8(t)?(a=!!t.spaceBefore,i=t.commentBefore,o=t.comment):(a=!1,i=null,o=null,t&&"object"==typeof t&&(t=u.createNode(t))),r.implicitKey=!1,!y&&!m&&l4(t)&&(r.indentAtStart=v.length+1),b=!1,!(!h&&d.length>=2&&!r.inFlow&&!y&&l6(t))||t.flow||t.tag||t.anchor||(r.indent=r.indent.substring(2));let w=!1,k=uF(t,r,()=>w=!0,()=>b=!0),x=" ";if(m||a||i){if(x=a?"\n":"",i){let e=p(i);x+=`
877
+ ${uT(e,r.indent)}`}""!==k||r.inFlow?x+=`
878
+ ${r.indent}`:"\n"===x&&o&&(x="\n\n")}else if(!y&&l3(t)){let e=k[0],n=k.indexOf("\n"),s=-1!==n,a=r.inFlow??t.flow??0===t.items.length;if(s||!a){let t=!1;if(s&&("&"===e||"!"===e)){let r=k.indexOf(" ");"&"===e&&-1!==r&&r<n&&"!"===k[r+1]&&(r=k.indexOf(" ",r+1)),(-1===r||n<r)&&(t=!0)}t||(x=`
879
+ ${r.indent}`)}}else(""===k||"\n"===k[0])&&(x="");return v+=x+k,r.inFlow?w&&n&&n():o&&!w?v+=uO(v,r.indent,p(o)):b&&s&&s(),v}(this,e,t,r):JSON.stringify(this)}}function uG(e,t,r){return(t.inFlow??e.flow?function({items:e},t,{flowChars:r,itemIndent:n}){let{indent:s,indentStep:a,flowCollectionPadding:i,options:{commentString:o}}=t,l=Object.assign({},t,{indent:n+=a,inFlow:!0,type:null}),u=!1,c=0,d=[];for(let r=0;r<e.length;++r){let s=e[r],a=null;if(l8(s))s.spaceBefore&&d.push(""),uX(t,d,s.commentBefore,!1),s.comment&&(a=s.comment);else if(l9(s)){let e=l8(s.key)?s.key:null;e&&(e.spaceBefore&&d.push(""),uX(t,d,e.commentBefore,!1),e.comment&&(u=!0));let r=l8(s.value)?s.value:null;r?(r.comment&&(a=r.comment),r.commentBefore&&(u=!0)):null==s.value&&e?.comment&&(a=e.comment)}a&&(u=!0);let i=uF(s,l,()=>a=null);u||(u=d.length>c||i.includes("\n")),r<e.length-1?i+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((e,t)=>e+t.length+2,2)+(i.length+2)>t.options.lineWidth)),u&&(i+=",")),a&&(i+=uO(i,n,o(a))),d.push(i),c=d.length}let{start:p,end:h}=r;if(0===d.length)return p+h;if(!u){let e=d.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(!u)return`${p}${i}${d.join(" ")}${i}${h}`;{let e=p;for(let t of d)e+=t?`
880
+ ${a}${s}${t}`:"\n";return`${e}
881
+ ${s}${h}`}}:function({comment:e,items:t},r,{blockItemPrefix:n,flowChars:s,itemIndent:a,onChompKeep:i,onComment:o}){let l,{indent:u,options:{commentString:c}}=r,d=Object.assign({},r,{indent:a,type:null}),p=!1,h=[];for(let e=0;e<t.length;++e){let s=t[e],i=null;if(l8(s))!p&&s.spaceBefore&&h.push(""),uX(r,h,s.commentBefore,p),s.comment&&(i=s.comment);else if(l9(s)){let e=l8(s.key)?s.key:null;e&&(!p&&e.spaceBefore&&h.push(""),uX(r,h,e.commentBefore,p))}p=!1;let o=uF(s,d,()=>i=null,()=>p=!0);i&&(o+=uO(o,a,c(i))),p&&i&&(p=!1),h.push(n+o)}if(0===h.length)l=s.start+s.end;else{l=h[0];for(let e=1;e<h.length;++e){let t=h[e];l+=t?`
882
+ ${u}${t}`:"\n"}}return e?(l+="\n"+uT(c(e),u),o&&o()):p&&i&&i(),l})(e,t,r)}function uX({indent:e,options:{commentString:t}},r,n,s){if(n&&s&&(n=n.replace(/^\n+/,"")),n){let s=uT(t(n),e);r.push(s.trimStart())}}function uY(e,t){let r=l4(t)?t.value:t;for(let n of e)if(l9(n)&&(n.key===t||n.key===r||l4(n.key)&&n.key.value===r))return n}class uQ extends u_{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(lG,e),this.items=[]}static from(e,t,r){let{keepUndefined:n,replacer:s}=r,a=new this(e),i=(e,i)=>{if("function"==typeof s)i=s.call(t,e,i);else if(Array.isArray(s)&&!s.includes(e))return;(void 0!==i||n)&&a.items.push(uW(e,i,r))};if(t instanceof Map)for(let[e,r]of t)i(e,r);else if(t&&"object"==typeof t)for(let e of Object.keys(t))i(e,t[e]);return"function"==typeof e.sortMapEntries&&a.items.sort(e.sortMapEntries),a}add(e,t){let r;r=l9(e)?e:e&&"object"==typeof e&&"key"in e?new uV(e.key,e.value):new uV(e,e?.value);let n=uY(this.items,r.key),s=this.schema?.sortMapEntries;if(n){if(!t)throw Error(`Key ${r.key} already set`);l4(n.value)&&uw(r.value)?n.value.value=r.value:n.value=r.value}else if(s){let e=this.items.findIndex(e=>0>s(r,e));-1===e?this.items.push(r):this.items.splice(e,0,r)}else this.items.push(r)}delete(e){let t=uY(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let r=uY(this.items,e),n=r?.value;return(!t&&l4(n)?n.value:n)??void 0}has(e){return!!uY(this.items,e)}set(e,t){this.add(new uV(e,t),!0)}toJSON(e,t,r){let n=r?new r:t?.mapAsMap?new Map:{};for(let e of(t?.onCreate&&t.onCreate(n),this.items))uH(t,n,e);return n}toString(e,t,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!l9(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),uG(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}let u0={collection:"map",default:!0,nodeClass:uQ,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(l5(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,r)=>uQ.from(e,t,r)};class u1 extends u_{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(lQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=u2(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let r=u2(e);if("number"!=typeof r)return;let n=this.items[r];return!t&&l4(n)?n.value:n}has(e){let t=u2(e);return"number"==typeof t&&t<this.items.length}set(e,t){let r=u2(e);if("number"!=typeof r)throw Error(`Expected a valid index, not ${e}.`);let n=this.items[r];l4(n)&&uw(t)?n.value=t:this.items[r]=t}toJSON(e,t){let r=[];t?.onCreate&&t.onCreate(r);let n=0;for(let e of this.items)r.push(ug(e,String(n++),t));return r}toString(e,t,r){return e?uG(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){let{replacer:n}=r,s=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if("function"==typeof n){let r=t instanceof Set?a:String(e++);a=n.call(t,r,a)}s.items.push(ux(a,void 0,r))}}return s}}function u2(e){let t=l4(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}let u5={collection:"seq",default:!0,nodeClass:u1,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(l6(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,r)=>u1.from(e,t,r)},u9={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,r,n)=>uL(e,t=Object.assign({actualString:!0},t),r,n)},u4={identify:e=>null==e,createNode:()=>new uk(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new uk(null),stringify:({source:e},t)=>"string"==typeof e&&u4.test.test(e)?e:t.options.nullStr},u6={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new uk("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},r)=>e&&u6.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?r.options.trueStr:r.options.falseStr};function u3({format:e,minFractionDigits:t,tag:r,value:n}){if("bigint"==typeof n)return String(n);let s="number"==typeof n?n:Number(n);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let a=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||"tag:yaml.org,2002:float"===r)&&/^-?\d/.test(a)&&!a.includes("e")){let e=a.indexOf(".");e<0&&(e=a.length,a+=".");let r=t-(a.length-e-1);for(;r-- >0;)a+="0"}return a}let u8={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?0/0:"-"===e[0]?-1/0:1/0,stringify:u3},u7={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():u3(e)}},ce={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new uk(parseFloat(e)),r=e.indexOf(".");return -1!==r&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-r-1),t},stringify:u3},ct=e=>"bigint"==typeof e||Number.isInteger(e),cr=(e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r);function cn(e,t,r){let{value:n}=e;return ct(n)&&n>=0?r+n.toString(t):u3(e)}let cs={identify:e=>ct(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>cr(e,2,8,r),stringify:e=>cn(e,8,"0o")},ca={identify:ct,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>cr(e,0,10,r),stringify:u3},ci={identify:e=>ct(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>cr(e,2,16,r),stringify:e=>cn(e,16,"0x")},co=[u0,u5,u9,u4,u6,cs,ca,ci,u8,u7,ce];function cl(e){return"bigint"==typeof e||Number.isInteger(e)}let cu=({value:e})=>JSON.stringify(e),cc=[u0,u5].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:cu},{identify:e=>null==e,createNode:()=>new uk(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:cu},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:cu},{identify:cl,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>cl(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:cu}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),cd={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"!=typeof atob)return t("This environment does not support reading binary tags; either Buffer or atob is required"),e;{let t=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);return r}},stringify({comment:e,type:t,value:r},n,s,a){let i;if(!r)return"";if("function"==typeof btoa){let e="";for(let t=0;t<r.length;++t)e+=String.fromCharCode(r[t]);i=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=uk.BLOCK_LITERAL),t!==uk.QUOTE_DOUBLE){let e=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),r=Math.ceil(i.length/e),s=Array(r);for(let t=0,n=0;t<r;++t,n+=e)s[t]=i.substr(n,e);i=s.join(t===uk.BLOCK_LITERAL?"\n":" ")}return uL({comment:e,type:t,value:i},n,s,a)}};function cp(e,t){if(l6(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!l9(n)){if(l5(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");let e=n.items[0]||new uV(new uk(null));if(n.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${n.commentBefore}
883
+ ${e.key.commentBefore}`:n.commentBefore),n.comment){let t=e.value??e.key;t.comment=t.comment?`${n.comment}
884
+ ${t.comment}`:n.comment}n=e}e.items[r]=l9(n)?n:new uV(n)}}else t("Expected a sequence for this tag");return e}function ch(e,t,r){let{replacer:n}=r,s=new u1(e);s.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let i,o;if("function"==typeof n&&(e=n.call(t,String(a++),e)),Array.isArray(e))if(2===e.length)i=e[0],o=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)o=e[i=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;s.items.push(uW(i,o,r))}return s}let cf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cp,createNode:ch};class cm extends u1{constructor(){super(),this.add=uQ.prototype.add.bind(this),this.delete=uQ.prototype.delete.bind(this),this.get=uQ.prototype.get.bind(this),this.has=uQ.prototype.has.bind(this),this.set=uQ.prototype.set.bind(this),this.tag=cm.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;for(let e of(t?.onCreate&&t.onCreate(r),this.items)){let n,s;if(l9(e)?(n=ug(e.key,"",t),s=ug(e.value,n,t)):n=ug(e,"",t),r.has(n))throw Error("Ordered maps must not include duplicate keys");r.set(n,s)}return r}static from(e,t,r){let n=ch(e,t,r),s=new this;return s.items=n.items,s}}cm.tag="tag:yaml.org,2002:omap";let cy={collection:"seq",identify:e=>e instanceof Map,nodeClass:cm,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=cp(e,t),n=[];for(let{key:e}of r.items)l4(e)&&(n.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):n.push(e.value));return Object.assign(new cm,r)},createNode:(e,t,r)=>cm.from(e,t,r)};function cg({value:e,source:t},r){return t&&(e?cb:cv).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}let cb={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new uk(!0),stringify:cg},cv={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new uk(!1),stringify:cg},cw=e=>"bigint"==typeof e||Number.isInteger(e);function ck(e,t,r,{intAsBigInt:n}){let s=e[0];if(("-"===s||"+"===s)&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return"-"===s?BigInt(-1)*t:t}let a=parseInt(e,r);return"-"===s?-1*a:a}function cx(e,t,r){let{value:n}=e;if(cw(n)){let e=n.toString(t);return n<0?"-"+r+e.substr(1):r+e}return u3(e)}class c$ extends uQ{constructor(e){super(e),this.tag=c$.tag}add(e){let t;t=l9(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new uV(e.key,null):new uV(e,null),uY(this.items,t.key)||this.items.push(t)}get(e,t){let r=uY(this.items,e);return!t&&l9(r)?l4(r.key)?r.key.value:r.key:r}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=uY(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new uV(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:n}=r,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof n&&(e=n.call(t,e,e)),s.items.push(uW(e,null,r));return s}}c$.tag="tag:yaml.org,2002:set";let cS={collection:"map",identify:e=>e instanceof Set,nodeClass:c$,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>c$.from(e,t,r),resolve(e,t){if(l5(e))if(e.hasAllNullValues(!0))return Object.assign(new c$,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function c_(e,t){let r=e[0],n="-"===r||"+"===r?e.substring(1):e,s=e=>t?BigInt(e):Number(e),a=n.replace(/_/g,"").split(":").reduce((e,t)=>e*s(60)+s(t),s(0));return"-"===r?s(-1)*a:a}function cA(e){let{value:t}=e,r=e=>e;if("bigint"==typeof t)r=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return u3(e);let n="";t<0&&(n="-",t*=r(-1));let s=r(60),a=[t%s];return t<60?a.unshift(0):(t=(t-a[0])/s,a.unshift(t%s),t>=60&&(t=(t-a[0])/s,a.unshift(t))),n+a.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let cT={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>c_(e,r),stringify:cA},cO={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>c_(e,!1),stringify:cA},cE={identify:e=>e 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(e){let t=e.match(cE.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,s,a,i,o]=t.map(Number),l=Date.UTC(r,n-1,s,a||0,i||0,o||0,t[7]?Number((t[7]+"00").substr(1,3)):0),u=t[8];if(u&&"Z"!==u){let e=c_(u,!1);30>Math.abs(e)&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},cj=[u0,u5,u9,u4,cb,cv,{identify:cw,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>ck(e,2,2,r),stringify:e=>cx(e,2,"0b")},{identify:cw,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>ck(e,1,8,r),stringify:e=>cx(e,8,"0")},{identify:cw,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>ck(e,0,10,r),stringify:u3},{identify:cw,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>ck(e,2,16,r),stringify:e=>cx(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?0/0:"-"===e[0]?-1/0:1/0,stringify:u3},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():u3(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new uk(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(-1!==r){let n=e.substring(r+1).replace(/_/g,"");"0"===n[n.length-1]&&(t.minFractionDigits=n.length)}return t},stringify:u3},cd,uB,cy,cf,cS,cT,cO,cE],cM=new Map([["core",co],["failsafe",[u0,u5,u9]],["json",cc],["yaml11",cj],["yaml-1.1",cj]]),cN={binary:cd,bool:u6,float:ce,floatExp:u7,floatNaN:u8,floatTime:cO,int:ca,intHex:ci,intOct:cs,intTime:cT,map:u0,merge:uB,null:u4,omap:cy,pairs:cf,seq:u5,set:cS,timestamp:cE},cI={"tag:yaml.org,2002:binary":cd,"tag:yaml.org,2002:merge":uB,"tag:yaml.org,2002:omap":cy,"tag:yaml.org,2002:pairs":cf,"tag:yaml.org,2002:set":cS,"tag:yaml.org,2002:timestamp":cE};function cq(e,t,r){let n=cM.get(t);if(n&&!e)return r&&!n.includes(uB)?n.concat(uB):n.slice();let s=n;if(!s)if(Array.isArray(e))s=[];else{let e=Array.from(cM.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)s=s.concat(t);else"function"==typeof e&&(s=e(s.slice()));return r&&(s=s.concat(uB)),s.reduce((e,t)=>{let r="string"==typeof t?cN[t]:t;if(!r){let e=JSON.stringify(t),r=Object.keys(cN).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${r}`)}return e.includes(r)||e.push(r),e},[])}let cC=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class cz{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:n,schema:s,sortMapEntries:a,toStringDefaults:i}){this.compat=Array.isArray(e)?cq(e,"compat"):e?cq(null,e):null,this.name="string"==typeof s&&s||"core",this.knownTags=n?cI:{},this.tags=cq(t,this.name,r),this.toStringOptions=i??null,Object.defineProperty(this,lG,{value:u0}),Object.defineProperty(this,lY,{value:u9}),Object.defineProperty(this,lQ,{value:u5}),this.sortMapEntries="function"==typeof a?a:!0===a?cC:null}clone(){let e=Object.create(cz.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class cP{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,l0,{value:lV});let n=null;"function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t,t=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new up({version:a}),this.setSchema(a,r),this.contents=void 0===e?null:this.createNode(e,n,r)}clone(){let e=Object.create(cP.prototype,{[l0]:{value:lV}});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=l8(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){cR(this.contents)&&this.contents.add(e)}addIn(e,t){cR(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=uf(this);e.anchor=!t||r.has(t)?um(t||"a",r):t}return new uv(e.anchor)}createNode(e,t,r){var n,s;let a,i,o,l;if("function"==typeof t)e=t.call({"":e},"",e),a=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),a=t}else void 0===r&&t&&(r=t,t=void 0);let{aliasDuplicateObjects:u,anchorPrefix:c,flow:d,keepUndefined:p,onTagObj:h,tag:f}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:g}=(n=this,s=c||"a",i=[],o=new Map,l=null,{onAnchor:e=>{i.push(e),l??(l=uf(n));let t=um(s,l);return l.add(t),t},setAnchors:()=>{for(let e of i){let t=o.get(e);if("object"==typeof t&&t.anchor&&(l4(t.node)||l3(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:o}),b={aliasDuplicateObjects:u??!0,keepUndefined:p??!1,onAnchor:m,onTagObj:h,replacer:a,schema:this.schema,sourceObjects:g},v=ux(e,f,b);return d&&l3(v)&&(v.flow=!0),y(),v}createPair(e,t,r={}){return new uV(this.createNode(e,null,r),this.createNode(t,null,r))}delete(e){return!!cR(this.contents)&&this.contents.delete(e)}deleteIn(e){return uS(e)?null!=this.contents&&(this.contents=null,!0):!!cR(this.contents)&&this.contents.deleteIn(e)}get(e,t){return l3(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return uS(e)?!t&&l4(this.contents)?this.contents.value:this.contents:l3(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!l3(this.contents)&&this.contents.has(e)}hasIn(e){return uS(e)?void 0!==this.contents:!!l3(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=u$(this.schema,[e],t):cR(this.contents)&&this.contents.set(e,t)}setIn(e,t){uS(e)?this.contents=t:null==this.contents?this.contents=u$(this.schema,Array.from(e),t):cR(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let r;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new up({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new up({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new cz(Object.assign(r,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:n,onAnchor:s,reviver:a}={}){let i={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===r,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=ug(this.contents,t??"",i);if("function"==typeof s)for(let{count:e,res:t}of i.anchors.values())s(t,e);return"function"==typeof a?uy(a,{"":o},"",o):o}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let r=[],n=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(r.push(t),n=!0):e.directives.docStart&&(n=!0)}n&&r.push("---");let s=uU(e,t),{commentString:a}=s.options;if(e.commentBefore){1!==r.length&&r.unshift("");let t=a(e.commentBefore);r.unshift(uT(t,""))}let i=!1,o=null;if(e.contents){if(l8(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){let t=a(e.contents.commentBefore);r.push(uT(t,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}let t=o?void 0:()=>i=!0,l=uF(e.contents,s,()=>o=null,t);o&&(l+=uO(l,"",a(o))),("|"===l[0]||">"===l[0])&&"---"===r[r.length-1]?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(uF(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=a(e.comment);t.includes("\n")?(r.push("..."),r.push(uT(t,""))):r.push(`... ${t}`)}else r.push("...");else{let t=e.comment;t&&i&&(t=t.replace(/^\n+/,"")),t&&((!i||o)&&""!==r[r.length-1]&&r.push(""),r.push(uT(a(t),"")))}return r.join("\n")+"\n"}(this,e)}}function cR(e){if(l3(e))return!0;throw Error("Expected a YAML collection as document contents")}class cL extends Error{constructor(e,t,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=t}}class cU extends cL{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class cF extends cL{constructor(e,t,r){super("YAMLWarning",e,t,r)}}let cD=(e,t)=>r=>{if(-1===r.pos[0])return;r.linePos=r.pos.map(e=>t.linePos(e));let{line:n,col:s}=r.linePos[0];r.message+=` at line ${n}, column ${s}`;let a=s-1,i=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(a>=60&&i.length>80){let e=Math.min(a-39,i.length-79);i="…"+i.substring(e),a-=e-1}if(i.length>80&&(i=i.substring(0,79)+"…"),n>1&&/^ *$/.test(i.substring(0,a))){let r=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);r.length>80&&(r=r.substring(0,79)+"…\n"),i=r+i}if(/[^ ]/.test(i)){let e=1,t=r.linePos[1];t?.line===n&&t.col>s&&(e=Math.max(1,Math.min(t.col-s,80-a)));let o=" ".repeat(a)+"^".repeat(e);r.message+=`:
885
+
886
+ ${i}
887
+ ${o}
888
+ `}};function cB(e,{flow:t,indicator:r,next:n,offset:s,onError:a,parentIndent:i,startOnNewline:o}){let l=!1,u=o,c=o,d="",p="",h=!1,f=!1,m=null,y=null,g=null,b=null,v=null,w=null,k=null;for(let s of e)switch(f&&("space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&a(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),m&&(u&&"comment"!==s.type&&"newline"!==s.type&&a(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),s.type){case"space":!t&&("doc-start"!==r||n?.type!=="flow-collection")&&s.source.includes(" ")&&(m=s),c=!0;break;case"comment":{c||a(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=s.source.substring(1)||" ";d?d+=p+e:d=e,p="",u=!1;break}case"newline":u?d?d+=s.source:w&&"seq-item-ind"===r||(l=!0):p+=s.source,u=!0,h=!0,(y||g)&&(b=s),c=!0;break;case"anchor":y&&a(s,"MULTIPLE_ANCHORS","A node can have at most one anchor"),s.source.endsWith(":")&&a(s.offset+s.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=s,k??(k=s.offset),u=!1,c=!1,f=!0;break;case"tag":g&&a(s,"MULTIPLE_TAGS","A node can have at most one tag"),g=s,k??(k=s.offset),u=!1,c=!1,f=!0;break;case r:(y||g)&&a(s,"BAD_PROP_ORDER",`Anchors and tags must be after the ${s.source} indicator`),w&&a(s,"UNEXPECTED_TOKEN",`Unexpected ${s.source} in ${t??"collection"}`),w=s,u="seq-item-ind"===r||"explicit-key-ind"===r,c=!1;break;case"comma":if(t){v&&a(s,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=s,u=!1,c=!1;break}default:a(s,"UNEXPECTED_TOKEN",`Unexpected ${s.type} token`),u=!1,c=!1}let x=e[e.length-1],$=x?x.offset+x.source.length:s;return f&&n&&"space"!==n.type&&"newline"!==n.type&&"comma"!==n.type&&("scalar"!==n.type||""!==n.source)&&a(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=i||n?.type==="block-map"||n?.type==="block-seq")&&a(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:w,spaceBefore:l,comment:d,hasNewline:h,anchor:y,tag:g,newlineAfterProp:b,end:$,start:k??$}}function cK(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end){for(let t of e.end)if("newline"===t.type)return!0}return!1;case"flow-collection":for(let t of e.items){for(let e of t.start)if("newline"===e.type)return!0;if(t.sep){for(let e of t.sep)if("newline"===e.type)return!0}if(cK(t.key)||cK(t.value))return!0}return!1;default:return!0}}function cZ(e,t,r){if(t?.type==="flow-collection"){let n=t.end[0];n.indent===e&&("]"===n.source||"}"===n.source)&&cK(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function cJ(e,t,r){let{uniqueKeys:n}=e.options;if(!1===n)return!1;let s="function"==typeof n?n:(e,t)=>e===t||l4(e)&&l4(t)&&e.value===t.value;return t.some(e=>s(e.key,r))}let cH="All mapping items must start at the same column";function cW(e,t,r,n){let s="";if(e){let a=!1,i="";for(let o of e){let{source:e,type:l}=o;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=e.substring(1)||" ";s?s+=i+t:s=t,i="";break}case"newline":s&&(i+=e),a=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:s,offset:t}}let cV="Block collections are not allowed within flow collections",cG=e=>e&&("block-map"===e.type||"block-seq"===e.type);function cX(e,t,r,n,s,a){let i="block-map"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,s,a){let i=new(a?.nodeClass??uQ)(r.schema);r.atRoot&&(r.atRoot=!1);let o=n.offset,l=null;for(let a of n.items){let{start:u,key:c,sep:d,value:p}=a,h=cB(u,{indicator:"explicit-key-ind",next:c??d?.[0],offset:o,onError:s,parentIndent:n.indent,startOnNewline:!0}),f=!h.found;if(f){if(c&&("block-seq"===c.type?s(o,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in c&&c.indent!==n.indent&&s(o,"BAD_INDENT",cH)),!h.anchor&&!h.tag&&!d){l=h.end,h.comment&&(i.comment?i.comment+="\n"+h.comment:i.comment=h.comment);continue}(h.newlineAfterProp||cK(c))&&s(c??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&s(o,"BAD_INDENT",cH);r.atKey=!0;let m=h.end,y=c?e(r,c,h,s):t(r,m,u,null,h,s);r.schema.compat&&cZ(n.indent,c,s),r.atKey=!1,cJ(r,i.items,y)&&s(m,"DUPLICATE_KEY","Map keys must be unique");let g=cB(d??[],{indicator:"map-value-ind",next:p,offset:y.range[2],onError:s,parentIndent:n.indent,startOnNewline:!c||"block-scalar"===c.type});if(o=g.end,g.found){f&&(p?.type!=="block-map"||g.hasNewline||s(o,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start<g.found.offset-1024&&s(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let l=p?e(r,p,g,s):t(r,o,d,null,g,s);r.schema.compat&&cZ(n.indent,p,s),o=l.range[2];let u=new uV(y,l);r.options.keepSourceTokens&&(u.srcToken=a),i.items.push(u)}else{f&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),g.comment&&(y.comment?y.comment+="\n"+g.comment:y.comment=g.comment);let e=new uV(y);r.options.keepSourceTokens&&(e.srcToken=a),i.items.push(e)}}return l&&l<o&&s(l,"IMPOSSIBLE","Map comment with trailing content"),i.range=[n.offset,o,l??o],i}(e,t,r,n,a):"block-seq"===r.type?function({composeNode:e,composeEmptyNode:t},r,n,s,a){let i=new(a?.nodeClass??u1)(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let o=n.offset,l=null;for(let{start:a,value:u}of n.items){let c=cB(a,{indicator:"seq-item-ind",next:u,offset:o,onError:s,parentIndent:n.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||u)u?.type==="block-seq"?s(c.end,"BAD_INDENT","All sequence items must start at the same column"):s(o,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(i.comment=c.comment);continue}let d=u?e(r,u,c,s):t(r,c.end,a,null,c,s);r.schema.compat&&cZ(n.indent,u,s),o=d.range[2],i.items.push(d)}return i.range=[n.offset,o,l??o],i}(e,t,r,n,a):function({composeNode:e,composeEmptyNode:t},r,n,s,a){let i="{"===n.start.source,o=i?"flow map":"flow sequence",l=new(a?.nodeClass??(i?uQ:u1))(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset+n.start.source.length;for(let a=0;a<n.items.length;++a){let u=n.items[a],{start:d,key:p,sep:h,value:f}=u,m=cB(d,{flow:o,indicator:"explicit-key-ind",next:p??h?.[0],offset:c,onError:s,parentIndent:n.indent,startOnNewline:!1});if(!m.found){if(!m.anchor&&!m.tag&&!h&&!f){0===a&&m.comma?s(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):a<n.items.length-1&&s(m.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),m.comment&&(l.comment?l.comment+="\n"+m.comment:l.comment=m.comment),c=m.end;continue}!i&&r.options.strict&&cK(p)&&s(p,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===a)m.comma&&s(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(m.comma||s(m.start,"MISSING_CHAR",`Missing , between ${o} items`),m.comment){let e="";e:for(let t of d)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=l.items[l.items.length-1];l9(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,m.comment=m.comment.substring(e.length+1)}}if(i||h||m.found){r.atKey=!0;let a=m.end,y=p?e(r,p,m,s):t(r,a,d,null,m,s);cG(p)&&s(y.range,"BLOCK_IN_FLOW",cV),r.atKey=!1;let g=cB(h??[],{flow:o,indicator:"map-value-ind",next:f,offset:y.range[2],onError:s,parentIndent:n.indent,startOnNewline:!1});if(g.found){if(!i&&!m.found&&r.options.strict){if(h)for(let e of h){if(e===g.found)break;if("newline"===e.type){s(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}m.start<g.found.offset-1024&&s(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else f&&("source"in f&&f.source?.[0]===":"?s(f,"MISSING_CHAR",`Missing space after : in ${o}`):s(g.start,"MISSING_CHAR",`Missing , or : between ${o} items`));let b=f?e(r,f,g,s):g.found?t(r,g.end,h,null,g,s):null;b?cG(f)&&s(b.range,"BLOCK_IN_FLOW",cV):g.comment&&(y.comment?y.comment+="\n"+g.comment:y.comment=g.comment);let v=new uV(y,b);if(r.options.keepSourceTokens&&(v.srcToken=u),i)cJ(r,l.items,y)&&s(a,"DUPLICATE_KEY","Map keys must be unique"),l.items.push(v);else{let e=new uQ(r.schema);e.flow=!0,e.items.push(v);let t=(b??y).range;e.range=[y.range[0],t[1],t[2]],l.items.push(e)}c=b?b.range[2]:g.end}else{let n=f?e(r,f,m,s):t(r,m.end,h,null,m,s);l.items.push(n),c=n.range[2],cG(f)&&s(n.range,"BLOCK_IN_FLOW",cV)}}let d=i?"}":"]",[p,...h]=n.end,f=c;if(p?.source===d)f=p.offset+p.source.length;else{let e=o[0].toUpperCase()+o.substring(1),t=u?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;s(c,u?"MISSING_CHAR":"BAD_INDENT",t),p&&1!==p.source.length&&h.unshift(p)}if(h.length>0){let e=cW(h,f,r.options.strict,s);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[n.offset,f,e.offset]}else l.range=[n.offset,f,f];return l}(e,t,r,n,a),o=i.constructor;return"!"===s||s===o.tagName?i.tag=o.tagName:s&&(i.tag=s),i}function cY(e,t,r){let n=t.offset,s=function({offset:e,props:t},r,n){if("block-scalar-header"!==t[0].type)return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=t[0],a=s[0],i=0,o="",l=-1;for(let t=1;t<s.length;++t){let r=s[t];if(o||"-"!==r&&"+"!==r){let n=Number(r);!i&&n?i=n:-1===l&&(l=e+t)}else o=r}-1!==l&&n(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let u=!1,c="",d=s.length;for(let e=1;e<t.length;++e){let s=t[e];switch(s.type){case"space":u=!0;case"newline":d+=s.source.length;break;case"comment":r&&!u&&n(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=s.source.length,c=s.source.substring(1);break;case"error":n(s,"UNEXPECTED_TOKEN",s.message),d+=s.source.length;break;default:{let e=`Unexpected token in block scalar header: ${s.type}`;n(s,"UNEXPECTED_TOKEN",e);let t=s.source;t&&"string"==typeof t&&(d+=t.length)}}}return{mode:a,indent:i,chomp:o,comment:c,length:d}}(t,e.options.strict,r);if(!s)return{value:"",type:null,comment:"",range:[n,n,n]};let a=">"===s.mode?uk.BLOCK_FOLDED:uk.BLOCK_LITERAL,i=t.source?function(e){let t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let e=1;e<t.length;e+=2)s.push([t[e],t[e+1]]);return s}(t.source):[],o=i.length;for(let e=i.length-1;e>=0;--e){let t=i[e][1];if(""===t||"\r"===t)o=e;else break}if(0===o){let e="+"===s.chomp&&i.length>0?"\n".repeat(Math.max(1,i.length-1)):"",r=n+s.length;return t.source&&(r+=t.source.length),{value:e,type:a,comment:s.comment,range:[n,r,r]}}let l=t.indent+s.indent,u=t.offset+s.length,c=0;for(let t=0;t<o;++t){let[n,a]=i[t];if(""===a||"\r"===a)0===s.indent&&n.length>l&&(l=n.length);else{n.length<l&&r(u+n.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),0===s.indent&&(l=n.length),c=t,0!==l||e.atRoot||r(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=n.length+a.length+1}for(let e=i.length-1;e>=o;--e)i[e][0].length>l&&(o=e+1);let d="",p="",h=!1;for(let e=0;e<c;++e)d+=i[e][0].slice(l)+"\n";for(let e=c;e<o;++e){let[t,n]=i[e];u+=t.length+n.length+1;let o="\r"===n[n.length-1];if(o&&(n=n.slice(0,-1)),n&&t.length<l){let e=s.indent?"explicit indentation indicator":"first line",a=`Block scalar lines must not be less indented than their ${e}`;r(u-n.length-(o?2:1),"BAD_INDENT",a),t=""}a===uk.BLOCK_LITERAL?(d+=p+t.slice(l)+n,p="\n"):t.length>l||" "===n[0]?(" "===p?p="\n":h||"\n"!==p||(p="\n\n"),d+=p+t.slice(l)+n,p="\n",h=!0):""===n?"\n"===p?d+="\n":p="\n":(d+=p+n,p=" ",h=!1)}switch(s.chomp){case"-":break;case"+":for(let e=o;e<i.length;++e)d+="\n"+i[e][0].slice(l);"\n"!==d[d.length-1]&&(d+="\n");break;default:d+="\n"}let f=n+s.length+t.source.length;return{value:d,type:a,comment:s.comment,range:[n,f,f]}}function cQ(e,t,r){let n,s,{offset:a,type:i,source:o,end:l}=e,u=(e,t,n)=>r(a+e,t,n);switch(i){case"scalar":n=uk.PLAIN,s=function(e,t){let r="";switch(e[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":r=`block scalar indicator ${e[0]}`;break;case"@":case"`":r=`reserved character ${e[0]}`}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),c0(e)}(o,u);break;case"single-quoted-scalar":var c,d;n=uk.QUOTE_SINGLE,c=o,d=u,("'"!==c[c.length-1]||1===c.length)&&d(c.length,"MISSING_CHAR","Missing closing 'quote"),s=c0(c.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":n=uk.QUOTE_DOUBLE,s=function(e,t){let r="";for(let n=1;n<e.length-1;++n){let s=e[n];if("\r"!==s||"\n"!==e[n+1])if("\n"===s){let{fold:t,offset:s}=function(e,t){let r="",n=e[t+1];for(;(" "===n||" "===n||"\n"===n||"\r"===n)&&("\r"!==n||"\n"===e[t+2]);)"\n"===n&&(r+="\n"),t+=1,n=e[t+1];return r||(r=" "),{fold:r,offset:t}}(e,n);r+=t,n=s}else if("\\"===s){let s=e[++n],a=c1[s];if(a)r+=a;else if("\n"===s)for(s=e[n+1];" "===s||" "===s;)s=e[++n+1];else if("\r"===s&&"\n"===e[n+1])for(s=e[++n+1];" "===s||" "===s;)s=e[++n+1];else if("x"===s||"u"===s||"U"===s){let a="x"===s?2:"u"===s?4:8;r+=function(e,t,r,n){let s=e.substr(t,r),a=s.length===r&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):0/0;try{return String.fromCodePoint(a)}catch{let s=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}(e,n+1,a,t),n+=a}else{let s=e.substr(n-1,2);t(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),r+=s}}else if(" "===s||" "===s){let t=n,a=e[n+1];for(;" "===a||" "===a;)a=e[++n+1];"\n"!==a&&("\r"!==a||"\n"!==e[n+2])&&(r+=n>t?e.slice(t,n+1):s)}else r+=s}return('"'!==e[e.length-1]||1===e.length)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),r}(o,u);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[a,a+o.length,a+o.length]}}let p=a+o.length,h=cW(l,p,t,r);return{value:s,type:n,comment:h.comment,range:[a,p,h.offset]}}function c0(e){let t,r,n=/(.*?)\r?\n/sy,s=n.exec(e);if(!s)return e;try{t=RegExp("(?<![ ])[ ]+$"),r=RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{t=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let a=s[1].replace(t,""),i=" ",o=n.lastIndex;for(;s=n.exec(e);){let e=s[1].replace(r,"");""===e?"\n"===i?a+=i:i="\n":(a+=i+e,i=" "),o=n.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(e),a+i+(s?.[1]??"")}let c1={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function c2(e,t,r,n){let s,a,{value:i,type:o,comment:l,range:u}="block-scalar"===t.type?cY(e,t,n):cQ(t,e.options.strict,n),c=r?e.directives.tagName(r.source,e=>n(r,"TAG_RESOLVE_FAILED",e)):null;s=e.options.stringKeys&&e.atKey?e.schema[lY]:c?function(e,t,r,n,s){if("!"===r)return e[lY];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(!t.default||!t.test)return t;else a.push(t);for(let e of a)if(e.test?.test(t))return e;let i=e.knownTags[r];return i&&!i.collection?(e.tags.push(Object.assign({},i,{default:!1,test:void 0})),i):(s(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,"tag:yaml.org,2002:str"!==r),e[lY])}(e.schema,i,c,r,n):"scalar"===t.type?function({atKey:e,directives:t,schema:r},n,s,a){let i=r.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(n))||r[lY];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(n))??r[lY];if(i.tag!==e.tag){let r=t.tagString(i.tag),n=t.tagString(e.tag);a(s,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${r} or ${n}`,!0)}}return i}(e,i,t,n):e.schema[lY];try{let o=s.resolve(i,e=>n(r??t,"TAG_RESOLVE_FAILED",e),e.options);a=l4(o)?o:new uk(o)}catch(e){n(r??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),a=new uk(i)}return a.range=u,a.source=i,o&&(a.type=o),c&&(a.tag=c),s.format&&(a.format=s.format),l&&(a.comment=l),a}let c5={composeNode:c9,composeEmptyNode:c4};function c9(e,t,r,n){let s,a=e.atKey,{spaceBefore:i,comment:o,anchor:l,tag:u}=r,c=!0;switch(t.type){case"alias":s=function({options:e},{offset:t,source:r,end:n},s){let a=new uv(r.substring(1));""===a.source&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&s(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let i=t+r.length,o=cW(n,i,e.strict,s);return a.range=[t,i,o.offset],o.comment&&(a.comment=o.comment),a}(e,t,n),(l||u)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":s=c2(e,t,u,n),l&&(s.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{s=function(e,t,r,n,s){let a=n.tag,i=a?t.directives.tagName(a.source,e=>s(a,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===r.type){let{anchor:e,newlineAfterProp:t}=n,r=e&&a?e.offset>a.offset?e:a:e??a;r&&(!t||t.offset<r.offset)&&s(r,"MISSING_CHAR","Missing newline after block sequence props")}let o="block-map"===r.type?"map":"block-seq"===r.type?"seq":"{"===r.start.source?"map":"seq";if(!a||!i||"!"===i||i===uQ.tagName&&"map"===o||i===u1.tagName&&"seq"===o)return cX(e,t,r,s,i);let l=t.schema.tags.find(e=>e.tag===i&&e.collection===o);if(!l){let n=t.schema.knownTags[i];if(n?.collection!==o)return n?s(a,"BAD_COLLECTION_TYPE",`${n.tag} used for ${o} collection, but expects ${n.collection??"scalar"}`,!0):s(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,!0),cX(e,t,r,s,i);t.schema.tags.push(Object.assign({},n,{default:!1})),l=n}let u=cX(e,t,r,s,i,l),c=l.resolve?.(u,e=>s(a,"TAG_RESOLVE_FAILED",e),t.options)??u,d=l8(c)?c:new uk(c);return d.range=u.range,d.tag=i,l?.format&&(d.format=l.format),d}(c5,e,t,r,n),l&&(s.anchor=l.source.substring(1))}catch(e){n(t,"RESOURCE_EXHAUSTION",e instanceof Error?e.message:String(e))}break;default:{let e="error"===t.type?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",e),c=!1}}return s??(s=c4(e,t.offset,void 0,null,r,n)),l&&""===s.anchor&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!l4(s)||"string"!=typeof s.value||s.tag&&"tag:yaml.org,2002:str"!==s.tag)&&n(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(s.spaceBefore=!0),o&&("scalar"===t.type&&""===t.source?s.comment=o:s.commentBefore=o),e.options.keepSourceTokens&&c&&(s.srcToken=t),s}function c4(e,t,r,n,{spaceBefore:s,comment:a,anchor:i,tag:o,end:l},u){let c=c2(e,{type:"scalar",offset:function(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let r=t[n];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++n];r?.type==="space";)e+=r.source.length,r=t[++n];break}}return e}(t,r,n),indent:-1,source:""},o,u);return i&&(c.anchor=i.source.substring(1),""===c.anchor&&u(i,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(c.spaceBefore=!0),a&&(c.comment=a,c.range[2]=l),c}function c6(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+("string"==typeof r?r.length:1)]}function c3(e){let t="",r=!1,n=!1;for(let s=0;s<e.length;++s){let a=e[s];switch(a[0]){case"#":t+=(""===t?"":n?"\n\n":"\n")+(a.substring(1)||" "),r=!0,n=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}class c8{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,r,n)=>{let s=c6(e);n?this.warnings.push(new cF(s,t,r)):this.errors.push(new cU(s,t,r))},this.directives=new up({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:n}=c3(this.prelude);if(r){let s=e.contents;if(t)e.comment=e.comment?`${e.comment}
889
+ ${r}`:r;else if(n||e.directives.docStart||!s)e.commentBefore=r;else if(l3(s)&&!s.flow&&s.items.length>0){let e=s.items[0];l9(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${r}
890
+ ${t}`:r}else{let e=s.commentBefore;s.commentBefore=e?`${r}
891
+ ${e}`:r}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:c3(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let t of e)yield*this.next(t);yield*this.end(t,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,r,n)=>{let s=c6(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=function(e,t,{offset:r,start:n,value:s,end:a},i){let o=new cP(void 0,Object.assign({_directives:t},e)),l={atKey:!1,atRoot:!0,directives:o.directives,options:o.options,schema:o.schema},u=cB(n,{indicator:"doc-start",next:s??a?.[0],offset:r,onError:i,parentIndent:0,startOnNewline:!0});u.found&&(o.directives.docStart=!0,s&&("block-map"===s.type||"block-seq"===s.type)&&!u.hasNewline&&i(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),o.contents=s?c9(l,s,u,i):c4(l,u.end,n,null,u,i);let c=o.contents.range[2],d=cW(a,c,!1,i);return d.comment&&(o.comment=d.comment),o.range=[r,c,d.offset],o}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new cU(c6(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new cU(c6(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=cW(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
892
+ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new cU(c6(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new cP(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}}function c7(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function de(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let n=e.props.slice(1),s=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(s-=e.props[0].source.length),n))t.offset+=s;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{let n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{let n="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:r,indent:n,source:t,end:s})}}}let dt=Symbol("break visit"),dr=Symbol("skip children"),dn=Symbol("remove item");function ds(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,r,n){let s=n(r,t);if("symbol"==typeof s)return s;for(let a of["key","value"]){let i=r[a];if(i&&"items"in i){for(let r=0;r<i.items.length;++r){let s=e(Object.freeze(t.concat([[a,r]])),i.items[r],n);if("number"==typeof s)r=s-1;else{if(s===dt)return dt;s===dn&&(i.items.splice(r,1),r-=1)}}"function"==typeof s&&"key"===a&&(s=s(r,t))}}return"function"==typeof s?s(r,t):s}(Object.freeze([]),e,t)}function da(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function di(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=di(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=dl(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=dl(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=dl(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function dl({start:e,key:t,sep:r,value:n}){let s="";for(let t of e)s+=t.source;if(t&&(s+=di(t)),r)for(let e of r)s+=e.source;return n&&(s+=di(n)),s}ds.BREAK=dt,ds.SKIP=dr,ds.REMOVE=dn,ds.itemAtPath=(e,t)=>{let r=e;for(let[e,n]of t){let t=r?.[e];if(!t||!("items"in t))return;r=t.items[n]}return r},ds.parentCollection=(e,t)=>{let r=ds.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],s=r?.[n];if(s&&"items"in s)return s;throw Error("Parent collection not found")},e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","createScalarToken",0,function(e,t){let{implicitKey:r=!1,indent:n,inFlow:s=!1,offset:a=-1,type:i="PLAIN"}=t,o=uL({type:i,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:n,source:"\n"}];switch(o[0]){case"|":case">":{let e=o.indexOf("\n"),t=o.substring(0,e),r=o.substring(e+1)+"\n",s=[{type:"block-scalar-header",offset:a,indent:n,source:t}];return c7(s,l)||s.push({type:"newline",offset:-1,indent:n,source:"\n"}),{type:"block-scalar",offset:a,indent:n,props:s,source:r}}case'"':return{type:"double-quoted-scalar",offset:a,indent:n,source:o,end:l};case"'":return{type:"single-quoted-scalar",offset:a,indent:n,source:o,end:l};default:return{type:"scalar",offset:a,indent:n,source:o,end:l}}},"isCollection",0,e=>!!e&&"items"in e,"isScalar",0,e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),"prettyToken",0,function(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}},"resolveAsScalar",0,function(e,t=!0,r){if(e){let n=(e,t,n)=>{let s="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(r)r(s,t,n);else throw new cU([s,s+1],t,n)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return cQ(e,t,n);case"block-scalar":return cY({options:{strict:t}},e,n)}}return null},"setScalarValue",0,function(e,t,r={}){let{afterKey:n=!1,implicitKey:s=!1,inFlow:a=!1,type:i}=r,o="indent"in e?e.indent:null;if(n&&"number"==typeof o&&(o+=2),!i)switch(e.type){case"single-quoted-scalar":i="QUOTE_SINGLE";break;case"double-quoted-scalar":i="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");i=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:i="PLAIN"}let l=uL({type:i,value:t},{implicitKey:s||null===o,indent:null!==o&&o>0?" ".repeat(o):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let r=t.indexOf("\n"),n=t.substring(0,r),s=t.substring(r+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=n,e.source=s}else{let{offset:t}=e,r="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:t,indent:r,source:n}];for(let t of(c7(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:r,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:r,props:a,source:s})}}(e,l);break;case'"':de(e,l,"double-quoted-scalar");break;case"'":de(e,l,"single-quoted-scalar");break;default:de(e,l,"scalar")}},"stringify",0,e=>"type"in e?di(e):dl(e),"tokenType",0,da,"visit",0,ds],91723);var du=e.i(91723);function dc(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let dd=new Set("0123456789ABCDEFabcdef"),dp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),dh=new Set(",[]{}"),df=new Set(" ,[]{}\n\r "),dm=e=>!e||df.has(e);class dy{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;" "===t;)t=this.buffer[++r+e];if("\r"===t){let t=this.buffer[r+e+1];if("\n"===t||!t&&!this.atEnd)return e+r+1}return"\n"!==t&&!(r>=this.indentNext)&&(t||this.atEnd)?-1:e+r}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&dc(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,r=e.indexOf("#");for(;-1!==r;){let n=e[r-1];if(" "===n||" "===n){t=r-1;break}r=e.indexOf("#",r+1)}for(;;){let r=e[t-1];if(" "===r||" "===r)t-=1;else break}let n=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"\x02",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&dc(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!dc(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&dc(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(dm),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0)let n=this.getLine();if(null===n)return this.setNext("flow");if((-1!==r&&r<this.indentNext&&"#"!==n[0]||0===r&&(n.startsWith("---")||n.startsWith("..."))&&dc(n[3]))&&(r!==this.indentNext-1||1!==this.flowLevel||"]"!==n[0]&&"}"!==n[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let s=0;for(;","===n[s];)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n[s+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(dm),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||dc(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),n=r.indexOf("\n",this.pos);if(-1!==n){for(;-1!==n;){let e=this.continueScalar(n+1);if(-1===e)break;n=r.indexOf("\n",e)}-1!==n&&(t=n-("\r"===r[n-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>dc(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,r=0;e:for(let n=this.pos;e=this.buffer[n];++n)switch(e){case" ":r+=1;break;case"\n":t=n,r=0;break;case"\r":{let e=this.buffer[n+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=r:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t)if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let n=t+1;for(e=this.buffer[n];" "===e;)e=this.buffer[++n];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++n];t=n-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,n=this.buffer[e];"\r"===n&&(n=this.buffer[--e]);let s=e;for(;" "===n;)n=this.buffer[--e];if("\n"===n&&e>=this.pos&&e+1+r>s)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,r=this.pos-1,n=this.pos-1;for(;e=this.buffer[++n];)if(":"===e){let e=this.buffer[n+1];if(dc(e)||t&&dh.has(e))break;r=n}else if(dc(e)){let s=this.buffer[n+1];if("\r"===e&&("\n"===s?(n+=1,e="\n",s=this.buffer[n+1]):r=n),"#"===s||t&&dh.has(s))break;if("\n"===e){let e=this.continueScalar(n+1);if(-1===e)break;n=Math.max(n,e-2)}}else{if(t&&dh.has(e))break;r=n}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(r+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(dm),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(dc(r)||t&&dh.has(r)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!dc(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(dp.has(t))t=this.buffer[++e];else if("%"===t&&dd.has(this.buffer[e+1])&&dd.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,r=this.pos-1;do t=this.buffer[++r];while(" "===t||e&&" "===t)let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function dg(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function db(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function dv(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function dw(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function dk(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function dx(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function d$(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||dg(t.start,"explicit-key-ind")||dg(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,dv(t.value)?t.value.end?dx(t.value.end,t.sep):t.value.end=t.sep:dx(t.start,t.sep),delete t.sep)}class dS{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new dy,this.onNewLine=e}*parse(e,t=!1){for(let r of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=da(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&d$(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let r=e.items[e.items.length-1];if(r.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=e.items[e.items.length-1];r.value?e.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=e.items[e.items.length-1];!r||r.value?e.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&-1===db(r.start)&&(0===t.indent||r.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=r.start:e.items.push({start:r.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==db(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,r=dk(dw(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){dx(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,n=r&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,s=[];if(n&&t.sep&&!t.value){let r=[];for(let n=0;n<t.sep.length;++n){let s=t.sep[n];switch(s.type){case"newline":r.push(n);break;case"space":break;case"comment":s.indent>e.indent&&(r.length=0);break;default:r.length=0}}r.length>=2&&(s=t.sep.splice(r[1]))}switch(this.type){case"anchor":case"tag":n||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?n||t.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}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(dg(t.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(dv(t.key)&&!dg(t.sep,"newline")){let e=dk(t.start),r=t.key,n=t.sep;n.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:r,sep:n}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(dg(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=dk(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:s,key:null,sep:[this.sourceToken]}):dg(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);n||t.value?(e.items.push({start:s,key:r,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(r):(Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0);return}default:{let n=this.startBlockValue(e);if(n){if("block-seq"===n.type){if(!t.explicitKey&&t.sep&&!dg(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else r&&e.items.push({start:s});this.stack.push(n);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0,n=Array.isArray(r)?r[r.length-1]:void 0;n?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let r=e.items[e.items.length-2],n=r?.value?.end;if(Array.isArray(n)){dx(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||dg(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let r=dk(dw(t));d$(e);let n=e.end.splice(1,e.end.length);n.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+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 t=dk(dw(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=dk(dw(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(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],"newline"===this.type&&(yield*this.pop())}}}class d_{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){let n=t+r>>1;this.lineStarts[n]<e?t=n+1:r=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let n=this.lineStarts[t-1];return{line:t,col:e-n+1}}}}function dA(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new d_||null,prettyErrors:t}}function dT(e,t={}){let{lineCounter:r,prettyErrors:n}=dA(t),s=new dS(r?.addNewLine),a=new c8(t),i=null;for(let t of a.compose(s.parse(e),!0,e.length))if(i){if("silent"!==i.options.logLevel){i.errors.push(new cU(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else i=t;return n&&r&&(i.errors.forEach(cD(e,r)),i.warnings.forEach(cD(e,r))),i}function dO(e,t,r){let n;"function"==typeof t?n=t:void 0===r&&t&&"object"==typeof t&&(r=t);let s=dT(e,r);if(!s)return null;if(s.warnings.forEach(e=>uD(s.options.logLevel,e)),s.errors.length>0)if("silent"!==s.options.logLevel)throw s.errors[0];else s.errors=[];return s.toJS(Object.assign({reviver:n},r))}e.s(["Alias",0,uv,"CST",0,du,"Composer",0,c8,"Document",0,cP,"Lexer",0,dy,"LineCounter",0,d_,"Pair",0,uV,"Parser",0,dS,"Scalar",0,uk,"Schema",0,cz,"YAMLError",0,cL,"YAMLMap",0,uQ,"YAMLParseError",0,cU,"YAMLSeq",0,u1,"YAMLWarning",0,cF,"isAlias",0,l1,"isCollection",0,l3,"isDocument",0,l2,"isMap",0,l5,"isNode",0,l8,"isPair",0,l9,"isScalar",0,l4,"isSeq",0,l6,"parse",0,dO,"parseAllDocuments",0,function(e,t={}){let{lineCounter:r,prettyErrors:n}=dA(t),s=new dS(r?.addNewLine),a=new c8(t),i=Array.from(a.compose(s.parse(e)));if(n&&r)for(let t of i)t.errors.forEach(cD(e,r)),t.warnings.forEach(cD(e,r));return i.length>0?i:Object.assign([],{empty:!0},a.streamInfo())},"parseDocument",0,dT,"stringify",0,function(e,t,r){let n=null;if("function"==typeof t||Array.isArray(t)?n=t:void 0===r&&t&&(r=t),"string"==typeof r&&(r=r.length),"number"==typeof r){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=r??t??{};if(!e)return}return l2(e)&&!n?e.toString(r):new cP(e,n,r).toString(r)},"visit",0,un,"visitAsync",0,ua],32861),e.i(32861);let dE=/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S+)(?:\s+HTTP\/[\d.]+)?\s*$/,dj=e=>e.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")||"Imported";function dM(e,t,r=""){let n=t.replace(/\s+$/,"");if(!n)return e;let s=/json/i.test(r)||/^\s*[{[]/.test(n);return{...e,bodyMode:s?"json":"text",bodyText:n}}function dN(e,t,r,n){let s=d4(t,e,r,n);return{...s.draft,headers:s.headers}}function dI(e,t){let r=dj(t),n=new Set,s=e=>n.add(e),a=[],i=[],o=e.replace(/\r\n?/g,"\n").split(/^###(.*)$/m),l=[{title:"",text:o[0]}];for(let e=1;e<o.length;e+=2)l.push({title:o[e].trim(),text:o[e+1]??""});for(let[e,{title:t,text:n}]of l.entries()){let o=n.split("\n"),l=t,u=0;for(;u<o.length;u++){let e=o[u].trim();if(!e)continue;let t=/^(?:#|\/\/)\s*@name\s+(.+)$/.exec(e);if(t){l=t[1].trim();continue}let r=/^@([\w.-]+)\s*=\s*(.*)$/.exec(e);if(r){a.push({key:r[1],value:r[2].trim(),secret:!1});continue}if(/^(#|\/\/)/.test(e)){l||(l=e.replace(/^(#|\/\/)\s*/,"").slice(0,120));continue}break}if(u>=o.length)continue;let c=o[u].trim(),d=dE.exec(c)??(/^(https?:\/\/|\{\{)/.test(c)?["","GET",c.split(/\s+/)[0]]:null);if(!d){s(`Request ${e+1}: "${c.slice(0,60)}" isn't a request line — skipped`);continue}let p=d[1],h=d[2];for(u++;u<o.length&&/^\s+[?&]/.test(o[u]);)h+=o[u++].trim();let f=[];for(;u<o.length;u++){let e=o[u];if(!e.trim()){u++;break}if(/^\s*(#|\/\/)/.test(e))continue;let t=/^([^:\s][^:]*):\s*(.*)$/.exec(e.trim());t&&f.push({key:t[1].trim(),value:t[2].trim()})}let m=o.slice(u),y=m.findIndex(e=>/^\s*>\s/.test(e)||/^\s*<>\s/.test(e));y>=0&&s(`${l||`${p} ${h}`}: response handler scripts (> {% … %}) aren't imported — add checks on the Checks tab`);let g=(y>=0?m.slice(0,y):m).filter(e=>!/^\s*(#|\/\/)/.test(e));g.some(e=>/^\s*<\s+\S/.test(e))&&s(`${l||`${p} ${h}`}: a body read from a file (< path) — choose the file again in the Body tab`);let b=l||`${p} ${h}`,v=lk({...ld(),method:p},h),w=f.find(e=>/^content-type$/i.test(e.key))?.value??"";if(v=dM(v,g.filter(e=>!/^\s*<\s+\S/.test(e)).join("\n"),w),i.push({collection:ln(r),name:(l||`${p} ${h.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120),request:dN(v,f,s,b)}),i.length>=2e3)break}if(!i.length)throw Error("No requests found — each request starts with a line like GET https://api.example.com/items");let u=a.length?[{name:r,variables:function(e){let t=new Map;for(let r of e)t.set(r.key,r);return[...t.values()]}(a)}]:[];return{kind:"http",title:r,requests:i,environments:u,warnings:[...n]}}let dq=e=>e.trim().replace(/^\$\.?/,"").replace(/\['([^']+)'\]/g,".$1").replace(/^\./,"")||"",dC=e=>{let t=e.trim();if(/^".*"$/.test(t))try{return JSON.parse(t)}catch{return t.slice(1,-1)}return t};function dz(e,t){let r=dj(t),n=new Set,s=e=>n.add(e),a=[],i=e.replace(/\r\n?/g,"\n").split("\n"),o=[],l=null,u="headers",c=null,d=!1,p="";for(let e of i){let t=e.replace(/\s+$/,"");if(d){/^```/.test(t.trim())?d=!1:l?.body.push(e);continue}if(/^\s*#/.test(t)){p=t.replace(/^\s*#\s*/,"").trim();continue}let r=dE.exec(t.trim());if(r&&!t.startsWith(" ")){l={method:r[1],url:r[2],headers:[],sections:new Map,body:[],status:null,response:new Map,comment:p},p="",o.push(l),u="headers",c=null;continue}if(!l)continue;let n=/^HTTP(?:\/[\d.]+)?\s+(\d{3}|\*)/.exec(t.trim());if(n){l.status="*"===n[1]?null:n[1],u="response",c=null;continue}let s=/^\[(\w+)\]$/.exec(t.trim());if(s){c=s[1],("response"===u?l.response:l.sections).set(c,[]);continue}if(!t.trim()){"headers"===u&&!c&&l.headers.length&&(u="body");continue}if(c){("response"===u?l.response:l.sections).get(c).push(t.trim());continue}if("headers"===u){let e=/^([\w-]+):\s*(.*)$/.exec(t.trim());if(e){l.headers.push({key:e[1],value:e[2]});continue}u="body"}if("body"===u){if(/^```/.test(t.trim())){d=!0;continue}l.body.push(e)}}let h=(e=[])=>e.map(e=>/^([^:]+):\s*(.*)$/.exec(e)).filter(e=>!!e).map(e=>({key:e[1].trim(),value:dC(e[2])}));for(let e of o){let t=e.comment||`${e.method} ${e.url}`,n=lk({...ld(),method:e.method},e.url),i=h(e.sections.get("QueryStringParams")??e.sections.get("Query"));i.length&&(n={...n,params:[...n.params,...i]});let o=h(e.sections.get("BasicAuth"))[0];o&&(n={...n,authMode:"basic",username:o.key,password:o.value});let l=h(e.sections.get("FormParams")??e.sections.get("Form")),u=h(e.sections.get("MultipartFormData")??e.sections.get("Multipart"));if(l.length)n={...n,bodyMode:"form",formRows:l.map(e=>({...e,kind:"text",file:null}))};else if(u.length){let e=u.map(e=>/^file,/.test(e.value)?{key:e.key,value:"",kind:"file",file:null}:{...e,kind:"text",file:null});e.some(e=>"file"===e.kind)&&s(`${t}: choose the files for the form again in the Body tab`),n={...n,bodyMode:"multipart",formRows:e}}else{let r=e.body.join("\n").trim();/^file,/.test(r)?s(`${t}: a body read from a file — choose it again (Body → File)`):n=dM(n,r.replace(/^`([\s\S]*)`$/,"$1"),e.headers.find(e=>/^content-type$/i.test(e.key))?.value??"")}let c=[];e.status&&c.push({type:"status",expect:e.status});let d=0;for(let t of e.response.get("Asserts")??[]){let e=function(e){let t=/^(jsonpath|header|status|body|duration)(?:\s+("(?:[^"\\]|\\.)*"))?\s+(not\s+)?(==|!=|>=|<=|>|<|contains|startsWith|endsWith|matches|exists|isString|isNumber|isInteger|isFloat|isBoolean|isCollection|isList|isObject|count)\s*(.*)$/.exec(e.trim());if(!t)return null;let[,r,n="",s,a,i=""]=t,o=dC(i);if("status"===r&&"=="===a&&!s)return{type:"status",expect:o};if("duration"===r&&("<"===a||"<="===a))return{type:"time",maxMs:Number(o)||1e3};if("body"===r&&"contains"===a)return{type:"body",op:s?"not_contains":"contains",value:o};if("body"===r&&"matches"===a)return{type:"body",op:"matches",value:o.replace(/^\/|\/$/g,"")};if("header"===r){let e=dC(n);return"exists"===a?{type:"header",name:e,op:s?"not_exists":"exists",value:""}:"=="!==a||s?"contains"!==a||s?"matches"!==a||s?null:{type:"header",name:e,op:"matches",value:o.replace(/^\/|\/$/g,"")}:{type:"header",name:e,op:"contains",value:o}:{type:"header",name:e,op:"equals",value:o}}if("jsonpath"===r){let e=dq(dC(n));if(!e)return null;if("exists"===a)return{type:"json",path:e,op:s?"not_exists":"exists",value:""};if("=="===a)return{type:"json",path:e,op:s?"not_equals":"equals",value:o};if("!="===a)return{type:"json",path:e,op:"not_equals",value:o};if("contains"===a&&!s)return{type:"json",path:e,op:"contains",value:o};if((">"===a||">="===a)&&!s)return{type:"json",path:e,op:"greater",value:">="===a?String(Number(o)-1e-9):o};if(("<"===a||"<="===a)&&!s)return{type:"json",path:e,op:"less",value:"<="===a?String(Number(o)+1e-9):o};if("matches"===a&&!s)return{type:"json",path:e,op:"matches",value:o.replace(/^\/|\/$/g,"")};if("count"===a&&!s)return{type:"json",path:e,op:"length",value:i.replace(/^==\s*/,"").trim()};let t={isString:"string",isNumber:"number",isInteger:"number",isFloat:"number",isBoolean:"boolean",isCollection:"array",isList:"array",isObject:"object"};if(t[a]&&!s)return{type:"json",path:e,op:"type",value:t[a]}}return null}(t);e?c.push(e):d++}d&&s(`${t}: ${d} assert${1===d?"":"s"} the app has no check for were left out`);let p=[];for(let r of e.response.get("Captures")??[]){let e=/^([A-Za-z_][\w]*)\s*:\s*(jsonpath|header)\s+("(?:[^"\\]|\\.)*")/.exec(r);e?p.push({name:e[1],from:"header"===e[2]?"header":"json",path:"header"===e[2]?dC(e[3]):dq(dC(e[3]))}):s(`${t}: a capture the app can't take ("${r.slice(0,50)}") was left out`)}n={...n,checks:c,saveValues:p};let f=(e.comment||`${e.method} ${e.url.replace(/^\{\{[^}]+\}\}/,"")}`).slice(0,120);if(a.push({collection:ln(r),name:f,request:dN(n,e.headers,s,t)}),a.length>=2e3)break}if(!a.length)throw Error("No requests found in this Hurl file");return{kind:"hurl",title:r,requests:a,environments:[],warnings:[...n]}}function dP(e=""){return e.split("\n").map(e=>/^(~?)([^:]+):\s?(.*)$/.exec(e.trim())).filter(e=>!!e).map(e=>({key:e[2].trim(),value:e[3],enabled:!e[1]}))}function dR(e,t){let r=e.name,n=e.method.toUpperCase(),s=lk({...ld(),method:ls.includes(n)?n:"GET"},e.url),a=e.params.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),i=new Set(s.params.map(e=>e.key)),o=a.filter(e=>!i.has(e.key));o.length&&(s={...s,params:[...s.params,...o]});let l=e.body;switch(e.bodyMode){case"json":s=dM(s,l.json??"","json");break;case"text":"json"!==(s=dM({...s},l.text??"","text/plain")).bodyMode||/^\s*[{[]/.test(l.text??"")||(s={...s,bodyMode:"text"});break;case"xml":l.xml&&(s={...s,bodyMode:"text",bodyText:l.xml});break;case"graphql":s={...s,bodyMode:"graphql",graphqlQuery:l.graphql?.query??"",graphqlVariables:l.graphql?.variables??""};break;case"formUrlEncoded":s={...s,bodyMode:"form",formRows:l.form.map(e=>({...e,kind:"text",file:null}))};break;case"multipartForm":l.multipart.some(e=>e.file)&&t(`${r}: choose the files for the form again in the Body tab`),s={...s,bodyMode:"multipart",formRows:l.multipart.map(e=>e.file?{key:e.key,value:"",kind:"file",file:null}:{key:e.key,value:e.value,kind:"text",file:null})}}let u=e.auth;"bearer"===u.mode?s={...s,authMode:"bearer",token:u.token??""}:"basic"===u.mode?s={...s,authMode:"basic",username:u.username??"",password:u.password??""}:"apikey"===u.mode?s={...s,authMode:"api_key",apiName:u.key||"X-API-Key",apiValue:u.value??"",apiIn:"queryparams"===u.placement?"query":"header"}:"none"===u.mode?s={...s,authMode:"none"}:u.mode&&"inherit"!==u.mode&&t(`${r}: ${u.mode} auth isn't imported from Bruno — set it on the Auth tab`);let c=[],d=0;for(let t of e.assertions.filter(e=>e.enabled)){let e=function(e,t){let r=/^(eq|neq|gt|gte|lt|lte|contains|notContains|isDefined|isUndefined|isNull|isString|isNumber|isBoolean|isArray|isJson|matches|length)\s*(.*)$/.exec(t.trim());if(!r)return null;let[,n,s=""]=r,a=dC(s);if("res.status"===e&&"eq"===n)return{type:"status",expect:a};if("res.responseTime"===e&&("lt"===n||"lte"===n))return{type:"time",maxMs:Number(a)||1e3};let i=/^res\.headers?\[["']?([^"'\]]+)["']?\]$|^res\.headers?\.([\w-]+)$/.exec(e);if(i){let e=i[1]??i[2];return"isDefined"===n?{type:"header",name:e,op:"exists",value:""}:"eq"===n?{type:"header",name:e,op:"equals",value:a}:"contains"===n?{type:"header",name:e,op:"contains",value:a}:null}if("res.body"===e&&"contains"===n)return{type:"body",op:"contains",value:a};if("res.body"===e&&"isJson"===n)return{type:"body",op:"is_json",value:""};let o=/^res\.body\.?(.*)$/.exec(e)?.[1];if(!o)return null;switch(n){case"eq":return{type:"json",path:o,op:"equals",value:a};case"neq":return{type:"json",path:o,op:"not_equals",value:a};case"gt":case"gte":return{type:"json",path:o,op:"greater",value:"gte"===n?String(Number(a)-1e-9):a};case"lt":case"lte":return{type:"json",path:o,op:"less",value:"lte"===n?String(Number(a)+1e-9):a};case"contains":return{type:"json",path:o,op:"contains",value:a};case"isDefined":return{type:"json",path:o,op:"exists",value:""};case"isUndefined":return{type:"json",path:o,op:"not_exists",value:""};case"isString":case"isNumber":case"isBoolean":case"isArray":return{type:"json",path:o,op:"type",value:n.slice(2).toLowerCase()};case"matches":return{type:"json",path:o,op:"matches",value:a.replace(/^\/|\/$/g,"")};case"length":return{type:"json",path:o,op:"length",value:a};default:return null}}(t.name,t.value);e?c.push(e):d++}return d&&t(`${r}: ${d} assertion${1===d?"":"s"} the app has no check for were left out`),(e.scripts||e.tests)&&t(`${r}: Bruno scripts and tests (bru.*, res.*) aren't imported — the app's scripts use Postman's pm.* — re-create them as checks or pm.test`),dN(s={...s,checks:c,description:e.docs.trim().slice(0,5e4)},e.headers.filter(e=>e.enabled).map(e=>({key:e.name,value:e.value})),t,r)}let dL=e=>"string"==typeof e?e:null==e?"":String(e),dU=e=>Array.isArray(e)?e:[],dF={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"},dD=e=>e.replace(/&(#x[0-9a-f]+|#\d+|amp|lt|gt|quot|apos);/gi,(e,t)=>"#"===t[0]?String.fromCodePoint("x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1))):dF[t.toLowerCase()]??"");function dB(e){let t={name:"#root",attrs:{},children:[]},r=[t],n=0;for(;n<e.length;){let t=e.indexOf("<",n);if(t<0)break;if(t>n&&r.length>1){let s=r[r.length-1];s.text=(s.text??"")+dD(e.slice(n,t))}if(e.startsWith("<!--",t)){let r=e.indexOf("-->",t+4);n=r<0?e.length:r+3;continue}if(e.startsWith("<![CDATA[",t)){let r=e.indexOf("]]>",t+9);n=r<0?e.length:r+3;continue}if("?"===e[t+1]||"!"===e[t+1]){let r=e.indexOf(">",t);n=r<0?e.length:r+1;continue}let s=t+1,a="";for(;s<e.length;s++){let t=e[s];if(a)t===a&&(a="");else if('"'===t||"'"===t)a=t;else if(">"===t)break}if(s>=e.length)throw Error("Not valid XML: a tag isn't closed");let i=e.slice(t+1,s);if(n=s+1,"/"===i[0]){let e=dK(i.slice(1).trim());if(r.length<2||r[r.length-1].name!==e)throw Error(`Not valid XML: </${e}> doesn't match`);r.pop();continue}let o=i.endsWith("/"),l=o?i.slice(0,-1):i,u=l.search(/\s|$/),c=l.slice(0,u),d={name:dK(c),attrs:{},children:[],...c.includes(":")?{prefix:c.slice(0,c.indexOf(":"))}:{}};for(let e of l.slice(u).matchAll(/([^\s=]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g))d.attrs[e[1]]=dD(e[2]??e[3]??"");r[r.length-1].children.push(d),o||r.push(d)}if(r.length>1)throw Error(`Not valid XML: <${r[r.length-1].name}> isn't closed`);return t}let dK=e=>e.slice(e.indexOf(":")+1),dZ=/^Edm\.(Int16|Int32|Int64|Byte|SByte|Decimal|Double|Single)$/;function dJ(e,t,r){return e.filter(e=>e.field).map(e=>{let n=t.find(t=>t.name===e.field)?.type??"Edm.String";if("contains"===e.op||"startswith"===e.op||"endswith"===e.op){let t=`'${e.value.replace(/'/g,"''")}'`;return"contains"===e.op&&"2.0"===r?`substringof(${t},${e.field})`:`${e.op}(${e.field},${t})`}return`${e.field} ${e.op} ${function(e,t,r){let n=e.trim();if(/^null$/i.test(n))return"null";if(dZ.test(t)&&/^-?\d+(\.\d+)?([eE][-+]?\d+)?$/.test(n))return"2.0"===r&&"Edm.Int64"===t?`${n}L`:"2.0"===r&&"Edm.Decimal"===t?`${n}M`:n;if("Edm.Boolean"===t&&/^(true|false)$/i.test(n))return n.toLowerCase();if("Edm.Guid"===t)return"2.0"===r?`guid'${n}'`:n;if("Edm.DateTime"===t)return`datetime'${n.replace(/Z$/,"").replace(/^(\d{4}-\d\d-\d\d)$/,"$1T00:00:00")}'`;if("Edm.DateTimeOffset"===t){let e=/^\d{4}-\d\d-\d\d$/.test(n)?`${n}T00:00:00Z`:n;return"2.0"===r?`datetimeoffset'${e}'`:e}return"Edm.Date"===t&&"4.0"===r?n:`'${e.replace(/'/g,"''")}'`}(e.value,n,r)}`}).join(" and ")}function dH(e,t){let r=[],n=0,s=!1,a=0,i=e.toLowerCase();for(let o=0;o<e.length;o++){let l=e[o];"'"===l?s=!s:s||"("!==l?s||")"!==l?!s&&0===n&&i.startsWith(t,o)&&(r.push(e.slice(a,o)),a=o+t.length,o+=t.length-1):n--:n++}return r.push(e.slice(a)),r.map(e=>e.trim()).filter(Boolean)}let dW=e=>{let t={};for(let[r,n]of Object.entries(e))!("__metadata"===r||r.startsWith("@odata.")||r.includes("@odata."))&&(n&&"object"==typeof n&&"__deferred"in n||(n&&"object"==typeof n&&Array.isArray(n.results)?t[r]=n.results.map(dW):n&&"object"==typeof n&&!Array.isArray(n)?t[r]=dW(n):t[r]=n));return t};e.s(["N",0,[{id:"eq",label:"is"},{id:"ne",label:"is not"},{id:"contains",label:"contains"},{id:"startswith",label:"starts with"},{id:"endswith",label:"ends with"},{id:"gt",label:"more than"},{id:"ge",label:"at least"},{id:"lt",label:"less than"},{id:"le",label:"at most"}],"q",0,function(e){if(null==e)return"";if("string"==typeof e){let t=/^\/Date\((-?\d+)([+-]\d{4})?\)\/$/.exec(e);if(!t)return e;let r=new Date(Number(t[1])).toISOString();return r.endsWith("T00:00:00.000Z")?r.slice(0,10):r.replace(".000Z","Z")}return"object"==typeof e?JSON.stringify(e):String(e)},"U",0,dJ,"i",0,function(e,t){let r=t.entitySets.find(t=>t.name===e.entitySet),n=[],s=(e.select??[]).filter(e=>!e.includes("/")),a=new Map;for(let t of e.expand??[])a.set(t,[]);for(let t of e.select??[]){let e=t.indexOf("/");e>0&&a.set(t.slice(0,e),[...a.get(t.slice(0,e))??[],t.slice(e+1)])}"2.0"===t.version?e.select?.length&&n.push(["$select",e.select.join(",")]):s.length&&n.push(["$select",s.join(",")]);let i=e.filterText?.trim()||dJ(e.filters??[],r?.properties??[],t.version);return i&&n.push(["$filter",i]),a.size&&n.push(["$expand",[...a].map(([e,r])=>"4.0"===t.version&&r.length?`${e}($select=${r.join(",")})`:e).join(",")]),e.orderBy?.field&&n.push(["$orderby",`${e.orderBy.field}${e.orderBy.desc?" desc":""}`]),void 0!==e.top&&n.push(["$top",String(e.top)]),e.skip&&n.push(["$skip",String(e.skip)]),e.count&&n.push("2.0"===t.version?["$inlinecount","allpages"]:["$count","true"]),"2.0"===t.version&&n.push(["$format","json"]),n.length?`${e.entitySet}?${n.map(([e,t])=>`${e}=${encodeURIComponent(t).replace(/%3D/g,"=").replace(/%3B/g,";").replace(/%2C/g,",").replace(/%2F/g,"/").replace(/%3A/g,":").replace(/%24/g,"$")}`).join("&")}`:e.entitySet},"b",0,function(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`},"o",0,function(e,t,r=""){let n=e.trim(),s=r.replace(/\/+$/,"");s&&n.startsWith(s)&&(n=n.slice(s.length));let a=(n=n.replace(/^\{\{[^}]*\}\}/,"").replace(/^\/+/,"")).indexOf("?"),i=((a<0?n:n.slice(0,a)).split("/").filter(Boolean).pop()??"").replace(/\(.*\)$/,""),o=t.entitySets.find(e=>e.name===i)??t.entitySets.find(e=>e.name.toLowerCase()===i.toLowerCase());if(!o)return null;let l=new Map;for(let e of(a<0?"":n.slice(a+1)).split("&").filter(Boolean)){let t=e.indexOf("="),r=e=>{try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}};l.set(r(t<0?e:e.slice(0,t)).toLowerCase(),r(t<0?"":e.slice(t+1)))}let u={entitySet:o.name},c=(l.get("$select")??"").split(",").map(e=>e.trim()).filter(Boolean),d=[];for(let e of dH(l.get("$expand")??"",",")){let t=/^([\w/]+)(?:\((.*)\))?$/.exec(e);if(!t)continue;d.push(t[1]);let r=/\$select=([^;)]*)/i.exec(t[2]??"")?.[1];if(r)for(let e of r.split(",").map(e=>e.trim()).filter(Boolean))c.push(`${t[1]}/${e}`)}c.length&&(u.select=c);let p=new Set(c.filter(e=>e.includes("/")).map(e=>e.slice(0,e.indexOf("/")))),h=d.filter(e=>!p.has(e));h.length&&(u.expand=h);let f=l.get("$filter")?.trim();if(f){let e=function(e){if(dH(e," or ").length>1)return null;let t=[];for(let r of dH(e," and ")){let e;if(e=/^substringof\(\s*'((?:[^']|'')*)'\s*,\s*([\w/]+)\s*\)$/i.exec(r))t.push({field:e[2],op:"contains",value:e[1].replace(/''/g,"'")});else if(e=/^(contains|startswith|endswith)\(\s*([\w/]+)\s*,\s*'((?:[^']|'')*)'\s*\)$/i.exec(r))t.push({field:e[2],op:e[1].toLowerCase(),value:e[3].replace(/''/g,"'")});else{if(!(e=/^([\w/]+)\s+(eq|ne|gt|ge|lt|le)\s+(.+)$/i.exec(r)))return null;let n=function(e){let t,r=e.trim();return(t=/^'((?:[^']|'')*)'$/.exec(r))?t[1].replace(/''/g,"'"):(t=/^(?:datetime|datetimeoffset|guid)'([^']*)'$/i.exec(r))?t[1].replace(/T00:00:00(\.0+)?Z?$/,""):(t=/^(-?\d+(?:\.\d+)?)[LMDdmf]?$/.exec(r))?t[1]:/^(true|false|null)$/i.test(r)?r.toLowerCase():/^\d{4}-\d\d-\d\d/.test(r)?r.replace(/T00:00:00(\.0+)?Z?$/,""):null}(e[3]);if(null===n)return null;t.push({field:e[1],op:e[2].toLowerCase(),value:n})}}return t}(f);e?u.filters=e:u.filterText=f}let m=l.get("$orderby")?.split(",")[0]?.trim().split(/\s+/);m?.[0]&&(u.orderBy={field:m[0],desc:m[1]?.toLowerCase()==="desc"});let y=Number(l.get("$top"));return l.has("$top")&&Number.isFinite(y)&&(u.top=y),u.count="allpages"===l.get("$inlinecount")||"true"===l.get("$count"),u},"Z",0,dB,"F",0,function(e){if(!e||"object"!=typeof e)return{rows:[]};if("d"in e){let t=e.d;if(Array.isArray(t))return{rows:t.map(dW)};let r=t??{};if(Array.isArray(r.results)){let e=Number(r.__count);return{rows:r.results.map(dW),...Number.isFinite(e)&&void 0!==r.__count?{count:e}:{},..."string"==typeof r.__next?{next:r.__next}:{}}}return{rows:[dW(r)]}}if(Array.isArray(e.value)){let t=Number(e["@odata.count"]);return{rows:e.value.map(dW),...void 0!==e["@odata.count"]&&Number.isFinite(t)?{count:t}:{},..."string"==typeof e["@odata.nextLink"]?{next:e["@odata.nextLink"]}:{}}}return{rows:[dW(e)]}}],36851);let dV="http://schemas.xmlsoap.org/wsdl/soap12/",dG={"1.1":"http://schemas.xmlsoap.org/soap/envelope/","1.2":"http://www.w3.org/2003/05/soap-envelope"},dX=e=>e.slice(e.indexOf(":")+1),dY=(e,t)=>({uri:t[e.includes(":")?e.slice(0,e.indexOf(":")):""]??"",name:dX(e)}),dQ=e=>(e.text??"").trim();function d0(e,t=""){let r,n=function(e,t){let r=t.toLowerCase(),n=e.replace(/^/,"");if(r.endsWith(".hurl"))return dz(n,t);if(r.endsWith(".bru")||/^meta\s*\{\s*$/m.test(n))return function(e,t){let r=function(e){let t=new Map,r=e.replace(/\r\n?/g,"\n").split("\n");for(let e=0;e<r.length;e++){let n=/^([\w:-]+)\s*\{\s*$/.exec(r[e]);if(!n)continue;let s=[];for(e++;e<r.length&&"}"!==r[e];e++)s.push(r[e].replace(/^ {2}/,""));t.set(n[1],s.join("\n"))}return t}(e),n=Object.fromEntries(dP(r.get("meta")).map(e=>[e.key,e.value])),s=[...r.keys()].find(e=>{let t;return t=e.toUpperCase(),ls.includes(t)});if(!s){if(r.has("vars")||/^vars:secret\s*\[/m.test(e)){let n=dj(t),s=dP(r.get("vars")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,secret:!1})),a=/^vars:secret\s*\[([\s\S]*?)\]/m.exec(e)?.[1]?.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)??[];for(let e of a)s.push({key:e,value:"",secret:!0});return{kind:"bruno",title:"Bruno",requests:[],environments:[{name:n,variables:s}],warnings:a.length?[`${n}: fill in the secret values (${a.join(", ")}) under Environments — Bruno keeps them out of its files`]:[]}}if(r.has("meta")||r.has("headers")||[...r.keys()].some(e=>e.startsWith("auth")))return{kind:"bruno",title:"Bruno",requests:[],environments:[],warnings:[`${dj(t)}.bru: folder-wide headers and auth aren't imported — set them in the folder's settings (⋯ → Folder settings)`]};throw Error("No request found in this .bru file (it has no get { … }, post { … } block)")}let a=Object.fromEntries(dP(r.get(s)).map(e=>[e.key,e.value])),i=new Set,o=Object.fromEntries(dP(r.get(`auth:${a.auth??""}`)).map(e=>[e.key,e.value])),l={name:n.name||dj(t),method:s,url:a.url??"",headers:dP(r.get("headers")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),params:dP(r.get("params:query")??r.get("query")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),bodyMode:{json:"json",text:"text",xml:"xml",graphql:"graphql","form-urlencoded":"formUrlEncoded","multipart-form":"multipartForm"}[a.body??""]??"none",body:{json:r.get("body:json"),text:r.get("body:text"),xml:r.get("body:xml"),graphql:{query:r.get("body:graphql"),variables:r.get("body:graphql:vars")},form:dP(r.get("body:form-urlencoded")).filter(e=>e.enabled),multipart:dP(r.get("body:multipart-form")).filter(e=>e.enabled).map(e=>({key:e.key,value:e.value,file:/^@file\(/.test(e.value)}))},auth:{mode:a.auth??"inherit",token:o.token,username:o.username,password:o.password,key:o.key,value:o.value,placement:o.placement},assertions:dP(r.get("assert")).map(e=>({name:e.key,value:e.value,enabled:e.enabled})),scripts:r.has("script:pre-request")||r.has("script:post-response"),tests:r.has("tests"),docs:r.get("docs")??""},u=dR(l,e=>i.add(e)),c="Bruno";return{kind:"bruno",title:c,requests:[{collection:ln(c),name:l.name.slice(0,120),request:u}],environments:[],warnings:[...i]}}(n,t);if(r.endsWith(".http")||r.endsWith(".rest"))return dI(n,t);let s=n.split(/\r?\n/).find(e=>e.trim()&&!/^\s*(#|\/\/)/.test(e))?.trim()??"";return/^[{[]/.test(s)?null:dE.test(s)||/^@[\w.-]+\s*=/.test(s)||/^###/m.test(n)?/^HTTP(\/[\d.]+)?\s+(\d{3}|\*)\s*$/m.test(n)||/^\[(Asserts|Captures|QueryStringParams|FormParams|BasicAuth)\]\s*$/m.test(n)?dz(n,t):dI(n,t):null}(e,t);if(n)return n;if((r=e.replace(/^/,"").trimStart().slice(0,4e3)).startsWith("<")&&/<([\w-]+:)?definitions[\s>]/.test(r)&&r.includes("http://schemas.xmlsoap.org/wsdl/"))return function(e){let t,r,n;try{t=dB(e.replace(/^/,""))}catch(e){throw Error(`This WSDL isn't valid XML: ${e instanceof Error?e.message:"parse error"}`)}let s=t.children.find(e=>"definitions"===e.name);if(!s)throw Error("Not a WSDL 1.1 file (no <definitions>). WSDL 2.0 isn't supported yet.");let a=(r=new Map,(n=(e,t)=>{let s=t;for(let[t,r]of Object.entries(e.attrs))"xmlns"===t?s={...s,"":r}:t.startsWith("xmlns:")&&(s={...s,[t.slice(6)]:r});for(let t of(r.set(e,s),e.children))n(t,s)})(s,{}),r),i=e=>a.get(e)??{},o=(e,t)=>e.children.filter(e=>e.name===t),l=new Set,u=s.attrs.targetNamespace??"",c=[];for(let e of o(s,"types"))for(let t of o(e,"schema"))c.push({node:t,tns:t.attrs.targetNamespace??u,qualified:"qualified"===t.attrs.elementFormDefault});let d=e=>{let t=new Map;for(let r of c)for(let n of o(r.node,e))n.attrs.name&&t.set(`${r.tns} ${n.attrs.name}`,{node:n,schema:r});return t},p=d("element"),h=d("complexType"),f=d("simpleType"),m=new Map;for(let e of c){let t=r=>{m.set(r,e),r.children.forEach(t)};t(e.node)}let y=new Map,g=e=>e?(y.has(e)||y.set(e,0===y.size?"tns":`ns${y.size}`),y.get(e)):"",b={string:"?",normalizedString:"?",token:"?",anyURI:"https://example.com",boolean:"false",int:"0",integer:"0",long:"0",short:"0",byte:"0",decimal:"0.00",float:"0.0",double:"0.0",nonNegativeInteger:"0",positiveInteger:"1",unsignedInt:"0",unsignedLong:"0",unsignedShort:"0",date:"2024-01-31",dateTime:"2024-01-31T09:00:00Z",time:"09:00:00",gYear:"2024",base64Binary:"",hexBinary:""},v=(e,t,r=0)=>{if(!e)return"?";let n=dY(e,i(t));if("http://www.w3.org/2001/XMLSchema"===n.uri||!n.uri)return b[n.name]??"?";let s=f.get(`${n.uri} ${n.name}`);return s&&r<5?w(s.node,r+1):"?"},w=(e,t)=>{let r=o(e,"restriction")[0];if(!r)return"?";let n=o(r,"enumeration")[0];return n?n.attrs.value??"?":v(r.attrs.base,r,t)},k=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),x=(e,t,r,n)=>{if(e.attrs.ref){let n=dY(e.attrs.ref,i(e)),s=p.get(`${n.uri} ${n.name}`);return s?$(e,t,x(s.node,t,r,!0)):[`${t}<!-- ${k(e.attrs.ref)}: not described in this file -->`]}let s=m.get(e),a=e.attrs.name??"item",l=(n||s?.qualified)&&s?.tns?`${g(s.tns)}:${a}`:a;if(r>12)return[`${t}<${l}><!-- nested too deep to show --></${l}>`];if("true"===e.attrs.nillable&&!e.attrs.type&&!e.children.length)return[`${t}<${l}/>`];let u=o(e,"complexType")[0];if(!u&&e.attrs.type){let t=dY(e.attrs.type,i(e));u=h.get(`${t.uri} ${t.name}`)?.node}if(!u){let r=o(e,"simpleType")[0],n=r?w(r,0):v(e.attrs.type??"xs:string",e);return $(e,t,[`${t}<${l}>${k(n)}</${l}>`])}let{attrs:c,children:d}=S(u,`${t} `,r),f=`<${l}${c.map(e=>` ${e}`).join("")}`;return $(e,t,d.length?[`${t}${f}>`,...d,`${t}</${l}>`]:[`${t}${f}/>`])},$=(e,t,r)=>{let n=["0"===e.attrs.minOccurs?"optional":"",e.attrs.maxOccurs&&"1"!==e.attrs.maxOccurs&&"0"!==e.attrs.maxOccurs?"repeat as needed":""].filter(Boolean);return n.length?[`${t}<!-- ${n.join(", ")} -->`,...r]:r},S=(e,t,r)=>{let n=[],s=[],a=e=>{for(let o of e.children)if("element"===o.name)s.push(...x(o,t,r+1,!1));else if("sequence"===o.name||"all"===o.name)a(o);else if("choice"===o.name){let e=o.children.find(e=>"element"===e.name||"sequence"===e.name);e&&(s.push(`${t}<!-- one of: ${o.children.filter(e=>"element"===e.name).map(e=>e.attrs.name??e.attrs.ref).join(", ")} -->`),a({...o,children:[e]}))}else if("attribute"===o.name&&o.attrs.name)n.push(`${o.attrs.name}="${k(v(o.attrs.type??"xs:string",o))}"`);else if("complexContent"===o.name||"simpleContent"===o.name)for(let e of o.children.filter(e=>"extension"===e.name||"restriction"===e.name)){if(e.attrs.base&&"complexContent"===o.name){let a=dY(e.attrs.base,i(e)),o=h.get(`${a.uri} ${a.name}`);if(o&&r<12){let e=S(o.node,t,r+1);n.push(...e.attrs),s.push(...e.children)}}else"simpleContent"===o.name&&s.push(`${t}${k(v(e.attrs.base,e))}`);a(e)}else"any"===o.name&&s.push(`${t}<!-- any element -->`)};return a(e),{attrs:n,children:s}},_=e=>new Map(o(s,e).filter(e=>e.attrs.name).map(e=>[e.attrs.name,e])),A=_("message"),T=_("portType"),O=_("binding"),E=[];for(let e of o(s,"service"))for(let t of o(e,"port")){let r=O.get(dX(t.attrs.binding??"")),n=t.children.find(e=>"address"===e.name);if(!r||!n)continue;let s=i(n)[n.prefix??""]??"";("http://schemas.xmlsoap.org/wsdl/soap/"===s||s===dV)&&E.push({name:t.attrs.name??"",service:e.attrs.name??"Service",binding:r,version:s===dV?"1.2":"1.1",address:n.attrs.location??""})}if(!E.length)throw Error("This WSDL has no SOAP service address (no <service> with a <soap:address>)");let j=new Map;for(let e of E){let t=`${e.service} ${dX(e.binding.attrs.type??"")}`,r=j.get(t);r&&("1.2"!==r.version||"1.1"!==e.version)||j.set(t,e)}let M=(s.attrs.name??[...j.values()][0].service).trim()||"SOAP service",N=[],I=new Map,q=[];for(let e of j.values()){let t=I.get(e.address);t||(t=0===I.size?"serviceUrl":`serviceUrl${I.size+1}`,I.set(e.address,t),N.push({key:t,value:e.address,secret:!1}));let r=T.get(dX(e.binding.attrs.type??"")),n=e.binding.children.find(e=>"binding"===e.name)?.attrs.style??"document";for(let s of o(e.binding,"operation")){if(q.length>=500){l.add("Only the first 500 operations were imported");break}let a=s.attrs.name??"operation",c=s.children.find(e=>"operation"===e.name),d=c?.attrs.soapAction??c?.attrs.soapActionURI??"",h=c?.attrs.style??n,f=r?o(r,"operation").find(e=>e.attrs.name===a):void 0,m=e=>{let t=f?o(f,e)[0]?.attrs.message:void 0;return t?A.get(dX(t)):void 0},b=m("input"),w=m("output");y.clear();let $=[],S="",_=e=>{if(!e.attrs.element)return;let t=dY(e.attrs.element,i(e));return p.get(`${t.uri} ${t.name}`)?.node};if("rpc"===h){let e=g(o(s,"input")[0]?.children.find(e=>"body"===e.name)?.attrs.namespace??u);for(let t of($=[` <${e}:${a}>`],b?o(b,"part"):[])){let e=_(t);e?$.push(...x(e," ",1,!0)):$.push(` <${t.attrs.name}>${k(v(t.attrs.type,t))}</${t.attrs.name}>`)}$.push(` </${e}:${a}>`),S=`${a}Response`}else{for(let e of b?o(b,"part"):[]){let t=_(e);t?$.push(...x(t," ",0,!0)):l.add(`${a}: an input part without an element; fill in its body by hand`)}let e=w?o(w,"part")[0]:void 0;S=e?.attrs.element?dX(e.attrs.element):""}let T="1.2"===e.version?"soap12":"soapenv",O=[`xmlns:${T}="${dG[e.version]}"`,...[...y].map(([e,t])=>`xmlns:${t}="${k(e)}"`)].join(" "),E=[`<${T}:Envelope ${O}>`,` <${T}:Header/>`,` <${T}:Body>`,...$,` </${T}:Body>`,`</${T}:Envelope>`].join("\n"),N="1.2"===e.version?[{key:"Content-Type",value:`application/soap+xml; charset=utf-8${d?`; action="${d}"`:""}`,enabled:!0}]:[{key:"Content-Type",value:"text/xml; charset=utf-8",enabled:!0},{key:"SOAPAction",value:`"${d}"`,enabled:!0}],I=[{type:"status",expect:"200"},{type:"json",path:"Envelope.Body.Fault",op:"not_exists",value:""},...S?[{type:"json",path:`Envelope.Body.${S}`,op:"exists",value:""}]:[]],C=f?o(f,"documentation")[0]:void 0,z=lk({...ld(),method:"POST"},`{{${t}}}`);z={...z,headers:N,bodyMode:"text",bodyText:E,checks:I,authMode:"inherit",description:[C?dQ(C):"",`SOAP ${e.version} \xb7 ${"rpc"===h?"rpc":"document/literal"}${d?` \xb7 SOAPAction ${d}`:""}`].filter(Boolean).join("\n\n")},q.push({collection:j.size>1?`${M}/${e.service}`:M,name:a,request:z})}}if(!q.length)throw Error("This WSDL describes no SOAP operations");return l.add(`WSDL files don't say how to sign in: set Auth on the “${M}” folder (Basic for most SAP services; NetSuite SuiteTalk signs in inside the envelope's Header)`),[...q].some(e=>e.request.bodyText.includes(">?<"))&&l.add("Text values are “?” placeholders: replace them with real values before sending"),{kind:"wsdl",title:M,requests:q,environments:[{name:M,variables:N}],warnings:[...l]}}(e);let s=function(e,t){let r=e.replace(/^/,"").trim();if(!r)return null;if(r.startsWith("{")||r.startsWith("["))try{return JSON.parse(r)}catch(e){if(/\.json$/i.test(t))throw Error(`Not valid JSON: ${e instanceof Error?e.message:"parse error"}`)}try{return dO(r,{maxAliasCount:200})}catch(e){throw Error(`Not valid JSON or YAML: ${e instanceof Error?e.message.split("\n")[0]:"parse error"}`)}}(e,t);if(!s||"object"!=typeof s)throw Error("This file is empty or not JSON/YAML");let a=s.info;if("string"==typeof a?.schema&&/collection\/v2/.test(a.schema)||Array.isArray(s.item)&&a)return function(e){let t=d2((e.info??{}).name,"Imported collection").trim()||"Imported collection",r=[],n=new Set,s=e=>n.add(e),a=new Set,i=[],o=e=>ln([t,...e].map(e=>e.replace(/[\\/]/g," ")).join("/")),l=0,u=0,c=0,d=(e,t,r,n,a)=>{let u=lt(),c=pe(a,"prerequest").slice(0,1e5),d=pe(a,"test").slice(0,1e5);if((c||d)&&(u={...u,preScript:c,postScript:d},l++),t?.type&&"inherit"!==t.type){let e=d3({...ld(),authMode:"inherit"},t,s,n);u={...u,auth:{authMode:e.authMode,oauth:e.oauth,oauth1:e.oauth1,aws:e.aws,jwt:e.jwt,domain:e.domain,token:e.token,username:e.username,password:e.password,apiName:e.apiName,apiValue:e.apiValue,apiIn:e.apiIn}}}let p=d5(r).map(e=>e).filter(e=>d2(e.key).trim()&&!e.disabled).map(e=>({key:d2(e.key).trim(),value:d2(e.value),secret:"secret"===e.type}));p.length&&(u={...u,variables:pn(p)});let h=pr(e.length?a.description:a.info?.description);h&&(u={...u,description:h}),lr(u)||i.push({path:o(e),settings:u})},p=(e,t)=>{for(let n of e){if(Array.isArray(n.item)){let e=[...t,d2(n.name,"Folder")];e.length>=6&&s(`${e.join(" › ")}: folders deeper than 6 levels were put in the folder above`),d(e,n.auth,n.variable,e.join(" › "),n),p(n.item,e);continue}if(r.length>=2e3)return void s("Only the first 2000 requests were imported");let e=d2(n.name,"Request"),i=[...t,e].join(" › "),h="string"==typeof n.request?{url:n.request}:n.request??{},f=d9(h.method);if(!f){s(`${i}: ${d2(h.method)} requests are not supported; skipped`);continue}let m=function(e){if("string"==typeof e)return e;let t=e??{};if("string"==typeof t.raw)return t.raw;let r=d2(t.protocol),n=Array.isArray(t.host)?t.host.map(e=>d2(e)).join("."):d2(t.host),s=Array.isArray(t.path)?t.path.map(e=>d2(e)).join("/"):d2(t.path),a=d5(t.query).filter(e=>!e.disabled).map(e=>`${d2(e.key)}=${d2(e.value)}`).join("&");return`${r?`${r}://`:""}${n}${s?`/${s}`:""}${a?`?${a}`:""}`}(h.url);for(let e of JSON.stringify(h).matchAll(/\{\{\s*(\$[A-Za-z]+)/g))pt.has(e[1].toLowerCase())||a.add(e[1]);let y=lk({...ld(),method:f},m);!y.baseUrl&&m&&(y={...y,url:m}),y=d3({...y,authMode:"inherit"},h.auth,s,i);let g=d5(h.header).filter(e=>!e.disabled).map(e=>{let t=pr(e.description);return{key:d2(e.key),value:d2(e.value),...t?{description:t}:{}}}),b=new Map(d5(h.url?.query).flatMap(e=>{let t=pr(e.description);return t?[[d2(e.key),t]]:[]}));b.size&&(y={...y,params:y.params.map(e=>b.has(e.key)?{...e,description:b.get(e.key)}:e)});let v=d4(g,y,s,i);v=function(e,t,r,n,s){if(!t||t.disabled)return{draft:e,headers:r};let a=r.some(e=>/^content-type$/i.test(e.key));switch(t.mode){case"raw":{let n=d2(t.raw),s="json"===d2(t.options?.raw?.language)||r.some(e=>/^content-type$/i.test(e.key)&&/json/i.test(e.value))||/^\s*[{[]/.test(n);return{draft:{...e,bodyMode:s?"json":"text",bodyText:n},headers:r}}case"urlencoded":{let n=d5(t.urlencoded).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(d2(e.key))}=${encodeURIComponent(d2(e.value))}`).join("&");return{draft:{...e,bodyMode:"text",bodyText:n},headers:a?r:[...r,{key:"Content-Type",value:"application/x-www-form-urlencoded"}]}}case"graphql":{let n=t.graphql??{},s="string"==typeof n.variables?n.variables:n.variables?JSON.stringify(n.variables,null,2):"";return{draft:{...e,bodyMode:"graphql",graphqlQuery:d2(n.query),graphqlVariables:s},headers:r.filter(e=>!/^content-type$/i.test(e.key))}}case"formdata":return{draft:d7(e,d5(t.formdata).filter(e=>!e.disabled).map(e=>"file"===e.type?d8(d2(e.key)):{key:d2(e.key),value:d2(e.value),kind:"text",file:null}),n,s),headers:r.filter(e=>!(/^content-type$/i.test(e.key)&&/multipart/i.test(e.value)))};case"file":return n(`${s}: the body is a file — choose it again in the Body tab (the file itself isn't in the export)`),{draft:{...e,bodyMode:"file",bodyFile:null},headers:r};default:return{draft:e,headers:r}}}(v.draft,h.body,v.headers,s,i);let w=pe(n,"prerequest").slice(0,1e5),k=pe(n,"test").slice(0,1e5);(w||k)&&l++;let x=function(e){let t=d5(e.response).map(e=>e).filter(e=>Number.isInteger(Number(e.code))),r=t.find(e=>Number(e.code)>=200&&300>Number(e.code))??t[0];if(!r)return{mock:null,count:0};let n=d5(r.header).flatMap(e=>{let{key:t,value:r,disabled:n}=e??{};return"string"==typeof t&&t.trim()&&!n?[[t,d2(r)]]:[]});return{mock:oV({status:Number(r.code),headers:n,body:d2(r.body),delayMs:0}),count:t.length}}(n);x.mock&&u++,x.count>1&&c++,r.push({collection:o(t),name:e,request:{...v.draft,headers:v.headers,preScript:w,postScript:k,mock:x.mock,description:pr(h.description??n.description)}})}};return d([],e.auth,e.variable,t,e),p(d5(e.item),[]),l&&s(`Pre-request or test scripts came along on ${l} request${1===l?"":"s"} or folder${1===l?"":"s"} — they run as in Postman (Scripts tab, and Folder settings → Scripts)`),u&&s(`Saved examples came along on ${u} request${1===u?"":"s"} as the Example tab (what the mock server answers)${c?`; ${c} had more than one, and only the first successful one was kept`:""}`),a.size&&s(`Postman dynamic values the app doesn't make: ${[...a].slice(0,8).map(e=>`{{${e}}}`).join(", ")} — they are sent as written`),{kind:"postman",title:t,requests:r,folders:i,environments:[],warnings:[...n]}}(s);if(Array.isArray(s.values)&&("environment"===s._postman_variable_scope||"string"==typeof s.name)){var i;let e;return{kind:"postman-environment",title:e=d2((i=s).name,"Imported environment").trim()||"Imported environment",requests:[],environments:[{name:e,variables:pn(d5(i.values).map(e=>e).filter(e=>d2(e.key).trim()&&!1!==e.enabled).map(e=>({key:d2(e.key).trim(),value:d2(e.value),secret:"secret"===e.type})))}],warnings:[]}}if(s.log&&"object"==typeof s.log&&Array.isArray(s.log.entries))return function(e,t){let r=e.log,n=t.replace(/\.har$/i,"").replace(/[_-]+/g," ").trim()||"Browser recording",s=[],a=new Set,i=e=>a.add(e),o=new Set,l=0,u=0;for(let e of d5(r.entries)){var c;let t=e.request??{},r=d2(t.url);if(!/^https?:\/\//i.test(r))continue;let a=d9(t.method);if(!a||"OPTIONS"===a)continue;let d=d2(e._resourceType),p=d2(e.response?.content?.mimeType);if(d&&!["xhr","fetch","document",""].includes(d)||po.test(r)||pl.test(p)){l++;continue}let h=`${a} ${r}`;if(o.has(h))continue;if(o.add(h),s.length>=2e3){i("Only the first 2000 requests were imported");break}let f=new URL(r),m=`${a} ${f.pathname}`,y=lk({...ld(),method:a},r),g=d5(t.headers).map(e=>({key:d2(e.name),value:d2(e.value)})).filter(e=>e.key&&!pu.test(e.key));g.some(e=>/^cookie$/i.test(e.key))&&u++;let b=d4(g.filter(e=>!/^cookie$/i.test(e.key)),y,i,m);y=b.draft;let v=t.postData;if(v&&("POST"===(c=a)||"PUT"===c||"PATCH"===c||"DELETE"===c)){let e=d2(v.mimeType),t=d2(v.text);if(/json/i.test(e))y={...y,bodyMode:"json",bodyText:t};else if(/multipart\/form-data/i.test(e)){let e=d5(v.params).map(e=>void 0!==e.fileName?d8(d2(e.name)):{key:d2(e.name),value:d2(e.value),kind:"text",file:null});e.length?y=d7(y,e,i,m):i(`${m}: the recording doesn't have the form's fields; the body was left out`)}else t&&(y={...y,bodyMode:"text",bodyText:t});!e||b.headers.some(e=>/^content-type$/i.test(e.key))||/multipart/i.test(e)||(b={...b,headers:[...b.headers,{key:"Content-Type",value:e.split(";")[0]}]})}s.push({collection:ln(`${n}/${f.host.replace(/:/g," ")}`),name:m.slice(0,120),request:{...y,headers:b.headers}})}if(!s.length)throw Error("No API calls found in this recording — record with DevTools open while you use the app, then Save all as HAR");return l&&i(`${l} page files (images, scripts, styles, fonts) were left out — only API calls are imported`),u&&i(`Cookies were left out of ${u} request${1===u?"":"s"} — send the login request first; the cookie jar keeps its session`),{kind:"har",title:n,requests:s,environments:[],warnings:[...a]}}(s,t);if("export"===s._type&&Array.isArray(s.resources)||"string"==typeof s.type&&s.type.startsWith("collection.insomnia.rest/"))return function(e){let t=new Set,r=e=>t.add(e),n=e=>pc(e,r,"Some values"),s="Insomnia collection",a=[],i=[];if("export"===e._type){let t=d5(e.resources).map(e=>e),r=t.find(e=>"workspace"===e._type);s=d2(r?.name,s)||s;let n=new Map;for(let e of t)"request_group"===e._type&&n.set(d2(e._id),{kind:"folder",name:d2(e.name,"Folder"),raw:e,children:[]}),"request"===e._type&&n.set(d2(e._id),{kind:"request",name:d2(e.name,"Request"),raw:e,children:[]});for(let e of t){let t=n.get(d2(e._id));if(!t)continue;let r=n.get(d2(e.parentId));r?r.children.push(t):a.push(t)}let o=t.find(e=>"environment"===e._type&&e.parentId===r?._id),l=t.filter(e=>"environment"===e._type&&o&&e.parentId===o._id),u=pd(o?.data);if(l.length)for(let e of l)i.push({name:d2(e.name,"Environment"),variables:pn([...u,...pd(e.data)])});else u.length&&i.push({name:`${s} (base)`,variables:u})}else{s=d2(e.name,s)||s;let t=e=>e.map(e=>Array.isArray(e.children)?{kind:"folder",name:d2(e.name,"Folder"),raw:e,children:t(e.children)}:{kind:"request",name:d2(e.name,"Request"),raw:e,children:[]});a=t(d5(e.collection));let r=e.environments;if(r){let e=pd(r.data),t=d5(r.subEnvironments).map(e=>e);if(t.length)for(let r of t)i.push({name:d2(r.name,"Environment"),variables:pn([...e,...pd(r.data)])});else e.length&&i.push({name:`${s} (base)`,variables:e})}}let o=[],l=[],u=ln(s),c=(e,t)=>{for(let s of e){if("folder"===s.kind){let e=[...t,s.name],a=lt();a={...a,auth:pp(a.auth,s.raw.authentication,r,e.join(" › "),n)};let i=pd(s.raw.environment);i.length&&(a={...a,variables:i}),d2(s.raw.description).trim()&&(a={...a,description:d2(s.raw.description).trim().slice(0,5e4)}),lr(a)||l.push({path:ln(`${u}/${e.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),settings:a}),c(s.children,e);continue}if(o.length>=2e3)return void r("Only the first 2000 requests were imported");let e=s.raw,a=[...t,s.name].join(" › "),i=d9(e.method);if(!i){r(`${a}: ${d2(e.method)} requests are not supported; skipped`);continue}let d=lk({...ld(),method:i},pc(d2(e.url),r,a)),p=d5(e.parameters).filter(e=>!e.disabled).map(e=>({key:d2(e.name),value:n(d2(e.value))})).filter(e=>e.key);p.length&&(d={...d,params:[...d.params,...p]}),d=pp(d,e.authentication,r,a,n);let h=d4(d5(e.headers).filter(e=>!e.disabled).map(e=>({key:d2(e.name),value:n(d2(e.value))})),d,r,a);d=h.draft;let f=e.body??{},m=d2(f.mimeType);if("application/graphql"===m)try{let e=JSON.parse(d2(f.text,"{}"));d={...d,bodyMode:"graphql",graphqlQuery:n(d2(e.query)),graphqlVariables:e.variables?JSON.stringify(e.variables,null,2):""}}catch{r(`${a}: the GraphQL body could not be read`)}else if(/json/i.test(m))d={...d,bodyMode:"json",bodyText:n(d2(f.text))};else if("application/x-www-form-urlencoded"===m){let e=d5(f.params).filter(e=>!e.disabled).map(e=>`${encodeURIComponent(d2(e.name))}=${encodeURIComponent(n(d2(e.value)))}`).join("&");d={...d,bodyMode:"text",bodyText:e}}else"multipart/form-data"===m?d=d7(d,d5(f.params).filter(e=>!e.disabled).map(e=>"file"===e.type?d8(d2(e.name)):{key:d2(e.name),value:n(d2(e.value)),kind:"text",file:null}),r,a):d2(f.text)&&(d={...d,bodyMode:"text",bodyText:n(d2(f.text))});let y=!m||/graphql|multipart/.test(m)||h.headers.some(e=>/^content-type$/i.test(e.key))?h.headers:[...h.headers,{key:"Content-Type",value:m}];o.push({collection:ln(`${u}/${t.map(e=>e.replace(/[\\/]/g," ")).join("/")}`),name:s.name.slice(0,120),request:{...d,headers:"graphql"===d.bodyMode?h.headers:y,description:d2(e.description).trim().slice(0,5e4)}})}};if(c(a,[]),!o.length)throw Error("No requests found in this Insomnia file");return{kind:"insomnia",title:s,requests:o,folders:l,environments:i,warnings:[...t]}}(s);if("string"==typeof s.openapi&&s.openapi.startsWith("3"))return pi(s,"openapi");if("2.0"===s.swagger)return pi(s,"swagger");if(Array.isArray(s.items)&&"string"==typeof s.name&&(void 0!==s.brunoConfig||"1"===s.version)&&dU(s.items).every(e=>"http"===e.type||"graphql"===e.type||"folder"===e.type||"http-request"===e.type||"graphql-request"===e.type))return function(e){let t=dL(e.name).trim()||"Bruno collection",r=new Set,n=e=>r.add(e),s=[],a=(e,r)=>{for(let i of e){if(s.length>=2e3)return;if("folder"===i.type){a(dU(i.items),[...r,dL(i.name).replace(/[\\/]/g," ")]);continue}let e=i.request??{},o=e.body??{},l=e.auth??{},u=dL(l.mode),c=l[u]??{},d=e.script??{},p={name:dL(i.name)||"Request",method:dL(e.method)||"GET",url:dL(e.url),headers:dU(e.headers).map(e=>({name:dL(e.name),value:dL(e.value),enabled:!1!==e.enabled})),params:dU(e.params).filter(e=>"query"===dL(e.type||"query")).map(e=>({name:dL(e.name),value:dL(e.value),enabled:!1!==e.enabled})),bodyMode:dL(o.mode)||"none",body:{json:dL(o.json),text:dL(o.text),xml:dL(o.xml),graphql:{query:dL(o.graphql?.query),variables:dL(o.graphql?.variables)},form:dU(o.formUrlEncoded).filter(e=>!1!==e.enabled).map(e=>({key:dL(e.name),value:dL(e.value)})),multipart:dU(o.multipartForm).filter(e=>!1!==e.enabled).map(e=>({key:dL(e.name),value:Array.isArray(e.value)?"":dL(e.value),file:"file"===e.type}))},auth:{mode:u,token:dL(c.token),username:dL(c.username),password:dL(c.password),key:dL(c.key),value:dL(c.value),placement:dL(c.placement)},assertions:dU(e.assertions).map(e=>({name:dL(e.name),value:dL(e.value),enabled:!1!==e.enabled})),scripts:!!(dL(d.req).trim()||dL(d.res).trim()),tests:!!dL(e.tests).trim(),docs:dL(e.docs)};s.push({collection:ln([t,...r].join("/")),name:p.name.slice(0,120),request:dR(p,n)})}};if(a(dU(e.items),[]),!s.length)throw Error("This Bruno collection has no requests");let i=dU(e.environments).map(e=>({name:dL(e.name)||"Bruno",variables:dU(e.variables).filter(e=>!1!==e.enabled&&dL(e.name)).map(e=>({key:dL(e.name),value:e.secret?"":dL(e.value),secret:!!e.secret}))}));return dU(e.environments).some(e=>dU(e.variables).some(e=>e.secret))&&n("Secret environment values aren't in Bruno's export — fill them in under Environments"),{kind:"bruno",title:t,requests:s,environments:i,warnings:[...r]}}(s);if(s.format===lj&&Array.isArray(s.requests))return function(e){let t="string"==typeof e.name&&e.name.trim()||"Imported collection",r=[],n=new Map;for(let t of e.requests)"string"==typeof t?.ref&&"string"==typeof t.name&&n.set(t.ref,t.name);let s=[];for(let[a,i]of e.requests.entries()){if(!i||"string"!=typeof i.name||!i.request||"object"!=typeof i.request){r.push(`Request ${a+1} isn't a request — skipped`);continue}let e=lg({...ld(),...i.request,before:null});Array.isArray(i.request.params)&&e.params.length&&!e.url.includes("?")&&(e=lx(lk(e,e.url),{params:e.params}));let o=i.runFirst&&n.has(i.runFirst.ref)?{ref:i.runFirst.ref,requestName:n.get(i.runFirst.ref),extract:Array.isArray(i.runFirst.extract)?i.runFirst.extract:[]}:void 0;i.runFirst&&!o&&r.push(`${i.name}: runs first "${i.runFirst.ref}", which isn't in the file`);let l="string"==typeof i.folder&&i.folder.trim()?`/${i.folder.trim()}`:"";s.push({collection:ln(`${t}${l}`),name:i.name.slice(0,120),request:e,...i.ref?{ref:i.ref}:{},...o?{runFirst:o}:{}})}let a=(e.variables??[]).filter(e=>"string"==typeof e?.key&&e.key.trim()).map(e=>({key:e.key,value:String(e.value??""),secret:!!e.secret}));return{kind:"apitestcenter",title:t,requests:s,environments:a.length?[{name:t,variables:a}]:[],warnings:r}}(s);if("string"==typeof s.openapi)throw Error(`OpenAPI ${s.openapi} is not supported yet — use 3.x or Swagger 2.0`);throw Error("Not a Postman collection or environment, an Insomnia export, a HAR recording, an OpenAPI/Swagger file, a Bruno collection, a WSDL, or an .http / Hurl file")}function d1(e){if(1===e.length)return d0(e[0].text,e[0].name);let t=[],r=[],n="";for(let s of e){if(/(^|[\\/])bruno\.json$/i.test(s.name)){try{let e=JSON.parse(s.text).name;"string"==typeof e&&e.trim()&&(n=e.trim().slice(0,60))}catch{}continue}try{t.push(d0(s.text,s.name))}catch(e){r.push(`${s.name}: ${e instanceof Error?e.message:"could not be read"}`)}}if(!t.length)throw Error(r.join("; ")||"No files");let s=new Set(t.map(e=>e.kind)),a=1===s.size&&s.has("bruno")?n||"Bruno":t[0].title;return{kind:1===s.size?t[0].kind:"several",title:a,requests:t.flatMap(e=>e.requests).slice(0,2e3),folders:t.flatMap(e=>e.folders??[]),environments:t.flatMap(e=>e.environments),warnings:[...r,...t.flatMap(e=>e.warnings)]}}let d2=(e,t="")=>"string"==typeof e?e:"number"==typeof e||"boolean"==typeof e?String(e):t,d5=e=>Array.isArray(e)?e:[],d9=e=>{let t=d2(e,"GET").toUpperCase();return ls.includes(t)?t:null};function d4(e,t,r,n){let s=[],a=t;for(let t of e){let e=t.key.trim();if(/^authorization$/i.test(e)){let e=/^bearer\s+(.+)$/i.exec(t.value.trim()),s=/^basic\s+(.+)$/i.exec(t.value.trim()),i="none"===a.authMode||"inherit"===a.authMode;if(e&&i)a={...a,authMode:"bearer",token:e[1]};else if(s&&i)try{let[e,...t]=atob(s[1]).split(":");a={...a,authMode:"basic",username:e??"",password:t.join(":")}}catch{r(`${n}: an Authorization header could not be read; set Auth by hand`)}else i&&r(`${n}: an Authorization header was dropped; set Auth by hand`);continue}if(/^cookie$/i.test(e)){r(`${n}: a Cookie header was left out — send the login request first; the cookie jar keeps its session`);continue}e&&s.push({key:e,value:t.value,...t.description?{description:t.description}:{}})}return{draft:a,headers:s}}function d6(e,t,r){let n=e[t],s=e=>"boolean"==typeof e||"number"==typeof e?String(e):d2(e);return Array.isArray(n)?s(n.find(e=>e.key===r)?.value):n&&"object"==typeof n?s(n[r]):""}function d3(e,t,r,n){if(!t||!t.type||"inherit"===t.type)return e;if("noauth"===t.type)return{...e,authMode:"none"};if("bearer"===t.type)return{...e,authMode:"bearer",token:d6(t,"bearer","token")};if("basic"===t.type)return{...e,authMode:"basic",username:d6(t,"basic","username"),password:d6(t,"basic","password")};if("apikey"===t.type)return{...e,authMode:"api_key",apiName:d6(t,"apikey","key")||"X-API-Key",apiValue:d6(t,"apikey","value"),apiIn:"query"===d6(t,"apikey","in")?"query":"header"};if("digest"===t.type)return{...e,authMode:"digest",username:d6(t,t.type,"username"),password:d6(t,t.type,"password")};if("ntlm"===t.type)return{...e,authMode:"ntlm",username:d6(t,t.type,"username"),password:d6(t,t.type,"password"),domain:d6(t,t.type,"domain")};if("awsv4"===t.type)return{...e,authMode:"aws_sigv4",aws:{accessKeyId:d6(t,t.type,"accessKey"),secretAccessKey:d6(t,t.type,"secretKey"),sessionToken:d6(t,t.type,"sessionToken"),region:d6(t,t.type,"region")||"us-east-1",service:d6(t,t.type,"service")||"execute-api"}};if("oauth1"===t.type){let r=d6(t,t.type,"signatureMethod").toUpperCase();return{...e,authMode:"oauth1",oauth1:{consumerKey:d6(t,t.type,"consumerKey"),consumerSecret:d6(t,t.type,"consumerSecret"),token:d6(t,t.type,"token"),tokenSecret:d6(t,t.type,"tokenSecret"),signatureMethod:"HMAC-SHA1"===r||"PLAINTEXT"===r?r:"HMAC-SHA256",realm:d6(t,t.type,"realm"),addTo:"false"===d6(t,t.type,"addParamsToHeader")?"query":"header"}}}if("jwt"===t.type){let r=d6(t,t.type,"algorithm").toUpperCase(),n=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","ES256","ES384","ES512"].includes(r)?r:"HS256";return{...e,authMode:"jwt",jwt:{...e.jwt,algorithm:n,secret:d6(t,t.type,"secret"),privateKey:d6(t,t.type,"privateKey"),payload:d6(t,t.type,"payload")||e.jwt.payload,prefix:d6(t,t.type,"headerPrefix")||"Bearer"}}}return r("oauth2"===t.type?`${n}: OAuth 2.0 settings were not imported — set the token URL and client under Auth → OAuth 2.0`:`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}function d8(e){return{key:e,value:"",kind:"file",file:null}}function d7(e,t,r,n){let s=t.filter(e=>"file"===e.kind).length;return s&&r(`${n}: choose the file${1===s?"":"s"} for the form again in the Body tab (files aren't in the export)`),{...e,bodyMode:"multipart",formRows:t}}function pe(e,t){return d5(e.event).map(e=>e).filter(e=>e.listen===t&&!e.disabled).map(e=>{let t=(e.script??{}).exec;return Array.isArray(t)?t.map(e=>d2(e)).join("\n"):d2(t)}).filter(e=>e.trim()).join("\n")}let pt=new Set(["$guid","$uuid","$randomuuid","$timestamp","$isotimestamp","$randomint","$randomemail","$randomfirstname","$randomlastname","$randomfullname","$randomboolean","$randomalphanumeric"]);function pr(e){return("string"==typeof e?e:e&&"object"==typeof e?d2(e.content):"").trim().slice(0,5e4)}function pn(e){let t=new Map;for(let r of e)/^[A-Za-z_][\w.-]*$/.test(r.key)&&t.set(r.key,r);return[...t.values()]}function ps(e,t,r=0){let n=t;for(let t=0;n&&"string"==typeof n.$ref&&t<20;t++){let t=n.$ref;if(!t.startsWith("#/"))return{};n=t.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")).reduce((e,t)=>e&&"object"==typeof e?e[t]:void 0,e)}return r>40?{}:n??{}}function pa(e,t,r=0,n=new Set){let s=ps(e,t);if(r>6||n.has(s))return null;if("example"in s)return s.example;if(Array.isArray(s.examples)&&s.examples.length)return s.examples[0];if("default"in s)return s.default;if(Array.isArray(s.enum)&&s.enum.length)return s.enum[0];let a=new Set(n).add(s),i=d5(s.allOf);if(i.length)return Object.assign({},...i.map(t=>pa(e,t,r+1,a)).filter(e=>e&&"object"==typeof e));let o=d5(s.oneOf).concat(d5(s.anyOf));if(o.length)return pa(e,o[0],r+1,a);let l=Array.isArray(s.type)?s.type.find(e=>"null"!==e):s.type;if("object"===l||s.properties){let t={};for(let[n,i]of Object.entries(s.properties??{}))t[n]=pa(e,i,r+1,a);return t}if("array"===l)return[pa(e,s.items,r+1,a)];if("integer"===l||"number"===l)return 0;if("boolean"===l)return!1;if("string"===l){let e=d2(s.format);return"date-time"===e?"2026-01-01T00:00:00Z":"date"===e?"2026-01-01":"email"===e?"user@example.com":"uuid"===e?"00000000-0000-0000-0000-000000000000":"string"}return null}function pi(e,t){let r=e.info??{},n=d2(r.title,"Imported API").trim()||"Imported API",s=new Set,a=e=>s.add(e),i=[],o=0,l=new Map,u=(e,t="",r=!1)=>{/^[A-Za-z_][\w.-]*$/.test(e)&&!l.has(e)&&l.set(e,{key:e,value:t,secret:r})},c=function(e,t){if("swagger"===t){let t=d2(e.host);if(!t)return null;let r=d5(e.schemes).includes("https")||!d5(e.schemes).length?"https":d2(d5(e.schemes)[0]);return`${r}://${t}${d2(e.basePath).replace(/\/$/,"")}`}let r=d5(e.servers)[0];if(!r)return null;let n=d2(r.url);for(let[e,t]of Object.entries(r.variables??{}))n=n.replace(`{${e}}`,d2(t.default));return n.replace(/\/$/,"")}(e,t);c&&/^https?:\/\//i.test(c)?u("baseUrl",c):(u("baseUrl","https://api.example.com"),a(c?`The server URL “${c}” is relative — set baseUrl in the “${n}” environment`:`No server URL in the file — set baseUrl in the “${n}” environment`));let d="swagger"===t?e.securityDefinitions:(e.components??{}).securitySchemes,p=(t,r)=>{let n=d5(t)[0],s=n?Object.keys(n)[0]:void 0,i=s?ps(e,d?.[s]):void 0;if(!i)return r;let o=d2(i.type),l=d2(i.scheme).toLowerCase();return"http"===o&&"bearer"===l||"oauth2"===o||"openIdConnect"===o?(u("token","",!0),"http"!==o&&a(`${o} sign-in is set up as a Bearer token — paste a token into {{token}}, or use Run first to fetch one`),{...r,authMode:"bearer",token:"{{token}}"}):"http"===o&&"basic"===l||"basic"===o?(u("username"),u("password","",!0),{...r,authMode:"basic",username:"{{username}}",password:"{{password}}"}):"apiKey"===o?"cookie"===i.in?(a("Cookie API keys are not supported; set Auth by hand"),r):(u("apiKey","",!0),{...r,authMode:"api_key",apiName:d2(i.name,"X-API-Key"),apiValue:"{{apiKey}}",apiIn:"query"===i.in?"query":"header"}):r};for(let[r,s]of Object.entries(e.paths??{})){let l=ps(e,s),c=d5(l.parameters);for(let[s,d]of Object.entries(l)){let l,h,f=d9(s);if(!f||"parameters"===s||"object"!=typeof d)continue;if(i.length>=2e3){a("Only the first 2000 operations were imported");break}let m=d2(d5(d.tags)[0]),y=d2(d.summary).trim()||d2(d.operationId).trim()||`${f} ${r}`,g=m?`${m} › ${y}`:y,b=[...c,...d5(d.parameters)].map(t=>ps(e,t)),v=r.replace(/\{([^}]+)\}/g,(t,r)=>{let n=r.replace(/[^\w.-]/g,"_"),s=b.find(e=>"path"===e.in&&e.name===r);return u(n,d2(s?.example??ps(e,s?.schema).example??"")),`{{${n}}}`}),w=b.filter(e=>"query"===e.in&&(e.required||"example"in e)).map(t=>({key:d2(t.name),value:d2(t.example??pa(e,t.schema)??""),...d2(t.description).trim()?{description:d2(t.description).trim()}:{}})),k=lk({...ld(),method:f},`{{baseUrl}}${v}`);k={...k,url:`{{baseUrl}}${v}${w.length?`?${w.map(e=>`${e.key}=${e.value}`).join("&")}`:""}`,params:w};let x=d4(b.filter(e=>"header"===e.in).map(e=>({key:d2(e.name),value:d2(e.example??""),...d2(e.description).trim()?{description:d2(e.description).trim()}:{}})),k=p(d.security??e.security,k),a,g);k={...x.draft,headers:x.headers};let $=!0,S=!1;if("openapi"===t&&d.requestBody){let t=ps(e,d.requestBody).content??{},r=Object.keys(t).find(e=>/json/i.test(e))??Object.keys(t)[0];if(r){let n=t[r];if($=/json/i.test(r),l=n.schema,h=n.example??Object.values(n.examples??{})[0]?.value,!/json/i.test(r)){if(/x-www-form-urlencoded/i.test(r)&&!k.headers.some(e=>/^content-type$/i.test(e.key)))k={...k,headers:[...k.headers,{key:"Content-Type",value:r}]};else if(/multipart/i.test(r)){let t=Object.entries(ps(e,n.schema)?.properties??{}).map(([t,r])=>{let n=ps(e,r);return"binary"===n.format||"base64"===n.format||"array"===n.type&&ps(e,n.items)?.format==="binary"?d8(t):{key:t,value:void 0!==n.example?d2(n.example,JSON.stringify(n.example)):"",kind:"text",file:null}});k={...k,bodyMode:"multipart",formRows:t},S=!0}}}}else if("swagger"===t){let e=b.find(e=>"body"===e.in);e&&(l=e.schema)}if(!S&&(l||void 0!==h)&&"GET"!==f&&"HEAD"!==f){let t=h??pa(e,l);k=$?{...k,bodyMode:"json",bodyText:JSON.stringify(t??{},null,2)}:{...k,bodyMode:"text",bodyText:"object"==typeof t&&t?new URLSearchParams(Object.entries(t).map(([e,t])=>[e,d2(t)])).toString():d2(t)}}let _=Object.keys(d.responses??{}).find(e=>/^2\d\d$/.test(e)),A=[{type:"status",expect:_??"2xx"}],T=null;if(_){let r=ps(e,(d.responses??{})[_]),n=r.content??{},s=Object.keys(n).find(e=>/json/i.test(e)),a="swagger"===t?r.schema:s?n[s].schema:void 0,i=function(e,t,r){if(!t||"object"!=typeof t)return null;let n=new Map,s=(t,r)=>{if(!(r>60)&&t&&"object"==typeof t){if(Array.isArray(t))return t.forEach(e=>s(e,r+1));if("string"==typeof t.$ref&&t.$ref.startsWith("#/")&&!n.has(t.$ref)){let a=ps(e,{$ref:t.$ref});n.set(t.$ref,a),s(a,r+1)}for(let[e,n]of Object.entries(t))"$ref"!==e&&"example"!==e&&"examples"!==e&&s(n,r+1)}};s(t,0);let a=ps(e,t);if(!["type","properties","items","allOf","anyOf","oneOf","enum","required"].some(e=>e in a)||n.size>200)return null;let i={title:r,...t};for(let[e,t]of n){let r=e.slice(2).split("/").map(e=>e.replace(/~1/g,"/").replace(/~0/g,"~")),n=i;for(let e of r.slice(0,-1))n=n[e]??={};n[r[r.length-1]]=t}let o=JSON.stringify(i);return o.length<=2e5?o:null}(e,a,`${y} (${_})`);i&&(A.push({type:"schema",schema:i}),o++);let l=s?n[s]:void 0,u="swagger"===t?(r.examples??{})["application/json"]:l?.example??Object.values(l?.examples??{})[0]?.value,c=void 0!==u?u:a?pa(e,a):void 0;void 0!==c?T={status:Number(_),headers:[["Content-Type","application/json"]],body:JSON.stringify(c,null,2),delayMs:0}:"204"!==_&&Object.keys(n).length||(T={status:Number(_),headers:[],body:"",delayMs:0})}let O=[d2(d.summary).trim()&&d2(d.summary).trim()!==y?d2(d.summary).trim():"",d2(d.description).trim()].filter(Boolean).join("\n\n");i.push({collection:n,name:g,request:{...k,checks:A,mock:T,description:O.slice(0,5e4)}})}}i.length||a("The file has no operations under “paths”"),o&&a(`${o} request${1===o?" checks its answer":"s check their answers"} against the response schema in the file (Checks tab) — remove a check where the API differs from its documentation`);let h=d2(r.description).trim(),f=h?[{path:ln(n),settings:{...lt(),description:h.slice(0,5e4)}}]:[];return{kind:t,title:n,requests:i,folders:f,environments:[{name:n,variables:[...l.values()]}],warnings:[...s]}}let po=/\.(png|jpe?g|gif|svg|webp|avif|ico|bmp|css|js|mjs|map|woff2?|ttf|otf|eot|mp4|webm|mp3|wav|pdf)(\?|$)/i,pl=/^(image|font|audio|video)\/|^text\/(css|javascript)|javascript/i,pu=/^(:|host$|content-length$|connection$|accept-encoding$|accept-language$|user-agent$|origin$|referer$|priority$|upgrade-insecure-requests$|cache-control$|pragma$|dnt$|sec-|te$)/i;function pc(e,t,r){return/\{%/.test(e)&&t(`${r}: Insomnia template tags ({% … %}) were kept as text — replace them with {{variables}} or Run first`),e.replace(/\{\{\s*_\.([\w.-]+)\s*\}\}/g,"{{$1}}")}function pd(e,t=""){if(!e||"object"!=typeof e||Array.isArray(e))return[];let r=[];for(let[n,s]of Object.entries(e)){let e=t?`${t}.${n}`:n;s&&"object"==typeof s&&!Array.isArray(s)?r.push(...pd(s,e)):/^[A-Za-z_][\w.-]*$/.test(e)&&r.push({key:e,value:"string"==typeof s?s:JSON.stringify(s),secret:!1})}return r}function pp(e,t,r,n,s){if(!t||!t.type||"none"===t.type||t.disabled)return t?.type==="none"?{...e,authMode:"none"}:e;let a=e=>s(d2(t[e]));switch(t.type){case"bearer":return{...e,authMode:"bearer",token:a("token")};case"basic":return{...e,authMode:"basic",username:a("username"),password:a("password")};case"digest":return{...e,authMode:"digest",username:a("username"),password:a("password")};case"ntlm":return{...e,authMode:"ntlm",username:a("username"),password:a("password")};case"apikey":return{...e,authMode:"api_key",apiName:a("key")||"X-API-Key",apiValue:a("value"),apiIn:"queryParams"===d2(t.addTo)?"query":"header"};case"iam":return{...e,authMode:"aws_sigv4",aws:{accessKeyId:a("accessKeyId"),secretAccessKey:a("secretAccessKey"),sessionToken:a("sessionToken"),region:a("region")||"us-east-1",service:a("service")||"execute-api"}};case"oauth1":{let s=d2(t.signatureMethod).toUpperCase();return s.startsWith("RSA")&&r(`${n}: OAuth 1.0 with ${s} isn't supported; set the signature method by hand`),{...e,authMode:"oauth1",oauth1:{consumerKey:a("consumerKey"),consumerSecret:a("consumerSecret"),token:a("tokenKey"),tokenSecret:a("tokenSecret"),signatureMethod:"HMAC-SHA1"===s||"PLAINTEXT"===s?s:"HMAC-SHA256",realm:a("realm"),addTo:"header"}}}case"oauth2":{let s=d2(t.grantType);return"implicit"===s&&r(`${n}: the OAuth 2.0 implicit grant is outdated and not supported — it was set to client credentials`),{...e,authMode:"oauth2",oauth:{...o2(),grant:"password"===s||"authorization_code"===s?s:"client_credentials",tokenUrl:a("accessTokenUrl"),authUrl:a("authorizationUrl"),clientId:a("clientId"),clientSecret:a("clientSecret"),scope:a("scope"),username:a("username"),password:a("password"),redirectUri:a("redirectUrl")||o2().redirectUri,pkce:!1!==t.usePkce}}}default:return r(`${n}: ${t.type} auth is not supported yet; set Auth by hand`),e}}let ph=[1,2,3,5,7.5,10,15,20,30,50,75,100,150,200,300,500,750,1e3,1500,2e3,3e3,5e3,1e4,1/0];function pf(e){let t=ph[e]??1/0,r=0===e?0:ph[e-1],n=e=>e>=1e3?`${e/1e3}s`:`${e}ms`;return 1/0===t?`> ${n(r)}`:`${n(r)}–${n(t)}`}function pm(e){let t=Array(ph.length).fill(0),r=!1;for(let n of e)if(n){r=!0;for(let e=0;e<t.length;e++)t[e]+=n[e]??0}return r?t:null}function py(e,t){let r=0,n=0,s=0;for(let a=0;a<e.length;a++){let i=e[a]??0;r+=i;let o=ph[a]??1/0;o<=t?n+=i:o<=4*t&&(s+=i)}return r?(n+s/2)/r:null}function pg(e){let t=Number(e);switch(t){case 0:return"no answer at all — a timeout, a refused connection, or a network problem";case 400:return"bad request — the API did not accept what was sent";case 401:return"not signed in — the token or password is missing or expired";case 403:return"forbidden — refused on purpose, often by a firewall that blocks heavy traffic";case 404:return"not found — the address is wrong";case 408:return"the server gave up waiting for the request";case 409:return"conflict — the request clashed with the current state of the data";case 413:return"the request body is too large";case 422:return"the API understood the request but rejected its content";case 429:return"too many requests — the server or its firewall is limiting how fast you can call it";case 500:return"server error — the API itself crashed or hit a bug";case 502:return"bad gateway — a proxy in front of the API could not reach it";case 503:return"unavailable — the API is overloaded or down";case 504:return"gateway timeout — a proxy in front of the API waited too long"}return t>=500?"server error":t>=400?"the request was refused":"unexpected response"}e.s(["M",0,ph,"G",0,py,"B",0,pf,"p",0,pm],28251);let pb=new Set(["429","403"]);function pv(e){let t=function(e){let t=e.buckets.filter(e=>e.rps>0);if(t.length<2)return null;let r=t.map(e=>e.rps).sort((e,t)=>e-t),n=e=>Math.round(100*e)/100,s=e.summary.http.rps.avg||r.reduce((e,t)=>e+t,0)/e.buckets.length,a=e.buckets.filter(e=>e.vus>0);return{rps:{min:n(r[0]),max:n(r[r.length-1]),avg:n(s),p95:n(r[Math.min(r.length-1,Math.max(0,Math.ceil(.95*r.length)-1))])},vusAvg:a.length?n(a.reduce((e,t)=>e+t.vus,0)/a.length):e.summary.vus.avg}}(e);if(!t)return e;let{rps:r}=e.summary.http,n=r.min===r.max,s=e.summary.vus.avg<t.vusAvg/2;return n||s?{...e,summary:{...e.summary,http:{...e.summary.http,rps:n?t.rps:r},vus:{...e.summary.vus,avg:s?t.vusAvg:e.summary.vus.avg}}}:e}let pw={errorWarn:.01,errorFail:.05,p95WarnMs:500,p95FailMs:2e3,stabilityWarn:1.5,stabilityFail:2.5};function pk(e){return e&&e.p95Ms>0&&e.errorRate>=0?{errorWarn:.5*e.errorRate,errorFail:e.errorRate,p95WarnMs:.8*e.p95Ms,p95FailMs:e.p95Ms,owned:!0}:{...pw,owned:!1}}function px(e,t,r){let{buckets:n}=e;if(0===n.length)return 0;let s=Math.floor(n.length*t),a=Math.max(s+1,Math.ceil(n.length*r)),i=n.slice(s,a).map(e=>e.p95Ms).filter(e=>e>0);return 0===i.length?0:i.reduce((e,t)=>e+t,0)/i.length}function p$(e){let t,r=e.summary.http.status;return{failedRate:e.summary.http.failed.rate,p95:e.summary.latencyMs.p95,requests:e.summary.http.requests,bucketCount:e.buckets.length,earlyP95:px(e,0,.33),lateP95:px(e,.66,1),status5xx:Object.entries(r).filter(([e])=>Number(e)>=500).reduce((e,[,t])=>e+t,0),status0:r["0"]??0,checksPassed:e.summary.checks.reduce((e,t)=>e+t.passes,0),checksFailed:e.summary.checks.reduce((e,t)=>e+t.fails,0),dropped:e.summary.droppedIterations??0,topFailure:(t=Object.entries(r).filter(([e])=>"0"===e||Number(e)>=400).sort((e,t)=>t[1]-e[1])[0])?{code:t[0],count:t[1]}:null,blockedCount:Object.entries(r).filter(([e])=>pb.has(e)).reduce((e,[,t])=>e+t,0),status503:r["503"]??0,okP95:e.summary.latencyOkMs?.p95||null}}function pS(e,t={}){return p_(p$(e),t)}function p_(e,t={}){var r;let{failedRate:n,p95:s,requests:a,status5xx:i,status0:o}=e,l=pk(t.slo),u=l.owned?`your target: fail ≥ ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%`:"default: fail ≥ 5%",c=l.owned?`your target: warn ≥ ${(100*l.errorWarn).toFixed(l.errorWarn<.01?2:1)}%`:"default: warn ≥ 1%",d=Math.round(n*a),p=n>=l.errorFail&&(e.blockedCount??0)>=.5*d&&d>0,h=a>0&&n>=.5,f=e.topFailure,m=f&&d?` Mostly ${"0"===f.code?"no answer":f.code}: ${pg(f.code)}.`:"",y=l.owned?`your target: fail ≥ ${Math.round(l.p95FailMs)} ms`:"default: fail ≥ 2 s",g=l.owned?`your target: warn ≥ ${Math.round(l.p95WarnMs)} ms`:"default: warn ≥ 500 ms",b=0===a?{id:"errors",title:"Errors",level:"fail",summary:"No HTTP requests completed. The target may be unreachable, hanging, or blocked."}:n>=l.errorFail?{id:"errors",title:"Errors",level:"fail",summary:`${(100*n).toFixed(1)}% of requests failed (${u}).${m||" Clients would see this as broken."}`}:n>=l.errorWarn?{id:"errors",title:"Errors",level:"warn",summary:`${(100*n).toFixed(1)}% failed (${c}).${m||" Fine for a spike test; noisy for a smoke test."}`}:{id:"errors",title:"Errors",level:"pass",summary:`${(100*n).toFixed(2)}% failed. Under this load the API mostly answered.`},v=(()=>{if(h){let t=e.okP95;return{id:"latency",title:"Latency",level:null!=t&&t>=l.p95FailMs?"fail":"warn",summary:`Not meaningful here: ${(100*n).toFixed(0)}% of responses were errors, and errors come back fast.${null!=t?` Successful requests alone: p95 ${Math.round(t)} ms.`:""}`}}return s<=0&&0===a?{id:"latency",title:"Latency",level:"fail",summary:"No latency samples. Nothing to judge."}:s>=l.p95FailMs?{id:"latency",title:"Latency",level:"fail",summary:`p95 is ${Math.round(s)} ms (${y}). Most users would feel this as stuck.`}:s>=l.p95WarnMs?{id:"latency",title:"Latency",level:"warn",summary:`p95 is ${Math.round(s)} ms (${g}). OK for a heavy report API; slow for a ping/health check.`}:{id:"latency",title:"Latency",level:"pass",summary:`p95 is ${Math.round(s)} ms. 95% of calls were faster than that under this load.`}})(),w=e.earlyP95,k=e.lateP95,x=w>0?k/w:1,$=k-w>=Math.max(20,.1*l.p95WarnMs),S=h?{id:"stability",title:"Stability",level:"warn",summary:"Not judged: most responses were errors, so changes in response time describe the errors, not the API."}:e.bucketCount<6?{id:"stability",title:"Stability",level:"warn",summary:"Run was too short to judge whether latency stayed flat. Use Average (minutes) for a stability read."}:$&&x>=pw.stabilityFail?{id:"stability",title:"Stability",level:"fail",summary:`p95 grew ~${x.toFixed(1)}\xd7 from the first third to the last third. The API (or the generator) degraded as the test went on.`}:$&&x>=pw.stabilityWarn?{id:"stability",title:"Stability",level:"warn",summary:`p95 rose ~${x.toFixed(1)}\xd7 later in the run. Watch for warm-up, lock contention, or GC.`}:{id:"stability",title:"Stability",level:"pass",summary:"Latency did not blow up over time in this run. That is a healthy pattern."},_=e.dropped??0,A=p?{id:"capacity",title:"Capacity",level:"fail",summary:`Refused on purpose (${f&&pb.has(f.code)?f.code:"429/403"}): a rate limit or firewall stopped the load. This shows the limit you hit, not how much the API can take.`}:(e.status503??0)>=.5*d&&n>=l.errorFail?{id:"capacity",title:"Capacity",level:"fail",summary:"Mostly 503 (unavailable): the API, or something in front of it, was overloaded at this load."}:_>0&&_>=Math.max(1,(a+_)*.05)?{id:"capacity",title:"Capacity",level:"fail",summary:`${_.toLocaleString("en-US")} requests were never sent: this computer ran out of virtual users to hold the rate. Raise Max virtual users, or the API is too slow for this rate.`}:o>.1*a&&a>0?{id:"capacity",title:"Capacity",level:"fail",summary:"Many requests never got an HTTP status (network/timeout). Either the API or this machine’s generator is saturated."}:i>0&&i/Math.max(a,1)>=.02?{id:"capacity",title:"Capacity",level:"fail",summary:"Server 5xx responses appeared. The API is shedding load or crashing under these VUs."}:_>0?{id:"capacity",title:"Capacity",level:"warn",summary:`${_.toLocaleString("en-US")} requests were dropped because no virtual user was free. The rate you asked for was not fully held.`}:s>=l.p95WarnMs&&n<l.errorWarn?{id:"capacity",title:"Capacity",level:"warn",summary:"It still answers, but slowly. You are near a capacity cliff: raise VUs carefully or add think time."}:{id:"capacity",title:"Capacity",level:"pass",summary:"No clear saturation signal (timeouts / 5xx) at this VU level."},T=e.checksPassed??0,O=e.checksFailed??0,E=T+O,j=t.slo?.checksRate??.99,M=0===E?null:T/E<j?{id:"checks",title:"Checks",level:"fail",summary:`${(T/E*100).toFixed(1)}% of checks passed (needs ${(100*j).toFixed(+(j<1))}%). Responses arrived, but not all of them were correct.`}:O>0?{id:"checks",title:"Checks",level:"warn",summary:`${O.toLocaleString("en-US")} of ${E.toLocaleString("en-US")} checks failed — within your bar, but look at which ones.`}:{id:"checks",title:"Checks",level:"pass",summary:`All ${E.toLocaleString("en-US")} checks passed. Responses were correct, not just fast.`},N=[b,v,S,A,...M?[M]:[]],I=(r=N.map(e=>e.level)).includes("fail")?"fail":r.includes("warn")?"warn":"pass",q=p?"Blocked by a rate limit or firewall at this load — the results show that limit, not the API’s speed.":l.owned?"pass"===I?"Meets your performance targets under this load.":"warn"===I?"Close to your performance targets. Read the checks before you trust it in UAT.":"Misses your performance targets at this load.":"pass"===I?"Looks healthy under this load (built-in defaults — set your own under Goals).":"warn"===I?"Usable, with caveats. Read the lines below before you trust it in UAT.":"This run does not look production-ready at this load.";return{overall:I,headline:q,aspects:N,disclaimer:l.owned?`Your targets: errors < ${(100*l.errorFail).toFixed(l.errorFail<.01?2:1)}%, p95 < ${Math.round(l.p95FailMs)} ms. Stability and capacity use built-in rules.`:"Heuristics only (errors < 1%, p95 < 500 ms as a starting bar). Set your own thresholds when you know the API’s contract."}}function pA(e,t){try{let r=new URL(t);return`${e.toUpperCase()} ${r.origin}${r.pathname.replace(/\/+$/,"")||"/"}`}catch{return`${e.toUpperCase()} ${t}`}}function pT(e,t,r){let{report:n,meta:s}=e;return{kind:"run",id:n.id,file:t,name:s?.name?.trim()||n.testName,note:s?.note||void 0,baseline:s?.baseline===!0,savedAt:s?.savedAt??e.exportedAt??n.endedAt,startedAt:n.startedAt,endedAt:n.endedAt,status:n.status,method:n.definition.method,url:n.definition.url,endpoint:pA(n.definition.method,n.definition.url),p50:n.summary.latencyMs.median,p95:n.summary.latencyMs.p95,p99:n.summary.latencyMs.p99,rps:n.summary.http.rps.avg,errorRate:n.summary.http.failed.rate,requests:n.summary.http.requests,vusMax:n.summary.vus.max,bytes:r,verdict:p$(n),error:s?.error}}function pO(e,t,r,n){var s,a;let i,o;return{kind:"compare",id:t,file:r,name:e.meta?.name?.trim()||(s=e.apis,a=e.mode,i=s.map(e=>e.title||e.report.testName||"API").slice(0,3),o=s.length>3?` +${s.length-3}`:"",`${i.join(" vs ")}${o} (${"parallel"===a?"all at once":"one after another"})`),note:e.meta?.note||void 0,savedAt:e.meta?.savedAt??e.exportedAt,mode:e.mode,titles:e.apis.map(e=>e.title),endpoints:e.apis.map(e=>pA(e.report.definition.method,e.report.definition.url)),bytes:n}}function pE(e,t){return{exportedAt:t.savedAt,exporter:"ApiTestCenter",version:1,report:e,meta:t}}function pj(e,t){let r=(e,t)=>t>0?e/t-1:null;return{p95:r(e.p95,t.p95),rps:r(e.rps,t.rps),errorRate:t.errorRate>0?e.errorRate/t.errorRate-1:e.errorRate>0?null:0}}e.s(["s",0,pS,"F",0,p_,"X",0,function(e){let t=e.definition.load.stages;return t.length>0?t.reduce((e,t)=>e+os(t.duration),0):3e4},"P",0,function(e,t){let r=pS(e,{slo:t}),n=e=>"pass"===e?"[PASS]":"warn"===e?"[WARN]":"[FAIL]",s=e.summary.http.rps.avg,a=s>=100?String(Math.round(s)):s>=10?s.toFixed(1):s.toFixed(2),i=["APITestCenter | load test result",`${n(r.overall)} ${r.overall.toUpperCase()}`,r.headline,"","Request",`${e.definition.method} ${e.definition.url}`,"","Results",`p95 ${Math.round(e.summary.latencyMs.p95)} ms`,`Errors ${(100*e.summary.http.failed.rate).toFixed(2)}%`,`Requests ${e.summary.http.requests.toLocaleString("en-US")}`,`Peak VUs ${e.summary.vus.max}`,`Avg rps ${a}`,"","Checks",...r.aspects.map(e=>`${n(e.level)} ${e.title} — ${e.summary}`),"","Please attach the HTML report (charts) and the Excel workbook (numbers).","Tokens are not included.","",r.disclaimer];return{subject:`API test ${r.overall.toUpperCase()}: ${e.testName}`,body:i.join("\n")}},"v",0,pk,"b",0,p$],2385),e.s(["L",0,pj,"U",0,pA,"i",0,pE,"o",0,pO,"s",0,pT],94122);let pM=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),pN=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:2)} s`:`${e>=100?Math.round(e):e>=10?e.toFixed(1):e.toFixed(2)} ms`,pI=e=>`${(100*e).toFixed(e>0&&e<.001?3:2)}%`,pq={pass:{word:"PASS",mark:"✓",ink:"#137333",bg:"#e6f4ea",line:"#a8dab5"},warn:{word:"WARNING",mark:"!",ink:"#975300",bg:"#fef3e0",line:"#f5cf8b"},fail:{word:"FAIL",mark:"✕",ink:"#c62828",bg:"#fdecea",line:"#f3b0aa"}},pC={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function pz(e){let t=Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3));return t>=60?`${Math.floor(t/60)} min ${t%60} s`:`${t} s`}function pP(e,t){return null!=e&&Number.isFinite(e)?.005>Math.abs(e)?{text:"no change",ink:"#5c6778"}:{text:`${e>0?"▲":"▼"} ${Math.abs(100*e).toFixed(0)}%`,ink:(t?e>0:e<0)?"#c62828":"#137333"}:null}function pR(e){let t=new TextEncoder().encode(e),r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r).replace(/.{76}/g,"$&\r\n")}e.s(["H",0,function(e,t={}){let r,n=pS(e,{slo:t.slo??null}),s=pq[n.overall],a=e.summary,i=t.appUrl??"https://apitestcenter.com",o=t.baseline?pj({p95:a.latencyMs.p95,rps:a.http.rps.avg,errorRate:a.http.failed.rate},t.baseline):null;a.checks.reduce((e,t)=>e+t.passes,0),a.checks.reduce((e,t)=>e+t.fails,0);let l=e.definition.load.executor.endsWith("arrival-rate"),u=new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}),c=[{label:"Response time",tech:"95% of requests (p95)",value:pN(a.latencyMs.p95),change:pP(o?.p95??null,!0)},{label:"Requests per second",tech:"throughput",value:(r=a.http.rps.avg)>=100?String(Math.round(r)):r>=10?r.toFixed(1):r.toFixed(2),change:pP(o?.rps??null,!1)},{label:"Failed requests",tech:"error rate",value:pI(a.http.failed.rate),change:pP(o?.errorRate??null,!0)},{label:"Typical response",tech:"median (p50)",value:pN(a.latencyMs.median)},{label:"Slowest 1%",tech:"p99",value:pN(a.latencyMs.p99)},{label:l?"Users needed":"Simulated users",tech:"peak VUs",value:String(a.vus.max)}],d=[["Fastest",a.latencyMs.min],["Typical (p50)",a.latencyMs.median],["Most (p90)",a.latencyMs.p90],["95% (p95)",a.latencyMs.p95],["Slowest 1% (p99)",a.latencyMs.p99],["Slowest",a.latencyMs.max]],p=Math.max(...d.map(([,e])=>e),1),h="font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif",f=(e,t="")=>`<td style="${h};font-size:14px;color:#12151c;${t}">${e}</td>`,m=e=>`<tr><td style="${h};padding:22px 24px 8px;font-size:13px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#5c6778">${pM(e)}</td></tr>`,y=c.map(e=>`<td width="33%" valign="top" style="${h};padding:6px">
893
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f9;border-radius:8px"><tr><td style="${h};padding:12px 14px">
894
+ <div style="font-size:13px;color:#5c6778">${pM(e.label)}</div>
895
+ <div style="font-size:11px;color:#8b97a8">${pM(e.tech)}</div>
896
+ <div style="font-size:22px;font-weight:600;color:#12151c;margin-top:4px;font-family:Consolas,Menlo,monospace">${pM(e.value)}</div>
897
+ ${e.change?`<div style="font-size:12px;color:${e.change.ink};margin-top:2px">${pM(e.change.text)} vs reference run</div>`:""}
898
+ </td></tr></table></td>`).reduce((e,t,r)=>(r%3==0&&e.push(""),e[e.length-1]+=t,e),[]).map(e=>`<tr>${e}</tr>`).join(""),g=d.map(([e,t])=>{let r=Math.max(1,Math.round(t/p*100));return`<tr>
899
+ ${f(pM(e),"padding:3px 10px 3px 0;color:#5c6778;font-size:13px;white-space:nowrap")}
900
+ <td width="100%" style="padding:3px 0"><table role="presentation" width="${r}%" cellpadding="0" cellspacing="0"><tr><td style="background:#2a78d6;height:10px;border-radius:3px;font-size:0;line-height:0">&nbsp;</td></tr></table></td>
901
+ ${f(pM(pN(t)),"padding:3px 0 3px 10px;font-family:Consolas,Menlo,monospace;font-size:13px;white-space:nowrap;text-align:right")}
902
+ </tr>`}).join(""),b=a.thresholds.length?a.thresholds.map(e=>`<tr>${f(e.ok?"✓":"✕",`padding:4px 8px 4px 0;color:${e.ok?"#137333":"#c62828"};font-weight:700`)}${f(pM(e.name),"padding:4px 0")}${f(pM(e.actual?`measured ${e.actual}`:""),"padding:4px 0;color:#5c6778;font-size:13px;text-align:right")}</tr>`).join(""):`<tr>${f("No goals were set — the result uses built-in defaults (errors under 1%, 95% of requests under 500 ms).","color:#5c6778;font-size:13px")}</tr>`,v=a.checks.map(e=>{let t=e.passes+e.fails,r=0===e.fails;return`<tr>${f(r?"✓":"✕",`padding:4px 8px 4px 0;color:${r?"#137333":"#c62828"};font-weight:700`)}${f(pM(e.name),"padding:4px 0;font-family:Consolas,Menlo,monospace;font-size:13px")}${f(`${t?pI(e.passes/t):"—"} \xb7 ${e.fails.toLocaleString("en-US")} failed of ${t.toLocaleString("en-US")}`,"padding:4px 0;color:#5c6778;font-size:13px;text-align:right")}</tr>`}).join(""),w=n.aspects.map(e=>{let t=pq[e.level];return`<tr>${f(t.mark,`padding:5px 8px 5px 0;color:${t.ink};font-weight:700`)}${f(`<b>${pM(e.title)}</b> — ${pM(e.summary)}`,"padding:5px 0;font-size:13px")}</tr>`}).join(""),k=[["Request",`${e.definition.method} ${e.definition.url}`],["Load style",pC[e.definition.load.executor]??e.definition.load.executor],[l?"Peak request rate":"Simulated users",l?`${e.definition.load.rate??"—"} per second`:String(Math.max(...e.definition.load.stages.map(e=>e.target),0))],["Test length",pz(e)],["Total requests",a.http.requests.toLocaleString("en-US")],["Sign-in type","none"===e.definition.auth.mode?"none":e.definition.auth.mode]];e.definition.data?.before&&k.push(["Runs first",e.definition.data.before.label]),e.definition.data?.testData&&k.push(["Test data",`${e.definition.data.testData.fileName} \xb7 ${e.definition.data.testData.rows.toLocaleString("en-US")} rows`]);let x=k.map(([e,t])=>`<tr>${f(pM(e),"padding:4px 16px 4px 0;color:#5c6778;font-size:13px;white-space:nowrap;vertical-align:top")}${f(pM(t),"padding:4px 0;font-size:13px;word-break:break-all")}</tr>`).join(""),$=`<!doctype html>
903
+ <html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>${pM(e.testName)}</title></head>
904
+ <body style="margin:0;padding:0;background:#f4f6f9">
905
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:#f4f6f9"><tr><td align="center" style="padding:24px 12px">
906
+ <table role="presentation" width="640" cellpadding="0" cellspacing="0" style="max-width:640px;width:100%;background:#ffffff;border:1px solid #d5dce6;border-radius:12px">
907
+ <tr><td style="${h};padding:20px 24px 4px;font-size:12px;color:#5c6778">APITestCenter \xb7 Load test result</td></tr>
908
+ <tr><td style="${h};padding:0 24px;font-size:20px;font-weight:600;color:#12151c">${pM(e.testName)}</td></tr>
909
+ <tr><td style="${h};padding:4px 24px 0;font-size:13px;color:#5c6778">${pM(u)} \xb7 ${pM(pz(e))} \xb7 ${pM(e.definition.method)} <span style="font-family:Consolas,Menlo,monospace">${pM(e.definition.url)}</span></td></tr>
910
+ <tr><td style="padding:16px 24px 0">
911
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background:${s.bg};border:1px solid ${s.line};border-radius:10px"><tr>
912
+ <td style="${h};padding:14px 16px;font-size:15px;color:${s.ink}"><b style="font-size:13px;letter-spacing:.06em">${s.mark} ${s.word}</b><br><span style="color:#12151c">${pM(n.headline)}</span></td>
913
+ </tr></table>
914
+ </td></tr>
915
+ ${m("Key numbers")}
916
+ <tr><td style="padding:0 18px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${y}</table></td></tr>
917
+ ${m("Response time, fastest to slowest")}
918
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${g}</table></td></tr>
919
+ ${m("Pass/fail goals")}
920
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${b}</table></td></tr>
921
+ ${v?`${m("Checks on every response")}<tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${v}</table></td></tr>`:""}
922
+ ${m("What the result is based on")}
923
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${w}</table></td></tr>
924
+ ${m("Test settings")}
925
+ <tr><td style="padding:0 24px"><table role="presentation" width="100%" cellpadding="0" cellspacing="0">${x}</table></td></tr>
926
+ <tr><td style="${h};padding:22px 24px 6px;font-size:12px;color:#5c6778">${pM(n.disclaimer)}</td></tr>
927
+ <tr><td style="${h};padding:0 24px 22px;font-size:12px;color:#5c6778">The full report with charts is attached as an HTML file. Made with <a href="${pM(i)}" style="color:#08705f">APITestCenter</a>. No tokens or passwords are included.</td></tr>
928
+ </table>
929
+ </td></tr></table>
930
+ </body></html>`,S=["APITestCenter — load test result",`${e.testName}`,`${u} \xb7 ${pz(e)} \xb7 ${e.definition.method} ${e.definition.url}`,"",`${s.word}: ${n.headline}`,"","Key numbers",...c.map(e=>` ${`${e.label}:`.padEnd(22)}${e.value}${e.change?` (${e.change.text} vs reference run)`:""}`),"","Pass/fail goals",...a.thresholds.length?a.thresholds.map(e=>` ${e.ok?"[met] ":"[missed]"} ${e.name}${e.actual?` — measured ${e.actual}`:""}`):[" None set — built-in defaults were used."],...a.checks.length?["","Checks",...a.checks.map(e=>` ${e.fails?"[fail]":"[ok] "} ${e.name} — ${e.fails.toLocaleString("en-US")} failed of ${(e.passes+e.fails).toLocaleString("en-US")}`)]:[],"","What the result is based on",...n.aspects.map(e=>` [${pq[e.level].word}] ${e.title} — ${e.summary}`),"",n.disclaimer,`Made with APITestCenter — ${i}`].join("\n");return{subject:`Load test ${pq[n.overall].word}: ${e.testName} — ${pN(a.latencyMs.p95)} p95, ${pI(a.http.failed.rate)} failed`,html:$,text:S}},"W",0,function(e){let t=`atc-mixed-${Math.random().toString(36).slice(2)}`,r=`atc-alt-${Math.random().toString(36).slice(2)}`,n=e=>`=?UTF-8?B?${pR(e).replace(/\r\n/g,"")}?=`,s=["X-Unsent: 1",`Subject: ${n(e.subject)}`,"MIME-Version: 1.0",`Content-Type: multipart/mixed; boundary="${t}"`,"",`--${t}`,`Content-Type: multipart/alternative; boundary="${r}"`,"",`--${r}`,"Content-Type: text/plain; charset=UTF-8","Content-Transfer-Encoding: base64","",pR(e.text),`--${r}`,"Content-Type: text/html; charset=UTF-8","Content-Transfer-Encoding: base64","",pR(e.html),`--${r}--`];for(let r of e.attachments??[])s.push(`--${t}`,`Content-Type: ${r.type}; charset=UTF-8; name="${n(r.name)}"`,`Content-Disposition: attachment; filename="${n(r.name)}"`,"Content-Transfer-Encoding: base64","",pR(r.content));return s.push(`--${t}--`,""),s.join("\r\n")}],54608);let pL={p50:["Typical response time","p50"],p95:["Response time","p95"],p99:["Slowest 1%","p99"],rps:["Requests per second","throughput"],errorRate:["Failed requests","error rate"],checksRate:["Checks passed","checks rate"]};function pU(e){let t=e.summary.checks.reduce((e,t)=>e+t.passes,0),r=e.summary.checks.reduce((e,t)=>e+t.fails,0);return t+r?t/(t+r):null}function pF(e){let t=e.definition.load,r=t.executor.endsWith("arrival-rate"),n=r?t.rate??Math.max(0,...t.stages.map(e=>e.target)):Math.max(0,...t.stages.map(e=>e.target));return{rate:r,peak:n,ms:t.stages.reduce((e,t)=>e+os(t.duration),0)}}let pD=e=>`${Math.round(100*Math.abs(e))}%`,pB=e=>e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`,pK=e=>`${(100*e).toFixed(+(e<.1))}%`;function pZ(e,t,r={}){let n,s,a=r.minRelative??.05,i=r.minMs??10,o=r.minRate??.005,l=e.summary.http.failed.rate>=.5||t.summary.http.failed.rate>=.5,u=(e,t,r,n,s)=>{let[u,c]=pL[e],d={key:e,label:u,tech:c,before:t,after:r};if(null==t||null==r)return{...d,relative:null,absolute:null,direction:"n/a",note:"not measured in both runs"};let p=r-t,h=t>0?r/t-1:r>0?null:0;if("ms"===s&&l)return{...d,relative:h,absolute:p,direction:"n/a",note:"mostly error responses — not the API's speed"};let f="rate"===s?Math.abs(p)<o:Math.abs(h??1)<a||"ms"===s&&Math.abs(p)<i;return{...d,relative:h,absolute:p,direction:f||0===p?"same":p>0===n?"better":"worse"}},c=e.summary,d=t.summary,p=[u("p95",c.latencyMs.p95,d.latencyMs.p95,!1,"ms"),u("p50",c.latencyMs.median,d.latencyMs.median,!1,"ms"),u("p99",c.latencyMs.p99,d.latencyMs.p99,!1,"ms"),u("rps",c.http.rps.avg,d.http.rps.avg,!0,"count"),u("errorRate",c.http.failed.rate,d.http.failed.rate,!1,"rate")],h=pU(e),f=pU(t);(null!=h||null!=f)&&p.push(u("checksRate",h,f,!0,"rate"));let{unfair:m,caveats:y}=function(e,t){let r=[],n=[],s=pA(e.definition.method,e.definition.url),a=pA(t.definition.method,t.definition.url);s!==a&&r.push(`they test different requests (${s} and ${a})`);let i=pF(e),o=pF(t);for(let[s,a]of(i.rate!==o.rate?r.push("one held a request rate and the other used simulated users"):i.peak!==o.peak&&r.push(`the load was different (${i.peak} vs ${o.peak} ${i.rate?"requests per second":"users"} at the peak)`),i.ms&&o.ms&&Math.abs(i.ms-o.ms)/Math.max(i.ms,o.ms)>.25&&n.push("the runs were planned for different lengths"),[[e,"before"],[t,"after"]]))"stopped"===s.endReason&&n.push(`the ${a} run was stopped early`),"target-missed"===s.endReason&&n.push(`the ${a} run stopped early because a goal was missed`);return{unfair:r,caveats:n}}(e,t),g=Object.fromEntries(p.map(e=>[e.key,e])),b=g.p95,v=g.errorRate,w=g.checksRate;if(m.length)n="unfair",s=`Not a fair comparison: ${m.join("; ")}. The numbers are shown, but don't read them as better or worse.`;else if("worse"===v.direction)n="worse",s=`After fails more often: ${pK(v.before)} → ${pK(v.after)} of requests failed.`;else if(w?.direction==="worse")n="worse",s=`After gives more wrong answers: checks passed ${pK(w.before)} → ${pK(w.after)}.`;else if("worse"===b.direction)n="worse",s=`After is ${pD(b.relative??0)} slower: 95% of requests within ${pB(b.before)} → ${pB(b.after)}. That is more than normal run-to-run variation.`;else if("better"===b.direction){let e=p.some(e=>"worse"===e.direction);n=e?"mixed":"better",s=`After is ${pD(b.relative??0)} faster: 95% of requests within ${pB(b.before)} → ${pB(b.after)}.${e?" Some other measures got worse — see below.":""}`}else if("better"===v.direction)n="better",s=`After fails less often: ${pK(v.before)} → ${pK(v.after)} of requests failed. Speed is about the same.`;else if("n/a"===b.direction)n="same",s="Speed can't be compared: most responses in at least one run were errors.";else{let e=p.filter(e=>"worse"===e.direction);n=e.length?"mixed":"same",s=e.length?`Response time is about the same, but ${e.map(e=>e.label.toLowerCase()).join(" and ")} got worse.`:"About the same — the differences are within normal run-to-run variation."}return!m.length&&y.length&&(s+=` Note: ${y.join("; ")}.`),{before:{id:e.id,name:e.testName,startedAt:e.startedAt},after:{id:t.id,name:t.testName,startedAt:t.startedAt},metrics:p,fair:0===m.length,reasons:[...m,...y],level:n,headline:s}}e.s(["d",0,function(e,t){let r=[],n=e.map((e,n)=>{let s=pF(e),a=Date.parse(e.endedAt)-Date.parse(e.startedAt),i=Number.isFinite(a)&&a>0?a:(e.buckets.at(-1)?.elapsedS??0)*1e3,o=s.rate?s.peak:Math.max(0,...e.buckets.map(e=>e.vus))||s.peak;return"stopped"===e.endReason&&r.push(`${t[n]} was stopped early`),"target-missed"===e.endReason&&r.push(`${t[n]} stopped early because a goal was missed`),{label:t[n],rate:s.rate,peak:o,ms:i,stopped:"stopped"===e.endReason||"target-missed"===e.endReason}});if(n.length<2)return{unfair:null,caveats:r};let s=Math.max(...n.map(e=>e.ms));if(!(n.some(e=>e.rate!==n[0].rate)||n.some(e=>Math.abs(e.peak-n[0].peak)>Math.max(1,.1*n[0].peak))||n.some(e=>s>0&&(s-e.ms)/s>.25)))return{unfair:null,caveats:r};let a=[];for(let e of n){let t=(e,t)=>Math.abs(e-t)<=.1*Math.max(e,t),r=a.find(({first:r})=>r.rate===e.rate&&r.stopped===e.stopped&&t(r.ms,e.ms)&&t(r.peak,e.peak));r?r.names.push(e.label):a.push({first:e,names:[e.label]})}let i=[...a].sort((e,t)=>e.names.length-t.names.length).map(e=>{var t;let r;return`${(t=e.names).length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t.at(-1)}`} ${r=e.first,`ran ${function(e){let t=Math.max(1,Math.round(e/1e3));if(t<60)return`${t} s`;let r=Math.floor(t/60);return t%60?`${r} min ${t%60} s`:`${r} min`}(r.ms)} ${r.rate?`at ${r.peak} requests per second`:`with up to ${r.peak} user${1===r.peak?"":"s"}`}${r.stopped?" (stopped early)":""}`}`});return{unfair:`Not a like-for-like comparison: ${i.join("; ")}.`,caveats:[]}},"c",0,pZ],55658);let pJ=["latency","throughput","status","phase","percentiles","thresholds"],pH=pJ.map(e=>({id:e,w:1,h:1}));function pW(e){return[{key:"p50",label:"Median latency (p50)",unit:"ms",better:"lower",read:e=>e.summary.latencyMs.median},{key:"p95",label:"95th percentile latency",unit:"ms",better:"lower",read:e=>e.summary.latencyMs.p95},{key:"p99",label:"99th percentile latency",unit:"ms",better:"lower",read:e=>e.summary.latencyMs.p99},{key:"rps",label:"Requests per second",unit:"rps",better:"higher",read:e=>e.summary.http.rps.avg},{key:"err",label:"Error rate",unit:"pct",better:"lower",read:e=>e.summary.http.failed.rate},{key:"reqs",label:"Total requests",unit:"count",better:"neutral",read:e=>e.summary.http.requests}].map(t=>{let r=e.map(t.read);return{key:t.key,label:t.label,unit:t.unit,better:t.better,values:r,winner:function(e,t){if("neutral"===t||0===e.length)return null;let r=0;for(let n=1;n<e.length;n++){let s=e[n]??0,a=e[r]??0;("lower"===t?s<a:s>a)&&(r=n)}let n=e[r];return null==n||e.filter(e=>e===n).length>1?null:r}(r,t.better)}})}function pV(e,t,r=new Date().toISOString()){let n=e.map(e=>e.report),s={exportedAt:r,exporter:"ApiTestCenter",version:1,kind:"compare",mode:t,apis:e,kpis:n.length>=2?pW(n):[]};return`${JSON.stringify(s,null,2)}
931
+ `}e.s(["p",0,{latency:"Latency over time",throughput:"Throughput and offered load",status:"Status codes over time",phase:"Where time went",percentiles:"Latency distribution",thresholds:"Thresholds / SLO"},"L",0,function(e){return e.summary.thresholds.length>0||e.summary.checks.length>0},"$",0,function(e,t){let r=new Set,n=[];if(Array.isArray(e))for(let s of e){if(!pJ.includes(s.id))continue;let e=s.id;!r.has(e)&&("thresholds"!==e||t)&&(r.add(e),n.push({id:e,w:2===s.w?2:1,h:2===s.h?2:1}))}for(let e of pH)("thresholds"!==e.id||t)&&(r.has(e.id)||n.push({...e}));return n}],46306),e.s(["l",0,pW,"u",0,function(e,t){let r=`API ${e+1}`,n=t?.trim();return!n||/^API\s*\d+$/i.test(n)?r:/^API\s*\d+\s*\(.*\)$/i.test(n)?n:`${r} (${n})`},"g",0,function(e,t={}){let r=e.map(e=>{let t=new Map;for(let r of e.buckets)t.set(r.elapsedS,r);return t}),n=[...new Set(r.flatMap(e=>[...e.keys()]))],s=n.length?Math.max(...n):0;return Array.from({length:Math.max(t.durationS&&t.durationS>0?Math.ceil(t.durationS):0,s,0)+1},(e,t)=>t).map(e=>({elapsedS:e,p50:r.map(t=>t.get(e)?.p50Ms),p95:r.map(t=>t.get(e)?.p95Ms),p99:r.map(t=>t.get(e)?.p99Ms),rps:r.map(t=>t.get(e)?.rps),failedRate:r.map(t=>t.get(e)?.failedRate),vus:r.map(t=>t.get(e)?.vus)}))}],60617),e.s(["y",0,function(e,t){return e.map(e=>{let r=pS(e.report,{slo:t});return{id:e.id,title:e.title,overall:r.overall,headline:r.headline}})},"z",0,function(e,t){return null==e.winner?"tie":t[e.winner]??`API ${e.winner+1}`},"E",0,pV,"m",0,function(e,t=new Date().toISOString()){return`${JSON.stringify({exportedAt:t,exporter:"ApiTestCenter",version:1,kind:"probe",probe:{ok:e.ok,status:e.status,statusText:e.statusText??"",url:e.url,headers:e.headers,body:e.body,truncated:!!e.truncated,durationMs:e.durationMs??0,error:e.error}},null,2)}
932
+ `}],88491);let pG="#12151c",pX="#5c6778",pY="#d5dce6",pQ="#ffffff",p0="#137333",p1="#975300",p2="#c62828",p5={p50:"#86b6ef",p90:"#3987e5",p95:"#256abf",p99:"#104281",p999:"#6250d6",max:"#12151c"},p9="#0ca30c",p4="#fab219",p6="#d03b3b",p3="#898781",p8=["#eef4fc","#c3d9f5","#86b6ef","#3987e5","#256abf","#104281"],p7=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),he=e=>Number.isFinite(e)?e<10?`${e.toFixed(1)} ms`:e>=1e4?`${(e/1e3).toFixed(1)} s`:`${Math.round(e)} ms`:"—",ht=e=>Number.isFinite(e)?e>=1e3?`${(e/1e3).toFixed(2)}k`:e.toFixed(e>=100?0:1):"—",hr=e=>`${(100*e).toFixed(e<.01?2:1)}%`,hn=e=>new Intl.NumberFormat("en-US").format(Math.round(e)),hs=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(2)} MB`,ha=e=>e>=60?`${Math.floor(e/60)}m ${e%60?`${e%60}s`:""}`.trim():`${e}s`,hi=e=>Math.max(0,Math.round((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3)),ho=e=>"ok"===e?p0:"warn"===e?p1:"bad"===e?p2:pG;function hl(e,t,r){let n=e.summary;switch(t){case"throughput":return{text:`${ht(n.http.rps.avg)} rps`,hint:`max ${ht(n.http.rps.max)}`};case"peakRps":return{text:`${ht(n.http.rps.max)} rps`,hint:`average ${ht(n.http.rps.avg)}`};case"p95":{let e=r?.p95Ms??500;if(n.http.failed.rate>=.5)return{text:he(n.latencyMs.p95),hint:"mostly error responses — not the API’s speed"};let t=n.latencyMs.p95>=(r?e:2e3)?"bad":n.latencyMs.p95>=e*(r?.8:1)?"warn":"ok";return{text:he(n.latencyMs.p95),hint:`slowest 1% ${he(n.latencyMs.p99)}`,tone:t}}case"p50":return{text:he(n.latencyMs.median),hint:"half of requests were faster"};case"avg":return{text:he(n.latencyMs.mean),hint:`typical spread \xb1${he(n.latencyMs.stdDev)}`};case"p99":return{text:he(n.latencyMs.p99),hint:`slowest ${he(n.latencyMs.max)}`};case"max":return{text:he(n.latencyMs.max),hint:`fastest ${he(n.latencyMs.min)}`};case"ttfb":{let e=n.latencyMs.mean>0?Math.min(1,n.phasesMs.ttfb.avg/n.latencyMs.mean):0;return{text:he(n.phasesMs.ttfb.avg),hint:`${Math.round(100*e)}% of the response time`}}case"errors":{let e=n.http.failed.rate,t=e>=(r?r.errorRate:.05)?"bad":e>=(r?.5*r.errorRate:.01)?"warn":"ok";return{text:hr(e),hint:`${hn(n.http.failed.count)} failed`,tone:t}}case"checks":{let e=n.checks.reduce((e,t)=>e+t.passes,0),t=n.checks.reduce((e,t)=>e+t.fails,0);if(!e&&!t)return{text:"—",hint:"no checks set"};let s=e/(e+t),a=r?.checksRate??.99;return{text:hr(s),hint:`${hn(t)} failed`,tone:s>=a?"ok":s>=a-.05?"warn":"bad"}}case"vus":return{text:String(n.vus.max),hint:`average ${n.vus.avg.toFixed(1)}`};case"requests":return{text:hn(n.http.requests),hint:`${hn(n.iterations.count)} iterations`};case"dropped":{let e=n.droppedIterations;return null==e?{text:"—",hint:"rate mode only"}:{text:hn(e),tone:e>0?"warn":"ok",hint:"requests that could not start on time"}}case"apdex":{let t=pm(e.buckets.map(e=>e.hist)),n=t?py(t,r?.p95Ms??500):null;return null==n?{text:"—",hint:"not recorded"}:{text:n.toFixed(2),tone:n>=.85?"ok":n>=.7?"warn":"bad",hint:n>=.94?"excellent":n>=.85?"good":n>=.7?"fair":"poor"}}case"data":return{text:hs(n.data.bytesIn),hint:`sent ${hs(n.data.bytesOut)}`};case"sent":return{text:hs(n.data.bytesOut),hint:`received ${hs(n.data.bytesIn)}`};case"duration":return{text:ha(hi(e)),hint:`${hn(n.http.requests)} requests`}}}let hu=640;function hc(e){if(!(e>0))return 1;let t=Math.pow(10,Math.floor(Math.log10(e)));for(let r of[1,1.5,2,2.5,3,4,5,6,8,10])if(r*t>=e)return r*t;return 10*t}function hd(e,t,r,n={}){let s=n.h??210;if(!e.length||!t.length)return'<p class="empty">Not recorded for this run.</p>';let a=n.stacked?t.map((r,n)=>e.map((e,r)=>t.slice(0,n+1).reduce((e,t)=>e+(t.values[r]??0),0))):t.map(e=>e.values),i=hc(Math.max(...a.flat().filter(e=>null!=e&&Number.isFinite(e)),n.ref?.value??0,0)),o=e[0],l=e[e.length-1]===o?o+1:e[e.length-1],u=e=>52+(e-o)/(l-o)*(hu-52-12),c=e=>s-24-e/i*(s-10-24),d=[0,.25,.5,.75,1].map(e=>i*e).map(e=>`<line x1="52" x2="${hu-12}" y1="${c(e).toFixed(1)}" y2="${c(e).toFixed(1)}" class="g"/><text x="${46}" y="${(c(e)+3.5).toFixed(1)}" class="t" text-anchor="end">${p7(r(e))}</text>`).join(""),p=Array.from({length:6},(e,t)=>Math.round(o+(l-o)*t/5)).map(e=>`<text x="${u(e).toFixed(1)}" y="${s-6}" class="t" text-anchor="middle">${p7(ha(e))}</text>`).join(""),h=a.map((r,s)=>{let i,o,l,d=t[s],p="",h=!1;if(r.forEach((t,r)=>{null!=t&&Number.isFinite(t)?(p+=`${h?"L":"M"}${u(e[r]).toFixed(1)},${c(t).toFixed(1)}`,h=!0):h=!1}),!p)return"";let f=n.area||n.stacked?(i=n.stacked&&s>0?a[s-1]:e.map(()=>0),o=r.map((t,r)=>`${u(e[r]).toFixed(1)},${c(t??0).toFixed(1)}`).join(" L"),l=[...i].reverse().map((t,r)=>`${u(e[e.length-1-r]).toFixed(1)},${c(t??0).toFixed(1)}`).join(" L"),`<path d="M${o} L${l} Z" fill="${d.color}" fill-opacity="${n.stacked?.85:.18}" stroke="none"/>`):"";return`${f}<path d="${p}" fill="none" stroke="${d.color}" stroke-width="2" stroke-linejoin="round"${d.dash?' stroke-dasharray="5 4"':""}/>`}).join(""),f=n.ref?`<line x1="52" x2="${hu-12}" y1="${c(n.ref.value).toFixed(1)}" y2="${c(n.ref.value).toFixed(1)}" stroke="${pX}" stroke-dasharray="6 4"/><text x="${hu-12}" y="${(c(n.ref.value)-4).toFixed(1)}" class="t" text-anchor="end">${p7(n.ref.label)}</text>`:"",m=Math.max(1,Math.ceil(e.length/240)),y=(hu-52-12)/Math.max(1,(e.length-1)/m),g=e.map((e,n)=>n%m?"":`<rect x="${(u(e)-y/2).toFixed(1)}" y="10" width="${y.toFixed(1)}" height="${s-10-24}" fill="transparent"><title>${p7(ha(e))}
933
+ ${t.map(e=>`${e.label}: ${null==e.values[n]?"—":r(e.values[n])}`).join("\n")}</title></rect>`).join(""),b=t.length>1?`<div class="legend">${t.map(e=>`<span><i style="background:${e.color}"></i>${p7(e.label)}</span>`).join("")}</div>`:"";return`<svg viewBox="0 0 ${hu} ${s}" role="img" aria-label="${p7(t.map(e=>e.label).join(", "))} over time">${d}${p}${f}${h}${g}</svg>${b}`}function hp(e){let t=Math.max(...e.map(e=>e.value),1);return`<table class="bars">${e.map(e=>`<tr><th>${p7(e.label)}</th><td><span class="bar" style="width:${Math.max(1,e.value/t*100).toFixed(1)}%;background:${e.color}"></span></td><td class="v">${p7(e.text)}</td></tr>`).join("")}</table>`}let hh={"constant-vus":"Steady users","ramping-vus":"Changing users","constant-arrival-rate":"Steady request rate","ramping-arrival-rate":"Changing request rate"};function hf(e){let t=e.definition.load.executor.endsWith("arrival-rate"),r=e=>t?`${e} requests/s`:`${e} ${1===e?"user":"users"}`,n=e.definition.load.stages,s=e.definition.load.executor.startsWith("constant")?n[0]?.target??0:0,a=n.map(e=>{let t=e.target===s?`stay at ${r(e.target)} for ${e.duration}`:`${e.target>s?"go up":"go down"} to ${r(e.target)} over ${e.duration}`;return s=e.target,t}).join(", then ");return a.charAt(0).toUpperCase()+a.slice(1)}e.s(["f",0,function(e,t={}){let r=t.generatedAt??new Date().toISOString(),n=t.view??A("run"),s=pS(e,{slo:t.slo??null}),a=function(e,t={}){let r=e.summary,n=e.buckets,s=t.slo??null,a=p$(e),i=[],o=[],l=e.definition.load.executor.endsWith("arrival-rate"),u=function(e){let t=e.summary,r=t.http.failed.rate,n=Object.entries(t.http.status).filter(([e])=>"0"===e||Number(e)>=400),s=n.reduce((e,[,t])=>e+t,0),a=[...n].sort((e,t)=>t[1]-e[1])[0],i=a&&s?{code:a[0],count:a[1],share:a[1]/s,meaning:pg(a[0])}:null,o=n.filter(([e])=>pb.has(e)).reduce((e,[,t])=>e+t,0),l=e.buckets.filter(e=>e.rps>0||e.vus>0),u=function(e){for(let t=0;t<e.length;t++){let r=e.slice(t,t+3).filter(e=>e.rps>0);if(r.length&&r.every(e=>e.failedRate>=.5))return t}return -1}(l),c=u>=0?l[u]:null,d=c?{elapsedS:c.elapsedS,vus:Math.round(c.vus),rps:Math.round(c.rps)}:null,p=null;if(c){let e=Math.max(...l.slice(u).map(e=>e.vus)),t=l.findIndex((t,r)=>r>=u&&t.vus===e),r=l.slice(t+1).filter(e=>e.rps>0&&e.vus<=Math.max(1,.6*c.vus));if(r.length>=3){let e=r.slice(Math.floor(r.length/3));p=e.reduce((e,t)=>e+t.failedRate,0)/e.length<.1}}let h=c?l.slice(0,u).filter(e=>e.rps>0&&e.failedRate<.5):[],f=h.length?{vus:Math.round(Math.max(...h.map(e=>e.vus))),rps:Math.round(Math.max(...h.map(e=>e.rps)))}:null,m=null;if(t.latencyOkMs&&t.latencyOkMs.p95>0)m=t.latencyOkMs.p95;else{let e=pm((c?h:l.filter(e=>e.failedRate<.5)).map(e=>e.hist));m=e?function(e){let t=e.reduce((e,t)=>e+t,0);if(!t)return null;let r=0;for(let n=0;n<e.length;n++)if((r+=e[n])/t>=.95){let e=ph[n];return Number.isFinite(e)?e:ph[ph.length-2]}return null}(e):null}return{failedRate:r,dominant:i,blocked:s>0&&o/s>=.5,timingsUnreliable:r>=.5,onset:d,recovered:p,lastHealthy:f,healthyP95Ms:m}}(e);i.push(`<b>Load.</b> ${p7(hf(e))}. In ${p7(ha(hi(e)))} the API answered ${p7(hn(r.http.requests))} requests — ${p7(ht(r.http.rps.avg))} per second on average, ${p7(ht(r.http.rps.max))} at the busiest second.`);let c=r.latencyMs.p95;if(u.timingsUnreliable){let e=u.healthyP95Ms;i.push(`<b>Speed.</b> The response times of this run are not meaningful: ${p7(hr(r.http.failed.rate))} of responses were errors, and errors come back almost instantly.${e?u.onset?` While requests were still succeeding (before ${p7(ha(u.onset.elapsedS))}), 95% took about ${p7(he(e))}.`:` Successful requests alone: 95% took about ${p7(he(e))}.`:""}`)}else{let e=`<b>Speed.</b> A typical request took ${p7(he(r.latencyMs.median))}; 95% finished within ${p7(he(c))}, and the slowest took ${p7(he(r.latencyMs.max))}.`;s?.p95Ms&&(e+=c<=s.p95Ms?` That is within your ${p7(he(s.p95Ms))} goal.`:` That is over your ${p7(he(s.p95Ms))} goal by ${p7(he(c-s.p95Ms))}.`),r.latencyMs.p99>3*c&&r.latencyMs.p99>100&&(e+=` The slowest 1% (${p7(he(r.latencyMs.p99))}) is much slower than the rest — a few requests hit something slow, like a cold cache, a lock, or garbage collection.`),i.push(e)}if(n.length>=6&&a.earlyP95>0&&!u.onset&&!u.timingsUnreliable){let e=a.lateP95/a.earlyP95;e>1.5?(i.push(`<b>Over time.</b> It got slower as the test went on: 95% of requests took ${p7(he(a.earlyP95))} early on and ${p7(he(a.lateP95))} near the end (\xd7${e.toFixed(1)}). That often means work piling up — a queue, a connection pool, or memory that keeps growing.`),o.push("Run it longer (the Soak preset) to see whether the slowdown keeps growing.")):e<.67?i.push(`<b>Over time.</b> It got faster after the start (${p7(he(a.earlyP95))} → ${p7(he(a.lateP95))}) — typical of warm-up: caches filling, connections opening, code getting compiled.`):i.push("<b>Over time.</b> Response time stayed steady from start to finish.")}let d=r.http.failed.count;if(d){let e=Object.entries(r.http.status).filter(([e])=>"0"===e||Number(e)>=400).sort((e,t)=>t[1]-e[1]).slice(0,4).map(([e,t])=>`${"0"===e?"no answer":e} \xd7${hn(t)}`).join(", "),t=n.find(e=>e.failedRate>0),s=u.dominant,l=`<b>Errors.</b> ${p7(hn(d))} requests failed (${p7(hr(r.http.failed.rate))})${e?`: ${p7(e)}`:""}.`;s&&(l+=` ${p7("0"===s.code?"No answer":s.code)} means ${p7(s.meaning)}.`),u.onset?(l+=` From ${p7(ha(u.onset.elapsedS))} on — at about ${p7(hn(u.onset.vus))} simultaneous users and ${p7(ht(u.onset.rps))} requests per second — most requests failed.`,u.lastHealthy&&(l+=` Up to about ${p7(hn(u.lastHealthy.vus))} users (${p7(ht(u.lastHealthy.rps))} requests per second) it answered normally.`),!1===u.recovered?l+=" They kept failing even after the load dropped back — a lockout, typical of a rate limit or firewall that blocks a caller for a while.":!0===u.recovered&&(l+=" When the load dropped, it recovered.")):t&&(l+=` The first failures appeared at ${p7(ha(t.elapsedS))}.`),i.push(l),u.blocked?o.push(s?.code==="403"?"You were blocked (403). If this API is yours, ask for this computer’s address to be allowed through the firewall, or test a staging server without it.":"You were rate-limited (429). Lower the load — Requests per second mode with a modest rate — or test a staging server without the limit. Don’t load test public sites or APIs you don’t control."):s?.code==="503"&&o.push("The API was overloaded (503). Lower the load step by step to find where the 503s start — that is its current limit."),a.status5xx>0&&o.push("Look at the server logs around the time of the 5xx errors — the API itself reported a problem."),a.status0>0&&o.push("Some requests got no answer at all: check timeouts, the network, and whether the API was overloaded.")}else i.push("<b>Errors.</b> No request failed.");let p=r.checks.reduce((e,t)=>e+t.passes,0),h=r.checks.reduce((e,t)=>e+t.fails,0);if(p+h>0){let e=[...r.checks].sort((e,t)=>t.fails-e.fails)[0];i.push(h?`<b>Correctness.</b> ${p7(hn(h))} of ${p7(hn(p+h))} checks failed; the most often failed was <code>${p7(e.name)}</code>. A fast answer is not a correct one.`:`<b>Correctness.</b> Every check passed on every response (${p7(hn(p))} checks).`)}else o.push("Add checks (Checks tab) so a fast answer that is wrong still counts as a failure.");let f=r.phasesMs,m=f.blocked.avg+f.dns.avg+f.tcp.avg+f.tls.avg+f.send.avg+f.ttfb.avg+f.download.avg;if(m>0&&!u.timingsUnreliable){let e=f.ttfb.avg/m,t=(f.blocked.avg+f.dns.avg+f.tcp.avg+f.tls.avg)/m;e>=.7?i.push(`<b>Where the time went.</b> Most of each request (${Math.round(100*e)}%) was the API working on the answer, so speed-ups will come from the API itself — its code, database, or downstream calls.`):t>=.4?(i.push(`<b>Where the time went.</b> ${Math.round(100*t)}% of each request was spent connecting (waiting for a connection, DNS, TCP, TLS), not in the API.`),o.push("Connection time is high: check that connections are reused (Settings → keep connections), and the network between this computer and the API.")):i.push(`<b>Where the time went.</b> Time was split between the server (${Math.round(100*e)}%) and moving data or connecting.`)}let y=n.filter(e=>e.rps>0);if(y.length>=8&&!u.onset&&!u.timingsUnreliable){let e=e=>l?e.rps:e.vus,t=[...y].sort((t,r)=>e(t)-e(r)),r=Math.max(1,Math.floor(t.length/4)),n=t.slice(0,r),s=t.slice(-r),a=(e,t)=>e.reduce((e,r)=>e+t(r),0)/e.length,u=a(n,e=>e.p95Ms),c=a(s,e=>e.p95Ms);if(e(s[0])>e(n[n.length-1])&&u>0){let t=c/u;t>2?(i.push(`<b>Capacity.</b> Under the heaviest load, 95% of requests took ${p7(he(c))}, against ${p7(he(u))} at light load (\xd7${t.toFixed(1)}). The API is near its comfortable limit at about ${p7(l?`${ht(a(s,e))} requests per second`:`${Math.round(a(s,e))} simultaneous users`)}.`),o.push("Use the Load vs response time chart to find where the dots start climbing — that is the most this API can take comfortably.")):(i.push(`<b>Capacity.</b> Response time barely changed between light and full load (${p7(he(u))} → ${p7(he(c))}), so this load is comfortably within what the API can handle.`),o.push("Raise the load (more users, or the Stress preset) to find where it starts to slow down."))}}if((r.droppedIterations??0)>0&&(i.push(`<b>Requests not sent.</b> ${p7(hn(r.droppedIterations))} requests could not start on time because every simulated user was busy — the API, or this computer, could not keep up with the requested rate.`),o.push("Increase “Max simulated users” in the Load tab, or lower the request rate, then compare.")),t.baseline){let e=pj({p95:c,rps:r.http.rps.avg,errorRate:r.http.failed.rate},t.baseline),n=(e,t)=>null==e?"":.05>Math.abs(e)?"about the same":`${(t?e>0:e<0)?"worse":"better"} by ${Math.abs(100*e).toFixed(0)}%`;i.push(`<b>Against your reference run.</b> Response time ${p7(n(e.p95,!0))}; requests per second ${p7(n(e.rps,!1))}; failed requests ${p7(n(e.errorRate,!0)||"unchanged")}.`)}else o.push("Mark a good run as the reference run, so later runs show whether they got faster or slower.");return s||o.splice(u.blocked||u.dominant?.code==="503"?1:0,0,"Set pass/fail goals (Goals tab) so the result reflects what “fast enough” means for this API."),{findings:i,next:o.slice(0,5)}}(e,t),i=s.overall,o=r=>{let n=x[r.metric],s=E(r),a=j(r);hu=Math.max(320,Math.round(r.w/12*1080));let i=function(e,t,r){let n=t.buckets,s=n.map(e=>e.elapsedS),a=e.options??{},i=r.slo??null,o=pS(t,{slo:i});switch(e.metric){case"kpis":case"number":{let n=a.kpis?.length?a.kpis:["throughput","p95","errors","vus","requests"],s=r.baseline?pj({p95:t.summary.latencyMs.p95,rps:t.summary.http.rps.avg,errorRate:t.summary.http.failed.rate},r.baseline):null;return`<div class="kpis ${"number"===e.metric?"one":""}">${n.map(r=>{let n=hl(t,r,i),a=s&&("p95"===r?s.p95:"throughput"===r?s.rps:"errors"===r?s.errorRate:null),o=null!=a&&Number.isFinite(a)?`<div class="chg" style="color:${("throughput"===r?a<0:a>0)?p2:p0}">${a>0?"▲":"▼"} ${Math.abs(100*a).toFixed(0)}% vs reference run</div>`:"";return`<div class="kpi">${"number"===e.metric?"":`<div class="kl">${p7(v[r])}</div><div class="kt">${p7(w[r])}</div>`}<div class="kv" style="color:${ho(n.tone)}">${p7(n.text)}</div>${n.hint?`<div class="kh">${p7(n.hint)}</div>`:""}${o}</div>`}).join("")}</div>`}case"verdict":{let e=o.overall;return`<div class="verdict ${e}"><b>${"pass"===e?"✓ PASS":"warn"===e?"! WARNING":"✕ FAIL"}</b> ${p7(o.headline)}</div><ul class="aspects">${o.aspects.map(e=>`<li><b class="${e.level}">${"pass"===e.level?"✓":"warn"===e.level?"!":"✕"}</b> <strong>${p7(e.title)}</strong> — ${p7(e.summary)}</li>`).join("")}</ul><p class="note">${p7(o.disclaimer)}</p>`}case"heading":return a.note?`<p class="note">${p7(a.note)}</p>`:"";case"latency":{let e=a.percentiles?.length?a.percentiles:["p50","p95","p99"],t={p50:e=>e.p50Ms,p90:e=>e.p90Ms,p95:e=>e.p95Ms,p99:e=>e.p99Ms,p999:e=>e.p999Ms,max:e=>e.maxMs};return hd(s,e.map(e=>({label:g[e],color:p5[e],values:n.map(r=>t[e](r)??null)})),he,{ref:!1!==a.showTarget&&i?.p95Ms?{value:i.p95Ms,label:`goal ${he(i.p95Ms)}`}:void 0})}case"throughput":return hd(s,[{label:"Requests per second",color:"#2a78d6",values:n.map(e=>e.rps)}],ht,{area:"area"===e.kind});case"vus":return hd(s,[{label:"Simulated users",color:"#6250d6",values:n.map(e=>e.vus)}],e=>String(Math.round(e)),{area:!0});case"errors":return hd(s,[{label:"Failed requests",color:p2,values:n.map(e=>e.failedRate)}],hr,{ref:!1!==a.showTarget&&i?{value:i.errorRate,label:`goal ${hr(i.errorRate)}`}:void 0});case"status":return hd(s,[{label:"2xx success",color:p9,values:n.map(e=>e.http2xx)},{label:"4xx client error",color:p4,values:n.map(e=>e.http4xx)},{label:"5xx server error",color:p6,values:n.map(e=>e.http5xx)},{label:"No answer",color:p3,values:n.map(e=>e.http0)}],e=>String(Math.round(e)),{stacked:!0});case"data":return hd(s,[{label:"Received",color:"#2a78d6",values:n.map(e=>e.bytesIn)},{label:"Sent",color:"#eb6834",values:n.map(e=>e.bytesOut)}],e=>`${hs(Math.round(e))}/s`);case"serverTime":return hd(s,[{label:"Server time (TTFB)",color:"#2a78d6",values:n.map(e=>e.ttfbMs??null)},{label:"TCP connect",color:"#eb6834",values:n.map(e=>e.connectMs??null)},{label:"TLS handshake",color:"#1baf7a",values:n.map(e=>e.tlsMs??null)}],he);case"checksRate":return hd(s,[{label:"Checks passing",color:p0,values:n.map(e=>null!=e.checksPassed&&e.checksPassed+(e.checksFailed??0)>0?e.checksPassed/(e.checksPassed+(e.checksFailed??0)):null)}],hr);case"dropped":return hd(s,[{label:"Requests not sent",color:p1,values:n.map(e=>e.dropped??null)}],e=>String(Math.round(e)));case"histogram":return function(e){let t=pm(e.buckets.map(e=>e.hist));if(!t)return'<p class="empty">Not recorded for this run.</p>';let r=t.map((e,t)=>[e,t]).filter(([e])=>e>0),n=r[0]?.[1]??0,s=r[r.length-1]?.[1]??0,a=t.slice(n,s+1),i=Math.max(...a,1),o=(hu-52-12)/a.length,l=a.map((e,t)=>{let r=e/i*156;return`<rect x="${(52+t*o+1).toFixed(1)}" y="${(166-r).toFixed(1)}" width="${Math.max(1,o-2).toFixed(1)}" height="${r.toFixed(1)}" rx="2" fill="#2a78d6"><title>${p7(pf(n+t))}: ${p7(hn(e))} requests</title></rect>`}).join(""),u=a.map((e,t)=>t%Math.ceil(a.length/6)?"":`<text x="${(52+t*o+o/2).toFixed(1)}" y="184" class="t" text-anchor="middle">${p7(pf(n+t))}</text>`).join("");return`<svg viewBox="0 0 ${hu} 190" role="img" aria-label="How many requests took each amount of time"><line x1="52" x2="${hu-12}" y1="${166}" y2="${166}" class="g"/>${l}${u}</svg>`}(t);case"heatmap":return function(e){let t=e.buckets.filter(e=>e.hist);if(!t.length)return'<p class="empty">Not recorded for this run.</p>';let r=ph.map((e,t)=>t).filter(e=>t.some(t=>(t.hist[e]??0)>0)),n=Math.max(1,Math.ceil(t.length/120)),s=[];for(let e=0;e<t.length;e+=n)s.push(t.slice(e,e+n));let a=Math.min(260,24+14*r.length),i=(hu-52-12)/s.length,o=(a-10-24)/r.length,l=1,u=s.map(e=>r.map(t=>e.reduce((e,r)=>e+(r.hist[t]??0),0)));for(let e of u)for(let t of e)l=Math.max(l,t);let c=u.map((e,t)=>e.map((e,n)=>{if(!e)return"";let u=Math.min(p8.length-1,Math.floor(e/l*p8.length));return`<rect x="${(52+t*i).toFixed(1)}" y="${(a-24-(n+1)*o).toFixed(1)}" width="${(i+.3).toFixed(1)}" height="${(o+.3).toFixed(1)}" fill="${p8[u]}"><title>${p7(ha(s[t][0].elapsedS))} \xb7 ${p7(pf(r[n]))}: ${p7(hn(e))}</title></rect>`}).join("")).join(""),d=r.map((e,t)=>t%Math.ceil(r.length/6)?"":`<text x="${46}" y="${(a-24-t*o-o/2+3).toFixed(1)}" class="t" text-anchor="end">${p7(pf(e))}</text>`).join("");return`<svg viewBox="0 0 ${hu} ${a}" role="img" aria-label="Response times each second; darker means more requests">${c}${d}</svg><p class="note">Each column is a moment in the run; darker squares mean more requests took that long.</p>`}(t);case"percentiles":{let e=t.summary.latencyMs;return hp([{label:"Fastest",value:e.min,color:pX,text:he(e.min)},{label:g.p50,value:e.median,color:p5.p50,text:he(e.median)},{label:g.p90,value:e.p90,color:p5.p90,text:he(e.p90)},{label:g.p95,value:e.p95,color:p5.p95,text:he(e.p95)},{label:g.p99,value:e.p99,color:p5.p99,text:he(e.p99)},{label:g.max,value:e.max,color:pG,text:he(e.max)}])}case"phases":{let e=t.summary.phasesMs,r=[{label:"Waiting for a connection",value:e.blocked.avg,color:"#2a78d6"},{label:"DNS lookup",value:e.dns.avg,color:"#eb6834"},{label:"TCP connect",value:e.tcp.avg,color:"#1baf7a"},{label:"TLS handshake",value:e.tls.avg,color:"#eda100"},{label:"Sending",value:e.send.avg,color:"#008300"},{label:"Server time (TTFB)",value:e.ttfb.avg,color:"#e87ba4"},{label:"Download",value:e.download.avg,color:"#6250d6"}],n=r.reduce((e,t)=>e+t.value,0)||1;return`<div class="stack">${r.filter(e=>e.value>0).map(e=>`<span style="width:${(e.value/n*100).toFixed(2)}%;background:${e.color}" title="${p7(e.label)} ${p7(he(e.value))}"></span>`).join("")}</div>${hp(r.map(e=>({...e,text:`${he(e.value)} \xb7 ${Math.round(e.value/n*100)}%`})))}<p class="note">“Server time” is your API working on the answer; high connection times point to the network or the testing computer.</p>`}case"concurrency":return function(e){let t=e.definition.load.executor.endsWith("arrival-rate"),r=e.buckets.filter(e=>e.rps>0).map(e=>({x:t?e.rps:e.vus,y:e.p95Ms,t:e.elapsedS}));if(r.length<3)return'<p class="empty">Not enough data points.</p>';let n=hc(Math.max(...r.map(e=>e.x))),s=hc(Math.max(...r.map(e=>e.y))),a=e=>52+e/n*(hu-52-12),i=e=>186-e/s*176,o=r.map(e=>`<circle cx="${a(e.x).toFixed(1)}" cy="${i(e.y).toFixed(1)}" r="4" fill="#2a78d6" fill-opacity=".75" stroke="#fff" stroke-width="1.5"><title>${p7(ha(e.t))}: ${t?`${ht(e.x)} rps`:`${e.x} users`} → ${p7(he(e.y))}</title></circle>`).join(""),l=[0,.5,1].map(e=>`<line x1="52" x2="${hu-12}" y1="${i(s*e)}" y2="${i(s*e)}" class="g"/><text x="${46}" y="${i(s*e)+3.5}" class="t" text-anchor="end">${p7(he(s*e))}</text><text x="${a(n*e)}" y="204" class="t" text-anchor="middle">${p7(t?ht(n*e):String(Math.round(n*e)))}</text>`).join("");return`<svg viewBox="0 0 ${hu} 210" role="img" aria-label="Load against response time">${l}${o}</svg><p class="note">Each dot is one second: ${t?"requests per second":"simulated users"} across, response time (95% of requests) up. Where the dots climb is where the API starts to struggle.</p>`}(t);case"apdex":{let e=hl(t,"apdex",i);return`<div class="kpis one"><div class="kpi"><div class="kv" style="color:${ho(e.tone)}">${p7(e.text)}</div><div class="kh">${p7(e.hint??"")} \xb7 1.00 means every answer was fast enough</div></div></div>`}case"targets":{let e=t.summary.thresholds,r=e.length?`<ul class="list">${e.map(e=>`<li><b class="${e.ok?"pass":"fail"}">${e.ok?"✓":"✕"}</b> ${p7(e.name)}${e.actual?` <span class="note">measured ${p7(e.actual)}</span>`:""}</li>`).join("")}</ul>`:'<p class="note">No goals were set for this run.</p>',n=t.summary.checks.length?`<h4>Checks on every response</h4><ul class="list">${t.summary.checks.map(e=>`<li><b class="${e.fails?"fail":"pass"}">${e.fails?"✕":"✓"}</b> <code>${p7(e.name)}</code> <span class="note">${p7(hr(e.passes/Math.max(1,e.passes+e.fails)))} \xb7 ${p7(hn(e.fails))} failed of ${p7(hn(e.passes+e.fails))}</span></li>`).join("")}</ul>`:"";return`<h4>Goals</h4>${r}${n}`}case"statusTable":{let e=Object.entries(t.summary.http.status).sort((e,t)=>t[1]-e[1]),r=e.reduce((e,[,t])=>e+t,0)||1;return`<table class="tbl"><thead><tr><th>Code</th><th>Meaning</th><th>Count</th><th>Share</th></tr></thead><tbody>${e.map(([e,t])=>{let n=Number(e);return`<tr><td><code>${p7(e)}</code></td><td>${p7("0"===e?"No answer (timeout or connection error)":n<300?"Success":n<400?"Redirect":n<500?"Client error":"Server error")}</td><td>${p7(hn(t))}</td><td>${p7(hr(t/r))}</td></tr>`}).join("")}</tbody></table>`}case"config":var l;let u,c;return u=(l=t).definition,c=[["Request",`${u.method} ${u.url}`],["Sign-in type","none"===u.auth.mode?"none":u.auth.mode],["Load style",`${hh[u.load.executor]??u.load.executor}`],["Load over time",hf(l)],["Started",new Date(l.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"medium"})],["Length",ha(hi(l))],["Data received / sent",`${hs(l.summary.data.bytesIn)} / ${hs(l.summary.data.bytesOut)}`]],u.data?.before&&c.push(["Runs first",`${u.data.before.label} → ${u.data.before.values.map(e=>`{{${e}}}`).join(", ")}`]),u.data?.testData&&c.push(["Test data",`${u.data.testData.fileName} \xb7 ${hn(u.data.testData.rows)} rows`]),`<table class="kv-tbl">${c.map(([e,t])=>`<tr><th>${p7(e)}</th><td>${p7(t)}</td></tr>`).join("")}</table>`}}(r,e,t),o=n.bare?"w head":"w";return`<section class="${o}">${n.bare?`<h2>${p7(s)}</h2>`:`<h3>${p7(s)}${a?` <small>${p7(a)}</small>`:""}</h3>`}${i}</section>`},l=(function(e){let t=[],r=-1;for(let n of M(e))(!t.length||n.y>=r)&&t.push([]),t[t.length-1].push(n),r=Math.max(r,n.y+n.h);return t.map(e=>{let t=[];for(let r of[...e].sort((e,t)=>e.x-t.x||e.y-t.y)){let e=t.find(e=>r.x<e.end&&r.x+r.w>e.x);e?(e.widgets.push(r),e.x=Math.min(e.x,r.x),e.end=Math.max(e.end,r.x+r.w)):t.push({x:r.x,end:r.x+r.w,widgets:[r]})}for(let e=!0;e;){e=!1,t.sort((e,t)=>e.x-t.x);for(let r=1;r<t.length;r++)if(t[r].x<t[r-1].end){t[r-1].end=Math.max(t[r-1].end,t[r].end),t[r-1].widgets.push(...t[r].widgets),t.splice(r,1),e=!0;break}}return t.map(e=>({x:e.x,w:e.end-e.x,widgets:e.widgets.sort((e,t)=>e.y-t.y||e.x-t.x)}))})})(n.widgets).map(e=>`<div class="band">${e.map(e=>`<div class="lane" style="--x:${e.x+1};--w:${e.w}">${e.widgets.map(o).join("")}</div>`).join("")}</div>`).join("\n");hu=640;let u=e.buckets.map(e=>`<tr><td>${p7(ha(e.elapsedS))}</td><td>${e.vus}</td><td>${p7(ht(e.rps))}</td><td>${p7(he(e.p50Ms))}</td><td>${p7(he(e.p95Ms))}</td><td>${p7(he(e.p99Ms))}</td><td>${p7(hr(e.failedRate))}</td><td>${e.http2xx}</td><td>${e.http4xx}</td><td>${e.http5xx}</td><td>${e.http0}</td></tr>`).join("");return`<!DOCTYPE html>
934
+ <html lang="en">
935
+ <head>
936
+ <meta charset="utf-8">
937
+ <meta name="viewport" content="width=device-width, initial-scale=1">
938
+ <title>${p7(e.testName)} — APITestCenter</title>
939
+ <style>
940
+ :root { color-scheme: light; }
941
+ * { box-sizing: border-box; }
942
+ body { margin: 0; background: #f4f6f9; color: ${pG}; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
943
+ code, .kv, .tbl td, .series td { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
944
+ header.top { background: ${pQ}; border-bottom: 1px solid ${pY}; padding: 20px 28px; }
945
+ header.top .brand { font-size: 12px; color: ${pX}; }
946
+ header.top h1 { margin: 2px 0 4px; font-size: 22px; letter-spacing: -.01em; }
947
+ header.top .meta { color: ${pX}; font-size: 13px; word-break: break-all; }
948
+ main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 56px; }
949
+ .verdict { border-radius: 10px; padding: 12px 14px; font-size: 15px; }
950
+ .verdict.pass { background: #e6f4ea; border: 1px solid #a8dab5; } .verdict.pass b { color: ${p0}; }
951
+ .verdict.warn { background: #fef3e0; border: 1px solid #f5cf8b; } .verdict.warn b { color: ${p1}; }
952
+ .verdict.fail { background: #fdecea; border: 1px solid #f3b0aa; } .verdict.fail b { color: ${p2}; }
953
+ .debrief { background: ${pQ}; border: 1px solid ${pY}; border-radius: 12px; padding: 16px 20px; margin: 16px 0; }
954
+ .debrief h2 { margin: 0 0 8px; font-size: 17px; }
955
+ .debrief p { margin: 6px 0; } .debrief ol { margin: 6px 0 0; padding-left: 20px; } .debrief li { margin: 3px 0; }
956
+ .grid { display: flex; flex-direction: column; gap: 12px; }
957
+ .band { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
958
+ .lane { grid-column: var(--x) / span var(--w); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
959
+ .w { background: ${pQ}; border: 1px solid ${pY}; border-radius: 12px; padding: 12px 14px; min-width: 0; break-inside: avoid; }
960
+ .w.head { background: none; border: 0; padding: 14px 2px 0; }
961
+ .w.head h2 { margin: 0; padding-bottom: 4px; border-bottom: 1px solid ${pY}; font-size: 18px; }
962
+ .w h3 { margin: 0 0 8px; font-size: 14px; } .w h3 small { color: ${pX}; font-weight: 400; font-size: 12px; margin-left: 4px; }
963
+ .w h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: ${pX}; }
964
+ svg { width: 100%; height: auto; display: block; }
965
+ svg .g { stroke: ${pY}; stroke-width: 1; } svg .t { fill: ${pX}; font: 11px ui-monospace, Consolas, monospace; }
966
+ .legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: ${pX}; margin-top: 4px; }
967
+ .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
968
+ .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
969
+ .kpis.one { grid-template-columns: 1fr; }
970
+ .kpi { background: #eef1f6; border-radius: 10px; padding: 10px 12px; }
971
+ .kl { font-size: 12px; color: ${pX}; font-weight: 600; } .kt { font-size: 11px; color: #7a8596; }
972
+ .kv { font-size: 24px; font-weight: 600; margin-top: 2px; } .kpis.one .kv { font-size: 34px; }
973
+ .kh, .chg, .note { font-size: 12px; color: ${pX}; } .chg { margin-top: 2px; }
974
+ .aspects, .list { list-style: none; padding: 0; margin: 10px 0 0; } .aspects li, .list li { margin: 5px 0; font-size: 13px; }
975
+ b.pass { color: ${p0}; } b.warn { color: ${p1}; } b.fail { color: ${p2}; }
976
+ table { border-collapse: collapse; width: 100%; }
977
+ .bars th { text-align: left; font-weight: 400; color: ${pX}; font-size: 12px; padding: 3px 10px 3px 0; white-space: nowrap; width: 1%; }
978
+ .bars td { padding: 3px 0; } .bars td.v { text-align: right; font: 12px ui-monospace, Consolas, monospace; padding-left: 10px; white-space: nowrap; width: 1%; }
979
+ .bar { display: block; height: 10px; border-radius: 3px; }
980
+ .stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 2px 0 10px; gap: 2px; } .stack span { display: block; height: 100%; }
981
+ .tbl th, .tbl td, .series th, .series td, .kv-tbl th, .kv-tbl td { text-align: left; padding: 6px 8px; border-top: 1px solid ${pY}; font-size: 12px; }
982
+ .tbl th, .series th { color: ${pX}; font-weight: 600; border-top: 0; }
983
+ .kv-tbl th { color: ${pX}; font-weight: 400; width: 30%; white-space: nowrap; vertical-align: top; } .kv-tbl td { word-break: break-all; }
984
+ .empty { color: ${pX}; font-size: 13px; }
985
+ details.appendix { margin-top: 20px; background: ${pQ}; border: 1px solid ${pY}; border-radius: 12px; padding: 12px 16px; }
986
+ details.appendix summary { cursor: pointer; font-weight: 600; }
987
+ .series-wrap { max-height: 420px; overflow: auto; margin-top: 10px; }
988
+ footer { color: ${pX}; font-size: 12px; margin-top: 24px; }
989
+ @media (max-width: 900px) { .lane { grid-column: 1 / -1; } }
990
+ @media print { body { background: #fff; } .series-wrap { max-height: none; } details.appendix { display: none; } .w, .debrief { box-shadow: none; } }
991
+ </style>
992
+ </head>
993
+ <body>
994
+ <header class="top">
995
+ <div class="brand">APITestCenter \xb7 Load test report</div>
996
+ <h1>${p7(e.testName)}</h1>
997
+ <div class="meta">${p7(e.definition.method)} ${p7(e.definition.url)} \xb7 ${p7(new Date(e.startedAt).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"}))} \xb7 ${p7(ha(hi(e)))} \xb7 ${p7(e.status)} \xb7 sign-in ${p7(e.definition.auth.mode)}</div>
998
+ </header>
999
+ <main>
1000
+ <div class="verdict ${i}"><b>${"pass"===i?"✓ PASS":"warn"===i?"! WARNING":"✕ FAIL"}</b> ${p7(s.headline)}</div>
1001
+ <section class="debrief">
1002
+ <h2>What happened in this run</h2>
1003
+ ${a.findings.map(e=>`<p>${e}</p>`).join("\n ")}
1004
+ ${a.next.length?`<h2 style="margin-top:14px">Suggested next steps</h2><ol>${a.next.map(e=>`<li>${p7(e)}</li>`).join("")}</ol>`:""}
1005
+ <p class="note">Written from the measured numbers by fixed rules. ${p7(s.disclaimer)}</p>
1006
+ </section>
1007
+ ${function(e,t){if(!t||t.id===e.id)return"";let r=pZ(t,e),n="worse"===r.level?"fail":"better"===r.level?"pass":"same"===r.level?"same":"warn",s=(e,t)=>null==t?"—":"rps"===e?`${ht(t)}/s`:"errorRate"===e||"checksRate"===e?hr(t):he(t),a=r.metrics.map(e=>`<tr><th>${p7(e.label)} <span class="sub">${p7(e.tech)}</span></th><td>${p7(s(e.key,e.before))}</td><td>${p7(s(e.key,e.after))}</td><td>${(e=>{if("n/a"===e.direction)return`<span class="sub">${p7(e.note??"—")}</span>`;if("same"===e.direction)return'<span class="sub">= about the same</span>';let t=(e.absolute??0)>0,r="errorRate"===e.key||"checksRate"===e.key?`${t?"+":"−"}${(100*Math.abs(e.absolute??0)).toFixed(1)} points`:null!=e.relative?`${t?"+":"−"}${Math.round(100*Math.abs(e.relative))}%`:"";return`<span style="color:${"better"===e.direction?p0:p2};font-weight:600">${t?"↑":"↓"} ${p7(r)} \xb7 ${e.direction}</span>`})(e)}</td></tr>`).join("");return` <section class="debrief">
1008
+ <h2>Before / after</h2>
1009
+ <p class="sub">This run compared with “${p7(t.testName)}” (${p7(new Date(t.startedAt).toLocaleString("en-GB"))}).</p>
1010
+ <div class="verdict ${n}" style="margin:10px 0">${p7(r.headline)}</div>
1011
+ <table class="kv-tbl"><tr><th>Measure</th><th>Before</th><th>After</th><th>Change</th></tr>${a}</table>
1012
+ <p class="note">Changes under 5% (or under 10 ms) count as about the same — two runs of an unchanged API never match exactly.</p>
1013
+ </section>`}(e,t.before??null)}
1014
+ <div class="grid">
1015
+ ${l}
1016
+ </div>
1017
+ <details class="appendix">
1018
+ <summary>Every second of the run (${e.buckets.length} rows)</summary>
1019
+ <div class="series-wrap"><table class="series"><thead><tr><th>Time</th><th>Users</th><th>Req/s</th><th>Typical</th><th>95%</th><th>Slowest 1%</th><th>Failed</th><th>2xx</th><th>4xx</th><th>5xx</th><th>No answer</th></tr></thead><tbody>${u}</tbody></table></div>
1020
+ </details>
1021
+ <footer>Report view: ${p7(n.name)} \xb7 made ${p7(r)} with APITestCenter (apitestcenter.com). Secrets are never included; sign-in is shown as a type only.</footer>
1022
+ </main>
1023
+ </body>
1024
+ </html>
1025
+ `}],94713);let hm={proxy:{mode:"environment",url:"",username:"",bypass:""},requests:{timeout:"5m",maxRedirects:5,useCookies:!0,tlsSkip:!0},load:{preset:"smoke"}};e.s(["g",0,hm,"b",0,function(e){let t=e??{},r=t.proxy??{},n=t.requests??{},s=["off","environment","manual"].find(e=>e===r.mode)??hm.proxy.mode,a="string"==typeof r.url?function(e){let t=e.trim();if(!t)return{url:""};try{let e=new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`http://${t}`);if("http:"!==e.protocol&&"https:"!==e.protocol)return null;let r=decodeURIComponent(e.username),n=decodeURIComponent(e.password);return e.username="",e.password="",{url:`${e.protocol}//${e.host}`,...r?{username:r}:{},...n?{password:n}:{}}}catch{return null}}(r.url):null,i=Number(n.maxRedirects);return{proxy:{mode:s,url:a?.url??"",username:"string"==typeof r.username?r.username.trim():a?.username??"",bypass:"string"==typeof r.bypass?r.bypass.trim():""},requests:{timeout:"string"==typeof n.timeout&&/^\d+(ms|s|m)$/.test(n.timeout.trim())?n.timeout.trim():hm.requests.timeout,maxRedirects:Number.isInteger(i)&&i>=0&&i<=20?i:hm.requests.maxRedirects,useCookies:"boolean"==typeof n.useCookies?n.useCookies:hm.requests.useCookies,tlsSkip:"boolean"==typeof n.tlsSkip?n.tlsSkip:hm.requests.tlsSkip},load:{preset:oi.find(e=>e===t.load?.preset)??hm.load.preset}}}],19166);let hy=[{id:"smoke",label:"Smoke",question:"Does it work under a little load?",hint:"2 users for 30 seconds — a quick check before anything bigger."},{id:"average",label:"Load",question:"Does it hold up on a normal day?",hint:"10 users for 5 minutes — your usual traffic."},{id:"stress",label:"Stress",question:"How does it do above normal?",hint:"Ramp to 20 users and hold — more than a normal day. Do the targets still hold at the peak?"},{id:"spike",label:"Spike",question:"Does it survive a sudden burst, and recover?",hint:"5 users, a sudden jump to 50, then back to 5."},{id:"soak",label:"Soak",question:"Does it slow down over time?",hint:"10 users for 30 minutes — finds leaks and slow decline that short tests miss."},{id:"breakpoint",label:"Breakpoint",question:"How much can it take?",hint:"Adds users steadily (up to 200 over 10 minutes) and stops when a target breaks — the report says the most it handled."}],hg=e=>e.length?e.reduce((e,t)=>e+t,0)/e.length:0,hb=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)} s`:`${Math.round(e)} ms`,hv=e=>`${(100*e).toFixed(e>0&&e<.01?2:1)}%`,hw=e=>hg(e.map(e=>e.p95Ms).filter(e=>e>0)),hk=e=>hg(e.map(e=>e.failedRate));e.s(["R",0,hy,"w",0,e=>hy.find(t=>t.id===e)?.label??("custom"===e?"Custom":void 0),"a",0,function(e,t){let r,n=e.definition.load.testType,s=e.buckets.filter(e=>e.rps>0);if(s.length<3)return null;let a=pk(t),i={rate:r=e.definition.load.executor.includes("arrival-rate"),at:e=>r?Math.round(e.rps):e.vus,unit:e=>r?`${e} req/s`:`${e} ${1===e?"user":"users"}`},o=Math.max(...s.map(i.at));if("stress"===n){let e=s.filter(e=>i.at(e)>=.9*o),t=hw(e),r=hk(e),n=r>=a.errorFail||t>=a.p95FailMs?"fail":r>=a.errorWarn||t>=a.p95WarnMs?"warn":"pass";return{title:"At the peak",level:n,summary:`With ${i.unit(o)}, p95 was ${hb(t)} and ${hv(r)} of requests failed.${"pass"===n?" It held up above a normal day.":""}`}}if("spike"===n){let e=s.map((e,t)=>i.at(e)>=.8*o?t:-1).filter(e=>e>=0);if(!e.length)return null;let t=e=>i.at(e)>0&&i.at(e)<=.3*o,r=s.slice(0,e[0]).filter(t),n=e.map(e=>s[e]),l=s.slice(e.at(-1)+1).filter(t);if(r.length<2||l.length<2)return null;let[u,c,d]=[hw(r),hw(n),hw(l)],[p,h,f]=[hk(r),hk(n),hk(l)],m=d<=Math.max(1.5*u,u+50)&&f<=p+.01;return{title:"Recovery after the spike",level:m?h>=a.errorFail?"warn":"pass":"fail",summary:`p95 ${hb(u)} before the spike, ${hb(c)} during it (${hv(h)} errors), ${hb(d)} after.${m?" It recovered.":" It didn't recover: still slower or failing more after the burst."}`}}if("soak"===n){let e=s.filter(e=>i.at(e)>=.9*o);if(e.length<10)return null;let t=Math.max(2,Math.floor(e.length/5)),[r,n]=[hw(e.slice(0,t)),hw(e.slice(-t))],[l,u]=[hk(e.slice(0,t)),hk(e.slice(-t))],c=r>0?n/r:1,d=c>=2||u>=l+a.errorFail?"fail":c>=1.3||u>=l+a.errorWarn?"warn":"pass",p=c>=1?`+${Math.round((c-1)*100)}%`:`−${Math.round((1-c)*100)}%`;return{title:"Over time",level:d,summary:`p95 went from ${hb(r)} at the start to ${hb(n)} at the end (${p}); errors ${hv(l)} → ${hv(u)}.${"pass"===d?" No slowdown over the run.":" It got slower as it ran — look for leaks, growing queues or caches."}`}}if("breakpoint"===n){let e=e=>e.p95Ms>=a.p95FailMs||e.failedRate>=a.errorFail,t=-1;for(let r=0;r+2<s.length;r++)if(e(s[r])&&e(s[r+1])&&e(s[r+2])){t=r;break}let r=`p95 under ${hb(a.p95FailMs)} and errors under ${hv(a.errorFail)}${a.owned?" (your targets)":" (defaults — set your own in Goals)"}`;if(t<0)return{title:"Breaking point",level:"pass",summary:`It didn't break: still within ${r} at ${i.unit(o)}, the most this test reached. Raise the top to find the limit.`};let n=s.slice(0,t).filter(t=>!e(t)),l=n.length?Math.max(...n.map(i.at)):0,u=s[t],c=u.failedRate>=a.errorFail?`${hv(u.failedRate)} errors`:`p95 ${hb(u.p95Ms)}`;return{title:"Breaking point",level:"warn",summary:l?`It handled up to ${i.unit(l)} within ${r}. It broke at ${i.unit(i.at(u))} — ${c}.`:`It broke straight away, at ${i.unit(i.at(u))} — ${c}. Start lower, or check the API with a Smoke test first.`}}return null}],30340);let hx=e=>!!e&&"object"==typeof e&&!Array.isArray(e),h$=`openapi: 3.0.3
1026
+ info:
1027
+ title: Orders API
1028
+ version: "1.0"
1029
+ servers:
1030
+ - url: https://api.example.com/v1
1031
+ paths:
1032
+ /orders/{orderId}:
1033
+ get:
1034
+ summary: One order
1035
+ parameters:
1036
+ - name: orderId
1037
+ in: path
1038
+ required: true
1039
+ schema: { type: string }
1040
+ responses:
1041
+ "200":
1042
+ description: The order
1043
+ content:
1044
+ application/json:
1045
+ schema:
1046
+ type: object
1047
+ required: [id, status]
1048
+ properties:
1049
+ id: { type: string }
1050
+ status: { type: string, enum: [open, paid, shipped] }
1051
+ total: { type: number }
1052
+ "404":
1053
+ description: No order with that id
1054
+ `;e.s(["_",0,h$,"J",0,function(e){let t;e=e.replace(/^\uFEFF/,"");try{t=JSON.parse(e)}catch{try{t=dO(e,{maxAliasCount:1e3})}catch{throw Error("That file is neither JSON nor YAML")}}if(!hx(t))throw Error(Array.isArray(t)?"It's a list, not an OpenAPI description — those start with openapi: 3… (or swagger: 2.0), then info and paths":"That file is not an OpenAPI description");let r="string"==typeof t.openapi&&t.openapi.startsWith("3")?"openapi":"2.0"===t.swagger?"swagger":null;if(!r)throw Error("string"==typeof t.openapi?`OpenAPI ${t.openapi} is not supported — use 3.x or Swagger 2.0`:function(e,t){let r=hx(e.info)?e.info:null,n="Import it (Import in the sidebar) to get its requests; contract tests need the API's own OpenAPI file";if(r&&("string"==typeof r._postman_id||"string"==typeof r.schema&&r.schema.includes("getpostman"))||Array.isArray(e.item)&&r)return`It's a Postman collection, not an API description. ${n}`;if(Array.isArray(e.values)&&"string"==typeof e._postman_variable_scope)return"It's a Postman environment, not an API description. Import it to get its variables";if(hx(e.log)&&Array.isArray(e.log.entries))return`It's a browser recording (HAR), not an API description. ${n}`;if("export"===e._type||"string"==typeof e.type&&e.type.startsWith("collection.insomnia.rest/"))return`It's an Insomnia export, not an API description. ${n}`;if("string"==typeof e.asyncapi)return"It's an AsyncAPI file — that describes event and message APIs. Contract tests need OpenAPI 3 or Swagger 2";if(hx(e.__schema)||hx(e.data)&&hx(e.data.__schema))return"It's a GraphQL schema. Contract tests check REST APIs against OpenAPI; GraphQL requests check their answers with checks instead";if("string"==typeof e.$schema&&!e.paths)return"It's a JSON Schema — one shape of data, not a whole API. An OpenAPI file holds schemas like it under components, with the API's paths";let s=Object.keys(e),a=s.length?` This one starts with ${s.slice(0,3).join(", ")}${s.length>3?` and ${s.length-3} more`:""}.`:"";return`It's ${t}, but not an OpenAPI or Swagger description: those start with openapi: 3… (or swagger: 2.0), then info and paths.${a}`}(t,/^\s*[{[]/.test(e)?"JSON":"YAML"));if(!hx(t.paths))throw Error("The description has no paths: an OpenAPI file lists the API's operations under paths");let n=hx(t.info)?t.info:{};return{kind:r,title:"string"==typeof n.title&&n.title.trim()?n.title.trim():"API",version:"string"==typeof n.version?n.version:"",doc:t}}],54185);let hS={id:"rest-basics",title:"REST basics",summary:"Read a list, read one item and check a missing one — with checks on status, body and speed.",category:"Start here",shows:["GET requests","Checks","Collection run"],realSystem:"Set baseUrl to your API and change the paths and checks to match it.",file:{format:lj,name:"REST basics",description:"Three requests to the practice store, each with checks. Run the collection to see them all pass.",variables:[{key:"baseUrl",value:"{{practiceApi}}",secret:!1,note:"Your API's address, e.g. https://api.example.com"}],requests:[{name:"List products",request:{method:"GET",url:"{{baseUrl}}/products",description:"Every product, with how many there are.",checks:[{type:"status",expect:"200"},{type:"json",path:"items",op:"length",value:">= 1"},{type:"json",path:"total",op:"type",value:"number"},{type:"time",maxMs:2e3}]}},{name:"Get one product",request:{method:"GET",url:"{{baseUrl}}/products/1",description:"One product by its id.",checks:[{type:"status",expect:"200"},{type:"json",path:"id",op:"equals",value:"1"},{type:"json",path:"name",op:"type",value:"string"},{type:"header",name:"content-type",op:"contains",value:"application/json"}]}},{name:"A product that isn't there",request:{method:"GET",url:"{{baseUrl}}/products/999",description:"An id that doesn't exist: the API should say 404 and why.",checks:[{type:"status",expect:"404"},{type:"json",path:"error",op:"exists",value:""}]}}]}},h_={id:"sign-in-and-chain",title:"Sign in, create, read back",summary:"Sign in once, use the token on the next requests, and pass a new order's id along.",category:"Start here",shows:["Bearer token","Run first","Saved values"],realSystem:"Point the sign-in request at your API's login, and change the paths the token and id are read from.",file:{format:lj,name:"Sign in and chain",description:"The sign-in request runs first for the others, and the new order's id is saved for the last request.",variables:[{key:"baseUrl",value:"{{practiceApi}}",secret:!1,note:"Your API's address"},{key:"username",value:"practice-user",secret:!1},{key:"password",value:"demo",secret:!1,note:"The practice store takes any user name with the password demo. A real password: mark it secret"}],requests:[{ref:"sign-in",name:"Sign in",request:{method:"POST",url:"{{baseUrl}}/login",bodyMode:"json",bodyText:JSON.stringify({username:"{{username}}",password:"{{password}}"},null,2),description:"Returns a token for the requests after it.",checks:[{type:"status",expect:"200"},{type:"json",path:"data.token",op:"exists",value:""}]}},{name:"Create an order",request:{method:"POST",url:"{{baseUrl}}/orders",authMode:"bearer",token:"{{token}}",bodyMode:"json",bodyText:JSON.stringify({productId:2,quantity:3},null,2),saveValues:[{name:"orderId",from:"json",path:"id"}],description:"Signs in first, then creates an order and saves its id as {{orderId}}.",checks:[{type:"status",expect:"201"},{type:"json",path:"quantity",op:"equals",value:"3"},{type:"json",path:"status",op:"equals",value:"new"}]},runFirst:{ref:"sign-in",extract:[{name:"token",from:"json",path:"data.token"}]}},{name:"Read the order back",request:{method:"GET",url:"{{baseUrl}}/orders/{{orderId}}",authMode:"bearer",token:"{{token}}",description:"The order created by the request before, by the id it saved.",checks:[{type:"status",expect:"200"},{type:"json",path:"id",op:"matches",value:"^A-[0-9]+$"},{type:"json",path:"quantity",op:"equals",value:"3"}]},runFirst:{ref:"sign-in",extract:[{name:"token",from:"json",path:"data.token"}]}},{name:"Without signing in",request:{method:"GET",url:"{{baseUrl}}/orders",description:"No token: the API should turn the request away.",checks:[{type:"status",expect:"401"}]}}]}},hA=(e,t,r)=>({method:"POST",url:e,bodyMode:"form",formRows:[{key:"grant_type",value:"client_credentials",kind:"text",file:null},{key:"client_id",value:`{{${t}}}`,kind:"text",file:null},{key:"client_secret",value:`{{${r}}}`,kind:"text",file:null}],checks:[{type:"status",expect:"200"},{type:"json",path:"access_token",op:"exists",value:""}]}),hT={id:"salesforce-soql",title:"Salesforce: objects and SOQL",summary:"Sign in with client credentials, list the objects, describe one and run SOQL queries.",category:"Enterprise",shows:["OAuth 2.0","SOQL","Describe"],realSystem:"Set sfUrl to your org's My Domain address (https://your-company.my.salesforce.com) and clientId / clientSecret to a connected app's. Use a sandbox or developer org first.",file:{format:lj,name:"Salesforce",description:"Runs against the app's practice Salesforce org. For a real org, change sfUrl, clientId and clientSecret.",variables:[{key:"sfUrl",value:"{{practiceApi}}/salesforce",secret:!1,note:"Your org: https://your-company.my.salesforce.com"},{key:"apiVersion",value:"62.0",secret:!1},{key:"clientId",value:"practice",secret:!1,note:"The connected app's consumer key"},{key:"clientSecret",value:"demo",secret:!1,note:"The connected app's consumer secret — mark it secret when you put a real one in"}],requests:[{ref:"sign-in",name:"Sign in",request:{...hA("{{sfUrl}}/services/oauth2/token","clientId","clientSecret"),description:"Client credentials flow: the token for the requests after it."}},{name:"List objects",request:{method:"GET",url:"{{sfUrl}}/services/data/v{{apiVersion}}/sobjects",authMode:"bearer",token:"{{sfToken}}",description:"Every object the user can see.",checks:[{type:"status",expect:"200"},{type:"json",path:"sobjects",op:"length",value:">= 1"}]},runFirst:{ref:"sign-in",extract:[{name:"sfToken",from:"json",path:"access_token"}]}},{name:"Describe Account",request:{method:"GET",url:"{{sfUrl}}/services/data/v{{apiVersion}}/sobjects/Account/describe",authMode:"bearer",token:"{{sfToken}}",description:"Account's fields: names, types and lengths — what you can query.",checks:[{type:"status",expect:"200"},{type:"json",path:"name",op:"equals",value:"Account"},{type:"json",path:"fields",op:"length",value:">= 1"}]},runFirst:{ref:"sign-in",extract:[{name:"sfToken",from:"json",path:"access_token"}]}},{name:"Query accounts (SOQL)",request:{method:"GET",url:"{{sfUrl}}/services/data/v{{apiVersion}}/query",params:[{key:"q",value:"SELECT Id, Name, Industry FROM Account ORDER BY Name LIMIT 10"}],authMode:"bearer",token:"{{sfToken}}",description:"A SOQL query. `done: false` means there's a next page at `nextRecordsUrl`.",checks:[{type:"status",expect:"200"},{type:"json",path:"records",op:"length",value:">= 1"},{type:"json",path:"records[0].Name",op:"exists",value:""}]},runFirst:{ref:"sign-in",extract:[{name:"sfToken",from:"json",path:"access_token"}]}},{name:"Count contacts",request:{method:"GET",url:"{{sfUrl}}/services/data/v{{apiVersion}}/query",params:[{key:"q",value:"SELECT COUNT() FROM Contact"}],authMode:"bearer",token:"{{sfToken}}",description:"COUNT() returns only `totalSize`.",checks:[{type:"status",expect:"200"},{type:"json",path:"totalSize",op:"type",value:"number"}]},runFirst:{ref:"sign-in",extract:[{name:"sfToken",from:"json",path:"access_token"}]}}]}},hO={id:"netsuite-suiteql",title:"NetSuite: SuiteQL and records",summary:"Sign in with client credentials, read the record catalog and run SuiteQL queries.",category:"Enterprise",shows:["OAuth 2.0","SuiteQL","Metadata"],realSystem:"Set nsUrl to https://<account-id>.suitetalk.api.netsuite.com. A real account usually signs in with OAuth 2.0 using a certificate or a browser sign-in, as its integration record allows: choose it on the Auth tab, or let Connections set it up.",file:{format:lj,name:"NetSuite",description:"Runs against the app's practice NetSuite account. For a real account, change nsUrl and the sign-in.",variables:[{key:"nsUrl",value:"{{practiceApi}}/netsuite",secret:!1,note:"Your account: https://<account-id>.suitetalk.api.netsuite.com"},{key:"clientId",value:"practice",secret:!1},{key:"clientSecret",value:"demo",secret:!1,note:"A real one: mark it secret"}],requests:[{ref:"sign-in",name:"Sign in",request:{...hA("{{nsUrl}}/services/rest/auth/oauth2/v1/token","clientId","clientSecret"),description:"The token for the requests after it."}},{name:"Record types",request:{method:"GET",url:"{{nsUrl}}/services/rest/record/v1/metadata-catalog",authMode:"bearer",token:"{{nsToken}}",description:"The record types you can read.",checks:[{type:"status",expect:"200"},{type:"json",path:"items",op:"length",value:">= 1"}]},runFirst:{ref:"sign-in",extract:[{name:"nsToken",from:"json",path:"access_token"}]}},{name:"Customer fields",request:{method:"GET",url:"{{nsUrl}}/services/rest/record/v1/metadata-catalog/customer",authMode:"bearer",token:"{{nsToken}}",description:"The customer record's fields, as a JSON schema.",checks:[{type:"status",expect:"200"},{type:"json",path:"properties",op:"exists",value:""}]},runFirst:{ref:"sign-in",extract:[{name:"nsToken",from:"json",path:"access_token"}]}},{name:"Query customers (SuiteQL)",request:{method:"POST",url:"{{nsUrl}}/services/rest/query/v1/suiteql",params:[{key:"limit",value:"10"}],headers:[{key:"Prefer",value:"transient"}],authMode:"bearer",token:"{{nsToken}}",bodyMode:"json",bodyText:JSON.stringify({q:"SELECT id, email, balance FROM customer ORDER BY id"},null,2),description:"A SuiteQL query. `hasMore: true` means there's a next page (the `next` link).",checks:[{type:"status",expect:"200"},{type:"json",path:"items",op:"length",value:">= 1"},{type:"json",path:"hasMore",op:"type",value:"boolean"}]},runFirst:{ref:"sign-in",extract:[{name:"nsToken",from:"json",path:"access_token"}]}}]}},hE={id:"odata-sap",title:"OData (SAP SuccessFactors style)",summary:"Read the $metadata, then query with $filter, $select, $top and $expand — in OData v2 and v4.",category:"Enterprise",shows:["Basic sign-in","OData v2 / v4","$filter"],realSystem:"Set odataUrl to your service (for SuccessFactors, https://<api-server>/odata/v2) and the user name and password to an API user's. Change the entity names to your service's.",file:{format:lj,name:"OData",description:"Runs against the app's practice OData service. For a real one, change odataUrl and the sign-in.",variables:[{key:"odataUrl",value:"{{practiceApi}}/odata/v2",secret:!1,note:"Your service, e.g. https://<api-server>/odata/v2"},{key:"odataV4Url",value:"{{practiceApi}}/odata/v4",secret:!1},{key:"odataUser",value:"practice-user",secret:!1,note:"SuccessFactors: username@companyId"},{key:"odataPassword",value:"demo",secret:!1,note:"A real one: mark it secret"}],requests:[{name:"Service metadata",request:{method:"GET",url:"{{odataUrl}}/$metadata",authMode:"basic",username:"{{odataUser}}",password:"{{odataPassword}}",description:"Every entity, its fields and its links, in XML.",checks:[{type:"status",expect:"200"},{type:"body",op:"contains",value:"EntityType"}]}},{name:"Employees in a department (v2)",request:{method:"GET",url:"{{odataUrl}}/Employees",params:[{key:"$filter",value:"DepartmentID eq 1"},{key:"$select",value:"EmployeeID,FirstName,LastName"},{key:"$top",value:"5"},{key:"$format",value:"json"}],authMode:"basic",username:"{{odataUser}}",password:"{{odataPassword}}",description:"OData v2 wraps the rows in `d.results`.",checks:[{type:"status",expect:"200"},{type:"json",path:"d.results",op:"length",value:">= 1"}]}},{name:"Departments with their employees (v4)",request:{method:"GET",url:"{{odataV4Url}}/Departments",params:[{key:"$expand",value:"Employees"},{key:"$top",value:"2"}],authMode:"basic",username:"{{odataUser}}",password:"{{odataPassword}}",description:"OData v4 puts the rows in `value`; $expand brings the linked rows along.",checks:[{type:"status",expect:"200"},{type:"json",path:"value",op:"length",value:">= 1"},{type:"json",path:"value[0].Employees",op:"exists",value:""}]}}]}},hj=[hS,h_,{id:"successfactors-to-netsuite",title:"SuccessFactors to NetSuite: did the employee arrive?",summary:"Read an employee in SuccessFactors, find the copy an integration made in NetSuite, and check every field matches.",category:"Enterprise",shows:["Two systems","Field mapping","Saved record"],realSystem:"Set odataUrl, odataUser and odataPassword to your SuccessFactors API user, nsUrl and the client to your NetSuite integration, and employeeId to a person your integration has copied. Change the field rows to the fields your integration maps.",file:{format:lj,name:"SuccessFactors to NetSuite",description:"Run it as a collection: the first request saves the employee from SuccessFactors, the last checks NetSuite has the same values. Set employeeId to E1009 to see a difference: that person's job title changed after the copy.",variables:[{key:"employeeId",value:"E1004",secret:!1,note:"The person to check. E1001 to E1010 are in both practice systems."},{key:"odataUrl",value:"{{practiceApi}}/odata/v2",secret:!1,note:"SuccessFactors: https://<api-server>/odata/v2"},{key:"odataUser",value:"practice-user",secret:!1,note:"SuccessFactors: username@companyId"},{key:"odataPassword",value:"demo",secret:!1,note:"A real one: mark it secret"},{key:"nsUrl",value:"{{practiceApi}}/netsuite",secret:!1,note:"Your account: https://<account-id>.suitetalk.api.netsuite.com"},{key:"clientId",value:"practice",secret:!1},{key:"clientSecret",value:"demo",secret:!1,note:"A real one: mark it secret"}],requests:[{name:"1. The employee in SuccessFactors",request:{method:"GET",url:"{{odataUrl}}/Employees('{{employeeId}}')",params:[{key:"$format",value:"json"}],authMode:"basic",username:"{{odataUser}}",password:"{{odataPassword}}",description:"The source record. Save values keeps the whole of it as {{employee}}, so later requests can use any field: {{employee.FirstName}}.",checks:[{type:"status",expect:"200"},{type:"json",path:"d.EmployeeID",op:"exists",value:""}],saveValues:[{name:"employee",from:"json",path:"d"}]}},{ref:"sign-in",name:"Sign in to NetSuite",request:{...hA("{{nsUrl}}/services/rest/auth/oauth2/v1/token","clientId","clientSecret"),description:"The token for the NetSuite request."}},{name:"2. The same person in NetSuite",request:{method:"POST",url:"{{nsUrl}}/services/rest/query/v1/suiteql",headers:[{key:"Prefer",value:"transient"}],authMode:"bearer",token:"{{nsToken}}",bodyMode:"json",bodyText:JSON.stringify({q:"SELECT id, externalid, firstname, lastname, email, title, hiredate, isinactive FROM employee WHERE externalid = '{{employeeId}}'"},null,2),description:"Finds the copy by its external ID (the SuccessFactors EmployeeID) and checks each field against the saved record, each the way the two systems write it: dates as the same day, the email ignoring case, Active true as isinactive F.",checks:[{type:"status",expect:"200"},{type:"json",path:"items",op:"length",value:"1"},{type:"fields",rows:[{path:"items[0].externalid",value:"{{employee.EmployeeID}}",as:"text",map:""},{path:"items[0].firstname",value:"{{employee.FirstName}}",as:"text",map:""},{path:"items[0].lastname",value:"{{employee.LastName}}",as:"text",map:""},{path:"items[0].email",value:"{{employee.Email}}",as:"loose",map:""},{path:"items[0].title",value:"{{employee.JobTitle}}",as:"text",map:""},{path:"items[0].hiredate",value:"{{employee.HireDate}}",as:"date",map:""},{path:"items[0].isinactive",value:"{{employee.Active}}",as:"text",map:"true=F, false=T"}]}]},runFirst:{ref:"sign-in",extract:[{name:"nsToken",from:"json",path:"access_token"}]}}]}},hT,hO,hE,{id:"reliability-checks",title:"Speed and reliability checks",summary:"Requests that are slow or fail now and then — a starting point for time limits and load tests.",category:"Testing",shows:["Time limits","Load test","Uploads"],realSystem:"Set baseUrl to your API and change the time limits to what your users expect.",file:{format:lj,name:"Speed and reliability",description:"Open a request and press Load test to see how it holds up under many users.",variables:[{key:"baseUrl",value:"{{practiceApi}}",secret:!1,note:"Your API's address"}],requests:[{name:"Answers within half a second",request:{method:"GET",url:"{{baseUrl}}/slow",params:[{key:"ms",value:"200"}],description:"Waits about 200 ms. The time check fails if it takes over 500 ms.",checks:[{type:"status",expect:"200"},{type:"time",maxMs:500}]}},{name:"Sometimes fails",request:{method:"GET",url:"{{baseUrl}}/flaky",description:"Fails about 1 time in 10, on purpose. Run it as a load test to see the error rate.",checks:[{type:"status",expect:"2xx,500"}]}},{name:"Upload a form",request:{method:"POST",url:"{{baseUrl}}/upload",bodyMode:"multipart",formRows:[{key:"title",value:"Quarterly report",kind:"text",file:null},{key:"pages",value:"12",kind:"text",file:null}],description:"A multipart form; add a file row to send a file too.",checks:[{type:"status",expect:"200"},{type:"json",path:"fields.title",op:"equals",value:"Quarterly report"}]}}]}}];function hM(e,t=new Date().toISOString()){return`${JSON.stringify({exportedAt:t,exporter:"ApiTestCenter",version:1,report:e},null,2)}
1055
+ `}function hN(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.testName&&Array.isArray(e.buckets)&&"object"==typeof e.summary&&null!==e.summary}function hI(e){if(!e||"object"!=typeof e)throw Error("That file is not JSON we can open.");if("compare"===e.kind||Array.isArray(e.apis)&&e.apis.length>0){if(!(e&&"object"==typeof e&&"compare"===e.kind&&Array.isArray(e.apis)&&e.apis.length>=1&&e.apis.every(e=>e&&"object"==typeof e&&hN(e.report))))throw Error("Not a valid APITestCenter compare export.");return{kind:"compare",doc:{...e,apis:e.apis.map(e=>({...e,report:pv(e.report)}))}}}if(hN(e.report))return{kind:"report",report:pv(e.report)};if(hN(e))return{kind:"report",report:pv(e)};throw Error("Not an APITestCenter report. Export JSON from the lab (not HTML or Excel).")}function hq(e){let t=0x811c9dc5;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,0x1000193);return(t>>>0).toString(16).padStart(8,"0")}e.s(["g",0,hj,"s",0,function(e){return hj.find(t=>t.id===e.trim().toLowerCase())},"t",0,function(e){return`${JSON.stringify(e.file,null,2)}
1056
+ `}],35540),e.s(["L",0,function(e){return`apitestcenter-${e}`},"$",0,hM],16587),e.s(["f",0,hI],504);let hC=/\.(html?|xlsx|csv|eml)$/i;async function hz(e){let t=[];for(let n of e){var r;if(/\.zip$/i.test(n.name)||(r=n.bytes).length>4&&80===r[0]&&75===r[1]&&3===r[2]&&4===r[3])try{let e=(await hP(n.bytes)).filter(e=>/\.json$/i.test(e.name));for(let r of(e.length||t.push({name:n.name,error:"This Zip has no JSON report inside. Use the Zip that APITestCenter exports."}),e))t.push({name:r.name,text:new TextDecoder().decode(r.bytes)})}catch(e){t.push({name:n.name,error:e instanceof Error?e.message:"This Zip couldn't be read."})}else hC.test(n.name)?t.push({name:n.name,error:"HTML, Excel and CSV are for reading, not for opening again. Open the JSON or the Zip export."}):t.push({name:n.name,text:new TextDecoder().decode(n.bytes)})}return t}async function hP(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=-1;for(let n=e.length-22;n>=Math.max(0,e.length-22-65535);n--)if(0x6054b50===t.getUint32(n,!0)){r=n;break}if(r<0)throw Error("This Zip couldn't be read: it may be cut short.");let n=t.getUint16(r+10,!0),s=t.getUint32(r+16,!0),a=[];for(let r=0;r<n;r++){if(0x2014b50!==t.getUint32(s,!0))throw Error("This Zip couldn't be read: its list of files is damaged.");let r=t.getUint16(s+10,!0),n=t.getUint32(s+20,!0),i=t.getUint16(s+28,!0),o=t.getUint16(s+30,!0),l=t.getUint16(s+32,!0),u=t.getUint32(s+42,!0),c=new TextDecoder().decode(e.subarray(s+46,s+46+i));if(s+=46+i+o+l,c.endsWith("/"))continue;let d=u+30+t.getUint16(u+26,!0)+t.getUint16(u+28,!0),p=e.subarray(d,d+n);0===r?a.push({name:c.split("/").pop()??c,bytes:p}):8===r&&a.push({name:c.split("/").pop()??c,bytes:await hR(p)})}return a}async function hR(e){let t=new Blob([e]).stream().pipeThrough(new DecompressionStream("deflate-raw"));return new Uint8Array(await new Response(t).arrayBuffer())}e.s(["e",0,class{list;constructor(e=[]){this.list=[...e]}records(){return[...this.list]}clear(){this.list=[]}restore(e){this.list=[...e]}addText(e,t,r=new Date().toISOString()){let n;try{n=JSON.parse(t)}catch{return this.invalid(e,t.length,"This isn't JSON. Open the JSON or Zip export from APITestCenter.")}return this.add(e,n,t.length,r)}add(e,t,r,n=new Date().toISOString()){let s;if(t&&"object"==typeof t&&"probe"===t.kind)return{kind:"skipped",name:e,reason:"A single response, saved next to its report"};try{s=hI(t)}catch(t){return this.invalid(e,r,t instanceof Error?t.message:"Not an APITestCenter report.")}let a=t.meta;if("report"===s.kind){let t=s.report,i=this.list.findIndex(e=>"runs"===e.folder&&"doc"in e&&e.doc.report.id===t.id),o=i>=0?this.list[i].doc.meta:void 0,l={...a,savedAt:o?.savedAt??a?.savedAt??n,source:a?.source??"import",name:o?.name??a?.name,note:o?.note??a?.note,baseline:o?.baseline??a?.baseline},u={folder:"runs",file:e,bytes:r,doc:pE(t,l)};return i>=0?this.list[i]=u:this.list.push(u),l.baseline&&this.onlyBaseline(t.id),{kind:"run",id:t.id,name:pT(u.doc,e,r).name,replaced:i>=0}}let i={...s.doc,meta:a?{...a}:void 0},o=a?.id??`compare-${hq(`${i.exportedAt}|${i.apis.map(e=>e.report.id).join(",")}`)}`,l=this.list.findIndex(e=>"compares"===e.folder&&e.id===o),u={...i.meta,id:o,savedAt:i.meta?.savedAt??i.exportedAt??n,source:i.meta?.source??"import"},c={folder:"compares",file:e,bytes:r,id:o,doc:{...i,meta:u}};return l>=0?this.list[l]=c:this.list.push(c),{kind:"compare",id:o,name:pO(c.doc,o,e,r).name,replaced:l>=0}}unreadable(e,t,r=0){return this.invalid(e,r,t)}invalid(e,t,r){return this.list=this.list.filter(t=>!("invalid"in t&&t.file===e)),this.list.push({folder:"runs",file:e,bytes:t,invalid:r}),{kind:"invalid",name:e,reason:r}}index(){let e=[],t=[],r=[],n=0;for(let s of this.list)n+=s.bytes,"invalid"in s?r.push({folder:s.folder,file:s.file,reason:s.invalid}):"runs"===s.folder?e.push(pT(s.doc,s.file,s.bytes)):t.push(pO(s.doc,s.id,s.file,s.bytes));return e.sort((e,t)=>Date.parse(t.startedAt)-Date.parse(e.startedAt)),t.sort((e,t)=>Date.parse(t.savedAt)-Date.parse(e.savedAt)),{dataDir:"this browser",runs:e,compares:t,invalid:r,totalBytes:n}}run(e){let t=this.findRun(e);return t?t.doc:null}compare(e){let t=this.findCompare(e);return t?t.doc:null}updateRun(e,t){let r=this.findRun(e);if(!r)return null;let n={savedAt:r.doc.exportedAt,source:"import",...r.doc.meta};return void 0!==t.name&&(n.name=t.name.trim()||void 0),void 0!==t.note&&(n.note=t.note.trim()||void 0),void 0!==t.baseline&&(n.baseline=t.baseline||void 0),r.doc={...r.doc,meta:n},t.baseline&&this.onlyBaseline(e),pT(r.doc,r.file,r.bytes)}updateCompare(e,t){let r=this.findCompare(e);if(!r)return null;let n={savedAt:r.doc.exportedAt,source:"import",...r.doc.meta,id:e};return void 0!==t.name&&(n.name=t.name.trim()||void 0),void 0!==t.note&&(n.note=t.note.trim()||void 0),r.doc={...r.doc,meta:n},pO(r.doc,e,r.file,r.bytes)}saveCompare(e,t=new Date().toISOString()){let r=`compare-${hq(`${t}|${e.apis.map(e=>e.report.id).join(",")}`)}`,n={...JSON.parse(pV(e.apis,e.mode,t)),meta:{id:r,savedAt:t,source:"compare",name:e.name,ignoreStructure:e.ignoreStructure}},s=`${e.apis.map(e=>e.title).join(" vs ")}.json`,a=JSON.stringify(n).length;return this.list.push({folder:"compares",file:s,bytes:a,id:r,doc:n}),pO(n,r,s,a)}remove(e){let t=this.list.length,r=new Set(e.runs??[]),n=new Set(e.compares??[]),s=new Set((e.invalid??[]).map(e=>e.file));return this.list=this.list.filter(e=>"invalid"in e?!s.has(e.file):"runs"===e.folder?!r.has(e.doc.report.id):!n.has(e.id)),t-this.list.length}findRun(e){return this.list.find(t=>"runs"===t.folder&&"doc"in t&&t.doc.report.id===e)}findCompare(e){return this.list.find(t=>"compares"===t.folder&&t.id===e)}onlyBaseline(e){let t=this.findRun(e);if(!t)return;let r=pT(t.doc,t.file,t.bytes).endpoint;for(let e of this.list)e!==t&&"runs"===e.folder&&"doc"in e&&e.doc.meta?.baseline&&pT(e.doc,e.file,e.bytes).endpoint===r&&(e.doc={...e.doc,meta:{...e.doc.meta,baseline:void 0}})}},"V",0,hz,"i",0,function(e=Date.now()){let t=t=>new Date(e-864e5*t-72e5).toISOString(),r=(e,r,n,s)=>m({id:e,startedAt:t(r),latencyScale:n,spike:s,errors:s}),n=r("sample-orders-1",6,1.35,!0),s=r("sample-orders-2",3,1,!0),a=r("sample-orders-3",0,.8,!1),i=m({id:"sample-payments-1",testName:"Payments API — Create payment",url:"https://api.uat.example.com/v1/payments",startedAt:t(.05),latencyScale:1.6,spike:!0}),o=(e,t,r)=>{let n=JSON.parse(hM(t));return{name:e,text:JSON.stringify(r?{...n,meta:{savedAt:t.endedAt,source:"import",...r}}:n)}};return[o("orders-after-caching.json",a,{name:"Orders API — with caching",note:"Build 431: response caching on."}),o("orders-reference.json",s,{name:"Orders API — release 2.3",note:"Agreed reference for this API.",baseline:!0}),o("orders-before-caching.json",n,{name:"Orders API — before caching",note:"Build 412. The database is slow when users double."}),o("payments.json",i),{name:"orders-vs-payments.json",text:pV([{id:"orders",title:"Orders API",report:a},{id:"payments",title:"Payments API",report:i}],"parallel",t(0))}]}],65510),e.s([],24856)}],11367,(e,t,r)=>{var n={872:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,a=l(e),i=a[0],o=a[1],u=new s((i+o)*3/4-o),c=0,d=o>0?i-4:i;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,a=[],i=0,o=n-s;i<o;i+=16383)a.push(function(e,t,n){for(var s,a=[],i=t;i<n;i+=3)s=(e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2]),a.push(r[s>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return a.join("")}(e,i,i+16383>o?o:i+16383));return 1===s?a.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===s&&a.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),a.join("")};for(var r=[],n=[],s="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=a.length;i<o;++i)r[i]=a[i],n[a.charCodeAt(i)]=i;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),s=r(321),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,s=t;if(("string"!=typeof s||""===s)&&(s="utf8"),!o.isEncoding(s))throw TypeError("Unknown encoding: "+s);var a=0|h(n,s),l=i(a),u=l.write(n,s);return u!==a&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(E(e,ArrayBuffer)||e&&E(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(E(e,SharedArrayBuffer)||e&&E(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return o.from(c,t,r);var f=function(e){if(o.isBuffer(e)){var t=0|p(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),i(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(u(e),e<=0)?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function p(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||E(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(s)return n?-1:_(e).length;t=(""+t).toLowerCase(),s=!0}}function f(e,t,r){var s,a,i,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var s="",a=t;a<r;++a)s+=j[e[a]];return s}(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var s=t;s<r;++s)n+=String.fromCharCode(127&e[s]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var s=t;s<r;++s)n+=String.fromCharCode(e[s]);return n}(this,t,r);case"base64":return s=this,a=t,i=r,0===a&&i===s.length?n.fromByteArray(s):n.fromByteArray(s.slice(a,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),s="",a=0;a<n.length;a+=2)s+=String.fromCharCode(n[a]+256*n[a+1]);return s}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,s){var a;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r*=1)!=a&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(s)return -1;else r=e.length-1;else if(r<0)if(!s)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,s);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(s)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return g(e,[t],r,n,s)}throw TypeError("val must be string, number or Buffer")}function g(e,t,r,n,s){var a,i=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;i=2,o/=2,l/=2,r/=2}function u(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(s){var c=-1;for(a=r;a<o;a++)if(u(e,a)===u(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*i}else -1!==c&&(a-=a-c),c=-1}else for(r+l>o&&(r=o-l),a=r;a>=0;a--){for(var d=!0,p=0;p<l;p++)if(u(e,a+p)!==u(t,p)){d=!1;break}if(d)return a}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(E(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),E(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,s=0,a=Math.min(r,n);s<a;++s)if(e[s]!==t[s]){r=e[s],n=t[s];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),s=0;for(r=0;r<e.length;++r){var a=e[r];if(E(a,Uint8Array)&&(a=o.from(a)),!o.isBuffer(a))throw TypeError('"list" argument must be an Array of Buffers');a.copy(n,s),s+=a.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(o.prototype[a]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,s){if(E(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||r>e.length||n<0||s>this.length)throw RangeError("out of range index");if(n>=s&&t>=r)return 0;if(n>=s)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var a=s-n,i=r-t,l=Math.min(a,i),u=this.slice(n,s),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){a=u[d],i=c[d];break}return a<i?-1:+(i<a)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)};function b(e,t,r){r=Math.min(e.length,r);for(var n=[],s=t;s<r;){var a,i,o,l,u=e[s],c=null,d=u>239?4:u>223?3:u>191?2:1;if(s+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(a=e[s+1]))==128&&(l=(31&u)<<6|63&a)>127&&(c=l);break;case 3:a=e[s+1],i=e[s+2],(192&a)==128&&(192&i)==128&&(l=(15&u)<<12|(63&a)<<6|63&i)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[s+1],i=e[s+2],o=e[s+3],(192&a)==128&&(192&i)==128&&(192&o)==128&&(l=(15&u)<<18|(63&a)<<12|(63&i)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),s+=d}var p=n,h=p.length;if(h<=4096)return String.fromCharCode.apply(String,p);for(var f="",m=0;m<h;)f+=String.fromCharCode.apply(String,p.slice(m,m+=4096));return f}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,s,a){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<a)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function k(e,t,r,n,s,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function x(e,t,r,n,a){return t*=1,r>>>=0,a||k(e,t,r,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,r,n,23,4),r+4}function $(e,t,r,n,a){return t*=1,r>>>=0,a||k(e,t,r,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,a,i,o,l,u,c,d,p=this.length-t;if((void 0===r||r>p)&&(r=p),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;var a=t.length;n>a/2&&(n=a/2);for(var i=0;i<n;++i){var o,l=parseInt(t.substr(2*i,2),16);if((o=l)!=o)break;e[r+i]=l}return i}(this,e,t,r);case"utf8":case"utf-8":return s=t,a=r,O(_(e,this.length-s),this,s,a);case"ascii":return i=t,o=r,O(A(e),this,i,o);case"latin1":case"binary":return function(e,t,r,n){return O(A(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,O(T(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,O(function(e,t){for(var r,n,s=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,s.push(r%256),s.push(n);return s}(e,this.length-c),this,c,d);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],s=1,a=0;++a<t&&(s*=256);)n+=this[e+a]*s;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],s=1,a=0;++a<t&&(s*=256);)n+=this[e+a]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,s=1,a=this[e+--n];n>0&&(s*=256);)a+=this[e+--n]*s;return a>=(s*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),s.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),s.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),s.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),s.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;w(this,e,t,r,s,0)}var a=1,i=0;for(this[t]=255&e;++i<r&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;w(this,e,t,r,s,0)}var a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var s=Math.pow(2,8*r-1);w(this,e,t,r,s-1,-s)}var a=0,i=1,o=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/i|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var s=Math.pow(2,8*r-1);w(this,e,t,r,s-1,-s)}var a=r-1,i=1,o=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/i|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||w(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return x(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return x(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return $(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return $(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var s=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var a=s-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return s},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var s,a=e.charCodeAt(0);("utf8"===n&&a<128||"latin1"===n)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var i=o.isBuffer(e)?e:o.from(e,n),l=i.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=i[s%l]}return this};var S=/[^+/0-9A-Za-z-_]/g;function _(e,t){t=t||1/0;for(var r,n=e.length,s=null,a=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!s){if(r>56319||i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&a.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function A(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function T(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function O(e,t,r,n){for(var s=0;s<n&&!(s+r>=t.length)&&!(s>=e.length);++s)t[s+r]=e[s];return s}function E(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var j=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,s=0;s<16;++s)t[n+s]=e[r]+e[s];return t}()},321:function(e,t){t.read=function(e,t,r,n,s){var a,i,o=8*s-n-1,l=(1<<o)-1,u=l>>1,c=-7,d=r?s-1:0,p=r?-1:1,h=e[t+d];for(d+=p,a=h&(1<<-c)-1,h>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=p,c-=8);for(i=a&(1<<-c)-1,a>>=-c,c+=n;c>0;i=256*i+e[t+d],d+=p,c-=8);if(0===a)a=1-u;else{if(a===l)return i?0/0:(h?-1:1)*2e308;i+=Math.pow(2,n),a-=u}return(h?-1:1)*i*Math.pow(2,a-n)},t.write=function(e,t,r,n,s,a){var i,o,l,u=8*a-s-1,c=(1<<u)-1,d=c>>1,p=5960464477539062e-23*(23===s),h=n?0:a-1,f=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(o=+!!isNaN(t),i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+d>=1?t+=p/l:t+=p*Math.pow(2,1-d),t*l>=2&&(i++,l/=2),i+d>=c?(o=0,i=c):i+d>=1?(o=(t*l-1)*Math.pow(2,s),i+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,s),i=0));s>=8;e[r+h]=255&o,h+=f,o/=256,s-=8);for(i=i<<s|o,u+=s;u>0;e[r+h]=255&i,h+=f,i/=256,u-=8);e[r+h-f]|=128*m}}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}},i=!0;try{n[e](r,r.exports,a),i=!1}finally{i&&delete s[e]}return r.exports}a.ab="/ROOT/node_modules/.pnpm/next@16.4.3_@playwright+test@1.64.1_@types+node@24.19.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/next/dist/compiled/buffer/",t.exports=a(230)}]);