libre-webui 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +6 -1
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/middleware/staticAssets.d.ts +29 -0
- package/backend/dist/middleware/staticAssets.d.ts.map +1 -0
- package/backend/dist/middleware/staticAssets.js +141 -0
- package/backend/dist/middleware/staticAssets.js.map +1 -0
- package/backend/dist/routes/artifacts.d.ts.map +1 -1
- package/backend/dist/routes/artifacts.js +4 -2
- package/backend/dist/routes/artifacts.js.map +1 -1
- package/backend/dist/routes/plugins.d.ts.map +1 -1
- package/backend/dist/routes/plugins.js +13 -2
- package/backend/dist/routes/plugins.js.map +1 -1
- package/backend/dist/routes/preferences.d.ts.map +1 -1
- package/backend/dist/routes/preferences.js +40 -1
- package/backend/dist/routes/preferences.js.map +1 -1
- package/backend/dist/services/appearanceSettingsService.d.ts +20 -0
- package/backend/dist/services/appearanceSettingsService.d.ts.map +1 -0
- package/backend/dist/services/appearanceSettingsService.js +91 -0
- package/backend/dist/services/appearanceSettingsService.js.map +1 -0
- package/backend/dist/services/authService.d.ts +3 -0
- package/backend/dist/services/authService.d.ts.map +1 -1
- package/backend/dist/services/authService.js +2 -0
- package/backend/dist/services/authService.js.map +1 -1
- package/backend/dist/services/ollamaSettingsService.d.ts.map +1 -1
- package/backend/dist/services/ollamaSettingsService.js +7 -2
- package/backend/dist/services/ollamaSettingsService.js.map +1 -1
- package/backend/dist/services/preferencesService.d.ts +5 -0
- package/backend/dist/services/preferencesService.d.ts.map +1 -1
- package/backend/dist/services/preferencesService.js +15 -2
- package/backend/dist/services/preferencesService.js.map +1 -1
- package/backend/dist/services/workPreviewProxyService.d.ts.map +1 -1
- package/backend/dist/services/workPreviewProxyService.js +4 -2
- package/backend/dist/services/workPreviewProxyService.js.map +1 -1
- package/backend/dist/types/index.d.ts +1 -1
- package/backend/dist/types/index.d.ts.map +1 -1
- package/backend/package.json +1 -1
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -1
- package/frontend/dist/assets/index-DegYzMyw.js +70 -0
- package/frontend/dist/assets/index-gKj8Y1JB.css +1 -0
- package/frontend/dist/assets/xterm-B8QFf3JU.css +1 -0
- package/frontend/dist/index.html +62 -40
- package/frontend/dist/js/ArtifactContainer-BB6A8cT5.js +1 -0
- package/frontend/dist/js/{ArtifactDemoPage-BLF8Ok-o.js → ArtifactDemoPage-Bf1dW5Z3.js} +1 -1
- package/frontend/dist/js/{ArtifactSandboxFrame-Cs1Gu1WB.js → ArtifactSandboxFrame-DsZW0Axy.js} +1 -1
- package/frontend/dist/js/ArtifactSlideOutPanel-Cartcixp.js +1 -0
- package/frontend/dist/js/AutomationModal-BI_3nFeg.js +1 -0
- package/frontend/dist/js/AutomationsPage-ChMXj4UG.js +1 -0
- package/frontend/dist/js/AvatarUpload-gfZ9QWR3.js +1 -0
- package/frontend/dist/js/Button-BQ5JnUVj.js +1 -0
- package/frontend/dist/js/CalendarPage-Ce1ud5St.js +1 -0
- package/frontend/dist/js/ChannelsPage-kl8zJ2HA.js +1 -0
- package/frontend/dist/js/ChatPage-Bj98c6rc.js +14 -0
- package/frontend/dist/js/ConnectModels-CPftHmE3.js +1 -0
- package/frontend/dist/js/{EvaluationsPage-DOJLpauA.js → EvaluationsPage-Cydglp6R.js} +2 -2
- package/frontend/dist/js/FirstTimeSetup-C5cc-bc9.js +1 -0
- package/frontend/dist/js/GalleryPage-Dvq2GVoH.js +1 -0
- package/frontend/dist/js/HomePage-zVjADRoX.js +1 -0
- package/frontend/dist/js/LibreClawPage-x0Qmtcnc.js +1 -0
- package/frontend/dist/js/Logo-BlcOFpac.js +1 -0
- package/frontend/dist/js/LogoMark-CNeQ6eO9.js +1 -0
- package/frontend/dist/js/ModelManagerModals-K1oiXMTv.js +1 -0
- package/frontend/dist/js/NotesPage-BnqBv-n1.js +3 -0
- package/frontend/dist/js/OptimizedSyntaxHighlighter-CtQ_FGCX.js +2 -0
- package/frontend/dist/js/OptimizedSyntaxHighlighter-SkJc7ZMe.js +1 -0
- package/frontend/dist/js/PasswordStrengthMeter-DVFLKG_-.js +1 -0
- package/frontend/dist/js/{PersonasPage-C3D_6lIx.js → PersonasPage-DK9-SDZQ.js} +2 -2
- package/frontend/dist/js/PluginUsagePage-DX9uxdRr.js +1 -0
- package/frontend/dist/js/RichMessageContent-BzfhfzQ4.js +1 -0
- package/frontend/dist/js/RichMessageContent-XMkRvBen.js +3 -0
- package/frontend/dist/js/SettingsModal-CMOwEhkG.js +19 -0
- package/frontend/dist/js/SettingsToggle-B7UynBmZ.js +1 -0
- package/frontend/dist/js/ShareDialog-CZpU1itx.js +1 -0
- package/frontend/dist/js/SystemPage-BVaaKTRs.js +1 -0
- package/frontend/dist/js/TurnstileWidget-CEJst9eS.js +1 -0
- package/frontend/dist/js/UserManagementPage-DdpcN4-Q.js +1 -0
- package/frontend/dist/js/UserManagementPanel-BxAvybHj.js +1 -0
- package/frontend/dist/js/WhatsNewModal-CoFCdUpf.js +1 -0
- package/frontend/dist/js/WorkPage-Du6llCSU.js +7 -0
- package/frontend/dist/js/api-CatP45JH.js +1 -0
- package/frontend/dist/js/api-DQdJeQjd.js +14 -0
- package/frontend/dist/js/{appNavigation-DfHbXBey.js → appNavigation-DRM2Jr4r.js} +1 -1
- package/frontend/dist/js/appStore-BXbVcTeo.js +2 -0
- package/frontend/dist/js/appVersion-BUroqcki.js +1 -0
- package/frontend/dist/js/ar-C8Izi_rT.js +2 -0
- package/frontend/dist/js/authStore-DkqtNSYP.js +4 -0
- package/frontend/dist/js/authStore-bqAN5v4N.js +1 -0
- package/frontend/dist/js/axios-CYkJpKn8.js +1 -0
- package/frontend/dist/js/babel-CY5KOv-I.js +16 -0
- package/frontend/dist/js/bn-BJJgi-6Q.js +2 -0
- package/frontend/dist/js/chatStore-8jYk48hC.js +3 -0
- package/frontend/dist/js/{config-DJwXAf8i.js → config-D4dduT3C.js} +1 -1
- package/frontend/dist/js/cs-DheVrMUl.js +2 -0
- package/frontend/dist/js/da-BLszIs3a.js +2 -0
- package/frontend/dist/js/de-BvWdcr7T.js +2 -0
- package/frontend/dist/js/es-CQ8Yauda.js +2 -0
- package/frontend/dist/js/estree-CuT_pB8K.js +44 -0
- package/frontend/dist/js/{evaluationsApi-BKY-maUM.js → evaluationsApi-CBKjxZUn.js} +1 -1
- package/frontend/dist/js/fr-BD5h-w8z.js +2 -0
- package/frontend/dist/js/goober.modern-BaHbaW3_.js +1 -0
- package/frontend/dist/js/hi-IlRhC5IE.js +2 -0
- package/frontend/dist/js/html-Cdnr2qzU.js +25 -0
- package/frontend/dist/js/i18next-ChipS_AK.js +1 -0
- package/frontend/dist/js/id-DalGMQEJ.js +2 -0
- package/frontend/dist/js/is-DuQqmHeS.js +2 -0
- package/frontend/dist/js/it-DDaqAdB1.js +2 -0
- package/frontend/dist/js/ja-CYCu9F9Y.js +2 -0
- package/frontend/dist/js/ko-P3JZPOXE.js +2 -0
- package/frontend/dist/js/logger-DnuT4jgB.js +1 -0
- package/frontend/dist/js/markdown-CByV-4CU.js +70 -0
- package/frontend/dist/js/markdown-core-D067gSd8.js +31 -0
- package/frontend/dist/js/markdown-html-CQM6wA9G.js +2 -0
- package/frontend/dist/js/markdown-math-Dg-WB9ui.js +261 -0
- package/frontend/dist/js/markdownHtml-Djpz4yB3.js +1 -0
- package/frontend/dist/js/markdownMath-CoDj1i7z.js +1 -0
- package/frontend/dist/js/{messageCodeStyles-CkxF6yil.js → messageCodeStyles-0_YpQDk4.js} +2 -2
- package/frontend/dist/js/ms-B3ZIqlUn.js +2 -0
- package/frontend/dist/js/nl-1Qpsmmz1.js +2 -0
- package/frontend/dist/js/pl-ErrMri3_.js +2 -0
- package/frontend/dist/js/postcss-CifRAFe1.js +62 -0
- package/frontend/dist/js/pt-0T0R9AtX.js +2 -0
- package/frontend/dist/js/react-vendor-D0Ec-185.js +9 -0
- package/frontend/dist/js/rfb-NV_fh9Db.js +5 -0
- package/frontend/dist/js/router-vendor-CMbYTGdh.js +1 -0
- package/frontend/dist/js/ru-B34INyPg.js +2 -0
- package/frontend/dist/js/standalone-6z5x8CWe.js +29 -0
- package/frontend/dist/js/sv-BSqDwAur.js +2 -0
- package/frontend/dist/js/syntax-highlight-DTWfgxYh.js +7 -0
- package/frontend/dist/js/{teamEventStream-DUodK0-C.js → teamEventStream-RoMYo102.js} +1 -1
- package/frontend/dist/js/th-DK9M4-Iy.js +2 -0
- package/frontend/dist/js/tr-DUrkEwr1.js +2 -0
- package/frontend/dist/js/ttsBatching-kFVEE3Ip.js +2 -0
- package/frontend/dist/js/typescript-BPrdIZ70.js +22 -0
- package/frontend/dist/js/ui-UU79S5lB.js +2 -0
- package/frontend/dist/js/ui-vendor-6y6qiSk5.js +177 -0
- package/frontend/dist/js/uk-B5DYTi0e.js +2 -0
- package/frontend/dist/js/useChat-ImXXcy0q.js +10 -0
- package/frontend/dist/js/useDictation-eMIAncoT.js +1 -0
- package/frontend/dist/js/useQuery-BKulzCS7.js +1 -0
- package/frontend/dist/js/useTranslation-D0mJ4NnO.js +1 -0
- package/frontend/dist/js/{utils-nNyg0lfc.js → utils-Bn0RE9_8.js} +1 -1
- package/frontend/dist/js/utils-vendor-BbPbaAuC.js +9 -0
- package/frontend/dist/js/vi-CrtPQUIM.js +2 -0
- package/frontend/dist/js/workApi-BM8qVq_w.js +1 -0
- package/frontend/dist/js/workApi-xhF57amo.js +6 -0
- package/frontend/dist/js/xterm-C3BHN0de.js +16 -0
- package/frontend/dist/js/yaml-9ltHPDNO.js +154 -0
- package/frontend/dist/js/zh-gbOKajYe.js +2 -0
- package/frontend/dist/sw.js +3 -3
- package/package.json +2 -2
- package/frontend/dist/assets/index-B6xMZpzA.js +0 -76
- package/frontend/dist/assets/index-BjipfsCP.css +0 -1
- package/frontend/dist/assets/xterm-DHcfr8qj.css +0 -1
- package/frontend/dist/js/ArtifactContainer-Bn6iJtaJ.js +0 -1
- package/frontend/dist/js/ArtifactSlideOutPanel-CuKq5cL0.js +0 -1
- package/frontend/dist/js/AutomationModal-Dha4KgLI.js +0 -1
- package/frontend/dist/js/AutomationsPage-HcMCRV-D.js +0 -1
- package/frontend/dist/js/AvatarUpload-CFrlSszY.js +0 -1
- package/frontend/dist/js/Button-CgN11mgY.js +0 -1
- package/frontend/dist/js/CalendarPage-D_K-XrG9.js +0 -1
- package/frontend/dist/js/ChannelsPage-D3CoImOT.js +0 -1
- package/frontend/dist/js/ChatPage-C0iBDbOq.js +0 -14
- package/frontend/dist/js/ConnectModels-D_ZbZQub.js +0 -1
- package/frontend/dist/js/FirstTimeSetup-DDIP_4Dd.js +0 -1
- package/frontend/dist/js/GalleryPage-C8U_F7Ns.js +0 -1
- package/frontend/dist/js/HomePage-B_aotoDU.js +0 -1
- package/frontend/dist/js/LibreClawPage-cr2N6W00.js +0 -1
- package/frontend/dist/js/Logo-B7o7eaPU.js +0 -1
- package/frontend/dist/js/LogoMark-D9g6ls0h.js +0 -1
- package/frontend/dist/js/ModelManagerModals-C-J1d7GL.js +0 -1
- package/frontend/dist/js/NotesPage-Bgr7R_Vm.js +0 -3
- package/frontend/dist/js/OptimizedSyntaxHighlighter-BwKLuOu-.js +0 -1
- package/frontend/dist/js/OptimizedSyntaxHighlighter-oiyvxgDA.js +0 -1
- package/frontend/dist/js/PasswordStrengthMeter-DR-mGbLF.js +0 -1
- package/frontend/dist/js/PluginUsagePage-DK7MgSiu.js +0 -1
- package/frontend/dist/js/RichMessageContent-7FxrZ4A8.js +0 -1
- package/frontend/dist/js/RichMessageContent-CQkLI7Dt.js +0 -3
- package/frontend/dist/js/SettingsModal-CIV_Bgsf.js +0 -19
- package/frontend/dist/js/SettingsToggle-Cw4OhW7B.js +0 -1
- package/frontend/dist/js/ShareDialog-BCEVgtbN.js +0 -1
- package/frontend/dist/js/SystemPage-BNVZtLe9.js +0 -1
- package/frontend/dist/js/TurnstileWidget-lyEp7A0r.js +0 -1
- package/frontend/dist/js/UserManagementPage-pPC_Svj9.js +0 -1
- package/frontend/dist/js/WorkPage-Q33nIqkM.js +0 -7
- package/frontend/dist/js/api-D-5hpGht.js +0 -14
- package/frontend/dist/js/api-WR1CTYO5.js +0 -1
- package/frontend/dist/js/appStore-B136FGdu.js +0 -2
- package/frontend/dist/js/appVersion-Ck7dYiHe.js +0 -1
- package/frontend/dist/js/ar-Cq-nC6v9.js +0 -2
- package/frontend/dist/js/authStore-6AJLgQsD.js +0 -1
- package/frontend/dist/js/authStore-Ckz37pwu.js +0 -4
- package/frontend/dist/js/axios-CUerAKcc.js +0 -1
- package/frontend/dist/js/babel-8afoxhZ7.js +0 -16
- package/frontend/dist/js/bn-BFSKytYs.js +0 -2
- package/frontend/dist/js/chatStore-Dpm3g_Ln.js +0 -3
- package/frontend/dist/js/classPrivateMethodInitSpec-DE0XIqc_.js +0 -1
- package/frontend/dist/js/cs-BKWXa629.js +0 -2
- package/frontend/dist/js/da-Cra_DJnV.js +0 -2
- package/frontend/dist/js/de-BQa6_UuE.js +0 -2
- package/frontend/dist/js/es-BBOHFrx1.js +0 -2
- package/frontend/dist/js/estree-qxY7ACbu.js +0 -44
- package/frontend/dist/js/fr-C8kXs5c0.js +0 -2
- package/frontend/dist/js/hi-BEef4bjU.js +0 -2
- package/frontend/dist/js/html-B_cUU1Gi.js +0 -25
- package/frontend/dist/js/i18next-ChNMiFef.js +0 -1
- package/frontend/dist/js/id-Djipic7Y.js +0 -2
- package/frontend/dist/js/is-pazl6RLG.js +0 -2
- package/frontend/dist/js/it-DobPbTwl.js +0 -2
- package/frontend/dist/js/ja-DwYNaMNX.js +0 -2
- package/frontend/dist/js/ko-BQfXE7_o.js +0 -2
- package/frontend/dist/js/logger-CpCQz3Vi.js +0 -1
- package/frontend/dist/js/markdown-BAF0w-jL.js +0 -70
- package/frontend/dist/js/markdown-core-CsTEqgp1.js +0 -32
- package/frontend/dist/js/markdown-math-BhUmos36.js +0 -261
- package/frontend/dist/js/ms-CkPQoE5T.js +0 -2
- package/frontend/dist/js/nl-X_QsDAtu.js +0 -2
- package/frontend/dist/js/pl-CK39gUsy.js +0 -2
- package/frontend/dist/js/postcss-B2vYq4-H.js +0 -62
- package/frontend/dist/js/pt-C0dWyR_I.js +0 -2
- package/frontend/dist/js/react-vendor-BsJBHRYW.js +0 -9
- package/frontend/dist/js/rfb-BOfFBtVG.js +0 -5
- package/frontend/dist/js/router-vendor-CIwPu612.js +0 -1
- package/frontend/dist/js/ru-sNJkEz1G.js +0 -2
- package/frontend/dist/js/standalone-BqZmfuRy.js +0 -29
- package/frontend/dist/js/sv-Bh-uxdF3.js +0 -2
- package/frontend/dist/js/syntax-highlight-DY6Hwrri.js +0 -8
- package/frontend/dist/js/th-DPVtwZj2.js +0 -2
- package/frontend/dist/js/tr-BYNM_Tm7.js +0 -2
- package/frontend/dist/js/ttsBatching-7_-p2nxR.js +0 -2
- package/frontend/dist/js/typescript-DokwN-5Y.js +0 -22
- package/frontend/dist/js/ui-BK53RPmS.js +0 -2
- package/frontend/dist/js/ui-vendor-CPdYrKhz.js +0 -177
- package/frontend/dist/js/uk-kvNBuYin.js +0 -2
- package/frontend/dist/js/useChat-Czg2p4Rr.js +0 -10
- package/frontend/dist/js/useDictation-B2lYEYKn.js +0 -1
- package/frontend/dist/js/useQuery-ClAiNxQ7.js +0 -1
- package/frontend/dist/js/useTranslation-C7GwbUQA.js +0 -1
- package/frontend/dist/js/utils-vendor-CeUf_ngc.js +0 -9
- package/frontend/dist/js/vi-CmLoaP0K.js +0 -2
- package/frontend/dist/js/workApi-BoJb9aVF.js +0 -1
- package/frontend/dist/js/workApi-CFH097y5.js +0 -6
- package/frontend/dist/js/xterm-CdjKCQM7.js +0 -16
- package/frontend/dist/js/yaml-BXEpxPn2.js +0 -154
- package/frontend/dist/js/zh-D2zvmvrj.js +0 -2
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,v as r}from"./router-vendor-CIwPu612.js";var i,a=Object.defineProperty,o=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},s={};o(s,{__parsePrettierYamlConfig:()=>Ts,languages:()=>Gt,options:()=>qt,parsers:()=>Jt,printers:()=>ws});var c=(e,t)=>(n,r,...i)=>n|1&&r==null?void 0:(t.call(r)??r[e]).apply(r,i);function l(e){return this[e<0?this.length+e:e]}var u=c(`at`,function(){if(Array.isArray(this)||typeof this==`string`)return l}),d=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},f=c(`replaceAll`,function(){if(typeof this==`string`)return d}),p=()=>{},m=`string`,h=`array`,g=`cursor`,_=`indent`,v=`align`,y=`trim`,b=`group`,x=`fill`,S=`if-break`,ee=`indent-if-break`,te=`line-suffix`,ne=`line-suffix-boundary`,re=`line`,ie=`label`,ae=`break-parent`,oe=new Set([g,_,v,y,b,x,S,ee,te,ne,re,ie,ae]);function se(e,t,n){if(!e.has(t)){let r=n(t);e.set(t,r)}return e.get(t)}function ce(e){if(typeof e==`string`)return m;if(Array.isArray(e))return h;if(!e)return;let{type:t}=e;if(oe.has(t))return t}var le=ce,ue=e=>new Intl.ListFormat(`en-US`,{type:`disjunction`}).format(e);function de(e){let t=e===null?`null`:typeof e;if(t!==`string`&&t!==`object`)return`Unexpected doc '${t}',
|
|
2
|
-
Expected it to be 'string' or 'object'.`;if(le(e))throw Error(`doc is valid.`);let n=Object.prototype.toString.call(e);if(n!==`[object Object]`)return`Unexpected doc '${n}'.`;let r=ue([...oe].map(e=>`'${e}'`));return`Unexpected doc.type '${e.type}'.
|
|
3
|
-
Expected it to be ${r}.`}var fe=class extends Error{constructor(e){((...e)=>(super(...e),n(this,`name`,`InvalidDocError`),this))(de(e)),this.doc=e}};function pe(e,t){if(typeof e==`string`)return t(e);let n=new Map;return r(e);function r(e){return se(n,e,i)}function i(e){switch(le(e)){case h:return t(e.map(r));case x:return t({...e,parts:e.parts.map(r)});case S:return t({...e,breakContents:r(e.breakContents),flatContents:r(e.flatContents)});case b:{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 v:case _:case ee:case ie:case te:return t({...e,contents:r(e.contents)});case m:case g:case y:case ne:case re:case ae:return t(e);default:throw new fe(e)}}}function me(e,t=Ae){return pe(e,e=>typeof e==`string`?C(t,e.split(`
|
|
4
|
-
`)):e)}var he=p,ge=p,_e=p,ve=p;function ye(e,t){return ve(e),he(t),{type:v,contents:t,n:e}}function be(e){return ye(-1/0,e)}function xe(e){return ye({type:`root`},e)}function Se(e){return ye(-1,e)}var Ce={type:ae};function we(e){return _e(e),{type:x,parts:e}}function Te(e,t={}){return he(e),ge(t.expandedStates,!0),{type:b,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function Ee(e,t){return Te(e[0],{...t,expandedStates:e})}function De(e,t=``,n={}){return he(e),t!==``&&he(t),{type:S,breakContents:e,flatContents:t,groupId:n.groupId}}function C(e,t){he(e),ge(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}var Oe={type:re},ke={type:re,soft:!0},w=[{type:re,hard:!0},Ce],Ae=[{type:re,hard:!0,literal:!0},Ce];function je(e){return he(e),{type:te,contents:e}}function Me(e){return(t,n,r)=>{if(n===!1)return!1;let i=!!r?.backwards,{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 Ne=Me(` `),Pe=e=>e===`
|
|
5
|
-
`||e===`\r`||e===`\u2028`||e===`\u2029`;function Fe(e,t,n){if(t===!1)return!1;let r=!!n?.backwards,i=e.charAt(t);if(r){if(e.charAt(t-1)===`\r`&&i===`
|
|
6
|
-
`)return t-2;if(Pe(i))return t-1}else{if(i===`\r`&&e.charAt(t+1)===`
|
|
7
|
-
`)return t+2;if(Pe(i))return t+1}return t}var Ie=Fe;function Le(e,t){let n=t-1;n=Ne(e,n,{backwards:!0}),n=Ie(e,n,{backwards:!0}),n=Ne(e,n,{backwards:!0});let r=Ie(e,n,{backwards:!0});return n!==r}var Re=Le,ze=class extends Error{constructor(e,t,r=`type`){((...e)=>(super(...e),n(this,`name`,`UnexpectedNodeError`),this))(`Unexpected ${t} node ${r}: ${JSON.stringify(e[r])}.`),this.node=e}};function Be(e,t){let{node:n}=e;if(n.type===`root`&&t.filepath&&/(?:[/\\]|^)\.(?:prettier|stylelint|lintstaged)rc$/.test(t.filepath))return async e=>{let n=await e(t.originalText,{parser:`json`});return n?[n,w]:void 0}}Be.getVisitorKeys=()=>[];var Ve=Be,He=null;function Ue(e){if(He!==null&&typeof He.property){let e=He;return He=Ue.prototype=null,e}return He=Ue.prototype=e??Object.create(null),new Ue}var We=10;for(let e=0;e<=We;e++)Ue();function Ge(e){return Ue(e)}function Ke(e,t=`type`){Ge(e);function n(n){let r=n[t],i=e[r];if(!Array.isArray(i))throw Object.assign(Error(`Missing visitor keys for '${r}'.`),{node:n});return i}return n}var qe=Ke,T=[[`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`key`,`value`,`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`content`,`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],[`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`]],Je=qe({root:T[0],document:[`head`,`body`,`children`,`anchor`,`tag`,`indicatorComment`,`leadingComments`,`middleComments`,`trailingComment`,`endComments`],documentHead:T[0],documentBody:T[0],directive:T[1],alias:T[1],blockLiteral:T[1],blockFolded:T[0],plain:T[0],quoteSingle:T[1],quoteDouble:T[1],mapping:T[0],mappingItem:T[2],mappingKey:T[3],mappingValue:T[3],sequence:T[0],sequenceItem:T[3],flowMapping:T[0],flowMappingItem:T[2],flowSequence:T[0],flowSequenceItem:T[3],comment:T[1],tag:T[4],anchor:T[4]}),Ye=e=>e.position.start.offset,Xe=e=>e.position.end.offset,Ze=`format`,Qe=/^\s*#[^\S\n]*@(?:noformat|noprettier)\s*?(?:\n|$)/,$e=/^\s*#[^\S\n]*@(?:format|prettier)\s*?(?:\n|$)/,et=/^\s*@(?:format|prettier)\s*$/,tt=e=>et.test(e),nt=e=>$e.test(e),rt=e=>Qe.test(e),it=e=>`# @${Ze}
|
|
8
|
-
|
|
9
|
-
${e}`;function at(e,t){switch(e.type){case`comment`:if(tt(e.value))return null;break;case`quoteDouble`:case`quoteSingle`:t.type=`quote`;break;case`document`:t.directivesEndMarker||delete t.directivesEndMarker,t.documentEndMarker||delete t.documentEndMarker;break;case`blockLiteral`:case`blockFolded`:e.chomping===`keep`?t.value=e.value.split(`
|
|
10
|
-
`).map(e=>e.replace(/[ \t]+$/,``)).join(`
|
|
11
|
-
`):(e.chomping===`clip`||e.chomping===`strip`)&&(t.value=e.value.trimEnd())}}at.ignoredProperties=new Set([`position`]);function ot(e){return Array.isArray(e)&&e.length>0}var st=ot;function E(e,t){return typeof e?.type==`string`&&t.includes(e.type)}function ct(e,t,n){return t(`children`in e?{...e,children:e.children.map(n=>ct(n,t,e))}:e,n)}function lt(e,t,n){Object.defineProperty(e,t,{get:n,enumerable:!1})}function ut(e,t){let n=0,r=t.length;for(let i=e.position.end.offset-1;i<r;i++){let e=t[i];if(e===`
|
|
12
|
-
`&&n++,n===1&&/\S/.test(e))return!1;if(n===2)return!0}return!1}function dt(e){let{node:t}=e;switch(t.type){case`tag`:case`anchor`:case`comment`:return!1}let n=e.stack.length;for(let t=1;t<n;t++){let n=e.stack[t],r=e.stack[t-1];if(Array.isArray(r)&&typeof n==`number`&&n!==r.length-1)return!1}return!0}function ft(e){return st(e.children)?ft(u(0,e.children,-1)):e}function pt(e){return e.value.trim()===`prettier-ignore`}function mt(e){let{node:t}=e;if(t.type===`documentBody`){let t=e.parent.head;return k(t)&&pt(u(0,t.endComments,-1))}return D(t)&&pt(u(0,t.leadingComments,-1))}function ht(e){return!st(e.children)&&!gt(e)}function gt(e){return D(e)||_t(e)||vt(e)||O(e)||k(e)}function D(e){return st(e?.leadingComments)}function _t(e){return st(e?.middleComments)}function vt(e){return e?.indicatorComment}function O(e){return e?.trailingComment}function k(e){return st(e?.endComments)}function yt(e){return e?e.split(/(?<!^| ) (?! |$)/):[]}function bt(e,t,n){let r=t.split(`
|
|
13
|
-
`).map((e,t,n)=>t===0&&t===n.length-1?e:t!==0&&t!==n.length-1?e.trim():t===0?e.trimEnd():e.trimStart());if(n.proseWrap===`preserve`)return r.map(e=>e?[e]:[]);let i=[];for(let[t,n]of r.entries()){let a=yt(n);t>0&&r[t-1].length>0&&a.length>0&&!(e===`quoteDouble`&&u(0,u(0,i,-1),-1).endsWith(`\\`))?i[i.length-1]=[...u(0,i,-1),...a]:i.push(a)}return n.proseWrap===`never`?i.map(e=>[e.join(` `)]):i}function xt(e,{parentIndent:t,isLastDescendant:n,options:r}){let i=e.position.start.line===e.position.end.line?``:r.originalText.slice(e.position.start.offset,e.position.end.offset).match(/^[^\n]*\n(.*)$/s)[1];if(i===``)return[];let a;if(e.indent===null){let e=i.match(/^(?<leadingSpace> *)[^\n\r ]/m);a=e?e.groups.leadingSpace.length:1/0}else a=e.indent-1+t;let o=i.split(`
|
|
14
|
-
`).map(e=>e.slice(a));if(r.proseWrap===`preserve`||e.type===`blockLiteral`)return c(o.map(e=>e?[e]:[]));let s=[];for(let[e,t]of o.entries()){let n=yt(t);e>0&&n.length>0&&o[e-1].length>0&&!/^\s/.test(n[0])&&!/^\s|\s$/.test(u(0,s,-1))?s[s.length-1]=[...u(0,s,-1),...n]:s.push(n)}return s=s.map(e=>{let t=[];for(let n of e)t.length>0&&/\s$/.test(u(0,t,-1))?t[t.length-1]+=` `+n:t.push(n);return t}),r.proseWrap===`never`&&(s=s.map(e=>[e.join(` `)])),c(s);function c(t){if(e.chomping===`keep`)return i.endsWith(`
|
|
15
|
-
`)&&u(0,t,-1).length===0?t.slice(0,-1):t;let r=0;for(let e=t.length-1;e>=0&&t[e].every(e=>e.replace(/[ \t]+$/,``)===``);e--)r++;return r===0?t:r>=2&&!n?t.slice(0,-(r-1)):t.slice(0,-r)}}function St(e){if(!e)return!0;switch(e.type){case`plain`:case`quoteDouble`:case`quoteSingle`:case`alias`:case`flowMapping`:case`flowSequence`:return!0;default:return!1}}var Ct=new WeakMap;function wt(e,t){let{node:n,root:r}=e,i=se(Ct,r,()=>new Set);return!i.has(n.position.end.offset)&&(i.add(n.position.end.offset),ut(n,t)&&!Tt(e.parent))?ke:``}function Tt(e){return k(e)&&!E(e,[`documentHead`,`documentBody`,`flowMapping`,`flowSequence`])}function A(e,t){return ye(` `.repeat(e),t)}function Et(e,t,n){let{node:r}=e,i=e.ancestors.filter(e=>e.type===`sequence`||e.type===`mapping`).length,a=dt(e),o=[r.type===`blockFolded`?`>`:`|`];r.indent!==null&&o.push(r.indent.toString()),r.chomping!==`clip`&&o.push(r.chomping===`keep`?`+`:`-`),vt(r)&&o.push(` `,n(`indicatorComment`));let s=xt(r,{parentIndent:i,isLastDescendant:a,options:t}),c=[];for(let[e,t]of s.entries())e===0&&c.push(w),c.push(we(C(Oe,t))),e===s.length-1?r.chomping===`keep`&&a&&c.push(be(t.length===0?w:Ae)):c.push(t.length===0?w:xe(Ae));return r.indent===null?o.push(Se(A(t.tabWidth,c))):o.push(be(A(r.indent-1+i,c))),o}var Dt=Et;function Ot(e,t,n){let{node:r}=e,i=r.type===`flowMapping`,a=i?`{`:`[`,o=i?`}`:`]`,s=ke;i&&r.children.length>0&&t.bracketSpacing&&(s=Oe);let c=u(0,r.children,-1),l=c?.type===`flowMappingItem`&&ht(c.key)&&ht(c.value);return[a,A(t.tabWidth,[s,kt(e,t,n),t.trailingComma===`none`?``:De(`,`),k(r)?[w,C(w,e.map(n,`endComments`))]:``]),l?``:s,o]}function kt(e,t,n){return e.map(({isLast:r,node:i,next:a})=>[n(),r?``:[`,`,Oe,i.position.start.line===a.position.start.line?``:wt(e,t.originalText)]],`children`)}function At(e,t,n){let{node:r,parent:i}=e,{key:a,value:o}=r,s=ht(a),c=ht(o);if(s&&c)return`: `;let l=n(`key`),u=Mt(r)?` `:``;if(c)return r.type===`flowMappingItem`&&i.type===`flowMapping`?l:r.type===`mappingItem`&&jt(a.content,t)&&!O(a.content)&&i.tag?.value!==`tag:yaml.org,2002:set`?[l,u,`:`]:[`? `,A(2,l)];let d=n(`value`);if(s)return[`: `,A(2,d)];if(D(o)||!St(a.content))return[`? `,A(2,l),w,...e.map(()=>[n(),w],`value`,`leadingComments`),`: `,A(2,d)];if(Nt(a.content)&&!D(a.content)&&!_t(a.content)&&!O(a.content)&&!k(a)&&!D(o.content)&&!_t(o.content)&&!k(o)&&jt(o.content,t)&&jt(a.content,t))return[l,u,`: `,d];let f=Symbol(`mappingKey`),p=Te([De(`? `),Te(A(2,l),{id:f})]),m=[w,`: `,A(2,d)],h=[u,`:`];k(o)&&o.content&&E(o.content,[`flowMapping`,`flowSequence`])&&o.content.children.length===0?h.push(` `):D(o.content)||k(o)&&o.content&&!E(o.content,[`mapping`,`sequence`])||i.type===`mapping`&&O(a.content)&&St(o.content)||E(o.content,[`mapping`,`sequence`])&&o.content.tag===null&&o.content.anchor===null?h.push(w):o.content?h.push(Oe):O(o)&&h.push(` `),h.push(d);let g=A(t.tabWidth,h);return jt(a.content,t)&&!D(a.content)&&!_t(a.content)&&!O(a.content)&&!k(a)?Ee([[l,g]]):Ee([[p,De(m,g,{groupId:f})]])}function jt(e,t){if(!e)return!0;switch(e.type){case`plain`:case`quoteSingle`:case`quoteDouble`:break;case`alias`:return!0;default:return!1}if(t.proseWrap===`preserve`)return e.position.start.line===e.position.end.line;if(/\\$/m.test(t.originalText.slice(e.position.start.offset,e.position.end.offset)))return!1;switch(t.proseWrap){case`never`:return!e.value.includes(`
|
|
16
|
-
`);case`always`:return!/[\n ]/.test(e.value);default:return!1}}function Mt(e){return e.key.content?.type===`alias`}function Nt(e){if(!e)return!0;switch(e.type){case`plain`:case`quoteDouble`:case`quoteSingle`:return e.position.start.line===e.position.end.line;case`alias`:return!0;default:return!1}}var Pt=At;function Ft(e){return ct(e,It)}function It(e){switch(e.type){case`document`:lt(e,`head`,()=>e.children[0]),lt(e,`body`,()=>e.children[1]);break;case`documentBody`:case`sequenceItem`:case`flowSequenceItem`:case`mappingKey`:case`mappingValue`:lt(e,`content`,()=>e.children[0]);break;case`mappingItem`:case`flowMappingItem`:lt(e,`key`,()=>e.children[0]),lt(e,`value`,()=>e.children[1])}return e}var Lt=Ft;function Rt(e,t,n){let{node:r}=e,i=[];r.type!==`mappingValue`&&D(r)&&i.push([C(w,e.map(n,`leadingComments`)),w]);let{tag:a,anchor:o}=r;a&&i.push(n(`tag`)),a&&o&&i.push(` `),o&&i.push(n(`anchor`));let s=``;return E(r,[`mapping`,`sequence`,`comment`,`directive`,`mappingItem`,`sequenceItem`])&&!dt(e)&&(s=wt(e,t.originalText)),(a||o)&&(E(r,[`sequence`,`mapping`])&&!_t(r)?i.push(w):i.push(` `)),_t(r)&&i.push([r.middleComments.length===1?``:w,C(w,e.map(n,`middleComments`)),w]),mt(e)?i.push(me(t.originalText.slice(r.position.start.offset,r.position.end.offset).trimEnd())):i.push(Te(zt(e,t,n))),O(r)&&!E(r,[`document`,`documentHead`])&&i.push(je([r.type===`mappingValue`&&!r.content?``:` `,e.parent.type===`mappingKey`&&e.getParentNode(2).type===`mapping`&&St(r)?``:Ce,n(`trailingComment`)])),Tt(r)&&i.push(A(r.type===`sequenceItem`?2:0,[w,C(w,e.map(({node:e})=>[Re(t.originalText,Ye(e))?w:``,n()],`endComments`))])),i.push(s),i}function zt(e,t,n){let{node:r}=e;switch(r.type){case`root`:{let t=ft(r),i=!(E(t,[`blockLiteral`,`blockFolded`])&&t.chomping===`keep`),a=[];return e.each(({node:t,isFirst:r})=>{r||a.push(w),a.push(n()),Vt(e)&&(i&&a.push(w),a.push(`...`),O(t)&&a.push(` `,n(`trailingComment`)))},`children`),i&&a.push(w),a}case`document`:{let t=[];return Ht(e)&&((r.head.children.length>0||r.head.endComments.length>0)&&t.push(n(`head`)),O(r.head)?t.push([`---`,` `,n([`head`,`trailingComment`])]):t.push(`---`)),Bt(r)&&t.push(n(`body`)),C(w,t)}case`documentHead`:return C(w,[...e.map(n,`children`),...e.map(n,`endComments`)]);case`documentBody`:{let{children:i,endComments:a}=r,o=``;if(i.length>0&&a.length>0){let e=ft(r);E(e,[`blockFolded`,`blockLiteral`])?e.chomping!==`keep`&&(o=[w,w]):o=E(u(0,i,-1),[`mapping`])&&Re(t.originalText,Ye(a[0]))?[w,w]:w}return[C(w,e.map(n,`children`)),o,C(w,e.map(n,`endComments`))]}case`directive`:return[`%`,C(` `,[r.name,...r.parameters])];case`comment`:return[`#`,r.value];case`alias`:return[`*`,r.value];case`tag`:return t.originalText.slice(r.position.start.offset,r.position.end.offset);case`anchor`:return[`&`,r.value];case`plain`:return Ut(r.type,t.originalText.slice(r.position.start.offset,r.position.end.offset),t);case`quoteDouble`:case`quoteSingle`:{let e=t.originalText.slice(r.position.start.offset+1,r.position.end.offset-1);if(r.type===`quoteSingle`&&e.includes(`\\`)||r.type===`quoteDouble`&&/\\[^"]/.test(e)){let n=r.type===`quoteDouble`?`"`:`'`;return[n,Ut(r.type,e,t),n]}if(e.includes(`"`))return[`'`,Ut(r.type,r.type===`quoteDouble`?f(0,f(0,e,`\\"`,`"`),`'`,`'`.repeat(2)):e,t),`'`];if(e.includes(`'`))return[`"`,Ut(r.type,r.type===`quoteSingle`?f(0,e,`''`,`'`):e,t),`"`];let n=t.singleQuote?`'`:`"`;return[n,Ut(r.type,e,t),n]}case`blockFolded`:case`blockLiteral`:return Dt(e,t,n);case`mapping`:case`sequence`:return C(w,e.map(n,`children`));case`sequenceItem`:return[`- `,A(2,r.content?n(`content`):``)];case`mappingKey`:case`mappingValue`:return r.content?n(`content`):``;case`mappingItem`:case`flowMappingItem`:return Pt(e,t,n);case`flowMapping`:return Ot(e,t,n);case`flowSequence`:return Ot(e,t,n);case`flowSequenceItem`:return n(`content`);default:throw new ze(r,`YAML`)}}function Bt(e){return e.body.children.length>0||k(e.body)}function Vt(e){let t=e.node;if(t.documentEndMarker||O(t))return!0;if(e.isLast)return!1;let n=e.next;return n.head.children.length>0||k(n.head)}function Ht(e){let t=e.node;return t.directivesEndMarker||t.head.children.length>0||k(t.head)||O(t.head)}function Ut(e,t,n){return C(w,bt(e,t,n).map(e=>we(C(Oe,e))))}var Wt={preprocess:Lt,embed:Ve,print:Rt,massageAstNode:at,insertPragma:it,getVisitorKeys:Je},Gt=[{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}],Kt={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.`}},qt={bracketSpacing:Kt.bracketSpacing,singleQuote:Kt.singleQuote,proseWrap:Kt.proseWrap},Jt={};o(Jt,{yaml:()=>Cs});var Yt=class extends SyntaxError{constructor(e,t){((...e)=>(super(...e),n(this,`name`,`YAMLSyntaxError`),n(this,`code`,void 0),n(this,`source`,void 0),n(this,`position`,void 0),this))(t.message,{cause:t}),this.cause??(this.cause=t),this.code=t.code,this.source=e.text,this.position=e.transformRange(t.pos)}};function j(e,t=null){`children`in e&&e.children.forEach(t=>j(t,e)),`anchor`in e&&e.anchor&&j(e.anchor,e),`tag`in e&&e.tag&&j(e.tag,e),`leadingComments`in e&&e.leadingComments.forEach(t=>j(t,e)),`middleComments`in e&&e.middleComments.forEach(t=>j(t,e)),`indicatorComment`in e&&e.indicatorComment&&j(e.indicatorComment,e),`trailingComment`in e&&e.trailingComment&&j(e.trailingComment,e),`endComments`in e&&e.endComments.forEach(t=>j(t,e)),Object.defineProperty(e,"_parent",{value:t,enumerable:!1})}function Xt(e){return`${e.line}:${e.column}`}function Zt(e){j(e);let t=Qt(e),n=e.children.slice();e.comments.filter(e=>!e._parent).forEach(e=>{for(;n.length>1&&e.position.start.line>n[0].position.end.line;)n.shift();en(e,t,n[0])})}function Qt(e){let t=Array.from(Array(e.position.end.line),()=>({}));for(let n of e.comments)t[n.position.start.line-1].comment=n;return $t(t,e),t}function $t(e,t){if(t.position.start.offset!==t.position.end.offset){if(`leadingComments`in t){let{start:n}=t.position,{leadingAttachableNode:r}=e[n.line-1];(!r||n.column<r.position.start.column)&&(e[n.line-1].leadingAttachableNode=t)}if(`trailingComment`in t&&t.position.end.column>1&&t.type!==`document`&&t.type!==`documentHead`){let{end:n}=t.position,{trailingAttachableNode:r}=e[n.line-1];(!r||n.column>=r.position.end.column)&&(e[n.line-1].trailingAttachableNode=t)}if(t.type!==`root`&&t.type!==`document`&&t.type!==`documentHead`&&t.type!==`documentBody`){let{start:n,end:r}=t.position,i=[r.line].concat(n.line===r.line?[]:n.line);for(let n of i){let i=e[n-1].trailingNode;(!i||r.column>=i.position.end.column)&&(e[n-1].trailingNode=t)}}`children`in t&&t.children.forEach(t=>{$t(e,t)})}}function en(e,t,n){let r=e.position.start.line,{trailingAttachableNode:i}=t[r-1];if(i){if(i.trailingComment)throw Error(`Unexpected multiple trailing comment at ${Xt(e.position.start)}`);j(e,i),i.trailingComment=e;return}for(let i=r;i>=n.position.start.line;i--){let{trailingNode:n}=t[i-1],a;if(n)a=n;else if(i!==r&&t[i-1].comment)a=t[i-1].comment._parent;else continue;if((a.type===`sequence`||a.type===`mapping`)&&(a=a.children[0]),a.type===`mappingItem`){let[e,t]=a.children;a=nn(e)?e:t}for(;;){if(tn(a,e)){j(e,a),a.endComments.push(e);return}if(!a._parent)break;a=a._parent}break}for(let i=r+1;i<=n.position.end.line;i++){let{leadingAttachableNode:n}=t[i-1];if(n){j(e,n),n.leadingComments.push(e);return}}let a=n.children[1];j(e,a),a.endComments.push(e)}function tn(e,t){if(e.position.start.offset<t.position.start.offset&&e.position.end.offset>t.position.end.offset)switch(e.type){case`flowMapping`:case`flowSequence`:return e.children.length===0||t.position.start.line>e.children[e.children.length-1].position.end.line}if(t.position.end.offset<e.position.end.offset)return!1;switch(e.type){case`sequenceItem`:return t.position.start.column>e.position.start.column;case`mappingKey`:case`mappingValue`:return t.position.start.column>e._parent.position.start.column&&(e.children.length===0||e.children.length===1&&e.children[0].type!==`blockFolded`&&e.children[0].type!==`blockLiteral`)&&(e.type===`mappingValue`||nn(e));default:return!1}}function nn(e){return e.position.start!==e.position.end&&(e.children.length===0||e.position.start.offset!==e.children[0].position.start.offset)}function rn(e,t,n){return{type:`root`,position:e,children:t,comments:n}}function an(e,t){return{start:e,end:t}}function on(e){return{start:e,end:e}}function sn(e,t){return{type:`comment`,position:t.transformRange([e.offset,e.offset+e.source.length]),value:e.source.slice(1)}}function cn(e,t){return{type:`anchor`,position:e,value:t}}function ln(e,t,n){return{anchor:t,tag:e,middleComments:n}}function un(e,t){return{type:`tag`,position:e,value:t}}function dn(e,t,n){let r=[],i=null,a=null,o=null;for(let s of t){let t=[s.offset,s.offset+s.source.length];switch(s.type){case`tag`:{i??(i=t);let r=e.tag??s.source.slice(s.source.startsWith(`!!`)?2:1);r===`!`&&(r=`tag:yaml.org,2002:str`),a=un(n.transformRange(t),r)}break;case`anchor`:i??(i=t),o=cn(n.transformRange(t),e.anchor);break;case`comment`:{let a=n.transformComment(s);i&&i[0]<=t[0]&&t[1]<=e.range[0]&&r.push(a);break}default:throw Error(`Unexpected content property token type: ${s.type}`)}}return ln(a,o,r)}function fn(e,t,n){return{type:`alias`,position:e,leadingComments:[],trailingComment:null,...t,value:n}}function*M(...e){for(let t of e)if(t)for(let e of t)pn(e)||(yield e)}function pn(e){return e.type===`space`||e.type===`newline`}function mn(e){return e.type===`comment`||e.type===`tag`||e.type===`anchor`}function N(e,t){let n=[];for(let r of M(e))r.type===`comment`?t.transformComment(r):n.push(r);return n}function hn(e,t,n){let r=e.srcToken;for(let e of N(r.end,t))throw Error(`Unexpected token type in alias end: ${e.type}`);return fn(t.transformRange(e.range),t.transformContentProperties(e,n.tokens),e.source)}function gn(e){return{...e,type:`blockFolded`}}function _n(e,t,n,r,i,a){return{type:`blockValue`,position:e,leadingComments:[],...t,chomping:n,indent:r,value:i,indicatorComment:a}}function vn(e,t,n,r){let i=null,a=null;for(let e of M(t.props))if(e.type===`comment`)a=n.transformComment(e);else if(e.type===`block-scalar-header`)i=e;else throw Error(`Unexpected token type in block value end: ${e.type}`);if(!i)throw Error(`Expected block scalar header token`);let o=yn(i.source);return _n(n.transformRange(e.range),n.transformContentProperties(e,r.tokens),o.chomping,o.indent,e.source,a)}function yn(e){let t=/([+-]?)(\d*)([+-]?)$/u.exec(e),n=null,r=`clip`;if(t){n=t[2]?Number(t[2]):null;let e=t[3]||t[1];r=e===`+`?`keep`:e===`-`?`strip`:`clip`}return{chomping:r,indent:n}}function bn(e,t,n){let r=e.srcToken;if(!r||r.type!==`block-scalar`)throw Error(`Expected block scalar srcToken`);return gn(vn(e,r,t,n))}function xn(e){return{...e,type:`blockLiteral`}}function Sn(e,t,n){let r=e.srcToken;if(!r||r.type!==`block-scalar`)throw Error(`Expected block scalar srcToken`);return xn(vn(e,r,t,n))}function Cn(e,t,n){return{type:`flowCollection`,position:e,leadingComments:[],trailingComment:null,endComments:[],...t,children:n}}function wn(e,t,n){return{...Cn(e,t,n),type:`flowMapping`}}function Tn(e,t,n){return{type:`flowMappingItem`,position:e,leadingComments:[],children:[t,n]}}function En(e,t){return{type:`mappingKey`,position:e,trailingComment:null,endComments:[],children:t?[t]:[]}}function Dn(e,t){return{type:`mappingValue`,position:e,leadingComments:[],trailingComment:null,endComments:[],children:t?[t]:[]}}function On(e,t,n,r){let i=[],a=null;for(let e of M(t.start)){if(mn(e)){i.push(e);continue}if(e.type===`explicit-key-ind`){a=e;continue}if(e.type!==`comma`)throw Error(`Unexpected token type in collection item start: ${e.type}`)}let o=[],s=null;for(let e of M(t.sep)){if(mn(e)){o.push(e);continue}if(e.type===`map-value-ind`){s=e;continue}throw Error(`Unexpected token type in collection item sep: ${e.type}`)}let c=a?.offset??t.key?.offset??s?.offset??t.value.offset,l=[c,t.key?e.key.range[1]:a?a.offset+a.source.length:c],u=null;if(e.value){let n=s?.offset??t.value?.offset??e.value.range[0];u=[n,t.value?e.value.range[1]:s?s.offset+s.source.length:n]}return kn(e,n,r,{range:l,props:{tokens:i}},{range:u,props:{tokens:o}})}function kn(e,t,n,r,i){let a=null;Jo(e.key,r.props)?N(r.props.tokens,t):a=t.transformNode(e.key,r.props);let o=null;Jo(e.value,i.props)?N(i.props.tokens,t):o=t.transformNode(e.value,i.props);let s=En(t.transformRange([r.range?r.range[0]:a.position.start.offset,a?a.position.end.offset:r.range[1]]),a),c=o||i.range?Dn(t.transformRange([i.range?i.range[0]:o.position.start.offset,o?o.position.end.offset:i.range[0]+1]),o):null;return n(an(s.position.start,c?c.position.end:s.position.end),s,c||Dn(on(s.position.end),null))}function An(e,t,n){let r=e.srcToken;if(!r||r.type!==`flow-collection`)throw Error(`Expected flow-collection CST node for flow map`);let i=e.items.map((e,n)=>{let i=r.items[n];return On(e,i,t,Tn)});if(e.items.length<r.items.length)for(let n=e.items.length;n<r.items.length;n++){let e=r.items[n];for(let n of N(e.start,t))if(n.type!==`comma`)throw Error(`Unexpected token type in collection item start: ${n.type}`)}let a=null;for(let e of N(r.end,t)){if(e.type===`flow-map-end`){a=e;continue}throw Error(`Unexpected token type in flow map end: ${e.type}`)}if(!a)throw Error(`Expected flow-map-end token`);return wn(t.transformRange([r.start.offset,a.offset+a.source.length]),t.transformContentProperties(e,n.tokens),i)}function jn(e,t,n){return{...Cn(e,t,n),type:`flowSequence`}}function Mn(e,t){return{type:`flowSequenceItem`,position:e,children:[t]}}function Nn(e){return e[e.length-1]}var Pn={};o(Pn,{Alias:()=>ar,CST:()=>Ra,Composer:()=>La,Document:()=>Xi,Lexer:()=>po,LineCounter:()=>mo,Pair:()=>Y,Parser:()=>So,Scalar:()=>K,Schema:()=>Ji,YAMLError:()=>Qi,YAMLMap:()=>X,YAMLParseError:()=>$i,YAMLSeq:()=>Z,YAMLWarning:()=>ea,isAlias:()=>L,isCollection:()=>V,isDocument:()=>zn,isMap:()=>R,isNode:()=>H,isPair:()=>z,isScalar:()=>B,isSeq:()=>Bn,parse:()=>Eo,parseAllDocuments:()=>wo,parseDocument:()=>To,stringify:()=>Do,visit:()=>Un,visitAsync:()=>Gn});var Fn=Symbol.for(`yaml.alias`),In=Symbol.for(`yaml.document`),P=Symbol.for(`yaml.map`),Ln=Symbol.for(`yaml.pair`),F=Symbol.for(`yaml.scalar`),Rn=Symbol.for(`yaml.seq`),I=Symbol.for(`yaml.node.type`),L=e=>!!e&&typeof e==`object`&&e[I]===Fn,zn=e=>!!e&&typeof e==`object`&&e[I]===In,R=e=>!!e&&typeof e==`object`&&e[I]===P,z=e=>!!e&&typeof e==`object`&&e[I]===Ln,B=e=>!!e&&typeof e==`object`&&e[I]===F,Bn=e=>!!e&&typeof e==`object`&&e[I]===Rn;function V(e){if(e&&typeof e==`object`)switch(e[I]){case P:case Rn:return!0}return!1}function H(e){if(e&&typeof e==`object`)switch(e[I]){case Fn:case P:case F:case Rn:return!0}return!1}var Vn=e=>(B(e)||V(e))&&!!e.anchor,U=Symbol(`break visit`),Hn=Symbol(`skip children`),W=Symbol(`remove node`);function Un(e,t){let n=qn(t);zn(e)?Wn(null,e.contents,n,Object.freeze([e]))===W&&(e.contents=null):Wn(null,e,n,Object.freeze([]))}Un.BREAK=U,Un.SKIP=Hn,Un.REMOVE=W;function Wn(e,t,n,r){let i=Jn(e,t,n,r);if(H(i)||z(i))return Yn(e,r,i),Wn(e,i,n,r);if(typeof i!=`symbol`){if(V(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=Wn(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else{if(i===U)return U;i===W&&(t.items.splice(e,1),--e)}}}else if(z(t)){r=Object.freeze(r.concat(t));let e=Wn(`key`,t.key,n,r);if(e===U)return U;e===W&&(t.key=null);let i=Wn(`value`,t.value,n,r);if(i===U)return U;i===W&&(t.value=null)}}return i}async function Gn(e,t){let n=qn(t);zn(e)?await Kn(null,e.contents,n,Object.freeze([e]))===W&&(e.contents=null):await Kn(null,e,n,Object.freeze([]))}Gn.BREAK=U,Gn.SKIP=Hn,Gn.REMOVE=W;async function Kn(e,t,n,r){let i=await Jn(e,t,n,r);if(H(i)||z(i))return Yn(e,r,i),Kn(e,i,n,r);if(typeof i!=`symbol`){if(V(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Kn(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else{if(i===U)return U;i===W&&(t.items.splice(e,1),--e)}}}else if(z(t)){r=Object.freeze(r.concat(t));let e=await Kn(`key`,t.key,n,r);if(e===U)return U;e===W&&(t.key=null);let i=await Kn(`value`,t.value,n,r);if(i===U)return U;i===W&&(t.value=null)}}return i}function qn(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Jn(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(R(t))return n.Map?.(e,t,r);if(Bn(t))return n.Seq?.(e,t,r);if(z(t))return n.Pair?.(e,t,r);if(B(t))return n.Scalar?.(e,t,r);if(L(t))return n.Alias?.(e,t,r)}function Yn(e,t,n){let r=t[t.length-1];if(V(r))r.items[e]=n;else if(z(r))e===`key`?r.key=n:r.value=n;else if(zn(r))r.contents=n;else{let e=L(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Xn={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Zn=e=>e.replace(/[!,[\]{}]/g,e=>Xn[e]),Qn=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),this.atNextDocument=!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Zn(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&H(e.contents)){let t={};Un(e.contents,(e,n)=>{H(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
17
|
-
`)}};Qn.defaultYaml={explicit:!1,version:`1.2`},Qn.defaultTags={"!!":`tag:yaml.org,2002:`};function $n(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function er(e){let t=new Set;return Un(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function tr(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function nr(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??(i=er(e));let a=tr(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(B(t.node)||V(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function rr(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=rr(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=rr(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=rr(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=rr(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function G(e,t,n){if(Array.isArray(e))return e.map((e,t)=>G(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Vn(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var ir=class{constructor(e){Object.defineProperty(this,I,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!zn(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=G(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?rr(i,{"":o},``,o):o}},ar=class extends ir{constructor(e){super(Fn),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Un(e,{Node:(e,t)=>{(L(t)||Vn(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||(G(a,null,t),o=n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=or(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if($n(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function or(e,t,n){if(L(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(V(t)){let r=0;for(let i of t.items){let t=or(e,i,n);t>r&&(r=t)}return r}if(z(t)){let r=or(e,t.key,n),i=or(e,t.value,n);return Math.max(r,i)}return 1}var sr=e=>!e||typeof e!=`function`&&typeof e!=`object`,K=class extends ir{constructor(e){super(F),this.value=e}toJSON(e,t){return t?.keep?this.value:G(this.value,e,t)}toString(){return String(this.value)}};K.BLOCK_FOLDED=`BLOCK_FOLDED`,K.BLOCK_LITERAL=`BLOCK_LITERAL`,K.PLAIN=`PLAIN`,K.QUOTE_DOUBLE=`QUOTE_DOUBLE`,K.QUOTE_SINGLE=`QUOTE_SINGLE`;var cr=`tag:yaml.org,2002:`;function lr(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function ur(e,t,n){if(zn(e)&&(e=e.contents),H(e))return e;if(z(e)){let t=n.schema[P].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new ar(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=cr+t.slice(2));let l=lr(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new K(e);return c&&(c.node=t),t}l=e instanceof Map?o[P]:Symbol.iterator in Object(e)?o[Rn]:o[P]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new K(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function dr(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return ur(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var fr=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,pr=class extends ir{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>H(t)||z(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(fr(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(V(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,dr(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(V(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&B(i)?i.value:i:V(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!z(t))return!1;let n=t.value;return n==null||e&&B(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return V(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(V(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,dr(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},mr=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function q(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var hr=(e,t,n)=>e.endsWith(`
|
|
18
|
-
`)?q(n,t):n.includes(`
|
|
19
|
-
`)?`
|
|
20
|
-
`+q(n,t):(e.endsWith(` `)?``:` `)+n,gr=`flow`,_r=`block`,vr=`quoted`;function yr(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===_r&&(h=br(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===vr&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
21
|
-
`)n===_r&&(h=br(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
22
|
-
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
23
|
-
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===vr){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`
|
|
24
|
-
${t}${e.slice(0,a)}`:(n===vr&&u[i]&&(v+=`${e[i]}\\`),v+=`
|
|
25
|
-
${t}${e.slice(i+1,a)}`)}return v}function br(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
26
|
-
`);r=t,i=t+1,a=e[i]}return r}var xr=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Sr=e=>/^(%|---|\.\.\.)/m.test(e);function Cr(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
27
|
-
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function wr(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Sr(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
28
|
-
|
|
29
|
-
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
30
|
-
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:yr(o,a,vr,xr(t,!1))}function Tr(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
31
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return wr(e,t);let n=t.indent||(Sr(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&
|
|
32
|
-
${n}`)+`'`;return t.implicitKey?r:yr(r,n,gr,xr(t,!1))}function Er(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=wr;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Tr:i&&!t?wr:n?Tr:wr}return r(e,t)}var Dr;try{Dr=RegExp(`(^|(?<!
|
|
33
|
-
))
|
|
34
|
-
+(?!
|
|
35
|
-
|$)`,`g`)}catch{Dr=/\n+(?!\n|$)/g}function Or({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Er(n,r);let l=r.indent||(r.forceBlockIndent||Sr(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===K.BLOCK_FOLDED?!1:t===K.BLOCK_LITERAL||!Cr(n,c,l.length);if(!n)return u?`|
|
|
36
|
-
`:`>
|
|
37
|
-
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
38
|
-
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
39
|
-
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
40
|
-
`&&(p=p.slice(0,-1)),p=p.replace(Dr,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
41
|
-
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&(n=n.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
42
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=xr(r,!0);o!==`folded`&&t!==K.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=yr(`${v}${e}${p}`,l,_r,a);if(!i)return`>${y}
|
|
43
|
-
${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}
|
|
44
|
-
${l}${v}${n}${p}`}function kr(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
45
|
-
`)||u&&/[[\]{},]/.test(a))return Er(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
46
|
-
`)?Er(a,t):Or(e,t,n,r);if(!s&&!u&&i!==K.PLAIN&&a.includes(`
|
|
47
|
-
`))return Or(e,t,n,r);if(Sr(a)){if(c===``)return t.forceBlockIndent=!0,Or(e,t,n,r);if(s&&c===l)return Er(a,t)}let d=a.replace(/\n+/g,`$&
|
|
48
|
-
${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return Er(a,t)}return s?d:yr(d,c,gr,xr(t,!1))}function Ar(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==K.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=K.QUOTE_DOUBLE);let c=e=>{switch(e){case K.BLOCK_FOLDED:case K.BLOCK_LITERAL:return i||a?Er(o.value,t):Or(o,t,n,r);case K.QUOTE_DOUBLE:return wr(o.value,t);case K.QUOTE_SINGLE:return Tr(o.value,t);case K.PLAIN:return kr(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function jr(e,t){let n=Object.assign({blockQuote:!0,commentString:mr,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Mr(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(B(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Nr(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(B(e)||V(e))&&e.anchor;a&&$n(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Pr(e,t,n,r){if(z(e))return e.toString(t,n,r);if(L(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=H(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=Mr(t.doc.schema.tags,a));let o=Nr(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):B(a)?Ar(a,t,n,r):a.toString(t,n,r);return o?B(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}
|
|
49
|
-
${t.indent}${s}`:s}function Fr({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=H(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(V(e)||!H(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||V(e)||(B(e)?e.type===K.BLOCK_FOLDED||e.type===K.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Pr(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=hr(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=hr(g,n.indent,l(f))),g=`? ${g}
|
|
50
|
-
${s}:`):(g=`${g}:`,f&&(g+=hr(g,n.indent,l(f))));let _,v,y;H(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&B(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Bn(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Pr(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
51
|
-
`:``,v){let e=l(v);S+=`
|
|
52
|
-
${q(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
53
|
-
`&&y&&(S=`
|
|
54
|
-
|
|
55
|
-
`):S+=`
|
|
56
|
-
${n.indent}`}else if(!p&&V(t)){let e=x[0],r=x.indexOf(`
|
|
57
|
-
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`
|
|
58
|
-
${n.indent}`)}}else(x===``||x[0]===`
|
|
59
|
-
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=hr(g,n.indent,l(y)):h&&i&&i(),g}function Ir(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Lr=`<<`,J={identify:e=>e===Lr||typeof e==`symbol`&&e.description===Lr,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new K(Symbol(Lr)),{addToJSMap:zr}),stringify:()=>Lr},Rr=(e,t)=>(J.identify(t)||B(t)&&(!t.type||t.type===K.PLAIN)&&J.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===J.tag&&e.default);function zr(e,t,n){let r=Vr(e,n);if(Bn(r))for(let n of r.items)Br(e,t,n);else if(Array.isArray(r))for(let n of r)Br(e,t,n);else Br(e,t,r)}function Br(e,t,n){let r=Vr(e,n);if(!R(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Vr(e,t){return e&&L(t)?t.resolve(e.doc,e):t}function Hr(e,t,{key:n,value:r}){if(H(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Rr(e,n))zr(e,t,r);else{let i=G(n,``,e);if(t instanceof Map)t.set(i,G(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Ur(n,i,e),o=G(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Ur(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(H(e)&&n?.doc){let t=jr(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Ir(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Wr(e,t,n){return new Y(ur(e,void 0,n),ur(t,void 0,n))}var Y=class e{constructor(e,t=null){Object.defineProperty(this,I,{value:Ln}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return H(n)&&(n=n.clone(t)),H(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Hr(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Fr(this,e,t,n):JSON.stringify(this)}};function Gr(e,t,n){return(t.inFlow??e.flow?qr:Kr)(e,t,n)}function Kr({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(H(i))!d&&i.spaceBefore&&f.push(``),Jr(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(z(i)){let e=H(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Jr(n,f,e.commentBefore,d))}d=!1;let s=Pr(i,u,()=>o=null,()=>d=!0);o&&(s+=hr(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`
|
|
60
|
-
${c}${t}`:`
|
|
61
|
-
`}}return e?(p+=`
|
|
62
|
-
`+q(l(e),c),s&&s()):d&&o&&o(),p}function qr({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(H(i))i.spaceBefore&&d.push(``),Jr(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(z(i)){let e=H(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Jr(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=H(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Pr(i,c,()=>a=null);l||(l=d.length>u||o.includes(`
|
|
63
|
-
`)),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth)),l&&(o+=`,`)),a&&(o+=hr(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`
|
|
64
|
-
${a}${i}${t}`:`
|
|
65
|
-
`;return`${e}
|
|
66
|
-
${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function Jr({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=q(t(r),e);n.push(i.trimStart())}}function Yr(e,t){let n=B(t)?t.value:t;for(let r of e)if(z(r)&&(r.key===t||r.key===n||B(r.key)&&r.key.value===n))return r}var X=class extends pr{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(P,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Wr(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=z(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Y(e,e?.value):new Y(e.key,e.value);let r=Yr(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);B(r.value)&&sr(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Yr(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Yr(this.items,e)?.value;return(!t&&B(n)?n.value:n)??void 0}has(e){return!!Yr(this.items,e)}set(e,t){this.add(new Y(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Hr(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!z(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Gr(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Xr={collection:`map`,default:!0,nodeClass:X,tag:`tag:yaml.org,2002:map`,resolve(e,t){return R(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>X.from(e,t,n)},Z=class extends pr{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Rn,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Zr(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Zr(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&B(r)?r.value:r}has(e){let t=Zr(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Zr(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];B(r)&&sr(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(G(e,String(r++),t));return n}toString(e,t,n){return e?Gr(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(ur(a,void 0,n))}}return i}};function Zr(e){let t=B(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Qr={collection:`seq`,default:!0,nodeClass:Z,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Bn(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Z.from(e,t,n)},$r={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ar(e,t,n,r)}},ei={identify:e=>e==null,createNode:()=>new K(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new K(null),stringify:({source:e},t)=>typeof e==`string`&&ei.test.test(e)?e:t.options.nullStr},ti={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new K(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&ti.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Q({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var ni={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Q},ri={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Q(e)}},ii={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new K(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:Q},ai=e=>typeof e==`bigint`||Number.isInteger(e),oi=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function si(e,t,n){let{value:r}=e;return ai(r)&&r>=0?n+r.toString(t):Q(e)}var ci={identify:e=>ai(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>oi(e,2,8,n),stringify:e=>si(e,8,`0o`)},li={identify:ai,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>oi(e,0,10,n),stringify:Q},ui={identify:e=>ai(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>oi(e,2,16,n),stringify:e=>si(e,16,`0x`)},di=[Xr,Qr,$r,ei,ti,ci,li,ui,ni,ri,ii];function fi(e){return typeof e==`bigint`||Number.isInteger(e)}var pi=({value:e})=>JSON.stringify(e),mi=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:pi},{identify:e=>e==null,createNode:()=>new K(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:pi},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:pi},{identify:fi,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>fi(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:pi}],hi=[Xr,Qr].concat(mi,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),gi={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??(t=K.BLOCK_LITERAL),t!==K.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===K.BLOCK_LITERAL?`
|
|
67
|
-
`:` `)}return Ar({comment:e,type:t,value:s},r,i,a)}};function _i(e,t){if(Bn(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!z(r)){if(R(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Y(new K(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}
|
|
68
|
-
${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}
|
|
69
|
-
${t.comment}`:r.comment}r=e}e.items[n]=z(r)?r:new Y(r)}}else t(`Expected a sequence for this tag`);return e}function vi(e,t,n){let{replacer:r}=n,i=new Z(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Wr(o,s,n))}return i}var yi={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:_i,createNode:vi},bi=class e extends Z{constructor(){super(),this.add=X.prototype.add.bind(this),this.delete=X.prototype.delete.bind(this),this.get=X.prototype.get.bind(this),this.has=X.prototype.has.bind(this),this.set=X.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(z(e)?(r=G(e.key,``,t),i=G(e.value,r,t)):r=G(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=vi(e,t,n),i=new this;return i.items=r.items,i}};bi.tag=`tag:yaml.org,2002:omap`;var xi={collection:`seq`,identify:e=>e instanceof Map,nodeClass:bi,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=_i(e,t),r=[];for(let{key:e}of n.items)B(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new bi,n)},createNode:(e,t,n)=>bi.from(e,t,n)};function Si({value:e,source:t},n){return t&&(e?Ci:wi).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Ci={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new K(!0),stringify:Si},wi={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new K(!1),stringify:Si},Ti={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Q},Ei={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Q(e)}},Di={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new K(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:Q},Oi=e=>typeof e==`bigint`||Number.isInteger(e);function ki(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Ai(e,t,n){let{value:r}=e;if(Oi(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Q(e)}var ji={identify:Oi,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ki(e,2,2,n),stringify:e=>Ai(e,2,`0b`)},Mi={identify:Oi,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ki(e,1,8,n),stringify:e=>Ai(e,8,`0`)},Ni={identify:Oi,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ki(e,0,10,n),stringify:Q},Pi={identify:Oi,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ki(e,2,16,n),stringify:e=>Ai(e,16,`0x`)},Fi=class e extends X{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=z(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Y(e.key,null):new Y(e,null),Yr(this.items,t.key)||this.items.push(t)}get(e,t){let n=Yr(this.items,e);return!t&&z(n)?B(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Yr(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Y(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Wr(e,null,n));return i}};Fi.tag=`tag:yaml.org,2002:set`;var Ii={collection:`map`,identify:e=>e instanceof Set,nodeClass:Fi,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>Fi.from(e,t,n),resolve(e,t){if(R(e)){if(e.hasAllNullValues(!0))return Object.assign(new Fi,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Li(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function Ri(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Q(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var zi={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Li(e,n),stringify:Ri},Bi={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Li(e,!1),stringify:Ri},Vi={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Vi.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Li(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},Hi=[Xr,Qr,$r,ei,Ci,wi,ji,Mi,Ni,Pi,Ti,Ei,Di,gi,J,xi,yi,Ii,zi,Bi,Vi],Ui=new Map([[`core`,di],[`failsafe`,[Xr,Qr,$r]],[`json`,hi],[`yaml11`,Hi],[`yaml-1.1`,Hi]]),Wi={binary:gi,bool:ti,float:ii,floatExp:ri,floatNaN:ni,floatTime:Bi,int:li,intHex:ui,intOct:ci,intTime:zi,map:Xr,merge:J,null:ei,omap:xi,pairs:yi,seq:Qr,set:Ii,timestamp:Vi},Gi={"tag:yaml.org,2002:binary":gi,"tag:yaml.org,2002:merge":J,"tag:yaml.org,2002:omap":xi,"tag:yaml.org,2002:pairs":yi,"tag:yaml.org,2002:set":Ii,"tag:yaml.org,2002:timestamp":Vi};function Ki(e,t,n){let r=Ui.get(t);if(r&&!e)return n&&!r.includes(J)?r.concat(J):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(Ui.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(J)),i.reduce((e,t)=>{let n=typeof t==`string`?Wi[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(Wi).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var qi=(e,t)=>e.key<t.key?-1:+(e.key>t.key),Ji=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Ki(e,`compat`):e?Ki(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?Gi:{},this.tags=Ki(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,P,{value:Xr}),Object.defineProperty(this,F,{value:$r}),Object.defineProperty(this,Rn,{value:Qr}),this.sortMapEntries=typeof a==`function`?a:a===!0?qi:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Yi(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=jr(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(q(t,``))}let o=!1,s=null;if(e.contents){if(H(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(q(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=Pr(e.contents,i,()=>s=null,t);s&&(c+=hr(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Pr(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
|
|
70
|
-
`)?(n.push(`...`),n.push(q(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(q(a(t),``)))}return n.join(`
|
|
71
|
-
`)+`
|
|
72
|
-
`}var Xi=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,I,{value:In});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Qn({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[I]:{value:In}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=H(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Zi(this.contents)&&this.contents.add(e)}addIn(e,t){Zi(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=er(this);e.anchor=!t||n.has(t)?tr(t||`a`,n):t}return new ar(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=nr(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=ur(e,l,p);return o&&V(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Y(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Zi(this.contents)?this.contents.delete(e):!1}deleteIn(e){return fr(e)?this.contents!=null&&(this.contents=null,!0):Zi(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return V(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return fr(e)?!t&&B(this.contents)?this.contents.value:this.contents:V(this.contents)?this.contents.getIn(e,t):void 0}has(e){return V(this.contents)?this.contents.has(e):!1}hasIn(e){return fr(e)?this.contents!==void 0:V(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=dr(this.schema,[e],t):Zi(this.contents)&&this.contents.set(e,t)}setIn(e,t){fr(e)?this.contents=t:this.contents==null?this.contents=dr(this.schema,Array.from(e),t):Zi(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new Qn({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new Qn({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Ji(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=G(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?rr(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Yi(this,e)}};function Zi(e){if(V(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Qi=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},$i=class extends Qi{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},ea=class extends Qi{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},ta=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
73
|
-
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:
|
|
74
|
-
|
|
75
|
-
${o}
|
|
76
|
-
${s}
|
|
77
|
-
`}};function na(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),m=!1),h&&(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),h=null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??(x=i.offset),l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],ee=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:ee,start:x??ee}}function ra(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
78
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(ra(t.key)||ra(t.value))return!0}return!1;default:return!0}}function ia(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&ra(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function aa(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||B(e)&&B(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var oa=`All mapping items must start at the same column`;function sa({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??X)(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=na(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,oa)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|
79
|
-
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||ra(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,oa);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&ia(r.indent,u,i),n.atKey=!1,aa(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=na(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&ia(r.indent,f,i),s=c.range[2];let l=new Y(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
|
80
|
-
`+_.comment:g.comment=_.comment);let e=new Y(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function ca({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Z)(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=na(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&ia(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function la(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var ua=`Block collections are not allowed within flow collections`,da=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function fa({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?X:Z))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=na(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
|
81
|
-
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&ra(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;e:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break e;default:break e}if(e){let t=c.items[c.items.length-1];z(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
82
|
-
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],da(m)&&i(r.range,`BLOCK_IN_FLOW`,ua)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);da(f)&&i(g.range,`BLOCK_IN_FLOW`,ua),n.atKey=!1;let _=na(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?da(m)&&i(v.range,`BLOCK_IN_FLOW`,ua):_.comment&&(g.comment?g.comment+=`
|
|
83
|
-
`+_.comment:g.comment=_.comment);let y=new Y(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;aa(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new X(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=la(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
84
|
-
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function pa(e,t,n,r,i,a){let o=n.type===`block-map`?sa(e,t,n,r,a):n.type===`block-seq`?ca(e,t,n,r,a):fa(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function ma(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===X.tagName&&s===`map`||o===Z.tagName&&s===`seq`)return pa(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),pa(e,t,n,i,o)}let l=pa(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=H(u)?u:new K(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function ha(e,t,n){let r=t.offset,i=ga(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?K.BLOCK_FOLDED:K.BLOCK_LITERAL,o=t.source?_a(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
85
|
-
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
86
|
-
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===K.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
87
|
-
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
88
|
-
`:!p&&f===`
|
|
89
|
-
`&&(f=`
|
|
90
|
-
|
|
91
|
-
`),d+=f+t.slice(c)+r,f=`
|
|
92
|
-
`,p=!0):r===``?f===`
|
|
93
|
-
`?d+=`
|
|
94
|
-
`:f=`
|
|
95
|
-
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|
96
|
-
`+o[e][0].slice(c);d[d.length-1]!==`
|
|
97
|
-
`&&(d+=`
|
|
98
|
-
`);break;default:d+=`
|
|
99
|
-
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function ga({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function _a(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function va(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=K.PLAIN,c=ya(a,l);break;case`single-quoted-scalar`:s=K.QUOTE_SINGLE,c=ba(a,l);break;case`double-quoted-scalar`:s=K.QUOTE_DOUBLE,c=Sa(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=la(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function ya(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),xa(e)}function ba(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),xa(e.slice(1,-1)).replace(/''/g,`'`)}function xa(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
100
|
-
`,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
101
|
-
`,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
|
|
102
|
-
`?i+=a:a=`
|
|
103
|
-
`:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function Sa(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
|
104
|
-
`){if(i===`
|
|
105
|
-
`){let{fold:t,offset:i}=Ca(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=wa[i];if(a)n+=a;else if(i===`
|
|
106
|
-
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
|
107
|
-
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=Ta(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
|
108
|
-
`&&(a!==`\r`||e[r+2]!==`
|
|
109
|
-
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function Ca(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|
110
|
-
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
|
111
|
-
`);)r===`
|
|
112
|
-
`&&(n+=`
|
|
113
|
-
`),t+=1,r=e[t+1];return n||(n=` `),{fold:n,offset:t}}var wa={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
114
|
-
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Ta(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function Ea(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?ha(e,t,r):va(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[F]:c?Da(e.schema,i,c,n,r):t.type===`scalar`?Oa(e,i,t,r):e.schema[F];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=B(a)?a:new K(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new K(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Da(e,t,n,r,i){if(n===`!`)return e[F];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[F])}function Oa({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[F];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[F];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function ka(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Aa={composeNode:ja,composeEmptyNode:Ma};function ja(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Na(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=Ea(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=ma(Aa,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??(l=Ma(e,t.offset,void 0,null,n,r)),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!B(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Ma(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Ea(e,{type:`scalar`,offset:ka(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Na({options:e},{offset:t,source:n,end:r},i){let a=new ar(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=la(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Pa(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Xi(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=na(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?ja(c,i,l,o):Ma(c,l.end,r,null,l,o);let u=s.contents.range[2],d=la(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Fa(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function Ia(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
115
|
-
|
|
116
|
-
`:`
|
|
117
|
-
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var La=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Fa(e);r?this.warnings.push(new ea(i,t,n)):this.errors.push(new $i(i,t,n))},this.directives=new Qn({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Ia(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
118
|
-
${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(V(i)&&!i.flow&&i.items.length>0){let e=i.items[0];z(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}
|
|
119
|
-
${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}
|
|
120
|
-
${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ia(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=Fa(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Pa(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new $i(Fa(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new $i(Fa(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=la(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
|
|
121
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new $i(Fa(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Xi(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},Ra={};o(Ra,{BOM:()=>$a,DOCUMENT:()=>eo,FLOW_END:()=>to,SCALAR:()=>no,createScalarToken:()=>Ba,isCollection:()=>ro,isScalar:()=>io,prettyToken:()=>ao,resolveAsScalar:()=>za,setScalarValue:()=>Va,stringify:()=>Ga,tokenType:()=>oo,visit:()=>Za});function za(e,t=!0,n){if(e){let r=(e,t,r)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(n)n(i,t,r);else throw new $i([i,i+1],t,r)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return va(e,t,r);case`block-scalar`:return ha({options:{strict:t}},e,r)}}return null}function Ba(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:a=-1,type:o=`PLAIN`}=t,s=Ar({type:o,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:`newline`,offset:-1,indent:r,source:`
|
|
122
|
-
`}];switch(s[0]){case`|`:case`>`:{let e=s.indexOf(`
|
|
123
|
-
`),t=s.substring(0,e),n=s.substring(e+1)+`
|
|
124
|
-
`,i=[{type:`block-scalar-header`,offset:a,indent:r,source:t}];return Ua(i,c)||i.push({type:`newline`,offset:-1,indent:r,source:`
|
|
125
|
-
`}),{type:`block-scalar`,offset:a,indent:r,props:i,source:n}}case`"`:return{type:`double-quoted-scalar`,offset:a,indent:r,source:s,end:c};case`'`:return{type:`single-quoted-scalar`,offset:a,indent:r,source:s,end:c};default:return{type:`scalar`,offset:a,indent:r,source:s,end:c}}}function Va(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:a=!1,type:o}=n,s=`indent`in e?e.indent:null;if(r&&typeof s==`number`&&(s+=2),!o)switch(e.type){case`single-quoted-scalar`:o=`QUOTE_SINGLE`;break;case`double-quoted-scalar`:o=`QUOTE_DOUBLE`;break;case`block-scalar`:{let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);o=t.source[0]===`>`?`BLOCK_FOLDED`:`BLOCK_LITERAL`;break}default:o=`PLAIN`}let c=Ar({type:o,value:t},{implicitKey:i||s===null,indent:s!==null&&s>0?` `.repeat(s):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case`|`:case`>`:Ha(e,c);break;case`"`:Wa(e,c,`double-quoted-scalar`);break;case`'`:Wa(e,c,`single-quoted-scalar`);break;default:Wa(e,c,`scalar`)}}function Ha(e,t){let n=t.indexOf(`
|
|
126
|
-
`),r=t.substring(0,n),i=t.substring(n+1)+`
|
|
127
|
-
`;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];Ua(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
|
|
128
|
-
`});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function Ua(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function Wa(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:`
|
|
129
|
-
`};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}var Ga=e=>`type`in e?Ka(e):qa(e);function Ka(e){switch(e.type){case`block-scalar`:{let t=``;for(let n of e.props)t+=Ka(n);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=qa(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=qa(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=qa(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function qa({start:e,key:t,sep:n,value:r}){let i=``;for(let t of e)i+=t.source;if(t&&(i+=Ka(t)),n)for(let e of n)i+=e.source;return r&&(i+=Ka(r)),i}var Ja=Symbol(`break visit`),Ya=Symbol(`skip children`),Xa=Symbol(`remove item`);function Za(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Qa(Object.freeze([]),e,t)}Za.BREAK=Ja,Za.SKIP=Ya,Za.REMOVE=Xa,Za.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Za.parentCollection=(e,t)=>{let n=Za.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Qa(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Qa(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else{if(r===Ja)return Ja;r===Xa&&(a.items.splice(t,1),--t)}}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}var $a=``,eo=``,to=``,no=``,ro=e=>!!e&&`items`in e,io=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function ao(e){switch(e){case $a:return`<BOM>`;case eo:return`<DOC>`;case to:return`<FLOW_END>`;case no:return`<SCALAR>`;default:return JSON.stringify(e)}}function oo(e){switch(e){case $a:return`byte-order-mark`;case eo:return`doc-mode`;case to:return`flow-error-end`;case no:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
130
|
-
`:case`\r
|
|
131
|
-
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function $(e){switch(e){case void 0:case` `:case`
|
|
132
|
-
`:case`\r`:case` `:return!0;default:return!1}}var so=new Set(`0123456789ABCDEFabcdef`),co=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),lo=new Set(`,[]{}`),uo=new Set(` ,[]{}
|
|
133
|
-
\r `),fo=e=>!e||uo.has(e),po=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
|
134
|
-
`||t===`\r`&&this.buffer[e+1]===`
|
|
135
|
-
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
|
136
|
-
`||!t&&!this.atEnd)return e+n+1}return t===`
|
|
137
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&$(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
138
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===$a&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield eo,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&$(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!$(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&$(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(fo),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&$(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield to,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(fo),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||$(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
139
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
|
140
|
-
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>$(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
|
141
|
-
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
|
142
|
-
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
|
143
|
-
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
|
144
|
-
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
|
145
|
-
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield no,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if($(r)||e&&lo.has(r))break;t=n}else if($(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|
146
|
-
`?(n+=1,r=`
|
|
147
|
-
`,i=this.buffer[n+1]):t=n),i===`#`||e&&lo.has(i))break;if(r===`
|
|
148
|
-
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&lo.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield no,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case`&`:e+=yield*this.pushUntil(fo),e+=yield*this.pushSpaces(!0);continue e;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if($(n)||t&&lo.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!$(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(co.has(t))t=this.buffer[++e];else if(t===`%`&&so.has(this.buffer[e+1])&&so.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
149
|
-
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
150
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},mo=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function ho(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function go(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function _o(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function vo(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function yo(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break e}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function bo(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function xo(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!ho(t.start,`explicit-key-ind`)&&!ho(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,_o(t.value)?t.value.end?bo(t.value.end,t.sep):t.value.end=t.sep:bo(t.start,t.sep),delete t.sep)}var So=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new po,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=oo(e);if(t){if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&xo(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&go(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:go(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=yo(vo(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
151
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
152
|
-
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){bo(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(t.sep){if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ho(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(_o(t.key)&&!ho(t.sep,`newline`)){let e=yo(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else if(ho(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=yo(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):ho(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!ho(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){bo(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||ho(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=yo(vo(t));xo(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
153
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
154
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=yo(vo(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=yo(vo(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Co(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new mo||null,prettyErrors:t}}function wo(e,t={}){let{lineCounter:n,prettyErrors:r}=Co(t),i=new So(n?.addNewLine),a=new La(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(let t of o)t.errors.forEach(ta(e,n)),t.warnings.forEach(ta(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function To(e,t={}){let{lineCounter:n,prettyErrors:r}=Co(t),i=new So(n?.addNewLine),a=new La(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new $i(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(ta(e,n)),o.warnings.forEach(ta(e,n))),o}function Eo(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=To(e,n);if(!i)return null;if(i.warnings.forEach(e=>Ir(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Do(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return zn(e)&&!r?e.toString(n):new Xi(e,r,n).toString(n)}var Oo=Pn;function ko(e,t,n){let r=e.srcToken;if(!r||r.type!==`flow-collection`)throw Error(`Expected flow-collection CST node for flow sequence`);let i=e.items.map((e,n)=>{let i=r.items[n];if(Ao(e,i))return On(Nn(e.items),i,t,Tn);if(z(e))return On(e,i,t,Tn);{let n=[];for(let e of M(i.start)){if(mn(e)){n.push(e);continue}if(e.type!==`comma`)throw Error(`Unexpected token type in sequence item start: ${e.type}`)}let r=t.transformNode(e,{tokens:n});return Mn(an(r.position.start,r.position.end),r)}});if(e.items.length<r.items.length)for(let n=e.items.length;n<r.items.length;n++){let e=r.items[n];for(let n of N(e.start,t))if(n.type!==`comma`)throw Error(`Unexpected token type in collection item start: ${n.type}`)}let a=null;for(let e of M(r.end)){if(e.type===`comment`){t.transformComment(e);continue}if(e.type===`flow-seq-end`){a=e;continue}throw Error(`Unexpected token type in flow seq end: ${e.type}`)}if(!a)throw Error(`Expected flow-seq-end token`);return jn(t.transformRange([r.start.offset,a.offset+a.source.length]),t.transformContentProperties(e,n.tokens),i)}function Ao(e,t){return e.srcToken||!R(e)?!1:e.items.length===1&&e.items[0].srcToken===t}function jo(e,t,n){return{type:`mapping`,position:e,leadingComments:[],...t,children:n}}function Mo(e,t,n){return{type:`mappingItem`,position:e,leadingComments:[],children:[t,n]}}function No(e,t,n){let r=e.srcToken;if(!r||r.type!==`block-map`)throw Error(`Expected block mapping srcToken`);let i=e.items.map((e,n)=>{let i=r.items[n];return On(e,i,t,Mo)});if(e.items.length<r.items.length)for(let n=e.items.length;n<r.items.length;n++){let e=r.items[n];for(let n of N(e.start,t))throw Error(`Unexpected token type in collection item start: ${n.type}`)}return jo(an(i[0].position.start,Nn(i).position.end),t.transformContentProperties(e,n.tokens),i)}function Po(e,t,n){return{type:`plain`,position:e,leadingComments:[],trailingComment:null,...t,value:n}}function Fo(e,t,n){for(let r=t;r>=0;r--)if(n.test(e[r]))return r;return-1}function Io(e,t,n){if(e.range[0]===e.range[1]){let r=Fo(t.text,e.range[0]-1,/\S/u)+1;return Po(t.transformRange([r,r]),t.transformContentProperties(e,n.tokens),``)}let r=e.srcToken;if(!r||r.type!==`scalar`)throw Error(`Expected plain scalar srcToken`);for(let e of N(r.end,t))throw Error(`Unexpected token type in plain scalar end: ${e.type}`);return Po(t.transformRange(e.range),t.transformContentProperties(e,n.tokens),e.source)}function Lo(e){return{...e,type:`quoteDouble`}}function Ro(e,t,n){return{type:`quoteValue`,position:e,...t,leadingComments:[],trailingComment:null,value:n}}function zo(e,t,n,r){for(let e of N(t.end,n))throw Error(`Unexpected token type in quote value end: ${e.type}`);return Ro(n.transformRange(e.range),n.transformContentProperties(e,r.tokens),e.source)}function Bo(e,t,n){let r=e.srcToken;if(!r||r.type!==`double-quoted-scalar`)throw Error(`Expected double-quoted scalar srcToken`);return Lo(zo(e,r,t,n))}function Vo(e){return{...e,type:`quoteSingle`}}function Ho(e,t,n){let r=e.srcToken;if(!r||r.type!==`single-quoted-scalar`)throw Error(`Expected single-quoted scalar srcToken`);return Vo(zo(e,r,t,n))}function Uo(e,t,n){return{type:`sequence`,position:e,leadingComments:[],endComments:[],...t,children:n}}function Wo(e,t){return{type:`sequenceItem`,position:e,leadingComments:[],trailingComment:null,endComments:[],children:t?[t]:[]}}function Go(e,t,n){let r=e.srcToken;if(!r||r.type!==`block-seq`)throw Error(`Expected block sequence srcToken`);let i=e.items.map((e,n)=>{let i=r.items[n],a=[],o=null;for(let e of M(i.start)){if(mn(e)){a.push(e);continue}if(e.type===`seq-item-ind`){o=e;continue}throw Error(`Unexpected token type in sequence item start: ${e.type}`)}let s=Ko(e,t,{tokens:a});return Wo(an(o?t.transformOffset(o.offset):s.position.start,s?.position.end??t.transformOffset(o.offset+o.source.length)),s)});if(e.items.length<r.items.length)for(let n=e.items.length;n<r.items.length;n++){let e=r.items[n];for(let n of N(e.start,t))throw Error(`Unexpected token type in collection item start: ${n.type}`)}return Uo(an(i[0].position.start,Nn(i).position.end),t.transformContentProperties(e,n.tokens),i)}function Ko(e,t,n){if(!z(e))return Jo(e,n)?(N(n.tokens,t),null):t.transformNode(e,n);let r=e.srcToken,i=On(e,r,t,Mo);return jo(i.position,t.transformContentProperties(e.key,n.tokens),[i])}function qo(e,t,n){if(e==null)return null;if(L(e))return hn(e,t,n);if(R(e))return e.flow?An(e,t,n):No(e,t,n);if(Bn(e))return e.flow?ko(e,t,n):Go(e,t,n);if(B(e)){switch(e.type){case`BLOCK_FOLDED`:return bn(e,t,n);case`BLOCK_LITERAL`:return Sn(e,t,n);case`PLAIN`:return Io(e,t,n);case`QUOTE_DOUBLE`:return Bo(e,t,n);case`QUOTE_SINGLE`:return Ho(e,t,n)}throw Error(`Unexpected scalar type: ${e.type}`)}throw Error(`Unexpected unknown node type`)}function Jo(e,t){return!e||e.range[0]===e.range[1]&&t.tokens.every(e=>e.type===`comment`)}var Yo=(i=new WeakMap,class{constructor(r,a){n(this,`text`,void 0),n(this,`comments`,[]),t(this,i,void 0),this.text=r,e(i,this,a)}transformOffset(e){let{line:t,col:n}=r(i,this).linePos(e);return{line:t,column:n,offset:e}}transformRange(e){let[t,n]=e.map(e=>this.transformOffset(e));return an(t,n)}transformNode(e,t){return qo(e,this,t)}transformComment(e){let t=sn(e,this);return this.comments.push(t),t}transformContentProperties(e,t){return dn(e,t,this)}});function Xo(e,t,n,r,i,a){return{type:`document`,position:e,trailingComment:a,directivesEndMarker:t,documentEndMarker:n,children:[r,i]}}function Zo(e,t,n){return{type:`documentBody`,position:e,endComments:n,children:t?[t]:[]}}function Qo(e,t,n){for(let r=t;r<e.length;r++)if(n.test(e[r]))return r;return null}function $o(e,t,n,r,i,a,o){let{documentTrailingComment:s,endComments:c,propTokens:l}=es(t,n,i,a,o),u=r.contents&&(r.contents.range[0]<r.contents.range[1]||l.some(e=>e.type===`tag`||e.type===`anchor`)),d=u?o.transformNode(r.contents,{tokens:l}):null;if(!u)for(let e of N(l,o))throw Error(`Unexpected token type in empty document body: ${e.type}`);let{position:f,documentEndPoint:p}=ts(e,r,d,a,o);return{documentBody:Zo(f,d,c),documentEndPoint:p,documentTrailingComment:s}}function es(e,t,n,r,i){let a=[],o=[],s=[];for(let t of e){if(mn(t)){s.push(t);continue}throw Error(`Unexpected token type: ${t.type}`)}for(let e of N(n,i))throw Error(`Unexpected token type: ${e.type}`);let c=r?i.transformOffset(r.offset):null;if(t)for(let e of M(t.end,r?.end)){if(e.type===`comment`){let t=i.transformComment(e);c?c.line===t.position.start.line?o.push(t):t.position.start.line<c.line&&a.push(t):a.push(t);continue}throw Error(`Unexpected token type: ${e.type}`)}if(o.length>1)throw Error(`Unexpected multiple document trailing comments at ${Xt(o[1].position.start)}`);return{propTokens:s,endComments:a,documentTrailingComment:Nn(o)||null}}function ts(e,t,n,r,i){let a=r?Math.max(0,r.offset-1):Qo(i.text,t.range[2],/\S/u)??i.text.length;i.text[a-1]===`\r`&&a--;let o=n===null?a:n.position.start.offset;if(e){let t=e.offset+e.source.length+1;o<t&&t<=a&&(o=t)}let s=i.transformRange([o,a]);return{position:s,documentEndPoint:r?i.transformOffset(r.offset+r.source.length):s.end}}function ns(e,t,n,r){return{type:`documentHead`,position:e,endComments:n,trailingComment:r,children:t}}function rs(e,t,n){return{type:`directive`,position:e,leadingComments:[],trailingComment:null,name:t,parameters:n}}function is(e,t){let n=e.source.trim().split(/[\t ]+/),r=n.shift().replace(/^%/,``);return rs(t.transformRange([e.offset,e.offset+e.source.length]),r,n)}function as(e,t,n,r){let{directives:i,endCommentCandidates:a}=os(e,r),o=[],s=null;if(t){for(let e of M(t.start))if(o.push(e),!s&&e.type===`doc-start`){for(let e of o)if(e.type===`comment`){let t=r.transformComment(e);a.push(t)}o=[],s=e}}let c=ss(i,n,s,r),l=null;if(s&&o.length>0){let e=o[0];e.type===`comment`&&r.transformOffset(e.offset).line===c.end.line&&(l=r.transformComment(e),o.shift())}return{documentHead:ns(c,i,s?a:[],l),docStart:s,tokensBeforeBody:o}}function os(e,t){let n=[],r=[],i=null;for(let a of e)if(a.type===`comment`){let e=t.transformComment(a);i&&i.position.end.line===e.position.start.line&&!i.trailingComment?(i.trailingComment=e,i.position.end=e.position.end):r.push(e)}else{let e=is(a,t);n.push(e),i=e,r=[]}return{directives:n,endCommentCandidates:r}}function ss(e,t,n,r){let i=n?[n.offset,n.offset+n.source.length]:t.contents?[t.contents.range[0],t.contents.range[0]]:[t.range[0],t.range[0]];return e.length!==0&&(i[0]=e[0].position.start.offset),r.transformRange(i)}function cs(e,t){let{documentHead:n,tokensBeforeBody:r,docStart:i}=as(e.tokensBeforeBody,e.cstNode,e.node,t),{documentBody:a,documentEndPoint:o,documentTrailingComment:s}=$o(i,r,e.cstNode,e.node,e.tokensAfterBody,e.documentEnd,t);return Xo(an(n.position.start,o),!!i,!!e.documentEnd,n,a,s)}function ls(e,t,n){if(e.length===0)return[];let r=[],i=[],a=[],o=null,s=t=>{let n={tokensBeforeBody:[...a,...i],cstNode:t,node:e[r.length],tokensAfterBody:[],documentEnd:null};return r.push(n),a.length=0,i.length=0,n};for(let c of M(t)){if(c.type===`document`){if(r.length>=e.length)throw Error(`Unexpected 'document' token at ${Xt(n.transformOffset(c.offset))}`);o=s(c);continue}if(c.type===`comment`){i.push(c);continue}if(c.type===`directive`){a.push(...i,c),i.length=0;continue}if(c.type===`doc-end`){if(!o||o.documentEnd)throw Error(`Unexpected 'doc-end' token at ${Xt(n.transformOffset(c.offset))}`);o.tokensAfterBody=[...i],i.length=0,o.documentEnd=c;continue}}if(a.length>0){let[e]=a;throw Error(`Unexpected '${e.type}' token at ${Xt(n.transformOffset(e.offset))}`)}return i.length>0&&(o||(o=s(null)),i.length>0&&(o.tokensAfterBody.push(...i),i.length=0)),r.map(e=>cs(e,n))}function us(e,t,n,r){let i=t(e);return t=>{r(i,t)&&n(e,i=t)}}function ds(e){if(e===null||!(`children`in e))return;let t=e.children;if(t.forEach(ds),e.type===`document`){let[t,n]=e.children;t.position.start.offset===t.position.end.offset?t.position.start=t.position.end=n.position.start:n.position.start.offset===n.position.end.offset&&(n.position.start=n.position.end=t.position.end)}let n=us(e.position,fs,ps,gs),r=us(e.position,ms,hs,_s);`endComments`in e&&e.endComments.length!==0&&(n(e.endComments[0].position.start),r(Nn(e.endComments).position.end));let i=t.filter(e=>e!==null);if(i.length!==0){let e=i[0],t=Nn(i);n(e.position.start),r(t.position.end),`leadingComments`in e&&e.leadingComments.length!==0&&n(e.leadingComments[0].position.start),`tag`in e&&e.tag&&n(e.tag.position.start),`anchor`in e&&e.anchor&&n(e.anchor.position.start),`trailingComment`in t&&t.trailingComment&&r(t.trailingComment.position.end)}}function fs(e){return e.start}function ps(e,t){e.start=t}function ms(e){return e.end}function hs(e,t){e.end=t}function gs(e,t){return t.offset<e.offset}function _s(e,t){return t.offset>e.offset}function vs(e,t){let n=new mo,r=new Yo(e,n),i=new So(n.addNewLine),a=new La({keepSourceTokens:!0,uniqueKeys:t?.uniqueKeys,lineCounter:n,merge:!0}),o=[],s=[...i.parse(e)];for(let t of a.compose(s,!0,e.length)){let{errors:e}=t;if(e.length>0)throw new Yt(r,e[0]);o.push(t)}let c=ls(o,s,r),l=r.comments.sort((e,t)=>e.position.start.offset-t.position.end.offset),u=rn(r.transformRange([0,e.length]),c,l);return Zt(u),ds(u),u}function ys(e,t){let n=SyntaxError(e+` (`+t.loc.start.line+`:`+t.loc.start.column+`)`);return Object.assign(n,t)}var bs=ys,xs={uniqueKeys:!1};function Ss(e){let t;try{t=vs(e,xs)}catch(e){throw e instanceof Yt?bs(e.message,{loc:e.position,cause:e}):e}return delete t.comments,t}var Cs={astFormat:`yaml`,parse:Ss,hasPragma:nt,hasIgnorePragma:rt,locStart:Ye,locEnd:Xe},ws={yaml:Wt},Ts=Oo.parse;export{Ts as __parsePrettierYamlConfig,s as default,Gt as languages,qt as options,Jt as parsers,ws as printers};
|