the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+454
@@ -0,0 +1,454 @@
|
||||
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{a as n,d as r,i,l as a,o,p as s,u as c}from"./networking-_mWsNZqn.js";
|
||||
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
|
||||
function l(e,t){this.v=e,this.k=t}function u(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){if(Array.isArray(e))return e}function f(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function p(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
function m(e,t){return d(e)||f(e,t)||h(e,t)||p()}function h(e,t){if(e){if(typeof e==`string`)return u(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function g(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof l;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}g.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},g.prototype.next=function(e){return this._invoke(`next`,e)},g.prototype.throw=function(e){return this._invoke(`throw`,e)},g.prototype.return=function(e){return this._invoke(`return`,e)};var _=Object.entries,v=Object.setPrototypeOf,y=Object.isFrozen,b=Object.getPrototypeOf,x=Object.getOwnPropertyDescriptor,S=Object.freeze,C=Object.seal,ee=Object.create,te=typeof Reflect<`u`&&Reflect,ne=te.apply,w=te.construct;S||=function(e){return e},C||=function(e){return e},ne||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},w||=function(e){return new e(...[...arguments].slice(1))};var re=T(Array.prototype.forEach);Array.prototype.indexOf;var ie=T(Array.prototype.lastIndexOf),ae=T(Array.prototype.pop),oe=T(Array.prototype.push),se=T(Array.prototype.slice),ce=T(Array.prototype.splice),le=Array.isArray,ue=De(Set),de=T(Set.prototype.add),fe=T(Set.prototype.has),pe=T(String.prototype.toLowerCase),me=T(String.prototype.toString),he=T(String.prototype.match),ge=T(String.prototype.replace),_e=T(String.prototype.indexOf),ve=T(String.prototype.trim),ye=T(Number.prototype.toString),be=T(Boolean.prototype.toString),xe=typeof BigInt>`u`?null:T(BigInt.prototype.toString),Se=typeof Symbol>`u`?null:T(Symbol.prototype.toString),Ce=T(Object.prototype.hasOwnProperty),we=T(Object.prototype.toString),Te=T(RegExp.prototype.test),Ee=De(TypeError);function T(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ne(e,t,n)}}function De(e){return function(){return w(e,[...arguments])}}function E(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pe;if(v&&v(e,null),!le(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(y(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Oe(e){for(let t=0;t<e.length;t++)Ce(e,t)||(e[t]=null);return e}function ke(e){let t=ee(null);for(let r of _(e)){var n=m(r,2);let i=n[0],a=n[1];Ce(e,i)&&(t[i]=le(a)?Oe(a):a&&typeof a==`object`&&a.constructor===Object?ke(a):a)}return t}function Ae(e){switch(typeof e){case`string`:return e;case`number`:return ye(e);case`boolean`:return be(e);case`bigint`:return xe?xe(e):`0`;case`symbol`:return Se?Se(e):`Symbol()`;case`undefined`:return we(e);case`function`:case`object`:{if(e===null)return we(e);let t=e,n=je(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:we(e)}return we(e)}default:return we(e)}}function je(e,t){for(;e!==null;){let n=x(e,t);if(n){if(n.get)return T(n.get);if(typeof n.value==`function`)return T(n.value)}e=b(e)}function n(){return null}return n}function Me(e,t){for(;e!==null;){let n=x(e,t);if(n)return n.get?T(n.get):null;e=b(e)}return null}function Ne(e){try{return Te(e,``),!0}catch{return!1}}var Pe=S(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Fe=S(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ie=S([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNo
Line truncated
|
||||
`+f),Bt&&(f=Zn(f)),Se&&Yt?pt(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dn(e),Ut=!0,Wt=A,Gt=j},t.clearConfig=function(){wn=null,Ut=!1,Wt=null,Gt=null,Se=T,we=``},t.isValidAttribute=function(e,t,n){wn||Dn({});let r=M(e),i=M(t);return typeof n==`string`&&(mr(t,n)||!zt&&Te(it,n))?!1:N(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Ce(k,e)&&oe(k[e],t)},t.removeHook=function(e,t){if(Ce(k,e)){if(t!==void 0){let n=ie(k[e],t);return n===-1?void 0:ce(k[e],n,1)[0]}return ae(k[e])}},t.removeHooks=function(e){Ce(k,e)&&(k[e]=[])},t.removeAllHooks=function(){k=lt()},t}var D=ft(),pt=D,mt=D.sanitize.bind(D);D.isSupported,D.addHook.bind(D),D.removeHook.bind(D),D.removeHooks.bind(D),D.removeAllHooks.bind(D),D.setConfig.bind(D),D.clearConfig.bind(D),D.isValidAttribute.bind(D),D.version,D.removed;function ht(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var gt=ht();function _t(e){gt=e}var vt={exec:()=>null};function yt(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function O(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(k.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var bt=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),k={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:yt(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:yt(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:yt(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:yt(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:yt(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:yt(e=>RegExp(`^ {0,${e}}(?:</?(?:${Nt})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:yt(e=>RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},xt=/^(?:[ \t]*(?:\n|$))+/,St=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ct=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,wt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Et=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Dt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Ot=O(Dt).replace(/bull/g,Et).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),kt=O(Dt).replace(/bull/g,Et).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}Line truncated
|
||||
]`).replace(`lheading`,Ot).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ut=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Kt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qt=/[\p{P}\p{S}]/u,Jt=/[\s\p{P}\p{S}]/u,Yt=/[^\s\p{P}\p{S}]/u,Xt=O(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Jt).getRegex(),Zt=/[\p{Pi}\p{Ps}"']/u,Qt=/(?!~)[\p{P}\p{S}]/u,$t=/(?!~)[\s\p{P}\p{S}]/u,en=/(?:[^\s\p{P}\p{S}]|~)/u,tn=O(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,bt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),nn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,rn=O(nn,`u`).replace(/punct/g,qt).getRegex(),an=O(nn,`u`).replace(/punct/g,Qt).getRegex(),on=O(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Zt).replace(/punct/g,qt).getRegex(),sn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,cn=O(sn,`gu`).replace(/notPunctSpace/g,Yt).replace(/punctSpace/g,Jt).replace(/punct/g,qt).getRegex(),ln=O(sn,`gu`).replace(/notPunctSpace/g,en).replace(/punctSpace/g,$t).replace(/punct/g,Qt).getRegex(),un=O(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Yt).replace(/punctSpace/g,Jt).replace(/punct/g,qt).getRegex(),dn=O(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Yt).replace(/punctSpace/g,Jt).replace(/punct/g,qt).getRegex(),fn=O(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Yt).replace(/punctSpace/g,Jt).replace(/punct/g,qt).getRegex(),pn=O(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,qt).getRegex(),mn=O(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Yt).replace(/punctSpace/g,Jt).replace(/punct/g,qt).getRegex(),hn=O(/\\(punct)/,`gu`).replace(/punct/g,qt).getRegex(),gn=O(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,qt).getRegex(),_n=O(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),vn=O(Pt).replace(`(?:-->|$)`,`-->`).getRegex(),yn=O(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,vn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,xn=O(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,bn).getRegex(),Sn=O(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,xn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Cn=O(/^!?\[(label)\]\[(ref)\]/).replace(`label`,xn).replace(`ref`,j).getRegex(),M=O(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,j).getRegex(),wn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Tn=O(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,bn).getRegex(),En=O(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,O(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Tn).replace(`ref`,wn).getRegex()).replace(`nolink`,O(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,wn).getRegex()).getRegex(),Dn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,On=O(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Line truncated
|
||||
`),n=t.length-1;for(;n>=0&&k.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
||||
`)}function Un(e){return e.trim().replace(k.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function Wn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var Gn=new WeakMap;function Kn(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let a=e[i];if(a!==`*`&&a!==`_`&&a!==`~`)continue;let o=i===0?`
|
||||
`:e[i-1],s=i+1;for(;s<r&&e[s]===a;)s++;o!==` `&&o!==` `&&o!==`
|
||||
`&&o!==`\r`&&o!==`\f`&&(a===`~`?n=i:t[a]=i),i=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function qn(e,t){let n=Kn(t),r=Gn.get(e);r?r.push(n):Gn.set(e,[n])}function Jn(e){let t=Gn.get(e);t&&(t.pop(),t.length===0&&Gn.delete(e))}function Yn(e,t,n){let r=Gn.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:Kn(t).lastPossibleEmStrongCloserIndex[n]}function Xn(e,t){let n=Gn.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:Kn(t).lastPossibleDelCloserIndex}function Zn(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Qn(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function $n(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
||||
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
||||
`)}function er(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var tr=class{options;rules;lexer;constructor(e){this.options=e||gt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Hn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=$n(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Vn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Vn(t[0],`
|
||||
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Vn(t[0],`
|
||||
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Vn(t[0],`
|
||||
`).split(`
|
||||
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
||||
`),c=s.replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>t+Zn(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
||||
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
||||
${s}`:s,r=r?`${r}
|
||||
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
||||
`),o=t.raw+`
|
||||
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
|
||||
`).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n}
|
||||
${d.join(`
|
||||
`)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
||||
`+e.join(`
|
||||
`),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(`
|
||||
`).length:0;if(s>0){let t=e.slice(0,s).join(`
|
||||
`);n=`${n}
|
||||
${t}`,r=`${r}
|
||||
${t}`}e=e.slice(s)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===`text`&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
|
||||
`,1)[0],d=t[1].length,f=this.options.pedantic?Zn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Zn(e,d)),p=e.split(`
|
||||
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h),c=!1;for(;e;){let l=e.split(`
|
||||
`,1)[0],u;if(p=l,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),u=p):u=p.replace(this.rules.other.leadingSpaceTab,e=>Zn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(u.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
|
||||
`+u.slice(h),c=!1;else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||o.test(f)||n.test(f))break;if(!this.options.pedantic&&!c){let e=f.replace(this.rules.other.nestedContainerMarkers,``);if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}let e=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f}
|
||||
${p}`)?` ${u.replace(/^ {0,3}/,``)}`:p;a+=`
|
||||
`+e,c=!0}m=!p.trim(),e=e.substring(l.length+1),f=u.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Hn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Wn(t[2],`()`)!==-1)return;let e=Un(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Vn(t[0],`
|
||||
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Bn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
||||
`):[],a={type:`table`,raw:Vn(t[0],`
|
||||
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Bn(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Vn(t[0],`
|
||||
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
||||
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&er(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Vn(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Wn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=Vn(t[0].slice(0,-1),`\\`);if((t[0].length-i.length)%2==0)return;let a=t[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),Qn(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&er(e,n[1],r,this.rules))return;let i=t[Un(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Qn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);s<o&&(n=c);let u=s<o?l:n===`*`||n===`_`||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||``;if(!d||!n||u){let n=[...r[0]].length-1,u,f,p=n,m=0,h=o-s+n,g=!this.options.pedantic&&!!c.trim()&&(!!d||i===`*`&&!l);if(i!==`*`&&i!==`_`)return;let _=i===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,v=Yn(this,t,i),y=t.length-e.length+n;if(v<y)return;t=t.slice(-1*e.length+n);let b=v-y;for(_.lastIndex=0;(r=_.exec(t))!==null&&!(r.index>b);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if(r[5]||r[6]||g){if(a&&(r[5]||r[6]))break;if(h%3&&!((h+f)%3)){m+=f;continue}}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=Xn(this,t),l=t.length-e.length+n;if(c<l)return;t=t.slice(-1*e.length+n);let u=c-l;for(s.lastIndex=0;(r=s.exec(t))!==null&&!(r.index>u);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}
Line truncated
|
||||
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(k.tabCharGlobal,` `).replace(k.spaceLine,``));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=t.at(-1);let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
||||
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
||||
`)?``:`
|
||||
`)+r.raw,n.text+=`
|
||||
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
||||
`)?``:`
|
||||
`)+r.raw,n.text+=`
|
||||
`+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let i=t.at(-1);n&&i?.type===`paragraph`?(i.raw+=(i.raw.endsWith(`
|
||||
`)?``:`
|
||||
`)+r.raw,i.text+=`
|
||||
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
||||
`)?``:`
|
||||
`)+r.raw,n.text+=`
|
||||
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Un(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`)||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==tr.prototype.emStrong||this.tokenizer.del!==tr.prototype.del?this.#r(e):e;qn(this.tokenizer,n);try{return this.#t(e,n,t)}finally{Jn(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(t=>(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,i=``,a=0,o;for(t.lastIndex=0;o=t.exec(e);){let s=o.index+(o[2]?o[2].length:0),c=o.index+o[0].length;if(e.charAt(s)===`<`){let i=e.slice(s),a=n.exec(i)||r.exec(i);if(!a){t.lastIndex=s+1;continue}c=s+a[0].length,t.lastIndex=c}i+=e.slice(a,s)+`[`+`a`.repeat(c-s-2)+`]`,a=c}return i+e.slice(a)}#r(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Un(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},rr=class{options;parser;constructor(e){this.options=e||gt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(k.notSpaceStart)?.[0],i=e?e.replace(k.endingNewline,``)+`
|
||||
`:``;return r?`<pre><code class="language-`+Ln(r)+`">`+(n?i:Ln(i,!0))+`</code></pre>
|
||||
`:`<pre><code>`+(n?i:Ln(i,!0))+`</code></pre>
|
||||
`}blockquote({tokens:e}){return`<blockquote>
|
||||
${this.parser.parse(e)}</blockquote>
|
||||
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
||||
`}hr(e){return`<hr>
|
||||
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
||||
`+r+`</`+i+`>
|
||||
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
||||
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
||||
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
||||
<thead>
|
||||
`+t+`</thead>
|
||||
`+r+`</table>
|
||||
`}tablerow({text:e}){return`<tr>
|
||||
${e}</tr>
|
||||
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
||||
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ln(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Ln(n,!0):this.parser.parseInline(r),o=zn(e);if(o===null)return a;e=Ln(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Ln(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=zn(e);if(i===null)return Ln(n);e=i;let a=`<img src="${Ln(e)}" alt="${Ln(n)}"`;return t&&(a+=` title="${Ln(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Ln(e.text)}},ir=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`
|
||||
`}checkbox({raw:e}){return e}},ar=class e{options;renderer;textRenderer;constructor(e){this.options=e||gt,this.options.renderer=this.options.renderer||new rr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ir,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n===!1?``:n??``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e===!1?``:e??``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},or=class{options;block;constructor(e){this.options=e||gt}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?nr.lex:nr.lexInline}provideParser(e=this.block){return e?ar.parse:ar.parseInline}};function sr(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var cr=class{defaults=ht();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ar;Renderer=rr;TextRenderer=ir;Lexer=nr;Tokenizer=tr;Hooks=or;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(sr(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)sr(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)sr(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;sr(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);sr(n,this.walkTokens(i,t))}):e.tokens&&sr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new rr(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new tr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error
Line truncated
|
||||
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Ln(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},lr=new cr;function N(e,t){return lr.parse(e,t)}N.options=N.setOptions=function(e){return lr.setOptions(e),N.defaults=lr.defaults,_t(N.defaults),N},N.getDefaults=ht,N.defaults=gt;function ur(...e){return lr.use(...e),N.defaults=lr.defaults,_t(N.defaults),N}N.use=ur,N.walkTokens=function(e,t){return lr.walkTokens(e,t)},N.parseInline=lr.parseInline,N.Parser=ar,N.parser=ar.parse,N.Renderer=rr,N.TextRenderer=ir,N.Lexer=nr,N.lexer=nr.lex,N.Tokenizer=tr,N.Hooks=or,N.parse=N,N.options,N.setOptions,N.walkTokens;var dr=N.parseInline,fr=N;ar.parse;var pr=nr.lex,mr=`https://unpkg.com/@sveltia/cms`,hr=`https://github.com/sveltia/sveltia-cms`,gr=`https://sveltiacms.app/en/docs`,_r=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),vr=Array.isArray,yr=Array.prototype.indexOf,br=Array.prototype.includes,xr=Array.from,Sr=Object.defineProperty,Cr=Object.getOwnPropertyDescriptor,wr=Object.getOwnPropertyDescriptors,Tr=Object.prototype,Er=Array.prototype,Dr=Object.getPrototypeOf,Or=Object.isExtensible;function kr(e){return typeof e==`function`}var Ar=()=>{};function jr(e){return typeof e?.then==`function`}function Mr(e){for(var t=0;t<e.length;t++)e[t]()}function Nr(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Pr(e,t,n=!1){return e===void 0?n?t():t:e}function Fr(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var Ir=1<<24,Lr=1024,Rr=2048,zr=4096,Br=8192,Vr=16384,Hr=32768,Ur=1<<25,Wr=65536,Gr=1<<18,Kr=1<<19,qr=1<<20,Jr=1<<25,Yr=1<<21,Xr=1<<22,Zr=1<<23,Qr=Symbol(`$state`),$r=Symbol(`component`),ei=Symbol(`legacy props`),ti=Symbol(``),ni=Symbol(`attributes`),ri=Symbol(`class`),ii=Symbol(`style`),ai=Symbol(`text`),oi=Symbol(`form reset`),si=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ci=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),li={},P=Symbol(`uninitialized`),ui=`http://www.w3.org/1999/xhtml`,di=`http://www.w3.org/2000/svg`,fi=`http://www.w3.org/1998/Math/MathML`,pi=`@attach`;function mi(){console.warn(`https://svelte.dev/e/derived_inert`)}function hi(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function gi(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function _i(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var F=!1;function vi(e){F=e}var I;function L(e){if(e===null)throw hi(),li;return I=e}function yi(){return L(ho(I))}function bi(e){if(F){if(ho(I)!==null)throw hi(),li;I=e}}function xi(e=1){if(F){for(var t=e,n=I;t--;)n=ho(n);I=n}}function Si(e=!0){for(var t=0,n=I;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ho(n);e&&n.remove(),n=i}}function Ci(e){if(!e||e.nodeType!==8)throw hi(),li;return e.data}function wi(e){return e===this.v}function Ti(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ei(e){return!Ti(e,this.v)}function Di(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Oi(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function ki(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ai(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function ji(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Mi(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Ni(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Pi(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Fi(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ii(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Li(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ri(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var zi=[];function Bi(e,t=!1,n=!1){return Vi(e,new Map,``,zi,null,n)}function Vi(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e)
Line truncated
|
||||
\r\f\xA0\v`];function il(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||rl.includes(r[o-1]))&&(s===r.length||rl.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function al(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function ol(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function sl(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(ol)),i&&c.push(...Object.keys(i).map(ol));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=ol(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=al(r)),i&&(n+=al(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function cl(e,t,n,r,i,a){var o=e[ri];if(F||o!==n||o===void 0){var s=il(n,r,a);F&&s===e.getAttribute(`class`)||(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[ri]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ll(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function ul(e,t,n,r){var i=e[ii];if(F||i!==t){var a=sl(t,r);F&&a===e.getAttribute(`style`)||(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[ii]=t}else r&&(Array.isArray(r)?(ll(e,n?.[0],r[0]),ll(e,n?.[1],r[1],`important`)):ll(e,n,r));return r}function dl(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function fl(e,t){var n=!(`__defaultValue`in e);(n||e.__defaultValue!==t)&&(e.__defaultValue=t,pl(e,!n||`__value`in e))}function pl(e,t){var n=e.__defaultValue,r=e.multiple,i=r?n??[]:null;if(!r||vr(i)){var a=e.selectedIndex,o=t&&r?new Set(e.selectedOptions):null;for(var s of e.options){var c=gl(s);dl(s,r?i.includes(c):ao(c,n))}if(t){if(o!==null)for(s of e.options){var l=o.has(s);s.selected!==l&&(s.selected=l)}else e.selectedIndex!==a&&(e.selectedIndex=a)}}}function ml(e,t,n=!1){if(e.multiple){if(t==null)return;if(!vr(t))return gi();for(var r of e.options)r.selected=t.includes(gl(r))}else{for(r of e.options)if(ao(gl(r),t)){r.selected=!0;return}n&&t===void 0||(e.selectedIndex=-1)}}function hl(e){var t=new MutationObserver(t=>{t.every(_l)||(`__defaultValue`in e&&pl(e,!1),`__value`in e&&ml(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Ao(()=>{t.disconnect()})}function gl(e){return`__value`in e?e.__value:e.value}function _l(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var vl=Symbol(`class`),yl=Symbol(`style`),bl=Symbol(`is custom element`),xl=Symbol(`is html`),Sl=ci?`link`:`LINK`,Cl=ci?`input`:`INPUT`,wl=ci?`option`:`OPTION`,Tl=ci?`select`:`SELECT`,El=ci?`progress`:`PROGRESS`;function Dl(e){if(F){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Ol(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Ol(e,`checked`,null),e.checked=r}}};e[oi]=n,ta(n),ua()}}function Ol(e,t,n,r){var i=jl(e);if(!(F&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Sl))){var a=i[t];a!==(i[t]=n)&&(t===`loading`&&(e[ti]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Nl(e).has(t)?e[t]=n:(!F||typeof n!=`number`&&typeof n!=`boolean`||a!==String(n))&&e.setAttribute(t,n))}}function kl(e,t,n,r,i=!1,a=!1){F&&i&&e.nodeName===Cl&&(`defaultValue`in n||`defaultChecked`in n||Dl(e));var o=jl(e),s=o[bl],c=!o[xl];let l=F&&s;l&&vi(!1);var u=t||{},d=e.nodeName===wl,f=e.nodeName===Tl;try{for(var p in t)!(p in n)&&p[0]+p[1]!==`$$`&&(n[p]=null);n.class?n.class=nl(n.class):(r||n[vl])&&(n.class=null),n[yl]&&(n.style??=null);var m=Nl(e);if(e.nodeName===Cl&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==u.type||h===void 0&&e.hasAttribute(`type`))&&(u.type=h,Ol(e,`type`,h,a))}for(let i in n){let l=n[i];if(d&&i===`value`&&l==null)e.value=e.__value=``,u[i]=l;else if(i===`class`)cl(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,l,r,t?.[vl],n[vl]),u[i]=l,u[vl]=n[vl];else if(i===`style`)ul(e,l,t?.[yl],n[yl]),u[i]=l,u[yl]=n[yl];else{var g=u[i];if(l!==g||l===void 0&&e.hasAttribute(i)){u[i]=l;var _=i[0]+i[1];if(_!==`$$`){if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=Ms(r);if(As(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(l!=null)continue;e.removeEventListener(r,u[n],t),u[n]=null}if(v)qs(r,
Line truncated
|
||||
\r `),U,W,lu=(e,t)=>new ru(`missing-syntax`,e,e+t.length,t),uu=(...e)=>new ru(...e);function du(e,t){if(W.startsWith(e,U))t&&(U+=e.length);else throw lu(U,e)}function fu(e){U=0,W=e;let t=gu();if(W.startsWith(`.match`,U))return pu(t);let n=t.length>0||W.startsWith(`{{`,U);!n&&U>0&&(U=0);let r=hu(n);if(n&&(G(),U<W.length))throw uu(`extra-content`,U,W.length);return{type:`message`,declarations:t,pattern:r}}function pu(e){U+=6,G(!0);let t=[];for(;W[U]===`$`;)t.push(wu()),G(!0);if(t.length===0)throw uu(`empty-token`,U);let n=[];for(;U<W.length;)n.push(mu()),G();return{type:`select`,declarations:e,selectors:t,variants:n}}function mu(){let e=[];for(;U<W.length;){G(e.length?`{`:!1);let t=W[U];if(t===`{`)break;if(t===`*`)e.push({type:`*`}),U+=1;else{let t=Tu(!0);t.value=t.value.normalize(),e.push(t)}}return{keys:e,value:hu(!0)}}function hu(e){if(e){if(W.startsWith(`{{`,U))U+=2;else throw lu(U,`{{`)}let t=[];loop:for(;U<W.length;)switch(W[U]){case`{`:t.push(yu(!0));break;case`}`:if(!e)throw uu(`parse-error`,U);break loop;default:t.push(Su())}if(e){if(W.startsWith(`}}`,U))U+=2;else throw lu(U,`}}`)}return t}function gu(){let e=[];G();loop:for(;W[U]===`.`;){switch(W.substr(U,6)){case`.input`:e.push(_u());break;case`.local`:e.push(vu());break;case`.match`:break loop;default:throw uu(`parse-error`,U)}G()}return e}function _u(){U+=6,G(),du(`{`,!1);let e=U,t=yu(!1);if(t.type===`expression`&&t.arg?.type===`variable`)return{type:`input`,name:t.arg.name,value:t};throw uu(`bad-input-expression`,e,U)}function vu(){U+=6,G(!0),du(`$`,!0);let e=Ou();return G(),du(`=`,!0),G(),du(`{`,!1),{type:`local`,name:e,value:yu(!1)}}function yu(e){let t=U;U+=1,G();let n=Cu(!1);n&&G(`}`);let r=W[U],i,a;switch(r){case`@`:case`}`:break;case`:`:{U+=1,i={type:`function`,name:Du()};let e=bu();e&&(i.options=e);break}case`#`:case`/`:{if(n||!e)throw uu(`parse-error`,U);U+=1,a={type:`markup`,kind:r===`#`?`open`:`close`,name:Du()};let t=bu();t&&(a.options=t);break}default:throw uu(`parse-error`,U)}let o=xu();if(a?.kind===`open`&&W[U]===`/`&&(a.kind=`standalone`,U+=1),du(`}`,!0),i){let e=n?{type:`expression`,arg:n,functionRef:i}:{type:`expression`,functionRef:i};return o&&(e.attributes=o),e}if(a)return o&&(a.attributes=o),a;if(!n)throw uu(`empty-token`,t,U);return o?{type:`expression`,arg:n,attributes:o}:{type:`expression`,arg:n}}function bu(){G(`/}`);let e={},t=!0;for(;U<W.length;){let n=W[U];if(n===`@`||n===`/`||n===`}`)break;let r=U,i=Du();if(Object.hasOwn(e,i))throw uu(`duplicate-option-name`,r,U);G(),du(`=`,!0),G(),e[i]=Cu(!0),t=!1,G(`/}`)}return t?null:e}function xu(){let e={},t=!0;for(;W[U]===`@`;){let n=U;U+=1;let r=Du();if(Object.hasOwn(e,r))throw uu(`duplicate-attribute`,n,U);G(`=/}`),W[U]===`=`?(U+=1,G(),e[r]=Tu(!0),G(`/}`)):e[r]=!0,t=!1}return t?null:e}function Su(){let e=``,t=U;loop:for(;t<W.length;++t)switch(W[t]){case`\\`:{let n=W[t+1];if(!`\\{|}`.includes(n))throw uu(`bad-escape`,t,t+2);e+=W.substring(U,t)+n,t+=1,U=t+1;break}case`{`:case`}`:break loop}return e+=W.substring(U,t),U=t,e}function Cu(e){return W[U]===`$`?wu():Tu(e)}function wu(){return U+=1,{type:`variable`,name:Ou()}}function Tu(e){if(W[U]===`|`)return Eu();let t=eu(W,U);if(t)return U+=t.length,{type:`literal`,value:t};if(e)throw uu(`empty-token`,U)}function Eu(){U+=1;let e=``;for(let t=U;t<W.length;++t)switch(W[t]){case`\\`:{let n=W[t+1];if(!`\\{|}`.includes(n))throw uu(`bad-escape`,t,t+2);e+=W.substring(U,t)+n,t+=1,U=t+1;break}case`|`:return e+=W.substring(U,t),U=t+1,{type:`literal`,value:e}}throw lu(W.length,`|`)}function Du(){let e=Ou();return W[U]===`:`?(U+=1,e+`:`+Ou()):e}function Ou(){let e=$l(W,U);if(!e)throw uu(`empty-token`,U);return U=e.end,e.value}function G(e=!1){let t=W[U],n=!1;if(e){for(;su.has(t);)t=W[++U];for(;cu.has(t);)t=W[++U],n=!0}for(;su.has(t)||cu.has(t);)t=W[++U];if(e&&!n&&(e===!0||!e.includes(W[U])))throw lu(U,`' '`)}function ku(e,t){let{node:n,pattern:r}=t,{functionRef:i=n,attributes:a=null,declaration:o=n,expression:s=n,key:c=n,markup:l=n,options:u=null,value:d=n,variant:f=n}=t,p=(e,t)=>{if(e){let n=u?.(e,t);if(d)for(let n of Object.values(e))d(n,t,`option`);n?.()}},m=(e,t)=>{if(e){let n=a?.(e,t);if(d)for(let n of Object.values(e))n!==!0&&d(n,t,`attribute`);n?.()}},h=(e,t)=>{if(typeof e==`object`){let n;switch(e.type){case`expression`:if(n=s?.(e,t),e.arg&&d?.(e.arg,t,`arg`),e.functionRef){let n=i?.(e.functionRef,t,e.arg);p(e.functionRef.options,t),n?.()}m(e.attributes,t);break;case`markup`:n=l?.(e,t),p(e.options,t),m(e.attributes,t)}n?.()}},g=e=>{let t=r?.(e);for(let t of e)h(t,`placeholder`);t?.()};for(let t of e.declarations){let e=o?.(t);t.value&&h(t.value,`declaration`),e?.()}if(e.type===`message`)g(e.pattern);else{if(d)for(let t of e.selectors)d(t,`selector`,`arg`);for(let t of e.variants){let e=f?.(t);c&&t.keys.forEach(c),g(t.value),e?.()}}}function Au(e,t=(e,t)=>{throw new iu(e,t)}){let n=0,r=null,i=new Set,a=new Set,o=new Set,s=new Set,c=new Set,l=new Set,u=!0;ku(e,{declaration(e){if(e.name)return(e.value.functionRef||e.type===`local`&&e.
Line truncated
|
||||
`),Ep=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,Dp=async e=>{let t=Ep(e);return new Uint8Array(await t.arrayBuffer()).toBase64()},Op=async e=>{let t=Uint8Array.fromBase64(e);return new TextDecoder().decode(t)},kp=new Map([[`application/gzip`,`gz`],[`application/javascript`,`js`],[`application/ld+json`,`jsonld`],[`audio/mpeg`,`mp3`],[`text/javascript`,`js`],[`text/markdown`,`md`],[`text/plain`,`txt`],[`video/quicktime`,`mov`]]),Ap=e=>{let t=e.toLowerCase().split(`;`)[0].trim(),n=kp.get(t);if(n)return n;let r=t.split(`/`)[1]?.split(`+`)[0];if(r&&!/[.-]/.test(r))return r},jp=(e,t)=>{let n=document.createElement(`a`),r=URL.createObjectURL(e),i=Ap(e.type);n.download=t||e.name||[Date.now(),i].filter(Boolean).join(`.`),n.href=r,n.click(),globalThis.setTimeout(()=>{URL.revokeObjectURL(r)},0)},Mp=/(?<!\\){{(.+?)}}/,Np=new RegExp(Mp.source,`g`),Pp=[`year`,`month`,`day`,`hour`,`minute`,`second`],Fp=/{{(?:year|month|day|hour|minute|second)}}/,Ip=/^fields\./,Lp=/\|\s*default\s*\(/,Rp={uuid:{length:void 0,pattern:`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`},uuid_short:{length:`short`,pattern:`[0-9a-f]{12}`},uuid_shorter:{length:`shorter`,pattern:`[0-9a-f]{8}`}},zp=(e,t,n)=>{let r=t+n;for(;/\s/.test(e[r]??``);)r+=n;return e[r]??``},Bp=(e,t,{unescape:n=!0}={})=>{let r=``,i=0;for(;i<e.length;){let a=e.indexOf(`{{`,i);if(a===-1){r+=e.slice(i);break}r+=e.slice(i,a);let o=a+2,s=!1;for(;o<e.length;){let c=e[o],l=e[o+1];if(c===`'`&&(!s&&[`(`,`,`].includes(zp(e,o,-1))?s=!0:s&&[`,`,`)`].includes(zp(e,o,1))&&(s=!1)),!s&&c===`}`&&l===`}`){let s=o,c=e.slice(a+2,s);if(e[a-1]===`\\`){r=n?r.slice(0,-1):r,r+=e.slice(a,s+2),i=s+2;break}r+=c?t(e.slice(a,s+2),c):e.slice(a,s+2),i=s+2;break}o+=1}if(o>=e.length){r+=e.slice(a);break}}return r},Vp=e=>{let t=[];return{tags:t,literals:Bp(e,(e,n)=>(t.push(n),`\0`)).split(`\0`)}},Hp=e=>{let t=[];return Bp(e,(e,n)=>(t.push({tag:e,content:n,name:n.split(`|`)[0].trim()}),e)),t},Up=e=>Mp.test(e),Wp=e=>e.replace(Ip,``),Gp=(e,t=[])=>{let n=e.split(`/`).pop(),r=n.lastIndexOf(`.`),i=r===-1?``:n.slice(r+1),a=r===-1?n:n.slice(0,r),o=t.find(e=>a.endsWith(`.${e}`));return o&&(a=a.slice(0,-(o.length+1))),{filename:a,extension:i}},Kp=({_i18n:e})=>e?.structureMap?.i18nMultiFile?e.allLocales:[],qp=(e,t)=>Vp(e).literals.map(hf).join(t),Jp=`_index`,Yp=new WeakMap,Xp=e=>{if(!rp(e))return;let{index_file:t}=e;if(t)return(t===!0?void 0:t.name)??Jp},Zp=e=>{let t=Yp.get(e);if(t&&t.locale===Ud.current)return t.indexFile;let n=Xp(e),r;if(n!==void 0){let{index_file:t}=e,i=t===!0?{}:t;r={...i,name:n,label:i.label||Yd(`index_file`),icon:i.icon??`home`}}return Yp.set(e,{locale:Ud.current,indexFile:r}),r},Qp=(e,t)=>{let n=Xp(e);if(n===void 0)return!1;let r=e._file?.fullPathRegEx;return!!r&&t.match(r)?.groups?.subPath===n},$p=(e,t)=>{let n=Xp(e);if(n===void 0)return!1;let r=Object.values(t.locales??{})[0]?.path;return r===void 0?t.slug===n:Qp(e,r)},em=[`markdown`,`md`,`mdown`,`mdwn`,`mdx`,`mkd`,`mkdn`,`html.md`],tm={raw:`txt`,yaml:`yml`,yml:`yml`,toml:`toml`,json:`json`},nm={yaml:`yaml`,yml:`yaml`,toml:`toml`,json:`json`,astro:`raw`},rm={"json-frontmatter":[`{`,`}`],"toml-frontmatter":[`+++`,`+++`],"yaml-frontmatter":[`---`,`---`]},im=[`yaml-frontmatter`,`toml-frontmatter`,`json-frontmatter`],am=[`yml`,`yaml`,`toml`,`json`,`frontmatter`,...im,`raw`],om=[`toml`,`toml-frontmatter`],sm={yml:`yaml`,yaml:`yaml`,toml:`toml`,json:`json`,frontmatter:`yaml`,"yaml-frontmatter":`yaml`,"toml-frontmatter":`toml`,"json-frontmatter":`json`},cm=e=>Object.hasOwn(sm,e)?sm[e]:void 0,lm=e=>typeof e==`string`&&!!e.trim(),um=e=>typeof e==`string`&&/^https?:\/\//i.test(e.trim())&&yf(e.trim()),dm=e=>e.replace(/&(?![a-zA-Z0-9#]+;)/g,`&`).replaceAll(`"`,`"`),fm={"&":`&`,"<":`<`,">":`>`},pm=e=>e.replace(/[&<>]/g,e=>fm[e]),mm={ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`]},hm=(e,t)=>mt(e.replace(`<a>`,`<a href="${dm(t)}" target="_blank" rel="noopener noreferrer">`),mm),gm=(e,{allowedTags:t=[`strong`,`em`,`del`,`code`,`a`],allowedAttr:n=[`href`]}={})=>mt(dr(e),{ALLOWED_TAGS:t,ALLOWED_ATTR:n}),_m=e=>gm(e.replaceAll(`\\n`,`<br>`),{allowedTags:[`strong`,`em`,`del`,`code`,`a`,`br`]}),vm=[`index`,`_index`],ym=[...em,...Object.keys(nm)],bm=e=>{if(typeof e!=`string`||!e.trim())return;let t=K(e.trim()),{filename:n,extension:r}=Sp(t);return r!==void 0&&ym.includes(r)?n:t},xm=q(``),Sm=e=>{let t=e;if(!rp(t))return;let{nested:n}=t;if(!n||typeof n!=`object`)return;let{depth:r,summary:i,subfolders:a}=n;return{depth:typeof r==`number`&&r>=1?Math.floor(r):1/0,summary:lm(i)?i:void 0,subfolders:a!==!1}},Cm=e=>!!Sm(e),wm=e=>{if(!Cm(e))return;let t=e.meta?.path;if(t&&typeof t==`object`)return{indexFileName:bm(t.index_file)}},Tm=e=>Cm(e)?wm(e)?.indexFileName:void 0,Em=e=>Sm(e)?.subfolders===!1?void 0:wm(e)?.indexFileName,Dm=(e,t)=>{let n=Em(e);return n&&t.endsWith(`/${n}`)?t.slice(0,-n.length-1):t},Om=({collection:e,isNew:t,originalPath:n,currentPath:r})=>r===void 0?!1:t&&Em(e)?!0:!!K(r)||!!K(n??``),km=e=>{let t=e.l
Line truncated
|
||||
`)}};Dy.defaultYaml={explicit:!1,version:`1.2`},Dy.defaultTags={"!!":`tag:yaml.org,2002:`};function Oy(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 ky(e){let t=new Set;return by(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Ay(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function jy(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=ky(e);let a=Ay(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Y(t.node)||X(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 My(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=My(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=My(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=My(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=My(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function Ny(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Ny(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!gy(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 Py=class{constructor(e){Object.defineProperty(this,dy,{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(!py(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=Ny(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?My(i,{"":o},``,o):o}},Fy=class extends Py{constructor(e){super(ay),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=[],by(e,{Node:(e,t)=>{(fy(t)||gy(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)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(Ny(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Iy(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Oy(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 Iy(e,t,n){if(fy(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(X(t)){let r=0;for(let i of t.items){let t=Iy(e,i,n);t>r&&(r=t)}return r}if(J(t)){let r=Iy(e,t.key,n),i=Iy(e,t.value,n);return Math.max(r,i)}return 1}var Ly=e=>!e||typeof e!=`function`&&typeof e!=`object`,Q=class extends Py{constructor(e){super(ly),this.value=e}toJSON(e,t){return t?.keep?this.value:Ny(this.value,e,t)}toString(){return String(this.value)}};Q.BLOCK_FOLDED=`BLOCK_FOLDED`,Q.BLOCK_LITERAL=`BLOCK_LITERAL`,Q.PLAIN=`PLAIN`,Q.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Q.QUOTE_SINGLE=`QUOTE_SINGLE`;var Ry=`tag:yaml.org,2002:`;function zy(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 By(e,t,n){if(py(e)&&(e=e.contents),Z(e))return e;if(J(e)){let t=n.schema[sy].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 Fy(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Ry+t.slice(2));let l=zy(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Q(e);return c&&(c.node=t),t}l=e instance
Line truncated
|
||||
`)?Gy(n,t):n.includes(`
|
||||
`)?`
|
||||
`+Gy(n,t):(e.endsWith(` `)?``:` `)+n,qy=`flow`,Jy=`block`,Yy=`quoted`;function Xy(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===`block`&&(h=Zy(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&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===`
|
||||
`)n===`block`&&(h=Zy(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
||||
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
||||
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){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=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function Zy(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!==`
|
||||
`);r=t,i=t+1,a=e[i]}return r}var Qy=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$y=e=>/^(%|---|\.\.\.)/m.test(e);function eb(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]===`
|
||||
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function tb(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||($y(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)+`
|
||||
|
||||
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
||||
`,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:Xy(o,a,Yy,Qy(t,!1))}function nb(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return tb(e,t);let n=t.indent||($y(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:Xy(r,n,qy,Qy(t,!1))}function rb(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=tb;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?nb:i&&!t?tb:n?nb:tb}return r(e,t)}var ib;try{ib=RegExp(`(^|(?<!
|
||||
))
|
||||
+(?!
|
||||
|$)`,`g`)}catch{ib=/\n+(?!\n|$)/g}function ab({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 rb(n,r);let l=r.indent||(r.forceBlockIndent||$y(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Q.BLOCK_FOLDED?!1:t===Q.BLOCK_LITERAL||!eb(n,c,l.length);if(!n)return u?`|
|
||||
`:`>
|
||||
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
||||
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
||||
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
||||
`&&(p=p.slice(0,-1)),p.replace(ib,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
||||
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),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,`
|
||||
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=Qy(r,!0);o!==`folded`&&t!==Q.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Xy(`${v}${e}${p}`,l,Jy,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function ob(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(`
|
||||
`)||u&&/[[\]{},]/.test(a))return rb(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?rb(a,t):ab(e,t,n,r);if(!s&&!u&&i!==Q.PLAIN&&a.includes(`
|
||||
`))return ab(e,t,n,r);if($y(a)){if(c===``)return t.forceBlockIndent=!0,ab(e,t,n,r);if(s&&c===l)return rb(a,t)}let d=a.replace(/\n+/g,`$&\n${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 rb(a,t)}return s?d:Xy(d,c,qy,Qy(t,!1))}function sb(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!==Q.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Q.QUOTE_DOUBLE);let c=e=>{switch(e){case Q.BLOCK_FOLDED:case Q.BLOCK_LITERAL:return i||a?rb(o.value,t):ab(o,t,n,r);case Q.QUOTE_DOUBLE:return tb(o.value,t);case Q.QUOTE_SINGLE:return nb(o.value,t);case Q.PLAIN:return ob(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 cb(e,t){let n=Object.assign({blockQuote:!0,commentString:Wy,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 lb(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(Y(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 ub(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Y(e)||X(e))&&e.anchor;a&&Oy(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 db(e,t,n,r){if(J(e))return e.toString(t,n,r);if(fy(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=Z(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=lb(t.doc.schema.tags,a);let o=ub(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):Y(a)?sb(a,t,n,r):a.toString(t,n,r);return o?Y(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function fb({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=Z(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(X(e)||!Z(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||X(e)||(Y(e)?e.type===Q.BLOCK_FOLDED||e.type===Q.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=db(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+=Ky(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Ky(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Ky(g,n.indent,l(f))));let _,v,y;Z(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&&Y(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&hy(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=db(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${Gy(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||||
`&&y&&(S=`
|
||||
|
||||
`):S+=`\n${n.indent}`}else if(!p&&X(t)){let e=x[0],r=x.indexOf(`
|
||||
`),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=`\n${n.indent}`)}}else(x===``||x[0]===`
|
||||
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=Ky(g,n.indent,l(y)):h&&i&&i(),g}function pb(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var mb=`<<`,hb={identify:e=>e===mb||typeof e==`symbol`&&e.description===mb,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Q(Symbol(mb)),{addToJSMap:_b}),stringify:()=>mb},gb=(e,t)=>(hb.identify(t)||Y(t)&&(!t.type||t.type===Q.PLAIN)&&hb.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===hb.tag&&e.default);function _b(e,t,n){let r=yb(e,n);if(hy(r))for(let n of r.items)vb(e,t,n);else if(Array.isArray(r))for(let n of r)vb(e,t,n);else vb(e,t,r)}function vb(e,t,n){let r=yb(e,n);if(!my(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 yb(e,t){return e&&fy(t)?t.resolve(e.doc,e):t}function bb(e,t,{key:n,value:r}){if(Z(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(gb(e,n))_b(e,t,r);else{let i=Ny(n,``,e);if(t instanceof Map)t.set(i,Ny(r,i,e));else if(t instanceof Set)t.add(i);else{let a=xb(n,i,e),o=Ny(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function xb(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Z(e)&&n?.doc){let t=cb(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)+`..."`),pb(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 Sb(e,t,n){return new Cb(By(e,void 0,n),By(t,void 0,n))}var Cb=class e{constructor(e,t=null){Object.defineProperty(this,dy,{value:cy}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Z(n)&&(n=n.clone(t)),Z(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return bb(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?fb(this,e,t,n):JSON.stringify(this)}};function wb(e,t,n){return(t.inFlow??e.flow?Eb:Tb)(e,t,n)}function Tb({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(Z(i))!d&&i.spaceBefore&&f.push(``),Db(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(J(i)){let e=Z(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Db(n,f,e.commentBefore,d))}d=!1;let s=db(i,u,()=>o=null,()=>d=!0);o&&(s+=Ky(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?`\n${c}${t}`:`
|
||||
`}}return e?(p+=`
|
||||
`+Gy(l(e),c),s&&s()):d&&o&&o(),p}function Eb({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(Z(i))i.spaceBefore&&d.push(``),Db(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(J(i)){let e=Z(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Db(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Z(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=db(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
||||
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Ky(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?`\n${a}${i}${t}`:`
|
||||
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function Db({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Gy(t(r),e);n.push(i.trimStart())}}function Ob(e,t){let n=Y(t)?t.value:t;for(let r of e)if(J(r)&&(r.key===t||r.key===n||Y(r.key)&&r.key.value===n))return r}var kb=class extends Uy{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(sy,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(Sb(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=J(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Cb(e,e?.value):new Cb(e.key,e.value);let r=Ob(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Y(r.value)&&Ly(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=Ob(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Ob(this.items,e)?.value;return(!t&&Y(n)?n.value:n)??void 0}has(e){return!!Ob(this.items,e)}set(e,t){this.add(new Cb(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)bb(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!J(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})),wb(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Ab={collection:`map`,default:!0,nodeClass:kb,tag:`tag:yaml.org,2002:map`,resolve(e,t){return my(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>kb.from(e,t,n)},jb=class extends Uy{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(uy,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Mb(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Mb(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Y(r)?r.value:r}has(e){let t=Mb(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Mb(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Y(r)&&Ly(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(Ny(e,String(r++),t));return n}toString(e,t,n){return e?wb(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(By(a,void 0,n))}}return i}};function Mb(e){let t=Y(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Nb={collection:`seq`,default:!0,nodeClass:jb,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return hy(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>jb.from(e,t,n)},Pb={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),sb(e,t,n,r)}},Fb={identify:e=>e==null,createNode:()=>new Q(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Q(null),stringify:({source:e},t)=>typeof e==`string`&&Fb.test.test(e)?e:t.options.nullStr},Ib={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Q(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Ib.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Lb({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 Rb={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:Lb},zb={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=
Line truncated
|
||||
`:` `)}return sb({comment:e,type:t,value:s},r,i,a)}};function $b(e,t){if(hy(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!J(r)){if(my(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Cb(new Q(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=J(r)?r:new Cb(r)}}else t(`Expected a sequence for this tag`);return e}function ex(e,t,n){let{replacer:r}=n,i=new jb(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(Sb(o,s,n))}return i}var tx={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:$b,createNode:ex},nx=class e extends jb{constructor(){super(),this.add=kb.prototype.add.bind(this),this.delete=kb.prototype.delete.bind(this),this.get=kb.prototype.get.bind(this),this.has=kb.prototype.has.bind(this),this.set=kb.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(J(e)?(r=Ny(e.key,``,t),i=Ny(e.value,r,t)):r=Ny(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=ex(e,t,n),i=new this;return i.items=r.items,i}};nx.tag=`tag:yaml.org,2002:omap`;var rx={collection:`seq`,identify:e=>e instanceof Map,nodeClass:nx,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=$b(e,t),r=[];for(let{key:e}of n.items)Y(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new nx,n)},createNode:(e,t,n)=>nx.from(e,t,n)};function ix({value:e,source:t},n){return t&&(e?ax:ox).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var ax={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 Q(!0),stringify:ix},ox={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 Q(!1),stringify:ix},sx={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:Lb},cx={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():Lb(e)}},lx={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 Q(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:Lb},ux=e=>typeof e==`bigint`||Number.isInteger(e);function dx(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 fx(e,t,n){let{value:r}=e;if(ux(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Lb(e)}var px={identify:ux,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>dx(e,2,2,n),stringify:e=>fx(e,2,`0b`)},mx={identify:ux,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>dx(e,1,8,n),stringify:e=>fx(e,8,`0`)},hx={identify:ux,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>dx(e,0,10,n),stringify:Lb},gx={identify:ux,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>dx(e,2,16,n),stringify:e=>fx(e,16,`0x`)},_x=class e extends kb{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=J(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Cb(e.key,null):new Cb(e,null),Ob(this.items,t.key)||this.items.push(t)}get(e,t){let n=Ob(this.items,e);return!t&&J(n)?Y(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=Ob(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Cb(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.toStri
Line truncated
|
||||
`)?(n.push(`...`),n.push(Gy(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(Gy(a(t),``)))}return n.join(`
|
||||
`)+`
|
||||
`}var Mx=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,dy,{value:oy});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 Dy({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[dy]:{value:oy}});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=Z(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Nx(this.contents)&&this.contents.add(e)}addIn(e,t){Nx(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=ky(this);e.anchor=!t||n.has(t)?Ay(t||`a`,n):t}return new Fy(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}=jy(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=By(e,l,p);return o&&X(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Cb(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Nx(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Hy(e)?this.contents!=null&&(this.contents=null,!0):Nx(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return X(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Hy(e)?!t&&Y(this.contents)?this.contents.value:this.contents:X(this.contents)?this.contents.getIn(e,t):void 0}has(e){return X(this.contents)?this.contents.has(e):!1}hasIn(e){return Hy(e)?this.contents!==void 0:X(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Vy(this.schema,[e],t):Nx(this.contents)&&this.contents.set(e,t)}setIn(e,t){Hy(e)?this.contents=t:this.contents==null?this.contents=Vy(this.schema,Array.from(e),t):Nx(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 Dy({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 Dy({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 Ax(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=Ny(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`?My(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 jx(this,e)}};function Nx(e){if(X(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Px=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Fx=class extends Px{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Ix=class extends Px{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Lx=(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)+`…
|
||||
`),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+=`:\n\n${o}\n${s}\n`}};function Rx(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`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),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??=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??=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],C=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:C,start:x??C}}function zx(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
||||
`))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(zx(t.key)||zx(t.value))return!0}return!1;default:return!0}}function Bx(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&zx(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Vx(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Y(e)&&Y(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Hx=`All mapping items must start at the same column`;function Ux({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??kb)(n.schema);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=Rx(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`,Hx)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||zx(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`,Hx);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Bx(r.indent,u,i),n.atKey=!1,Vx(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Rx(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&&Bx(r.indent,f,i),s=c.range[2];let l=new Cb(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+=`
|
||||
`+_.comment:g.comment=_.comment);let e=new Cb(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 Wx({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??jb)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=Rx(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&&Bx(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Gx(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 Kx=`Block collections are not allowed within flow collections`,qx=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function Jx({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?kb:jb))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),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=Rx(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+=`
|
||||
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&zx(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=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];J(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
||||
`+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],qx(m)&&i(r.range,`BLOCK_IN_FLOW`,Kx)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);qx(f)&&i(g.range,`BLOCK_IN_FLOW`,Kx),n.atKey=!1;let _=Rx(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?qx(m)&&i(v.range,`BLOCK_IN_FLOW`,Kx):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new Cb(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Vx(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new kb(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=Gx(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
||||
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function Yx(e,t,n,r,i,a){let o=n.type===`block-map`?Ux(e,t,n,r,a):n.type===`block-seq`?Wx(e,t,n,r,a):Jx(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function Xx(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===kb.tagName&&s===`map`||o===jb.tagName&&s===`seq`)return Yx(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),Yx(e,t,n,i,o)}let l=Yx(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Z(u)?u:new Q(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function Zx(e,t,n){let r=t.offset,i=Qx(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?Q.BLOCK_FOLDED:Q.BLOCK_LITERAL,o=t.source?$x(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?`
|
||||
`.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)+`
|
||||
`;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===Q.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
||||
`):t.length>c||r[0]===` `?(f===` `?f=`
|
||||
`:!p&&f===`
|
||||
`&&(f=`
|
||||
|
||||
`),d+=f+t.slice(c)+r,f=`
|
||||
`,p=!0):r===``?f===`
|
||||
`?d+=`
|
||||
`:f=`
|
||||
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
||||
`+o[e][0].slice(c);d[d.length-1]!==`
|
||||
`&&(d+=`
|
||||
`);break;default:d+=`
|
||||
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function Qx({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 $x(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 eS(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=Q.PLAIN,c=tS(a,l);break;case`single-quoted-scalar`:s=Q.QUOTE_SINGLE,c=nS(a,l);break;case`double-quoted-scalar`:s=Q.QUOTE_DOUBLE,c=iS(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=Gx(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function tS(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}`),rS(e)}function nS(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),rS(e.slice(1,-1)).replace(/''/g,`'`)}function rS(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
||||
`?a+=o:o=`
|
||||
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function iS(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
||||
`){if(i===`
|
||||
`){let{fold:t,offset:i}=aS(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=oS[i];if(a)n+=a;else if(i===`
|
||||
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
||||
`)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+=sS(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!==`
|
||||
`&&(a!==`\r`||e[r+2]!==`
|
||||
`)&&(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 aS(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
||||
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
||||
`);)r===`
|
||||
`&&(n+=`
|
||||
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var oS={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function sS(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 cS(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Zx(e,t,r):eS(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[ly]:c?lS(e.schema,i,c,n,r):t.type===`scalar`?uS(e,i,t,r):e.schema[ly];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Y(a)?a:new Q(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new Q(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 lS(e,t,n,r,i){if(n===`!`)return e[ly];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[ly])}function uS({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[ly];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[ly];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 dS(e,t,n){if(t){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 fS={composeNode:pS,composeEmptyNode:mS};function pS(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=hS(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=cS(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=Xx(fS,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??=mS(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&&(!Y(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 mS(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=cS(e,{type:`scalar`,offset:dS(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 hS({options:e},{offset:t,source:n,end:r},i){let a=new Fy(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=Gx(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function gS(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Mx(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Rx(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?pS(c,i,l,o):mS(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Gx(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function _S(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 vS(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?`
|
||||
|
||||
`:`
|
||||
`)+(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 yS=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=_S(e);r?this.warnings.push(new Ix(i,t,n)):this.errors.push(new Fx(i,t,n))},this.directives=new Dy({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=vS(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(X(i)&&!i.flow&&i.items.length>0){let e=i.items[0];J(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${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:vS(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=_S(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=gS(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 Fx(_S(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 Fx(_S(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Gx(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}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Fx(_S(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 Mx(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}}},bS=Symbol(`break visit`),xS=Symbol(`skip children`),SS=Symbol(`remove item`);function CS(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),wS(Object.freeze([]),e,t)}CS.BREAK=bS,CS.SKIP=xS,CS.REMOVE=SS,CS.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},CS.parentCollection=(e,t)=>{let n=CS.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 wS(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=wS(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===bS)return bS;else r===SS&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function TS(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
||||
`:case`\r
|
||||
`: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 ES(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var DS=new Set(`0123456789ABCDEFabcdef`),OS=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),kS=new Set(`,[]{}`),AS=new Set(` ,[]{}
|
||||
\r `),jS=e=>!e||AS.has(e),MS=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===`
|
||||
`||t===`\r`&&this.buffer[e+1]===`
|
||||
`}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===`
|
||||
`||!t&&!this.atEnd)return e+n+1}return t===`
|
||||
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&ES(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(`
|
||||
`,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]===``&&(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``,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===`...`)&&ES(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&&!ES(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===`:`)&&ES(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(jS),`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(`...`))&&ES(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,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(jS),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||ES(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(`
|
||||
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
||||
`,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=>ES(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
||||
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
||||
`)break}default:break loop}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(`
|
||||
`,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===`
|
||||
`;)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===`
|
||||
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,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(ES(r)||e&&kS.has(r))break;t=n}else if(ES(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||||
`?(n+=1,r=`
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&kS.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&kS.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,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;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(jS),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(ES(n)||t&&kS.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!ES(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(OS.has(t))t=this.buffer[++e];else if(t===`%`&&DS.has(this.buffer[e+1])&&DS.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===`
|
||||
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
||||
`?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)}},NS=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 PS(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function FS(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 IS(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 LS(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 RS(e){if(e.length===0)return[];let t=e.length;loop: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 loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function zS(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 BS(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!PS(t.start,`explicit-key-ind`)&&!PS(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,IS(t.value)?t.value.end?zS(t.value.end,t.sep):t.value.end=t.sep:zS(t.start,t.sep),delete t.sep)}var VS=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 MS,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=TS(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else 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}}*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})}else{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`&&BS(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&&FS(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in
Line truncated
|
||||
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
||||
`,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)){zS(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(PS(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=RS(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(PS(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(IS(t.key)&&!PS(t.sep,`newline`)){let e=RS(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 t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):PS(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&&!PS(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)){zS(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||PS(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.ite
Line truncated
|
||||
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
||||
`,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=RS(LS(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=RS(LS(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 HS(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new NS||null,prettyErrors:t}}function US(e,t={}){let{lineCounter:n,prettyErrors:r}=HS(t),i=new VS(n?.addNewLine),a=new yS(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 Fx(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Lx(e,n)),o.warnings.forEach(Lx(e,n))),o}function WS(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=US(e,n);if(!i)return null;if(i.warnings.forEach(e=>pb(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 GS(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 py(e)&&!r?e.toString(n):new Mx(e,r,n).toString(n)}var KS=new Map,qS=(e,t)=>{let n=Object.entries(t).filter(([,e])=>e!==void 0);n.length?KS.set(e,Object.fromEntries(n)):KS.delete(e)},JS=(e,t)=>{qS(e,{...KS.get(e),...t})},YS=({previousPath:e,path:t})=>{let n=e?KS.get(e):void 0;return n?KS.set(t,n):KS.delete(t),n??{}},XS=/(?:^|[^\d])\.0|\d\.0*(?!\d)|\d[eE][-+]?\d/,ZS=/^[-+]?(?:\d+|0o[0-7]+|0x[\da-fA-F]+)$/,QS=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/,$S=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/,eC=/^-?\d+$/,tC=e=>XS.test(e),nC=e=>typeof e==`number`&&Number.isInteger(e),rC=e=>{let t=Object.is(e,-0)?`-0`:String(e);return/[.e]/.test(t)?t:`${t}.0`},iC=(e,t,n)=>{let r=e.get(t);e.set(t,r===void 0||r===n?n:null)},aC=(e,t)=>{let n=String(t).replace(/[\\.]/g,`\\$&`);return e?`${e}.${n}`:n},oC=e=>{let t={},n=(e,r)=>{if(Y(e)){let{value:n,source:i,tag:a}=e;r&&nC(n)&&(!a||a===`tag:yaml.org,2002:float`)&&typeof i==`string`&&!ZS.test(i)&&(t[r]={value:n,source:i})}else my(e)?e.items.forEach(({key:e,value:t})=>{Y(e)&&n(t,aC(r,String(e.value)))}):hy(e)&&e.items.forEach((e,t)=>{n(e,aC(r,t))})};return n(e.contents,``),t},sC=class{constructor(e,t){this.value=e,this.source=t}toJSON(){return this.value}},cC=(e,t,n)=>{let r=n?.source;return nC(t)&&typeof r==`string`&&!eC.test(r)?new sC(t,r):t},lC=e=>{let t={},n=(e,r)=>e instanceof sC?(r&&(t[r]={value:e.value,source:e.source}),e.value):((Array.isArray(e)||c(e))&&Object.entries(e).forEach(([t,i])=>{e[t]=n(i,aC(r,t))}),e);return{value:n(e,``),sourceMap:t}},uC=(e,t)=>{Object.keys(t).length&&JS(e,{valueSources:t})},dC=(e,t)=>{let n=new Map;return Object.entries(e).forEach(([e,t])=>{let[r,...i]=e.split(`.`);n.has(r)||n.set(r,[]),n.get(r).push([i.join(`.`),t])}),Object.fromEntries(t.flatMap((e,t)=>e===void 0?[]:(n.get(String(e))??[]).map(([e,n])=>[e?`${t}.${e}`:String(t),n])))},fC=(e,{value:t,source:n})=>typeof e==`number`&&e===t?new sC(e,n):void 0,pC=(e,t,n=fC,r=``)=>{let i=r&&Object.hasOwn(t,r)?t[r]:void 0,a=i?n(e,i):void 0;return a===void 0?Array.isArray(e)?e.map((e,i)=>pC(e,t,n,aC(r,i))):Tg(e)?Object.fromEntries(Object.entries(e).map(([e,i])=>[e,pC(i,t,n,aC(r,e))])):e:a},mC=(e,t,n)=>n.test(e)&&/[.eE]/.test(e)&&Number(e.replaceAll(`_`,``))===t,hC=({value:e,source:t})=>mC(t,e,$S)?t:void 0,gC={identify:e=>e instanceof sC,default:!0,tag:`tag:yaml.org,2002:float`,resolve:e=>N
Line truncated
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function DC(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function OC(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
|
||||
`,e===t&&(i+=` `.repeat(a+n+2),i+=`^
|
||||
`))}return i}var $=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=DC(t.toml,t.ptr),i=OC(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}};
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function kC(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p<e.s.length;e.p++)if(n=e.s.charCodeAt(e.p),a&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10))c&&=3;else if(n<32&&n!==9||n===127)$.x(`control characters are not allowed in strings`,e);else if((!c||c===3)&&n===r&&(!a||e.s.charCodeAt(e.p+1)===r&&e.s.charCodeAt(e.p+2)===r)){if(a&&(e.s.charCodeAt(e.p+3)===r&&e.p++,e.s.charCodeAt(e.p+3)===r&&e.p++),!c){let t=e.s.slice(s,e.p);o=o?o+t:t}return e.p+=a?3:1,o}else if(!c)!i&&n===92&&(o+=e.s.slice(s,s=e.p),c=1);else if(c===1){if(n===120||n===117||n===85){let t=e.p++-1,r=0,i=n===120?2:n===117?4:8;for(let t=0;t<i;t++,e.p++){let t=e.s.charCodeAt(e.p),n=t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&$.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&$.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=`
|
||||
`:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:$.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&$.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);$.x(`unfinished string`,e,t)}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
var AC=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,jC=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match(AC);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function MC(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function NC(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function PC(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||$.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?GC(e):WC(e);return e.d++,t}return r===34||r===39?kC(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&$.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&$.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?FC(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?RC(e,r,t):e.s.charCodeAt(e.p+2)===58?zC(e,r,t):FC(e,e.p,r,0,t)}function FC(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&$.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&$.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||NC(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return IC(e,t,16,i);if(a===98)return IC(e,t,2,i);if(a===111)return IC(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:$.x(`illegal leading zero`,e,t)}else MC(a)||$.x(`invalid value`,e,t);for(;++e.p<e.s.length&&(a=e.s.charCodeAt(e.p),!NC(a,i));)o||=1,a===95?(o&1||$.x(`illegal underscore`,e),o+=11,s=!0):o===1&&a===46?o=2:(o===1||o===3)&&(a===101||a===69)?o=4:o===4&&(a===43||a===45)?o=6:MC(a)?o>9?o-=11:o&1||o++:$.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||$.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):LC(e,c,10,t)}function IC(e,t,n,r){let i,a=1;for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!NC(i,r));)i===95?(a&1&&$.x(`illegal underscore`,e),a=3):MC(i,n)?a&1&&a--:$.x(`illegal character in numeric literal`,e);a&1&&$.x(`unfinished numeric value`,e);let o=e.s.slice(t+2,e.p);return a&&(o=o.replaceAll(`_`,``)),LC(e,o,n,t)}function LC(e,t,n,r){if(e.bi!==!0)int:{let i=parseInt(t,n);if(!Number.isSafeInteger(i)){if(e.bi)break int;$.x(`integer value cannot be represented losslessly`,e,r)}return i}return BigInt(n===10?t:(n===2?`0b`:n===8?`0o`:`0x`)+t)}function RC(e,t,n){let r=e.p++,i;if(!MC(t)||!MC(e.s.charCodeAt(e.p++))||!MC(e.s.charCodeAt(e.p++))||!MC(e.s.charCodeAt(e.p++)))return FC(e,e.p=r,t,0,n);if(e.p+=5,MC(e.s.charCodeAt(e.p++))||$.x(`invalid date-time: date part is malformed`,e,r),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!MC(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return BC(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&$.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;MC(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return BC(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return BC(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return BC(e,e.s.slice(r,e.p),2,i,r)}function zC(e,t,n){let r=e.p;if(!MC(t)||!MC(e.s.charCodeAt(++e.p)))return FC(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;MC(e.s.charCodeAt(++e.p)););return BC(e,e.s.slice(r,e.p),4,!1,r)}function BC(e,t,n,r,i,a){if(e.ld){let a=new jC(t,n,r);return a.isValid()||$.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){$.x(t instanceof Error?t.message:``+t,e,i)}}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function VC(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&$.x(`control characters are not allowed in comments`,e)}}function HC(e,t,n){let r;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((r=e.s.charCodeAt(e.p))===32||r===9||!t&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||r!==35)break;VC(e)}}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function UC(e,t=61){let n,r=0,i=[],a,o=e.s.charCodeAt(n=e.p);do if(o===t)return r||$.x(`unexpected end of key`,e),r===1&&i.push(e.s.slice(a,e.p)),e.p++,i;else o===46?(r||$.x(`illegal empty bare key`,e),r===1&&i.push(e.s.slice(a,e.p)),r=0):!r&&(o===34||o===39)?(o===e.s.charCodeAt(e.p+1)&&o===e.s.charCodeAt(e.p+2)&&$.x(`illegal quoted key: multiline strings are not allowed`,e),i.push(kC(e)),r=2,e.p--):o===32||o===9?r===1&&(i.push(e.s.slice(a,e.p)),r=2):r===2||o<48&&o!==45||o>57&&o<65||o>90&&o<97&&o!==95||o>122?$.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));$.x(`incomplete key-value: cannot find end of key`,e,n)}function WC(e){let t=e.p++,n=Object.create(null),r=new Set,i;for(;e.p<e.s.length;){if(HC(e),(i=e.s.charCodeAt(e.p))===125)return e.p++,n;let t,a=n,o=!1,s=e.p,c=UC(e);for(let n=0;n<c.length;n++){n&&(a=o?a[t]:a[t]=Object.create(null)),t=c[n],(o=Object.hasOwn(a,t))&&(typeof a[t]!=`object`||r.has(a[t]))&&$.x(`trying to redefine an already defined value`,e,s);let i=t===`__proto__`;if(e.uk&&(i||t===`constructor`)){a=e.uk!==1&&$.x(`document contains an unsafe property`,e,s);break}!o&&i&&Object.defineProperty(a,t,{enumerable:!0,configurable:!0,writable:!0})}o&&$.x(`trying to redefine an already defined value`,e,s),HC(e,!0,!0);let l=PC(e,125);if(a&&typeof(a[t]=l)==`object`&&r.add(l),HC(e),(i=e.s.charCodeAt(e.p++))===125)return n;i!==44&&$.x(`expected comma or end of structure`,e,e.p-1)}$.x(`unfinished table`,e,t)}function GC(e){let t=e.p++,n=[],r;for(;e.p<e.s.length;){if(HC(e),(r=e.s.charCodeAt(e.p))===93)return e.p++,n;if(n.push(PC(e,93)),HC(e),(r=e.s.charCodeAt(e.p++))===93)return n;r!==44&&$.x(`expected comma or end of structure`,e,e.p-1)}$.x(`unfinished array`,e,t)}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function KC(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if(a=c?a[s]:a[s]=Object.create(null),o=(l=o[s]).c,i===0&&(l.t===1||l.t===2))return null;if(l.t===2){let e=a.length-1;a=a[e],o=o[e].c}}if(s=t[n],(c=Object.hasOwn(a,s))&&o[s]?.t===0&&o[s]?.d)return null;if(!c){let r=s===`__proto__`;if(e.uk&&(r||s===`constructor`))return!1;r&&(Object.defineProperty(a,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,s,{enumerable:!0,configurable:!0,writable:!0})),o[s]={t:n<t.length-1&&i===2?3:i,d:!1,i:0,c:Object.create(null)}}}if(l=o[s],l.t!==i&&(i!==1||l.t!==3)||(i===2&&(l.d||(l.d=!0,a[s]=[]),a[s].push(a=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,i===1)a=c?a[s]:a[s]=Object.create(null);else if(i===0&&c)return null;return[s,a,l.c]}function qC(e,t,n){(t===null||e.uk===2)&&$.x(t===null?`trying to redefine an already defined table or value`:`document contains an unsafe property`,e,n)}function JC(e,t={}){let n={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour===`throw`?2:+(t.unsafeKeyBehaviour===`drop`)},r=Object.create(null),i=Object.create(null),a,o=!1,s=r,c=i;for(e.charCodeAt(0)===65279&&n.p++,HC(n);n.p<e.length;){if(e.charCodeAt(n.p)===91){let t=e.charCodeAt(++n.p)===91;a=n.p+=+t,o=!1;let l=UC(n,93);t&&(e.charCodeAt(n.p)!==93&&$.x(`expected end of table array declaration`,n),n.p++);let u=KC(n,l,r,i,t?2:1);u?(c=u[2],s=u[1]):(qC(n,u,a),o=!0)}else{a=n.p;let e=KC(n,UC(n),s,c,0);!e&&!o&&qC(n,e,a),HC(n,!0,!0);let t=PC(n,void 0);e&&!o&&(e[1][e[0]]=t)}HC(n,!0),n.p<e.length&&(a=e.charCodeAt(n.p))!==10&&(a!==13||e.charCodeAt(n.p+1)!==10)&&$.x(`each key-value declaration must be followed by an end-of-line`,n),HC(n)}return r}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
var YC=/^[a-z0-9-_]+$/i,XC=!!``.isWellFormed;function ZC(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(typeof e.getUTCDate==`function`&&e instanceof Date)return`date`;if(globalThis.Temporal){if(e.until){if(e instanceof Temporal.ZonedDateTime)return`temporal/tz+uc`;if(e instanceof Temporal.PlainDateTime||e instanceof Temporal.PlainDate)return`temporal/uc`;if(e instanceof Temporal.PlainTime||e instanceof Temporal.Instant)return`temporal`;if(e instanceof Temporal.PlainYearMonth)return`temporal/x`}else if(e.toPlainDate&&e instanceof Temporal.PlainMonthDay||e.negated&&e instanceof Temporal.Duration)return`temporal/x`}}return t}function QC(e){for(let t=0;t<e.length;t++)if(ZC(e[t])!==`object`)return!1;return e.length!=0}function $C(e){return JSON.stringify(e).replaceAll(``,`\\u007f`)}function ew(e){return $C(XC?e.toWellFormed():e)}function tw(e){if(YC.test(e))return e;if(XC&&!e.isWellFormed())throw RangeError(`key contains illegal lone surrogates`);return $C(e)}function nw(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);switch(t){case`number`:if(isNaN(e))return`nan`;if(e===1/0)return`inf`;if(e===-1/0)return`-inf`;if(Number.isInteger(e)&&(r||!Number.isSafeInteger(e)))return e.toFixed(1);case`bigint`:case`boolean`:case`temporal`:return e.toString();case`string`:return ew(e);case`date`:if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString();case`object`:return rw(e,n,r,i);case`array`:return iw(e,n,r,i);case`temporal/tz+uc`:if(i){let t=e.timeZoneId,n=t.charCodeAt(0);if(n!==43&&n!==45&&(n!==85&&n!==71&&n!==90&&n!==69||t!==`UTC`&&t!==`UCT`&&t!==`Universal`&&t!==`Zulu`&&!t.startsWith(`GMT`)&&t!==`Greenwich`&&!t.startsWith(`Etc/`)))throw TypeError(`Temporal objects with an IANA timezone are not allowed in Temporal strict mode`)}case`temporal/uc`:if(i&&e.calendarId!==`iso8601`)throw TypeError(`Temporal objects with a non-default calendar are not allowed in Temporal strict mode`);return e.toString({calendarName:`never`,timeZoneName:`never`});case`temporal/x`:throw TypeError(`Unsupported `+e[Symbol.toStringTag])}}function rw(e,t,n,r){let i=Object.keys(e);if(i.length===0)return`{}`;let a=`{ `;for(let o=0;o<i.length;o++){let s=i[o];o&&(a+=`, `),a+=tw(s)+` = `+nw(e[s],ZC(e[s]),t-1,n,r)}return a+` }`}function iw(e,t,n,r){if(e.length===0)return`[]`;let i=`[ `;for(let a=0;a<e.length;a++){if(a&&(i+=`, `),e[a]===null||e[a]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);i+=nw(e[a],ZC(e[a]),t-1,n,r)}return i+` ]`}function aw(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``;for(let o=0;o<e.length;o++)a+=`${a&&`
|
||||
`}[[${t}]]\n`,a+=ow(0,e[o],t,n,r,i);return a}function ow(e,t,n,r,i,a){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let o=``,s=``,c=Object.keys(t);for(let e=0;e<c.length;e++){let l=c[e];if(t[l]!==null&&t[l]!==void 0){let e=ZC(t[l]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let c=tw(l);if(e===`array`&&QC(t[l]))s+=(s&&`
|
||||
`)+aw(t[l],n?`${n}.${c}`:c,r-1,i,a);else if(e===`object`){let e=n?`${n}.${c}`:c;s+=(s&&`
|
||||
`)+ow(e,t[l],e,r-1,i,a)}else o+=c,o+=` = `,o+=nw(t[l],e,r,i,a),o+=`
|
||||
`}}return e&&(o||!s)&&(o=o?`[${e}]\n${o}`:`[${e}]`),o&&s?`${o}\n${s}`:o||s}function sw(e,{maxDepth:t=1e3,numbersAsFloat:n=!1,strictTemporal:r=!1}={}){if(ZC(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let i=ow(0,e,``,t,n,r);return i[i.length-1]===`
|
||||
`?i:i+`
|
||||
`}
|
||||
/*!
|
||||
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
var cw=/^(?:[ \t]*(?:#.*)?(?:\n|$))*/,lw=e=>{if(!e.trimStart().startsWith(`#`))return;let[t]=e.match(cw);return(t.length===e.length?e:t.match(/^[\s\S]*\n[ \t]*\n/)?.[0]??``).trim()||void 0},uw=(e,t)=>{let n=lw(t);(n||KS.get(e)?.leadingComment)&&JS(e,{leadingComment:n})},dw=(e,t)=>t?e?`${t}\n\n${e}`:t:e,fw=/(?<![\w.:+-])(?:\d{4}-\d{2}-\d{2}(?:[Tt ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:[Zz]|[+-]\d{2}:\d{2})?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)(?![\w.:+-])/g,pw=/(?<![\w.:+-])[-+]?(?:0x[\da-fA-F_]+|0o[0-7_]+|0b[01_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?)(?![\w.:+-])/g,mw=/"""[\s\S]*?"""(?!")|'''[\s\S]*?'''(?!')|"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|#[^\n]*/g,hw=/^[-+]?\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?$/,gw=class extends jC{#e;constructor(e,t){super(e),this.#e=t}toISOString(){return this.#e}},_w=(e,t)=>{let n=mC(t,e,hw)?t:rC(e);return Object.assign(new Date(0),{toISOString:()=>n})},vw=e=>{let t=new Map,n=new Set;return e.replace(mw,` `).match(pw)?.forEach(e=>{let r=!/^[-+]?0[xob]/.test(e)&&/[.eE]/.test(e),i=Number(e.replaceAll(`_`,``));r?Number.isInteger(i)&&iC(t,i,e):n.add(i)}),n.forEach(e=>{t.delete(e)}),t},yw=e=>{let t=new Map;return e.match(fw)?.forEach(e=>{let n=new jC(e);n.isValid()&&iC(t,n.toISOString(),e)}),t},bw=(e,t)=>{let n={},r,i,a=(t,o)=>{if(t instanceof jC){let i=t.toISOString();r??=yw(e),n[o]={value:i,source:r.get(i)??i}}else Number.isInteger(t)?(i??=tC(e)?vw(e):new Map,i.has(t)&&(n[o]={value:t,source:i.get(t)??rC(t)})):(Array.isArray(t)||c(t))&&Object.entries(t).forEach(([e,t])=>{a(t,aC(o,e))})};return a(t,``),n},xw=({path:e,str:t,parsed:n})=>{uC(e,bw(t,n))},Sw=(e,t)=>e===t||e instanceof jC&&e.toISOString()===t,Cw=(e,{value:t,source:n})=>typeof t==`number`?e===t?_w(t,n):void 0:Sw(e,t)?new gw(t,n):void 0,ww=(e,t)=>pC(e,t,Cw),Tw=(e,t,n)=>cC(e,CC(e,t,n),n),Ew=(e,t)=>{if(t===void 0||!tC(e))return yC(e)?JSON.parse(e,CC):JSON.parse(e);let{value:n,sourceMap:r}=lC(JSON.parse(e,Tw));return uC(t,r),n},Dw=(e,t)=>{let n=SC(JC(e,{integersAsBigInt:`asNeeded`}));return t!==void 0&&xw({path:t,str:e,parsed:n}),r(n)},Ow=(e,t,n)=>{let r=US(e,t);if(r.warnings.forEach(e=>console.warn(e)),r.errors.length)throw r.errors[0];return uC(n,oC(r)),r.toJS(t)},kw=(e,t,n)=>{let r=yC(e),i=r?{...t,intAsBigInt:!0}:t,a=n!==void 0&&tC(e)?Ow(e,i,n):WS(e,i);return r?SC(a):a},Aw=e=>{let t=e.split(`
|
||||
`,1)[0].trim();return im.find(e=>t===rm[e][0])??`yaml-frontmatter`},jw=/^\{\n(?<head>\{[\s\S]*?\})\n\}(?:\n\n(?<body>[\s\S]*))?$/,Mw=(e,t)=>{let n=e.trim();return Ew(n.startsWith(`{`)?n:`{${n}}`,t)},Nw=e=>(t,n)=>{let r=e(t,n);return n!==void 0&&uw(n,t),r},Pw={yaml:Nw((e,t)=>kw(e,void 0,t)),toml:Nw(Dw),json:Ew},Fw={...Pw,json:Mw},Iw=new Map,Lw=({collection:e,collectionFile:t,isIndexFile:n,format:r,text:i,path:a})=>{let{format:o,fmDelimiters:s,bodyField:{key:c=`body`,inline:l=!1}={}}=ph({collection:e,collectionFile:t,isIndexFile:n}),[u,d]=(o===`frontmatter`?uh({format:r,delimiter:s}):s)??rm[`yaml-frontmatter`],f=hf(u),p=hf(d),m=Pm(Iw,`${f}|${p}`,()=>RegExp(`^${f}[ \t]*\n(?:(?<head>[\\s\\S]*?)\n)?${p}[ \t]*(?:\n(?<body>[\\s\\S]*))?$`,`s`)),h=i.trimStart(),g=(r===`json-frontmatter`&&u===`{`&&d===`}`?h.match(jw)?.groups:void 0)??h.match(m)?.groups;if(!g)return{content:{[c]:i},hasFrontMatter:!1};let{head:_=``,body:v}=g,y=im.includes(r)?cm(r):void 0,b=y?Fw[y](_,a):{};return i!==h&&_.trim()&&b!=null&&(typeof b!=`object`||Array.isArray(b))?{content:{[c]:i},hasFrontMatter:!1}:((!b||typeof b!=`object`||Array.isArray(b))&&(b={}),{content:{...b,...!Object.hasOwn(b,c)&&(!l||v?.trim())?{[c]:v?.replace(/^\n/,``)}:{}},hasFrontMatter:!0})},Rw=({path:e,folder:{collectionName:t,fileName:n}})=>{let r=Vh(t),i=r&&n?Zh(r,n):void 0;if(!r)throw Error(`Collection not found`);if(n&&!i)throw Error(`Collection file not found`);let a=!i&&Qp(r,e),{format:o}=ph({collection:r,collectionFile:i,isIndexFile:a});return{collection:r,collectionFile:i,isIndexFile:a,format:o}},zw=e=>{try{return!!kf.get(Rw(e).format)?.parser}catch{return!1}},Bw=async({text:e=``,path:t,folder:n})=>{let r=Rw({path:t,folder:n}),{collection:i,collectionFile:a,isIndexFile:o}=r,{format:s}=r;KS.delete(t),e=e.trimEnd().replace(/\r\n?/g,`
|
||||
`);let c=e.trimStart(),l=kf.get(s)?.parser;if(l)return l(c);if(s===`raw`)return{body:e};try{let n=s===`frontmatter`;if(n&&(s=Aw(c)),im.includes(s)){let{content:r,hasFrontMatter:c}=Lw({collection:i,collectionFile:a,isIndexFile:o,format:s,text:e,path:t});return n&&c&&JS(t,{format:s}),r}let r=cm(s);if(r)return Pw[r](c,t)}catch(e){throw Error(`${t} could not be parsed due to ${e.name}: ${e.message}`)}throw kf.has(s)?Error(`${t} could not be parsed, as no \`fromFile\` method was registered for the custom “${s}” format with \`CMS.registerCustomFormat()\``):Error(`${t} could not be parsed due to an unknown format: ${s}`)},Vw=async()=>{let{scheduler:e}=globalThis;typeof e?.yield==`function`?await e.yield():await a()},Hw=async(e,t,{budget:n=50}={})=>{let r=performance.now();for(let i=0;i<e.length;i+=1)performance.now()-r>=n&&(await Vw(),r=performance.now()),await t(e[i])},Uw=()=>{let e=0;return{next:()=>{e+=1;let t=e;return()=>t===e}}},Ww=(e,{lastInFirstOut:t=!1}={})=>{let n=0,r=[];return Object.assign(async(i,{key:a=void 0}={})=>{n>=e?await new Promise(e=>{r.push({start:e,key:a})}):n+=1;try{return await i()}finally{let e=t?r.pop():r.shift();e?e.start():--n}},{prioritize:e=>{let n=e===void 0?-1:r.findIndex(t=>t.key===e);if(n>-1){let[e]=r.splice(n,1);t?r.push(e):r.unshift(e)}}})},Gw=e=>/\/_index(?:\.[\w-]+)?\.md$/.test(e),Kw=/{{([^]*?)}}/,qw=new Map,Jw=({subPath:e,subPathTemplate:t})=>{if(t?.includes(`{{slug}}`)){let n=Pm(qw,t,()=>{let e=t.split(Kw).map((e,t)=>t%2==0?hf(e):e===`slug`?`([^/]+)`:`[^/]+?`).join(``);return RegExp(`^${e}$`)}),[,r]=e.match(n)??[];if(r)return r}return e},Yw=(e,t=new Set)=>{if(typeof e!=`object`||!e)return!1;if(t.has(e))return!0;t.add(e);let n=Object.values(e).some(e=>Yw(e,t));return t.delete(e),n},Xw=()=>`${s}\n${$f.current}`,Zw=({parsedFileMap:e,path:t,key:n,content:r})=>{try{e.set(t,{key:n,content:structuredClone(r),...KS.get(t)})}catch{}},Qw=async(e,t,n)=>{let{path:r,parsed:i}=e,a=Xw(),o=zw(e);if(i?.key===a&&!o){let{key:e,content:t,...n}=i;return qS(r,n),t}try{if(e.text===void 0)throw Error(`${r} could not be read.`);let t=await Bw(e);if(Yw(t))throw Error(`${r} could not be parsed, as it contains a circular reference.`);return n&&!o&&!yC(e.text)&&Zw({parsedFileMap:n,path:r,key:a,content:t}),t}catch(e){console.error(e),t.push(e);return}},$w=({rawContent:e,fields:t,i18nSingleFile:n,validate:r})=>{let i=t[0].name;if(n)return!c(e)||!Object.values(e).every(r)?void 0:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{[i]:t}]));if(r(e))return{[i]:e}},eT=(e,t,n)=>{if(!c(e))return;let r=t.filter(e=>e!==n),i=Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e))),a={[n]:i};return r.forEach(t=>{c(e[t])&&(a[t]=e[t])}),a},tT=(e,t,n)=>{let r={rawContent:e,fields:t,i18nSingleFile:n};return Y_(t,`list`)?$w({...r,validate:Jv(t[0])?e=>c(e)||Array.isArray(e):Array.isArray}):Y_(t,`keyvalue`)?$w({...r,validate:e=>c(e)&&Object.values(e).every(e=>typeof e==`string`)}):c(e)?e:void 0},nT=(e,t,n)=>{let r=tT(e,t,n);if(r)return n?Object.fromEntries(Object.entries(r).map(([e,n])=>[e,ty(n,t,!0)])):ty(r,t,!0)},rT=(e,t,n,r,i)=>r?.split(`/`).pop()===`_index`&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(e)&&i!==`md`?!0:Gw(e)?!(t||Zp(n)?.name===`_index`||r?.split(`/`).pop()===`_index`&&i===`md`||Tm(n)===`_index`):!1,iT=({file:e,fileName:t,fullPathRegEx:n,defaultLocale:r,isMultiFileStructure:i})=>{let{path:a,folder:{filePathMap:o}}=e;if(t){if(i){let[e,t]=Object.entries(o??{}).find(([,e])=>e===a)??[];return{subPath:t,locale:e}}return{subPath:a,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};let s=a.match(n);if(!s?.groups)return{subPath:void 0,locale:void 0};let{subPath:c,locale:l=r}=s.groups;return{subPath:c,locale:l}},aT=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a})=>{let o=r||Jw({subPath:i,subPathTemplate:a});e.slug=o,e.locales._default={slug:o,path:n,content:Mg(t)}},oT=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,allLocales:o})=>{let s=r||Jw({subPath:i,subPathTemplate:a});e.slug=s,e.locales=Object.fromEntries(o.filter(e=>c(t[e])).map(e=>[e,{slug:s,path:n,content:Mg(t[e])}]))},sT=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,locale:o,defaultLocale:s,collectionName:c,canonicalSlugKey:l,entryMap:u})=>{let d=l&&typeof t[l]==`string`?t[l]:void 0,f=r||Jw({subPath:i,subPathTemplate:a}),p={slug:f,path:n,content:Mg(t)},m=`${c}/${r||(d??i)}`,h=u.get(m);return h?(h.locales[o]=p,o!==s&&h.slug||(h.slug=f,h.subPath=i),!0):(e.id=m,e.locales[o]=p,e.slug=f,u.set(m,e),!1)},cT=new Map,lT=({collection:e,item:t,index:n,path:r,meta:i={}})=>{let{fields:a,_i18n:{i18nEnabled:o,allLocales:s,defaultLocale:c,structureMap:{i18nSingleFileDefaultRoot:l}}}=e,u=l?eT(t,s,c):t,d=u?nT(u,a,o):void 0;if(!d)return;let f=String(n),p={id:``,slug:``,subPath:f,locales:{},arrayIndex:n,...i};return o?oT({entry:p,rawContent:d,path:r,subPath:f,allLocales:s}):aT({entry:p,rawContent:d,path:r,subPath:f}),Object.keys(p.locales).length?p:void 0},uT=({collection:e,file:t,rawConteLine truncated
|
||||
`:`
|
||||
|
||||
`}Signed-off-by: ${o} <${a}>`},uD=e=>{let t=new Map;return e.forEach(e=>{t.has(e.sha)||t.set(e.sha,e)}),[...t.values()].sort((e,t)=>t.date.getTime()-e.date.getTime())},dD=(e,t)=>VE(`Failed to retrieve the last commit hash.`,e,t),fD=async(e,t)=>{let n=await t().catch(()=>void 0);if(n&&n.hash!==e)throw VE(`The branch has moved since the site data was loaded.`,`save_conflict.branch_moved`)},pD=async(e,t,n)=>uD((await RE(e,t)).flat().map(n)),mD=e=>(e.catch(()=>{}),e),hD=e=>{let t=[],n=[],r=[],i=new Set;e.forEach(e=>{let{path:a,name:o}=e;if(o.startsWith(`.`))sE.test(o)&&r.push({...e,type:`config`});else{let[r]=Gv(a);if(r){t.push({...e,type:`entry`,folder:r}),i.add(a);return}if(i.has(a)||Gw(a))return;let[o]=GT(a);o&&n.push({...e,type:`asset`,folder:o})}});let a=[...t,...n,...r];return{entryFiles:t,assetFiles:n,configFiles:r,allFiles:a,count:a.length}},gD=({entryFiles:e,assetFiles:t,configFiles:n})=>`${e.length} entry files, ${t.length} asset files, ${n.length} config files`,_D=e=>{let t=performance.now(),n=t;return(r,...i)=>{let a=performance.now(),o=Math.round(a-n),s=Math.round(a-t);n=a,console.debug(`[${e}] ${r} (+${o} ms, ${s} ms total)`,...i)}},vD={clientId:``,authScope:``,authURL:``,tokenURL:``,authScheme:`token`,restBaseURL:``,graphqlBaseURL:``,includeCredentials:!1},yD={},bD=async(e,t,{includeCredentials:n=!1}={})=>{if(i(e))try{return await fetch(e,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(t),...n&&{credentials:`include`}})}catch{return}},xD=new Map,SD=async({clientId:e,tokenURL:t,refreshToken:n})=>{let r=await bD(t,{grant_type:`refresh_token`,client_id:e,refresh_token:n},{includeCredentials:vD.includeCredentials});if(!r?.ok)throw Error(Yd(`sign_in_error.TOKEN_REFRESH_FAILED`));let i;try{i=await r.json()}catch{}if(!lm(i?.access_token))throw Error(Yd(`sign_in_error.TOKEN_REFRESH_FAILED`));let a=i?.access_token;if(lm(i?.refresh_token)&&(n=i?.refresh_token),YE.account){YE.account={...YE.account,token:a,refreshToken:n};try{await mf.set(qE,YE.account)}catch{}}return{token:a,refreshToken:n}},CD=({clientId:e,tokenURL:t,refreshToken:n})=>{let r=xD.get(n);return r||(r=SD({clientId:e,tokenURL:t,refreshToken:n}).finally(()=>{xD.delete(n)}),xD.set(n,r)),r},wD=`sveltia-cms.token-refresh`,TD=e=>{let t=globalThis.navigator?.locks;return t?t.request(wD,e):e()},ED=e=>{let{account:t}=YE,n=lm(e?.refreshToken)?e.refreshToken:void 0;if(t&&lm(e?.token)&&e.backendName===t.backendName&&e.id===t.id&&(!t.refreshToken||n))return{token:e.token,refreshToken:n}},DD=async()=>{try{return ED(await mf.get(qE))}catch{return}},OD=(e,{token:t,refreshToken:n})=>!!e?.token&&e.token!==t&&e.refreshToken!==n;globalThis.addEventListener?.(`storage`,({key:e,newValue:t})=>{if(e!==`sveltia-cms.user`||!t)return;let n;try{n=JSON.parse(t)}catch{return}let r=ED(n),{account:i}=YE;r&&(r.token!==i.token||r.refreshToken!==i.refreshToken)&&(YE.account={...i,...r})});var kD=async(e,{method:t=`GET`,headers:r={},body:i=null,isGraphQL:a=!1,responseType:o=`json`,token:s=void 0,refreshToken:c=void 0,retryable:l=void 0}={})=>{let{clientId:u,tokenURL:d,restBaseURL:f,graphqlBaseURL:p,authScheme:m=`token`,includeCredentials:h}=vD,g=YE.account,_=a?p:f;s??=g?.token,c??=g?.refreshToken,r.Authorization=`${m} ${s}`;let v=!!g&&s===g.token&&c===g.refreshToken;return n(`${_}${e}`,{method:t,headers:r,body:i,...h&&{credentials:`include`}},{responseType:o,retryable:l,refreshAccessToken:c?()=>TD(async()=>{if(v){let{account:e}=YE;if(e&&OD(e,{token:s,refreshToken:c}))return{token:e.token,refreshToken:e.refreshToken};let t=await DD();if(t&&OD(t,{token:s,refreshToken:c}))return YE.account={...YE.account,...t},t}return CD({clientId:u,tokenURL:d,refreshToken:c})}):void 0})},AD=async(e,t={},{retryable:n}={})=>{e=e.replace(/\n\s*/g,` `),Object.entries(yD).forEach(([n,r])=>{e.includes(`$${n}`)&&(t[n]??=r)});let{data:r}=await kD(``,{method:`POST`,body:{query:e,variables:t},isGraphQL:!0,retryable:n});return r},jD=async({token:e,refreshToken:t},n,r)=>{let i=YE.account?.token,a=await kD(`/user`,{token:e,refreshToken:t}),o=YE.account;return o?.token&&o.token!==e&&o.token!==i&&(e=o.token,t=o.refreshToken),{backendName:n,id:a.id,name:a[r.name],login:a[r.login],email:a.email,avatarURL:a.avatar_url,profileURL:a[r.profileURL],bot:a.bot??!1,token:e,refreshToken:t}},MD=`gitea`,ND=`Gitea / Forgejo`,PD=`forgejo`,FD=`Forgejo`,ID=[MD,PD],LD=e=>!!e&&ID.includes(e),RD=`https://gitea.com/api/v1`,zD=`https://gitea.com`,BD=`login/oauth/authorize`,VD=1.24,HD=q(!1),UD=q(),WD=`sveltia-cms.auth`,GD=`sveltia-cms.auth-popup`,KD=e=>`sveltia-cms.auth.${e}`,qD=e=>`authorizing:${e}`,JD=(e,t,n)=>`authorization:${e}:${t}:${JSON.stringify(n)}`,YD=(e,t)=>t.match(`^authorization:${e}:(success|error):(?<result>.+)`)?.groups?.result,XD=()=>{try{return window.sessionStorage.getItem(GD)}catch{return null}},ZD=e=>{try{e?window.sessionStorage.setItem(GD,e):window.sessionStorage.removeItem(GD)}catch{}},QD=async()=>{ZD(),await mf.delete(WD)},$D=()=>Object.assign(Error(`A
Line truncated
|
||||
|
||||
`):n},XO=({regex:e,prefix:t})=>({strip:t=>{let n=t;for(;e.test(n);)n=n.replace(e,``);return n},format:(e,n)=>n?`${t}${e}`:e}),ZO=(e,{removedStatus:t})=>e.map(({filename:e,status:n,previous_filename:r})=>({path:e,sha:``,size:0,deleted:n===t,previousPath:r||void 0})),QO=({login:e,name:t,email:n,id:r})=>e?{name:t||e,email:n??``,id:r,login:e}:void 0,$O=(e,t)=>({number:e.number,nodeId:String(e.id),url:e.html_url,headSHA:e.head?.sha,createdDate:new Date(e.created_at),updatedDate:new Date(e.updated_at),files:[],...t}),ek={interval:1e3,attempts:30},tk=e=>{let{backend:t}=Zf.current??{};return!!t&&(Array.isArray(e)?e:[e]).includes(t.name)&&`open_authoring`in t&&t.open_authoring===!0},nk=({owner:e,repo:t})=>kT.current??{owner:e,repo:t},rk=async({repoPath:e,allowForking:t})=>{if(!t)throw VE(`The repository does not allow forking`,`open_authoring.forking_disabled`,{repo:e});if(!await LT(e))throw VE(`Permission to fork the repository was declined`,`open_authoring.fork_declined`)},ik=(e,t)=>(console.error(`Failed to fork the repository.`,t),VE(`Failed to fork the repository.`,`open_authoring.fork_failed`,{repo:e})),ak=async({repoPath:e,requestFork:t,requestRenamedFork:n,conflictStatuses:r,isNameTaken:i})=>{try{return await t()}catch(t){if(!r.includes(t.cause?.status)||!await i())throw ik(e,t)}try{return await n()}catch(t){throw ik(e,t)}},ok=async({repoPath:e,checkFork:t,attemptsLeft:n=ek.attempts})=>{let r=await HO(t,e=>e!==`pending`,{...ek,attempts:n});if(r!==`ready`)throw VE(r===`failed`?`The fork could not be created.`:`Timed out waiting for the fork to be created.`,`open_authoring.fork_failed`,{repo:e})},sk=async e=>{kT.current=void 0,jT.current=!1,await e(),jT.current=!0},ck=async e=>{let{repository:t,fetchAccess:n,fetchFork:r,prepareFork:i,fetchForkingAllowed:a}=e,o=await n();if(o.canWrite)return;t.branch||await e.fetchDefaultBranchName?.();let s=await r();s?(await i?.(s),kT.current=s):(await rk({repoPath:`${t.owner}/${t.repo}`,allowForking:await a(o)}),kT.current=await e.createFork())},lk=()=>{if(AT.current)throw VE(`Cannot publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},uk=({branch:e})=>{if(AT.current&&!e)throw VE(`Cannot commit directly to the configured repository`,`open_authoring.direct_commit_unsupported`)},dk=e=>{if(e===`pending_publish`)throw VE(`Cannot mark an entry ready to publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},fk=async({branch:e,mergedSHA:t,fetchBranchHead:n,deleteBranch:r})=>{let i=await n(e);if(!(i&&i!==t))throw i&&await r(e),VE(MT,`open_authoring.entry_already_published`)},pk=(e,t)=>{console.warn(`Failed to sync the ${PT(e)} fork with the upstream repository.`,t)},mk=e=>{console.warn(`The ${PT(e)} fork could not be fast-forwarded to the upstream repository.`)},hk=async(e,t,n)=>{let r;try{r=await(n?n():kD(`${jO(e)}/merge-upstream`,{method:`POST`,body:{branch:t},responseType:`raw`}))}catch(t){pk(e,t);return}r&&!r.ok&&mk(e)},gk=async(e,t)=>{let n=YE.account?.login,r=await BO(jO({owner:n,repo:e.repo}),t);return r?.fork&&NO(r.parent?.full_name,e)&&r.owner?.login?.toLowerCase()===n.toLowerCase()?MO(r.full_name):void 0},_k=async(e,t,n)=>{let r=[],i=[];return e.forEach((e,n)=>{let a=t(e,n);`leftover`in a?r.push(a.leftover):i.push(a.pending)}),await LE(r,n),i},vk=async e=>{let{pullRequest:t,status:n,requestKey:r,createRequest:i,fetchRequest:a,applyStatus:o}=e,{fetchBranchHead:s,deleteBranch:c}=e;dk(n);let{branch:l,title:u}=t;if(t[r]===void 0)return n===`draft`?{...t,status:n,updatedDate:new Date}:i({branch:l,title:u,status:n,description:UO});let d=await a(t);if(d){let{merged:n,isEntryRequest:r,getMergedSHA:i}=d;if(n&&r&&await fk({branch:l,mergedSHA:await i(),fetchBranchHead:s,deleteBranch:c}),n||!r)return vk({...e,pullRequest:{...t,number:void 0,nodeId:void 0,url:void 0}})}return await o({pullRequest:t,status:n,state:d?.state,draft:d?.draft}),{...t,status:n,updatedDate:new Date}},yk=({commit:e,branch:t,title:n})=>({title:n,branch:t,status:`draft`,createdDate:e.date,updatedDate:e.date,files:[],canMerge:!1}),bk=(e,t,n,r=(e,t)=>e===t)=>{let i=e.some(e=>r(e,t));return n&&!i?[...e,t]:!n&&i?e.filter(e=>!r(e,t)):e},xk=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t)),Sk=(e,{maxItems:t,maxSize:n,getSize:r})=>{let i=[],a=[],o=0;return e.forEach(e=>{let s=r(e);a.length&&(a.length===t||o+s>n)&&(i.push(a),a=[],o=0),a.push(e),o+=s}),a.length&&i.push(a),i},Ck=q(``),wk={current:0},Tk=()=>{let e=wk.current;return()=>e!==wk.current},Ek=/netlify|vercel|cloudflare|workers|deploy|preview|pages|render|surge|amplify|firebase/i,Dk=/prod/i,Ok=/canceled|cancelled|skipped|no (?:changes|build)/i,kk={deployment:2,status:1,check:0},Ak=()=>{let{backend:e}=Zf.current??{};return(e??{}).preview_context??``},jk=e=>{if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.protocol===`https:`)return t.href.replace(/\/$/,``)},Mk=(e,t)=>{if(!e)return;let n=``;try{n=new URL(t??``).host}catch{}return(e.match(/https:\/\/[^\s"'<>)\]]+/g)??[]).map(e=>jk
Line truncated
|
||||
//# sourceMappingURL=init-Da57-oKP.js.map
|
||||
Reference in new issue
Block a user