Files
site/node_modules/@sveltia/cms/npm/chunks/init-Da57-oKP.js
T
site-admin 3ac81d5a52
deploy / build-and-publish (push) Successful in 1m37s
the editable site (validation-lab)
2026-11-21 08:03:55 +01:00

454 lines
411 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Le=S([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Re=S(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),ze=S([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Be=S([`#text`]),Ve=S(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),He=S(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ue=S(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),We=S([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ge=C(/{{[\w\W]*|^[\w\W]*}}/g),Ke=C(/<%[\w\W]*|^[\w\W]*%>/g),qe=C(/\${[\w\W]*/g),Je=C(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ye=C(/^aria-[\-\w]+$/),Xe=C(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ze=C(/^(?:\w+script|data):/i),Qe=C(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$e=C(/^html$/i),et=C(/^[a-z][.\w]*(-[.\w]+)+$/i),tt=C(/<[/\w!]/g),nt=C(/<[/\w]/g),rt=C(/<\/no(script|embed|frames)/i),it=C(/\/>/i),at={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ot=S(E({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),st=function(){return typeof window>`u`?null:window},ct=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},lt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ut=function(e,t,n,r){return Ce(e,t)&&le(e[t])?E(r.base?ke(r.base):{},e[t],r.transform):n},dt=function(e,t,n){let r=Ce(e,t)?e[t]:void 0;return r&&typeof r==`object`?ke(r):n()};function ft(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:st(),t=e=>ft(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==at.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=je(d,`cloneNode`),p=je(d,`remove`),m=je(d,`removeAttributeNode`),h=je(d,`nextSibling`),g=je(d,`childNodes`),v=je(d,`parentNode`),y=je(d,`shadowRoot`),b=je(d,`attributes`),x=o&&o.prototype?je(o.prototype,`nodeType`):null,te=o&&o.prototype?je(o.prototype,`nodeName`):null,ne=o&&o.prototype?je(o.prototype,`ownerDocument`):null,w=function(e){return x?x(e):e.nodeType},ye=function(e){return te?te(e):e.nodeName},be=Me(d,`namespaceURI`),xe=function(e){return be?be(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let Se,we=``,T,De=!1,Oe=0,D=function(){if(Oe>0)throw Ee(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},pt=function(e){D(),Oe++;try{return Se.createHTML(e)}finally{Oe--}},mt=function(e){D(),Oe++;try{return Se.createScriptURL(e)}finally{Oe--}},ht=function(){return De||=(T=ct(u,i),!0),T},gt=n,_t=gt.implementation,vt=gt.createNodeIterator,yt=gt.createDocumentFragment,O=gt.getElementsByTagName,bt=r.importNode,k=lt();t.isSupported=typeof _==`function`&&typeof v==`function`&&_t&&_t.createHTMLDocument!==void 0;let xt=Ge,St=Ke,Ct=qe,wt=Je,Tt=Ye,Et=Ze,Dt=Qe,Ot=et,kt=Xe,A=null,At=E({},[...Pe,...Fe,...Ie,...Re,...Be]),j=null,jt=E({},[...Ve,...He,...Ue,...We]),Mt=Object.seal(ee(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Nt=null,Pt=null,Ft=Object.seal(ee(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),It=!0,Lt=!0,Rt=!1,zt=!0,Bt=!1,Vt=!0,Ht=!1,Ut=!1,Wt=null,Gt=null,Kt=!1,qt=!1,Jt=!1,Yt=!1,Xt=!0,Zt=!1,Qt=`user-content-`,$t=!0,en=!1,tn=null,nn={},rn=null,an=E({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),on=null,sn=E({},[`audio`,`video`,`img`,`source`,`image`,`track`]),cn=null,ln=E({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),un=`http://www.w3.org/1998/Math/MathML`,dn=`http://www.w3.org/2000/svg`,fn=`http://www.w3.org/1999/xhtml`,pn=fn,mn=!1,hn=null,gn=E({},[un,dn,fn],me),_n=S([`mi`,`mo`,`mn`,`ms`,`mtext`]),vn=E({},_n),yn=S([`annotation-xml`]),bn=E({},yn),xn=E({},[`title`,`style`,`font`,`a`,`script`]),Sn=null,Cn=[`application/xhtml+xml`,`text/html`],M=null,wn=null,Tn=n.createElement(`form`),En=function(e){return e instanceof RegExp||e instanceof Function},Dn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(wn&&wn===e)return;e&&typeof e==`object`||(e={}),e=ke(e),Sn=Cn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,M=Sn===`application/xhtml+xml`?me:pe,A=ut(e,`ALLOWED_TAGS`,At,{transform:M}),j=ut(e,`ALLOWED_ATTR`,jt,{transform:M}),hn=ut(e,`ALLOWED_NAMESPACES`,gn,{transform:me}),cn=ut(e,`ADD_URI_SAFE_ATTR`,ln,{transform:M,base:ln}),on=ut(e,`ADD_DATA_URI_TAGS`,sn,{transform:M,base:sn}),rn=ut(e,`FORBID_CONTENTS`,an,{transform:M}),Nt=ut(e,`FORBID_TAGS`,ke({}),{transform:M}),Pt=ut(e,`FORBID_ATTR`,ke({}),{transform:M}),nn=Ce(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?ke(e.USE_PROFILES):e.USE_PROFILES:!1,It=e.ALLOW_ARIA_ATTR!==!1,Lt=e.ALLOW_DATA_ATTR!==!1,Rt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bt=e.SAFE_FOR_TEMPLATES||!1,Vt=e.SAFE_FOR_XML!==!1,Ht=e.WHOLE_DOCUMENT||!1,qt=e.RETURN_DOM||!1,Jt=e.RETURN_DOM_FRAGMENT||!1,Yt=e.RETURN_TRUSTED_TYPE||!1,Kt=e.FORCE_BODY||!1,Xt=e.SANITIZE_DOM!==!1,Zt=e.SANITIZE_NAMED_PROPS||!1,$t=e.KEEP_CONTENT!==!1,en=e.IN_PLACE||!1,kt=Ne(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Xe,pn=typeof e.NAMESPACE==`string`?e.NAMESPACE:fn,vn=dt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>E({},_n)),bn=dt(e,`HTML_INTEGRATION_POINTS`,()=>E({},yn));let t=dt(e,`CUSTOM_ELEMENT_HANDLING`,()=>ee(null));if(Mt=ee(null),Ce(t,`tagNameCheck`)&&En(t.tagNameCheck)&&(Mt.tagNameCheck=t.tagNameCheck),Ce(t,`attributeNameCheck`)&&En(t.attributeNameCheck)&&(Mt.attributeNameCheck=t.attributeNameCheck),Ce(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Mt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),C(Mt),Bt&&(Lt=!1),Jt&&(qt=!0),nn&&(A=E({},Be),j=ee(null),nn.html===!0&&(E(A,Pe),E(j,Ve)),nn.svg===!0&&(E(A,Fe),E(j,He),E(j,We)),nn.svgFilters===!0&&(E(A,Ie),E(j,He),E(j,We)),nn.mathMl===!0&&(E(A,Re),E(j,Ue),E(j,We))),Ft.tagCheck=null,Ft.attributeCheck=null,Ce(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ft.tagCheck=e.ADD_TAGS:le(e.ADD_TAGS)&&(A===At&&(A=ke(A)),E(A,e.ADD_TAGS,M))),Ce(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ft.attributeCheck=e.ADD_ATTR:le(e.ADD_ATTR)&&(j===jt&&(j=ke(j)),E(j,e.ADD_ATTR,M))),Ce(e,`ADD_FORBID_CONTENTS`)&&le(e.ADD_FORBID_CONTENTS)&&(rn===an&&(rn=ke(rn)),E(rn,e.ADD_FORBID_CONTENTS,M)),$t&&(A[`#text`]=!0),Ht&&E(A,[`html`,`head`,`body`]),A.table&&(E(A,[`tbody`]),delete Nt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Ee(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Ee(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=Se;Se=e.TRUSTED_TYPES_POLICY;try{we=pt(``)}catch(e){throw Se=t,e}}else e.TRUSTED_TYPES_POLICY===null?(Se=void 0,we=``):(Se===void 0&&(Se=ht()),Se&&typeof we==`string`&&(we=pt(``)));S&&S(e),wn=e},On=E({},[...Fe,...Ie,...Le]),kn=E({},[...Re,...ze]),An=function(e,t,n){return t.namespaceURI===fn?e===`svg`:t.namespaceURI===un?e===`svg`&&(n===`annotation-xml`||vn[n]):!!On[e]},jn=function(e,t,n){return t.namespaceURI===fn?e===`math`:t.namespaceURI===dn?e===`math`&&bn[n]:!!kn[e]},Mn=function(e,t,n){return t.namespaceURI===dn&&!bn[n]||t.namespaceURI===un&&!vn[n]?!1:!kn[e]&&(xn[e]||!On[e])},Nn=function(e){let t=xe(e),n=pe(ye(e)),r=v(e),i,a;return r&&w(r)===at.element?(i={namespaceURI:xe(r)},a=pe(ye(r))):(i={namespaceURI:pn},a=`template`),hn[t]?t===dn?An(n,i,a):t===un?jn(n,i,a):t===fn?Mn(n,i,a):!!(Sn===`application/xhtml+xml`&&hn[t]):!1},Pn=function(e){oe(t.removed,{element:e});try{v(e).removeChild(e)}catch{if(p(e),!v(e))throw Ee(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Fn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},In=function(e){Bn(e);let t=g(e);t&&re(se(t),e=>{try{p(e)}catch{}});let n=w(e)===at.element?b(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Fn(e,r,i)}},Ln=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}oe(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(qt||Jt)try{Pn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Rn=function(e){let t=b(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||j[M(i)]||Fn(e,r,i)}},zn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&w(e)===at.element){let t=y(e);tr(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Bn=function(e){zn(e,e=>{w(e)===at.element&&Rn(e)})},Vn=function(e){let t=[];return zn(e,e=>{t.push(e)},!0),t},Hn=function(e,t){let n=ue();re(Vn(e),e=>{w(e)===at.element&&de(n,e)}),re(t,e=>{w(e)===at.element&&!fe(n,e)&&Rn(e)})},Un=function(e,n){let r=!1;return re(t.removed,t=>{t.element&&(r||=t.element===e,Bn(t.element))}),Hn(e,n),r},Wn=function(e,t){let n=tn,r=null,i=()=>(r||(r=ue(),re(t,e=>{de(r,e)})),r);for(let t=0;;t++){let r=Vn(e),a=[e],o=!1;if(re(r,e=>{w(e)===at.documentFragment?oe(a,e):!o&&!fe(n,e)&&(o=fe(i(),e))}),!o)return;if(t>=8)throw Ee(`the tree kept changing during in-place sanitization; refusing to return it`);re(a,(t,n)=>{Gn(t,n>0,e,i())})}},Gn=function(e,t,n,r){let i=Xn(e),a;for(;a=i.nextNode();)fe(r,a)&&!fe(tn,a)&&(t&&rr(k.uponSanitizeShadowNode,a,null),lr(a,n),hr(a,n),tr(a.content)&&gr(a.content))},Kn=function(e){tn&&de(tn,e)},qn=function(e,t){return Vt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Jn=function(e){Vt&&zn(e,e=>{let t=w(e);if(t===at.processingInstruction||t===at.comment&&Te(nt,e.data)){try{p(e)}catch{}return!1}if(t===at.element){let t=e,n=M(ye(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&qn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Yn=function(e){let t=null,r=null;if(Kt)e=`<remove></remove>`+e;else{let t=he(e,/^[\r\n\t ]+/);r=t&&t[0]}Sn===`application/xhtml+xml`&&pn===fn&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=Se?pt(e):e;if(pn===fn)try{t=new l().parseFromString(i,Sn)}catch{}if(!t||!t.documentElement){t=_t.createDocument(pn,`template`,null);try{t.documentElement.innerHTML=mn?we:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),pn===fn?O.call(t,Ht?`html`:`body`)[0]:Ht?t.documentElement:a},Xn=function(e){let t=ne?ne(e):e.ownerDocument;return vt.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Zn=function(e){return e=ge(e,xt,` `),e=ge(e,St,` `),e=ge(e,Ct,` `),e},Qn=function(e){$n(e);let t=e.querySelectorAll?.call(e,`template`);t&&re(t,e=>{tr(e.content)&&Qn(e.content)})},$n=function(e){e.normalize();let t=ne?ne(e):e.ownerDocument,n=vt.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Zn(r.data),r=n.nextNode()},er=function(e){let t=te?te(e):null;return typeof t!=`string`||M(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==b(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==x(e)||e.childNodes!==g(e)},tr=function(e){if(!x||typeof e!=`object`||!e)return!1;try{return x(e)===at.documentFragment}catch{return!1}},nr=function(e){if(!x||typeof e!=`object`||!e)return!1;try{return typeof x(e)==`number`}catch{return!1}};function rr(e,n,r){e.length!==0&&re(e,e=>{e.call(t,n,r,wn)})}let ir=function(e,t){return!!(Vt&&e.hasChildNodes()&&!nr(e.firstElementChild)&&Te(tt,e.textContent)&&Te(tt,e.innerHTML)||Vt&&ot[t]&&w(e)===at.element&&xe(e)===fn&&(nr(e.firstElementChild)||typeof e.textContent==`string`&&Te(tt,e.textContent))||e.nodeType===at.processingInstruction||Vt&&e.nodeType===at.comment&&Te(nt,e.data))},ar=function(e,t){return e instanceof RegExp?Te(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},or=function(e,t,n){if(!Nt[t]&&dr(t)&&ar(Mt.tagNameCheck,t))return!1;if($t&&!rn[t]&&!rn[pe(t)]){let t=v(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Pn(e),!0},sr=function(e,t,n,r){return e.length===0?t:t===n||t===r?ke(t):t},cr=function(e,t){return e===t||v(e)!==null?!1:(en&&Bn(e),!0)},lr=function(e,n){if(Kn(e),rr(k.beforeSanitizeElements,e,null),cr(e,n))return!0;if(er(e))return Pn(e),!0;let r=M(ye(e));if(A=sr(k.uponSanitizeElement,A,At,Wt),rr(k.uponSanitizeElement,e,{tagName:r,allowedTags:A}),cr(e,n))return!0;if(ir(e,r))return Pn(e),!0;if(Nt[r]||!(Ft.tagCheck instanceof Function&&Ft.tagCheck(r))&&!A[r]){let t=or(e,r,n);return t===!1&&(rr(k.afterSanitizeElements,e,null),cr(e,n))?!0:t}if(w(e)===at.element&&!Nn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Te(rt,e.innerHTML))return Pn(e),!0;if(Bt&&e.nodeType===at.text){let n=Zn(e.textContent);e.textContent!==n&&(oe(t.removed,{element:e.cloneNode()}),e.textContent=n)}return rr(k.afterSanitizeElements,e,null),cr(e,n)},N=function(e,t,r){if(Pt[t]||qn(t,e)||Xt&&(t===`id`||t===`name`)&&(r in n||r in Tn))return!1;let i=j[t]||Ft.attributeCheck instanceof Function&&Ft.attributeCheck(t,e);return Lt&&Te(wt,t)||It&&Te(Tt,t)?!0:i?cn[t]||Te(kt,ge(r,Dt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&_e(r,`data:`)===0&&on[e]||Rt&&!Te(Et,ge(r,Dt,``))?!0:!r:dr(e)&&ar(Mt.tagNameCheck,e)&&ar(Mt.attributeNameCheck,t,e)||t===`is`&&Mt.allowCustomizedBuiltInElements&&ar(Mt.tagNameCheck,r)},ur=E({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),dr=function(e){return!ur[pe(e)]&&Te(Ot,e)},fr=function(e,t,n,r){if(Se&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return pt(r);case`TrustedScriptURL`:return mt(r)}return r},pr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!er(e)||(Pn(e),!1)}catch{return Ln(t,e),!1}},mr=function(e,t){return Vt&&Te(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:pe(e)===`attributename`&&he(t,`href`)!==null},hr=function(e,n){if(rr(k.beforeSanitizeAttributes,e,null),cr(e,n))return;let r=e.attributes;if(!r||er(e))return;j=sr(k.uponSanitizeAttribute,j,jt,Gt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},a=r.length,o=M(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=M(s),d=l,f=s===`value`?d:ve(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,rr(k.uponSanitizeAttribute,e,i),f=i.attrValue,Zt&&(u===`id`||u===`name`)&&_e(f,Qt)!==0&&(Ln(s,e,n),f=Qt+f,p=!0),mr(s,f)?Ln(s,e,n):i.forceKeepAttr||(i.keepAttr?!zt&&Te(it,f)?Ln(s,e,n):(Bt&&(f=Zn(f)),N(o,u,f)?(f=fr(o,u,c,f),f!==d&&pr(e,s,c,f)&&p&&ae(t.removed)):Ln(s,e,n)):Ln(s,e,n))}rr(k.afterSanitizeAttributes,e,null),cr(e,n)},gr=function(e){let t=null,n=Xn(e);for(rr(k.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(rr(k.uponSanitizeShadowNode,t,null),lr(t,e),hr(t,e),tr(t.content)&&gr(t.content),w(t)===at.element){let e=y(t);tr(e)&&(_r(e),gr(e))}Bt&&$n(e),rr(k.afterSanitizeShadowDOM,e,null)},_r=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){gr(e.shadow);continue}let n=e.node,r=w(n)===at.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=te?te(n):null;if(typeof e==`string`&&M(e)===`template`){let e=n.content;tr(e)&&t.push({node:e,shadow:null})}}if(r){let e=y(n);tr(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(mn=!e,mn&&(e=`<!-->`),typeof e!=`string`&&!nr(e)&&(e=Ae(e),typeof e!=`string`))throw Ee(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ut?(A=Wt,j=Gt):Dn(n),(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&(A=ke(A)),k.uponSanitizeAttribute.length>0&&(j=ke(j)),t.removed=[];let c=en&&typeof e!=`string`&&nr(e),l=[],u=tn;if(c){Jn(e);let t=ye(e);if(typeof t==`string`){let n=M(t);if(!A[n]||Nt[n])throw In(e),Ee(`root node is forbidden and cannot be sanitized in-place`)}if(er(e))throw In(e),Ee(`root node is clobbered and cannot be sanitized in-place`);l=Vn(e),tn=ue()}else if(nr(e))i=Yn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===at.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),_r(i);else{if(!qt&&!Bt&&!Ht&&e.indexOf(`<`)===-1)return Se&&Yt?pt(e):e;if(i=Yn(e),!i)return qt?null:Yt?we:``}i&&Kt&&Pn(i.firstChild);let d=c?e:i;try{c&&_r(e);let t=Xn(d);for(;o=t.nextNode();)lr(o,d),hr(o,d),tr(o.content)&&gr(o.content);c&&Wn(e,l)}catch(t){throw c&&(In(e),Un(e,l)),t}finally{tn=u}if(c){if(Un(e,l))throw Ee(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Bt&&Qn(e),e}if(qt){if(Bt&&Qn(i),Jt)for(s=yt.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(j.shadowroot||j.shadowrootmode)&&(s=bt.call(r,s,!0)),s}let f=Ht?i.outerHTML:i.innerHTML;return Ht&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Te($e,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
`+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}#{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,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),A=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,At=/^[^\n]+/,j=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,jt=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,j).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Mt=O(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Et).getRegex(),Nt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Pt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ft=O(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Pt).replace(`tag`,Nt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),It=e=>O(A).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Nt).getRegex(),Lt=It(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Rt=It(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),zt={blockquote:O(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Rt).getRegex(),code:St,def:jt,fences:Ct,heading:Tt,hr:wt,html:Ft,lheading:Ot,list:Mt,newline:xt,paragraph:Lt,table:vt,text:At},Bt=O(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Nt).getRegex(),Vt={...zt,lheading:kt,table:Bt,paragraph:O(A).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Bt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Nt).getRegex()},Ht={...zt,html:O(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,Pt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O(A).replace(`hr`,wt).replace(`heading`,` *#{1,6} *[^
]`).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,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),kn={_backpedal:vt,anyPunctuation:hn,anyPunctuationOutsideCode:gn,autolink:_n,blockSkip:tn,br:Gt,code:Wt,del:vt,delLDelim:vt,delRDelim:vt,emStrongLDelim:rn,emStrongRDelimAst:cn,emStrongRDelimUnd:dn,escape:Ut,link:Sn,nolink:M,punctuation:Xt,reflink:Cn,reflinkSearch:En,tag:yn,text:Kt,url:vt},An={...kn,emStrongLDelim:on,emStrongRDelimAst:un,emStrongRDelimUnd:fn,link:O(/^!?\[(label)\]\((.*?)\)/).replace(`label`,xn).getRegex(),reflink:O(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,xn).getRegex()},jn={...kn,emStrongRDelimAst:ln,emStrongLDelim:an,delLDelim:pn,delRDelim:mn,url:O(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,On).replace(`protocol`,Dn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:O(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Dn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(`wwwStart`,bt?`(?<![^\\s*_~(])www\\.`:`www\\.`).getRegex()},Mn={...jn,br:O(Gt).replace(`{2,}`,`*`).getRegex(),text:O(jn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Nn={normal:zt,gfm:Vt,pedantic:Ht},Pn={normal:kn,gfm:jn,breaks:Mn,pedantic:An},Fn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},In=e=>Fn[e];function Ln(e,t){if(t){if(k.escapeTest.test(e))return e.replace(k.escapeReplace,In)}else if(k.escapeTestNoEncode.test(e))return e.replace(k.escapeReplaceNoEncode,In);return e}function Rn(e){return k.numericCharacterReference.test(e)?e.replace(k.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function zn(e){try{e=encodeURI(e).replace(k.percentDecode,`%`)}catch{return null}return e}function Bn(e,t){let n=e.replace(k.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(k.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(k.slashPipe,`|`);return n}function Vn(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Hn(e){let t=e.split(`
`),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]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Rn(t[0]),escaped:e}}}},nr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||gt,this.options.tokenizer=this.options.tokenizer||new tr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:k,block:Nn.normal,inline:Pn.normal};this.options.pedantic?(t.block=Nn.pedantic,t.inline=Pn.pedantic):this.options.gfm&&(t.block=Nn.gfm,t.inline=this.options.breaks?Pn.breaks:Pn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Nn,inline:Pn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(k.carriageReturn,`
`),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(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new or;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=or.passThroughHooks.has(n)?e=>{if(t.options.async&&or.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return sr(n,r.call(this,e)),t&&sr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return nr.lex(e,t??this.defaults)}parser(e,t){return ar.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?nr.lex:nr.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ar.parse:ar.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?nr.lex:nr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ar.parse:ar.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
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);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(vr(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=Vi(l,t,n,r,null,a))}return s}if(Dr(e)===Tr){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=Vi(e[u],t,n,r,null,a);return s}if(e instanceof Date)return e.getTime(),structuredClone(e);if(typeof e.toJSON==`function`&&!a)return Vi(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}function Hi(e){let t=e.p;for(;t!==null&&t.c===null;)t=t.p;return t?.c??null}function Ui(e,t){return e===null&&Di(t),e.c??=new Map(Hi(e)||void 0)}var Wi=null;function Gi(e){Wi=e}function Ki(e){return Ui(Wi,`getContext`).get(e)}function qi(e,t){return Ui(Wi,`setContext`).set(e,t),t}function Ji(){return Ui(Wi,`getAllContexts`)}function Yi(e,t=!1,n){Wi={p:Wi,i:!1,c:null,e:null,s:e,x:null,r:V,l:null}}function Xi(e){var t=Wi,n=t.e;if(n!==null){t.e=null;for(var r of n)Mo(r)}return e!==void 0&&(t.x=e),t.i=!0,Wi=t.p,Zi(e)}function Zi(e={}){return Sr(e,$r,{value:!0}),e}function Qi(){return!0}var $i=[];function ea(){var e=$i;$i=[],Mr(e)}function ta(e){if($i.length===0&&!ja){var t=$i;queueMicrotask(()=>{t===$i&&ea()})}$i.push(e)}function na(){for(;$i.length>0;)ea()}var ra=~(Rr|zr|Lr);function ia(e,t){e.f=e.f&ra|t}function aa(e){e.f&512||e.deps===null?ia(e,Lr):ia(e,zr)}function oa(e,t){e.f&2048?t.set(e,Rr):e.f&4096&&t.get(e)!==2048&&t.set(e,zr),ia(e,Lr)}function sa(e,t){if(t){let t=document.body;e.autofocus=!0,ta(()=>{document.activeElement===t&&e.focus()})}}function ca(e){F&&mo(e)!==null&&bo(e)}var la=!1;function ua(){la||(la=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[oi]?.()})},{capture:!0}))}function da(e){var t=B,n=V;as(null),os(null);try{return e()}finally{as(t),os(n)}}function fa(e,t,n,r=n){e.addEventListener(t,()=>da(n));let i=e[oi];e[oi]=i?()=>{i(),r(!0)}:()=>r(!0),ua()}function pa(e,t,n,r){let i=Qi()?_a:xa;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=V,c=ma(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){To(e,s)}ha()}}var d=ga();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>ya(e))).then(u).catch(e=>To(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),ha())}):f()}function ma(){var e=V,t=B,n=Wi,r=R;return function(i=!0){os(e),as(t),Gi(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function ha(e=!0){os(null),as(null),Gi(null),e&&R?.deactivate()}function ga(){var e=V,t=e.b,n=R,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function _a(e){var t=2|Rr;return V!==null&&(V.f|=Kr),{ctx:Wi,deps:null,effects:null,equals:wi,f:t,fn:e,reactions:null,rv:0,v:P,wv:0,parent:V,ac:null}}var va=Symbol(`obsolete`);function ya(e,t,n){let r=V;r===null&&Oi();var i=void 0,a=Ja(P),o=!B,s=new Set;return Lo(()=>{var t=V,n=Nr();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==si&&n.reject(e)}).finally(ha)}catch(e){n.reject(e),ha()}var c=R;if(o){if(t.f&32768)var l=ga();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(va);else for(let e of s.values())e.reject(va);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==va&&(c.activate(),t?(a.f|=Zr,$a(a,t)):(a.f&8388608&&(a.f^=Zr),$a(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Ao(()=>{for(let e of s)e.reject(va)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function ba(e){let t=_a(e);return cs(t),t}function xa(e){let t=_a(e);return t.equals=Ei,t}function Sa(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)qo(t[n])}}function Ca(e){var t,n=V,r=e.parent;if(!ns&&r!==null&&e.v!==P&&r.f&24576)return mi(),e.v;os(r);try{Sa(e),t=bs(e)}finally{os(n)}return t}function wa(e){var t=Ca(e);!e.equals(t)&&(e.wv=_s(),(!R?.is_fork||e.deps===null)&&(R===null?e.v=t:(R.capture(e,t,!0),Oa?.capture(e,t,!0)),e.deps===null))?ia(e,Lr):ns||(ka===null?aa(e):(ko()||R?.is_fork)&&ka.set(e,t))}function Ta(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&da(()=>{t.ac.abort(si),t.ac=null}),t.fn!==null&&(t.teardown=Ar),Cs(t,0),Go(t))}function Ea(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&ws(t)}var Da=null,R=null,Oa=null,ka=null,Aa=null,ja=!1,Ma=!1,Na=null,Pa=null,Fa=0,Ia=1,La=class e{id=Ia++;started=!1;linked=!0;prev=null;next=null;async_deriveds=new Map;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=new Map;#i=null;#a=[];#o=[];#s=new Map;#c=new Map;#l=new Set;is_fork=!1;#u=!1;constructor(){Da===null?Da=this:(Da.next=this,this.prev=Da),Da=this}#d(){if(this.is_fork)return!0;for(let e of this.#r.keys())if(!this.#f(e))return!0;return!1}#f(e){for(var t=e;t!==null;t=t.parent)if(this.#c.has(t))return!0;return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]}),this.#l.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#c.get(e);if(n){this.#c.delete(e);for(var r of n.d)ia(r,Rr),t(r);for(r of n.m)ia(r,zr),t(r)}this.#l.add(e)}#p(){var e=[];for(let i of this.#a)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=Lr}}n||e.push(t)}return this.#a=[],e}#m(){this.started=!0;for(let[e,t]of this.#s)ia(e,t),this.schedule(e);this.apply();for(var t=Na=[],n=[],r=Pa=[];this.#a.length>0;){Fa++>1e3&&(this.#b(),za());for(let e of this.#p())try{this.#h(e,t,n)}catch(t){throw Wa(e),this.#d()||this.discard(),t}}if(R=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Na=null,Pa=null,this.#d()){this.#y(n),this.#y(t);for(let[e,t]of this.#c)Ua(e,t);r.length>0&&R.#m();return}let a=this.#g();if(a)this.#y(n),this.#y(t),a.#v(this);else{this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),Oa=this,Va(n),Va(t),Oa=null,this.#i?.resolve();var o=R;this.#n===0&&(this.#a.length===0||o!==null)&&this.#b(),o!==null&&(Ka.clear(),o.#m())}}#h(e,t,n){e.f^=Lr;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=Lr:i&4?t.push(r):vs(r)&&(i&16&&this.add_dirty_reaction(r,zr),ws(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(){for(var e=this.prev;e!==null;e=e.prev)if(!e.is_fork&&this.#_(e))return e;return null}#_(e){for(let[t,[,n]]of this.current)if(!n&&e.current.has(t))return!0;return!1}#v(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_reactions(e.#s);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#s.delete(i),ia(i,Rr),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#b(),R=this,this.#m()}#y(e){for(var t=0;t<e.length;t+=1)oa(e[t],this.#s)}capture(e,t,n=!1){e.v!==P&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),ka?.set(e,t)),this.is_fork||(e.v=t)}activate(){R=this}deactivate(){R=null,ka=null}flush(){try{Ma=!0,R=this,this.#m()}finally{Fa=0,Aa=null,Na=null,Pa=null,Ma=!1,R=null,ka=null,Ka.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear();for(let e of this.async_deriveds.values())e.reject(va);this.#b(),this.#i?.resolve()}register_created_effect(e){this.#o.push(e)}increment(e,t){if(this.#n+=1,e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t){if(--this.#n,e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#u||(this.#u=!0,ta(()=>{this.#u=!1,this.linked&&this.flush()}))}transfer_reactions(e){for(let[t,n]of e)this.add_dirty_reaction(t,n);e.clear()}add_dirty_reaction(e,t){(t===2048||this.#s.get(e)!==2048)&&this.#s.set(e,t)}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=Nr()).promise}static ensure(){if(R===null){let t=R=new e;!Ma&&!ja&&ta(()=>{t.started||t.flush()})}return R}apply(){ka=null}schedule(e){Aa=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#a.push(e)}#b(){if(this.linked){var e=this.prev,t=this.next;e===null||(e.next=t),t===null?Da=e:t.prev=e,this.linked=!1}}};function Ra(e){var t=ja,n=Oa;Oa=null,ja=!0;try{var r;for(e&&(Ra(),r=e());;){if(na(),R===null)return r;R.flush()}}finally{ja=t,Oa=n}}function za(){try{Ni()}catch(e){To(e,Aa)}}var Ba=null;function Va(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&vs(r)&&(Ba=new Set,ws(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Yo(r),Ba?.size>0)){Ka.clear();for(let e of Ba){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Ba.has(n)&&(Ba.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||ws(n)}}Ba.clear()}}Ba=null}}function Ha(e){R.schedule(e)}function Ua(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),ia(e,Lr);for(var n=e.first;n!==null;)Ua(n,t),n=n.next}}function Wa(e){ia(e,Lr);for(var t=e.first;t!==null;)Wa(t),t=t.next}var Ga=new Set,Ka=new Map,qa=!1;function Ja(e,t){return{f:0,v:e,reactions:null,equals:wi,rv:0,wv:0}}function Ya(e,t){let n=Ja(e,t);return cs(n),n}function Xa(e,t=!1,n=!0){let r=Ja(e);return t||(r.equals=Ei),r}function z(e,t,n=!1){return B!==null&&(!is||B.f&131072)&&Qi()&&B.f&4325394&&(ss===null||!ss.has(e))&&Li(),$a(e,n?ro(t):t,Pa)}var Za=null,Qa=0;function $a(e,t,n=null){if(!e.equals(t)){ns?Ka.set(e,t):Ka.has(e)||Ka.set(e,e.v);var r=La.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Ca(t),ka===null&&aa(t)}e.wv=_s(),Za=null,Qa=0,no(e,Rr,n),Za=null,Qi()&&V!==null&&V.f&1024&&!(V.f&96)&&(ds===null?fs([e]):ds.push(e)),!r.is_fork&&Ga.size>0&&!qa&&eo()}return t}function eo(){qa=!1;for(let e of Ga){e.f&1024&&ia(e,zr);let t;try{t=vs(e)}catch{t=!0}t&&ws(e)}Ga.clear()}function to(e){z(e,e.v+1)}function no(e,t,n){var r=e.reactions;if(r!==null){var i=Qi(),a=r.length;if(Qa+=a,Qa>1e5&&Za===null&&(Za=new Set),Za!==null){if(Za.has(e))return;Za.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==V){var l=(c&Rr)===0;if(l&&ia(s,t),c&131072)Ga.add(s);else if(c&2){var u=s;ka?.delete(u),no(u,zr,n)}else if(l){var d=s;c&16&&Ba!==null&&Ba.add(d),n===null?Ha(d):n.push(d)}}}}}function ro(e){if(typeof e!=`object`||!e||Qr in e||$r in e)return e;let t=Dr(e);if(t!==Tr&&t!==Er)return e;var n=new Map,r=vr(e),i=Ya(0),a=null,o=hs,s=e=>{if(hs===o)return e();var t=B,n=hs;as(null),gs(o);var r=e();return as(t),gs(n),r};return r&&n.set(`length`,Ya(e.length,a)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&r.configurable!==!1&&r.enumerable!==!1&&r.writable!==!1||Fi();var i=n.get(t);return i===void 0?s(()=>{var e=Ya(r.value,a);return n.set(t,e),e}):z(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>Ya(P,a));n.set(t,e),to(i)}}else z(r,P),to(i);return!0},get(t,r,i){if(r===Qr)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||Cr(t,r)?.writable)&&(o=s(()=>Ya(ro(c?t[r]:P),a)),n.set(r,o)),o!==void 0){var l=H(o);return l===P?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=H(i);if(a===P)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===Qr)return!0;var r=n.get(t),i=r!==void 0&&r.v!==P||Reflect.has(e,t);return(r!==void 0||(V!==null||B!==null)&&(!i||Cr(e,t)?.writable))&&(r===void 0&&(r=s(()=>Ya(i?ro(e[t]):P,a)),n.set(t,r)),H(r)===P)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>Ya(P,a)),n.set(d+``,f)):z(f,P)}if(l===void 0)(!u||Cr(e,t)?.writable)&&(l=s(()=>Ya(void 0,a)),z(l,ro(o)),n.set(t,l));else{u=l.v!==P;var p=s(()=>ro(o));z(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&z(h,g+1)}to(i)}return!0},ownKeys(e){H(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==P});for(var[r,a]of n)a.v!==P&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Ii()}})}function io(e){try{if(typeof e==`object`&&e&&Qr in e)return e[Qr]}catch{}return e}function ao(e,t){return Object.is(io(e),io(t))}var oo,so,co,lo,uo;function fo(){if(oo===void 0){oo=window,so=document,co=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;lo=Cr(t,`firstChild`).get,uo=Cr(t,`nextSibling`).get,Or(e)&&(e[ri]=void 0,e[ni]=null,e[ii]=void 0,e.__e=void 0),Or(n)&&(n[ai]=void 0)}}function po(e=``){return document.createTextNode(e)}function mo(e){return lo.call(e)}function ho(e){return uo.call(e)}function go(e,t){if(!F)return mo(e);var n=mo(I);if(n===null)n=I.appendChild(po());else if(t&&n.nodeType!==3){var r=po();return n?.before(r),L(r),r}return t&&Co(n),L(n),n}function _o(e,t=!1){if(!F){var n=mo(e);return n instanceof Comment&&n.data===``?ho(n):n}if(t){if(I?.nodeType!==3){var r=po();return I?.before(r),L(r),r}Co(I)}return I}function vo(e,t=!1){if(!F)return mo(e);var n=go(e,t);return bi(e),n}function yo(e,t=1,n=!1){let r=F?I:e;for(var i;t--;)i=r,r=ho(r);if(!F)return r;if(n){if(r?.nodeType!==3){var a=po();return r===null?i?.after(a):r.before(a),L(a),a}Co(r)}return L(r),r}function bo(e){e.textContent=``}function xo(){return!1}function So(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Co(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function wo(e){var t=V;if(t===null)return B.f|=Zr,e;if(!(t.f&32768)&&!(t.f&4))throw e;To(e,t)}function To(e,t){if(e===li)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function Eo(e){V===null&&(B===null&&Mi(e),ji()),ns&&Ai(e)}function Do(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Oo(e,t){var n=V;n!==null&&n.f&8192&&(e|=Br);var r={ctx:Wi,deps:null,nodes:null,f:e|Rr|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};R?.register_created_effect(r);var i=r;if(e&4)Na===null?La.ensure().schedule(r):Na.push(r);else if(t!==null){try{ws(r)}catch(e){throw qo(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=Wr))}if(i!==null&&(i.parent=n,n!==null&&Do(i,n),B!==null&&B.f&2&&!(e&64))){var a=B;(a.effects??=[]).push(i)}return r}function ko(){return B!==null&&!is}function Ao(e){let t=Oo(8,null);return ia(t,Lr),t.teardown=e,t}function jo(e){Eo(`$effect`);var t=V.f;if(!B&&t&32&&Wi!==null&&!Wi.i){var n=Wi;(n.e??=[]).push(e)}else return Mo(e)}function Mo(e){return Oo(4|qr,e)}function No(e){return Eo(`$effect.pre`),Oo(8|qr,e)}function Po(e){La.ensure();let t=Oo(64|Kr,e);return()=>{qo(t)}}function Fo(e){La.ensure();let t=Oo(64|Kr,e);return(e={})=>new Promise(n=>{e.outro?Xo(t,()=>{qo(t),n(void 0)}):(qo(t),n(void 0))})}function Io(e){return Oo(4,e)}function Lo(e){return Oo(Xr|Kr,e)}function Ro(e,t=0){return Oo(8|t,e)}function zo(e,t=[],n=[],r=[]){pa(r,t,n,t=>{Oo(8,()=>{e(...t.map(H))})})}function Bo(e,t=[],n=[],r=[]){pa(r,t,n,t=>{Oo(4,()=>e(...t.map(H)))})}function Vo(e,t=0){return Oo(16|t,e)}function Ho(e,t=0){return Oo(Ir|t,e)}function Uo(e){return Oo(32|Kr,e)}function Wo(e){var t=e.teardown;if(t!==null){let n=ns,r=B;rs(!0),as(null);try{t.call(null)}catch(t){To(t,e.parent)}finally{rs(n),as(r)}}}function Go(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&da(()=>{e.abort(si)});var r=n.next;n.f&64?n.parent=null:qo(n,t),n=r}}function Ko(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||qo(t),t=n}}function qo(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Jo(e.nodes.start,e.nodes.end),n=!0),e.f|=Ur,Go(e,t&&!n),Cs(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Wo(e),e.f^=Ur,e.f|=Vr;var i=e.parent;i!==null&&i.first!==null&&Yo(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Jo(e,t){for(;e!==null;){var n=e===t?null:ho(e);e.remove(),e=n}}function Yo(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Xo(e,t,n=!0){var r=[];e.f|=256,Zo(e,r,!0);var i=()=>{n&&qo(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Zo(e,t,n){if(!(e.f&8192)){e.f^=Br;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Zo(i,t,o?n:!1)}i=a}}}function Qo(e){e.f&=-257,$o(e,!0)}function $o(e,t){if(!(e.f&256)&&e.f&8192){e.f^=Br,e.f&1024||(ia(e,Rr),La.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);$o(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function es(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ho(n);t.append(n),n=i}}var ts=null,ns=!1;function rs(e){ns=e}var B=null,is=!1;function as(e){B=e}var V=null;function os(e){V=e}var ss=null;function cs(e){B!==null&&(B.f&2097152||B.f&2)&&(ss??=new Set).add(e)}var ls=null,us=0,ds=null;function fs(e){ds=e}var ps=1,ms=0,hs=ms;function gs(e){hs=e}function _s(){return++ps}function vs(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(vs(a)&&wa(a),a.wv>e.wv)return!0}t&512&&ka===null&&ia(e,Lr)}return!1}function ys(e,t,n=!0){var r=e.reactions;if(r!==null&&!(ss!==null&&ss.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?ys(a,t,!1):t===a&&(n?ia(a,Rr):a.f&1024&&ia(a,zr),Ha(a))}}function bs(e){var t=ls,n=us,r=ds,i=B,a=ss,o=Wi,s=is,c=hs,l=e.f;ls=null,us=0,ds=null,B=l&96?null:e,ss=null,Gi(e.ctx),is=!1,hs=++ms,e.ac!==null&&(da(()=>{e.ac.abort(si)}),e.ac=null);try{e.f|=Yr;var u=e.fn,d=u();e.f|=Hr;var f=xs(e);if(Qi()&&ds!==null&&!is&&f!==null&&!(e.f&6146))for(var p=0;p<ds.length;p++)ys(ds[p],e);if(i!==null&&i!==e){if(ms++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=ms;if(t!==null)for(let e of t)e.rv=ms;ds!==null&&(r===null?r=ds:r.push(...ds))}return e.f&8388608&&(e.f^=Zr),d}catch(t){return xs(e),wo(t)}finally{e.f^=Yr,ls=t,us=n,ds=r,B=i,ss=a,Gi(o),is=s,hs=c}}function xs(e){var t=e.deps,n=R?.is_fork;if(ls!==null){var r;if(n||Cs(e,us),t!==null&&us>0)for(t.length=us+ls.length,r=0;r<ls.length;r++)t[us+r]=ls[r];else e.deps=t=ls;if(ko()&&e.f&512)for(r=us;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&us<t.length&&(Cs(e,us),t.length=us);return t}function Ss(e,t){let n=t.reactions;if(n!==null){var r=yr.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(ls===null||!br.call(ls,t))){var a=t;a.f&512&&(a.f^=512),a.v!==P&&aa(a),a.ac!==null&&da(()=>{a.ac.abort(si),a.ac=null,ia(a,Rr)}),Ta(a),Cs(a,0)}}function Cs(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Ss(e,n[r])}function ws(e){var t=e.f;if(!(t&16384)){ia(e,Lr);var n=V;V=e;try{t&16777232?Ko(e):Go(e),Wo(e);var r=bs(e);e.teardown=typeof r==`function`?r:null,e.wv=ps}finally{V=n}}}async function Ts(){await Promise.resolve(),Ra()}function H(e){var t=!!(e.f&2);if(ts?.add(e),B!==null&&!is&&!(V!==null&&V.f&16384)&&(ss===null||!ss.has(e))){var n=B.deps;if(B.f&2097152)e.rv<ms&&(e.rv=ms,ls===null&&n!==null&&n[us]===e?us++:ls===null?ls=[e]:ls.push(e));else{B.deps??=[],br.call(B.deps,e)||B.deps.push(e);var r=e.reactions;r===null?e.reactions=[B]:br.call(r,B)||r.push(B)}}if(ns&&Ka.has(e))return Ka.get(e);if(t){var i=e;if(ns){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Ds(i))&&(a=Ca(i)),Ka.set(i,a),a}var o=!(i.f&512)&&!is&&B!==null&&!!(B.f&512),s=(i.f&Hr)===0;vs(i)&&(o&&(i.f|=512),wa(i)),o&&!s&&(Ea(i),Es(i))}if(ka?.has(e))return ka.get(e);if(e.f&8388608)throw e.v;return e.v}function Es(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t=n.reactions;t===null?n.reactions=[e]:br.call(t,e)||t.push(e),n.f&2&&!(n.f&512)&&(Ea(n),Es(n))}}function Ds(e){if(e.v===P)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ka.has(t)||t.f&2&&Ds(t))return!0;return!1}function Os(e){var t=is;try{return is=!0,e()}finally{is=t}}function ks(){return Symbol(pi)}function As(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var js=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function Ms(e){return js.includes(e)}var Ns=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),Ps={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function Fs(e){return e=e.toLowerCase(),Ps[e]??e}[...Ns];var Is=[`touchstart`,`touchmove`];function Ls(e){return Is.includes(e)}var Rs=[`textarea`,`script`,`style`,`title`];function zs(e){return Rs.includes(e)}var Bs=Symbol(`events`),Vs=new Set,Hs=new Set;function Us(e){if(!F)return;e.removeAttribute(`onload`),e.removeAttribute(`onerror`);let t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function Ws(e,t,n,r={}){function i(e){if(r.capture||Zs.call(t,e),!e.cancelBubble)return da(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,ta(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function Gs(e,t,n,r={}){var i=Ws(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function Ks(e,t,n,r,i){var a={capture:r,passive:i},o=Ws(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Ao(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function qs(e,t,n){(t[Bs]??={})[e]=n}function Js(e){for(var t=0;t<e.length;t++)Vs.add(e[t]);for(var n of Hs)n(e)}var Ys=null,Xs=!1;function Zs(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Ys=e,Xs||(Xs=!0,setTimeout(()=>{Xs=!1,Ys=null}));var o=0,s=Ys===e&&e[Bs];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Bs]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){Sr(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=B,d=V;as(null),os(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[Bs]?.[r];m==null||a.disabled&&e.target!==a||m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[Bs]=t,delete e.currentTarget,as(u),os(d)}}}var Qs=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function $s(e){return Qs?.createHTML(e)??e}function ec(e){var t=So(`template`);return t.innerHTML=$s(e.replaceAll(`<!>`,`<!---->`)),t.content}function tc(e,t){var n=V;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function nc(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(F)return tc(I,null),I;i===void 0&&(i=ec(a?e:`<!>`+e),n||(i=mo(i)));var t=r||co?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=mo(t),s=t.lastChild;tc(o,s)}else tc(t,t);return t}}function rc(e=``){if(!F){var t=po(e+``);return tc(t,t),t}var n=I;return n.nodeType===3?Co(n):(n.before(n=po()),L(n)),tc(n,n),n}function ic(){if(F)return tc(I,null),I;var e=document.createDocumentFragment(),t=document.createComment(``),n=po();return e.append(t,n),tc(t,n),e}function ac(e,t){if(F){var n=V;n.f&32768&&n.nodes.end!==null||(n.nodes.end=I),yi()}else e!==null&&e.before(t)}function oc(){if(F&&I&&I.nodeType===8&&I.textContent?.startsWith(`$`)){let e=I.textContent.substring(1);return yi(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function sc(e){let t=0,n=Ja(0),r;return()=>{ko()&&(H(n),Ro(()=>(t===0&&(r=Os(()=>e(()=>to(n)))),t+=1,()=>{ta(()=>{--t,t===0&&(r?.(),r=void 0,to(n))})})))}}var cc=Wr|Kr;function lc(e,t,n,r){new uc(e,t,n,r)}var uc=class{parent;is_pending=!1;transform_error;#e;#t=F?I:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Map;#p=null;#m=sc(()=>(this.#p=Ja(this.#l),()=>{this.#p=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=V;t.b=this,t.f|=128,n(e)},this.parent=V.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Vo(()=>{if(F){let e=Ci(this.#t);yi();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#g(t)}else t?this.#y():this.#h()}else this.#b()},cc),F&&(this.#e=I)}#h(){try{this.#a=Uo(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#_(e);ta(r),t&&(this.#s=Uo(()=>{t(this.#e,()=>e,()=>n)}))}#_(e){var t=!1,n=!1;let r=()=>{this.#v()||(t?_i():(t=!0,n&&Ri(),this.#s!==null&&Xo(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})))};return{reset:r,invoke_onerror:()=>{if(!this.#v())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){To(e,this.#i&&this.#i.parent)}}}}#v(){return(this.#i.f&(Vr|Ur))!==0}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Uo(()=>e(this.#e)),ta(()=>{if(!this.#v()){var e=this.#c=document.createDocumentFragment(),t=po(),n=!1;e.append(t),this.#a=this.#S(()=>{try{return Uo(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){To(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#x(R)):this.#u===0&&(this.#e.before(e),this.#c=null,Xo(this.#o,()=>{this.#o=null}),this.#x(R))}}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Uo(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();es(this.#a,e);let t=this.#n.pending;this.#o=Uo(()=>t(this.#e))}else this.#x(R)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_reactions(this.#f)}defer_effect(e){oa(e,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=V,n=B,r=Wi;os(this.#i),as(this.#i),Gi(this.#i.ctx);try{return La.ensure(),e()}finally{os(t),as(n),Gi(r)}}#C(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Xo(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#C(e,t)}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!this.#p||this.#d||(this.#d=!0,ta(()=>{this.#d=!1,this.#p&&$a(this.#p,this.#l)}))}get_effect_pending(){return this.#m(),H(this.#p)}error(e){if(e===li||!this.#n.onerror&&!this.#n.failed)throw e;R?.is_fork?(this.#a&&R.skip_effect(this.#a),this.#o&&R.skip_effect(this.#o),this.#s&&R.skip_effect(this.#s),R.oncommit(()=>{this.#v()||this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(qo(this.#a),null),this.#o&&=(qo(this.#o),null),this.#s&&=(qo(this.#s),null),F&&(L(this.#t),xi(),L(Si()));let t=this.#n.failed,n=e=>{if(this.#v())return;let{reset:n,invoke_onerror:r}=this.#_(e);r(),t&&!this.#v()&&(this.#s=this.#S(()=>{try{return Uo(()=>{var r=V;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return To(e,this.#i.parent),null}}))};ta(()=>{if(!this.#v()){var t;try{t=this.transform_error(e)}catch(e){To(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>To(e,this.#i&&this.#i.parent)):n(t)}})}};function dc(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ai]??=e.nodeValue)&&(e[ai]=n,e.nodeValue=`${n}`)}function fc(e,t){return mc(e,t)}var pc=new Map;function mc(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){fo();var c=void 0,l=Fo(()=>{var o=n??t.appendChild(po());lc(o,{pending:()=>{}},t=>{Yi({});var n=Wi;if(a&&(n.c=a),i&&(r.$$events=i),F&&tc(t,null),c=e(t,r)||Zi(),F&&(V.nodes.end=I,I===null||I.nodeType!==8||I.data!==`]`))throw hi(),li;Xi()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=Ls(r);for(let e of[t,document]){var a=pc.get(e);a===void 0&&(a=new Map,pc.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Zs,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(xr(Vs)),Hs.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=pc.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Zs),r.delete(e),r.size===0&&pc.delete(n)):r.set(e,i)}Hs.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return hc.set(c,l),c}var hc=new WeakMap;function gc(e,t){let n=hc.get(e);return n?(hc.delete(e),n(t)):Promise.resolve()}var _c=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Qo(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Qo(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(qo(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();es(r,t),t.append(po()),this.#n.set(e,{effect:r,fragment:t})}else qo(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Xo(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(qo(n.effect),this.#n.delete(e))};ensure(e,t){var n=R,r=xo();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=po();i.append(a),this.#n.set(e,{effect:Uo(()=>t(a)),fragment:i})}else this.#t.set(e,Uo(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else F&&(this.anchor=I),this.#a(n)}},vc=0,yc=1,bc=2;function xc(e,t,n,r,i){F&&yi();var a=Qi(),o=P,s=a?Ja(o):Xa(o,!1,!1),c=a?Ja(o):Xa(o,!1,!1),l=new _c(e);Vo(()=>{var a=R,o=t(),u=!1;let d=F&&jr(o)===(e.data===`[!`);if(d&&(L(Si()),vi(!1)),jr(o)){var f=ma(),p=!1;let e=e=>{if(!u){p=!0,f(!1),R===a&&a.deactivate(),La.ensure();try{e()}finally{ha(!1),ja||Ra()}}};o.then(t=>{e(()=>{$a(s,t),l.ensure(yc,r&&(e=>r(e,s)))})},t=>{e(()=>{if($a(c,t),l.ensure(bc,i&&(e=>i(e,c))),!i)throw c.v})}),F?l.ensure(vc,n):ta(()=>{p||e(()=>{l.ensure(vc,n)})})}else $a(s,o),l.ensure(yc,r&&(e=>r(e,s)));return d&&vi(!0),()=>{u=!0}})}function Sc(e,t,n=!1){var r;F&&(r=I,yi());var i=new _c(e),a=n?Wr:0;function o(e,t){if(F){var n=Ci(r);if(e!==parseInt(n.substring(1))){var a=Si();L(a),i.anchor=a,vi(!1),i.ensure(e,t),vi(!0);return}}i.ensure(e,t)}Vo(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Cc=Symbol(`NaN`);function wc(e,t,n){F&&yi();var r=new _c(e),i=!Qi();Vo(()=>{var e=t();e!==e&&(e=Cc),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Tc(e,t){F&&L(mo(e)),Ro(()=>{var n=t();for(var r in n){var i=n[r];i==null||i===``?e.style.removeProperty(r):e.style.setProperty(r,i)}})}function Ec(e,t){return t}function Dc(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Xo(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Oc(e,xr(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;bo(u),u.append(l),e.items.clear()}Oc(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Oc(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=Jr,es(a,document.createDocumentFragment())):qo(t[i],n)}}var kc;function Ac(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=F?L(mo(c)):c.appendChild(po())}F&&yi();var l=null,u=xa(()=>{var e=n();return vr(e)?e:e==null?[]:xr(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=H(u);h.fallback=l,Mc(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=Jr,Pc(l,null,o)):Qo(l):Xo(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:Vo(()=>{var e=H(u),c=e.length;let h=!1;F&&Ci(o)===`[!`!=(c===0)&&(o=Si(),L(o),vi(!1),h=!0);for(var g=new Set,_=R,v=xo(),y=0;y<c;y+=1){F&&I.nodeType===8&&I.data===`]`&&(o=I,h=!0,vi(!1));var b=e[y],x=r(b,y),S=f?null:s.get(x);S?(S.v&&$a(S.v,b),S.i&&$a(S.i,y),v&&_.unskip_effect(S.e)):(S=Nc(s,f?o:kc??=po(),b,x,y,i,t,n),f||(S.e.f|=Jr),s.set(x,S)),g.add(x)}if(c===0&&a&&!l&&(f?l=Uo(()=>a(o)):(l=Uo(()=>a(kc??=po())),l.f|=Jr)),c>g.size&&ki(``,``,``),F&&c>0&&L(Si()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&vi(!0),H(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,F&&(o=I)}function jc(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Mc(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=jc(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(Qo(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432){if(g.f^=Jr,g===c)Pc(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Fc(e,u,g),Fc(e,g,v),Pc(g,v,n),u=g,f=[],p=[],c=jc(u.next);continue}}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],S=f[f.length-1];for(b=0;b<f.length;b+=1)Pc(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);Fc(e,x.prev,S.next),Fc(e,u,x),Fc(e,S,y),c=y,u=S,--_,f=[],p=[]}else l.delete(g),Pc(g,c,n),Fc(e,g.prev,g.next),Fc(e,g,u===null?e.effect.first:u.next),Fc(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=jc(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=jc(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Oc(e,xr(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=jc(c.next);var ee=C.length;if(ee>0){var te=r&4&&o===0?n:null;if(a){for(_=0;_<ee;_+=1)C[_].nodes?.a?.measure();for(_=0;_<ee;_+=1)C[_].nodes?.a?.fix()}Dc(e,C,te)}}a&&ta(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Nc(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ja(n):Xa(n,!1,!1):null,l=o&2?Ja(i):null;return{v:c,i:l,e:Uo(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Pc(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ho(r);if(a.before(r),r===i)return;r=o}}function Fc(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ic(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;F&&(o=L(mo(c)))}zo(()=>{var e=V;if(s===(s=t()??``))F&&yi();else if(n&&!F)e.nodes=null,c.innerHTML=s,s!==``&&tc(mo(c),c.lastChild);else if(e.nodes!==null&&(Jo(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(F){for(var a=I.data,l=yi(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=ho(l);if(l===null)throw hi(),li;tc(I,u),o=L(l)}else{var d=So(r?`svg`:i?`math`:`template`,r?di:i?fi:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(tc(mo(f),f.lastChild),r||i)for(;mo(f);)o.before(mo(f));else o.before(f)}}})}function Lc(e,t,...n){var r=new _c(e);Vo(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},Wr)}function Rc(e,t,n){var r;F&&(r=I,yi());var i=new _c(e);Vo(()=>{var e=t()??null;if(F&&Ci(r)===`[`!=(e!==null)){var a=Si();L(a),i.anchor=a,vi(!1),i.ensure(e,e&&(t=>n(t,e))),vi(!0)}else i.ensure(e,e&&(t=>n(t,e)))},Wr)}var zc=()=>performance.now(),Bc={tick:e=>requestAnimationFrame(e),now:()=>zc(),tasks:new Set};function Vc(){let e=Bc.now();Bc.tasks.forEach(t=>{t.c(e)||(Bc.tasks.delete(t),t.f())}),Bc.tasks.size!==0&&Bc.tick(Vc)}function Hc(e){let t;return Bc.tasks.size===0&&Bc.tick(Vc),{promise:new Promise(n=>{Bc.tasks.add(t={c:e,f:n})}),abort(){Bc.tasks.delete(t)}}}function Uc(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function Wc(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=Uc(n.trim());t[i]=r.trim()}return t}var Gc=e=>e,Kc=null;function qc(e){Kc=e}function Jc(e,t,n){var r=(Kc??V).nodes,i,a,o,s=null;r.a??={element:e,measure(){i=this.element.getBoundingClientRect()},apply(){if(o?.abort(),a=this.element.getBoundingClientRect(),i.left!==a.left||i.right!==a.right||i.top!==a.top||i.bottom!==a.bottom){let e=t()(this.element,{from:i,to:a},n?.());o=Yc(this.element,e,void 0,1,()=>{},()=>{o?.abort(),o=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var a=e.style;s={position:a.position,width:a.width,height:a.height,transform:a.transform},a.position=`absolute`,a.width=n,a.height=r;var o=e.getBoundingClientRect();if(i.left!==o.left||i.top!==o.top){var c=`translate(${i.left-o.left}px, ${i.top-o.top}px)`;a.transform=a.transform?`${a.transform} ${c}`:c}}}},unfix(){if(s){var t=e.style;t.position=s.position,t.width=s.width,t.height=s.height,t.transform=s.transform}}},r.a.element=e}function Yc(e,t,n,r,i,a){var o=r===1,s=!1;if(kr(t)){var c;return ta(()=>{s||(c=Yc(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{s=!0,c?.abort()},deactivate:()=>c?.deactivate(),reset:()=>c?.reset(),t:()=>c?.t()??1-r}}if(n?.deactivate(),!t?.duration&&!t?.delay)return i(),a(),{abort:Ar,deactivate:Ar,reset:Ar,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=Gc}=t;var p,m=()=>1-r;return ta(()=>{if(!s){var c=[];if(o&&n===void 0&&(d&&d(0,1),u)){var h=Wc(u(0,1));c.push(h,h)}p=e.animate(c,{duration:l,fill:`forwards`}),p.onfinish=()=>{p.cancel(),i();var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),l=[];if(c>0){var h=!1;if(u)for(var g=Math.ceil(c/(1e3/60)),_=0;_<=g;_+=1){var v=o+s*f(_/g),y=Wc(u(v,1-v));l.push(y),h||=y.overflow===`hidden`}h&&(e.style.overflow=`hidden`),m=()=>{var e=p.currentTime;return o+s*f(e/c)},d&&Hc(()=>{if(p.playState!==`running`)return!1;var e=m();return d(e,1-e),!0})}p=e.animate(l,{duration:c,fill:`forwards`}),p.onfinish=()=>{m=()=>r,d?.(r,1-r),a()}}}}),{abort:()=>{s=!0,p&&(p.cancel(),p.effect=null,p.onfinish=Ar)},deactivate:()=>{a=Ar},reset:()=>{r===0&&d?.(1,0)},t:()=>m()}}function Xc(e,t,n,r,i,a){let o=F;F&&yi();var s=null;F&&I.nodeType===1&&(s=I,yi());var c=F?I:e,l=V,u=new _c(c,!1);Vo(()=>{let e=t()||null;var a=i?i():n||e===`svg`?di:void 0;if(e===null)u.ensure(null,null);else return u.ensure(e,t=>{if(e){var n=F;if(s=F?s:So(e,a),tc(s,s),r){var i=null;F&&zs(e)&&s.append(i=document.createComment(``));var o=F?mo(s):s.appendChild(po());F&&(o===null?vi(!1):L(o)),qc(l),r(s,o),i?.remove(),qc(null)}V.nodes.end=s,n||t.before(s)}F&&L(t)}),()=>{}},Wr),Ao(()=>{}),o&&(vi(!0),L(c))}function Zc(e,t){let n=null,r=F;var i;if(F){n=I;for(var a=mo(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=ho(a);if(a===null)vi(!1);else{var o=ho(a);a.remove(),L(o)}}F||(i=document.head.appendChild(po()));try{Vo(()=>{var e=Uo(()=>t(i));e.f|=Gr,F||(e.nodes===null?e.nodes={start:i,end:i,a:null,t:null}:e.nodes.end=i)})}finally{r&&(vi(!0),L(n))}}function Qc(e,t){Io(()=>{e=V?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=So(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function $c(e,t){var n=void 0,r;Ho(()=>{n!==(n=t())&&(r&&=(qo(r),null),n&&(r=Uo(()=>{Io(()=>n(e))})))})}function el(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=el(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function tl(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=el(e))&&(r&&(r+=` `),r+=t);return r}function nl(e){return typeof e==`object`?tl(e):e??``}var rl=[...`
\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,e,l),Js([r]);else if(l!=null){function a(e){u[i].call(this,e)}u[n]=Ws(r,e,a,t)}}else if(i===`style`)Ol(e,i,l);else if(i===`autofocus`)sa(e,!!l);else if(!s&&(i===`__value`||i===`value`&&l!=null))e.__value=l,(g==null||e.value!==l||l===0&&e.nodeName===El)&&(e.value=l);else if(i===`selected`&&d)dl(e,l);else{var y=i;c||(y=Fs(y));var b=y===`defaultValue`||y===`defaultChecked`;if(f&&y===`defaultValue`)continue;if(l==null&&!s&&!b){if(o[i]=null,y===`value`||y===`checked`){let n=e,r=t===void 0;if(y===`value`){let e=n.defaultValue;n.removeAttribute(y),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(y),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i)}else b||(s||typeof l!=`string`)&&m.has(y)?(e[y]=l,y in o&&(o[y]=P)):typeof l!=`function`&&Ol(e,y,l,a)}}}}}}finally{l&&vi(!0)}return u}function Al(e,t,n=[],r=[],i=[],a,o=!1,s=!1){pa(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Tl,l=!1;if(Ho(()=>{var u=t(...n.map(H)),d=kl(e,r,u,a,o,s);if(l&&c){var f=e;`defaultValue`in u&&fl(f,u.defaultValue),`value`in u&&ml(f,u.value)}for(let e of Object.getOwnPropertySymbols(i))u[e]||qo(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var p=u[t];t.description!==`@attach`||r&&p===r[t]||(i[t]&&qo(i[t]),i[t]=Uo(()=>$c(e,()=>p))),d[t]=p}r=d}),c){var u=e;Io(()=>{var e=r;`defaultValue`in e&&fl(u,e.defaultValue),ml(u,e.value,!0),hl(u)})}l=!0})}function jl(e){return e[ni]??={[bl]:e.nodeName.includes(`-`),[xl]:e.namespaceURI===ui}}var Ml=new Map;function Nl(e){var t=e.getAttribute(`is`)||e.nodeName,n=Ml.get(t);if(n)return n;Ml.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=wr(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=Dr(i)}return n}function Pl(e,t,n=t){var r=new WeakSet;fa(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Fl(e)?Il(a):a,n(a),R!==null&&r.add(R),await Ts(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(F&&e.defaultValue!==e.value||Os(t)==null&&e.value)&&(n(Fl(e)?Il(e.value):e.value),R!==null&&r.add(R)),Ro(()=>{var n=t();if(e===document.activeElement){var i=R;if(r.has(i))return}Fl(e)&&n===Il(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function Fl(e){var t=e.type;return t===`number`||t===`range`}function Il(e){return e===``?null:+e}var Ll=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function Rl(e,t,n){var r=Ll.observe(e,()=>n(e[t]));Io(()=>(Os(()=>n(e[t])),r))}function zl(e,t){return e===t||e?.[Qr]===t}function Bl(e=Zi(),t,n,r){var i=Wi.r,a=V;return Io(()=>{var o,s;return Ro(()=>{o=s,s=r?.()||[],Os(()=>{zl(n(...s),e)||(t(e,...s),o&&zl(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&zl(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var Vl=!1;function Hl(e){var t=Vl;try{return Vl=!1,[e(),Vl]}finally{Vl=t}}var Ul={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return!e.exclude.has(t)&&t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function Wl(e,t,n){return new Proxy({props:e,exclude:t},Ul)}var Gl={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(kr(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];kr(i)&&(i=i());let a=Cr(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(kr(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=Cr(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Qr||t===ei)return!1;for(let n of e.props)if(kr(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(kr(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function Kl(...e){return new Proxy({props:e},Gl)}function ql(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=_a(r),H(l)):(c&&(c=!1,s=o?Os(r):r),s);let d;if(a){var f=Qr in e||ei in e;d=Cr(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Hl(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&Pi(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?_a:xa)(()=>(_=!1,h()));a&&H(v);var y=V;return(function(e,t){if(arguments.length>0){let n=t?H(v):i&&a?ro(e):e;return z(v,n),_=!0,s!==void 0&&(s=n),e}return ns&&_||y.f&16384?v.v:H(v)})}function Jl(e){Wi===null&&Di(`onMount`),jo(()=>{let t=Os(e);if(typeof t==`function`)return t})}function Yl(e){Wi===null&&Di(`onDestroy`),Jl(()=>()=>Os(e))}var Xl=/^[\u061c\u200e\u200f\u2066-\u2069]+/,Zl=/^[-.+0-9A-Z_a-z\u{a1}-\u{61b}\u{61d}-\u{167f}\u{1681}-\u{1fff}\u{200b}-\u{200d}\u{2010}-\u{2027}\u{2030}-\u{205e}\u{2060}-\u{2065}\u{206a}-\u{2fff}\u{3001}-\u{d7ff}\u{e000}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]+/u,Ql=/^[-.0-9]/;function $l(e,t){let n=t,r=e.slice(n).match(Xl);r&&(n+=r[0].length);let i=e.slice(n).match(Zl);if(!i)return null;let a=i[0];if(Ql.test(a))return null;n+=a.length;let o=e.slice(n).match(Xl);return o&&(n+=o[0].length),{value:a.normalize(),end:n}}var eu=(e,t)=>e.slice(t).match(Zl)?.[0]??``,tu=Symbol.for(`CST`),nu=class extends Error{type;constructor(e,t){super(t),this.type=e}},ru=class extends nu{start;end;constructor(e,t,n,r){let i=r?`Missing ${r}`:e;t>=0&&(i+=` at ${t}`),super(e,i),this.start=t,this.end=n??t+1}},iu=class extends ru{constructor(e,t){let{start:n,end:r}=t[tu]??{start:-1,end:-1};super(e,n,r)}},au=class extends nu{source;cause;constructor(e,t,n,r){super(e,t),this.source=n,r!==void 0&&(this.cause=r)}},ou=class extends nu{source;cause;constructor(e,t){super(e,t),this.source=`�`}},su=new Set(`؜‎‏⁦⁧⁨⁩`),cu=new Set(`
\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.value.arg?.type===`variable`&&i.has(e.value.arg.name))&&i.add(e.name),e.type===`local`&&s.add(e.name),u=e.type===`local`,()=>{a.has(e.name)?t(`duplicate-declaration`,e):a.add(e.name)}},expression({functionRef:e}){e&&o.add(e.name)},value(e,o,s){if(e.type===`variable`)switch(c.add(e.name),o){case`declaration`:(s!==`arg`||u)&&a.add(e.name);break;case`selector`:n+=1,r=e,i.has(e.name)||t(`missing-selector-annotation`,e)}},variant(e){let{keys:i}=e;i.length!==n&&t(`key-mismatch`,e);let a=JSON.stringify(i.map(e=>e.type===`literal`?e.value:0));l.has(a)?t(`duplicate-variant`,e):l.add(a),r&&=i.every(e=>e.type===`*`)?null:e}}),r&&t(`missing-fallback`,r);for(let e of s)c.delete(e);return{functions:o,variables:c}}var ju=`Adlm,Arab,Hebr,Mand,Nkoo,Rohg,Syrc,Thaa`;function Mu(e){if(e)try{typeof e==`string`&&(e=new Intl.Locale(e));let t=e.getTextInfo?.()??e.textInfo;if(t?.direction)return t.direction;let n=e.maximize().script;if(n)return ju.includes(n)?`rtl`:`ltr`}catch{}return`auto`}function Nu(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`boolean`)return e;if(e&&typeof e==`object`&&(e=String(e)),e===`true`)return!0;if(e===`false`)return!1;throw RangeError(`Not a boolean`)}function Pu(e){if(e&&typeof e==`object`&&(e=e.valueOf()),e&&typeof e==`object`&&(e=String(e)),typeof e==`string`&&/^(0|[1-9][0-9]*)$/.test(e)&&(e=Number(e)),typeof e==`number`&&e>=0&&Number.isInteger(e))return e;throw RangeError(`Not a positive integer`)}function Fu(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`string`)return e;if(e&&typeof e==`object`)return String(e);throw RangeError(`Not a string`)}function Iu(e){let t;if(typeof e==`object`){let n=e?.valueOf;typeof n==`function`&&(t=e.options,e=n.call(e))}if(typeof e==`string`)try{e=JSON.parse(e)}catch{}if(typeof e!=`bigint`&&typeof e!=`number`)throw new ou(`bad-operand`,`Input is not numeric`);return{value:e,options:t}}function Lu(e,t,n,r){let{dir:i,locales:a}=e;n.useGrouping===`never`&&(n.useGrouping=!1),r&&`select`in n&&!e.literalOptionKeys.has(`select`)&&(e.onError(`bad-option`,`The option select may only be set by a literal value`),r=!1);let o,s,c,l;return{type:`number`,get dir(){return i??=(o??=Intl.NumberFormat.supportedLocalesOf(a,n)[0],Mu(o)),i},get options(){return{...n}},selectKey:r?e=>{let r=t;n.style===`percent`&&(r*=typeof r==`bigint`?100n:100);let i=String(r);if(e.has(i))return i;if(n.select===`exact`)return null;let o=n.select?{...n,select:void 0,type:n.select}:n;return c??=new Intl.PluralRules(a,o).select(Number(r)),e.has(c)?c:null}:void 0,toParts(){s??=new Intl.NumberFormat(a,n);let e=s.formatToParts(t);return o??=s.resolvedOptions().locale,i??=Mu(o),i===`ltr`||i===`rtl`?[{type:`number`,dir:i,locale:o,parts:e}]:[{type:`number`,locale:o,parts:e}]},toString(){return s??=new Intl.NumberFormat(a,n),l??=s.format(t),l},valueOf:()=>t}}function Ru(e,t,n){let r=Iu(n),i=r.value,a=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:a[n]=Pu(r);break;case`roundingMode`:case`roundingPriority`:case`select`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:a[n]=Fu(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :number option ${n}`)}return Lu(e,i,a,!0)}function zu(e,t,n){let r=Iu(n),i=Number.isFinite(r.value)?Math.round(r.value):r.value,a=Object.assign({},r.options,{maximumFractionDigits:0,minimumFractionDigits:void 0,minimumSignificantDigits:void 0,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`maximumSignificantDigits`:a[n]=Pu(r);break;case`select`:case`signDisplay`:case`useGrouping`:a[n]=Fu(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :integer option ${n}`)}return Lu(e,i,a,!0)}function Bu(e,t,n){let r=Iu(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`currency`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`currency`:case`currencySign`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Fu(r);break;case`minimumIntegerDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Pu(r);break;case`currencyDisplay`:{let t=Fu(r);t===`never`?e.onError(`unsupported-operation`,`Currency display "never" is not yet supported`):i[n]=t;break}case`fractionDigits`:{let e=Fu(r);if(e===`auto`)i.minimumFractionDigits=void 0,i.maximumFractionDigits=void 0;else{let t=Pu(e);i.minimumFractionDigits=t,i.maximumFractionDigits=t}break}}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.currency)throw new ou(`bad-operand`,`A currency code is required for :currency`);return Lu(e,r.value,i,!1)}var Vu=new Set([`weekday`,`day-weekday`,`month-day`,`month-day-weekday`,`year-month-day`,`year-month-day-weekday`]),Hu=new Set([`long`,`medium`,`short`]),Uu=new Set([`hour`,`minute`,`second`]),Wu=new Set([`long`,`short`]),Gu=(e,t,n)=>Ju(`datetime`,e,t,n),Ku=(e,t,n)=>Ju(`date`,e,t,n),qu=(e,t,n)=>Ju(`time`,e,t,n);function Ju(e,t,n,r){let i={localeMatcher:t.localeMatcher},a=r;if(typeof a==`object`&&a){let t=a.options;t&&(i.calendar=t.calendar,e!==`date`&&(i.hour12=t.hour12),i.timeZone=t.timeZone),typeof a.valueOf==`function`&&(a=a.valueOf())}switch(typeof a){case`number`:case`string`:a=new Date(a)}if(!(a instanceof Date)||isNaN(a.getTime()))throw new ou(`bad-operand`,`Input is not a valid date`);if(n.calendar!==void 0)try{i.calendar=Fu(n.calendar)}catch{t.onError(`bad-option`,`Invalid :${e} calendar option value`)}if(n.hour12!==void 0&&e!==`date`)try{i.hour12=Nu(n.hour12)}catch{t.onError(`bad-option`,`Invalid :${e} hour12 option value`)}if(n.timeZone!==void 0){let r;try{r=Fu(n.timeZone)}catch{t.onError(`bad-option`,`Invalid :${e} timeZone option value`)}if(r===`input`)i.timeZone===void 0&&t.onError(`bad-operand`,`Missing input timeZone value for :${e}`);else if(r!==void 0){if(i.timeZone!==void 0&&r!==i.timeZone)throw new ou(`bad-option`,`Time zone conversion is not supported`);i.timeZone=r}}if(e!==`time`){let r=e===`date`?`fields`:`dateFields`,a=e===`date`?`length`:`dateLength`,o=Yu(t,n,r,Vu)??`year-month-day`,s=Yu(t,n,a,Hu),c=new Set(o.split(`-`));c.has(`year`)&&(i.year=`numeric`),c.has(`month`)&&(i.month=s===`long`?`long`:s===`short`?`numeric`:`short`),c.has(`day`)&&(i.day=`numeric`),c.has(`weekday`)&&(i.weekday=s===`long`?`long`:`short`)}if(e!==`date`){switch(Yu(t,n,e===`time`?`precision`:`timePrecision`,Uu)){case`hour`:i.hour=`numeric`;break;case`second`:i.hour=`numeric`,i.minute=`numeric`,i.second=`numeric`;break;default:i.hour=`numeric`,i.minute=`numeric`}i.timeZoneName=Yu(t,n,`timeZoneStyle`,Wu)}let o=new Intl.DateTimeFormat(t.locales,i),s=t.dir,c,l;return{type:`datetime`,get dir(){return s??=(c??=o.resolvedOptions().locale,Mu(c)),s},get options(){return{...i}},toParts(){let e=o.formatToParts(a);return c??=o.resolvedOptions().locale,s??=Mu(c),s===`ltr`||s===`rtl`?[{type:`datetime`,dir:s,locale:c,parts:e}]:[{type:`datetime`,locale:c,parts:e}]},toString(){return l??=o.format(a),l},valueOf:()=>a}}function Yu(e,t,n,r){let i=t[n];if(i!==void 0)try{let e=Fu(i);if(r&&!r.has(e))throw Error();return e}catch{e.onError(`bad-option`,`Invalid value for ${n} option`)}}function Xu(e,t,n){let{value:r,options:i}=Iu(n),a;try{a=`add`in t?Pu(t.add):-1}catch{throw new ou(`bad-option`,`Value ${t.add} is not valid for :offset option add`)}let o;try{o=`subtract`in t?Pu(t.subtract):-1}catch{throw new ou(`bad-option`,`Value ${t.subtract} is not valid for :offset option subtract`)}if(a<0==o<0)throw new ou(`bad-option`,`Exactly one of "add" or "subtract" is required as an :offset option`);let s=a<0?-o:a;return r+=typeof r==`number`?s:BigInt(s),Ru(e,{},{valueOf:()=>r,options:i})}function Zu(e,t,n){let r=Iu(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`percent`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`roundingMode`:case`roundingPriority`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Fu(r);break;case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:i[n]=Pu(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :percent option ${n}`)}return Lu(e,r.value,i,!0)}function Qu(e,t,n){let r=n===void 0?``:String(n),i=r.normalize();return{type:`string`,dir:e.dir??`auto`,selectKey:e=>e.has(i)?i:null,toParts(){let{dir:t}=e,n=e.locales[0];return t===`ltr`||t===`rtl`?[{type:`string`,dir:t,locale:n,value:r}]:[{type:`string`,locale:n,value:r}]},toString:()=>r,valueOf:()=>r}}function $u(e,t,n){let r=Iu(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`unit`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`signDisplay`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`unit`:case`unitDisplay`:case`useGrouping`:i[n]=Fu(r);break;case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=Pu(r)}}catch(t){t instanceof nu?e.onError(t):e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.unit)throw new ou(`bad-operand`,`A unit identifier is required for :unit`);return Lu(e,r.value,i,!1)}var ed={currency:Bu,integer:zu,number:Ru,offset:Xu,percent:Zu,string:Qu};ed=Object.freeze(Object.assign(Object.create(null),ed));var td={date:Ku,datetime:Gu,time:qu,unit:$u};td=Object.freeze(Object.assign(Object.create(null),td));var nd=Symbol(`bidi-isolate`),rd=(e=`�`)=>({type:`fallback`,source:e,toParts:()=>[{type:`fallback`,source:e}],toString:()=>`{${e}}`}),id=(e,t)=>({type:`unknown`,source:e,dir:`auto`,toParts:()=>[{type:`unknown`,value:t}],toString:()=>String(t),valueOf:()=>t}),ad=class{#e;#t;#n;dir;id;constructor(e,t,n){this.#e=e,this.#n=t,this.dir=void 0;let r=n&&Object.hasOwn(n,`u:dir`)?n[`u:dir`]:void 0;if(r){let t=String(md(e,r));if(t===`ltr`||t===`rtl`||t===`auto`)this.dir=t;else if(t!==`inherit`){let t=new ou(`bad-option`,`Unsupported value for u:dir option`);t.source=hd(r),e.onError(t)}}let i=n&&Object.hasOwn(n,`u:id`)?n[`u:id`]:void 0;if(this.id=i?String(md(e,i)):void 0,n){this.#t=new Set;for(let[e,t]of Object.entries(n))t.type===`literal`&&this.#t.add(e)}}get literalOptionKeys(){return new Set(this.#t)}get localeMatcher(){return this.#e.localeMatcher}get locales(){return this.#e.locales.map(String)}onError(e,t){let n;e instanceof ou?n=e:typeof e==`string`&&typeof t==`string`?n=new ou(e,t):(n=new ou(`function-error`,String(e)),n.cause=e),n.source=this.#n,this.#e.onError(n)}};function od(e,t,{name:n,options:r}){let i=`:${n}`,a=hd(t)??i;try{let o=t?[md(e,t)]:[],s=e.functions[n];if(!s)throw new au(`unknown-function`,`Unknown function ${i}`,a);let c=new ad(e,a,r),l=s(c,sd(e,r),...o);if(typeof l!=`object`||!l||typeof l.type!=`string`)throw new au(`bad-function-result`,`Function ${i} did not return a MessageValue`,a);let u={source:a};return c.dir&&(u.dir=c.dir,u[nd]=!0),c.id&&typeof l.toParts==`function`&&(u.toParts=()=>{let e=l.toParts();for(let t of e)t.id=c.id;return e}),{...l,...u}}catch(t){return e.onError(t instanceof nu?t:new au(`bad-function-result`,String(t),a,t)),rd(a)}}function sd(e,t){let n=Object.create(null);if(t)for(let[r,i]of Object.entries(t))r.startsWith(`u:`)||(n[r]=md(e,i));return n}function cd(e,{arg:t,functionRef:n}){if(n)return od(e,t,n);switch(t?.type){case`literal`:{let n=`|${t.value}|`,r=Qu(new ad(e,n),{},t.value);return r.source=n,r}case`variable`:return pd(e,t);default:throw Error(`Unsupported expression: ${t?.type}`)}}var ld=class{expression;scope;constructor(e,t){this.expression=e,this.scope=t}},ud=e=>e!==null&&(typeof e==`object`||typeof e==`function`);function dd(e,t){if(ud(e)){if(t in e)return e[t];let n=t.split(`.`);for(let t=n.length-1;t>0;--t){let r=n.slice(0,t).join(`.`);if(r in e){let i=n.slice(t).join(`.`);return dd(e[r],i)}}for(let[n,r]of Object.entries(e))if(n.normalize()===t)return r}}function fd(e,{name:t}){let n=dd(e.scope,t);if(n===void 0){let n=`$`+t,r=`Variable not available: ${n}`;e.onError(new au(`unresolved-variable`,r,n))}else if(n instanceof ld){let r=cd(n.scope?{...e,scope:n.scope}:e,n.expression);return e.scope[t]=r,e.localVars.add(r),r}return n}function pd(e,t){let n=`$`+t.name,r=fd(e,t);if(r===void 0)return rd(n);let i=typeof r;if(i===`object`){let t=r;if(t.type===`fallback`)return rd(n);if(e.localVars.has(t))return t.source=n,t;r instanceof Number?i=`number`:r instanceof String&&(i=`string`)}let a;switch(i){case`bigint`:case`number`:a=e.functions.number;break;case`string`:a=e.functions.string;break;default:return id(n,r)}let o=new ad(e,n),s=a(o,{},r);return s.source=n,s}function md(e,t){switch(t.type){case`literal`:return t.value;case`variable`:return fd(e,t);default:throw Error(`Unsupported value: ${t.type}`)}}function hd(e){switch(e?.type){case`literal`:return`|`+e.value.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`)+`|`;case`variable`:return`$`+e.name;default:return}}function gd(e,{kind:t,name:n,options:r}){let i={type:`markup`,kind:t,name:n},a=r?Object.entries(r):null;if(a?.length){i.options={};for(let[t,n]of a)if(t===`u:dir`){let r=new ou(`bad-option`,`The option ${t} is not valid for markup`);r.source=hd(n),e.onError(r)}else{let r=md(e,n);typeof r==`object`&&typeof r?.valueOf==`function`&&(r=r.valueOf()),t===`u:id`?i.id=String(r):i.options[t]=r}}return i}function _d(e,t){if(t.type===`message`)return t.pattern;let n=t.selectors.map(t=>{let n=pd(e,t),r;return typeof n.selectKey==`function`?r=n.selectKey.bind(n):(e.onError(new au(`bad-selector`,`Selector does not support selection`,n.source)),r=()=>null),{selectKey:r,source:n.source,best:null,keys:null}}),r=t.variants;loop:for(let i=0;i<n.length;++i){let a=n[i];if(!a.keys){a.keys=new Set;for(let{keys:e}of r){let t=e[i];if(!t)break loop;t.type!==`*`&&a.keys.add(t.value)}}try{a.best=a.keys.size?a.selectKey(a.keys):null}catch(t){e.onError(new au(`bad-selector`,`Selection failed`,a.source,t)),a.selectKey=()=>null,a.best=null}if(r=r.filter(e=>{let t=e.keys[i];return t.type===`*`?a.best==null:a.best===t.value}),r.length===0){if(i===0)break;let e=n[i-1];e.best==null?e.keys?.clear():e.keys?.delete(e.best);for(let e=i;e<n.length;++e)n[e].keys=null;r=t.variants,i=-1}}let i=r[0];return i?i.value:(e.onError(new au(`no-match`,`No variant was selected!?`,`.match`)),[])}Intl.MessageFormat??=class{#e;#t;#n;#r;#i;#a;constructor(e,t,n){this.#e=n?.bidiIsolation!==`none`,this.#n=n?.localeMatcher??`best fit`,this.#r=Array.isArray(e)?e.map(e=>new Intl.Locale(e)):e?[new Intl.Locale(e)]:[],this.#t=n?.dir??Mu(this.#r[0]),this.#i=typeof t==`string`?fu(t):t,Au(this.#i),this.#a=n?.functions?Object.assign(Object.create(null),ed,n.functions):ed}format(e,t){let n=this.#o(e,t),r=``;for(let e of _d(n,this.#i))if(typeof e==`string`)r+=e;else if(e.type===`markup`)gd(n,e);else{let t;try{if(t=cd(n,e),typeof t.toString==`function`){if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[nd])){let e=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r+=e+t.toString()+`⁩`}else r+=t.toString()}else{let e=new ou(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i=`{${t?.source??`�`}}`;r+=this.#e?`⁨`+i+`⁩`:i}}return r}formatToParts(e,t){let n=this.#o(e,t),r=[];for(let e of _d(n,this.#i))if(typeof e==`string`)r.push({type:`text`,value:e});else if(e.type===`markup`)r.push(gd(n,e));else{let t;try{if(t=cd(n,e),typeof t.toParts==`function`){let e=t.toParts();if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[nd])){let n=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r.push({type:`bidiIsolation`,value:n},...e,{type:`bidiIsolation`,value:`⁩`})}else r.push(...e)}else{let e=new ou(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i={type:`fallback`,source:t?.source??`�`};this.#e?r.push({type:`bidiIsolation`,value:`⁨`},i,{type:`bidiIsolation`,value:`⁩`}):r.push(i)}}return r}#o(e,t=e=>{try{process.emitWarning(e)}catch{console.warn(e)}}){let n={...e};for(let t of this.#i.declarations)n[t.name]=new ld(t.value,t.type===`input`?e??{}:void 0);return{onError:t,localeMatcher:this.#n,locales:this.#r,localVars:new WeakSet,functions:this.#a,scope:n}}};var vd=Ya(``),yd=``,bd=ro([]),xd=ro({}),Sd=``,Cd=``,wd,Td={},Ed={},Dd,Od=(e,t)=>{if(typeof t!=`string`||!t)throw TypeError(`${e} must be a non-empty string (got ${JSON.stringify(t)})`)},kd=(e,t)=>{if(typeof t!=`string`)throw TypeError(`${e} must be a string (got ${typeof t})`)},Ad=(e,t)=>{if(typeof t!=`function`)throw TypeError(`${e} must be a function (got ${typeof t})`)},jd=new Map,Md=e=>{if(!jd.has(e))try{let t=new Intl.Locale(e),{language:n,script:r,region:i}=t,a=r&&i?void 0:t.maximize();jd.set(e,{language:n,script:r??a?.script,region:i,preferredRegion:i??a?.region,anyScript:!r&&!i})}catch{jd.set(e,void 0)}return jd.get(e)},Nd=(e,t)=>{if(!e||!t.length||t.includes(e))return e;let n=Md(e);if(!n)return e;let{language:r,script:i,anyScript:a,preferredRegion:o}=n,s=t.filter(e=>{let t=Md(e);return!!t&&t.language===r&&(a||t.script===i)});if(s.length<2)return s[0]??e;let c=e=>e?s.find(t=>Md(t)?.region===e):void 0;return c(o)??c(Md(r)?.preferredRegion)??s[0]},Pd=(e,t=``)=>Object.entries(e).reduce((e,[n,r])=>{let i=t?`${t}.${n}`:n;return typeof r==`object`&&r&&!Array.isArray(r)?Object.assign(e,Pd(r,i)):e[i]=r,e},Object.create(null)),Fd=e=>{bd.includes(e)||(bd.push(e),Cd=Nd(Sd,bd))},Id=e=>{if(!e||!bd.length)return e;let t=Nd(e,bd);return!bd.includes(t)&&Cd&&bd.includes(Cd)?Cd:t},Ld=()=>{yd&&Id(yd)!==H(vd)&&Ud.set(yd)},Rd=(e,...t)=>{Od(`addMessages: localeCode`,e),t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`addMessages: maps[${t}] must be a plain object (got ${Array.isArray(e)?`array`:typeof e})`)}),Fd(e),xd[e]??={};let n=xd[e],r={...rf,...Ed};t.forEach(t=>{Object.entries(Pd(t)).forEach(([t,i])=>{n[t]=new Intl.MessageFormat(e,String(i),{functions:r})})}),Ld()},zd=new Map,Bd=new Map,Vd=(e=H(vd))=>{if(kd(`waitLocale: localeCode`,e),!e)return Promise.resolve();let t=Bd.get(e);if(!t){let n=zd.get(e);t=n?Promise.resolve(n()).then(t=>{Rd(e,t)},()=>{if(Bd.delete(e),H(vd)===e&&!xd[e]&&Cd&&Cd!==e)return Ud.set(Cd)}):Promise.resolve(),Bd.set(e,t)}return t},Hd=(e=H(vd))=>Mu(e)===`rtl`,Ud={get current(){return H(vd)},set(e){kd(`locale.set: value`,e),yd=e;let t=Id(e);if(z(vd,t,!0),typeof document<`u`&&t){document.documentElement.lang=t;let e=Mu(t);e!==`auto`&&(document.documentElement.dir=e)}return Vd(t)}},Wd=(e,t)=>{Od(`register: localeCode`,e),Ad(`register: loader`,t),zd.set(e,t),Bd.delete(e),Fd(e),Ld()},Gd=()=>{if(typeof navigator>`u`)return;let e=navigator.languages?.length?navigator.languages:[navigator.language];return e.map(e=>Nd(e,bd)).find(e=>bd.includes(e))??e[0]},Kd=e=>{if(!e||typeof e.fallbackLocale!=`string`)throw TypeError(`init: fallbackLocale must be a string (got ${JSON.stringify(e?.fallbackLocale)})`);e.initialLocale!==void 0&&kd(`init: initialLocale`,e.initialLocale),e.handleMissingMessage!==void 0&&Ad(`init: handleMissingMessage`,e.handleMissingMessage),Sd=e.fallbackLocale,Cd=Nd(Sd,bd),wd=e.handleMissingMessage,Td=e.formats??{},e.initialLocale&&Ud.set(e.initialLocale)},qd=(e,t)=>{let n=xd[e];return n&&Object.hasOwn(n,t)?n[t]:void 0},Jd=e=>{let t=e??H(vd);return t===Cd?[t]:[t,Cd]},Yd=(e,{values:t={},locale:n,default:r,formats:i}={})=>{if(e==null)throw TypeError(`format: key must be a string or message object (got ${JSON.stringify(e)})`);if(typeof e==`object`){let{id:t,...n}=e;return Yd(t,n)}let a=Jd(n),[o]=a,s=a.reduce((t,n)=>t??qd(n,e),void 0);Dd=i;let c;try{c=s?.format(t)}finally{Dd=void 0}if(c!==void 0)return c;if(wd){let t=wd(e,o,r);if(t!==void 0)return t}return r??e},Xd=`_default`,Zd={date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}},number:{currency:{style:`currency`},percent:{style:`percent`},scientific:{notation:`scientific`},engineering:{notation:`engineering`},compactLong:{notation:`compact`,compactDisplay:`long`},compactShort:{notation:`compact`,compactDisplay:`short`}}},Qd=(e,t)=>Td[e]?.[t]??Zd[e]?.[t],$d=e=>Td[e]?.[Xd],ef=e=>{let t=Dd?.[e];return(typeof t==`string`?Qd(e,t):t)??$d(e)},tf=(e,t,n)=>{let r=e.valueOf();return{...e,dir:n?Mu(n):e.dir,toString:()=>t.format(r)}},nf=(e,t,n)=>(r,i,a)=>{let o=e(r,i,a),s=ef(t);if(!s)return o;let{locale:c,...l}=s;return tf(o,new n(c??r.locales,l),c)},rf={...td,date:nf(td.date,`date`,Intl.DateTimeFormat),time:nf(td.time,`time`,Intl.DateTimeFormat),datetime:nf(td.datetime,`datetime`,Intl.DateTimeFormat),number:nf(ed.number,`number`,Intl.NumberFormat),integer:nf(ed.integer,`number`,Intl.NumberFormat)},af=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,of=e=>{let t=globalThis.crypto.randomUUID();return e===`short`?t.split(`-`).pop():e===`shorter`?t.split(`-`).shift():typeof e==`number`?t.split(`-`).join(``).slice(0,e):t},sf=`abcdefghijklmnopqrstuvwxyz234567`,cf=e=>{let t=``,n=0,r=0;return e.forEach(e=>{for(n=n<<8|e,r+=8;r>=5;)r-=5,t+=sf[n>>>r&31]}),r>0&&(t+=sf[n<<5-r&31]),t},lf=()=>cf(Uint8Array.fromHex(of().replaceAll(`-`,``))),uf=async(e,{algorithm:t=`SHA-1`,format:n=`hex`}={})=>{let r;if(typeof e==`string`)r=new TextEncoder().encode(e);else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e;else if(e&&typeof e.arrayBuffer==`function`)r=await e.arrayBuffer();else throw Error(`Unsupported input type for getHash`);let i=await globalThis.crypto.subtle.digest(t,r);return n===`binary`?Array.from(new Uint8Array(i),e=>String.fromCharCode(e)).join(``):new Uint8Array(i).toHex()},df=e(_r(),1),ff=class e{#e;#t;#n=``;#r=``;#i={};#a=[];constructor(e,t,{keyPath:n,autoIncrement:r,indexes:i=[]}={}){this.#e=void 0,this.#n=e,this.#r=t,this.#i={keyPath:n,autoIncrement:r},this.#a=i}async#o(e){return new Promise((t,n)=>{let r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{let e=r.result,t=this.#r,n=e.objectStoreNames.contains(t)?r.transaction.objectStore(t):e.createObjectStore(t,this.#i);this.#a.forEach(({name:e,keyPath:t,options:r})=>{n.indexNames.contains(e)||n.createIndex(e,t,r)})},r.onsuccess=()=>{t(r.result)},r.onerror=()=>{n(r.error)}})}#s(e){let t=this.#r;if(!e.objectStoreNames.contains(t))return!0;let n=e.transaction(t).objectStore(t);return this.#a.some(({name:e})=>!n.indexNames.contains(e))}async#c(){let e=await this.#o();for(;this.#s(e);){let{version:t}=e;e.close();try{e=await this.#o(t+1)}catch(t){if(t?.name!==`VersionError`)throw t;e=await this.#o()}}return e.onversionchange=()=>{e.close(),this.#e=void 0},e.onclose=()=>{this.#e=void 0},e}async#l(e,{mode:t=`readonly`}={}){if(!this.#e){this.#t??=this.#c();try{this.#e=await this.#t}finally{this.#t=void 0}}let n=this.#e,r=this.#r,i=n.transaction(r,t),a=e(i.objectStore(r));return new Promise((e,n)=>{if(i.onerror=()=>{n(i.error)},i.onabort=()=>{n(i.error)},t===`readwrite`){let t;a&&(a.onsuccess=()=>{t=a.result}),i.oncomplete=()=>{e(t)}}else a?a.onsuccess=()=>{e(a.result)}:i.oncomplete=()=>{e(void 0)}})}async set(e,t){return this.#l(n=>n.put(t,e),{mode:`readwrite`})}async put(e){return this.#l(t=>t.put(e),{mode:`readwrite`})}async saveEntries(e){return this.#l(t=>{e.forEach(([e,n])=>{t.put(n,e)})},{mode:`readwrite`})}async get(e){return this.#l(t=>t.get(e))}async keys(){return this.#l(e=>e.getAllKeys())}async values(){return this.#l(e=>e.getAll())}async entries(){let e=[],t=await this.#l(t=>{let n=t.getAllKeys();return n.onsuccess=()=>{e=n.result},t.getAll()});return e.map((e,n)=>[e,t[n]])}static#u(e,t){return t?e.index(t):e}async#d({callback:t=void 0,index:n=void 0,query:r=void 0,direction:i=`next`}){return new Promise((a,o)=>{this.#l(o=>{let s=e.#u(o,n).openCursor(r,i);s.onsuccess=()=>{let e=s.result;if(e){let{value:n}=e;typeof t!=`function`||t(n)?a(n):e.continue()}else a(void 0)}}).catch(o)})}async find(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n})}async findLast(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n,direction:`prev`})}async filter(t,{index:n,query:r}={}){let i=await this.#l(t=>e.#u(t,n).getAll(r));return typeof t==`function`?i.filter(e=>t(e)):i}async delete(e){await this.#l(t=>t.delete(e),{mode:`readwrite`})}async deleteEntries(e){await this.#l(t=>{e.forEach(e=>{t.delete(e)})},{mode:`readwrite`})}async clear(){await this.#l(e=>e.clear(),{mode:`readwrite`})}},pf=e=>{try{return JSON.parse(e)}catch{return null}},mf=class{static async set(e,t){t===void 0?globalThis.localStorage.removeItem(e):globalThis.localStorage.setItem(e,JSON.stringify(t))}static async get(e){let t=globalThis.localStorage.getItem(e);return t?pf(t):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(pf)}static async entries(){return Object.entries(globalThis.localStorage).map(([e,t])=>[e,pf(t)])}},hf=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),gf=(e,t,{ellipsis:n=`…`}={})=>{let r=e.trim();if(r.length<=t)return r;let i=[...r.slice(0,t*2)];return`${i.slice(0,t).join(``).trim()}${i.length>t||r.length>t*2?n:``}`},K=e=>e.replace(/^\/+|\/+$/g,``),_f,vf=e=>(_f??=new DOMParser,_f.parseFromString(e,`text/html`).body.textContent),yf=e=>!/\s/.test(e)&&URL.canParse(e),bf=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare,xf=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],Sf=[`difference`,`intersection`,`symmetricDifference`,`union`],Cf=!1,wf=class e extends Set{#e=new Map;#t=Ya(0);#n=Ya(0);#r=hs||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}Cf||this.#a()}#i(e){return hs===this.#r?Ya(e):Ja(e)}#a(){Cf=!0;var t=e.prototype,n=Set.prototype;for(let e of xf)t[e]=function(...t){return H(this.#t),n[e].apply(this,t)};for(let r of Sf)t[r]=function(...t){H(this.#t);var i=n[r].apply(this,t);return new e(i)}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return H(this.#t),!1;r=this.#i(!0),n.set(e,r)}return H(r),t}add(e){return super.has(e)||(super.add(e),z(this.#n,super.size),to(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),z(r,!1)),t&&(z(this.#n,super.size),to(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())z(t,!1);e.clear(),z(this.#n,0),to(this.#t)}}keys(){return this.values()}values(){return H(this.#t),super.values()}entries(){return H(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return H(this.#n)}},Tf=class extends Map{#e=new Map;#t=Ya(0);#n=Ya(0);#r=hs||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return hs===this.#r?Ya(e):Ja(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return H(this.#t),!1}return H(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{H(this.#t);return}}return H(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),z(this.#n,super.size),to(o);else if(i!==t){to(r);var s=o.reactions===null?null:new Set(o.reactions);s!==null&&r.reactions?.every(e=>s.has(e))||to(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),z(n,-1)),r&&(z(this.#n,super.size),to(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;z(this.#n,0);for(var t of e.values())z(t,-1);to(this.#t),e.clear()}}#a(){H(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)H(n)}keys(){return H(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return H(this.#n),super.size}},Ef=new Map,Df=new Tf,Of=new Map,kf=new Map,Af=new Set,jf=new Map,Mf=new Map,Nf=new Set,Pf=`${mr}/schema/sveltia-cms.json`,{DEV:Ff,VITE_SITE_URL:If}={DEV:!1},Lf=Ff?If||`http://localhost:5174`:void 0,Rf=`/admin/config.yml`,zf=[`text/yaml`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/json`],Bf=(e,t=[])=>(t.forEach(t=>{Object.hasOwn(e,t)&&Object.defineProperty(e,t,{value:e[t],writable:!1,enumerable:!0,configurable:!0})}),ro(e)),Vf=e=>Bi(e),q=e=>{let t=Ya(e);return{get current(){return H(t)},set current(e){z(t,e)}}},Hf=e=>ro({current:e}),Uf=e=>{let t=ba(e);return{get current(){return H(t)}}},Wf=e=>{let t;return Uf(()=>{let n=e();return(0,df.default)(n,t)||(t=n),t})},Gf=(e,t,n)=>(e.current?.respond(n),new Promise(n=>{let r={...t,respond:t=>{e.current===r&&(e.current=void 0),n(t)}};e.current=r})),Kf=e=>Po(()=>{jo(e)}),qf=(e,t)=>{jo(()=>(e(),Os(t)))},Jf=(e,t,n)=>{jo(()=>{let r=e();if(!r)return;let i=!1;return r.then(e=>{i||t(e)},n&&(e=>{i||n(e)})),()=>{i=!0}})},Yf=(e,t,n,r,i=e=>e,a=e=>e)=>{let o,s=()=>{let t=i(e());n()!==t&&r(t),o=t},c=()=>{let r=a(n());e()!==r&&t(r)};return qf(e,s),qf(n,()=>{n()!==o&&c()}),{updateInput:s,updateValue:c}},Xf=q(),Zf=Xf,Qf={},$f=q(),ep=q([]),tp=Uf(()=>!!Zf.current||!!ep.current.length),np={errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set},rp=e=>Array.isArray(e.fields)&&!Array.isArray(e.files),ip=e=>Array.isArray(e.files),ap=e=>ip(e)&&e.name===`_singletons`,op=e=>e?._type===`entry`&&!!e._file.arrayFile,sp=(e,{visible:t=void 0,type:n=void 0}={})=>`divider`in e||t&&e.hide?!1:n===`entry`?rp(e):n===`file`?ip(e):n===`singleton`?ap(e):rp(e)||ip(e),cp=e=>!(`divider`in e)&&typeof e.file==`string`&&Array.isArray(e.fields),lp=e=>e.filter(e=>cp(e)),up=[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`],dp=[`boolean`,`color`,`compute`,`datetime`,`map`,`markdown`,`number`,`richtext`,`string`,`text`,`uuid`],fp=dp.filter(e=>![`boolean`,`number`].includes(e)),pp=[`file`,`image`],mp=[`richtext`,`markdown`],hp=[`text`,`string`,...mp],gp=[...pp,`relation`,`select`],_p=[...gp,`datetime`,`keyvalue`,`list`,`number`],vp=(e=``)=>RegExp(`\\bblob:${hf(globalThis.location.origin)}\\/${af.source}\\b`,e),yp=/(?:(.+?)\/)?(([^/]+?)(?:\.((?:[Tt][Aa][Rr]\.)?[a-zA-Z0-9]+))?)$/,bp=[`application/atom+xml`,`application/javascript`,`application/json`,`application/ld+json`,`application/rss+xml`,`application/xhtml+xml`,`application/xml`,`application/yaml`,`image/svg+xml`],xp=e=>e.startsWith(`text/`)||bp.includes(e),Sp=e=>{let t=e.length;for(;e[t-1]===`/`;)--t;let[,n,r=``,i=``,a]=e.slice(0,t).match(yp)??[];return{dirname:n,basename:r,filename:i,extension:a}},Cp=(e,t)=>{if(!t.length)return!0;let n=e.name.toLowerCase();return t.some(t=>{let r=t.toLowerCase();if(r.startsWith(`.`))return n.endsWith(r);let[i,a]=r.split(`/`);return a===`*`?e.type.split(`/`)[0]===i:e.type===r})},wp=async({items:e},{accept:t}={})=>{let n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):[],r=e=>new Promise(t=>{e.file(t,()=>t(null))}),i=e=>new Promise(t=>{e.readEntries(t,()=>t([]))}),a=async e=>{if(e.name.startsWith(`.`))return[];if(e.isFile){let t=await r(e);return t&&Cp(t,n)?[t]:[]}let t=e.createReader(),o=[];for(;;){let e=await i(t);if(!e.length)break;o.push(...e)}return(await Promise.all(o.map(a))).flat()},o=[...e].map(e=>e.webkitGetAsEntry()).filter(e=>e!==null);return(await Promise.all(o.map(a))).flat().sort((e,t)=>e.name.localeCompare(t.name))},Tp=async e=>(await e.text()).replace(/\r\n?/g,`
`),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,`&amp;`).replaceAll(`"`,`&quot;`),fm={"&":`&amp;`,"<":`&lt;`,">":`&gt;`},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.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)},Am=(e,t)=>{let n=t?`${t}/`:``,r=e.startsWith(n)?e.slice(n.length):void 0;return r?.includes(`/`)?void 0:r},jm=(e,t)=>!e||t.startsWith(`${e}/`),Mm=({collection:e,entries:t,dirPath:n})=>{if(!Cm(e))return!1;let r=K(n);return!r||t.some(({subPath:e})=>jm(r,e))},Nm=({collection:e,entries:t,dirPath:n})=>{let r=Sm(e);if(!r)return t;let{subfolders:i}=r,a=K(n);return t.filter(({subPath:e})=>{if(!jm(a,e))return!1;let t=(a?e.slice(a.length+1):e).split(`/`).length;return i?a?t===2:t<=2:t===1})},Pm=(e,t,n)=>{let r=e;return r.has(t)||r.set(t,n()),r.get(t)},Fm=(e,t)=>{let n=e.get(t);return e.delete(t),e.set(t,n),n},Im=(e,t,n,r)=>{e.delete(t),e.set(t,n),e.size>r&&e.delete(e.keys().next().value)},Lm=e=>{let t=new Map;return{has:e=>t.has(e),get:e=>t.has(e)?Fm(t,e):void 0,set:(n,r)=>{Im(t,n,r,e)},clear:()=>{t.clear()}}},Rm=(e,t,n,r)=>{if(e.has(t))return Fm(e,t);let i=n();return Im(e,t,i,r),i},zm=(e,t,n)=>Pm(e,t,()=>n().finally(()=>{e.delete(t)})),Bm=(e,t,n)=>Pm(e,t,()=>n().catch(n=>{throw e.delete(t),n})),Vm=(e,t)=>{let n;return()=>{let r=e();return n&&n.source===r||(n={source:r,value:t(r)}),n.value}},Hm=`{{locale}}`,Um=/(?:^|\/){{locale}}(?:\/|$)/,Wm=e=>e.includes(Hm),Gm=e=>e.split(`{{locale}}`).length===2&&Um.test(e),Km=e=>{let t=e.indexOf(Hm);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+10);if(n===``||n.endsWith(`/`))return r.startsWith(`/`)?`${n}${r.slice(1)}`:r===``?n.endsWith(`//`)?void 0:n.length>1?n.slice(0,-1):n:/^\.(?:[^./][^/]*\.|{{)/.test(r)?`${n}${r.slice(1)}`:void 0;if(/[^/]\.$/.test(n)&&/^(?:[./]|$)/.test(r))return`${n.slice(0,-1)}${r}`},qm=e=>Km(e)!==void 0,Jm=({path:e,locale:t,omitLocale:n=!1})=>(n&&(e=Km(e)??e),e.replaceAll(Hm,t)),Ym=(e,t)=>`${e}/`.split(`${Hm}/`).map(hf).join(t),Xm=new Map,Zm=(e,t)=>e.replace(Pm(Xm,t,()=>RegExp(`^${Ym(t,`(?:[^/]+\\/)?`)}`)),``),Qm={type:`language`,languageDisplay:`standard`,style:`short`,fallback:`none`},$m=e=>{let t;if(e!==`_default`)try{[t]=Intl.getCanonicalLocales(e)}catch{}return t},eh=e=>e===`_default`?`auto`:Hd(e)?`rtl`:`ltr`,th=new Map,nh=(e,{displayLocale:t=$m(Ud.current??`en`),formatterOptions:n=Qm}={})=>{let r=$m(e);if(!r)return;let i=t?Pm(th,t,()=>new Intl.DisplayNames(t,n)):new Intl.DisplayNames(void 0,n);try{let e=i.of(r);if(!e)return;let[n,...a]=e;return[n.toLocaleUpperCase(t),...a].join(``)}catch(e){console.error(e);return}},rh=new Map,ih=(e,t={})=>{let n={style:`narrow`,type:`conjunction`,...t};return Pm(rh,`${e}|${n.style}|${n.type}`,()=>{let t=new Intl.ListFormat($m(e),n);return{format:e=>t.format([...e].filter(e=>e!=null).map(e=>`${e}`))}})},ah=({_i18n:e,locale:t,path:n})=>{let{defaultLocale:r,omitDefaultLocaleFromFilePath:i}=e;return Jm({path:n,locale:t,omitLocale:i&&t===r})},oh=({extension:e,format:t})=>(t?kf.get(t)?.extension:void 0)||e||(t?tm[t]??`md`:`md`),sh=({extension:e,format:t})=>t||(em.includes(e)?`frontmatter`:nm[e]??`yaml-frontmatter`),ch=({subPath:e,indexFileName:t,nestedDepth:n,entrySuffix:r=``,indexSuffix:i=``})=>{let a=t?hf(t):``,o=!!a&&!!i,s=a&&!o?`|${a}`:``,c;if(!e)c=n===void 0?`[^/]+?`:`[^/]+?(?:\\/[^/]+?)${Number.isFinite(n)?`{0,${Math.max(0,n-1)}}`:`*`}`;else{let t=`${qp(e,`[^/]+?`)}${s}`;if(n===void 0)c=t;else{let r=Number.isFinite(n)?Math.max(0,n-e.split(`/`).length):void 0;c=`${r===void 0?`(?:[^/]+\\/)*`:`(?:[^/]+\\/){0,${r}}`}(?:${t})`}}return o?`(?<subPath>${`(?!${a}${r})`}(?:${c})${r}|${a}${i})`:`(?<subPath>${c})`},lh=({extension:e,format:t,basePath:n,subPath:r,indexFileName:i,indexFileExtension:a,nestedDepth:o,_i18n:s})=>{let{allLocales:c,defaultLocale:l,omitDefaultLocaleFromFilePath:u,structureMap:{i18nMultiFile:d,i18nMultiFolder:f,i18nMultiRootFolder:p}}=s,m=c.map(hf).join(`|`),h=c.filter(e=>e!==l).map(hf).join(`|`),g=`(?<locale>${m})`,_=u?`(?:(?<locale>${h})\\/)?`:`${g}\\/`,v=u?`(?:\\.(?<locale>${h}))?`:`\\.${g}`,y=!!n&&Wm(n),b=y?Ym(n,_):n?`${hf(n)}\\/`:``,x=oh({format:t,extension:e}),S=i&&a!==void 0&&a!==x?a:void 0,C=e=>{let t=u?`(?:\\.(?:${h}))?`:`\\.(?:${m})`;return`(?=${d?t:``}\\.${hf(e)}$)`},ee=[`^`,p&&!y?_:``,b,f&&!y?_:``,ch({subPath:r,indexFileName:i,nestedDepth:o,entrySuffix:S?C(x):``,indexSuffix:S?C(S):``}),d?v:``,`\\.`,S?`(?:${hf(x)}|${hf(S)})`:hf(x),`$`].join(``);return new RegExp(ee)},uh=({format:e,delimiter:t})=>lm(t)?[t,t]:Array.isArray(t)&&t.length===2?t:rm[e]??void 0,dh=({indexFile:e,extension:t,format:n})=>{if(!e)return;let{extension:r,format:i}=e;if(r===void 0&&i===void 0)return;let a=oh({extension:r,format:i}),o=sh({extension:a,format:i}),s=oh({extension:t,format:n}),c=sh({extension:s,format:n});if(a!==s||o!==c)return{extension:a,format:o}},fh=({rawCollection:e,file:t,_i18n:n})=>{let{folder:r,file:i,path:a,extension:o,format:s,frontmatter_delimiter:c,body_field:l,yaml_quote:u}=e,d=rp(e),f=d&&typeof i==`string`,p=t?.file?K(t.file):f?K(i):void 0,m=p?Sp(p).extension:o,h=t?.format??s,g=oh({format:h,extension:m}),_=sh({format:h,extension:g}),v=t?.frontmatter_delimiter??c,y=d&&!f,b=y?K(r):void 0,x=y?Zp(e):void 0,S=x?.name,C=y?Sm(e)?.depth:void 0,ee=dh({indexFile:x,extension:o,format:s}),te={extension:g,format:_,basePath:b,subPath:y?a:void 0,fullPathRegEx:b===void 0?void 0:lh({extension:g,format:_,basePath:b,subPath:a,indexFileName:S,indexFileExtension:ee?.extension,nestedDepth:C,_i18n:n}),fullPath:p?ah({_i18n:n,locale:n.defaultLocale,path:p}):void 0,fmDelimiters:uh({format:_,delimiter:v}),bodyField:t?.body_field??l,yamlQuote:!!u};return f&&(te.arrayFile=!0),ee&&(te.indexFile={...te,...ee,fmDelimiters:uh({format:ee.format,delimiter:v})}),te},ph=({collection:e,collectionFile:t,isIndexFile:n=!1})=>{let{_file:r}=t??e;return(n?r.indexFile:void 0)??r},mh={SINGLE_FILE:`single_file`,SINGLE_FILE_DEFAULT_ROOT:`single_file_default_root`,MULTIPLE_FILES:`multiple_files`,MULTIPLE_FOLDERS:`multiple_folders`,MULTIPLE_FOLDERS_I18N_ROOT:`multiple_folders_i18n_root`,MULTIPLE_ROOT_FOLDERS:`multiple_root_folders`},hh=[mh.MULTIPLE_FOLDERS_I18N_ROOT,mh.MULTIPLE_ROOT_FOLDERS],gh=`_default`,_h={key:`translationKey`,value:`{{slug}}`},vh=({cmsConfig:e,collection:t,file:n})=>{let r=e?.i18n;if(!c(r))return;let i=structuredClone(r),{name:a,i18n:o}=t;if(o||a===`_singletons`){if(c(o)&&Object.assign(i,o),n){if(!n.i18n)return;c(n.i18n)&&Object.assign(i,n.i18n)}return i}},yh=e=>e?.omit_default_locale_from_file_path??e?.omit_default_locale_from_filename??!1,bh={i18nEnabled:!1,saveAllLocales:!0,allLocales:[gh],initialLocales:[gh],defaultLocale:gh,structure:mh.SINGLE_FILE,structureMap:{i18nSingleFile:!1,i18nSingleFileDefaultRoot:!1,i18nMultiFile:!1,i18nMultiFolder:!1,i18nMultiRootFolder:!1},canonicalSlug:{..._h},omitDefaultLocaleFromFilePath:!1,omitDefaultLocaleFromPreviewPath:!1},xh=e=>(e?.collectionFile??e?.collection)?._i18n??bh,Sh=(e,t,n,r)=>!t&&typeof r!=`string`?typeof n==`string`&&Wm(n)?mh.MULTIPLE_FOLDERS:e:t?.file.includes(`{{locale}}`)?mh.MULTIPLE_FILES:e===mh.SINGLE_FILE_DEFAULT_ROOT?mh.SINGLE_FILE_DEFAULT_ROOT:mh.SINGLE_FILE,Ch=(e,t)=>({i18nSingleFile:e&&t===mh.SINGLE_FILE,i18nSingleFileDefaultRoot:e&&t===mh.SINGLE_FILE_DEFAULT_ROOT,i18nMultiFile:e&&t===mh.MULTIPLE_FILES,i18nMultiFolder:e&&t===mh.MULTIPLE_FOLDERS,i18nMultiRootFolder:e&&(t===mh.MULTIPLE_FOLDERS_I18N_ROOT||t===mh.MULTIPLE_ROOT_FOLDERS)}),wh=({i18nSingleFile:e,i18nSingleFileDefaultRoot:t})=>!!e||!!t,Th=({i18nMultiFile:e,i18nMultiFolder:t,i18nMultiRootFolder:n})=>!!e||!!t||!!n,Eh=(e,t,n)=>e?n&&t.includes(n)?n:t[0]:gh,Dh=(e,t,n)=>e===`all`?t:e==="default"?[n]:t.filter(t=>t===n||!Array.isArray(e)||e.includes(t)),Oh=(e,t,n)=>e?n?qm(n.file):Th(t):!1,kh=(e,t)=>{let{structure:n=mh.SINGLE_FILE,locales:r=[],default_locale:i,initial_locales:a,save_all_locales:o=!0,canonical_slug:s={key:void 0,value:void 0},omit_default_locale_from_filename:c,omit_default_locale_from_file_path:l=c??!1,omit_default_locale_from_preview_path:u=!1}=vh({cmsConfig:Zf.current,collection:e,file:t})??{},{key:d=_h.key,value:f=_h.value}=s,p=r.length>0,m=p?r:[gh],h=Eh(p,m,i),{folder:g,file:_}=e,v=Sh(n,t,g,_),y=Ch(p,v),b=!p||o===!0&&a===void 0,x=Dh(a,m,h),S=Oh(l,y,t);return{i18nEnabled:p,saveAllLocales:b,allLocales:m,defaultLocale:h,initialLocales:x,structure:v,structureMap:y,canonicalSlug:{key:d,value:f},omitDefaultLocaleFromFilePath:S,omitDefaultLocaleFromPreviewPath:u}},Ah=e=>{if(!e)return;let t=Object.values(e);if(t.some(e=>e.config?.multiple===!0))return!0;if(t.some(e=>e.config?.multiple===!1))return!1},jh=e=>{if(!e?.config)return;let{multiple:t}=e.config;if(typeof t==`boolean`)return t},Mh=e=>{let t=Zf.current;return e.multiple??Ah(e.media_libraries)??jh(e.media_library)??Ah(t?.media_libraries)??jh(t?.media_library)??!1},Nh=q(),Ph=new Map,Fh=({collections:e=Zf.current?.collections??[],visible:t,type:n}={})=>e.filter(e=>sp(e,{visible:t,type:n})),Ih=()=>Fh({visible:!0})[0],Lh=e=>{if(!rp(e))return[];let{fields:t,thumbnail:n=!0}=e;return n===!1?[]:typeof n==`string`?[n]:Array.isArray(n)?n:t?.length?t.filter(({widget:e=`string`})=>pp.includes(e)).map(e=>Mh(e)?`${e.name}.*`:e.name):[]},Rh=(e,t)=>({...e,_i18n:t,_type:`entry`,_file:fh({rawCollection:e,_i18n:t}),_thumbnailFieldNames:Lh(e)}),zh=(e,t,n)=>({...e,_i18n:t,_type:ap(e)?`singleton`:`file`,_fileMap:Object.fromEntries(n.filter(cp).map(t=>{let n=kh(e,t),r=fh({rawCollection:e,file:t,_i18n:n});return[t.name,{...t,_file:r,_i18n:n}]}))}),Bh=()=>{let e=Zf.current?.singletons;if(!Array.isArray(e))return;let t=lp(e).map(e=>({...e,file:K(e.file)}));if(!t.length)return;let n={name:`_singletons`,files:t};return zh(n,kh(n),t)},Vh=e=>{let t=Ph.get(e);if(t)return t;if(e===`_singletons`){let t=Bh();return Ph.set(e,t),t}let n=Fh().find(t=>t.name===e);if(!n){Ph.set(e,void 0);return}let r=rp(n)?n:void 0,i=ip(n)?n:void 0;if(!r&&!i){Ph.set(e,void 0);return}r?(typeof r.folder==`string`&&(r.folder=K(r.folder)),typeof r.file==`string`&&(r.file=K(r.file))):i?.files.forEach(e=>{e.file&&=K(e.file)});let a=kh(n),o=r?Rh(r,a):zh(i,a,i.files);return Ph.set(e,o),o},Hh=(e,{useSingular:t=!1}={})=>{let{_type:n,name:r,label:i,label_singular:a}=e;return n===`singleton`?Yd(`files`):t&&a?a:i||r},Uh=e=>e?e===`_singletons`?9999999:Zf.current?.collections?.findIndex(({name:t})=>t===e)??-1:-1,Wh=q(!1),Gh=q(),Kh=q([]),qh=q([]),Jh=Vm(()=>qh.current,e=>{let t=new Map;return e.forEach((e,n)=>{Object.values(e.locales).forEach(({path:r})=>{t.has(r)||t.set(r,{entry:e,index:n})})}),t}),Yh=e=>{let t=Jh(),n;return[...e].forEach(e=>{let r=t.get(e);r&&(!n||r.index<n.index)&&(n=r)}),n?.entry},Xh=q([]),Zh=(e,t)=>{let n=typeof e==`string`?Vh(e):e;if(n&&`_fileMap`in n&&Object.hasOwn(n._fileMap,t))return n._fileMap[t]},Qh=(e,t)=>{let n=Vh(e);if(!n)return;let r=t?Zh(n,t):void 0;if(!t||r)return{collection:n,collectionFile:r}},$h=e=>e.label||e.name,eg=(e,t)=>`_fileMap`in e?Object.values(e._fileMap).filter(({file:e,_file:n,_i18n:r})=>Object.entries(t.locales).some(([t,{path:i}])=>i===(t===r.defaultLocale?n.fullPath:ah({_i18n:r,locale:t,path:K(e)})))):[],tg=(e,t)=>{let n=Kh.current.find(({collectionName:n,fileName:r})=>n===e&&r===t);if(n?.filePathMap)return Yh(Object.values(n.filePathMap))},ng=(e,t)=>{if(e&&t){let{collections:n,singletons:r}=Zf.current;if(e===`_singletons`)return Array.isArray(r)?lp(r).findIndex(e=>e.name===t):-1;let i=Fh({collections:n}).find(({name:t})=>t===e);if(i&&`files`in i)return i.files.findIndex(({name:e})=>e===t)}return-1},rg=e=>hf(e).replaceAll(`\\*`,`\\d+`),ig=(e,t)=>e===t||e.startsWith(`${t}.`),ag=new WeakMap,og=e=>{let t=ag.get(e);return t||(t=Object.keys(e).map((e,t)=>[e,t]).sort(([e],[t])=>e<t?-1:1),ag.set(e,t)),t},sg=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.startsWith(t));let r=og(e),i=0,a=r.length;for(;i<a;){let e=Math.floor((i+a)/2);r[e][0]<t?i=e+1:a=e}let o=[];for(let e=i;e<r.length&&r[e][0].startsWith(t);e+=1)o.push(r[e]);return o.sort(([,e],[,t])=>e-t).map(([e])=>e)},cg=/\.\d+$/,lg=/^(?<parent>.+)\.\d+$/,ug=new WeakMap,dg=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.match(lg)?.groups?.parent===t);let r=ug.get(e);return r||(r=new Map,Object.keys(e).forEach(e=>{let{parent:t}=e.match(lg)?.groups??{};if(t===void 0)return;let n=r.get(t);n?n.push(e):r.set(t,[e])}),ug.set(e,r)),r.get(t)??[]};function fg(e){return e&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function pg(e){return e}function mg(e,t){t||={};let n=t.delimiter||`.`,r=t.maxDepth,i=t.transformKey||pg,a={};function o(e,s,c){c||=1,Object.keys(e).forEach(function(l){let u=e[l],d=t.safe&&Array.isArray(u),f=Object.prototype.toString.call(u),p=fg(u),m=f===`[object Object]`||f===`[object Array]`,h=s?s+n+i(l):i(l);if(!d&&!p&&m&&Object.keys(u).length&&(!t.maxDepth||c<r))return o(u,h,c+1);a[h]=u})}return o(e),a}function hg(e,t){t||={};let n=t.delimiter||`.`,r=t.overwrite||!1,i=t.transformKey||pg,a={};if(fg(e)||Object.prototype.toString.call(e)!==`[object Object]`)return e;function o(e){let n=Number(e);return isNaN(n)||e.indexOf(`.`)!==-1||t.object?e:n}function s(e,t,r){return Object.keys(r).reduce(function(t,i){return t[e+n+i]=r[i],t},t)}function c(e){let t=Object.prototype.toString.call(e),n=t===`[object Array]`,r=t===`[object Object]`;if(!e)return!0;if(n)return!e.length;if(r)return!Object.keys(e).length}return e=Object.keys(e).reduce(function(n,r){let i=Object.prototype.toString.call(e[r]);return i!==`[object Object]`&&i!==`[object Array]`||c(e[r])?(n[r]=e[r],n):s(r,n,mg(e[r],t))},{}),Object.keys(e).forEach(function(s){let c=s.split(n).map(i),l=o(c.shift()),u=o(c[0]),d=a;for(;u!==void 0;){if(l===`__proto__`)return;let e=Object.prototype.toString.call(d[l]),n=e===`[object Object]`||e===`[object Array]`;if(!r&&!n&&d[l]!==void 0)return;(r&&!n||!r&&d[l]==null)&&(d[l]=typeof u==`number`&&!t.object?[]:{}),d=d[l],c.length>0&&(l=o(c.shift()),u=o(c[0]))}d[l]=hg(e[s],t)}),a}var gg=``,_g=``,vg=/[.\uE000\uE001]/g,yg=/\uE001([\uE000\uE001])|\uE000/g,bg=/[\uE000\uE001]/,xg=`\0`,Sg=/^(?:0|[1-9]\d*)$/,Cg=e=>!Number.isNaN(Number(e))&&!Sg.test(e),wg=e=>Cg(e)?`${xg}${e}`:e,Tg=e=>c(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e)),Eg=e=>Array.isArray(e)?(e.forEach((t,n)=>{e[n]=Eg(t)}),e):Tg(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.startsWith(xg)?e.slice(1):e,Eg(t)])):e,Dg=e=>e.includes(`.`)||bg.test(e)?e.replace(vg,e=>e===`.`?gg:`${_g}${e}`):e,Og=e=>bg.test(e)?e.replace(yg,(e,t)=>t??`.`):e,kg=e=>[`[object Object]`,`[object Array]`].includes(Object.prototype.toString.call(e))&&!!Object.keys(e).length,Ag=e=>Object.prototype.toString.call(e)===`[object Object]`&&Object.keys(e).some(e=>Sg.test(e)),jg=(e,t)=>{let n=`${t}.`;return Object.keys(e).some(e=>e.startsWith(n)&&Sg.test(e.slice(n.length).split(`.`)[0]))},Mg=(e,t)=>{let n={},r=(e,t)=>{t!==void 0&&Ag(e)&&(n[t]={}),Object.entries(e).forEach(([e,i])=>{let a=Dg(e),o=t===void 0?a:`${t}.${a}`;kg(i)?r(i,o):n[o]=i})};return kg(e)?r(e,t):t!==void 0&&(n[t]=e),n},Ng=e=>wg(Og(e)),Pg=e=>{let t=Object.entries(e);return t.some(([,e])=>kg(e))?Pg(Object.fromEntries(t.flatMap(([e,t])=>kg(t)?Object.entries(Mg(t,e)):[[e,t]]))):t.some(([e])=>bg.test(e)||e.split(`.`).some(Cg))?Eg(hg(e,{transformKey:Ng})):hg(e)},Fg=e=>e?Pg(Object.fromEntries(Object.entries(e).sort(([e],[t])=>bf(e,t)))):hg(e),Ig=e=>e==null||e===``||Array.isArray(e)&&!e.length||Tg(e)&&!Object.keys(e).length,Lg=e=>Array.isArray(e)&&!e.length||c(e)&&!Object.keys(e).length,Rg=(e,t)=>({[e]:Array.isArray(t)?[]:{},...Mg(t,e)}),zg=(e,t,{live:n=!1}={})=>{let r=sg(e,`${t}.`,{live:n});if(!r.length)return;let i=r.map(n=>[`_${n.slice(t.length)}`,e[n]]),a=e[t];return Lg(a)&&i.push([`_`,a]),Fg(Object.fromEntries(i))._},Bg=e=>typeof e==`object`&&e?Array.isArray(e)?`\0[]`:`\0{}`:e,Vg=(e,t,n)=>{let r=sg(t,`${n}.`),i=[...r,n].map(e=>Bg(t[e])),a=e.keys,o=e.values;return e.keyPath===n&&a.length===r.length&&r.every((e,t)=>e===a[t])&&i.every((e,t)=>e===o[t])||Object.assign(e,{keyPath:n,keys:r,values:i,subtree:zg(t,n)}),e.subtree},Hg=(e,t)=>{Object.keys(e).forEach(n=>{ig(n,t)&&delete e[n]})},Ug=(e,t,n)=>{Hg(e,t),Object.assign(e,Rg(t,n))},Wg=e=>!!e&&`type`in e&&e.type===`inline`,Gg=({source:e,flags:t})=>new RegExp(e.startsWith(`^`)?e.slice(1):e,t.replace(/[gy]/g,``)),Kg=e=>{let{id:t,label:n,icon:r,pattern:i,trigger:a,toPreview:o,onInsert:s,onEdit:c}=e,{fromBlock:l,toBlock:u}=e,d=e.fromInline??l,f=e.toInline??u;return{id:t,label:n,icon:r,fields:[],pattern:Gg(i),fromBlock:d,toBlock:f,toPreview:o,inlinePattern:{trigger:a||void 0,onInsert:s,onEdit:c}}},qg=new WeakMap,Jg=(e,t)=>{let n=t?`sticky`:`global`,r=Pm(qg,e,()=>({}));return r[n]??=new RegExp(e.source,`${e.flags}${t?`y`:`g`}`),r[n]},Yg=(e,t,{trigger:n}={},r=1/0)=>{let i=Jg(t,!!n),a=[],o=n?e.indexOf(n):0;for(;o!==-1&&a.length<r;){i.lastIndex=o;let t=i.exec(e);if(!t&&!n)break;let r;t?.[0]?(a.push(t),r=t.index+t[0].length):r=(t?.index??o)+1,o=n?e.indexOf(n,r):r<=e.length?r:-1}return a},Xg=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>Yg(n,e,t,1)[0]??null}),Zg=`__sc_`,Qg=e=>e.startsWith(Zg),$g=({multiline:e,dotAll:t,source:n})=>e||t||n.includes(`[\\s\\S]`)||n.includes(`[\\S\\s]`),e_=({pattern:e,inlinePattern:t})=>!!t||!$g(e),t_=e=>{let t=[],n=0,r=``,i=0,a=!1;return[...e,`,`].forEach((o,s)=>{r?o===r&&(r=``):n===0&&o===`,`?(t.push(e.slice(i,s).trim()),i=s+1,a=!1):n===0&&/[\s>+~]/.test(o)?a=!0:(a&&=(i=s,!1),o===`"`||o===`'`?r=o:o===`(`||o===`[`?n+=1:(o===`)`||o===`]`)&&--n)}),t},n_=e=>{let t=t_(e).map(e=>/^[a-z][a-z\d-]*(?![\w-])/i.exec(e)?.[0].toLowerCase()??``);return t.every(Boolean)?[...new Set(t)]:void 0},r_=e=>{try{return document.createDocumentFragment().querySelector(e),!0}catch{return!1}},i_=({htmlSelector:e,fromBlockHTML:t,toBlockHTML:n})=>typeof e==`string`&&typeof t==`function`&&typeof n==`function`,a_=e=>Pg(Object.fromEntries(Object.entries(Mg(e)).filter(([e])=>!Qg(e.split(`.`).pop())))),o_=e=>{let t=e?.parentElement?.closest(`[data-component-path]`);return t?JSON.parse(t.dataset.componentPath):[]},s_=(e,t)=>{let n=e?.closest(`[role="textbox"]`);if(!n)return;let r=()=>{t(n.getAttribute(`aria-readonly`)===`true`)},i=new MutationObserver(r);return r(),i.observe(n,{attributes:!0,attributeFilter:[`aria-readonly`]}),i},c_=(e,t)=>{let n,r=window.requestAnimationFrame(()=>{n=s_(e,t)});return()=>{window.cancelAnimationFrame(r),n?.disconnect()}},l_=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`),u_=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/"/g,`\\"`),d_=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/[[\]]/g,`\\$&`),f_=[String.raw`(?:[^\][\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\[(?:[^\][\\!]|\\(?!!\[).|!(?!\[))*\])*`].join(``),p_=[String.raw`(?:[^"()\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\((?:[^)!]|!(?!\[))*\)|"(?:[^"!]|!(?!\[))*")*?`].join(``),m_=e=>String.raw`(?:[^${e}\\!]|\\(?!!\[).|!(?!\[))*`,h_=(e=``)=>[String.raw`!\[(?<alt${e}>${f_})\]\((?<src${e}>${p_})`,String.raw`(?:(?<![^\\]\s)\s+(?:"(?<title${e}>${m_(`"`)})"`,String.raw`|'(?<singleQuotedTitle${e}>${m_(`'`)})'))?\)`].join(``),g_=new RegExp(h_()),__=new RegExp(String.raw`\[${h_(`2`)}\](?:\((?<link>[^()]*(?:\([^)]*\)[^)]*|\([^)]*)?)\))`),v_=RegExp(`${g_.source}|${__.source}`),y_=String.raw`(?:\s+[^\s"'<>=/]+(?:="[^"]*")?)*\s*`,b_=String.raw`<img${y_}\/?>`,x_=({linked:e=!1}={})=>{let t=e?String.raw`(?:<a${y_}>${b_}<\/a>|${b_})`:b_;return[String.raw`<figure>(?<figureContent>${t})`,String.raw`<figcaption>(?<caption>(?:[^<\n]|<(?!\/fig(?:caption|ure)>))*)<\/figcaption>`,String.raw`<\/figure>`].join(``)},S_={ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:[`iframe`],ADD_ATTR:[`allow`,`allowfullscreen`,`referrerpolicy`,`sandbox`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`textarea`,`select`,`option`]},C_=[`color`,`background-color`,`font-style`,`font-weight`,`text-decoration`,`text-decoration-line`,`text-decoration-style`,`text-decoration-color`,`text-decoration-thickness`,`text-align`,`text-align-all`,`text-align-last`,`width`,`height`,`max-width`,`max-height`],w_=e=>{let{style:t}=e;Array.from(t).filter(e=>!C_.includes(e)).forEach(e=>{t.removeProperty(e)}),t.length||e.removeAttribute(`style`)},T_=[`allow-forms`,`allow-orientation-lock`,`allow-pointer-lock`,`allow-popups`,`allow-presentation`,`allow-same-origin`,`allow-scripts`,`allow-storage-access-by-user-activation`],E_=[`accelerometer`,`autoplay`,`clipboard-write`,`encrypted-media`,`fullscreen`,`gyroscope`,`picture-in-picture`,`web-share`],D_=e=>{let t=e.getAttribute(`allow`);if(t===null)return;let n=t.split(`;`).map(e=>e.trim()).filter(e=>E_.includes(e.split(/\s+/)[0].toLowerCase()));n.length?e.setAttribute(`allow`,n.join(`; `)):e.removeAttribute(`allow`)},O_=e=>{let t=e.getAttribute(`src`)?.trim()||``;if(!t.startsWith(`https://`))return!1;try{let e=new URL(t),n=typeof window<`u`&&window.location?window.location.origin:``;if(n&&e.origin===n)return!1}catch{return!1}let n=e.getAttribute(`sandbox`)||``,r=new Set(n.toLowerCase().split(/\s+/).filter(e=>T_.includes(e)));return r.add(`allow-scripts`),r.add(`allow-same-origin`),e.setAttribute(`sandbox`,Array.from(r).join(` `)),D_(e),!0},k_=(e,t={})=>{let n=mt(e,{...S_,...t,RETURN_DOM:!0});return Array.from(n.querySelectorAll(`iframe`)).forEach(e=>{O_(e)||e.remove()}),n.querySelectorAll(`[style]`).forEach(e=>{w_(e)}),n.innerHTML},A_=e=>({src:e.getAttribute(`src`)??``,alt:e.getAttribute(`alt`)??``,title:e.getAttribute(`title`)??``}),j_=({src:e=``,alt:t=``,title:n=``})=>{if(!e)return``;let r=document.createElement(`img`);return r.setAttribute(`src`,e),r.setAttribute(`alt`,t),n&&r.setAttribute(`title`,n),r},M_=({src:e=``,alt:t=``,title:n=``})=>e?`![${d_(t)}](${e}${n?` "${u_(n)}"`:``})`:``,N_=({src:e=``,alt:t=``,title:n=``})=>`<img src="${dm(e)}" alt="${dm(t)}" title="${dm(n)}">`,P_=(e,{linked:t=!1}={})=>{let[n,r,...i]=e.children,a=[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&!!e.textContent?.trim());if(!n||r?.localName!==`figcaption`||i.length||a)return;let o=t&&n.localName===`a`&&n.children.length===1&&!n.textContent?.trim()?n:void 0,s=o?o.children[0]:n;if(s.localName!==`img`)return;let c={...A_(s),caption:r.innerHTML.trim()};return t?{...c,link:o?.getAttribute(`href`)??``}:c},F_=(e,t,{linked:n=!1}={})=>{if(e.groups?.figureContent===void 0)return t(e);let{body:r}=new DOMParser().parseFromString(e[0],`text/html`);return{...P_(r.firstElementChild,{linked:n}),caption:e.groups.caption}},I_=({src:e=``,alt:t=``,title:n=``,link:r=``,caption:i=``})=>{let a=`<img src="${dm(e)}" alt="${dm(t)}"${n?` title="${dm(n)}"`:``}>`;return[`<figure>`,r?`<a href="${dm(r)}">${a}</a>`:a,`<figcaption>${String(i).replace(/\s*\n\s*/g,` `)}</figcaption>`,`</figure>`].join(``)},L_=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`),i=document.createElement(`template`);return i.innerHTML=k_(t),r.append(i.content),n.append(e,r),n},R_={image:`Image`,src:`Source`,alt:`Alt Text`,title:`Title`,link:`Link`,caption:`Caption`},z_=({groups:e})=>{let{src:t,alt:n,title:r=e?.singleQuotedTitle}=e??{};return{src:t,alt:n&&l_(n),title:r&&l_(r)}},B_=({groups:e})=>{let{src:t,alt:n,title:r,singleQuotedTitle:i,src2:a,alt2:o,title2:s,singleQuotedTitle2:c,link:l}=e??{};return{src:(t||a||``).trim(),alt:l_(n||o||``).trim(),title:l_(r||i||s||c||``).trim(),link:(l||``).trim()}},V_=({linked:e,getLabel:t})=>({id:e?`linked-image`:`image`,label:t(`image`),fields:[{name:`src`,label:t(`src`),widget:`image`},{name:`alt`,label:t(`alt`),required:!1},{name:`title`,label:t(`title`),required:!1},...e?[{name:`link`,label:t(`link`),required:!1}]:[],{name:`caption`,label:t(`caption`),required:!1}],pattern:new RegExp([x_({linked:e}),(e?v_:g_).source].join(`|`)),fromBlock:t=>F_(t,e?B_:z_,{linked:e}),toBlock:t=>{let n=e?t.link??``:``,r=M_(t);return r&&t.caption?I_({...t,link:n}):r&&n?`[${r}](${n})`:r},toPreview:t=>{let n=e?t.link??``:``;if(t.src&&t.caption)return I_({...t,link:n});let r=N_(t);return n?`<a href="${dm(n)}">${r}</a>`:r},htmlSelector:e?`figure, a:has(> img:only-child), img`:`figure, img`,fromBlockHTML:t=>{if(t.localName===`figure`)return P_(t,{linked:e});if(t.localName===`img`)return e?{...A_(t),link:``}:A_(t);if(!t.textContent?.trim())return{...A_(t.querySelector(`img`)),link:t.getAttribute(`href`)??``}},toBlockHTML:t=>{let n=e?t.link??``:``,r=j_(t);if(!r)return r;let i=r;return n&&(i=document.createElement(`a`),i.setAttribute(`href`,n),i.append(r)),t.caption?L_(i,t.caption):i}}),H_=e=>R_[e];V_({linked:!1,getLabel:H_}),V_({linked:!0,getLabel:H_});var U_=e=>Yd(`editor_components.${e}`),W_=()=>[!1,!0].map(e=>({...V_({linked:e,getLabel:U_}),icon:`image`,trigger:`button`,createMarkdown:()=>`![]()`})),G_=e=>{if(!e)return;if(Ef.has(e))return e;let t=e.replace(/^x-/,``);return t!==e&&Ef.has(t)?t:void 0},K_=e=>{let t=G_(e);if(t){let e=Ef.get(t),n=Wg(e)?Kg(e):e;return{...n,id:`x-${t}`,label:n.label??t}}return W_().find(({id:t})=>t===e)},q_=/^(.*?)<([^>]+)>(.*)$/,J_=new Map,Y_=(e,t)=>{if(e.length!==1)return!1;let[n]=e;return n.widget===t&&`root`in n&&n.root===!0},X_=e=>{let t=e.widget??`string`;return pp.includes(t)?Mh(e):gp.includes(t)?!!e.multiple:!1},Z_=e=>{let t=e.match(q_);if(!t)return{cleanKey:e};let[,n,r,i]=t;return i?{cleanKey:e}:{cleanKey:n||``,typeName:r}},Q_=({field:e,key:t,keyPathArray:n,segmentIndex:r,pendingExplicitType:i,valueMap:a})=>{let{cleanKey:s,typeName:c}=Z_(t),{widget:l=`text`}=e,u=c??i,d=o(s),f=s===`*`;if((d||f)&&gp.includes(l))return{field:X_(e)?e:void 0,explicitType:u};let{field:p}=e,{fields:m}=e,{types:h,typeKey:g=`type`}=e;if(p){let e=d||f?n[r+1]:void 0;return{field:!e||p.name===e||p.widget===`object`&&`fields`in p&&p.fields?.some(t=>t.name===e)?p:void 0,explicitType:u}}if(m&&(d||f))return{field:e,explicitType:u};if(m&&!d&&s!==``)return{field:m.find(({name:e})=>e===s),explicitType:u};if(h&&(d||f)){let e=u??a[[n.slice(0,r).join(`.`),s,g].join(`.`)];return{field:h.find(({name:t})=>t===e),explicitType:f?void 0:u}}if(h&&t!==g&&s!==g&&s!==``){let e=u??a[[n.slice(0,r).join(`.`),g].join(`.`)];return{field:h.find(({name:t})=>t===e)?.fields?.find(({name:e})=>e===s),explicitType:void 0}}return{field:void 0,explicitType:u}},$_=({collectionName:e,fileName:t,isIndexFile:n},r={})=>({collectionName:e,fileName:t,isIndexFile:n,...r}),ev=e=>{let{collectionName:t,fileName:n=void 0,componentName:r=void 0,valueMap:i={},keyPath:a,isIndexFile:o=!1}=e,s=[t,n??``,r??``,a,o?`1`:`0`].join(`|`);if(J_.has(s))return J_.get(s);let c=Vh(t),l=c&&n?Zh(c,n):void 0;if(!c||n&&c?._type!==`entry`&&!l){J_.set(s,void 0);return}let{fields:u=[]}=l??c,d=o?Zp(c):void 0,f=r?K_(r)?.fields??[]:d?.fields??u,p=a.split(`.`),m,h,g=!1;if(p.forEach((e,t)=>{if(t===0){let{cleanKey:t,typeName:n}=Z_(e);m=f.find(({name:e})=>e===t),!m&&d?.fields&&(m=u.find(({name:e})=>e===t)),n&&(h=n)}else if(m){let n=Q_({field:m,key:e,keyPathArray:p,segmentIndex:t,pendingExplicitType:h,valueMap:i});m=n.field,h=n.explicitType}m&&`types`in m&&(g=!0)}),h&&m&&`types`in m){let{types:e}=m;m=e.find(({name:e})=>e===h)}return g||J_.set(s,m),m},tv=({keyPath:e,valueMap:t={},...n})=>{let r=e.split(`.`);return r.map((e,i)=>{let a=r.slice(0,i).join(`.`),s=i?`${a}.${e}`:e;if(o(e)){let e=ev({...n,valueMap:t,keyPath:a}),{widget:r=`text`}=e??{};if(gp.includes(r))return;let{field:i}=e??{},{types:o,typeKey:c=`type`}=e??{};if(i)return`*.${i.name}`;let l=o?t[`${s}.${c}`]:void 0;return l?`*<${l}>`:`*`}let c=ev({...n,valueMap:t,keyPath:s}),{types:l,typeKey:u=`type`}=c??{},d=c?.widget===`object`&&l?t[`${s}.${u}`]:void 0;return d?`${e}<${d}>`:e}).filter(e=>e!==void 0).join(`.`)},nv=e=>{let t=e.widget??`string`;return up.includes(t)?`builtin`:Of.has(t)?`custom`:`unknown`},rv=({fieldConfig:{required:e=!0},locale:t})=>Array.isArray(e)?e.includes(t):!!e,iv=({valueMap:e,keyPath:t,isList:n,isCustomFieldType:r=!1})=>{let i=e[t];if(!n&&!r)return c(i)?zg(e,t)??i:i;let a=dg(e,t);return a.length?a.map(t=>e[t]).filter(e=>e!==void 0):r?i===void 0||c(i)?zg(e,t)??i:i:[]},av=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=e;return r??i?.find(({name:e})=>e===t[`${n}.${a}`])?.fields},ov=(e,t)=>{let n=e.find(({name:e})=>e===t);return n?n.fields??[]:void 0},sv=({value:e,fields:t,types:n,typeKey:r=`type`})=>t??(n?ov(n,e?.[r]):void 0)??[],cv=(e,t,n,r)=>{let{widget:i}=t,{field:a}=t,{fields:o,types:s,typeKey:c}=t;return i===`object`?n(e,sv({value:e,fields:o,types:s,typeKey:c})):i!==`list`||!Array.isArray(e)?e:e.map((e,t)=>a?r(e,a,t):n(e,sv({value:e,fields:o,types:s,typeKey:c}),t))},lv=e=>{let{field:t,fields:n=[],types:r=[]}=e;return[...t?[t]:[],...n,...r.flatMap(e=>e.fields??[])]},uv=(e,t,n,r=!1)=>{let{widget:i,field:a,fields:o,types:s}=e;if(i!==`object`&&i!==`list`)return;let c=i===`list`?`${t}.*`:t,l=(e,t)=>{Array.isArray(e)&&e.forEach(e=>n(e,`${t}.${e?.name}`))};i===`list`&&a&&n(a,c),l(o,c),Array.isArray(s)&&s.forEach(e=>l(e?.fields,r?`${c}<${e?.name}>`:c))},dv=(e,t,n)=>{let r=n?.get(e);if(r!==void 0)return r;let i=t(e)||lv(e).some(e=>dv(e,t,n));return n?.set(e,i),i},fv=t(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e,t,i){if(typeof t!=`string`)throw Error(`Input must be string`);for(var a=t.length,o=0,s,c,l=0;l<a;l+=1){if(s=t.charCodeAt(l),c=t[l],n(s)&&r(t.charCodeAt(l+1))&&(l+=1,c+=t[l]),o+=e(c),o===i)return t.slice(0,l+1);if(o>i)return t.slice(0,l-c.length+1)}return t}})),pv=t(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e){if(typeof e!=`string`)throw Error(`Input must be string`);for(var t=e.length,i=0,a=null,o=null,s=0;s<t;s++)a=e.charCodeAt(s),r(a)?o!=null&&n(o)?i+=1:i+=3:a<=127?i+=1:a>=128&&a<=2047?i+=2:a>=2048&&a<=65535&&(i+=3),o=a;return i}})),mv=t(((e,t)=>{var n=fv(),r=pv();t.exports=n.bind(null,r)})),hv=e(t(((e,t)=>{var n=mv(),r=/[\/\?<>\\:\*\|"]/g,i=/[\x00-\x1f\x80-\x9f]/g,a=/^\.+$/,o=/^(con|prn|aux|nul|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3])(\..*)?$/i;function s(e,t){for(var n=e.length;n>0&&(e[n-1]===`.`||e[n-1]===` `);)n--;return n===e.length?e:typeof t==`function`?e.slice(0,n)+t(e.slice(n),n,e):e.slice(0,n)+t}function c(e,t){if(typeof e!=`string`)throw Error(`Input must be string`);var c=e.replace(r,t).replace(i,t).replace(a,t).replace(o,t);return c=s(c,t),c=n(c,255),s(c,``).replace(o,``)}t.exports=function(e,t){var n=t&&t.replacement||``,r=c(e,n);return n===``?r:c(r,``)}}))(),1),gv=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[\da-f]{2})+/gi,e=>{try{return t(e)}catch{return e}})}},_v=e=>gv(e,decodeURI),vv=e=>gv(e,decodeURIComponent),yv=e=>{try{return new URL(e).href}catch{return encodeURI(_v(e).toWellFormed())}},bv=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),xv=(e,t=encodeURIComponent)=>e.split(`/`).map(e=>t(e)).join(`/`),Sv=e=>e.replace(/\/+$/,``),Cv=(e,t)=>RegExp(`^${e.split(`/`).map(t).join(`\\/`)}(?=\\/|$)`),wv=e=>{let t=e.startsWith(`@`);return t&&(e=e.slice(1)),e=xv(e,bv),t?`@${e}`:e},Tv=(e,t,{hasExtension:n=!0}={})=>{let r=e.toLowerCase();if(!t.some(e=>e.toLowerCase()===r))return e;let{filename:i,extension:a}=n?Sp(e):{filename:e,extension:void 0},o=a?`\\.${a}`:``,s=RegExp(`^${hf(i)}-(?<num>\\d+)${o}$`,`i`),c=0;return t.forEach(e=>{let t=e.match(s);t&&(c=Math.max(c,Number(t.groups.num)))}),`${i}-${c+1}${a?`.${a}`:``}`},Ev=e=>(0,hv.default)(e.normalize().replace(/[\s\u00A0\u202F]+/g,` `)),Dv=[[`jpg`,`jpeg`,`jpe`,`jfif`],[`tif`,`tiff`],[`htm`,`html`],[`yml`,`yaml`],[`md`,`markdown`],[`mpg`,`mpeg`],[`mid`,`midi`],[`aif`,`aiff`]],Ov=(e,t)=>{let n=e?.toLowerCase()??``,r=t?.toLowerCase()??``;return n===r||Dv.some(e=>e.includes(n)&&e.includes(r))},kv=e=>e.filter(Boolean).join(`/`),Av=e=>Sp(e).dirname??``,jv=e=>e.slice(e.lastIndexOf(`/`)+1),Mv=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,Nv=e=>e.split(`/`).filter(e=>e!==`.`&&e!==`..`).join(`/`),Pv=e=>{let t=[],n=!1;return e.split(`/`).forEach(e=>{if(e){if(!n||e!==`.`&&e!==`..`)n||=e!==`.`&&e!==`..`,t.push(e);else if(e===`..`){let n=t.at(-1);n!==void 0&&n!==`.`&&n!==`..`?t.pop():t.push(e)}}}),t.join(`/`)},Fv=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,Iv=e=>typeof e==`string`?new TextEncoder().encode(e).length:e.size,Lv=async e=>{let t=await e.arrayBuffer();return uf(new Blob([`blob ${t.byteLength}\0`,t]))},Rv=new WeakMap,zv=e=>typeof e==`string`?Lv(Fv(e)):Bm(Rv,e,()=>Lv(e)),Bv=(e,t)=>t&&e[t]?t:Object.keys(e)[0],Vv=(e,{locale:t,defaultLocale:n}={})=>(t?e.locales[t]:void 0)??e.locales[Bv(e.locales,n)],Hv=(e,{includePrevious:t=!1}={})=>[...new Set([...Object.values(e.locales).map(({path:e})=>e),...t&&e.workflow?.previousPaths||[]])],Uv=(e,{basePath:t,fullPathRegEx:n}={})=>{let r=n?e.match(n)?.groups?.subPath:void 0;if(r!==void 0)return Av(r);let i=K(t??``);return Av(Wm(i)?Zm(e,i):Mv(e,i))},Wv=Vm(()=>Kh.current,e=>{let t=new Map,n=[];return e.forEach(e=>{e.filePathMap?[...new Set(Object.values(e.filePathMap))].forEach(n=>{Pm(t,n,()=>[]).push(e)}):n.push([e,Vh(e.collectionName)?._file?.fullPathRegEx])}),{fileMap:t,regexFolders:n}}),Gv=e=>{let{fileMap:t,regexFolders:n}=Wv();return t.get(e)||n.filter(([,t])=>t?.test(e)).map(([e])=>e).sort((e,t)=>(t.folderPath??``).localeCompare(e.folderPath??``))},Kv=/^(?:0|[1-9]\d*)$/,qv=/^(.+)\.\d+\.([^.]+)$/,Jv=e=>{if(e.widget!==`list`||!(`fields`in e||`types`in e))return;let{map_key_field:t}=e;return typeof t==`string`&&t?t:void 0},Yv=e=>Kv.test(e)&&Number(e)<2**32-1,Xv=(e,t)=>!c(e)||!Object.values(e).every(e=>e===null||c(e))?e:Object.entries(e).map(([e,n])=>({...n,[t]:e})),Zv=(e,t)=>Array.isArray(e)?Object.fromEntries(e.map(e=>{let{[t]:n=``,...r}=c(e)?e:{};return[String(n),r]})):e,Qv=new WeakMap,$v=e=>dv(e,e=>!!Jv(e),Qv),ey=(e,t,n)=>{if(!$v(t))return e;let r=Jv(t),i=r&&n?Xv(e,r):e,a=cv(i,t,(e,t)=>ty(e,t,n),(e,t)=>ey(e,t,n)),o=Array.isArray(a)&&a.every((e,t)=>e===i[t])?i:a;return r&&!n?Zv(o,r):o},ty=(e,t,n)=>{if(!c(e))return e;let r=e;return t.forEach(t=>{let{name:i}=t;if(!Object.hasOwn(e,i))return;let a=ey(e[i],t,n);a!==e[i]&&(r===e&&(r={...e}),r[i]=a)}),r},ny=e=>{if(e.componentName)return;let[,t,n]=e.keyPath.match(qv)??[];if(!t)return;let r=ev({...e,keyPath:t});if(r&&Jv(r)===n)return{listKeyPath:t,keyField:n}},ry=({valueMap:e,listKeyPath:t,keyField:n})=>{let r=`${t}.`,i=`.${n}`;return Object.keys(e).filter(e=>e.startsWith(r)&&e.endsWith(i)&&o(e.slice(r.length,-i.length)))},iy=({valueMap:e,keyPath:t,listKeyPath:n,keyField:r,value:i})=>ry({valueMap:e,listKeyPath:n,keyField:r}).some(n=>n!==t&&e[n]!==void 0&&e[n]!==null&&String(e[n])===String(i)),ay=Symbol.for(`yaml.alias`),oy=Symbol.for(`yaml.document`),sy=Symbol.for(`yaml.map`),cy=Symbol.for(`yaml.pair`),ly=Symbol.for(`yaml.scalar`),uy=Symbol.for(`yaml.seq`),dy=Symbol.for(`yaml.node.type`),fy=e=>!!e&&typeof e==`object`&&e[dy]===ay,py=e=>!!e&&typeof e==`object`&&e[dy]===oy,my=e=>!!e&&typeof e==`object`&&e[dy]===sy,J=e=>!!e&&typeof e==`object`&&e[dy]===cy,Y=e=>!!e&&typeof e==`object`&&e[dy]===ly,hy=e=>!!e&&typeof e==`object`&&e[dy]===uy;function X(e){if(e&&typeof e==`object`)switch(e[dy]){case sy:case uy:return!0}return!1}function Z(e){if(e&&typeof e==`object`)switch(e[dy]){case ay:case sy:case ly:case uy:return!0}return!1}var gy=e=>(Y(e)||X(e))&&!!e.anchor,_y=Symbol(`break visit`),vy=Symbol(`skip children`),yy=Symbol(`remove node`);function by(e,t){let n=Sy(t);py(e)?xy(null,e.contents,n,Object.freeze([e]))===yy&&(e.contents=null):xy(null,e,n,Object.freeze([]))}by.BREAK=_y,by.SKIP=vy,by.REMOVE=yy;function xy(e,t,n,r){let i=Cy(e,t,n,r);if(Z(i)||J(i))return wy(e,r,i),xy(e,i,n,r);if(typeof i!=`symbol`){if(X(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=xy(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===_y)return _y;else i===yy&&(t.items.splice(e,1),--e)}}else if(J(t)){r=Object.freeze(r.concat(t));let e=xy(`key`,t.key,n,r);if(e===_y)return _y;e===yy&&(t.key=null);let i=xy(`value`,t.value,n,r);if(i===_y)return _y;i===yy&&(t.value=null)}}return i}function Sy(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Cy(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(my(t))return n.Map?.(e,t,r);if(hy(t))return n.Seq?.(e,t,r);if(J(t))return n.Pair?.(e,t,r);if(Y(t))return n.Scalar?.(e,t,r);if(fy(t))return n.Alias?.(e,t,r)}function wy(e,t,n){let r=t[t.length-1];if(X(r))r.items[e]=n;else if(J(r))e===`key`?r.key=n:r.value=n;else if(py(r))r.contents=n;else{let e=fy(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Ty={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Ey=e=>e.replace(/[!,[\]{}]/g,e=>Ty[e]),Dy=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ey(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Z(e.contents)){let t={};by(e.contents,(e,n)=>{Z(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(`
`)}};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 instanceof Map?o[sy]:Symbol.iterator in Object(e)?o[uy]:o[sy]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Q(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Vy(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return By(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Hy=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Uy=class extends Py{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Z(t)||J(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Hy(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(X(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Vy(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(X(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Y(i)?i.value:i:X(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!J(t))return!1;let n=t.value;return n==null||e&&Y(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return X(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(X(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Vy(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Wy=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Gy(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ky=(e,t,n)=>e.endsWith(`
`)?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=Number(e.value);return isFinite(t)?t.toExponential():Lb(e)}},Bb={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)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:Lb},Vb=e=>typeof e==`bigint`||Number.isInteger(e),Hb=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Ub(e,t,n){let{value:r}=e;return Vb(r)&&r>=0?n+r.toString(t):Lb(e)}var Wb={identify:e=>Vb(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Hb(e,2,8,n),stringify:e=>Ub(e,8,`0o`)},Gb={identify:Vb,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Hb(e,0,10,n),stringify:Lb},Kb={identify:e=>Vb(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Hb(e,2,16,n),stringify:e=>Ub(e,16,`0x`)},qb=[Ab,Nb,Pb,Fb,Ib,Wb,Gb,Kb,Rb,zb,Bb];function Jb(e){return typeof e==`bigint`||Number.isInteger(e)}var Yb=({value:e})=>JSON.stringify(e),Xb=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Yb},{identify:e=>e==null,createNode:()=>new Q(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Yb},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Yb},{identify:Jb,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Jb(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Yb}],Zb=[Ab,Nb].concat(Xb,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),Qb={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=Q.BLOCK_LITERAL,t!==Q.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===Q.BLOCK_LITERAL?`
`:` `)}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.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Sb(e,null,n));return i}};_x.tag=`tag:yaml.org,2002:set`;var vx={collection:`map`,identify:e=>e instanceof Set,nodeClass:_x,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>_x.from(e,t,n),resolve(e,t){if(my(e)){if(e.hasAllNullValues(!0))return Object.assign(new _x,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function yx(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function bx(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Lb(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var xx={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>yx(e,n),stringify:bx},Sx={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>yx(e,!1),stringify:bx},Cx={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Cx.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=yx(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},wx=[Ab,Nb,Pb,Fb,ax,ox,px,mx,hx,gx,sx,cx,lx,Qb,hb,rx,tx,vx,xx,Sx,Cx],Tx=new Map([[`core`,qb],[`failsafe`,[Ab,Nb,Pb]],[`json`,Zb],[`yaml11`,wx],[`yaml-1.1`,wx]]),Ex={binary:Qb,bool:Ib,float:Bb,floatExp:zb,floatNaN:Rb,floatTime:Sx,int:Gb,intHex:Kb,intOct:Wb,intTime:xx,map:Ab,merge:hb,null:Fb,omap:rx,pairs:tx,seq:Nb,set:vx,timestamp:Cx},Dx={"tag:yaml.org,2002:binary":Qb,"tag:yaml.org,2002:merge":hb,"tag:yaml.org,2002:omap":rx,"tag:yaml.org,2002:pairs":tx,"tag:yaml.org,2002:set":vx,"tag:yaml.org,2002:timestamp":Cx};function Ox(e,t,n){let r=Tx.get(t);if(r&&!e)return n&&!r.includes(hb)?r.concat(hb):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(Tx.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(hb)),i.reduce((e,t)=>{let n=typeof t==`string`?Ex[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(Ex).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var kx=(e,t)=>e.key<t.key?-1:+(e.key>t.key),Ax=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Ox(e,`compat`):e?Ox(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?Dx:{},this.tags=Ox(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,sy,{value:Ab}),Object.defineProperty(this,ly,{value:Pb}),Object.defineProperty(this,uy,{value:Nb}),this.sortMapEntries=typeof a==`function`?a:a===!0?kx:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function jx(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=cb(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(Gy(t,``))}let o=!1,s=null;if(e.contents){if(Z(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(Gy(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=db(e.contents,i,()=>s=null,t);s&&(c+=Ky(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(db(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
`)?(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.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:FS(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=RS(LS(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
`)+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.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=RS(LS(t));BS(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
`)+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=>Number(e),stringify:({value:e})=>{let{value:t,source:n}=e;return mC(n,t,QS)?n:rC(t)}},_C=new Map,vC=/\d{16}/,yC=e=>vC.test(e),bC=(e,t)=>{iC(_C,e,t)},xC=e=>{let t=Number(e);return Number.isSafeInteger(t)||bC(t,String(e)),t},SC=e=>typeof e==`bigint`?xC(e):Number.isInteger(e)&&!Number.isSafeInteger(e)?(bC(e,String(BigInt(e))),e):((Array.isArray(e)||c(e))&&Object.entries(e).forEach(([t,n])=>{e[t]=SC(n)}),e),CC=(e,t,n)=>{let r=n?.source;return typeof t==`number`&&!Number.isSafeInteger(t)&&typeof r==`string`&&eC.test(r)?xC(BigInt(r)):t},wC=e=>typeof e==`number`&&!Number.isSafeInteger(e)?_C.get(e)??void 0:void 0,TC=()=>_C.size>0,EC=e=>{let t=wC(e);return t===void 0?Array.isArray(e)?e.map(EC):Tg(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,EC(t)])):e:BigInt(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 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,rawContent:n,entries:r,errors:i})=>{let{path:a,meta:o={}}=t;Array.isArray(n)?(cT.set(a,n),n.forEach((t,n)=>{let i=lT({collection:e,item:t,index:n,path:a,meta:o});i&&r.push(i)})):(cT.set(a,null),i.push(Error(`${a} could not be parsed, as it doesn’t contain an array.`)))},dT=async({file:e,entries:t,entryMap:n,errors:r,parsedFileMap:i})=>{let a=await Qw(e,r,i),{path:o,meta:s={},folder:{collectionName:c,fileName:l}}=e,{collection:u,collectionFile:d}=Qh(c,l)??{},f=!d&&u?._type===`entry`&&u._file.arrayFile;if(!a){f&&cT.set(o,null);return}if(!u)return;if(f){uT({collection:u,file:e,rawContent:a,entries:t,errors:r});return}let{fields:p=[],_file:{fullPathRegEx:m,subPath:h,extension:g},_i18n:{i18nEnabled:_,allLocales:v,defaultLocale:y,structureMap:b,canonicalSlug:{key:x}}}=d??u,S=!d&&Qp(u,o)&&Zp(u)?.fields||p,C=b.i18nSingleFileDefaultRoot?eT(a,v,y):a;if(!C)return;let ee=wh(b),te=nT(C,S,ee);if(!te||rT(o,l,u,h,g))return;let ne=Th(b),{subPath:w,locale:re}=iT({file:e,fileName:l,fullPathRegEx:m,defaultLocale:y,isMultiFileStructure:ne});if(!w||ne&&!re)return;let ie={id:``,slug:``,subPath:w,locales:{},...s},ae={entry:ie,rawContent:te,path:o,fileName:l,subPath:w,subPathTemplate:h};if(!_)aT(ae);else if(ee)oT({...ae,allLocales:v});else if(sT({...ae,locale:re,defaultLocale:y,collectionName:c,canonicalSlugKey:x,entryMap:n}))return;t.push(ie)},fT=async(e,{parsedFileMap:t}={})=>{let n=[],r=new Map,i=[];return await Hw(e,async e=>{try{await dT({file:e,entries:n,entryMap:r,errors:i,parsedFileMap:t})}catch(e){console.error(e),i.push(e)}}),{entries:n.filter(e=>(e.id=of(),!!e.slug&&!!Object.keys(e.locales).length)),errors:i}},pT=[`admin`,`cms`],mT=[``,`static`,`public`],hT=e=>K(e).normalize().toLowerCase(),gT=e=>pT.includes(hT(e)),_T=(e,t)=>{if(typeof e!=`string`||typeof t!=`string`)return;let n=K(e).replace(/^\.(?:\/|$)/,``),r=K(t);if(!(Up(n)||Up(r)||/^[.@]/.test(r)))return!r||n===r?r?``:n:n.endsWith(`/${r}`)?n.slice(0,-r.length-1):void 0},vT=e=>{let t=e.split(`/`).filter(Boolean);t.at(-1)?.includes(`.`)&&t.pop();try{let e=t.map(decodeURIComponent);return e.map((t,n)=>e.slice(n).join(`/`))}catch{return[]}},yT,bT=()=>{let{media_folder:e,public_folder:t}=Xf.current??{},n=globalThis.location?.pathname??``,r=JSON.stringify([e,t,n]);if(yT?.key!==r){let i=_T(e,t),a=i===void 0?mT:[...mT,i],o=[...pT,...vT(n)];yT={key:r,paths:a.flatMap(e=>o.map(t=>hT(`${e}/${t}`)))}}return yT.paths},xT=e=>{let t=hT(e);return bT().some(e=>t===e||t.startsWith(`${e}/`))},ST=/^(?:index\.html|config\.(?:ya?ml|toml|json))$/,CT=(e,t)=>{if(!ST.test(hT(t)))return!1;let n=[...pT,...vT(globalThis.location?.pathname??``).slice(-1).map(hT)];return hT(e).split(`/`).some(e=>n.includes(e))},wT=e=>{let t=e.lastIndexOf(`/`),n=e.slice(0,Math.max(t,0));return xT(n)||CT(n,e.slice(t+1))},TT=e=>{if(e.some(wT))throw Error(`Cannot change a file in a folder the CMS is served from`)},ET=q(),DT=q(),OT=async(e,t)=>{let n={};if(e)try{n=await t(e)}catch{}ET.current=n.canPush===!1?e:void 0,DT.current=n.canMerge===!1?e:void 0},kT=q(),AT=Uf(()=>!!kT.current),jT=q(!1),MT=`entry_already_published`,NT=e=>e?.message===MT,PT=e=>e?`${e.owner}/${e.repo}`:``,FT=(e,t)=>{let{repoURL:n,owner:r,repo:i}=e??{};return!t||!n?``:n.slice(0,-`${r}/${i}`.length)+PT(t)},IT=q(),LT=async e=>Gf(IT,{repo:e},!1),RT=q([]),zT=Uf(()=>RT.current.find(({collectionName:e,componentName:t,typedKeyPath:n,internalPath:r})=>e===void 0&&t===void 0&&n===void 0&&r!==void 0)),BT=q(),VT=Uf(()=>{let{current:e}=BT;return e?.internalPath===void 0?zT.current:e}),HT=e=>{let t=`typedKeyPath`in e?e.typedKeyPath?.match(/[^:]+$/)?.[0]:e.typedKeyPath;return RT.current.find(n=>(`typedKeyPath`in e?n.typedKeyPath===t:!n.typedKeyPath)?e.componentName?n.componentName===(G_(e.componentName)??e.componentName):n.collectionName===e.collectionName&&n.fileName===e.fileName&&!!n.isIndexFile==!!e.isIndexFile:!1)},UT=({internalPath:e,internalSubPath:t,localeFolderNames:n})=>{let r=n?.length?`(?:(?:${n.map(hf).join(`|`)})\\/)?`:``,i=e;if(Wm(i))return RegExp(`^${Ym(i,r)}`);if(i)return RegExp(`^${r}${hf(i)}\\/`);let a=t,[o]=a.split(`/`);if(!o||o===`..`||Up(o))return/(?!)/;let s=qp(a,`[^/]+`);return RegExp(`^${r}${s}\\/`)},WT=Vm(()=>RT.current,e=>{let t=[],n=[];return e.forEach(e=>{let{internalPath:r,entryRelative:i}=e;if(r!==void 0){if(i)n.push({folder:e,regex:UT(e)});else{let n=qp(r,`.+?`);t.push({folder:e,regexSub:RegExp(`^${n}${r?`(?=\\/|$)`:`$`}`),regexExact:RegExp(`^${n}$`)})}}}),{items:t,entryRelative:n}}),GT=(e,{matchSubFolders:t=!0}={})=>{let{filename:n,dirname:r}=Sp(e);if(n.startsWith(`+`))return[];let{items:i,entryRelative:a}=WT(),o=r??``;return[...a.filter(({regex:t})=>t.test(e)).map(({folder:e})=>e),...i.filter(({regexSub:e,regexExact:n})=>(t?e:n).test(o)).map(({folder:e})=>e)].sort((e,t)=>t.internalPath.localeCompare(e.internalPath))},KT=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:a,internalSubPath:o,publicPath:s})=>JSON.stringify([e,t,n,r,i,a,o,s]),qT=e=>!!e&&!e.entryRelative&&!e.hasTemplateTags&&!e.readonly,JT=Uf(()=>AT.current||!!ET.current),YT=Vm(()=>RT.current,e=>new Set(e.filter(({readonly:e,entryRelative:t})=>e&&!t).map(({internalPath:e})=>e))),XT=e=>e.some(({folder:e,path:t})=>!!e?.readonly||!e?.entryRelative&&YT().has(e?.internalPath)||wT(t)),ZT=q([]),QT=Uf(()=>ZT.current.some(({workflow:e})=>e)?ZT.current.filter(({workflow:e})=>!e):ZT.current),$T=q([]),eE=Uf(()=>new Set($T.current.map(e=>e.path))),tE=q(),nE=Uf(()=>$T.current.length?[...$T.current]:tE.current?[tE.current]:[]),rE=q(),iE=q({folder:void 0,files:[]}),aE=q(),oE=q(),sE=/^(?:.+\/)?(\.git(?:attributes|ignore|keep))$/,cE=q([]),lE={"application/andrew-inset":[`ez`],"application/appinstaller":[`appinstaller`],"application/applixware":[`aw`],"application/appx":[`appx`],"application/appxbundle":[`appxbundle`],"application/atom+xml":[`atom`],"application/atomcat+xml":[`atomcat`],"application/atomdeleted+xml":[`atomdeleted`],"application/atomsvc+xml":[`atomsvc`],"application/atsc-dwd+xml":[`dwd`],"application/atsc-held+xml":[`held`],"application/atsc-rsat+xml":[`rsat`],"application/automationml-aml+xml":[`aml`],"application/automationml-amlx+zip":[`amlx`],"application/bdoc":[`bdoc`],"application/calendar+xml":[`xcs`],"application/ccxml+xml":[`ccxml`],"application/cdfx+xml":[`cdfx`],"application/cdmi-capability":[`cdmia`],"application/cdmi-container":[`cdmic`],"application/cdmi-domain":[`cdmid`],"application/cdmi-object":[`cdmio`],"application/cdmi-queue":[`cdmiq`],"application/cpl+xml":[`cpl`],"application/cu-seeme":[`cu`],"application/cwl":[`cwl`],"application/dash+xml":[`mpd`],"application/dash-patch+xml":[`mpp`],"application/davmount+xml":[`davmount`],"application/dicom":[`dcm`],"application/docbook+xml":[`dbk`],"application/dssc+der":[`dssc`],"application/dssc+xml":[`xdssc`],"application/ecmascript":[`ecma`],"application/emma+xml":[`emma`],"application/emotionml+xml":[`emotionml`],"application/epub+zip":[`epub`],"application/exi":[`exi`],"application/express":[`exp`],"application/fdf":[`fdf`],"application/fdt+xml":[`fdt`],"application/font-tdpfr":[`pfr`],"application/geo+json":[`geojson`],"application/gml+xml":[`gml`],"application/gpx+xml":[`gpx`],"application/gxf":[`gxf`],"application/gzip":[`gz`],"application/hjson":[`hjson`],"application/hyperstudio":[`stk`],"application/inkml+xml":[`ink`,`inkml`],"application/ipfix":[`ipfix`],"application/its+xml":[`its`],"application/java-archive":[`jar`,`war`,`ear`],"application/java-serialized-object":[`ser`],"application/java-vm":[`class`],"application/javascript":[`*js`],"application/json":[`json`,`map`],"application/json5":[`json5`],"application/jsonml+json":[`jsonml`],"application/ld+json":[`jsonld`],"application/lgr+xml":[`lgr`],"application/lost+xml":[`lostxml`],"application/mac-binhex40":[`hqx`],"application/mac-compactpro":[`cpt`],"application/mads+xml":[`mads`],"application/manifest+json":[`webmanifest`],"application/marc":[`mrc`],"application/marcxml+xml":[`mrcx`],"application/mathematica":[`ma`,`nb`,`mb`],"application/mathml+xml":[`mathml`],"application/mbox":[`mbox`],"application/media-policy-dataset+xml":[`mpf`],"application/mediaservercontrol+xml":[`mscml`],"application/metalink+xml":[`metalink`],"application/metalink4+xml":[`meta4`],"application/mets+xml":[`mets`],"application/mmt-aei+xml":[`maei`],"application/mmt-usd+xml":[`musd`],"application/mods+xml":[`mods`],"application/mp21":[`m21`,`mp21`],"application/mp4":[`*mp4`,`*mpg4`,`mp4s`,`m4p`],"application/msix":[`msix`],"application/msixbundle":[`msixbundle`],"application/msword":[`doc`,`dot`],"application/mxf":[`mxf`],"application/n-quads":[`nq`],"application/n-triples":[`nt`],"application/node":[`cjs`],"application/octet-stream":[`bin`,`dms`,`lrf`,`mar`,`so`,`dist`,`distz`,`pkg`,`bpk`,`dump`,`elc`,`deploy`,`exe`,`dll`,`deb`,`dmg`,`iso`,`img`,`msi`,`msp`,`msm`,`buffer`],"application/oda":[`oda`],"application/oebps-package+xml":[`opf`],"application/ogg":[`ogx`],"application/omdoc+xml":[`omdoc`],"application/onenote":[`onetoc`,`onetoc2`,`onetmp`,`onepkg`,`one`,`onea`],"application/oxps":[`oxps`],"application/p2p-overlay+xml":[`relo`],"application/patch-ops-error+xml":[`xer`],"application/pdf":[`pdf`],"application/pgp-encrypted":[`pgp`],"application/pgp-keys":[`asc`],"application/pgp-signature":[`sig`,`*asc`],"application/pics-rules":[`prf`],"application/pkcs10":[`p10`],"application/pkcs7-mime":[`p7m`,`p7c`],"application/pkcs7-signature":[`p7s`],"application/pkcs8":[`p8`],"application/pkix-attr-cert":[`ac`],"application/pkix-cert":[`cer`],"application/pkix-crl":[`crl`],"application/pkix-pkipath":[`pkipath`],"application/pkixcmp":[`pki`],"application/pls+xml":[`pls`],"application/postscript":[`ai`,`eps`,`ps`],"application/provenance+xml":[`provx`],"application/pskc+xml":[`pskcxml`],"application/raml+yaml":[`raml`],"application/rdf+xml":[`rdf`,`owl`],"application/reginfo+xml":[`rif`],"application/relax-ng-compact-syntax":[`rnc`],"application/resource-lists+xml":[`rl`],"application/resource-lists-diff+xml":[`rld`],"application/rls-services+xml":[`rs`],"application/route-apd+xml":[`rapd`],"application/route-s-tsid+xml":[`sls`],"application/route-usd+xml":[`rusd`],"application/rpki-ghostbusters":[`gbr`],"application/rpki-manifest":[`mft`],"application/rpki-roa":[`roa`],"application/rsd+xml":[`rsd`],"application/rss+xml":[`rss`],"application/rtf":[`rtf`],"application/sbml+xml":[`sbml`],"application/scvp-cv-request":[`scq`],"application/scvp-cv-response":[`scs`],"application/scvp-vp-request":[`spq`],"application/scvp-vp-response":[`spp`],"application/sdp":[`sdp`],"application/senml+xml":[`senmlx`],"application/sensml+xml":[`sensmlx`],"application/set-payment-initiation":[`setpay`],"application/set-registration-initiation":[`setreg`],"application/shf+xml":[`shf`],"application/sieve":[`siv`,`sieve`],"application/smil+xml":[`smi`,`smil`],"application/sparql-query":[`rq`],"application/sparql-results+xml":[`srx`],"application/sql":[`sql`],"application/srgs":[`gram`],"application/srgs+xml":[`grxml`],"application/sru+xml":[`sru`],"application/ssdl+xml":[`ssdl`],"application/ssml+xml":[`ssml`],"application/swid+xml":[`swidtag`],"application/tei+xml":[`tei`,`teicorpus`],"application/thraud+xml":[`tfi`],"application/timestamped-data":[`tsd`],"application/toml":[`toml`],"application/trig":[`trig`],"application/ttml+xml":[`ttml`],"application/ubjson":[`ubj`],"application/urc-ressheet+xml":[`rsheet`],"application/urc-targetdesc+xml":[`td`],"application/voicexml+xml":[`vxml`],"application/wasm":[`wasm`],"application/watcherinfo+xml":[`wif`],"application/widget":[`wgt`],"application/winhlp":[`hlp`],"application/wsdl+xml":[`wsdl`],"application/wspolicy+xml":[`wspolicy`],"application/xaml+xml":[`xaml`],"application/xcap-att+xml":[`xav`],"application/xcap-caps+xml":[`xca`],"application/xcap-diff+xml":[`xdf`],"application/xcap-el+xml":[`xel`],"application/xcap-ns+xml":[`xns`],"application/xenc+xml":[`xenc`],"application/xfdf":[`xfdf`],"application/xhtml+xml":[`xhtml`,`xht`],"application/xliff+xml":[`xlf`],"application/xml":[`xml`,`xsl`,`xsd`,`rng`],"application/xml-dtd":[`dtd`],"application/xop+xml":[`xop`],"application/xproc+xml":[`xpl`],"application/xslt+xml":[`*xsl`,`xslt`],"application/xspf+xml":[`xspf`],"application/xv+xml":[`mxml`,`xhvml`,`xvml`,`xvm`],"application/yang":[`yang`],"application/yin+xml":[`yin`],"application/zip":[`zip`],"application/zip+dotlottie":[`lottie`],"audio/3gpp":[`*3gpp`],"audio/aac":[`adts`,`aac`],"audio/adpcm":[`adp`],"audio/amr":[`amr`],"audio/basic":[`au`,`snd`],"audio/midi":[`mid`,`midi`,`kar`,`rmi`],"audio/mobile-xmf":[`mxmf`],"audio/mp3":[`*mp3`],"audio/mp4":[`m4a`,`mp4a`,`m4b`],"audio/mpeg":[`mpga`,`mp2`,`mp2a`,`mp3`,`m2a`,`m3a`],"audio/ogg":[`oga`,`ogg`,`spx`,`opus`],"audio/s3m":[`s3m`],"audio/silk":[`sil`],"audio/wav":[`wav`],"audio/wave":[`*wav`],"audio/webm":[`weba`],"audio/xm":[`xm`],"font/collection":[`ttc`],"font/otf":[`otf`],"font/ttf":[`ttf`],"font/woff":[`woff`],"font/woff2":[`woff2`],"image/aces":[`exr`],"image/apng":[`apng`],"image/avci":[`avci`],"image/avcs":[`avcs`],"image/avif":[`avif`],"image/bmp":[`bmp`,`dib`],"image/cgm":[`cgm`],"image/dicom-rle":[`drle`],"image/dpx":[`dpx`],"image/emf":[`emf`],"image/fits":[`fits`],"image/g3fax":[`g3`],"image/gif":[`gif`],"image/heic":[`heic`],"image/heic-sequence":[`heics`],"image/heif":[`heif`],"image/heif-sequence":[`heifs`],"image/hej2k":[`hej2`],"image/ief":[`ief`],"image/jaii":[`jaii`],"image/jais":[`jais`],"image/jls":[`jls`],"image/jp2":[`jp2`,`jpg2`],"image/jpeg":[`jpg`,`jpeg`,`jpe`],"image/jph":[`jph`],"image/jphc":[`jhc`],"image/jpm":[`jpm`,`jpgm`],"image/jpx":[`jpx`,`jpf`],"image/jxl":[`jxl`],"image/jxr":[`jxr`],"image/jxra":[`jxra`],"image/jxrs":[`jxrs`],"image/jxs":[`jxs`],"image/jxsc":[`jxsc`],"image/jxsi":[`jxsi`],"image/jxss":[`jxss`],"image/ktx":[`ktx`],"image/ktx2":[`ktx2`],"image/pjpeg":[`jfif`],"image/png":[`png`],"image/sgi":[`sgi`],"image/svg+xml":[`svg`,`svgz`],"image/t38":[`t38`],"image/tiff":[`tif`,`tiff`],"image/tiff-fx":[`tfx`],"image/webp":[`webp`],"image/wmf":[`wmf`],"message/disposition-notification":[`disposition-notification`],"message/global":[`u8msg`],"message/global-delivery-status":[`u8dsn`],"message/global-disposition-notification":[`u8mdn`],"message/global-headers":[`u8hdr`],"message/rfc822":[`eml`,`mime`,`mht`,`mhtml`],"model/3mf":[`3mf`],"model/gltf+json":[`gltf`],"model/gltf-binary":[`glb`],"model/iges":[`igs`,`iges`],"model/jt":[`jt`],"model/mesh":[`msh`,`mesh`,`silo`],"model/mtl":[`mtl`],"model/obj":[`obj`],"model/prc":[`prc`],"model/step":[`step`,`stp`,`stpnc`,`p21`,`210`],"model/step+xml":[`stpx`],"model/step+zip":[`stpz`],"model/step-xml+zip":[`stpxz`],"model/stl":[`stl`],"model/u3d":[`u3d`],"model/vrml":[`wrl`,`vrml`],"model/x3d+binary":[`*x3db`,`x3dbz`],"model/x3d+fastinfoset":[`x3db`],"model/x3d+vrml":[`*x3dv`,`x3dvz`],"model/x3d+xml":[`x3d`,`x3dz`],"model/x3d-vrml":[`x3dv`],"text/cache-manifest":[`appcache`,`manifest`],"text/calendar":[`ics`,`ifb`],"text/coffeescript":[`coffee`,`litcoffee`],"text/css":[`css`],"text/csv":[`csv`],"text/html":[`html`,`htm`,`shtml`],"text/jade":[`jade`],"text/javascript":[`js`,`mjs`],"text/jsx":[`jsx`],"text/less":[`less`],"text/markdown":[`md`,`markdown`],"text/mathml":[`mml`],"text/mdx":[`mdx`],"text/n3":[`n3`],"text/plain":[`txt`,`text`,`conf`,`def`,`list`,`log`,`in`,`ini`],"text/richtext":[`rtx`],"text/rtf":[`*rtf`],"text/sgml":[`sgml`,`sgm`],"text/shex":[`shex`],"text/slim":[`slim`,`slm`],"text/spdx":[`spdx`],"text/stylus":[`stylus`,`styl`],"text/tab-separated-values":[`tsv`],"text/troff":[`t`,`tr`,`roff`,`man`,`me`,`ms`],"text/turtle":[`ttl`],"text/uri-list":[`uri`,`uris`,`urls`],"text/vcard":[`vcard`],"text/vtt":[`vtt`],"text/wgsl":[`wgsl`],"text/xml":[`*xml`],"text/yaml":[`yaml`,`yml`],"video/3gpp":[`3gp`,`3gpp`],"video/3gpp2":[`3g2`],"video/h261":[`h261`],"video/h263":[`h263`],"video/h264":[`h264`],"video/iso.segment":[`m4s`],"video/jpeg":[`jpgv`],"video/jpm":[`*jpm`,`*jpgm`],"video/mj2":[`mj2`,`mjp2`],"video/mp2t":[`ts`,`m2t`,`m2ts`,`mts`],"video/mp4":[`mp4`,`mp4v`,`mpg4`],"video/mpeg":[`mpeg`,`mpg`,`mpe`,`m1v`,`m2v`],"video/ogg":[`ogv`],"video/quicktime":[`qt`,`mov`],"video/webm":[`webm`]};Object.freeze(lE);var uE=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},dE,fE,pE,mE=class{constructor(...e){dE.set(this,new Map),fE.set(this,new Map),pE.set(this,new Map);for(let t of e)this.define(t)}define(e,t=!1){for(let[n,r]of Object.entries(e)){n=n.toLowerCase(),r=r.map(e=>e.toLowerCase());let e=uE(this,pE,`f`).get(n);e||(e=new Set,uE(this,pE,`f`).set(n,e));let i=!0;for(let a of r){let r=a.startsWith(`*`);if(a=r?a.slice(1):a,e.add(a),i&&uE(this,fE,`f`).set(n,a),i=!1,r)continue;let o=uE(this,dE,`f`).get(a);if(o&&o!=n&&!t)throw Error(`"${n} -> ${a}" conflicts with "${o} -> ${a}". Pass \`force=true\` to override this definition.`);uE(this,dE,`f`).set(a,n)}}return this}getType(e){if(typeof e!=`string`)return null;let t=e.replace(/^.*[/\\]/s,``).toLowerCase(),n=t.replace(/^.*\./s,``).toLowerCase(),r=t.length<e.length;return!(n.length<t.length-1)&&r?null:uE(this,dE,`f`).get(n)??null}getExtension(e){return typeof e==`string`?(e=e?.split?.(`;`)[0],(e&&uE(this,fE,`f`).get(e.trim().toLowerCase()))??null):null}getAllExtensions(e){if(typeof e!=`string`)return null;e=e.split(`;`)[0].trim().toLowerCase();let t=uE(this,pE,`f`).get(e);return t?new Set(t):null}_freeze(){return this.define=()=>{throw Error(`define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances`)},Object.freeze(this),this}_getTestState(){return{types:uE(this,dE,`f`),extensions:uE(this,fE,`f`)}}};dE=new WeakMap,fE=new WeakMap,pE=new WeakMap,new mE(lE)._freeze();var hE=new mE(lE,{"application/vnd.ms-excel":[`xls`,`xlm`,`xla`,`xlc`,`xlt`,`xlw`],"application/vnd.ms-powerpoint":[`ppt`,`pps`,`pot`],"application/vnd.oasis.opendocument.presentation":[`odp`],"application/vnd.oasis.opendocument.spreadsheet":[`ods`],"application/vnd.oasis.opendocument.text":[`odt`],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[`pptx`],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[`xlsx`],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[`docx`],"audio/vnd.dece.audio":[`uva`,`uvva`],"audio/vnd.digital-winds":[`eol`],"audio/vnd.dra":[`dra`],"audio/vnd.dts":[`dts`],"audio/vnd.dts.hd":[`dtshd`],"audio/vnd.lucent.voice":[`lvp`],"audio/vnd.ms-playready.media.pya":[`pya`],"audio/vnd.nuera.ecelp4800":[`ecelp4800`],"audio/vnd.nuera.ecelp7470":[`ecelp7470`],"audio/vnd.nuera.ecelp9600":[`ecelp9600`],"audio/vnd.rip":[`rip`],"audio/x-aac":[`*aac`],"audio/x-aiff":[`aif`,`aiff`,`aifc`],"audio/x-caf":[`caf`],"audio/x-flac":[`flac`],"audio/x-m4a":[`*m4a`],"audio/x-matroska":[`mka`],"audio/x-mpegurl":[`m3u`],"audio/x-ms-wax":[`wax`],"audio/x-ms-wma":[`wma`],"audio/x-pn-realaudio":[`ram`,`ra`],"audio/x-pn-realaudio-plugin":[`rmp`],"audio/x-realaudio":[`*ra`],"audio/x-wav":[`*wav`],"image/prs.btif":[`btif`,`btf`],"image/prs.pti":[`pti`],"image/vnd.adobe.photoshop":[`psd`],"image/vnd.airzip.accelerator.azv":[`azv`],"image/vnd.blockfact.facti":[`facti`],"image/vnd.dece.graphic":[`uvi`,`uvvi`,`uvg`,`uvvg`],"image/vnd.djvu":[`djvu`,`djv`],"image/vnd.dvb.subtitle":[`*sub`],"image/vnd.dwg":[`dwg`],"image/vnd.dxf":[`dxf`],"image/vnd.fastbidsheet":[`fbs`],"image/vnd.fpx":[`fpx`],"image/vnd.fst":[`fst`],"image/vnd.fujixerox.edmics-mmr":[`mmr`],"image/vnd.fujixerox.edmics-rlc":[`rlc`],"image/vnd.microsoft.icon":[`ico`],"image/vnd.ms-dds":[`dds`],"image/vnd.ms-modi":[`mdi`],"image/vnd.ms-photo":[`wdp`],"image/vnd.net-fpx":[`npx`],"image/vnd.pco.b16":[`b16`],"image/vnd.tencent.tap":[`tap`],"image/vnd.valve.source.texture":[`vtf`],"image/vnd.wap.wbmp":[`wbmp`],"image/vnd.xiff":[`xif`],"image/vnd.zbrush.pcx":[`pcx`],"image/x-3ds":[`3ds`],"image/x-adobe-dng":[`dng`],"image/x-cmu-raster":[`ras`],"image/x-cmx":[`cmx`],"image/x-freehand":[`fh`,`fhc`,`fh4`,`fh5`,`fh7`],"image/x-icon":[`*ico`],"image/x-jng":[`jng`],"image/x-mrsid-image":[`sid`],"image/x-ms-bmp":[`*bmp`],"image/x-pcx":[`*pcx`],"image/x-pict":[`pic`,`pct`],"image/x-portable-anymap":[`pnm`],"image/x-portable-bitmap":[`pbm`],"image/x-portable-graymap":[`pgm`],"image/x-portable-pixmap":[`ppm`],"image/x-rgb":[`rgb`],"image/x-tga":[`tga`],"image/x-xbitmap":[`xbm`],"image/x-xpixmap":[`xpm`],"image/x-xwindowdump":[`xwd`],"text/prs.lines.tag":[`dsc`],"text/vnd.curl":[`curl`],"text/vnd.curl.dcurl":[`dcurl`],"text/vnd.curl.mcurl":[`mcurl`],"text/vnd.curl.scurl":[`scurl`],"text/vnd.dvb.subtitle":[`sub`],"text/vnd.familysearch.gedcom":[`ged`],"text/vnd.fly":[`fly`],"text/vnd.fmi.flexstor":[`flx`],"text/vnd.graphviz":[`gv`],"text/vnd.in3d.3dml":[`3dml`],"text/vnd.in3d.spot":[`spot`],"text/vnd.sun.j2me.app-descriptor":[`jad`],"text/vnd.wap.wml":[`wml`],"text/vnd.wap.wmlscript":[`wmls`],"text/x-asm":[`s`,`asm`],"text/x-c":[`c`,`cc`,`cxx`,`cpp`,`h`,`hh`,`dic`],"text/x-component":[`htc`],"text/x-fortran":[`f`,`for`,`f77`,`f90`],"text/x-handlebars-template":[`hbs`],"text/x-java-source":[`java`],"text/x-lua":[`lua`],"text/x-markdown":[`mkd`],"text/x-nfo":[`nfo`],"text/x-opml":[`opml`],"text/x-org":[`*org`],"text/x-pascal":[`p`,`pas`],"text/x-processing":[`pde`],"text/x-sass":[`sass`],"text/x-scss":[`scss`],"text/x-setext":[`etx`],"text/x-sfv":[`sfv`],"text/x-suse-ymp":[`ymp`],"text/x-uuencode":[`uu`],"text/x-vcalendar":[`vcs`],"text/x-vcard":[`vcf`],"video/vnd.dece.hd":[`uvh`,`uvvh`],"video/vnd.dece.mobile":[`uvm`,`uvvm`],"video/vnd.dece.pd":[`uvp`,`uvvp`],"video/vnd.dece.sd":[`uvs`,`uvvs`],"video/vnd.dece.video":[`uvv`,`uvvv`],"video/vnd.dvb.file":[`dvb`],"video/vnd.fvt":[`fvt`],"video/vnd.mpegurl":[`mxu`,`m4u`],"video/vnd.ms-playready.media.pyv":[`pyv`],"video/vnd.uvvu.mp4":[`uvu`,`uvvu`],"video/vnd.vivo":[`viv`],"video/x-f4v":[`f4v`],"video/x-fli":[`fli`],"video/x-flv":[`flv`],"video/x-m4v":[`m4v`],"video/x-matroska":[`mkv`,`mk3d`,`mks`],"video/x-mng":[`mng`],"video/x-ms-asf":[`asf`,`asx`],"video/x-ms-vob":[`vob`],"video/x-ms-wm":[`wm`],"video/x-ms-wmv":[`wmv`],"video/x-ms-wmx":[`wmx`],"video/x-ms-wvx":[`wvx`],"video/x-msvideo":[`avi`],"video/x-sgi-movie":[`movie`],"video/x-smv":[`smv`]})._freeze(),gE=[`image`,`video`,`audio`],_E=[`image`,`video`],vE=e=>/\.pdf$/i.test(e),yE=e=>_E.includes(e.kind)||vE(e.name),bE=[...gE,`document`,`other`],xE=/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xlsx?)$/i,SE=/^(?<type>image|video|audio)\//,CE=e=>gE.includes(e),wE=(e,t)=>{let n=hE.getType(t);return CE(e)||n===`application/pdf`||!!n&&xp(n)},TE=e=>wE(e.kind,e.path),EE=e=>{if(!e)return;let[t,n]=e.split(`/`);if(CE(t)&&n&&!n.startsWith(`x-`))return t},DE=e=>{if(e.startsWith(`data:`))return EE(e.slice(5).split(/[;,]/)[0]);if(yf(e)){let{hostname:t,pathname:n}=new URL(e);if(t.startsWith(`images.`))return`image`;e=n}return EE(hE.getType(e)??``)},OE=async e=>{if(typeof e==`string`){if(!e.startsWith(`blob:`))return DE(e);try{return EE((await(await fetch(e)).blob()).type)}catch{return}}if(e instanceof Blob)return EE(e.type)},kE=e=>{let t=hE.getType(e.path);return!!t&&xp(t)},AE=e=>hE.getType(e)?.match(SE)?.groups?.type??(xE.test(e)?`document`:`other`),jE=e=>typeof e==`string`?e.split(`/`).filter(e=>e&&e!==`.`).join(`/`):``,ME=()=>jE(Zf.current?.backend?.root_dir),NE=(e,t=ME())=>t?Pv(`${t}/${e}`):e,PE=(e,t=ME())=>{if(!t)return e;if(e.startsWith(`${t}/`))return e.slice(t.length+1);let n=t.split(`/`),r=e.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)},FE=e=>!e.startsWith(`../`),IE=e=>{let t=ME();return t?e.map(({previousPath:e,...n})=>({...n,path:NE(n.path,t),...e!==void 0&&{previousPath:NE(e,t)}})):e},LE=async(e,t,{concurrency:n=10}={})=>{let r=0,i=async()=>{for(;r<e.length;){let n=e[r];r+=1,await t(n)}};await Promise.all(Array(Math.min(n,e.length)).fill(void 0).map(()=>i()))},RE=async(e,t,n)=>{let r=Array(e.length);return await LE([...e.keys()],async n=>{r[n]=await t(e[n])},n),r},zE=`Not a collaborator of the repository`,BE=class extends Error{},VE=(e,t,n)=>Error(e,{cause:new BE(n?Yd(t,{values:n}):Yd(t))}),HE=(e,t)=>e?.cause instanceof BE&&e.cause.message||Yd(t),UE=e=>VE(zE,`repository_no_access`,{repo:e}),WE=e=>VE(zE,`repository_no_write_access`,{repo:e}),GE=(e,t)=>t?WE(e):UE(e),KE=({owner:e,repo:t},n)=>n===401||n===403||n===404?UE(t):VE(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:`${e}/${t}`}),qE=`sveltia-cms.user`,JE=[`decap-cms-user`,`netlify-cms-user`],YE=ro({account:void 0});Po(()=>{jo(()=>{let e=YE.account;(async()=>{try{e?await mf.set(qE,e):e===null&&await mf.delete(qE)}catch{}})()})});var XE={create:`Create {{collection}} “{{slug}}”`,update:`Update {{collection}} “{{slug}}”`,delete:`Delete {{collection}} “{{slug}}”`,uploadMedia:`Upload “{{path}}”`,deleteMedia:`Delete “{{path}}”`,openAuthoring:`{{message}}`},ZE=/\[(?:skip[ -](?:ci|actions)|(?:ci|actions)[ -]skip|no[ -]ci|cf-pages-skip)\]/i,QE=e=>ZE.test(e),$E=(e,t)=>e.replace(/\{\{([\w-]+)\}\}/g,(e,n)=>Object.hasOwn(t,n)?t[n]:e),eD=()=>Zf.current?.backend??{},tD=()=>{let{email:e=``,login:t=``,name:n=``}=YE.account;return{"author-email":e,"author-login":t,"author-name":n}},nD=(e,{commitType:t=`update`,collection:n},r=eD())=>{let{commit_messages:i={}}=r,[a=``]=e.map(e=>e.slug).filter(Boolean),[o,...s]=e.map(({path:e})=>e),c=n?Hh(n,{useSingular:!0}):``,l=i[t]||XE[t]||``,u=tD();return[`create`,`update`,`delete`].includes(t)&&(l=$E(l,{slug:a,collection:c,path:o,...u})),[`uploadMedia`,`deleteMedia`].includes(t)&&(l=$E(l,{path:o,...u})),s.length&&(l+=` +${s.length}`),l},rD=(e,t,n)=>{let r=t?.trim();return r?n===!0?r:n===`prefix`?`${r} ${e}`:n===`suffix`?`${e} ${r}`:e:e},iD=({commitType:e,skipCI:t})=>{let{skip_ci:n,automatic_deployments:r}=eD();return e===`delete`||e===`deleteMedia`||!(t??(n===!0||r===!1))},aD=(e,t)=>{let{userMessage:n}=t,r=eD(),{commit_messages:i={},prompt_commit_messages:a}=r,o=rD(nD(e,t,r),n,a);return AT.current&&(o=$E(i.openAuthoring||XE.openAuthoring,{message:o,...tD()})),iD(t)||(o=`[skip ci] ${o}`),o},oD=/^[A-Za-z0-9-]+:\s*\S/,sD=e=>(e??``).replace(/[\s<>]+/g,` `).trim(),cD=new WeakSet,lD=e=>{if(!eD().signoff_commits)return e;let{account:t}=YE,{email:n,login:r,name:i}=t,a=sD(n);if(!a)return cD.has(t)||(cD.add(t),console.warn("The `signoff_commits` option is enabled, but the Git host doesn’t share your email address, so commits are made without a `Signed-off-by` trailer.")),e;let o=sD(i)||sD(r)||a,s=e.trimEnd(),c=`<${a}>`.toLowerCase();if(s.split(/\r?\n/).some(e=>{let t=e.trim().toLowerCase();return t.startsWith(`signed-off-by:`)&&t.endsWith(c)}))return e;let l=s.split(/\r?\n\s*\r?\n/),u=l.at(-1);return`${s}${l.length>1&&u.split(/\r?\n/).every(e=>oD.test(e))?`
`:`
`}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(`Authentication aborted`),{name:`AbortError`}),eO=({authURL:e})=>{let{availHeight:t,availWidth:n}=window.screen,r=t/2-400,i=n/2-300;return window.open(e,`auth`,`width=600,height=800,top=${r},left=${i}`)},tO=async({backendName:e,authURL:t,popup:n,state:r})=>{let i=n??eO({authURL:t});if(!i)throw $D();return new Promise((n,a)=>{let o=new AbortController,s=e,l=r?new BroadcastChannel(KD(r)):void 0,u,d=()=>{o.abort(),clearInterval(u),l?.close(),UD.current=void 0},f=()=>{d(),i.close(),a($D())};(e===`github`||LD(e))&&(u=setInterval(()=>{i.closed&&f()},1e3));let p=e=>{let t=YD(s,e),r;try{r=t?JSON.parse(t):{error:`No data`},c(r)||(r={error:`Malformed data`})}catch{r={error:`Malformed data`}}`token`in r?n(r):a(Error(`Authentication failed`,{cause:Error(r.errorCode?Yd(`sign_in_error.${r.errorCode}`,{default:r.error}):r.error)})),d(),i.close()};window.addEventListener(`message`,({origin:e,data:n,source:r})=>{r===i&&e===new URL(t).origin&&typeof n==`string`&&(n===qD(s)?i.postMessage(n,e):p(n))},{signal:o.signal}),l&&(l.onmessage=({data:e})=>{typeof e==`string`&&p(e)}),UD.current=f})},nO=async({backendName:e,siteDomain:t,authURL:n,scope:r})=>{let{hostname:i}=window.location;t??=i===`localhost`?`cms.netlify.com`:i;try{new URL(n).origin===`https://api.netlify.com`&&(t=new URL(`https://${t}`).hostname)}catch{}return tO({backendName:e,authURL:`${n}?${new URLSearchParams({provider:e,site_id:t,scope:r})}`})},rO=async()=>{let e=`${lf()}${lf()}`,t=btoa(await uf(e,{algorithm:`SHA-256`,format:`binary`})).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);return{csrfToken:of().replaceAll(`-`,``),codeVerifier:e,codeChallenge:t}},iO=async({backendName:e,clientId:t,authURL:n,scope:r})=>{let{origin:i,pathname:a}=window.location,o=`${i}${a}`,s=eO({authURL:o});if(!s)throw $D();let{csrfToken:c,codeVerifier:l,codeChallenge:u}=await rO(),d=new URLSearchParams({client_id:t,redirect_uri:o,response_type:`code`,state:c,scope:r,code_challenge:u,code_challenge_method:`S256`});if(await mf.set(WD,{csrfToken:c,codeVerifier:l,realAuthURL:`${n}?${d}`}),await mf.set(qE,{backendName:e}),s.closed)throw $D();try{return await tO({backendName:e,authURL:o,popup:s,state:c})}catch(e){throw await mf.delete(WD),e}},aO=({provider:e=`unknown`,state:t,token:n,refreshToken:r,error:i,errorCode:a})=>{let o=i?`error`:`success`,s=i?{provider:e,error:i,errorCode:a}:{provider:e,token:n,refreshToken:r};if(!window.opener){if(t){let n=new BroadcastChannel(KD(t));n.postMessage(JD(e,o,s)),n.close(),window.close()}return}let c=({data:t,origin:n,source:r})=>{r===window.opener&&n===window.location.origin&&t===qD(e)&&(window.opener?.postMessage(JD(e,o,s),n),window.removeEventListener(`message`,c))};window.addEventListener(`message`,c),window.opener?.postMessage(qD(e),window.location.origin)},oO=async({backendName:e,apiConfig:t,code:n,state:r})=>{let{clientId:i,tokenURL:a,includeCredentials:o=!1}=t,{origin:s,pathname:c}=new URL(window.location.href),{csrfToken:l,codeVerifier:u}=await mf.get(WD)??{},d=e,f=`${s}${c}`;if(await QD(),!l||!u||r!==l)return aO({provider:d,state:r,error:Yd(`sign_in_error.CSRF_DETECTED`),errorCode:`CSRF_DETECTED`});let p=``,m=``,h=``,g=await bD(a,{grant_type:`authorization_code`,client_id:i,code:n,redirect_uri:f,code_verifier:u},{includeCredentials:o});if(!g)return aO({provider:d,state:r,error:Yd(`sign_in_error.TOKEN_REQUEST_FAILED`),errorCode:`TOKEN_REQUEST_FAILED`});try{({access_token:p,refresh_token:m,error:h}=await g.json())}catch{return aO({provider:d,state:r,error:Yd(`sign_in_error.MALFORMED_RESPONSE`),errorCode:`MALFORMED_RESPONSE`})}return aO({provider:d,state:r,token:p,refreshToken:m,error:h})},sO=async({backendName:e,apiConfig:t})=>{HD.current=!0;let{search:n}=window.location,{code:r,state:i,error:a,error_description:o}=Object.fromEntries(new URLSearchParams(n));if(r&&i)await oO({backendName:e,apiConfig:t,code:r,state:i});else if(a)await QD(),aO({provider:e,state:i,error:o||a,errorCode:`AUTH_CODE_REQUEST_FAILED`});else{let{csrfToken:e,realAuthURL:t}=await mf.get(WD)??{};t&&(ZD(e),window.location.href=t)}},cO=()=>{try{if(window.opener)return window.opener.origin===window.location.origin&&window.name===`auth`}catch{return!1}let e=new URLSearchParams(window.location.search).get(`state`);return!!e&&e===XD()},lO=async({auto:e,apiConfig:t})=>{let{backend:n}=Zf.current,{name:r,site_domain:i,auth_type:a}=n,{clientId:o,authScope:s,authURL:c}=t,l={backendName:r,authURL:c,scope:s};if(LD(r)||a===`pkce`){let n=cO();return n&&await sO({backendName:r,apiConfig:t}),n||e?void 0:iO({...l,clientId:o})}if(!e)return nO({...l,siteDomain:i})},uO=async({options:{token:e,refreshToken:t,auto:n=!1},apiConfig:r})=>{if(!e){let i=await lO({auto:n,apiConfig:r});if(!i)return;({token:e,refreshToken:t}=i)}return{token:e,refreshToken:t}},dO=async({options:e,getUserProfile:t})=>{let{token:n,refreshToken:r}=await uO({options:e,apiConfig:vD})??{};if(n)return t({token:n,refreshToken:r})},fO=async()=>void 0,pO=`sveltia-cms/`,mO=[`netlify-cms/`,`decap-cms/`],hO=[`draft`,`pending_review`,`pending_publish`],gO=[`draft`,`pending_review`],_O=[...hO,`pending_deletion`],vO={draft:`status.draft`,pending_review:`status.in_review`,pending_publish:`status.ready`,pending_deletion:`status.pending_deletion`},yO=`sveltia-cms.prefs`,bO=`auto`,xO=ro({current:void 0}),SO=ro({}),CO=!1,wO=0,TO,EO=ro({current:void 0});Po(()=>{(async()=>{xO.current=void 0;try{let e=await mf.get(yO),t=c(e)?e:{};t.apiKeys??={},t.useDraftBackup??=!0,t.closeOnSave??=!0,t.closeWithEscape??=!0,t.underlineLinks??=!0,t.devModeEnabled??=!1,t.localGitCommits??=!1,t.defaultTranslationService??=`google`,t.locale??=bO,t.locale===`en`&&(t.locale=bO),delete t.beta,Object.assign(SO,t)}catch{xO.current={type:`permission_denied`}}})(),jo(()=>{if(!Object.keys(SO).length)return;let e=Bi(SO);(async()=>{try{(0,df.default)(e,await mf.get(`sveltia-cms.prefs`))||await mf.set(yO,e)}catch{}})();let{theme:t,underlineLinks:n=!0,devModeEnabled:r=!1}=SO,i=!t||t===`auto`,a=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;Object.assign(document.documentElement.dataset,{theme:i?a:t,autoTheming:i,underlineLinks:n,devMode:r})}),jo(()=>{let{locale:e}=SO,t=e===`auto`?EO.current:e;if(!t||!bd.includes(t))return;let n=Os(()=>Ud.current),r=CO&&e!==`auto`;CO=!0,wO+=1;let i=wO;Vd(t).then(()=>{i===wO&&(t in xd?(Ud.set(t),TO=e):r&&n&&(SO.locale=TO??n))})})});var DO={service:``,label:``,owner:``,repo:``,branch:``,repoURL:``,treeBaseURL:``,blobBaseURL:``,isSelfHosted:!1,databaseName:``},OO=/^(?<origin>(?:[a-z][a-z\d+.-]*:)?\/\/[^/]*)?(?<path>.*?)\/api(?:\/.*)?$/i,kO=e=>e===`https://api.github.com`?`https://github.com`:e.replace(OO,`$<origin>$<path>`),AO=(e,t)=>`${kO(e)}/${t}`,jO=({owner:e,repo:t})=>`/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,MO=e=>{let[t,n]=e.split(`/`);return{owner:t,repo:n}},NO=(e,{owner:t,repo:n})=>typeof e==`string`&&e.toLowerCase()===`${t}/${n}`.toLowerCase(),PO=(e,t)=>`${jO(e)}/pulls/${t}`,FO=(e,t)=>`${jO(e)}/branches/${xv(t)}`,IO=({tree:e,blob:t,commit:n})=>(r,i)=>({treeBaseURL:i?`${r}${e}/${xv(i)}`:r,blobBaseURL:i?`${r}${t}/${xv(i)}`:``,commitBaseURL:`${r}${n}`}),LO=(e,t,n)=>{let r=e(t,n),i=ME();return!i||!n?r:{...r,treeBaseURL:`${r.treeBaseURL}/${xv(i)}`,blobBaseURL:`${r.blobBaseURL}/${xv(i)}`}},RO=(e,{service:t,label:n,owner:r,repo:i,branch:a,restApiRoot:o,defaultApiRoot:s,getTokenPageURL:c,getBaseURLs:l})=>{o=K(o);let u=`${r}/${i}`,d=AO(o,u),f=ME();return Object.assign(e,{service:t,label:n,owner:r,repo:i,branch:a,repoURL:d,tokenPageURL:c(kO(o)),databaseName:f?`${t}:${u}:${f}`:`${t}:${u}`,isSelfHosted:o!==s},LO(l,d,a)),SO.devModeEnabled&&console.info(`repositoryInfo`,e),e},zO=(e,{found:t,branch:n,getBaseURLs:r})=>{let{repo:i,repoURL:a=``}=e;if(!t)throw VE(`Failed to retrieve the default branch name.`,`repository_not_found`,{repo:i});if(!n)throw VE(`Failed to retrieve the default branch name.`,`repository_empty`,{repo:i});return Object.assign(e,{branch:n},LO(r,a,n)),n},BO=async(...e)=>{try{return await kD(...e)}catch(e){if(e?.cause?.status===404)return;throw e}},VO={attempts:10,interval:1e3},HO=async(e,t,{attempts:n,interval:r})=>{let i=await e();return t(i)||n<=1?i:(await a(r),HO(e,t,{attempts:n-1,interval:r}))},UO=`Automatically generated by Sveltia CMS`,WO=/\s*<!-- sveltia-cms:deletion-group=([\w-]+) -->/g,GO=/<!-- sveltia-cms:deletion-group=([\w-]+) -->/,KO=e=>`<!-- sveltia-cms:deletion-group=${e} -->`,qO=e=>e?`${UO}\n\n${KO(e)}`:UO,JO=({description:e})=>e?.match(GO)?.[1],YO=(e,t)=>{let n=e.replace(WO,``);return t?[n,KO(t)].filter(Boolean).join(`
`):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(e)).find(e=>!!e&&new URL(e).host!==n)},Nk=(e,t)=>{try{return new URL(e).host===new URL(t).host}catch{return!1}},Pk=({name:e,source:t},n)=>!!n||t===`deployment`||Ek.test(e),Fk=(e,t)=>e.source!==`check`||Pk(e,t),Ik=(e,{kind:t,previewContext:n})=>{let{name:r,url:i,state:a,source:o}=e,s=Dk.test(r);return(Pk(e,n)?0:-64)+(i?32:0)+(a===`ready`?16:0)+kk[o]*4+(t===`production`===s?2:0)+ +!!Ek.test(r)},Lk=(e,{kind:t,selfURL:n})=>{let r=Ak(),i=e;if(r){let e=r.toLowerCase(),t=i.filter(({name:t})=>t.toLowerCase()===e);i=t.length?t:i.filter(({name:t})=>t.toLowerCase().includes(e))}if(i=i.filter(({description:e})=>!e||!Ok.test(e)),i=i.map(e=>({...e,url:e.state===`ready`&&Fk(e,r)&&!Nk(e.url,n)?jk(e.url):void 0})),!i.length)return{state:`unknown`,checkedTime:Date.now()};let[a]=i.map((e,n)=>({candidate:e,index:n,score:Ik(e,{kind:t,previewContext:r})})).sort((e,t)=>t.score-e.score||t.index-e.index).map(({candidate:e})=>e);return{state:a.state,url:a.url,context:a.name,checkedTime:Date.now()}},Rk=(e,t,n,r)=>{t?.forEach(t=>{let i=n(t);i&&e.push({...r(t),state:i})})},zk=async e=>{try{await e()}catch(e){console.warn(`Failed to fetch the deployment info.`,e)}},Bk=async(e,{collect:t,selfURL:n})=>{let r=e.filter(({sha:e})=>!!e),i=[...new Set(r.map(({sha:e})=>e))];if(!i.length)return{};let a=Object.fromEntries(i.map(e=>[e,[]]));return await t(i,a),Object.fromEntries(r.map(({sha:e,kind:t})=>[e,Lk(a[e],{kind:t,selfURL:n})]))},Vk=async(e,t)=>{if(e)return(await kD(t(e)))?.commit?.id??void 0},Hk=({arrayIndex:e},t)=>e===void 0?t:`${t}#${e}`,Uk=({entries:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.flatMap(e=>Object.values(e.locales).map(({path:t})=>[Hk(e,t),e]))),i=new Set;return e.map(e=>{let t=Object.values(e.locales).map(({path:e})=>e),a=t.map(t=>r.get(Hk(e,t))).find(e=>!!e&&!i.has(e));if(!a)return e;i.add(a);let o=Object.values(a.locales).map(({path:e})=>e);return t.length===o.length&&t.every(e=>o.includes(e)&&!n.has(e))?a:{...e,id:a.id}})},Wk=({assets:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.map(e=>[e.path,e])),i=new Set(e.map(({path:e})=>e)),a=(e,t)=>{let{workflow:n}=e;return n.replacedAsset===t?e:{...e,workflow:{...n,replacedAsset:t}}};return[...e.map(e=>{let t=r.get(e.path),i=t?.workflow?t.workflow.replacedAsset:t,o=i&&!n.has(e.path)?i:e;return t?.workflow?a(t,o):o}),...t.filter(({path:e,workflow:t})=>!!t&&!i.has(e)).map(e=>a(e,void 0))]},Gk=({collectionName:e,fileName:t})=>{let n=Vh(e),{structureMap:r}=((n&&t?Zh(n,t):void 0)??n)?._i18n??{};return!!(r?.i18nMultiFile||r?.i18nMultiFolder||r?.i18nMultiRootFolder)},Kk=({entryFiles:e,previous:t,changedPaths:n})=>{let r=new Set(e.map(({path:e})=>e)),i=new Map,a=new Set;t.forEach(e=>{Hv(e).forEach(t=>{i.has(t)&&a.add(t),i.set(t,e)})});let o=({path:e},t)=>{let o=i.get(e);if(!o||n.has(e)||a.has(e))return;let s=Hv(o);if(t||s.length===1&&s[0]===e)return s.every(e=>r.has(e)&&!n.has(e)&&!a.has(e))?o:void 0},s=new Map,c=[],l=new Map,u=new Map;return e.forEach(e=>{let{collectionName:t,fileName:n}=e.folder,r=`${t}\n${n??``}`,i=l.get(r);i===void 0&&(i=Gk(e.folder),l.set(r,i));let a=o(e,i);if(i){let n=u.get(t)??[];n.push({file:e,entry:a}),u.set(t,n)}else a?s.set(e.path,a):c.push(e)}),u.forEach(e=>{e.every(({entry:e})=>!!e)?e.forEach(({file:e,entry:t})=>{s.set(e.path,t)}):c.push(...e.map(({file:e})=>e))}),{reusedEntries:s,dirtyFiles:c}},qk=({entryFiles:e,reusedEntries:t,parsedEntries:n})=>{let r=new Map;n.forEach(e=>{Hv(e).forEach(t=>{Pm(r,t,()=>[]).push(e)})});let i=new Set;return e.forEach(({path:e})=>{let n=t.get(e);(n?[n]:r.get(e)??[]).forEach(e=>{i.add(e)})}),[...i]},Jk=({fileInfo:e,fetchedFileMap:t})=>{let{meta:n,size:r,text:i}=t[e.path]??{};return{...e,size:e.size??r,text:e.text??i,meta:e.meta??n}},Yk=e=>{let{name:t,meta:n={},...r}=e,i=AE(t);return{...r,...n,name:t,kind:i}},Xk=e=>`locales`in e?Object.values(e.locales).map(({path:e})=>e):[e.path],Zk=({entries:e,assets:t,configFiles:n,errors:r=[],changedPaths:i})=>{let a=i??new Set([...e,...t].flatMap(Xk));qh.current=Uk({entries:e,previous:qh.current,changedPaths:a}),ZT.current=Wk({assets:t,previous:ZT.current,changedPaths:a}),cE.current=n,Xh.current=r,Wh.current=!0},Qk=({fetchedFileMap:e,metadataMap:t})=>{Object.entries(t).forEach(([t,n])=>{e[t]&&(e[t].meta=n)});let n=!1,r=!1,i=qh.current.map(e=>{if(e.commitDate)return e;let r=Object.values(e.locales).map(({path:e})=>t[e]).find(Boolean);return r?(n=!0,{...e,...r}):e}),a=ZT.current.map(e=>{let n=e.commitDate?void 0:t[e.path];return n?(r=!0,{...e,...n}):e});n&&(qh.current=i),r&&(ZT.current=a)},$k=async({entryFiles:e,changedPaths:t,parsedFileMap:n})=>{let r=qh.current;if(!t||!r.length)return fT(e,{parsedFileMap:n});let{reusedEntries:i,dirtyFiles:a}=Kk({entryFiles:e,previous:r,changedPaths:t}),{entries:o,errors:s}=await fT(a,{parsedFileMap:n});return{entries:qk({entryFiles:e,reusedEntries:i,parsedEntries:o}),errors:s}},eA=async({fileList:{entryFiles:e,assetFiles:t,configFiles:n},fetchedFileMap:r,changedPaths:i,parsedFileMap:a})=>{let{entries:o,errors:s}=await $k({entryFiles:e.map(e=>Jk({fileInfo:e,fetchedFileMap:r})),changedPaths:i,parsedFileMap:a});return{entries:o,errors:s,assets:t.map(e=>Yk(Jk({fileInfo:e,fetchedFileMap:r}))),configFiles:n.map(e=>Jk({fileInfo:e,fetchedFileMap:r}))}},tA=(e,{sha:t=``,size:n=0,...r}={})=>({path:e,name:Sp(e).basename,sha:t,size:n,...r}),nA=e=>e.filter(({type:e})=>e===`blob`).map(({path:e,sha:t,size:n})=>tA(e,{sha:t,size:n})),rA=async({metaEntries:e,lastCommitHash:t,cachedFileEntries:n,fetchFileList:r,log:i})=>{let a=$f.current,{last_config_hash:o,last_commit_hash:s,git_config_fetched:c}=Object.fromEntries(e);if(o&&o===a&&s&&s===t&&c&&n.length){let e=hD(n.map(([e,t])=>tA(e,t)));return i(`Restored the file list from the cache: ${gD(e)}`),e}let l=hD(await r(t));return i(`Fetched the file list: ${gD(l)}`),l},iA=async({metaDB:e,lastConfigHash:t,lastCommitHash:n})=>{await e.saveEntries(Object.entries({last_config_hash:t,last_commit_hash:n,git_config_fetched:!0}))},aA=async({databaseName:e},t,n)=>{Ck.current=n;try{let r=new ff(e,`meta`);await r.get(`last_commit_hash`)===t&&await r.set(`last_commit_hash`,n)}catch(e){console.error(`Failed to update the file cache.`,e)}},oA=({allFiles:e,cachedFiles:t})=>{e.forEach(({sha:n,path:r},i)=>{t[r]?.sha===n&&Object.assign(e[i],t[r])})},sA=({parsedFileMap:e,fetchedFileMap:t,cachedFiles:n})=>{let r={};return e.forEach((e,i)=>{t[i]?t[i].parsed=e:n[i]&&(r[i]={...n[i],parsed:e})}),r},cA=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a={}})=>{let o=new Set(t.map(({path:e})=>e)),s=Object.keys(n).filter(e=>!o.has(e)),c=[...r.length?Object.entries(i):[],...Object.entries(a)];await Promise.all([c.length?e.saveEntries(c):void 0,s.length?e.deleteEntries(s):void 0])},lA=({metaDB:e,cacheDB:t})=>mD((async()=>{try{let n=await t.entries();return{metaEntries:await e.entries(),cachedFileEntries:n}}catch(e){return console.error(`Failed to read the file cache.`,e),{metaEntries:[],cachedFileEntries:[]}}})()),uA=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a,fetchFileMetadata:o,log:s})=>{let c={cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a},l=!0;if(o&&r.length){try{await cA(c),s(`Cached the contents of ${r.length} files`)}catch(e){console.error(`Failed to cache the contents.`,e)}try{Qk({fetchedFileMap:i,metadataMap:await o(r)}),s(`Fetched the commit metadata of ${r.length} files`)}catch(e){console.error(`Failed to fetch the commit metadata.`,e),l=!1}}await cA(c),s(l?`Cached ${r.length} files with their metadata`:`Cached ${r.length} files without their metadata; they are fetched again next time`)},dA=async({metaDB:e,lastConfigHash:t,lastCommitHash:n,cacheUpdate:r})=>{try{await r,await iA({metaDB:e,lastConfigHash:t,lastCommitHash:n})}catch(e){console.error(`Failed to update the file cache.`,e)}},fA=(e,t)=>((...n)=>{let r=ME();return r?t(r,...n):e(...n)}),pA=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[t(e),n])),mA=(e,t)=>({...e,path:t(e.path),...e.previousPath!==void 0&&{previousPath:t(e.previousPath)}}),hA=(e,t)=>({...e,files:e.files.map(e=>mA(e,t))}),gA=(e,t)=>({...e,files:pA(e.files,e=>PE(e,t))}),_A=({repository:e,fetchFileList:t,fetchFileContents:n,fetchFileMetadata:r})=>{let i=(e,t)=>e.map(e=>({...e,path:NE(e.path,t)}));return{fetchFileList:fA(t,async(n,r)=>{let i=(await t(r)).flatMap(e=>{let t=PE(e.path,n);return FE(t)?[{...e,path:t}]:[]});if(!i.length)throw VE(`Failed to list the files.`,`root_dir_not_found`,{repo:`${e.owner}/${e.repo}`,dir:n});return i}),fetchFileContents:fA(n,async(e,t,r)=>pA(await n(i(t,e),r),t=>PE(t,e))),fetchFileMetadata:r&&fA(r,async(e,t)=>pA(await r(i(t,e)),t=>PE(t,e)))}},vA=e=>{let t=(e,t)=>hA(e,e=>NE(e,t)),n=(e,t)=>hA(e,e=>PE(e,t));return{...e,fetchPullRequests:fA(e.fetchPullRequests,async t=>(await e.fetchPullRequests()).map(e=>n(e,t))),savePullRequest:fA(e.savePullRequest,async(r,i)=>{let{commit:a,pullRequest:o}=await e.savePullRequest({...i,changes:IE(i.changes),pullRequest:i.pullRequest&&t(i.pullRequest,r)});return{commit:gA(a,r),pullRequest:n(o,r)}}),updateStatus:fA(e.updateStatus,async(r,i,a)=>n(await e.updateStatus(t(i,r),a),r)),fetchMergeState:fA(e.fetchMergeState,async(n,r)=>{let i=await e.fetchMergeState(t(r,n)),a=i.files.some(({path:e,previousPath:t})=>[e,t].some(e=>e!==void 0&&e.split(`/`).some(e=>e===`.`||e===`..`)));return{...i,files:i.files.map(e=>mA(e,e=>PE(e,n))),...a&&{complete:!1}}}),fetchUnchangedPaths:fA(e.fetchUnchangedPaths,async(t,{headSHA:n,paths:r})=>(await e.fetchUnchangedPaths({headSHA:n,paths:r.map(e=>NE(e,t))})).map(e=>PE(e,t))),publish:fA(e.publish,(n,r)=>e.publish(t(r,n))),discard:fA(e.discard,(n,r)=>e.discard(t(r,n)))}},yA=e=>{let{fetchBlob:t,commitChanges:n,fetchFileCommits:r,workflow:i}=e;return{...e,fetchBlob:t&&fA(t,(e,n)=>t({...n,path:NE(n.path,e)})),commitChanges:fA(n,async(e,t,r)=>gA(await n(IE(t),r),e)),fetchFileCommits:r&&fA(r,(e,t)=>r(t.map(t=>NE(t,e)))),workflow:i&&vA(i)}},bA=q({}),xA=q(``),SA=q({published:!0,time:0}),CA=q(!1),wA=e=>{let t=e.filter(e=>!!e);t.length&&(bA.current=Object.fromEntries(Object.entries(bA.current).filter(([e])=>!t.includes(e))))},TA=()=>{bA.current={},xA.current=``,CA.current=!1,SA.current={published:!0,time:0}},EA=e=>{SA.current={published:e,time:Date.now()}},DA,OA=e=>`${e}\n${$f.current}`,kA=async({repository:e,accessPromise:t,fetchDefaultBranchName:n,fetchLastCommit:r,lastCommit:i,log:a})=>{let{branch:o}=e;if(o&&i)return await t,i;if(!o){let r=mD(n());await t,o=await r,e.branch=o,a(`Fetched the default branch name: ${o}`)}let s=mD(r());await t;let c=await s;return a(`Fetched the last commit on ${o}: ${c.hash}`),c},AA=async({fileList:{allFiles:e},lastCommitHash:t,cachedFileEntries:n,fetchFileContents:r,fetchFileMetadata:i,log:a})=>{let o=Object.fromEntries(n);oA({allFiles:e,cachedFiles:o});let s=new Set(e.filter(({path:e,sha:t})=>o[e]?.sha!==t).map(({path:e})=>e)),c=e.filter(({meta:e})=>!e),l=i?c.filter(({type:e,text:t})=>e!==`asset`&&t===void 0):c,u=Object.fromEntries(c.map(({path:e,sha:t,size:n,text:r})=>[e,{sha:t,size:n,text:r,meta:void 0}]));return a(`Restored ${e.length-c.length} files from the cache; fetching ${c.length} files`),l.length&&(Object.assign(u,await r(l,t)),a(`Fetched the contents of ${l.filter(({type:e})=>e!==`asset`).length} files`)),{cachedFiles:o,changedPaths:s,fetchingFiles:c,fetchedFileMap:u}},jA=async({data:e,isStale:t,parseKey:n,metaDB:r,lastConfigHash:i,lastCommitHash:a,startCacheUpdate:o,log:s,readyMessage:c})=>{t()?s(`Discarded: the site data was reset while loading`):(Zk(e),DA=n,Ck.current=a,s(c),await dA({metaDB:r,lastConfigHash:i,lastCommitHash:a,cacheUpdate:o()}))},MA=async({repository:e,checkAccess:t,checkBranchAccess:n,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,...o})=>{let{service:s,owner:c,repo:l,databaseName:u}=e,{fetchFileList:d,fetchFileContents:f,fetchFileMetadata:p}=_A({repository:e,...o}),m=_D(`Loading site data`);m(`Started: ${s} ${c}/${l}`);let h=OA(u),g=Tk(),_=!!Ck.current&&DA===h,v=new ff(u,`meta`),y=new ff(u,`file-cache`),b=!Ck.current,x=t&&b?mD(t()):void 0,S=lA({metaDB:v,cacheDB:y}),{hash:C,message:ee}=await kA({repository:e,accessPromise:x,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,log:m}),te=n&&b?n():void 0,{metaEntries:ne,cachedFileEntries:w}=await S;m(`Read the file cache: ${w.length} files`);let re=$f.current,ie=await rA({metaEntries:ne,lastCommitHash:C,cachedFileEntries:w,fetchFileList:d,log:m});EA(!QE(ee)),await te;let ae={isStale:g,parseKey:h,metaDB:v,lastConfigHash:re,lastCommitHash:C,log:m};if(!ie.count){await jA({...ae,data:{entries:[],assets:[],configFiles:[]},readyMessage:`The site data is ready: no files to load`,startCacheUpdate:()=>cA({cacheDB:y,allFiles:[],cachedFiles:Object.fromEntries(w),fetchingFiles:[],fetchedFileMap:{}})});return}let{cachedFiles:oe,changedPaths:se,fetchingFiles:ce,fetchedFileMap:le}=await AA({fileList:ie,lastCommitHash:C,cachedFileEntries:w,fetchFileContents:f,fetchFileMetadata:p,log:m}),ue=new Map,{entries:de,errors:fe,assets:pe,configFiles:me}=await eA({fileList:ie,fetchedFileMap:le,changedPaths:_?se:void 0,parsedFileMap:ue}),he=sA({parsedFileMap:ue,fetchedFileMap:le,cachedFiles:oe});m(`Parsed ${de.length} entries (${fe.length} errors)`),await jA({...ae,data:{entries:de,assets:pe,configFiles:me,errors:fe,changedPaths:se},readyMessage:`The site data is ready`,startCacheUpdate:()=>uA({cacheDB:y,allFiles:ie.allFiles,cachedFiles:oe,fetchingFiles:ce,fetchedFileMap:le,reparsedFileMap:he,fetchFileMetadata:p,log:m})})},NA=async({isOpenAuthoringConfigured:e,initOpenAuthoring:t,checkAccess:n,checkBranchAccess:r,...i})=>{let a=e();a&&!jT.current&&await t(),await MA({...i,checkAccess:a?void 0:n,checkBranchAccess:kT.current?void 0:r})},PA=()=>{let{backend:e}=Zf.current??{};return e&&`squash_merges`in e?!!e.squash_merges:!1},FA=async({branch:e,path:t,goneStatuses:n})=>{try{await kD(t,{method:`DELETE`,responseType:`text`})}catch(t){if(n.includes(t.cause?.status))return;console.warn(`Failed to delete the ${e} branch.`,t)}},IA=async({commit:e,branch:t,title:n,status:r,deletionGroup:i,createPullRequest:a})=>AT.current&&r===`draft`?yk({commit:e,branch:t,title:n}):a({branch:t,title:n,status:r,description:qO(i)}),LA=async({changes:e,options:t,branch:n,title:r,status:i,pullRequest:a,deletionGroup:o},{commitToNewBranch:s,commitToExistingBranch:c,createPullRequest:l,updateDescription:u})=>{if(a){let r=JO(a)===o?a:{...a,description:await u(a,e=>YO(e,o))};return{commit:await c(e,{...t,branch:n},a),pullRequest:r}}let d=await s(e,{...t,branch:n});return{commit:d,pullRequest:await IA({commit:d,branch:n,title:r,status:i,deletionGroup:o,createPullRequest:l})}},RA=async({branch:e,branchExistsStatus:t,commitFromStart:n,commitOnBranch:r,findOpenPullRequest:i,inUseMessage:a,deleteBranch:o})=>{try{return await n()}catch(e){if(e.cause?.status!==t)throw e}if(AT.current)return r();let s=await i();if(s)throw VE(a,`workflow.branch_in_use`,{number:s});return await o(e),n()},zA=(e,t)=>VE(`Failed to save the changes.`,`branch_not_found`,{repo:t.repo,branch:e}),BA=async({branch:e,headSHA:t,fetchBranchHead:n,getWorkflowRepository:r})=>{let i=await n(e);if(i===void 0)throw zA(e,r());if(!t||i!==t)throw VE(`The workflow branch has moved since the entry was loaded.`,`save_conflict.branch_moved`);return t},VA=async(e,t,{updateForkStatus:n,updateLabels:r,updateDraftState:i})=>{if(AT.current)return n(e,t);let a=t===`draft`;return await r(e,t),a!==(e.status===`draft`)&&await i(e,a),{...e,status:t,updatedDate:new Date}},HA=e=>[...new Set(e.map(e=>e.slice(0,Math.max(e.lastIndexOf(`/`),0))))],UA=async(e,{statusMap:t,headSHA:n,fetchFileModes:r})=>{let i=e.map(({filename:e,status:n,previous_filename:r})=>({path:e,status:t[n]??`modified`,previousPath:r||void 0})),a=await r({headSHA:n,paths:i.filter(({status:e})=>e!==`removed`).map(({path:e})=>e)});return i.map(e=>({...e,mode:a.get(e.path)}))},WA=(e,t)=>t===e.headSHA?void 0:{headSHA:t,onConfiguredBranches:!0,files:[],complete:!0},GA=async({pullRequest:e,headSHA:t,onConfiguredBranches:n,listChangedFiles:r})=>!t||!n?{headSHA:t,onConfiguredBranches:!1,files:[],complete:!1}:WA(e,t)||{headSHA:t,onConfiguredBranches:n,...await r(t)},KA=async(e,t)=>(await kD(`${PO(e,t)}/merge`,{responseType:`raw`})).ok,qA=async(e,t)=>{await kD(PO(e,t),{method:`PATCH`,body:{state:`open`}})},JA=async(e,t,n)=>{let r=PO(e,t.number),{body:i}=await kD(r),a=n(i??``);return await kD(r,{method:`PATCH`,body:{body:a}}),a},YA=async(e,t,n)=>{await kD(`${PO(e,t.number)}/reviews`,{method:`POST`,body:{event:n,commit_id:t.headSHA}})},XA=e=>e.filter(({state:e,dismissed:t,user:n})=>e===`APPROVED`&&!t&&n?.login===YE.account?.login),ZA=async(e,t,{deleteBranch:n,closedStatuses:r=[]})=>{if(t.number!==void 0)try{await kD(PO(e,t.number),{method:`PATCH`,body:{state:`closed`}})}catch(e){if(!r.includes(e.cause?.status))throw e}await n(t.branch)},QA=async({pullRequest:e,status:t,state:n,draft:r},{repository:i,updateDraftState:a})=>{let o=n?.toLowerCase();t===`draft`?o===`open`&&!r&&await a(e,!0):(o===`closed`&&await qA(i,e.number),r&&await a(e,!1))},$A={interval:1e4,maxDuration:36e5},ej=e=>{let t=e?.cause?.status;return typeof t==`number`&&t>=400&&t<500&&t!==429},tj=async e=>{let{read:t,check:n,cancel:r,label:i,deadline:o=Date.now()+$A.maxDuration}=e,s=async()=>{try{await r()}catch(e){console.warn(`Failed to cancel the auto-merge on ${i}.`,e)}};if(Date.now()>=o)throw await s(),Error(`Timed out waiting for ${i} to be merged`);await a($A.interval);let c;try{c={item:await t()}}catch(e){if(ej(e))throw e;console.warn(`Failed to read ${i}, still waiting.`,e)}if(c){let{merged:e,failure:t,armed:r}=n(c.item);if(e)return;if(t)throw r&&await s(),Error(`${i[0].toUpperCase()}${i.slice(1)} was not merged: ${t}`)}await tj({...e,deadline:o})},nj=()=>{let{backend:e}=Zf.current??{};return(e&&`cms_label_prefix`in e?e.cms_label_prefix:void 0)||`sveltia-cms/`},rj=()=>[...new Set([nj(),pO,...mO])],ij=e=>`${nj()}${e}`,aj=()=>rj().flatMap(e=>_O.map(t=>`${e}${t}`)),oj=(e,t)=>{let n=aj();return[...e.filter(e=>!n.includes(e)),ij(t)]},sj=e=>{let t;return rj().some(n=>(t=_O.find(t=>e.includes(`${n}${t}`)),!!t)),t},cj=`cms`,lj=200,uj=244,dj=32,fj=new TextEncoder,pj=new Intl.Segmenter,mj=e=>{let t=kT.current;return[cj,t?.owner,t?.repo,e].filter(Boolean).map(e=>`${e}/`).join(``)},hj=()=>mj(ME()),gj=()=>mj(``),_j=e=>e.replaceAll(`%`,`%25`).replaceAll(`/`,`%2F`),vj=e=>e.replaceAll(`%2F`,`/`).replaceAll(`%25`,`%`),yj=e=>fj.encode(_j(e)).length,bj=({collectionName:e,dirPath:t})=>{let n=`${hj()}${e}/`,r=t?yj(`${t}/`):0,i=uj-fj.encode(n).length-r;return Math.max(Math.min(lj,i),dj)},xj=(e,t)=>{let n=Array.from(pj.segment(e),({segment:e})=>e),r=0,i=n.findIndex(e=>(r+=yj(e),r>t));return i===-1?e:n.slice(0,i).join(``)},Sj=({collectionName:e,slug:t})=>`${hj()}${e}/${_j(t)}`,Cj=e=>{let t=hj(),n=gj(),r=!e.startsWith(t);if(r&&(t===n||!e.startsWith(n)))return;let i=e.slice(r?n.length:t.length),a=i.indexOf(`/`);if(!(a<1||a===i.length-1))return{collectionName:i.slice(0,a),slug:vj(i.slice(a+1)),...r&&{legacy:r}}},wj=({branch:e,collectionName:t,slug:n})=>{let r=Cj(e);return r?.collectionName===t&&r.slug===n},Tj=(e,{authRoot:t,authPath:n,tokenPath:r,api:i,...a})=>{let o=`${K(t)}/${K(n)}`;return RO(e,a),Object.assign(vD,{...i,authURL:o,tokenURL:o.replace(`/authorize`,r)}),e};export{Sk as $,Th as $a,Qc as $c,c_ as $i,xi as $l,oE as $n,om as $o,by as $r,Vf as $s,LD as $t,tj as A,ig as Aa,Yd as Ac,yv as Ai,Bo as Al,jE as An,Am as Ao,Jw as Ar,pp as As,NO as At,aA as B,Gh as Ba,Wl as Bc,$_ as Bi,ro as Bl,OE as Bn,mm as Bo,wC as Br,Zf as Bs,UD as Bt,KA as C,Og as Ca,gf as Cc,Ev as Ci,Ks as Cl,GE as Cn,Rm as Co,OT as Cr,Sp as Cs,DO as Ct,UA as D,sg as Da,of as Dc,_v as Di,H as Dl,LE as Dn,Nm as Do,wT as Dr,jp as Ds,PO as Dt,LA as E,cg as Ea,lf as Ec,vv as Ei,ks as El,RE as En,vm as Eo,xT as Er,Tp as Es,kO as Et,SA as F,eg as Fa,bd as Fc,ov as Fi,oo as Fl,yE as Fn,jm as Fo,kw as Fr,fp as Fs,SO as Ft,zk as G,Hh as Ga,vl as Gc,X_ as Gi,ba as Gl,hE as Gn,hm as Go,dC as Gr,Qf as Gs,MD as Gt,nA as H,Yh as Ha,Bl as Hc,nv as Hi,Ya as Hl,EE as Hn,pm as Ho,EC as Hr,tp as Hs,dO as Ht,xA as I,Qh as Ia,Wd as Ic,sv as Ii,go as Il,kE as In,Mm as Io,ww as Ir,hp as Is,xO as It,Bk as J,Fh as Ja,Ol as Jc,G_ as Ji,Ki as Jl,ZT as Jn,am as Jo,KS as Jr,Uf as Js,BD as Jt,Vk as K,Ih as Ka,yl as Kc,rv as Ki,ca as Kl,sE as Kn,_m as Ko,pC as Kr,Xf as Ks,ID as Kt,TA as L,qh as La,Yl as Lc,cv as Li,_o as Ll,TE as Ln,xm as Lo,dw as Lr,lp as Ls,gO as Lt,CA as M,tg as Ma,Kd as Mc,uv as Mi,jo as Ml,NE as Mn,Tm as Mo,Ww as Mr,gp as Ms,bO as Mt,bA as N,ng as Na,Hd as Nc,lv as Ni,No as Nl,bE as Nn,Em as No,Uw as Nr,mp as Ns,yO as Nt,VA as O,dg as Oa,uf as Oc,xv as Oi,Ts as Ol,ME as On,km as Oo,cT as Or,wp as Os,jO as Ot,wA as P,$h as Pa,Ud as Pc,av as Pi,so as Pl,_E as Pn,Cm as Po,Dw as Pr,dp as Ps,EO as Pt,xk as Q,kh as Qa,$c as Qc,h_ as Qi,Bi as Ql,QT as Qn,em as Qo,Mx as Qr,Bf as Qs,VD as Qt,EA as R,Kh as Ra,Jl as Rc,dv as Ri,vo as Rl,wE as Rn,Dm as Ro,sw as Rr,op as Rs,hO as Rt,HA as S,Ig as Sa,vf as Sc,Pv as Si,qs as Sl,UE as Sn,Bm as So,DT as Sr,vp as Ss,BO as St,GA as T,Fg as Ta,ff as Tc,Mv as Ti,Us as Tl,KE as Tn,zm as To,gT as Tr,Cp as Ts,IO as Tt,Yk as U,Vh as Ua,Rl as Uc,tv as Ui,Ra as Ul,CE as Un,um as Uo,sC as Ur,$f as Us,fO as Ut,tA as V,Xh as Va,Kl as Vc,ev as Vi,z as Vl,DE as Vn,dm as Vo,TC as Vr,ep as Vs,HD as Vt,Rk as W,Uh as Wa,Pl as Wc,Y_ as Wi,xa as Wl,vE as Wn,lm as Wo,hC as Wr,np as Ws,ND as Wt,wk as X,Mh as Xa,cl as Xc,v_ as Xi,Yi as Xl,tE as Xn,rm as Xo,JS as Xr,Kf as Xs,FD as Xt,Tk as Y,Nh as Ya,ul as Yc,k_ as Yi,Xi as Yl,aE as Yn,nm as Yo,YS as Yr,q as Ys,zD as Yt,Ck as Z,xh as Za,nl as Zc,__ as Zi,qi as Zl,rE as Zn,im as Zo,GS as Zr,Wf as Zs,PD as Zt,zA as _,Ug as _a,wf as _c,Iv as _i,ic as _l,YE as _n,Wm as _o,FT as _r,Mp as _s,ZO as _t,yj as a,a_ as aa,Lf as ac,Yv as ai,Ic as al,_D as an,mh as ao,JT as ar,Gp as as,tk as at,gr as au,XA as b,jg as ba,yf as bc,Ov as bi,rc as bl,zE as bn,Lm as bo,jT as br,Op as bs,VO as bt,xj as c,Qg as ca,Ef as cc,Uv as ci,Tc as cl,mD as cn,sh as co,KT as cr,zp as cs,ak as ct,rr as cu,ij as d,Wg as da,Df as dc,Hv as di,xc as dl,aD as dn,eh as do,XT as dr,Bp as ds,ck as dt,cr as du,o_ as ea,Gf as ec,my as ei,Zc as el,jD as en,wh as eo,eE as er,cm as es,bk as et,bi as eu,oj as f,Hg as fa,Af as fc,kv as fi,fc as fl,dD as fn,ih as fo,BT as fr,Vp as fs,hk as ft,ur as fu,RA as g,Lg as ga,Tf as gc,Fv as gi,ac as gl,lD as gn,Jm as go,PT as gr,Ip as gs,JO as gt,BA as h,Rg as ha,Nf as hc,jv as hi,lc as hl,iD as hn,qm as ho,kT as hr,Lp as hs,XO as ht,mt as hu,bj as i,r_ as ia,Rf as ic,ry as ii,Lc as il,yD as in,gh as io,RT as ir,Kp as is,gk as it,_r as iu,NA as j,Zh as ja,Gd as jc,Sv as ji,zo as jl,IE as jn,Sm as jo,fT as jr,_p as js,MO as jt,JA as k,rg as ka,Rd as kc,bv as ki,Os as kl,FE as kn,wm as ko,lT as kr,up as ks,FO as kt,aj as l,Xg as la,Of as lc,Bv as li,wc as ll,fD as ln,ph as lo,GT as lr,Hp as ls,nk as lt,fr as lu,YA as m,zg as ma,Mf as mc,wv as mi,gc as ml,pD as mn,ah as mo,IT as mr,Fp as ms,mk as mt,pt as mu,gj as n,e_ as na,qf as nc,Jv as ni,Jc as nl,kD as nn,vh as no,nE as nr,Xp as ns,lk as nt,Ar as nu,wj as o,i_ as oa,Pf as oc,iy as oi,Ac as ol,hD as on,hh as oo,qT as or,qp as os,ok as ot,hr as ou,QA as p,Vg as pa,jf as pc,Cv as pi,dc as pl,uD as pn,nh as po,VT as pr,Pp as ps,vk as pt,N as pu,Mk as q,Bh as qa,Al as qc,K_ as qi,Ji as ql,cE as qn,gm as qo,gC as qr,Hf as qs,RD as qt,Sj as r,$g as ra,Jf as rc,ny as ri,Rc as rl,AD as rn,_h as ro,iE as rr,$p as rs,ik as rt,Fr as ru,Cj as s,Zg as sa,zf as sc,Gv as si,Ec as sl,gD as sn,oh as so,HT as sr,Wp as ss,_k as st,dr as su,Tj as t,n_ as ta,Yf as tc,ty as ti,Xc as tl,vD as tn,yh as to,$T as tr,Zp as ts,uk as tt,Pr as tu,sj as u,Yg as ua,kf as uc,Vv as ui,Sc as ul,nD as un,$m as uo,zT as ur,Up as us,sk as ut,pr as uu,FA as v,Dg as va,bf as vc,Av as vi,nc as vl,JE as vn,Gm as vo,NT as vr,Np as vs,$O as vt,PA as w,Pg as wa,mf as wc,Nv as wi,Gs as wl,HE as wn,Vm as wo,TT as wr,xp as ws,zO as wt,WA as x,Tg as xa,K as xc,Tv as xi,Js as xl,VE as xn,Pm as xo,ET as xr,Dp as xs,HO as xt,ZA as y,Mg as ya,hf as yc,zv as yi,oc as yl,qE as yn,Km as yo,AT as yr,Rp as ys,QO as yt,yA as z,Wh as za,ql as zc,iv as zi,yo as zl,AE as zn,Om as zo,jC as zr,cp as zs,vO as zt};
//# sourceMappingURL=init-Da57-oKP.js.map