oapiex 0.3.8 → 0.3.10

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 (43) hide show
  1. package/bin/acorn-e8W_D2c_.mjs +16 -0
  2. package/bin/angular-hFYH82G-.mjs +4 -0
  3. package/bin/babel-fr_lL9to.mjs +15 -0
  4. package/bin/cli.mjs +111 -13
  5. package/bin/estree-B-Lhm4Hd.mjs +44 -0
  6. package/bin/flow-BRS1FfP1.mjs +20 -0
  7. package/bin/glimmer-BtFpvZhb.mjs +37 -0
  8. package/bin/graphql-kQVq9UYo.mjs +28 -0
  9. package/bin/html-CIcRoqWL.mjs +25 -0
  10. package/bin/markdown-uvG4mxr8.mjs +62 -0
  11. package/bin/meriyah-DyP35pNK.mjs +5 -0
  12. package/bin/postcss-CbFXTw98.mjs +61 -0
  13. package/bin/typescript-BDVDge_O.mjs +21 -0
  14. package/bin/yaml-BNfwk1xa.mjs +159 -0
  15. package/dist/acorn-21ABnSdB.cjs +4971 -0
  16. package/dist/acorn-C_1S2EAj.mjs +4969 -0
  17. package/dist/angular-BV6jfWdp.cjs +4084 -0
  18. package/dist/angular-C66eBqoS.mjs +4082 -0
  19. package/dist/babel-Bz8pZo4b.cjs +9879 -0
  20. package/dist/babel-CsQd21KZ.mjs +9877 -0
  21. package/dist/estree-CzMW7i2J.mjs +7266 -0
  22. package/dist/estree-JnZk-Onr.cjs +7270 -0
  23. package/dist/flow-BiaXaApn.mjs +52913 -0
  24. package/dist/flow-nfncfm-z.cjs +52915 -0
  25. package/dist/glimmer-B6CdKQ-2.mjs +7532 -0
  26. package/dist/glimmer-CiwR9Elq.cjs +7536 -0
  27. package/dist/graphql-BHWygr4C.cjs +1950 -0
  28. package/dist/graphql-C2x1gvQd.mjs +1945 -0
  29. package/dist/html-2W-fjNa6.cjs +7143 -0
  30. package/dist/html-kerd4hOT.mjs +7138 -0
  31. package/dist/index.cjs +15635 -22
  32. package/dist/index.mjs +15622 -8
  33. package/dist/markdown-CbyydoYw.mjs +6877 -0
  34. package/dist/markdown-Ccw9NnJ_.cjs +6882 -0
  35. package/dist/meriyah-C4Gx_ouZ.mjs +7591 -0
  36. package/dist/meriyah-CUKcThLv.cjs +7593 -0
  37. package/dist/postcss-DtZ8UtYr.cjs +6782 -0
  38. package/dist/postcss-DuVmYBUE.mjs +6777 -0
  39. package/dist/typescript-DoEQusFy.mjs +22902 -0
  40. package/dist/typescript-I6QkuLBo.cjs +22904 -0
  41. package/dist/yaml-TADhykGS.mjs +5279 -0
  42. package/dist/yaml-jVlKqQbk.cjs +5285 -0
  43. package/package.json +16 -13
package/bin/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import{JSDOM as e}from"jsdom";import{Window as t}from"happy-dom";import n from"axios";import{Logger as r}from"@h3ravel/shared";import i from"node:path";import a,{readFile as o}from"node:fs/promises";import{Command as s,Kernel as c}from"@h3ravel/musket";import l from"prettier";import{execFileSync as u}from"node:child_process";import{pathToFileURL as d}from"node:url";import{existsSync as f,readdirSync as p}from"node:fs";import{fileURLToPath as m}from"url";import{createJiti as h}from"jiti";const g={outputFormat:`pretty`,outputShape:`raw`,requestTimeout:5e4,maxRedirects:5,userAgent:`Mozilla/5.0 (X11; Linux x64) AppleWebKit/537.36 (KHTML, like Gecko) OpenApiExtractor/1.0.0`,retryCount:3,retryDelay:1e3,browser:`puppeteer`,happyDom:{enableJavaScriptEvaluation:!0,suppressInsecureJavaScriptEnvironmentWarning:!0},puppeteer:{headless:!0,args:[`--no-sandbox`,`--disable-setuid-sandbox`]}},_=()=>({...g,happyDom:{...g.happyDom},puppeteer:g.puppeteer?{...g.puppeteer,args:g.puppeteer.args?[...g.puppeteer.args]:void 0}:void 0,sdkKit:g.sdkKit?{...g.sdkKit,urls:g.sdkKit.urls?{...g.sdkKit.urls}:void 0}:void 0,sdk:g.sdk?{...g.sdk,urls:g.sdk.urls?{...g.sdk.urls}:void 0}:void 0}),v=(e,t)=>({...e,...t,happyDom:{...e.happyDom,...t.happyDom},puppeteer:t.puppeteer?{...e.puppeteer??{},...t.puppeteer,args:t.puppeteer.args?[...t.puppeteer.args]:e.puppeteer?.args}:e.puppeteer,sdkKit:t.sdkKit?{...e.sdkKit??{},...t.sdkKit,urls:t.sdkKit.urls?{...e.sdkKit?.urls??{},...t.sdkKit.urls}:e.sdkKit?.urls}:e.sdkKit,sdk:t.sdk?{...e.sdk??{},...t.sdk,urls:t.sdk.urls?{...e.sdk?.urls??{},...t.sdk.urls}:e.sdk?.urls}:e.sdk}),y=[`SIGINT`,`SIGTERM`,`SIGTSTP`],b=[`axios`,`happy-dom`,`jsdom`,`puppeteer`];let x=_(),S=!1,C=!1;const w=new Set,T=()=>globalThis.__oapieBrowserSession,E=()=>{!T()&&w.size===0&&O()},D=()=>{if(!C){for(let e of y)process.on(e,A);C=!0}},O=()=>{if(C){for(let e of y)process.off(e,A);C=!1}},k=e=>(D(),w.add(e),()=>{w.delete(e),E()}),ee=async()=>{let e=Array.from(w).reverse();w.clear();for(let t of e)await t();await M()},A=async e=>{if(!S){S=!0,O();try{await ee()}catch(e){console.error(`Failed to close active browser resources:`,e)}finally{S=!1}if(e===`SIGTSTP`){process.kill(process.pid,e);return}process.exit(e===`SIGINT`?130:143)}},j=async(e=x)=>{let t=T();if(t?.browser===e.browser)return t;t&&await M();let n={browser:e.browser,closers:[]};return e.browser===`puppeteer`&&(n.puppeteerBrowser=await(await import(`puppeteer`)).launch({headless:e.puppeteer?.headless??!0,args:e.puppeteer?.args??[`--no-sandbox`,`--disable-setuid-sandbox`]})),D(),globalThis.__oapieBrowserSession=n,n},M=async()=>{let e=T();if(e){globalThis.__oapieBrowserSession=void 0;for(let t of e.closers.reverse())await t();e.puppeteerBrowser&&await e.puppeteerBrowser.close(),E()}},N=(e,t)=>{let n=T();return!n||n.browser!==e?!1:(n.closers.push(t),!0)},P=e=>b.includes(e),te=async(r,i=x,a=!1)=>{let{data:o}=i.browser===`puppeteer`?{data:``}:await n.get(r,{timeout:i.requestTimeout,maxRedirects:i.maxRedirects,headers:{"User-Agent":i.userAgent,Accept:`text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`}});if(i.browser===`axios`)return o;if(i.browser===`happy-dom`){let e=new t({url:r,innerWidth:1024,innerHeight:768,settings:i.happyDom}),n=k(()=>e.happyDOM.close());try{e.document.write(o),await e.happyDOM.waitUntilComplete();let t=e.document.documentElement.outerHTML;if(!t)throw await e.happyDOM.close(),Error(`Unable to extract HTML from remote source: ${r}`);return N(`happy-dom`,()=>e.happyDOM.close())||await e.happyDOM.close(),t}finally{n()}}else if(i.browser===`jsdom`){let t,n;try{({window:t}=new e(o,{url:r,contentType:`text/html`,runScripts:`dangerously`,includeNodeLocations:!0})),n=k(()=>t?.close());let i=t.document.documentElement.outerHTML;if(!i)throw Error(`Unable to extract HTML from remote source: ${r}`);let a=t;return N(`jsdom`,()=>a.close())||t.close(),t=void 0,i}finally{n?.(),t&&t.close()}}else if(i.browser===`puppeteer`){let e=T(),t=Math.max(i.requestTimeout,3e4),o=e?.browser===`puppeteer`?e.puppeteerBrowser:void 0,s=!1,c,l,u;try{o||(o=await(await import(`puppeteer`)).launch({headless:i.puppeteer?.headless??!0,args:i.puppeteer?.args??[`--no-sandbox`,`--disable-setuid-sandbox`]}),s=!0,l=k(async()=>{o?.connected&&await o.close()})),c=await o.newPage(),u=k(async()=>{c&&!c.isClosed()&&await c.close()}),await c.setUserAgent({userAgent:i.userAgent}),await c.setRequestInterception(!0),c.on(`request`,e=>{let t=e.resourceType();if([`image`,`font`,`media`,`stylesheet`].includes(t))return void e.abort();e.continue()});try{await c.goto(r,{waitUntil:`domcontentloaded`,timeout:t})}catch(e){if(!c||!await se(c))throw e}let e=await ie(c,t,a);if(!e)throw Error(`Unable to extract HTML from remote source: ${r}`);if(!e.includes(`id="ssr-props"`)){let{data:t}=await n.get(r,{timeout:i.requestTimeout,maxRedirects:i.maxRedirects,headers:{"User-Agent":i.userAgent,Accept:`text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`}});e=ce(e,t)}return e}finally{u?.(),c&&!c.isClosed()&&await c.close(),l?.(),s&&o&&await o.close()}}else throw Error(`Unsupported browser specified in configuration: ${x.browser}`)},ne=async(e,t,n=!1)=>{try{n&&await e.waitForSelector(`.hub-sidebar-content .rm-Sidebar-link`),await e.waitForSelector(`[data-testid="http-method"], article#content, script#ssr-props`,{timeout:t})}catch{}},re=async(e,t)=>{try{await e.waitForFunction(()=>{let e=!!document.querySelector(`[data-testid="http-method"]`),t=!!document.querySelector(`form[name="Parameters"]`),n=!!document.querySelector(`.rm-PlaygroundRequest`),r=!!document.querySelector(`.rm-PlaygroundResponse`),i=!!document.querySelector(`script#ssr-props`);return e?t||n||r||i:!1},{timeout:t})}catch{}try{await e.waitForSelector(`.rm-PlaygroundRequest, .rm-PlaygroundResponse, form[name="Parameters"], script#ssr-props`,{timeout:Math.min(t,5e3)})}catch{}try{await e.waitForNetworkIdle?.({idleTime:500,timeout:Math.min(t,5e3)})}catch{}},ie=async(e,t,n=!1,r=3)=>{let i;for(let a=1;a<=r;a+=1)try{return await ne(e,t,n),await re(e,t),await e.content()}catch(n){if(i=n,!oe(n)||a===r)throw n;await ae(e,t)}throw i instanceof Error?i:Error(`Unable to extract stable HTML from remote source`)},ae=async(e,t)=>{try{await e.waitForFunction(()=>document.readyState===`interactive`||document.readyState===`complete`,{timeout:Math.min(t,5e3)})}catch{}try{await e.waitForNetworkIdle?.({idleTime:500,timeout:Math.min(t,5e3)})}catch{}},oe=e=>{if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return t.includes(`execution context was destroyed`)||t.includes(`cannot find context with specified id`)||t.includes(`most likely because of a navigation`)},se=async e=>!!await e.$(`[data-testid="http-method"], article#content, script#ssr-props`),ce=(e,t)=>{if(e.includes(`id="ssr-props"`))return e;let n=le(t);return n?e.includes(`</body>`)?e.replace(`</body>`,`${n}</body>`):e.includes(`</html>`)?e.replace(`</html>`,`${n}</html>`):`${e}${n}`:e},le=e=>e.match(/<script id="ssr-props"[^>]*>[\s\S]*?<\/script>/i)?.[0]??null;var F=class e{static parsePossiblyTruncated=t=>{let n=new e,r=t.trim();if(!/^(?:\{|\[)/.test(r))return null;try{return JSON.parse(r)}catch{let e=n.repairCommonJsonIssues(r);try{return JSON.parse(e)}catch{return null}}};repairCommonJsonIssues=e=>{let t=this.removeUnexpectedObjectTokens(e),n=this.insertMissingCommas(t);return`${n}${this.buildMissingJsonClosers(n)}`};removeUnexpectedObjectTokens=e=>e.replace(/([[{,]\s*)([A-Za-z_$][\w$-]*)(?=\s*"(?:\\.|[^"\\])*"\s*:)/g,`$1`);insertMissingCommas=e=>{let t=``,n=!1,r=!1,i=``;for(let a=0;a<e.length;a+=1){let o=e[a];if(n){if(t+=o,r){r=!1;continue}if(o===`\\`){r=!0;continue}o===`"`&&(n=!1,i=`"`);continue}if(o===`"`){let r=e.slice(a);/^"(?:\\.|[^"\\])*"\s*:/.test(r)&&this.shouldInsertCommaBeforeKey(i,t)&&(t+=`,`),t+=o,n=!0;continue}t+=o,/\s/.test(o)||(i=o)}return t};shouldInsertCommaBeforeKey=(e,t)=>{if(!e||![`"`,`}`,`]`,`e`,`l`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].includes(e))return!1;let n=t.trimEnd();return!n.endsWith(`,`)&&!n.endsWith(`{`)};buildMissingJsonClosers=e=>{let t=[],n=!1,r=!1;for(let i of e){if(r){r=!1;continue}if(i===`\\`){r=!0;continue}if(i===`"`){n=!n;continue}if(!n){if(i===`{`){t.push(`}`);continue}if(i===`[`){t.push(`]`);continue}(i===`}`||i===`]`)&&t[t.length-1]===i&&t.pop()}}return t.reverse().join(``)}};const I=e=>typeof e==`object`&&!!e&&!Array.isArray(e),L=e=>{let n=new t;n.document.write(e);let{document:r}=n,i=r.querySelector(`article#content`)??r.body,a=i.querySelector(`form[name="Parameters"]`),o=r.querySelector(`.rm-PlaygroundRequest`),s=r.querySelector(`.rm-PlaygroundResponse`),c=be(o),l=Re(c[0]??null),u=xe(s);return ue({method:q(i.querySelector(`[data-testid="http-method"]`))?.toUpperCase()??null,url:q(i.querySelector(`[data-testid="serverurl"]`)),description:ye(i),sidebarLinks:Se(r.querySelector(`.rm-Sidebar.hub-sidebar-content`)),requestParams:Ce(a),requestCodeSnippets:c,requestExample:c[0]?.body??null,requestExampleNormalized:l,responseSchemas:we(i),responseBodies:u,responseExample:u[0]?.body??null,responseExampleRaw:u[0]?.rawBody??null},de(r))},ue=(e,t)=>t?{method:e.method??t.method,url:e.url??t.url,description:e.description??t.description,sidebarLinks:e.sidebarLinks.length>0?e.sidebarLinks:t.sidebarLinks,requestParams:e.requestParams.length>0?e.requestParams:t.requestParams,requestCodeSnippets:e.requestCodeSnippets.length>0?e.requestCodeSnippets:t.requestCodeSnippets,requestExample:e.requestExample??t.requestExample,requestExampleNormalized:e.requestExampleNormalized??t.requestExampleNormalized,responseSchemas:e.responseSchemas.length>0?e.responseSchemas:t.responseSchemas,responseBodies:e.responseBodies.length>0?e.responseBodies:t.responseBodies,responseExample:e.responseExample??t.responseExample,responseExampleRaw:e.responseExampleRaw??t.responseExampleRaw}:e,de=e=>{let t=e.querySelector(`script#ssr-props`)?.textContent?.trim();if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}let r=I(n)&&I(n.document)?n.document.api:null;if(!I(r))return null;let i=typeof r.method==`string`?r.method.toUpperCase():null,a=typeof r.path==`string`?r.path:null,o=I(r.schema)?r.schema:null,s=pe(o,a,i?.toLowerCase()??null),c=Array.isArray(o?.servers)&&I(o.servers[0])&&typeof o.servers[0].url==`string`?o.servers[0].url:null;if(!s&&!i&&!a)return null;let l=_e(s?.responses??{});return{method:i,url:me(c,a),description:s?.description??null,sidebarLinks:[],requestParams:[...fe(s?.parameters),...he(s?.requestBody)],requestCodeSnippets:[],requestExample:null,requestExampleNormalized:null,responseSchemas:ge(s?.responses??{}),responseBodies:l,responseExample:l[0]?.body??null,responseExampleRaw:l[0]?.rawBody??null}},fe=e=>e?e.map(e=>({name:e.name,in:e.in,path:[e.name],type:e.schema?.type??null,required:e.required??!1,defaultValue:e.schema?.default==null?e.example==null?null:String(e.example):String(e.schema.default),description:e.description??e.schema?.description??null})):[],pe=(e,t,n)=>{if(!e||!t||!n||!I(e.paths))return null;let r=e.paths[t];return!I(r)||!I(r[n])?null:r[n]},me=(e,t)=>!e||!t?null:`${e.replace(/\/$/,``)}${t.startsWith(`/`)?t:`/${t}`}`,he=e=>{let t=e?.content?.[`application/json`]?.schema;return t?R(t):[]},R=(e,t=[])=>{if(!e.properties)return[];let n=[];for(let[r,i]of Object.entries(e.properties)){let a=[...t,r],o=e.required?.includes(r)??!1;if(i.type===`object`&&i.properties){n.push(...R(i,a).map(e=>({...e,required:e.path.length===a.length+1?o&&e.required:e.required})));continue}n.push({name:r,in:`body`,path:a,type:i.type??null,required:o,defaultValue:i.default==null?null:String(i.default),description:i.description??null})}return n},ge=e=>Object.entries(e).map(([e,t])=>({statusCode:e,description:t.description??e})),_e=e=>{let t=[];for(let[n,r]of Object.entries(e))for(let[e,i]of Object.entries(r.content??{})){let a=ve(i);if(a==null)continue;let o=typeof a==`string`?a:JSON.stringify(a,null,2),s=V(o,e);t.push({format:s.format,contentType:e,statusCode:n,label:r.description??n,body:s.body,rawBody:o})}return t},ve=e=>{if(e.example!==void 0)return e.example;let t=e.examples;if(t&&I(t)){for(let e of Object.values(t))if(I(e)&&`value`in e)return e.value??null}return e.schema?.example===void 0?null:e.schema.example},ye=e=>{let t=e.querySelector(`header`);if(!t)return null;let n=Array.from(t.querySelectorAll(`[data-testid="RDMD"]`));return q(n[n.length-1]??null)},be=e=>{if(!e)return[];let t=Ee(e);return z(e).map(e=>({label:t,body:e}))},xe=e=>{if(!e)return[];let t=z(e),n=ke(e),r=Ae(e);return t.map((e,t)=>{let i=r[t]??r[0]??null,a=n[t]??n[0]??null,o=V(e,a);return{format:o.format,contentType:a,statusCode:i?.match(/\b\d{3}\b/)?.[0]??null,label:i,body:o.body,rawBody:e}})},Se=e=>e?Array.from(e.querySelectorAll(`.rm-Sidebar-link`)).map(e=>{let t=e.closest(`.rm-Sidebar-section`),n=q(e.querySelector(`[data-testid="http-method"]`))?.toUpperCase()??null;return{section:q(t?.querySelector(`.rm-Sidebar-heading`)??null),label:Oe(e,n),href:e.getAttribute(`href`),method:n,active:e.classList.contains(`active`)||e.getAttribute(`aria-current`)===`page`,subpage:e.classList.contains(`subpage`)}}).filter(e=>e.label.length>0):[],Ce=e=>e?Array.from(e.querySelectorAll(`label`)).map(t=>{let n=q(t),r=je(t,e),i=Me(r,t);return{name:n??``,in:Ne(r,t,e),path:Pe(t,n),type:Fe(r,i),required:Ie(r,i),defaultValue:De(i),description:Le(r)}}).filter(e=>e.name.length>0):[],we=e=>{let t=e.querySelector(`#response-schemas`)?.nextElementSibling;return!t||!t.classList.contains(`rm-APIResponseSchemaPicker`)?[]:Array.from(t.querySelectorAll(`button`)).map(e=>{let t=q(e),n=t?.match(/\b\d{3}\b/),r=Array.from(e.querySelectorAll(`[data-testid="RDMD"]`));return{statusCode:n?.[0]??null,description:q(r[0]??null)??t}}).filter(e=>e.statusCode!==null)},z=e=>Array.from(e.querySelectorAll(`.CodeSnippet`)).map(e=>Te(e)).filter(e=>!!e),Te=e=>{if(!e)return null;let t=Array.from(e.querySelectorAll(`.CodeMirror-code pre.CodeMirror-line`));return t.length===0?null:t.map(e=>e.textContent?.replace(/\u00a0/g,` `)??``).join(`
2
- `).trimEnd()||null},Ee=e=>{let t=e.querySelector(`header`);if(!t)return null;let n=Array.from(t.querySelectorAll(`button`)).map(e=>Y(e)).filter(e=>!!e);return n.find(e=>e.toLowerCase()!==`examples`)??n[0]??null},De=e=>e&&e.getAttribute(`value`)?.trim()||null,Oe=(e,t)=>J(e.querySelectorAll(`span`)).filter(e=>!t||e.toUpperCase()!==t).sort((e,t)=>t.length-e.length)[0]??q(e)??``,ke=e=>J(e.querySelectorAll(`div`)).filter(e=>/^[\w.+-]+\/[\w.+-]+$/i.test(e)),Ae=e=>Array.from(e.querySelectorAll(`button, [role="button"]`)).map(e=>Y(e)).filter(e=>!!e).filter(e=>/\b\d{3}\b/.test(e)),je=(e,t)=>{let n=e.getAttribute(`for`),r=e;for(;r;){let e=n?r.querySelector(`#${K(n)}`):null,i=r.querySelector(`input, textarea, select`);if((e||i)&&r!==t)return r;r=r.parentElement}return e},Me=(e,t)=>{let n=t.getAttribute(`for`),r=n?e.querySelector(`#${K(n)}`):null,i=e.querySelector(`input, textarea, select`);return r??i},Ne=(e,t,n)=>{let r=B(`${t.getAttribute(`for`)?.toLowerCase()??``} ${e.closest(`[id]`)?.getAttribute(`id`)?.toLowerCase()??``}`);if(r)return r;let i=e;for(;i&&i!==n;){let e=i.previousElementSibling;for(;e;){if(e.tagName===`HEADER`){let t=B(q(e)??``);if(t)return t}e=e.previousElementSibling}i=i.parentElement}return null},B=e=>{let t=e.trim().toLowerCase();return t.includes(`query params`)||t.includes(`query-`)?`query`:t.includes(`headers`)||t.includes(`header-`)?`header`:t.includes(`body params`)||t.includes(`request body`)||t.includes(`body-`)?`body`:t.includes(`path params`)||t.includes(`path-`)?`path`:t.includes(`cookie`)||t.includes(`cookie-`)?`cookie`:null},Pe=(e,t)=>{let n=e.getAttribute(`for`)??``,r=n.includes(`_`)?n.slice(n.indexOf(`_`)+1):``;return r.includes(`.`)?r.split(`.`).map(e=>e.trim()).filter(e=>e.length>0):t?[t]:[]},Fe=(e,t)=>{let n=t?.getAttribute(`type`)?.toLowerCase();if(n===`text`)return`string`;if(n)return n;let r=Array.from(e.querySelectorAll(`[class]`)).find(e=>(e.getAttribute(`class`)??``).split(/\s+/).some(e=>e.startsWith(`field-`)))?.getAttribute(`class`)?.split(/\s+/).find(e=>e.startsWith(`field-`));return r?r.replace(/^field-/,``):null},Ie=(e,t)=>t?.hasAttribute(`required`)?!0:J(e.querySelectorAll(`*`)).some(e=>e.toLowerCase()===`required`),Le=e=>q(e.querySelector(`[id$="__description"]`)||(Array.from(e.querySelectorAll(`[data-testid="RDMD"]`))[0]??null)),V=(e,t)=>{let n=e.trim();if(t?.toLowerCase().includes(`json`)||/^(?:\{|\[)/.test(n)){let t=F.parsePossiblyTruncated(n);if(t!==null)return{format:`json`,body:t};let r=G(n);return r===null?{format:`text`,body:e}:{format:`json`,body:r}}return{format:`text`,body:e}},Re=e=>e?H(e)??ze(e)??{sourceLabel:e.label,method:null,url:null,headers:{},bodyFormat:null,body:null,rawBody:null}:null,H=e=>{if(!e.body.startsWith(`curl `))return null;let t=e.body.match(/--request\s+([A-Z]+)/)?.[1]??null,n=e.body.match(/--url\s+(\S+)/)?.[1]??null,r=Object.fromEntries(Array.from(e.body.matchAll(/--header\s+'([^:]+):\s*([^']+)'/g)).map(e=>[e[1].trim(),e[2].trim()])),i=e.body.match(/--data\s+'([\s\S]*)'$/)?.[1]?.trim()??null,a=i?V(i,r[`content-type`]??r[`Content-Type`]??null):null;return{sourceLabel:e.label,method:t,url:n,headers:r,bodyFormat:a?.format??null,body:a?.body??null,rawBody:i}},ze=e=>{let t=e.body.match(/fetch\(\s*(["'])(.*?)\1\s*,\s*\{([\s\S]*)\}\s*\)/);if(!t)return null;let[,,n,r]=t,i=U(r,`method`)?.toUpperCase()??null,a=Be(r),o=Ve(r),s=a[`content-type`]??a[`Content-Type`]??null,c=o?He(o,s):null;return{sourceLabel:e.label,method:i,url:n,headers:a,bodyFormat:c?.format??null,body:c?.body??null,rawBody:o}},Be=e=>{let t=U(e,`headers`);if(!t)return{};let n=G(t);return I(n)?Object.fromEntries(Object.entries(n).map(([e,t])=>[e,String(t)])):{}},Ve=e=>U(e,`body`),He=(e,t)=>{let n=G(e);return n!==null&&(t?.toLowerCase().includes(`json`)||/^[[{]/.test(e.trim()))?{format:`json`,body:n}:V(e,t)},U=(e,t)=>{let n=e.match(RegExp(`\\b${t}\\s*:`,`m`));if(!n||n.index===void 0)return null;let r=n.index+n[0].length;for(;/\s/.test(e[r]??``);)r+=1;if(e.startsWith(`JSON.stringify`,r)){let t=e.indexOf(`(`,r);return t===-1?null:W(e,t,`(`,`)`)?.slice(1,-1).trim()??null}if(e[r]===`{`||e[r]===`[`){let t=e[r]===`{`?`}`:`]`;return W(e,r,e[r],t)?.trim()??null}return e[r]===`"`||e[r]===`'`?Ue(e,r):(e.slice(r).match(/^([^,\n]+)/)?.[1])?.trim()??null},W=(e,t,n,r)=>{let i=0,a=null,o=!1;for(let s=t;s<e.length;s+=1){let c=e[s];if(a){if(o){o=!1;continue}if(c===`\\`){o=!0;continue}c===a&&(a=null);continue}if(c===`"`||c===`'`){a=c;continue}if(c===n){i+=1;continue}if(c===r&&(--i,i===0))return e.slice(t,s+1)}return null},Ue=(e,t)=>{let n=e[t],r=``,i=!1;for(let a=t+1;a<e.length;a+=1){let t=e[a];if(i){r+=t,i=!1;continue}if(t===`\\`){i=!0;continue}if(t===n)return r;r+=t}return null},G=e=>{let t=Ge(e).trim();if(!/^[[{]/.test(t))return null;let n=We(t.replace(/([{,]\s*)([A-Za-z_$][\w$-]*)(\s*:)/g,`$1"$2"$3`).replace(/,\s*([}\]])/g,`$1`));try{return JSON.parse(n)}catch{return null}},We=e=>{let t=``,n=!1,r=!1,i=!1,a=``;for(let o of e){if(r){if(i){a+=o,i=!1;continue}if(o===`\\`){i=!0;continue}if(o===`'`){t+=JSON.stringify(a),a=``,r=!1;continue}a+=o;continue}if(n){if(t+=o,i){i=!1;continue}if(o===`\\`){i=!0;continue}o===`"`&&(n=!1);continue}if(o===`'`){r=!0,a=``;continue}o===`"`&&(n=!0),t+=o}return t},Ge=e=>{let t=Ke(e);return t=qe(t),t=Je(t),t},Ke=e=>{let t=``,n=!1,r=!1;for(let i=0;i<e.length;i+=1){let a=e[i],o=e[i+1];if(n){if(t+=a,r){r=!1;continue}if(a===`\\`){r=!0;continue}a===`"`&&(n=!1);continue}if(a===`"`){n=!0,t+=a;continue}if(a===`/`&&o===`/`){for(;i<e.length&&e[i]!==`
3
- `;)i+=1;i<e.length&&(t+=e[i]);continue}t+=a}return t},qe=e=>e.replace(/([[{]\s*)([A-Za-z_$][\w$-]*)(\s+)(?=")/g,`$1`),Je=e=>{let t=e.trimStart();return!t.startsWith(`{`)||/"data"\s*:\s*\[/.test(t)||!/^\{\s*"[^"]+"\s*:/.test(t)||!/\]\s*,\s*"meta"\s*:/.test(t)?e:`${e.slice(0,e.indexOf(`{`))}{"data": [{${t.slice(1)}`},K=e=>e.replace(/([#.:[\],=])/g,`\\$1`),q=e=>e?.textContent?.replace(/\s+/g,` `).trim()||null,J=e=>Array.from(e).map(e=>q(e)).filter(e=>!!e),Y=e=>J(e.querySelectorAll(`span, div, code`)).filter(e=>e.trim().length>0).sort((e,t)=>t.length-e.length)[0]??q(e),Ye=(e,t)=>{let n=new URL(t),r=e.sidebarLinks.map(e=>e.href).filter(e=>!!e).map(e=>new URL(e,n).toString()).filter(e=>/^https?:\/\//i.test(e));return Array.from(new Set(r))};var Xe=class{config;constructor(e={}){this.config=v(_(),e)}getConfig(e={}){return{...this.config,...e}}configure(e){return this.config=v(this.config,e),this.config}async crawlReadmeOperations(e,t,n){let i=this.resolveCrawlBaseUrl(e,n);if(!i)throw Error(`Crawl mode requires a remote source URL or --base-url when using a local file`);let a=!!T();a||await j(this.config);try{let e=Ye(t,i),n=new URL(i).toString(),a=this.attachSourceUrl(n,t),o=e.filter(e=>e!==n);return{rootSource:n,discoveredUrls:e,operations:[a,...(await Promise.all(o.map(async e=>{let t=Date.now(),n=L(await this.loadHtmlSource(e)),a=Date.now()-t;return n.method?(r.twoColumnDetail(r.log([[`Crawled`,`green`],[`${a/1e3}s`,`gray`]],` `,!1),e.replace(i,``)),this.attachSourceUrl(e,n)):null}))).filter(e=>e!==null)]}}finally{a||await M()}}attachSourceUrl(e,t){return{sourceUrl:e,...t}}resolveCrawlBaseUrl(e,t){return t?new URL(t).toString():/^https?:\/\//i.test(e)?e:null}async loadHtmlSource(e,t){if(!e)throw Error(`A source path or URL is required`);return/^https?:\/\//i.test(e)?te(e,this.config,t):o(i.resolve(process.cwd(),e),`utf8`)}},Ze=class{renderDeclaration(e){switch(e.kind){case`interface`:return this.renderInterface(e);case`interface-alias`:return`export interface ${e.name} extends ${e.target} {}`;case`type-alias`:return`export type ${e.name} = ${e.target}`;case`shape-alias`:return`export type ${e.name} = ${this.renderShape(e.shape)}`}}renderOpenApiDocumentDefinitions(e,t,n){return[`export interface OpenApiInfo {
1
+ import{JSDOM as e}from"jsdom";import{Window as t}from"happy-dom";import n from"axios";import{Logger as r}from"@h3ravel/shared";import i from"node:path";import a,{readFile as o}from"node:fs/promises";import{Command as s,Kernel as c}from"@h3ravel/musket";import{builtinModules as l,createRequire as u}from"module";import*as d from"url";import f,{fileURLToPath as p,pathToFileURL as m}from"url";import*as h from"path";import g,{dirname as _}from"path";import*as v from"fs/promises";import y from"fs/promises";import b from"process";import x,{ok as S,strictEqual as C}from"assert";import w,{realpathSync as T,statSync as E}from"fs";import D from"v8";import{format as O,inspect as k}from"util";import{execFileSync as A}from"node:child_process";import{pathToFileURL as ee}from"node:url";import{existsSync as j,readdirSync as M}from"node:fs";import{createJiti as N}from"jiti";var te=Object.defineProperty,P=(e,t)=>{let n={};for(var r in e)te(n,r,{get:e[r],enumerable:!0});return t||te(n,Symbol.toStringTag,{value:`Module`}),n};const F={outputFormat:`pretty`,outputShape:`raw`,requestTimeout:5e4,maxRedirects:5,userAgent:`Mozilla/5.0 (X11; Linux x64) AppleWebKit/537.36 (KHTML, like Gecko) OpenApiExtractor/1.0.0`,retryCount:3,retryDelay:1e3,browser:`puppeteer`,happyDom:{enableJavaScriptEvaluation:!0,suppressInsecureJavaScriptEnvironmentWarning:!0},puppeteer:{headless:!0,args:[`--no-sandbox`,`--disable-setuid-sandbox`]}},ne=()=>({...F,happyDom:{...F.happyDom},puppeteer:F.puppeteer?{...F.puppeteer,args:F.puppeteer.args?[...F.puppeteer.args]:void 0}:void 0,sdkKit:F.sdkKit?{...F.sdkKit,urls:F.sdkKit.urls?{...F.sdkKit.urls}:void 0}:void 0,sdk:F.sdk?{...F.sdk,urls:F.sdk.urls?{...F.sdk.urls}:void 0}:void 0}),I=(e,t)=>({...e,...t,happyDom:{...e.happyDom,...t.happyDom},puppeteer:t.puppeteer?{...e.puppeteer??{},...t.puppeteer,args:t.puppeteer.args?[...t.puppeteer.args]:e.puppeteer?.args}:e.puppeteer,sdkKit:t.sdkKit?{...e.sdkKit??{},...t.sdkKit,urls:t.sdkKit.urls?{...e.sdkKit?.urls??{},...t.sdkKit.urls}:e.sdkKit?.urls}:e.sdkKit,sdk:t.sdk?{...e.sdk??{},...t.sdk,urls:t.sdk.urls?{...e.sdk?.urls??{},...t.sdk.urls}:e.sdk?.urls}:e.sdk}),re=[`SIGINT`,`SIGTERM`,`SIGTSTP`],L=[`axios`,`happy-dom`,`jsdom`,`puppeteer`];let R=ne(),z=!1,B=!1;const ie=new Set,V=()=>globalThis.__oapieBrowserSession,H=()=>{!V()&&ie.size===0&&oe()},ae=()=>{if(!B){for(let e of re)process.on(e,U);B=!0}},oe=()=>{if(B){for(let e of re)process.off(e,U);B=!1}},se=e=>(ae(),ie.add(e),()=>{ie.delete(e),H()}),ce=async()=>{let e=Array.from(ie).reverse();ie.clear();for(let t of e)await t();await ue()},U=async e=>{if(!z){z=!0,oe();try{await ce()}catch(e){console.error(`Failed to close active browser resources:`,e)}finally{z=!1}if(e===`SIGTSTP`){process.kill(process.pid,e);return}process.exit(e===`SIGINT`?130:143)}},le=async(e=R)=>{let t=V();if(t?.browser===e.browser)return t;t&&await ue();let n={browser:e.browser,closers:[]};return e.browser===`puppeteer`&&(n.puppeteerBrowser=await(await import(`puppeteer`)).launch({headless:e.puppeteer?.headless??!0,args:e.puppeteer?.args??[`--no-sandbox`,`--disable-setuid-sandbox`]})),ae(),globalThis.__oapieBrowserSession=n,n},ue=async()=>{let e=V();if(e){globalThis.__oapieBrowserSession=void 0;for(let t of e.closers.reverse())await t();e.puppeteerBrowser&&await e.puppeteerBrowser.close(),H()}},de=(e,t)=>{let n=V();return!n||n.browser!==e?!1:(n.closers.push(t),!0)},fe=e=>L.includes(e),pe=async(r,i=R,a=!1)=>{let{data:o}=i.browser===`puppeteer`?{data:``}:await n.get(r,{timeout:i.requestTimeout,maxRedirects:i.maxRedirects,headers:{"User-Agent":i.userAgent,Accept:`text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`}});if(i.browser===`axios`)return o;if(i.browser===`happy-dom`){let e=new t({url:r,innerWidth:1024,innerHeight:768,settings:i.happyDom}),n=se(()=>e.happyDOM.close());try{e.document.write(o),await e.happyDOM.waitUntilComplete();let t=e.document.documentElement.outerHTML;if(!t)throw await e.happyDOM.close(),Error(`Unable to extract HTML from remote source: ${r}`);return de(`happy-dom`,()=>e.happyDOM.close())||await e.happyDOM.close(),t}finally{n()}}else if(i.browser===`jsdom`){let t,n;try{({window:t}=new e(o,{url:r,contentType:`text/html`,runScripts:`dangerously`,includeNodeLocations:!0})),n=se(()=>t?.close());let i=t.document.documentElement.outerHTML;if(!i)throw Error(`Unable to extract HTML from remote source: ${r}`);let a=t;return de(`jsdom`,()=>a.close())||t.close(),t=void 0,i}finally{n?.(),t&&t.close()}}else if(i.browser===`puppeteer`){let e=V(),t=Math.max(i.requestTimeout,3e4),o=e?.browser===`puppeteer`?e.puppeteerBrowser:void 0,s=!1,c,l,u;try{o||(o=await(await import(`puppeteer`)).launch({headless:i.puppeteer?.headless??!0,args:i.puppeteer?.args??[`--no-sandbox`,`--disable-setuid-sandbox`]}),s=!0,l=se(async()=>{o?.connected&&await o.close()})),c=await o.newPage(),u=se(async()=>{c&&!c.isClosed()&&await c.close()}),await c.setUserAgent({userAgent:i.userAgent}),await c.setRequestInterception(!0),c.on(`request`,e=>{let t=e.resourceType();if([`image`,`font`,`media`,`stylesheet`].includes(t))return void e.abort();e.continue()});try{await c.goto(r,{waitUntil:`domcontentloaded`,timeout:t})}catch(e){if(!c||!await ye(c))throw e}let e=await ge(c,t,a);if(!e)throw Error(`Unable to extract HTML from remote source: ${r}`);if(!e.includes(`id="ssr-props"`)){let{data:t}=await n.get(r,{timeout:i.requestTimeout,maxRedirects:i.maxRedirects,headers:{"User-Agent":i.userAgent,Accept:`text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`}});e=be(e,t)}return e}finally{u?.(),c&&!c.isClosed()&&await c.close(),l?.(),s&&o&&await o.close()}}else throw Error(`Unsupported browser specified in configuration: ${R.browser}`)},me=async(e,t,n=!1)=>{try{n&&await e.waitForSelector(`.hub-sidebar-content .rm-Sidebar-link`),await e.waitForSelector(`[data-testid="http-method"], article#content, script#ssr-props`,{timeout:t})}catch{}},he=async(e,t)=>{try{await e.waitForFunction(()=>{let e=!!document.querySelector(`[data-testid="http-method"]`),t=!!document.querySelector(`form[name="Parameters"]`),n=!!document.querySelector(`.rm-PlaygroundRequest`),r=!!document.querySelector(`.rm-PlaygroundResponse`),i=!!document.querySelector(`script#ssr-props`);return e?t||n||r||i:!1},{timeout:t})}catch{}try{await e.waitForSelector(`.rm-PlaygroundRequest, .rm-PlaygroundResponse, form[name="Parameters"], script#ssr-props`,{timeout:Math.min(t,5e3)})}catch{}try{await e.waitForNetworkIdle?.({idleTime:500,timeout:Math.min(t,5e3)})}catch{}},ge=async(e,t,n=!1,r=3)=>{let i;for(let a=1;a<=r;a+=1)try{return await me(e,t,n),await he(e,t),await e.content()}catch(n){if(i=n,!ve(n)||a===r)throw n;await _e(e,t)}throw i instanceof Error?i:Error(`Unable to extract stable HTML from remote source`)},_e=async(e,t)=>{try{await e.waitForFunction(()=>document.readyState===`interactive`||document.readyState===`complete`,{timeout:Math.min(t,5e3)})}catch{}try{await e.waitForNetworkIdle?.({idleTime:500,timeout:Math.min(t,5e3)})}catch{}},ve=e=>{if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return t.includes(`execution context was destroyed`)||t.includes(`cannot find context with specified id`)||t.includes(`most likely because of a navigation`)},ye=async e=>!!await e.$(`[data-testid="http-method"], article#content, script#ssr-props`),be=(e,t)=>{if(e.includes(`id="ssr-props"`))return e;let n=xe(t);return n?e.includes(`</body>`)?e.replace(`</body>`,`${n}</body>`):e.includes(`</html>`)?e.replace(`</html>`,`${n}</html>`):`${e}${n}`:e},xe=e=>e.match(/<script id="ssr-props"[^>]*>[\s\S]*?<\/script>/i)?.[0]??null;var Se=class e{static parsePossiblyTruncated=t=>{let n=new e,r=t.trim();if(!/^(?:\{|\[)/.test(r))return null;try{return JSON.parse(r)}catch{let e=n.repairCommonJsonIssues(r);try{return JSON.parse(e)}catch{return null}}};repairCommonJsonIssues=e=>{let t=this.removeUnexpectedObjectTokens(e),n=this.insertMissingCommas(t);return`${n}${this.buildMissingJsonClosers(n)}`};removeUnexpectedObjectTokens=e=>e.replace(/([[{,]\s*)([A-Za-z_$][\w$-]*)(?=\s*"(?:\\.|[^"\\])*"\s*:)/g,`$1`);insertMissingCommas=e=>{let t=``,n=!1,r=!1,i=``;for(let a=0;a<e.length;a+=1){let o=e[a];if(n){if(t+=o,r){r=!1;continue}if(o===`\\`){r=!0;continue}o===`"`&&(n=!1,i=`"`);continue}if(o===`"`){let r=e.slice(a);/^"(?:\\.|[^"\\])*"\s*:/.test(r)&&this.shouldInsertCommaBeforeKey(i,t)&&(t+=`,`),t+=o,n=!0;continue}t+=o,/\s/.test(o)||(i=o)}return t};shouldInsertCommaBeforeKey=(e,t)=>{if(!e||![`"`,`}`,`]`,`e`,`l`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`].includes(e))return!1;let n=t.trimEnd();return!n.endsWith(`,`)&&!n.endsWith(`{`)};buildMissingJsonClosers=e=>{let t=[],n=!1,r=!1;for(let i of e){if(r){r=!1;continue}if(i===`\\`){r=!0;continue}if(i===`"`){n=!n;continue}if(!n){if(i===`{`){t.push(`}`);continue}if(i===`[`){t.push(`]`);continue}(i===`}`||i===`]`)&&t[t.length-1]===i&&t.pop()}}return t.reverse().join(``)}};const Ce=e=>typeof e==`object`&&!!e&&!Array.isArray(e),we=e=>{let n=new t;n.document.write(e);let{document:r}=n,i=r.querySelector(`article#content`)??r.body,a=i.querySelector(`form[name="Parameters"]`),o=r.querySelector(`.rm-PlaygroundRequest`),s=r.querySelector(`.rm-PlaygroundResponse`),c=Ie(o),l=rt(c[0]??null),u=Le(s);return Te({method:yt(i.querySelector(`[data-testid="http-method"]`))?.toUpperCase()??null,url:yt(i.querySelector(`[data-testid="serverurl"]`)),description:Fe(i),sidebarLinks:Re(r.querySelector(`.rm-Sidebar.hub-sidebar-content`)),requestParams:ze(a),requestCodeSnippets:c,requestExample:c[0]?.body??null,requestExampleNormalized:l,responseSchemas:Be(i),responseBodies:u,responseExample:u[0]?.body??null,responseExampleRaw:u[0]?.rawBody??null},Ee(r))},Te=(e,t)=>t?{method:e.method??t.method,url:e.url??t.url,description:e.description??t.description,sidebarLinks:e.sidebarLinks.length>0?e.sidebarLinks:t.sidebarLinks,requestParams:e.requestParams.length>0?e.requestParams:t.requestParams,requestCodeSnippets:e.requestCodeSnippets.length>0?e.requestCodeSnippets:t.requestCodeSnippets,requestExample:e.requestExample??t.requestExample,requestExampleNormalized:e.requestExampleNormalized??t.requestExampleNormalized,responseSchemas:e.responseSchemas.length>0?e.responseSchemas:t.responseSchemas,responseBodies:e.responseBodies.length>0?e.responseBodies:t.responseBodies,responseExample:e.responseExample??t.responseExample,responseExampleRaw:e.responseExampleRaw??t.responseExampleRaw}:e,Ee=e=>{let t=e.querySelector(`script#ssr-props`)?.textContent?.trim();if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}let r=Ce(n)&&Ce(n.document)?n.document.api:null;if(!Ce(r))return null;let i=typeof r.method==`string`?r.method.toUpperCase():null,a=typeof r.path==`string`?r.path:null,o=Ce(r.schema)?r.schema:null,s=Oe(o,a,i?.toLowerCase()??null),c=Array.isArray(o?.servers)&&Ce(o.servers[0])&&typeof o.servers[0].url==`string`?o.servers[0].url:null;if(!s&&!i&&!a)return null;let l=Ne(s?.responses??{});return{method:i,url:ke(c,a),description:s?.description??null,sidebarLinks:[],requestParams:[...De(s?.parameters),...Ae(s?.requestBody)],requestCodeSnippets:[],requestExample:null,requestExampleNormalized:null,responseSchemas:Me(s?.responses??{}),responseBodies:l,responseExample:l[0]?.body??null,responseExampleRaw:l[0]?.rawBody??null}},De=e=>e?e.map(e=>({name:e.name,in:e.in,path:[e.name],type:e.schema?.type??null,required:e.required??!1,defaultValue:e.schema?.default==null?e.example==null?null:String(e.example):String(e.schema.default),description:e.description??e.schema?.description??null})):[],Oe=(e,t,n)=>{if(!e||!t||!n||!Ce(e.paths))return null;let r=e.paths[t];return!Ce(r)||!Ce(r[n])?null:r[n]},ke=(e,t)=>!e||!t?null:`${e.replace(/\/$/,``)}${t.startsWith(`/`)?t:`/${t}`}`,Ae=e=>{let t=e?.content?.[`application/json`]?.schema;return t?je(t):[]},je=(e,t=[])=>{if(!e.properties)return[];let n=[];for(let[r,i]of Object.entries(e.properties)){let a=[...t,r],o=e.required?.includes(r)??!1;if(i.type===`object`&&i.properties){n.push(...je(i,a).map(e=>({...e,required:e.path.length===a.length+1?o&&e.required:e.required})));continue}n.push({name:r,in:`body`,path:a,type:i.type??null,required:o,defaultValue:i.default==null?null:String(i.default),description:i.description??null})}return n},Me=e=>Object.entries(e).map(([e,t])=>({statusCode:e,description:t.description??e})),Ne=e=>{let t=[];for(let[n,r]of Object.entries(e))for(let[e,i]of Object.entries(r.content??{})){let a=Pe(i);if(a==null)continue;let o=typeof a==`string`?a:JSON.stringify(a,null,2),s=nt(o,e);t.push({format:s.format,contentType:e,statusCode:n,label:r.description??n,body:s.body,rawBody:o})}return t},Pe=e=>{if(e.example!==void 0)return e.example;let t=e.examples;if(t&&Ce(t)){for(let e of Object.values(t))if(Ce(e)&&`value`in e)return e.value??null}return e.schema?.example===void 0?null:e.schema.example},Fe=e=>{let t=e.querySelector(`header`);if(!t)return null;let n=Array.from(t.querySelectorAll(`[data-testid="RDMD"]`));return yt(n[n.length-1]??null)},Ie=e=>{if(!e)return[];let t=Ue(e);return Ve(e).map(e=>({label:t,body:e}))},Le=e=>{if(!e)return[];let t=Ve(e),n=Ke(e),r=qe(e);return t.map((e,t)=>{let i=r[t]??r[0]??null,a=n[t]??n[0]??null,o=nt(e,a);return{format:o.format,contentType:a,statusCode:i?.match(/\b\d{3}\b/)?.[0]??null,label:i,body:o.body,rawBody:e}})},Re=e=>e?Array.from(e.querySelectorAll(`.rm-Sidebar-link`)).map(e=>{let t=e.closest(`.rm-Sidebar-section`),n=yt(e.querySelector(`[data-testid="http-method"]`))?.toUpperCase()??null;return{section:yt(t?.querySelector(`.rm-Sidebar-heading`)??null),label:Ge(e,n),href:e.getAttribute(`href`),method:n,active:e.classList.contains(`active`)||e.getAttribute(`aria-current`)===`page`,subpage:e.classList.contains(`subpage`)}}).filter(e=>e.label.length>0):[],ze=e=>e?Array.from(e.querySelectorAll(`label`)).map(t=>{let n=yt(t),r=Je(t,e),i=Ye(r,t);return{name:n??``,in:Xe(r,t,e),path:Qe(t,n),type:$e(r,i),required:et(r,i),defaultValue:We(i),description:tt(r)}}).filter(e=>e.name.length>0):[],Be=e=>{let t=e.querySelector(`#response-schemas`)?.nextElementSibling;return!t||!t.classList.contains(`rm-APIResponseSchemaPicker`)?[]:Array.from(t.querySelectorAll(`button`)).map(e=>{let t=yt(e),n=t?.match(/\b\d{3}\b/),r=Array.from(e.querySelectorAll(`[data-testid="RDMD"]`));return{statusCode:n?.[0]??null,description:yt(r[0]??null)??t}}).filter(e=>e.statusCode!==null)},Ve=e=>Array.from(e.querySelectorAll(`.CodeSnippet`)).map(e=>He(e)).filter(e=>!!e),He=e=>{if(!e)return null;let t=Array.from(e.querySelectorAll(`.CodeMirror-code pre.CodeMirror-line`));return t.length===0?null:t.map(e=>e.textContent?.replace(/\u00a0/g,` `)??``).join(`
2
+ `).trimEnd()||null},Ue=e=>{let t=e.querySelector(`header`);if(!t)return null;let n=Array.from(t.querySelectorAll(`button`)).map(e=>xt(e)).filter(e=>!!e);return n.find(e=>e.toLowerCase()!==`examples`)??n[0]??null},We=e=>e&&e.getAttribute(`value`)?.trim()||null,Ge=(e,t)=>bt(e.querySelectorAll(`span`)).filter(e=>!t||e.toUpperCase()!==t).sort((e,t)=>t.length-e.length)[0]??yt(e)??``,Ke=e=>bt(e.querySelectorAll(`div`)).filter(e=>/^[\w.+-]+\/[\w.+-]+$/i.test(e)),qe=e=>Array.from(e.querySelectorAll(`button, [role="button"]`)).map(e=>xt(e)).filter(e=>!!e).filter(e=>/\b\d{3}\b/.test(e)),Je=(e,t)=>{let n=e.getAttribute(`for`),r=e;for(;r;){let e=n?r.querySelector(`#${vt(n)}`):null,i=r.querySelector(`input, textarea, select`);if((e||i)&&r!==t)return r;r=r.parentElement}return e},Ye=(e,t)=>{let n=t.getAttribute(`for`),r=n?e.querySelector(`#${vt(n)}`):null,i=e.querySelector(`input, textarea, select`);return r??i},Xe=(e,t,n)=>{let r=Ze(`${t.getAttribute(`for`)?.toLowerCase()??``} ${e.closest(`[id]`)?.getAttribute(`id`)?.toLowerCase()??``}`);if(r)return r;let i=e;for(;i&&i!==n;){let e=i.previousElementSibling;for(;e;){if(e.tagName===`HEADER`){let t=Ze(yt(e)??``);if(t)return t}e=e.previousElementSibling}i=i.parentElement}return null},Ze=e=>{let t=e.trim().toLowerCase();return t.includes(`query params`)||t.includes(`query-`)?`query`:t.includes(`headers`)||t.includes(`header-`)?`header`:t.includes(`body params`)||t.includes(`request body`)||t.includes(`body-`)?`body`:t.includes(`path params`)||t.includes(`path-`)?`path`:t.includes(`cookie`)||t.includes(`cookie-`)?`cookie`:null},Qe=(e,t)=>{let n=e.getAttribute(`for`)??``,r=n.includes(`_`)?n.slice(n.indexOf(`_`)+1):``;return r.includes(`.`)?r.split(`.`).map(e=>e.trim()).filter(e=>e.length>0):t?[t]:[]},$e=(e,t)=>{let n=t?.getAttribute(`type`)?.toLowerCase();if(n===`text`)return`string`;if(n)return n;let r=Array.from(e.querySelectorAll(`[class]`)).find(e=>(e.getAttribute(`class`)??``).split(/\s+/).some(e=>e.startsWith(`field-`)))?.getAttribute(`class`)?.split(/\s+/).find(e=>e.startsWith(`field-`));return r?r.replace(/^field-/,``):null},et=(e,t)=>t?.hasAttribute(`required`)?!0:bt(e.querySelectorAll(`*`)).some(e=>e.toLowerCase()===`required`),tt=e=>yt(e.querySelector(`[id$="__description"]`)||(Array.from(e.querySelectorAll(`[data-testid="RDMD"]`))[0]??null)),nt=(e,t)=>{let n=e.trim();if(t?.toLowerCase().includes(`json`)||/^(?:\{|\[)/.test(n)){let t=Se.parsePossiblyTruncated(n);if(t!==null)return{format:`json`,body:t};let r=ft(n);return r===null?{format:`text`,body:e}:{format:`json`,body:r}}return{format:`text`,body:e}},rt=e=>e?it(e)??at(e)??{sourceLabel:e.label,method:null,url:null,headers:{},bodyFormat:null,body:null,rawBody:null}:null,it=e=>{if(!e.body.startsWith(`curl `))return null;let t=e.body.match(/--request\s+([A-Z]+)/)?.[1]??null,n=e.body.match(/--url\s+(\S+)/)?.[1]??null,r=Object.fromEntries(Array.from(e.body.matchAll(/--header\s+'([^:]+):\s*([^']+)'/g)).map(e=>[e[1].trim(),e[2].trim()])),i=e.body.match(/--data\s+'([\s\S]*)'$/)?.[1]?.trim()??null,a=i?nt(i,r[`content-type`]??r[`Content-Type`]??null):null;return{sourceLabel:e.label,method:t,url:n,headers:r,bodyFormat:a?.format??null,body:a?.body??null,rawBody:i}},at=e=>{let t=e.body.match(/fetch\(\s*(["'])(.*?)\1\s*,\s*\{([\s\S]*)\}\s*\)/);if(!t)return null;let[,,n,r]=t,i=lt(r,`method`)?.toUpperCase()??null,a=ot(r),o=st(r),s=a[`content-type`]??a[`Content-Type`]??null,c=o?ct(o,s):null;return{sourceLabel:e.label,method:i,url:n,headers:a,bodyFormat:c?.format??null,body:c?.body??null,rawBody:o}},ot=e=>{let t=lt(e,`headers`);if(!t)return{};let n=ft(t);return Ce(n)?Object.fromEntries(Object.entries(n).map(([e,t])=>[e,String(t)])):{}},st=e=>lt(e,`body`),ct=(e,t)=>{let n=ft(e);return n!==null&&(t?.toLowerCase().includes(`json`)||/^[[{]/.test(e.trim()))?{format:`json`,body:n}:nt(e,t)},lt=(e,t)=>{let n=e.match(RegExp(`\\b${t}\\s*:`,`m`));if(!n||n.index===void 0)return null;let r=n.index+n[0].length;for(;/\s/.test(e[r]??``);)r+=1;if(e.startsWith(`JSON.stringify`,r)){let t=e.indexOf(`(`,r);return t===-1?null:ut(e,t,`(`,`)`)?.slice(1,-1).trim()??null}if(e[r]===`{`||e[r]===`[`){let t=e[r]===`{`?`}`:`]`;return ut(e,r,e[r],t)?.trim()??null}return e[r]===`"`||e[r]===`'`?dt(e,r):(e.slice(r).match(/^([^,\n]+)/)?.[1])?.trim()??null},ut=(e,t,n,r)=>{let i=0,a=null,o=!1;for(let s=t;s<e.length;s+=1){let c=e[s];if(a){if(o){o=!1;continue}if(c===`\\`){o=!0;continue}c===a&&(a=null);continue}if(c===`"`||c===`'`){a=c;continue}if(c===n){i+=1;continue}if(c===r&&(--i,i===0))return e.slice(t,s+1)}return null},dt=(e,t)=>{let n=e[t],r=``,i=!1;for(let a=t+1;a<e.length;a+=1){let t=e[a];if(i){r+=t,i=!1;continue}if(t===`\\`){i=!0;continue}if(t===n)return r;r+=t}return null},ft=e=>{let t=mt(e).trim();if(!/^[[{]/.test(t))return null;let n=pt(t.replace(/([{,]\s*)([A-Za-z_$][\w$-]*)(\s*:)/g,`$1"$2"$3`).replace(/,\s*([}\]])/g,`$1`));try{return JSON.parse(n)}catch{return null}},pt=e=>{let t=``,n=!1,r=!1,i=!1,a=``;for(let o of e){if(r){if(i){a+=o,i=!1;continue}if(o===`\\`){i=!0;continue}if(o===`'`){t+=JSON.stringify(a),a=``,r=!1;continue}a+=o;continue}if(n){if(t+=o,i){i=!1;continue}if(o===`\\`){i=!0;continue}o===`"`&&(n=!1);continue}if(o===`'`){r=!0,a=``;continue}o===`"`&&(n=!0),t+=o}return t},mt=e=>{let t=ht(e);return t=gt(t),t=_t(t),t},ht=e=>{let t=``,n=!1,r=!1;for(let i=0;i<e.length;i+=1){let a=e[i],o=e[i+1];if(n){if(t+=a,r){r=!1;continue}if(a===`\\`){r=!0;continue}a===`"`&&(n=!1);continue}if(a===`"`){n=!0,t+=a;continue}if(a===`/`&&o===`/`){for(;i<e.length&&e[i]!==`
3
+ `;)i+=1;i<e.length&&(t+=e[i]);continue}t+=a}return t},gt=e=>e.replace(/([[{]\s*)([A-Za-z_$][\w$-]*)(\s+)(?=")/g,`$1`),_t=e=>{let t=e.trimStart();return!t.startsWith(`{`)||/"data"\s*:\s*\[/.test(t)||!/^\{\s*"[^"]+"\s*:/.test(t)||!/\]\s*,\s*"meta"\s*:/.test(t)?e:`${e.slice(0,e.indexOf(`{`))}{"data": [{${t.slice(1)}`},vt=e=>e.replace(/([#.:[\],=])/g,`\\$1`),yt=e=>e?.textContent?.replace(/\s+/g,` `).trim()||null,bt=e=>Array.from(e).map(e=>yt(e)).filter(e=>!!e),xt=e=>bt(e.querySelectorAll(`span, div, code`)).filter(e=>e.trim().length>0).sort((e,t)=>t.length-e.length)[0]??yt(e),St=(e,t)=>{let n=new URL(t),r=e.sidebarLinks.map(e=>e.href).filter(e=>!!e).map(e=>new URL(e,n).toString()).filter(e=>/^https?:\/\//i.test(e));return Array.from(new Set(r))};var Ct=class{config;constructor(e={}){this.config=I(ne(),e)}getConfig(e={}){return{...this.config,...e}}configure(e){return this.config=I(this.config,e),this.config}async crawlReadmeOperations(e,t,n){let i=this.resolveCrawlBaseUrl(e,n);if(!i)throw Error(`Crawl mode requires a remote source URL or --base-url when using a local file`);let a=!!V();a||await le(this.config);try{let e=St(t,i),n=new URL(i).toString(),a=this.attachSourceUrl(n,t),o=e.filter(e=>e!==n);return{rootSource:n,discoveredUrls:e,operations:[a,...(await Promise.all(o.map(async e=>{let t=Date.now(),n=we(await this.loadHtmlSource(e)),a=Date.now()-t;return n.method?(r.twoColumnDetail(r.log([[`Crawled`,`green`],[`${a/1e3}s`,`gray`]],` `,!1),e.replace(i,``)),this.attachSourceUrl(e,n)):null}))).filter(e=>e!==null)]}}finally{a||await ue()}}attachSourceUrl(e,t){return{sourceUrl:e,...t}}resolveCrawlBaseUrl(e,t){return t?new URL(t).toString():/^https?:\/\//i.test(e)?e:null}async loadHtmlSource(e,t){if(!e)throw Error(`A source path or URL is required`);return/^https?:\/\//i.test(e)?pe(e,this.config,t):o(i.resolve(process.cwd(),e),`utf8`)}},wt=class{renderDeclaration(e){switch(e.kind){case`interface`:return this.renderInterface(e);case`interface-alias`:return`export interface ${e.name} extends ${e.target} {}`;case`type-alias`:return`export type ${e.name} = ${e.target}`;case`shape-alias`:return`export type ${e.name} = ${this.renderShape(e.shape)}`}}renderOpenApiDocumentDefinitions(e,t,n){return[`export interface OpenApiInfo {
4
4
  title: string
5
5
  version: string
6
6
  }`,`export interface OpenApiSchemaDefinition {
@@ -136,7 +136,7 @@ import{JSDOM as e}from"jsdom";import{Window as t}from"happy-dom";import n from"a
136
136
  `)}renderValue(e){return this.renderLiteral(e,0)}renderOpenApiDocumentValue(e){return this.renderLiteral(this.normalizeOpenApiDocument(e),0)}toCamelCase(e){let t=this.sanitizeTypeName(e);return t.charAt(0).toLowerCase()+t.slice(1)}renderInterface(e){let t=e.properties.map(e=>` ${this.formatPropertyKey(e.key)}${e.optional?`?`:``}: ${this.renderShape(e.shape)}`).join(`
137
137
  `);return`export interface ${e.name} {\n${t}\n}`}renderShape(e){switch(e.kind){case`primitive`:return e.type;case`array`:return`${this.wrapUnion(this.renderShape(e.item))}[]`;case`union`:return e.types.map(e=>this.renderShape(e)).join(` | `);case`object`:return this.inlineObjectShape(e)}}inlineObjectShape(e){return e.properties.length===0?`Record<string, never>`:`{ ${e.properties.map(e=>`${this.formatPropertyKey(e.key)}${e.optional?`?`:``}: ${this.renderShape(e.shape)}`).join(`; `)} }`}wrapUnion(e){return e.includes(` | `)?`(${e})`:e}derivePathTypeName(e){let t=e.split(`/`).map(e=>e.trim()).filter(Boolean).filter(e=>!/^v\d+$/i.test(e)).map(e=>this.isPathParam(e)?`by ${this.stripPathParam(e)}`:e);return`${this.sanitizeTypeName(t.join(` `))}Path`}deriveOperationInterfaceName(e,t){return`${this.derivePathTypeName(e)}${this.sanitizeTypeName(t)}Operation`}sanitizeTypeName(e){let t=e.replace(/[^A-Za-z0-9]+/g,` `).trim();if(!t)return`GeneratedEntity`;let n=t.split(/\s+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``);return/^[A-Za-z_$]/.test(n)?n:`Type${n}`}formatPropertyKey(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)?e:`'${this.escapeStringLiteral(e)}'`}renderSdkMethodSignature(e){let t=[];return e.pathParams.length>0&&t.push(`(params: ${e.paramsType}`),e.queryParams.length>0&&t.push(`${t.length===0?`(`:`, `}query: ${e.queryType}`),e.hasBody&&t.push(`${t.length===0?`(`:`, `}body${e.bodyRequired?``:`?`}: ${e.inputType}`),e.headerParams.length>0&&t.push(`${t.length===0?`(`:`, `}headers?: ${e.headerType}`),t.length===0?`(): Promise<${e.responseType}>`:`${t.join(``)}): Promise<${e.responseType}>`}renderLiteral(e,t){if(e===null)return`null`;if(typeof e==`string`)return`'${this.escapeStringLiteral(e)}'`;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(Array.isArray(e)){if(e.length===0)return`[]`;let n=this.indent(t+1),r=this.indent(t);return`[\n${e.map(e=>`${n}${this.renderLiteral(e,t+1)}`).join(`,
138
138
  `)}\n${r}]`}if(typeof e==`object`){let n=Object.entries(e);if(n.length===0)return`{}`;let r=this.indent(t+1),i=this.indent(t);return`{\n${n.map(([e,n])=>`${r}${this.formatPropertyKey(e)}: ${this.renderLiteral(n,t+1)}`).join(`,
139
- `)}\n${i}}`}return`undefined`}normalizeOpenApiDocument(e){return this.normalizeObject(e,(e,t,n)=>{if(e===`example`&&n&&typeof n==`object`&&!Array.isArray(n)){let e=n;if(e.schema&&this.isPlainObject(e.schema))return this.normalizeExample(t,e.schema);if(this.isSchemaLike(e))return this.normalizeExample(t,e)}return t})}normalizeObject(e,t){if(Array.isArray(e))return e.map(e=>this.normalizeObject(e,t)).filter(e=>e!==void 0);if(!this.isPlainObject(e))return e;let n={};for(let[r,i]of Object.entries(e)){let a=t(r,i,e),o=this.normalizeObject(a,t);o!==void 0&&(n[r]=o)}return n}normalizeExample(e,t){if(e===void 0)return;let n=typeof t.type==`string`?t.type:void 0;if(n===`string`)return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):void 0;if(n===`number`||n===`integer`)return typeof e==`number`?e:typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e))?Number(e):void 0;if(n===`boolean`)return typeof e==`boolean`?e:e===`true`?!0:e===`false`?!1:void 0;if(n===`array`){if(!Array.isArray(e))return;let n=this.isPlainObject(t.items)?t.items:void 0;return n?e.map(e=>this.normalizeExample(e,n)).filter(e=>e!==void 0):e}if(n===`object`){if(!this.isPlainObject(e))return;let n=this.isPlainObject(t.properties)?t.properties:{},r=Array.isArray(t.required)?t.required.filter(e=>typeof e==`string`):[],i={};for(let[t,r]of Object.entries(e)){let e=n[t],a=e?this.normalizeExample(r,e):r;a!==void 0&&(i[t]=a)}for(let e of r){if(e in i)continue;let t=n[e];if(!t)return;let r=t.default===void 0?t.example===void 0?void 0:this.normalizeExample(t.example,t):this.normalizeExample(t.default,t);if(r===void 0)return;i[e]=r}return i}return e}isPlainObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}isSchemaLike(e){return`type`in e||`properties`in e||`items`in e||`required`in e||`default`in e}indent(e){return` `.repeat(e)}escapeStringLiteral(e){return e.replace(/\\/g,String.raw`\\`).replace(/'/g,String.raw`\'`).replace(/\r/g,String.raw`\r`).replace(/\n/g,String.raw`\n`).replace(/\t/g,String.raw`\t`).replace(/\f/g,String.raw`\f`).replace(/\x08/g,String.raw`\b`).replace(/\u2028/g,String.raw`\u2028`).replace(/\u2029/g,String.raw`\u2029`)}isPathParam(e){return e.startsWith(`{`)&&e.endsWith(`}`)||/^:[A-Za-z0-9_]+$/.test(e)}stripPathParam(e){return e.replace(/^\{/,``).replace(/\}$/,``).replace(/^:/,``)}},Qe=class e{static contextualTailSegments=new Set([`history`,`status`,`detail`,`details`]);static irregularSingulars=new Map([[`analyses`,`analysis`],[`diagnoses`,`diagnosis`],[`parentheses`,`parenthesis`],[`statuses`,`status`],[`synopses`,`synopsis`],[`theses`,`thesis`]]);static invariantSingulars=new Set([`analysis`,`diagnosis`,`news`,`series`,`species`,`status`,`synopsis`,`thesis`]);static nestedContextSegments=new Set([`account`,`accounts`,`transaction`,`transactions`,`wallet`,`wallets`,`virtual-account`,`virtual-accounts`,`history`]);static roleSuffixes=[`Input`,`Query`,`Header`,`Params`];sanitizeTypeName(e){let t=e.replace(/[^A-Za-z0-9]+/g,` `).trim();if(!t)return`GeneratedEntity`;let n=t.split(/\s+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``);return/^[A-Za-z_$]/.test(n)?n:`Type${n}`}isPathParam(e){return e.startsWith(`{`)&&e.endsWith(`}`)||/^:[A-Za-z0-9_]+$/.test(e)}stripPathParam(e){return e.replace(/^\{/,``).replace(/\}$/,``).replace(/^:/,``)}singularize(t){let n=t.toLowerCase();return e.irregularSingulars.has(n)?e.irregularSingulars.get(n)??t:e.invariantSingulars.has(n)?t:/ies$/i.test(t)?`${t.slice(0,-3)}y`:/(sses|shes|ches|xes|zes)$/i.test(t)||/uses$/i.test(t)?t.slice(0,-2):t.endsWith(`s`)&&!t.endsWith(`ss`)&&t.length>1?t.slice(0,-1):t}pluralize(e){return/y$/i.test(e)?`${e.slice(0,-1)}ies`:/s$/i.test(e)?e:`${e}s`}toCamelCase(e){let t=this.sanitizeTypeName(e);return t.charAt(0).toLowerCase()+t.slice(1)}deriveOperationNaming(t){let n=this.getNormalizedPathSegments(t),r=n.filter(e=>!this.isPathParam(e)).map(e=>this.singularize(e)),i=n.filter(e=>this.isPathParam(e)).map(e=>this.singularize(this.stripPathParam(e))),a=r[r.length-1]??`resource`,o=r[r.length-2]??null,s=n.slice(0,-1).some(e=>this.isPathParam(e)),c=!!(o&&(e.contextualTailSegments.has(a.toLowerCase())||s&&e.nestedContextSegments.has(a.toLowerCase())));return{baseName:this.sanitizeTypeName(c?`${o} ${a}`:a),collisionSuffix:i.length>0?`By ${i.map(e=>this.sanitizeTypeName(e)).join(` And `)}`:o&&!c?this.sanitizeTypeName(o):``}}fallbackCollisionSuffix(e,t,n){let r=this.getNormalizedPathSegments(t),i=r.filter(e=>!this.isPathParam(e)),a=i[i.length-1]??``,o=r.some(e=>this.isPathParam(e));return e===`get`&&!o&&/s$/i.test(a)?`List`:e===`post`&&!o?`Create`:(e===`put`||e===`patch`)&&o?`Update`:e===`delete`?`Delete`:`${this.sanitizeTypeName(e)}${n}`}insertCollisionSuffix(t,n){if(!n)return t;for(let r of e.roleSuffixes)if(t.endsWith(r)&&t.length>r.length)return`${t.slice(0,-r.length)}${n}${r}`;return`${t}${n}`}deriveSdkGroupNamesBySignature(e,t){let n=new Map;for(let t of Object.keys(e.paths)){let e=this.getStaticPathSignature(t);n.has(e)||n.set(e,t)}let r=Array.from(n.entries()).map(([e,n])=>({signature:e,staticSegments:e.split(`/`).filter(Boolean),candidates:this.buildSdkGroupNameCandidates(n,t)})).sort((e,t)=>e.staticSegments.length-t.staticSegments.length||e.signature.localeCompare(t.signature)),i=new Map,a=new Set;for(let e of r){let t=e.candidates.find(e=>!a.has(e))??this.createUniqueSdkGroupName(e.candidates[e.candidates.length-1]??`Resource`,a);a.add(t),i.set(e.signature,t)}return i}getStaticPathSegments(e){return this.getNormalizedPathSegments(e).filter(e=>!this.isPathParam(e)).map(e=>this.singularize(e))}getStaticPathSignature(e){return this.getStaticPathSegments(e).join(`/`)}getNormalizedPathSegments(e){return e.split(`/`).map(e=>e.trim()).filter(Boolean).filter(e=>!/^v\d+$/i.test(e))}deriveSdkMethodName(e,t,n,r){if(r===`operation-id`&&n.operationId)return this.toCamelCase(this.sanitizeTypeName(n.operationId));let i=this.getNormalizedPathSegments(t).some(e=>this.isPathParam(e));return e===`get`?this.endsWithPluralStaticSegment(t)?`list`:i?`get`:`list`:e===`post`?`create`:e===`patch`||e===`put`?`update`:e===`delete`?`delete`:this.toCamelCase(this.sanitizeTypeName(e))}ensureUniqueSdkMethodNames(e){let t=new Map;return e.map(e=>{let n=t.get(e.methodName)??0;if(t.set(e.methodName,n+1),n===0)return e;let r=this.sanitizeTypeName(this.fallbackCollisionSuffix(e.method.toLowerCase(),e.path,`Operation`));return{...e,methodName:`${e.methodName}${r}`}})}createSdkParameterManifest(e,t,n){return[...(e??[]).filter(e=>e.in===t).sort((e,t)=>e.name.localeCompare(t.name)),...this.getInferredPathParameters(n,t,(e??[]).filter(e=>e.in===t))].sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({name:e.name,accessor:this.toParameterAccessor(e.name),in:t,required:e.required??!1,description:e.description}))}getInferredPathParameters(e,t,n){if(t!==`path`||!e)return[];let r=new Set(n.map(e=>e.name));return this.getNormalizedPathSegments(e).filter(e=>this.isPathParam(e)).map(e=>this.stripPathParam(e)).filter(e=>!r.has(e)).map(e=>({name:e,in:`path`,required:!0,schema:{type:`string`}}))}buildSdkGroupNameCandidates(e,t){let n=this.getNormalizedPathSegments(e),r=n.filter(e=>!this.isPathParam(e)),i=r.map(e=>this.singularize(e)),a=this.deriveOperationNaming(e).baseName,o=this.getPreferredSdkGroupName(n,r,i),s=i.map((e,t,n)=>this.sanitizeTypeName(n.slice(t).join(` `))).reverse();return t===`scoped`?Array.from(new Set([o??``,this.sanitizeTypeName(i.join(` `)),...s,a].filter(Boolean))):Array.from(new Set([o??``,a,...s].filter(Boolean)))}getPreferredSdkGroupName(e,t,n){let r=t[t.length-1],i=n[n.length-1],a=n[n.length-2],o=e.some(e=>this.isPathParam(e)),s=e.slice(0,-1).some(e=>this.isPathParam(e));return!r||!i||!a?null:t.length===2&&!o?this.sanitizeTypeName(`${i} ${a}`):s?this.singularize(r)===r?this.sanitizeTypeName(`${i} ${a}`):this.sanitizeTypeName(`${a} ${i}`):null}createUniqueSdkGroupName(e,t){let n=2,r=e;for(;t.has(r);)r=`${e}${n}`,n+=1;return r}endsWithPluralStaticSegment(e){let t=this.getNormalizedPathSegments(e).at(-1);return!t||this.isPathParam(t)?!1:this.singularize(t)!==t}toParameterAccessor(e){let t=e.replace(/[^A-Za-z0-9]+/g,` `).trim();if(!t)return`value`;let[n,...r]=t.split(/\s+/).filter(Boolean),i=[n.toLowerCase(),...r.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())].join(``);return/^[A-Za-z_$]/.test(i)?i:`value${i}`}},$e=class{constructor(e){this.naming=e}createContext(){return{declarations:[],declarationByName:new Map,nameBySignature:new Map,usedNames:new Set}}namespaceTopLevelShape(e,t){return e.kind===`object`?{...e,signature:`${t}:${e.signature}`}:e}inferShapeFromExample(e,t){if(e===null)return{kind:`primitive`,type:`null`};if(Array.isArray(e)){if(e.length===0)return{kind:`array`,item:{kind:`primitive`,type:`unknown`}};let n=this.dedupeShapes(e.map(e=>this.inferShapeFromExample(e,this.naming.singularize(t))));return{kind:`array`,item:n.length===1?n[0]:{kind:`union`,types:n}}}if(this.isRecord(e))return this.createObjectShape(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({key:e,optional:!1,shape:this.inferShapeFromExample(t,e)})));switch(typeof e){case`string`:return{kind:`primitive`,type:`string`};case`number`:return{kind:`primitive`,type:`number`};case`boolean`:return{kind:`primitive`,type:`boolean`};default:return{kind:`primitive`,type:`unknown`}}}registerNamedShape(e,t,n,r){if(e.kind===`object`)return this.registerObjectShape(e,t,n,r,!0);let i=this.createUniqueTypeName(t,n,r),a={kind:`shape-alias`,name:i,shape:this.prepareNestedShape(e,t,n)};return n.declarations.push(a),n.declarationByName.set(i,a),i}registerObjectShape(e,t,n,r,i=!1){let a=n.nameBySignature.get(e.signature),o=this.findCompatibleObjectDeclaration(e,t,n);if(a){if(i&&a!==t&&!n.declarationByName.has(t)){let e=this.createUniqueTypeName(t,n,r);if(e!==a){let t={kind:`interface-alias`,name:e,target:a};n.declarations.push(t),n.declarationByName.set(e,t)}}return a}if(o){if(this.isObjectShapeAssignableTo(e,o.rawShape))return n.nameBySignature.set(e.signature,o.name),o.name;let t=this.mergeObjectShapes(o.rawShape,e);return o.rawShape=t,o.properties=t.properties.map(e=>({...e,shape:this.prepareNestedShape(e.shape,e.key,n)})),n.nameBySignature.set(e.signature,o.name),n.nameBySignature.set(t.signature,o.name),o.name}let s=this.createUniqueTypeName(t,n,r),c={kind:`interface`,name:s,baseName:this.naming.sanitizeTypeName(t),rawShape:e,properties:[]};return n.nameBySignature.set(e.signature,s),n.declarations.push(c),n.declarationByName.set(s,c),c.properties=e.properties.map(e=>({...e,shape:this.prepareNestedShape(e.shape,e.key,n)})),s}resolveSdkResponseType(e,t){let n=Object.entries(e).filter(([e])=>/^2\d\d$/.test(e)).sort(([e],[t])=>e.localeCompare(t))[0]?.[1];if(!n)return t;let r=this.getPreferredMediaType(n.content);if(!r)return t;let i=this.resolveResponsePayloadSchema(r.schema,r.example).schema??r.schema;return i&&this.resolveSchemaType(i)===`array`?`${t}[]`:t}getSuccessResponseShape(e){let t=Object.entries(e).filter(([e])=>/^2\d\d$/.test(e)).sort(([e],[t])=>e.localeCompare(t))[0]?.[1];if(!t)return this.emptyObjectShape;let n=this.getPreferredMediaType(t.content);if(!n)return this.emptyObjectShape;let r=this.resolveResponsePayloadSchema(n.schema,n.example);return r.schema?this.resolveSchemaType(r.schema)===`array`?this.schemaToShape(r.schema.items,`Item`,this.extractExampleArrayItem(r.example)):this.schemaToShape(r.schema,`Response`,r.example):this.schemaToShape(n.schema,`Response`,n.example)}getRequestInputShape(e){if(!e)return this.emptyObjectShape;let t=this.getPreferredMediaType(e.content);return t?this.schemaToShape(t.schema,`Input`,t.example):this.emptyObjectShape}getResponseExampleShape(e){let t=Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).flatMap(([,e])=>{let t=this.getPreferredMediaType(e.content);if(!t)return[];let n=t.example??t.schema?.example;return t.schema?[this.schemaToShape(t.schema,`ResponseExample`,n)]:n===void 0?[]:[this.inferShapeFromExample(n,`ResponseExample`)]}),n=this.dedupeShapes(t);return n.length===0?{kind:`primitive`,type:`unknown`}:n.length===1?n[0]:{kind:`union`,types:n}}createParameterGroupShape(e,t,n){let r=(e??[]).filter(e=>e.in===t).sort((e,t)=>e.name.localeCompare(t.name)),i=[...r,...this.naming.getInferredPathParameters(n,t,r)].sort((e,t)=>e.name.localeCompare(t.name));return i.length===0?this.emptyObjectShape:this.createObjectShape(i.map(e=>({key:e.name,optional:!(e.required??!1),shape:this.schemaToShape(e.schema,e.name,e.example)})))}get emptyObjectShape(){return this.createObjectShape([])}findCompatibleObjectDeclaration(e,t,n){let r=this.naming.sanitizeTypeName(t);return n.declarations.find(t=>t.kind!==`interface`||t.baseName!==r?!1:this.isObjectShapeAssignableTo(e,t.rawShape)||this.isObjectShapeAssignableTo(t.rawShape,e)||this.canMergeObjectShapes(t.rawShape,e))}canMergeObjectShapes(e,t){let n=new Set([...e.properties.map(e=>e.key),...t.properties.map(e=>e.key)]);for(let r of n){let n=e.properties.find(e=>e.key===r),i=t.properties.find(e=>e.key===r);if(!n||!i){if(!(n??i)?.optional)return!1;continue}if(!this.canMergeShapes(n.shape,i.shape))return!1}return!0}isObjectShapeAssignableTo(e,t){let n=new Map(t.properties.map(e=>[e.key,e]));for(let t of e.properties){let e=n.get(t.key);if(!e||t.optional&&!e.optional||!this.isShapeAssignableTo(t.shape,e.shape))return!1}return t.properties.every(t=>e.properties.some(e=>e.key===t.key)||t.optional)}isShapeAssignableTo(e,t){if(t.kind===`union`)return t.types.some(t=>this.isShapeAssignableTo(e,t));switch(e.kind){case`primitive`:return t.kind===`primitive`?e.type===t.type:!1;case`array`:return t.kind===`array`?this.isShapeAssignableTo(e.item,t.item):!1;case`union`:return e.types.every(e=>this.isShapeAssignableTo(e,t));case`object`:return t.kind===`object`?this.isObjectShapeAssignableTo(e,t):!1}}canMergeShapes(e,t){return e.kind===`union`?e.types.every(e=>this.canMergeShapes(e,t)):t.kind===`union`?t.types.every(t=>this.canMergeShapes(e,t)):e.kind===`primitive`&&t.kind===`primitive`?!0:e.kind===`array`&&t.kind===`array`?this.canMergeShapes(e.item,t.item):e.kind===`object`&&t.kind===`object`?this.canMergeObjectShapes(e,t):!1}mergeObjectShapes(e,t){let n=new Set([...e.properties.map(e=>e.key),...t.properties.map(e=>e.key)]);return this.createObjectShape(Array.from(n).map(n=>{let r=e.properties.find(e=>e.key===n),i=t.properties.find(e=>e.key===n);return r&&i?{key:n,optional:r.optional||i.optional,shape:this.mergeShapes(r.shape,i.shape)}:{key:n,optional:!0,shape:(r??i).shape}}))}mergeShapes(e,t){if(e.kind===`union`||t.kind===`union`||e.kind!==t.kind)return this.createUnionShape(e,t);switch(e.kind){case`primitive`:return t.kind===`primitive`&&e.type===t.type?e:this.createUnionShape(e,t);case`array`:return t.kind===`array`?{kind:`array`,item:this.mergeShapes(e.item,t.item)}:e;case`object`:return t.kind===`object`?this.mergeObjectShapes(e,t):e}}createUnionShape(...e){let t=e.flatMap(e=>e.kind===`union`?e.types:[e]),n=this.dedupeShapes(t);return n.length===1?n[0]:{kind:`union`,types:n}}prepareNestedShape(e,t,n){if(e.kind===`object`)return{kind:`primitive`,type:this.registerObjectShape(e,this.naming.sanitizeTypeName(this.naming.singularize(t)),n,this.naming.sanitizeTypeName(t))};if(e.kind===`array`)return{kind:`array`,item:this.prepareNestedShape(e.item,this.naming.singularize(t),n)};if(e.kind===`union`){let r=this.dedupeShapes(e.types.map((e,r)=>this.prepareNestedShape(e,this.getUnionMemberKeyHint(t,r,e),n)));return r.length===1?r[0]:{kind:`union`,types:r}}return e}getUnionMemberKeyHint(e,t,n){if(n.kind!==`object`&&n.kind!==`array`)return e;let r=this.naming.sanitizeTypeName(e);return r.endsWith(`ResponseExample`)?`${r}Variant${t+1}`:e}schemaToShape(e,t,n){if(!e)return this.inferShapeFromExample(n,t);let r=this.resolveSchemaType(e);if(r===`array`)return{kind:`array`,item:this.schemaToShape(e.items,this.naming.singularize(t),this.extractExampleArrayItem(e.example)??this.extractExampleArrayItem(n))};if(r===`object`){let r=this.isRecord(e.example)?e.example:this.isRecord(n)?n:void 0,i=Object.entries(e.properties??{}).sort(([e],[t])=>e.localeCompare(t)).map(([t,n])=>({key:t,optional:!(e.required??[]).includes(t),shape:this.schemaToShape(n,t,r?.[t])}));return i.length>0?this.createObjectShape(i):this.inferShapeFromExample(e.example??n,t)}return r===`integer`||r===`number`?{kind:`primitive`,type:`number`}:r===`string`?{kind:`primitive`,type:`string`}:r===`boolean`?{kind:`primitive`,type:`boolean`}:e.example===null||n===null?{kind:`primitive`,type:`null`}:e.example!==void 0||n!==void 0?this.inferShapeFromExample(e.example??n,t):{kind:`primitive`,type:`unknown`}}dedupeShapes(e){let t=new Set;return e.filter(e=>{let n=this.getShapeSignature(e);return t.has(n)?!1:(t.add(n),!0)})}createObjectShape(e){let t=e.map(e=>({...e})).sort((e,t)=>e.key.localeCompare(t.key));return{kind:`object`,signature:JSON.stringify(t.map(e=>({key:e.key,optional:e.optional,shape:this.getShapeSignature(e.shape)}))),properties:t}}getShapeSignature(e){switch(e.kind){case`primitive`:return`primitive:${e.type}`;case`array`:return`array:${this.getShapeSignature(e.item)}`;case`union`:return`union:${e.types.map(e=>this.getShapeSignature(e)).join(`|`)}`;case`object`:return`object:${e.signature}`}}getPreferredMediaType(e){if(e)return e[`application/json`]??e[`application/*+json`]??Object.values(e)[0]}resolveResponsePayloadSchema(e,t){for(let n of[[`data`],[`meta`,`data`]]){let r=this.getSchemaCandidateAtPath(e,t,n);if(r)return r}return{}}getSchemaCandidateAtPath(e,t,n){let r=this.getSchemaAtPath(e,n),i=this.getExampleAtPath(t,n);if(!(!r&&i===void 0))return r?{schema:r.example===void 0&&i!==void 0?{...r,example:i}:r,example:i??r.example}:{schema:{...this.inferSchemaTypeFromExample(i),example:i},example:i}}getSchemaAtPath(e,t){let n=e;for(let e of t){if(!n?.properties?.[e])return;n=n.properties[e]}return n}getExampleAtPath(e,t){let n=e;for(let e of t){if(!this.isRecord(n)||!(e in n))return;n=n[e]}return n}inferSchemaTypeFromExample(e){return Array.isArray(e)?{type:`array`,items:e.map(e=>this.inferSchemaTypeFromExample(e)).find(e=>this.hasSchemaDetails(e))??{}}:this.isRecord(e)?{type:`object`,properties:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this.inferSchemaTypeFromExample(t)]))}:typeof e==`string`?{type:`string`}:typeof e==`number`?{type:`number`}:typeof e==`boolean`?{type:`boolean`}:{}}hasSchemaDetails(e){return!!(e?.type||e?.properties||e?.items||e?.example!==void 0)}resolveSchemaType(e){return e.type??(e.properties?`object`:void 0)}extractExampleArrayItem(e){return Array.isArray(e)?e[0]:void 0}createUniqueTypeName(e,t,n){let r=this.naming.sanitizeTypeName(e)||`GeneratedEntity`,i=this.naming.sanitizeTypeName(n),a=r,o=2;if(!t.usedNames.has(a)||(a=this.naming.insertCollisionSuffix(r,i),!t.usedNames.has(a)))return t.usedNames.add(a),a;for(;t.usedNames.has(a);)a=`${r}${o}`,o+=1;return t.usedNames.add(a),a}isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}},X=class{naming=new Qe;shapes=new $e(this.naming);createContext(){return this.shapes.createContext()}collectSemanticModels(e){let t=[];for(let[n,r]of Object.entries(e.paths)){let e=this.naming.deriveOperationNaming(n),i=e.baseName,a=Object.entries(r).sort(([,e],[,t])=>this.getOperationPriority(t)-this.getOperationPriority(e));for(let[r,o]of a){let a=e.collisionSuffix||this.naming.fallbackCollisionSuffix(r,n,i);t.push({path:n,method:r,name:i,role:`response`,shape:this.shapes.getSuccessResponseShape(o.responses),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}ResponseExample`,role:`responseExample`,shape:this.shapes.getResponseExampleShape(o.responses),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Input`,role:`input`,shape:this.shapes.getRequestInputShape(o.requestBody),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Query`,role:`query`,shape:this.shapes.createParameterGroupShape(o.parameters,`query`,n),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Header`,role:`header`,shape:this.shapes.createParameterGroupShape(o.parameters,`header`,n),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Params`,role:`params`,shape:this.shapes.createParameterGroupShape(o.parameters,`path`,n),collisionSuffix:a})}}return t}buildSdkManifest(e,t,n={}){let r=this.naming.deriveSdkGroupNamesBySignature(e,n.namespaceStrategy??`smart`),i=new Map,a=this.buildSecuritySchemes(e),o=this.buildSecurityRequirements(e.security);for(let[a,o]of Object.entries(e.paths)){let e=this.naming.getStaticPathSegments(a).join(`/`),s=r.get(e)??`Resource`,c=this.naming.toCamelCase(this.naming.pluralize(s)),l=i.get(c)??{className:s,propertyName:c,operations:[]};for(let[e,r]of Object.entries(o)){let i=t.get(`${a}::${e}`)??{response:`Record<string, never>`,responseExample:`unknown`,input:`Record<string, never>`,query:`Record<string, never>`,header:`Record<string, never>`,params:`Record<string, never>`};l.operations.push({path:a,method:e.toUpperCase(),methodName:this.naming.deriveSdkMethodName(e,a,r,n.methodStrategy??`smart`),summary:r.summary,description:r.description,operationId:r.operationId,requestBodyDescription:r.requestBody?.description,responseDescription:this.resolveSuccessResponseDescription(r.responses),responseType:this.shapes.resolveSdkResponseType(r.responses,i.response),inputType:i.input,queryType:i.query,headerType:i.header,paramsType:i.params,hasBody:!!r.requestBody,bodyRequired:r.requestBody?.required??!1,pathParams:this.naming.createSdkParameterManifest(r.parameters,`path`,a),queryParams:this.naming.createSdkParameterManifest(r.parameters,`query`,a),headerParams:this.naming.createSdkParameterManifest(r.parameters,`header`,a),security:this.buildSecurityRequirements(r.security)})}i.set(c,l)}return{groups:Array.from(i.values()).map(e=>({...e,operations:this.naming.ensureUniqueSdkMethodNames(e.operations)})).sort((e,t)=>e.propertyName.localeCompare(t.propertyName)),securitySchemes:a,security:o}}inferShapeFromExample(e,t){return this.shapes.inferShapeFromExample(e,t)}sanitizeTypeName(e){return this.naming.sanitizeTypeName(e)}registerNamedShape(e,t,n,r){return this.shapes.registerNamedShape(e,t,n,r)}namespaceTopLevelShape(e,t){return this.shapes.namespaceTopLevelShape(e,t)}registerObjectShape(e,t,n,r,i=!1){return this.shapes.registerObjectShape(e,t,n,r,i)}getOperationPriority(e){return Number(!!e.requestBody)*10}resolveSuccessResponseDescription(e){for(let t of[`200`,`201`,`202`,`204`]){let n=e[t]?.description?.trim();if(n)return n}for(let t of Object.values(e)){let e=t.description?.trim();if(e)return e}}buildSecuritySchemes(e){return Object.entries(e.components?.securitySchemes??{}).map(([e,t])=>this.createSecuritySchemeManifest(e,t)).filter(e=>e!==null).sort((e,t)=>e.name.localeCompare(t.name))}createSecuritySchemeManifest(e,t){let n=this.createSecurityHelperName(e);if(t.type===`apiKey`)return{name:e,helperName:n,description:t.description,type:`apiKey`,authType:`apiKey`,in:t.in,parameterName:t.name};if(t.type===`oauth2`)return{name:e,helperName:n,description:t.description,type:`oauth2`,authType:`oauth2`,scopes:this.collectSecurityScopes(t)};if(t.type===`openIdConnect`)return{name:e,helperName:n,description:t.description,type:`openIdConnect`,authType:`oauth2`,openIdConnectUrl:t.openIdConnectUrl};let r=t.scheme.toLowerCase();return{name:e,helperName:n,description:t.description,type:`http`,authType:r===`basic`?`basic`:`bearer`,scheme:t.scheme,bearerFormat:t.bearerFormat}}buildSecurityRequirements(e){if(!e||e.length===0)return;let t=e.map(e=>({schemes:Object.entries(e).map(([e,t])=>({name:e,scopes:[...t].sort()})).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.schemes.length>0);return t.length>0?t:void 0}collectSecurityScopes(e){let t=new Set;for(let n of Object.values(e.flows??{}))for(let e of Object.keys(n.scopes??{}))t.add(e);return t.size>0?Array.from(t).sort():void 0}createSecurityHelperName(e){let t=this.naming.sanitizeTypeName(e);return t.endsWith(`Auth`)?`create${t}`:`create${t}Auth`}},Z=class e{typeBuilder=new X;moduleRenderer=new Ze;static generateModule=(t,n=`GeneratedOutput`,r={})=>new e().generate(t,n,r);generate(e,t=`GeneratedOutput`,n={}){return this.isOpenApiDocumentLike(e)?this.generateModule(e,t,n):this.generateGenericModule(e,t)}generateModule(e,t,n={}){let r=this.typeBuilder.createContext(),i=new Map;for(let t of this.typeBuilder.collectSemanticModels(e)){let e=`${t.path}::${t.method}`,n=this.typeBuilder.registerNamedShape(this.typeBuilder.namespaceTopLevelShape(t.shape,t.role),t.name,r,t.collisionSuffix),a=i.get(e)??{response:`Record<string, never>`,responseExample:`unknown`,input:`Record<string, never>`,query:`Record<string, never>`,header:`Record<string, never>`,params:`Record<string, never>`};a[t.role]=n,i.set(e,a)}let a=r.declarations.map(e=>this.moduleRenderer.renderDeclaration(e)).join(`
139
+ `)}\n${i}}`}return`undefined`}normalizeOpenApiDocument(e){return this.normalizeObject(e,(e,t,n)=>{if(e===`example`&&n&&typeof n==`object`&&!Array.isArray(n)){let e=n;if(e.schema&&this.isPlainObject(e.schema))return this.normalizeExample(t,e.schema);if(this.isSchemaLike(e))return this.normalizeExample(t,e)}return t})}normalizeObject(e,t){if(Array.isArray(e))return e.map(e=>this.normalizeObject(e,t)).filter(e=>e!==void 0);if(!this.isPlainObject(e))return e;let n={};for(let[r,i]of Object.entries(e)){let a=t(r,i,e),o=this.normalizeObject(a,t);o!==void 0&&(n[r]=o)}return n}normalizeExample(e,t){if(e===void 0)return;let n=typeof t.type==`string`?t.type:void 0;if(n===`string`)return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):void 0;if(n===`number`||n===`integer`)return typeof e==`number`?e:typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e))?Number(e):void 0;if(n===`boolean`)return typeof e==`boolean`?e:e===`true`?!0:e===`false`?!1:void 0;if(n===`array`){if(!Array.isArray(e))return;let n=this.isPlainObject(t.items)?t.items:void 0;return n?e.map(e=>this.normalizeExample(e,n)).filter(e=>e!==void 0):e}if(n===`object`){if(!this.isPlainObject(e))return;let n=this.isPlainObject(t.properties)?t.properties:{},r=Array.isArray(t.required)?t.required.filter(e=>typeof e==`string`):[],i={};for(let[t,r]of Object.entries(e)){let e=n[t],a=e?this.normalizeExample(r,e):r;a!==void 0&&(i[t]=a)}for(let e of r){if(e in i)continue;let t=n[e];if(!t)return;let r=t.default===void 0?t.example===void 0?void 0:this.normalizeExample(t.example,t):this.normalizeExample(t.default,t);if(r===void 0)return;i[e]=r}return i}return e}isPlainObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}isSchemaLike(e){return`type`in e||`properties`in e||`items`in e||`required`in e||`default`in e}indent(e){return` `.repeat(e)}escapeStringLiteral(e){return e.replace(/\\/g,String.raw`\\`).replace(/'/g,String.raw`\'`).replace(/\r/g,String.raw`\r`).replace(/\n/g,String.raw`\n`).replace(/\t/g,String.raw`\t`).replace(/\f/g,String.raw`\f`).replace(/\x08/g,String.raw`\b`).replace(/\u2028/g,String.raw`\u2028`).replace(/\u2029/g,String.raw`\u2029`)}isPathParam(e){return e.startsWith(`{`)&&e.endsWith(`}`)||/^:[A-Za-z0-9_]+$/.test(e)}stripPathParam(e){return e.replace(/^\{/,``).replace(/\}$/,``).replace(/^:/,``)}},Tt=class e{static contextualTailSegments=new Set([`history`,`status`,`detail`,`details`]);static irregularSingulars=new Map([[`analyses`,`analysis`],[`diagnoses`,`diagnosis`],[`parentheses`,`parenthesis`],[`statuses`,`status`],[`synopses`,`synopsis`],[`theses`,`thesis`]]);static invariantSingulars=new Set([`analysis`,`diagnosis`,`news`,`series`,`species`,`status`,`synopsis`,`thesis`]);static nestedContextSegments=new Set([`account`,`accounts`,`transaction`,`transactions`,`wallet`,`wallets`,`virtual-account`,`virtual-accounts`,`history`]);static roleSuffixes=[`Input`,`Query`,`Header`,`Params`];sanitizeTypeName(e){let t=e.replace(/[^A-Za-z0-9]+/g,` `).trim();if(!t)return`GeneratedEntity`;let n=t.split(/\s+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``);return/^[A-Za-z_$]/.test(n)?n:`Type${n}`}isPathParam(e){return e.startsWith(`{`)&&e.endsWith(`}`)||/^:[A-Za-z0-9_]+$/.test(e)}stripPathParam(e){return e.replace(/^\{/,``).replace(/\}$/,``).replace(/^:/,``)}singularize(t){let n=t.toLowerCase();return e.irregularSingulars.has(n)?e.irregularSingulars.get(n)??t:e.invariantSingulars.has(n)?t:/ies$/i.test(t)?`${t.slice(0,-3)}y`:/(sses|shes|ches|xes|zes)$/i.test(t)||/uses$/i.test(t)?t.slice(0,-2):t.endsWith(`s`)&&!t.endsWith(`ss`)&&t.length>1?t.slice(0,-1):t}pluralize(e){return/y$/i.test(e)?`${e.slice(0,-1)}ies`:/s$/i.test(e)?e:`${e}s`}toCamelCase(e){let t=this.sanitizeTypeName(e);return t.charAt(0).toLowerCase()+t.slice(1)}deriveOperationNaming(t){let n=this.getNormalizedPathSegments(t),r=n.filter(e=>!this.isPathParam(e)).map(e=>this.singularize(e)),i=n.filter(e=>this.isPathParam(e)).map(e=>this.singularize(this.stripPathParam(e))),a=r[r.length-1]??`resource`,o=r[r.length-2]??null,s=n.slice(0,-1).some(e=>this.isPathParam(e)),c=!!(o&&(e.contextualTailSegments.has(a.toLowerCase())||s&&e.nestedContextSegments.has(a.toLowerCase())));return{baseName:this.sanitizeTypeName(c?`${o} ${a}`:a),collisionSuffix:i.length>0?`By ${i.map(e=>this.sanitizeTypeName(e)).join(` And `)}`:o&&!c?this.sanitizeTypeName(o):``}}fallbackCollisionSuffix(e,t,n){let r=this.getNormalizedPathSegments(t),i=r.filter(e=>!this.isPathParam(e)),a=i[i.length-1]??``,o=r.some(e=>this.isPathParam(e));return e===`get`&&!o&&/s$/i.test(a)?`List`:e===`post`&&!o?`Create`:(e===`put`||e===`patch`)&&o?`Update`:e===`delete`?`Delete`:`${this.sanitizeTypeName(e)}${n}`}insertCollisionSuffix(t,n){if(!n)return t;for(let r of e.roleSuffixes)if(t.endsWith(r)&&t.length>r.length)return`${t.slice(0,-r.length)}${n}${r}`;return`${t}${n}`}deriveSdkGroupNamesBySignature(e,t){let n=new Map;for(let t of Object.keys(e.paths)){let e=this.getStaticPathSignature(t);n.has(e)||n.set(e,t)}let r=Array.from(n.entries()).map(([e,n])=>({signature:e,staticSegments:e.split(`/`).filter(Boolean),candidates:this.buildSdkGroupNameCandidates(n,t)})).sort((e,t)=>e.staticSegments.length-t.staticSegments.length||e.signature.localeCompare(t.signature)),i=new Map,a=new Set;for(let e of r){let t=e.candidates.find(e=>!a.has(e))??this.createUniqueSdkGroupName(e.candidates[e.candidates.length-1]??`Resource`,a);a.add(t),i.set(e.signature,t)}return i}getStaticPathSegments(e){return this.getNormalizedPathSegments(e).filter(e=>!this.isPathParam(e)).map(e=>this.singularize(e))}getStaticPathSignature(e){return this.getStaticPathSegments(e).join(`/`)}getNormalizedPathSegments(e){return e.split(`/`).map(e=>e.trim()).filter(Boolean).filter(e=>!/^v\d+$/i.test(e))}deriveSdkMethodName(e,t,n,r){if(r===`operation-id`&&n.operationId)return this.toCamelCase(this.sanitizeTypeName(n.operationId));let i=this.getNormalizedPathSegments(t).some(e=>this.isPathParam(e));return e===`get`?this.endsWithPluralStaticSegment(t)?`list`:i?`get`:`list`:e===`post`?`create`:e===`patch`||e===`put`?`update`:e===`delete`?`delete`:this.toCamelCase(this.sanitizeTypeName(e))}ensureUniqueSdkMethodNames(e){let t=new Map;return e.map(e=>{let n=t.get(e.methodName)??0;if(t.set(e.methodName,n+1),n===0)return e;let r=this.sanitizeTypeName(this.fallbackCollisionSuffix(e.method.toLowerCase(),e.path,`Operation`));return{...e,methodName:`${e.methodName}${r}`}})}createSdkParameterManifest(e,t,n){return[...(e??[]).filter(e=>e.in===t).sort((e,t)=>e.name.localeCompare(t.name)),...this.getInferredPathParameters(n,t,(e??[]).filter(e=>e.in===t))].sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({name:e.name,accessor:this.toParameterAccessor(e.name),in:t,required:e.required??!1,description:e.description}))}getInferredPathParameters(e,t,n){if(t!==`path`||!e)return[];let r=new Set(n.map(e=>e.name));return this.getNormalizedPathSegments(e).filter(e=>this.isPathParam(e)).map(e=>this.stripPathParam(e)).filter(e=>!r.has(e)).map(e=>({name:e,in:`path`,required:!0,schema:{type:`string`}}))}buildSdkGroupNameCandidates(e,t){let n=this.getNormalizedPathSegments(e),r=n.filter(e=>!this.isPathParam(e)),i=r.map(e=>this.singularize(e)),a=this.deriveOperationNaming(e).baseName,o=this.getPreferredSdkGroupName(n,r,i),s=i.map((e,t,n)=>this.sanitizeTypeName(n.slice(t).join(` `))).reverse();return t===`scoped`?Array.from(new Set([o??``,this.sanitizeTypeName(i.join(` `)),...s,a].filter(Boolean))):Array.from(new Set([o??``,a,...s].filter(Boolean)))}getPreferredSdkGroupName(e,t,n){let r=t[t.length-1],i=n[n.length-1],a=n[n.length-2],o=e.some(e=>this.isPathParam(e)),s=e.slice(0,-1).some(e=>this.isPathParam(e));return!r||!i||!a?null:t.length===2&&!o?this.sanitizeTypeName(`${i} ${a}`):s?this.singularize(r)===r?this.sanitizeTypeName(`${i} ${a}`):this.sanitizeTypeName(`${a} ${i}`):null}createUniqueSdkGroupName(e,t){let n=2,r=e;for(;t.has(r);)r=`${e}${n}`,n+=1;return r}endsWithPluralStaticSegment(e){let t=this.getNormalizedPathSegments(e).at(-1);return!t||this.isPathParam(t)?!1:this.singularize(t)!==t}toParameterAccessor(e){let t=e.replace(/[^A-Za-z0-9]+/g,` `).trim();if(!t)return`value`;let[n,...r]=t.split(/\s+/).filter(Boolean),i=[n.toLowerCase(),...r.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())].join(``);return/^[A-Za-z_$]/.test(i)?i:`value${i}`}},Et=class{naming;constructor(e){this.naming=e}createContext(){return{declarations:[],declarationByName:new Map,nameBySignature:new Map,usedNames:new Set}}namespaceTopLevelShape(e,t){return e.kind===`object`?{...e,signature:`${t}:${e.signature}`}:e}inferShapeFromExample(e,t){if(e===null)return{kind:`primitive`,type:`null`};if(Array.isArray(e)){if(e.length===0)return{kind:`array`,item:{kind:`primitive`,type:`unknown`}};let n=this.dedupeShapes(e.map(e=>this.inferShapeFromExample(e,this.naming.singularize(t))));return{kind:`array`,item:n.length===1?n[0]:{kind:`union`,types:n}}}if(this.isRecord(e))return this.createObjectShape(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({key:e,optional:!1,shape:this.inferShapeFromExample(t,e)})));switch(typeof e){case`string`:return{kind:`primitive`,type:`string`};case`number`:return{kind:`primitive`,type:`number`};case`boolean`:return{kind:`primitive`,type:`boolean`};default:return{kind:`primitive`,type:`unknown`}}}registerNamedShape(e,t,n,r){if(e.kind===`object`)return this.registerObjectShape(e,t,n,r,!0);let i=this.createUniqueTypeName(t,n,r),a={kind:`shape-alias`,name:i,shape:this.prepareNestedShape(e,t,n)};return n.declarations.push(a),n.declarationByName.set(i,a),i}registerObjectShape(e,t,n,r,i=!1){let a=n.nameBySignature.get(e.signature),o=this.findCompatibleObjectDeclaration(e,t,n);if(a){if(i&&a!==t&&!n.declarationByName.has(t)){let e=this.createUniqueTypeName(t,n,r);if(e!==a){let t={kind:`interface-alias`,name:e,target:a};n.declarations.push(t),n.declarationByName.set(e,t)}}return a}if(o){if(this.isObjectShapeAssignableTo(e,o.rawShape))return n.nameBySignature.set(e.signature,o.name),o.name;let t=this.mergeObjectShapes(o.rawShape,e);return o.rawShape=t,o.properties=t.properties.map(e=>({...e,shape:this.prepareNestedShape(e.shape,e.key,n)})),n.nameBySignature.set(e.signature,o.name),n.nameBySignature.set(t.signature,o.name),o.name}let s=this.createUniqueTypeName(t,n,r),c={kind:`interface`,name:s,baseName:this.naming.sanitizeTypeName(t),rawShape:e,properties:[]};return n.nameBySignature.set(e.signature,s),n.declarations.push(c),n.declarationByName.set(s,c),c.properties=e.properties.map(e=>({...e,shape:this.prepareNestedShape(e.shape,e.key,n)})),s}resolveSdkResponseType(e,t){let n=Object.entries(e).filter(([e])=>/^2\d\d$/.test(e)).sort(([e],[t])=>e.localeCompare(t))[0]?.[1];if(!n)return t;let r=this.getPreferredMediaType(n.content);if(!r)return t;let i=this.resolveResponsePayloadSchema(r.schema,r.example).schema??r.schema;return i&&this.resolveSchemaType(i)===`array`?`${t}[]`:t}getSuccessResponseShape(e){let t=Object.entries(e).filter(([e])=>/^2\d\d$/.test(e)).sort(([e],[t])=>e.localeCompare(t))[0]?.[1];if(!t)return this.emptyObjectShape;let n=this.getPreferredMediaType(t.content);if(!n)return this.emptyObjectShape;let r=this.resolveResponsePayloadSchema(n.schema,n.example);return r.schema?this.resolveSchemaType(r.schema)===`array`?this.schemaToShape(r.schema.items,`Item`,this.extractExampleArrayItem(r.example)):this.schemaToShape(r.schema,`Response`,r.example):this.schemaToShape(n.schema,`Response`,n.example)}getRequestInputShape(e){if(!e)return this.emptyObjectShape;let t=this.getPreferredMediaType(e.content);return t?this.schemaToShape(t.schema,`Input`,t.example):this.emptyObjectShape}getResponseExampleShape(e){let t=Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).flatMap(([,e])=>{let t=this.getPreferredMediaType(e.content);if(!t)return[];let n=t.example??t.schema?.example;return t.schema?[this.schemaToShape(t.schema,`ResponseExample`,n)]:n===void 0?[]:[this.inferShapeFromExample(n,`ResponseExample`)]}),n=this.dedupeShapes(t);return n.length===0?{kind:`primitive`,type:`unknown`}:n.length===1?n[0]:{kind:`union`,types:n}}createParameterGroupShape(e,t,n){let r=(e??[]).filter(e=>e.in===t).sort((e,t)=>e.name.localeCompare(t.name)),i=[...r,...this.naming.getInferredPathParameters(n,t,r)].sort((e,t)=>e.name.localeCompare(t.name));return i.length===0?this.emptyObjectShape:this.createObjectShape(i.map(e=>({key:e.name,optional:!(e.required??!1),shape:this.schemaToShape(e.schema,e.name,e.example)})))}get emptyObjectShape(){return this.createObjectShape([])}findCompatibleObjectDeclaration(e,t,n){let r=this.naming.sanitizeTypeName(t);return n.declarations.find(t=>t.kind!==`interface`||t.baseName!==r?!1:this.isObjectShapeAssignableTo(e,t.rawShape)||this.isObjectShapeAssignableTo(t.rawShape,e)||this.canMergeObjectShapes(t.rawShape,e))}canMergeObjectShapes(e,t){let n=new Set([...e.properties.map(e=>e.key),...t.properties.map(e=>e.key)]);for(let r of n){let n=e.properties.find(e=>e.key===r),i=t.properties.find(e=>e.key===r);if(!n||!i){if(!(n??i)?.optional)return!1;continue}if(!this.canMergeShapes(n.shape,i.shape))return!1}return!0}isObjectShapeAssignableTo(e,t){let n=new Map(t.properties.map(e=>[e.key,e]));for(let t of e.properties){let e=n.get(t.key);if(!e||t.optional&&!e.optional||!this.isShapeAssignableTo(t.shape,e.shape))return!1}return t.properties.every(t=>e.properties.some(e=>e.key===t.key)||t.optional)}isShapeAssignableTo(e,t){if(t.kind===`union`)return t.types.some(t=>this.isShapeAssignableTo(e,t));switch(e.kind){case`primitive`:return t.kind===`primitive`?e.type===t.type:!1;case`array`:return t.kind===`array`?this.isShapeAssignableTo(e.item,t.item):!1;case`union`:return e.types.every(e=>this.isShapeAssignableTo(e,t));case`object`:return t.kind===`object`?this.isObjectShapeAssignableTo(e,t):!1}}canMergeShapes(e,t){return e.kind===`union`?e.types.every(e=>this.canMergeShapes(e,t)):t.kind===`union`?t.types.every(t=>this.canMergeShapes(e,t)):e.kind===`primitive`&&t.kind===`primitive`?!0:e.kind===`array`&&t.kind===`array`?this.canMergeShapes(e.item,t.item):e.kind===`object`&&t.kind===`object`?this.canMergeObjectShapes(e,t):!1}mergeObjectShapes(e,t){let n=new Set([...e.properties.map(e=>e.key),...t.properties.map(e=>e.key)]);return this.createObjectShape(Array.from(n).map(n=>{let r=e.properties.find(e=>e.key===n),i=t.properties.find(e=>e.key===n);return r&&i?{key:n,optional:r.optional||i.optional,shape:this.mergeShapes(r.shape,i.shape)}:{key:n,optional:!0,shape:(r??i).shape}}))}mergeShapes(e,t){if(e.kind===`union`||t.kind===`union`||e.kind!==t.kind)return this.createUnionShape(e,t);switch(e.kind){case`primitive`:return t.kind===`primitive`&&e.type===t.type?e:this.createUnionShape(e,t);case`array`:return t.kind===`array`?{kind:`array`,item:this.mergeShapes(e.item,t.item)}:e;case`object`:return t.kind===`object`?this.mergeObjectShapes(e,t):e}}createUnionShape(...e){let t=e.flatMap(e=>e.kind===`union`?e.types:[e]),n=this.dedupeShapes(t);return n.length===1?n[0]:{kind:`union`,types:n}}prepareNestedShape(e,t,n){if(e.kind===`object`)return{kind:`primitive`,type:this.registerObjectShape(e,this.naming.sanitizeTypeName(this.naming.singularize(t)),n,this.naming.sanitizeTypeName(t))};if(e.kind===`array`)return{kind:`array`,item:this.prepareNestedShape(e.item,this.naming.singularize(t),n)};if(e.kind===`union`){let r=this.dedupeShapes(e.types.map((e,r)=>this.prepareNestedShape(e,this.getUnionMemberKeyHint(t,r,e),n)));return r.length===1?r[0]:{kind:`union`,types:r}}return e}getUnionMemberKeyHint(e,t,n){if(n.kind!==`object`&&n.kind!==`array`)return e;let r=this.naming.sanitizeTypeName(e);return r.endsWith(`ResponseExample`)?`${r}Variant${t+1}`:e}schemaToShape(e,t,n){if(!e)return this.inferShapeFromExample(n,t);let r=this.resolveSchemaType(e);if(r===`array`)return{kind:`array`,item:this.schemaToShape(e.items,this.naming.singularize(t),this.extractExampleArrayItem(e.example)??this.extractExampleArrayItem(n))};if(r===`object`){let r=this.isRecord(e.example)?e.example:this.isRecord(n)?n:void 0,i=Object.entries(e.properties??{}).sort(([e],[t])=>e.localeCompare(t)).map(([t,n])=>({key:t,optional:!(e.required??[]).includes(t),shape:this.schemaToShape(n,t,r?.[t])}));return i.length>0?this.createObjectShape(i):this.inferShapeFromExample(e.example??n,t)}return r===`integer`||r===`number`?{kind:`primitive`,type:`number`}:r===`string`?{kind:`primitive`,type:`string`}:r===`boolean`?{kind:`primitive`,type:`boolean`}:e.example===null||n===null?{kind:`primitive`,type:`null`}:e.example!==void 0||n!==void 0?this.inferShapeFromExample(e.example??n,t):{kind:`primitive`,type:`unknown`}}dedupeShapes(e){let t=new Set;return e.filter(e=>{let n=this.getShapeSignature(e);return t.has(n)?!1:(t.add(n),!0)})}createObjectShape(e){let t=e.map(e=>({...e})).sort((e,t)=>e.key.localeCompare(t.key));return{kind:`object`,signature:JSON.stringify(t.map(e=>({key:e.key,optional:e.optional,shape:this.getShapeSignature(e.shape)}))),properties:t}}getShapeSignature(e){switch(e.kind){case`primitive`:return`primitive:${e.type}`;case`array`:return`array:${this.getShapeSignature(e.item)}`;case`union`:return`union:${e.types.map(e=>this.getShapeSignature(e)).join(`|`)}`;case`object`:return`object:${e.signature}`}}getPreferredMediaType(e){if(e)return e[`application/json`]??e[`application/*+json`]??Object.values(e)[0]}resolveResponsePayloadSchema(e,t){for(let n of[[`data`],[`meta`,`data`]]){let r=this.getSchemaCandidateAtPath(e,t,n);if(r)return r}return{}}getSchemaCandidateAtPath(e,t,n){let r=this.getSchemaAtPath(e,n),i=this.getExampleAtPath(t,n);if(!(!r&&i===void 0))return r?{schema:r.example===void 0&&i!==void 0?{...r,example:i}:r,example:i??r.example}:{schema:{...this.inferSchemaTypeFromExample(i),example:i},example:i}}getSchemaAtPath(e,t){let n=e;for(let e of t){if(!n?.properties?.[e])return;n=n.properties[e]}return n}getExampleAtPath(e,t){let n=e;for(let e of t){if(!this.isRecord(n)||!(e in n))return;n=n[e]}return n}inferSchemaTypeFromExample(e){return Array.isArray(e)?{type:`array`,items:e.map(e=>this.inferSchemaTypeFromExample(e)).find(e=>this.hasSchemaDetails(e))??{}}:this.isRecord(e)?{type:`object`,properties:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this.inferSchemaTypeFromExample(t)]))}:typeof e==`string`?{type:`string`}:typeof e==`number`?{type:`number`}:typeof e==`boolean`?{type:`boolean`}:{}}hasSchemaDetails(e){return!!(e?.type||e?.properties||e?.items||e?.example!==void 0)}resolveSchemaType(e){return e.type??(e.properties?`object`:void 0)}extractExampleArrayItem(e){return Array.isArray(e)?e[0]:void 0}createUniqueTypeName(e,t,n){let r=this.naming.sanitizeTypeName(e)||`GeneratedEntity`,i=this.naming.sanitizeTypeName(n),a=r,o=2;if(!t.usedNames.has(a)||(a=this.naming.insertCollisionSuffix(r,i),!t.usedNames.has(a)))return t.usedNames.add(a),a;for(;t.usedNames.has(a);)a=`${r}${o}`,o+=1;return t.usedNames.add(a),a}isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}},Dt=class{naming=new Tt;shapes=new Et(this.naming);createContext(){return this.shapes.createContext()}collectSemanticModels(e){let t=[];for(let[n,r]of Object.entries(e.paths)){let e=this.naming.deriveOperationNaming(n),i=e.baseName,a=Object.entries(r).sort(([,e],[,t])=>this.getOperationPriority(t)-this.getOperationPriority(e));for(let[r,o]of a){let a=e.collisionSuffix||this.naming.fallbackCollisionSuffix(r,n,i);t.push({path:n,method:r,name:i,role:`response`,shape:this.shapes.getSuccessResponseShape(o.responses),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}ResponseExample`,role:`responseExample`,shape:this.shapes.getResponseExampleShape(o.responses),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Input`,role:`input`,shape:this.shapes.getRequestInputShape(o.requestBody),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Query`,role:`query`,shape:this.shapes.createParameterGroupShape(o.parameters,`query`,n),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Header`,role:`header`,shape:this.shapes.createParameterGroupShape(o.parameters,`header`,n),collisionSuffix:a}),t.push({path:n,method:r,name:`${i}Params`,role:`params`,shape:this.shapes.createParameterGroupShape(o.parameters,`path`,n),collisionSuffix:a})}}return t}buildSdkManifest(e,t,n={}){let r=this.naming.deriveSdkGroupNamesBySignature(e,n.namespaceStrategy??`smart`),i=new Map,a=this.buildSecuritySchemes(e),o=this.buildSecurityRequirements(e.security);for(let[a,o]of Object.entries(e.paths)){let e=this.naming.getStaticPathSegments(a).join(`/`),s=r.get(e)??`Resource`,c=this.naming.toCamelCase(this.naming.pluralize(s)),l=i.get(c)??{className:s,propertyName:c,operations:[]};for(let[e,r]of Object.entries(o)){let i=t.get(`${a}::${e}`)??{response:`Record<string, never>`,responseExample:`unknown`,input:`Record<string, never>`,query:`Record<string, never>`,header:`Record<string, never>`,params:`Record<string, never>`};l.operations.push({path:a,method:e.toUpperCase(),methodName:this.naming.deriveSdkMethodName(e,a,r,n.methodStrategy??`smart`),summary:r.summary,description:r.description,operationId:r.operationId,requestBodyDescription:r.requestBody?.description,responseDescription:this.resolveSuccessResponseDescription(r.responses),responseType:this.shapes.resolveSdkResponseType(r.responses,i.response),inputType:i.input,queryType:i.query,headerType:i.header,paramsType:i.params,hasBody:!!r.requestBody,bodyRequired:r.requestBody?.required??!1,pathParams:this.naming.createSdkParameterManifest(r.parameters,`path`,a),queryParams:this.naming.createSdkParameterManifest(r.parameters,`query`,a),headerParams:this.naming.createSdkParameterManifest(r.parameters,`header`,a),security:this.buildSecurityRequirements(r.security)})}i.set(c,l)}return{groups:Array.from(i.values()).map(e=>({...e,operations:this.naming.ensureUniqueSdkMethodNames(e.operations)})).sort((e,t)=>e.propertyName.localeCompare(t.propertyName)),securitySchemes:a,security:o}}inferShapeFromExample(e,t){return this.shapes.inferShapeFromExample(e,t)}sanitizeTypeName(e){return this.naming.sanitizeTypeName(e)}registerNamedShape(e,t,n,r){return this.shapes.registerNamedShape(e,t,n,r)}namespaceTopLevelShape(e,t){return this.shapes.namespaceTopLevelShape(e,t)}registerObjectShape(e,t,n,r,i=!1){return this.shapes.registerObjectShape(e,t,n,r,i)}getOperationPriority(e){return Number(!!e.requestBody)*10}resolveSuccessResponseDescription(e){for(let t of[`200`,`201`,`202`,`204`]){let n=e[t]?.description?.trim();if(n)return n}for(let t of Object.values(e)){let e=t.description?.trim();if(e)return e}}buildSecuritySchemes(e){return Object.entries(e.components?.securitySchemes??{}).map(([e,t])=>this.createSecuritySchemeManifest(e,t)).filter(e=>e!==null).sort((e,t)=>e.name.localeCompare(t.name))}createSecuritySchemeManifest(e,t){let n=this.createSecurityHelperName(e);if(t.type===`apiKey`)return{name:e,helperName:n,description:t.description,type:`apiKey`,authType:`apiKey`,in:t.in,parameterName:t.name};if(t.type===`oauth2`)return{name:e,helperName:n,description:t.description,type:`oauth2`,authType:`oauth2`,scopes:this.collectSecurityScopes(t)};if(t.type===`openIdConnect`)return{name:e,helperName:n,description:t.description,type:`openIdConnect`,authType:`oauth2`,openIdConnectUrl:t.openIdConnectUrl};let r=t.scheme.toLowerCase();return{name:e,helperName:n,description:t.description,type:`http`,authType:r===`basic`?`basic`:`bearer`,scheme:t.scheme,bearerFormat:t.bearerFormat}}buildSecurityRequirements(e){if(!e||e.length===0)return;let t=e.map(e=>({schemes:Object.entries(e).map(([e,t])=>({name:e,scopes:[...t].sort()})).sort((e,t)=>e.name.localeCompare(t.name))})).filter(e=>e.schemes.length>0);return t.length>0?t:void 0}collectSecurityScopes(e){let t=new Set;for(let n of Object.values(e.flows??{}))for(let e of Object.keys(n.scopes??{}))t.add(e);return t.size>0?Array.from(t).sort():void 0}createSecurityHelperName(e){let t=this.naming.sanitizeTypeName(e);return t.endsWith(`Auth`)?`create${t}`:`create${t}Auth`}},Ot=class e{typeBuilder=new Dt;moduleRenderer=new wt;static generateModule=(t,n=`GeneratedOutput`,r={})=>new e().generate(t,n,r);generate(e,t=`GeneratedOutput`,n={}){return this.isOpenApiDocumentLike(e)?this.generateModule(e,t,n):this.generateGenericModule(e,t)}generateModule(e,t,n={}){let r=this.typeBuilder.createContext(),i=new Map;for(let t of this.typeBuilder.collectSemanticModels(e)){let e=`${t.path}::${t.method}`,n=this.typeBuilder.registerNamedShape(this.typeBuilder.namespaceTopLevelShape(t.shape,t.role),t.name,r,t.collisionSuffix),a=i.get(e)??{response:`Record<string, never>`,responseExample:`unknown`,input:`Record<string, never>`,query:`Record<string, never>`,header:`Record<string, never>`,params:`Record<string, never>`};a[t.role]=n,i.set(e,a)}let a=r.declarations.map(e=>this.moduleRenderer.renderDeclaration(e)).join(`
140
140
 
141
141
  `),o=this.moduleRenderer.toCamelCase(t),s=this.typeBuilder.buildSdkManifest(e,i,n);return[a,this.moduleRenderer.renderOpenApiDocumentDefinitions(t,e,i),this.moduleRenderer.renderSdkApiInterface(t,s),this.moduleRenderer.renderSdkManifest(o,s),`export const ${o}: ${t} = ${this.moduleRenderer.renderOpenApiDocumentValue(e)}`,this.moduleRenderer.renderSdkBundle(o,t),``,`export default ${o}`].filter(Boolean).join(`
142
142
 
@@ -144,13 +144,111 @@ import{JSDOM as e}from"jsdom";import{Window as t}from"happy-dom";import n from"a
144
144
 
145
145
  `),o,`export const ${s}: ${t} = ${this.moduleRenderer.renderValue(e)}`,``,`export default ${s}`].filter(Boolean).join(`
146
146
 
147
- `)}isOpenApiDocumentLike(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;if(typeof t.info!=`object`||t.info===null||Array.isArray(t.info))return!1;let n=t.info;return t.openapi===`3.1.0`&&typeof n.title==`string`&&typeof n.version==`string`&&typeof t.paths==`object`&&t.paths!==null&&!Array.isArray(t.paths)}},Q=class{static serializeOutput=async(e,t,n=`ExtractedApiDocument`,r={})=>t===`js`?l.format(`export default ${JSON.stringify(e,null,2)}`,{parser:`babel`,semi:!1,singleQuote:!0}):t===`ts`?l.format(Z.generateModule(e,n,r),{parser:`typescript`,semi:!1,singleQuote:!0}):JSON.stringify(e,null,t===`json`?0:2);static buildFilePath=(e,t,n,r)=>{let a={pretty:`txt`,json:`json`,js:`js`,ts:`ts`}[r],o=this.toSafeSourceName(t),s=n===`openapi`?`.openapi`:``;return i.join(e,`output`,`${o||`output`}${s}.${a}`)};static buildArtifactDirectory=(e,t,n)=>{let r=this.toSafeSourceName(t);return i.join(e,`output`,`${r||n}.${n}`)};static toSafeSourceName(e){return e.replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/^_+|_+$/g,``)}static getRootTypeName=e=>e===`openapi`?`ExtractedApiDocument`:`ExtractedPayload`},et=class e{static publishedPackageVersionRanges=new Map;typeBuilder=new X;typeScriptGenerator=new Z;generate(e,t={}){let n=t.outputMode??`both`,r=t.signatureStyle??`grouped`,i=t.rootTypeName??`ExtractedApiDocument`,a=t.schemaModule??this.typeScriptGenerator.generateModule(e,i,t),o=this.createOperationTypeRefs(e),s=this.typeBuilder.buildSdkManifest(e,o,t),c=s.groups.map(e=>e.className),l={"package.json":this.renderPackageJson(t),"README.md":this.renderReadme(s,t,n,r),"src/Schema.ts":a,"src/index.ts":this.renderIndexFile(c,n,i,s),"tsconfig.json":this.renderTsconfig(),"tsdown.config.ts":this.renderTsdownConfig(),"vitest.config.ts":this.renderVitestConfig(),"tests/exports.test.ts":this.renderExportsTest(i,n)};if(n!==`runtime`){l[`src/BaseApi.ts`]=this.renderBaseApi(),l[`src/ApiBinder.ts`]=this.renderApiBinder(s);for(let e of s.groups)l[`src/Apis/${e.className}.ts`]=this.renderApiClass(e,r);l[`src/Core.ts`]=this.renderCoreFile()}return l}createOperationTypeRefs(e){let t=this.typeBuilder.createContext(),n=new Map;for(let r of this.typeBuilder.collectSemanticModels(e)){let e=`${r.path}::${r.method}`,i=this.typeBuilder.registerNamedShape(this.typeBuilder.namespaceTopLevelShape(r.shape,r.role),r.name,t,r.collisionSuffix),a=n.get(e)??{response:`Record<string, never>`,responseExample:`unknown`,input:`Record<string, never>`,query:`Record<string, never>`,header:`Record<string, never>`,params:`Record<string, never>`};a[r.role]=i,n.set(e,a)}return n}renderBaseApi(){return[`import { BaseApi as KitBaseApi } from '@oapiex/sdk-kit'`,``,`export class BaseApi extends KitBaseApi {}`].join(`
147
+ `)}isOpenApiDocumentLike(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;if(typeof t.info!=`object`||t.info===null||Array.isArray(t.info))return!1;let n=t.info;return t.openapi===`3.1.0`&&typeof n.title==`string`&&typeof n.version==`string`&&typeof t.paths==`object`&&t.paths!==null&&!Array.isArray(t.paths)}},kt=P({builders:()=>Nr,default:()=>Mt,printer:()=>Pr,utils:()=>Fr}),At=Object.defineProperty,jt=(e,t)=>{for(var n in t)At(e,n,{get:t[n],enumerable:!0})},Mt={};jt(Mt,{builders:()=>Nr,printer:()=>Pr,utils:()=>Fr});var Nt=1,Pt=(e,t)=>(n,r,...i)=>{if(!(n|Nt&&r==null))return(t.call(r)??r[e]).apply(r,i)};function Ft(e){return this[e<0?this.length+e:e]}var It=Pt(`at`,function(){if(Array.isArray(this)||typeof this==`string`)return Ft}),Lt=()=>{},Rt=`string`,zt=`array`,Bt=`cursor`,Vt=`indent`,Ht=`align`,Ut=`trim`,Wt=`group`,Gt=`fill`,Kt=`if-break`,qt=`indent-if-break`,Jt=`line-suffix`,Yt=`line-suffix-boundary`,Xt=`line`,Zt=`label`,Qt=`break-parent`,$t=new Set([Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt]);function en(e){let t=e.length;for(;t>0&&(e[t-1]===`\r`||e[t-1]===`
148
+ `);)t--;return t<e.length?e.slice(0,t):e}function tn(e){if(typeof e==`string`)return Rt;if(Array.isArray(e))return zt;if(!e)return;let{type:t}=e;if($t.has(t))return t}var nn=tn,rn=e=>new Intl.ListFormat(`en-US`,{type:`disjunction`}).format(e);function an(e){let t=e===null?`null`:typeof e;if(t!==`string`&&t!==`object`)return`Unexpected doc '${t}',
149
+ Expected it to be 'string' or 'object'.`;if(nn(e))throw Error(`doc is valid.`);let n=Object.prototype.toString.call(e);if(n!==`[object Object]`)return`Unexpected doc '${n}'.`;let r=rn([...$t].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.
150
+ Expected it to be ${r}.`}var on=class extends Error{name=`InvalidDocError`;constructor(e){super(an(e)),this.doc=e}},sn={};function cn(e,t,n,r){let i=[e];for(;i.length>0;){let e=i.pop();if(e===sn){n(i.pop());continue}n&&i.push(e,sn);let a=nn(e);if(!a)throw new on(e);if(t?.(e)!==!1)switch(a){case zt:case Gt:{let t=a===zt?e:e.parts;for(let e=t.length-1;e>=0;--e)i.push(t[e]);break}case Kt:i.push(e.flatContents,e.breakContents);break;case Wt:if(r&&e.expandedStates)for(let t=e.expandedStates.length-1;t>=0;--t)i.push(e.expandedStates[t]);else i.push(e.contents);break;case Ht:case Vt:case qt:case Zt:case Jt:i.push(e.contents);break;case Rt:case Bt:case Ut:case Yt:case Xt:case Qt:break;default:throw new on(e)}}}var ln=cn;function un(e,t){if(typeof e==`string`)return t(e);let n=new Map;return r(e);function r(e){if(n.has(e))return n.get(e);let t=i(e);return n.set(e,t),t}function i(e){switch(nn(e)){case zt:return t(e.map(r));case Gt:return t({...e,parts:e.parts.map(r)});case Kt:return t({...e,breakContents:r(e.breakContents),flatContents:r(e.flatContents)});case Wt:{let{expandedStates:n,contents:i}=e;return n?(n=n.map(r),i=n[0]):i=r(i),t({...e,contents:i,expandedStates:n})}case Ht:case Vt:case qt:case Zt:case Jt:return t({...e,contents:r(e.contents)});case Rt:case Bt:case Ut:case Yt:case Xt:case Qt:return t(e);default:throw new on(e)}}}function dn(e,t,n){let r=n,i=!1;function a(e){if(i)return!1;let n=t(e);n!==void 0&&(i=!0,r=n)}return ln(e,a),r}function fn(e){if(e.type===Wt&&e.break||e.type===Xt&&e.hard||e.type===Qt)return!0}function pn(e){return dn(e,fn,!1)}function mn(e){if(e.length>0){let t=It(0,e,-1);!t.expandedStates&&!t.break&&(t.break=`propagated`)}return null}function hn(e){let t=new Set,n=[];function r(e){if(e.type===Qt&&mn(n),e.type===Wt){if(n.push(e),t.has(e))return!1;t.add(e)}}function i(e){e.type===Wt&&n.pop().break&&mn(n)}ln(e,r,i,!0)}function gn(e){return e.type===Xt&&!e.hard?e.soft?``:` `:e.type===Kt?e.flatContents:e}function _n(e){return un(e,gn)}function vn(e){for(e=[...e];e.length>=2&&It(0,e,-2).type===Xt&&It(0,e,-1).type===Qt;)e.length-=2;if(e.length>0){let t=yn(It(0,e,-1));e[e.length-1]=t}return e}function yn(e){switch(nn(e)){case Vt:case qt:case Wt:case Jt:case Zt:{let t=yn(e.contents);return{...e,contents:t}}case Kt:return{...e,breakContents:yn(e.breakContents),flatContents:yn(e.flatContents)};case Gt:return{...e,parts:vn(e.parts)};case zt:return vn(e);case Rt:return en(e);case Ht:case Bt:case Ut:case Yt:case Xt:case Qt:break;default:throw new on(e)}return e}function bn(e){return yn(Sn(e))}function xn(e){switch(nn(e)){case Gt:if(e.parts.every(e=>e===``))return``;break;case Wt:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return``;if(e.contents.type===Wt&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case Ht:case Vt:case qt:case Jt:if(!e.contents)return``;break;case Kt:if(!e.flatContents&&!e.breakContents)return``;break;case zt:{let t=[];for(let n of e){if(!n)continue;let[e,...r]=Array.isArray(n)?n:[n];typeof e==`string`&&typeof It(0,t,-1)==`string`?t[t.length-1]+=e:t.push(e),t.push(...r)}return t.length===0?``:t.length===1?t[0]:t}case Rt:case Bt:case Ut:case Yt:case Xt:case Zt:case Qt:break;default:throw new on(e)}return e}function Sn(e){return un(e,e=>xn(e))}function Cn(e,t=Xn){return un(e,e=>typeof e==`string`?Un(t,e.split(`
151
+ `)):e)}function wn(e){if(e.type===Xt)return!0}function Tn(e){return dn(e,wn,!1)}var En=Lt,Dn=Lt,On=Lt,kn=Lt;function An(e){return En(e),{type:Vt,contents:e}}function jn(e,t){return kn(e),En(t),{type:Ht,contents:t,n:e}}function Mn(e){return jn(-1/0,e)}function Nn(e){return jn({type:`root`},e)}function Pn(e){return jn(-1,e)}function Fn(e,t,n){En(e);let r=e;if(t>0){for(let e=0;e<Math.floor(t/n);++e)r=An(r);r=jn(t%n,r),r=jn(-1/0,r)}return r}var In={type:Qt},Ln={type:Bt};function Rn(e){return On(e),{type:Gt,parts:e}}function zn(e,t={}){return En(e),Dn(t.expandedStates,!0),{type:Wt,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Bn(e,t){return zn(e[0],{...t,expandedStates:e})}function Vn(e,t=``,n={}){return En(e),t!==``&&En(t),{type:Kt,breakContents:e,flatContents:t,groupId:n.groupId}}function Hn(e,t){return En(e),{type:qt,contents:e,groupId:t.groupId,negate:t.negate}}function Un(e,t){En(e),Dn(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}function Wn(e,t){return En(t),e?{type:Zt,label:e,contents:t}:t}var Gn={type:Xt},Kn={type:Xt,soft:!0},qn={type:Xt,hard:!0},Jn=[qn,In],Yn={type:Xt,hard:!0,literal:!0},Xn=[Yn,In];function Zn(e){return En(e),{type:Jt,contents:e}}var Qn={type:Yt},$n={type:Ut},er=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},tr=Pt(`replaceAll`,function(){if(typeof this==`string`)return er}),nr=`cr`,rr=`crlf`,ir=`\r`,ar=`\r
152
+ `,or=`
153
+ `;function sr(e){return e===nr?ir:e===rr?ar:or}var cr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function lr(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function ur(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var dr=`©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇`,fr=/[^\x20-\x7F]/u,pr=new Set(dr);function mr(e){if(!e)return 0;if(!fr.test(e))return e.length;e=e.replace(cr(),e=>pr.has(e)?` `:` `);let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||e>=65024&&e<=65039||(t+=lr(e)||ur(e)?2:1)}return t}var hr=mr,gr=0,_r=1,vr=2,yr=3,br={type:gr},xr={type:_r},Sr={value:``,length:0,queue:[],get root(){return Sr}};function Cr(e,t,n){let r=t.type===_r?e.queue.slice(0,-1):[...e.queue,t],i=``,a=0,o=0,s=0;for(let e of r)switch(e.type){case gr:u(),n.useTabs?c(1):l(n.tabWidth);break;case yr:{let{string:t}=e;u(),i+=t,a+=t.length;break}case vr:{let{width:t}=e;o+=1,s+=t;break}default:throw Error(`Unexpected indent comment '${e.type}'.`)}return f(),{...e,value:i,length:a,queue:r};function c(e){i+=` `.repeat(e),a+=n.tabWidth*e}function l(e){i+=` `.repeat(e),a+=e}function u(){n.useTabs?d():f()}function d(){o>0&&c(o),p()}function f(){s>0&&l(s),p()}function p(){o=0,s=0}}function wr(e,t,n){if(!t)return e;if(t.type===`root`)return{...e,root:e};if(t===-1/0)return e.root;let r;return r=typeof t==`number`?t<0?xr:{type:vr,width:t}:{type:yr,string:t},Cr(e,r,n)}function Tr(e,t){return Cr(e,br,t)}function Er(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r===` `||r===` `)t++;else break}return t}function Dr(e){let t=Er(e);return{text:t===0?e:e.slice(0,e.length-t),count:t}}var Or=Symbol(`MODE_BREAK`),kr=Symbol(`MODE_FLAT`),Ar=Symbol(`DOC_FILL_PRINTED_LENGTH`);function jr(e,t,n,r,i,a){if(n===1/0)return!0;let o=t.length,s=!1,c=[e],l=``;for(;n>=0;){if(c.length===0){if(o===0)return!0;c.push(t[--o]);continue}let{mode:e,doc:u}=c.pop(),d=nn(u);switch(d){case Rt:u&&(s&&=(l+=` `,--n,!1),l+=u,n-=hr(u));break;case zt:case Gt:{let t=d===zt?u:u.parts,n=u[Ar]??0;for(let r=t.length-1;r>=n;r--)c.push({mode:e,doc:t[r]});break}case Vt:case Ht:case qt:case Zt:c.push({mode:e,doc:u.contents});break;case Ut:{let{text:e,count:t}=Dr(l);l=e,n+=t;break}case Wt:{if(a&&u.break)return!1;let t=u.break?Or:e,n=u.expandedStates&&t===Or?It(0,u.expandedStates,-1):u.contents;c.push({mode:t,doc:n});break}case Kt:{let t=(u.groupId?i[u.groupId]||kr:e)===Or?u.breakContents:u.flatContents;t&&c.push({mode:e,doc:t});break}case Xt:if(e===Or||u.hard)return!0;u.soft||(s=!0);break;case Jt:r=!0;break;case Yt:if(r)return!1;break}}return!1}function Mr(e,t){let n=Object.create(null),r=t.printWidth,i=sr(t.endOfLine),a=0,o=[{indent:Sr,mode:Or,doc:e}],s=``,c=!1,l=[],u=[],d=[],f=[],p=0;for(hn(e);o.length>0;){let{indent:e,mode:d,doc:f}=o.pop();switch(nn(f)){case Rt:{let e=i===`
154
+ `?f:tr(0,f,`
155
+ `,i);e&&(s+=e,o.length>0&&(a+=hr(e)));break}case zt:for(let t=f.length-1;t>=0;t--)o.push({indent:e,mode:d,doc:f[t]});break;case Bt:if(u.length>=2)throw Error(`There are too many 'cursor' in doc.`);u.push(p+s.length);break;case Vt:o.push({indent:Tr(e,t),mode:d,doc:f.contents});break;case Ht:o.push({indent:wr(e,f.n,t),mode:d,doc:f.contents});break;case Ut:_();break;case Wt:switch(d){case kr:if(!c){o.push({indent:e,mode:f.break?Or:kr,doc:f.contents});break}case Or:{c=!1;let t={indent:e,mode:kr,doc:f.contents},i=r-a,s=l.length>0;if(!f.break&&jr(t,o,i,s,n))o.push(t);else if(f.expandedStates){let t=It(0,f.expandedStates,-1);if(f.break){o.push({indent:e,mode:Or,doc:t});break}else for(let r=1;r<f.expandedStates.length+1;r++)if(r>=f.expandedStates.length){o.push({indent:e,mode:Or,doc:t});break}else{let t={indent:e,mode:kr,doc:f.expandedStates[r]};if(jr(t,o,i,s,n)){o.push(t);break}}}else o.push({indent:e,mode:Or,doc:f.contents});break}}f.id&&(n[f.id]=It(0,o,-1).mode);break;case Gt:{let t=r-a,i=f[Ar]??0,{parts:s}=f,c=s.length-i;if(c===0)break;let u=s[i+0],p=s[i+1],m={indent:e,mode:kr,doc:u},h={indent:e,mode:Or,doc:u},g=jr(m,[],t,l.length>0,n,!0);if(c===1){g?o.push(m):o.push(h);break}let _={indent:e,mode:kr,doc:p},v={indent:e,mode:Or,doc:p};if(c===2){g?o.push(_,m):o.push(v,h);break}let y=s[i+2],b={indent:e,mode:d,doc:{...f,[Ar]:i+2}},x=jr({indent:e,mode:kr,doc:[u,p,y]},[],t,l.length>0,n,!0);o.push(b),x?o.push(_,m):g?o.push(v,m):o.push(v,h);break}case Kt:case qt:{let t=f.groupId?n[f.groupId]:d;if(t===Or){let t=f.type===Kt?f.breakContents:f.negate?f.contents:An(f.contents);t&&o.push({indent:e,mode:d,doc:t})}if(t===kr){let t=f.type===Kt?f.flatContents:f.negate?An(f.contents):f.contents;t&&o.push({indent:e,mode:d,doc:t})}break}case Jt:l.push({indent:e,mode:d,doc:f.contents});break;case Yt:l.length>0&&o.push({indent:e,mode:d,doc:qn});break;case Xt:switch(d){case kr:if(f.hard)c=!0;else{f.soft||(s+=` `,a+=1);break}case Or:if(l.length>0){o.push({indent:e,mode:d,doc:f},...l.reverse()),l.length=0;break}f.literal?(s+=i,a=0,e.root&&(e.root.value&&(s+=e.root.value),a=e.root.length)):(_(),s+=i+e.value,a=e.length);break}break;case Zt:o.push({indent:e,mode:d,doc:f.contents});break;case Qt:break;default:throw new on(f)}o.length===0&&l.length>0&&(o.push(...l.reverse()),l.length=0)}let m=d.join(``)+s,h=[...f,...u];if(h.length!==2)return{formatted:m};let g=h[0];return{formatted:m,cursorNodeStart:g,cursorNodeText:m.slice(g,It(0,h,-1))};function _(){let{text:e,count:t}=Dr(s);e&&(d.push(e),p+=e.length),s=``,a-=t,u.length>0&&(f.push(...u.map(e=>Math.min(e,p))),u.length=0)}}var Nr={join:Un,line:Gn,softline:Kn,hardline:Jn,literalline:Xn,group:zn,conditionalGroup:Bn,fill:Rn,lineSuffix:Zn,lineSuffixBoundary:Qn,cursor:Ln,breakParent:In,ifBreak:Vn,trim:$n,indent:An,indentIfBreak:Hn,align:jn,addAlignmentToDoc:Fn,markAsRoot:Nn,dedentToRoot:Mn,dedent:Pn,hardlineWithoutBreakParent:qn,literallineWithoutBreakParent:Yn,label:Wn,concat:e=>e},Pr={printDocToString:Mr},Fr={willBreak:pn,traverseDoc:ln,findInDoc:dn,mapDoc:un,removeLines:_n,stripTrailingHardline:bn,replaceEndOfLine:Cn,canBreak:Tn};const Ir=u(import.meta.url);_(p(import.meta.url));var Lr=Object.create,Rr=Object.defineProperty,zr=Object.getOwnPropertyDescriptor,Br=Object.getOwnPropertyNames,Vr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,W=(e=>Ir===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(Ir===void 0?e:Ir)[t]}):e:Ir)(function(e){if(Ir!==void 0)return Ir.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),G=(e,t)=>function(){return t||(0,e[Br(e)[0]])((t={exports:{}}).exports,t),t.exports},Ur=(e,t)=>{for(var n in t)Rr(e,n,{get:t[n],enumerable:!0})},Wr=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Br(t))!Hr.call(e,i)&&i!==n&&Rr(e,i,{get:()=>t[i],enumerable:!(r=zr(t,i))||r.enumerable});return e},Gr=(e,t,n)=>(n=e==null?{}:Lr(Vr(e)),Wr(t||!e||!e.__esModule?Rr(n,`default`,{value:e,enumerable:!0}):n,e)),Kr=G({"node_modules/fast-glob/out/utils/array.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.splitWhen=e.flatten=void 0;function t(e){return e.reduce((e,t)=>[].concat(e,t),[])}e.flatten=t;function n(e,t){let n=[[]],r=0;for(let i of e)t(i)?(r++,n[r]=[]):n[r].push(i);return n}e.splitWhen=n}}),qr=G({"node_modules/fast-glob/out/utils/errno.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isEnoentCodeError=void 0;function t(e){return e.code===`ENOENT`}e.isEnoentCodeError=t}}),Jr=G({"node_modules/fast-glob/out/utils/fs.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n}}),Yr=G({"node_modules/fast-glob/out/utils/path.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPosixPathToPattern=e.convertWindowsPathToPattern=e.convertPathToPattern=e.escapePosixPath=e.escapeWindowsPath=e.escape=e.removeLeadingDotSegment=e.makeAbsolute=e.unixify=void 0;var t=W(`os`),n=W(`path`),r=t.platform()===`win32`,i=2,a=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,o=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,c=/\\(?![!()+@[\]{}])/g;function l(e){return e.replace(/\\/g,`/`)}e.unixify=l;function u(e,t){return n.resolve(e,t)}e.makeAbsolute=u;function d(e){if(e.charAt(0)===`.`){let t=e.charAt(1);if(t===`/`||t===`\\`)return e.slice(i)}return e}e.removeLeadingDotSegment=d,e.escape=r?f:p;function f(e){return e.replace(o,`\\$2`)}e.escapeWindowsPath=f;function p(e){return e.replace(a,`\\$2`)}e.escapePosixPath=p,e.convertPathToPattern=r?m:h;function m(e){return f(e).replace(s,`//$1`).replace(c,`/`)}e.convertWindowsPathToPattern=m;function h(e){return p(e)}e.convertPosixPathToPattern=h}}),Xr=G({"node_modules/is-extglob/index.js"(e,t){t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}}}),Zr=G({"node_modules/is-glob/index.js"(e,t){var n=Xr(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(var t=0,n=-2,i=-2,a=-2,o=-2,s=-2;t<e.length;){if(e[t]===`*`||e[t+1]===`?`&&/[\].+)]/.test(e[t])||i!==-1&&e[t]===`[`&&e[t+1]!==`]`&&(i<t&&(i=e.indexOf(`]`,t)),i>t&&(s===-1||s>i||(s=e.indexOf(`\\`,t),s===-1||s>i)))||a!==-1&&e[t]===`{`&&e[t+1]!==`}`&&(a=e.indexOf(`}`,t),a>t&&(s=e.indexOf(`\\`,t),s===-1||s>a))||o!==-1&&e[t]===`(`&&e[t+1]===`?`&&/[:!=]/.test(e[t+2])&&e[t+3]!==`)`&&(o=e.indexOf(`)`,t),o>t&&(s=e.indexOf(`\\`,t),s===-1||s>o))||n!==-1&&e[t]===`(`&&e[t+1]!==`|`&&(n<t&&(n=e.indexOf(`|`,t)),n!==-1&&e[n+1]!==`)`&&(o=e.indexOf(`)`,n),o>n&&(s=e.indexOf(`\\`,n),s===-1||s>o))))return!0;if(e[t]===`\\`){var c=e[t+1];t+=2;var l=r[c];if(l){var u=e.indexOf(l,t);u!==-1&&(t=u+1)}if(e[t]===`!`)return!0}else t++}return!1},a=function(e){if(e[0]===`!`)return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]===`\\`){var n=e[t+1];t+=2;var i=r[n];if(i){var a=e.indexOf(i,t);a!==-1&&(t=a+1)}if(e[t]===`!`)return!0}else t++}return!1};t.exports=function(e,t){if(typeof e!=`string`||e===``)return!1;if(n(e))return!0;var r=i;return t&&t.strict===!1&&(r=a),r(e)}}}),Qr=G({"node_modules/fast-glob/node_modules/glob-parent/index.js"(e,t){var n=Zr(),r=W(`path`).posix.dirname,i=W(`os`).platform()===`win32`,a=`/`,o=/\\/g,s=/[\{\[].*[\}\]]$/,c=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&i&&e.indexOf(a)<0&&(e=e.replace(o,a)),s.test(e)&&(e+=a),e+=`a`;do e=r(e);while(n(e)||c.test(e));return e.replace(l,`$1`)}}}),$r=G({"node_modules/braces/lib/utils.js"(e){e.isInteger=e=>typeof e==`number`?Number.isInteger(e):typeof e==`string`&&e.trim()!==``?Number.isInteger(Number(e)):!1,e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||r.type===`open`||r.type===`close`)&&r.escaped!==!0&&(r.value=`\\`+r.value,r.escaped=!0)},e.encloseBrace=e=>e.type===`brace`?e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0):!1,e.isInvalidBrace=e=>e.type===`brace`?e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1:!1,e.isOpenOrClose=e=>e.type===`open`||e.type===`close`?!0:e.open===!0||e.close===!0,e.reduce=e=>e.reduce((e,t)=>(t.type===`text`&&e.push(t.value),t.type===`range`&&(t.type=`text`),e),[]),e.flatten=(...e)=>{let t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(Array.isArray(i)){n(i);continue}i!==void 0&&t.push(i)}return t};return n(e),t}}}),ei=G({"node_modules/braces/lib/stringify.js"(e,t){var n=$r();t.exports=(e,t={})=>{let r=(e,i={})=>{let a=t.escapeInvalid&&n.isInvalidBrace(i),o=e.invalid===!0&&t.escapeInvalid===!0,s=``;if(e.value)return(a||o)&&n.isOpenOrClose(e)?`\\`+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=r(t);return s};return r(e)}}}),ti=G({"node_modules/is-number/index.js"(e,t){t.exports=function(e){return typeof e==`number`?e-e===0:typeof e==`string`&&e.trim()!==``?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}}}),ni=G({"node_modules/to-regex-range/index.js"(e,t){var n=ti(),r=(e,t,a)=>{if(n(e)===!1)throw TypeError(`toRegexRange: expected the first argument to be a number`);if(t===void 0||e===t)return String(e);if(n(t)===!1)throw TypeError(`toRegexRange: expected the second argument to be a number.`);let o={relaxZeros:!0,...a};typeof o.strictZeros==`boolean`&&(o.relaxZeros=o.strictZeros===!1);let c=String(o.relaxZeros),l=String(o.shorthand),u=String(o.capture),d=String(o.wrap),f=e+`:`+t+`=`+c+l+u+d;if(r.cache.hasOwnProperty(f))return r.cache[f].result;let p=Math.min(e,t),m=Math.max(e,t);if(Math.abs(p-m)===1){let n=e+`|`+t;return o.capture?`(${n})`:o.wrap===!1?n:`(?:${n})`}let h=g(e)||g(t),_={min:e,max:t,a:p,b:m},v=[],y=[];return h&&(_.isPadded=h,_.maxLen=String(_.max).length),p<0&&(y=s(m<0?Math.abs(m):1,Math.abs(p),_,o),p=_.a=0),m>=0&&(v=s(p,m,_,o)),_.negatives=y,_.positives=v,_.result=i(y,v,o),o.capture===!0?_.result=`(${_.result})`:o.wrap!==!1&&v.length+y.length>1&&(_.result=`(?:${_.result})`),r.cache[f]=_,_.result};function i(e,t,n){let r=c(e,t,`-`,!1,n)||[],i=c(t,e,``,!1,n)||[],a=c(e,t,`-?`,!0,n)||[];return r.concat(a).concat(i).join(`|`)}function a(e,t){let n=1,r=1,i=f(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=f(e,n);for(i=p(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=p(t+1,r)-1;return a=[...a],a.sort(u),a}function o(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=l(e,t),i=r.length,a=``,o=0;for(let e=0;e<i;e++){let[t,i]=r[e];t===i?a+=t:t!==`0`||i!==`9`?a+=h(t,i,n):o++}return o&&(a+=n.shorthand===!0?`\\d`:`[0-9]`),{pattern:a,count:[o],digits:i}}function s(e,t,n,r){let i=a(e,t),s=[],c=e,l;for(let e=0;e<i.length;e++){let t=i[e],a=o(String(c),String(t),r),u=``;if(!n.isPadded&&l&&l.pattern===a.pattern){l.count.length>1&&l.count.pop(),l.count.push(a.count[0]),l.string=l.pattern+m(l.count),c=t+1;continue}n.isPadded&&(u=_(t,n,r)),a.string=u+a.pattern+m(a.count),s.push(a),c=t+1,l=a}return s}function c(e,t,n,r,i){let a=[];for(let i of e){let{string:e}=i;!r&&!d(t,`string`,e)&&a.push(n+e),r&&d(t,`string`,e)&&a.push(n+e)}return a}function l(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function u(e,t){return e>t?1:t>e?-1:0}function d(e,t,n){return e.some(e=>e[t]===n)}function f(e,t){return Number(String(e).slice(0,-t)+`9`.repeat(t))}function p(e,t){return e-e%10**t}function m(e){let[t=0,n=``]=e;return n||t>1?`{${t+(n?`,`+n:``)}}`:``}function h(e,t,n){return`[${e}${t-e===1?``:`-`}${t}]`}function g(e){return/^-?(0+)\d/.test(e)}function _(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return``;case 1:return i?`0?`:`0`;case 2:return i?`0{0,2}`:`00`;default:return i?`0{0,${r}}`:`0{${r}}`}}r.cache={},r.clearCache=()=>r.cache={},t.exports=r}}),ri=G({"node_modules/fill-range/index.js"(e,t){var n=W(`util`),r=ni(),i=e=>typeof e==`object`&&!!e&&!Array.isArray(e),a=e=>t=>e===!0?Number(t):String(t),o=e=>typeof e==`number`||typeof e==`string`&&e!==``,s=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,n=-1;if(t[0]===`-`&&(t=t.slice(1)),t===`0`)return!1;for(;t[++n]===`0`;);return n>0},l=(e,t,n)=>typeof e==`string`||typeof t==`string`?!0:n.stringify===!0,u=(e,t,n)=>{if(t>0){let n=e[0]===`-`?`-`:``;n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,`0`)}return n===!1?String(e):e},d=(e,t)=>{let n=e[0]===`-`?`-`:``;for(n&&(e=e.slice(1),t--);e.length<t;)e=`0`+e;return n?`-`+e:e},f=(e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:+(e>t)),e.positives.sort((e,t)=>e<t?-1:+(e>t));let r=t.capture?``:`?:`,i=``,a=``,o;return e.positives.length&&(i=e.positives.map(e=>d(String(e),n)).join(`|`)),e.negatives.length&&(a=`-(${r}${e.negatives.map(e=>d(String(e),n)).join(`|`)})`),o=i&&a?`${i}|${a}`:i||a,t.wrap?`(${r}${o})`:o},p=(e,t,n,i)=>{if(n)return r(e,t,{wrap:!1,...i});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},m=(e,t,n)=>{if(Array.isArray(e)){let t=n.wrap===!0,r=n.capture?``:`?:`;return t?`(${r}${e.join(`|`)})`:e.join(`|`)}return r(e,t,n)},h=(...e)=>RangeError(`Invalid range arguments: `+n.inspect(...e)),g=(e,t,n)=>{if(n.strictRanges===!0)throw h([e,t]);return[]},_=(e,t)=>{if(t.strictRanges===!0)throw TypeError(`Expected step "${e}" to be a number`);return[]},v=(e,t,n=1,r={})=>{let i=Number(e),o=Number(t);if(!Number.isInteger(i)||!Number.isInteger(o)){if(r.strictRanges===!0)throw h([e,t]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,g=String(e),_=String(t),v=String(n);n=Math.max(Math.abs(n),1);let y=c(g)||c(_)||c(v),b=y?Math.max(g.length,_.length,v.length):0,x=y===!1&&l(e,t,r)===!1,S=r.transform||a(x);if(r.toRegex&&n===1)return p(d(e,b),d(t,b),!0,r);let C={negatives:[],positives:[]},w=e=>C[e<0?`negatives`:`positives`].push(Math.abs(e)),T=[],E=0;for(;s?i>=o:i<=o;)r.toRegex===!0&&n>1?w(i):T.push(u(S(i,E),b,x)),i=s?i-n:i+n,E++;return r.toRegex===!0?n>1?f(C,r,b):m(T,null,{wrap:!1,...r}):T},y=(e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return g(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),c=a>o,l=Math.min(a,o),u=Math.max(a,o);if(r.toRegex&&n===1)return p(l,u,!1,r);let d=[],f=0;for(;c?a>=o:a<=o;)d.push(i(a,f)),a=c?a-n:a+n,f++;return r.toRegex===!0?m(d,null,{wrap:!1,options:r}):d},b=(e,t,n,r={})=>{if(t==null&&o(e))return[e];if(!o(e)||!o(t))return g(e,t,r);if(typeof n==`function`)return b(e,t,1,{transform:n});if(i(n))return b(e,t,0,n);let a={...r};return a.capture===!0&&(a.wrap=!0),n=n||a.step||1,s(n)?s(e)&&s(t)?v(e,t,n,a):y(e,t,Math.max(Math.abs(n),1),a):n!=null&&!i(n)?_(n,a):b(e,t,1,n)};t.exports=b}}),ii=G({"node_modules/braces/lib/compile.js"(e,t){var n=ri(),r=$r();t.exports=(e,t={})=>{let i=(e,a={})=>{let o=r.isInvalidBrace(a),s=e.invalid===!0&&t.escapeInvalid===!0,c=o===!0||s===!0,l=t.escapeInvalid===!0?`\\`:``,u=``;if(e.isOpen===!0)return l+e.value;if(e.isClose===!0)return console.log(`node.isClose`,l,e.value),l+e.value;if(e.type===`open`)return c?l+e.value:`(`;if(e.type===`close`)return c?l+e.value:`)`;if(e.type===`comma`)return e.prev.type===`comma`?``:c?e.value:`|`;if(e.value)return e.value;if(e.nodes&&e.ranges>0){let i=r.reduce(e.nodes),a=n(...i,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(a.length!==0)return i.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)u+=i(t,e);return u};return i(e)}}}),ai=G({"node_modules/braces/lib/expand.js"(e,t){var n=ri(),r=ei(),i=$r(),a=(e=``,t=``,n=!1)=>{let r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?i.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(a(e,t,n));else for(let e of t)n===!0&&typeof e==`string`&&(e=`{${e}}`),r.push(Array.isArray(e)?a(i,e,n):i+e);return i.flatten(r)};t.exports=(e,t={})=>{let o=t.rangeLimit===void 0?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;l.type!==`brace`&&l.type!==`root`&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar){u.push(a(u.pop(),r(e,t)));return}if(e.type===`brace`&&e.invalid!==!0&&e.nodes.length===2){u.push(a(u.pop(),[`{}`]));return}if(e.nodes&&e.ranges>0){let s=i.reduce(e.nodes);if(i.exceedsLimit(...s,t.step,o))throw RangeError(`expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.`);let c=n(...s,t);c.length===0&&(c=r(e,t)),u.push(a(u.pop(),c)),e.nodes=[];return}let d=i.encloseBrace(e),f=e.queue,p=e;for(;p.type!==`brace`&&p.type!==`root`&&p.parent;)p=p.parent,f=p.queue;for(let t=0;t<e.nodes.length;t++){let n=e.nodes[t];if(n.type===`comma`&&e.type===`brace`){t===1&&f.push(``),f.push(``);continue}if(n.type===`close`){u.push(a(u.pop(),f,d));continue}if(n.value&&n.type!==`open`){f.push(a(f.pop(),n.value));continue}n.nodes&&s(n,e)}return f};return i.flatten(s(e))}}}),oi=G({"node_modules/braces/lib/constants.js"(e,t){t.exports={MAX_LENGTH:1e4,CHAR_0:`0`,CHAR_9:`9`,CHAR_UPPERCASE_A:`A`,CHAR_LOWERCASE_A:`a`,CHAR_UPPERCASE_Z:`Z`,CHAR_LOWERCASE_Z:`z`,CHAR_LEFT_PARENTHESES:`(`,CHAR_RIGHT_PARENTHESES:`)`,CHAR_ASTERISK:`*`,CHAR_AMPERSAND:`&`,CHAR_AT:`@`,CHAR_BACKSLASH:`\\`,CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:`\r`,CHAR_CIRCUMFLEX_ACCENT:`^`,CHAR_COLON:`:`,CHAR_COMMA:`,`,CHAR_DOLLAR:`$`,CHAR_DOT:`.`,CHAR_DOUBLE_QUOTE:`"`,CHAR_EQUAL:`=`,CHAR_EXCLAMATION_MARK:`!`,CHAR_FORM_FEED:`\f`,CHAR_FORWARD_SLASH:`/`,CHAR_HASH:`#`,CHAR_HYPHEN_MINUS:`-`,CHAR_LEFT_ANGLE_BRACKET:`<`,CHAR_LEFT_CURLY_BRACE:`{`,CHAR_LEFT_SQUARE_BRACKET:`[`,CHAR_LINE_FEED:`
156
+ `,CHAR_NO_BREAK_SPACE:`\xA0`,CHAR_PERCENT:`%`,CHAR_PLUS:`+`,CHAR_QUESTION_MARK:`?`,CHAR_RIGHT_ANGLE_BRACKET:`>`,CHAR_RIGHT_CURLY_BRACE:`}`,CHAR_RIGHT_SQUARE_BRACKET:`]`,CHAR_SEMICOLON:`;`,CHAR_SINGLE_QUOTE:`'`,CHAR_SPACE:` `,CHAR_TAB:` `,CHAR_UNDERSCORE:`_`,CHAR_VERTICAL_LINE:`|`,CHAR_ZERO_WIDTH_NOBREAK_SPACE:``}}}),si=G({"node_modules/braces/lib/parse.js"(e,t){var n=ei(),{MAX_LENGTH:r,CHAR_BACKSLASH:i,CHAR_BACKTICK:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=oi();t.exports=(e,t={})=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);let v=t||{},y=typeof v.maxLength==`number`?Math.min(r,v.maxLength):r;if(e.length>y)throw SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let b={type:`root`,input:e,nodes:[]},x=[b],S=b,C=b,w=0,T=e.length,E=0,D=0,O,k=()=>e[E++],A=e=>{if(e.type===`text`&&C.type===`dot`&&(C.type=`text`),C&&C.type===`text`&&e.type===`text`){C.value+=e.value;return}return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e};for(A({type:`bos`});E<T;)if(S=x[x.length-1],O=k(),!(O===_||O===g)){if(O===i){A({type:`text`,value:(t.keepEscaping?O:``)+k()});continue}if(O===p){A({type:`text`,value:`\\`+O});continue}if(O===f){w++;let e;for(;E<T&&(e=k());){if(O+=e,e===f){w++;continue}if(e===i){O+=k();continue}if(e===p&&(w--,w===0))break}A({type:`text`,value:O});continue}if(O===c){S=A({type:`paren`,nodes:[]}),x.push(S),A({type:`text`,value:O});continue}if(O===l){if(S.type!==`paren`){A({type:`text`,value:O});continue}S=x.pop(),A({type:`text`,value:O}),S=x[x.length-1];continue}if(O===m||O===h||O===a){let e=O,n;for(t.keepQuotes!==!0&&(O=``);E<T&&(n=k());){if(n===i){O+=n+k();continue}if(n===e){t.keepQuotes===!0&&(O+=n);break}O+=n}A({type:`text`,value:O});continue}if(O===u){D++,S=A({type:`brace`,open:!0,close:!1,dollar:C.value&&C.value.slice(-1)===`$`||S.dollar===!0,depth:D,commas:0,ranges:0,nodes:[]}),x.push(S),A({type:`open`,value:O});continue}if(O===d){if(S.type!==`brace`){A({type:`text`,value:O});continue}S=x.pop(),S.close=!0,A({type:`close`,value:O}),D--,S=x[x.length-1];continue}if(O===o&&D>0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:`text`,value:n(S)}]}A({type:`comma`,value:O}),S.commas++;continue}if(O===s&&D>0&&S.commas===0){let e=S.nodes;if(D===0||e.length===0){A({type:`text`,value:O});continue}if(C.type===`dot`){if(S.range=[],C.value+=O,C.type=`range`,S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,C.type=`text`;continue}S.ranges++,S.args=[];continue}if(C.type===`range`){e.pop();let t=e[e.length-1];t.value+=C.value+O,C=t,S.ranges--;continue}A({type:`dot`,value:O});continue}A({type:`text`,value:O})}do if(S=x.pop(),S.type!==`root`){S.nodes.forEach(e=>{e.nodes||(e.type===`open`&&(e.isOpen=!0),e.type===`close`&&(e.isClose=!0),e.nodes||(e.type=`text`),e.invalid=!0)});let e=x[x.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}while(x.length>0);return A({type:`eos`}),b}}}),ci=G({"node_modules/braces/index.js"(e,t){var n=ei(),r=ii(),i=ai(),a=si(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};o.parse=(e,t={})=>a(e,t),o.stringify=(e,t={})=>n(typeof e==`string`?o.parse(e,t):e,t),o.compile=(e,t={})=>(typeof e==`string`&&(e=o.parse(e,t)),r(e,t)),o.expand=(e,t={})=>{typeof e==`string`&&(e=o.parse(e,t));let n=i(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n},o.create=(e,t={})=>e===``||e.length<3?[e]:t.expand===!0?o.expand(e,t):o.compile(e,t),t.exports=o}}),li=G({"node_modules/micromatch/node_modules/picomatch/lib/constants.js"(e,t){var n=W(`path`),r=`\\\\/`,i=`[^${r}]`,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f},h={...m,SLASH_LITERAL:`[${r}]`,QMARK:i,STAR:`${i}*?`,DOTS_SLASH:`${a}{1,2}(?:[${r}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${r}])${a}{1,2}(?:[${r}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${r}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${r}]|$))`,QMARK_NO_DOT:`[^.${r}]`,START_ANCHOR:`(?:^|[${r}])`,END_ANCHOR:`(?:[${r}]|$)`};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:n.sep,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}}}),ui=G({"node_modules/micromatch/node_modules/picomatch/lib/utils.js"(e){var t=W(`path`),n=process.platform===`win32`,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=li();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>a.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,`\\$1`),e.toPosixSlashes=e=>e.replace(r,`/`),e.removeBackslashes=e=>e.replace(i,e=>e===`\\`?``:e),e.supportsLookbehinds=()=>{let e=process.version.slice(1).split(`.`).map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10},e.isWindows=e=>e&&typeof e.windows==`boolean`?e.windows:n===!0||t.sep===`\\`,e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r}}}),di=G({"node_modules/micromatch/node_modules/picomatch/lib/scan.js"(e,t){var n=ui(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=li(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,ee=!1,j=!1,M=!1,N=!1,te=!1,P=!1,F=!1,ne=!1,I=!1,re=0,L,R,z={value:``,depth:0,isGlob:!1},B=()=>D>=x,ie=()=>E.charCodeAt(D+1),V=()=>(L=R,E.charCodeAt(++D));for(;D<x;){R=V();let e;if(R===a){P=z.backslashes=!0,R=V(),R===u&&(te=!0);continue}if(te===!0||R===u){for(re++;B()!==!0&&(R=V());){if(R===a){P=z.backslashes=!0,V();continue}if(R===u){re++;continue}if(te!==!0&&R===s&&(R=V())===s){if(A=z.isBrace=!0,j=z.isGlob=!0,I=!0,S===!0)continue;break}if(te!==!0&&R===o){if(A=z.isBrace=!0,j=z.isGlob=!0,I=!0,S===!0)continue;break}if(R===h&&(re--,re===0)){te=!1,A=z.isBrace=!0,I=!0;break}}if(S===!0)continue;break}if(R===l){if(C.push(D),w.push(z),z={value:``,depth:0,isGlob:!1},I===!0)continue;if(L===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(R===p||R===i||R===r||R===m||R===c)&&ie()===d){if(j=z.isGlob=!0,M=z.isExtglob=!0,I=!0,R===c&&D===O&&(ne=!0),S===!0){for(;B()!==!0&&(R=V());){if(R===a){P=z.backslashes=!0,R=V();continue}if(R===g){j=z.isGlob=!0,I=!0;break}}continue}break}if(R===r){if(L===r&&(N=z.isGlobstar=!0),j=z.isGlob=!0,I=!0,S===!0)continue;break}if(R===m){if(j=z.isGlob=!0,I=!0,S===!0)continue;break}if(R===f){for(;B()!==!0&&(e=V());){if(e===a){P=z.backslashes=!0,V();continue}if(e===_){ee=z.isBracket=!0,j=z.isGlob=!0,I=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&R===c&&D===O){F=z.negated=!0,O++;continue}if(b.noparen!==!0&&R===d){if(j=z.isGlob=!0,S===!0){for(;B()!==!0&&(R=V());){if(R===d){P=z.backslashes=!0,R=V();continue}if(R===g){I=!0;break}}continue}break}if(j===!0){if(I=!0,S===!0)continue;break}}b.noext===!0&&(M=!1,j=!1);let H=E,ae=``,oe=``;O>0&&(ae=E.slice(0,O),E=E.slice(O),k-=O),H&&j===!0&&k>0?(H=E.slice(0,k),oe=E.slice(k)):j===!0?(H=``,oe=E):H=E,H&&H!==``&&H!==`/`&&H!==E&&v(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),b.unescape===!0&&(oe&&=n.removeBackslashes(oe),H&&P===!0&&(H=n.removeBackslashes(H)));let se={prefix:ae,input:e,start:O,base:H,glob:oe,isBrace:A,isBracket:ee,isGlob:j,isExtglob:M,isGlobstar:N,negated:F,negatedExtglob:ne};if(b.tokens===!0&&(se.maxDepth=0,v(R)||w.push(z),se.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=ae):w[n].value=a,y(w[n]),se.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),se.maxDepth+=w[w.length-1].depth)}se.slashes=C,se.parts=T}return se}}}),fi=G({"node_modules/micromatch/node_modules/picomatch/lib/parse.js"(e,t){var n=li(),r=ui(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let f={...t},p=typeof f.maxLength==`number`?Math.min(i,f.maxLength):i,m=e.length;if(m>p)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`);let h={type:`bos`,value:``,output:f.prepend||``},g=[h],_=f.capture?``:`?:`,v=r.isWindows(t),y=n.globChars(v),b=n.extglobChars(y),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:ee,START_ANCHOR:j}=y,M=e=>`(${_}(?:(?!${j}${e.dot?T:x}).)*?)`,N=f.dot?``:E,te=f.dot?k:A,P=f.bash===!0?M(f):ee;f.capture&&(P=`(${P})`),typeof f.noext==`boolean`&&(f.noextglob=f.noext);let F={input:e,index:-1,start:0,dot:f.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};e=r.removePrefix(e,F),m=e.length;let ne=[],I=[],re=[],L=h,R,z=()=>F.index===m-1,B=F.peek=(t=1)=>e[F.index+t],ie=F.advance=()=>e[++F.index]||``,V=()=>e.slice(F.index+1),H=(e=``,t=0)=>{F.consumed+=e,F.index+=t},ae=e=>{F.output+=e.output==null?e.value:e.output,H(e.value)},oe=()=>{let e=1;for(;B()===`!`&&(B(2)!==`(`||B(3)===`?`);)ie(),F.start++,e++;return e%2==0?!1:(F.negated=!0,F.start++,!0)},se=e=>{F[e]++,re.push(e)},ce=e=>{F[e]--,re.pop()},U=e=>{if(L.type===`globstar`){let t=F.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ne.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(F.output=F.output.slice(0,-L.output.length),L.type=`star`,L.value=`*`,L.output=P,F.output+=L.output)}if(ne.length&&e.type!==`paren`&&(ne[ne.length-1].inner+=e.value),(e.value||e.output)&&ae(e),L&&L.type===`text`&&e.type===`text`){L.value+=e.value,L.output=(L.output||``)+e.value;return}e.prev=L,g.push(e),L=e},le=(e,t)=>{let n={...b[t],conditions:1,inner:``};n.prev=L,n.parens=F.parens,n.output=F.output;let r=(f.capture?`(`:``)+n.open;se(`parens`),U({type:e,value:t,output:F.output?``:w}),U({type:`paren`,extglob:!0,value:ie(),output:r}),ne.push(n)},ue=e=>{let n=e.close+(f.capture?`)`:``),r;if(e.type===`negate`){let i=P;e.inner&&e.inner.length>1&&e.inner.includes(`/`)&&(i=M(f)),(i!==P||z()||/^\)+$/.test(V()))&&(n=e.close=`)$))${i}`),e.inner.includes(`*`)&&(r=V())&&/^\.[^\\/.]+$/.test(r)&&(n=e.close=`)${d(r,{...t,fastpaths:!1}).output})${i})`),e.prev.type===`bos`&&(F.negatedExtglob=!0)}U({type:`paren`,extglob:!0,value:R,output:n}),ce(`parens`)};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?te+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?P:``):P:t?e:`\\${e}`);return n===!0&&(i=f.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&f.contains===!0?(F.output=e,F):(F.output=r.wrapOutput(i,F,t),F)}for(;!z();){if(R=ie(),R===`\0`)continue;if(R===`\\`){let e=B();if(e===`/`&&f.bash!==!0||e===`.`||e===`;`)continue;if(!e){R+=`\\`,U({type:`text`,value:R});continue}let t=/^\\+/.exec(V()),n=0;if(t&&t[0].length>2&&(n=t[0].length,F.index+=n,n%2!=0&&(R+=`\\`)),f.unescape===!0?R=ie():R+=ie(),F.brackets===0){U({type:`text`,value:R});continue}}if(F.brackets>0&&(R!==`]`||L.value===`[`||L.value===`[^`)){if(f.posix!==!1&&R===`:`){let e=L.value.slice(1);if(e.includes(`[`)&&(L.posix=!0,e.includes(`:`))){let e=L.value.lastIndexOf(`[`),t=L.value.slice(0,e),n=a[L.value.slice(e+2)];if(n){L.value=t+n,F.backtrack=!0,ie(),!h.output&&g.indexOf(L)===1&&(h.output=w);continue}}}(R===`[`&&B()!==`:`||R===`-`&&B()===`]`)&&(R=`\\${R}`),R===`]`&&(L.value===`[`||L.value===`[^`)&&(R=`\\${R}`),f.posix===!0&&R===`!`&&L.value===`[`&&(R=`^`),L.value+=R,ae({value:R});continue}if(F.quotes===1&&R!==`"`){R=r.escapeRegex(R),L.value+=R,ae({value:R});continue}if(R===`"`){F.quotes=F.quotes===1?0:1,f.keepQuotes===!0&&U({type:`text`,value:R});continue}if(R===`(`){se(`parens`),U({type:`paren`,value:R});continue}if(R===`)`){if(F.parens===0&&f.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ne[ne.length-1];if(e&&F.parens===e.parens+1){ue(ne.pop());continue}U({type:`paren`,value:R,output:F.parens?`)`:`\\)`}),ce(`parens`);continue}if(R===`[`){if(f.nobracket===!0||!V().includes(`]`)){if(f.nobracket!==!0&&f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));R=`\\${R}`}else se(`brackets`);U({type:`bracket`,value:R});continue}if(R===`]`){if(f.nobracket===!0||L&&L.type===`bracket`&&L.value.length===1){U({type:`text`,value:R,output:`\\${R}`});continue}if(F.brackets===0){if(f.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));U({type:`text`,value:R,output:`\\${R}`});continue}ce(`brackets`);let e=L.value.slice(1);if(L.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(R=`/${R}`),L.value+=R,ae({value:R}),f.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(L.value);if(F.output=F.output.slice(0,-L.value.length),f.literalBrackets===!0){F.output+=t,L.value=t;continue}L.value=`(${_}${t}|${L.value})`,F.output+=L.value;continue}if(R===`{`&&f.nobrace!==!0){se(`braces`);let e={type:`brace`,value:R,output:`(`,outputIndex:F.output.length,tokensIndex:F.tokens.length};I.push(e),U(e);continue}if(R===`}`){let e=I[I.length-1];if(f.nobrace===!0||!e){U({type:`text`,value:R,output:R});continue}let t=`)`;if(e.dots===!0){let e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,f),F.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=F.output.slice(0,e.outputIndex),r=F.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,R=t=`\\}`,F.output=n;for(let e of r)F.output+=e.output||e.value}U({type:`brace`,value:R,output:t}),ce(`braces`),I.pop();continue}if(R===`|`){ne.length>0&&ne[ne.length-1].conditions++,U({type:`text`,value:R});continue}if(R===`,`){let e=R,t=I[I.length-1];t&&re[re.length-1]===`braces`&&(t.comma=!0,e=`|`),U({type:`comma`,value:R,output:e});continue}if(R===`/`){if(L.type===`dot`&&F.index===F.start+1){F.start=F.index+1,F.consumed=``,F.output=``,g.pop(),L=h;continue}U({type:`slash`,value:R,output:C});continue}if(R===`.`){if(F.braces>0&&L.type===`dot`){L.value===`.`&&(L.output=x);let e=I[I.length-1];L.type=`dots`,L.output+=R,L.value+=R,e.dots=!0;continue}if(F.braces+F.parens===0&&L.type!==`bos`&&L.type!==`slash`){U({type:`text`,value:R,output:x});continue}U({type:`dot`,value:R,output:x});continue}if(R===`?`){if(!(L&&L.value===`(`)&&f.noextglob!==!0&&B()===`(`&&B(2)!==`?`){le(`qmark`,R);continue}if(L&&L.type===`paren`){let e=B(),t=R;if(e===`<`&&!r.supportsLookbehinds())throw Error(`Node.js v10 or higher is required for regex lookbehinds`);(L.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(V()))&&(t=`\\${R}`),U({type:`text`,value:R,output:t});continue}if(f.dot!==!0&&(L.type===`slash`||L.type===`bos`)){U({type:`qmark`,value:R,output:A});continue}U({type:`qmark`,value:R,output:k});continue}if(R===`!`){if(f.noextglob!==!0&&B()===`(`&&(B(2)!==`?`||!/[!=<:]/.test(B(3)))){le(`negate`,R);continue}if(f.nonegate!==!0&&F.index===0){oe();continue}}if(R===`+`){if(f.noextglob!==!0&&B()===`(`&&B(2)!==`?`){le(`plus`,R);continue}if(L&&L.value===`(`||f.regex===!1){U({type:`plus`,value:R,output:S});continue}if(L&&(L.type===`bracket`||L.type===`paren`||L.type===`brace`)||F.parens>0){U({type:`plus`,value:R});continue}U({type:`plus`,value:S});continue}if(R===`@`){if(f.noextglob!==!0&&B()===`(`&&B(2)!==`?`){U({type:`at`,extglob:!0,value:R,output:``});continue}U({type:`text`,value:R});continue}if(R!==`*`){(R===`$`||R===`^`)&&(R=`\\${R}`);let e=o.exec(V());e&&(R+=e[0],F.index+=e[0].length),U({type:`text`,value:R});continue}if(L&&(L.type===`globstar`||L.star===!0)){L.type=`star`,L.star=!0,L.value+=R,L.output=P,F.backtrack=!0,F.globstar=!0,H(R);continue}let t=V();if(f.noextglob!==!0&&/^\([^?]/.test(t)){le(`star`,R);continue}if(L.type===`star`){if(f.noglobstar===!0){H(R);continue}let n=L.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(f.bash===!0&&(!i||t[0]&&t[0]!==`/`)){U({type:`star`,value:R,output:``});continue}let o=F.braces>0&&(n.type===`comma`||n.type===`brace`),s=ne.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){U({type:`star`,value:R,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[F.index+4];if(n&&n!==`/`)break;t=t.slice(3),H(`/**`,3)}if(n.type===`bos`&&z()){L.type=`globstar`,L.value+=R,L.output=M(f),F.output=L.output,F.globstar=!0,H(R);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&z()){F.output=F.output.slice(0,-(n.output+L.output).length),n.output=`(?:${n.output}`,L.type=`globstar`,L.output=M(f)+(f.strictSlashes?`)`:`|$)`),L.value+=R,F.globstar=!0,F.output+=n.output+L.output,H(R);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;F.output=F.output.slice(0,-(n.output+L.output).length),n.output=`(?:${n.output}`,L.type=`globstar`,L.output=`${M(f)}${C}|${C}${e})`,L.value+=R,F.output+=n.output+L.output,F.globstar=!0,H(R+ie()),U({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){L.type=`globstar`,L.value+=R,L.output=`(?:^|${C}|${M(f)}${C})`,F.output=L.output,F.globstar=!0,H(R+ie()),U({type:`slash`,value:`/`,output:``});continue}F.output=F.output.slice(0,-L.output.length),L.type=`globstar`,L.output=M(f),L.value+=R,F.output+=L.output,F.globstar=!0,H(R);continue}let n={type:`star`,value:R,output:P};if(f.bash===!0){n.output=`.*?`,(L.type===`bos`||L.type===`slash`)&&(n.output=N+n.output),U(n);continue}if(L&&(L.type===`bracket`||L.type===`paren`)&&f.regex===!0){n.output=R,U(n);continue}(F.index===F.start||L.type===`slash`||L.type===`dot`)&&(L.type===`dot`?(F.output+=D,L.output+=D):f.dot===!0?(F.output+=O,L.output+=O):(F.output+=N,L.output+=N),B()!==`*`&&(F.output+=w,L.output+=w)),U(n)}for(;F.brackets>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));F.output=r.escapeLast(F.output,`[`),ce(`brackets`)}for(;F.parens>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));F.output=r.escapeLast(F.output,`(`),ce(`parens`)}for(;F.braces>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));F.output=r.escapeLast(F.output,`{`),ce(`braces`)}if(f.strictSlashes!==!0&&(L.type===`star`||L.type===`bracket`)&&U({type:`maybe_slash`,value:``,output:`${C}?`}),F.backtrack===!0){F.output=``;for(let e of F.tokens)F.output+=e.output==null?e.value:e.output,e.suffix&&(F.output+=e.suffix)}return F};d.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let l=r.isWindows(t),{DOT_LITERAL:u,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:m,NO_DOTS:h,NO_DOTS_SLASH:g,STAR:_,START_ANCHOR:v}=n.globChars(l),y=a.dot?h:m,b=a.dot?g:m,x=a.capture?``:`?:`,S={negated:!1,prefix:``},C=a.bash===!0?`.*?`:_;a.capture&&(C=`(${C})`);let w=e=>e.noglobstar===!0?C:`(${x}(?:(?!${v}${e.dot?p:u}).)*?)`,T=e=>{switch(e){case`*`:return`${y}${f}${C}`;case`.*`:return`${u}${f}${C}`;case`*.*`:return`${y}${C}${u}${f}${C}`;case`*/*`:return`${y}${C}${d}${f}${b}${C}`;case`**`:return y+w(a);case`**/*`:return`(?:${y}${w(a)}${d})?${b}${f}${C}`;case`**/*.*`:return`(?:${y}${w(a)}${d})?${b}${C}${u}${f}${C}`;case`**/.*`:return`(?:${y}${w(a)}${d})?${u}${f}${C}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=T(t[1]);return n?n+u+t[2]:void 0}}},E=T(r.removePrefix(e,S));return E&&a.strictSlashes!==!0&&(E+=`${d}?`),E},t.exports=d}}),pi=G({"node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(e,t){var n=W(`path`),r=di(),i=fi(),a=ui(),o=li(),s=e=>e&&typeof e==`object`&&!Array.isArray(e),c=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>c(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=s(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},o=a.isWindows(t),l=r?c.compileRe(e,t):c.makeRe(e,t,!1,!0),u=l.state;delete l.state;let d=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};d=c(i.ignore,e,n)}let f=(n,r=!1)=>{let{isMatch:a,match:s,output:f}=c.test(n,l,t,{glob:e,posix:o}),p={glob:e,state:u,regex:l,posix:o,input:n,output:f,match:s,isMatch:a};return typeof i.onResult==`function`&&i.onResult(p),a===!1?(p.isMatch=!1,r?p:!1):d(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(f.state=u),f};c.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},s=o.format||(i?a.toPosixSlashes:null),l=e===r,u=l&&s?s(e):e;return l===!1&&(u=s?s(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?c.matchBase(e,t,n,i):t.exec(u)),{isMatch:!!l,match:l,output:u}},c.matchBase=(e,t,r,i=a.isWindows(r))=>(t instanceof RegExp?t:c.makeRe(t,r)).test(n.basename(e)),c.isMatch=(e,t,n)=>c(t,n)(e),c.parse=(e,t)=>Array.isArray(e)?e.map(e=>c.parse(e,t)):i(e,{...t,fastpaths:!1}),c.scan=(e,t)=>r(e,t),c.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let l=c.toRegex(s,t);return r===!0&&(l.state=e),l},c.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=i.fastpaths(e,t)),a.output||(a=i(e,t)),c.compileRe(a,t,n,r)},c.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},c.constants=o,t.exports=c}}),mi=G({"node_modules/micromatch/node_modules/picomatch/index.js"(e,t){t.exports=pi()}}),hi=G({"node_modules/micromatch/index.js"(e,t){var n=W(`util`),r=ci(),i=mi(),a=ui(),o=e=>e===``||e===`./`,s=e=>{let t=e.indexOf(`{`);return t>-1&&e.indexOf(`}`,t)>-1},c=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,a=new Set,o=new Set,s=0,c=e=>{o.add(e.output),n&&n.onResult&&n.onResult(e)};for(let o=0;o<t.length;o++){let l=i(String(t[o]),{...n,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&s++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?r.add(e.output):(r.delete(e.output),a.add(e.output)))}}let l=(s===t.length?[...o]:[...a]).filter(e=>!r.has(e));if(n&&l.length===0){if(n.failglob===!0)throw Error(`No matches found for "${t.join(`, `)}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(e=>e.replace(/\\/g,``)):t}return l};c.match=c,c.matcher=(e,t)=>i(e,t),c.isMatch=(e,t,n)=>i(t,n)(e),c.any=c.isMatch,c.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=e=>{n.onResult&&n.onResult(e),i.push(e.output)},o=new Set(c(e,t,{...n,onResult:a}));for(let e of i)o.has(e)||r.add(e);return[...r]},c.contains=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>c.contains(e,t,r));if(typeof t==`string`){if(o(e)||o(t))return!1;if(e.includes(t)||e.startsWith(`./`)&&e.slice(2).includes(t))return!0}return c.isMatch(e,t,{...r,contains:!0})},c.matchKeys=(e,t,n)=>{if(!a.isObject(e))throw TypeError(`Expected the first argument to be an object`);let r=c(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},c.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(r.some(e=>t(e)))return!0}return!1},c.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},c.all=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>i(t,r)(e))},c.capture=(e,t,n)=>{let r=a.isWindows(n),o=i.makeRe(String(e),{...n,capture:!0}).exec(r?a.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>e===void 0?``:e)},c.makeRe=(...e)=>i.makeRe(...e),c.scan=(...e)=>i.scan(...e),c.parse=(e,t)=>{let n=[];for(let a of[].concat(e||[]))for(let e of r(String(a),t))n.push(i.parse(e,t));return n},c.braces=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return t&&t.nobrace===!0||!s(e)?[e]:r(e,t)},c.braceExpand=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return c.braces(e,{...t,expand:!0})},c.hasBraces=s,t.exports=c}}),gi=G({"node_modules/fast-glob/out/utils/pattern.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isAbsolute=e.partitionAbsoluteAndRelative=e.removeDuplicateSlashes=e.matchAny=e.convertPatternsToRe=e.makeRe=e.getPatternParts=e.expandBraceExpansion=e.expandPatternsWithBraceExpansion=e.isAffectDepthOfReadingPattern=e.endsWithSlashGlobStar=e.hasGlobStar=e.getBaseDirectory=e.isPatternRelatedToParentDirectory=e.getPatternsOutsideCurrentDirectory=e.getPatternsInsideCurrentDirectory=e.getPositivePatterns=e.getNegativePatterns=e.isPositivePattern=e.isNegativePattern=e.convertToNegativePattern=e.convertToPositivePattern=e.isDynamicPattern=e.isStaticPattern=void 0;var t=W(`path`),n=Qr(),r=hi(),i=`**`,a=`\\`,o=/[*?]|^!/,s=/\[[^[]*]/,c=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,l=/[!*+?@]\([^(]*\)/,u=/,|\.\./,d=/(?!^)\/{2,}/g;function f(e,t={}){return!p(e,t)}e.isStaticPattern=f;function p(e,t={}){return e===``?!1:!!(t.caseSensitiveMatch===!1||e.includes(a)||o.test(e)||s.test(e)||c.test(e)||t.extglob!==!1&&l.test(e)||t.braceExpansion!==!1&&m(e))}e.isDynamicPattern=p;function m(e){let t=e.indexOf(`{`);if(t===-1)return!1;let n=e.indexOf(`}`,t+1);if(n===-1)return!1;let r=e.slice(t,n);return u.test(r)}function h(e){return _(e)?e.slice(1):e}e.convertToPositivePattern=h;function g(e){return`!`+e}e.convertToNegativePattern=g;function _(e){return e.startsWith(`!`)&&e[1]!==`(`}e.isNegativePattern=_;function v(e){return!_(e)}e.isPositivePattern=v;function y(e){return e.filter(_)}e.getNegativePatterns=y;function b(e){return e.filter(v)}e.getPositivePatterns=b;function x(e){return e.filter(e=>!C(e))}e.getPatternsInsideCurrentDirectory=x;function S(e){return e.filter(C)}e.getPatternsOutsideCurrentDirectory=S;function C(e){return e.startsWith(`..`)||e.startsWith(`./..`)}e.isPatternRelatedToParentDirectory=C;function w(e){return n(e,{flipBackslashes:!1})}e.getBaseDirectory=w;function T(e){return e.includes(i)}e.hasGlobStar=T;function E(e){return e.endsWith(`/`+i)}e.endsWithSlashGlobStar=E;function D(e){let n=t.basename(e);return E(e)||f(n)}e.isAffectDepthOfReadingPattern=D;function O(e){return e.reduce((e,t)=>e.concat(k(t)),[])}e.expandPatternsWithBraceExpansion=O;function k(e){let t=r.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>e!==``)}e.expandBraceExpansion=k;function A(e,t){let{parts:n}=r.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return n.length===0&&(n=[e]),n[0].startsWith(`/`)&&(n[0]=n[0].slice(1),n.unshift(``)),n}e.getPatternParts=A;function ee(e,t){return r.makeRe(e,t)}e.makeRe=ee;function j(e,t){return e.map(e=>ee(e,t))}e.convertPatternsToRe=j;function M(e,t){return t.some(t=>t.test(e))}e.matchAny=M;function N(e){return e.replace(d,`/`)}e.removeDuplicateSlashes=N;function te(e){let t=[],n=[];for(let r of e)P(r)?t.push(r):n.push(r);return[t,n]}e.partitionAbsoluteAndRelative=te;function P(e){return t.isAbsolute(e)}e.isAbsolute=P}}),_i=G({"node_modules/merge2/index.js"(e,t){var n=W(`stream`).PassThrough,r=Array.prototype.slice;t.exports=i;function i(){let e=[],t=r.call(arguments),i=!1,o=t[t.length-1];o&&!Array.isArray(o)&&o.pipe==null?t.pop():o={};let s=o.end!==!1,c=o.pipeError===!0;o.objectMode??=!0,o.highWaterMark??=64*1024;let l=n(o);function u(){for(let t=0,n=arguments.length;t<n;t++)e.push(a(arguments[t],o));return d(),this}function d(){if(i)return;i=!0;let t=e.shift();if(!t){process.nextTick(f);return}Array.isArray(t)||(t=[t]);let n=t.length+1;function r(){--n>0||(i=!1,d())}function a(e){function t(){e.removeListener(`merge2UnpipeEnd`,t),e.removeListener(`end`,t),c&&e.removeListener(`error`,n),r()}function n(e){l.emit(`error`,e)}if(e._readableState.endEmitted)return r();e.on(`merge2UnpipeEnd`,t),e.on(`end`,t),c&&e.on(`error`,n),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<t.length;e++)a(t[e]);r()}function f(){i=!1,l.emit(`queueDrain`),s&&l.end()}return l.setMaxListeners(0),l.add=u,l.on(`unpipe`,function(e){e.emit(`merge2UnpipeEnd`)}),t.length&&u.apply(null,t),l}function a(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)e[n]=a(e[n],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(n(t))),!e._readableState||!e.pause||!e.pipe)throw Error(`Only readable stream can be merged.`);e.pause()}return e}}}),vi=G({"node_modules/fast-glob/out/utils/stream.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.merge=void 0;var t=_i();function n(e){let n=t(e);return e.forEach(e=>{e.once(`error`,e=>n.emit(`error`,e))}),n.once(`close`,()=>r(e)),n.once(`end`,()=>r(e)),n}e.merge=n;function r(e){e.forEach(e=>e.emit(`close`))}}}),yi=G({"node_modules/fast-glob/out/utils/string.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.isEmpty=e.isString=void 0;function t(e){return typeof e==`string`}e.isString=t;function n(e){return e===``}e.isEmpty=n}}),bi=G({"node_modules/fast-glob/out/utils/index.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.string=e.stream=e.pattern=e.path=e.fs=e.errno=e.array=void 0,e.array=Kr(),e.errno=qr(),e.fs=Jr(),e.path=Yr(),e.pattern=gi(),e.stream=vi(),e.string=yi()}}),xi=G({"node_modules/fast-glob/out/managers/tasks.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPatternGroupToTask=e.convertPatternGroupsToTasks=e.groupPatternsByBaseDirectory=e.getNegativePatternsAsPositive=e.getPositivePatterns=e.convertPatternsToTasks=e.generate=void 0;var t=bi();function n(e,n){let s=r(e,n),c=r(n.ignore,n),l=a(s),u=o(s,c),d=l.filter(e=>t.pattern.isStaticPattern(e,n)),f=l.filter(e=>t.pattern.isDynamicPattern(e,n)),p=i(d,u,!1),m=i(f,u,!0);return p.concat(m)}e.generate=n;function r(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes(`/`)?e:`**/${e}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function i(e,n,r){let i=[],a=t.pattern.getPatternsOutsideCurrentDirectory(e),o=t.pattern.getPatternsInsideCurrentDirectory(e),u=s(a),d=s(o);return i.push(...c(u,n,r)),`.`in d?i.push(l(`.`,o,n,r)):i.push(...c(d,n,r)),i}e.convertPatternsToTasks=i;function a(e){return t.pattern.getPositivePatterns(e)}e.getPositivePatterns=a;function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}e.getNegativePatternsAsPositive=o;function s(e){return e.reduce((e,n)=>{let r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}e.groupPatternsByBaseDirectory=s;function c(e,t,n){return Object.keys(e).map(r=>l(r,e[r],t,n))}e.convertPatternGroupsToTasks=c;function l(e,n,r,i){return{dynamic:i,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}e.convertPatternGroupToTask=l}}),Si=G({"node_modules/@nodelib/fs.stat/out/providers/async.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t,i){t.fs.lstat(e,(a,o)=>{if(a!==null){n(i,a);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){r(i,o);return}t.fs.stat(e,(e,a)=>{if(e!==null){if(t.throwErrorOnBrokenSymbolicLink){n(i,e);return}r(i,o);return}t.markSymbolicLink&&(a.isSymbolicLink=()=>!0),r(i,a)})})}e.read=t;function n(e,t){e(t)}function r(e,t){e(null,t)}}}),Ci=G({"node_modules/@nodelib/fs.stat/out/providers/sync.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t){let n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}e.read=t}}),wi=G({"node_modules/@nodelib/fs.stat/out/adapters/fs.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;var t=W(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n}}),Ti=G({"node_modules/@nodelib/fs.stat/out/settings.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=wi();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e??t}}}}),Ei=G({"node_modules/@nodelib/fs.stat/out/index.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.statSync=e.stat=e.Settings=void 0;var t=Si(),n=Ci(),r=Ti();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.stat=i;function a(e,t){let r=o(t);return n.read(e,r)}e.statSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}}}),Di=G({"node_modules/queue-microtask/index.js"(e,t){var n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))}}),Oi=G({"node_modules/run-parallel/index.js"(e,t){t.exports=r;var n=Di();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}}}),ki=G({"node_modules/@nodelib/fs.scandir/out/constants.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10),i=10;e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>i||n===i&&r>=10}}),Ai=G({"node_modules/@nodelib/fs.scandir/out/utils/fs.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n}}),ji=G({"node_modules/@nodelib/fs.scandir/out/utils/index.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.fs=void 0,e.fs=Ai()}}),Mi=G({"node_modules/@nodelib/fs.scandir/out/providers/common.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=t}}),Ni=G({"node_modules/@nodelib/fs.scandir/out/providers/async.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;var t=Ei(),n=Oi(),r=ki(),i=ji(),a=Mi();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}e.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}n(s.map(e=>c(e,t)),(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}e.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}n(c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}}),(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}e.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}}}),Pi=G({"node_modules/@nodelib/fs.scandir/out/providers/sync.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;var t=Ei(),n=ki(),r=ji(),i=Mi();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}e.read=a;function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}e.readdirWithFileTypes=o;function s(e,n){return n.fs.readdirSync(e).map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}e.readdir=s}}),Fi=G({"node_modules/@nodelib/fs.scandir/out/adapters/fs.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;var t=W(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n}}),Ii=G({"node_modules/@nodelib/fs.scandir/out/settings.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`path`),n=Ei(),r=Fi();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}}}),Li=G({"node_modules/@nodelib/fs.scandir/out/index.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;var t=Ni(),n=Pi(),r=Ii();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}e.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}}}),Ri=G({"node_modules/reusify/reusify.js"(e,t){function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n}}),zi=G({"node_modules/fastq/queue.js"(e,t){var n=Ri();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o}}),Bi=G({"node_modules/@nodelib/fs.walk/out/readers/common.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=e.replacePathSegmentSeparator=e.isAppliedFilter=e.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}e.isFatalError=t;function n(e,t){return e===null||e(t)}e.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}e.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=i}}),Vi=G({"node_modules/@nodelib/fs.walk/out/readers/reader.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Bi();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}}}),Hi=G({"node_modules/@nodelib/fs.walk/out/readers/async.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`events`),n=Li(),r=zi(),i=Bi(),a=Vi();e.default=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}}}}),Ui=G({"node_modules/@nodelib/fs.walk/out/providers/async.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Hi();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{n(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{r(e,this._storage)}),this._reader.read()}};function n(e,t){e(t)}function r(e,t){e(null,t)}}}),Wi=G({"node_modules/@nodelib/fs.walk/out/providers/stream.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`stream`),n=Hi();e.default=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}}}),Gi=G({"node_modules/@nodelib/fs.walk/out/readers/sync.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Li(),n=Bi(),r=Vi();e.default=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}}}),Ki=G({"node_modules/@nodelib/fs.walk/out/providers/sync.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Gi();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}}}}),qi=G({"node_modules/@nodelib/fs.walk/out/settings.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`path`),n=Li();e.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}}}),Ji=G({"node_modules/@nodelib/fs.walk/out/index.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;var t=Ui(),n=Wi(),r=Ki(),i=qi();e.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}e.walk=a;function o(e,t){let n=c(t);return new r.default(e,n).read()}e.walkSync=o;function s(e,t){let r=c(t);return new n.default(e,r).read()}e.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}}}),Yi=G({"node_modules/fast-glob/out/readers/reader.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`path`),n=Ei(),r=bi();e.default=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}}}),Xi=G({"node_modules/fast-glob/out/readers/stream.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`stream`),n=Ei(),r=Ji(),i=Yi();e.default=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}}}}),Zi=G({"node_modules/fast-glob/out/readers/async.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Ji(),n=Yi(),r=Xi();e.default=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}}}}),Qi=G({"node_modules/fast-glob/out/providers/matchers/matcher.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=bi();e.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}}}}),$i=G({"node_modules/fast-glob/out/providers/matchers/partial.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Qi();e.default=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length||t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)}))return!0}return!1}}}}),ea=G({"node_modules/fast-glob/out/providers/filters/deep.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=bi(),n=$i();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;return e===``?n:n-e.split(`/`).length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}}}}),ta=G({"node_modules/fast-glob/out/providers/filters/entry.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=bi();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let[r,i]=t.pattern.partitionAbsoluteAndRelative(n),a={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,a)}_filter(e,n){let r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(r),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!(!this._isMatchToPatterns(e,t.positive.all,n)||this._isMatchToPatterns(e,t.negative.relative,n)||this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(n.length===0)return!1;let i=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,n,r)}_isMatchToPatterns(e,n,r){if(n.length===0)return!1;let i=t.pattern.matchAny(e,n);return!i&&r?t.pattern.matchAny(e+`/`,n):i}}}}),na=G({"node_modules/fast-glob/out/providers/filters/error.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=bi();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}}}),ra=G({"node_modules/fast-glob/out/providers/transformers/entry.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=bi();e.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}}}}),ia=G({"node_modules/fast-glob/out/providers/provider.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`path`),n=ea(),r=ta(),i=na(),a=ra();e.default=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}}}),aa=G({"node_modules/fast-glob/out/providers/async.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Zi(),n=ia();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}}}),oa=G({"node_modules/fast-glob/out/providers/stream.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=W(`stream`),n=Xi(),r=ia();e.default=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}}}),sa=G({"node_modules/fast-glob/out/readers/sync.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Ei(),n=Ji(),r=Yi();e.default=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);i===null||!t.entryFilter(i)||n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}}}),ca=G({"node_modules/fast-glob/out/providers/sync.js"(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=sa(),n=ia();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}}}),la=G({"node_modules/fast-glob/out/settings.js"(e){Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var t=W(`fs`),n=W(`os`),r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}}}),ua=G({"node_modules/fast-glob/out/index.js"(e,t){var n=xi(),r=aa(),i=oa(),a=ca(),o=la(),s=bi();async function c(e,t){u(e);let n=l(e,r.default,t),i=await Promise.all(n);return s.array.flatten(i)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(e,t){u(e);let n=l(e,a.default,t);return s.array.flatten(n)}e.sync=t;function r(e,t){u(e);let n=l(e,i.default,t);return s.stream.merge(n)}e.stream=r;function c(e,t){u(e);let r=[].concat(e),i=new o.default(t);return n.generate(r,i)}e.generateTasks=c;function d(e,t){u(e);let n=new o.default(t);return s.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=d;function f(e){return u(e),s.path.escape(e)}e.escapePath=f;function p(e){return u(e),s.path.convertPathToPattern(e)}e.convertPathToPattern=p,(function(e){function t(e){return u(e),s.path.escapePosixPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertPosixPathToPattern(e)}e.convertPathToPattern=n})(e.posix||={}),(function(e){function t(e){return u(e),s.path.escapeWindowsPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertWindowsPathToPattern(e)}e.convertPathToPattern=n})(e.win32||={})})(c||={});function l(e,t,r){let i=[].concat(e),a=new o.default(r),s=n.generate(i,a),c=new t(a);return s.map(c.read,c)}function u(e){if(![].concat(e).every(e=>s.string.isString(e)&&!s.string.isEmpty(e)))throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=c}}),da=G({"node_modules/picocolors/picocolors.js"(e,t){var n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}}),fa=G({"node_modules/semver/internal/debug.js"(e,t){t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}}}),pa=G({"node_modules/semver/internal/constants.js"(e,t){var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}}),ma=G({"node_modules/semver/internal/re.js"(e,t){var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=pa(),a=fa();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)}}),ha=G({"node_modules/semver/internal/parse-options.js"(e,t){var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r}}),ga=G({"node_modules/semver/internal/identifiers.js"(e,t){var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}}}),_a=G({"node_modules/semver/classes/semver.js"(e,t){var n=fa(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=pa(),{safeRe:a,t:o}=ma(),s=ha(),{compareIdentifiers:c}=ga();t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),c(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}}}),va=G({"node_modules/semver/functions/compare.js"(e,t){var n=_a();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))}}),ya=G({"node_modules/semver/functions/gte.js"(e,t){var n=va();t.exports=(e,t,r)=>n(e,t,r)>=0}}),ba=G({"node_modules/pseudomap/pseudomap.js"(e,t){var n=Object.prototype.hasOwnProperty;t.exports=r;function r(e){if(!(this instanceof r))throw TypeError(`Constructor PseudoMap requires 'new'`);if(this.clear(),e)if(e instanceof r||typeof Map==`function`&&e instanceof Map)e.forEach(function(e,t){this.set(t,e)},this);else if(Array.isArray(e))e.forEach(function(e){this.set(e[0],e[1])},this);else throw TypeError(`invalid argument`)}r.prototype.forEach=function(e,t){t||=this,Object.keys(this._data).forEach(function(n){n!==`size`&&e.call(t,this._data[n].value,this._data[n].key)},this)},r.prototype.has=function(e){return!!o(this._data,e)},r.prototype.get=function(e){var t=o(this._data,e);return t&&t.value},r.prototype.set=function(e,t){s(this._data,e,t)},r.prototype.delete=function(e){var t=o(this._data,e);t&&(delete this._data[t._index],this._data.size--)},r.prototype.clear=function(){var e=Object.create(null);e.size=0,Object.defineProperty(this,`_data`,{value:e,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(r.prototype,`size`,{get:function(){return this._data.size},set:function(e){},enumerable:!0,configurable:!0}),r.prototype.values=r.prototype.keys=r.prototype.entries=function(){throw Error(`iterators are not implemented in this version`)};function i(e,t){return e===t||e!==e&&t!==t}function a(e,t,n){this.key=e,this.value=t,this._index=n}function o(e,t){for(var r=0,a=`_`+t,o=a;n.call(e,o);o=a+ r++)if(i(e[o].key,t))return e[o]}function s(e,t,r){for(var o=0,s=`_`+t,c=s;n.call(e,c);c=s+ o++)if(i(e[c].key,t)){e[c].value=r;return}e.size++,e[c]=new a(t,r,c)}}}),xa=G({"node_modules/pseudomap/map.js"(e,t){process.env.npm_package_name===`pseudomap`&&process.env.npm_lifecycle_script===`test`&&(process.env.TEST_PSEUDOMAP=`true`),typeof Map==`function`&&!process.env.TEST_PSEUDOMAP?t.exports=Map:t.exports=ba()}}),Sa=G({"node_modules/yallist/yallist.js"(e,t){t.exports=n,n.Node=a,n.create=n;function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach==`function`)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}n.prototype.removeNode=function(e){if(e.list!==this)throw Error(`removing node which does not belong to this list`);var t=e.next,n=e.prev;t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||=e,this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||=e,this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t||=this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next},n.prototype.forEachReverse=function(e,t){t||=this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev},n.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value},n.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value},n.prototype.map=function(e,t){t||=this;for(var r=new n,i=this.head;i!==null;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t||=this;for(var r=new n,i=this.tail;i!==null;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n},n.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n},n.prototype.toArray=function(){for(var e=Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e},n.prototype.toArrayReverse=function(){for(var e=Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e},n.prototype.slice=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,a=this.head;a!==null&&i<e;i++)a=a.next;for(;a!==null&&i<t;i++,a=a.next)r.push(a.value);return r},n.prototype.sliceReverse=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,a=this.tail;a!==null&&i>t;i--)a=a.prev;for(;a!==null&&i>e;i--,a=a.prev)r.push(a.value);return r},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function r(e,t){e.tail=new a(t,e.tail,null,e),e.head||=e.tail,e.length++}function i(e,t){e.head=new a(t,null,e.head,e),e.tail||=e.head,e.length++}function a(e,t,n,r){if(!(this instanceof a))return new a(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}}}),Ca=G({"node_modules/editorconfig/node_modules/lru-cache/index.js"(e,t){t.exports=g;var n=xa(),r=W(`util`),i=Sa(),a=typeof Symbol==`function`&&process.env._nodeLRUCacheForceNoSymbol!==`1`?function(e){return Symbol(e)}:function(e){return`_`+e},o=a(`max`),s=a(`length`),c=a(`lengthCalculator`),l=a(`allowStale`),u=a(`maxAge`),d=a(`dispose`),f=a(`noDisposeOnSet`),p=a(`lruList`),m=a(`cache`);function h(){return 1}function g(e){if(!(this instanceof g))return new g(e);typeof e==`number`&&(e={max:e}),e||={};var t=this[o]=e.max;(!t||typeof t!=`number`||t<=0)&&(this[o]=1/0);var n=e.length||h;typeof n!=`function`&&(n=h),this[c]=n,this[l]=e.stale||!1,this[u]=e.maxAge||0,this[d]=e.dispose,this[f]=e.noDisposeOnSet||!1,this.reset()}Object.defineProperty(g.prototype,`max`,{set:function(e){(!e||typeof e!=`number`||e<=0)&&(e=1/0),this[o]=e,b(this)},get:function(){return this[o]},enumerable:!0}),Object.defineProperty(g.prototype,`allowStale`,{set:function(e){this[l]=!!e},get:function(){return this[l]},enumerable:!0}),Object.defineProperty(g.prototype,`maxAge`,{set:function(e){(!e||typeof e!=`number`||e<0)&&(e=0),this[u]=e,b(this)},get:function(){return this[u]},enumerable:!0}),Object.defineProperty(g.prototype,`lengthCalculator`,{set:function(e){typeof e!=`function`&&(e=h),e!==this[c]&&(this[c]=e,this[s]=0,this[p].forEach(function(e){e.length=this[c](e.value,e.key),this[s]+=e.length},this)),b(this)},get:function(){return this[c]},enumerable:!0}),Object.defineProperty(g.prototype,`length`,{get:function(){return this[s]},enumerable:!0}),Object.defineProperty(g.prototype,`itemCount`,{get:function(){return this[p].length},enumerable:!0}),g.prototype.rforEach=function(e,t){t||=this;for(var n=this[p].tail;n!==null;){var r=n.prev;_(this,e,n,t),n=r}};function _(e,t,n,r){var i=n.value;y(e,i)&&(x(e,n),e[l]||(i=void 0)),i&&t.call(r,i.value,i.key,e)}g.prototype.forEach=function(e,t){t||=this;for(var n=this[p].head;n!==null;){var r=n.next;_(this,e,n,t),n=r}},g.prototype.keys=function(){return this[p].toArray().map(function(e){return e.key},this)},g.prototype.values=function(){return this[p].toArray().map(function(e){return e.value},this)},g.prototype.reset=function(){this[d]&&this[p]&&this[p].length&&this[p].forEach(function(e){this[d](e.key,e.value)},this),this[m]=new n,this[p]=new i,this[s]=0},g.prototype.dump=function(){return this[p].map(function(e){if(!y(this,e))return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}},this).toArray().filter(function(e){return e})},g.prototype.dumpLru=function(){return this[p]},g.prototype.inspect=function(e,t){var n=`LRUCache {`,i=!1;this[l]&&(n+=`
157
+ allowStale: true`,i=!0);var a=this[o];a&&a!==1/0&&(i&&(n+=`,`),n+=`
158
+ max: `+r.inspect(a,t),i=!0);var d=this[u];d&&(i&&(n+=`,`),n+=`
159
+ maxAge: `+r.inspect(d,t),i=!0);var f=this[c];f&&f!==h&&(i&&(n+=`,`),n+=`
160
+ length: `+r.inspect(this[s],t),i=!0);var m=!1;return this[p].forEach(function(e){m?n+=`,
161
+ `:(i&&(n+=`,
162
+ `),m=!0,n+=`
163
+ `);var a=r.inspect(e.key).split(`
164
+ `).join(`
165
+ `),o={value:e.value};e.maxAge!==d&&(o.maxAge=e.maxAge),f!==h&&(o.length=e.length),y(this,e)&&(o.stale=!0),o=r.inspect(o,t).split(`
166
+ `).join(`
167
+ `),n+=a+` => `+o}),(m||i)&&(n+=`
168
+ `),n+=`}`,n},g.prototype.set=function(e,t,n){n||=this[u];var r=n?Date.now():0,i=this[c](t,e);if(this[m].has(e)){if(i>this[o])return x(this,this[m].get(e)),!1;var a=this[m].get(e).value;return this[d]&&(this[f]||this[d](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[s]+=i-a.length,a.length=i,this.get(e),b(this),!0}var l=new S(e,t,i,r,n);return l.length>this[o]?(this[d]&&this[d](e,t),!1):(this[s]+=l.length,this[p].unshift(l),this[m].set(e,this[p].head),b(this),!0)},g.prototype.has=function(e){if(!this[m].has(e))return!1;var t=this[m].get(e).value;return!y(this,t)},g.prototype.get=function(e){return v(this,e,!0)},g.prototype.peek=function(e){return v(this,e,!1)},g.prototype.pop=function(){var e=this[p].tail;return e?(x(this,e),e.value):null},g.prototype.del=function(e){x(this,this[m].get(e))},g.prototype.load=function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(i===0)this.set(r.k,r.v);else{var a=i-t;a>0&&this.set(r.k,r.v,a)}}},g.prototype.prune=function(){var e=this;this[m].forEach(function(t,n){v(e,n,!1)})};function v(e,t,n){var r=e[m].get(t);if(r){var i=r.value;y(e,i)?(x(e,r),e[l]||(i=void 0)):n&&e[p].unshiftNode(r),i&&=i.value}return i}function y(e,t){if(!t||!t.maxAge&&!e[u])return!1;var n=!1,r=Date.now()-t.now;return n=t.maxAge?r>t.maxAge:e[u]&&r>e[u],n}function b(e){if(e[s]>e[o])for(var t=e[p].tail;e[s]>e[o]&&t!==null;){var n=t.prev;x(e,t),t=n}}function x(e,t){if(t){var n=t.value;e[d]&&e[d](n.key,n.value),e[s]-=n.length,e[m].delete(n.key),e[p].removeNode(t)}}function S(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}}),wa=G({"node_modules/sigmund/sigmund.js"(e,t){t.exports=n;function n(e,t){t||=10;var n=[],r=``,i=RegExp;function a(e,o){if(!(o>t)&&!(typeof e==`function`||e===void 0)){if(typeof e!=`object`||!e||e instanceof i){r+=e;return}n.indexOf(e)!==-1||o===t||(n.push(e),r+=`{`,Object.keys(e).forEach(function(t,n,i){if(t.charAt(0)!==`_`){var s=typeof e[t];s===`function`||s===`undefined`||(r+=t,a(e[t],o+1))}}))}}return a(e,0),r}}}),Ta=G({"node_modules/editorconfig/src/lib/fnmatch.js"(e,t){var n=typeof process==`object`?process.platform:`win32`;t?t.exports=_:e.minimatch=_,_.Minimatch=v;var r=_.cache=new(Ca())({max:100}),i=_.GLOBSTAR=v.GLOBSTAR={},a=wa(),o=W(`path`),s=`[^/]`,c=s+`*?`,l=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,u=`(?:(?!(?:\\/|^)\\.).)*?`,d=f(`().*{}+?[]^$\\!`);function f(e){return e.split(``).reduce(function(e,t){return e[t]=!0,e},{})}var p=/\/+/;_.monkeyPatch=m;function m(){var e=Object.getOwnPropertyDescriptor(String.prototype,`match`),t=e.value;e.value=function(e){return e instanceof v?e.match(this):t.call(this,e)},Object.defineProperty(String.prototype,e)}_.filter=h;function h(e,t){return t||={},function(n,r,i){return _(n,e,t)}}function g(e,t){e||={},t||={};var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}_.defaults=function(e){if(!e||!Object.keys(e).length)return _;var t=_,n=function(n,r,i){return t.minimatch(n,r,g(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,g(e,r))},n},v.defaults=function(e){return!e||!Object.keys(e).length?v:_.defaults(e).Minimatch};function _(e,t,n){if(typeof t!=`string`)throw TypeError(`glob pattern string required`);return n||={},!n.nocomment&&t.charAt(0)===`#`?!1:t.trim()===``?e===``:new v(t,n).match(e)}function v(e,t){if(!(this instanceof v))return new v(e,t,r);if(typeof e!=`string`)throw TypeError(`glob pattern string required`);t||={},n===`win32`&&(e=e.split(`\\`).join(`/`));var i=e+`
169
+ `+a(t),o=_.cache.get(i);if(o)return o;_.cache.set(i,this),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}v.prototype.make=y;function y(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&console.error(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(p)}),t.debug&&console.error(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),t.debug&&console.error(this.pattern,n),n=n.filter(function(e){return e.indexOf(!1)===-1}),t.debug&&console.error(this.pattern,n),this.set=n}}v.prototype.parseNegate=b;function b(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;i<a&&e.charAt(i)===`!`;i++)t=!t,r++;r&&(this.pattern=e.substr(r)),this.negate=t}}_.braceExpand=function(e,t){return new v(e,t).braceExpand()},v.prototype.braceExpand=x;function x(e,t){if(t||=this.options,e=e===void 0?this.pattern:e,e===void 0)throw Error(`undefined pattern`);if(t.nobrace||!e.match(/\{.*\}/))return[e];var n=!1;if(e.charAt(0)!==`{`){for(var r=null,i=0,a=e.length;i<a;i++){var o=e.charAt(i);if(o===`\\`)n=!n;else if(o===`{`&&!n){r=e.substr(0,i);break}}return r===null?[e]:x(e.substr(i),t).map(function(e){return r+e})}var s=e.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(s){for(var c=x(e.substr(s[0].length),t),l=+s[1],u=+s[2],d=l>u?-1:1,f=[],i=l;i!=u+d;i+=d)for(var p=0,m=c.length;p<m;p++)f.push(i+c[p]);return f}var i=1,h=1,f=[],g=``,n=!1;function _(){f.push(g),g=``}FOR:for(i=1,a=e.length;i<a;i++){var o=e.charAt(i);if(n)n=!1,g+=`\\`+o;else switch(o){case`\\`:n=!0;continue;case`{`:h++,g+=`{`;continue;case`}`:if(h--,h===0){_(),i++;break FOR}else{g+=o;continue}case`,`:h===1?_():g+=o;continue;default:g+=o;continue}}if(h!==0)return x(`\\`+e,t);var c=x(e.substr(i),t),v=f.length===1;f=f.map(function(e){return x(e,t)}),f=f.reduce(function(e,t){return e.concat(t)}),v&&(f=f.map(function(e){return`{`+e+`}`}));for(var y=[],i=0,a=f.length;i<a;i++)for(var p=0,m=c.length;p<m;p++)y.push(f[i]+c[p]);return y}v.prototype.parse=C;var S={};function C(e,t){var n=this.options;if(!n.noglobstar&&e===`**`)return i;if(e===``)return``;var r=``,a=!!n.nocase,o=!1,l=[],u,f,p=!1,m=-1,h=-1,g=e.charAt(0)===`.`?``:n.dot?`(?!(?:^|\\/)\\.{1,2}(?:$|\\/))`:`(?!\\.)`;function _(){if(f){switch(f){case`*`:r+=c,a=!0;break;case`?`:r+=s,a=!0;break;default:r+=`\\`+f;break}f=!1}}for(var v=0,y=e.length,b;v<y&&(b=e.charAt(v));v++){if(n.debug&&console.error(`%s %s %s %j`,e,v,r,b),o&&d[b]){r+=`\\`+b,o=!1;continue}SWITCH:switch(b){case`/`:return!1;case`\\`:_(),o=!0;continue;case`?`:case`*`:case`+`:case`@`:case`!`:if(n.debug&&console.error(`%s %s %s %j <-- stateChar`,e,v,r,b),p){b===`!`&&v===h+1&&(b=`^`),r+=b;continue}_(),f=b,n.noext&&_();continue;case`(`:if(p){r+=`(`;continue}if(!f){r+=`\\(`;continue}u=f,l.push({type:u,start:v-1,reStart:r.length}),r+=f===`!`?`(?:(?!`:`(?:`,f=!1;continue;case`)`:if(p||!l.length){r+=`\\)`;continue}switch(a=!0,r+=`)`,u=l.pop().type,u){case`!`:r+=`[^/]*?)`;break;case`?`:case`+`:case`*`:r+=u;case`@`:break}continue;case`|`:if(p||!l.length||o){r+=`\\|`,o=!1;continue}r+=`|`;continue;case`[`:if(_(),p){r+=`\\`+b;continue}p=!0,h=v,m=r.length,r+=b;continue;case`]`:if(v===h+1||!p){r+=`\\`+b,o=!1;continue}a=!0,p=!1,r+=b;continue;default:_(),o?o=!1:d[b]&&!(b===`^`&&p)&&(r+=`\\`),r+=b}}if(p){var x=e.substr(h+1),C=this.parse(x,S);r=r.substr(0,m)+`\\[`+C[0],a||=C[1]}for(var w;w=l.pop();){var T=r.slice(w.reStart+3);T=T.replace(/((?:\\{2})*)(\\?)\|/g,function(e,t,n){return n||=`\\`,t+t+n+`|`});var D=w.type===`*`?c:w.type===`?`?s:`\\`+w.type;a=!0,r=r.slice(0,w.reStart)+D+`\\(`+T}_(),o&&(r+=`\\\\`);var O=!1;switch(r.charAt(0)){case`.`:case`[`:case`(`:O=!0}if(r!==``&&a&&(r=`(?=.)`+r),O&&(r=g+r),t===S)return[r,a];if(!a)return E(e);var k=n.nocase?`i`:``,A=RegExp(`^`+r+`$`,k);return A._glob=e,A._src=r,A}_.makeRe=function(e,t){return new v(e,t||{}).makeRe()},v.prototype.makeRe=w;function w(){if(this.regexp||this.regexp===!1)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1;var t=this.options,n=t.noglobstar?c:t.dot?l:u,r=t.nocase?`i`:``,a=e.map(function(e){return e.map(function(e){return e===i?n:typeof e==`string`?D(e):e._src}).join(`\\/`)}).join(`|`);a=`^(?:`+a+`)$`,this.negate&&(a=`^(?!`+a+`).*$`);try{return this.regexp=new RegExp(a,r)}catch{return this.regexp=!1}}_.match=function(e,t,n){var r=new v(t,n);return e=e.filter(function(e){return r.match(e)}),n.nonull&&!e.length&&e.push(t),e},v.prototype.match=T;function T(e,t){if(this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;var r=this.options;n===`win32`&&(e=e.split(`\\`).join(`/`)),e=e.split(p),r.debug&&console.error(this.pattern,`split`,e);for(var i=this.set,a=0,o=i.length;a<o;a++){var s=i[a];if(this.matchOne(e,s,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}v.prototype.matchOne=function(e,t,n){var r=this.options;r.debug&&console.error(`matchOne`,{this:this,file:e,pattern:t}),r.matchBase&&t.length===1&&(e=o.basename(e.join(`/`)).split(`/`)),r.debug&&console.error(`matchOne`,e.length,t.length);for(var a=0,s=0,c=e.length,l=t.length;a<c&&s<l;a++,s++){r.debug&&console.error(`matchOne loop`);var u=t[s],d=e[a];if(r.debug&&console.error(t,u,d),u===!1)return!1;if(u===i){r.debug&&console.error(`GLOBSTAR`,[t,u,d]);var f=a,p=s+1;if(p===l){for(r.debug&&console.error(`** at the end`);a<c;a++)if(e[a]===`.`||e[a]===`..`||!r.dot&&e[a].charAt(0)===`.`)return!1;return!0}WHILE:for(;f<c;){var m=e[f];if(r.debug&&console.error(`
170
+ globstar while`,e,f,t,p,m),this.matchOne(e.slice(f),t.slice(p),n))return r.debug&&console.error(`globstar found match!`,f,c,m),!0;if(m===`.`||m===`..`||!r.dot&&m.charAt(0)===`.`){r.debug&&console.error(`dot detected!`,e,f,t,p);break WHILE}r.debug&&console.error(`globstar swallow a segment, and continue`),f++}return!!(n&&f===c)}var h;if(typeof u==`string`?(h=r.nocase?d.toLowerCase()===u.toLowerCase():d===u,r.debug&&console.error(`string match`,u,d,h)):(h=d.match(u),r.debug&&console.error(`pattern match`,u,d,h)),!h)return!1}if(a===c&&s===l)return!0;if(a===c)return n;if(s===l)return a===c-1&&e[a]===``;throw Error(`wtf?`)};function E(e){return e.replace(/\\(.)/g,`$1`)}function D(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`)}}}),Ea=G({"node_modules/editorconfig/src/lib/ini.js"(e){var t=e&&e.__awaiter||function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(e,`__esModule`,{value:!0});var i=r(W(`fs`)),a={section:/^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,param:/^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,comment:/^\s*[#;].*$/};function o(e){return t(this,void 0,void 0,function(){return n(this,function(t){return[2,new Promise(function(t,n){i.readFile(e,`utf8`,function(e,r){if(e){n(e);return}t(c(r))})})]})})}e.parse=o;function s(e){return c(i.readFileSync(e,`utf8`))}e.parseSync=s;function c(e){var t={},n=null,r=[[n,t]];return e.split(/\r\n|\r|\n/).forEach(function(e){var i;a.comment.test(e)||(a.param.test(e)?(i=e.match(a.param),t[i[1]]=i[2]):a.section.test(e)&&(i=e.match(a.section),n=i[1],t={},r.push([n,t])))}),r}e.parseString=c}}),Da=G({"node_modules/editorconfig/package.json"(e,t){t.exports={name:`editorconfig`,version:`0.15.3`,description:`EditorConfig File Locator and Interpreter for Node.js`,keywords:[`editorconfig`,`core`],main:`src/index.js`,contributors:[`Hong Xu (topbug.net)`,`Jed Mao (https://github.com/jedmao/)`,`Trey Hunner (http://treyhunner.com)`],directories:{bin:`./bin`,lib:`./lib`},scripts:{clean:`rimraf dist`,prebuild:`npm run clean`,build:`tsc`,pretest:`npm run lint && npm run build && npm run copy && cmake .`,test:`ctest .`,"pretest:ci":`npm run pretest`,"test:ci":`ctest -VV --output-on-failure .`,lint:`npm run eclint && npm run tslint`,eclint:`eclint check --indent_size ignore "src/**"`,tslint:`tslint --project tsconfig.json --exclude package.json`,copy:`cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib`,prepub:`npm run lint && npm run build && npm run copy`,pub:`npm publish ./dist`},repository:{type:`git`,url:`git://github.com/editorconfig/editorconfig-core-js.git`},bugs:`https://github.com/editorconfig/editorconfig-core-js/issues`,author:`EditorConfig Team`,license:`MIT`,dependencies:{commander:`^2.19.0`,"lru-cache":`^4.1.5`,semver:`^5.6.0`,sigmund:`^1.0.1`},devDependencies:{"@types/mocha":`^5.2.6`,"@types/node":`^10.12.29`,"@types/semver":`^5.5.0`,"cpy-cli":`^2.0.0`,eclint:`^2.8.1`,mocha:`^5.2.0`,rimraf:`^2.6.3`,should:`^13.2.3`,tslint:`^5.13.1`,typescript:`^3.3.3333`}}}}),Oa=G({"node_modules/editorconfig/src/index.js"(e){var t=e&&e.__awaiter||function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0});var a=r(W(`fs`)),o=r(W(`path`)),s={gte:ya()},c=i(Ta()),l=Ea();e.parseString=l.parseString;var u=i(Da()),d={end_of_line:!0,indent_style:!0,indent_size:!0,insert_final_newline:!0,trim_trailing_whitespace:!0,charset:!0};function f(e,t){return t=t.replace(/\*\*/g,`{*,**/**/**}`),c.default(e,t,{matchBase:!0,dot:!0,noext:!0})}function p(e,t){var n=[];do e=o.dirname(e),n.push(o.join(e,t.config));while(e!==t.root);return n}function m(e,t){return`indent_style`in e&&e.indent_style===`tab`&&!(`indent_size`in e)&&s.gte(t,`0.10.0`)&&(e.indent_size=`tab`),`indent_size`in e&&!(`tab_width`in e)&&e.indent_size!==`tab`&&(e.tab_width=e.indent_size),`indent_size`in e&&`tab_width`in e&&e.indent_size===`tab`&&(e.indent_size=e.tab_width),e}function h(e,t){return e===void 0&&(e={}),{config:e.config||`.editorconfig`,version:e.version||u.default.version,root:o.resolve(e.root||o.parse(t).root)}}function g(e,t){switch(t.indexOf(`/`)){case-1:t=`**/`+t;break;case 0:t=t.substring(1);break;default:break}return o.join(e,t)}function _(e,t){for(var n in e===void 0&&(e={}),t===void 0&&(t={}),t)if(t.hasOwnProperty(n)){var r=t[n],i=n.toLowerCase(),a=r;d[i]&&(a=r.toLowerCase());try{a=JSON.parse(r)}catch{}r??(a=String(r)),e[i]=a}return e}function v(e,t,n){return m(e.reverse().reduce(function(e,n){var r=o.dirname(n.name);return n.contents.forEach(function(n){var i=n[0],a=n[1];i&&f(t,g(r,i))&&(e=_(e,a))}),e},{}),n.version)}function y(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=e[n],i=l.parseString(r.contents);if(t.push({name:r.name,contents:i}),(i[0][1].root||``).toLowerCase()===`true`)break}return t}function b(e){return t(this,void 0,void 0,function(){return n(this,function(t){return[2,Promise.all(e.map(function(e){return new Promise(function(t){a.readFile(e,`utf8`,function(n,r){t({name:e,contents:n?``:r})})})}))]})})}function x(e){var t=[],n;return e.forEach(function(e){try{n=a.readFileSync(e,`utf8`)}catch{n=``}t.push({name:e,contents:n})}),t}function S(e,t){t===void 0&&(t={});var n=o.resolve(e);return[n,h(t,n)]}function C(e,r,i){return i===void 0&&(i={}),t(this,void 0,void 0,function(){var t,a,o;return n(this,function(n){return t=S(e,i),a=t[0],o=t[1],[2,r.then(y).then(function(e){return v(e,a,o)})]})})}e.parseFromFiles=C;function w(e,t,n){n===void 0&&(n={});var r=S(e,n),i=r[0],a=r[1];return v(y(t),i,a)}e.parseFromFilesSync=w;function T(e,r){return r===void 0&&(r={}),t(this,void 0,void 0,function(){var t,i,a,o;return n(this,function(n){return t=S(e,r),i=t[0],a=t[1],o=p(i,a),[2,b(o).then(y).then(function(e){return v(e,i,a)})]})})}e.parse=T;function E(e,t){t===void 0&&(t={});var n=S(e,t),r=n[0],i=n[1];return v(y(x(p(r,i))),r,i)}e.parseSync=E}}),ka=G({"node_modules/@babel/code-frame/node_modules/js-tokens/index.js"(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m=/\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy,h,g,_,v,y,b;p=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,n=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy,g=/(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y,f=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,_=/[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y,b=/[\t\v\f\ufeff\p{Zs}]+/uy,l=/\r?\n|[\r\u2028\u2029]/y,u=/\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y,h=/\/\/.*/y,i=/[<>.:={}]|\/(?![\/*])/y,r=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy,a=/(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y,o=/[^<>{}]+/y,y=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,v=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,s=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,c=/^(?:return|throw|yield)$/,d=RegExp(l.source),t.exports=function*(e,{jsx:t=!1}={}){var x,S,C,w,T,E,D,O,k,A,ee,j,M,N;for({length:E}=e,w=0,T=``,N=[{tag:`JS`}],x=[],ee=0,j=!1;w<E;){switch(O=N[N.length-1],O.tag){case`JS`:case`JSNonExpressionParen`:case`InterpolationInTemplate`:case`InterpolationInJSX`:if(e[w]===`/`&&(y.test(T)||s.test(T))&&(m.lastIndex=w,D=m.exec(e))){w=m.lastIndex,T=D[0],j=!0,yield{type:`RegularExpressionLiteral`,value:D[0],closed:D[1]!==void 0&&D[1]!==`\\`};continue}if(p.lastIndex=w,D=p.exec(e)){switch(M=D[0],k=p.lastIndex,A=M,M){case`(`:T===`?NonExpressionParenKeyword`&&N.push({tag:`JSNonExpressionParen`,nesting:ee}),ee++,j=!1;break;case`)`:ee--,j=!0,O.tag===`JSNonExpressionParen`&&ee===O.nesting&&(N.pop(),A=`?NonExpressionParenEnd`,j=!1);break;case`{`:p.lastIndex=0,C=!v.test(T)&&(y.test(T)||s.test(T)),x.push(C),j=!1;break;case`}`:switch(O.tag){case`InterpolationInTemplate`:if(x.length===O.nesting){_.lastIndex=w,D=_.exec(e),w=_.lastIndex,T=D[0],D[1]==="${"?(T=`?InterpolationInTemplate`,j=!1,yield{type:`TemplateMiddle`,value:D[0]}):(N.pop(),j=!0,yield{type:`TemplateTail`,value:D[0],closed:D[1]==="`"});continue}break;case`InterpolationInJSX`:if(x.length===O.nesting){N.pop(),w+=1,T=`}`,yield{type:`JSXPunctuator`,value:`}`};continue}}j=x.pop(),A=j?`?ExpressionBraceEnd`:`}`;break;case`]`:j=!0;break;case`++`:case`--`:A=j?`?PostfixIncDec`:`?UnaryIncDec`;break;case`<`:if(t&&(y.test(T)||s.test(T))){N.push({tag:`JSXTag`}),w+=1,T=`<`,yield{type:`JSXPunctuator`,value:M};continue}j=!1;break;default:j=!1}w=k,T=A,yield{type:`Punctuator`,value:M};continue}if(n.lastIndex=w,D=n.exec(e)){switch(w=n.lastIndex,A=D[0],D[0]){case`for`:case`if`:case`while`:case`with`:T!==`.`&&T!==`?.`&&(A=`?NonExpressionParenKeyword`)}T=A,j=!s.test(D[0]),yield{type:D[1]===`#`?`PrivateIdentifier`:`IdentifierName`,value:D[0]};continue}if(g.lastIndex=w,D=g.exec(e)){w=g.lastIndex,T=D[0],j=!0,yield{type:`StringLiteral`,value:D[0],closed:D[2]!==void 0};continue}if(f.lastIndex=w,D=f.exec(e)){w=f.lastIndex,T=D[0],j=!0,yield{type:`NumericLiteral`,value:D[0]};continue}if(_.lastIndex=w,D=_.exec(e)){w=_.lastIndex,T=D[0],D[1]==="${"?(T=`?InterpolationInTemplate`,N.push({tag:`InterpolationInTemplate`,nesting:x.length}),j=!1,yield{type:`TemplateHead`,value:D[0]}):(j=!0,yield{type:`NoSubstitutionTemplate`,value:D[0],closed:D[1]==="`"});continue}break;case`JSXTag`:case`JSXTagEnd`:if(i.lastIndex=w,D=i.exec(e)){switch(w=i.lastIndex,A=D[0],D[0]){case`<`:N.push({tag:`JSXTag`});break;case`>`:N.pop(),T===`/`||O.tag===`JSXTagEnd`?(A=`?JSX`,j=!0):N.push({tag:`JSXChildren`});break;case`{`:N.push({tag:`InterpolationInJSX`,nesting:x.length}),A=`?InterpolationInJSX`,j=!1;break;case`/`:T===`<`&&(N.pop(),N[N.length-1].tag===`JSXChildren`&&N.pop(),N.push({tag:`JSXTagEnd`}))}T=A,yield{type:`JSXPunctuator`,value:D[0]};continue}if(r.lastIndex=w,D=r.exec(e)){w=r.lastIndex,T=D[0],yield{type:`JSXIdentifier`,value:D[0]};continue}if(a.lastIndex=w,D=a.exec(e)){w=a.lastIndex,T=D[0],yield{type:`JSXString`,value:D[0],closed:D[2]!==void 0};continue}break;case`JSXChildren`:if(o.lastIndex=w,D=o.exec(e)){w=o.lastIndex,T=D[0],yield{type:`JSXText`,value:D[0]};continue}switch(e[w]){case`<`:N.push({tag:`JSXTag`}),w++,T=`<`,yield{type:`JSXPunctuator`,value:`<`};continue;case`{`:N.push({tag:`InterpolationInJSX`,nesting:x.length}),w++,T=`?InterpolationInJSX`,j=!1,yield{type:`JSXPunctuator`,value:`{`};continue}}if(b.lastIndex=w,D=b.exec(e)){w=b.lastIndex,yield{type:`WhiteSpace`,value:D[0]};continue}if(l.lastIndex=w,D=l.exec(e)){w=l.lastIndex,j=!1,c.test(T)&&(T=`?NoLineTerminatorHere`),yield{type:`LineTerminatorSequence`,value:D[0]};continue}if(u.lastIndex=w,D=u.exec(e)){w=u.lastIndex,d.test(D[0])&&(j=!1,c.test(T)&&(T=`?NoLineTerminatorHere`)),yield{type:`MultiLineComment`,value:D[0],closed:D[1]!==void 0};continue}if(h.lastIndex=w,D=h.exec(e)){w=h.lastIndex,j=!1,yield{type:`SingleLineComment`,value:D[0]};continue}S=String.fromCodePoint(e.codePointAt(w)),w+=S.length,T=S,j=!1,yield{type:O.tag.startsWith(`JSX`)?`JSXInvalid`:`Invalid`,value:S}}}}}),Aa=G({"node_modules/n-readlines/readlines.js"(e,t){var n=W(`fs`);t.exports=class{constructor(e,t){t||={},t.readChunk||=1024,t.newLineCharacter?t.newLineCharacter=t.newLineCharacter.charCodeAt(0):t.newLineCharacter=10,typeof e==`number`?this.fd=e:this.fd=n.openSync(e,`r`),this.options=t,this.newLineCharacter=t.newLineCharacter,this.reset()}_searchInBuffer(e,t){let n=-1;for(let r=0;r<=e.length;r++)if(e[r]===t){n=r;break}return n}reset(){this.eofReached=!1,this.linesCache=[],this.fdPosition=0}close(){n.closeSync(this.fd),this.fd=null}_extractLines(e){let t,n=[],r=0,i=0;for(;;){let a=e[r++];if(a===this.newLineCharacter)t=e.slice(i,r),n.push(t),i=r;else if(a===void 0)break}let a=e.slice(i,r);return a.length&&n.push(a),n}_readChunk(e){let t=0,r,i=[];do{let e=Buffer.alloc(this.options.readChunk);r=n.readSync(this.fd,e,0,this.options.readChunk,this.fdPosition),t+=r,this.fdPosition+=r,i.push(e)}while(r&&this._searchInBuffer(i[i.length-1],this.options.newLineCharacter)===-1);let a=Buffer.concat(i);return r<this.options.readChunk&&(this.eofReached=!0,a=a.slice(0,t)),t&&(this.linesCache=this._extractLines(a),e&&(this.linesCache[0]=Buffer.concat([e,this.linesCache[0]]))),t}next(){if(!this.fd)return!1;let e=!1;if(this.eofReached&&this.linesCache.length===0)return e;let t;return this.linesCache.length||(t=this._readChunk()),this.linesCache.length&&(e=this.linesCache.shift(),e[e.length-1]!==this.newLineCharacter&&(t=this._readChunk(e),t&&(e=this.linesCache.shift()))),this.eofReached&&this.linesCache.length===0&&this.close(),e&&e[e.length-1]===this.newLineCharacter&&(e=e.slice(0,e.length-1)),e}}}}),ja=G({"node_modules/ignore/index.js"(e,t){function n(e){return Array.isArray(e)?e:[e]}var r=void 0,i=``,a=` `,o=`\\`,s=/^\s+$/,c=/(?:[^\\]|^)\\$/,l=/^\\!/,u=/^\\#/,d=/\r?\n/g,f=/^\.{0,2}\/|^\.{1,2}$/,p=/\/$/,m=`/`,h=`node-ignore`;typeof Symbol<`u`&&(h=Symbol.for(`node-ignore`));var g=h,_=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),v=/([0-z])-([0-z])/g,y=()=>!1,b=e=>e.replace(v,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:i),x=e=>{let{length:t}=e;return e.slice(0,t-t%2)},S=[[/^\uFEFF/,()=>i],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?a:i)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+a}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>o],[/\\\\/g,()=>o],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===o?`\\[${n}${x(r)}${i}`:i===`]`&&r.length%2==0?`[${b(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],C=/(^|\\\/)?\\\*$/,w=`regex`,T=`checkRegex`,E=`_`,D={[w](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[T](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},O=e=>S.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),k=e=>typeof e==`string`,A=e=>e&&k(e)&&!s.test(e)&&!c.test(e)&&e.indexOf(`#`)!==0,ee=e=>e.split(d).filter(Boolean),j=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,_(this,`body`,n),_(this,`ignoreCase`,r),_(this,`regexPrefix`,a)}get regex(){let e=E+w;return this[e]?this[e]:this._make(w,e)}get checkRegex(){let e=E+T;return this[e]?this[e]:this._make(T,e)}_make(e,t){let n=this.regexPrefix.replace(C,D[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return _(this,t,r)}},M=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(l,`!`).replace(u,`#`);let a=O(i);return new j(e,t,i,n,r,a)},N=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[g]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(k(e)&&(e={pattern:e}),A(e.pattern)){let t=M(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(k(e)?ee(e):e).forEach(this._add,this),this._added}test(e,t,n){let i=!1,a=!1,o;this._rules.forEach(s=>{let{negative:c}=s;a===c&&i!==a||c&&!i&&!a&&!t||s[n].test(e)&&(i=!c,a=c,o=c?r:s)});let s={ignored:i,unignored:a};return o&&(s.rule=o),s}},te=(e,t)=>{throw new t(e)},P=(e,t,n)=>k(e)?e?P.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),F=e=>f.test(e);P.isNotRelative=F,P.convert=e=>e;var ne=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){_(this,g,!0),this._rules=new N(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&P.convert(e);return P(i,e,this._strictPathCheck?te:y),this._t(i,t,n,r)}checkIgnore(e){if(!p.test(e))return this.test(e);let t=e.split(m).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(m)+m,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,T)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(m).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,w);let i=this._t(r.join(m)+m,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,w)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},I=e=>new ne(e),re=e=>P(e&&P.convert(e),e,y),L=()=>{P.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;P.isNotRelative=t=>e.test(t)||F(t)};typeof process<`u`&&process.platform===`win32`&&L(),t.exports=I,I.default=I,t.exports.isPathValid=re,_(t.exports,Symbol.for(`setupWindows`),L)}}),Ma={};Ur(Ma,{__debug:()=>Wg,__internal:()=>Ug,check:()=>zg,clearConfigCache:()=>Bg,doc:()=>kt,format:()=>Rg,formatWithCursor:()=>Lg,getFileInfo:()=>$h,getSupportInfo:()=>Vg,resolveConfig:()=>gd,resolveConfigFile:()=>_d,util:()=>tg,version:()=>eg});var Na=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},Pa=new class extends Na{constructor(){super(...arguments),this.tokenize=Ia}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
171
+ `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
172
+ `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
173
+ `)&&(e=e.slice(0,-1)),t.endsWith(`
174
+ `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Fa(e,t,n){return Pa.diff(e,t,n)}function Ia(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
175
+ `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}var La=new class extends Na{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Ra(e,t,n){return La.diff(e,t,n)}function za(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;Fa(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(Fa(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||Ha(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
176
+ `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function Ba(e){if(Array.isArray(e))return e.map(Ba).join(`
177
+ `);let t=[];e.oldFileName==e.newFileName&&t.push(`Index: `+e.oldFileName),t.push(`===================================================================`),t.push(`--- `+e.oldFileName+(e.oldHeader===void 0?``:` `+e.oldHeader)),t.push(`+++ `+e.newFileName+(e.newHeader===void 0?``:` `+e.newHeader));for(let n=0;n<e.hunks.length;n++){let r=e.hunks[n];r.oldLines===0&&--r.oldStart,r.newLines===0&&--r.newStart,t.push(`@@ -`+r.oldStart+`,`+r.oldLines+` +`+r.newStart+`,`+r.newLines+` @@`);for(let e of r.lines)t.push(e)}return t.join(`
178
+ `)+`
179
+ `}function Va(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;za(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Ba(e):void 0)}}))}else{let s=za(e,t,n,r,i,a,o);return s?Ba(s):void 0}}function Ha(e){let t=e.endsWith(`
180
+ `),n=e.split(`
181
+ `).map(e=>e+`
182
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var Ua=Gr(ua(),1),Wa=[],Ga=[];function Ka(e,t,n){if(e===t)return 0;let r=n?.maxDistance,i=e;e.length>t.length&&(e=t,t=i);let a=e.length,o=t.length;for(;a>0&&e.charCodeAt(~-a)===t.charCodeAt(~-o);)a--,o--;let s=0;for(;s<a&&e.charCodeAt(s)===t.charCodeAt(s);)s++;if(a-=s,o-=s,r!==void 0&&o-a>r)return r;if(a===0)return r!==void 0&&o>r?r:o;let c,l,u,d,f=0,p=0;for(;f<a;)Ga[f]=e.charCodeAt(s+f),Wa[f]=++f;for(;p<o;){for(c=t.charCodeAt(s+p),u=p++,l=p,f=0;f<a;f++)d=c===Ga[f]?u:u+1,u=Wa[f],l=Wa[f]=u>l?d>l?l+1:d:d>u?u+1:d;if(r!==void 0){let e=l;for(f=0;f<a;f++)Wa[f]<e&&(e=Wa[f]);if(e>r)return r}}return Wa.length=a,Ga.length=a,r!==void 0&&l>r?r:l}function qa(e,t,n){if(!Array.isArray(t)||t.length===0)return;let r=n?.maxDistance,i=e.length;for(let n of t)if(n===e)return n;if(r===0)return;let a,o=1/0,s=new Set;for(let n of t){if(s.has(n))continue;s.add(n);let t=Math.abs(n.length-i);if(t>=o||r!==void 0&&t>r)continue;let c=Number.isFinite(o)?r===void 0?o:Math.min(o,r):r,l=c===void 0?Ka(e,n):Ka(e,n,{maxDistance:c});if(r!==void 0&&l>r)continue;let u=l;if(c!==void 0&&l===c&&c===r&&(u=Ka(e,n)),u<o&&(o=u,a=n,o===0))break}if(!(r!==void 0&&o>r))return a}var Ja=Gr(da(),1),Ya={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(typeof e!=`object`||!e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(e=>Ya.value(e)).join(`, `)}]`;let t=Object.keys(e);return t.length===0?`{}`:`{ ${t.map(t=>`${Ya.key(t)}: ${Ya.value(e[t])}`).join(`, `)} }`},pair:({key:e,value:t})=>Ya.value({[e]:t})},Xa=Gr(da(),1),Za=(e,t,{descriptor:n})=>{let r=[`${Xa.default.yellow(typeof e==`string`?n.key(e):n.pair(e))} is deprecated`];return t&&r.push(`we now treat it as ${Xa.default.blue(typeof t==`string`?n.key(t):n.pair(t))}`),r.join(`; `)+`.`},Qa=Gr(da(),1),$a=Symbol.for(`vnopts.VALUE_NOT_EXIST`),eo=Symbol.for(`vnopts.VALUE_UNCHANGED`),to=` `.repeat(2),no=(e,t,n)=>{let{text:r,list:i}=n.normalizeExpectedResult(n.schemas[e].expected(n)),a=[];return r&&a.push(ro(e,t,r,n.descriptor)),i&&a.push([ro(e,t,i.title,n.descriptor)].concat(i.values.map(e=>io(e,n.loggerPrintWidth))).join(`
183
+ `)),ao(a,n.loggerPrintWidth)};function ro(e,t,n,r){return[`Invalid ${Qa.default.red(r.key(e))} value.`,`Expected ${Qa.default.blue(n)},`,`but received ${t===$a?Qa.default.gray(`nothing`):Qa.default.red(r.value(t))}.`].join(` `)}function io({text:e,list:t},n){let r=[];return e&&r.push(`- ${Qa.default.blue(e)}`),t&&r.push([`- ${Qa.default.blue(t.title)}:`].concat(t.values.map(e=>io(e,n-to.length).replace(/^|\n/g,`$&${to}`))).join(`
184
+ `)),ao(r,n)}function ao(e,t){if(e.length===1)return e[0];let[n,r]=e,[i,a]=e.map(e=>e.split(`
185
+ `,1)[0].length);return i>t&&i>a?r:n}var oo=Gr(da(),1),so=(e,t,{descriptor:n,logger:r,schemas:i})=>{let a=[`Ignored unknown option ${oo.default.yellow(n.pair({key:e,value:t}))}.`],o=qa(e,Object.keys(i),{maxDistance:3});o&&a.push(`Did you mean ${oo.default.blue(n.key(o))}?`),r.warn(a.join(` `))},co=[`default`,`expected`,`validate`,`deprecated`,`forward`,`redirect`,`overlap`,`preprocess`,`postprocess`];function lo(e,t){let n=new e(t),r=Object.create(n);for(let e of co)e in t&&(r[e]=fo(t[e],n,uo.prototype[e].length));return r}var uo=class{static create(e){return lo(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return`nothing`}validate(e,t){return!1}deprecated(e,t){return!1}forward(e,t){}redirect(e,t){}overlap(e,t,n){return e}preprocess(e,t){return e}postprocess(e,t){return eo}};function fo(e,t,n){return typeof e==`function`?(...r)=>e(...r.slice(0,n-1),t,...r.slice(n-1)):()=>e}var po=class extends uo{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,t){return t.schemas[this._sourceName].validate(e,t)}redirect(e,t){return this._sourceName}},mo=class extends uo{expected(){return`anything`}validate(){return!0}},ho=class extends uo{constructor({valueSchema:e,name:t=e.name,...n}){super({...n,name:t}),this._valueSchema=e}expected(e){let{text:t,list:n}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:t&&`an array of ${t}`,list:n&&{title:`an array of the following values`,values:[{list:n}]}}}validate(e,t){if(!Array.isArray(e))return!1;let n=[];for(let r of e){let e=t.normalizeValidateResult(this._valueSchema.validate(r,t),r);e!==!0&&n.push(e.value)}return n.length===0?!0:{value:n}}deprecated(e,t){let n=[];for(let r of e){let e=t.normalizeDeprecatedResult(this._valueSchema.deprecated(r,t),r);e!==!1&&n.push(...e.map(({value:e})=>({value:[e]})))}return n}forward(e,t){let n=[];for(let r of e){let e=t.normalizeForwardResult(this._valueSchema.forward(r,t),r);n.push(...e.map(go))}return n}redirect(e,t){let n=[],r=[];for(let i of e){let e=t.normalizeRedirectResult(this._valueSchema.redirect(i,t),i);`remain`in e&&n.push(e.remain),r.push(...e.redirect.map(go))}return n.length===0?{redirect:r}:{redirect:r,remain:n}}overlap(e,t){return e.concat(t)}};function go({from:e,to:t}){return{from:[e],to:t}}var _o=class extends uo{expected(){return`true or false`}validate(e){return typeof e==`boolean`}};function vo(e,t){let n=Object.create(null);for(let r of e){let e=r[t];if(n[e])throw Error(`Duplicate ${t} ${JSON.stringify(e)}`);n[e]=r}return n}function yo(e,t){let n=new Map;for(let r of e){let e=r[t];if(n.has(e))throw Error(`Duplicate ${t} ${JSON.stringify(e)}`);n.set(e,r)}return n}function bo(){let e=Object.create(null);return t=>{let n=JSON.stringify(t);return e[n]?!0:(e[n]=!0,!1)}}function xo(e,t){let n=[],r=[];for(let i of e)t(i)?n.push(i):r.push(i);return[n,r]}function So(e){return e===Math.floor(e)}function Co(e,t){if(e===t)return 0;let n=typeof e,r=typeof t,i=[`undefined`,`object`,`boolean`,`number`,`string`];return n===r?n===`string`?e.localeCompare(t):Number(e)-Number(t):i.indexOf(n)-i.indexOf(r)}function wo(e){return(...t)=>{let n=e(...t);return typeof n==`string`?Error(n):n}}function To(e){return e===void 0?{}:e}function Eo(e){if(typeof e==`string`)return{text:e};let{text:t,list:n}=e;return Mo((t||n)!==void 0,"Unexpected `expected` result, there should be at least one field."),n?{text:t,list:{title:n.title,values:n.values.map(Eo)}}:{text:t}}function Do(e,t){return e===!0?!0:e===!1?{value:t}:e}function Oo(e,t,n=!1){return e===!1?!1:e===!0?n?!0:[{value:t}]:`value`in e?[e]:e.length===0?!1:e}function ko(e,t){return typeof e==`string`||`key`in e?{from:t,to:e}:`from`in e?{from:e.from,to:e.to}:{from:t,to:e.to}}function Ao(e,t){return e===void 0?[]:Array.isArray(e)?e.map(e=>ko(e,t)):[ko(e,t)]}function jo(e,t){let n=Ao(typeof e==`object`&&`redirect`in e?e.redirect:e,t);return n.length===0?{remain:t,redirect:n}:typeof e==`object`&&`remain`in e?{remain:e.remain,redirect:n}:{redirect:n}}function Mo(e,t){if(!e)throw Error(t)}var No=class extends uo{constructor(e){super(e),this._choices=yo(e.choices.map(e=>e&&typeof e==`object`?e:{value:e}),`value`)}expected({descriptor:e}){let t=Array.from(this._choices.keys()).map(e=>this._choices.get(e)).filter(({hidden:e})=>!e).map(e=>e.value).sort(Co).map(e.value),n=t.slice(0,-2),r=t.slice(-2);return{text:n.concat(r.join(` or `)).join(`, `),list:{title:`one of the following values`,values:t}}}validate(e){return this._choices.has(e)}deprecated(e){let t=this._choices.get(e);return t&&t.deprecated?{value:e}:!1}forward(e){let t=this._choices.get(e);return t?t.forward:void 0}redirect(e){let t=this._choices.get(e);return t?t.redirect:void 0}},Po=class extends uo{expected(){return`a number`}validate(e,t){return typeof e==`number`}},Fo=class extends Po{expected(){return`an integer`}validate(e,t){return t.normalizeValidateResult(super.validate(e,t),e)===!0&&So(e)}},Io=class extends uo{expected(){return`a string`}validate(e){return typeof e==`string`}},Lo=Ya,Ro=so,zo=no,Bo=Za,Vo=class{constructor(e,t){let{logger:n=console,loggerPrintWidth:r=80,descriptor:i=Lo,unknown:a=Ro,invalid:o=zo,deprecated:s=Bo,missing:c=()=>!1,required:l=()=>!1,preprocess:u=e=>e,postprocess:d=()=>eo}=t||{};this._utils={descriptor:i,logger:n||{warn:()=>{}},loggerPrintWidth:r,schemas:vo(e,`name`),normalizeDefaultResult:To,normalizeExpectedResult:Eo,normalizeDeprecatedResult:Oo,normalizeForwardResult:Ao,normalizeRedirectResult:jo,normalizeValidateResult:Do},this._unknownHandler=a,this._invalidHandler=wo(o),this._deprecatedHandler=s,this._identifyMissing=(e,t)=>!(e in t)||c(e,t),this._identifyRequired=l,this._preprocess=u,this._postprocess=d,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=bo()}normalize(e){let t={},n=[this._preprocess(e,this._utils)],r=()=>{for(;n.length!==0;){let e=n.shift(),r=this._applyNormalization(e,t);n.push(...r)}};r();for(let e of Object.keys(this._utils.schemas)){let r=this._utils.schemas[e];if(!(e in t)){let t=To(r.default(this._utils));`value`in t&&n.push({[e]:t.value})}}r();for(let e of Object.keys(this._utils.schemas)){if(!(e in t))continue;let n=this._utils.schemas[e],r=t[e],i=n.postprocess(r,this._utils);i!==eo&&(this._applyValidation(i,e,n),t[e]=i)}return this._applyPostprocess(t),this._applyRequiredCheck(t),t}_applyNormalization(e,t){let n=[],{knownKeys:r,unknownKeys:i}=this._partitionOptionKeys(e);for(let i of r){let r=this._utils.schemas[i],a=r.preprocess(e[i],this._utils);this._applyValidation(a,i,r);let o=({from:e,to:t})=>{n.push(typeof t==`string`?{[t]:e}:{[t.key]:t.value})},s=({value:e,redirectTo:t})=>{let n=Oo(r.deprecated(e,this._utils),a,!0);if(n!==!1)if(n===!0)this._hasDeprecationWarned(i)||this._utils.logger.warn(this._deprecatedHandler(i,t,this._utils));else for(let{value:e}of n){let n={key:i,value:e};if(!this._hasDeprecationWarned(n)){let r=typeof t==`string`?{key:t,value:e}:t;this._utils.logger.warn(this._deprecatedHandler(n,r,this._utils))}}};Ao(r.forward(a,this._utils),a).forEach(o);let c=jo(r.redirect(a,this._utils),a);if(c.redirect.forEach(o),`remain`in c){let e=c.remain;t[i]=i in t?r.overlap(t[i],e,this._utils):e,s({value:e})}for(let{from:e,to:t}of c.redirect)s({value:e,redirectTo:t})}for(let r of i){let i=e[r];this._applyUnknownHandler(r,i,t,(e,t)=>{n.push({[e]:t})})}return n}_applyRequiredCheck(e){for(let t of Object.keys(this._utils.schemas))if(this._identifyMissing(t,e)&&this._identifyRequired(t))throw this._invalidHandler(t,$a,this._utils)}_partitionOptionKeys(e){let[t,n]=xo(Object.keys(e).filter(t=>!this._identifyMissing(t,e)),e=>e in this._utils.schemas);return{knownKeys:t,unknownKeys:n}}_applyValidation(e,t,n){let r=Do(n.validate(e,this._utils),e);if(r!==!0)throw this._invalidHandler(t,r.value,this._utils)}_applyUnknownHandler(e,t,n,r){let i=this._unknownHandler(e,t,this._utils);if(i)for(let e of Object.keys(i)){if(this._identifyMissing(e,i))continue;let t=i[e];e in this._utils.schemas?r(e,t):n[e]=t}}_applyPostprocess(e){let t=this._postprocess(e,this._utils);if(t!==eo){if(t.delete)for(let n of t.delete)delete e[n];if(t.override){let{knownKeys:n,unknownKeys:r}=this._partitionOptionKeys(t.override);for(let r of n){let n=t.override[r];this._applyValidation(n,r,this._utils.schemas[r]),e[r]=n}for(let n of r){let r=t.override[n];this._applyUnknownHandler(n,r,e,(t,n)=>{let r=this._utils.schemas[t];this._applyValidation(n,t,r),e[t]=n})}}}}},Ho={};Ur(Ho,{ArgExpansionBailout:()=>Go,ConfigError:()=>Uo,UndefinedParserError:()=>Wo});var Uo=class extends Error{name=`ConfigError`},Wo=class extends Error{name=`UndefinedParserError`},Go=class extends Error{name=`ArgExpansionBailout`};function Ko(e){let t={...e},n=(n,r)=>{if(!Object.prototype.hasOwnProperty.call(e,n))throw Error(`Unexpected mock '${n}'.`);t[n]=r};return{mocked:t,implementations:e,mockImplementation:n,mockImplementations:e=>{for(let[t,r]of Object.entries(e))n(t,r)},mockRestore:()=>{Object.assign(t,e)}}}var qo=Ko,Jo=qo({getPrettierConfigSearchStopDirectory:()=>void 0}),Yo=Jo.mocked,Xo=Gr(hi(),1),Zo=`file:`,Qo=e=>e instanceof URL,$o=e=>typeof e==`string`&&e.startsWith(Zo),es=e=>Qo(e)||$o(e),ts=e=>es(e)?d.fileURLToPath(e):e,ns=e=>e&&h.resolve(es(e)?d.fileURLToPath(e):e);function rs(e,t){let n=[[],[]];for(let r of e)n[+!t(r)].push(r);return n}var is=rs,as=Gr(Oa(),1),os=e=>e?.isFile(),ss=e=>e?.isDirectory();async function cs(e,{typeCheck:t,cwd:n,allowSymlinks:r=!0,filter:i}){let a=ns(n)??b.cwd(),o=Array.isArray(e)?e:[e];for(let e of o){let n=h.join(a,e),o=await ls(n,r);if(await t(o)&&(!i||await i({name:e,path:n,stats:o})))return n}}async function ls(e,t=!0){try{return await(t?v.stat:v.lstat)(e)}catch{}}function us(e,t){return cs(e,{...t,typeCheck:os})}function ds(e,t){return cs(e,{...t,typeCheck:ss})}function*fs(e,t){let n=ns(e)??b.cwd(),r=ns(t);if(r){let e=h.relative(r,n);if(e[0]===`.`||e===n)return}for(r=r?n.slice(0,r.length):h.parse(n).root;n!==r;)yield n,n=h.dirname(n);yield r}var ps=fs,ms=class{#e;#t;#n=new Map;#r;findInDirectory;constructor(e,{allowSymlinks:t,filter:n,stopDirectory:r,cache:i}={}){this.#e=r,this.#t=i??!0,this.#r=r=>this.findInDirectory(e,{cwd:r,filter:n,allowSymlinks:t})}#i(e,t=!0){let n=this.#n;return(!t||!n.has(e))&&n.set(e,this.#r(e)),n.get(e)}async search(e,t){for(let n of ps(e,this.#e)){let e=await this.#i(n,t?.cache??this.#t);if(e)return e}}clearCache(){this.#n.clear()}},hs=class extends ms{findInDirectory=us},gs=class extends ms{findInDirectory=ds},_s=[`.git`,`.hg`],vs;async function ys(e,t){vs??=new gs(_s,{allowSymlinks:!1});let n=await vs.search(e,{cache:t.shouldCache});return n?h.dirname(n):void 0}function bs(){vs?.clearCache()}var xs=e=>Number.isSafeInteger(e)&&e>0;function Ss(e){if(!e)return;let t={},{indent_style:n,indent_size:r,tab_width:i,max_line_length:a,quote_type:o,end_of_line:s}=e;if(n===`space`?t.useTabs=!1:(n===`tab`||r===`tab`)&&(t.useTabs=!0),t.useTabs===!1&&xs(r)?t.tabWidth=r:xs(i)&&(t.tabWidth=i),a===`off`?t.printWidth=1/0:xs(a)&&(t.printWidth=a),o===`single`?t.singleQuote=!0:o===`double`&&(t.singleQuote=!1),(s===`lf`||s===`crlf`||s===`cr`)&&(t.endOfLine=s),Object.keys(t).length!==0)return t}var Cs=Ss,ws=new Map;function Ts(){bs(),ws.clear()}async function Es(e,{shouldCache:t}){let n=await ys(g.dirname(e),{shouldCache:t});return Cs(await as.default.parse(e,{root:n}))}function Ds(e,{shouldCache:t}){return e=g.resolve(e),(!t||!ws.has(e))&&ws.set(e,Es(e,{shouldCache:t})),ws.get(e)}var Os={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},K={isSpaceSeparator(e){return typeof e==`string`&&Os.Space_Separator.test(e)},isIdStartChar(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`$`||e===`_`||Os.ID_Start.test(e))},isIdContinueChar(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`_`||e===`‌`||e===`‍`||Os.ID_Continue.test(e))},isDigit(e){return typeof e==`string`&&/[0-9]/.test(e)},isHexDigit(e){return typeof e==`string`&&/[0-9A-Fa-f]/.test(e)}},ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs=function(e,t){ks=String(e),As=`start`,js=[],Ms=0,Ns=1,Ps=0,Fs=void 0,Is=void 0,Ls=void 0;do Fs=Hs(),Ys[As]();while(Fs.type!==`eof`);return typeof t==`function`?zs({"":Ls},``,t):Ls};function zs(e,t,n){let r=e[t];if(typeof r==`object`&&r)if(Array.isArray(r))for(let e=0;e<r.length;e++){let t=String(e),i=zs(r,t,n);i===void 0?delete r[t]:Object.defineProperty(r,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}else for(let e in r){let t=zs(r,e,n);t===void 0?delete r[e]:Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}return n.call(e,t,r)}var q,J,Bs,Vs,Y;function Hs(){for(q=`default`,J=``,Bs=!1,Vs=1;;){Y=Us();let e=Ws[q]();if(e)return e}}function Us(){if(ks[Ms])return String.fromCodePoint(ks.codePointAt(Ms))}function X(){let e=Us();return e===`
186
+ `?(Ns++,Ps=0):e?Ps+=e.length:Ps++,e&&(Ms+=e.length),e}var Ws={default(){switch(Y){case` `:case`\v`:case`\f`:case` `:case`\xA0`:case``:case`
187
+ `:case`\r`:case`\u2028`:case`\u2029`:X();return;case`/`:X(),q=`comment`;return;case void 0:return X(),Z(`eof`)}if(K.isSpaceSeparator(Y)){X();return}return Ws[As]()},comment(){switch(Y){case`*`:X(),q=`multiLineComment`;return;case`/`:X(),q=`singleLineComment`;return}throw Q(X())},multiLineComment(){switch(Y){case`*`:X(),q=`multiLineCommentAsterisk`;return;case void 0:throw Q(X())}X()},multiLineCommentAsterisk(){switch(Y){case`*`:X();return;case`/`:X(),q=`default`;return;case void 0:throw Q(X())}X(),q=`multiLineComment`},singleLineComment(){switch(Y){case`
188
+ `:case`\r`:case`\u2028`:case`\u2029`:X(),q=`default`;return;case void 0:return X(),Z(`eof`)}X()},value(){switch(Y){case`{`:case`[`:return Z(`punctuator`,X());case`n`:return X(),Gs(`ull`),Z(`null`,null);case`t`:return X(),Gs(`rue`),Z(`boolean`,!0);case`f`:return X(),Gs(`alse`),Z(`boolean`,!1);case`-`:case`+`:X()===`-`&&(Vs=-1),q=`sign`;return;case`.`:J=X(),q=`decimalPointLeading`;return;case`0`:J=X(),q=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:J=X(),q=`decimalInteger`;return;case`I`:return X(),Gs(`nfinity`),Z(`numeric`,1/0);case`N`:return X(),Gs(`aN`),Z(`numeric`,NaN);case`"`:case`'`:Bs=X()===`"`,J=``,q=`string`;return}throw Q(X())},identifierNameStartEscape(){if(Y!==`u`)throw Q(X());X();let e=Js();switch(e){case`$`:case`_`:break;default:if(!K.isIdStartChar(e))throw $s();break}J+=e,q=`identifierName`},identifierName(){switch(Y){case`$`:case`_`:case`‌`:case`‍`:J+=X();return;case`\\`:X(),q=`identifierNameEscape`;return}if(K.isIdContinueChar(Y)){J+=X();return}return Z(`identifier`,J)},identifierNameEscape(){if(Y!==`u`)throw Q(X());X();let e=Js();switch(e){case`$`:case`_`:case`‌`:case`‍`:break;default:if(!K.isIdContinueChar(e))throw $s();break}J+=e,q=`identifierName`},sign(){switch(Y){case`.`:J=X(),q=`decimalPointLeading`;return;case`0`:J=X(),q=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:J=X(),q=`decimalInteger`;return;case`I`:return X(),Gs(`nfinity`),Z(`numeric`,Vs*(1/0));case`N`:return X(),Gs(`aN`),Z(`numeric`,NaN)}throw Q(X())},zero(){switch(Y){case`.`:J+=X(),q=`decimalPoint`;return;case`e`:case`E`:J+=X(),q=`decimalExponent`;return;case`x`:case`X`:J+=X(),q=`hexadecimal`;return}return Z(`numeric`,Vs*0)},decimalInteger(){switch(Y){case`.`:J+=X(),q=`decimalPoint`;return;case`e`:case`E`:J+=X(),q=`decimalExponent`;return}if(K.isDigit(Y)){J+=X();return}return Z(`numeric`,Vs*Number(J))},decimalPointLeading(){if(K.isDigit(Y)){J+=X(),q=`decimalFraction`;return}throw Q(X())},decimalPoint(){switch(Y){case`e`:case`E`:J+=X(),q=`decimalExponent`;return}if(K.isDigit(Y)){J+=X(),q=`decimalFraction`;return}return Z(`numeric`,Vs*Number(J))},decimalFraction(){switch(Y){case`e`:case`E`:J+=X(),q=`decimalExponent`;return}if(K.isDigit(Y)){J+=X();return}return Z(`numeric`,Vs*Number(J))},decimalExponent(){switch(Y){case`+`:case`-`:J+=X(),q=`decimalExponentSign`;return}if(K.isDigit(Y)){J+=X(),q=`decimalExponentInteger`;return}throw Q(X())},decimalExponentSign(){if(K.isDigit(Y)){J+=X(),q=`decimalExponentInteger`;return}throw Q(X())},decimalExponentInteger(){if(K.isDigit(Y)){J+=X();return}return Z(`numeric`,Vs*Number(J))},hexadecimal(){if(K.isHexDigit(Y)){J+=X(),q=`hexadecimalInteger`;return}throw Q(X())},hexadecimalInteger(){if(K.isHexDigit(Y)){J+=X();return}return Z(`numeric`,Vs*Number(J))},string(){switch(Y){case`\\`:X(),J+=Ks();return;case`"`:if(Bs)return X(),Z(`string`,J);J+=X();return;case`'`:if(!Bs)return X(),Z(`string`,J);J+=X();return;case`
189
+ `:case`\r`:throw Q(X());case`\u2028`:case`\u2029`:ec(Y);break;case void 0:throw Q(X())}J+=X()},start(){switch(Y){case`{`:case`[`:return Z(`punctuator`,X())}q=`value`},beforePropertyName(){switch(Y){case`$`:case`_`:J=X(),q=`identifierName`;return;case`\\`:X(),q=`identifierNameStartEscape`;return;case`}`:return Z(`punctuator`,X());case`"`:case`'`:Bs=X()===`"`,q=`string`;return}if(K.isIdStartChar(Y)){J+=X(),q=`identifierName`;return}throw Q(X())},afterPropertyName(){if(Y===`:`)return Z(`punctuator`,X());throw Q(X())},beforePropertyValue(){q=`value`},afterPropertyValue(){switch(Y){case`,`:case`}`:return Z(`punctuator`,X())}throw Q(X())},beforeArrayValue(){if(Y===`]`)return Z(`punctuator`,X());q=`value`},afterArrayValue(){switch(Y){case`,`:case`]`:return Z(`punctuator`,X())}throw Q(X())},end(){throw Q(X())}};function Z(e,t){return{type:e,value:t,line:Ns,column:Ps}}function Gs(e){for(let t of e){if(Us()!==t)throw Q(X());X()}}function Ks(){switch(Us()){case`b`:return X(),`\b`;case`f`:return X(),`\f`;case`n`:return X(),`
190
+ `;case`r`:return X(),`\r`;case`t`:return X(),` `;case`v`:return X(),`\v`;case`0`:if(X(),K.isDigit(Us()))throw Q(X());return`\0`;case`x`:return X(),qs();case`u`:return X(),Js();case`
191
+ `:case`\u2028`:case`\u2029`:return X(),``;case`\r`:return X(),Us()===`
192
+ `&&X(),``;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:throw Q(X());case void 0:throw Q(X())}return X()}function qs(){let e=``,t=Us();if(!K.isHexDigit(t)||(e+=X(),t=Us(),!K.isHexDigit(t)))throw Q(X());return e+=X(),String.fromCodePoint(parseInt(e,16))}function Js(){let e=``,t=4;for(;t-- >0;){let t=Us();if(!K.isHexDigit(t))throw Q(X());e+=X()}return String.fromCodePoint(parseInt(e,16))}var Ys={start(){if(Fs.type===`eof`)throw Qs();Xs()},beforePropertyName(){switch(Fs.type){case`identifier`:case`string`:Is=Fs.value,As=`afterPropertyName`;return;case`punctuator`:Zs();return;case`eof`:throw Qs()}},afterPropertyName(){if(Fs.type===`eof`)throw Qs();As=`beforePropertyValue`},beforePropertyValue(){if(Fs.type===`eof`)throw Qs();Xs()},beforeArrayValue(){if(Fs.type===`eof`)throw Qs();if(Fs.type===`punctuator`&&Fs.value===`]`){Zs();return}Xs()},afterPropertyValue(){if(Fs.type===`eof`)throw Qs();switch(Fs.value){case`,`:As=`beforePropertyName`;return;case`}`:Zs()}},afterArrayValue(){if(Fs.type===`eof`)throw Qs();switch(Fs.value){case`,`:As=`beforeArrayValue`;return;case`]`:Zs()}},end(){}};function Xs(){let e;switch(Fs.type){case`punctuator`:switch(Fs.value){case`{`:e={};break;case`[`:e=[];break}break;case`null`:case`boolean`:case`numeric`:case`string`:e=Fs.value;break}if(Ls===void 0)Ls=e;else{let t=js[js.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,Is,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(typeof e==`object`&&e)js.push(e),As=Array.isArray(e)?`beforeArrayValue`:`beforePropertyName`;else{let e=js[js.length-1];As=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}}function Zs(){js.pop();let e=js[js.length-1];As=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}function Q(e){return nc(e===void 0?`JSON5: invalid end of input at ${Ns}:${Ps}`:`JSON5: invalid character '${tc(e)}' at ${Ns}:${Ps}`)}function Qs(){return nc(`JSON5: invalid end of input at ${Ns}:${Ps}`)}function $s(){return Ps-=5,nc(`JSON5: invalid identifier character at ${Ns}:${Ps}`)}function ec(e){console.warn(`JSON5: '${tc(e)}' in strings is not valid ECMAScript; consider escaping`)}function tc(e){let t={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`};if(t[e])return t[e];if(e<` `){let t=e.charCodeAt(0).toString(16);return`\\x`+(`00`+t).substring(t.length)}return e}function nc(e){let t=SyntaxError(e);return t.lineNumber=Ns,t.columnNumber=Ps,t}var rc={parse:Rs},ic=Gr(da(),1),ac=Gr(ka(),1),oc=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,sc=`·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`;RegExp(`[`+oc+`]`),RegExp(`[`+oc+sc+`]`),oc=sc=null;var cc={keyword:`break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete`.split(`.`),strict:[`implements`,`interface`,`let`,`package`,`private`,`protected`,`public`,`static`,`yield`],strictBind:[`eval`,`arguments`]},lc=new Set(cc.keyword),uc=new Set(cc.strict);new Set(cc.strictBind);function dc(e,t){return t&&e===`await`||e===`enum`}function fc(e,t){return dc(e,t)||uc.has(e)}function pc(e){return lc.has(e)}function mc(){return typeof process==`object`&&(process.env.FORCE_COLOR===`0`||process.env.FORCE_COLOR===`false`)?!1:ic.default.isColorSupported}var hc=(e,t)=>n=>e(t(n));function gc(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.gray,invalid:hc(hc(e.white,e.bgRed),e.bold),gutter:e.gray,marker:hc(e.red,e.bold),message:hc(e.red,e.bold),reset:e.reset}}var _c=gc((0,ic.createColors)(!0)),vc=gc((0,ic.createColors)(!1));function yc(e){return e?_c:vc}var bc=new Set([`as`,`async`,`from`,`get`,`of`,`set`]),xc=/\r\n|[\n\r\u2028\u2029]/,Sc=/^[()[\]{}]$/,Cc;{let e=function(e){if(e.type===`IdentifierName`){if(pc(e.value)||fc(e.value,!0)||bc.has(e.value))return`keyword`;if(e.value[0]!==e.value[0].toLowerCase())return`capitalized`}if(e.type===`Punctuator`&&Sc.test(e.value))return`uncolored`;if(e.type===`Invalid`&&e.value===`@`)return`punctuator`;switch(e.type){case`NumericLiteral`:return`number`;case`StringLiteral`:case`JSXString`:case`NoSubstitutionTemplate`:return`string`;case`RegularExpressionLiteral`:return`regex`;case`Punctuator`:case`JSXPunctuator`:return`punctuator`;case`MultiLineComment`:case`SingleLineComment`:return`comment`;case`Invalid`:case`JSXInvalid`:return`invalid`;case`JSXIdentifier`:return`jsxIdentifier`;default:return`uncolored`}};Cc=function*(t){for(let n of(0,ac.default)(t,{jsx:!0}))switch(n.type){case`TemplateHead`:yield{type:`string`,value:n.value.slice(0,-2)},yield{type:`punctuator`,value:"${"};break;case`TemplateMiddle`:yield{type:`punctuator`,value:`}`},yield{type:`string`,value:n.value.slice(1,-2)},yield{type:`punctuator`,value:"${"};break;case`TemplateTail`:yield{type:`punctuator`,value:`}`},yield{type:`string`,value:n.value.slice(1)};break;default:yield{type:e(n),value:n.value}}}}function wc(e){if(e===``)return``;let t=yc(!0),n=``;for(let{type:r,value:i}of Cc(e))r in t?n+=i.split(xc).map(e=>t[r](e)).join(`
193
+ `):n+=i;return n}var Tc=/\r\n|[\n\r\u2028\u2029]/;function Ec(e,t,n){let r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:a=2,linesBelow:o=3}=n||{},s=r.line,c=r.column,l=i.line,u=i.column,d=Math.max(s-(a+1),0),f=Math.min(t.length,l+o);s===-1&&(d=0),l===-1&&(f=t.length);let p=l-s,m={};if(p)for(let e=0;e<=p;e++){let n=e+s;c?e===0?m[n]=[c,t[n-1].length-c+1]:e===p?m[n]=[0,u]:m[n]=[0,t[n-e].length]:m[n]=!0}else c===u?c?m[s]=[c,0]:m[s]=!0:m[s]=[c,u-c];return{start:d,end:f,markerLines:m}}function Dc(e,t,n={}){let r=n.forceColor||mc()&&n.highlightCode,i=yc(r),{start:a,end:o,markerLines:s}=Ec(t,e.split(Tc),n),c=t.start&&typeof t.start.column==`number`,l=String(o).length,u=(r?wc(e):e).split(Tc,o).slice(a,o).map((e,t)=>{let r=a+1+t,o=` ${` ${r}`.slice(-l)} |`,c=s[r],u=!s[r+1];if(c){let t=``;if(Array.isArray(c)){let r=e.slice(0,Math.max(c[0]-1,0)).replace(/[^\t]/g,` `),a=c[1]||1;t=[`
194
+ `,i.gutter(o.replace(/\d/g,` `)),` `,r,i.marker(`^`).repeat(a)].join(``),u&&n.message&&(t+=` `+i.message(n.message))}return[i.marker(`>`),i.gutter(o),e.length>0?` ${e}`:``,t].join(``)}else return` ${i.gutter(o)}${e.length>0?` ${e}`:``}`}).join(`
195
+ `);return n.message&&!c&&(u=`${` `.repeat(l+1)}${n.message}
196
+ ${u}`),r?i.reset(u):u}var Oc=({oneBased:e,oneBasedLine:t=e,oneBasedColumn:n=e}={})=>[+!!t,+!!n];function kc(e,t,n){let r=t===0?-1:e.lastIndexOf(`
197
+ `,t-1),[i,a]=Oc(n);return{line:r===-1?i:e.slice(0,r+1).match(/\n/g).length+i,column:t-r-1+a}}function Ac(e,t,n){if(typeof e!=`string`)throw TypeError(`Text parameter should be a string`);if(!Number.isInteger(t))throw TypeError(`Index parameter should be an integer`);if(t<0||t>e.length)throw RangeError(`Index out of bounds`);return kc(e,t,n)}var jc=e=>`\\u{${e.codePointAt(0).toString(16)}}`,Mc=class e extends Error{name=`JSONError`;fileName;#e;#t;#n;#r;#i;constructor(t){if(typeof t==`string`)super(),this.#n=t;else{let{jsonParseError:e,fileName:n,input:r}=t;super(void 0,{cause:e}),this.#e=r,this.#t=e,this.fileName=n}Error.captureStackTrace?.(this,e)}get message(){this.#n??=`${Pc(this.#t.message)}${this.#e===``?` while parsing empty string`:``}`;let{codeFrame:e}=this;return`${this.#n}${this.fileName?` in ${this.fileName}`:``}${e?`
198
+
199
+ ${e}
200
+ `:``}`}set message(e){this.#n=e}#a(e){if(!this.#t)return;let t=this.#e,n=Nc(t,this.#t.message);if(n)return Dc(t,{start:n},{highlightCode:e})}get codeFrame(){return this.#r??=this.#a(!0),this.#r}get rawCodeFrame(){return this.#i??=this.#a(!1),this.#i}},Nc=(e,t)=>{let n=t.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!n)return;let{index:r,line:i,column:a}=n.groups;return i&&a?{line:Number(i),column:Number(a)}:Ac(e,Number(r),{oneBased:!0})},Pc=e=>e.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,t,n)=>`"${n}"(${jc(n)})`);function Fc(e,t,n){typeof t==`string`&&(n=t,t=void 0);try{return JSON.parse(e,t)}catch(t){throw new Mc({jsonParseError:t,fileName:n,input:e})}}function Ic(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function Lc(e,t,n){let r=e.split(/\r\n|\n|\r/g),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
201
+ `,e===t&&(i+=` `.repeat(a+n+2),i+=`^
202
+ `))}return i}var $=class extends Error{line;column;codeblock;constructor(e,t){let[n,r]=Ic(t.toml,t.ptr),i=Lc(t.toml,n,r);super(`Invalid TOML document: ${e}
203
+
204
+ ${i}`,t),this.line=n,this.column=r,this.codeblock=i}};function Rc(e,t){let n=0;for(;e[t-++n]===`\\`;);return--n&&n%2}function zc(e,t=0,n=e.length){let r=e.indexOf(`
205
+ `,t);return e[r-1]===`\r`&&r--,r<=n?r:-1}function Bc(e,t){for(let n=t;n<e.length;n++){let r=e[n];if(r===`
206
+ `)return n;if(r===`\r`&&e[n+1]===`
207
+ `)return n+1;if(r<` `&&r!==` `||r===``)throw new $(`control characters are not allowed in comments`,{toml:e,ptr:t})}return e.length}function Vc(e,t,n,r){let i;for(;(i=e[t])===` `||i===` `||!n&&(i===`
208
+ `||i===`\r`&&e[t+1]===`
209
+ `);)t++;return r||i!==`#`?t:Vc(e,Bc(e,t),n)}function Hc(e,t,n,r,i=!1){if(!r)return t=zc(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let t=e[a];if(t===`#`)a=zc(e,a);else if(t===n)return a+1;else if(t===r||i&&(t===`
210
+ `||t===`\r`&&e[a+1]===`
211
+ `))return a}throw new $(`cannot find end of structure`,{toml:e,ptr:t})}function Uc(e,t){let n=e[t],r=n===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):n;t+=r.length-1;do t=e.indexOf(r,++t);while(t>-1&&n!==`'`&&Rc(e,t));return t>-1&&(t+=r.length,r.length>1&&(e[t]===n&&t++,e[t]===n&&t++)),t}var Wc=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i,Gc=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e){let t=!0,n=!0,r=`Z`;if(typeof e==`string`){let i=e.match(Wc);i?(i[1]||(t=!1,e=`0000-01-01T${e}`),n=!!i[2],n&&e[10]===` `&&(e=e.replace(` `,`T`)),i[2]&&+i[2]>23?e=``:(r=i[3]||null,e=e.toUpperCase(),!r&&n&&(e+=`Z`))):e=``}super(e),isNaN(this.getTime())||(this.#e=t,this.#t=n,this.#n=r)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}},Kc=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,qc=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Jc=/^[+-]?0[0-9_]/,Yc=/^[0-9a-f]{4,8}$/i,Xc={b:`\b`,t:` `,n:`
212
+ `,f:`\f`,r:`\r`,'"':`"`,"\\":`\\`};function Zc(e,t=0,n=e.length){let r=e[t]===`'`,i=e[t++]===e[t]&&e[t]===e[t+1];i&&(n-=2,e[t+=2]===`\r`&&t++,e[t]===`
213
+ `&&t++);let a=0,o,s=``,c=t;for(;t<n-1;){let n=e[t++];if(n===`
214
+ `||n===`\r`&&e[t]===`
215
+ `){if(!i)throw new $(`newlines are not allowed in strings`,{toml:e,ptr:t-1})}else if(n<` `&&n!==` `||n===``)throw new $(`control characters are not allowed in strings`,{toml:e,ptr:t-1});if(o){if(o=!1,n===`u`||n===`U`){let r=e.slice(t,t+=n===`u`?4:8);if(!Yc.test(r))throw new $(`invalid unicode escape`,{toml:e,ptr:a});try{s+=String.fromCodePoint(parseInt(r,16))}catch{throw new $(`invalid unicode escape`,{toml:e,ptr:a})}}else if(i&&(n===`
216
+ `||n===` `||n===` `||n===`\r`)){if(t=Vc(e,t-1,!0),e[t]!==`
217
+ `&&e[t]!==`\r`)throw new $(`invalid escape: only line-ending whitespace may be escaped`,{toml:e,ptr:a});t=Vc(e,t)}else if(n in Xc)s+=Xc[n];else throw new $(`unrecognized escape sequence`,{toml:e,ptr:a});c=t}else !r&&n===`\\`&&(a=t-1,o=!0,s+=e.slice(c,a))}return s+e.slice(c,n-1)}function Qc(e,t,n,r){if(e===`true`)return!0;if(e===`false`)return!1;if(e===`-inf`)return-1/0;if(e===`inf`||e===`+inf`)return 1/0;if(e===`nan`||e===`+nan`||e===`-nan`)return NaN;if(e===`-0`)return r?0n:0;let i=Kc.test(e);if(i||qc.test(e)){if(Jc.test(e))throw new $(`leading zeroes are not allowed`,{toml:t,ptr:n});e=e.replace(/_/g,``);let a=+e;if(isNaN(a))throw new $(`invalid number`,{toml:t,ptr:n});if(i){if((i=!Number.isSafeInteger(a))&&!r)throw new $(`integer value cannot be represented losslessly`,{toml:t,ptr:n});(i||r===!0)&&(a=BigInt(e))}return a}let a=new Gc(e);if(!a.isValid())throw new $(`invalid value`,{toml:t,ptr:n});return a}function $c(e,t,n,r){let i=e.slice(t,n),a=i.indexOf(`#`);a>-1&&(Bc(e,a),i=i.slice(0,a));let o=i.trimEnd();if(!r){let n=i.indexOf(`
218
+ `,o.length);if(n>-1)throw new $(`newlines are not allowed in inline tables`,{toml:e,ptr:t+n})}return[o,a]}function el(e,t,n,r,i){if(r===0)throw new $(`document contains excessively nested structures. aborting.`,{toml:e,ptr:t});let a=e[t];if(a===`[`||a===`{`){let[o,s]=a===`[`?il(e,t,r,i):rl(e,t,r,i),c=n?Hc(e,s,`,`,n):s;if(s-c&&n===`}`){let t=zc(e,s,c);if(t>-1)throw new $(`newlines are not allowed in inline tables`,{toml:e,ptr:t})}return[o,c]}let o;if(a===`"`||a===`'`){o=Uc(e,t);let r=Zc(e,t,o);if(n){if(o=Vc(e,o,n!==`]`),e[o]&&e[o]!==`,`&&e[o]!==n&&e[o]!==`
219
+ `&&e[o]!==`\r`)throw new $(`unexpected character encountered`,{toml:e,ptr:o});o+=+(e[o]===`,`)}return[r,o]}o=Hc(e,t,`,`,n);let s=$c(e,t,o-+(e[o-1]===`,`),n===`]`);if(!s[0])throw new $(`incomplete key-value declaration: no value specified`,{toml:e,ptr:t});return n&&s[1]>-1&&(o=Vc(e,t+s[1]),o+=+(e[o]===`,`)),[Qc(s[0],e,t,i),o]}var tl=/^[a-zA-Z0-9-_]+[ \t]*$/;function nl(e,t,n=`=`){let r=t-1,i=[],a=e.indexOf(n,t);if(a<0)throw new $(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});do{let o=e[t=++r];if(o!==` `&&o!==` `)if(o===`"`||o===`'`){if(o===e[t+1]&&o===e[t+2])throw new $(`multiline strings are not allowed in keys`,{toml:e,ptr:t});let s=Uc(e,t);if(s<0)throw new $(`unfinished string encountered`,{toml:e,ptr:t});r=e.indexOf(`.`,s);let c=e.slice(s,r<0||r>a?a:r),l=zc(c);if(l>-1)throw new $(`newlines are not allowed in keys`,{toml:e,ptr:t+r+l});if(c.trimStart())throw new $(`found extra tokens after the string part`,{toml:e,ptr:s});if(a<s&&(a=e.indexOf(n,s),a<0))throw new $(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});i.push(Zc(e,t,s))}else{r=e.indexOf(`.`,t);let n=e.slice(t,r<0||r>a?a:r);if(!tl.test(n))throw new $(`only letter, numbers, dashes and underscores are allowed in keys`,{toml:e,ptr:t});i.push(n.trimEnd())}}while(r+1&&r<a);return[i,Vc(e,a+1,!0,!0)]}function rl(e,t,n,r){let i={},a=new Set,o,s=0;for(t++;(o=e[t++])!==`}`&&o;){let c={toml:e,ptr:t-1};if(o===`
220
+ `)throw new $(`newlines are not allowed in inline tables`,c);if(o===`#`)throw new $(`inline tables cannot contain comments`,c);if(o===`,`)throw new $(`expected key-value, found comma`,c);if(o!==` `&&o!==` `){let o,c=i,l=!1,[u,d]=nl(e,t-1);for(let n=0;n<u.length;n++){if(n&&(c=l?c[o]:c[o]={}),o=u[n],(l=Object.hasOwn(c,o))&&(typeof c[o]!=`object`||a.has(c[o])))throw new $(`trying to redefine an already defined value`,{toml:e,ptr:t});!l&&o===`__proto__`&&Object.defineProperty(c,o,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new $(`trying to redefine an already defined value`,{toml:e,ptr:t});let[f,p]=el(e,d,`}`,n-1,r);a.add(f),c[o]=f,t=p,s=e[t-1]===`,`?t-1:0}}if(s)throw new $(`trailing commas are not allowed in inline tables`,{toml:e,ptr:s});if(!o)throw new $(`unfinished table encountered`,{toml:e,ptr:t});return[i,t]}function il(e,t,n,r){let i=[],a;for(t++;(a=e[t++])!==`]`&&a;)if(a===`,`)throw new $(`expected value, found comma`,{toml:e,ptr:t-1});else if(a===`#`)t=Bc(e,t);else if(a!==` `&&a!==` `&&a!==`
221
+ `&&a!==`\r`){let a=el(e,t-1,`]`,n-1,r);i.push(a[0]),t=a[1]}if(!a)throw new $(`unfinished array encountered`,{toml:e,ptr:t});return[i,t]}function al(e,t,n,r){let i=t,a=n,o,s=!1,c;for(let t=0;t<e.length;t++){if(t){if(i=s?i[o]:i[o]={},a=(c=a[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let e=i.length-1;i=i[e],a=a[e].c}}if(o=e[t],(s=Object.hasOwn(i,o))&&a[o]?.t===0&&a[o]?.d)return null;s||(o===`__proto__`&&(Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,o,{enumerable:!0,configurable:!0,writable:!0})),a[o]={t:t<e.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=a[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,i[o]=[]),i[o].push(i={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)i=s?i[o]:i[o]={};else if(r===0&&s)return null;return[o,i,c.c]}function ol(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let r={},i={},a=r,o=i;for(let s=Vc(e,0);s<e.length;){if(e[s]===`[`){let t=e[++s]===`[`,n=nl(e,s+=+t,`]`);if(t){if(e[n[1]-1]!==`]`)throw new $(`expected end of table declaration`,{toml:e,ptr:n[1]-1});n[1]++}let c=al(n[0],r,i,t?2:1);if(!c)throw new $(`trying to redefine an already defined table or value`,{toml:e,ptr:s});o=c[2],a=c[1],s=n[1]}else{let r=nl(e,s),i=al(r[0],a,o,0);if(!i)throw new $(`trying to redefine an already defined table or value`,{toml:e,ptr:s});let c=el(e,r[1],void 0,t,n);i[1][i[0]]=c[0],s=c[1]}if(s=Vc(e,s,!0),e[s]&&e[s]!==`
222
+ `&&e[s]!==`\r`)throw new $(`each key-value declaration must be followed by an end-of-line`,{toml:e,ptr:s});s=Vc(e,s)}return r}async function sl(e){$o(e)&&(e=new URL(e));try{return await y.readFile(e,`utf8`)}catch(t){if(t.code===`ENOENT`)return;throw Error(`Unable to read '${e}': ${t.message}`)}}var cl=sl;async function ll(e){let t=await cl(e);try{return Fc(t)}catch(t){throw t.message=`JSON Error in ${e}:
223
+ ${t.message}`,t}}async function ul(e){return(await import(m(e).href)).default}async function dl(e){try{return await ll(e)}catch(t){try{return await ul(e)}catch{}throw t}}var fl=process.versions.bun?async function(e){let{prettier:t}=await dl(e);return t}:async function(e){let{prettier:t}=await ll(e);return t};async function pl(e){let{prettier:t}=await hl(e);return t}var ml;async function hl(e){let t=await cl(e);ml||({__parsePrettierYamlConfig:ml}=await import(`./yaml-BNfwk1xa.mjs`));try{return ml(t)}catch(t){throw t.message=`YAML Error in ${e}:
224
+ ${t.message}`,t}}async function gl(e){let t=await cl(e);try{return ol(t)}catch(t){throw t.message=`TOML Error in ${e}:
225
+ ${t.message}`,t}}async function _l(e){let t=await cl(e);try{return rc.parse(t)}catch(t){throw t.message=`JSON5 Error in ${e}:
226
+ ${t.message}`,t}}var vl={".toml":gl,".json5":_l,".json":ll,".js":ul,".mjs":ul,".cjs":ul,".ts":ul,".mts":ul,".cts":ul,".yaml":hl,".yml":hl,"":hl},yl=[`package.json`,`package.yaml`,`.prettierrc`,`.prettierrc.json`,`.prettierrc.yml`,`.prettierrc.yaml`,`.prettierrc.json5`,`.prettierrc.js`,`prettier.config.js`,`.prettierrc.ts`,`prettier.config.ts`,`.prettierrc.mjs`,`prettier.config.mjs`,`.prettierrc.mts`,`prettier.config.mts`,`.prettierrc.cjs`,`prettier.config.cjs`,`.prettierrc.cts`,`prettier.config.cts`,`.prettierrc.toml`];async function bl({name:e,path:t}){if(e===`package.json`)try{return!!await fl(t)}catch{return!1}if(e===`package.yaml`)try{return!!await pl(t)}catch{return!1}return!0}function xl(e){return new hs(yl,{filter:bl,stopDirectory:e})}var Sl=xl,Cl={}.hasOwnProperty,wl=/^([A-Z][a-z\d]*)+$/,Tl=new Set([`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`]),El={};function Dl(e,t=`and`){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(`, `)}, ${t} ${e[e.length-1]}`}var Ol=new Map,kl=`__node_internal_`,Al;El.ERR_INVALID_ARG_TYPE=jl(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{x.ok(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let r=`The `;if(e.endsWith(` argument`))r+=`${e} `;else{let t=e.includes(`.`)?`property`:`argument`;r+=`"${e}" ${t} `}r+=`must be `;let i=[],a=[],o=[];for(let e of t)x.ok(typeof e==`string`,`All expected entries have to be of type string`),Tl.has(e)?i.push(e.toLowerCase()):wl.exec(e)===null?(x.ok(e!==`object`,`The value "object" should be written as "Object"`),o.push(e)):a.push(e);if(a.length>0){let e=i.indexOf(`object`);e!==-1&&(i.slice(e,1),a.push(`Object`))}return i.length>0&&(r+=`${i.length>1?`one of type`:`of type`} ${Dl(i,`or`)}`,(a.length>0||o.length>0)&&(r+=` or `)),a.length>0&&(r+=`an instance of ${Dl(a,`or`)}`,o.length>0&&(r+=` or `)),o.length>0&&(o.length>1?r+=`one of ${Dl(o,`or`)}`:(o[0].toLowerCase()!==o[0]&&(r+=`an `),r+=`${o[0]}`)),r+=`. Received ${Ll(n)}`,r},TypeError),El.ERR_INVALID_MODULE_SPECIFIER=jl(`ERR_INVALID_MODULE_SPECIFIER`,(e,t,n=void 0)=>`Invalid module "${e}" ${t}${n?` imported from ${n}`:``}`,TypeError),El.ERR_INVALID_PACKAGE_CONFIG=jl(`ERR_INVALID_PACKAGE_CONFIG`,(e,t,n)=>`Invalid package config ${e}${t?` while importing ${t}`:``}${n?`. ${n}`:``}`,Error),El.ERR_INVALID_PACKAGE_TARGET=jl(`ERR_INVALID_PACKAGE_TARGET`,(e,t,n,r=!1,i=void 0)=>{let a=typeof n==`string`&&!r&&n.length>0&&!n.startsWith(`./`);return t===`.`?(x.ok(r===!1),`Invalid "exports" main target ${JSON.stringify(n)} defined in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`):`Invalid "${r?`imports`:`exports`}" target ${JSON.stringify(n)} defined for '${t}' in the package config ${e}package.json${i?` imported from ${i}`:``}${a?`; targets must start with "./"`:``}`},Error),El.ERR_MODULE_NOT_FOUND=jl(`ERR_MODULE_NOT_FOUND`,(e,t,n=!1)=>`Cannot find ${n?`module`:`package`} '${e}' imported from ${t}`,Error),El.ERR_NETWORK_IMPORT_DISALLOWED=jl(`ERR_NETWORK_IMPORT_DISALLOWED`,`import of '%s' by %s is not supported: %s`,Error),El.ERR_PACKAGE_IMPORT_NOT_DEFINED=jl(`ERR_PACKAGE_IMPORT_NOT_DEFINED`,(e,t,n)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:``} imported from ${n}`,TypeError),El.ERR_PACKAGE_PATH_NOT_EXPORTED=jl(`ERR_PACKAGE_PATH_NOT_EXPORTED`,(e,t,n=void 0)=>t===`.`?`No "exports" main defined in ${e}package.json${n?` imported from ${n}`:``}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${n?` imported from ${n}`:``}`,Error),El.ERR_UNSUPPORTED_DIR_IMPORT=jl(`ERR_UNSUPPORTED_DIR_IMPORT`,`Directory import '%s' is not supported resolving ES modules imported from %s`,Error),El.ERR_UNSUPPORTED_RESOLVE_REQUEST=jl(`ERR_UNSUPPORTED_RESOLVE_REQUEST`,`Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.`,TypeError),El.ERR_UNKNOWN_FILE_EXTENSION=jl(`ERR_UNKNOWN_FILE_EXTENSION`,(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError),El.ERR_INVALID_ARG_VALUE=jl(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let r=k(t);return r.length>128&&(r=`${r.slice(0,128)}...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${r}`},TypeError);function jl(e,t,n){return Ol.set(e,t),Ml(n,e)}function Ml(e,t){return n;function n(...n){let r=Error.stackTraceLimit;Nl()&&(Error.stackTraceLimit=0);let i=new e;Nl()&&(Error.stackTraceLimit=r);let a=Il(t,n,i);return Object.defineProperties(i,{message:{value:a,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),Fl(i),i.code=t,i}}function Nl(){try{if(D.startupSnapshot.isBuildingSnapshot())return!1}catch{}let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Cl.call(e,`writable`)&&e.writable!==void 0?e.writable:e.set!==void 0}function Pl(e){let t=kl+e.name;return Object.defineProperty(e,`name`,{value:t}),e}var Fl=Pl(function(e){let t=Nl();return t&&(Al=Error.stackTraceLimit,Error.stackTraceLimit=1/0),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=Al),e});function Il(e,t,n){let r=Ol.get(e);if(x.ok(r!==void 0,"expected `message` to be found"),typeof r==`function`)return x.ok(r.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${r.length}).`),Reflect.apply(r,n,t);let i=/%[dfijoOs]/g,a=0;for(;i.exec(r)!==null;)a++;return x.ok(a===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${a}).`),t.length===0?r:(t.unshift(r),Reflect.apply(O,null,t))}function Ll(e){if(e==null)return String(e);if(typeof e==`function`&&e.name)return`function ${e.name}`;if(typeof e==`object`)return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${k(e,{depth:-1})}`;let t=k(e,{colors:!1});return t.length>28&&(t=`${t.slice(0,25)}...`),`type ${typeof e} (${t})`}var Rl={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:zl}=El,Bl=new Map;function Vl(e,{base:t,specifier:n}){let r=Bl.get(e);if(r)return r;let i;try{i=w.readFileSync(g.toNamespacedPath(e),`utf8`)}catch(e){let t=e;if(t.code!==`ENOENT`)throw t}let a={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:`none`,exports:void 0,imports:void 0};if(i!==void 0){let r;try{r=JSON.parse(i)}catch(r){let i=r,a=new zl(e,(t?`"${n}" from `:``)+p(t||n),i.message);throw a.cause=i,a}a.exists=!0,Rl.call(r,`name`)&&typeof r.name==`string`&&(a.name=r.name),Rl.call(r,`main`)&&typeof r.main==`string`&&(a.main=r.main),Rl.call(r,`exports`)&&(a.exports=r.exports),Rl.call(r,`imports`)&&(a.imports=r.imports),Rl.call(r,`type`)&&(r.type===`commonjs`||r.type===`module`)&&(a.type=r.type)}return Bl.set(e,a),a}function Hl(e){let t=new URL(`package.json`,e);for(;!t.pathname.endsWith(`node_modules/package.json`);){let n=Vl(p(t),{specifier:e});if(n.exists)return n;let r=t;if(t=new URL(`../package.json`,t),t.pathname===r.pathname)break}return{pjsonPath:p(t),exists:!1,type:`none`}}function Ul(e){return Hl(e).type}var{ERR_UNKNOWN_FILE_EXTENSION:Wl}=El,Gl={}.hasOwnProperty,Kl={__proto__:null,".cjs":`commonjs`,".js":`module`,".json":`json`,".mjs":`module`};function ql(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?`module`:e===`application/json`?`json`:null}var Jl={__proto__:null,"data:":Yl,"file:":Zl,"http:":Ql,"https:":Ql,"node:"(){return`builtin`}};function Yl(e){let{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return ql(t)}function Xl(e){let t=e.pathname,n=t.length;for(;n--;){let e=t.codePointAt(n);if(e===47)return``;if(e===46)return t.codePointAt(n-1)===47?``:t.slice(n)}return``}function Zl(e,t,n){let r=Xl(e);if(r===`.js`){let t=Ul(e);return t===`none`?`commonjs`:t}if(r===``){let t=Ul(e);return t===`none`||t===`commonjs`?`commonjs`:`module`}let i=Kl[r];if(i)return i;if(!n)throw new Wl(r,p(e))}function Ql(){}function $l(e,t){let n=e.protocol;return Gl.call(Jl,n)&&Jl[n](e,t,!0)||null}var{ERR_INVALID_ARG_VALUE:eu}=El,tu=Object.freeze([`node`,`import`]),nu=new Set(tu);function ru(){return tu}function iu(){return nu}function au(e){if(e!==void 0&&e!==ru()){if(!Array.isArray(e))throw new eu(`conditions`,e,`expected an array`);return new Set(e)}return iu()}var ou=RegExp.prototype[Symbol.replace],{ERR_NETWORK_IMPORT_DISALLOWED:su,ERR_INVALID_MODULE_SPECIFIER:cu,ERR_INVALID_PACKAGE_CONFIG:lu,ERR_INVALID_PACKAGE_TARGET:uu,ERR_MODULE_NOT_FOUND:du,ERR_PACKAGE_IMPORT_NOT_DEFINED:fu,ERR_PACKAGE_PATH_NOT_EXPORTED:pu,ERR_UNSUPPORTED_DIR_IMPORT:mu,ERR_UNSUPPORTED_RESOLVE_REQUEST:hu}=El,gu={}.hasOwnProperty,_u=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,vu=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,yu=/^\.|%|\\/,bu=/\*/g,xu=/%2f|%5c/i,Su=new Set,Cu=/[/\\]{2}/;function wu(e,t,n,r,i,a,o){if(b.noDeprecation)return;let s=p(r),c=Cu.exec(o?e:t)!==null;b.emitWarning(`Use of deprecated ${c?`double slash`:`leading or trailing slash matching`} resolving "${e}" for module request "${t}" ${t===n?``:`matched to "${n}" `}in the "${i?`imports`:`exports`}" field module resolution of the package at ${s}${a?` imported from ${p(a)}`:``}.`,`DeprecationWarning`,`DEP0166`)}function Tu(e,t,n,r){if(b.noDeprecation||$l(e,{parentURL:n.href})!==`module`)return;let i=p(e.href),a=p(new URL(`.`,t)),o=p(n);r?g.resolve(a,r)!==i&&b.emitWarning(`Package ${a} has a "main" field set to "${r}", excluding the full filename and extension to the resolved file at "${i.slice(a.length)}", imported from ${o}.
227
+ Automatic extension resolution of the "main" field is deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`):b.emitWarning(`No "main" or "exports" field defined in the package.json for ${a} resolving the main entry point "${i.slice(a.length)}", imported from ${o}.
228
+ Default "index" lookups for the main are deprecated for ES modules.`,`DeprecationWarning`,`DEP0151`)}function Eu(e){try{return E(e)}catch{}}function Du(e){let t=E(e,{throwIfNoEntry:!1});return(t?t.isFile():void 0)??!1}function Ou(e,t,n){let r;if(t.main!==void 0){if(r=new URL(t.main,e),Du(r))return r;let i=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],a=-1;for(;++a<i.length&&(r=new URL(i[a],e),!Du(r));)r=void 0;if(r)return Tu(r,e,n,t.main),r}let i=[`./index.js`,`./index.json`,`./index.node`],a=-1;for(;++a<i.length&&(r=new URL(i[a],e),!Du(r));)r=void 0;if(r)return Tu(r,e,n,t.main),r;throw new du(p(new URL(`.`,e)),p(n))}function ku(e,t,n){if(xu.exec(e.pathname)!==null)throw new cu(e.pathname,`must not include encoded "/" or "\\" characters`,p(t));let r;try{r=p(e)}catch(n){let r=n;throw Object.defineProperty(r,`input`,{value:String(e)}),Object.defineProperty(r,`module`,{value:String(t)}),r}let i=Eu(r.endsWith(`/`)?r.slice(-1):r);if(i&&i.isDirectory()){let n=new mu(r,p(t));throw n.url=String(e),n}if(!i||!i.isFile()){let n=new du(r||e.pathname,t&&p(t),!0);throw n.url=String(e),n}if(!n){let t=T(r),{search:n,hash:i}=e;e=m(t+(r.endsWith(g.sep)?`/`:``)),e.search=n,e.hash=i}return e}function Au(e,t,n){return new fu(e,t&&p(new URL(`.`,t)),p(n))}function ju(e,t,n){return new pu(p(new URL(`.`,t)),e,n&&p(n))}function Mu(e,t,n,r,i){throw new cu(e,`request is not a valid match in pattern "${t}" for the "${r?`imports`:`exports`}" resolution of ${p(n)}`,i&&p(i))}function Nu(e,t,n,r,i){return t=typeof t==`object`&&t?JSON.stringify(t,null,``):`${t}`,new uu(p(new URL(`.`,n)),e,t,r,i&&p(i))}function Pu(e,t,n,r,i,a,o,s,c){if(t!==``&&!a&&e[e.length-1]!==`/`)throw Nu(n,e,r,o,i);if(!e.startsWith(`./`)){if(o&&!e.startsWith(`../`)&&!e.startsWith(`/`)){let n=!1;try{new URL(e),n=!0}catch{}if(!n)return Uu(a?ou.call(bu,e,()=>t):e+t,r,c)}throw Nu(n,e,r,o,i)}if(_u.exec(e.slice(2))!==null)if(vu.exec(e.slice(2))===null){if(!s){let s=a?n.replace(`*`,()=>t):n+t;wu(a?ou.call(bu,e,()=>t):e,s,n,r,o,i,!0)}}else throw Nu(n,e,r,o,i);let l=new URL(e,r),u=l.pathname,d=new URL(`.`,r).pathname;if(!u.startsWith(d))throw Nu(n,e,r,o,i);if(t===``)return l;if(_u.exec(t)!==null){let c=a?n.replace(`*`,()=>t):n+t;vu.exec(t)===null?s||wu(a?ou.call(bu,e,()=>t):e,c,n,r,o,i,!1):Mu(c,n,r,o,i)}return a?new URL(ou.call(bu,l.href,()=>t)):new URL(t,l)}function Fu(e){let t=Number(e);return`${t}`===e?t>=0&&t<4294967295:!1}function Iu(e,t,n,r,i,a,o,s,c){if(typeof t==`string`)return Pu(t,n,r,e,i,a,o,s,c);if(Array.isArray(t)){let l=t;if(l.length===0)return null;let u,d=-1;for(;++d<l.length;){let t=l[d],f;try{f=Iu(e,t,n,r,i,a,o,s,c)}catch(e){let t=e;if(u=t,t.code===`ERR_INVALID_PACKAGE_TARGET`)continue;throw e}if(f!==void 0){if(f===null){u=null;continue}return f}}if(u==null)return null;throw u}if(typeof t==`object`&&t){let l=Object.getOwnPropertyNames(t),u=-1;for(;++u<l.length;){let t=l[u];if(Fu(t))throw new lu(p(e),i,`"exports" cannot contain numeric property keys.`)}for(u=-1;++u<l.length;){let d=l[u];if(d===`default`||c&&c.has(d)){let l=t[d],u=Iu(e,l,n,r,i,a,o,s,c);if(u===void 0)continue;return u}}return null}if(t===null)return null;throw Nu(r,t,e,o,i)}function Lu(e,t,n){if(typeof e==`string`||Array.isArray(e))return!0;if(typeof e!=`object`||!e)return!1;let r=Object.getOwnPropertyNames(e),i=!1,a=0,o=-1;for(;++o<r.length;){let e=r[o],s=e===``||e[0]!==`.`;if(a++===0)i=s;else if(i!==s)throw new lu(p(t),n,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return i}function Ru(e,t,n){if(b.noDeprecation)return;let r=p(t);Su.has(r+`|`+e)||(Su.add(r+`|`+e),b.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${r}${n?` imported from ${p(n)}`:``}. Mapping specifiers ending in "/" is no longer supported.`,`DeprecationWarning`,`DEP0155`))}function zu(e,t,n,r,i){let a=n.exports;if(Lu(a,e,r)&&(a={".":a}),gu.call(a,t)&&!t.includes(`*`)&&!t.endsWith(`/`)){let n=a[t],o=Iu(e,n,``,t,r,!1,!1,!1,i);if(o==null)throw ju(t,e,r);return o}let o=``,s=``,c=Object.getOwnPropertyNames(a),l=-1;for(;++l<c.length;){let n=c[l],i=n.indexOf(`*`);if(i!==-1&&t.startsWith(n.slice(0,i))){t.endsWith(`/`)&&Ru(t,e,r);let a=n.slice(i+1);t.length>=n.length&&t.endsWith(a)&&Bu(o,n)===1&&n.lastIndexOf(`*`)===i&&(o=n,s=t.slice(i,t.length-a.length))}}if(o){let n=a[o],c=Iu(e,n,s,o,r,!0,!1,t.endsWith(`/`),i);if(c==null)throw ju(t,e,r);return c}throw ju(t,e,r)}function Bu(e,t){let n=e.indexOf(`*`),r=t.indexOf(`*`),i=n===-1?e.length:n+1,a=r===-1?t.length:r+1;return i>a?-1:a>i||n===-1?1:r===-1||e.length>t.length?-1:+(t.length>e.length)}function Vu(e,t,n){if(e===`#`||e.startsWith(`#/`)||e.endsWith(`/`))throw new cu(e,`is not a valid internal imports specifier name`,p(t));let r,i=Hl(t);if(i.exists){r=m(i.pjsonPath);let a=i.imports;if(a)if(gu.call(a,e)&&!e.includes(`*`)){let i=Iu(r,a[e],``,e,t,!1,!0,!1,n);if(i!=null)return i}else{let i=``,o=``,s=Object.getOwnPropertyNames(a),c=-1;for(;++c<s.length;){let t=s[c],n=t.indexOf(`*`);if(n!==-1&&e.startsWith(t.slice(0,-1))){let r=t.slice(n+1);e.length>=t.length&&e.endsWith(r)&&Bu(i,t)===1&&t.lastIndexOf(`*`)===n&&(i=t,o=e.slice(n,e.length-r.length))}}if(i){let e=a[i],s=Iu(r,e,o,i,t,!0,!0,!1,n);if(s!=null)return s}}}throw Au(e,r,t)}function Hu(e,t){let n=e.indexOf(`/`),r=!0,i=!1;e[0]===`@`&&(i=!0,n===-1||e.length===0?r=!1:n=e.indexOf(`/`,n+1));let a=n===-1?e:e.slice(0,n);if(yu.exec(a)!==null&&(r=!1),!r)throw new cu(e,`is not a valid package name`,p(t));return{packageName:a,packageSubpath:`.`+(n===-1?``:e.slice(n)),isScoped:i}}function Uu(e,t,n){if(l.includes(e))return new URL(`node:`+e);let{packageName:r,packageSubpath:i,isScoped:a}=Hu(e,t),o=Hl(t);if(o.exists){let e=m(o.pjsonPath);if(o.name===r&&o.exports!==void 0&&o.exports!==null)return zu(e,i,o,t,n)}let s=new URL(`./node_modules/`+r+`/package.json`,t),c=p(s),u;do{let o=Eu(c.slice(0,-13));if(!o||!o.isDirectory()){u=c,s=new URL((a?`../../../../node_modules/`:`../../../node_modules/`)+r+`/package.json`,s),c=p(s);continue}let l=Vl(c,{base:t,specifier:e});return l.exports!==void 0&&l.exports!==null?zu(s,i,l,t,n):i===`.`?Ou(s,l,t):new URL(i,s)}while(c.length!==u.length);throw new du(r,p(t),!1)}function Wu(e){return e[0]===`.`&&(e.length===1||e[1]===`/`||e[1]===`.`&&(e.length===2||e[2]===`/`))}function Gu(e){return e===``?!1:e[0]===`/`?!0:Wu(e)}function Ku(e,t,n,r){n===void 0&&(n=au());let i=t.protocol,a=i===`data:`||i===`http:`||i===`https:`,o;if(Gu(e))try{o=new URL(e,t)}catch(n){let r=new hu(e,t);throw r.cause=n,r}else if(i===`file:`&&e[0]===`#`)o=Vu(e,t,n);else try{o=new URL(e)}catch(r){if(a&&!l.includes(e)){let n=new hu(e,t);throw n.cause=r,n}o=Uu(e,t,n)}return x.ok(o!==void 0,`expected to be defined`),o.protocol===`file:`?ku(o,t,r):o}function qu(e,t,n){if(n){let r=n.protocol;if(r===`http:`||r===`https:`){if(Gu(e)){let r=t?.protocol;if(r&&r!==`https:`&&r!==`http:`)throw new su(e,n,`remote imports cannot import from a local location.`);return{url:t?.href||``}}throw l.includes(e)?new su(e,n,`remote imports cannot import from a local location.`):new su(e,n,`only relative and absolute specifiers are supported.`)}}}function Ju(e){return!!(e&&typeof e==`object`&&`href`in e&&typeof e.href==`string`&&`protocol`in e&&typeof e.protocol==`string`&&e.href&&e.protocol)}function Yu(e){if(e!==void 0&&typeof e!=`string`&&!Ju(e))throw new El.ERR_INVALID_ARG_TYPE(`parentURL`,[`string`,`URL`],e)}function Xu(e,t={}){let{parentURL:n}=t;x.ok(n!==void 0,"expected `parentURL` to be defined"),Yu(n);let r;if(n)try{r=new URL(n)}catch{}let i,a;try{if(i=Gu(e)?new URL(e,r):new URL(e),a=i.protocol,a===`data:`)return{url:i.href,format:null}}catch{}let o=qu(e,i,r);if(o)return o;if(a===void 0&&i&&(a=i.protocol),a===`node:`||i&&i.protocol===`node:`)return{url:e};let s=au(t.conditions),c=Ku(e,new URL(n),s,!1);return{url:c.href,format:$l(c,{parentURL:n})}}function Zu(e,t){if(!t)throw Error("Please pass `parent`: `import-meta-resolve` cannot ponyfill that");try{return Xu(e,{parentURL:t}).url}catch(e){let t=e;if((t.code===`ERR_UNSUPPORTED_DIR_IMPORT`||t.code===`ERR_MODULE_NOT_FOUND`)&&typeof t.url==`string`)return t.url;throw e}}function Qu(e,t){return import(Zu(e,m(t).href))}var $u=Qu;function ed(e,t){return u(t)(e)}var td=ed,nd=new Set([`MODULE_NOT_FOUND`,`ERR_REQUIRE_ESM`,`ERR_PACKAGE_PATH_NOT_EXPORTED`,`ERR_REQUIRE_ASYNC_MODULE`]);async function rd(e,t){try{let n=td(e,t);return process.features.require_module&&n.__esModule?n.default:n}catch(e){if(!nd.has(e?.code))throw e}return(await $u(e,t)).default}var id=rd;async function ad(e){let{base:t,ext:n}=g.parse(e),r=t===`package.json`?fl:t===`package.yaml`?pl:vl[n];if(!r)throw Error(`No loader specified for extension "${n||`noExt`}"`);let i=await r(e);if(i){if(typeof i==`string`&&(i=await id(i,e)),typeof i!=`object`)throw TypeError(`Config is only allowed to be an object, but received ${typeof i} in "${e}"`);return delete i.$schema,i}}var od=ad,sd=new Map,cd=new Map;function ld(){sd.clear(),cd.clear()}function ud(e,{shouldCache:t}){return e=g.resolve(e),(!t||!sd.has(e))&&sd.set(e,od(e)),sd.get(e)}function dd(e){if(e=e?g.resolve(e):void 0,!cd.has(e)){let t=Sl(e),n=t.search.bind(t);cd.set(e,n)}return cd.get(e)}function fd(e,t={}){return e=e?g.resolve(e):process.cwd(),dd(Yo.getPrettierConfigSearchStopDirectory())(e,{cache:t.shouldCache})}function pd(){ld(),Ts()}function md(e,t){if(!e||!t.editorconfig)return;let n=t.useCache;return Ds(e,{shouldCache:n})}async function hd(e,t){let n=t.useCache,r=t.config;if(r||=await fd(e?g.dirname(g.resolve(e)):void 0,{shouldCache:n}),r)return r=ts(r),{config:await ud(r,{shouldCache:n}),configFile:r}}async function gd(e,t){t={useCache:!0,...t};let n=ts(e),[r,i]=await Promise.all([hd(n,t),md(n,t)]);if(!r&&!i)return null;let a={...i,...vd(r,n)};return Array.isArray(a.plugins)&&(a.plugins=a.plugins.map(e=>typeof e==`string`&&e.startsWith(`.`)?g.resolve(g.dirname(r.configFile),e):e)),a}async function _d(e){return await fd(e?g.dirname(g.resolve(ts(e))):void 0,{shouldCache:!1})??null}function vd(e,t){let{config:n,configFile:r}=e||{},{overrides:i,...a}=n||{};if(t&&i){let e=g.relative(g.dirname(r),t);for(let t of i)yd(e,t.files,t.excludeFiles)&&Object.assign(a,t.options)}return a}function yd(e,t,n){let[r,i]=is(Array.isArray(t)?t:[t],e=>e.includes(`/`));return Xo.default.isMatch(e,i,{ignore:n,basename:!0,dot:!0})||Xo.default.isMatch(e,r,{ignore:n,basename:!1,dot:!0})}var bd=1,xd=(e,t)=>(n,r,...i)=>{if(!(n|bd&&r==null))return(t.call(r)??r[e]).apply(r,i)},Sd=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},Cd=xd(`replaceAll`,function(){if(typeof this==`string`)return Sd}),wd=`cr`,Td=`crlf`,Ed=`lf`,Dd=`\r`,Od=`\r
229
+ `,kd=`
230
+ `,Ad=kd;function jd(e){let t=e.indexOf(Dd);return t===-1?Ed:e.charAt(t+1)===kd?Td:wd}function Md(e){return e===wd?Dd:e===Td?Od:Ad}var Nd=new Map([[kd,/\n/gu],[Dd,/\r/gu],[Od,/\r\n/gu]]);function Pd(e,t){let n=Nd.get(t);return e.match(n)?.length??0}var Fd=/\r\n?/gu;function Id(e){return Cd(0,e,Fd,kd)}function Ld(e){return this[e<0?this.length+e:e]}var Rd=xd(`at`,function(){if(Array.isArray(this)||typeof this==`string`)return Ld}),zd=()=>{},Bd=`cursor`,Vd=`indent`,Hd=`align`,Ud=`trim`,Wd=`group`,Gd=`fill`,Kd=`if-break`,qd=`indent-if-break`,Jd=`line-suffix`,Yd=`line-suffix-boundary`,Xd=`line`,Zd=`label`,Qd=`break-parent`;function $d(e,t){return e.type===Zd?{...e,contents:t(e.contents)}:t(e)}function ef(e){if(!e)return``;if(Array.isArray(e)){let t=[];for(let n of e)if(Array.isArray(n))t.push(...ef(n));else{let e=ef(n);e!==``&&t.push(e)}return t}return e.type===Kd?{...e,breakContents:ef(e.breakContents),flatContents:ef(e.flatContents)}:e.type===Wd?{...e,contents:ef(e.contents),expandedStates:e.expandedStates?.map(ef)}:e.type===Gd?{type:`fill`,parts:e.parts.map(ef)}:e.contents?{...e,contents:ef(e.contents)}:e}function tf(e){let t=Object.create(null),n=new Set;return r(ef(e));function r(e,t,n){if(typeof e==`string`)return JSON.stringify(e);if(Array.isArray(e)){let t=e.map(r).filter(Boolean);return t.length===1?t[0]:`[${t.join(`, `)}]`}if(e.type===Xd){let r=n?.[t+1]?.type===Qd;return e.literal?r?`literalline`:`literallineWithoutBreakParent`:e.hard?r?`hardline`:`hardlineWithoutBreakParent`:e.soft?`softline`:`line`}if(e.type===Qd)return n?.[t-1]?.type===Xd&&n[t-1].hard?void 0:`breakParent`;if(e.type===Ud)return`trim`;if(e.type===Vd)return`indent(`+r(e.contents)+`)`;if(e.type===Hd)return e.n===-1/0?`dedentToRoot(`+r(e.contents)+`)`:e.n<0?`dedent(`+r(e.contents)+`)`:e.n.type===`root`?`markAsRoot(`+r(e.contents)+`)`:`align(`+JSON.stringify(e.n)+`, `+r(e.contents)+`)`;if(e.type===Kd)return`ifBreak(`+r(e.breakContents)+(e.flatContents?`, `+r(e.flatContents):``)+(e.groupId?(e.flatContents?``:`, ""`)+`, { groupId: ${i(e.groupId)} }`:``)+`)`;if(e.type===qd){let t=[];e.negate&&t.push(`negate: true`),e.groupId&&t.push(`groupId: ${i(e.groupId)}`);let n=t.length>0?`, { ${t.join(`, `)} }`:``;return`indentIfBreak(${r(e.contents)}${n})`}if(e.type===Wd){let t=[];e.break&&e.break!==`propagated`&&t.push(`shouldBreak: true`),e.id&&t.push(`id: ${i(e.id)}`);let n=t.length>0?`, { ${t.join(`, `)} }`:``;return e.expandedStates?`conditionalGroup([${e.expandedStates.map(e=>r(e)).join(`,`)}]${n})`:`group(${r(e.contents)}${n})`}if(e.type===Gd)return`fill([${e.parts.map(e=>r(e)).join(`, `)}])`;if(e.type===Jd)return`lineSuffix(`+r(e.contents)+`)`;if(e.type===Yd)return`lineSuffixBoundary`;if(e.type===Zd)return`label(${JSON.stringify(e.label)}, ${r(e.contents)})`;if(e.type===Bd)return`cursor`;throw Error(`Unknown doc type `+e.type)}function i(e){if(typeof e!=`symbol`)return JSON.stringify(String(e));if(e in t)return t[e];let r=e.description||`symbol`;for(let i=0;;i++){let a=r+(i>0?` #${i}`:``);if(!n.has(a))return n.add(a),t[e]=`Symbol.for(${JSON.stringify(a)})`}}}var nf=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function rf(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function af(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var of=`©®‼⁉™ℹ↔↕↖↗↘↙↩↪⌨⏏⏱⏲⏸⏹⏺▪▫▶◀◻◼☀☁☂☃☄☎☑☘☝☠☢☣☦☪☮☯☸☹☺♀♂♟♠♣♥♦♨♻♾⚒⚔⚕⚖⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛓⛩⛱⛷⛸⛹✂✈✉✌✍✏✒✔✖✝✡✳✴❄❇❣❤➡⤴⤵⬅⬆⬇`,sf=/[^\x20-\x7F]/u,cf=new Set(of);function lf(e){if(!e)return 0;if(!sf.test(e))return e.length;e=e.replace(nf(),e=>cf.has(e)?` `:` `);let t=0;for(let n of e){let e=n.codePointAt(0);e<=31||e>=127&&e<=159||e>=768&&e<=879||e>=65024&&e<=65039||(t+=rf(e)||af(e)?2:1)}return t}var uf=lf;function df(e,t,n=0){let r=0;for(let i=n;i<e.length;++i)e[i]===` `?r=r+t-r%t:r++;return r}var ff=df,pf=class{constructor(e){this.stack=[e]}get key(){let{stack:e,siblings:t}=this;return Rd(0,e,t===null?-2:-4)??null}get index(){return this.siblings===null?null:Rd(0,this.stack,-2)}get node(){return Rd(0,this.stack,-1)}get parent(){return this.getNode(1)}get grandparent(){return this.getNode(2)}get isInArray(){return this.siblings!==null}get siblings(){let{stack:e}=this,t=Rd(0,e,-3);return Array.isArray(t)?t:null}get next(){let{siblings:e}=this;return e===null?null:e[this.index+1]}get previous(){let{siblings:e}=this;return e===null?null:e[this.index-1]}get isFirst(){return this.index===0}get isLast(){let{siblings:e,index:t}=this;return e!==null&&t===e.length-1}get isRoot(){return this.stack.length===1}get root(){return this.stack[0]}get ancestors(){return[...this.#t()]}getName(){let{stack:e}=this,{length:t}=e;return t>1?Rd(0,e,-2):null}getValue(){return Rd(0,this.stack,-1)}getNode(e=0){let t=this.#e(e);return t===-1?null:this.stack[t]}getParentNode(e=0){return this.getNode(e+1)}#e(e){let{stack:t}=this;for(let n=t.length-1;n>=0;n-=2)if(!Array.isArray(t[n])&&--e<0)return n;return-1}call(e,...t){let{stack:n}=this,{length:r}=n,i=Rd(0,n,-1);for(let e of t)i=i?.[e],n.push(e,i);try{return e(this)}finally{n.length=r}}callParent(e,t=0){let n=this.#e(t+1),r=this.stack.splice(n+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...t){let{stack:n}=this,{length:r}=n,i=Rd(0,n,-1);for(let e of t)i=i[e],n.push(e,i);try{for(let t=0;t<i.length;++t)n.push(t,i[t]),e(this,t,i),n.length-=2}finally{n.length=r}}map(e,...t){let n=[];return this.each((t,r,i)=>{n[r]=e(t,r,i)},...t),n}match(...e){let t=this.stack.length-1,n=null,r=this.stack[t--];for(let i of e){if(r===void 0)return!1;let e=null;if(typeof n==`number`&&(e=n,n=this.stack[t--],r=this.stack[t--]),i&&!i(r,n,e))return!1;n=this.stack[t--],r=this.stack[t--]}return!0}findAncestor(e){for(let t of this.#t())if(e(t))return t}hasAncestor(e){for(let t of this.#t())if(e(t))return!0;return!1}*#t(){let{stack:e}=this;for(let t=e.length-3;t>=0;t-=2){let n=e[t];Array.isArray(n)||(yield n)}}};function mf(e){return typeof e==`object`&&!!e}var hf=mf;function gf(e){return(t,n,r)=>{let i=!!r?.backwards;if(n===!1)return!1;let{length:a}=t,o=n;for(;o>=0&&o<a;){let n=t.charAt(o);if(e instanceof RegExp){if(!e.test(n))return o}else if(!e.includes(n))return o;i?o--:o++}return o===-1||o===a?o:!1}}var _f=gf(/\s/u),vf=gf(` `),yf=gf(`,; `),bf=gf(/[^\n\r]/u),xf=e=>e===`
231
+ `||e===`\r`||e===`\u2028`||e===`\u2029`;function Sf(e,t,n){let r=!!n?.backwards;if(t===!1)return!1;let i=e.charAt(t);if(r){if(e.charAt(t-1)===`\r`&&i===`
232
+ `)return t-2;if(xf(i))return t-1}else{if(i===`\r`&&e.charAt(t+1)===`
233
+ `)return t+2;if(xf(i))return t+1}return t}var Cf=Sf;function wf(e,t,n={}){let r=vf(e,n.backwards?t-1:t,n);return r!==Cf(e,r,n)}var Tf=wf;function Ef(e){return Array.isArray(e)&&e.length>0}var Df=Ef;function*Of(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,i=e=>hf(e)&&r(e);for(let t of n(e)){let n=e[t];if(Array.isArray(n))for(let e of n)i(e)&&(yield e);else i(n)&&(yield n)}}function*kf(e,t){let n=[e];for(let e=0;e<n.length;e++){let r=n[e];for(let e of Of(r,t))yield e,n.push(e)}}function Af(e,t){return Of(e,t).next().done}function jf(e,t,n){let{cache:r}=n;if(r.has(e))return r.get(e);let{filter:i}=n;if(!i)return[];let a,o=(n.getChildren?.(e,n)??[...Of(e,{getVisitorKeys:n.getVisitorKeys})]).flatMap(r=>(a??=[e,...t],i(r,a)?[r]:jf(r,a,n))),{locStart:s,locEnd:c}=n;return o.sort((e,t)=>s(e)-s(t)||c(e)-c(t)),r.set(e,o),o}var Mf=jf;function Nf(e){let t=e.type||e.kind||`(unknown type)`,n=String(e.name||e.id&&(typeof e.id==`object`?e.id.name:e.id)||e.key&&(typeof e.key==`object`?e.key.name:e.key)||e.value&&(typeof e.value==`object`?``:String(e.value))||e.operator||``);return n.length>20&&(n=n.slice(0,19)+`…`),t+(n?` `+n:``)}function Pf(e,t){(e.comments??=[]).push(t),t.printed=!1,t.nodeDescription=Nf(e)}function Ff(e,t){t.leading=!0,t.trailing=!1,Pf(e,t)}function If(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Pf(e,t)}function Lf(e,t){t.leading=!1,t.trailing=!0,Pf(e,t)}var Rf=new WeakMap;function zf(e,t,n,r,i=[]){let{locStart:a,locEnd:o}=n,s=a(t),c=o(t),l=Mf(e,i,{cache:Rf,locStart:a,locEnd:o,getVisitorKeys:n.getVisitorKeys,filter:n.printer.canAttachComment,getChildren:n.printer.getCommentChildNodes}),u,d,f=0,p=l.length;for(;f<p;){let e=f+p>>1,r=l[e],m=a(r),h=o(r);if(m<=s&&c<=h)return zf(r,t,n,r,[r,...i]);if(h<=s){u=r,f=e+1;continue}if(c<=m){d=r,p=e;continue}throw Error(`Comment location overlaps with node location`)}if(r?.type===`TemplateLiteral`){let{quasis:e}=r,i=Kf(e,t,n);u&&Kf(e,u,n)!==i&&(u=null),d&&Kf(e,d,n)!==i&&(d=null)}return{enclosingNode:r,precedingNode:u,followingNode:d}}var Bf=()=>!1;function Vf(e,t){let{comments:n}=e;if(delete e.comments,!Df(n)||!t.printer.canAttachComment)return;let r=[],{printer:{features:{experimental_avoidAstMutation:i},handleComments:a={}},originalText:o}=t,{ownLine:s=Bf,endOfLine:c=Bf,remaining:l=Bf}=a,u=n.map((r,i)=>({...zf(e,r,t),comment:r,text:o,options:t,ast:e,isLastComment:n.length-1===i}));for(let[e,t]of u.entries()){let{comment:n,precedingNode:a,enclosingNode:o,followingNode:d,text:f,options:p,ast:m,isLastComment:h}=t,g;if(i?g=[t]:(n.enclosingNode=o,n.precedingNode=a,n.followingNode=d,g=[n,f,p,m,h]),Uf(f,p,u,e))n.placement=`ownLine`,s(...g)||(d?Ff(d,n):a?Lf(a,n):If(o||m,n));else if(Wf(f,p,u,e))n.placement=`endOfLine`,c(...g)||(a?Lf(a,n):d?Ff(d,n):If(o||m,n));else if(n.placement=`remaining`,!l(...g))if(a&&d){let e=r.length;e>0&&r[e-1].followingNode!==d&&Gf(r,p),r.push(t)}else a?Lf(a,n):d?Ff(d,n):If(o||m,n)}if(Gf(r,t),!i)for(let e of n)delete e.precedingNode,delete e.enclosingNode,delete e.followingNode}var Hf=e=>!/[\S\n\u2028\u2029]/u.test(e);function Uf(e,t,n,r){let{comment:i,precedingNode:a}=n[r],{locStart:o,locEnd:s}=t,c=o(i);if(a)for(let t=r-1;t>=0;t--){let{comment:r,precedingNode:i}=n[t];if(i!==a||!Hf(e.slice(s(r),c)))break;c=o(r)}return Tf(e,c,{backwards:!0})}function Wf(e,t,n,r){let{comment:i,followingNode:a}=n[r],{locStart:o,locEnd:s}=t,c=s(i);if(a)for(let t=r+1;t<n.length;t++){let{comment:r,followingNode:i}=n[t];if(i!==a||!Hf(e.slice(c,o(r))))break;c=s(r)}return Tf(e,c)}function Gf(e,t){let n=e.length;if(n===0)return;let{precedingNode:r,followingNode:i}=e[0],a=t.locStart(i),o;for(o=n;o>0;--o){let{comment:n,precedingNode:s,followingNode:c}=e[o-1];C(s,r),C(c,i);let l=t.originalText.slice(t.locEnd(n),a);if(t.printer.isGap?.(l,t)??/^[\s(]*$/u.test(l))a=t.locStart(n);else break}for(let[t,{comment:n}]of e.entries())t<o?Lf(r,n):Ff(i,n);for(let e of[r,i])e.comments&&e.comments.length>1&&e.comments.sort((e,n)=>t.locStart(e)-t.locStart(n));e.length=0}function Kf(e,t,n){let r=n.locStart(t)-1;for(let t=1;t<e.length;++t)if(r<n.locStart(e[t]))return t-1;return 0}function qf(e,t){let n=t-1;n=vf(e,n,{backwards:!0}),n=Cf(e,n,{backwards:!0}),n=vf(e,n,{backwards:!0});let r=Cf(e,n,{backwards:!0});return n!==r}var Jf=qf,{breakParent:Yf,hardline:Xf,indent:Zf,join:Qf,line:$f,lineSuffix:ep}=Nr;function tp(e,t){let n=e.node;return n.printed=!0,t.printer.printComment(e,t)}function np(e,t){let n=e.node,r=[tp(e,t)],{printer:i,originalText:a,locStart:o,locEnd:s}=t;if(i.isBlockComment?.(n)){let e=Tf(a,s(n))?Tf(a,o(n),{backwards:!0})?Xf:$f:` `;r.push(e)}else r.push(Xf);let c=Cf(a,vf(a,s(n)));return c!==!1&&Tf(a,c)&&r.push(Xf),r}function rp(e,t,n){let r=e.node,i=tp(e,t),{printer:a,originalText:o,locStart:s}=t,c=a.isBlockComment?.(r);return n?.hasLineSuffix&&!n?.isBlock||Tf(o,s(r),{backwards:!0})?{doc:ep([Xf,Jf(o,s(r))?Xf:``,i]),isBlock:c,hasLineSuffix:!0}:!c||n?.hasLineSuffix?{doc:[ep([` `,i]),Yf],isBlock:c,hasLineSuffix:!0}:{doc:[` `,i],isBlock:c,hasLineSuffix:!1}}function ip(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for(`printedComments`)];if((n.comments||[]).filter(e=>!r.has(e)).length===0)return{leading:``,trailing:``};let i=[],a=[],o;return e.each(()=>{let n=e.node;if(r?.has(n))return;let{leading:s,trailing:c}=n;s?i.push(np(e,t)):c&&(o=rp(e,t,o),a.push(o.doc))},`comments`),{leading:i,trailing:a}}function ap(e,t,n){let{leading:r,trailing:i}=ip(e,n);return!r&&!i?t:$d(t,e=>[r,e,i])}function op(e){let{[Symbol.for(`comments`)]:t,[Symbol.for(`printedComments`)]:n}=e;for(let e of t){if(!e.printed&&!n.has(e))throw Error(`Comment "`+e.value.trim()+`" was not printed. Please report this error!`);delete e.printed}}var sp=()=>zd,cp={checkIgnorePragma:{category:`Special`,type:`boolean`,default:!1,description:`Check whether the file's first docblock comment contains '@noprettier' or '@noformat' to determine if it should be formatted.`,cliCategory:`Other`},cursorOffset:{category:`Special`,type:`int`,default:-1,range:{start:-1,end:1/0,step:1},description:`Print (to stderr) where a cursor at the given position would move to after formatting.`,cliCategory:`Editor`},endOfLine:{category:`Global`,type:`choice`,default:`lf`,description:`Which end of line characters to apply.`,choices:[{value:`lf`,description:`Line Feed only (\\n), common on Linux and macOS as well as inside git repos`},{value:`crlf`,description:`Carriage Return + Line Feed characters (\\r\\n), common on Windows`},{value:`cr`,description:`Carriage Return character only (\\r), used very rarely`},{value:`auto`,description:`Maintain existing
234
+ (mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:`Special`,type:`path`,description:`Specify the input filepath. This will be used to do parser inference.`,cliName:`stdin-filepath`,cliCategory:`Other`,cliDescription:`Path to the file to pretend that stdin comes from.`},insertPragma:{category:`Special`,type:`boolean`,default:!1,description:`Insert @format pragma into file's first docblock comment.`,cliCategory:`Other`},parser:{category:`Global`,type:`choice`,default:void 0,description:`Which parser to use.`,exception:e=>typeof e==`string`||typeof e==`function`,choices:[{value:`flow`,description:`Flow`},{value:`babel`,description:`JavaScript`},{value:`babel-flow`,description:`Flow`},{value:`babel-ts`,description:`TypeScript`},{value:`typescript`,description:`TypeScript`},{value:`acorn`,description:`JavaScript`},{value:`espree`,description:`JavaScript`},{value:`meriyah`,description:`JavaScript`},{value:`css`,description:`CSS`},{value:`less`,description:`Less`},{value:`scss`,description:`SCSS`},{value:`json`,description:`JSON`},{value:`json5`,description:`JSON5`},{value:`jsonc`,description:`JSON with Comments`},{value:`json-stringify`,description:`JSON.stringify`},{value:`graphql`,description:`GraphQL`},{value:`markdown`,description:`Markdown`},{value:`mdx`,description:`MDX`},{value:`vue`,description:`Vue`},{value:`yaml`,description:`YAML`},{value:`glimmer`,description:`Ember / Handlebars`},{value:`html`,description:`HTML`},{value:`angular`,description:`Angular`},{value:`lwc`,description:`Lightning Web Components`},{value:`mjml`,description:`MJML`}]},plugins:{type:`path`,array:!0,default:[{value:[]}],category:`Global`,description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e==`string`||typeof e==`object`,cliName:`plugin`,cliCategory:`Config`},printWidth:{category:`Global`,type:`int`,default:80,description:`The line length where Prettier will try wrap.`,range:{start:0,end:1/0,step:1}},rangeEnd:{category:`Special`,type:`int`,default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive).
235
+ The range will extend forwards to the end of the selected statement.`,cliCategory:`Editor`},rangeStart:{category:`Special`,type:`int`,default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset.
236
+ The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:`Editor`},requirePragma:{category:`Special`,type:`boolean`,default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment in order for it to be formatted.`,cliCategory:`Other`},tabWidth:{type:`int`,category:`Global`,default:2,description:`Number of spaces per indentation level.`,range:{start:0,end:1/0,step:1}},useTabs:{category:`Global`,type:`boolean`,default:!1,description:`Indent with tabs instead of spaces.`},embeddedLanguageFormatting:{category:`Global`,type:`choice`,default:`auto`,description:`Control how Prettier formats quoted code embedded in the file.`,choices:[{value:`auto`,description:`Format embedded code if Prettier can automatically identify it.`},{value:`off`,description:`Never automatically format embedded code.`}]}};function lp({plugins:e=[],showDeprecated:t=!1}={}){let n=e.flatMap(e=>e.languages??[]),r=[];for(let i of dp(Object.assign({},...e.map(({options:e})=>e),cp)))!t&&i.deprecated||(Array.isArray(i.choices)&&(t||(i.choices=i.choices.filter(e=>!e.deprecated)),i.name===`parser`&&(i.choices=[...i.choices,...up(i.choices,n,e)])),i.pluginDefaults=Object.fromEntries(e.filter(e=>e.defaultOptions?.[i.name]!==void 0).map(e=>[e.name,e.defaultOptions[i.name]])),r.push(i));return{languages:n,options:r}}function*up(e,t,n){let r=new Set(e.map(e=>e.value));for(let e of t)if(e.parsers){for(let t of e.parsers)if(!r.has(t)){r.add(t);let i=n.find(e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t)),a=e.name;i?.name&&(a+=` (plugin: ${i.name})`),yield{value:t,description:a}}}}function dp(e){let t=[];for(let[n,r]of Object.entries(e)){let e={name:n,...r};Array.isArray(e.default)&&(e.default=Rd(0,e.default,-1).value),t.push(e)}return t}var fp=Array.prototype.toReversed??function(){return[...this].reverse()},pp=xd(`toReversed`,function(){if(Array.isArray(this))return fp}),mp=Gr(Aa(),1);function hp(e){try{let t=new mp.default(e),n=t.next();if(n===!1)return;t.close();let r=n.toString(`utf8`),i=r.match(/^#!\/(?:usr\/)?bin\/env\s+(\S+)/u);if(i)return i[1];let a=r.match(/^#!\/(?:usr\/(?:local\/)?)?bin\/(\S+)/u);if(a)return a[1]}catch{}}var gp=hp,_p=e=>{try{return g.basename(ts(e))}catch{return``}};function vp(e,t){if(!t)return;let n=_p(t).toLowerCase();return e.find(({filenames:e})=>e?.some(e=>e.toLowerCase()===n))??e.find(({extensions:e})=>e?.some(e=>n.endsWith(e)))}function yp(e,t){if(t)return e.find(({name:e})=>e.toLowerCase()===t)??e.find(({aliases:e})=>e?.includes(t))??e.find(({extensions:e})=>e?.includes(`.${t}`))}function bp(e,t){if(!t||_p(t).includes(`.`))return;let n=e.filter(({interpreters:e})=>Df(e));if(n.length===0)return;let r=gp(t);if(r)return n.find(({interpreters:e})=>e.includes(r))}var xp=bp;function Sp(e,t){if(t){if(es(t))try{t=p(t)}catch{return}if(typeof t==`string`)return e.find(({isSupported:e})=>e?.({filepath:t}))}}function Cp(e,t){let n=pp(0,e.plugins).flatMap(e=>e.languages??[]);return(yp(n,t.language)??vp(n,t.physicalFile)??vp(n,t.file)??Sp(n,t.physicalFile)??Sp(n,t.file)??xp?.(n,t.physicalFile))?.parsers[0]}var wp=Cp,Tp;function Ep(e,t,{logger:n=!1,isCLI:r=!1,passThrough:i=!1,FlagSchema:a,descriptor:o}={}){if(r){if(!a)throw Error(`'FlagSchema' option is required.`);if(!o)throw Error(`'descriptor' option is required.`)}else o=Ya;let s=i?Array.isArray(i)?(e,t)=>i.includes(e)?{[e]:t}:void 0:(e,t)=>({[e]:t}):(e,t,n)=>{let{_:r,...i}=n.schemas;return so(e,t,{...n,schemas:i})},c=new Vo(Dp(t,{isCLI:r,FlagSchema:a}),{logger:n,unknown:s,descriptor:o}),l=n!==!1;l&&Tp&&(c._hasDeprecationWarned=Tp);let u=c.normalize(e);return l&&(Tp=c._hasDeprecationWarned),u}function Dp(e,{isCLI:t,FlagSchema:n}){let r=[];t&&r.push(mo.create({name:`_`}));for(let i of e)r.push(Op(i,{isCLI:t,optionInfos:e,FlagSchema:n})),i.alias&&t&&r.push(po.create({name:i.alias,sourceName:i.name}));return r}function Op(e,{isCLI:t,optionInfos:n,FlagSchema:r}){let{name:i}=e,a={name:i},o,s={};switch(e.type){case`int`:o=Fo,t&&(a.preprocess=Number);break;case`string`:o=Io;break;case`choice`:o=No,a.choices=e.choices.map(t=>t?.redirect?{...t,redirect:{to:{key:e.name,value:t.redirect}}}:t);break;case`boolean`:o=_o;break;case`flag`:o=r,a.flags=n.flatMap(e=>[e.alias,e.description&&e.name,e.oppositeDescription&&`no-${e.name}`].filter(Boolean));break;case`path`:o=Io;break;default:throw Error(`Unexpected type ${e.type}`)}if(e.exception?a.validate=(t,n,r)=>e.exception(t)||n.validate(t,r):a.validate=(e,t,n)=>e===void 0||t.validate(e,n),e.redirect&&(s.redirect=t=>t?{to:typeof e.redirect==`string`?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(s.deprecated=!0),t&&!e.array){let e=a.preprocess||(e=>e);a.preprocess=(t,n,r)=>n.preprocess(e(Array.isArray(t)?Rd(0,t,-1):t),r)}return e.array?ho.create({...t?{preprocess:e=>Array.isArray(e)?e:[e]}:{},...s,valueSchema:o.create(a)}):o.create({...a,...s})}var kp=Ep,Ap=Array.prototype.findLast??function(e){for(let t=this.length-1;t>=0;t--){let n=this[t];if(e(n,t,this))return n}},jp=xd(`findLast`,function(){if(Array.isArray(this))return Ap}),Mp=Symbol.for(`PRETTIER_IS_FRONT_MATTER`),Np=[];function Pp(e){return!!e?.[Mp]}var Fp=Pp,{hardline:Ip,markAsRoot:Lp}=Nr,Rp=new Set([`yaml`,`toml`]),zp=({node:e})=>Fp(e)&&Rp.has(e.language);async function Bp(e,t,n,r){let{node:i}=n,{language:a}=i;if(!Rp.has(a))return;let o=i.value.trim(),s;if(o){let t=a===`yaml`?a:wp(r,{language:a});if(!t)return;s=o?await e(o,{parser:t}):``}else s=o;return Lp([i.startDelimiter,i.explicitLanguage??``,Ip,s,s?Ip:``,i.endDelimiter])}function Vp(e,t){return zp({node:e})&&(delete t.end,delete t.raw,delete t.value),t}var Hp=Vp;function Up({node:e}){return e.raw}var Wp=Up,Gp=new Set([`tokens`,`comments`,`parent`,`enclosingNode`,`precedingNode`,`followingNode`]),Kp=e=>Object.keys(e).filter(e=>!Gp.has(e));function qp(e,t){let n=e?t=>e(t,Gp):Kp;return t?new Proxy(n,{apply:(e,t,n)=>Fp(n[0])?Np:Reflect.apply(e,t,n)}):n}var Jp=qp;function Yp(e,t){if(!t)throw Error(`parserName is required.`);let n=jp(0,e,e=>e.parsers&&Object.prototype.hasOwnProperty.call(e.parsers,t));if(n)return n;throw new Uo(`Couldn't resolve parser "${t}".`)}function Xp(e,t){if(!t)throw Error(`astFormat is required.`);let n=jp(0,e,e=>e.printers&&Object.prototype.hasOwnProperty.call(e.printers,t));if(n)return n;throw new Uo(`Couldn't find plugin for AST format "${t}".`)}function Zp({plugins:e,parser:t}){return Qp(Yp(e,t),t)}function Qp(e,t){let n=e.parsers[t];return typeof n==`function`?n():n}async function $p(e,t){let n=e.printers[t];return tm(typeof n==`function`?await n():n)}var em=new WeakMap;function tm(e){if(em.has(e))return em.get(e);let{features:t,getVisitorKeys:n,embed:r,massageAstNode:i,print:a,...o}=e;t=im(t);let s=t.experimental_frontMatterSupport;n=Jp(n,s.massageAstNode||s.embed||s.print);let c=i;i&&s.massageAstNode&&(c=new Proxy(i,{apply(e,t,n){return Hp(...n),Reflect.apply(e,t,n)}}));let l=r;if(r){let e;l=new Proxy(r,{get(t,i,a){return i===`getVisitorKeys`?(e??=r.getVisitorKeys?Jp(r.getVisitorKeys,s.massageAstNode||s.embed):n,e):Reflect.get(t,i,a)},apply:(e,t,n)=>s.embed&&zp(...n)?Bp:Reflect.apply(e,t,n)})}let u=a;s.print&&(u=new Proxy(a,{apply(e,t,n){let[r]=n;return Fp(r.node)?Wp(r):Reflect.apply(e,t,n)}}));let d={features:t,getVisitorKeys:n,embed:l,massageAstNode:c,print:u,...o};return em.set(e,d),d}var nm=Object.fromEntries([`clean`,`embed`,`print`].map(e=>[e,!1]));function rm(e){return{...nm,...e}}function im(e){return{experimental_avoidAstMutation:!1,...e,experimental_frontMatterSupport:rm(e?.experimental_frontMatterSupport)}}var am={astFormat:`estree`,printer:{},originalText:void 0,locStart:null,locEnd:null,getVisitorKeys:null};async function om(e,t={}){let n={...e};if(!n.parser){if(!n.filepath)throw new Wo(`No parser and no file path given, couldn't infer a parser.`);if(n.parser=wp(n,{physicalFile:n.filepath}),!n.parser)throw new Wo(`No parser could be inferred for file "${n.filepath}".`)}let r=lp({plugins:e.plugins,showDeprecated:!0}).options,i={...am,...Object.fromEntries(r.filter(e=>e.default!==void 0).map(e=>[e.name,e.default]))},a=Yp(n.plugins,n.parser),o=await Qp(a,n.parser);n.astFormat=o.astFormat,n.locEnd=o.locEnd,n.locStart=o.locStart;let s=a.printers?.[o.astFormat]?a:Xp(n.plugins,o.astFormat),c=await $p(s,o.astFormat);n.printer=c,n.getVisitorKeys=c.getVisitorKeys;let l=s.defaultOptions?Object.fromEntries(Object.entries(s.defaultOptions).filter(([,e])=>e!==void 0)):{},u={...i,...l};for(let[e,t]of Object.entries(u))(n[e]===null||n[e]===void 0)&&(n[e]=t);return n.parser===`json`&&(n.trailingComma=`none`),kp(n,r,{passThrough:Object.keys(am),...t})}var sm=om;async function cm(e,t){let n=await Zp(t),r=n.preprocess?await n.preprocess(e,t):e;t.originalText=r;let i;try{i=await n.parse(r,t,t)}catch(t){lm(t,e)}return{text:r,ast:i}}function lm(e,t){let{loc:n}=e;if(n){let r=Dc(t,n,{highlightCode:!0});throw e.message+=`
237
+ `+r,e.codeFrame=r,e}throw e}var um=cm,{stripTrailingHardline:dm}=Fr;async function fm(e,t,n,r,i){if(n.embeddedLanguageFormatting!==`auto`)return;let{printer:a}=n,{embed:o}=a;if(!o)return;if(o.length>2)throw Error(`printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/plugins#optional-embed`);let{hasPrettierIgnore:s}=a,{getVisitorKeys:c}=o,l=[];f();let u=e.stack;for(let{print:r,node:a,pathStack:o}of l)try{e.stack=o;let s=await r(d,t,e,n);s&&i.set(a,s)}catch(e){if(process.env.PRETTIER_DEBUG)throw e}e.stack=u;function d(e,t){return pm(e,t,n,r)}function f(){let{node:t}=e;if(typeof t!=`object`||!t||s?.(e))return;for(let n of c(t))Array.isArray(t[n])?e.each(f,n):e.call(f,n);let r=o(e,n);if(r){if(typeof r==`function`){l.push({print:r,node:t,pathStack:[...e.stack]});return}i.set(t,r)}}}async function pm(e,t,n,r){let i=await sm({...n,...t,parentParser:n.parser,originalText:e,cursorOffset:void 0,rangeStart:void 0,rangeEnd:void 0},{passThrough:!0}),{ast:a}=await um(e,i);return dm(await r(a,i))}function mm(e,t,n,r){let{originalText:i,[Symbol.for(`comments`)]:a,locStart:o,locEnd:s,[Symbol.for(`printedComments`)]:c}=t,{node:l}=e,u=o(l),d=s(l);for(let e of a)o(e)>=u&&s(e)<=d&&c.add(e);let{printPrettierIgnored:f}=t.printer;return f?f(e,t,n,r):i.slice(u,d)}var hm=mm,{cursor:gm}=Nr;async function _m(e,t){({ast:e}=await ym(e,t));let n=new Map,r=new pf(e),i=sp(t),a=new Map;await fm(r,s,t,_m,a);let o=await vm(r,t,s,void 0,a);if(op(t),t.cursorOffset>=0){if(t.nodeAfterCursor&&!t.nodeBeforeCursor)return[gm,o];if(t.nodeBeforeCursor&&!t.nodeAfterCursor)return[o,gm]}return o;function s(e,t){return e===void 0||e===r?c(t):Array.isArray(e)?r.call(()=>c(t),...e):r.call(()=>c(t),e)}function c(e){i(r);let o=r.node;if(o==null)return``;let c=hf(o)&&e===void 0;if(c&&n.has(o))return n.get(o);let l=vm(r,t,s,e,a);return c&&n.set(o,l),l}}function vm(e,t,n,r,i){let{node:a}=e,{printer:o}=t,s;switch(s=o.hasPrettierIgnore?.(e)?hm(e,t,n,r):i.has(a)?i.get(a):o.print(e,t,n,r),a){case t.cursorNode:s=$d(s,e=>[gm,e,gm]);break;case t.nodeBeforeCursor:s=$d(s,e=>[e,gm]);break;case t.nodeAfterCursor:s=$d(s,e=>[gm,e]);break}return o.printComment&&!o.willPrintOwnComments?.(e,t)&&(s=ap(e,s,t)),s}async function ym(e,t){let n=e.comments??[];t[Symbol.for(`comments`)]=n,t[Symbol.for(`printedComments`)]=new Set,Vf(e,t);let{printer:{preprocess:r}}=t;return e=r?await r(e,t):e,{ast:e,comments:n}}function bm(e,t){let{cursorOffset:n,locStart:r,locEnd:i,getVisitorKeys:a}=t,o=e=>r(e)<=n&&i(e)>=n,s=e,c=[e];for(let t of kf(e,{getVisitorKeys:a,filter:o}))c.push(t),s=t;if(Af(s,{getVisitorKeys:a}))return{cursorNode:s};let l,u,d=-1,f=1/0;for(;c.length>0&&(l===void 0||u===void 0);){s=c.pop();let e=l!==void 0,t=u!==void 0;for(let o of Of(s,{getVisitorKeys:a})){if(!e){let e=i(o);e<=n&&e>d&&(l=o,d=e)}if(!t){let e=r(o);e>=n&&e<f&&(u=o,f=e)}}}return{nodeBeforeCursor:l,nodeAfterCursor:u}}var xm=bm;function Sm(e,t){let{printer:n}=t,r=n.massageAstNode;if(!r)return e;let{getVisitorKeys:i}=n,{ignoredProperties:a}=r;return o(e);function o(e,t){if(!hf(e))return e;if(Array.isArray(e))return e.map(e=>o(e,t)).filter(Boolean);let n={},s=new Set(i(e));for(let t in e)!Object.prototype.hasOwnProperty.call(e,t)||a?.has(t)||(s.has(t)?n[t]=o(e[t],e):n[t]=e[t]);let c=r(e,n,t);if(c!==null)return c??n}}var Cm=Sm,wm=Array.prototype.findLastIndex??function(e){for(let t=this.length-1;t>=0;t--){let n=this[t];if(e(n,t,this))return t}return-1},Tm=xd(`findLastIndex`,function(){if(Array.isArray(this))return wm}),Em=({parser:e})=>e===`json`||e===`json5`||e===`jsonc`||e===`json-stringify`;function Dm(e,t){return t=new Set(t),e.find(e=>Mm.has(e.type)&&t.has(e))}function Om(e){let t=Tm(0,e,e=>e.type!==`Program`&&e.type!==`File`);return t===-1?e:e.slice(0,t+1)}function km(e,t,{locStart:n,locEnd:r}){let[i,...a]=e,[o,...s]=t;if(i===o)return[i,o];let c=n(i);for(let e of Om(s))if(n(e)>=c)o=e;else break;let l=r(o);for(let e of Om(a)){if(r(e)<=l)i=e;else break;if(i===o)break}return[i,o]}function Am(e,t,n,r,i=[],a){let{locStart:o,locEnd:s}=n,c=o(e),l=s(e);if(t>l||t<c||a===`rangeEnd`&&t===c||a===`rangeStart`&&t===l)return;let u=[e,...i],d=Mf(e,u,{cache:Rf,locStart:o,locEnd:s,getVisitorKeys:n.getVisitorKeys,filter:n.printer.canAttachComment,getChildren:n.printer.getCommentChildNodes});for(let e of d){let i=Am(e,t,n,r,u,a);if(i)return i}if(r(e,i[0]))return u}function jm(e,t){return t!==`DeclareExportDeclaration`&&e!==`TypeParameterDeclaration`&&(e===`Directive`||e===`TypeAlias`||e===`TSExportAssignment`||e.startsWith(`Declare`)||e.startsWith(`TSDeclare`)||e.endsWith(`Statement`)||e.endsWith(`Declaration`))}var Mm=new Set([`JsonRoot`,`ObjectExpression`,`ArrayExpression`,`StringLiteral`,`NumericLiteral`,`BooleanLiteral`,`NullLiteral`,`UnaryExpression`,`TemplateLiteral`]),Nm=new Set([`OperationDefinition`,`FragmentDefinition`,`VariableDefinition`,`TypeExtensionDefinition`,`ObjectTypeDefinition`,`FieldDefinition`,`DirectiveDefinition`,`EnumTypeDefinition`,`EnumValueDefinition`,`InputValueDefinition`,`InputObjectTypeDefinition`,`SchemaDefinition`,`OperationTypeDefinition`,`InterfaceTypeDefinition`,`UnionTypeDefinition`,`ScalarTypeDefinition`]);function Pm(e,t,n){if(!t)return!1;switch(e.parser){case`flow`:case`hermes`:case`babel`:case`babel-flow`:case`babel-ts`:case`typescript`:case`acorn`:case`espree`:case`meriyah`:case`oxc`:case`oxc-ts`:case`__babel_estree`:return jm(t.type,n?.type);case`json`:case`json5`:case`jsonc`:case`json-stringify`:return Mm.has(t.type);case`graphql`:return Nm.has(t.kind);case`vue`:return t.tag!==`root`}return!1}function Fm(e,t,n){let{rangeStart:r,rangeEnd:i,locStart:a,locEnd:o}=t;S(i>r);let s=e.slice(r,i).search(/\S/u),c=s===-1;if(!c)for(r+=s;i>r&&!/\S/u.test(e[i-1]);--i);let l=Am(n,r,t,(e,n)=>Pm(t,e,n),[],`rangeStart`);if(!l)return;let u=c?l:Am(n,i,t,e=>Pm(t,e),[],`rangeEnd`);if(!u)return;let d,f;if(Em(t)){let e=Dm(l,u);d=e,f=e}else [d,f]=km(l,u,t);return[Math.min(a(d),a(f)),Math.max(o(d),o(f))]}var{addAlignmentToDoc:Im,hardline:Lm}=Nr,{printDocToString:Rm}=Pr,zm=``,Bm=Symbol(`cursor`);async function Vm(e,t,n=0){if(!e||e.trim().length===0)return{formatted:``,cursorOffset:-1,comments:[]};let{ast:r,text:i}=await um(e,t);t.cursorOffset>=0&&(t={...t,...xm(r,t)});let a=await _m(r,t,n);n>0&&(a=Im([Lm,a],n,t.tabWidth));let o=Rm(a,t);if(n>0){let e=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(e),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>e.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=e+Md(t.endOfLine)}let s=t[Symbol.for(`comments`)];if(t.cursorOffset>=0){let e,n,r,a;if((t.cursorNode||t.nodeBeforeCursor||t.nodeAfterCursor)&&o.cursorNodeText)if(r=o.cursorNodeStart,a=o.cursorNodeText,t.cursorNode)e=t.locStart(t.cursorNode),n=i.slice(e,t.locEnd(t.cursorNode));else{if(!t.nodeBeforeCursor&&!t.nodeAfterCursor)throw Error(`Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor`);e=t.nodeBeforeCursor?t.locEnd(t.nodeBeforeCursor):0;let r=t.nodeAfterCursor?t.locStart(t.nodeAfterCursor):i.length;n=i.slice(e,r)}else e=0,n=i,r=0,a=o.formatted;let c=t.cursorOffset-e;if(n===a)return{formatted:o.formatted,cursorOffset:r+c,comments:s};let l=n.split(``);l.splice(c,0,Bm);let u=Ra(l,a.split(``)),d=r;for(let e of u)if(e.removed){if(e.value.includes(Bm))break}else d+=e.count;return{formatted:o.formatted,cursorOffset:d,comments:s}}return{formatted:o.formatted,cursorOffset:-1,comments:s}}async function Hm(e,t){let{ast:n,text:r}=await um(e,t),[i,a]=Fm(r,t,n)??[0,0],o=r.slice(i,a),s=Math.min(i,r.lastIndexOf(`
238
+ `,i)+1),c=r.slice(s,i).match(/^\s*/u)[0],l=ff(c,t.tabWidth),u=await Vm(o,{...t,rangeStart:0,rangeEnd:1/0,cursorOffset:t.cursorOffset>i&&t.cursorOffset<=a?t.cursorOffset-i:-1,endOfLine:`lf`},l),d=u.formatted.trimEnd(),{cursorOffset:f}=t;f>a?f+=d.length-o.length:u.cursorOffset>=0&&(f=u.cursorOffset+i);let p=r.slice(0,i)+d+r.slice(a);if(t.endOfLine!==`lf`){let e=Md(t.endOfLine);f>=0&&e===`\r
239
+ `&&(f+=Pd(p.slice(0,f),`
240
+ `)),p=Cd(0,p,`
241
+ `,e)}return{formatted:p,cursorOffset:f,comments:u.comments}}function Um(e,t,n){return typeof t!=`number`||Number.isNaN(t)||t<0||t>e.length?n:t}function Wm(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=Um(e,n,-1),r=Um(e,r,0),i=Um(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function Gm(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:a}=Wm(e,t),o=e.charAt(0)===zm;if(o&&(e=e.slice(1),n--,r--,i--),a===`auto`&&(a=jd(e)),e.includes(`\r`)){let t=t=>Pd(e.slice(0,Math.max(t,0)),`\r
242
+ `);n-=t(n),r-=t(r),i-=t(i),e=Id(e)}return{hasBOM:o,text:e,options:Wm(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:a})}}async function Km(e,t){let n=await Zp(t);return!n.hasPragma||n.hasPragma(e)}async function qm(e,t){return(await Zp(t)).hasIgnorePragma?.(e)}async function Jm(e,t){let{hasBOM:n,text:r,options:i}=Gm(e,await sm(t));if(i.rangeStart>=i.rangeEnd&&r!==``||i.requirePragma&&!await Km(r,i)||i.checkIgnorePragma&&await qm(r,i))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let a;return i.rangeStart>0||i.rangeEnd<r.length?a=await Hm(r,i):(!i.requirePragma&&i.insertPragma&&i.printer.insertPragma&&!await Km(r,i)&&(r=i.printer.insertPragma(r)),a=await Vm(r,i)),n&&(a.formatted=zm+a.formatted,a.cursorOffset>=0&&a.cursorOffset++),a}async function Ym(e,t,n){let{text:r,options:i}=Gm(e,await sm(t)),a=await um(r,i);return n&&(n.preprocessForPrint&&(a.ast=await ym(a.ast,i)),n.massage&&(a.ast=Cm(a.ast,i))),a}async function Xm(e,t){return t=await sm(t),Rm(await _m(e,t),t)}async function Zm(e,t){let{formatted:n}=await Jm(tf(e),{...t,parser:`__js_expression`});return n}async function Qm(e,t){t=await sm(t);let{ast:n}=await um(e,t);return t.cursorOffset>=0&&(t={...t,...xm(n,t)}),_m(n,t)}async function $m(e,t){return Rm(e,await sm(t))}var eh={};Ur(eh,{CATEGORY_CONFIG:()=>th,CATEGORY_EDITOR:()=>nh,CATEGORY_FORMAT:()=>rh,CATEGORY_GLOBAL:()=>oh,CATEGORY_OTHER:()=>ih,CATEGORY_OUTPUT:()=>ah,CATEGORY_SPECIAL:()=>sh});var th=`Config`,nh=`Editor`,rh=`Format`,ih=`Other`,ah=`Output`,oh=`Global`,sh=`Special`,ch=[{name:`CSS`,type:`markup`,aceMode:`css`,extensions:[`.css`,`.wxss`],tmScope:`source.css`,codemirrorMode:`css`,codemirrorMimeType:`text/css`,parsers:[`css`],vscodeLanguageIds:[`css`],linguistLanguageId:50},{name:`PostCSS`,type:`markup`,aceMode:`text`,extensions:[`.pcss`,`.postcss`],tmScope:`source.postcss`,group:`CSS`,parsers:[`css`],vscodeLanguageIds:[`postcss`],linguistLanguageId:262764437},{name:`Less`,type:`markup`,aceMode:`less`,extensions:[`.less`],tmScope:`source.css.less`,aliases:[`less-css`],codemirrorMode:`css`,codemirrorMimeType:`text/x-less`,parsers:[`less`],vscodeLanguageIds:[`less`],linguistLanguageId:198},{name:`SCSS`,type:`markup`,aceMode:`scss`,extensions:[`.scss`],tmScope:`source.css.scss`,codemirrorMode:`css`,codemirrorMimeType:`text/x-scss`,parsers:[`scss`],vscodeLanguageIds:[`scss`],linguistLanguageId:329}],lh={bracketSpacing:{category:`Common`,type:`boolean`,default:!0,description:`Print spaces between brackets.`,oppositeDescription:`Do not print spaces between brackets.`},objectWrap:{category:`Common`,type:`choice`,default:`preserve`,description:`How to wrap object literals.`,choices:[{value:`preserve`,description:`Keep as multi-line, if there is a newline between the opening brace and first property.`},{value:`collapse`,description:`Fit to a single line when possible.`}]},singleQuote:{category:`Common`,type:`boolean`,default:!1,description:`Use single quotes instead of double quotes.`},proseWrap:{category:`Common`,type:`choice`,default:`preserve`,description:`How to wrap prose.`,choices:[{value:`always`,description:`Wrap prose if it exceeds the print width.`},{value:`never`,description:`Do not wrap prose.`},{value:`preserve`,description:`Wrap prose as-is.`}]},bracketSameLine:{category:`Common`,type:`boolean`,default:!1,description:`Put > of opening tags on the last line instead of on a new line.`},singleAttributePerLine:{category:`Common`,type:`boolean`,default:!1,description:`Enforce single attribute per line in HTML, Vue and JSX.`}},uh={singleQuote:lh.singleQuote},dh=[{name:`GraphQL`,type:`data`,aceMode:`graphqlschema`,extensions:[`.graphql`,`.gql`,`.graphqls`],tmScope:`source.graphql`,parsers:[`graphql`],vscodeLanguageIds:[`graphql`],linguistLanguageId:139}],fh={bracketSpacing:lh.bracketSpacing},ph=[{name:`Handlebars`,type:`markup`,aceMode:`handlebars`,extensions:[`.handlebars`,`.hbs`],tmScope:`text.html.handlebars`,aliases:[`hbs`,`htmlbars`],parsers:[`glimmer`],vscodeLanguageIds:[`handlebars`],linguistLanguageId:155}],mh=[{name:`Angular`,type:`markup`,aceMode:`html`,extensions:[`.component.html`],tmScope:`text.html.basic`,aliases:[`xhtml`],codemirrorMode:`htmlmixed`,codemirrorMimeType:`text/html`,parsers:[`angular`],vscodeLanguageIds:[`html`],filenames:[],linguistLanguageId:146},{name:`HTML`,type:`markup`,aceMode:`html`,extensions:[`.html`,`.hta`,`.htm`,`.html.hl`,`.inc`,`.xht`,`.xhtml`],tmScope:`text.html.basic`,aliases:[`xhtml`],codemirrorMode:`htmlmixed`,codemirrorMimeType:`text/html`,parsers:[`html`],vscodeLanguageIds:[`html`],linguistLanguageId:146},{name:`Lightning Web Components`,type:`markup`,aceMode:`html`,extensions:[],tmScope:`text.html.basic`,aliases:[`xhtml`],codemirrorMode:`htmlmixed`,codemirrorMimeType:`text/html`,parsers:[`lwc`],vscodeLanguageIds:[`html`],filenames:[],linguistLanguageId:146},{name:`MJML`,type:`markup`,aceMode:`html`,extensions:[`.mjml`],tmScope:`text.mjml.basic`,aliases:[`MJML`,`mjml`],codemirrorMode:`htmlmixed`,codemirrorMimeType:`text/html`,parsers:[`mjml`],filenames:[],vscodeLanguageIds:[`mjml`],linguistLanguageId:146},{name:`Vue`,type:`markup`,aceMode:`vue`,extensions:[`.vue`],tmScope:`source.vue`,codemirrorMode:`vue`,codemirrorMimeType:`text/x-vue`,parsers:[`vue`],vscodeLanguageIds:[`vue`],linguistLanguageId:391}],hh=`HTML`,gh={bracketSameLine:lh.bracketSameLine,htmlWhitespaceSensitivity:{category:hh,type:`choice`,default:`css`,description:`How to handle whitespaces in HTML.`,choices:[{value:`css`,description:`Respect the default value of CSS display property.`},{value:`strict`,description:`Whitespaces are considered sensitive.`},{value:`ignore`,description:`Whitespaces are considered insensitive.`}]},singleAttributePerLine:lh.singleAttributePerLine,vueIndentScriptAndStyle:{category:hh,type:`boolean`,default:!1,description:`Indent script and style tags in Vue files.`}},_h=[{name:`JavaScript`,type:`programming`,aceMode:`javascript`,extensions:`.js,._js,.bones,.cjs,.es,.es6,.gs,.jake,.javascript,.jsb,.jscad,.jsfl,.jslib,.jsm,.jspre,.jss,.mjs,.njs,.pac,.sjs,.ssjs,.xsjs,.xsjslib,.start.frag,.end.frag,.wxs`.split(`,`),filenames:[`Jakefile`,`start.frag`,`end.frag`],tmScope:`source.js`,aliases:[`js`,`node`],codemirrorMode:`javascript`,codemirrorMimeType:`text/javascript`,interpreters:[`chakra`,`d8`,`gjs`,`js`,`node`,`nodejs`,`qjs`,`rhino`,`v8`,`v8-shell`,`zx`],parsers:[`babel`,`acorn`,`espree`,`meriyah`,`babel-flow`,`babel-ts`,`flow`,`typescript`],vscodeLanguageIds:[`javascript`,`mongo`],linguistLanguageId:183},{name:`Flow`,type:`programming`,aceMode:`javascript`,extensions:[`.js.flow`],filenames:[],tmScope:`source.js`,aliases:[],codemirrorMode:`javascript`,codemirrorMimeType:`text/javascript`,interpreters:[`chakra`,`d8`,`gjs`,`js`,`node`,`nodejs`,`qjs`,`rhino`,`v8`,`v8-shell`],parsers:[`flow`,`babel-flow`],vscodeLanguageIds:[`javascript`],linguistLanguageId:183},{name:`JSX`,type:`programming`,aceMode:`javascript`,extensions:[`.jsx`],filenames:void 0,tmScope:`source.js.jsx`,aliases:void 0,codemirrorMode:`jsx`,codemirrorMimeType:`text/jsx`,interpreters:void 0,parsers:[`babel`,`babel-flow`,`babel-ts`,`flow`,`typescript`,`espree`,`meriyah`],vscodeLanguageIds:[`javascriptreact`],group:`JavaScript`,linguistLanguageId:183},{name:`TypeScript`,type:`programming`,aceMode:`typescript`,extensions:[`.ts`,`.cts`,`.mts`],tmScope:`source.ts`,aliases:[`ts`],codemirrorMode:`javascript`,codemirrorMimeType:`application/typescript`,interpreters:[`bun`,`deno`,`ts-node`,`tsx`],parsers:[`typescript`,`babel-ts`],vscodeLanguageIds:[`typescript`],linguistLanguageId:378},{name:`TSX`,type:`programming`,aceMode:`tsx`,extensions:[`.tsx`],tmScope:`source.tsx`,codemirrorMode:`jsx`,codemirrorMimeType:`text/typescript-jsx`,group:`TypeScript`,parsers:[`typescript`,`babel-ts`],vscodeLanguageIds:[`typescriptreact`],linguistLanguageId:94901924}],vh=`JavaScript`,yh={arrowParens:{category:vh,type:`choice`,default:`always`,description:`Include parentheses around a sole arrow function parameter.`,choices:[{value:`always`,description:"Always include parens. Example: `(x) => x`"},{value:`avoid`,description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:lh.bracketSameLine,objectWrap:lh.objectWrap,bracketSpacing:lh.bracketSpacing,jsxBracketSameLine:{category:vh,type:`boolean`,description:`Put > on the last line instead of at a new line.`,deprecated:`2.4.0`},semi:{category:vh,type:`boolean`,default:!0,description:`Print semicolons.`,oppositeDescription:`Do not print semicolons, except at the beginning of lines which may need them.`},experimentalOperatorPosition:{category:vh,type:`choice`,default:`end`,description:`Where to print operators when binary expressions wrap lines.`,choices:[{value:`start`,description:`Print operators at the start of new lines.`},{value:`end`,description:`Print operators at the end of previous lines.`}]},experimentalTernaries:{category:vh,type:`boolean`,default:!1,description:`Use curious ternaries, with the question mark after the condition.`,oppositeDescription:`Default behavior of ternaries; keep question marks on the same line as the consequent.`},singleQuote:lh.singleQuote,jsxSingleQuote:{category:vh,type:`boolean`,default:!1,description:`Use single quotes in JSX.`},quoteProps:{category:vh,type:`choice`,default:`as-needed`,description:`Change when properties in objects are quoted.`,choices:[{value:`as-needed`,description:`Only add quotes around object properties where required.`},{value:`consistent`,description:`If at least one property in an object requires quotes, quote all properties.`},{value:`preserve`,description:`Respect the input use of quotes in object properties.`}]},trailingComma:{category:vh,type:`choice`,default:`all`,description:`Print trailing commas wherever possible when multi-line.`,choices:[{value:`all`,description:`Trailing commas wherever possible (including function arguments).`},{value:`es5`,description:`Trailing commas where valid in ES5 (objects, arrays, etc.)`},{value:`none`,description:`No trailing commas.`}]},singleAttributePerLine:lh.singleAttributePerLine},bh=[{name:`JSON.stringify`,type:`data`,aceMode:`json`,extensions:[`.importmap`],filenames:[`package.json`,`package-lock.json`,`composer.json`],tmScope:`source.json`,aliases:[`geojson`,`jsonl`,`sarif`,`topojson`],codemirrorMode:`javascript`,codemirrorMimeType:`application/json`,parsers:[`json-stringify`],vscodeLanguageIds:[`json`],linguistLanguageId:174},{name:`JSON`,type:`data`,aceMode:`json`,extensions:[`.json`,`.4DForm`,`.4DProject`,`.avsc`,`.geojson`,`.gltf`,`.har`,`.ice`,`.JSON-tmLanguage`,`.json.example`,`.mcmeta`,`.sarif`,`.tact`,`.tfstate`,`.tfstate.backup`,`.topojson`,`.webapp`,`.webmanifest`,`.yy`,`.yyp`],filenames:[`.all-contributorsrc`,`.arcconfig`,`.auto-changelog`,`.c8rc`,`.htmlhintrc`,`.imgbotconfig`,`.nycrc`,`.tern-config`,`.tern-project`,`.watchmanconfig`,`.babelrc`,`.jscsrc`,`.jshintrc`,`.jslintrc`,`.swcrc`],tmScope:`source.json`,aliases:[`geojson`,`jsonl`,`sarif`,`topojson`],codemirrorMode:`javascript`,codemirrorMimeType:`application/json`,parsers:[`json`],vscodeLanguageIds:[`json`],linguistLanguageId:174},{name:`JSON with Comments`,type:`data`,aceMode:`javascript`,extensions:[`.jsonc`,`.code-snippets`,`.code-workspace`,`.sublime-build`,`.sublime-color-scheme`,`.sublime-commands`,`.sublime-completions`,`.sublime-keymap`,`.sublime-macro`,`.sublime-menu`,`.sublime-mousemap`,`.sublime-project`,`.sublime-settings`,`.sublime-theme`,`.sublime-workspace`,`.sublime_metrics`,`.sublime_session`],filenames:[],tmScope:`source.json.comments`,aliases:[`jsonc`],codemirrorMode:`javascript`,codemirrorMimeType:`text/javascript`,group:`JSON`,parsers:[`jsonc`],vscodeLanguageIds:[`jsonc`],linguistLanguageId:423},{name:`JSON5`,type:`data`,aceMode:`json5`,extensions:[`.json5`],tmScope:`source.js`,codemirrorMode:`javascript`,codemirrorMimeType:`application/json`,parsers:[`json5`],vscodeLanguageIds:[`json5`],linguistLanguageId:175}],xh=[{name:`Markdown`,type:`prose`,aceMode:`markdown`,extensions:[`.md`,`.livemd`,`.markdown`,`.mdown`,`.mdwn`,`.mkd`,`.mkdn`,`.mkdown`,`.ronn`,`.scd`,`.workbook`],filenames:[`contents.lr`,`README`],tmScope:`text.md`,aliases:[`md`,`pandoc`],codemirrorMode:`gfm`,codemirrorMimeType:`text/x-gfm`,wrap:!0,parsers:[`markdown`],vscodeLanguageIds:[`markdown`],linguistLanguageId:222},{name:`MDX`,type:`prose`,aceMode:`markdown`,extensions:[`.mdx`],filenames:[],tmScope:`text.md`,aliases:[`md`,`pandoc`],codemirrorMode:`gfm`,codemirrorMimeType:`text/x-gfm`,wrap:!0,parsers:[`mdx`],vscodeLanguageIds:[`mdx`],linguistLanguageId:222}],Sh={proseWrap:lh.proseWrap,singleQuote:lh.singleQuote},Ch=[{name:`YAML`,type:`data`,aceMode:`yaml`,extensions:[`.yml`,`.mir`,`.reek`,`.rviz`,`.sublime-syntax`,`.syntax`,`.yaml`,`.yaml-tmlanguage`,`.yaml.sed`,`.yml.mysql`],filenames:[`.clang-format`,`.clang-tidy`,`.clangd`,`.gemrc`,`CITATION.cff`,`glide.lock`,`pixi.lock`,`.prettierrc`,`.stylelintrc`,`.lintstagedrc`],tmScope:`source.yaml`,aliases:[`yml`],codemirrorMode:`yaml`,codemirrorMimeType:`text/x-yaml`,parsers:[`yaml`],vscodeLanguageIds:[`yaml`,`ansible`,`dockercompose`,`github-actions-workflow`,`home-assistant`],linguistLanguageId:407}],wh={bracketSpacing:lh.bracketSpacing,singleQuote:lh.singleQuote,proseWrap:lh.proseWrap};function Th(e){let t=Object.create(null),n=Object.create(null);for(let{importPlugin:r,parsers:i=[],printers:a=[]}of e){let e=async()=>{let e=await r();return Object.assign(t,e.parsers),Object.assign(n,e.printers),e};for(let n of i)t[n]=async()=>(await e()).parsers[n];for(let t of a)n[t]=async()=>(await e()).printers[t]}return{parsers:t,printers:n}}var Eh=Th([{importPlugin:()=>import(`./estree-B-Lhm4Hd.mjs`),printers:[`estree`,`estree-json`]}]),Dh={...uh,...fh,...gh,...yh,...Sh,...wh},Oh=[...ch,...dh,...ph,...mh,..._h,...bh,...xh,...Ch],{parsers:kh,printers:Ah}=Th([{importPlugin:()=>import(`./acorn-e8W_D2c_.mjs`),parsers:[`acorn`,`espree`]},{importPlugin:()=>import(`./angular-hFYH82G-.mjs`),parsers:[`__ng_action`,`__ng_binding`,`__ng_interpolation`,`__ng_directive`]},{importPlugin:()=>import(`./babel-fr_lL9to.mjs`),parsers:[`babel`,`babel-flow`,`babel-ts`,`__js_expression`,`__ts_expression`,`__vue_expression`,`__vue_ts_expression`,`__vue_event_binding`,`__vue_ts_event_binding`,`__babel_estree`,`json`,`json5`,`jsonc`,`json-stringify`]},{importPlugin:()=>import(`./flow-BRS1FfP1.mjs`),parsers:[`flow`]},{importPlugin:()=>import(`./glimmer-BtFpvZhb.mjs`),parsers:[`glimmer`],printers:[`glimmer`]},{importPlugin:()=>import(`./graphql-kQVq9UYo.mjs`),parsers:[`graphql`],printers:[`graphql`]},{importPlugin:()=>import(`./html-CIcRoqWL.mjs`),parsers:[`html`,`angular`,`vue`,`lwc`,`mjml`],printers:[`html`]},{importPlugin:()=>import(`./markdown-uvG4mxr8.mjs`),parsers:[`markdown`,`mdx`,`remark`],printers:[`mdast`]},{importPlugin:()=>import(`./meriyah-DyP35pNK.mjs`),parsers:[`meriyah`]},{importPlugin:()=>import(`./postcss-CbFXTw98.mjs`),parsers:[`css`,`less`,`scss`],printers:[`postcss`]},{importPlugin:()=>import(`./typescript-BDVDge_O.mjs`),parsers:[`typescript`]},{importPlugin:()=>import(`./yaml-BNfwk1xa.mjs`),parsers:[`yaml`],printers:[`yaml`]}]),jh=[Eh,{options:Dh,languages:Oh,parsers:kh,printers:Ah}];function Mh(){return jh}var Nh=Mh;function Ph(e,t){return $u(e,g.join(t,`noop.js`))}var Fh=Ph;async function Ih(e,t){if(es(e))return import(e);if(g.isAbsolute(e))return import(m(e).href);try{return await import(m(g.resolve(e)).href)}catch{return Fh(e,t)}}async function Lh(e,t){let n=await Ih(e,t),r=n.default??n;return{name:es(e)?ts(e):e,...r}}var Rh=new Map;function zh(e){if(typeof e!=`string`&&!(e instanceof URL))return e;let t=process.cwd(),n=JSON.stringify({name:e,cwd:t});return Rh.has(n)||Rh.set(n,Lh(e,t)),Rh.get(n)}function Bh(){Rh.clear()}function Vh(e=[]){return Promise.all(e.map(e=>zh(e)))}var Hh=Vh,Uh=Gr(ja(),1),Wh=g.sep===`\\`?e=>Cd(0,e,`\\`,`/`):e=>e;function Gh(e,t){let n=ts(t),r=es(e)?f.fileURLToPath(e):g.resolve(e);return g.relative(n?g.dirname(n):process.cwd(),r)}async function Kh(e,t){let n=``;if(e&&(n+=await cl(e)??``),t||(n+=`
243
+ node_modules`),!n)return;let r=(0,Uh.default)({allowRelativePaths:!0}).add(n);return t=>r.checkIgnore(Wh(Gh(t,e))).ignored}async function qh(e,t){e.length===0&&!t&&(e=[void 0]);let n=(await Promise.all(e.map(e=>Kh(e,t)))).filter(Boolean);return e=>n.some(t=>t(e))}async function Jh(e,t){let{ignorePath:n,withNodeModules:r}=t;return(await qh(n,r))(e)}function Yh(e,t){return t=new Set(t),Object.fromEntries(Object.entries(e).filter(([e])=>!t.has(e)))}var Xh=Yh;async function Zh(e,t={}){if(typeof e!=`string`&&!(e instanceof URL))throw TypeError(`expect \`file\` to be a string or URL, got \`${typeof e}\``);let{ignorePath:n,withNodeModules:r}=t;Array.isArray(n)||(n=[n]);let i=await Jh(e,{ignorePath:n,withNodeModules:r}),a;return i||(a=t.parser??await Qh(e,t)),{ignored:i,inferredParser:a??null}}async function Qh(e,t){let n;if(t.resolveConfig!==!1&&(n=await gd(e,{editorconfig:!1})),n?.parser)return n.parser;let r=t.plugins??n?.plugins??[];return r=(await Promise.all([Nh(),Hh(r)])).flat(),wp({plugins:r},{physicalFile:e})}var $h=Zh,eg=`3.8.3`,tg={};Ur(tg,{addDanglingComment:()=>If,addLeadingComment:()=>Ff,addTrailingComment:()=>Lf,getAlignmentSize:()=>ff,getIndentSize:()=>dg,getMaxContinuousCount:()=>mg,getNextNonSpaceNonCommentCharacter:()=>gg,getNextNonSpaceNonCommentCharacterIndex:()=>Ag,getPreferredQuote:()=>wg,getStringWidth:()=>uf,hasNewline:()=>Tf,hasNewlineInRange:()=>Eg,hasSpaces:()=>Og,isNextLineEmpty:()=>Fg,isNextLineEmptyAfterIndex:()=>lg,isPreviousLineEmpty:()=>Mg,makeString:()=>Pg,skip:()=>gf,skipEverythingButNewLine:()=>bf,skipInlineComment:()=>rg,skipNewline:()=>Cf,skipSpaces:()=>vf,skipToLineEnd:()=>yf,skipTrailingComment:()=>ag,skipWhitespace:()=>_f});function ng(e,t){if(t===!1)return!1;if(e.charAt(t)===`/`&&e.charAt(t+1)===`*`){for(let n=t+2;n<e.length;++n)if(e.charAt(n)===`*`&&e.charAt(n+1)===`/`)return n+2}return t}var rg=ng;function ig(e,t){return t===!1?!1:e.charAt(t)===`/`&&e.charAt(t+1)===`/`?bf(e,t):t}var ag=ig;function og(e,t){let n=null,r=t;for(;r!==n;)n=r,r=vf(e,r),r=rg(e,r),r=ag(e,r),r=Cf(e,r);return r}var sg=og;function cg(e,t){let n=null,r=t;for(;r!==n;)n=r,r=yf(e,r),r=rg(e,r),r=vf(e,r);return r=ag(e,r),r=Cf(e,r),r!==!1&&Tf(e,r)}var lg=cg;function ug(e,t){let n=e.lastIndexOf(`
244
+ `);return n===-1?0:ff(e.slice(n+1).match(/^[\t ]*/u)[0],t)}var dg=ug;function fg(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function pg(e,t){let n=e.matchAll(RegExp(`(?:${fg(t)})+`,`gu`));return n.reduce||(n=[...n]),n.reduce((e,[t])=>Math.max(e,t.length),0)/t.length}var mg=pg;function hg(e,t){let n=sg(e,t);return n===!1?``:e.charAt(n)}var gg=hg,_g=`'`,vg=`"`,yg=Object.freeze({character:_g,codePoint:39}),bg=Object.freeze({character:vg,codePoint:34}),xg=Object.freeze({preferred:yg,alternate:bg}),Sg=Object.freeze({preferred:bg,alternate:yg});function Cg(e,t){let{preferred:n,alternate:r}=t===!0||t===_g?xg:Sg,{length:i}=e,a=0,o=0;for(let t=0;t<i;t++){let i=e.charCodeAt(t);i===n.codePoint?a++:i===r.codePoint&&o++}return(a>o?r:n).character}var wg=Cg;function Tg(e,t,n){for(let r=t;r<n;++r)if(e.charAt(r)===`
245
+ `)return!0;return!1}var Eg=Tg;function Dg(e,t,n={}){return vf(e,n.backwards?t-1:t,n)!==t}var Og=Dg;function kg(e,t,n){return sg(e,n(t))}function Ag(e,t){return arguments.length===2||typeof t==`number`?sg(e,t):kg(...arguments)}function jg(e,t,n){return Jf(e,n(t))}function Mg(e,t){return arguments.length===2||typeof t==`number`?Jf(e,t):jg(...arguments)}function Ng(e,t,n){return lg(e,n(t))}function Pg(e,t,n){let r=t===`"`?`'`:`"`;return t+Cd(0,e,/\\(.)|(["'])/gsu,(e,i,a)=>i===r?i:a===t?`\\`+a:a||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(i)?i:`\\`+i))+t}function Fg(e,t){return arguments.length===2||typeof t==`number`?lg(e,t):Ng(...arguments)}function Ig(e,t=1){return async(...n)=>{let r=n[t]??{},{plugins:i=[]}=r;return n[t]={...r,plugins:(await Promise.all([Nh(),Hh(i)])).flat()},e(...n)}}var Lg=Ig(Jm);async function Rg(e,t){let{formatted:n}=await Lg(e,{...t,cursorOffset:-1});return n}async function zg(e,t){return await Rg(e,t)===e}async function Bg(){pd(),Bh()}var Vg=Ig(lp,0),Hg=Ig((e,t)=>wp(t,{physicalFile:e})),Ug={errors:Ho,optionCategories:eh,createIsIgnoredFunction:qh,formatOptionsHiddenDefaults:am,normalizeOptions:kp,getSupportInfoWithoutPlugins:lp,normalizeOptionSettings:dp,inferParser:(e,t)=>Promise.resolve(t?.parser??Hg(e,t)),vnopts:{ChoiceSchema:No,apiDescriptor:Ya},fastGlob:Ua.default,createTwoFilesPatch:Va,picocolors:Ja.default,closetLevenshteinMatch:qa,utilities:{omit:Xh,createMockable:qo}},Wg={parse:Ig(Ym),formatAST:Ig(Xm),formatDoc:Ig(Zm),printToDoc:Ig(Qm),printDocToString:Ig($m),mockable:Jo},Gg=class{static serializeOutput=async(e,t,n=`ExtractedApiDocument`,r={})=>t===`js`?Ma.format(`export default ${JSON.stringify(e,null,2)}`,{parser:`babel`,semi:!1,singleQuote:!0}):t===`ts`?Ma.format(Ot.generateModule(e,n,r),{parser:`typescript`,semi:!1,singleQuote:!0}):JSON.stringify(e,null,t===`json`?0:2);static buildFilePath=(e,t,n,r)=>{let a={pretty:`txt`,json:`json`,js:`js`,ts:`ts`}[r],o=this.toSafeSourceName(t),s=n===`openapi`?`.openapi`:``;return i.join(e,`output`,`${o||`output`}${s}.${a}`)};static buildArtifactDirectory=(e,t,n)=>{let r=this.toSafeSourceName(t);return i.join(e,`output`,`${r||n}.${n}`)};static toSafeSourceName(e){return e.replace(/[^a-zA-Z0-9_-]+/g,`_`).replace(/^_+|_+$/g,``)}static getRootTypeName=e=>e===`openapi`?`ExtractedApiDocument`:`ExtractedPayload`},Kg=class e{static publishedPackageVersionRanges=new Map;typeBuilder=new Dt;typeScriptGenerator=new Ot;generate(e,t={}){let n=t.outputMode??`both`,r=t.signatureStyle??`grouped`,i=t.rootTypeName??`ExtractedApiDocument`,a=t.schemaModule??this.typeScriptGenerator.generateModule(e,i,t),o=this.createOperationTypeRefs(e),s=this.typeBuilder.buildSdkManifest(e,o,t),c=s.groups.map(e=>e.className),l={"package.json":this.renderPackageJson(t),"README.md":this.renderReadme(s,t,n,r),"src/Schema.ts":a,"src/index.ts":this.renderIndexFile(c,n,i,s),"tsconfig.json":this.renderTsconfig(),"tsdown.config.ts":this.renderTsdownConfig(),"vitest.config.ts":this.renderVitestConfig(),"tests/exports.test.ts":this.renderExportsTest(i,n)};if(n!==`runtime`){l[`src/BaseApi.ts`]=this.renderBaseApi(),l[`src/ApiBinder.ts`]=this.renderApiBinder(s);for(let e of s.groups)l[`src/Apis/${e.className}.ts`]=this.renderApiClass(e,r);l[`src/Core.ts`]=this.renderCoreFile()}return l}createOperationTypeRefs(e){let t=this.typeBuilder.createContext(),n=new Map;for(let r of this.typeBuilder.collectSemanticModels(e)){let e=`${r.path}::${r.method}`,i=this.typeBuilder.registerNamedShape(this.typeBuilder.namespaceTopLevelShape(r.shape,r.role),r.name,t,r.collisionSuffix),a=n.get(e)??{response:`Record<string, never>`,responseExample:`unknown`,input:`Record<string, never>`,query:`Record<string, never>`,header:`Record<string, never>`,params:`Record<string, never>`};a[r.role]=i,n.set(e,a)}return n}renderBaseApi(){return[`import { BaseApi as KitBaseApi } from '@oapiex/sdk-kit'`,``,`export class BaseApi extends KitBaseApi {}`].join(`
148
246
  `)}renderApiBinder(e){return[`import { BaseApi } from './BaseApi'`,``,...e.groups.map(e=>`import { ${e.className} } from './Apis/${e.className}'`),``,`export class ApiBinder extends BaseApi {`,...e.groups.map(e=>` ${e.propertyName}!: ${e.className}`),``,` protected override boot () {`,...e.groups.map(e=>` this.${e.propertyName} = new ${e.className}(this.core)`),` }`,`}`].join(`
149
247
  `)}renderApiClass(e,t){let n=this.createTypeImportContext(e,t),r=[`import { BaseApi } from '../BaseApi'`,`import { Http } from '@oapiex/sdk-kit'`];return n.specifiers.length>0&&r.splice(1,0,`import type { ${n.specifiers.join(`, `)} } from '../Schema'`),[...r,``,`export class ${e.className} extends BaseApi {`,``,...e.operations.flatMap(e=>[this.renderApiMethod(e,t,n.aliasMap),``]).slice(0,-1),`}`].join(`
150
248
  `)}renderApiMethod(e,t,n){let r=t===`flat`?this.renderFlatSignature(e,n):this.renderGroupedSignature(e,n),i=t===`flat`?this.renderFlatObjectLiteral(e.paramsType,e.pathParams):e.pathParams.length>0?`params`:`{}`,a=t===`flat`?this.renderFlatObjectLiteral(e.queryType,e.queryParams):e.queryParams.length>0?`query`:`{}`,o=t===`flat`?this.renderFlatHeaders(e):e.headerParams.length>0?`((headers ? { ...headers } : {}) as Record<string, string | undefined>)`:`{}`,s=t===`flat`?e.hasBody?`body`:`{}`:e.hasBody?`body ?? {}`:`{}`,c=this.renderMethodDocComment(e,t,n);return[...c?[c]:[],` async ${e.methodName} ${r}: Promise<${this.rewriteTypeReference(e.responseType,n)}> {`,` await this.core.validateAccess()`,``,` const { data } = await Http.send<${this.rewriteTypeReference(e.responseType,n)}>(`,` this.core.builder.buildTargetUrl('${e.path}', ${i}, ${a}),`,` '${e.method}',`,` ${s},`,` ${o}`,` )`,``,` return data`,` }`].join(`
151
249
  `)}renderMethodDocComment(e,t,n){let r=[],i=e.summary?.trim(),a=e.description?.trim(),o=e.operationId?.trim(),s=this.rewriteTypeReference(e.responseType,n),c=e.responseDescription?.trim();i&&r.push(i),a&&a!==i&&(r.length>0&&r.push(``),r.push(...this.wrapDocText(a)));let l=[`HTTP ${e.method} ${e.path}`,...o?[`Operation ID: ${o}`]:[]];l.length>0&&(r.length>0&&r.push(``),r.push(...l));let u=t===`flat`?this.renderFlatParameterDocs(e,n):this.renderGroupedParameterDocs(e,n);return u.length>0&&(r.length>0&&r.push(``),r.push(...u)),r.push(`@returns ${c?`${c} `:``}${s}`.trim()),[` /**`,...r.map(e=>e?` * ${e}`:` *`),` */`].join(`
152
250
  `)}renderGroupedParameterDocs(e,t){let n=[];return e.pathParams.length>0&&n.push(this.renderParamDoc(`params`,e.paramsType,t,this.describeParameterGroup(e.pathParams,`path parameters`))),e.queryParams.length>0&&n.push(this.renderParamDoc(`query`,e.queryType,t,this.describeParameterGroup(e.queryParams,`query parameters`))),e.hasBody&&n.push(this.renderParamDoc(`body`,e.inputType,t,e.requestBodyDescription?.trim()||`Request body`)),e.headerParams.length>0&&n.push(this.renderParamDoc(`headers`,e.headerType,t,this.describeParameterGroup(e.headerParams,`request headers`))),n}renderFlatParameterDocs(e,t){return[...e.pathParams.map(n=>this.renderParamDoc(n.accessor,`${e.paramsType}[${JSON.stringify(n.name)}]`,t,n.description?.trim()||`Path parameter ${n.name}`)),...e.queryParams.map(n=>this.renderParamDoc(n.accessor,`${e.queryType}[${JSON.stringify(n.name)}]`,t,n.description?.trim()||`Query parameter ${n.name}`)),...e.hasBody?[this.renderParamDoc(`body`,e.inputType,t,e.requestBodyDescription?.trim()||`Request body`)]:[],...e.headerParams.map(n=>this.renderParamDoc(n.accessor,`${e.headerType}[${JSON.stringify(n.name)}]`,t,n.description?.trim()||`Header ${n.name}`))]}renderParamDoc(e,t,n,r){return`@param ${e} ${r} Type: ${this.rewriteTypeReference(t,n)}`}describeParameterGroup(e,t){let n=e.map(e=>e.description?.trim()?`${e.name}: ${e.description.trim()}`:e.name).filter(Boolean);return n.length===0?t:n.join(`; `)}wrapDocText(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)}renderGroupedSignature(e,t){let n=[];return e.pathParams.length>0&&n.push(`params: ${this.rewriteTypeReference(e.paramsType,t)}`),e.queryParams.length>0&&n.push(`query: ${this.rewriteTypeReference(e.queryType,t)}`),e.hasBody&&n.push(`body${e.bodyRequired?``:`?`}: ${this.rewriteTypeReference(e.inputType,t)}`),e.headerParams.length>0&&n.push(`headers?: ${this.rewriteTypeReference(e.headerType,t)}`),`(${n.join(`, `)})`}renderFlatSignature(e,t){return`(${[...e.pathParams.map(n=>`${n.accessor}${n.required?``:`?`}: ${this.rewriteTypeReference(e.paramsType,t)}[${JSON.stringify(n.name)}]`),...e.queryParams.map(n=>`${n.accessor}${n.required?``:`?`}: ${this.rewriteTypeReference(e.queryType,t)}[${JSON.stringify(n.name)}]`),...e.hasBody?[`body${e.bodyRequired?``:`?`}: ${this.rewriteTypeReference(e.inputType,t)}`]:[],...e.headerParams.map(n=>`${n.accessor}${n.required?``:`?`}: ${this.rewriteTypeReference(e.headerType,t)}[${JSON.stringify(n.name)}]`)].join(`, `)})`}createTypeImportContext(e,t){let n=new Set;for(let t of e.operations)n.add(t.responseType),t.hasBody&&n.add(t.inputType),t.queryParams.length>0&&n.add(t.queryType),t.headerParams.length>0&&n.add(t.headerType),t.pathParams.length>0&&n.add(t.paramsType);let r=Array.from(new Set(Array.from(n).flatMap(e=>this.collectTypeIdentifiers(e)))).sort(),i=new Map;return{specifiers:r.map(t=>{if(t===e.className){let e=`${t}Model`;return i.set(t,e),`${t} as ${e}`}return t}),aliasMap:i}}rewriteTypeReference(e,t){let n=e;for(let[e,r]of t.entries())n=n.replace(RegExp(`\\b${e}\\b`,`g`),r);return n}renderFlatObjectLiteral(e,t){return t.length===0?`{}`:`{ ${t.map(e=>`${JSON.stringify(e.name)}: ${e.accessor}`).join(`, `)} }`}renderFlatHeaders(e){return e.headerParams.length===0?`{}`:`({ ${e.headerParams.map(e=>`${JSON.stringify(e.name)}: ${e.accessor}`).join(`, `)} } as Record<string, string | undefined>)`}renderCoreFile(){return[`import { Core as KitCore } from '@oapiex/sdk-kit'`,``,`import { ApiBinder } from './ApiBinder'`,``,`export class Core extends KitCore {`,` static override apiClass = ApiBinder`,``,` declare api: ApiBinder`,`}`].join(`
153
- `)}renderPackageJson(e){let t=e.sdkKitPackageName??`@oapiex/sdk-kit`;return JSON.stringify({name:e.packageName??`generated-sdk`,type:`module`,version:e.packageVersion??`0.1.0`,private:!0,description:e.packageDescription??`Generated SDK scaffold emitted by oapiex.`,main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,exports:{".":{import:`./dist/index.js`,require:`./dist/index.cjs`},"./package.json":`./package.json`},files:[`dist`],scripts:{test:`pnpm vitest --run`,"test:watch":`pnpm vitest`,build:`tsdown`},dependencies:{"@h3ravel/shared":this.resolvePublishedPackageVersionRange(`@h3ravel/shared`),[t]:this.resolvePublishedPackageVersionRange(t)},devDependencies:{"@types/node":`^20.14.5`,tsdown:`^0.20.1`,typescript:`^5.4.5`,vitest:`^3.2.4`}},null,2)}resolvePublishedPackageVersionRange(t){let n=e.publishedPackageVersionRanges.get(t);if(n)return n;try{let n=JSON.parse(u(`npm`,[`view`,t,`version`,`--json`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}));if(typeof n==`string`&&n.trim().length>0){let r=`^${n.trim()}`;return e.publishedPackageVersionRanges.set(t,r),r}}catch{e.publishedPackageVersionRanges.set(t,`latest`)}return`latest`}renderReadme(e,t,n,r){let i=t.packageName??`generated-sdk`,a=`# ${i}`,o=this.renderReadmeDescription(n),s=this.renderReadmeUsage(e,i,n,r),c=this.renderReadmeExports(n,e);return[a,``,o,``,`## Install`,``,"```bash",`pnpm add ${i}`,"```",``,`## Quick Start`,``,"```ts",s,"```",``,`## Main Exports`,``,...c.map(e=>`- ${e}`),``,`## Commands`,``,"```bash",`pnpm test`,`pnpm build`,"```"].join(`
251
+ `)}renderPackageJson(e){let t=e.sdkKitPackageName??`@oapiex/sdk-kit`;return JSON.stringify({name:e.packageName??`generated-sdk`,type:`module`,version:e.packageVersion??`0.1.0`,private:!0,description:e.packageDescription??`Generated SDK scaffold emitted by oapiex.`,main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,exports:{".":{import:`./dist/index.js`,require:`./dist/index.cjs`},"./package.json":`./package.json`},files:[`dist`],scripts:{test:`pnpm vitest --run`,"test:watch":`pnpm vitest`,build:`tsdown`},dependencies:{"@h3ravel/shared":this.resolvePublishedPackageVersionRange(`@h3ravel/shared`),[t]:this.resolvePublishedPackageVersionRange(t)},devDependencies:{"@types/node":`^20.14.5`,tsdown:`^0.20.1`,typescript:`^5.4.5`,vitest:`^3.2.4`}},null,2)}resolvePublishedPackageVersionRange(t){let n=e.publishedPackageVersionRanges.get(t);if(n)return n;try{let n=JSON.parse(A(`npm`,[`view`,t,`version`,`--json`],{encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}));if(typeof n==`string`&&n.trim().length>0){let r=`^${n.trim()}`;return e.publishedPackageVersionRanges.set(t,r),r}}catch{e.publishedPackageVersionRanges.set(t,`latest`)}return`latest`}renderReadme(e,t,n,r){let i=t.packageName??`generated-sdk`,a=`# ${i}`,o=this.renderReadmeDescription(n),s=this.renderReadmeUsage(e,i,n,r),c=this.renderReadmeExports(n,e);return[a,``,o,``,`## Install`,``,"```bash",`pnpm add ${i}`,"```",``,`## Quick Start`,``,"```ts",s,"```",``,`## Main Exports`,``,...c.map(e=>`- ${e}`),``,`## Commands`,``,"```bash",`pnpm test`,`pnpm build`,"```"].join(`
154
252
  `)}renderReadmeDescription(e){return e===`runtime`?`Generated runtime-first TypeScript SDK emitted by oapiex.`:e===`classes`?`Generated class-based TypeScript SDK emitted by oapiex.`:`Generated TypeScript SDK emitted by oapiex with both class-based and runtime-first entrypoints.`}renderReadmeUsage(e,t,n,r){let i=this.pickExampleOperation(e),a=this.renderReadmeClientSnippet(t,`runtime`,r,i);if(n===`runtime`)return a;let o=this.renderReadmeClientSnippet(t,`classes`,r,i);if(n===`classes`)return o;let s=i?this.collectReadmeTypeImports(i.operation):[],c=[`Core`,`createClient`,...i?this.collectReadmeAuthHelperImports(i):[]];return[s.length>0?`import { ${c.join(`, `)}, type ${s.join(`, type `)} } from '${t}'`:`import { ${c.join(`, `)} } from '${t}'`,``,...this.renderReadmeClientBody(`sdk`,`classes`,r,i),``,`// --- OR ---`,``,...this.renderReadmeClientBody(`runtimeSdk`,`runtime`,r,i)].join(`
155
253
  `)}renderReadmeClientSnippet(e,t,n,r){let i=t===`runtime`?[`createClient`]:[`Core`],a=r?this.collectReadmeTypeImports(r.operation):[],o=r?this.collectReadmeAuthHelperImports(r):[],s=[...i,...o],c=a.length>0?`import { ${s.join(`, `)}, type ${a.join(`, type `)} } from '${e}'`:`import { ${s.join(`, `)} } from '${e}'`,l=t===`runtime`?`runtimeSdk`:`sdk`;return[c,``,...this.renderReadmeClientBody(l,t,n,r)].join(`
156
254
  `)}renderReadmeClientBody(e,t,n,r){let i=t===`runtime`?`const ${e} = createClient({`:`const ${e} = new Core({`,a=r?this.renderReadmeOperationCall(e,r,t===`runtime`?`grouped`:n):[];return[i,` clientId: process.env.CLIENT_ID!,`,` clientSecret: process.env.CLIENT_SECRET!,`,` environment: 'sandbox',`,...r?this.renderReadmeAuthLines(r.operation.security??r.groupSecurity??r.globalSecurity):[],`})`,...a.length>0?[``,...a]:[]]}renderReadmeExports(e,t){let n=t.securitySchemes.length>0?[`generated auth helpers derived from OpenAPI security schemes`]:[];return e===`runtime`?["`createClient()` for a typed runtime SDK instance",...n,"`Schema` exports for request, response, params, query, and header types"]:e===`classes`?["`Core` as the class-based SDK entrypoint",...n,"generated API classes plus `Schema` type exports"]:["`Core` for class-based usage","`createClient()` for runtime-first usage",...n,"`Schema` exports for generated request, response, params, query, and header types"]}pickExampleOperation(e){let t=e.groups[0],n=t?.operations[0];return!t||!n?null:{group:t,operation:n,groupSecurity:void 0,globalSecurity:e.security}}renderReadmeAuthLines(e){if(!e||e.length===0)return[];let t=e[0];if(!t||t.schemes.length===0)return[];let n=t.schemes.length===1?this.renderReadmeAuthFactoryCall(t.schemes[0].name):`[
@@ -158,9 +256,9 @@ import{JSDOM as e}from"jsdom";import{Window as t}from"happy-dom";import n from"a
158
256
  `)}
159
257
  ]`,r=e.length>1?[` // Choose a generated auth helper that matches your API access setup.`]:[];return r.push(` auth: ${n},`),r}renderReadmeAuthFactoryCall(e){let t=this.createSecurityHelperName(e),n=this.toConstantCase(e);return/basic/i.test(e)?`${t}(process.env.${n}_USERNAME!, process.env.${n}_PASSWORD!)`:`${t}(process.env.${n}_VALUE!)`}collectReadmeAuthHelperImports(e){let t=(e.operation.security??e.groupSecurity??e.globalSecurity)?.[0];return t?t.schemes.map(e=>this.createSecurityHelperName(e.name)):[]}collectReadmeTypeImports(e){let t=new Set;return e.pathParams.length>0&&t.add(e.paramsType),e.queryParams.length>0&&t.add(e.queryType),e.hasBody&&t.add(e.inputType),e.headerParams.length>0&&t.add(e.headerType),Array.from(t).sort()}renderReadmeOperationCall(e,t,n){let{group:r,operation:i}=t,a=n===`flat`?this.renderReadmeFlatArgs(i):this.renderReadmeGroupedArgs(i);return[`await ${e}.api.${r.propertyName}.${i.methodName}(`,...a.map(e=>` ${e},`),`)`]}renderReadmeGroupedArgs(e){let t=[];return e.pathParams.length>0&&t.push(`{} as ${e.paramsType}`),e.queryParams.length>0&&t.push(`{} as ${e.queryType}`),e.hasBody&&t.push(`{} as ${e.inputType}`),e.headerParams.length>0&&t.push(`{} as ${e.headerType}`),t}renderReadmeFlatArgs(e){return[...e.pathParams.map(t=>`{} as ${e.paramsType}[${JSON.stringify(t.name)}]`),...e.queryParams.map(t=>`{} as ${e.queryType}[${JSON.stringify(t.name)}]`),...e.hasBody?[`{} as ${e.inputType}`]:[],...e.headerParams.map(t=>`{} as ${e.headerType}[${JSON.stringify(t.name)}]`)]}renderTsconfig(){return JSON.stringify({compilerOptions:{rootDir:`.`,outDir:`./dist`,target:`esnext`,module:`es2022`,moduleResolution:`bundler`,esModuleInterop:!0,strict:!0,allowJs:!0,skipLibCheck:!0,resolveJsonModule:!0},include:[`./src/**/*`,`./tests/**/*`],exclude:[`./dist`,`./node_modules`]},null,2)}renderTsdownConfig(){return[`import { defineConfig } from 'tsdown'`,``,`export default defineConfig({`,` entry: {`,` index: 'src/index.ts',`,` },`,` exports: true,`,` format: ['esm', 'cjs'],`,` outDir: 'dist',`,` dts: true,`,` sourcemap: false,`,` external: ['@oapiex/sdk-kit'],`,` clean: true,`,`})`].join(`
160
258
  `)}renderVitestConfig(){return[`import { defineConfig } from 'vitest/config'`,``,`export default defineConfig({`,` test: {`,` name: 'generated-sdk',`,` environment: 'node',`,` include: ['tests/*.{test,spec}.?(c|m)[jt]s?(x)'],`,` },`,`})`].join(`
161
- `)}renderExportsTest(e,t){let n=`${e.charAt(0).toLowerCase()}${e.slice(1)}`,r=[` expect(sdk.createClient).toBeTypeOf('function')`,` expect(sdk.createSdk).toBeTypeOf('function')`,` expect(sdk.${n}Sdk).toBeDefined()`,` expect(sdk.${n}Manifest).toBeDefined()`];return t!==`runtime`&&(r.unshift(` expect(sdk.Core).toBeTypeOf('function')`),r.unshift(` expect(sdk.BaseApi).toBeTypeOf('function')`)),[`import { describe, expect, it } from 'vitest'`,``,`import * as sdk from '../src/index'`,``,`describe('generated sdk exports', () => {`,` it('exposes the generated schema and runtime helpers', () => {`,...r,` })`,`})`].join(`
162
- `)}renderIndexFile(e,t,n,r){let i=`${n.charAt(0).toLowerCase()}${n.slice(1)}`,a=[`import type { ${n}Api } from './Schema'`,`import { ${i}Manifest, ${i}Sdk } from './Schema'`,`import { createSdk as createBoundSdk } from '@oapiex/sdk-kit'`,`import type { AuthConfig, BaseApi as KitBaseApi, Core as KitCore, InitOptions } from '@oapiex/sdk-kit'`,``,`export * from './Schema'`];if(t!==`runtime`&&(a.push(`export { ApiBinder } from './ApiBinder'`),a.push(`export { BaseApi } from './BaseApi'`),a.push(...e.map(e=>`export { ${e} as ${e}Api } from './Apis/${e}'`)),a.push(`export { Core } from './Core'`)),a.push(``),a.push(`export const securitySchemes = ${i}Manifest.securitySchemes`),a.push(`export const security = ${i}Manifest.security`),r.securitySchemes.length>0){a.push(``);for(let e of r.securitySchemes)a.push(...this.renderSecurityHelper(e)),a.push(``)}return a.push(`export const createClient = (`),a.push(` options: InitOptions`),a.push(`): KitCore & { api: KitBaseApi & ${n}Api } =>`),a.push(` createBoundSdk(${i}Sdk, options) as KitCore & { api: KitBaseApi & ${n}Api }`),a.push(``),a.push(`export {`),a.push(` BadRequestException,`),a.push(` Builder,`),a.push(` ForbiddenRequestException,`),a.push(` Http,`),a.push(` HttpException,`),a.push(` UnauthorizedRequestException,`),a.push(` WebhookValidator,`),a.push(` createSdk,`),a.push(`} from '@oapiex/sdk-kit'`),a.push(``),a.push(`export type {`),a.push(` AuthConfig,`),a.push(` InitOptions,`),a.push(` UnifiedResponse,`),a.push(` XGenericObject,`),a.push(`} from '@oapiex/sdk-kit'`),a.join(`
163
- `)}collectTypeIdentifiers(e){return Array.from(new Set((e.match(/\b[A-Z][A-Za-z0-9_]*/g)??[]).filter(e=>![`Record`,`Promise`].includes(e))))}renderSecurityHelper(e){return e.authType===`basic`?[`export const ${e.helperName} = (username: string, password: string): AuthConfig => ({`,` type: 'basic',`,` username,`,` password,`,`})`]:e.authType===`apiKey`?[`export const ${e.helperName} = (value: string): AuthConfig => ({`,` type: 'apiKey',`,` name: ${JSON.stringify(e.parameterName??e.name)},`,` value,`,` in: ${JSON.stringify(e.in??`header`)},`,`})`]:e.authType===`oauth2`?[`export const ${e.helperName} = (accessToken: string, tokenType = 'Bearer'): AuthConfig => ({`,` type: 'oauth2',`,` accessToken,`,` tokenType,`,`})`]:[`export const ${e.helperName} = (token: string): AuthConfig => ({`,` type: 'bearer',`,` token,`,...e.scheme&&e.scheme.toLowerCase()!==`bearer`?[` prefix: ${JSON.stringify(this.normalizeHttpAuthPrefix(e.scheme))},`]:[],`})`]}createSecurityHelperName(e){let t=this.typeBuilder.sanitizeTypeName(e);return t.endsWith(`Auth`)?`create${t}`:`create${t}Auth`}normalizeHttpAuthPrefix(e){return e.charAt(0).toUpperCase()+e.slice(1)}toConstantCase(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).replace(/[^A-Za-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).toUpperCase()||`AUTH`}};const $=new class{createDocument(e,t=`Extracted API`,n=`0.0.0`){let r={};for(let t of e){let e=this.transformOperation(t);!e||this.shouldSkipNormalizedOperation(e)||(r[e.path]??={},r[e.path][e.method]=e.operation)}return{openapi:`3.1.0`,info:{title:t,version:n},paths:r}}transformOperation(e){if(!e.method||!e.url)return null;let t=new URL(e.url);if(this.shouldSkipPlaceholderOperation(t,e))return null;let n=e.method.toLowerCase(),r=this.decodeOpenApiPathname(t.pathname);return{path:r,method:n,operation:{summary:e.sidebarLinks.find(e=>e.active)?.label,description:e.description??void 0,operationId:this.buildOperationId(n,r),parameters:this.createParameters(e.requestParams),requestBody:this.createRequestBody(e.requestParams,e.requestExampleNormalized?.body,this.hasExtractedBodyParams(e.requestParams)?null:this.resolveFallbackRequestBodyExample(e)),responses:this.createResponses(e.responseSchemas,e.responseBodies)}}}shouldSkipNormalizedOperation(e){return e.path===`/`&&e.method===`get`&&e.operation.operationId===`get`&&Object.keys(e.operation.responses).length===0}shouldSkipPlaceholderOperation(e,t){return e.hostname!==`example.com`||e.pathname!==`/`?!1:t.requestParams.length===0&&t.responseSchemas.length===0&&t.responseBodies.length===0&&t.requestExampleNormalized?.url===`https://example.com/`}decodeOpenApiPathname(e){return e.split(`/`).map(e=>{if(!e)return e;try{return decodeURIComponent(e)}catch{return e}}).join(`/`)}hasExtractedBodyParams(e){return e.some(e=>e.in===`body`||e.in===null)}createParameters(e){let t=e.filter(e=>this.isOpenApiParameterLocation(e.in)).map(e=>this.createParameter(e));return t.length>0?t:void 0}createRequestBody(e,t,n){let r=e.filter(e=>e.in===`body`||e.in===null);if(r.length===0&&t==null)return;let i=this.buildRequestBodySchema(r,t,n);return{required:r.length>0?r.some(e=>e.required):!1,content:{"application/json":{schema:i,...t==null?{}:{example:t}}}}}buildRequestBodySchema(e,t,n){let r=this.mergeOpenApiSchemas(this.createExampleSchema(t),this.createExampleSchema(n))??{type:`object`};t==null?n!=null&&(r.example=n):r.example=t;for(let t of e)this.insertRequestBodyParam(r,t);return r}inferSchemaFromExample(e){if(Array.isArray(e))return{type:`array`,items:this.inferSchemaFromExample(e[0])??{},example:e};if(I(e))return{type:`object`,properties:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this.inferSchemaFromExample(t)??{}])),example:e};if(typeof e==`string`)return{type:`string`,example:e};if(typeof e==`number`)return{type:Number.isInteger(e)?`integer`:`number`,example:e};if(typeof e==`boolean`)return{type:`boolean`,example:e};if(e===null)return{}}insertRequestBodyParam(e,t){let n=t.path.length>0?t.path:[t.name],r=e;for(let[e,i]of n.slice(0,-1).entries())r.properties??={},r.properties[i]??={type:`object`},t.required&&(r.required=Array.from(new Set([...r.required??[],i]))),r=r.properties[i],r.type??=`object`,e===n.length-2&&t.required&&(r.required??=[]);let i=n[n.length-1]??t.name;r.properties??={},r.properties[i]=this.createParameterSchema(t),t.required&&(r.required=Array.from(new Set([...r.required??[],i])))}createParameter(e){return{name:e.name,in:e.in,required:e.in===`path`?!0:e.required,description:e.description??void 0,schema:this.createParameterSchema(e),example:e.defaultValue??void 0}}createParameterSchema(e){return{type:e.type??void 0,description:e.description??void 0,default:e.defaultValue??void 0}}createResponses(e,t){let n={};for(let r of e){if(!r.statusCode)continue;let e=t.filter(e=>e.statusCode===r.statusCode),i=this.createResponseContent(e);n[r.statusCode]={description:r.description??r.statusCode,...i?{content:i}:{}}}for(let e of t){if(!e.statusCode||n[e.statusCode])continue;let t=this.createResponseContent([e]);n[e.statusCode]={description:e.label??e.statusCode,...t?{content:t}:{}}}return n}createResponseContent(e){if(e.length===0)return;let t={};for(let n of e){let e=n.contentType??(n.format===`json`?`application/json`:`text/plain`),r=this.normalizeResponseExampleValue(n.body,n.format);t[e]={schema:this.inferSchemaFromBody(r,n.format),example:r}}return t}inferSchemaFromBody(e,t){if(t===`json`)return this.inferSchemaFromExample(e);if(t===`text`)return{type:`string`,example:e}}normalizeResponseExampleValue(e,t){return t!==`json`||typeof e!=`string`?e:F.parsePossiblyTruncated(e)??G(e)??e}resolveFallbackRequestBodyExample(e){return e.responseBodies.find(e=>e.format===`json`)?.body??(typeof e.responseExample==`object`&&e.responseExample!==null?e.responseExample:typeof e.responseExampleRaw==`string`?F.parsePossiblyTruncated(e.responseExampleRaw):typeof e.responseExample==`string`?F.parsePossiblyTruncated(e.responseExample):null)}createExampleSchema(e){return e==null?null:this.inferSchemaFromExample(e)??null}mergeOpenApiSchemas(e,t){if(!e)return t;if(!t)return e;let n={...t,...e,...e.type||t.type?{type:e.type??t.type}:{},...e.description||t.description?{description:e.description??t.description}:{},...e.default!==void 0||t.default!==void 0?{default:e.default??t.default}:{},...e.example!==void 0||t.example!==void 0?{example:e.example??t.example}:{}};if(e.properties||t.properties){let r=new Set([...Object.keys(e.properties??{}),...Object.keys(t.properties??{})]);n.properties=Object.fromEntries(Array.from(r).map(n=>[n,this.mergeOpenApiSchemas(e.properties?.[n]??null,t.properties?.[n]??null)??{}]))}return(e.items||t.items)&&(n.items=this.mergeOpenApiSchemas(e.items??null,t.items??null)??{}),(e.required||t.required)&&(n.required=Array.from(new Set([...t.required??[],...e.required??[]]))),n}buildOperationId(e,t){return`${e}${t.replace(/\{([^}]+)\}/g,`$1`).split(`/`).filter(Boolean).map(e=>e.replace(/[^a-zA-Z0-9]+/g,` `)).map(e=>e.trim()).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).replace(/\s+(.)/g,(e,t)=>t.toUpperCase())).join(``)}`}isOpenApiParameterLocation(e){return e===`query`||e===`header`||e===`path`||e===`cookie`}};var tt=class extends s{signature=`generate
259
+ `)}renderExportsTest(e,t){let n=`${e.charAt(0).toLowerCase()}${e.slice(1)}`,r=[` expect(sdk.createClient).toBeTypeOf('function')`,` expect(sdk.createSdk).toBeTypeOf('function')`,` expect(sdk.setConfigFileBasename).toBeTypeOf('function')`,` expect(sdk.${n}Sdk).toBeDefined()`,` expect(sdk.${n}Manifest).toBeDefined()`];return t!==`runtime`&&(r.unshift(` expect(sdk.Core).toBeTypeOf('function')`),r.unshift(` expect(sdk.BaseApi).toBeTypeOf('function')`)),[`import { describe, expect, it } from 'vitest'`,``,`import * as sdk from '../src/index'`,``,`describe('generated sdk exports', () => {`,` it('exposes the generated schema and runtime helpers', () => {`,...r,` })`,`})`].join(`
260
+ `)}renderIndexFile(e,t,n,r){let i=`${n.charAt(0).toLowerCase()}${n.slice(1)}`,a=[`import type { ${n}Api } from './Schema'`,`import { ${i}Manifest, ${i}Sdk } from './Schema'`,`import { createSdk as createBoundSdk } from '@oapiex/sdk-kit'`,`import type { AuthConfig, BaseApi as KitBaseApi, Core as KitCore, InitOptions } from '@oapiex/sdk-kit'`,``,`export * from './Schema'`];if(t!==`runtime`&&(a.push(`export { ApiBinder } from './ApiBinder'`),a.push(`export { BaseApi } from './BaseApi'`),a.push(...e.map(e=>`export { ${e} as ${e}Api } from './Apis/${e}'`)),a.push(`export { Core } from './Core'`)),a.push(``),a.push(`export const securitySchemes = ${i}Manifest.securitySchemes`),a.push(`export const security = ${i}Manifest.security`),r.securitySchemes.length>0){a.push(``);for(let e of r.securitySchemes)a.push(...this.renderSecurityHelper(e)),a.push(``)}return a.push(`export const createClient = (`),a.push(` options: InitOptions`),a.push(`): KitCore & { api: KitBaseApi & ${n}Api } =>`),a.push(` createBoundSdk(${i}Sdk, options) as KitCore & { api: KitBaseApi & ${n}Api }`),a.push(``),a.push(`export {`),a.push(` BadRequestException,`),a.push(` Builder,`),a.push(` ForbiddenRequestException,`),a.push(` Http,`),a.push(` HttpException,`),a.push(` setConfigFileBasename,`),a.push(` UnauthorizedRequestException,`),a.push(` WebhookValidator,`),a.push(` createSdk,`),a.push(`} from '@oapiex/sdk-kit'`),a.push(``),a.push(`export type {`),a.push(` AuthConfig,`),a.push(` InitOptions,`),a.push(` UnifiedResponse,`),a.push(` XGenericObject,`),a.push(`} from '@oapiex/sdk-kit'`),a.join(`
261
+ `)}collectTypeIdentifiers(e){return Array.from(new Set((e.match(/\b[A-Z][A-Za-z0-9_]*/g)??[]).filter(e=>![`Record`,`Promise`].includes(e))))}renderSecurityHelper(e){return e.authType===`basic`?[`export const ${e.helperName} = (username: string, password: string): AuthConfig => ({`,` type: 'basic',`,` username,`,` password,`,`})`]:e.authType===`apiKey`?[`export const ${e.helperName} = (value: string): AuthConfig => ({`,` type: 'apiKey',`,` name: ${JSON.stringify(e.parameterName??e.name)},`,` value,`,` in: ${JSON.stringify(e.in??`header`)},`,`})`]:e.authType===`oauth2`?[`export const ${e.helperName} = (accessToken: string, tokenType = 'Bearer'): AuthConfig => ({`,` type: 'oauth2',`,` accessToken,`,` tokenType,`,`})`]:[`export const ${e.helperName} = (token: string): AuthConfig => ({`,` type: 'bearer',`,` token,`,...e.scheme&&e.scheme.toLowerCase()!==`bearer`?[` prefix: ${JSON.stringify(this.normalizeHttpAuthPrefix(e.scheme))},`]:[],`})`]}createSecurityHelperName(e){let t=this.typeBuilder.sanitizeTypeName(e);return t.endsWith(`Auth`)?`create${t}`:`create${t}Auth`}normalizeHttpAuthPrefix(e){return e.charAt(0).toUpperCase()+e.slice(1)}toConstantCase(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1_$2`).replace(/[^A-Za-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).toUpperCase()||`AUTH`}};const qg=new class{createDocument(e,t=`Extracted API`,n=`0.0.0`){let r={};for(let t of e){let e=this.transformOperation(t);!e||this.shouldSkipNormalizedOperation(e)||(r[e.path]??={},r[e.path][e.method]=e.operation)}return{openapi:`3.1.0`,info:{title:t,version:n},paths:r}}transformOperation(e){if(!e.method||!e.url)return null;let t=new URL(e.url);if(this.shouldSkipPlaceholderOperation(t,e))return null;let n=e.method.toLowerCase(),r=this.decodeOpenApiPathname(t.pathname);return{path:r,method:n,operation:{summary:e.sidebarLinks.find(e=>e.active)?.label,description:e.description??void 0,operationId:this.buildOperationId(n,r),parameters:this.createParameters(e.requestParams),requestBody:this.createRequestBody(e.requestParams,e.requestExampleNormalized?.body,this.hasExtractedBodyParams(e.requestParams)?null:this.resolveFallbackRequestBodyExample(e)),responses:this.createResponses(e.responseSchemas,e.responseBodies)}}}shouldSkipNormalizedOperation(e){return e.path===`/`&&e.method===`get`&&e.operation.operationId===`get`&&Object.keys(e.operation.responses).length===0}shouldSkipPlaceholderOperation(e,t){return e.hostname!==`example.com`||e.pathname!==`/`?!1:t.requestParams.length===0&&t.responseSchemas.length===0&&t.responseBodies.length===0&&t.requestExampleNormalized?.url===`https://example.com/`}decodeOpenApiPathname(e){return e.split(`/`).map(e=>{if(!e)return e;try{return decodeURIComponent(e)}catch{return e}}).join(`/`)}hasExtractedBodyParams(e){return e.some(e=>e.in===`body`||e.in===null)}createParameters(e){let t=e.filter(e=>this.isOpenApiParameterLocation(e.in)).map(e=>this.createParameter(e));return t.length>0?t:void 0}createRequestBody(e,t,n){let r=e.filter(e=>e.in===`body`||e.in===null);if(r.length===0&&t==null)return;let i=this.buildRequestBodySchema(r,t,n);return{required:r.length>0?r.some(e=>e.required):!1,content:{"application/json":{schema:i,...t==null?{}:{example:t}}}}}buildRequestBodySchema(e,t,n){let r=this.mergeOpenApiSchemas(this.createExampleSchema(t),this.createExampleSchema(n))??{type:`object`};t==null?n!=null&&(r.example=n):r.example=t;for(let t of e)this.insertRequestBodyParam(r,t);return r}inferSchemaFromExample(e){if(Array.isArray(e))return{type:`array`,items:this.inferSchemaFromExample(e[0])??{},example:e};if(Ce(e))return{type:`object`,properties:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,this.inferSchemaFromExample(t)??{}])),example:e};if(typeof e==`string`)return{type:`string`,example:e};if(typeof e==`number`)return{type:Number.isInteger(e)?`integer`:`number`,example:e};if(typeof e==`boolean`)return{type:`boolean`,example:e};if(e===null)return{}}insertRequestBodyParam(e,t){let n=t.path.length>0?t.path:[t.name],r=e;for(let[e,i]of n.slice(0,-1).entries())r.properties??={},r.properties[i]??={type:`object`},t.required&&(r.required=Array.from(new Set([...r.required??[],i]))),r=r.properties[i],r.type??=`object`,e===n.length-2&&t.required&&(r.required??=[]);let i=n[n.length-1]??t.name;r.properties??={},r.properties[i]=this.createParameterSchema(t),t.required&&(r.required=Array.from(new Set([...r.required??[],i])))}createParameter(e){return{name:e.name,in:e.in,required:e.in===`path`?!0:e.required,description:e.description??void 0,schema:this.createParameterSchema(e),example:e.defaultValue??void 0}}createParameterSchema(e){return{type:e.type??void 0,description:e.description??void 0,default:e.defaultValue??void 0}}createResponses(e,t){let n={};for(let r of e){if(!r.statusCode)continue;let e=t.filter(e=>e.statusCode===r.statusCode),i=this.createResponseContent(e);n[r.statusCode]={description:r.description??r.statusCode,...i?{content:i}:{}}}for(let e of t){if(!e.statusCode||n[e.statusCode])continue;let t=this.createResponseContent([e]);n[e.statusCode]={description:e.label??e.statusCode,...t?{content:t}:{}}}return n}createResponseContent(e){if(e.length===0)return;let t={};for(let n of e){let e=n.contentType??(n.format===`json`?`application/json`:`text/plain`),r=this.normalizeResponseExampleValue(n.body,n.format);t[e]={schema:this.inferSchemaFromBody(r,n.format),example:r}}return t}inferSchemaFromBody(e,t){if(t===`json`)return this.inferSchemaFromExample(e);if(t===`text`)return{type:`string`,example:e}}normalizeResponseExampleValue(e,t){return t!==`json`||typeof e!=`string`?e:Se.parsePossiblyTruncated(e)??ft(e)??e}resolveFallbackRequestBodyExample(e){return e.responseBodies.find(e=>e.format===`json`)?.body??(typeof e.responseExample==`object`&&e.responseExample!==null?e.responseExample:typeof e.responseExampleRaw==`string`?Se.parsePossiblyTruncated(e.responseExampleRaw):typeof e.responseExample==`string`?Se.parsePossiblyTruncated(e.responseExample):null)}createExampleSchema(e){return e==null?null:this.inferSchemaFromExample(e)??null}mergeOpenApiSchemas(e,t){if(!e)return t;if(!t)return e;let n={...t,...e,...e.type||t.type?{type:e.type??t.type}:{},...e.description||t.description?{description:e.description??t.description}:{},...e.default!==void 0||t.default!==void 0?{default:e.default??t.default}:{},...e.example!==void 0||t.example!==void 0?{example:e.example??t.example}:{}};if(e.properties||t.properties){let r=new Set([...Object.keys(e.properties??{}),...Object.keys(t.properties??{})]);n.properties=Object.fromEntries(Array.from(r).map(n=>[n,this.mergeOpenApiSchemas(e.properties?.[n]??null,t.properties?.[n]??null)??{}]))}return(e.items||t.items)&&(n.items=this.mergeOpenApiSchemas(e.items??null,t.items??null)??{}),(e.required||t.required)&&(n.required=Array.from(new Set([...t.required??[],...e.required??[]]))),n}buildOperationId(e,t){return`${e}${t.replace(/\{([^}]+)\}/g,`$1`).split(`/`).filter(Boolean).map(e=>e.replace(/[^a-zA-Z0-9]+/g,` `)).map(e=>e.trim()).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).replace(/\s+(.)/g,(e,t)=>t.toUpperCase())).join(``)}`}isOpenApiParameterLocation(e){return e===`query`||e===`header`||e===`path`||e===`cookie`}};var Jg=class extends s{signature=`generate
164
262
  {artifact : Artifact to generate [sdk]}
165
263
  {source? : Documentation URL/local source or parsed TypeScript output file}
166
264
  {--d|dir? : Output directory for the generated artifact}
@@ -174,12 +272,12 @@ import{JSDOM as e}from"jsdom";import{Window as t}from"happy-dom";import n from"a
174
272
  {--t|timeout? : Request/browser timeout in milliseconds}
175
273
  {--c|crawl : Crawl sidebar links and parse every discovered operation}
176
274
  {--b|base-url? : Base URL used to resolve sidebar links when crawling from a local file}
177
- `;description=`Generate artifacts such as SDK packages from documentation sources or parsed TypeScript outputs`;async handle(){let e=this.app.getConfig(),t=String(this.argument(`artifact`,``)).trim().toLowerCase(),n=String(this.argument(`source`,``)).trim(),i=String(this.option(`browser`,e.browser)).trim().toLowerCase(),a=String(this.option(`timeout`,``)).trim(),o=this.option(`crawl`),s=String(this.option(`baseUrl`,``)).trim()||null,c=await this.resolveOutputDirectory(n),l=this.spinner(`Generating ${t} artifact...`).start(),u=!1;try{let d=Date.now();if(!P(i))throw Error(`Unsupported browser: ${i}`);if(t!==`sdk`)throw Error(`Unsupported artifact: ${t}`);if(!n)throw Error(`The sdk artifact requires a source argument`);if(!this.isTypeScriptArtifactSource(n)&&!P(i))throw Error(`Unsupported browser: ${i}`);let f=this.resolveTimeoutOverride(a,e.requestTimeout),p=this.parseNamespaceStrategy(this.option(`namespaceStrategy`,`smart`)),m=this.parseMethodStrategy(this.option(`methodStrategy`,`smart`)),h=this.parseOutputMode(this.option(`outputMode`,`both`)),g=this.parseSignatureStyle(this.option(`signatureStyle`,`grouped`)),_=String(this.option(`rootTypeName`,`ExtractedApiDocument`)).trim()||`ExtractedApiDocument`;this.app.configure({browser:i,requestTimeout:f}),!this.isTypeScriptArtifactSource(n)&&o&&(await j(this.app.getConfig()),u=!0);let v=await this.resolveSdkSource({source:n,crawl:o,baseUrl:s,rootTypeName:_,namespaceStrategy:p,methodStrategy:m}),y=this.resolvePackageName(c),b=new et().generate(v.document,{outputMode:h,signatureStyle:g,rootTypeName:_,namespaceStrategy:p,methodStrategy:m,schemaModule:v.schemaModule,packageName:String(this.option(`name`,``)).trim()||y});await this.writePackageFiles(c,b);let x=Date.now()-d;r.twoColumnDetail(r.log([[`Generated`,`green`],[`${x/1e3}s`,`gray`]],` `,!1),c.replace(process.cwd(),`.`)),l.succeed(`Artifact generation completed`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;l.fail(`Failed to generate artifact: ${t}`),process.exitCode=1}finally{u&&await M()}}async resolveSdkSource(e){if(this.isTypeScriptArtifactSource(e.source))return this.loadSdkSourceFromTypeScriptArtifact(e.source);let t=L(await this.app.loadHtmlSource(e.source,!0)),n=e.crawl?await this.app.crawlReadmeOperations(e.source,t,e.baseUrl):t,r=this.buildOpenApiPayload(n);return{document:r,schemaModule:await l.format(Z.generateModule(r,e.rootTypeName,{namespaceStrategy:e.namespaceStrategy,methodStrategy:e.methodStrategy}),{parser:`typescript`,semi:!1,singleQuote:!0})}}async loadSdkSourceFromTypeScriptArtifact(e){let t=i.resolve(process.cwd(),e),n=await a.readFile(t,`utf8`),r=await import(`${d(t).href}?t=${Date.now()}`),o=r.default??Object.values(r).find(e=>this.isOpenApiDocumentLike(e));if(!this.isOpenApiDocumentLike(o))throw Error(`The provided TypeScript source does not export an OpenAPI document`);return{document:o,schemaModule:n}}buildOpenApiPayload(e){return`operations`in e?$.createDocument(e.operations,`Extracted API`,`0.0.0`):$.createDocument([e],`Extracted API`,`0.0.0`)}resolveTimeoutOverride(e,t){if(!e)return t;let n=Number(e);if(!Number.isFinite(n)||n<=0)throw Error(`Invalid timeout override: ${e}`);return n}async resolveOutputDirectory(e,t){t??=String(this.option(`dir`,``)).trim();let n=t?i.resolve(process.cwd(),t):Q.buildArtifactDirectory(process.cwd(),e,`sdk`);if(f(n)&&p(n).length>0)switch(await this.choice(`Output directory (${t}) already exists and is not empty, what would you like to do?`,[{name:`Overwrite`,value:`overwrite`},{name:`Try to merge`,value:`merge`},{name:`Choose a different directory`,value:`choose`},{name:`Cancel`,value:`cancel`}])){case`overwrite`:await a.rm(n,{recursive:!0,force:!0});break;case`choose`:{let n=await this.ask(`Please enter a new output directory (relative to current directory):`,t);return this.resolveOutputDirectory(e,n)}case`cancel`:return this.info(`Operation cancelled by user`),process.exit(0);default:break}return n}resolvePackageName(e){return String(this.option(`name`,``)).trim()||i.basename(e).replace(/[^a-zA-Z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)||`generated-sdk`}parseOutputMode(e){let t=String(e??`both`).trim().toLowerCase();if(t===`runtime`||t===`classes`||t===`both`)return t;throw Error(`Unsupported sdk output mode: ${t}`)}parseSignatureStyle(e){let t=String(e??`grouped`).trim().toLowerCase();if(t===`flat`||t===`grouped`)return t;throw Error(`Unsupported signature style: ${t}`)}parseNamespaceStrategy(e){let t=String(e??`smart`).trim().toLowerCase();if(t===`smart`||t===`scoped`)return t;throw Error(`Unsupported namespace strategy: ${t}`)}parseMethodStrategy(e){let t=String(e??`smart`).trim().toLowerCase();if(t===`smart`||t===`operation-id`)return t;throw Error(`Unsupported method strategy: ${t}`)}isTypeScriptArtifactSource(e){return/\.(?:[cm]?ts|[cm]?js)$/i.test(e)}isOpenApiDocumentLike(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e,n=t.info;return t.openapi===`3.1.0`&&typeof n==`object`&&!!n&&!Array.isArray(n)&&typeof n.title==`string`&&typeof n.version==`string`&&typeof t.paths==`object`&&t.paths!==null&&!Array.isArray(t.paths)}async writePackageFiles(e,t){await Promise.all(Object.entries(t).map(async([t,n])=>{let r=i.join(e,t);await a.mkdir(i.dirname(r),{recursive:!0}),await a.writeFile(r,n,`utf8`)}))}};const nt=m(import.meta.url);var rt=class extends s{signature=`init
275
+ `;description=`Generate artifacts such as SDK packages from documentation sources or parsed TypeScript outputs`;async handle(){let e=this.app.getConfig(),t=String(this.argument(`artifact`,``)).trim().toLowerCase(),n=String(this.argument(`source`,``)).trim(),i=String(this.option(`browser`,e.browser)).trim().toLowerCase(),a=String(this.option(`timeout`,``)).trim(),o=this.option(`crawl`),s=String(this.option(`baseUrl`,``)).trim()||null,c=await this.resolveOutputDirectory(n),l=this.spinner(`Generating ${t} artifact...`).start(),u=!1;try{let d=Date.now();if(!fe(i))throw Error(`Unsupported browser: ${i}`);if(t!==`sdk`)throw Error(`Unsupported artifact: ${t}`);if(!n)throw Error(`The sdk artifact requires a source argument`);if(!this.isTypeScriptArtifactSource(n)&&!fe(i))throw Error(`Unsupported browser: ${i}`);let f=this.resolveTimeoutOverride(a,e.requestTimeout),p=this.parseNamespaceStrategy(this.option(`namespaceStrategy`,`smart`)),m=this.parseMethodStrategy(this.option(`methodStrategy`,`smart`)),h=this.parseOutputMode(this.option(`outputMode`,`both`)),g=this.parseSignatureStyle(this.option(`signatureStyle`,`grouped`)),_=String(this.option(`rootTypeName`,`ExtractedApiDocument`)).trim()||`ExtractedApiDocument`;this.app.configure({browser:i,requestTimeout:f}),!this.isTypeScriptArtifactSource(n)&&o&&(await le(this.app.getConfig()),u=!0);let v=await this.resolveSdkSource({source:n,crawl:o,baseUrl:s,rootTypeName:_,namespaceStrategy:p,methodStrategy:m}),y=this.resolvePackageName(c),b=new Kg().generate(v.document,{outputMode:h,signatureStyle:g,rootTypeName:_,namespaceStrategy:p,methodStrategy:m,schemaModule:v.schemaModule,packageName:String(this.option(`name`,``)).trim()||y});await this.writePackageFiles(c,b);let x=Date.now()-d;r.twoColumnDetail(r.log([[`Generated`,`green`],[`${x/1e3}s`,`gray`]],` `,!1),c.replace(process.cwd(),`.`)),l.succeed(`Artifact generation completed`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;l.fail(`Failed to generate artifact: ${t}`),process.exitCode=1}finally{u&&await ue()}}async resolveSdkSource(e){if(this.isTypeScriptArtifactSource(e.source))return this.loadSdkSourceFromTypeScriptArtifact(e.source);let t=we(await this.app.loadHtmlSource(e.source,!0)),n=e.crawl?await this.app.crawlReadmeOperations(e.source,t,e.baseUrl):t,r=this.buildOpenApiPayload(n);return{document:r,schemaModule:await Ma.format(Ot.generateModule(r,e.rootTypeName,{namespaceStrategy:e.namespaceStrategy,methodStrategy:e.methodStrategy}),{parser:`typescript`,semi:!1,singleQuote:!0})}}async loadSdkSourceFromTypeScriptArtifact(e){let t=i.resolve(process.cwd(),e),n=await a.readFile(t,`utf8`),r=await import(`${ee(t).href}?t=${Date.now()}`),o=r.default??Object.values(r).find(e=>this.isOpenApiDocumentLike(e));if(!this.isOpenApiDocumentLike(o))throw Error(`The provided TypeScript source does not export an OpenAPI document`);return{document:o,schemaModule:n}}buildOpenApiPayload(e){return`operations`in e?qg.createDocument(e.operations,`Extracted API`,`0.0.0`):qg.createDocument([e],`Extracted API`,`0.0.0`)}resolveTimeoutOverride(e,t){if(!e)return t;let n=Number(e);if(!Number.isFinite(n)||n<=0)throw Error(`Invalid timeout override: ${e}`);return n}async resolveOutputDirectory(e,t){t??=String(this.option(`dir`,``)).trim();let n=t?i.resolve(process.cwd(),t):Gg.buildArtifactDirectory(process.cwd(),e,`sdk`);if(j(n)&&M(n).length>0)switch(await this.choice(`Output directory (${t}) already exists and is not empty, what would you like to do?`,[{name:`Overwrite`,value:`overwrite`},{name:`Try to merge`,value:`merge`},{name:`Choose a different directory`,value:`choose`},{name:`Cancel`,value:`cancel`}])){case`overwrite`:await a.rm(n,{recursive:!0,force:!0});break;case`choose`:{let n=await this.ask(`Please enter a new output directory (relative to current directory):`,t);return this.resolveOutputDirectory(e,n)}case`cancel`:return this.info(`Operation cancelled by user`),process.exit(0);default:break}return n}resolvePackageName(e){return String(this.option(`name`,``)).trim()||i.basename(e).replace(/[^a-zA-Z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``)||`generated-sdk`}parseOutputMode(e){let t=String(e??`both`).trim().toLowerCase();if(t===`runtime`||t===`classes`||t===`both`)return t;throw Error(`Unsupported sdk output mode: ${t}`)}parseSignatureStyle(e){let t=String(e??`grouped`).trim().toLowerCase();if(t===`flat`||t===`grouped`)return t;throw Error(`Unsupported signature style: ${t}`)}parseNamespaceStrategy(e){let t=String(e??`smart`).trim().toLowerCase();if(t===`smart`||t===`scoped`)return t;throw Error(`Unsupported namespace strategy: ${t}`)}parseMethodStrategy(e){let t=String(e??`smart`).trim().toLowerCase();if(t===`smart`||t===`operation-id`)return t;throw Error(`Unsupported method strategy: ${t}`)}isTypeScriptArtifactSource(e){return/\.(?:[cm]?ts|[cm]?js)$/i.test(e)}isOpenApiDocumentLike(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e,n=t.info;return t.openapi===`3.1.0`&&typeof n==`object`&&!!n&&!Array.isArray(n)&&typeof n.title==`string`&&typeof n.version==`string`&&typeof t.paths==`object`&&t.paths!==null&&!Array.isArray(t.paths)}async writePackageFiles(e,t){await Promise.all(Object.entries(t).map(async([t,n])=>{let r=i.join(e,t);await a.mkdir(i.dirname(r),{recursive:!0}),await a.writeFile(r,n,`utf8`)}))}};const Yg=p(import.meta.url);var Xg=class extends s{signature=`init
178
276
  {--f|force : Overwrite existing config}
179
277
  {--S|sdk-kit : Also include default SDK config values.}
180
- `;description=`Generate a default oapiex.config.ts in the current directory`;async handle(){let e=process.cwd(),t=i.join(e,`oapiex.config.js`),n=this.option(`force`,!1),r=this.option(`sdkKit`,!1),o=this.buildConfigTemplate(r);try{await a.access(t),n||(this.error(`Config file already exists at ${t}. Use --force to overwrite.`),process.exit(1))}catch{}await a.writeFile(t,o,`utf8`),this.line(`Created ${t} `)}buildConfigTemplate(e=!1){let t=g;return[`import { defineConfig } from '${nt.includes(`node_modules`)?`oapiex`:`./src/config`}'`,``,`/**`,` * See https://toneflix.github.io/oapiex/configuration for docs`,` */`,`export default defineConfig({`,` outputFormat: '${t.outputFormat}',`,` outputShape: '${t.outputShape}',`,` browser: '${t.browser}',`,` requestTimeout: ${t.requestTimeout},`,` maxRedirects: ${t.maxRedirects},`,` userAgent: '${t.userAgent}',`,` retryCount: ${t.retryCount},`,` retryDelay: ${t.retryDelay},`,e?this.buildSdkConfigTemplate():void 0,`})`].filter(Boolean).join(`
278
+ `;description=`Generate a default oapiex.config.ts in the current directory`;async handle(){let e=process.cwd(),t=i.join(e,`oapiex.config.js`),n=this.option(`force`,!1),r=this.option(`sdkKit`,!1),o=this.buildConfigTemplate(r);try{await a.access(t),n||(this.error(`Config file already exists at ${t}. Use --force to overwrite.`),process.exit(1))}catch{}await a.writeFile(t,o,`utf8`),this.line(`Created ${t} `)}buildConfigTemplate(e=!1){let t=F;return[`import { defineConfig } from '${Yg.includes(`node_modules`)?`oapiex`:`./src/config`}'`,``,`/**`,` * See https://toneflix.github.io/oapiex/reference/configuration for docs`,` */`,`export default defineConfig({`,` outputFormat: '${t.outputFormat}',`,` outputShape: '${t.outputShape}',`,` browser: '${t.browser}',`,` requestTimeout: ${t.requestTimeout},`,` maxRedirects: ${t.maxRedirects},`,` userAgent: '${t.userAgent}',`,` retryCount: ${t.retryCount},`,` retryDelay: ${t.retryDelay},`,e?this.buildSdkConfigTemplate():void 0,`})`].filter(Boolean).join(`
181
279
  `)}buildSdkConfigTemplate(){return[` sdkKit: {`,` clientId: 'your-client-id',`,` clientSecret: 'your-client-secret',`,` encryptionKey: 'your-encryption-key',`,` environment: 'sandbox',`,` urls: {`,` live: 'https://live.oapiex.com',`,` sandbox: 'https://sandbox.oapiex.com',`,` },`,` debugLevel: 0,`,` },`].join(`
182
- `)}},it=class extends s{signature=`parse
280
+ `)}},Zg=class extends s{signature=`parse
183
281
  {source : Local HTML file path or remote URL}
184
282
  {--O|output=pretty : Output format [pretty,json,js,ts]}
185
283
  {--S|shape=raw : Result shape [raw,openapi]}
@@ -187,4 +285,4 @@ import{JSDOM as e}from"jsdom";import{Window as t}from"happy-dom";import n from"a
187
285
  {--t|timeout? : Request/browser timeout in milliseconds}
188
286
  {--c|crawl : Crawl sidebar links and parse every discovered operation}
189
287
  {--b|base-url? : Base URL used to resolve sidebar links when crawling from a local file}
190
- `;description=`Parse a saved ReadMe page or remote documentation URL and print normalized output`;async handle(){let e=this.app.getConfig(),t=String(this.argument(`source`,``)).trim(),n=String(this.option(`output`,e.outputFormat)).trim().toLowerCase(),i=String(this.option(`shape`,e.outputShape)).trim().toLowerCase(),a=String(this.option(`browser`,e.browser)).trim().toLowerCase(),o=String(this.option(`timeout`,``)).trim(),s=this.option(`crawl`),c=String(this.option(`baseUrl`,``)).trim()||null,l=this.spinner(`${s?`Crawling and p`:`P`}arsing source...`).start(),u=!1;try{let d=Date.now();if(!P(a))throw Error(`Unsupported browser: ${a}`);let f=this.resolveTimeoutOverride(o,e.requestTimeout);this.app.configure({browser:a,requestTimeout:f}),s&&(await j(this.app.getConfig()),u=!0);let p=L(await this.app.loadHtmlSource(t,!0)),m=s?await this.app.crawlReadmeOperations(t,p,c):p,h=i===`openapi`?this.buildOpenApiPayload(m):m,g=await Q.serializeOutput(h,n,Q.getRootTypeName(i)),_=await this.saveOutputToFile(g,t,i,n),v=Date.now()-d;r.twoColumnDetail(r.log([[`Output`,`green`],[`${v/1e3}s`,`gray`]],` `,!1),_.replace(process.cwd(),`.`)),l.succeed(`Parsing completed`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;l.fail(`Failed to parse source: ${t}`),process.exitCode=1}finally{u&&await M()}}resolveTimeoutOverride=(e,t)=>{if(!e)return t;let n=Number(e);if(!Number.isFinite(n)||n<=0)throw Error(`Invalid timeout override: ${e}`);return n};buildOpenApiPayload=e=>`operations`in e?$.createDocument(e.operations,`Extracted API`,`0.0.0`):$.createDocument([e],`Extracted API`,`0.0.0`);saveOutputToFile=async(e,t,n,r)=>{let o=Q.buildFilePath(process.cwd(),t,n,r),s=i.dirname(o);return await a.mkdir(s,{recursive:!0}),await a.writeFile(o,e,`utf8`),o}};const at=[`oapiex.config.ts`,`oapiex.config.js`,`oapiex.config.cjs`];async function ot(e=process.cwd()){let t=h(import.meta.url,{interopDefault:!0,moduleCache:!1,fsCache:!1});for(let n of at){let r=i.join(e,n);try{await a.access(r);let e=await t.import(r),n=typeof e==`object`&&e?e:null,i=n?.default??n?.config??e;if(typeof i==`object`&&i)return i}catch{continue}}return null}async function st(e={}){let t=await ot();return v(v(_(),t??{}),e)}const ct=new Xe(await st());await c.init(ct,{name:`OAPIEX`,logo:``,allowRebuilds:!1,packages:[`@h3ravel/musket`],baseCommands:[rt,tt,it],exceptionHandler(e){console.error(`An unexpected error occurred:`,e),process.exit(1)}});export{};
288
+ `;description=`Parse a saved ReadMe page or remote documentation URL and print normalized output`;async handle(){let e=this.app.getConfig(),t=String(this.argument(`source`,``)).trim(),n=String(this.option(`output`,e.outputFormat)).trim().toLowerCase(),i=String(this.option(`shape`,e.outputShape)).trim().toLowerCase(),a=String(this.option(`browser`,e.browser)).trim().toLowerCase(),o=String(this.option(`timeout`,``)).trim(),s=this.option(`crawl`),c=String(this.option(`baseUrl`,``)).trim()||null,l=this.spinner(`${s?`Crawling and p`:`P`}arsing source...`).start(),u=!1;try{let d=Date.now();if(!fe(a))throw Error(`Unsupported browser: ${a}`);let f=this.resolveTimeoutOverride(o,e.requestTimeout);this.app.configure({browser:a,requestTimeout:f}),s&&(await le(this.app.getConfig()),u=!0);let p=we(await this.app.loadHtmlSource(t,!0)),m=s?await this.app.crawlReadmeOperations(t,p,c):p,h=i===`openapi`?this.buildOpenApiPayload(m):m,g=await Gg.serializeOutput(h,n,Gg.getRootTypeName(i)),_=await this.saveOutputToFile(g,t,i,n),v=Date.now()-d;r.twoColumnDetail(r.log([[`Output`,`green`],[`${v/1e3}s`,`gray`]],` `,!1),_.replace(process.cwd(),`.`)),l.succeed(`Parsing completed`)}catch(e){let t=e instanceof Error?e.message:`Unknown error`;l.fail(`Failed to parse source: ${t}`),process.exitCode=1}finally{u&&await ue()}}resolveTimeoutOverride=(e,t)=>{if(!e)return t;let n=Number(e);if(!Number.isFinite(n)||n<=0)throw Error(`Invalid timeout override: ${e}`);return n};buildOpenApiPayload=e=>`operations`in e?qg.createDocument(e.operations,`Extracted API`,`0.0.0`):qg.createDocument([e],`Extracted API`,`0.0.0`);saveOutputToFile=async(e,t,n,r)=>{let o=Gg.buildFilePath(process.cwd(),t,n,r),s=i.dirname(o);return await a.mkdir(s,{recursive:!0}),await a.writeFile(o,e,`utf8`),o}};const Qg=[`oapiex.config.ts`,`oapiex.config.js`,`oapiex.config.cjs`];async function $g(e=process.cwd()){let t=N(import.meta.url,{interopDefault:!0,moduleCache:!1,fsCache:!1});for(let n of Qg){let r=i.join(e,n);try{await a.access(r);let e=await t.import(r),n=typeof e==`object`&&e?e:null,i=n?.default??n?.config??e;if(typeof i==`object`&&i)return i}catch{continue}}return null}async function e_(e={}){let t=await $g();return I(I(ne(),t??{}),e)}const t_=new Ct(await e_());await c.init(t_,{name:`OAPIEX`,logo:``,allowRebuilds:!1,packages:[`@h3ravel/musket`],baseCommands:[Xg,Jg,Zg],exceptionHandler(e){console.error(`An unexpected error occurred:`,e),process.exit(1)}});export{};