nimbi-cms 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nimbi-cms.cjs.js +32 -29
- package/dist/nimbi-cms.css +1 -1
- package/dist/nimbi-cms.es.js +3152 -2885
- package/dist/nimbi-cms.js +50 -47
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
package/dist/nimbi-cms.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var Ts=Object.create;var Ii=Object.defineProperty;var zs=Object.getOwnPropertyDescriptor;var Rs=Object.getOwnPropertyNames;var $s=Object.getPrototypeOf,Ps=Object.prototype.hasOwnProperty;var Is=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Rs(t))!Ps.call(e,r)&&r!==n&&Ii(e,r,{get:()=>t[r],enumerable:!(i=zs(t,r))||i.enumerable});return e};var Ns=(e,t,n)=>(n=e!=null?Ts($s(e)):{},Is(t||!e||!e.__esModule?Ii(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let Pr=0;const Ni=Object.create(null);function Oi(e){try{const t=Number(e);Pr=Number.isFinite(t)&&t>=0?Math.max(0,Math.min(3,Math.floor(t))):0}catch{Pr=0}}function Jt(e=1){try{return Number(Pr)>=Number(e||1)}catch{return!1}}function Yr(){return Jt(1)}function nr(...e){try{if(!Jt(1)||!console||typeof console.error!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.error(...t)}catch{}}function k(...e){try{if(!Jt(2)||!console||typeof console.warn!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.warn(...t)}catch{}}function $t(...e){try{if(!Jt(3)||!console||typeof console.info!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.info(...t)}catch{}}function Bt(...e){try{if(!Jt(3)||!console||typeof console.log!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.log(...t)}catch{}}function ua(e){try{if(!Yr())return;const t=String(e||"");if(!t)return;Ni[t]=(Ni[t]||0)+1}catch{}}function ha(e){try{if(typeof globalThis>"u"||!globalThis.__nimbiCMSDebug)return;const t=String(e||"");if(!t)return;try{globalThis.__nimbiCMSDebug[t]=(globalThis.__nimbiCMSDebug[t]||0)+1}catch{}}catch{}}const Tn={onPageLoad:[],onNavBuild:[],transformHtml:[]};function hr(e,t){if(!Object.prototype.hasOwnProperty.call(Tn,e))throw new Error('Unknown hook "'+e+'"');if(typeof t!="function")throw new TypeError("hook callback must be a function");Tn[e].push(t)}function Os(e){hr("onPageLoad",e)}function Bs(e){hr("onNavBuild",e)}function js(e){hr("transformHtml",e)}async function Ir(e,t){const n=Tn[e]||[];for(const i of n)try{await i(t)}catch(r){try{k("[nimbi-cms] runHooks callback failed",r)}catch{}}}function qs(){Object.keys(Tn).forEach(e=>{Tn[e].length=0})}function da(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Er,Bi;function Hs(){if(Bi)return Er;Bi=1;function e(x){return x instanceof Map?x.clear=x.delete=x.set=function(){throw new Error("map is read-only")}:x instanceof Set&&(x.add=x.clear=x.delete=function(){throw new Error("set is read-only")}),Object.freeze(x),Object.getOwnPropertyNames(x).forEach(B=>{const ee=x[B],we=typeof ee;(we==="object"||we==="function")&&!Object.isFrozen(ee)&&e(ee)}),x}class t{constructor(B){B.data===void 0&&(B.data={}),this.data=B.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(x){return x.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(x,...B){const ee=Object.create(null);for(const we in x)ee[we]=x[we];return B.forEach(function(we){for(const Ue in we)ee[Ue]=we[Ue]}),ee}const r="</span>",a=x=>!!x.scope,s=(x,{prefix:B})=>{if(x.startsWith("language:"))return x.replace("language:","language-");if(x.includes(".")){const ee=x.split(".");return[`${B}${ee.shift()}`,...ee.map((we,Ue)=>`${we}${"_".repeat(Ue+1)}`)].join(" ")}return`${B}${x}`};class o{constructor(B,ee){this.buffer="",this.classPrefix=ee.classPrefix,B.walk(this)}addText(B){this.buffer+=n(B)}openNode(B){if(!a(B))return;const ee=s(B.scope,{prefix:this.classPrefix});this.span(ee)}closeNode(B){a(B)&&(this.buffer+=r)}value(){return this.buffer}span(B){this.buffer+=`<span class="${B}">`}}const l=(x={})=>{const B={children:[]};return Object.assign(B,x),B};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(B){this.top.children.push(B)}openNode(B){const ee=l({scope:B});this.add(ee),this.stack.push(ee)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(B){return this.constructor._walk(B,this.rootNode)}static _walk(B,ee){return typeof ee=="string"?B.addText(ee):ee.children&&(B.openNode(ee),ee.children.forEach(we=>this._walk(B,we)),B.closeNode(ee)),B}static _collapse(B){typeof B!="string"&&B.children&&(B.children.every(ee=>typeof ee=="string")?B.children=[B.children.join("")]:B.children.forEach(ee=>{c._collapse(ee)}))}}class u extends c{constructor(B){super(),this.options=B}addText(B){B!==""&&this.add(B)}startScope(B){this.openNode(B)}endScope(){this.closeNode()}__addSublanguage(B,ee){const we=B.root;ee&&(we.scope=`language:${ee}`),this.add(we)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(x){return x?typeof x=="string"?x:x.source:null}function h(x){return m("(?=",x,")")}function d(x){return m("(?:",x,")*")}function p(x){return m("(?:",x,")?")}function m(...x){return x.map(ee=>g(ee)).join("")}function f(x){const B=x[x.length-1];return typeof B=="object"&&B.constructor===Object?(x.splice(x.length-1,1),B):{}}function w(...x){return"("+(f(x).capture?"":"?:")+x.map(we=>g(we)).join("|")+")"}function y(x){return new RegExp(x.toString()+"|").exec("").length-1}function _(x,B){const ee=x&&x.exec(B);return ee&&ee.index===0}const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function v(x,{joinWith:B}){let ee=0;return x.map(we=>{ee+=1;const Ue=ee;let We=g(we),oe="";for(;We.length>0;){const ae=b.exec(We);if(!ae){oe+=We;break}oe+=We.substring(0,ae.index),We=We.substring(ae.index+ae[0].length),ae[0][0]==="\\"&&ae[1]?oe+="\\"+String(Number(ae[1])+Ue):(oe+=ae[0],ae[0]==="("&&ee++)}return oe}).map(we=>`(${we})`).join(B)}const S=/\b\B/,E="[a-zA-Z]\\w*",P="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",z="\\b(0b[01]+)",O="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",W=(x={})=>{const B=/^#![ ]*\//;return x.binary&&(x.begin=m(B,/.*\b/,x.binary,/\b.*/)),i({scope:"meta",begin:B,end:/$/,relevance:0,"on:begin":(ee,we)=>{ee.index!==0&&we.ignoreMatch()}},x)},te={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[te]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[te]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},G=function(x,B,ee={}){const we=i({scope:"comment",begin:x,end:B,contains:[]},ee);we.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ue=w("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return we.contains.push({begin:m(/[ ]+/,"(",Ue,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),we},ie=G("//","$"),ye=G("/\\*","\\*/"),J=G("#","$"),Te={scope:"number",begin:I,relevance:0},ke={scope:"number",begin:U,relevance:0},xe={scope:"number",begin:z,relevance:0},Ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[te,{begin:/\[/,end:/\]/,relevance:0,contains:[te]}]},He={scope:"title",begin:E,relevance:0},R={scope:"title",begin:P,relevance:0},N={begin:"\\.\\s*"+P,relevance:0};var A=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:te,BINARY_NUMBER_MODE:xe,BINARY_NUMBER_RE:z,COMMENT:G,C_BLOCK_COMMENT_MODE:ye,C_LINE_COMMENT_MODE:ie,C_NUMBER_MODE:ke,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(x){return Object.assign(x,{"on:begin":(B,ee)=>{ee.data._beginMatch=B[1]},"on:end":(B,ee)=>{ee.data._beginMatch!==B[1]&&ee.ignoreMatch()}})},HASH_COMMENT_MODE:J,IDENT_RE:E,MATCH_NOTHING_RE:S,METHOD_GUARD:N,NUMBER_MODE:Te,NUMBER_RE:I,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:M,REGEXP_MODE:Ce,RE_STARTERS_RE:O,SHEBANG:W,TITLE_MODE:He,UNDERSCORE_IDENT_RE:P,UNDERSCORE_TITLE_MODE:R});function L(x,B){x.input[x.index-1]==="."&&B.ignoreMatch()}function D(x,B){x.className!==void 0&&(x.scope=x.className,delete x.className)}function K(x,B){B&&x.beginKeywords&&(x.begin="\\b("+x.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",x.__beforeBegin=L,x.keywords=x.keywords||x.beginKeywords,delete x.beginKeywords,x.relevance===void 0&&(x.relevance=0))}function q(x,B){Array.isArray(x.illegal)&&(x.illegal=w(...x.illegal))}function $(x,B){if(x.match){if(x.begin||x.end)throw new Error("begin & end are not supported with match");x.begin=x.match,delete x.match}}function T(x,B){x.relevance===void 0&&(x.relevance=1)}const j=(x,B)=>{if(!x.beforeMatch)return;if(x.starts)throw new Error("beforeMatch cannot be used with starts");const ee=Object.assign({},x);Object.keys(x).forEach(we=>{delete x[we]}),x.keywords=ee.keywords,x.begin=m(ee.beforeMatch,h(ee.begin)),x.starts={relevance:0,contains:[Object.assign(ee,{endsParent:!0})]},x.relevance=0,delete ee.beforeMatch},X=["of","and","for","in","not","or","if","then","parent","list","value"],se="keyword";function pe(x,B,ee=se){const we=Object.create(null);return typeof x=="string"?Ue(ee,x.split(" ")):Array.isArray(x)?Ue(ee,x):Object.keys(x).forEach(function(We){Object.assign(we,pe(x[We],B,We))}),we;function Ue(We,oe){B&&(oe=oe.map(ae=>ae.toLowerCase())),oe.forEach(function(ae){const me=ae.split("|");we[me[0]]=[We,be(me[0],me[1])]})}}function be(x,B){return B?Number(B):ge(x)?0:1}function ge(x){return X.includes(x.toLowerCase())}const Se={},ze=x=>{console.error(x)},Fe=(x,...B)=>{console.log(`WARN: ${x}`,...B)},Ge=(x,B)=>{Se[`${x}/${B}`]||(console.log(`Deprecated as of ${x}. ${B}`),Se[`${x}/${B}`]=!0)},Et=new Error;function dn(x,B,{key:ee}){let we=0;const Ue=x[ee],We={},oe={};for(let ae=1;ae<=B.length;ae++)oe[ae+we]=Ue[ae],We[ae+we]=!0,we+=y(B[ae-1]);x[ee]=oe,x[ee]._emit=We,x[ee]._multi=!0}function Ct(x){if(Array.isArray(x.begin)){if(x.skip||x.excludeBegin||x.returnBegin)throw ze("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Et;if(typeof x.beginScope!="object"||x.beginScope===null)throw ze("beginScope must be object"),Et;dn(x,x.begin,{key:"beginScope"}),x.begin=v(x.begin,{joinWith:""})}}function is(x){if(Array.isArray(x.end)){if(x.skip||x.excludeEnd||x.returnEnd)throw ze("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Et;if(typeof x.endScope!="object"||x.endScope===null)throw ze("endScope must be object"),Et;dn(x,x.end,{key:"endScope"}),x.end=v(x.end,{joinWith:""})}}function as(x){x.scope&&typeof x.scope=="object"&&x.scope!==null&&(x.beginScope=x.scope,delete x.scope)}function ss(x){as(x),typeof x.beginScope=="string"&&(x.beginScope={_wrap:x.beginScope}),typeof x.endScope=="string"&&(x.endScope={_wrap:x.endScope}),Ct(x),is(x)}function os(x){function B(oe,ae){return new RegExp(g(oe),"m"+(x.case_insensitive?"i":"")+(x.unicodeRegex?"u":"")+(ae?"g":""))}class ee{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ae,me){me.position=this.position++,this.matchIndexes[this.matchAt]=me,this.regexes.push([me,ae]),this.matchAt+=y(ae)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ae=this.regexes.map(me=>me[1]);this.matcherRe=B(v(ae,{joinWith:"|"}),!0),this.lastIndex=0}exec(ae){this.matcherRe.lastIndex=this.lastIndex;const me=this.matcherRe.exec(ae);if(!me)return null;const Ve=me.findIndex((fn,_r)=>_r>0&&fn!==void 0),Ze=this.matchIndexes[Ve];return me.splice(0,Ve),Object.assign(me,Ze)}}class we{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ae){if(this.multiRegexes[ae])return this.multiRegexes[ae];const me=new ee;return this.rules.slice(ae).forEach(([Ve,Ze])=>me.addRule(Ve,Ze)),me.compile(),this.multiRegexes[ae]=me,me}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ae,me){this.rules.push([ae,me]),me.type==="begin"&&this.count++}exec(ae){const me=this.getMatcher(this.regexIndex);me.lastIndex=this.lastIndex;let Ve=me.exec(ae);if(this.resumingScanAtSamePosition()&&!(Ve&&Ve.index===this.lastIndex)){const Ze=this.getMatcher(0);Ze.lastIndex=this.lastIndex+1,Ve=Ze.exec(ae)}return Ve&&(this.regexIndex+=Ve.position+1,this.regexIndex===this.count&&this.considerAll()),Ve}}function Ue(oe){const ae=new we;return oe.contains.forEach(me=>ae.addRule(me.begin,{rule:me,type:"begin"})),oe.terminatorEnd&&ae.addRule(oe.terminatorEnd,{type:"end"}),oe.illegal&&ae.addRule(oe.illegal,{type:"illegal"}),ae}function We(oe,ae){const me=oe;if(oe.isCompiled)return me;[D,$,ss,j].forEach(Ze=>Ze(oe,ae)),x.compilerExtensions.forEach(Ze=>Ze(oe,ae)),oe.__beforeBegin=null,[K,q,T].forEach(Ze=>Ze(oe,ae)),oe.isCompiled=!0;let Ve=null;return typeof oe.keywords=="object"&&oe.keywords.$pattern&&(oe.keywords=Object.assign({},oe.keywords),Ve=oe.keywords.$pattern,delete oe.keywords.$pattern),Ve=Ve||/\w+/,oe.keywords&&(oe.keywords=pe(oe.keywords,x.case_insensitive)),me.keywordPatternRe=B(Ve,!0),ae&&(oe.begin||(oe.begin=/\B|\b/),me.beginRe=B(me.begin),!oe.end&&!oe.endsWithParent&&(oe.end=/\B|\b/),oe.end&&(me.endRe=B(me.end)),me.terminatorEnd=g(me.end)||"",oe.endsWithParent&&ae.terminatorEnd&&(me.terminatorEnd+=(oe.end?"|":"")+ae.terminatorEnd)),oe.illegal&&(me.illegalRe=B(oe.illegal)),oe.contains||(oe.contains=[]),oe.contains=[].concat(...oe.contains.map(function(Ze){return ls(Ze==="self"?oe:Ze)})),oe.contains.forEach(function(Ze){We(Ze,me)}),oe.starts&&We(oe.starts,ae),me.matcher=Ue(me),me}if(x.compilerExtensions||(x.compilerExtensions=[]),x.contains&&x.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return x.classNameAliases=i(x.classNameAliases||{}),We(x)}function Si(x){return x?x.endsWithParent||Si(x.starts):!1}function ls(x){return x.variants&&!x.cachedVariants&&(x.cachedVariants=x.variants.map(function(B){return i(x,{variants:null},B)})),x.cachedVariants?x.cachedVariants:Si(x)?i(x,{starts:x.starts?i(x.starts):null}):Object.isFrozen(x)?i(x):x}var cs="11.11.1";class us extends Error{constructor(B,ee){super(B),this.name="HTMLInjectionError",this.html=ee}}const wr=n,vi=i,Ai=Symbol("nomatch"),hs=7,Ei=function(x){const B=Object.create(null),ee=Object.create(null),we=[];let Ue=!0;const We="Could not find the language '{}', did you forget to load/include a language module?",oe={disableAutodetect:!0,name:"Plain text",contains:[]};let ae={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function me(Q){return ae.noHighlightRe.test(Q)}function Ve(Q){let ue=Q.className+" ";ue+=Q.parentNode?Q.parentNode.className:"";const Me=ae.languageDetectRe.exec(ue);if(Me){const Be=Tt(Me[1]);return Be||(Fe(We.replace("{}",Me[1])),Fe("Falling back to no-highlight mode for this block.",Q)),Be?Me[1]:"no-highlight"}return ue.split(/\s+/).find(Be=>me(Be)||Tt(Be))}function Ze(Q,ue,Me){let Be="",Xe="";typeof ue=="object"?(Be=Q,Me=ue.ignoreIllegals,Xe=ue.language):(Ge("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ge("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
3
|
-
`,1;if(vr>1e5&&vr>ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return je+=ve,ve.length}const kt=Tt(Q);if(!kt)throw ze(We.replace("{}",Q)),new Error('Unknown language: "'+Q+'"');const Cs=os(kt);let Sr="",_e=Be||Cs;const Pi={},Ye=new ae.__emitter(ae);Es();let je="",Fn=0,Ft=0,vr=0,Ar=!1;try{if(kt.__emitTokens)kt.__emitTokens(ue,Ye);else{for(_e.matcher.considerAll();;){vr++,Ar?Ar=!1:_e.matcher.considerAll(),_e.matcher.lastIndex=Ft;const ne=_e.matcher.exec(ue);if(!ne)break;const ce=ue.substring(Ft,ne.index),ve=$i(ce,ne);Ft=ne.index+ve}$i(ue.substring(Ft))}return Ye.finalize(),Sr=Ye.toHTML(),{language:Q,value:Sr,relevance:Fn,illegal:!1,_emitter:Ye,_top:_e}}catch(ne){if(ne.message&&ne.message.includes("Illegal"))return{language:Q,value:wr(ue),illegal:!0,relevance:0,_illegalBy:{message:ne.message,index:Ft,context:ue.slice(Ft-100,Ft+100),mode:ne.mode,resultSoFar:Sr},_emitter:Ye};if(Ue)return{language:Q,value:wr(ue),illegal:!1,relevance:0,errorRaised:ne,_emitter:Ye,_top:_e};throw ne}}function _r(Q){const ue={value:wr(Q),illegal:!1,relevance:0,_top:oe,_emitter:new ae.__emitter(ae)};return ue._emitter.addText(Q),ue}function kr(Q,ue){ue=ue||ae.languages||Object.keys(B);const Me=_r(Q),Be=ue.filter(Tt).filter(Li).map(lt=>fn(lt,Q,!1));Be.unshift(Me);const Xe=Be.sort((lt,_t)=>{if(lt.relevance!==_t.relevance)return _t.relevance-lt.relevance;if(lt.language&&_t.language){if(Tt(lt.language).supersetOf===_t.language)return 1;if(Tt(_t.language).supersetOf===lt.language)return-1}return 0}),[yt,zt]=Xe,qn=yt;return qn.secondBest=zt,qn}function ds(Q,ue,Me){const Be=ue&&ee[ue]||Me;Q.classList.add("hljs"),Q.classList.add(`language-${Be}`)}function xr(Q){let ue=null;const Me=Ve(Q);if(me(Me))return;if(jn("before:highlightElement",{el:Q,language:Me}),Q.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Q);return}if(Q.children.length>0&&(ae.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Q)),ae.throwUnescapedHTML))throw new us("One of your code blocks includes unescaped HTML.",Q.innerHTML);ue=Q;const Be=ue.textContent,Xe=Me?Ze(Be,{language:Me,ignoreIllegals:!0}):kr(Be);Q.innerHTML=Xe.value,Q.dataset.highlighted="yes",ds(Q,Me,Xe.language),Q.result={language:Xe.language,re:Xe.relevance,relevance:Xe.relevance},Xe.secondBest&&(Q.secondBest={language:Xe.secondBest.language,relevance:Xe.secondBest.relevance}),jn("after:highlightElement",{el:Q,result:Xe,text:Be})}function fs(Q){ae=vi(ae,Q)}const gs=()=>{Bn(),Ge("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ps(){Bn(),Ge("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ci=!1;function Bn(){function Q(){Bn()}if(document.readyState==="loading"){Ci||window.addEventListener("DOMContentLoaded",Q,!1),Ci=!0;return}document.querySelectorAll(ae.cssSelector).forEach(xr)}function ms(Q,ue){let Me=null;try{Me=ue(x)}catch(Be){if(ze("Language definition for '{}' could not be registered.".replace("{}",Q)),Ue)ze(Be);else throw Be;Me=oe}Me.name||(Me.name=Q),B[Q]=Me,Me.rawDefinition=ue.bind(null,x),Me.aliases&&Mi(Me.aliases,{languageName:Q})}function ys(Q){delete B[Q];for(const ue of Object.keys(ee))ee[ue]===Q&&delete ee[ue]}function bs(){return Object.keys(B)}function Tt(Q){return Q=(Q||"").toLowerCase(),B[Q]||B[ee[Q]]}function Mi(Q,{languageName:ue}){typeof Q=="string"&&(Q=[Q]),Q.forEach(Me=>{ee[Me.toLowerCase()]=ue})}function Li(Q){const ue=Tt(Q);return ue&&!ue.disableAutodetect}function ws(Q){Q["before:highlightBlock"]&&!Q["before:highlightElement"]&&(Q["before:highlightElement"]=ue=>{Q["before:highlightBlock"](Object.assign({block:ue.el},ue))}),Q["after:highlightBlock"]&&!Q["after:highlightElement"]&&(Q["after:highlightElement"]=ue=>{Q["after:highlightBlock"](Object.assign({block:ue.el},ue))})}function _s(Q){ws(Q),we.push(Q)}function ks(Q){const ue=we.indexOf(Q);ue!==-1&&we.splice(ue,1)}function jn(Q,ue){const Me=Q;we.forEach(function(Be){Be[Me]&&Be[Me](ue)})}function xs(Q){return Ge("10.7.0","highlightBlock will be removed entirely in v12.0"),Ge("10.7.0","Please use highlightElement now."),xr(Q)}Object.assign(x,{highlight:Ze,highlightAuto:kr,highlightAll:Bn,highlightElement:xr,highlightBlock:xs,configure:fs,initHighlighting:gs,initHighlightingOnLoad:ps,registerLanguage:ms,unregisterLanguage:ys,listLanguages:bs,getLanguage:Tt,registerAliases:Mi,autoDetection:Li,inherit:vi,addPlugin:_s,removePlugin:ks}),x.debugMode=function(){Ue=!1},x.safeMode=function(){Ue=!0},x.versionString=cs,x.regex={concat:m,lookahead:h,either:w,optional:p,anyNumberOfTimes:d};for(const Q in A)typeof A[Q]=="object"&&e(A[Q]);return Object.assign(x,A),x},en=Ei({});return en.newInstance=()=>Ei({}),Er=en,en.HighlightJS=en,en.default=en,Er}var Fs=Hs();const Re=da(Fs);class dr{constructor(t={}){const{maxSize:n=0,ttlMs:i=0,onEvict:r=null}=t||{};this._map=new Map,this._maxSize=Math.max(0,Number(n)||0),this._ttlMs=Math.max(0,Number(i)||0),this._onEvict=typeof r=="function"?r:null}get size(){return this._map.size}has(t){const n=this._map.get(t);return n?this._ttlMs&&Date.now()-(n.ts||0)>=this._ttlMs?(this._evictKey(t,n),!1):(this._map.delete(t),this._map.set(t,n),!0):!1}get(t){const n=this._map.get(t);if(n){if(this._ttlMs&&Date.now()-(n.ts||0)>=this._ttlMs){this._evictKey(t,n);return}return this._map.delete(t),this._map.set(t,n),n.value}}set(t,n){if(this._map.has(t)&&this._map.delete(t),this._map.set(t,{value:n,ts:Date.now()}),this._maxSize&&this._map.size>this._maxSize)for(;this._map.size>this._maxSize;){const i=this._map.keys().next().value,r=this._map.get(i);if(this._map.delete(i),this._onEvict)try{this._onEvict(i,r&&r.value)}catch{}}return this}delete(t){return this._map.delete(t)}clear(){if(this._onEvict)for(const[t,n]of this._map.entries())try{this._onEvict(t,n&&n.value)}catch{}this._map.clear()}_evictKey(t,n){try{this._map.delete(t)}catch{}if(this._onEvict)try{this._onEvict(t,n&&n.value)}catch{}}}const Qn=new dr({maxSize:500});let fa=300*1e3;function Ds(){Qn.clear()}function Us(e){fa=Number(e)||0}async function Jr(e,t){try{if(!e)return null;const n=Date.now();let i=Qn.get(e);if(i&&i.ok===!1&&n-(i.ts||0)>=fa&&(Qn.delete(e),i=void 0),i){if(i.module)return i.module;if(i.promise)try{return await i.promise}catch{return null}}const r={promise:null,module:null,ok:null,ts:Date.now()};Qn.set(e,r),r.promise=(async()=>{try{return await t()}catch{return null}})();try{const a=await r.promise;return r.module=a,r.ok=!!a,r.ts=Date.now(),a}catch{return r.module=null,r.ok=!1,r.ts=Date.now(),null}}catch{return null}}async function Ws(e){return await Jr(e,async()=>{try{return await import(e)}catch{return null}})}const Zs="11.11.1",Ae=new Map,Gs="https://raw.githubusercontent.com/highlightjs/highlight.js/main/SUPPORTED_LANGUAGES.md",ht={shell:"bash",sh:"bash",zsh:"bash",js:"javascript",ts:"typescript",py:"python",csharp:"cs","c#":"cs"};ht.html="xml";ht.xhtml="xml";ht.markup="xml";const ei=new Set(["magic","undefined"]);let Nt=null,Xs=null;async function ti(e=Gs){if(e)return Nt||(Nt=(async()=>{try{const t=await fetch(e);if(!t.ok)return;const i=(await t.text()).split(/\r?\n/);let r=-1;for(let c=0;c<i.length;c++)if(/\|\s*Language\s*\|/i.test(i[c])){r=c;break}if(r===-1)return;const a=i[r].replace(/^\||\|$/g,"").split("|").map(c=>c.trim().toLowerCase());let s=a.findIndex(c=>/alias|aliases|equivalent|alt|alternates?/i.test(c));s===-1&&(s=1);let o=a.findIndex(c=>/file|filename|module|module name|module-name|short|slug/i.test(c));if(o===-1){const c=a.findIndex(u=>/language/i.test(u));o=c!==-1?c:0}let l=[];for(let c=r+1;c<i.length;c++){const u=i[c].trim();if(!u||!u.startsWith("|"))break;const g=u.replace(/^\||\|$/g,"").split("|").map(f=>f.trim());if(g.every(f=>/^-+$/.test(f)))continue;const h=g;if(!h.length)continue;const p=(h[o]||h[0]||"").toString().trim().toLowerCase();if(!p||/^-+$/.test(p))continue;Ae.set(p,p);const m=h[s]||"";if(m){const f=String(m).split(",").map(w=>w.replace(/`/g,"").trim()).filter(Boolean);if(f.length){const y=f[0].toLowerCase().replace(/^[:]+/,"").replace(/[^a-z0-9_-]+/ig,"");y&&/[a-z0-9]/i.test(y)&&(Ae.set(y,y),l.push(y))}}}try{const c=[];for(const u of l){const g=String(u||"").replace(/^[:]+/,"").replace(/[^a-z0-9_-]+/ig,"");g&&/[a-z0-9]/i.test(g)?c.push(g):Ae.delete(u)}l=c}catch(c){k("[codeblocksManager] cleanup aliases failed",c)}try{let c=0;for(const u of Array.from(Ae.keys())){if(!u||/^-+$/.test(u)||!/[a-z0-9]/i.test(u)){Ae.delete(u),c++;continue}if(/^[:]+/.test(u)){const g=u.replace(/^[:]+/,"");if(g&&/[a-z0-9]/i.test(g)){const h=Ae.get(u);Ae.delete(u),Ae.set(g,h)}else Ae.delete(u),c++}}for(const[u,g]of Array.from(Ae.entries()))(!g||/^-+$/.test(g)||!/[a-z0-9]/i.test(g))&&(Ae.delete(u),c++);try{const u=":---------------------";Ae.has(u)&&(Ae.delete(u),c++)}catch(u){k("[codeblocksManager] remove sep key failed",u)}try{const u=Array.from(Ae.keys()).sort()}catch(u){k("[codeblocksManager] compute supported keys failed",u)}}catch(c){k("[codeblocksManager] ignored error",c)}}catch(t){k("[codeblocksManager] loadSupportedLanguages failed",t)}})(),Nt)}const gn=new Set;async function on(e,t){if(Nt||(async()=>{try{await ti()}catch(r){k("[codeblocksManager] loadSupportedLanguages (IIFE) failed",r)}})(),Nt)try{await Nt}catch{}if(e=e==null?"":String(e),e=e.trim(),!e)return!1;const n=e.toLowerCase();if(ei.has(n))return!1;if(Ae.size&&!Ae.has(n)){const r=ht;if(!r[n]&&!r[e])return!1}if(gn.has(e))return!0;const i=ht;try{const r=(t||e||"").toString().replace(/\.js$/i,"").trim(),a=(i[e]||e||"").toString(),s=(i[r]||r||"").toString();let o=Array.from(new Set([a,s,r,e,i[r],i[e]].filter(Boolean))).map(u=>String(u).toLowerCase()).filter(u=>u&&u!=="undefined");Ae.size&&(o=o.filter(u=>{if(Ae.has(u))return!0;const g=ht[u];return!!(g&&Ae.has(g))}));let l=null,c=null;for(const u of o)try{if(l=await Jr(u,async()=>{try{try{try{return await import(`highlight.js/lib/languages/${u}.js`)}catch{return await import(`highlight.js/lib/languages/${u}`)}}catch{try{return await import(`https://cdn.jsdelivr.net/npm/highlight.js/es/languages/${u}.js`)}catch{try{return await import(`https://cdn.jsdelivr.net/npm/highlight.js/lib/languages/${u}.js`)}catch{return null}}}}catch{return null}}),l){const g=l.default||l;try{const h=Ae.size&&Ae.get(e)||u||e;return Re.registerLanguage(h,g),gn.add(h),h!==e&&(Re.registerLanguage(e,g),gn.add(e)),!0}catch(h){c=h}}else try{if(Ae.has(u)||Ae.has(e)){const g=()=>({});try{Re.registerLanguage(u,g),gn.add(u)}catch{}try{u!==e&&(Re.registerLanguage(e,g),gn.add(e))}catch{}return!0}}catch{}}catch(g){c=g}if(c)throw c;return!1}catch{return!1}}let Dn=null;function ga(e){const t=e&&e.querySelector?e:typeof document<"u"?document:null;Nt||(async()=>{try{await ti()}catch(s){k("[codeblocksManager] loadSupportedLanguages (observer) failed",s)}})();const n=ht,r=Dn||(typeof IntersectionObserver>"u"?null:(Dn=new IntersectionObserver((s,o)=>{s.forEach(l=>{if(!l.isIntersecting)return;const c=l.target;try{o.unobserve(c)}catch(u){k("[codeblocksManager] observer unobserve failed",u)}(async()=>{try{const u=c.getAttribute&&c.getAttribute("class")||c.className||"",g=u.match(/language-([a-zA-Z0-9_+-]+)/)||u.match(/lang(?:uage)?-?([a-zA-Z0-9_+-]+)/);if(g&&g[1]){const h=(g[1]||"").toLowerCase(),d=n[h]||h,p=Ae.size&&(Ae.get(d)||Ae.get(String(d).toLowerCase()))||d;try{await on(p)}catch(m){k("[codeblocksManager] registerLanguage failed",m)}try{try{const m=c.textContent||c.innerText||"";m!=null&&(c.textContent=m)}catch{}try{c&&c.dataset&&c.dataset.highlighted&&delete c.dataset.highlighted}catch{}Re.highlightElement(c)}catch(m){k("[codeblocksManager] hljs.highlightElement failed",m)}}else try{const h=c.textContent||"";try{if(Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")){const d=Re.highlight(h,{language:"plaintext"});if(d&&d.value)try{if(typeof document<"u"&&document.createRange&&typeof document.createRange=="function"){const p=document.createRange().createContextualFragment(d.value);if(typeof c.replaceChildren=="function")c.replaceChildren(...Array.from(p.childNodes));else{for(;c.firstChild;)c.removeChild(c.firstChild);c.appendChild(p)}}else c.innerHTML=d.value}catch{try{c.innerHTML=d.value}catch{}}}}catch{try{Re.highlightElement(c)}catch(p){k("[codeblocksManager] fallback highlightElement failed",p)}}}catch(h){k("[codeblocksManager] auto-detect plaintext failed",h)}}catch(u){k("[codeblocksManager] observer entry processing failed",u)}})()})},{root:null,rootMargin:"300px",threshold:.1}),Dn)),a=t&&t.querySelectorAll?t.querySelectorAll("pre code"):[];if(!r){a.forEach(async s=>{try{const o=s.getAttribute&&s.getAttribute("class")||s.className||"",l=o.match(/language-([a-zA-Z0-9_+-]+)/)||o.match(/lang(?:uage)?-?([a-zA-Z0-9_+-]+)/);if(l&&l[1]){const c=(l[1]||"").toLowerCase(),u=n[c]||c,g=Ae.size&&(Ae.get(u)||Ae.get(String(u).toLowerCase()))||u;try{await on(g)}catch(h){k("[codeblocksManager] registerLanguage failed (no observer)",h)}}try{try{const c=s.textContent||s.innerText||"";c!=null&&(s.textContent=c)}catch{}try{s&&s.dataset&&s.dataset.highlighted&&delete s.dataset.highlighted}catch{}Re.highlightElement(s)}catch(c){k("[codeblocksManager] hljs.highlightElement failed (no observer)",c)}}catch(o){k("[codeblocksManager] loadSupportedLanguages fallback ignored error",o)}});return}a.forEach(s=>{try{r.observe(s)}catch(o){k("[codeblocksManager] observe failed",o)}})}function Qs(e,{useCdn:t=!0}={}){const n=typeof document<"u"&&document.head&&document.head.querySelector?document.head.querySelector("link[data-hl-theme]"):typeof document<"u"?document.querySelector("link[data-hl-theme]"):null,i=n&&n.getAttribute?n.getAttribute("data-hl-theme"):null,r=e==null?"default":String(e),a=r&&String(r).toLowerCase()||"";if(a==="default"||a==="monokai"){try{n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}return}if(i&&i.toLowerCase()===a)return;if(!t){try{k("Requested highlight theme not bundled; set useCdn=true to load theme from CDN")}catch{}return}const s=a,o=`https://cdn.jsdelivr.net/npm/highlight.js@${Zs}/styles/${s}.css`,l=document.createElement("link");l.rel="stylesheet",l.href=o,l.setAttribute("data-hl-theme",s),l.addEventListener("load",()=>{try{n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}}),document.head.appendChild(l)}let Dt="light";function Ks(e,t={}){if(document.querySelector(`link[href="${e}"]`))return;const n=document.createElement("link");if(n.rel="stylesheet",n.href=e,Object.entries(t).forEach(([i,r])=>n.setAttribute(i,r)),document.head.appendChild(n),t["data-bulmaswatch-theme"])try{if(n.getAttribute("data-bulmaswatch-observer"))return;let i=Number(n.getAttribute("data-bulmaswatch-move-count")||0),r=!1;const a=new MutationObserver(()=>{try{if(r)return;const o=n.parentNode;if(!o||o.lastElementChild===n)return;if(i>=1e3){n.setAttribute("data-bulmaswatch-move-stopped","1");return}r=!0;try{o.appendChild(n)}catch{}i+=1,n.setAttribute("data-bulmaswatch-move-count",String(i)),r=!1}catch{}});try{a.observe(document.head,{childList:!0}),n.setAttribute("data-bulmaswatch-observer","1"),n.setAttribute("data-bulmaswatch-move-count",String(i))}catch{}const s=document.head;s&&s.lastElementChild!==n&&s.appendChild(n)}catch{}}function Cr(){try{const e=typeof document<"u"&&document.head?document.head:document,t=Array.from(e.querySelectorAll("link[data-bulmaswatch-theme]"));for(const n of t)n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}try{const e=typeof document<"u"&&document.head?document.head:document,t=Array.from(e.querySelectorAll("style[data-bulma-override]"));for(const n of t)n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}}async function pa(e="none",t="/"){try{Bt("[bulmaManager] ensureBulma called",{bulmaCustomize:e,pageDir:t})}catch{}if(!e)return;if(e==="none"){try{Cr()}catch{}return}const n=[t+"bulma.css","/bulma.css"],i=Array.from(new Set(n));if(e==="local"){if(Cr(),document.querySelector("style[data-bulma-override]"))return;for(const r of i)try{const a=await fetch(r,{method:"GET"});if(a.ok){const s=await a.text(),o=document.createElement("style");o.setAttribute("data-bulma-override",r),o.appendChild(document.createTextNode(`
|
|
1
|
+
"use strict";var Is=Object.create;var qi=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var Os=Object.getOwnPropertyNames;var Bs=Object.getPrototypeOf,js=Object.prototype.hasOwnProperty;var qs=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Os(t))!js.call(e,r)&&r!==n&&qi(e,r,{get:()=>t[r],enumerable:!(i=Ns(t,r))||i.enumerable});return e};var Hs=(e,t,n)=>(n=e!=null?Is(Bs(e)):{},qs(t||!e||!e.__esModule?qi(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let Br=0;const Hi=Object.create(null);function Fi(e){try{const t=Number(e);Br=Number.isFinite(t)&&t>=0?Math.max(0,Math.min(3,Math.floor(t))):0}catch{Br=0}}function tn(e=1){try{return Number(Br)>=Number(e||1)}catch{return!1}}function ii(){return tn(1)}function sr(...e){try{if(!tn(1)||!console||typeof console.error!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.error(...t)}catch{}}function k(...e){try{if(!tn(2)||!console||typeof console.warn!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.warn(...t)}catch{}}function $t(...e){try{if(!tn(3)||!console||typeof console.info!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.info(...t)}catch{}}function jt(...e){try{if(!tn(3)||!console||typeof console.log!="function")return;const t=e.map(n=>typeof n=="function"?n():n);console.log(...t)}catch{}}function ga(e){try{if(!ii())return;const t=String(e||"");if(!t)return;Hi[t]=(Hi[t]||0)+1}catch{}}function pa(e){try{if(typeof globalThis>"u"||!globalThis.__nimbiCMSDebug)return;const t=String(e||"");if(!t)return;try{globalThis.__nimbiCMSDebug[t]=(globalThis.__nimbiCMSDebug[t]||0)+1}catch{}}catch{}}const zn={onPageLoad:[],onNavBuild:[],transformHtml:[]};function gr(e,t){if(!Object.prototype.hasOwnProperty.call(zn,e))throw new Error('Unknown hook "'+e+'"');if(typeof t!="function")throw new TypeError("hook callback must be a function");zn[e].push(t)}function Fs(e){gr("onPageLoad",e)}function Ds(e){gr("onNavBuild",e)}function Us(e){gr("transformHtml",e)}async function jr(e,t){const n=zn[e]||[];for(const i of n)try{await i(t)}catch(r){try{k("[nimbi-cms] runHooks callback failed",r)}catch{}}}function Ws(){Object.keys(zn).forEach(e=>{zn[e].length=0})}function ma(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tr,Di;function Zs(){if(Di)return Tr;Di=1;function e(x){return x instanceof Map?x.clear=x.delete=x.set=function(){throw new Error("map is read-only")}:x instanceof Set&&(x.add=x.clear=x.delete=function(){throw new Error("set is read-only")}),Object.freeze(x),Object.getOwnPropertyNames(x).forEach(F=>{const te=x[F],ke=typeof te;(ke==="object"||ke==="function")&&!Object.isFrozen(te)&&e(te)}),x}class t{constructor(F){F.data===void 0&&(F.data={}),this.data=F.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(x){return x.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(x,...F){const te=Object.create(null);for(const ke in x)te[ke]=x[ke];return F.forEach(function(ke){for(const Ue in ke)te[Ue]=ke[Ue]}),te}const r="</span>",a=x=>!!x.scope,s=(x,{prefix:F})=>{if(x.startsWith("language:"))return x.replace("language:","language-");if(x.includes(".")){const te=x.split(".");return[`${F}${te.shift()}`,...te.map((ke,Ue)=>`${ke}${"_".repeat(Ue+1)}`)].join(" ")}return`${F}${x}`};class o{constructor(F,te){this.buffer="",this.classPrefix=te.classPrefix,F.walk(this)}addText(F){this.buffer+=n(F)}openNode(F){if(!a(F))return;const te=s(F.scope,{prefix:this.classPrefix});this.span(te)}closeNode(F){a(F)&&(this.buffer+=r)}value(){return this.buffer}span(F){this.buffer+=`<span class="${F}">`}}const l=(x={})=>{const F={children:[]};return Object.assign(F,x),F};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(F){this.top.children.push(F)}openNode(F){const te=l({scope:F});this.add(te),this.stack.push(te)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(F){return this.constructor._walk(F,this.rootNode)}static _walk(F,te){return typeof te=="string"?F.addText(te):te.children&&(F.openNode(te),te.children.forEach(ke=>this._walk(F,ke)),F.closeNode(te)),F}static _collapse(F){typeof F!="string"&&F.children&&(F.children.every(te=>typeof te=="string")?F.children=[F.children.join("")]:F.children.forEach(te=>{c._collapse(te)}))}}class u extends c{constructor(F){super(),this.options=F}addText(F){F!==""&&this.add(F)}startScope(F){this.openNode(F)}endScope(){this.closeNode()}__addSublanguage(F,te){const ke=F.root;te&&(ke.scope=`language:${te}`),this.add(ke)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function g(x){return x?typeof x=="string"?x:x.source:null}function h(x){return m("(?=",x,")")}function d(x){return m("(?:",x,")*")}function p(x){return m("(?:",x,")?")}function m(...x){return x.map(te=>g(te)).join("")}function f(x){const F=x[x.length-1];return typeof F=="object"&&F.constructor===Object?(x.splice(x.length-1,1),F):{}}function w(...x){return"("+(f(x).capture?"":"?:")+x.map(ke=>g(ke)).join("|")+")"}function y(x){return new RegExp(x.toString()+"|").exec("").length-1}function _(x,F){const te=x&&x.exec(F);return te&&te.index===0}const b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function A(x,{joinWith:F}){let te=0;return x.map(ke=>{te+=1;const Ue=te;let We=g(ke),oe="";for(;We.length>0;){const ae=b.exec(We);if(!ae){oe+=We;break}oe+=We.substring(0,ae.index),We=We.substring(ae.index+ae[0].length),ae[0][0]==="\\"&&ae[1]?oe+="\\"+String(Number(ae[1])+Ue):(oe+=ae[0],ae[0]==="("&&te++)}return oe}).map(ke=>`(${ke})`).join(F)}const S=/\b\B/,E="[a-zA-Z]\\w*",I="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",z="\\b(0b[01]+)",B="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Z=(x={})=>{const F=/^#![ ]*\//;return x.binary&&(x.begin=m(F,/.*\b/,x.binary,/\b.*/)),i({scope:"meta",begin:F,end:/$/,relevance:0,"on:begin":(te,ke)=>{te.index!==0&&ke.ignoreMatch()}},x)},ee={begin:"\\\\[\\s\\S]",relevance:0},j={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ee]},C={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ee]},N={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},D=function(x,F,te={}){const ke=i({scope:"comment",begin:x,end:F,contains:[]},te);ke.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ue=w("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ke.contains.push({begin:m(/[ ]+/,"(",Ue,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ke},ie=D("//","$"),he=D("/\\*","\\*/"),K=D("#","$"),Le={scope:"number",begin:O,relevance:0},me={scope:"number",begin:W,relevance:0},Se={scope:"number",begin:z,relevance:0},Ee={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ee,{begin:/\[/,end:/\]/,relevance:0,contains:[ee]}]},Fe={scope:"title",begin:E,relevance:0},R={scope:"title",begin:I,relevance:0},P={begin:"\\.\\s*"+I,relevance:0};var v=Object.freeze({__proto__:null,APOS_STRING_MODE:j,BACKSLASH_ESCAPE:ee,BINARY_NUMBER_MODE:Se,BINARY_NUMBER_RE:z,COMMENT:D,C_BLOCK_COMMENT_MODE:he,C_LINE_COMMENT_MODE:ie,C_NUMBER_MODE:me,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(x){return Object.assign(x,{"on:begin":(F,te)=>{te.data._beginMatch=F[1]},"on:end":(F,te)=>{te.data._beginMatch!==F[1]&&te.ignoreMatch()}})},HASH_COMMENT_MODE:K,IDENT_RE:E,MATCH_NOTHING_RE:S,METHOD_GUARD:P,NUMBER_MODE:Le,NUMBER_RE:O,PHRASAL_WORDS_MODE:N,QUOTE_STRING_MODE:C,REGEXP_MODE:Ee,RE_STARTERS_RE:B,SHEBANG:Z,TITLE_MODE:Fe,UNDERSCORE_IDENT_RE:I,UNDERSCORE_TITLE_MODE:R});function L(x,F){x.input[x.index-1]==="."&&F.ignoreMatch()}function U(x,F){x.className!==void 0&&(x.scope=x.className,delete x.className)}function V(x,F){F&&x.beginKeywords&&(x.begin="\\b("+x.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",x.__beforeBegin=L,x.keywords=x.keywords||x.beginKeywords,delete x.beginKeywords,x.relevance===void 0&&(x.relevance=0))}function H(x,F){Array.isArray(x.illegal)&&(x.illegal=w(...x.illegal))}function $(x,F){if(x.match){if(x.begin||x.end)throw new Error("begin & end are not supported with match");x.begin=x.match,delete x.match}}function T(x,F){x.relevance===void 0&&(x.relevance=1)}const q=(x,F)=>{if(!x.beforeMatch)return;if(x.starts)throw new Error("beforeMatch cannot be used with starts");const te=Object.assign({},x);Object.keys(x).forEach(ke=>{delete x[ke]}),x.keywords=te.keywords,x.begin=m(te.beforeMatch,h(te.begin)),x.starts={relevance:0,contains:[Object.assign(te,{endsParent:!0})]},x.relevance=0,delete te.beforeMatch},Q=["of","and","for","in","not","or","if","then","parent","list","value"],se="keyword";function ye(x,F,te=se){const ke=Object.create(null);return typeof x=="string"?Ue(te,x.split(" ")):Array.isArray(x)?Ue(te,x):Object.keys(x).forEach(function(We){Object.assign(ke,ye(x[We],F,We))}),ke;function Ue(We,oe){F&&(oe=oe.map(ae=>ae.toLowerCase())),oe.forEach(function(ae){const be=ae.split("|");ke[be[0]]=[We,we(be[0],be[1])]})}}function we(x,F){return F?Number(F):pe(x)?0:1}function pe(x){return Q.includes(x.toLowerCase())}const _e={},ve=x=>{console.error(x)},Ie=(x,...F)=>{console.log(`WARN: ${x}`,...F)},Ge=(x,F)=>{_e[`${x}/${F}`]||(console.log(`Deprecated as of ${x}. ${F}`),_e[`${x}/${F}`]=!0)},Et=new Error;function fn(x,F,{key:te}){let ke=0;const Ue=x[te],We={},oe={};for(let ae=1;ae<=F.length;ae++)oe[ae+ke]=Ue[ae],We[ae+ke]=!0,ke+=y(F[ae-1]);x[te]=oe,x[te]._emit=We,x[te]._multi=!0}function Ct(x){if(Array.isArray(x.begin)){if(x.skip||x.excludeBegin||x.returnBegin)throw ve("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Et;if(typeof x.beginScope!="object"||x.beginScope===null)throw ve("beginScope must be object"),Et;fn(x,x.begin,{key:"beginScope"}),x.begin=A(x.begin,{joinWith:""})}}function cs(x){if(Array.isArray(x.end)){if(x.skip||x.excludeEnd||x.returnEnd)throw ve("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Et;if(typeof x.endScope!="object"||x.endScope===null)throw ve("endScope must be object"),Et;fn(x,x.end,{key:"endScope"}),x.end=A(x.end,{joinWith:""})}}function us(x){x.scope&&typeof x.scope=="object"&&x.scope!==null&&(x.beginScope=x.scope,delete x.scope)}function hs(x){us(x),typeof x.beginScope=="string"&&(x.beginScope={_wrap:x.beginScope}),typeof x.endScope=="string"&&(x.endScope={_wrap:x.endScope}),Ct(x),cs(x)}function ds(x){function F(oe,ae){return new RegExp(g(oe),"m"+(x.case_insensitive?"i":"")+(x.unicodeRegex?"u":"")+(ae?"g":""))}class te{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ae,be){be.position=this.position++,this.matchIndexes[this.matchAt]=be,this.regexes.push([be,ae]),this.matchAt+=y(ae)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ae=this.regexes.map(be=>be[1]);this.matcherRe=F(A(ae,{joinWith:"|"}),!0),this.lastIndex=0}exec(ae){this.matcherRe.lastIndex=this.lastIndex;const be=this.matcherRe.exec(ae);if(!be)return null;const Ve=be.findIndex((gn,vr)=>vr>0&&gn!==void 0),Ze=this.matchIndexes[Ve];return be.splice(0,Ve),Object.assign(be,Ze)}}class ke{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ae){if(this.multiRegexes[ae])return this.multiRegexes[ae];const be=new te;return this.rules.slice(ae).forEach(([Ve,Ze])=>be.addRule(Ve,Ze)),be.compile(),this.multiRegexes[ae]=be,be}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ae,be){this.rules.push([ae,be]),be.type==="begin"&&this.count++}exec(ae){const be=this.getMatcher(this.regexIndex);be.lastIndex=this.lastIndex;let Ve=be.exec(ae);if(this.resumingScanAtSamePosition()&&!(Ve&&Ve.index===this.lastIndex)){const Ze=this.getMatcher(0);Ze.lastIndex=this.lastIndex+1,Ve=Ze.exec(ae)}return Ve&&(this.regexIndex+=Ve.position+1,this.regexIndex===this.count&&this.considerAll()),Ve}}function Ue(oe){const ae=new ke;return oe.contains.forEach(be=>ae.addRule(be.begin,{rule:be,type:"begin"})),oe.terminatorEnd&&ae.addRule(oe.terminatorEnd,{type:"end"}),oe.illegal&&ae.addRule(oe.illegal,{type:"illegal"}),ae}function We(oe,ae){const be=oe;if(oe.isCompiled)return be;[U,$,hs,q].forEach(Ze=>Ze(oe,ae)),x.compilerExtensions.forEach(Ze=>Ze(oe,ae)),oe.__beforeBegin=null,[V,H,T].forEach(Ze=>Ze(oe,ae)),oe.isCompiled=!0;let Ve=null;return typeof oe.keywords=="object"&&oe.keywords.$pattern&&(oe.keywords=Object.assign({},oe.keywords),Ve=oe.keywords.$pattern,delete oe.keywords.$pattern),Ve=Ve||/\w+/,oe.keywords&&(oe.keywords=ye(oe.keywords,x.case_insensitive)),be.keywordPatternRe=F(Ve,!0),ae&&(oe.begin||(oe.begin=/\B|\b/),be.beginRe=F(be.begin),!oe.end&&!oe.endsWithParent&&(oe.end=/\B|\b/),oe.end&&(be.endRe=F(be.end)),be.terminatorEnd=g(be.end)||"",oe.endsWithParent&&ae.terminatorEnd&&(be.terminatorEnd+=(oe.end?"|":"")+ae.terminatorEnd)),oe.illegal&&(be.illegalRe=F(oe.illegal)),oe.contains||(oe.contains=[]),oe.contains=[].concat(...oe.contains.map(function(Ze){return fs(Ze==="self"?oe:Ze)})),oe.contains.forEach(function(Ze){We(Ze,be)}),oe.starts&&We(oe.starts,ae),be.matcher=Ue(be),be}if(x.compilerExtensions||(x.compilerExtensions=[]),x.contains&&x.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return x.classNameAliases=i(x.classNameAliases||{}),We(x)}function Mi(x){return x?x.endsWithParent||Mi(x.starts):!1}function fs(x){return x.variants&&!x.cachedVariants&&(x.cachedVariants=x.variants.map(function(F){return i(x,{variants:null},F)})),x.cachedVariants?x.cachedVariants:Mi(x)?i(x,{starts:x.starts?i(x.starts):null}):Object.isFrozen(x)?i(x):x}var gs="11.11.1";class ps extends Error{constructor(F,te){super(F),this.name="HTMLInjectionError",this.html=te}}const Sr=n,Li=i,Ti=Symbol("nomatch"),ms=7,zi=function(x){const F=Object.create(null),te=Object.create(null),ke=[];let Ue=!0;const We="Could not find the language '{}', did you forget to load/include a language module?",oe={disableAutodetect:!0,name:"Plain text",contains:[]};let ae={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function be(X){return ae.noHighlightRe.test(X)}function Ve(X){let ue=X.className+" ";ue+=X.parentNode?X.parentNode.className:"";const Te=ae.languageDetectRe.exec(ue);if(Te){const je=Tt(Te[1]);return je||(Ie(We.replace("{}",Te[1])),Ie("Falling back to no-highlight mode for this block.",X)),je?Te[1]:"no-highlight"}return ue.split(/\s+/).find(je=>be(je)||Tt(je))}function Ze(X,ue,Te){let je="",Qe="";typeof ue=="object"?(je=X,Te=ue.ignoreIllegals,Qe=ue.language):(Ge("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ge("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Qe=X,je=ue),Te===void 0&&(Te=!0);const bt={code:je,language:Qe};Fn("before:highlight",bt);const zt=bt.result?bt.result:gn(bt.language,bt.code,Te);return zt.code=bt.code,Fn("after:highlight",zt),zt}function gn(X,ue,Te,je){const Qe=Object.create(null);function bt(ne,ce){return ne.keywords[ce]}function zt(){if(!xe.keywords){Ye.addText(qe);return}let ne=0;xe.keywordPatternRe.lastIndex=0;let ce=xe.keywordPatternRe.exec(qe),Ae="";for(;ce;){Ae+=qe.substring(ne,ce.index);const Ne=kt.case_insensitive?ce[0].toLowerCase():ce[0],et=bt(xe,Ne);if(et){const[Mt,$s]=et;if(Ye.addText(Ae),Ae="",Qe[Ne]=(Qe[Ne]||0)+1,Qe[Ne]<=ms&&(Wn+=$s),Mt.startsWith("_"))Ae+=ce[0];else{const Ps=kt.classNameAliases[Mt]||Mt;_t(ce[0],Ps)}}else Ae+=ce[0];ne=xe.keywordPatternRe.lastIndex,ce=xe.keywordPatternRe.exec(qe)}Ae+=qe.substring(ne),Ye.addText(Ae)}function Dn(){if(qe==="")return;let ne=null;if(typeof xe.subLanguage=="string"){if(!F[xe.subLanguage]){Ye.addText(qe);return}ne=gn(xe.subLanguage,qe,!0,ji[xe.subLanguage]),ji[xe.subLanguage]=ne._top}else ne=Ar(qe,xe.subLanguage.length?xe.subLanguage:null);xe.relevance>0&&(Wn+=ne.relevance),Ye.__addSublanguage(ne._emitter,ne.language)}function ct(){xe.subLanguage!=null?Dn():zt(),qe=""}function _t(ne,ce){ne!==""&&(Ye.startScope(ce),Ye.addText(ne),Ye.endScope())}function Ii(ne,ce){let Ae=1;const Ne=ce.length-1;for(;Ae<=Ne;){if(!ne._emit[Ae]){Ae++;continue}const et=kt.classNameAliases[ne[Ae]]||ne[Ae],Mt=ce[Ae];et?_t(Mt,et):(qe=Mt,zt(),qe=""),Ae++}}function Ni(ne,ce){return ne.scope&&typeof ne.scope=="string"&&Ye.openNode(kt.classNameAliases[ne.scope]||ne.scope),ne.beginScope&&(ne.beginScope._wrap?(_t(qe,kt.classNameAliases[ne.beginScope._wrap]||ne.beginScope._wrap),qe=""):ne.beginScope._multi&&(Ii(ne.beginScope,ce),qe="")),xe=Object.create(ne,{parent:{value:xe}}),xe}function Oi(ne,ce,Ae){let Ne=_(ne.endRe,Ae);if(Ne){if(ne["on:end"]){const et=new t(ne);ne["on:end"](ce,et),et.isMatchIgnored&&(Ne=!1)}if(Ne){for(;ne.endsParent&&ne.parent;)ne=ne.parent;return ne}}if(ne.endsWithParent)return Oi(ne.parent,ce,Ae)}function Ms(ne){return xe.matcher.regexIndex===0?(qe+=ne[0],1):(Lr=!0,0)}function Ls(ne){const ce=ne[0],Ae=ne.rule,Ne=new t(Ae),et=[Ae.__beforeBegin,Ae["on:begin"]];for(const Mt of et)if(Mt&&(Mt(ne,Ne),Ne.isMatchIgnored))return Ms(ce);return Ae.skip?qe+=ce:(Ae.excludeBegin&&(qe+=ce),ct(),!Ae.returnBegin&&!Ae.excludeBegin&&(qe=ce)),Ni(Ae,ne),Ae.returnBegin?0:ce.length}function Ts(ne){const ce=ne[0],Ae=ue.substring(ne.index),Ne=Oi(xe,ne,Ae);if(!Ne)return Ti;const et=xe;xe.endScope&&xe.endScope._wrap?(ct(),_t(ce,xe.endScope._wrap)):xe.endScope&&xe.endScope._multi?(ct(),Ii(xe.endScope,ne)):et.skip?qe+=ce:(et.returnEnd||et.excludeEnd||(qe+=ce),ct(),et.excludeEnd&&(qe=ce));do xe.scope&&Ye.closeNode(),!xe.skip&&!xe.subLanguage&&(Wn+=xe.relevance),xe=xe.parent;while(xe!==Ne.parent);return Ne.starts&&Ni(Ne.starts,ne),et.returnEnd?0:ce.length}function zs(){const ne=[];for(let ce=xe;ce!==kt;ce=ce.parent)ce.scope&&ne.unshift(ce.scope);ne.forEach(ce=>Ye.openNode(ce))}let Un={};function Bi(ne,ce){const Ae=ce&&ce[0];if(qe+=ne,Ae==null)return ct(),0;if(Un.type==="begin"&&ce.type==="end"&&Un.index===ce.index&&Ae===""){if(qe+=ue.slice(ce.index,ce.index+1),!Ue){const Ne=new Error(`0 width match regex (${X})`);throw Ne.languageName=X,Ne.badRule=Un.rule,Ne}return 1}if(Un=ce,ce.type==="begin")return Ls(ce);if(ce.type==="illegal"&&!Te){const Ne=new Error('Illegal lexeme "'+Ae+'" for mode "'+(xe.scope||"<unnamed>")+'"');throw Ne.mode=xe,Ne}else if(ce.type==="end"){const Ne=Ts(ce);if(Ne!==Ti)return Ne}if(ce.type==="illegal"&&Ae==="")return qe+=`
|
|
3
|
+
`,1;if(Mr>1e5&&Mr>ce.index*3)throw new Error("potential infinite loop, way more iterations than matches");return qe+=Ae,Ae.length}const kt=Tt(X);if(!kt)throw ve(We.replace("{}",X)),new Error('Unknown language: "'+X+'"');const Rs=ds(kt);let Cr="",xe=je||Rs;const ji={},Ye=new ae.__emitter(ae);zs();let qe="",Wn=0,Dt=0,Mr=0,Lr=!1;try{if(kt.__emitTokens)kt.__emitTokens(ue,Ye);else{for(xe.matcher.considerAll();;){Mr++,Lr?Lr=!1:xe.matcher.considerAll(),xe.matcher.lastIndex=Dt;const ne=xe.matcher.exec(ue);if(!ne)break;const ce=ue.substring(Dt,ne.index),Ae=Bi(ce,ne);Dt=ne.index+Ae}Bi(ue.substring(Dt))}return Ye.finalize(),Cr=Ye.toHTML(),{language:X,value:Cr,relevance:Wn,illegal:!1,_emitter:Ye,_top:xe}}catch(ne){if(ne.message&&ne.message.includes("Illegal"))return{language:X,value:Sr(ue),illegal:!0,relevance:0,_illegalBy:{message:ne.message,index:Dt,context:ue.slice(Dt-100,Dt+100),mode:ne.mode,resultSoFar:Cr},_emitter:Ye};if(Ue)return{language:X,value:Sr(ue),illegal:!1,relevance:0,errorRaised:ne,_emitter:Ye,_top:xe};throw ne}}function vr(X){const ue={value:Sr(X),illegal:!1,relevance:0,_top:oe,_emitter:new ae.__emitter(ae)};return ue._emitter.addText(X),ue}function Ar(X,ue){ue=ue||ae.languages||Object.keys(F);const Te=vr(X),je=ue.filter(Tt).filter(Pi).map(ct=>gn(ct,X,!1));je.unshift(Te);const Qe=je.sort((ct,_t)=>{if(ct.relevance!==_t.relevance)return _t.relevance-ct.relevance;if(ct.language&&_t.language){if(Tt(ct.language).supersetOf===_t.language)return 1;if(Tt(_t.language).supersetOf===ct.language)return-1}return 0}),[bt,zt]=Qe,Dn=bt;return Dn.secondBest=zt,Dn}function ys(X,ue,Te){const je=ue&&te[ue]||Te;X.classList.add("hljs"),X.classList.add(`language-${je}`)}function Er(X){let ue=null;const Te=Ve(X);if(be(Te))return;if(Fn("before:highlightElement",{el:X,language:Te}),X.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",X);return}if(X.children.length>0&&(ae.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(X)),ae.throwUnescapedHTML))throw new ps("One of your code blocks includes unescaped HTML.",X.innerHTML);ue=X;const je=ue.textContent,Qe=Te?Ze(je,{language:Te,ignoreIllegals:!0}):Ar(je);X.innerHTML=Qe.value,X.dataset.highlighted="yes",ys(X,Te,Qe.language),X.result={language:Qe.language,re:Qe.relevance,relevance:Qe.relevance},Qe.secondBest&&(X.secondBest={language:Qe.secondBest.language,relevance:Qe.secondBest.relevance}),Fn("after:highlightElement",{el:X,result:Qe,text:je})}function bs(X){ae=Li(ae,X)}const ws=()=>{Hn(),Ge("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _s(){Hn(),Ge("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ri=!1;function Hn(){function X(){Hn()}if(document.readyState==="loading"){Ri||window.addEventListener("DOMContentLoaded",X,!1),Ri=!0;return}document.querySelectorAll(ae.cssSelector).forEach(Er)}function ks(X,ue){let Te=null;try{Te=ue(x)}catch(je){if(ve("Language definition for '{}' could not be registered.".replace("{}",X)),Ue)ve(je);else throw je;Te=oe}Te.name||(Te.name=X),F[X]=Te,Te.rawDefinition=ue.bind(null,x),Te.aliases&&$i(Te.aliases,{languageName:X})}function xs(X){delete F[X];for(const ue of Object.keys(te))te[ue]===X&&delete te[ue]}function Ss(){return Object.keys(F)}function Tt(X){return X=(X||"").toLowerCase(),F[X]||F[te[X]]}function $i(X,{languageName:ue}){typeof X=="string"&&(X=[X]),X.forEach(Te=>{te[Te.toLowerCase()]=ue})}function Pi(X){const ue=Tt(X);return ue&&!ue.disableAutodetect}function vs(X){X["before:highlightBlock"]&&!X["before:highlightElement"]&&(X["before:highlightElement"]=ue=>{X["before:highlightBlock"](Object.assign({block:ue.el},ue))}),X["after:highlightBlock"]&&!X["after:highlightElement"]&&(X["after:highlightElement"]=ue=>{X["after:highlightBlock"](Object.assign({block:ue.el},ue))})}function As(X){vs(X),ke.push(X)}function Es(X){const ue=ke.indexOf(X);ue!==-1&&ke.splice(ue,1)}function Fn(X,ue){const Te=X;ke.forEach(function(je){je[Te]&&je[Te](ue)})}function Cs(X){return Ge("10.7.0","highlightBlock will be removed entirely in v12.0"),Ge("10.7.0","Please use highlightElement now."),Er(X)}Object.assign(x,{highlight:Ze,highlightAuto:Ar,highlightAll:Hn,highlightElement:Er,highlightBlock:Cs,configure:bs,initHighlighting:ws,initHighlightingOnLoad:_s,registerLanguage:ks,unregisterLanguage:xs,listLanguages:Ss,getLanguage:Tt,registerAliases:$i,autoDetection:Pi,inherit:Li,addPlugin:As,removePlugin:Es}),x.debugMode=function(){Ue=!1},x.safeMode=function(){Ue=!0},x.versionString=gs,x.regex={concat:m,lookahead:h,either:w,optional:p,anyNumberOfTimes:d};for(const X in v)typeof v[X]=="object"&&e(v[X]);return Object.assign(x,v),x},nn=zi({});return nn.newInstance=()=>zi({}),Tr=nn,nn.HighlightJS=nn,nn.default=nn,Tr}var Gs=Zs();const Re=ma(Gs);class pr{constructor(t={}){const{maxSize:n=0,ttlMs:i=0,onEvict:r=null}=t||{};this._map=new Map,this._maxSize=Math.max(0,Number(n)||0),this._ttlMs=Math.max(0,Number(i)||0),this._onEvict=typeof r=="function"?r:null}get size(){return this._map.size}has(t){const n=this._map.get(t);return n?this._ttlMs&&Date.now()-(n.ts||0)>=this._ttlMs?(this._evictKey(t,n),!1):(this._map.delete(t),this._map.set(t,n),!0):!1}get(t){const n=this._map.get(t);if(n){if(this._ttlMs&&Date.now()-(n.ts||0)>=this._ttlMs){this._evictKey(t,n);return}return this._map.delete(t),this._map.set(t,n),n.value}}set(t,n){if(this._map.has(t)&&this._map.delete(t),this._map.set(t,{value:n,ts:Date.now()}),this._maxSize&&this._map.size>this._maxSize)for(;this._map.size>this._maxSize;){const i=this._map.keys().next().value,r=this._map.get(i);if(this._map.delete(i),this._onEvict)try{this._onEvict(i,r&&r.value)}catch{}}return this}delete(t){return this._map.delete(t)}clear(){if(this._onEvict)for(const[t,n]of this._map.entries())try{this._onEvict(t,n&&n.value)}catch{}this._map.clear()}_evictKey(t,n){try{this._map.delete(t)}catch{}if(this._onEvict)try{this._onEvict(t,n&&n.value)}catch{}}}const Yn=new pr({maxSize:500});let ya=300*1e3;function Qs(){Yn.clear()}function Xs(e){ya=Number(e)||0}async function ai(e,t){try{if(!e)return null;const n=Date.now();let i=Yn.get(e);if(i&&i.ok===!1&&n-(i.ts||0)>=ya&&(Yn.delete(e),i=void 0),i){if(i.module)return i.module;if(i.promise)try{return await i.promise}catch{return null}}const r={promise:null,module:null,ok:null,ts:Date.now()};Yn.set(e,r),r.promise=(async()=>{try{return await t()}catch{return null}})();try{const a=await r.promise;return r.module=a,r.ok=!!a,r.ts=Date.now(),a}catch{return r.module=null,r.ok=!1,r.ts=Date.now(),null}}catch{return null}}async function Ks(e){return await ai(e,async()=>{try{return await import(e)}catch{return null}})}const Vs="11.11.1",Ce=new Map,Ys="https://raw.githubusercontent.com/highlightjs/highlight.js/main/SUPPORTED_LANGUAGES.md",dt={shell:"bash",sh:"bash",zsh:"bash",js:"javascript",ts:"typescript",py:"python",csharp:"cs","c#":"cs"};dt.html="xml";dt.xhtml="xml";dt.markup="xml";const si=new Set(["magic","undefined"]);let Nt=null,Js=null;async function oi(e=Ys){if(e)return Nt||(Nt=(async()=>{try{const t=await fetch(e);if(!t.ok)return;const i=(await t.text()).split(/\r?\n/);let r=-1;for(let c=0;c<i.length;c++)if(/\|\s*Language\s*\|/i.test(i[c])){r=c;break}if(r===-1)return;const a=i[r].replace(/^\||\|$/g,"").split("|").map(c=>c.trim().toLowerCase());let s=a.findIndex(c=>/alias|aliases|equivalent|alt|alternates?/i.test(c));s===-1&&(s=1);let o=a.findIndex(c=>/file|filename|module|module name|module-name|short|slug/i.test(c));if(o===-1){const c=a.findIndex(u=>/language/i.test(u));o=c!==-1?c:0}let l=[];for(let c=r+1;c<i.length;c++){const u=i[c].trim();if(!u||!u.startsWith("|"))break;const g=u.replace(/^\||\|$/g,"").split("|").map(f=>f.trim());if(g.every(f=>/^-+$/.test(f)))continue;const h=g;if(!h.length)continue;const p=(h[o]||h[0]||"").toString().trim().toLowerCase();if(!p||/^-+$/.test(p))continue;Ce.set(p,p);const m=h[s]||"";if(m){const f=String(m).split(",").map(w=>w.replace(/`/g,"").trim()).filter(Boolean);if(f.length){const y=f[0].toLowerCase().replace(/^[:]+/,"").replace(/[^a-z0-9_-]+/ig,"");y&&/[a-z0-9]/i.test(y)&&(Ce.set(y,y),l.push(y))}}}try{const c=[];for(const u of l){const g=String(u||"").replace(/^[:]+/,"").replace(/[^a-z0-9_-]+/ig,"");g&&/[a-z0-9]/i.test(g)?c.push(g):Ce.delete(u)}l=c}catch(c){k("[codeblocksManager] cleanup aliases failed",c)}try{let c=0;for(const u of Array.from(Ce.keys())){if(!u||/^-+$/.test(u)||!/[a-z0-9]/i.test(u)){Ce.delete(u),c++;continue}if(/^[:]+/.test(u)){const g=u.replace(/^[:]+/,"");if(g&&/[a-z0-9]/i.test(g)){const h=Ce.get(u);Ce.delete(u),Ce.set(g,h)}else Ce.delete(u),c++}}for(const[u,g]of Array.from(Ce.entries()))(!g||/^-+$/.test(g)||!/[a-z0-9]/i.test(g))&&(Ce.delete(u),c++);try{const u=":---------------------";Ce.has(u)&&(Ce.delete(u),c++)}catch(u){k("[codeblocksManager] remove sep key failed",u)}try{const u=Array.from(Ce.keys()).sort()}catch(u){k("[codeblocksManager] compute supported keys failed",u)}}catch(c){k("[codeblocksManager] ignored error",c)}}catch(t){k("[codeblocksManager] loadSupportedLanguages failed",t)}})(),Nt)}const pn=new Set;async function ln(e,t){if(Nt||(async()=>{try{await oi()}catch(r){k("[codeblocksManager] loadSupportedLanguages (IIFE) failed",r)}})(),Nt)try{await Nt}catch{}if(e=e==null?"":String(e),e=e.trim(),!e)return!1;const n=e.toLowerCase();if(si.has(n))return!1;if(Ce.size&&!Ce.has(n)){const r=dt;if(!r[n]&&!r[e])return!1}if(pn.has(e))return!0;const i=dt;try{const r=(t||e||"").toString().replace(/\.js$/i,"").trim(),a=(i[e]||e||"").toString(),s=(i[r]||r||"").toString();let o=Array.from(new Set([a,s,r,e,i[r],i[e]].filter(Boolean))).map(u=>String(u).toLowerCase()).filter(u=>u&&u!=="undefined");Ce.size&&(o=o.filter(u=>{if(Ce.has(u))return!0;const g=dt[u];return!!(g&&Ce.has(g))}));let l=null,c=null;for(const u of o)try{if(l=await ai(u,async()=>{try{try{try{return await import(`highlight.js/lib/languages/${u}.js`)}catch{return await import(`highlight.js/lib/languages/${u}`)}}catch{try{return await import(`https://cdn.jsdelivr.net/npm/highlight.js/es/languages/${u}.js`)}catch{try{return await import(`https://cdn.jsdelivr.net/npm/highlight.js/lib/languages/${u}.js`)}catch{return null}}}}catch{return null}}),l){const g=l.default||l;try{const h=Ce.size&&Ce.get(e)||u||e;return Re.registerLanguage(h,g),pn.add(h),h!==e&&(Re.registerLanguage(e,g),pn.add(e)),!0}catch(h){c=h}}else try{if(Ce.has(u)||Ce.has(e)){const g=()=>({});try{Re.registerLanguage(u,g),pn.add(u)}catch{}try{u!==e&&(Re.registerLanguage(e,g),pn.add(e))}catch{}return!0}}catch{}}catch(g){c=g}if(c)throw c;return!1}catch{return!1}}let Zn=null;function ba(e){const t=e&&e.querySelector?e:typeof document<"u"?document:null;Nt||(async()=>{try{await oi()}catch(s){k("[codeblocksManager] loadSupportedLanguages (observer) failed",s)}})();const n=dt,r=Zn||(typeof IntersectionObserver>"u"?null:(Zn=new IntersectionObserver((s,o)=>{s.forEach(l=>{if(!l.isIntersecting)return;const c=l.target;try{o.unobserve(c)}catch(u){k("[codeblocksManager] observer unobserve failed",u)}(async()=>{try{const u=c.getAttribute&&c.getAttribute("class")||c.className||"",g=u.match(/language-([a-zA-Z0-9_+-]+)/)||u.match(/lang(?:uage)?-?([a-zA-Z0-9_+-]+)/);if(g&&g[1]){const h=(g[1]||"").toLowerCase(),d=n[h]||h,p=Ce.size&&(Ce.get(d)||Ce.get(String(d).toLowerCase()))||d;try{await ln(p)}catch(m){k("[codeblocksManager] registerLanguage failed",m)}try{try{const m=c.textContent||c.innerText||"";m!=null&&(c.textContent=m)}catch{}try{c&&c.dataset&&c.dataset.highlighted&&delete c.dataset.highlighted}catch{}Re.highlightElement(c)}catch(m){k("[codeblocksManager] hljs.highlightElement failed",m)}}else try{const h=c.textContent||"";try{if(Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")){const d=Re.highlight(h,{language:"plaintext"});if(d&&d.value)try{if(typeof document<"u"&&document.createRange&&typeof document.createRange=="function"){const p=document.createRange().createContextualFragment(d.value);if(typeof c.replaceChildren=="function")c.replaceChildren(...Array.from(p.childNodes));else{for(;c.firstChild;)c.removeChild(c.firstChild);c.appendChild(p)}}else c.innerHTML=d.value}catch{try{c.innerHTML=d.value}catch{}}}}catch{try{Re.highlightElement(c)}catch(p){k("[codeblocksManager] fallback highlightElement failed",p)}}}catch(h){k("[codeblocksManager] auto-detect plaintext failed",h)}}catch(u){k("[codeblocksManager] observer entry processing failed",u)}})()})},{root:null,rootMargin:"300px",threshold:.1}),Zn)),a=t&&t.querySelectorAll?t.querySelectorAll("pre code"):[];if(!r){a.forEach(async s=>{try{const o=s.getAttribute&&s.getAttribute("class")||s.className||"",l=o.match(/language-([a-zA-Z0-9_+-]+)/)||o.match(/lang(?:uage)?-?([a-zA-Z0-9_+-]+)/);if(l&&l[1]){const c=(l[1]||"").toLowerCase(),u=n[c]||c,g=Ce.size&&(Ce.get(u)||Ce.get(String(u).toLowerCase()))||u;try{await ln(g)}catch(h){k("[codeblocksManager] registerLanguage failed (no observer)",h)}}try{try{const c=s.textContent||s.innerText||"";c!=null&&(s.textContent=c)}catch{}try{s&&s.dataset&&s.dataset.highlighted&&delete s.dataset.highlighted}catch{}Re.highlightElement(s)}catch(c){k("[codeblocksManager] hljs.highlightElement failed (no observer)",c)}}catch(o){k("[codeblocksManager] loadSupportedLanguages fallback ignored error",o)}});return}a.forEach(s=>{try{r.observe(s)}catch(o){k("[codeblocksManager] observe failed",o)}})}function eo(e,{useCdn:t=!0}={}){const n=typeof document<"u"&&document.head&&document.head.querySelector?document.head.querySelector("link[data-hl-theme]"):typeof document<"u"?document.querySelector("link[data-hl-theme]"):null,i=n&&n.getAttribute?n.getAttribute("data-hl-theme"):null,r=e==null?"default":String(e),a=r&&String(r).toLowerCase()||"";if(a==="default"||a==="monokai"){try{n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}return}if(i&&i.toLowerCase()===a)return;if(!t){try{k("Requested highlight theme not bundled; set useCdn=true to load theme from CDN")}catch{}return}const s=a,o=`https://cdn.jsdelivr.net/npm/highlight.js@${Vs}/styles/${s}.css`,l=document.createElement("link");l.rel="stylesheet",l.href=o,l.setAttribute("data-hl-theme",s),l.addEventListener("load",()=>{try{n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}}),document.head.appendChild(l)}let Ut="light";function to(e,t={}){if(document.querySelector(`link[href="${e}"]`))return;const n=document.createElement("link");if(n.rel="stylesheet",n.href=e,Object.entries(t).forEach(([i,r])=>n.setAttribute(i,r)),document.head.appendChild(n),t["data-bulmaswatch-theme"])try{if(n.getAttribute("data-bulmaswatch-observer"))return;let i=Number(n.getAttribute("data-bulmaswatch-move-count")||0),r=!1;const a=new MutationObserver(()=>{try{if(r)return;const o=n.parentNode;if(!o||o.lastElementChild===n)return;if(i>=1e3){n.setAttribute("data-bulmaswatch-move-stopped","1");return}r=!0;try{o.appendChild(n)}catch{}i+=1,n.setAttribute("data-bulmaswatch-move-count",String(i)),r=!1}catch{}});try{a.observe(document.head,{childList:!0}),n.setAttribute("data-bulmaswatch-observer","1"),n.setAttribute("data-bulmaswatch-move-count",String(i))}catch{}const s=document.head;s&&s.lastElementChild!==n&&s.appendChild(n)}catch{}}function zr(){try{const e=typeof document<"u"&&document.head?document.head:document,t=Array.from(e.querySelectorAll("link[data-bulmaswatch-theme]"));for(const n of t)n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}try{const e=typeof document<"u"&&document.head?document.head:document,t=Array.from(e.querySelectorAll("style[data-bulma-override]"));for(const n of t)n&&n.parentNode&&n.parentNode.removeChild(n)}catch{}}async function wa(e="none",t="/"){try{jt("[bulmaManager] ensureBulma called",{bulmaCustomize:e,pageDir:t})}catch{}if(!e)return;if(e==="none"){try{zr()}catch{}return}const n=[t+"bulma.css","/bulma.css"],i=Array.from(new Set(n));if(e==="local"){if(zr(),document.querySelector("style[data-bulma-override]"))return;for(const r of i)try{const a=await fetch(r,{method:"GET"});if(a.ok){const s=await a.text(),o=document.createElement("style");o.setAttribute("data-bulma-override",r),o.appendChild(document.createTextNode(`
|
|
4
4
|
/* bulma override: ${r} */
|
|
5
|
-
`+s)),document.head.appendChild(o);return}}catch(a){k("[bulmaManager] fetch local bulma candidate failed",a)}return}try{const r=String(e).trim();if(!r)return;
|
|
5
|
+
`+s)),document.head.appendChild(o);return}}catch(a){k("[bulmaManager] fetch local bulma candidate failed",a)}return}try{const r=String(e).trim();if(!r)return;zr();const a=`https://unpkg.com/bulmaswatch/${encodeURIComponent(r)}/bulmaswatch.min.css`;to(a,{"data-bulmaswatch-theme":r})}catch(r){k("[bulmaManager] ensureBulma failed",r)}}function _a(e){Ut=e==="dark"?"dark":e==="system"?"system":"light";try{const t=Array.from(document.querySelectorAll(".nimbi-mount"));if(t.length>0)for(const n of t)Ut==="dark"?n.setAttribute("data-theme","dark"):Ut==="light"?n.setAttribute("data-theme","light"):n.removeAttribute("data-theme");else{const n=document.documentElement;Ut==="dark"?n.setAttribute("data-theme","dark"):Ut==="light"?n.setAttribute("data-theme","light"):n.removeAttribute("data-theme")}}catch{}}function no(e){const t=document.documentElement;for(const[n,i]of Object.entries(e||{}))try{t.style.setProperty(`--${n}`,i)}catch(r){k("[bulmaManager] setThemeVars failed for",n,r)}}function ka(e){if(!e||!(e instanceof HTMLElement))return()=>{};const t=e.closest&&e.closest(".nimbi-mount")||null;try{t&&(Ut==="dark"?t.setAttribute("data-theme","dark"):Ut==="light"?t.setAttribute("data-theme","light"):t.removeAttribute("data-theme"))}catch{}return()=>{}}const xa={en:{navigation:"Navigation",onThisPage:"On this page",home:"Home",scrollToTop:"Scroll to top",readingTime:"{minutes} min read",searchPlaceholder:"Search…",searchNoResults:"No results",imagePreviewTitle:"Image preview",imagePreviewFit:"Fit to screen",imagePreviewOriginal:"Original size",imagePreviewZoomOut:"Zoom out",imagePreviewZoomIn:"Zoom in",imagePreviewClose:"Close"},es:{navigation:"Navegación",onThisPage:"En esta página",home:"Inicio",scrollToTop:"Ir arriba",readingTime:"{minutes} min de lectura",searchPlaceholder:"Buscar…",searchNoResults:"Sin resultados",imagePreviewTitle:"Previsualización de imagen",imagePreviewFit:"Ajustar a la pantalla",imagePreviewOriginal:"Tamaño original",imagePreviewZoomOut:"Alejar",imagePreviewZoomIn:"Acercar",imagePreviewClose:"Cerrar"},de:{navigation:"Navigation",onThisPage:"Auf dieser Seite",home:"Startseite",scrollToTop:"Nach oben",readingTime:"{minutes} min Lesezeit",searchPlaceholder:"Suchen…",searchNoResults:"Keine Ergebnisse",imagePreviewTitle:"Bildvorschau",imagePreviewFit:"An Bildschirm anpassen",imagePreviewOriginal:"Originalgröße",imagePreviewZoomOut:"Verkleinern",imagePreviewZoomIn:"Vergrößern",imagePreviewClose:"Schließen"},fr:{navigation:"Navigation",onThisPage:"Sur cette page",home:"Accueil",scrollToTop:"Aller en haut",readingTime:"{minutes} min de lecture",searchPlaceholder:"Rechercher…",searchNoResults:"Aucun résultat",imagePreviewTitle:"Aperçu de l’image",imagePreviewFit:"Ajuster à l’écran",imagePreviewOriginal:"Taille originale",imagePreviewZoomOut:"Dézoomer",imagePreviewZoomIn:"Zoomer",imagePreviewClose:"Fermer"},pt:{navigation:"Navegação",onThisPage:"Nesta página",home:"Início",scrollToTop:"Ir para o topo",readingTime:"{minutes} min de leitura",searchPlaceholder:"Procurar…",searchNoResults:"Sem resultados",imagePreviewTitle:"Visualização da imagem",imagePreviewFit:"Ajustar à tela",imagePreviewOriginal:"Tamanho original",imagePreviewZoomOut:"Diminuir",imagePreviewZoomIn:"Aumentar",imagePreviewClose:"Fechar"}},on=JSON.parse(JSON.stringify(xa));let or="en";if(typeof navigator<"u"){const e=navigator.language||navigator.languages&&navigator.languages[0]||"en";or=String(e).split("-")[0].toLowerCase()}xa[or]||(or="en");let qt=or;function an(e,t={}){const n=on[qt]||on.en;let i=n&&n[e]?n[e]:on.en[e]||"";for(const r of Object.keys(t))i=i.replace(new RegExp(`{${r}}`,"g"),String(t[r]));return i}async function li(e,t){if(!e)return;let n=e;try{/^https?:\/\//.test(e)||(n=new URL(e,location.origin+t).toString());const i=await fetch(n);if(!i.ok)return;const r=await i.json();for(const a of Object.keys(r||{}))on[a]=Object.assign({},on[a]||{},r[a])}catch{}}function ci(e){const t=String(e).split("-")[0].toLowerCase();qt=on[t]?t:"en"}const ro=Object.freeze(Object.defineProperty({__proto__:null,get currentLang(){return qt},loadL10nFile:li,setLang:ci,t:an},Symbol.toStringTag,{value:"Module"}));function io(e){try{return String(e||"").split("/").map(t=>encodeURIComponent(t)).join("/")}catch{return String(e||"")}}function Ui(e,t=null,n=void 0){let r="#/"+io(String(e||""));t&&(r+="#"+encodeURIComponent(String(t)));try{let a="";if(typeof n=="string")a=n;else if(typeof location<"u"&&location&&location.search)a=location.search;else if(typeof location<"u"&&location&&location.hash)try{const s=Je(location.href);s&&s.params&&(a=s.params)}catch{}if(a){const s=typeof a=="string"&&a.startsWith("?")?a.slice(1):a;try{const o=new URLSearchParams(s);o.delete("page");const l=o.toString();l&&(r+="?"+l)}catch{const l=String(s||"").replace(/^page=[^&]*&?/,"");l&&(r+="?"+l)}}}catch{}return r}function Je(e){try{const t=new URL(e,typeof location<"u"?location.href:"http://localhost/"),n=t.searchParams.get("page");if(n){let r=null,a="";if(t.hash){const c=t.hash.replace(/^#/,"");if(c.includes("&")){const u=c.split("&");r=u.shift()||null,a=u.join("&")}else r=c||null}const s=new URLSearchParams(t.search);s.delete("page");const l=[s.toString(),a].filter(Boolean).join("&");return{type:"canonical",page:decodeURIComponent(n),anchor:r,params:l}}const i=t.hash?decodeURIComponent(t.hash.replace(/^#/,"")):"";if(i&&i.startsWith("/")){let r=i,a="";if(r.indexOf("?")!==-1){const c=r.split("?");r=c.shift()||"",a=c.join("?")||""}let s=r,o=null;if(s.indexOf("#")!==-1){const c=s.split("#");s=c.shift()||"",o=c.join("#")||null}return{type:"cosmetic",page:s.replace(/^\/+/,"")||null,anchor:o,params:a}}return{type:"path",page:(t.pathname||"").replace(/^\//,"")||null,anchor:t.hash?t.hash.replace(/^#/,""):null,params:t.search?t.search.replace(/^\?/,""):""}}catch{return{type:"unknown",page:e,anchor:null,params:""}}}let Gn=typeof DOMParser<"u"?new DOMParser:null;function He(){return Gn||(typeof DOMParser<"u"?(Gn=new DOMParser,Gn):null)}async function Rn(e,t,n=4){if(!Array.isArray(e)||e.length===0)return[];const i=new Array(e.length);let r=0;const a=[],s=Math.max(1,Number(n)||1);async function o(){for(;;){const l=r++;if(l>=e.length)return;try{i[l]=await t(e[l],l)}catch{i[l]=void 0}}}for(let l=0;l<Math.min(s,e.length);l++)a.push(o());return await Promise.all(a),i}const ao=`/**
|
|
6
6
|
* @module worker/slugWorker
|
|
7
7
|
*/
|
|
8
8
|
import { buildSearchIndex, crawlForSlug } from '../slugManager.js'
|
|
@@ -71,14 +71,14 @@ export async function handleSlugWorkerMessage(msg) {
|
|
|
71
71
|
return { id: msg && msg.id, error: String(e) }
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`;function to(e,t="worker"){let n=null;function i(...l){try{k(...l)}catch{}}function r(){if(!n)try{const l=e();n=l||null,l&&l.addEventListener("error",()=>{try{n===l&&(n=null,l.terminate&&l.terminate())}catch(c){i("["+t+"] worker termination failed",c)}})}catch(l){n=null,i("["+t+"] worker init failed",l)}return n}function a(){try{n&&(n.terminate&&n.terminate(),n=null)}catch(l){i("["+t+"] worker termination failed",l)}}function s(l,c=1e4){return new Promise((u,g)=>{const h=r();if(!h)return g(new Error("worker unavailable"));const d=String(Math.random()),p=Object.assign({},l,{id:d});let m=null;const f=()=>{m&&clearTimeout(m),h.removeEventListener("message",w),h.removeEventListener("error",y)},w=_=>{const b=_.data||{};b.id===d&&(f(),b.error?g(new Error(b.error)):u(b.result))},y=_=>{f(),i("["+t+"] worker error event",_);try{n===h&&(n=null,h.terminate&&h.terminate())}catch(b){i("["+t+"] worker termination failed",b)}g(new Error(_&&_.message||"worker error"))};m=setTimeout(()=>{f(),i("["+t+"] worker timed out");try{n===h&&(n=null,h.terminate&&h.terminate())}catch(_){i("["+t+"] worker termination on timeout failed",_)}g(new Error("worker timeout"))},c),h.addEventListener("message",w),h.addEventListener("error",y);try{h.postMessage(p)}catch(_){f(),g(_)}})}return{get:r,send:s,terminate:a}}function wa(e,t="worker-pool",n=2){const i=new Array(n).fill(null);let r=0;function a(...p){try{k(...p)}catch{}}function s(p){if(!i[p])try{const m=e();i[p]=m||null,m&&m.addEventListener("error",()=>{try{i[p]===m&&(i[p]=null,m.terminate&&m.terminate())}catch(f){a("["+t+"] worker termination failed",f)}})}catch(m){i[p]=null,a("["+t+"] worker init failed",m)}return i[p]}const o=new Array(n).fill(0),l=new Array(n).fill(null),c=30*1e3;function u(p){try{o[p]=Date.now(),l[p]&&(clearTimeout(l[p]),l[p]=null),l[p]=setTimeout(()=>{try{i[p]&&(i[p].terminate&&i[p].terminate(),i[p]=null)}catch(m){a("["+t+"] idle termination failed",m)}l[p]=null},c)}catch{}}function g(){for(let p=0;p<i.length;p++){const m=s(p);if(m)return m}return null}function h(){for(let p=0;p<i.length;p++)try{i[p]&&(i[p].terminate&&i[p].terminate(),i[p]=null)}catch(m){a("["+t+"] worker termination failed",m)}}function d(p,m=1e4){return new Promise((f,w)=>{const y=r++%i.length,_=b=>{const v=(y+b)%i.length,S=s(v);if(!S)return b+1<i.length?_(b+1):w(new Error("worker pool unavailable"));const E=String(Math.random()),P=Object.assign({},p,{id:E});let I=null;const U=()=>{I&&clearTimeout(I),S.removeEventListener("message",z),S.removeEventListener("error",O)},z=W=>{const te=W.data||{};te.id===E&&(U(),te.error?w(new Error(te.error)):f(te.result))},O=W=>{U(),a("["+t+"] worker error event",W);try{i[v]===S&&(i[v]=null,S.terminate&&S.terminate())}catch(te){a("["+t+"] worker termination failed",te)}w(new Error(W&&W.message||"worker error"))};I=setTimeout(()=>{U(),a("["+t+"] worker timed out");try{i[v]===S&&(i[v]=null,S.terminate&&S.terminate())}catch(W){a("["+t+"] worker termination on timeout failed",W)}w(new Error("worker timeout"))},m),S.addEventListener("message",z),S.addEventListener("error",O);try{u(v),S.postMessage(P)}catch(W){U(),w(W)}};_(0)})}return{get:g,send:d,terminate:h}}function no(e,t,n="worker"){return to(()=>{try{const a=Zt(e);if(a)try{if(!(typeof process<"u"&&process.env&&process.env.VITEST))return a}catch{return a}}catch{}if(typeof t!="function")return null;const r={message:[],error:[]};return{addEventListener(a,s){r[a]||(r[a]=[]),r[a].push(s)},removeEventListener(a,s){if(!r[a])return;const o=r[a].indexOf(s);o!==-1&&r[a].splice(o,1)},postMessage(a){setTimeout(async()=>{try{const o={data:await t(a)};(r.message||[]).forEach(l=>l(o))}catch(s){const o={data:{id:a&&a.id,error:String(s)}};(r.message||[]).forEach(l=>l(o))}},0)},terminate(){Object.keys(r).forEach(a=>r[a].length=0)}}},n)}function Zt(e){try{if(typeof Blob<"u"&&typeof URL<"u"&&e)try{Zt._blobUrlCache||(Zt._blobUrlCache=new dr({maxSize:200,onEvict:(i,r)=>{try{typeof URL<"u"&&r&&URL.revokeObjectURL(r)}catch{}}}));const t=Zt._blobUrlCache;let n=t.get(e);if(!n){const i=new Blob([e],{type:"application/javascript"});n=URL.createObjectURL(i),t.set(e,n)}return new Worker(n,{type:"module"})}catch(t){try{k("[worker-manager] createWorkerFromRaw failed",t)}catch{}}}catch(t){try{k("[worker-manager] createWorkerFromRaw failed",t)}catch{}}return null}function ro(){return typeof requestIdleCallback=="function"?new Promise(e=>{try{requestIdleCallback(e,{timeout:50})}catch{setTimeout(e,0)}}):new Promise(e=>setTimeout(e,0))}async function Pt(e,t=50){try{if(!e||!t)return;e%t===0&&await ro()}catch{}}const rt=new Set;function Gt(e){if(io(),rt.clear(),Array.isArray(Ne)&&Ne.length)for(const t of Ne)t&&rt.add(t);else for(const t of $e)t&&rt.add(t);qi(V),qi(Z),Gt._refreshed=!0}function qi(e){if(!(!e||typeof e.values!="function"))for(const t of e.values())t&&rt.add(t)}function Hi(e){if(!e||typeof e.set!="function")return;const t=e.set;e.set=function(n,i){return i&&rt.add(i),t.call(this,n,i)}}let Fi=!1;function io(){Fi||(Hi(V),Hi(Z),Fi=!0)}const Mr=Object.freeze(Object.defineProperty({__proto__:null,indexSet:rt,refreshIndexPaths:Gt},Symbol.toStringTag,{value:"Module"}));function hn(e,t=1e3){const n=new Map;function i(r){const a=r===void 0?"__undefined":String(r);if(n.has(a)){const o=n.get(a);return n.delete(a),n.set(a,o),o}const s=e(r);try{if(n.set(a,s),n.size>t){const o=n.keys().next().value;n.delete(o)}}catch{}return s}return i._cache=n,i._reset=()=>n.clear(),i}function Nr(e){return!e||typeof e!="string"?!1:/^(https?:)?\/\//.test(e)||e.startsWith("mailto:")||e.startsWith("tel:")}const Y=hn(function(e){return String(e||"").replace(/^[.\/]+/,"")},2e3),ln=hn(function(e){return String(e||"").replace(/\/+$/,"")},2e3),Kt=hn(function(e){return ln(String(e||""))+"/"},2e3);function ao(e){try{if(!e||typeof document>"u"||!document.head||e.startsWith("data:")||document.head.querySelector(`link[rel="preload"][as="image"][href="${e}"]`))return;const n=document.createElement("link");n.rel="preload",n.as="image",n.href=e,document.head.appendChild(n)}catch(t){k("[helpers] preloadImage failed",t)}}function Wn(e,t=0,n=!1){try{if(typeof window>"u"||!e||!e.querySelectorAll)return;const i=Array.from(e.querySelectorAll("img"));if(!i.length)return;const r=e,a=r&&r.getBoundingClientRect?r.getBoundingClientRect():null,s=0,o=typeof window<"u"&&(window.innerHeight||document.documentElement.clientHeight)||0,l=a?Math.max(s,a.top):s,u=(a?Math.min(o,a.bottom):o)+Number(t||0);let g=0;r&&(g=r.clientHeight||(a?a.height:0)),g||(g=o-s);let h=.6;try{const f=r&&window.getComputedStyle?window.getComputedStyle(r):null,w=f&&f.getPropertyValue("--nimbi-image-max-height-ratio"),y=w?parseFloat(w):NaN;!Number.isNaN(y)&&y>0&&y<=1&&(h=y)}catch(f){k("[helpers] read CSS ratio failed",f)}const d=Math.max(200,Math.floor(g*h));let p=!1,m=null;if(i.forEach(f=>{try{const w=f.getAttribute?f.getAttribute("loading"):void 0;w!=="eager"&&f.setAttribute&&f.setAttribute("loading","lazy");const y=f.getBoundingClientRect?f.getBoundingClientRect():null,_=f.src||f.getAttribute&&f.getAttribute("src"),b=y&&y.height>1?y.height:d,v=y?y.top:0,S=v+b;y&&b>0&&v<=u&&S>=l&&(f.setAttribute?(f.setAttribute("loading","eager"),f.setAttribute("fetchpriority","high"),f.setAttribute("data-eager-by-nimbi","1")):(f.loading="eager",f.fetchPriority="high"),ao(_),p=!0),!m&&y&&y.top<=u&&(m={img:f,src:_,rect:y,beforeLoading:w})}catch(w){k("[helpers] setEagerForAboveFoldImages per-image failed",w)}}),!p&&m){const{img:f,src:w,rect:y,beforeLoading:_}=m;try{f.setAttribute?(f.setAttribute("loading","eager"),f.setAttribute("fetchpriority","high"),f.setAttribute("data-eager-by-nimbi","1")):(f.loading="eager",f.fetchPriority="high")}catch(b){k("[helpers] setEagerForAboveFoldImages fallback failed",b)}}}catch(i){k("[helpers] setEagerForAboveFoldImages failed",i)}}function Pe(e,t=null,n){try{const i=typeof n=="string"?n:typeof window<"u"&&window.location?window.location.search:"",r=new URLSearchParams(i.startsWith("?")?i.slice(1):i),a=String(e||"");r.delete("page");const s=new URLSearchParams;s.set("page",a);for(const[c,u]of r.entries())s.append(c,u);const o=s.toString();let l=o?`?${o}`:"";return t&&(l+=`#${encodeURIComponent(t)}`),l||`?page=${encodeURIComponent(a)}`}catch{const r=`?page=${encodeURIComponent(String(e||""))}`;return t?`${r}#${encodeURIComponent(t)}`:r}}hn(function(e){try{const t=String(e||"");return t.includes("%")?t:encodeURI(t)}catch(t){return k("[helpers] encodeURL failed",t),String(e||"")}},2e3);function ir(e){try{const t=e();return t&&typeof t.then=="function"?t.catch(n=>{k("[helpers] safe swallowed error",n)}):t}catch(t){k("[helpers] safe swallowed error",t)}}try{typeof globalThis<"u"&&!globalThis.safe&&(globalThis.safe=ir)}catch(e){k("[helpers] global attach failed",e)}const so=hn(function(e){try{if(!e&&e!==0)return"";const t=String(e),n={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};return t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(i,r)=>{if(!r)return i;if(r[0]==="#")try{return r[1]==="x"||r[1]==="X"?String.fromCharCode(parseInt(r.slice(2),16)):String.fromCharCode(parseInt(r.slice(1),10))}catch{return i}return n[r]!==void 0?n[r]:i})}catch{return String(e||"")}},2e3),V=new Map;let st=[],ii=!1;function oo(e){ii=!!e}function _a(e){st=Array.isArray(e)?e.slice():[]}function lo(){return st}const fr=typeof navigator<"u"&&navigator.hardwareConcurrency?Math.max(1,Math.floor(navigator.hardwareConcurrency/2)):2,ka=wa(()=>Zt(eo),"slugManager",fr);function co(){try{if(Yr())return!0}catch{}try{return!!(typeof le=="string"&&le)}catch{return!1}}function fe(...e){try{Bt(...e)}catch{}}function uo(){return ka.get()}function xa(e){return ka.send(e,5e3)}async function Or(e,t=1,n=void 0){const i=await Promise.resolve().then(()=>at);if(!(i.initSlugWorker&&i.initSlugWorker()))throw new Error("slug worker required but unavailable");return await xa({type:"buildSearchIndex",contentBase:e,indexDepth:t,noIndexing:n})}async function ho(e,t,n){const i=await Promise.resolve().then(()=>at);if(!(i.initSlugWorker&&i.initSlugWorker()))throw new Error("slug worker required but unavailable");return xa({type:"crawlForSlug",slug:e,base:t,maxQueue:n})}function nt(e,t){if(!e)return;let n=null;try{n=Y(typeof t=="string"?t:String(t||""))}catch{n=String(t||"")}if(n){try{if(st&&st.length){const r=String(n).split("/")[0],a=st.includes(r);let s=V.get(e);if(!s||typeof s=="string")s={default:typeof s=="string"?Y(s):void 0,langs:{}};else try{s.default&&(s.default=Y(s.default))}catch{}a?s.langs[r]=n:s.default=n,V.set(e,s)}else{const i=V.has(e)?V.get(e):void 0;if(!i)V.set(e,n);else{let r=null;try{typeof i=="string"?r=Y(i):i&&typeof i=="object"&&(r=i.default?Y(i.default):null)}catch{r=null}if(r===n)V.set(e,n);else{let a=null,s=2;for(;a=`${e}-${s}`,!!V.has(a);){let o=V.get(a),l=null;try{typeof o=="string"?l=Y(o):o&&typeof o=="object"&&(l=o.default?Y(o.default):null)}catch{l=null}if(l===n){e=a;break}if(s+=1,s>1e4)break}try{if(!V.has(a))V.set(a,n),e=a;else if(V.get(a)===n)e=a;else{const o=new Set;for(const c of V.keys())o.add(c);const l=typeof Xt=="function"?Xt(e,o):`${e}-2`;V.set(l,n),e=l}}catch{}}}}}catch{}try{if(n){try{Z.set(n,e)}catch{}try{if($e&&typeof $e.has=="function"){if(!$e.has(n)){try{$e.add(n)}catch{}try{Array.isArray(Ne)&&!Ne.includes(n)&&Ne.push(n)}catch{}}}else try{Array.isArray(Ne)&&!Ne.includes(n)&&Ne.push(n)}catch{}}catch{}}}catch{}}}const gr=new Set;function fo(e){typeof e=="function"&&gr.add(e)}function go(e){typeof e=="function"&&gr.delete(e)}const Z=new Map;let Br={},Ne=[];const $e=new Set;let le="_404.md",bt=null;const ai="_home";function Sa(e){if(e==null){le=null;return}le=String(e||"")}function va(e){if(e==null){bt=null;return}bt=String(e||"")}function po(e){Br=e||{}}function Aa(e){try{if(Array.isArray(re)||(re=[]),!Array.isArray(e))return;try{Array.isArray(re)||(re=[]),re.length=0;for(const t of e)re.push(t);try{if(typeof window<"u")try{window.__nimbiLiveSearchIndex=re}catch{}}catch{}}catch(t){fe("[slugManager] replacing searchIndex by assignment fallback",t);try{re=Array.from(e)}catch{}}}catch{}}const kn=new Map,ar=new Set;function mo(){kn.clear(),ar.clear()}function yo(e){if(!e||e.length===0)return"";let t=e[0];for(let i=1;i<e.length;i++){const r=e[i];let a=0;const s=Math.min(t.length,r.length);for(;a<s&&t[a]===r[a];)a++;t=t.slice(0,a)}const n=t.lastIndexOf("/");return n===-1?t:t.slice(0,n+1)}const he=hn(function(e){let n=String(e||"").toLowerCase().replace(/[^a-z0-9\- ]/g,"").replace(/ /g,"-");return n=n.replace(/(?:-?)(?:md|html)$/,""),n=n.replace(/-+/g,"-"),n=n.replace(/^-|-$/g,""),n.length>80&&(n=n.slice(0,80).replace(/-+$/g,"")),n},2e3);function si(e){V.clear(),Z.clear(),Ne=[];try{$e.clear()}catch{}st=st||[];const t=Object.keys(Br||{});if(!t.length)return;let n="";try{if(e){try{/^[a-z][a-z0-9+.-]*:/i.test(String(e))?n=new URL(String(e)).pathname:n=String(e||"")}catch(i){n=String(e||""),fe("[slugManager] parse contentBase failed",i)}n=Kt(n)}}catch(i){n="",fe("[slugManager] setContentBase prefix derivation failed",i)}n||(n=yo(t));for(const i of t){let r=i;n&&i.startsWith(n)?r=Y(i.slice(n.length)):r=Y(i),Ne.push(r);try{$e.add(r)}catch{}try{Gt()}catch(s){fe("[slugManager] refreshIndexPaths failed",s)}const a=Br[i];if(typeof a=="string"){const s=(a||"").match(/^#\s+(.+)$/m);if(s&&s[1]){const o=he(s[1].trim());if(o)try{let l=o;if((!st||!st.length)&&(l=Xt(l,new Set(V.keys()))),st&&st.length){const u=r.split("/")[0],g=st.includes(u);let h=V.get(l);(!h||typeof h=="string")&&(h={default:typeof h=="string"?h:void 0,langs:{}}),g?h.langs[u]=r:h.default=r,V.set(l,h)}else V.set(l,r);Z.set(r,l)}catch(l){fe("[slugManager] set slug mapping failed",l)}}}}}try{si()}catch(e){fe("[slugManager] initial setContentBase failed",e)}function Xt(e,t){if(!t.has(e))return e;let n=2,i=`${e}-${n}`;for(;t.has(i);)n+=1,i=`${e}-${n}`;return i}function bo(e){return In(e,void 0)}function In(e,t){if(!e)return!1;if(e.startsWith("//"))return!0;if(/^[a-z][a-z0-9+.-]*:/i.test(e)){if(t&&typeof t=="string")try{const n=new URL(e),i=new URL(t);return n.origin!==i.origin?!0:!n.pathname.startsWith(i.pathname)}catch{return!0}return!0}if(e.startsWith("/")&&t&&typeof t=="string")try{const n=new URL(e,t),i=new URL(t);return n.origin!==i.origin?!0:!n.pathname.startsWith(i.pathname)}catch{return!0}return!1}function Kn(e){return e==null?e:String(e).replace(/\\([\\`*_{}\[\]()#+\-.!])/g,(t,n)=>n)}function cn(e){if(!e||!V.has(e))return null;const t=V.get(e);if(!t)return null;if(typeof t=="string")return t;if(st&&st.length&&jt&&t.langs&&t.langs[jt])return t.langs[jt];if(t.default)return t.default;if(t.langs){const n=Object.keys(t.langs);if(n.length)return t.langs[n[0]]}return null}const ft=new dr({maxSize:2e3});function wo(){ft.clear(),qt.clear()}const qt=new dr({maxSize:2e3});let Ea=60*1e3;function _o(e){Ea=Number(e)||0}function ko(e){try{const t=Math.max(0,Number(e)||0);ft&&typeof ft._maxSize<"u"&&(ft._maxSize=t)}catch{}}function xo(e){try{const t=Math.max(0,Number(e)||0);ft&&typeof ft._ttlMs<"u"&&(ft._ttlMs=t)}catch{}}function So(e){try{const t=Math.max(0,Number(e)||0);qt&&typeof qt._maxSize<"u"&&(qt._maxSize=t)}catch{}}let jr=Math.max(1,Math.min(fr,5));function vo(e){try{jr=Math.max(1,Number(e)||1)}catch{jr=1}}function xn(){return jr}let Oe=async function(e,t,n){if(!e)throw new Error("path required");try{if(typeof e=="string"&&(e.indexOf("?page=")!==-1||e.startsWith("?")||e.startsWith("#/")||e.indexOf("#/")!==-1))try{const c=it(e);c&&c.page&&(e=c.page)}catch{}}catch{}try{const c=(String(e||"").match(/([^\/]+)\.md(?:$|[?#])/)||[])[1],u=typeof e=="string"&&String(e).indexOf("/")===-1;if(c&&(u||!1)&&V.has(c)){const h=cn(c)||V.get(c);h&&h!==e&&(e=h)}}catch(c){fe("[slugManager] slug mapping normalization failed",c)}try{if(typeof e=="string"&&e.indexOf("::")!==-1){const c=String(e).split("::",1)[0];if(c)try{if(V.has(c)){const u=cn(c)||V.get(c);u?e=u:e=c}else e=c}catch{e=c}}}catch(c){fe("[slugManager] path sanitize failed",c)}if(!(n&&n.force===!0||typeof le=="string"&&le||V&&V.size||$e&&$e.size||Yr()))throw new Error("failed to fetch md");const r=t==null?"":ln(String(t));let a="";try{const c=typeof location<"u"&&location.origin?location.origin:"http://localhost";if(r&&r.startsWith("/")&&!/^[a-z][a-z0-9+.-]*:/i.test(r)){const u=r.replace(/\/$/,"")+"/"+e.replace(/^\//,"");a=(typeof location<"u"&&location&&location.origin?location.origin:"http://localhost").replace(/\/$/,"")+u}else{let u=c+"/";r&&(/^[a-z][a-z0-9+.-]*:/i.test(r)?u=r.replace(/\/$/,"")+"/":r.startsWith("/")?u=c+r.replace(/\/$/,"")+"/":u=c+"/"+r.replace(/\/$/,"")+"/"),a=new URL(e.replace(/^\//,""),u).toString()}}catch{a=(typeof location<"u"&&location.origin?location.origin:"http://localhost")+"/"+e.replace(/^\//,"")}const s=n&&n.signal;try{const c=qt.get(a);if(c&&c>Date.now())return Promise.reject(new Error("failed to fetch md"));c&&qt.delete(a)}catch{}if(ft.has(a))return ft.get(a);const l=(async()=>{const c=await fetch(a,s?{signal:s}:void 0);if(!c||typeof c.ok!="boolean"||!c.ok){if(c&&c.status===404&&typeof le=="string"&&le)try{const m=`${r}/${le}`,f=await globalThis.fetch(m,s?{signal:s}:void 0);if(f&&typeof f.ok=="boolean"&&f.ok)return{raw:await f.text(),status:404}}catch(m){fe("[slugManager] fetching fallback 404 failed",m)}let p="";try{c&&typeof c.clone=="function"?p=await c.clone().text():c&&typeof c.text=="function"?p=await c.text():p=""}catch(m){p="",fe("[slugManager] reading error body failed",m)}try{const m=c?c.status:void 0;if(m===404)try{k("fetchMarkdown failed (404):",()=>({url:a,status:m,statusText:c?c.statusText:void 0,body:p.slice(0,200)}))}catch{}else try{nr("fetchMarkdown failed:",()=>({url:a,status:m,statusText:c?c.statusText:void 0,body:p.slice(0,200)}))}catch{}}catch{}throw new Error("failed to fetch md")}const u=await c.text(),g=u.trim().slice(0,128).toLowerCase(),h=/^(?:<!doctype|<html|<title|<h1)/.test(g),d=h||String(e||"").toLowerCase().endsWith(".html");if(h&&String(e||"").toLowerCase().endsWith(".md")){try{if(typeof le=="string"&&le){const p=`${r}/${le}`,m=await globalThis.fetch(p,s?{signal:s}:void 0);if(m.ok)return{raw:await m.text(),status:404}}}catch(p){fe("[slugManager] fetching fallback 404 failed",p)}throw co()&&nr("fetchMarkdown: server returned HTML for .md request",a),new Error("failed to fetch md")}return d?{raw:u,isHtml:!0}:{raw:u}})().catch(c=>{if(c&&c.name==="AbortError"){try{ft.delete(a)}catch{}throw c}try{qt.set(a,Date.now()+Ea)}catch{}try{ft.delete(a)}catch{}throw c});return ft.set(a,l),l};function Ao(e){typeof e=="function"&&(Oe=e)}const Vn=new Map;function Eo(e){if(!e||typeof e!="string")return"";let t=e.replace(/```[\s\S]*?```/g,"");return t=t.replace(/<pre[\s\S]*?<\/pre>/gi,""),t=t.replace(/<code[\s\S]*?<\/code>/gi,""),t=t.replace(/<!--([\s\S]*?)-->/g,""),t=t.replace(/^ {4,}.*$/gm,""),t=t.replace(/`[^`]*`/g,""),t}let re=[];function Co(){return re}try{if(typeof window<"u")try{Object.defineProperty(window,"__nimbiSearchIndex",{get(){return re},enumerable:!0,configurable:!0})}catch{try{window.__nimbiSearchIndex=re}catch{}}}catch{}try{if(typeof window<"u")try{Object.defineProperty(window,"__nimbiIndexReady",{get(){return qr},enumerable:!0,configurable:!0})}catch{try{window.__nimbiIndexReady=qr}catch{}}}catch{}let It=null;async function Wt(e,t=1,n=void 0,i=void 0){const r=Array.isArray(n)?Array.from(new Set((n||[]).map(a=>Y(String(a||""))))):[];try{const a=Y(String(le||""));a&&!r.includes(a)&&r.push(a)}catch{}if(re&&re.length&&t===1&&!re.some(s=>{try{return r.includes(Y(String(s.path||"")))}catch{return!1}}))return re;if(It)return It;It=(async()=>{let a=Array.isArray(n)?Array.from(new Set((n||[]).map(f=>Y(String(f||""))))):[];try{const f=Y(String(le||""));f&&!a.includes(f)&&a.push(f)}catch{}const s=f=>{if(!a||!a.length)return!1;for(const w of a)if(w&&(f===w||f.startsWith(w+"/")))return!0;return!1};let o=[];try{if(Array.isArray(i)&&i.length)for(const f of i)try{const w=Y(String(f||""));w&&o.push(w)}catch{}}catch{}if(Array.isArray(Ne)&&Ne.length&&(o=Array.from(Ne)),!o.length){if(Z&&typeof Z.size=="number"&&Z.size)try{o=Array.from(Z.keys())}catch{o=[]}else for(const f of V.values())if(f){if(typeof f=="string")o.push(f);else if(f&&typeof f=="object"){f.default&&o.push(f.default);const w=f.langs||{};for(const y of Object.keys(w||{}))try{w[y]&&o.push(w[y])}catch{}}}}try{const f=await za(e);f&&f.length&&(o=o.concat(f))}catch(f){fe("[slugManager] crawlAllMarkdown during buildSearchIndex failed",f)}try{const f=new Set(o),w=[...o],y=Math.max(1,Math.min(xn(),w.length||xn()));let _=0;const b=async()=>{for(;!(f.size>Nn);){const S=w.shift();if(!S)break;try{const E=await Oe(S,e);if(E&&E.raw){if(E.status===404)continue;let P=E.raw;const I=[],U=String(S||"").replace(/^.*\//,"");if(/^readme(?:\.md)?$/i.test(U)&&ii&&(!S||!S.includes("/")))continue;const z=Eo(P),O=/\[[^\]]+\]\(([^)]+)\)/g;let W;for(;W=O.exec(z);)I.push(W[1]);const te=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/gi;for(;W=te.exec(z);)I.push(W[1]);const H=S&&S.includes("/")?S.substring(0,S.lastIndexOf("/")+1):"";for(let M of I)try{if(In(M,e)||M.startsWith("..")||M.indexOf("/../")!==-1||(H&&!M.startsWith("./")&&!M.startsWith("/")&&!M.startsWith("../")&&(M=H+M),M=Y(M),!/\.(md|html?)(?:$|[?#])/i.test(M))||(M=M.split(/[?#]/)[0],s(M)))continue;f.has(M)||(f.add(M),w.push(M),o.push(M))}catch(F){fe("[slugManager] href processing failed",M,F)}}}catch(E){fe("[slugManager] discovery fetch failed for",S,E)}try{_++,await Pt(_,32)}catch{}}},v=[];for(let S=0;S<y;S++)v.push(b());await Promise.all(v)}catch(f){fe("[slugManager] discovery loop failed",f)}const l=new Set;o=o.filter(f=>!f||l.has(f)||s(f)?!1:(l.add(f),!0));const c=[],u=new Map,g=o.filter(f=>/\.(?:md|html?)(?:$|[?#])/i.test(f)),h=Math.max(1,Math.min(xn(),g.length||1)),d=g.slice(),p=[];for(let f=0;f<h;f++)p.push((async()=>{for(;d.length;){const w=d.shift();if(!w)break;try{const y=await Oe(w,e);u.set(w,y)}catch(y){fe("[slugManager] buildSearchIndex: entry fetch failed",w,y),u.set(w,null)}}})());await Promise.all(p);let m=0;for(const f of o){try{m++,await Pt(m,16)}catch{}if(/\.(?:md|html?)(?:$|[?#])/i.test(f))try{const w=u.get(f);if(!w||!w.raw||w.status===404)continue;let y="",_="",b=null;if(w.isHtml)try{const S=qe(),E=S?S.parseFromString(w.raw,"text/html"):null,P=E?E.querySelector("title")||E.querySelector("h1"):null;P&&P.textContent&&(y=P.textContent.trim());const I=E?E.querySelector("p"):null;if(I&&I.textContent&&(_=I.textContent.trim()),t>=2)try{const U=E?E.querySelector("h1"):null,z=U&&U.textContent?U.textContent.trim():y||"";try{const W=Z&&typeof Z.has=="function"&&Z.has(f)?Z.get(f):null;if(W)b=W;else{let te=he(y||f);const H=new Set;try{for(const F of V.keys())H.add(F)}catch{}try{for(const F of c)F&&F.slug&&H.add(String(F.slug).split("::")[0])}catch{}let M=!1;try{if(V.has(te)){const F=V.get(te);if(typeof F=="string")F===f&&(M=!0);else if(F&&typeof F=="object"){F.default===f&&(M=!0);for(const G of Object.keys(F.langs||{}))if(F.langs[G]===f){M=!0;break}}}}catch{}!M&&H.has(te)&&(te=Xt(te,H)),b=te;try{Z.has(f)||nt(b,f)}catch{}}}catch(W){fe("[slugManager] derive pageSlug failed",W)}const O=Array.from(E.querySelectorAll("h2"));for(const W of O)try{const te=(W.textContent||"").trim();if(!te)continue;const H=W.id?W.id:he(te),M=b?`${b}::${H}`:`${he(f)}::${H}`;let F="",G=W.nextElementSibling;for(;G&&G.tagName&&G.tagName.toLowerCase()==="script";)G=G.nextElementSibling;G&&G.textContent&&(F=String(G.textContent).trim()),c.push({slug:M,title:te,excerpt:F,path:f,parentTitle:z})}catch(te){fe("[slugManager] indexing H2 failed",te)}if(t===3)try{const W=Array.from(E.querySelectorAll("h3"));for(const te of W)try{const H=(te.textContent||"").trim();if(!H)continue;const M=te.id?te.id:he(H),F=b?`${b}::${M}`:`${he(f)}::${M}`;let G="",ie=te.nextElementSibling;for(;ie&&ie.tagName&&ie.tagName.toLowerCase()==="script";)ie=ie.nextElementSibling;ie&&ie.textContent&&(G=String(ie.textContent).trim()),c.push({slug:F,title:H,excerpt:G,path:f,parentTitle:z})}catch(H){fe("[slugManager] indexing H3 failed",H)}}catch(W){fe("[slugManager] collect H3s failed",W)}}catch(U){fe("[slugManager] collect H2s failed",U)}}catch(S){fe("[slugManager] parsing HTML for index failed",S)}else{const S=w.raw,E=S.match(/^#\s+(.+)$/m);y=E?E[1].trim():"";try{y=Kn(y)}catch{}const P=S.split(/\r?\n\s*\r?\n/);if(P.length>1)for(let I=1;I<P.length;I++){const U=P[I].trim();if(U&&!/^#/.test(U)){_=U.replace(/\r?\n/g," ");break}}if(t>=2){let I="";try{const U=(S.match(/^#\s+(.+)$/m)||[])[1];I=U?U.trim():"";try{const W=Z&&typeof Z.has=="function"&&Z.has(f)?Z.get(f):null;if(W)b=W;else{let te=he(y||f);const H=new Set;try{for(const F of V.keys())H.add(F)}catch{}try{for(const F of c)F&&F.slug&&H.add(String(F.slug).split("::")[0])}catch{}let M=!1;try{if(V.has(te)){const F=V.get(te);if(typeof F=="string")F===f&&(M=!0);else if(F&&typeof F=="object"){F.default===f&&(M=!0);for(const G of Object.keys(F.langs||{}))if(F.langs[G]===f){M=!0;break}}}}catch{}!M&&H.has(te)&&(te=Xt(te,H)),b=te;try{Z.has(f)||nt(b,f)}catch{}}}catch(W){fe("[slugManager] derive pageSlug failed",W)}const z=/^##\s+(.+)$/gm;let O;for(;O=z.exec(S);)try{const W=(O[1]||"").trim(),te=Kn(W);if(!W)continue;const H=he(W),M=b?`${b}::${H}`:`${he(f)}::${H}`,G=S.slice(z.lastIndex).match(/^(?:\r?\n)*([^\r\n][^\r\n]*(?:\r?\n[^\r\n].*)*)/),ie=G&&G[1]?String(G[1]).trim().split(/\r?\n/).join(" ").slice(0,300):"";c.push({slug:M,title:te,excerpt:ie,path:f,parentTitle:I})}catch(W){fe("[slugManager] indexing markdown H2 failed",W)}}catch(U){fe("[slugManager] collect markdown H2s failed",U)}if(t===3)try{const U=/^###\s+(.+)$/gm;let z;for(;z=U.exec(S);)try{const O=(z[1]||"").trim(),W=Kn(O);if(!O)continue;const te=he(O),H=b?`${b}::${te}`:`${he(f)}::${te}`,F=S.slice(U.lastIndex).match(/^(?:\r?\n)*([^\r\n][^\r\n]*(?:\r?\n[^\r\n].*)*)/),G=F&&F[1]?String(F[1]).trim().split(/\r?\n/).join(" ").slice(0,300):"";c.push({slug:H,title:W,excerpt:G,path:f,parentTitle:I})}catch(O){fe("[slugManager] indexing markdown H3 failed",O)}}catch(U){fe("[slugManager] collect markdown H3s failed",U)}}}let v="";try{Z.has(f)&&(v=Z.get(f))}catch(S){fe("[slugManager] mdToSlug access failed",S)}if(!v){try{if(!b){const S=Z&&typeof Z.has=="function"&&Z.has(f)?Z.get(f):null;if(S)b=S;else{let E=he(y||f);const P=new Set;try{for(const U of V.keys())P.add(U)}catch{}try{for(const U of c)U&&U.slug&&P.add(String(U.slug).split("::")[0])}catch{}let I=!1;try{if(V.has(E)){const U=V.get(E);if(typeof U=="string")U===f&&(I=!0);else if(U&&typeof U=="object"){U.default===f&&(I=!0);for(const z of Object.keys(U.langs||{}))if(U.langs[z]===f){I=!0;break}}}}catch{}!I&&P.has(E)&&(E=Xt(E,P)),b=E;try{Z.has(f)||nt(b,f)}catch{}}}}catch(S){fe("[slugManager] derive pageSlug failed",S)}v=b||he(y||f)}c.push({slug:v,title:y,excerpt:_,path:f})}catch(w){fe("[slugManager] buildSearchIndex: entry processing failed",w)}}try{const f=c.filter(w=>{try{return!s(String(w.path||""))}catch{return!0}});try{Array.isArray(re)||(re=[]),re.length=0;for(const w of f)re.push(w)}catch{try{re=Array.from(f)}catch{re=f}}try{if(typeof window<"u"){try{window.__nimbiResolvedIndex=re}catch{}try{const w=[],y=new Set;for(const _ of re)try{if(!_||!_.slug)continue;const b=String(_.slug).split("::")[0];if(y.has(b))continue;y.add(b);const v={slug:b};_.title?v.title=String(_.title):_.parentTitle&&(v.title=String(_.parentTitle)),_.path&&(v.path=String(_.path)),w.push(v)}catch{}try{window.__nimbiSitemapJson={generatedAt:new Date().toISOString(),entries:w}}catch{}try{window.__nimbiSitemapFinal=w}catch{}}catch{}}}catch{}}catch(f){fe("[slugManager] filtering index by excludes failed",f);try{Array.isArray(re)||(re=[]),re.length=0;for(const w of c)re.push(w)}catch{try{re=Array.from(c)}catch{re=c}}try{if(typeof window<"u")try{window.__nimbiResolvedIndex=re}catch{}}catch{}}return re})();try{await It}catch(a){fe("[slugManager] awaiting _indexPromise failed",a)}return It=null,re}async function Ot(e={}){try{const t=typeof e.timeoutMs=="number"?e.timeoutMs:8e3,n=e.contentBase,i=typeof e.indexDepth=="number"?e.indexDepth:1,r=Array.isArray(e.noIndexing)?e.noIndexing:void 0,a=Array.isArray(e.seedPaths)?e.seedPaths:void 0,s=typeof e.startBuild=="boolean"?e.startBuild:!0;if(Array.isArray(re)&&re.length&&!It&&!s)return re;if(It){try{await It}catch{}return re}if(s){try{if(typeof Or=="function")try{const l=await Or(n,i,r,a);if(Array.isArray(l)&&l.length){try{Aa(l)}catch{}return re}}catch{}}catch{}try{return await Wt(n,i,r,a),re}catch{}}const o=Date.now();for(;Date.now()-o<t;){if(Array.isArray(re)&&re.length)return re;await new Promise(l=>setTimeout(l,150))}return re}catch{return re}}async function qr(e={}){try{const t=Object.assign({},e);typeof t.startBuild!="boolean"&&(t.startBuild=!0),typeof t.timeoutMs!="number"&&(t.timeoutMs=1/0);try{return await Ot(t)}catch{return re}}catch{return re}}const Ca=1e3;let Nn=Ca;function Mo(e){typeof e=="number"&&e>=0&&(Nn=e)}const Ma=qe(),La="a[href]";let Ta=async function(e,t,n=Nn){if(Vn.has(e))return Vn.get(e);let i=null;const r=new Set,a=[""],s=typeof location<"u"&&location.origin?location.origin:"http://localhost";let o=s+"/";try{t&&(/^[a-z][a-z0-9+.-]*:/i.test(String(t))?o=String(t).replace(/\/$/,"")+"/":String(t).startsWith("/")?o=s+String(t).replace(/\/$/,"")+"/":o=s+"/"+String(t).replace(/\/$/,"")+"/")}catch{o=s+"/"}const l=Math.max(1,Math.min(fr,6));for(;a.length&&!i&&!(a.length>n);){const c=a.splice(0,l);await zn(c,async u=>{if(u==null||r.has(u))return;r.add(u);let g="";try{g=new URL(u||"",o).toString()}catch{g=(String(t||"")||s)+"/"+String(u||"").replace(/^\//,"")}try{let h;try{h=await globalThis.fetch(g)}catch(w){fe("[slugManager] crawlForSlug: fetch failed",{url:g,error:w});return}if(!h||!h.ok){h&&!h.ok&&fe("[slugManager] crawlForSlug: directory fetch non-ok",{url:g,status:h.status});return}const d=await h.text(),p=Ma.parseFromString(d,"text/html");let m=[];try{p&&typeof p.getElementsByTagName=="function"?m=p.getElementsByTagName("a"):p&&typeof p.querySelectorAll=="function"?m=p.querySelectorAll(La):m=[]}catch{try{m=p.getElementsByTagName?p.getElementsByTagName("a"):[]}catch{m=[]}}const f=g;for(const w of m)try{if(i)break;let y=w.getAttribute("href")||"";if(!y||In(y,t)||y.startsWith("..")||y.indexOf("/../")!==-1)continue;if(y.endsWith("/")){try{const _=new URL(y,f),b=new URL(o).pathname,v=_.pathname.startsWith(b)?_.pathname.slice(b.length):_.pathname.replace(/^\//,""),S=Kt(Y(v));r.has(S)||a.push(S)}catch{const b=Y(u+y);r.has(b)||a.push(b)}continue}if(y.toLowerCase().endsWith(".md")){let _="";try{const b=new URL(y,f),v=new URL(o).pathname;_=b.pathname.startsWith(v)?b.pathname.slice(v.length):b.pathname.replace(/^\//,"")}catch{_=(u+y).replace(/^\//,"")}_=Y(_);try{if(Z.has(_))continue;for(const b of V.values());}catch(b){fe("[slugManager] slug map access failed",b)}try{const b=await Oe(_,t);if(b&&b.raw){const v=(b.raw||"").match(/^#\s+(.+)$/m);if(v&&v[1]&&he(v[1].trim())===e){i=_;break}}}catch(b){fe("[slugManager] crawlForSlug: fetchMarkdown failed",b)}}}catch(y){fe("[slugManager] crawlForSlug: link iteration failed",y)}}catch(h){fe("[slugManager] crawlForSlug: directory fetch failed",h)}},l)}return Vn.set(e,i),i};async function za(e,t=Nn){const n=new Set,i=new Set,r=[""],a=typeof location<"u"&&location.origin?location.origin:"http://localhost";let s=a+"/";try{e&&(/^[a-z][a-z0-9+.-]*:/i.test(String(e))?s=String(e).replace(/\/$/,"")+"/":String(e).startsWith("/")?s=a+String(e).replace(/\/$/,"")+"/":s=a+"/"+String(e).replace(/\/$/,"")+"/")}catch{s=a+"/"}const o=Math.max(1,Math.min(fr,6));for(;r.length&&!(r.length>t);){const l=r.splice(0,o);await zn(l,async c=>{if(c==null||i.has(c))return;i.add(c);let u="";try{u=new URL(c||"",s).toString()}catch{u=(String(e||"")||a)+"/"+String(c||"").replace(/^\//,"")}try{let g;try{g=await globalThis.fetch(u)}catch(f){fe("[slugManager] crawlAllMarkdown: fetch failed",{url:u,error:f});return}if(!g||!g.ok){g&&!g.ok&&fe("[slugManager] crawlAllMarkdown: directory fetch non-ok",{url:u,status:g.status});return}const h=await g.text(),d=Ma.parseFromString(h,"text/html");let p=[];try{d&&typeof d.getElementsByTagName=="function"?p=d.getElementsByTagName("a"):d&&typeof d.querySelectorAll=="function"?p=d.querySelectorAll(La):p=[]}catch{try{p=d.getElementsByTagName?d.getElementsByTagName("a"):[]}catch{p=[]}}const m=u;for(const f of p)try{let w=f.getAttribute("href")||"";if(!w||In(w,e)||w.startsWith("..")||w.indexOf("/../")!==-1)continue;if(w.endsWith("/")){try{const _=new URL(w,m),b=new URL(s).pathname,v=_.pathname.startsWith(b)?_.pathname.slice(b.length):_.pathname.replace(/^\//,""),S=Kt(Y(v));i.has(S)||r.push(S)}catch{const b=c+w;i.has(b)||r.push(b)}continue}let y="";try{const _=new URL(w,m),b=new URL(s).pathname;y=_.pathname.startsWith(b)?_.pathname.slice(b.length):_.pathname.replace(/^\//,"")}catch{y=(c+w).replace(/^\//,"")}y=Y(y),/\.(md|html?)$/i.test(y)&&n.add(y)}catch(w){fe("[slugManager] crawlAllMarkdown: link iteration failed",w)}}catch(g){fe("[slugManager] crawlAllMarkdown: directory fetch failed",g)}},o)}return Array.from(n)}async function Ra(e,t,n){if(e&&typeof e=="string"&&(e=Y(e),e=ln(e)),V.has(e))return cn(e)||V.get(e);try{if(!(typeof le=="string"&&le||V.has(e)||$e&&$e.size||Gt._refreshed||typeof t=="string"&&/^[a-z][a-z0-9+.-]*:\/\//i.test(t)))return null}catch{}for(const r of gr)try{const a=await r(e,t);if(a)return nt(e,a),a}catch(a){fe("[slugManager] slug resolver failed",a)}if($e&&$e.size){if(kn.has(e)){const r=kn.get(e);return nt(e,r),r}for(const r of Ne)if(!ar.has(r))try{const a=await Oe(r,t);if(a&&a.raw){const s=(a.raw||"").match(/^#\s+(.+)$/m);if(s&&s[1]){const o=he(s[1].trim());if(ar.add(r),o&&kn.set(o,r),o===e)return nt(e,r),r}}}catch(a){fe("[slugManager] manifest title fetch failed",a)}try{crawlBatchYieldCount++,await Pt(crawlBatchYieldCount,8)}catch{}}try{const r=await Wt(t);if(r&&r.length){const a=r.find(s=>s.slug===e);if(a)return nt(e,a.path),a.path}}catch(r){fe("[slugManager] buildSearchIndex lookup failed",r)}try{const r=await Ta(e,t,n);if(r)return nt(e,r),r}catch(r){fe("[slugManager] crawlForSlug lookup failed",r)}const i=[`${e}.html`,`${e}.md`];for(const r of i)try{const a=await Oe(r,t);if(a&&a.raw)return nt(e,r),r}catch(a){fe("[slugManager] candidate fetch failed",a)}if($e&&$e.size)for(const r of Ne)try{const a=r.replace(/^.*\//,"").replace(/\.(md|html?)$/i,"");if(he(a)===e)return nt(e,r),r}catch(a){fe("[slugManager] build-time filename match failed",a)}try{if(bt&&typeof bt=="string"&&bt.trim())try{const r=await Oe(bt,t);if(r&&r.raw){const a=(r.raw||"").match(/^#\s+(.+)$/m);if(a&&a[1]&&he(a[1].trim())===e)return nt(e,bt),bt}}catch(r){fe("[slugManager] home page fetch failed",r)}}catch(r){fe("[slugManager] home page fetch failed",r)}return null}const at=Object.freeze(Object.defineProperty({__proto__:null,CRAWL_MAX_QUEUE:Ca,HOME_SLUG:ai,_setAllMd:po,_setSearchIndex:Aa,_storeSlugMapping:nt,addSlugResolver:fo,get allMarkdownPaths(){return Ne},allMarkdownPathsSet:$e,get availableLanguages(){return st},awaitSearchIndex:qr,buildSearchIndex:Wt,buildSearchIndexWorker:Or,clearFetchCache:wo,clearListCaches:mo,crawlAllMarkdown:za,crawlCache:Vn,crawlForSlug:Ta,crawlForSlugWorker:ho,get defaultCrawlMaxQueue(){return Nn},ensureSlug:Ra,fetchCache:ft,get fetchMarkdown(){return Oe},getFetchConcurrency:xn,getLanguages:lo,getSearchIndex:Co,get homePage(){return bt},initSlugWorker:uo,isExternalLink:bo,isExternalLinkWithBase:In,listPathsFetched:ar,listSlugCache:kn,mdToSlug:Z,negativeFetchCache:qt,get notFoundPage(){return le},removeSlugResolver:go,resolveSlugPath:cn,get searchIndex(){return re},setContentBase:si,setDefaultCrawlMaxQueue:Mo,setFetchCacheMaxSize:ko,setFetchCacheTTL:xo,setFetchConcurrency:vo,setFetchMarkdown:Ao,setFetchNegativeCacheTTL:_o,setHomePage:va,setLanguages:_a,setNegativeFetchCacheMaxSize:So,setNotFoundPage:Sa,setSkipRootReadme:oo,get skipRootReadme(){return ii},slugResolvers:gr,slugToMd:V,slugify:he,unescapeMarkdown:Kn,uniqueSlug:Xt,whenSearchIndexReady:Ot},Symbol.toStringTag,{value:"Module"}));var Lr,Di;function Lo(){if(Di)return Lr;Di=1;function e(a,s){return s.some(([o,l])=>o<=a&&a<=l)}function t(a){if(typeof a!="string")return!1;const s=a.charCodeAt(0);return e(s,[[12352,12447],[19968,40959],[44032,55203],[131072,191456]])}function n(a){return`
|
|
74
|
+
`;function so(e,t="worker"){let n=null;function i(...l){try{k(...l)}catch{}}function r(){if(!n)try{const l=e();n=l||null,l&&l.addEventListener("error",()=>{try{n===l&&(n=null,l.terminate&&l.terminate())}catch(c){i("["+t+"] worker termination failed",c)}})}catch(l){n=null,i("["+t+"] worker init failed",l)}return n}function a(){try{n&&(n.terminate&&n.terminate(),n=null)}catch(l){i("["+t+"] worker termination failed",l)}}function s(l,c=1e4){return new Promise((u,g)=>{const h=r();if(!h)return g(new Error("worker unavailable"));const d=String(Math.random()),p=Object.assign({},l,{id:d});let m=null;const f=()=>{m&&clearTimeout(m),h.removeEventListener("message",w),h.removeEventListener("error",y)},w=_=>{const b=_.data||{};b.id===d&&(f(),b.error?g(new Error(b.error)):u(b.result))},y=_=>{f(),i("["+t+"] worker error event",_);try{n===h&&(n=null,h.terminate&&h.terminate())}catch(b){i("["+t+"] worker termination failed",b)}g(new Error(_&&_.message||"worker error"))};m=setTimeout(()=>{f(),i("["+t+"] worker timed out");try{n===h&&(n=null,h.terminate&&h.terminate())}catch(_){i("["+t+"] worker termination on timeout failed",_)}g(new Error("worker timeout"))},c),h.addEventListener("message",w),h.addEventListener("error",y);try{h.postMessage(p)}catch(_){f(),g(_)}})}return{get:r,send:s,terminate:a}}function Sa(e,t="worker-pool",n=2){const i=new Array(n).fill(null);let r=0;function a(...p){try{k(...p)}catch{}}function s(p){if(!i[p])try{const m=e();i[p]=m||null,m&&m.addEventListener("error",()=>{try{i[p]===m&&(i[p]=null,m.terminate&&m.terminate())}catch(f){a("["+t+"] worker termination failed",f)}})}catch(m){i[p]=null,a("["+t+"] worker init failed",m)}return i[p]}const o=new Array(n).fill(0),l=new Array(n).fill(null),c=30*1e3;function u(p){try{o[p]=Date.now(),l[p]&&(clearTimeout(l[p]),l[p]=null),l[p]=setTimeout(()=>{try{i[p]&&(i[p].terminate&&i[p].terminate(),i[p]=null)}catch(m){a("["+t+"] idle termination failed",m)}l[p]=null},c)}catch{}}function g(){for(let p=0;p<i.length;p++){const m=s(p);if(m)return m}return null}function h(){for(let p=0;p<i.length;p++)try{i[p]&&(i[p].terminate&&i[p].terminate(),i[p]=null)}catch(m){a("["+t+"] worker termination failed",m)}}function d(p,m=1e4){return new Promise((f,w)=>{const y=r++%i.length,_=b=>{const A=(y+b)%i.length,S=s(A);if(!S)return b+1<i.length?_(b+1):w(new Error("worker pool unavailable"));const E=String(Math.random()),I=Object.assign({},p,{id:E});let O=null;const W=()=>{O&&clearTimeout(O),S.removeEventListener("message",z),S.removeEventListener("error",B)},z=Z=>{const ee=Z.data||{};ee.id===E&&(W(),ee.error?w(new Error(ee.error)):f(ee.result))},B=Z=>{W(),a("["+t+"] worker error event",Z);try{i[A]===S&&(i[A]=null,S.terminate&&S.terminate())}catch(ee){a("["+t+"] worker termination failed",ee)}w(new Error(Z&&Z.message||"worker error"))};O=setTimeout(()=>{W(),a("["+t+"] worker timed out");try{i[A]===S&&(i[A]=null,S.terminate&&S.terminate())}catch(Z){a("["+t+"] worker termination on timeout failed",Z)}w(new Error("worker timeout"))},m),S.addEventListener("message",z),S.addEventListener("error",B);try{u(A),S.postMessage(I)}catch(Z){W(),w(Z)}};_(0)})}return{get:g,send:d,terminate:h}}function oo(e,t,n="worker"){return so(()=>{try{const a=Gt(e);if(a)try{if(!(typeof process<"u"&&process.env&&process.env.VITEST))return a}catch{return a}}catch{}if(typeof t!="function")return null;const r={message:[],error:[]};return{addEventListener(a,s){r[a]||(r[a]=[]),r[a].push(s)},removeEventListener(a,s){if(!r[a])return;const o=r[a].indexOf(s);o!==-1&&r[a].splice(o,1)},postMessage(a){setTimeout(async()=>{try{const o={data:await t(a)};(r.message||[]).forEach(l=>l(o))}catch(s){const o={data:{id:a&&a.id,error:String(s)}};(r.message||[]).forEach(l=>l(o))}},0)},terminate(){Object.keys(r).forEach(a=>r[a].length=0)}}},n)}function Gt(e){try{if(typeof Blob<"u"&&typeof URL<"u"&&e)try{Gt._blobUrlCache||(Gt._blobUrlCache=new pr({maxSize:200,onEvict:(i,r)=>{try{typeof URL<"u"&&r&&URL.revokeObjectURL(r)}catch{}}}));const t=Gt._blobUrlCache;let n=t.get(e);if(!n){const i=new Blob([e],{type:"application/javascript"});n=URL.createObjectURL(i),t.set(e,n)}return new Worker(n,{type:"module"})}catch(t){try{k("[worker-manager] createWorkerFromRaw failed",t)}catch{}}}catch(t){try{k("[worker-manager] createWorkerFromRaw failed",t)}catch{}}return null}function lo(){return typeof requestIdleCallback=="function"?new Promise(e=>{try{requestIdleCallback(e,{timeout:50})}catch{setTimeout(e,0)}}):new Promise(e=>setTimeout(e,0))}async function Pt(e,t=50){try{if(!e||!t)return;e%t===0&&await lo()}catch{}}const it=new Set;function Qt(e){if(co(),it.clear(),Array.isArray(Oe)&&Oe.length)for(const t of Oe)t&&it.add(t);else for(const t of $e)t&&it.add(t);Wi(Y),Wi(G),Qt._refreshed=!0}function Wi(e){if(!(!e||typeof e.values!="function"))for(const t of e.values())t&&it.add(t)}function Zi(e){if(!e||typeof e.set!="function")return;const t=e.set;e.set=function(n,i){return i&&it.add(i),t.call(this,n,i)}}let Gi=!1;function co(){Gi||(Zi(Y),Zi(G),Gi=!0)}const Rr=Object.freeze(Object.defineProperty({__proto__:null,indexSet:it,refreshIndexPaths:Qt},Symbol.toStringTag,{value:"Module"}));function dn(e,t=1e3){const n=new Map;function i(r){const a=r===void 0?"__undefined":String(r);if(n.has(a)){const o=n.get(a);return n.delete(a),n.set(a,o),o}const s=e(r);try{if(n.set(a,s),n.size>t){const o=n.keys().next().value;n.delete(o)}}catch{}return s}return i._cache=n,i._reset=()=>n.clear(),i}function qr(e){return!e||typeof e!="string"?!1:/^(https?:)?\/\//.test(e)||e.startsWith("mailto:")||e.startsWith("tel:")}const J=dn(function(e){return String(e||"").replace(/^[.\/]+/,"")},2e3),cn=dn(function(e){return String(e||"").replace(/\/+$/,"")},2e3),Yt=dn(function(e){return cn(String(e||""))+"/"},2e3);function uo(e){try{if(!e||typeof document>"u"||!document.head||e.startsWith("data:")||document.head.querySelector(`link[rel="preload"][as="image"][href="${e}"]`))return;const n=document.createElement("link");n.rel="preload",n.as="image",n.href=e,document.head.appendChild(n)}catch(t){k("[helpers] preloadImage failed",t)}}function Qn(e,t=0,n=!1){try{if(typeof window>"u"||!e||!e.querySelectorAll)return;const i=Array.from(e.querySelectorAll("img"));if(!i.length)return;const r=e,a=r&&r.getBoundingClientRect?r.getBoundingClientRect():null,s=0,o=typeof window<"u"&&(window.innerHeight||document.documentElement.clientHeight)||0,l=a?Math.max(s,a.top):s,u=(a?Math.min(o,a.bottom):o)+Number(t||0);let g=0;r&&(g=r.clientHeight||(a?a.height:0)),g||(g=o-s);let h=.6;try{const f=r&&window.getComputedStyle?window.getComputedStyle(r):null,w=f&&f.getPropertyValue("--nimbi-image-max-height-ratio"),y=w?parseFloat(w):NaN;!Number.isNaN(y)&&y>0&&y<=1&&(h=y)}catch(f){k("[helpers] read CSS ratio failed",f)}const d=Math.max(200,Math.floor(g*h));let p=!1,m=null;if(i.forEach(f=>{try{const w=f.getAttribute?f.getAttribute("loading"):void 0;w!=="eager"&&f.setAttribute&&f.setAttribute("loading","lazy");const y=f.getBoundingClientRect?f.getBoundingClientRect():null,_=f.src||f.getAttribute&&f.getAttribute("src"),b=y&&y.height>1?y.height:d,A=y?y.top:0,S=A+b;y&&b>0&&A<=u&&S>=l&&(f.setAttribute?(f.setAttribute("loading","eager"),f.setAttribute("fetchpriority","high"),f.setAttribute("data-eager-by-nimbi","1")):(f.loading="eager",f.fetchPriority="high"),uo(_),p=!0),!m&&y&&y.top<=u&&(m={img:f,src:_,rect:y,beforeLoading:w})}catch(w){k("[helpers] setEagerForAboveFoldImages per-image failed",w)}}),!p&&m){const{img:f,src:w,rect:y,beforeLoading:_}=m;try{f.setAttribute?(f.setAttribute("loading","eager"),f.setAttribute("fetchpriority","high"),f.setAttribute("data-eager-by-nimbi","1")):(f.loading="eager",f.fetchPriority="high")}catch(b){k("[helpers] setEagerForAboveFoldImages fallback failed",b)}}}catch(i){k("[helpers] setEagerForAboveFoldImages failed",i)}}function Pe(e,t=null,n){try{const i=typeof n=="string"?n:typeof window<"u"&&window.location?window.location.search:"",r=new URLSearchParams(i.startsWith("?")?i.slice(1):i),a=String(e||"");r.delete("page");const s=new URLSearchParams;s.set("page",a);for(const[c,u]of r.entries())s.append(c,u);const o=s.toString();let l=o?`?${o}`:"";return t&&(l+=`#${encodeURIComponent(t)}`),l||`?page=${encodeURIComponent(a)}`}catch{const r=`?page=${encodeURIComponent(String(e||""))}`;return t?`${r}#${encodeURIComponent(t)}`:r}}dn(function(e){try{const t=String(e||"");return t.includes("%")?t:encodeURI(t)}catch(t){return k("[helpers] encodeURL failed",t),String(e||"")}},2e3);function lr(e){try{const t=e();return t&&typeof t.then=="function"?t.catch(n=>{k("[helpers] safe swallowed error",n)}):t}catch(t){k("[helpers] safe swallowed error",t)}}try{typeof globalThis<"u"&&!globalThis.safe&&(globalThis.safe=lr)}catch(e){k("[helpers] global attach failed",e)}const ho=dn(function(e){try{if(!e&&e!==0)return"";const t=String(e),n={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};return t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(i,r)=>{if(!r)return i;if(r[0]==="#")try{return r[1]==="x"||r[1]==="X"?String.fromCharCode(parseInt(r.slice(2),16)):String.fromCharCode(parseInt(r.slice(1),10))}catch{return i}return n[r]!==void 0?n[r]:i})}catch{return String(e||"")}},2e3),Y=new Map,cr=new Map;function Jn(e){try{if(!e)return;let t=Ot,n="";if(e.type==="cosmetic"){const r=e.page!=null&&String(e.page).trim()!=="";t=r?String(e.page):Ot,n="#/"+(r?String(e.page):""),e.anchor&&(n+="#"+String(e.anchor)),e.params&&(n+="?"+String(e.params))}else if(e.type==="path"){const r=e.page!=null&&String(e.page).trim()!=="";t=r?String(e.page):Ot,n="/"+(r?String(e.page):""),e.anchor&&(n+="#"+String(e.anchor)),e.params&&(n+="?"+String(e.params))}else if(e.type==="canonical")if(e.page)t=e.page,n="?page="+encodeURIComponent(e.page),e.anchor&&(n+="#"+String(e.anchor)),e.params&&(n+="?"+String(e.params));else{t=Ot;try{n=typeof location<"u"&&location&&location.pathname?String(location.pathname):"/",typeof location<"u"&&location.search&&(n+=String(location.search)),typeof location<"u"&&location.hash&&(n+=String(location.hash))}catch{n="/"}}else return;const i=cr.get(t)||[];i.push(n),cr.set(t,i)}catch{}}function va(e,t){try{const n=String(e||""),i=cr.get(n);if(!i||!i.length)return;try{const r=typeof globalThis<"u"?globalThis:null;if(r){try{r.__nimbiColdRouteResolved||(r.__nimbiColdRouteResolved=[])}catch{}for(const a of i)try{const s={slug:n,token:a,rel:String(t||"")};try{r.__nimbiColdRouteResolved.push(s)}catch{}try{r&&typeof r.dispatchEvent=="function"&&r.dispatchEvent(new CustomEvent("nimbi.coldRouteResolved",{detail:s}))}catch{}try{r&&r.__nimbiUI&&typeof r.__nimbiUI.renderByQuery=="function"&&r.__nimbiUI.renderByQuery().catch(()=>{})}catch{}}catch{}}}catch{}cr.delete(n)}catch{}}try{const e=Y.set;Y.set=function(t,n){const i=Map.prototype.has.call(this,t),r=Map.prototype.set.call(this,t,n);try{i||va(t,n)}catch{}return r}}catch{}let st=[],ui=!1;function fo(e){ui=!!e}function Aa(e){st=Array.isArray(e)?e.slice():[]}function go(){return st}const mr=typeof navigator<"u"&&navigator.hardwareConcurrency?Math.max(1,Math.floor(navigator.hardwareConcurrency/2)):2,Ea=Sa(()=>Gt(ao),"slugManager",mr);function po(){try{if(ii())return!0}catch{}try{return!!(typeof le=="string"&&le)}catch{return!1}}function ge(...e){try{jt(...e)}catch{}}function mo(){return Ea.get()}function Ca(e){return Ea.send(e,5e3)}async function Hr(e,t=1,n=void 0){const i=await Promise.resolve().then(()=>at);if(!(i.initSlugWorker&&i.initSlugWorker()))throw new Error("slug worker required but unavailable");return await Ca({type:"buildSearchIndex",contentBase:e,indexDepth:t,noIndexing:n})}async function yo(e,t,n){const i=await Promise.resolve().then(()=>at);if(!(i.initSlugWorker&&i.initSlugWorker()))throw new Error("slug worker required but unavailable");return Ca({type:"crawlForSlug",slug:e,base:t,maxQueue:n})}function rt(e,t){if(!e)return;let n=null;try{n=J(typeof t=="string"?t:String(t||""))}catch{n=String(t||"")}if(n){try{if(st&&st.length){const r=String(n).split("/")[0],a=st.includes(r);let s=Y.get(e);if(!s||typeof s=="string")s={default:typeof s=="string"?J(s):void 0,langs:{}};else try{s.default&&(s.default=J(s.default))}catch{}a?s.langs[r]=n:s.default=n,Y.set(e,s)}else{const i=Y.has(e)?Y.get(e):void 0;if(!i)Y.set(e,n);else{let r=null;try{typeof i=="string"?r=J(i):i&&typeof i=="object"&&(r=i.default?J(i.default):null)}catch{r=null}if(r===n)Y.set(e,n);else{let a=null,s=2;for(;a=`${e}-${s}`,!!Y.has(a);){let o=Y.get(a),l=null;try{typeof o=="string"?l=J(o):o&&typeof o=="object"&&(l=o.default?J(o.default):null)}catch{l=null}if(l===n){e=a;break}if(s+=1,s>1e4)break}try{if(!Y.has(a))Y.set(a,n),e=a;else if(Y.get(a)===n)e=a;else{const o=new Set;for(const c of Y.keys())o.add(c);const l=typeof Xt=="function"?Xt(e,o):`${e}-2`;Y.set(l,n),e=l}}catch{}}}}}catch{}try{if(n){try{G.set(n,e)}catch{}try{if($e&&typeof $e.has=="function"){if(!$e.has(n)){try{$e.add(n)}catch{}try{Array.isArray(Oe)&&!Oe.includes(n)&&Oe.push(n)}catch{}}}else try{Array.isArray(Oe)&&!Oe.includes(n)&&Oe.push(n)}catch{}}catch{}}}catch{}}}const yr=new Set;function bo(e){typeof e=="function"&&yr.add(e)}function wo(e){typeof e=="function"&&yr.delete(e)}const G=new Map;let Fr={},Oe=[];const $e=new Set;let le="_404.md",ot=null;const Ot="_home";function Ma(e){if(e==null){le=null;return}le=String(e||"")}function La(e){if(e==null){ot=null;return}ot=String(e||"");try{try{va(Ot,ot)}catch{}}catch{}}function _o(e){Fr=e||{}}function Ta(e){try{if(Array.isArray(re)||(re=[]),!Array.isArray(e))return;try{Array.isArray(re)||(re=[]),re.length=0;for(const t of e)re.push(t);try{if(typeof window<"u")try{window.__nimbiLiveSearchIndex=re}catch{}}catch{}}catch(t){ge("[slugManager] replacing searchIndex by assignment fallback",t);try{re=Array.from(e)}catch{}}}catch{}}const xn=new Map,ur=new Set;function ko(){xn.clear(),ur.clear()}function xo(e){if(!e||e.length===0)return"";let t=e[0];for(let i=1;i<e.length;i++){const r=e[i];let a=0;const s=Math.min(t.length,r.length);for(;a<s&&t[a]===r[a];)a++;t=t.slice(0,a)}const n=t.lastIndexOf("/");return n===-1?t:t.slice(0,n+1)}const de=dn(function(e){let n=String(e||"").toLowerCase().replace(/[^a-z0-9\- ]/g,"").replace(/ /g,"-");return n=n.replace(/(?:-?)(?:md|html)$/,""),n=n.replace(/-+/g,"-"),n=n.replace(/^-|-$/g,""),n.length>80&&(n=n.slice(0,80).replace(/-+$/g,"")),n},2e3);function hi(e){Y.clear(),G.clear(),Oe=[];try{$e.clear()}catch{}st=st||[];const t=Object.keys(Fr||{});if(!t.length)return;let n="";try{if(e){try{/^[a-z][a-z0-9+.-]*:/i.test(String(e))?n=new URL(String(e)).pathname:n=String(e||"")}catch(i){n=String(e||""),ge("[slugManager] parse contentBase failed",i)}n=Yt(n)}}catch(i){n="",ge("[slugManager] setContentBase prefix derivation failed",i)}n||(n=xo(t));for(const i of t){let r=i;n&&i.startsWith(n)?r=J(i.slice(n.length)):r=J(i),Oe.push(r);try{$e.add(r)}catch{}try{Qt()}catch(s){ge("[slugManager] refreshIndexPaths failed",s)}const a=Fr[i];if(typeof a=="string"){const s=(a||"").match(/^#\s+(.+)$/m);if(s&&s[1]){const o=de(s[1].trim());if(o)try{let l=o;if((!st||!st.length)&&(l=Xt(l,new Set(Y.keys()))),st&&st.length){const u=r.split("/")[0],g=st.includes(u);let h=Y.get(l);(!h||typeof h=="string")&&(h={default:typeof h=="string"?h:void 0,langs:{}}),g?h.langs[u]=r:h.default=r,Y.set(l,h)}else Y.set(l,r);G.set(r,l)}catch(l){ge("[slugManager] set slug mapping failed",l)}}}}}try{hi()}catch(e){ge("[slugManager] initial setContentBase failed",e)}function Xt(e,t){if(!t.has(e))return e;let n=2,i=`${e}-${n}`;for(;t.has(i);)n+=1,i=`${e}-${n}`;return i}function So(e){return Bn(e,void 0)}function Bn(e,t){if(!e)return!1;if(e.startsWith("//"))return!0;if(/^[a-z][a-z0-9+.-]*:/i.test(e)){if(t&&typeof t=="string")try{const n=new URL(e),i=new URL(t);return n.origin!==i.origin?!0:!n.pathname.startsWith(i.pathname)}catch{return!0}return!0}if(e.startsWith("/")&&t&&typeof t=="string")try{const n=new URL(e,t),i=new URL(t);return n.origin!==i.origin?!0:!n.pathname.startsWith(i.pathname)}catch{return!0}return!1}function er(e){return e==null?e:String(e).replace(/\\([\\`*_{}\[\]()#+\-.!])/g,(t,n)=>n)}function un(e){if(!e||!Y.has(e))return null;const t=Y.get(e);if(!t)return null;if(typeof t=="string")return t;if(st&&st.length&&qt&&t.langs&&t.langs[qt])return t.langs[qt];if(t.default)return t.default;if(t.langs){const n=Object.keys(t.langs);if(n.length)return t.langs[n[0]]}return null}const gt=new pr({maxSize:2e3});function vo(){gt.clear(),Ht.clear()}const Ht=new pr({maxSize:2e3});let za=60*1e3;function Ao(e){za=Number(e)||0}function Eo(e){try{const t=Math.max(0,Number(e)||0);gt&&typeof gt._maxSize<"u"&&(gt._maxSize=t)}catch{}}function Co(e){try{const t=Math.max(0,Number(e)||0);gt&&typeof gt._ttlMs<"u"&&(gt._ttlMs=t)}catch{}}function Mo(e){try{const t=Math.max(0,Number(e)||0);Ht&&typeof Ht._maxSize<"u"&&(Ht._maxSize=t)}catch{}}let Dr=Math.max(1,Math.min(mr,5));function Lo(e){try{Dr=Math.max(1,Number(e)||1)}catch{Dr=1}}function Sn(){return Dr}let Be=async function(e,t,n){if(!e)throw new Error("path required");try{if(typeof e=="string"&&(e.indexOf("?page=")!==-1||e.startsWith("?")||e.startsWith("#/")||e.indexOf("#/")!==-1))try{const c=Je(e);c&&c.page&&(e=c.page)}catch{}}catch{}try{const c=(String(e||"").match(/([^\/]+)\.md(?:$|[?#])/)||[])[1],u=typeof e=="string"&&String(e).indexOf("/")===-1;if(c&&(u||!1)&&Y.has(c)){const h=un(c)||Y.get(c);h&&h!==e&&(e=h)}}catch(c){ge("[slugManager] slug mapping normalization failed",c)}try{if(typeof e=="string"&&e.indexOf("::")!==-1){const c=String(e).split("::",1)[0];if(c)try{if(Y.has(c)){const u=un(c)||Y.get(c);u?e=u:e=c}else e=c}catch{e=c}}}catch(c){ge("[slugManager] path sanitize failed",c)}try{if(t)try{let u=(/^[a-z][a-z0-9+.-]*:/i.test(String(t))?new URL(String(t)):new URL(String(t),typeof location<"u"?location.origin:"http://localhost")).pathname||"";if(u=u.replace(/^\/+|\/+$/g,""),u)try{const g=String(e||"");if(!/^[a-z][a-z0-9+.-]*:/i.test(g)){let h=g.replace(/^\/+/,"");h===u?e="":h.startsWith(u+"/")?e=h.slice(u.length+1):e=h}}catch{}}catch{}}catch{}if(!(n&&n.force===!0||typeof le=="string"&&le||Y&&Y.size||$e&&$e.size||ii()))throw new Error("failed to fetch md");const r=t==null?"":cn(String(t));let a="";try{const c=typeof location<"u"&&location.origin?location.origin:"http://localhost";let u=c.replace(/\/$/,"")+"/";r&&(/^[a-z][a-z0-9+.-]*:/i.test(r)?u=r.replace(/\/$/,"")+"/":r.startsWith("/")?u=c.replace(/\/$/,"")+r.replace(/\/$/,"")+"/":u=c.replace(/\/$/,"")+"/"+r.replace(/\/$/,"")+"/");try{a=new URL(e.replace(/^\//,""),u).toString()}catch{a=c.replace(/\/$/,"")+"/"+e.replace(/^\//,"")}}catch{a=(typeof location<"u"&&location.origin?location.origin:"http://localhost")+"/"+e.replace(/^\//,"")}const s=n&&n.signal;try{const c=Ht.get(a);if(c&&c>Date.now())return Promise.reject(new Error("failed to fetch md"));c&&Ht.delete(a)}catch{}if(gt.has(a))return gt.get(a);const l=(async()=>{const c=await fetch(a,s?{signal:s}:void 0);if(!c||typeof c.ok!="boolean"||!c.ok){if(c&&c.status===404&&typeof le=="string"&&le)try{const m=`${r}/${le}`,f=await globalThis.fetch(m,s?{signal:s}:void 0);if(f&&typeof f.ok=="boolean"&&f.ok)return{raw:await f.text(),status:404}}catch(m){ge("[slugManager] fetching fallback 404 failed",m)}let p="";try{c&&typeof c.clone=="function"?p=await c.clone().text():c&&typeof c.text=="function"?p=await c.text():p=""}catch(m){p="",ge("[slugManager] reading error body failed",m)}try{const m=c?c.status:void 0;if(m===404)try{k("fetchMarkdown failed (404):",()=>({url:a,status:m,statusText:c?c.statusText:void 0,body:p.slice(0,200)}))}catch{}else try{sr("fetchMarkdown failed:",()=>({url:a,status:m,statusText:c?c.statusText:void 0,body:p.slice(0,200)}))}catch{}}catch{}throw new Error("failed to fetch md")}const u=await c.text(),g=u.trim().slice(0,128).toLowerCase(),h=/^(?:<!doctype|<html|<title|<h1)/.test(g),d=h||String(e||"").toLowerCase().endsWith(".html");if(h&&String(e||"").toLowerCase().endsWith(".md")){try{if(typeof le=="string"&&le){const p=`${r}/${le}`,m=await globalThis.fetch(p,s?{signal:s}:void 0);if(m.ok)return{raw:await m.text(),status:404}}}catch(p){ge("[slugManager] fetching fallback 404 failed",p)}throw po()&&sr("fetchMarkdown: server returned HTML for .md request",a),new Error("failed to fetch md")}return d?{raw:u,isHtml:!0}:{raw:u}})().catch(c=>{if(c&&c.name==="AbortError"){try{gt.delete(a)}catch{}throw c}try{Ht.set(a,Date.now()+za)}catch{}try{gt.delete(a)}catch{}throw c});return gt.set(a,l),l};function To(e){typeof e=="function"&&(Be=e)}const tr=new Map;function zo(e){if(!e||typeof e!="string")return"";let t=e.replace(/```[\s\S]*?```/g,"");return t=t.replace(/<pre[\s\S]*?<\/pre>/gi,""),t=t.replace(/<code[\s\S]*?<\/code>/gi,""),t=t.replace(/<!--([\s\S]*?)-->/g,""),t=t.replace(/^ {4,}.*$/gm,""),t=t.replace(/`[^`]*`/g,""),t}let re=[];function Ro(){return re}try{if(typeof window<"u")try{Object.defineProperty(window,"__nimbiSearchIndex",{get(){return re},enumerable:!0,configurable:!0})}catch{try{window.__nimbiSearchIndex=re}catch{}}}catch{}try{if(typeof window<"u")try{Object.defineProperty(window,"__nimbiIndexReady",{get(){return Ur},enumerable:!0,configurable:!0})}catch{try{window.__nimbiIndexReady=Ur}catch{}}}catch{}let It=null;async function Zt(e,t=1,n=void 0,i=void 0){const r=Array.isArray(n)?Array.from(new Set((n||[]).map(a=>J(String(a||""))))):[];try{const a=J(String(le||""));a&&!r.includes(a)&&r.push(a)}catch{}if(re&&re.length&&t===1&&!re.some(s=>{try{return r.includes(J(String(s.path||"")))}catch{return!1}}))return re;if(It)return It;It=(async()=>{let a=Array.isArray(n)?Array.from(new Set((n||[]).map(f=>J(String(f||""))))):[];try{const f=J(String(le||""));f&&!a.includes(f)&&a.push(f)}catch{}const s=f=>{if(!a||!a.length)return!1;for(const w of a)if(w&&(f===w||f.startsWith(w+"/")))return!0;return!1};let o=[];try{if(Array.isArray(i)&&i.length)for(const f of i)try{const w=J(String(f||""));w&&o.push(w)}catch{}}catch{}if(Array.isArray(Oe)&&Oe.length&&(o=Array.from(Oe)),!o.length){if(G&&typeof G.size=="number"&&G.size)try{o=Array.from(G.keys())}catch{o=[]}else for(const f of Y.values())if(f){if(typeof f=="string")o.push(f);else if(f&&typeof f=="object"){f.default&&o.push(f.default);const w=f.langs||{};for(const y of Object.keys(w||{}))try{w[y]&&o.push(w[y])}catch{}}}}try{const f=await Na(e);f&&f.length&&(o=o.concat(f))}catch(f){ge("[slugManager] crawlAllMarkdown during buildSearchIndex failed",f)}try{const f=new Set(o),w=[...o],y=Math.max(1,Math.min(Sn(),w.length||Sn()));let _=0;const b=async()=>{for(;!(f.size>jn);){const S=w.shift();if(!S)break;try{const E=await Be(S,e);if(E&&E.raw){if(E.status===404)continue;let I=E.raw;const O=[],W=String(S||"").replace(/^.*\//,"");if(/^readme(?:\.md)?$/i.test(W)&&ui&&(!S||!S.includes("/")))continue;const z=zo(I),B=/\[[^\]]+\]\(([^)]+)\)/g;let Z;for(;Z=B.exec(z);)O.push(Z[1]);const ee=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/gi;for(;Z=ee.exec(z);)O.push(Z[1]);const j=S&&S.includes("/")?S.substring(0,S.lastIndexOf("/")+1):"";for(let C of O)try{if(Bn(C,e)||C.startsWith("..")||C.indexOf("/../")!==-1||(j&&!C.startsWith("./")&&!C.startsWith("/")&&!C.startsWith("../")&&(C=j+C),C=J(C),!/\.(md|html?)(?:$|[?#])/i.test(C))||(C=C.split(/[?#]/)[0],s(C)))continue;f.has(C)||(f.add(C),w.push(C),o.push(C))}catch(N){ge("[slugManager] href processing failed",C,N)}}}catch(E){ge("[slugManager] discovery fetch failed for",S,E)}try{_++,await Pt(_,32)}catch{}}},A=[];for(let S=0;S<y;S++)A.push(b());await Promise.all(A)}catch(f){ge("[slugManager] discovery loop failed",f)}const l=new Set;o=o.filter(f=>!f||l.has(f)||s(f)?!1:(l.add(f),!0));const c=[],u=new Map,g=o.filter(f=>/\.(?:md|html?)(?:$|[?#])/i.test(f)),h=Math.max(1,Math.min(Sn(),g.length||1)),d=g.slice(),p=[];for(let f=0;f<h;f++)p.push((async()=>{for(;d.length;){const w=d.shift();if(!w)break;try{const y=await Be(w,e);u.set(w,y)}catch(y){ge("[slugManager] buildSearchIndex: entry fetch failed",w,y),u.set(w,null)}}})());await Promise.all(p);let m=0;for(const f of o){try{m++,await Pt(m,16)}catch{}if(/\.(?:md|html?)(?:$|[?#])/i.test(f))try{const w=u.get(f);if(!w||!w.raw||w.status===404)continue;let y="",_="",b=null;if(w.isHtml)try{const S=He(),E=S?S.parseFromString(w.raw,"text/html"):null,I=E?E.querySelector("title")||E.querySelector("h1"):null;I&&I.textContent&&(y=I.textContent.trim());const O=E?E.querySelector("p"):null;if(O&&O.textContent&&(_=O.textContent.trim()),t>=2)try{const W=E?E.querySelector("h1"):null,z=W&&W.textContent?W.textContent.trim():y||"";try{const Z=G&&typeof G.has=="function"&&G.has(f)?G.get(f):null;if(Z)b=Z;else{let ee=de(y||f);const j=new Set;try{for(const N of Y.keys())j.add(N)}catch{}try{for(const N of c)N&&N.slug&&j.add(String(N.slug).split("::")[0])}catch{}let C=!1;try{if(Y.has(ee)){const N=Y.get(ee);if(typeof N=="string")N===f&&(C=!0);else if(N&&typeof N=="object"){N.default===f&&(C=!0);for(const D of Object.keys(N.langs||{}))if(N.langs[D]===f){C=!0;break}}}}catch{}!C&&j.has(ee)&&(ee=Xt(ee,j)),b=ee;try{G.has(f)||rt(b,f)}catch{}}}catch(Z){ge("[slugManager] derive pageSlug failed",Z)}const B=Array.from(E.querySelectorAll("h2"));for(const Z of B)try{const ee=(Z.textContent||"").trim();if(!ee)continue;const j=Z.id?Z.id:de(ee),C=b?`${b}::${j}`:`${de(f)}::${j}`;let N="",D=Z.nextElementSibling;for(;D&&D.tagName&&D.tagName.toLowerCase()==="script";)D=D.nextElementSibling;D&&D.textContent&&(N=String(D.textContent).trim()),c.push({slug:C,title:ee,excerpt:N,path:f,parentTitle:z})}catch(ee){ge("[slugManager] indexing H2 failed",ee)}if(t===3)try{const Z=Array.from(E.querySelectorAll("h3"));for(const ee of Z)try{const j=(ee.textContent||"").trim();if(!j)continue;const C=ee.id?ee.id:de(j),N=b?`${b}::${C}`:`${de(f)}::${C}`;let D="",ie=ee.nextElementSibling;for(;ie&&ie.tagName&&ie.tagName.toLowerCase()==="script";)ie=ie.nextElementSibling;ie&&ie.textContent&&(D=String(ie.textContent).trim()),c.push({slug:N,title:j,excerpt:D,path:f,parentTitle:z})}catch(j){ge("[slugManager] indexing H3 failed",j)}}catch(Z){ge("[slugManager] collect H3s failed",Z)}}catch(W){ge("[slugManager] collect H2s failed",W)}}catch(S){ge("[slugManager] parsing HTML for index failed",S)}else{const S=w.raw,E=S.match(/^#\s+(.+)$/m);y=E?E[1].trim():"";try{y=er(y)}catch{}const I=S.split(/\r?\n\s*\r?\n/);if(I.length>1)for(let O=1;O<I.length;O++){const W=I[O].trim();if(W&&!/^#/.test(W)){_=W.replace(/\r?\n/g," ");break}}if(t>=2){let O="";try{const W=(S.match(/^#\s+(.+)$/m)||[])[1];O=W?W.trim():"";try{const Z=G&&typeof G.has=="function"&&G.has(f)?G.get(f):null;if(Z)b=Z;else{let ee=de(y||f);const j=new Set;try{for(const N of Y.keys())j.add(N)}catch{}try{for(const N of c)N&&N.slug&&j.add(String(N.slug).split("::")[0])}catch{}let C=!1;try{if(Y.has(ee)){const N=Y.get(ee);if(typeof N=="string")N===f&&(C=!0);else if(N&&typeof N=="object"){N.default===f&&(C=!0);for(const D of Object.keys(N.langs||{}))if(N.langs[D]===f){C=!0;break}}}}catch{}!C&&j.has(ee)&&(ee=Xt(ee,j)),b=ee;try{G.has(f)||rt(b,f)}catch{}}}catch(Z){ge("[slugManager] derive pageSlug failed",Z)}const z=/^##\s+(.+)$/gm;let B;for(;B=z.exec(S);)try{const Z=(B[1]||"").trim(),ee=er(Z);if(!Z)continue;const j=de(Z),C=b?`${b}::${j}`:`${de(f)}::${j}`,D=S.slice(z.lastIndex).match(/^(?:\r?\n)*([^\r\n][^\r\n]*(?:\r?\n[^\r\n].*)*)/),ie=D&&D[1]?String(D[1]).trim().split(/\r?\n/).join(" ").slice(0,300):"";c.push({slug:C,title:ee,excerpt:ie,path:f,parentTitle:O})}catch(Z){ge("[slugManager] indexing markdown H2 failed",Z)}}catch(W){ge("[slugManager] collect markdown H2s failed",W)}if(t===3)try{const W=/^###\s+(.+)$/gm;let z;for(;z=W.exec(S);)try{const B=(z[1]||"").trim(),Z=er(B);if(!B)continue;const ee=de(B),j=b?`${b}::${ee}`:`${de(f)}::${ee}`,N=S.slice(W.lastIndex).match(/^(?:\r?\n)*([^\r\n][^\r\n]*(?:\r?\n[^\r\n].*)*)/),D=N&&N[1]?String(N[1]).trim().split(/\r?\n/).join(" ").slice(0,300):"";c.push({slug:j,title:Z,excerpt:D,path:f,parentTitle:O})}catch(B){ge("[slugManager] indexing markdown H3 failed",B)}}catch(W){ge("[slugManager] collect markdown H3s failed",W)}}}let A="";try{G.has(f)&&(A=G.get(f))}catch(S){ge("[slugManager] mdToSlug access failed",S)}if(!A){try{if(!b){const S=G&&typeof G.has=="function"&&G.has(f)?G.get(f):null;if(S)b=S;else{let E=de(y||f);const I=new Set;try{for(const W of Y.keys())I.add(W)}catch{}try{for(const W of c)W&&W.slug&&I.add(String(W.slug).split("::")[0])}catch{}let O=!1;try{if(Y.has(E)){const W=Y.get(E);if(typeof W=="string")W===f&&(O=!0);else if(W&&typeof W=="object"){W.default===f&&(O=!0);for(const z of Object.keys(W.langs||{}))if(W.langs[z]===f){O=!0;break}}}}catch{}!O&&I.has(E)&&(E=Xt(E,I)),b=E;try{G.has(f)||rt(b,f)}catch{}}}}catch(S){ge("[slugManager] derive pageSlug failed",S)}A=b||de(y||f)}c.push({slug:A,title:y,excerpt:_,path:f})}catch(w){ge("[slugManager] buildSearchIndex: entry processing failed",w)}}try{const f=c.filter(w=>{try{return!s(String(w.path||""))}catch{return!0}});try{Array.isArray(re)||(re=[]),re.length=0;for(const w of f)re.push(w)}catch{try{re=Array.from(f)}catch{re=f}}try{if(typeof window<"u"){try{window.__nimbiResolvedIndex=re}catch{}try{const w=[],y=new Set;for(const _ of re)try{if(!_||!_.slug)continue;const b=String(_.slug).split("::")[0];if(y.has(b))continue;y.add(b);const A={slug:b};_.title?A.title=String(_.title):_.parentTitle&&(A.title=String(_.parentTitle)),_.path&&(A.path=String(_.path)),w.push(A)}catch{}try{window.__nimbiSitemapJson={generatedAt:new Date().toISOString(),entries:w}}catch{}try{window.__nimbiSitemapFinal=w}catch{}}catch{}}}catch{}}catch(f){ge("[slugManager] filtering index by excludes failed",f);try{Array.isArray(re)||(re=[]),re.length=0;for(const w of c)re.push(w)}catch{try{re=Array.from(c)}catch{re=c}}try{if(typeof window<"u")try{window.__nimbiResolvedIndex=re}catch{}}catch{}}return re})();try{await It}catch(a){ge("[slugManager] awaiting _indexPromise failed",a)}return It=null,re}async function Bt(e={}){try{const t=typeof e.timeoutMs=="number"?e.timeoutMs:8e3,n=e.contentBase,i=typeof e.indexDepth=="number"?e.indexDepth:1,r=Array.isArray(e.noIndexing)?e.noIndexing:void 0,a=Array.isArray(e.seedPaths)?e.seedPaths:void 0,s=typeof e.startBuild=="boolean"?e.startBuild:!0;if(Array.isArray(re)&&re.length&&!It&&!s)return re;if(It){try{await It}catch{}return re}if(s){try{if(typeof Hr=="function")try{const l=await Hr(n,i,r,a);if(Array.isArray(l)&&l.length){try{Ta(l)}catch{}return re}}catch{}}catch{}try{return await Zt(n,i,r,a),re}catch{}}const o=Date.now();for(;Date.now()-o<t;){if(Array.isArray(re)&&re.length)return re;await new Promise(l=>setTimeout(l,150))}return re}catch{return re}}async function Ur(e={}){try{const t=Object.assign({},e);typeof t.startBuild!="boolean"&&(t.startBuild=!0),typeof t.timeoutMs!="number"&&(t.timeoutMs=1/0);try{return await Bt(t)}catch{return re}}catch{return re}}const Ra=1e3;let jn=Ra;function $o(e){typeof e=="number"&&e>=0&&(jn=e)}const $a=He(),Pa="a[href]";let Ia=async function(e,t,n=jn){if(tr.has(e))return tr.get(e);let i=null;const r=new Set,a=[""],s=typeof location<"u"&&location.origin?location.origin:"http://localhost";let o=s+"/";try{t&&(/^[a-z][a-z0-9+.-]*:/i.test(String(t))?o=String(t).replace(/\/$/,"")+"/":String(t).startsWith("/")?o=s+String(t).replace(/\/$/,"")+"/":o=s+"/"+String(t).replace(/\/$/,"")+"/")}catch{o=s+"/"}const l=Math.max(1,Math.min(mr,6));for(;a.length&&!i&&!(a.length>n);){const c=a.splice(0,l);await Rn(c,async u=>{if(u==null||r.has(u))return;r.add(u);let g="";try{g=new URL(u||"",o).toString()}catch{g=(String(t||"")||s)+"/"+String(u||"").replace(/^\//,"")}try{let h;try{h=await globalThis.fetch(g)}catch(w){ge("[slugManager] crawlForSlug: fetch failed",{url:g,error:w});return}if(!h||!h.ok){h&&!h.ok&&ge("[slugManager] crawlForSlug: directory fetch non-ok",{url:g,status:h.status});return}const d=await h.text(),p=$a.parseFromString(d,"text/html");let m=[];try{p&&typeof p.getElementsByTagName=="function"?m=p.getElementsByTagName("a"):p&&typeof p.querySelectorAll=="function"?m=p.querySelectorAll(Pa):m=[]}catch{try{m=p.getElementsByTagName?p.getElementsByTagName("a"):[]}catch{m=[]}}const f=g;for(const w of m)try{if(i)break;let y=w.getAttribute("href")||"";if(!y||Bn(y,t)||y.startsWith("..")||y.indexOf("/../")!==-1)continue;if(y.endsWith("/")){try{const _=new URL(y,f),b=new URL(o).pathname,A=_.pathname.startsWith(b)?_.pathname.slice(b.length):_.pathname.replace(/^\//,""),S=Yt(J(A));r.has(S)||a.push(S)}catch{const b=J(u+y);r.has(b)||a.push(b)}continue}if(y.toLowerCase().endsWith(".md")){let _="";try{const b=new URL(y,f),A=new URL(o).pathname;_=b.pathname.startsWith(A)?b.pathname.slice(A.length):b.pathname.replace(/^\//,"")}catch{_=(u+y).replace(/^\//,"")}_=J(_);try{if(G.has(_))continue;for(const b of Y.values());}catch(b){ge("[slugManager] slug map access failed",b)}try{const b=await Be(_,t);if(b&&b.raw){const A=(b.raw||"").match(/^#\s+(.+)$/m);if(A&&A[1]&&de(A[1].trim())===e){i=_;break}}}catch(b){ge("[slugManager] crawlForSlug: fetchMarkdown failed",b)}}}catch(y){ge("[slugManager] crawlForSlug: link iteration failed",y)}}catch(h){ge("[slugManager] crawlForSlug: directory fetch failed",h)}},l)}return tr.set(e,i),i};async function Na(e,t=jn){const n=new Set,i=new Set,r=[""],a=typeof location<"u"&&location.origin?location.origin:"http://localhost";let s=a+"/";try{e&&(/^[a-z][a-z0-9+.-]*:/i.test(String(e))?s=String(e).replace(/\/$/,"")+"/":String(e).startsWith("/")?s=a+String(e).replace(/\/$/,"")+"/":s=a+"/"+String(e).replace(/\/$/,"")+"/")}catch{s=a+"/"}const o=Math.max(1,Math.min(mr,6));for(;r.length&&!(r.length>t);){const l=r.splice(0,o);await Rn(l,async c=>{if(c==null||i.has(c))return;i.add(c);let u="";try{u=new URL(c||"",s).toString()}catch{u=(String(e||"")||a)+"/"+String(c||"").replace(/^\//,"")}try{let g;try{g=await globalThis.fetch(u)}catch(f){ge("[slugManager] crawlAllMarkdown: fetch failed",{url:u,error:f});return}if(!g||!g.ok){g&&!g.ok&&ge("[slugManager] crawlAllMarkdown: directory fetch non-ok",{url:u,status:g.status});return}const h=await g.text(),d=$a.parseFromString(h,"text/html");let p=[];try{d&&typeof d.getElementsByTagName=="function"?p=d.getElementsByTagName("a"):d&&typeof d.querySelectorAll=="function"?p=d.querySelectorAll(Pa):p=[]}catch{try{p=d.getElementsByTagName?d.getElementsByTagName("a"):[]}catch{p=[]}}const m=u;for(const f of p)try{let w=f.getAttribute("href")||"";if(!w||Bn(w,e)||w.startsWith("..")||w.indexOf("/../")!==-1)continue;if(w.endsWith("/")){try{const _=new URL(w,m),b=new URL(s).pathname,A=_.pathname.startsWith(b)?_.pathname.slice(b.length):_.pathname.replace(/^\//,""),S=Yt(J(A));i.has(S)||r.push(S)}catch{const b=c+w;i.has(b)||r.push(b)}continue}let y="";try{const _=new URL(w,m),b=new URL(s).pathname;y=_.pathname.startsWith(b)?_.pathname.slice(b.length):_.pathname.replace(/^\//,"")}catch{y=(c+w).replace(/^\//,"")}y=J(y),/\.(md|html?)$/i.test(y)&&n.add(y)}catch(w){ge("[slugManager] crawlAllMarkdown: link iteration failed",w)}}catch(g){ge("[slugManager] crawlAllMarkdown: directory fetch failed",g)}},o)}return Array.from(n)}async function Oa(e,t,n){if(e&&typeof e=="string"&&(e=J(e),e=cn(e)),Y.has(e))return un(e)||Y.get(e);try{if(!(typeof le=="string"&&le||Y.has(e)||$e&&$e.size||Qt._refreshed||typeof t=="string"&&/^[a-z][a-z0-9+.-]*:\/\//i.test(t)))return null}catch{}for(const r of yr)try{const a=await r(e,t);if(a)return rt(e,a),a}catch(a){ge("[slugManager] slug resolver failed",a)}if($e&&$e.size){if(xn.has(e)){const r=xn.get(e);return rt(e,r),r}for(const r of Oe)if(!ur.has(r))try{const a=await Be(r,t);if(a&&a.raw){const s=(a.raw||"").match(/^#\s+(.+)$/m);if(s&&s[1]){const o=de(s[1].trim());if(ur.add(r),o&&xn.set(o,r),o===e)return rt(e,r),r}}}catch(a){ge("[slugManager] manifest title fetch failed",a)}try{crawlBatchYieldCount++,await Pt(crawlBatchYieldCount,8)}catch{}}try{const r=await Zt(t);if(r&&r.length){const a=r.find(s=>s.slug===e);if(a)return rt(e,a.path),a.path}}catch(r){ge("[slugManager] buildSearchIndex lookup failed",r)}try{const r=await Ia(e,t,n);if(r)return rt(e,r),r}catch(r){ge("[slugManager] crawlForSlug lookup failed",r)}const i=[`${e}.html`,`${e}.md`];for(const r of i)try{const a=await Be(r,t);if(a&&a.raw)return rt(e,r),r}catch(a){ge("[slugManager] candidate fetch failed",a)}if($e&&$e.size)for(const r of Oe)try{const a=r.replace(/^.*\//,"").replace(/\.(md|html?)$/i,"");if(de(a)===e)return rt(e,r),r}catch(a){ge("[slugManager] build-time filename match failed",a)}try{if(ot&&typeof ot=="string"&&ot.trim())try{const r=await Be(ot,t);if(r&&r.raw){const a=(r.raw||"").match(/^#\s+(.+)$/m);if(a&&a[1]&&de(a[1].trim())===e)return rt(e,ot),ot}}catch(r){ge("[slugManager] home page fetch failed",r)}}catch(r){ge("[slugManager] home page fetch failed",r)}return null}const at=Object.freeze(Object.defineProperty({__proto__:null,CRAWL_MAX_QUEUE:Ra,HOME_SLUG:Ot,_setAllMd:_o,_setSearchIndex:Ta,_storeSlugMapping:rt,addSlugResolver:bo,get allMarkdownPaths(){return Oe},allMarkdownPathsSet:$e,get availableLanguages(){return st},awaitSearchIndex:Ur,buildSearchIndex:Zt,buildSearchIndexWorker:Hr,clearFetchCache:vo,clearListCaches:ko,crawlAllMarkdown:Na,crawlCache:tr,crawlForSlug:Ia,crawlForSlugWorker:yo,get defaultCrawlMaxQueue(){return jn},ensureSlug:Oa,fetchCache:gt,get fetchMarkdown(){return Be},getFetchConcurrency:Sn,getLanguages:go,getSearchIndex:Ro,get homePage(){return ot},initSlugWorker:mo,isExternalLink:So,isExternalLinkWithBase:Bn,listPathsFetched:ur,listSlugCache:xn,mdToSlug:G,negativeFetchCache:Ht,get notFoundPage(){return le},removeSlugResolver:wo,resolveSlugPath:un,get searchIndex(){return re},setContentBase:hi,setDefaultCrawlMaxQueue:$o,setFetchCacheMaxSize:Eo,setFetchCacheTTL:Co,setFetchConcurrency:Lo,setFetchMarkdown:To,setFetchNegativeCacheTTL:Ao,setHomePage:La,setLanguages:Aa,setNegativeFetchCacheMaxSize:Mo,setNotFoundPage:Ma,setSkipRootReadme:fo,get skipRootReadme(){return ui},slugResolvers:yr,slugToMd:Y,slugify:de,unescapeMarkdown:er,uniqueSlug:Xt,watchForColdHashRoute:Jn,whenSearchIndexReady:Bt},Symbol.toStringTag,{value:"Module"}));var $r,Qi;function Po(){if(Qi)return $r;Qi=1;function e(a,s){return s.some(([o,l])=>o<=a&&a<=l)}function t(a){if(typeof a!="string")return!1;const s=a.charCodeAt(0);return e(s,[[12352,12447],[19968,40959],[44032,55203],[131072,191456]])}function n(a){return`
|
|
75
75
|
\r `.includes(a)}function i(a){if(typeof a!="string")return!1;const s=a.charCodeAt(0);return e(s,[[33,47],[58,64],[91,96],[123,126],[12288,12351],[65280,65519]])}function r(a,s={}){let o=0,l=0,c=a.length-1;const u=s.wordsPerMinute||200,g=s.wordBound||n;for(;g(a[l]);)l++;for(;g(a[c]);)c--;const h=`${a}
|
|
76
|
-
`;for(let f=l;f<=c;f++)if((t(h[f])||!g(h[f])&&(g(h[f+1])||t(h[f+1])))&&o++,t(h[f]))for(;f<=c&&(i(h[f+1])||g(h[f+1]));)f++;const d=o/u,p=Math.round(d*60*1e3);return{text:Math.ceil(d.toFixed(2))+" min read",minutes:d,time:p,words:o}}return Lr=r,Lr}var To=Lo();const zo=da(To),wn=new Map,Ro=200;function $o(e){return String(e||"")}function Po(e,t){if(wn.set(e,t),wn.size>Ro){const n=wn.keys().next().value;n&&wn.delete(n)}}function Io(e){return e?String(e).trim().split(/\s+/).filter(Boolean).length:0}function No(e){const t=$o(e),n=wn.get(t);if(n)return Object.assign({},n);const i=zo(e||""),r=typeof i.words=="number"?i.words:Io(e),a={readingTime:i,wordCount:r};return Po(t,a),Object.assign({},a)}function Rn(e,t){let n=document.querySelector(`meta[name="${e}"]`);n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t)}function Rt(e,t,n){let i=`meta[${e}="${t}"]`,r=document.querySelector(i);r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.setAttribute("content",n)}function $a(e,t){try{let n=document.querySelector(`link[rel="${e}"]`);n||(n=document.createElement("link"),n.setAttribute("rel",e),document.head.appendChild(n)),n.setAttribute("href",t)}catch(n){k("[seoManager] upsertLinkRel failed",n)}}function Oo(e,t,n,i){const r=t&&String(t).trim()?t:e.title||document.title;Rt("property","og:title",r);const a=i&&String(i).trim()?i:e.description||"";a&&String(a).trim()&&Rt("property","og:description",a),a&&String(a).trim()&&Rt("name","twitter:description",a),Rt("name","twitter:card",e.twitter_card||"summary_large_image");const s=n||e.image;s&&(Rt("property","og:image",s),Rt("name","twitter:image",s))}function oi(e,t,n,i,r=""){const a=e.meta||{},s=document&&document.querySelector&&document.querySelector('meta[name="description"]')&&document.querySelector('meta[name="description"]').getAttribute("content")||"",o=i&&String(i).trim()?i:a.description&&String(a.description).trim()?a.description:s&&String(s).trim()?s:"";o&&String(o).trim()&&Rn("description",o),Rn("robots",a.robots||"index,follow"),Oo(a,t,n,o)}function Bo(){try{const e=['meta[name="site"]','meta[name="site-name"]','meta[name="siteName"]','meta[property="og:site_name"]','meta[name="twitter:site"]'];for(const t of e){const n=document.querySelector(t);if(n){const i=n.getAttribute("content")||"";if(i&&i.trim())return i.trim()}}}catch(e){k("[seoManager] getSiteNameFromMeta failed",e)}return""}function li(e,t,n,i,r,a=""){try{const s=e.meta||{},o=n&&String(n).trim()?n:s.title||a||document.title,l=r&&String(r).trim()?r:s.description||document.querySelector('meta[name="description"]')&&document.querySelector('meta[name="description"]').getAttribute("content")||"",c=i||s.image||null;let u="";try{if(t){const p=Y(t);try{u=(location.origin+location.pathname).split("?")[0]+"?page="+encodeURIComponent(p)}catch{u=location.href.split("#")[0]}}else u=location.href.split("#")[0]}catch(p){u=location.href.split("#")[0],k("[seoManager] compute canonical failed",p)}u&&$a("canonical",u);try{Rt("property","og:url",u)}catch(p){k("[seoManager] upsertMeta og:url failed",p)}const g={"@context":"https://schema.org","@type":"Article",headline:o||"",description:l||"",url:u||location.href.split("#")[0]};c&&(g.image=String(c)),s.date&&(g.datePublished=s.date),s.dateModified&&(g.dateModified=s.dateModified);const h="nimbi-jsonld";let d=document.getElementById(h);d||(d=document.createElement("script"),d.type="application/ld+json",d.id=h,document.head.appendChild(d)),d.textContent=JSON.stringify(g,null,2)}catch(s){k("[seoManager] setStructuredData failed",s)}}let Sn=typeof window<"u"&&window.__SEO_MAP?window.__SEO_MAP:{};function jo(e){try{if(!e||typeof e!="object"){Sn={};return}Sn=Object.assign({},e)}catch(t){k("[seoManager] setSeoMap failed",t)}}function qo(e,t=""){try{if(!e)return;const n=Sn&&Sn[e]?Sn[e]:typeof window<"u"&&window.__SEO_MAP&&window.__SEO_MAP[e]?window.__SEO_MAP[e]:null;try{const i=location.origin+location.pathname+"?page="+encodeURIComponent(String(e||""));$a("canonical",i);try{Rt("property","og:url",i)}catch{}}catch{}if(!n)return;try{n.title&&(document.title=String(n.title))}catch{}try{n.description&&Rn("description",String(n.description))}catch{}try{try{oi({meta:n},n.title||void 0,n.image||void 0,n.description||void 0,t)}catch{}}catch{}try{li({meta:n},e,n.title||void 0,n.image||void 0,n.description||void 0,t)}catch(i){k("[seoManager] inject structured data failed",i)}}catch(n){k("[seoManager] injectSeoForPage failed",n)}}function Yn(e={},t="",n=void 0,i=void 0){try{const r=e||{},a=typeof n=="string"&&n.trim()?n:r.title||"Not Found",s=typeof i=="string"&&i.trim()?i:r.description||"";try{Rn("robots","noindex,follow")}catch{}try{s&&String(s).trim()&&Rn("description",String(s))}catch{}try{oi({meta:Object.assign({},r,{robots:"noindex,follow"})},a,r.image||void 0,s)}catch{}try{li({meta:Object.assign({},r,{title:a,description:s})},t||"",a,r.image||void 0,s)}catch{}}catch(r){k("[seoManager] markNotFound failed",r)}}function Ho(e,t,n,i,r,a,s,o,l,c,u){try{if(i&&i.querySelector){const g=i.querySelector(".menu-label");g&&(g.textContent=o&&o.textContent||e("onThisPage"))}}catch(g){k("[seoManager] update toc label failed",g)}try{const g=n.meta&&n.meta.title?String(n.meta.title).trim():"",h=r.querySelector("img"),d=h&&(h.getAttribute("src")||h.src)||null;let p="";try{let w="";try{const y=o||(r&&r.querySelector?r.querySelector("h1"):null);if(y){let _=y.nextElementSibling;const b=[];for(;_&&!(_.tagName&&_.tagName.toLowerCase()==="h2");){try{if(_.classList&&_.classList.contains("nimbi-article-subtitle")){_=_.nextElementSibling;continue}}catch{}const v=(_.textContent||"").trim();v&&b.push(v),_=_.nextElementSibling}b.length&&(w=b.join(" ").replace(/\s+/g," ").trim()),!w&&l&&(w=String(l).trim())}}catch(y){k("[seoManager] compute descOverride failed",y)}w&&String(w).length>160&&(w=String(w).slice(0,157).trim()+"..."),p=w}catch(w){k("[seoManager] compute descOverride failed",w)}let m="";try{g&&(m=g)}catch{}if(!m)try{o&&o.textContent&&(m=String(o.textContent).trim())}catch{}if(!m)try{const w=r.querySelector("h2");w&&w.textContent&&(m=String(w.textContent).trim())}catch{}m||(m=a||"");try{oi(n,m||void 0,d,p)}catch(w){k("[seoManager] setMetaTags failed",w)}try{li(n,c,m||void 0,d,p,t)}catch(w){k("[seoManager] setStructuredData failed",w)}const f=Bo();m?f?document.title=`${f} - ${m}`:document.title=`${t||"Site"} - ${m}`:g?document.title=g:document.title=t||document.title}catch(g){k("[seoManager] applyPageMeta failed",g)}try{try{const g=r.querySelectorAll(".nimbi-reading-time");g&&g.forEach(h=>h.remove())}catch{}if(l){const g=No(u.raw||""),h=g&&g.readingTime?g.readingTime:null,d=h&&typeof h.minutes=="number"?Math.ceil(h.minutes):0,p=d?e("readingTime",{minutes:d}):"";if(!p)return;const m=r.querySelector("h1");if(m){const f=r.querySelector(".nimbi-article-subtitle");try{if(f){const w=document.createElement("span");w.className="nimbi-reading-time",w.textContent=p,f.appendChild(w)}else{const w=document.createElement("p");w.className="nimbi-article-subtitle is-6 has-text-grey-light";const y=document.createElement("span");y.className="nimbi-reading-time",y.textContent=p,w.appendChild(y);try{m.parentElement.insertBefore(w,m.nextSibling)}catch{try{m.insertAdjacentElement("afterend",w)}catch{}}}}catch{try{const y=document.createElement("p");y.className="nimbi-article-subtitle is-6 has-text-grey-light";const _=document.createElement("span");_.className="nimbi-reading-time",_.textContent=p,y.appendChild(_),m.insertAdjacentElement("afterend",y)}catch{}}}}}catch(g){k("[seoManager] reading time update failed",g)}}let Pa=100;function Ui(e){Pa=e}function ct(){try{if(Jt(2))return!0}catch{}try{return!1}catch{return!1}}let vn=300*1e3,pn=null;function ut(e,t,n){try{if(typeof Oe=="function"&&typeof Oe.length=="number"&&Oe.length>=3)return Oe(e,t,{signal:n})}catch{}return Oe(e,t)}function Wi(e){vn=e}const mt=new Map;function Fo(e){if(!mt.has(e))return;const t=mt.get(e),n=Date.now();if(t.ts+vn<n){mt.delete(e);return}return mt.delete(e),mt.set(e,t),t.value}function Do(e,t){if(Zi(),Zi(),mt.delete(e),mt.set(e,{value:t,ts:Date.now()}),mt.size>Pa){const n=mt.keys().next().value;n!==void 0&&mt.delete(n)}}function Zi(){if(!vn||vn<=0)return;const e=Date.now();for(const[t,n]of mt.entries())n.ts+vn<e&&mt.delete(t)}async function Uo(e,t,n){const i=new Set(rt);let r=[];try{if(typeof document<"u"&&document.getElementsByClassName){const a=s=>{const o=document.getElementsByClassName(s);for(let l=0;l<o.length;l++){const c=o[l].getElementsByTagName("a");for(let u=0;u<c.length;u++)r.push(c[u])}};a("nimbi-site-navbar"),a("navbar"),a("nimbi-nav")}else r=Array.from(document.querySelectorAll(".nimbi-site-navbar a, .navbar a, .nimbi-nav a"))}catch{try{r=Array.from(document.querySelectorAll(".nimbi-site-navbar a, .navbar a, .nimbi-nav a"))}catch{r=[]}}for(const a of Array.from(r||[])){const s=a.getAttribute("href")||"";if(s)try{try{const h=it(s);if(h){if(h.type==="canonical"&&h.page){const d=Y(h.page);if(d){i.add(d);continue}}if(h.type==="cosmetic"&&h.page){const d=h.page;if(V.has(d)){const p=V.get(d);if(p)return p}continue}}}catch{}const o=new URL(s,location.href);if(o.origin!==location.origin)continue;const l=(o.hash||o.pathname).match(/([^#?]+\.md)(?:$|[?#])/)||(o.pathname||"").match(/([^#?]+\.md)(?:$|[?#])/);if(l){let h=Y(l[1]);h&&i.add(h);continue}const c=(a.textContent||"").trim(),u=(o.pathname||"").replace(/^.*\//,"");if(c&&he(c)===e||u&&he(u.replace(/\.(html?|md)$/i,""))===e)return o.toString();if(/\.(html?)$/i.test(o.pathname)){let h=o.pathname.replace(/^\//,"");i.add(h);continue}const g=o.pathname||"";if(g){const h=new URL(t),d=Kt(h.pathname);if(g.indexOf(d)!==-1){let p=g.startsWith(d)?g.slice(d.length):g;p=Y(p),p&&i.add(p)}}}catch(o){k("[router] malformed URL while discovering index candidates",o)}}for(const a of i)try{if(!a||!String(a).includes(".md"))continue;const s=await ut(a,t,n);if(!s||!s.raw)continue;const o=(s.raw||"").match(/^#\s+(.+)$/m);if(o){const l=(o[1]||"").trim();if(l&&he(l)===e)return a}}catch(s){k("[router] fetchMarkdown during index discovery failed",s)}return null}function Wo(e){const t=[];if(String(e).includes(".md")||String(e).includes(".html"))/index\.html$/i.test(e)||t.push(e);else try{const n=decodeURIComponent(String(e||""));if(V.has(n)){const i=cn(n)||V.get(n);i&&(/\.(md|html?)$/i.test(i)?/index\.html$/i.test(i)||t.push(i):(t.push(i),t.push(i+".html")))}else{if(rt&&rt.size)for(const i of rt){const r=i.replace(/^.*\//,"").replace(/\.(md|html?)$/i,"");if(he(r)===n&&!/index\.html$/i.test(i)){t.push(i);break}}!t.length&&n&&!/\.(md|html?)$/i.test(n)&&(t.push(n+".html"),t.push(n+".md"))}}catch(n){k("[router] buildPageCandidates failed during slug handling",n)}return t}async function Zo(e,t){const n=e||"";try{try{ua("fetchPageData")}catch{}try{ha("fetchPageData")}catch{}}catch{}try{if(pn&&typeof pn.abort=="function")try{pn.abort()}catch{}}catch{}pn=typeof AbortController<"u"?new AbortController:null;const i=pn;let r=null;try{const y=it(typeof location<"u"?location.href:"");y&&y.anchor&&(r=y.anchor)}catch{try{r=location&&location.hash?decodeURIComponent(location.hash.replace(/^#/,"")):null}catch{r=null}}let a=e||"",s=null;const o=String(n||"").includes(".md")||String(n||"").includes(".html");if(a&&String(a).includes("::")){const y=String(a).split("::",2);a=y[0],s=y[1]||null}const c=`${e}|||${typeof Ys<"u"&&jt?jt:""}`,u=Fo(c);if(u)a=u.resolved,s=u.anchor||s;else{if(!String(a).includes(".md")&&!String(a).includes(".html")){let y=decodeURIComponent(String(a||""));if(y&&typeof y=="string"&&(y=Y(y),y=ln(y)),V.has(y))a=cn(y)||V.get(y);else{let _=await Uo(y,t,i?i.signal:void 0);if(_)a=_;else if(Gt._refreshed&&rt&&rt.size||typeof t=="string"&&/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const b=await Ra(y,t);b&&(a=b)}}}Do(c,{resolved:a,anchor:s})}let g=!0;try{const y=String(a||"").includes(".md")||String(a||"").includes(".html")||a&&(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/"));g=typeof le=="string"&&le||V.has(a)||rt&&rt.size||Gt._refreshed||o||y}catch{g=!0}!s&&r&&(s=r);try{if(g&&a&&(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/"))){const y=a.startsWith("/")?new URL(a,location.origin).toString():a;try{const _=await fetch(y,i?{signal:i.signal}:void 0);if(_&&_.ok){const b=await _.text(),v=_&&_.headers&&typeof _.headers.get=="function"&&_.headers.get("content-type")||"",S=(b||"").toLowerCase();if(v&&v.indexOf&&v.indexOf("text/html")!==-1||S.indexOf("<!doctype")!==-1||S.indexOf("<html")!==-1){if(!o)try{let I=y;try{I=new URL(y).pathname.replace(/^\//,"")}catch{I=String(y||"").replace(/^\//,"")}const U=I.replace(/\.html$/i,".md");try{const z=await ut(U,t,i?i.signal:void 0);if(z&&z.raw)return{data:z,pagePath:U,anchor:s}}catch{}if(typeof le=="string"&&le)try{const z=await ut(le,t,i?i.signal:void 0);if(z&&z.raw){try{Yn(z.meta||{},le)}catch{}return{data:z,pagePath:le,anchor:s}}}catch{}try{w=new Error("site shell detected (absolute fetch)")}catch{}}catch{}if(S.indexOf('<div id="app"')!==-1||S.indexOf("nimbi-cms")!==-1||S.indexOf("nimbi-mount")!==-1||S.indexOf("nimbi-")!==-1||S.indexOf("initcms(")!==-1||S.indexOf("window.nimbi")!==-1||/\bnimbi\b/.test(S))try{let I=y;try{I=new URL(y).pathname.replace(/^\//,"")}catch{I=String(y||"").replace(/^\//,"")}const U=I.replace(/\.html$/i,".md");try{const z=await ut(U,t,i?i.signal:void 0);if(z&&z.raw)return{data:z,pagePath:U,anchor:s}}catch{}if(typeof le=="string"&&le)try{const z=await ut(le,t,i?i.signal:void 0);if(z&&z.raw){try{Yn(z.meta||{},le)}catch{}return{data:z,pagePath:le,anchor:s}}}catch{}try{w=new Error("site shell detected (absolute fetch)")}catch{}}catch{}}}}catch{}}}catch{}const h=Wo(a);try{if(ct())try{Bt("[router-debug] fetchPageData candidates",{originalRaw:n,resolved:a,pageCandidates:h})}catch{}}catch{}const d=String(n||"").includes(".md")||String(n||"").includes(".html");let p=null;if(!d)try{let y=decodeURIComponent(String(n||""));y=Y(y),y=ln(y),y&&!/\.(md|html?)$/i.test(y)&&(p=y)}catch{p=null}if(d&&h.length===0&&(String(a).includes(".md")||String(a).includes(".html"))&&h.push(a),h.length===0&&(String(a).includes(".md")||String(a).includes(".html"))&&h.push(a),h.length===1&&/index\.html$/i.test(h[0])&&!d&&!V.has(a)&&!V.has(decodeURIComponent(String(a||"")))&&!String(a||"").includes("/"))throw new Error("Unknown slug: index.html fallback prevented");let m=null,f=null,w=null;try{const y=String(a||"").includes(".md")||String(a||"").includes(".html")||a&&(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/"));g=typeof le=="string"&&le||V.has(a)||rt&&rt.size||Gt._refreshed||d||y}catch{g=!0}if(!g)w=new Error("no page data");else for(const y of h)if(y)try{const _=Y(y);if(m=await ut(_,t,i?i.signal:void 0),f=_,p&&!V.has(p))try{let b="";if(m&&m.isHtml)try{const v=qe();if(v){const S=v.parseFromString(m.raw||"","text/html"),E=S.querySelector("h1")||S.querySelector("title");E&&E.textContent&&(b=E.textContent.trim())}}catch{}else{const v=(m&&m.raw||"").match(/^#\s+(.+)$/m);v&&v[1]&&(b=v[1].trim())}if(b&&he(b)!==p)try{if(/\.html$/i.test(_)){const S=_.replace(/\.html$/i,".md");if(h.includes(S))try{const E=await ut(S,t,i?i.signal:void 0);if(E&&E.raw)m=E,f=S;else if(typeof le=="string"&&le)try{const P=await ut(le,t,i?i.signal:void 0);if(P&&P.raw)m=P,f=le;else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{m=null,f=null,w=new Error("slug mismatch for candidate");continue}else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{try{const P=await ut(le,t,i?i.signal:void 0);if(P&&P.raw)m=P,f=le;else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{}try{if(!d&&/\.html$/i.test(_)){const b=_.replace(/\.html$/i,".md");if(h.includes(b))try{const S=String(m&&m.raw||"").trim().slice(0,128).toLowerCase();if(m&&m.isHtml||/^(?:<!doctype|<html|<title|<h1)/i.test(S)||S.indexOf('<div id="app"')!==-1||S.indexOf("nimbi-")!==-1||S.indexOf("nimbi")!==-1||S.indexOf("initcms(")!==-1){let P=!1;try{const I=await ut(b,t,i?i.signal:void 0);if(I&&I.raw)m=I,f=b,P=!0;else if(typeof le=="string"&&le)try{const U=await ut(le,t,i?i.signal:void 0);U&&U.raw&&(m=U,f=le,P=!0)}catch{}}catch{try{const U=await ut(le,t,i?i.signal:void 0);U&&U.raw&&(m=U,f=le,P=!0)}catch{}}if(!P){m=null,f=null,w=new Error("site shell detected (candidate HTML rejected)");continue}}}catch{}}}catch{}try{if(ct())try{Bt("[router-debug] fetchPageData accepted candidate",{candidate:_,pagePath:f,isHtml:m&&m.isHtml,snippet:m&&m.raw?String(m.raw).slice(0,160):null})}catch{}}catch{}break}catch(_){w=_;try{ct()&&k("[router] candidate fetch failed",{candidate:y,contentBase:t,err:_&&_.message||_})}catch{}}if(!m){const y=w&&(w.message||String(w))||null,_=y&&/failed to fetch md|site shell detected/i.test(y);try{if(ct())try{Bt("[router-debug] fetchPageData no data",{originalRaw:n,resolved:a,pageCandidates:h,fetchError:y})}catch{}}catch{}if(_)try{if(ct())try{k("[router] fetchPageData: no page data (expected)",{originalRaw:n,resolved:a,pageCandidates:h,contentBase:t,fetchError:y})}catch{}}catch{}else try{if(ct())try{nr("[router] fetchPageData: no page data for",{originalRaw:n,resolved:a,pageCandidates:h,contentBase:t,fetchError:y})}catch{}}catch{}if(typeof le=="string"&&le)try{const b=await ut(le,t,i?i.signal:void 0);if(b&&b.raw){try{Yn(b.meta||{},le)}catch{}return{data:b,pagePath:le,anchor:s}}}catch{}try{if(d&&String(n||"").toLowerCase().includes(".html"))try{const b=new URL(String(n||""),location.href).toString();ct()&&k("[router] attempting absolute HTML fetch fallback",b);const v=await fetch(b,i?{signal:i.signal}:void 0);if(v&&v.ok){const S=await v.text(),E=v&&v.headers&&typeof v.headers.get=="function"&&v.headers.get("content-type")||"",P=(S||"").toLowerCase(),I=E&&E.indexOf&&E.indexOf("text/html")!==-1||P.indexOf("<!doctype")!==-1||P.indexOf("<html")!==-1;if(!I&&ct())try{k("[router] absolute fetch returned non-HTML",()=>({abs:b,contentType:E,snippet:P.slice(0,200)}))}catch{}if(I){const U=(S||"").toLowerCase();if(/<title>\s*index of\b/i.test(S)||/<h1>\s*index of\b/i.test(S)||U.indexOf("parent directory")!==-1||/<title>\s*directory listing/i.test(S)||/<h1>\s*directory listing/i.test(S))try{ct()&&k("[router] absolute fetch returned directory listing; treating as not found",{abs:b})}catch{}else try{const O=b,W=new URL(".",O).toString();try{const H=qe();if(H){const M=H.parseFromString(S||"","text/html"),F=(J,Te)=>{try{const ke=Te.getAttribute(J)||"";if(!ke||/^(https?:)?\/\//i.test(ke)||ke.startsWith("/")||ke.startsWith("#"))return;try{const xe=new URL(ke,O).toString();Te.setAttribute(J,xe)}catch(xe){k("[router] rewrite attribute failed",J,xe)}}catch(ke){k("[router] rewrite helper failed",ke)}},G=M.querySelectorAll("[src],[href],[srcset],[xlink:href],[poster]"),ie=[];for(const J of Array.from(G||[]))try{const Te=J.tagName?J.tagName.toLowerCase():"";if(Te==="a")continue;if(J.hasAttribute("src")){const ke=J.getAttribute("src");F("src",J);const xe=J.getAttribute("src");ke!==xe&&ie.push({attr:"src",tag:Te,before:ke,after:xe})}if(J.hasAttribute("href")&&Te==="link"){const ke=J.getAttribute("href");F("href",J);const xe=J.getAttribute("href");ke!==xe&&ie.push({attr:"href",tag:Te,before:ke,after:xe})}if(J.hasAttribute("href")&&Te!=="link"){const ke=J.getAttribute("href");F("href",J);const xe=J.getAttribute("href");ke!==xe&&ie.push({attr:"href",tag:Te,before:ke,after:xe})}if(J.hasAttribute("xlink:href")){const ke=J.getAttribute("xlink:href");F("xlink:href",J);const xe=J.getAttribute("xlink:href");ke!==xe&&ie.push({attr:"xlink:href",tag:Te,before:ke,after:xe})}if(J.hasAttribute("poster")){const ke=J.getAttribute("poster");F("poster",J);const xe=J.getAttribute("poster");ke!==xe&&ie.push({attr:"poster",tag:Te,before:ke,after:xe})}if(J.hasAttribute("srcset")){const Ce=(J.getAttribute("srcset")||"").split(",").map(He=>He.trim()).filter(Boolean).map(He=>{const[R,N]=He.split(/\s+/,2);if(!R||/^(https?:)?\/\//i.test(R)||R.startsWith("/"))return He;try{const C=new URL(R,O).toString();return N?`${C} ${N}`:C}catch{return He}}).join(", ");J.setAttribute("srcset",Ce)}}catch{}const ye=M.documentElement&&M.documentElement.outerHTML?M.documentElement.outerHTML:S;try{ct()&&ie&&ie.length&&k("[router] rewritten asset refs",{abs:b,rewritten:ie})}catch{}return{data:{raw:ye,isHtml:!0},pagePath:String(n||""),anchor:s}}}catch{}let te=S;return/<base\s+[^>]*>/i.test(S)||(/<head[^>]*>/i.test(S)?te=S.replace(/(<head[^>]*>)/i,`$1<base href="${W}">`):te=`<base href="${W}">`+S),{data:{raw:te,isHtml:!0},pagePath:String(n||""),anchor:s}}catch{return{data:{raw:S,isHtml:!0},pagePath:String(n||""),anchor:s}}}}}catch(b){ct()&&k("[router] absolute HTML fetch fallback failed",b)}}catch{}try{const b=decodeURIComponent(String(a||""));if(b&&!/\.(md|html?)$/i.test(b)&&typeof le=="string"&&le&&ct()){const S=[`/assets/${b}.html`,`/assets/${b}/index.html`];for(const E of S)try{const P=await fetch(E,Object.assign({method:"GET"},i?{signal:i.signal}:{}));if(P&&P.ok)return{data:{raw:await P.text(),isHtml:!0},pagePath:E.replace(/^\//,""),anchor:s}}catch{}}}catch(b){ct()&&k("[router] assets fallback failed",b)}throw new Error("no page data")}return{data:m,pagePath:f,anchor:s}}function pr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ht=pr();function Ia(e){Ht=e}var Ut={exec:()=>null};function Le(e,t=""){let n=typeof e=="string"?e:e.source,i={replace:(r,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(ot.caret,"$1"),n=n.replace(r,s),i},getRegex:()=>new RegExp(n,t)};return i}var Go=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,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,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=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Xo=/^(?:[ \t]*(?:\n|$))+/,Qo=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ko=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,On=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ci=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Na=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Oa=Le(Na).replace(/bull/g,ci).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Yo=Le(Na).replace(/bull/g,ci).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ui=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jo=/^[^\n]+/,hi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,el=Le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",hi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tl=Le(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ci).getRegex(),mr="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",di=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nl=Le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",di).replace("tag",mr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ba=Le(ui).replace("hr",On).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",mr).getRegex(),rl=Le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ba).getRegex(),fi={blockquote:rl,code:Qo,def:el,fences:Ko,heading:Vo,hr:On,html:nl,lheading:Oa,list:tl,newline:Xo,paragraph:Ba,table:Ut,text:Jo},Gi=Le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",On).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",mr).getRegex(),il={...fi,lheading:Yo,table:Gi,paragraph:Le(ui).replace("hr",On).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",mr).getRegex()},al={...fi,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",di).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:Ut,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(ui).replace("hr",On).replace("heading",` *#{1,6} *[^
|
|
77
|
-
]`).replace("lheading",
|
|
76
|
+
`;for(let f=l;f<=c;f++)if((t(h[f])||!g(h[f])&&(g(h[f+1])||t(h[f+1])))&&o++,t(h[f]))for(;f<=c&&(i(h[f+1])||g(h[f+1]));)f++;const d=o/u,p=Math.round(d*60*1e3);return{text:Math.ceil(d.toFixed(2))+" min read",minutes:d,time:p,words:o}}return $r=r,$r}var Io=Po();const No=ma(Io),_n=new Map,Oo=200;function Bo(e){return String(e||"")}function jo(e,t){if(_n.set(e,t),_n.size>Oo){const n=_n.keys().next().value;n&&_n.delete(n)}}function qo(e){return e?String(e).trim().split(/\s+/).filter(Boolean).length:0}function Ho(e){const t=Bo(e),n=_n.get(t);if(n)return Object.assign({},n);const i=No(e||""),r=typeof i.words=="number"?i.words:qo(e),a={readingTime:i,wordCount:r};return jo(t,a),Object.assign({},a)}function $n(e,t){let n=document.querySelector(`meta[name="${e}"]`);n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t)}function Rt(e,t,n){let i=`meta[${e}="${t}"]`,r=document.querySelector(i);r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.setAttribute("content",n)}function Ba(e,t){try{let n=document.querySelector(`link[rel="${e}"]`);n||(n=document.createElement("link"),n.setAttribute("rel",e),document.head.appendChild(n)),n.setAttribute("href",t)}catch(n){k("[seoManager] upsertLinkRel failed",n)}}function Fo(e,t,n,i){const r=t&&String(t).trim()?t:e.title||document.title;Rt("property","og:title",r);const a=i&&String(i).trim()?i:e.description||"";a&&String(a).trim()&&Rt("property","og:description",a),a&&String(a).trim()&&Rt("name","twitter:description",a),Rt("name","twitter:card",e.twitter_card||"summary_large_image");const s=n||e.image;s&&(Rt("property","og:image",s),Rt("name","twitter:image",s))}function di(e,t,n,i,r=""){const a=e.meta||{},s=document&&document.querySelector&&document.querySelector('meta[name="description"]')&&document.querySelector('meta[name="description"]').getAttribute("content")||"",o=i&&String(i).trim()?i:a.description&&String(a.description).trim()?a.description:s&&String(s).trim()?s:"";o&&String(o).trim()&&$n("description",o),$n("robots",a.robots||"index,follow"),Fo(a,t,n,o)}function Do(){try{const e=['meta[name="site"]','meta[name="site-name"]','meta[name="siteName"]','meta[property="og:site_name"]','meta[name="twitter:site"]'];for(const t of e){const n=document.querySelector(t);if(n){const i=n.getAttribute("content")||"";if(i&&i.trim())return i.trim()}}}catch(e){k("[seoManager] getSiteNameFromMeta failed",e)}return""}function fi(e,t,n,i,r,a=""){try{const s=e.meta||{},o=n&&String(n).trim()?n:s.title||a||document.title,l=r&&String(r).trim()?r:s.description||document.querySelector('meta[name="description"]')&&document.querySelector('meta[name="description"]').getAttribute("content")||"",c=i||s.image||null;let u="";try{if(t){const p=J(t);try{u=(location.origin+location.pathname).split("?")[0]+"?page="+encodeURIComponent(p)}catch{u=location.href.split("#")[0]}}else u=location.href.split("#")[0]}catch(p){u=location.href.split("#")[0],k("[seoManager] compute canonical failed",p)}u&&Ba("canonical",u);try{Rt("property","og:url",u)}catch(p){k("[seoManager] upsertMeta og:url failed",p)}const g={"@context":"https://schema.org","@type":"Article",headline:o||"",description:l||"",url:u||location.href.split("#")[0]};c&&(g.image=String(c)),s.date&&(g.datePublished=s.date),s.dateModified&&(g.dateModified=s.dateModified);const h="nimbi-jsonld";let d=document.getElementById(h);d||(d=document.createElement("script"),d.type="application/ld+json",d.id=h,document.head.appendChild(d)),d.textContent=JSON.stringify(g,null,2)}catch(s){k("[seoManager] setStructuredData failed",s)}}let vn=typeof window<"u"&&window.__SEO_MAP?window.__SEO_MAP:{};function Uo(e){try{if(!e||typeof e!="object"){vn={};return}vn=Object.assign({},e)}catch(t){k("[seoManager] setSeoMap failed",t)}}function Wo(e,t=""){try{if(!e)return;const n=vn&&vn[e]?vn[e]:typeof window<"u"&&window.__SEO_MAP&&window.__SEO_MAP[e]?window.__SEO_MAP[e]:null;try{const i=location.origin+location.pathname+"?page="+encodeURIComponent(String(e||""));Ba("canonical",i);try{Rt("property","og:url",i)}catch{}}catch{}if(!n)return;try{n.title&&(document.title=String(n.title))}catch{}try{n.description&&$n("description",String(n.description))}catch{}try{try{di({meta:n},n.title||void 0,n.image||void 0,n.description||void 0,t)}catch{}}catch{}try{fi({meta:n},e,n.title||void 0,n.image||void 0,n.description||void 0,t)}catch(i){k("[seoManager] inject structured data failed",i)}}catch(n){k("[seoManager] injectSeoForPage failed",n)}}function nr(e={},t="",n=void 0,i=void 0){try{const r=e||{},a=typeof n=="string"&&n.trim()?n:r.title||"Not Found",s=typeof i=="string"&&i.trim()?i:r.description||"";try{$n("robots","noindex,follow")}catch{}try{s&&String(s).trim()&&$n("description",String(s))}catch{}try{di({meta:Object.assign({},r,{robots:"noindex,follow"})},a,r.image||void 0,s)}catch{}try{fi({meta:Object.assign({},r,{title:a,description:s})},t||"",a,r.image||void 0,s)}catch{}}catch(r){k("[seoManager] markNotFound failed",r)}}function Zo(e,t,n,i,r,a,s,o,l,c,u){try{if(i&&i.querySelector){const g=i.querySelector(".menu-label");g&&(g.textContent=o&&o.textContent||e("onThisPage"))}}catch(g){k("[seoManager] update toc label failed",g)}try{const g=n.meta&&n.meta.title?String(n.meta.title).trim():"",h=r.querySelector("img"),d=h&&(h.getAttribute("src")||h.src)||null;let p="";try{let w="";try{const y=o||(r&&r.querySelector?r.querySelector("h1"):null);if(y){let _=y.nextElementSibling;const b=[];for(;_&&!(_.tagName&&_.tagName.toLowerCase()==="h2");){try{if(_.classList&&_.classList.contains("nimbi-article-subtitle")){_=_.nextElementSibling;continue}}catch{}const A=(_.textContent||"").trim();A&&b.push(A),_=_.nextElementSibling}b.length&&(w=b.join(" ").replace(/\s+/g," ").trim()),!w&&l&&(w=String(l).trim())}}catch(y){k("[seoManager] compute descOverride failed",y)}w&&String(w).length>160&&(w=String(w).slice(0,157).trim()+"..."),p=w}catch(w){k("[seoManager] compute descOverride failed",w)}let m="";try{g&&(m=g)}catch{}if(!m)try{o&&o.textContent&&(m=String(o.textContent).trim())}catch{}if(!m)try{const w=r.querySelector("h2");w&&w.textContent&&(m=String(w.textContent).trim())}catch{}m||(m=a||"");try{di(n,m||void 0,d,p)}catch(w){k("[seoManager] setMetaTags failed",w)}try{fi(n,c,m||void 0,d,p,t)}catch(w){k("[seoManager] setStructuredData failed",w)}const f=Do();m?f?document.title=`${f} - ${m}`:document.title=`${t||"Site"} - ${m}`:g?document.title=g:document.title=t||document.title}catch(g){k("[seoManager] applyPageMeta failed",g)}try{try{const g=r.querySelectorAll(".nimbi-reading-time");g&&g.forEach(h=>h.remove())}catch{}if(l){const g=Ho(u.raw||""),h=g&&g.readingTime?g.readingTime:null,d=h&&typeof h.minutes=="number"?Math.ceil(h.minutes):0,p=d?e("readingTime",{minutes:d}):"";if(!p)return;const m=r.querySelector("h1");if(m){const f=r.querySelector(".nimbi-article-subtitle");try{if(f){const w=document.createElement("span");w.className="nimbi-reading-time",w.textContent=p,f.appendChild(w)}else{const w=document.createElement("p");w.className="nimbi-article-subtitle is-6 has-text-grey-light";const y=document.createElement("span");y.className="nimbi-reading-time",y.textContent=p,w.appendChild(y);try{m.parentElement.insertBefore(w,m.nextSibling)}catch{try{m.insertAdjacentElement("afterend",w)}catch{}}}}catch{try{const y=document.createElement("p");y.className="nimbi-article-subtitle is-6 has-text-grey-light";const _=document.createElement("span");_.className="nimbi-reading-time",_.textContent=p,y.appendChild(_),m.insertAdjacentElement("afterend",y)}catch{}}}}}catch(g){k("[seoManager] reading time update failed",g)}}let ja=100;function Xi(e){ja=e}function ut(){try{if(tn(2))return!0}catch{}try{return!1}catch{return!1}}let An=300*1e3,mn=null;function ht(e,t,n){try{if(typeof Be=="function"&&typeof Be.length=="number"&&Be.length>=3)return Be(e,t,{signal:n})}catch{}return Be(e,t)}function Ki(e){An=e}const yt=new Map;function Go(e){if(!yt.has(e))return;const t=yt.get(e),n=Date.now();if(t.ts+An<n){yt.delete(e);return}return yt.delete(e),yt.set(e,t),t.value}function Qo(e,t){if(Vi(),Vi(),yt.delete(e),yt.set(e,{value:t,ts:Date.now()}),yt.size>ja){const n=yt.keys().next().value;n!==void 0&&yt.delete(n)}}function Vi(){if(!An||An<=0)return;const e=Date.now();for(const[t,n]of yt.entries())n.ts+An<e&&yt.delete(t)}async function Xo(e,t,n){const i=new Set(it);let r=[];try{if(typeof document<"u"&&document.getElementsByClassName){const a=s=>{const o=document.getElementsByClassName(s);for(let l=0;l<o.length;l++){const c=o[l].getElementsByTagName("a");for(let u=0;u<c.length;u++)r.push(c[u])}};a("nimbi-site-navbar"),a("navbar"),a("nimbi-nav")}else r=Array.from(document.querySelectorAll(".nimbi-site-navbar a, .navbar a, .nimbi-nav a"))}catch{try{r=Array.from(document.querySelectorAll(".nimbi-site-navbar a, .navbar a, .nimbi-nav a"))}catch{r=[]}}for(const a of Array.from(r||[])){const s=a.getAttribute("href")||"";if(s)try{try{const h=Je(s);if(h){if(h.type==="canonical"&&h.page){const d=J(h.page);if(d){i.add(d);continue}}if(h.type==="cosmetic"&&h.page){const d=h.page;if(Y.has(d)){const p=Y.get(d);if(p)return p}continue}}}catch{}const o=new URL(s,location.href);if(o.origin!==location.origin)continue;const l=(o.hash||o.pathname).match(/([^#?]+\.md)(?:$|[?#])/)||(o.pathname||"").match(/([^#?]+\.md)(?:$|[?#])/);if(l){let h=J(l[1]);h&&i.add(h);continue}const c=(a.textContent||"").trim(),u=(o.pathname||"").replace(/^.*\//,"");if(c&&de(c)===e||u&&de(u.replace(/\.(html?|md)$/i,""))===e)return o.toString();if(/\.(html?)$/i.test(o.pathname)){let h=o.pathname.replace(/^\//,"");i.add(h);continue}const g=o.pathname||"";if(g){const h=new URL(t),d=Yt(h.pathname);if(g.indexOf(d)!==-1){let p=g.startsWith(d)?g.slice(d.length):g;p=J(p),p&&i.add(p)}}}catch(o){k("[router] malformed URL while discovering index candidates",o)}}for(const a of i)try{if(!a||!String(a).includes(".md"))continue;const s=await ht(a,t,n);if(!s||!s.raw)continue;const o=(s.raw||"").match(/^#\s+(.+)$/m);if(o){const l=(o[1]||"").trim();if(l&&de(l)===e)return a}}catch(s){k("[router] fetchMarkdown during index discovery failed",s)}return null}function Ko(e){const t=[];if(String(e).includes(".md")||String(e).includes(".html"))/index\.html$/i.test(e)||t.push(e);else try{const n=decodeURIComponent(String(e||""));if(Y.has(n)){const i=un(n)||Y.get(n);i&&(/\.(md|html?)$/i.test(i)?/index\.html$/i.test(i)||t.push(i):(t.push(i),t.push(i+".html")))}else{if(it&&it.size)for(const i of it){const r=i.replace(/^.*\//,"").replace(/\.(md|html?)$/i,"");if(de(r)===n&&!/index\.html$/i.test(i)){t.push(i);break}}!t.length&&n&&!/\.(md|html?)$/i.test(n)&&(t.push(n+".html"),t.push(n+".md"))}}catch(n){k("[router] buildPageCandidates failed during slug handling",n)}return t}async function Vo(e,t){const n=e||"";try{try{ga("fetchPageData")}catch{}try{pa("fetchPageData")}catch{}}catch{}try{if(mn&&typeof mn.abort=="function")try{mn.abort()}catch{}}catch{}mn=typeof AbortController<"u"?new AbortController:null;const i=mn;let r=null;try{const y=Je(typeof location<"u"?location.href:"");y&&y.anchor&&(r=y.anchor)}catch{try{r=location&&location.hash?decodeURIComponent(location.hash.replace(/^#/,"")):null}catch{r=null}}let a=e||"";try{(!a||String(a).trim()==="")&&typeof ot=="string"&&ot&&(a=String(ot))}catch{}let s=null;const o=String(n||"").includes(".md")||String(n||"").includes(".html");if(a&&String(a).includes("::")){const y=String(a).split("::",2);a=y[0],s=y[1]||null}const c=`${e}|||${typeof ro<"u"&&qt?qt:""}`,u=Go(c);if(u)a=u.resolved,s=u.anchor||s;else{if(!String(a).includes(".md")&&!String(a).includes(".html")){let y=decodeURIComponent(String(a||""));if(y&&typeof y=="string"&&(y=J(y),y=cn(y)),Y.has(y))a=un(y)||Y.get(y);else{let _=await Xo(y,t,i?i.signal:void 0);if(_)a=_;else if(Qt._refreshed&&it&&it.size||typeof t=="string"&&/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const b=await Oa(y,t);b&&(a=b)}}}Qo(c,{resolved:a,anchor:s})}let g=!0;try{const y=String(a||"").includes(".md")||String(a||"").includes(".html")||a&&(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/"));g=typeof le=="string"&&le||Y.has(a)||it&&it.size||Qt._refreshed||o||y}catch{g=!0}!s&&r&&(s=r);try{if(g&&a&&(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/"))){const y=a.startsWith("/")?new URL(a,location.origin).toString():a;try{const _=await fetch(y,i?{signal:i.signal}:void 0);if(_&&_.ok){const b=await _.text(),A=_&&_.headers&&typeof _.headers.get=="function"&&_.headers.get("content-type")||"",S=(b||"").toLowerCase();if(A&&A.indexOf&&A.indexOf("text/html")!==-1||S.indexOf("<!doctype")!==-1||S.indexOf("<html")!==-1){if(!o)try{let O=y;try{O=new URL(y).pathname.replace(/^\//,"")}catch{O=String(y||"").replace(/^\//,"")}const W=O.replace(/\.html$/i,".md");try{const z=await ht(W,t,i?i.signal:void 0);if(z&&z.raw)return{data:z,pagePath:W,anchor:s}}catch{}if(typeof le=="string"&&le)try{const z=await ht(le,t,i?i.signal:void 0);if(z&&z.raw){try{nr(z.meta||{},le)}catch{}return{data:z,pagePath:le,anchor:s}}}catch{}try{w=new Error("site shell detected (absolute fetch)")}catch{}}catch{}if(S.indexOf('<div id="app"')!==-1||S.indexOf("nimbi-cms")!==-1||S.indexOf("nimbi-mount")!==-1||S.indexOf("nimbi-")!==-1||S.indexOf("initcms(")!==-1||S.indexOf("window.nimbi")!==-1||/\bnimbi\b/.test(S))try{let O=y;try{O=new URL(y).pathname.replace(/^\//,"")}catch{O=String(y||"").replace(/^\//,"")}const W=O.replace(/\.html$/i,".md");try{const z=await ht(W,t,i?i.signal:void 0);if(z&&z.raw)return{data:z,pagePath:W,anchor:s}}catch{}if(typeof le=="string"&&le)try{const z=await ht(le,t,i?i.signal:void 0);if(z&&z.raw){try{nr(z.meta||{},le)}catch{}return{data:z,pagePath:le,anchor:s}}}catch{}try{w=new Error("site shell detected (absolute fetch)")}catch{}}catch{}}}}catch{}}}catch{}const h=Ko(a);try{if(ut())try{jt("[router-debug] fetchPageData candidates",{originalRaw:n,resolved:a,pageCandidates:h})}catch{}}catch{}const d=String(n||"").includes(".md")||String(n||"").includes(".html");let p=null;if(!d)try{let y=decodeURIComponent(String(n||""));y=J(y),y=cn(y),y&&!/\.(md|html?)$/i.test(y)&&(p=y)}catch{p=null}if(d&&h.length===0&&(String(a).includes(".md")||String(a).includes(".html"))&&h.push(a),h.length===0&&(String(a).includes(".md")||String(a).includes(".html"))&&h.push(a),h.length===1&&/index\.html$/i.test(h[0])&&!d&&!Y.has(a)&&!Y.has(decodeURIComponent(String(a||"")))&&!String(a||"").includes("/"))throw new Error("Unknown slug: index.html fallback prevented");let m=null,f=null,w=null;try{const y=String(a||"").includes(".md")||String(a||"").includes(".html")||a&&(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/"));g=typeof le=="string"&&le||Y.has(a)||it&&it.size||Qt._refreshed||d||y}catch{g=!0}if(!g)w=new Error("no page data");else for(const y of h)if(y)try{const _=J(y);if(m=await ht(_,t,i?i.signal:void 0),f=_,p&&!Y.has(p))try{let b="";if(m&&m.isHtml)try{const A=He();if(A){const S=A.parseFromString(m.raw||"","text/html"),E=S.querySelector("h1")||S.querySelector("title");E&&E.textContent&&(b=E.textContent.trim())}}catch{}else{const A=(m&&m.raw||"").match(/^#\s+(.+)$/m);A&&A[1]&&(b=A[1].trim())}if(b&&de(b)!==p)try{if(/\.html$/i.test(_)){const S=_.replace(/\.html$/i,".md");if(h.includes(S))try{const E=await ht(S,t,i?i.signal:void 0);if(E&&E.raw)m=E,f=S;else if(typeof le=="string"&&le)try{const I=await ht(le,t,i?i.signal:void 0);if(I&&I.raw)m=I,f=le;else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{m=null,f=null,w=new Error("slug mismatch for candidate");continue}else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{try{const I=await ht(le,t,i?i.signal:void 0);if(I&&I.raw)m=I,f=le;else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}else{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{m=null,f=null,w=new Error("slug mismatch for candidate");continue}}catch{}try{if(!d&&/\.html$/i.test(_)){const b=_.replace(/\.html$/i,".md");if(h.includes(b))try{const S=String(m&&m.raw||"").trim().slice(0,128).toLowerCase();if(m&&m.isHtml||/^(?:<!doctype|<html|<title|<h1)/i.test(S)||S.indexOf('<div id="app"')!==-1||S.indexOf("nimbi-")!==-1||S.indexOf("nimbi")!==-1||S.indexOf("initcms(")!==-1){let I=!1;try{const O=await ht(b,t,i?i.signal:void 0);if(O&&O.raw)m=O,f=b,I=!0;else if(typeof le=="string"&&le)try{const W=await ht(le,t,i?i.signal:void 0);W&&W.raw&&(m=W,f=le,I=!0)}catch{}}catch{try{const W=await ht(le,t,i?i.signal:void 0);W&&W.raw&&(m=W,f=le,I=!0)}catch{}}if(!I){m=null,f=null,w=new Error("site shell detected (candidate HTML rejected)");continue}}}catch{}}}catch{}try{if(ut())try{jt("[router-debug] fetchPageData accepted candidate",{candidate:_,pagePath:f,isHtml:m&&m.isHtml,snippet:m&&m.raw?String(m.raw).slice(0,160):null})}catch{}}catch{}break}catch(_){w=_;try{ut()&&k("[router] candidate fetch failed",{candidate:y,contentBase:t,err:_&&_.message||_})}catch{}}if(!m){const y=w&&(w.message||String(w))||null,_=y&&/failed to fetch md|site shell detected/i.test(y);try{if(ut())try{jt("[router-debug] fetchPageData no data",{originalRaw:n,resolved:a,pageCandidates:h,fetchError:y})}catch{}}catch{}if(_)try{if(ut())try{k("[router] fetchPageData: no page data (expected)",{originalRaw:n,resolved:a,pageCandidates:h,contentBase:t,fetchError:y})}catch{}}catch{}else try{if(ut())try{sr("[router] fetchPageData: no page data for",{originalRaw:n,resolved:a,pageCandidates:h,contentBase:t,fetchError:y})}catch{}}catch{}if(typeof le=="string"&&le)try{const b=await ht(le,t,i?i.signal:void 0);if(b&&b.raw){try{nr(b.meta||{},le)}catch{}return{data:b,pagePath:le,anchor:s}}}catch{}try{if(d&&String(n||"").toLowerCase().includes(".html"))try{const b=new URL(String(n||""),location.href).toString();ut()&&k("[router] attempting absolute HTML fetch fallback",b);const A=await fetch(b,i?{signal:i.signal}:void 0);if(A&&A.ok){const S=await A.text(),E=A&&A.headers&&typeof A.headers.get=="function"&&A.headers.get("content-type")||"",I=(S||"").toLowerCase(),O=E&&E.indexOf&&E.indexOf("text/html")!==-1||I.indexOf("<!doctype")!==-1||I.indexOf("<html")!==-1;if(!O&&ut())try{k("[router] absolute fetch returned non-HTML",()=>({abs:b,contentType:E,snippet:I.slice(0,200)}))}catch{}if(O){const W=(S||"").toLowerCase();if(/<title>\s*index of\b/i.test(S)||/<h1>\s*index of\b/i.test(S)||W.indexOf("parent directory")!==-1||/<title>\s*directory listing/i.test(S)||/<h1>\s*directory listing/i.test(S))try{ut()&&k("[router] absolute fetch returned directory listing; treating as not found",{abs:b})}catch{}else try{const B=b,Z=new URL(".",B).toString();try{const j=He();if(j){const C=j.parseFromString(S||"","text/html"),N=(K,Le)=>{try{const me=Le.getAttribute(K)||"";if(!me||/^(https?:)?\/\//i.test(me)||me.startsWith("/")||me.startsWith("#"))return;try{const Se=new URL(me,B).toString();Le.setAttribute(K,Se)}catch(Se){k("[router] rewrite attribute failed",K,Se)}}catch(me){k("[router] rewrite helper failed",me)}},D=C.querySelectorAll("[src],[href],[srcset],[xlink:href],[poster]"),ie=[];for(const K of Array.from(D||[]))try{const Le=K.tagName?K.tagName.toLowerCase():"";if(Le==="a")continue;if(K.hasAttribute("src")){const me=K.getAttribute("src");N("src",K);const Se=K.getAttribute("src");me!==Se&&ie.push({attr:"src",tag:Le,before:me,after:Se})}if(K.hasAttribute("href")&&Le==="link"){const me=K.getAttribute("href");N("href",K);const Se=K.getAttribute("href");me!==Se&&ie.push({attr:"href",tag:Le,before:me,after:Se})}if(K.hasAttribute("href")&&Le!=="link"){const me=K.getAttribute("href");N("href",K);const Se=K.getAttribute("href");me!==Se&&ie.push({attr:"href",tag:Le,before:me,after:Se})}if(K.hasAttribute("xlink:href")){const me=K.getAttribute("xlink:href");N("xlink:href",K);const Se=K.getAttribute("xlink:href");me!==Se&&ie.push({attr:"xlink:href",tag:Le,before:me,after:Se})}if(K.hasAttribute("poster")){const me=K.getAttribute("poster");N("poster",K);const Se=K.getAttribute("poster");me!==Se&&ie.push({attr:"poster",tag:Le,before:me,after:Se})}if(K.hasAttribute("srcset")){const Ee=(K.getAttribute("srcset")||"").split(",").map(Fe=>Fe.trim()).filter(Boolean).map(Fe=>{const[R,P]=Fe.split(/\s+/,2);if(!R||/^(https?:)?\/\//i.test(R)||R.startsWith("/"))return Fe;try{const M=new URL(R,B).toString();return P?`${M} ${P}`:M}catch{return Fe}}).join(", ");K.setAttribute("srcset",Ee)}}catch{}const he=C.documentElement&&C.documentElement.outerHTML?C.documentElement.outerHTML:S;try{ut()&&ie&&ie.length&&k("[router] rewritten asset refs",{abs:b,rewritten:ie})}catch{}return{data:{raw:he,isHtml:!0},pagePath:String(n||""),anchor:s}}}catch{}let ee=S;try{let j=String(S||"");j=j.replace(/srcset\s*=\s*"([^"]*)"/gi,(C,N)=>`srcset="${String(N||"").split(",").map(he=>he.trim()).filter(Boolean).map(he=>{const[K,Le]=he.split(/\s+/,2);if(!K||/^(https?:)?\/\//i.test(K)||K.startsWith("/")||K.startsWith("#"))return he;try{const me=new URL(K,B).toString();return Le?`${me} ${Le}`:me}catch{return he}}).join(", ")}"`),j=j.replace(/<(?!a\b)([^>]*?)\bhref\s*=\s*"([^"]*)"/gi,(C,N,D)=>{if(!D||/^(https?:)?\/\//i.test(D)||D.startsWith("/")||D.startsWith("#"))return C;try{const ie=new URL(D,B).toString();return C.replace(`href="${D}"`,`href="${ie}"`)}catch{return C}}),j=j.replace(/\bsrc\s*=\s*"([^"]*)"/gi,(C,N)=>{if(!N||/^(https?:)?\/\//i.test(N)||N.startsWith("/")||N.startsWith("#"))return C;try{return`src="${new URL(N,B).toString()}"`}catch{return C}}),j=j.replace(/\bxlink:href\s*=\s*"([^"]*)"/gi,(C,N)=>{if(!N||/^(https?:)?\/\//i.test(N)||N.startsWith("/")||N.startsWith("#"))return C;try{return`xlink:href="${new URL(N,B).toString()}"`}catch{return C}}),j=j.replace(/\bposter\s*=\s*"([^"]*)"/gi,(C,N)=>{if(!N||/^(https?:)?\/\//i.test(N)||N.startsWith("/")||N.startsWith("#"))return C;try{return`poster="${new URL(N,B).toString()}"`}catch{return C}}),ee=j}catch{ee=S}return/<base\s+[^>]*>/i.test(ee)||(/<head[^>]*>/i.test(ee)?ee=ee.replace(/(<head[^>]*>)/i,`$1<base href="${Z}">`):ee=`<base href="${Z}">`+ee),{data:{raw:ee,isHtml:!0},pagePath:String(n||""),anchor:s}}catch{return{data:{raw:S,isHtml:!0},pagePath:String(n||""),anchor:s}}}}}catch(b){ut()&&k("[router] absolute HTML fetch fallback failed",b)}}catch{}try{const b=decodeURIComponent(String(a||""));if(b&&!/\.(md|html?)$/i.test(b)&&typeof le=="string"&&le&&ut()){const S=[`/assets/${b}.html`,`/assets/${b}/index.html`];for(const E of S)try{const I=await fetch(E,Object.assign({method:"GET"},i?{signal:i.signal}:{}));if(I&&I.ok)return{data:{raw:await I.text(),isHtml:!0},pagePath:E.replace(/^\//,""),anchor:s}}catch{}}}catch(b){ut()&&k("[router] assets fallback failed",b)}throw new Error("no page data")}return{data:m,pagePath:f,anchor:s}}function br(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ft=br();function qa(e){Ft=e}var Wt={exec:()=>null};function ze(e,t=""){let n=typeof e=="string"?e:e.source,i={replace:(r,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(lt.caret,"$1"),n=n.replace(r,s),i},getRegex:()=>new RegExp(n,t)};return i}var Yo=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),lt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,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,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=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Jo=/^(?:[ \t]*(?:\n|$))+/,el=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,nl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,gi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ha=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fa=ze(Ha).replace(/bull/g,gi).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),rl=ze(Ha).replace(/bull/g,gi).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),pi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,il=/^[^\n]+/,mi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,al=ze(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",mi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sl=ze(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,gi).getRegex(),wr="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",yi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ol=ze("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",yi).replace("tag",wr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Da=ze(pi).replace("hr",qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wr).getRegex(),ll=ze(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Da).getRegex(),bi={blockquote:ll,code:el,def:al,fences:tl,heading:nl,hr:qn,html:ol,lheading:Fa,list:sl,newline:Jo,paragraph:Da,table:Wt,text:il},Yi=ze("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wr).getRegex(),cl={...bi,lheading:rl,table:Yi,paragraph:ze(pi).replace("hr",qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wr).getRegex()},ul={...bi,html:ze(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",yi).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:Wt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ze(pi).replace("hr",qn).replace("heading",` *#{1,6} *[^
|
|
77
|
+
]`).replace("lheading",Fa).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},hl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,dl=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ua=/^( {2,}|\\)\n(?!\s*$)/,fl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_r=/[\p{P}\p{S}]/u,wi=/[\s\p{P}\p{S}]/u,Wa=/[^\s\p{P}\p{S}]/u,gl=ze(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wi).getRegex(),Za=/(?!~)[\p{P}\p{S}]/u,pl=/(?!~)[\s\p{P}\p{S}]/u,ml=/(?:[^\s\p{P}\p{S}]|~)/u,Ga=/(?![*_])[\p{P}\p{S}]/u,yl=/(?![*_])[\s\p{P}\p{S}]/u,bl=/(?:[^\s\p{P}\p{S}]|[*_])/u,wl=ze(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Yo?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Qa=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,_l=ze(Qa,"u").replace(/punct/g,_r).getRegex(),kl=ze(Qa,"u").replace(/punct/g,Za).getRegex(),Xa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xl=ze(Xa,"gu").replace(/notPunctSpace/g,Wa).replace(/punctSpace/g,wi).replace(/punct/g,_r).getRegex(),Sl=ze(Xa,"gu").replace(/notPunctSpace/g,ml).replace(/punctSpace/g,pl).replace(/punct/g,Za).getRegex(),vl=ze("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Wa).replace(/punctSpace/g,wi).replace(/punct/g,_r).getRegex(),Al=ze(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ga).getRegex(),El="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Cl=ze(El,"gu").replace(/notPunctSpace/g,bl).replace(/punctSpace/g,yl).replace(/punct/g,Ga).getRegex(),Ml=ze(/\\(punct)/,"gu").replace(/punct/g,_r).getRegex(),Ll=ze(/^<(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(),Tl=ze(yi).replace("(?:-->|$)","-->").getRegex(),zl=ze("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Tl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),hr=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Rl=ze(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",hr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ka=ze(/^!?\[(label)\]\[(ref)\]/).replace("label",hr).replace("ref",mi).getRegex(),Va=ze(/^!?\[(ref)\](?:\[\])?/).replace("ref",mi).getRegex(),$l=ze("reflink|nolink(?!\\()","g").replace("reflink",Ka).replace("nolink",Va).getRegex(),Ji=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,_i={_backpedal:Wt,anyPunctuation:Ml,autolink:Ll,blockSkip:wl,br:Ua,code:dl,del:Wt,delLDelim:Wt,delRDelim:Wt,emStrongLDelim:_l,emStrongRDelimAst:xl,emStrongRDelimUnd:vl,escape:hl,link:Rl,nolink:Va,punctuation:gl,reflink:Ka,reflinkSearch:$l,tag:zl,text:fl,url:Wt},Pl={..._i,link:ze(/^!?\[(label)\]\((.*?)\)/).replace("label",hr).getRegex(),reflink:ze(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",hr).getRegex()},Wr={..._i,emStrongRDelimAst:Sl,emStrongLDelim:kl,delLDelim:Al,delRDelim:Cl,url:ze(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ji).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ze(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ji).getRegex()},Il={...Wr,br:ze(Ua).replace("{2,}","*").getRegex(),text:ze(Wr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xn={normal:bi,gfm:cl,pedantic:ul},yn={normal:_i,gfm:Wr,breaks:Il,pedantic:Pl},Nl={"&":"&","<":"<",">":">",'"':""","'":"'"},ea=e=>Nl[e];function xt(e,t){if(t){if(lt.escapeTest.test(e))return e.replace(lt.escapeReplace,ea)}else if(lt.escapeTestNoEncode.test(e))return e.replace(lt.escapeReplaceNoEncode,ea);return e}function ta(e){try{e=encodeURI(e).replace(lt.percentDecode,"%")}catch{return null}return e}function na(e,t){let n=e.replace(lt.findPipe,(a,s,o)=>{let l=!1,c=s;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),i=n.split(lt.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(lt.slashPipe,"|");return i}function bn(e,t,n){let i=e.length;if(i===0)return"";let r=0;for(;r<i&&e.charAt(i-r-1)===t;)r++;return e.slice(0,i-r)}function Ol(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])n++;else if(e[i]===t[1]&&(n--,n<0))return i;return n>0?-2:-1}function Bl(e,t=0){let n=t,i="";for(let r of e)if(r===" "){let a=4-n%4;i+=" ".repeat(a),n+=a}else i+=r,n++;return i}function ra(e,t,n,i,r){let a=t.href,s=t.title||null,o=e[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:s,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,l}function jl(e,t,n){let i=e.match(n.other.indentCodeCompensation);if(i===null)return t;let r=i[1];return t.split(`
|
|
78
78
|
`).map(a=>{let s=a.match(n.other.beginningSpace);if(s===null)return a;let[o]=s;return o.length>=r.length?a.slice(r.length):a}).join(`
|
|
79
|
-
`)}var
|
|
80
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],i=
|
|
81
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=
|
|
79
|
+
`)}var Pn=class{options;rules;lexer;constructor(e){this.options=e||Ft}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 n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:bn(n,`
|
|
80
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],i=jl(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let i=bn(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:bn(t[0],`
|
|
81
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=bn(t[0],`
|
|
82
82
|
`).split(`
|
|
83
83
|
`),i="",r="",a=[];for(;n.length>0;){let s=!1,o=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))o.push(n[l]),s=!0;else if(!s)o.push(n[l]);else break;n=n.slice(l);let c=o.join(`
|
|
84
84
|
`),u=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
@@ -89,17 +89,17 @@ ${u}`:u;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
89
89
|
`),m=this.blockquote(p);a[a.length-1]=m,i=i.substring(0,i.length-d.raw.length)+m.raw,r=r.substring(0,r.length-d.text.length)+m.text;break}else if(h?.type==="list"){let d=h,p=d.raw+`
|
|
90
90
|
`+n.join(`
|
|
91
91
|
`),m=this.list(p);a[a.length-1]=m,i=i.substring(0,i.length-h.raw.length)+m.raw,r=r.substring(0,r.length-d.raw.length)+m.raw,n=p.substring(a.at(-1).raw.length).split(`
|
|
92
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),s=!1;for(;e;){let l=!1,c="",u="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let g
|
|
92
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),s=!1;for(;e;){let l=!1,c="",u="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let g=Bl(t[2].split(`
|
|
93
93
|
`,1)[0],t[1].length),h=e.split(`
|
|
94
94
|
`,1)[0],d=!g.trim(),p=0;if(this.options.pedantic?(p=2,u=g.trimStart()):d?p=t[1].length+1:(p=g.search(this.rules.other.nonSpaceChar),p=p>4?1:p,u=g.slice(p),p+=t[1].length),d&&this.rules.other.blankLine.test(h)&&(c+=h+`
|
|
95
|
-
`,e=e.substring(h.length+1),l=!0),!l){let m=this.rules.other.nextBulletRegex(p),f=this.rules.other.hrRegex(p),w=this.rules.other.fencesBeginRegex(p),y=this.rules.other.headingBeginRegex(p),_=this.rules.other.htmlBeginRegex(p),b=this.rules.other.blockquoteBeginRegex(p);for(;e;){let
|
|
96
|
-
`,1)[0],S;if(h=
|
|
95
|
+
`,e=e.substring(h.length+1),l=!0),!l){let m=this.rules.other.nextBulletRegex(p),f=this.rules.other.hrRegex(p),w=this.rules.other.fencesBeginRegex(p),y=this.rules.other.headingBeginRegex(p),_=this.rules.other.htmlBeginRegex(p),b=this.rules.other.blockquoteBeginRegex(p);for(;e;){let A=e.split(`
|
|
96
|
+
`,1)[0],S;if(h=A,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),S=h):S=h.replace(this.rules.other.tabCharGlobal," "),w.test(h)||y.test(h)||_.test(h)||b.test(h)||m.test(h)||f.test(h))break;if(S.search(this.rules.other.nonSpaceChar)>=p||!h.trim())u+=`
|
|
97
97
|
`+S.slice(p);else{if(d||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(g)||y.test(g)||f.test(g))break;u+=`
|
|
98
|
-
`+h}d=!h.trim(),c+=
|
|
99
|
-
`,e=e.substring(
|
|
100
|
-
`):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let s of i)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<n.length;s++)a.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:a.align[s]});for(let s of r)a.rows.push(
|
|
101
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}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){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=
|
|
102
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],i=!1){for(this.options.pedantic&&(t=t.replace(
|
|
98
|
+
`+h}d=!h.trim(),c+=A+`
|
|
99
|
+
`,e=e.substring(A.length+1),g=S.slice(p)}}r.loose||(s?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(s=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),r.raw+=c}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let u={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=u.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=u.raw+l.tokens[0].raw,l.tokens[0].text=u.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(u)):l.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):l.tokens.unshift(u)}}if(!r.loose){let c=l.tokens.filter(g=>g.type==="space"),u=c.length>0&&c.some(g=>this.rules.other.anyLine.test(g.raw));r.loose=u}}if(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=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:n,raw:t[0],href:i,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=na(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
100
|
+
`):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let s of i)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<n.length;s++)a.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:a.align[s]});for(let s of r)a.rows.push(na(s,a.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:a.align[l]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
101
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}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){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=bn(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Ol(t[2],"()");if(a===-2)return;if(a>-1){let s=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,s).trim(),t[3]=""}}let i=t[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],r=a[3])}else r=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),ra(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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 i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[i.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return ra(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!n||this.rules.inline.punctuation.exec(n))){let r=[...i[0]].length-1,a,s,o=r,l=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+r);(i=c.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(s=[...a].length,i[3]||i[4]){o+=s;continue}else if((i[5]||i[6])&&r%3&&!((r+s)%3)){l+=s;continue}if(o-=s,o>0)continue;s=Math.min(s,s+o+l);let u=[...i[0]][0].length,g=e.slice(0,r+i.index+u+s);if(Math.min(r,s)%2){let d=g.slice(1,-1);return{type:"em",raw:g,text:d,tokens:this.lexer.inlineTokens(d)}}let h=g.slice(2,-2);return{type:"strong",raw:g,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let i=this.rules.inline.delLDelim.exec(e);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...i[0]].length-1,a,s,o=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+r);(i=l.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(s=[...a].length,s!==r))continue;if(i[3]||i[4]){o+=s;continue}if(o-=s,o>0)continue;s=Math.min(s,s+o);let c=[...i[0]][0].length,u=e.slice(0,r+i.index+c+s),g=u.slice(r,-r);return{type:"del",raw:u,text:g,tokens:this.lexer.inlineTokens(g)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,i;if(t[2]==="@")n=t[0],i="mailto:"+n;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);n=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},pt=class Zr{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ft,this.options.tokenizer=this.options.tokenizer||new Pn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:lt,block:Xn.normal,inline:yn.normal};this.options.pedantic?(n.block=Xn.pedantic,n.inline=yn.pedantic):this.options.gfm&&(n.block=Xn.gfm,this.options.breaks?n.inline=yn.breaks:n.inline=yn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xn,inline:yn}}static lex(t,n){return new Zr(n).lex(t)}static lexInline(t,n){return new Zr(n).inlineTokens(t)}lex(t){t=t.replace(lt.carriageReturn,`
|
|
102
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],i=!1){for(this.options.pedantic&&(t=t.replace(lt.tabCharGlobal," ").replace(lt.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some(s=>(r=s.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let s=n.at(-1);r.raw.length===1&&s!==void 0?s.raw+=`
|
|
103
103
|
`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let s=n.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
|
|
104
104
|
`)?"":`
|
|
105
105
|
`)+r.raw,s.text+=`
|
|
@@ -112,7 +112,7 @@ ${u}`:u;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
112
112
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(r),i=a.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let s=n.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
|
|
113
113
|
`)?"":`
|
|
114
114
|
`)+r.raw,s.text+=`
|
|
115
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(r);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i=t,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)a=r[2]?r[2].length:0,i=i.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let s=!1,o="";for(;t;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let u=n.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,i,o)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t,i,o)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let c=t;if(this.options.extensions?.startInline){let u=1/0,g=t.slice(1),h;this.options.extensions.startInline.forEach(d=>{h=d.call({lexer:this},g),typeof h=="number"&&h>=0&&(u=Math.min(u,h))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},
|
|
115
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):n.push(r);continue}if(t){let s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i=t,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)a=r[2]?r[2].length:0,i=i.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let s=!1,o="";for(;t;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length);let u=n.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(t,i,o)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(t,i,o)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(t)){t=t.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t))){t=t.substring(l.raw.length),n.push(l);continue}let c=t;if(this.options.extensions?.startInline){let u=1/0,g=t.slice(1),h;this.options.extensions.startInline.forEach(d=>{h=d.call({lexer:this},g),typeof h=="number"&&h>=0&&(u=Math.min(u,h))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(l=this.tokenizer.inlineText(c)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},In=class{options;parser;constructor(e){this.options=e||Ft}space(e){return""}code({text:e,lang:t,escaped:n}){let i=(t||"").match(lt.notSpaceStart)?.[0],r=e.replace(lt.endingNewline,"")+`
|
|
116
116
|
`;return i?'<pre><code class="language-'+xt(i)+'">'+(n?r:xt(r,!0))+`</code></pre>
|
|
117
117
|
`:"<pre><code>"+(n?r:xt(r,!0))+`</code></pre>
|
|
118
118
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -130,8 +130,8 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
130
130
|
`}tablerow({text:e}){return`<tr>
|
|
131
131
|
${e}</tr>
|
|
132
132
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
133
|
-
`}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>${xt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let i=this.parser.parseInline(n),r=
|
|
134
|
-
Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+xt(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}},
|
|
133
|
+
`}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>${xt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let i=this.parser.parseInline(n),r=ta(e);if(r===null)return i;e=r;let a='<a href="'+e+'"';return t&&(a+=' title="'+xt(t)+'"'),a+=">"+i+"</a>",a}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=ta(e);if(r===null)return xt(n);e=r;let a=`<img src="${e}" alt="${xt(n)}"`;return t&&(a+=` title="${xt(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:xt(e.text)}},kr=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},mt=class Gr{options;renderer;textRenderer;constructor(t){this.options=t||Ft,this.options.renderer=this.options.renderer||new In,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new kr}static parse(t,n){return new Gr(n).parse(t)}static parseInline(t,n){return new Gr(n).parseInline(t)}parse(t){let n="";for(let i=0;i<t.length;i++){let r=t[i];if(this.options.extensions?.renderers?.[r.type]){let s=r,o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){n+=o||"";continue}}let a=r;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,n=this.renderer){let i="";for(let r=0;r<t.length;r++){let a=t[r];if(this.options.extensions?.renderers?.[a.type]){let o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=o||"";continue}}let s=a;switch(s.type){case"escape":{i+=n.text(s);break}case"html":{i+=n.html(s);break}case"link":{i+=n.link(s);break}case"image":{i+=n.image(s);break}case"checkbox":{i+=n.checkbox(s);break}case"strong":{i+=n.strong(s);break}case"em":{i+=n.em(s);break}case"codespan":{i+=n.codespan(s);break}case"br":{i+=n.br(s);break}case"del":{i+=n.del(s);break}case"text":{i+=n.text(s);break}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return i}},sn=class{options;block;constructor(e){this.options=e||Ft}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(){return this.block?pt.lex:pt.lexInline}provideParser(){return this.block?mt.parse:mt.parseInline}},Ya=class{defaults=br();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=mt;Renderer=In;TextRenderer=kr;Lexer=pt;Tokenizer=Pn;Hooks=sn;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{let r=i;for(let a of r.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of r.rows)for(let s of a)n=n.concat(this.walkTokens(s.tokens,t));break}case"list":{let r=i;n=n.concat(this.walkTokens(r.items,t));break}default:{let r=i;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(a=>{let s=r[a].flat(1/0);n=n.concat(this.walkTokens(s,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=t.renderers[r.name];a?t.renderers[r.name]=function(...s){let o=r.renderer.apply(this,s);return o===!1&&(o=a.apply(this,s)),o}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[r.level];a?a.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),n.renderer){let r=this.defaults.renderer||new In(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,o=n.renderer[s],l=r[s];r[s]=(...c)=>{let u=o.apply(r,c);return u===!1&&(u=l.apply(r,c)),u||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Pn(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,o=n.tokenizer[s],l=r[s];r[s]=(...c)=>{let u=o.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new sn;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,o=n.hooks[s],l=r[s];sn.passThroughHooks.has(a)?r[s]=c=>{if(this.defaults.async&&sn.passThroughHooksRespectAsync.has(a))return(async()=>{let g=await o.call(r,c);return l.call(r,g)})();let u=o.call(r,c);return l.call(r,u)}:r[s]=(...c)=>{if(this.defaults.async)return(async()=>{let g=await o.apply(r,c);return g===!1&&(g=await l.apply(r,c)),g})();let u=o.apply(r,c);return u===!1&&(u=l.apply(r,c)),u}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(s){let o=[];return o.push(a.call(this,s)),r&&(o=o.concat(r.call(this,s))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pt.lex(e,t??this.defaults)}parser(e,t){return mt.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let i={...n},r={...this.defaults,...i},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return a(new 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(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=e),r.async)return(async()=>{let s=r.hooks?await r.hooks.preprocess(t):t,o=await(r.hooks?await r.hooks.provideLexer():e?pt.lex:pt.lexInline)(s,r),l=r.hooks?await r.hooks.processAllTokens(o):o;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser():e?mt.parse:mt.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(a);try{r.hooks&&(t=r.hooks.preprocess(t));let s=(r.hooks?r.hooks.provideLexer():e?pt.lex:pt.lexInline)(t,r);r.hooks&&(s=r.hooks.processAllTokens(s)),r.walkTokens&&this.walkTokens(s,r.walkTokens);let o=(r.hooks?r.hooks.provideParser():e?mt.parse:mt.parseInline)(s,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(s){return a(s)}}}onError(e,t){return n=>{if(n.message+=`
|
|
134
|
+
Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error occurred:</p><pre>"+xt(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}},Jt=new Ya;function Me(e,t){return Jt.parse(e,t)}Me.options=Me.setOptions=function(e){return Jt.setOptions(e),Me.defaults=Jt.defaults,qa(Me.defaults),Me};Me.getDefaults=br;Me.defaults=Ft;Me.use=function(...e){return Jt.use(...e),Me.defaults=Jt.defaults,qa(Me.defaults),Me};Me.walkTokens=function(e,t){return Jt.walkTokens(e,t)};Me.parseInline=Jt.parseInline;Me.Parser=mt;Me.parser=mt.parse;Me.Renderer=In;Me.TextRenderer=kr;Me.Lexer=pt;Me.lexer=pt.lex;Me.Tokenizer=Pn;Me.Hooks=sn;Me.parse=Me;var ql=Me.options,Hl=Me.setOptions,Fl=Me.use,Dl=Me.walkTokens,Ul=Me.parseInline,Wl=Me,Zl=mt.parse,Gl=pt.lex;const ia=Object.freeze(Object.defineProperty({__proto__:null,Hooks:sn,Lexer:pt,Marked:Ya,Parser:mt,Renderer:In,TextRenderer:kr,Tokenizer:Pn,get defaults(){return Ft},getDefaults:br,lexer:Gl,marked:Me,options:ql,parse:Wl,parseInline:Ul,parser:Zl,setOptions:Hl,use:Fl,walkTokens:Dl},Symbol.toStringTag,{value:"Module"})),Ql=`/**
|
|
135
135
|
* @module worker/renderer
|
|
136
136
|
*/
|
|
137
137
|
import * as _markedModule from 'marked'
|
|
@@ -604,7 +604,10 @@ export async function handleWorkerMessageStream(msg, onChunk) {
|
|
|
604
604
|
return err
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
|
|
607
|
+
|
|
608
|
+
// Export internal helpers for unit testing of edge branches
|
|
609
|
+
export { _splitIntoSections, decodeHtmlEntitiesLocal, slugifyHeading, importModuleWithCache, ensureHljs }
|
|
610
|
+
`,Ja=`function F() {
|
|
608
611
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
609
612
|
}
|
|
610
613
|
var L = F();
|
|
@@ -2086,8 +2089,8 @@ onmessage = async (r) => {
|
|
|
2086
2089
|
postMessage({ id: e.id, error: String(s) });
|
|
2087
2090
|
}
|
|
2088
2091
|
};
|
|
2089
|
-
`,
|
|
2090
|
-
---`,3);if(t!==-1){const n=e.slice(3,t+0).trim(),i=e.slice(t+4).trimStart(),r={};return n.split(/\r?\n/).forEach(a=>{const s=a.match(/^([^:]+):\s*(.*)$/);s&&(r[s[1].trim()]=s[2].trim())}),{content:i,data:r}}}return{content:e,data:{}}}function or(e){try{if(!e&&e!==0)return"";const t=String(e),n={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};return t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(i,r)=>{if(!r)return i;if(r[0]==="#")try{return r[1]==="x"||r[1]==="X"?String.fromCharCode(parseInt(r.slice(2),16)):String.fromCharCode(parseInt(r.slice(1),10))}catch{return i}return n[r]!==void 0?n[r]:i})}catch{return String(e||"")}}const Qt=Ji&&(Ee||Ji)||void 0;function Qa(e,t){const n=String(e||"");if(!n||n.length<=t)return[n];const i=/^#{1,6}\s.*$/gm,r=[];let a;for(;(a=i.exec(n))!==null;)r.push(a.index);if(!r.length||r.length<2){const c=[];for(let u=0;u<n.length;u+=t)c.push(n.slice(u,u+t));return c}const s=[];r[0]>0&&s.push(n.slice(0,r[0]));for(let c=0;c<r.length;c++){const u=r[c],g=c+1<r.length?r[c+1]:n.length;s.push(n.slice(u,g))}const o=[];let l="";for(const c of s){if(!l&&c.length>=t){o.push(c);continue}l.length+c.length<=t?l+=c:(l&&o.push(l),l=c)}return l&&o.push(l),o}const lr=/```\s*([a-zA-Z0-9_\-+]+)?/g,Ka=new Set(["bash","sh","zsh","javascript","js","python","py","php","java","c","cpp","rust","go","ruby","perl","r","scala","swift","kotlin","cs","csharp","html","css","json","xml","yaml","yml","dockerfile","docker"]);function cr(e){try{return String(e||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}}let Ke=null;const Wl="https://cdn.jsdelivr.net/npm/highlight.js";function Zl(){Ds(),Ke=null}function Gl(e){Us(e)}async function mi(e){return await Ws(e)}async function sn(){if(Ke)return Ke;try{const e=Wl+"/lib/core.js";try{const t=await import("https://cdn.jsdelivr.net/npm/highlight.js/lib/core.js");if(t){Ke=t.default||t;try{await Jr(e,async()=>t)}catch{}}else Ke=null}catch{const n=await mi(e);n?Ke=n.default||n:Ke=null}}catch{Ke=null}return Ke}Qt&&typeof Qt.setOptions=="function"&&Qt.setOptions({gfm:!0,headerIds:!0,mangle:!1,highlighted:(e,t)=>{try{return Ke&&t&&typeof Ke.getLanguage=="function"&&Ke.getLanguage(t)?Ke.highlight(e,{language:t}).value:Ke&&typeof Ke.getLanguage=="function"&&Ke.getLanguage("plaintext")?Ke.highlight(e,{language:"plaintext"}).value:e}catch{return e}}});onmessage=async e=>{const t=e.data||{};try{if(t.type==="register"){const{name:u,url:g}=t;try{if(!await sn()){postMessage({type:"register-error",name:u,error:"hljs unavailable"});return}const d=await mi(g),p=d?d.default||d:null;if(!p)throw new Error("failed to import language module");Ke.registerLanguage(u,p),postMessage({type:"registered",name:u})}catch(h){postMessage({type:"register-error",name:u,error:String(h)})}return}if(t.type==="detect"){const u=t.md||"",g=t.supported||[],h=new Set,d=new RegExp(lr.source,lr.flags);let p;for(;p=d.exec(u);)if(p[1]){const m=String(p[1]).toLowerCase();if(!m)continue;if(m.length>=5&&m.length<=30&&/^[a-z][a-z0-9_\-+]*$/.test(m)&&h.add(m),Ka.has(m)&&h.add(m),g&&g.length)try{g.indexOf(m)!==-1&&h.add(m)}catch{}}postMessage({id:t.id,result:Array.from(h)});return}if(t.type==="stream"){const u=t.id;try{const g=Number(t.chunkSize)||65536,{content:h,data:d}=Yt(t.md||"");await sn().catch(()=>{});const p=Qa(h,g),m=new Map,f=cr;for(let w=0;w<p.length;w++){let y=p[w],_=Qt.parse(y);const b=[];_=_.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(v,S,E,P)=>{const I=Number(S);let U=P.replace(/<[^>]+>/g,"").trim();try{U=or(U)}catch{}let z=null;const O=(E||"").match(/\sid="([^"]+)"/);O&&(z=O[1]);const W=z||f(U)||"heading",H=(m.get(W)||0)+1;m.set(W,H);const M=H===1?W:W+"-"+H;b.push({level:I,text:U,id:M});const F={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},G=I<=2?"has-text-weight-bold":I<=4?"has-text-weight-semibold":"has-text-weight-normal",ie=(F[I]+" "+G).trim(),J=((E||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${M}" class="${ie}"`).trim();return`<h${I} ${J}>${P}</h${I}>`}),_=_.replace(/<img([^>]*)>/g,(v,S)=>/\bloading=/.test(S)?`<img${S}>`:/\bdata-want-lazy=/.test(S)?`<img${S}>`:`<img${S} loading="lazy">`),postMessage({id:u,type:"chunk",html:_,toc:b,index:w,isLast:w===p.length-1})}postMessage({id:u,type:"done",meta:d||{}})}catch(g){postMessage({id:t.id,error:String(g)})}return}const{id:n,md:i}=t,{content:r,data:a}=Yt(i||"");await sn().catch(()=>{});let s=Qt.parse(r);const o=[],l=new Map,c=cr;s=s.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(u,g,h,d)=>{const p=Number(g);let m=d.replace(/<[^>]+>/g,"").trim();try{m=or(m)}catch{}let f=null;const w=(h||"").match(/\sid="([^"]+)"/);w&&(f=w[1]);const y=f||c(m)||"heading",b=(l.get(y)||0)+1;l.set(y,b);const v=b===1?y:y+"-"+b;o.push({level:p,text:m,id:v});const S={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},E=p<=2?"has-text-weight-bold":p<=4?"has-text-weight-semibold":"has-text-weight-normal",P=(S[p]+" "+E).trim(),U=((h||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${v}" class="${P}"`).trim();return`<h${p} ${U}>${d}</h${p}>`}),s=s.replace(/<img([^>]*)>/g,(u,g)=>/\bloading=/.test(g)?`<img${g}>`:/\bdata-want-lazy=/.test(g)?`<img${g}>`:`<img${g} loading="lazy">`),postMessage({id:n,result:{html:s,meta:a||{},toc:o}})}catch(n){postMessage({id:t.id,error:String(n)})}};async function yi(e){try{if(e&&e.type==="register"){const{name:l,url:c}=e;try{if(!await sn())return{type:"register-error",name:l,error:"hljs unavailable"};const g=await mi(c),h=g?g.default||g:null;return h?(Ke.registerLanguage(l,h),{type:"registered",name:l}):{type:"register-error",name:l,error:"failed to import language module"}}catch(u){return{type:"register-error",name:l,error:String(u)}}}if(e&&e.type==="detect"){const l=e.md||"",c=e.supported||[],u=new Set,g=new RegExp(lr.source,lr.flags);let h;for(;h=g.exec(l);)if(h[1]){const d=String(h[1]).toLowerCase();if(!d)continue;if(d.length>=5&&d.length<=30&&/^[a-z][a-z0-9_\-+]*$/.test(d)&&u.add(d),Ka.has(d)&&u.add(d),c&&c.length)try{c.indexOf(d)!==-1&&u.add(d)}catch{}}return{id:e.id,result:Array.from(u)}}const t=e&&e.id,{content:n,data:i}=Yt(e&&e.md||"");await sn().catch(()=>{});let r=Qt.parse(n);const a=[],s=new Map,o=cr;return r=r.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(l,c,u,g)=>{const h=Number(c);let d=g.replace(/<[^>]+>/g,"").trim();try{d=or(d)}catch{}let p=null;const m=(u||"").match(/\sid="([^"]+)"/);m&&(p=m[1]);const f=p||o(d)||"heading",y=(s.get(f)||0)+1;s.set(f,y);const _=y===1?f:f+"-"+y;a.push({level:h,text:d,id:_});const b={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},v=h<=2?"has-text-weight-bold":h<=4?"has-text-weight-semibold":"has-text-weight-normal",S=(b[h]+" "+v).trim(),P=((u||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${_}" class="${S}"`).trim();return`<h${h} ${P}>${g}</h${h}>`}),r=r.replace(/<img([^>]*)>/g,(l,c)=>/\bloading=/.test(c)?`<img${c}>`:/\bdata-want-lazy=/.test(c)?`<img${c}>`:`<img${c} loading="lazy">`),{id:t,result:{html:r,meta:i||{},toc:a}}}catch(t){return{id:e&&e.id,error:String(t)}}}async function Ur(e,t){try{if(!e||e.type!=="stream"){const u=await yi(e);return typeof t=="function"&&t(u),u}const n=e.id,i=Number(e.chunkSize)||64*1024,{content:r,data:a}=Yt(e.md||"");await sn().catch(()=>{});const s=Qa(r,i),o=new Map,l=cr;for(let u=0;u<s.length;u++){let g=s[u],h=Qt.parse(g);const d=[];h=h.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(m,f,w,y)=>{const _=Number(f);let b=y.replace(/<[^>]+>/g,"").trim();try{b=or(b)}catch{}let v=null;const S=(w||"").match(/\sid="([^"]+)"/);S&&(v=S[1]);const E=v||l(b)||"heading",I=(o.get(E)||0)+1;o.set(E,I);const U=I===1?E:E+"-"+I;d.push({level:_,text:b,id:U});const z={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},O=_<=2?"has-text-weight-bold":_<=4?"has-text-weight-semibold":"has-text-weight-normal",W=(z[_]+" "+O).trim(),H=((w||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${U}" class="${W}"`).trim();return`<h${_} ${H}>${y}</h${_}>`}),h=h.replace(/<img([^>]*)>/g,(m,f)=>/\bloading=/.test(f)?`<img${f}>`:/\bdata-want-lazy=/.test(f)?`<img${f}>`:`<img${f} loading="lazy">`);const p={id:n,type:"chunk",html:h,toc:d,index:u,isLast:u===s.length-1};typeof t=="function"&&t(p)}const c={id:n,type:"done",meta:a||{}};return typeof t=="function"&&t(c),c}catch(n){const i={id:e&&e.id,error:String(n)};return typeof t=="function"&&t(i),i}}const Xl=Object.freeze(Object.defineProperty({__proto__:null,clearRendererImportCache:Zl,handleWorkerMessage:yi,handleWorkerMessageStream:Ur,setRendererImportNegativeCacheTTL:Gl},Symbol.toStringTag,{value:"Module"})),Jn={100:"💯",1234:"🔢",grinning:"😀",grimacing:"😬",grin:"😁",joy:"😂",rofl:"🤣",partying:"🥳",smiley:"😃",smile:"😄",sweat_smile:"😅",laughing:"😆",innocent:"😇",wink:"😉",blush:"😊",slightly_smiling_face:"🙂",upside_down_face:"🙃",relaxed:"☺️",yum:"😋",relieved:"😌",heart_eyes:"😍",smiling_face_with_three_hearts:"🥰",kissing_heart:"😘",kissing:"😗",kissing_smiling_eyes:"😙",kissing_closed_eyes:"😚",stuck_out_tongue_winking_eye:"😜",zany:"🤪",raised_eyebrow:"🤨",monocle:"🧐",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue:"😛",money_mouth_face:"🤑",nerd_face:"🤓",sunglasses:"😎",star_struck:"🤩",clown_face:"🤡",cowboy_hat_face:"🤠",hugs:"🤗",smirk:"😏",no_mouth:"😶",neutral_face:"😐",expressionless:"😑",unamused:"😒",roll_eyes:"🙄",thinking:"🤔",lying_face:"🤥",hand_over_mouth:"🤭",shushing:"🤫",symbols_over_mouth:"🤬",exploding_head:"🤯",flushed:"😳",disappointed:"😞",worried:"😟",angry:"😠",rage:"😡",pensive:"😔",confused:"😕",slightly_frowning_face:"🙁",frowning_face:"☹",persevere:"😣",confounded:"😖",tired_face:"😫",weary:"😩",pleading:"🥺",triumph:"😤",open_mouth:"😮",scream:"😱",fearful:"😨",cold_sweat:"😰",hushed:"😯",frowning:"😦",anguished:"😧",cry:"😢",disappointed_relieved:"😥",drooling_face:"🤤",sleepy:"😪",sweat:"😓",hot:"🥵",cold:"🥶",sob:"😭",dizzy_face:"😵",astonished:"😲",zipper_mouth_face:"🤐",nauseated_face:"🤢",sneezing_face:"🤧",vomiting:"🤮",mask:"😷",face_with_thermometer:"🤒",face_with_head_bandage:"🤕",woozy:"🥴",sleeping:"😴",zzz:"💤",poop:"💩",smiling_imp:"😈",imp:"👿",japanese_ogre:"👹",japanese_goblin:"👺",skull:"💀",ghost:"👻",alien:"👽",robot:"🤖",smiley_cat:"😺",smile_cat:"😸",joy_cat:"😹",heart_eyes_cat:"😻",smirk_cat:"😼",kissing_cat:"😽",scream_cat:"🙀",crying_cat_face:"😿",pouting_cat:"😾",palms_up:"🤲",raised_hands:"🙌",clap:"👏",wave:"👋",call_me_hand:"🤙","+1":"👍","-1":"👎",facepunch:"👊",fist:"✊",fist_left:"🤛",fist_right:"🤜",v:"✌",ok_hand:"👌",raised_hand:"✋",raised_back_of_hand:"🤚",open_hands:"👐",muscle:"💪",pray:"🙏",foot:"🦶",leg:"🦵",handshake:"🤝",point_up:"☝",point_up_2:"👆",point_down:"👇",point_left:"👈",point_right:"👉",fu:"🖕",raised_hand_with_fingers_splayed:"🖐",love_you:"🤟",metal:"🤘",crossed_fingers:"🤞",vulcan_salute:"🖖",writing_hand:"✍",selfie:"🤳",nail_care:"💅",lips:"👄",tooth:"🦷",tongue:"👅",ear:"👂",nose:"👃",eye:"👁",eyes:"👀",brain:"🧠",bust_in_silhouette:"👤",busts_in_silhouette:"👥",speaking_head:"🗣",baby:"👶",child:"🧒",boy:"👦",girl:"👧",adult:"🧑",man:"👨",woman:"👩",blonde_woman:"👱♀️",blonde_man:"👱",bearded_person:"🧔",older_adult:"🧓",older_man:"👴",older_woman:"👵",man_with_gua_pi_mao:"👲",woman_with_headscarf:"🧕",woman_with_turban:"👳♀️",man_with_turban:"👳",policewoman:"👮♀️",policeman:"👮",construction_worker_woman:"👷♀️",construction_worker_man:"👷",guardswoman:"💂♀️",guardsman:"💂",female_detective:"🕵️♀️",male_detective:"🕵",woman_health_worker:"👩⚕️",man_health_worker:"👨⚕️",woman_farmer:"👩🌾",man_farmer:"👨🌾",woman_cook:"👩🍳",man_cook:"👨🍳",woman_student:"👩🎓",man_student:"👨🎓",woman_singer:"👩🎤",man_singer:"👨🎤",woman_teacher:"👩🏫",man_teacher:"👨🏫",woman_factory_worker:"👩🏭",man_factory_worker:"👨🏭",woman_technologist:"👩💻",man_technologist:"👨💻",woman_office_worker:"👩💼",man_office_worker:"👨💼",woman_mechanic:"👩🔧",man_mechanic:"👨🔧",woman_scientist:"👩🔬",man_scientist:"👨🔬",woman_artist:"👩🎨",man_artist:"👨🎨",woman_firefighter:"👩🚒",man_firefighter:"👨🚒",woman_pilot:"👩✈️",man_pilot:"👨✈️",woman_astronaut:"👩🚀",man_astronaut:"👨🚀",woman_judge:"👩⚖️",man_judge:"👨⚖️",woman_superhero:"🦸♀️",man_superhero:"🦸♂️",woman_supervillain:"🦹♀️",man_supervillain:"🦹♂️",mrs_claus:"🤶",santa:"🎅",sorceress:"🧙♀️",wizard:"🧙♂️",woman_elf:"🧝♀️",man_elf:"🧝♂️",woman_vampire:"🧛♀️",man_vampire:"🧛♂️",woman_zombie:"🧟♀️",man_zombie:"🧟♂️",woman_genie:"🧞♀️",man_genie:"🧞♂️",mermaid:"🧜♀️",merman:"🧜♂️",woman_fairy:"🧚♀️",man_fairy:"🧚♂️",angel:"👼",pregnant_woman:"🤰",breastfeeding:"🤱",princess:"👸",prince:"🤴",bride_with_veil:"👰",man_in_tuxedo:"🤵",running_woman:"🏃♀️",running_man:"🏃",walking_woman:"🚶♀️",walking_man:"🚶",dancer:"💃",man_dancing:"🕺",dancing_women:"👯",dancing_men:"👯♂️",couple:"👫",two_men_holding_hands:"👬",two_women_holding_hands:"👭",bowing_woman:"🙇♀️",bowing_man:"🙇",man_facepalming:"🤦♂️",woman_facepalming:"🤦♀️",woman_shrugging:"🤷",man_shrugging:"🤷♂️",tipping_hand_woman:"💁",tipping_hand_man:"💁♂️",no_good_woman:"🙅",no_good_man:"🙅♂️",ok_woman:"🙆",ok_man:"🙆♂️",raising_hand_woman:"🙋",raising_hand_man:"🙋♂️",pouting_woman:"🙎",pouting_man:"🙎♂️",frowning_woman:"🙍",frowning_man:"🙍♂️",haircut_woman:"💇",haircut_man:"💇♂️",massage_woman:"💆",massage_man:"💆♂️",woman_in_steamy_room:"🧖♀️",man_in_steamy_room:"🧖♂️",couple_with_heart_woman_man:"💑",couple_with_heart_woman_woman:"👩❤️👩",couple_with_heart_man_man:"👨❤️👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩❤️💋👩",couplekiss_man_man:"👨❤️💋👨",family_man_woman_boy:"👪",family_man_woman_girl:"👨👩👧",family_man_woman_girl_boy:"👨👩👧👦",family_man_woman_boy_boy:"👨👩👦👦",family_man_woman_girl_girl:"👨👩👧👧",family_woman_woman_boy:"👩👩👦",family_woman_woman_girl:"👩👩👧",family_woman_woman_girl_boy:"👩👩👧👦",family_woman_woman_boy_boy:"👩👩👦👦",family_woman_woman_girl_girl:"👩👩👧👧",family_man_man_boy:"👨👨👦",family_man_man_girl:"👨👨👧",family_man_man_girl_boy:"👨👨👧👦",family_man_man_boy_boy:"👨👨👦👦",family_man_man_girl_girl:"👨👨👧👧",family_woman_boy:"👩👦",family_woman_girl:"👩👧",family_woman_girl_boy:"👩👧👦",family_woman_boy_boy:"👩👦👦",family_woman_girl_girl:"👩👧👧",family_man_boy:"👨👦",family_man_girl:"👨👧",family_man_girl_boy:"👨👧👦",family_man_boy_boy:"👨👦👦",family_man_girl_girl:"👨👧👧",yarn:"🧶",thread:"🧵",coat:"🧥",labcoat:"🥼",womans_clothes:"👚",tshirt:"👕",jeans:"👖",necktie:"👔",dress:"👗",bikini:"👙",kimono:"👘",lipstick:"💄",kiss:"💋",footprints:"👣",flat_shoe:"🥿",high_heel:"👠",sandal:"👡",boot:"👢",mans_shoe:"👞",athletic_shoe:"👟",hiking_boot:"🥾",socks:"🧦",gloves:"🧤",scarf:"🧣",womans_hat:"👒",tophat:"🎩",billed_hat:"🧢",rescue_worker_helmet:"⛑",mortar_board:"🎓",crown:"👑",school_satchel:"🎒",luggage:"🧳",pouch:"👝",purse:"👛",handbag:"👜",briefcase:"💼",eyeglasses:"👓",dark_sunglasses:"🕶",goggles:"🥽",ring:"💍",closed_umbrella:"🌂",dog:"🐶",cat:"🐱",mouse:"🐭",hamster:"🐹",rabbit:"🐰",fox_face:"🦊",bear:"🐻",panda_face:"🐼",koala:"🐨",tiger:"🐯",lion:"🦁",cow:"🐮",pig:"🐷",pig_nose:"🐽",frog:"🐸",squid:"🦑",octopus:"🐙",shrimp:"🦐",monkey_face:"🐵",gorilla:"🦍",see_no_evil:"🙈",hear_no_evil:"🙉",speak_no_evil:"🙊",monkey:"🐒",chicken:"🐔",penguin:"🐧",bird:"🐦",baby_chick:"🐤",hatching_chick:"🐣",hatched_chick:"🐥",duck:"🦆",eagle:"🦅",owl:"🦉",bat:"🦇",wolf:"🐺",boar:"🐗",horse:"🐴",unicorn:"🦄",honeybee:"🐝",bug:"🐛",butterfly:"🦋",snail:"🐌",beetle:"🐞",ant:"🐜",grasshopper:"🦗",spider:"🕷",scorpion:"🦂",crab:"🦀",snake:"🐍",lizard:"🦎","t-rex":"🦖",sauropod:"🦕",turtle:"🐢",tropical_fish:"🐠",fish:"🐟",blowfish:"🐡",dolphin:"🐬",shark:"🦈",whale:"🐳",whale2:"🐋",crocodile:"🐊",leopard:"🐆",zebra:"🦓",tiger2:"🐅",water_buffalo:"🐃",ox:"🐂",cow2:"🐄",deer:"🦌",dromedary_camel:"🐪",camel:"🐫",giraffe:"🦒",elephant:"🐘",rhinoceros:"🦏",goat:"🐐",ram:"🐏",sheep:"🐑",racehorse:"🐎",pig2:"🐖",rat:"🐀",mouse2:"🐁",rooster:"🐓",turkey:"🦃",dove:"🕊",dog2:"🐕",poodle:"🐩",cat2:"🐈",rabbit2:"🐇",chipmunk:"🐿",hedgehog:"🦔",raccoon:"🦝",llama:"🦙",hippopotamus:"🦛",kangaroo:"🦘",badger:"🦡",swan:"🦢",peacock:"🦚",parrot:"🦜",lobster:"🦞",mosquito:"🦟",paw_prints:"🐾",dragon:"🐉",dragon_face:"🐲",cactus:"🌵",christmas_tree:"🎄",evergreen_tree:"🌲",deciduous_tree:"🌳",palm_tree:"🌴",seedling:"🌱",herb:"🌿",shamrock:"☘",four_leaf_clover:"🍀",bamboo:"🎍",tanabata_tree:"🎋",leaves:"🍃",fallen_leaf:"🍂",maple_leaf:"🍁",ear_of_rice:"🌾",hibiscus:"🌺",sunflower:"🌻",rose:"🌹",wilted_flower:"🥀",tulip:"🌷",blossom:"🌼",cherry_blossom:"🌸",bouquet:"💐",mushroom:"🍄",chestnut:"🌰",jack_o_lantern:"🎃",shell:"🐚",spider_web:"🕸",earth_americas:"🌎",earth_africa:"🌍",earth_asia:"🌏",full_moon:"🌕",waning_gibbous_moon:"🌖",last_quarter_moon:"🌗",waning_crescent_moon:"🌘",new_moon:"🌑",waxing_crescent_moon:"🌒",first_quarter_moon:"🌓",waxing_gibbous_moon:"🌔",new_moon_with_face:"🌚",full_moon_with_face:"🌝",first_quarter_moon_with_face:"🌛",last_quarter_moon_with_face:"🌜",sun_with_face:"🌞",crescent_moon:"🌙",star:"⭐",star2:"🌟",dizzy:"💫",sparkles:"✨",comet:"☄",sunny:"☀️",sun_behind_small_cloud:"🌤",partly_sunny:"⛅",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",cloud:"☁️",cloud_with_rain:"🌧",cloud_with_lightning_and_rain:"⛈",cloud_with_lightning:"🌩",zap:"⚡",fire:"🔥",boom:"💥",snowflake:"❄️",cloud_with_snow:"🌨",snowman:"⛄",snowman_with_snow:"☃",wind_face:"🌬",dash:"💨",tornado:"🌪",fog:"🌫",open_umbrella:"☂",umbrella:"☔",droplet:"💧",sweat_drops:"💦",ocean:"🌊",green_apple:"🍏",apple:"🍎",pear:"🍐",tangerine:"🍊",lemon:"🍋",banana:"🍌",watermelon:"🍉",grapes:"🍇",strawberry:"🍓",melon:"🍈",cherries:"🍒",peach:"🍑",pineapple:"🍍",coconut:"🥥",kiwi_fruit:"🥝",mango:"🥭",avocado:"🥑",broccoli:"🥦",tomato:"🍅",eggplant:"🍆",cucumber:"🥒",carrot:"🥕",hot_pepper:"🌶",potato:"🥔",corn:"🌽",leafy_greens:"🥬",sweet_potato:"🍠",peanuts:"🥜",honey_pot:"🍯",croissant:"🥐",bread:"🍞",baguette_bread:"🥖",bagel:"🥯",pretzel:"🥨",cheese:"🧀",egg:"🥚",bacon:"🥓",steak:"🥩",pancakes:"🥞",poultry_leg:"🍗",meat_on_bone:"🍖",bone:"🦴",fried_shrimp:"🍤",fried_egg:"🍳",hamburger:"🍔",fries:"🍟",stuffed_flatbread:"🥙",hotdog:"🌭",pizza:"🍕",sandwich:"🥪",canned_food:"🥫",spaghetti:"🍝",taco:"🌮",burrito:"🌯",green_salad:"🥗",shallow_pan_of_food:"🥘",ramen:"🍜",stew:"🍲",fish_cake:"🍥",fortune_cookie:"🥠",sushi:"🍣",bento:"🍱",curry:"🍛",rice_ball:"🍙",rice:"🍚",rice_cracker:"🍘",oden:"🍢",dango:"🍡",shaved_ice:"🍧",ice_cream:"🍨",icecream:"🍦",pie:"🥧",cake:"🍰",cupcake:"🧁",moon_cake:"🥮",birthday:"🎂",custard:"🍮",candy:"🍬",lollipop:"🍭",chocolate_bar:"🍫",popcorn:"🍿",dumpling:"🥟",doughnut:"🍩",cookie:"🍪",milk_glass:"🥛",beer:"🍺",beers:"🍻",clinking_glasses:"🥂",wine_glass:"🍷",tumbler_glass:"🥃",cocktail:"🍸",tropical_drink:"🍹",champagne:"🍾",sake:"🍶",tea:"🍵",cup_with_straw:"🥤",coffee:"☕",baby_bottle:"🍼",salt:"🧂",spoon:"🥄",fork_and_knife:"🍴",plate_with_cutlery:"🍽",bowl_with_spoon:"🥣",takeout_box:"🥡",chopsticks:"🥢",soccer:"⚽",basketball:"🏀",football:"🏈",baseball:"⚾",softball:"🥎",tennis:"🎾",volleyball:"🏐",rugby_football:"🏉",flying_disc:"🥏","8ball":"🎱",golf:"⛳",golfing_woman:"🏌️♀️",golfing_man:"🏌",ping_pong:"🏓",badminton:"🏸",goal_net:"🥅",ice_hockey:"🏒",field_hockey:"🏑",lacrosse:"🥍",cricket:"🏏",ski:"🎿",skier:"⛷",snowboarder:"🏂",person_fencing:"🤺",women_wrestling:"🤼♀️",men_wrestling:"🤼♂️",woman_cartwheeling:"🤸♀️",man_cartwheeling:"🤸♂️",woman_playing_handball:"🤾♀️",man_playing_handball:"🤾♂️",ice_skate:"⛸",curling_stone:"🥌",skateboard:"🛹",sled:"🛷",bow_and_arrow:"🏹",fishing_pole_and_fish:"🎣",boxing_glove:"🥊",martial_arts_uniform:"🥋",rowing_woman:"🚣♀️",rowing_man:"🚣",climbing_woman:"🧗♀️",climbing_man:"🧗♂️",swimming_woman:"🏊♀️",swimming_man:"🏊",woman_playing_water_polo:"🤽♀️",man_playing_water_polo:"🤽♂️",woman_in_lotus_position:"🧘♀️",man_in_lotus_position:"🧘♂️",surfing_woman:"🏄♀️",surfing_man:"🏄",bath:"🛀",basketball_woman:"⛹️♀️",basketball_man:"⛹",weight_lifting_woman:"🏋️♀️",weight_lifting_man:"🏋",biking_woman:"🚴♀️",biking_man:"🚴",mountain_biking_woman:"🚵♀️",mountain_biking_man:"🚵",horse_racing:"🏇",business_suit_levitating:"🕴",trophy:"🏆",running_shirt_with_sash:"🎽",medal_sports:"🏅",medal_military:"🎖","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉",reminder_ribbon:"🎗",rosette:"🏵",ticket:"🎫",tickets:"🎟",performing_arts:"🎭",art:"🎨",circus_tent:"🎪",woman_juggling:"🤹♀️",man_juggling:"🤹♂️",microphone:"🎤",headphones:"🎧",musical_score:"🎼",musical_keyboard:"🎹",drum:"🥁",saxophone:"🎷",trumpet:"🎺",guitar:"🎸",violin:"🎻",clapper:"🎬",video_game:"🎮",space_invader:"👾",dart:"🎯",game_die:"🎲",chess_pawn:"♟",slot_machine:"🎰",jigsaw:"🧩",bowling:"🎳",red_car:"🚗",taxi:"🚕",blue_car:"🚙",bus:"🚌",trolleybus:"🚎",racing_car:"🏎",police_car:"🚓",ambulance:"🚑",fire_engine:"🚒",minibus:"🚐",truck:"🚚",articulated_lorry:"🚛",tractor:"🚜",kick_scooter:"🛴",motorcycle:"🏍",bike:"🚲",motor_scooter:"🛵",rotating_light:"🚨",oncoming_police_car:"🚔",oncoming_bus:"🚍",oncoming_automobile:"🚘",oncoming_taxi:"🚖",aerial_tramway:"🚡",mountain_cableway:"🚠",suspension_railway:"🚟",railway_car:"🚃",train:"🚋",monorail:"🚝",bullettrain_side:"🚄",bullettrain_front:"🚅",light_rail:"🚈",mountain_railway:"🚞",steam_locomotive:"🚂",train2:"🚆",metro:"🚇",tram:"🚊",station:"🚉",flying_saucer:"🛸",helicopter:"🚁",small_airplane:"🛩",airplane:"✈️",flight_departure:"🛫",flight_arrival:"🛬",sailboat:"⛵",motor_boat:"🛥",speedboat:"🚤",ferry:"⛴",passenger_ship:"🛳",rocket:"🚀",artificial_satellite:"🛰",seat:"💺",canoe:"🛶",anchor:"⚓",construction:"🚧",fuelpump:"⛽",busstop:"🚏",vertical_traffic_light:"🚦",traffic_light:"🚥",checkered_flag:"🏁",ship:"🚢",ferris_wheel:"🎡",roller_coaster:"🎢",carousel_horse:"🎠",building_construction:"🏗",foggy:"🌁",tokyo_tower:"🗼",factory:"🏭",fountain:"⛲",rice_scene:"🎑",mountain:"⛰",mountain_snow:"🏔",mount_fuji:"🗻",volcano:"🌋",japan:"🗾",camping:"🏕",tent:"⛺",national_park:"🏞",motorway:"🛣",railway_track:"🛤",sunrise:"🌅",sunrise_over_mountains:"🌄",desert:"🏜",beach_umbrella:"🏖",desert_island:"🏝",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",night_with_stars:"🌃",bridge_at_night:"🌉",milky_way:"🌌",stars:"🌠",sparkler:"🎇",fireworks:"🎆",rainbow:"🌈",houses:"🏘",european_castle:"🏰",japanese_castle:"🏯",stadium:"🏟",statue_of_liberty:"🗽",house:"🏠",house_with_garden:"🏡",derelict_house:"🏚",office:"🏢",department_store:"🏬",post_office:"🏣",european_post_office:"🏤",hospital:"🏥",bank:"🏦",hotel:"🏨",convenience_store:"🏪",school:"🏫",love_hotel:"🏩",wedding:"💒",classical_building:"🏛",church:"⛪",mosque:"🕌",synagogue:"🕍",kaaba:"🕋",shinto_shrine:"⛩",watch:"⌚",iphone:"📱",calling:"📲",computer:"💻",keyboard:"⌨",desktop_computer:"🖥",printer:"🖨",computer_mouse:"🖱",trackball:"🖲",joystick:"🕹",clamp:"🗜",minidisc:"💽",floppy_disk:"💾",cd:"💿",dvd:"📀",vhs:"📼",camera:"📷",camera_flash:"📸",video_camera:"📹",movie_camera:"🎥",film_projector:"📽",film_strip:"🎞",telephone_receiver:"📞",phone:"☎️",pager:"📟",fax:"📠",tv:"📺",radio:"📻",studio_microphone:"🎙",level_slider:"🎚",control_knobs:"🎛",compass:"🧭",stopwatch:"⏱",timer_clock:"⏲",alarm_clock:"⏰",mantelpiece_clock:"🕰",hourglass_flowing_sand:"⏳",hourglass:"⌛",satellite:"📡",battery:"🔋",electric_plug:"🔌",bulb:"💡",flashlight:"🔦",candle:"🕯",fire_extinguisher:"🧯",wastebasket:"🗑",oil_drum:"🛢",money_with_wings:"💸",dollar:"💵",yen:"💴",euro:"💶",pound:"💷",moneybag:"💰",credit_card:"💳",gem:"💎",balance_scale:"⚖",toolbox:"🧰",wrench:"🔧",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",pick:"⛏",nut_and_bolt:"🔩",gear:"⚙",brick:"🧱",chains:"⛓",magnet:"🧲",gun:"🔫",bomb:"💣",firecracker:"🧨",hocho:"🔪",dagger:"🗡",crossed_swords:"⚔",shield:"🛡",smoking:"🚬",skull_and_crossbones:"☠",coffin:"⚰",funeral_urn:"⚱",amphora:"🏺",crystal_ball:"🔮",prayer_beads:"📿",nazar_amulet:"🧿",barber:"💈",alembic:"⚗",telescope:"🔭",microscope:"🔬",hole:"🕳",pill:"💊",syringe:"💉",dna:"🧬",microbe:"🦠",petri_dish:"🧫",test_tube:"🧪",thermometer:"🌡",broom:"🧹",basket:"🧺",toilet_paper:"🧻",label:"🏷",bookmark:"🔖",toilet:"🚽",shower:"🚿",bathtub:"🛁",soap:"🧼",sponge:"🧽",lotion_bottle:"🧴",key:"🔑",old_key:"🗝",couch_and_lamp:"🛋",sleeping_bed:"🛌",bed:"🛏",door:"🚪",bellhop_bell:"🛎",teddy_bear:"🧸",framed_picture:"🖼",world_map:"🗺",parasol_on_ground:"⛱",moyai:"🗿",shopping:"🛍",shopping_cart:"🛒",balloon:"🎈",flags:"🎏",ribbon:"🎀",gift:"🎁",confetti_ball:"🎊",tada:"🎉",dolls:"🎎",wind_chime:"🎐",crossed_flags:"🎌",izakaya_lantern:"🏮",red_envelope:"🧧",email:"✉️",envelope_with_arrow:"📩",incoming_envelope:"📨","e-mail":"📧",love_letter:"💌",postbox:"📮",mailbox_closed:"📪",mailbox:"📫",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",package:"📦",postal_horn:"📯",inbox_tray:"📥",outbox_tray:"📤",scroll:"📜",page_with_curl:"📃",bookmark_tabs:"📑",receipt:"🧾",bar_chart:"📊",chart_with_upwards_trend:"📈",chart_with_downwards_trend:"📉",page_facing_up:"📄",date:"📅",calendar:"📆",spiral_calendar:"🗓",card_index:"📇",card_file_box:"🗃",ballot_box:"🗳",file_cabinet:"🗄",clipboard:"📋",spiral_notepad:"🗒",file_folder:"📁",open_file_folder:"📂",card_index_dividers:"🗂",newspaper_roll:"🗞",newspaper:"📰",notebook:"📓",closed_book:"📕",green_book:"📗",blue_book:"📘",orange_book:"📙",notebook_with_decorative_cover:"📔",ledger:"📒",books:"📚",open_book:"📖",safety_pin:"🧷",link:"🔗",paperclip:"📎",paperclips:"🖇",scissors:"✂️",triangular_ruler:"📐",straight_ruler:"📏",abacus:"🧮",pushpin:"📌",round_pushpin:"📍",triangular_flag_on_post:"🚩",white_flag:"🏳",black_flag:"🏴",rainbow_flag:"🏳️🌈",closed_lock_with_key:"🔐",lock:"🔒",unlock:"🔓",lock_with_ink_pen:"🔏",pen:"🖊",fountain_pen:"🖋",black_nib:"✒️",memo:"📝",pencil2:"✏️",crayon:"🖍",paintbrush:"🖌",mag:"🔍",mag_right:"🔎",heart:"❤️",orange_heart:"🧡",yellow_heart:"💛",green_heart:"💚",blue_heart:"💙",purple_heart:"💜",black_heart:"🖤",broken_heart:"💔",heavy_heart_exclamation:"❣",two_hearts:"💕",revolving_hearts:"💞",heartbeat:"💓",heartpulse:"💗",sparkling_heart:"💖",cupid:"💘",gift_heart:"💝",heart_decoration:"💟",peace_symbol:"☮",latin_cross:"✝",star_and_crescent:"☪",om:"🕉",wheel_of_dharma:"☸",star_of_david:"✡",six_pointed_star:"🔯",menorah:"🕎",yin_yang:"☯",orthodox_cross:"☦",place_of_worship:"🛐",ophiuchus:"⛎",aries:"♈",taurus:"♉",gemini:"♊",cancer:"♋",leo:"♌",virgo:"♍",libra:"♎",scorpius:"♏",sagittarius:"♐",capricorn:"♑",aquarius:"♒",pisces:"♓",id:"🆔",atom_symbol:"⚛",u7a7a:"🈳",u5272:"🈹",radioactive:"☢",biohazard:"☣",mobile_phone_off:"📴",vibration_mode:"📳",u6709:"🈶",u7121:"🈚",u7533:"🈸",u55b6:"🈺",u6708:"🈷️",eight_pointed_black_star:"✴️",vs:"🆚",accept:"🉑",white_flower:"💮",ideograph_advantage:"🉐",secret:"㊙️",congratulations:"㊗️",u5408:"🈴",u6e80:"🈵",u7981:"🈲",a:"🅰️",b:"🅱️",ab:"🆎",cl:"🆑",o2:"🅾️",sos:"🆘",no_entry:"⛔",name_badge:"📛",no_entry_sign:"🚫",x:"❌",o:"⭕",stop_sign:"🛑",anger:"💢",hotsprings:"♨️",no_pedestrians:"🚷",do_not_litter:"🚯",no_bicycles:"🚳","non-potable_water":"🚱",underage:"🔞",no_mobile_phones:"📵",exclamation:"❗",grey_exclamation:"❕",question:"❓",grey_question:"❔",bangbang:"‼️",interrobang:"⁉️",low_brightness:"🔅",high_brightness:"🔆",trident:"🔱",fleur_de_lis:"⚜",part_alternation_mark:"〽️",warning:"⚠️",children_crossing:"🚸",beginner:"🔰",recycle:"♻️",u6307:"🈯",chart:"💹",sparkle:"❇️",eight_spoked_asterisk:"✳️",negative_squared_cross_mark:"❎",white_check_mark:"✅",diamond_shape_with_a_dot_inside:"💠",cyclone:"🌀",loop:"➿",globe_with_meridians:"🌐",m:"Ⓜ️",atm:"🏧",sa:"🈂️",passport_control:"🛂",customs:"🛃",baggage_claim:"🛄",left_luggage:"🛅",wheelchair:"♿",no_smoking:"🚭",wc:"🚾",parking:"🅿️",potable_water:"🚰",mens:"🚹",womens:"🚺",baby_symbol:"🚼",restroom:"🚻",put_litter_in_its_place:"🚮",cinema:"🎦",signal_strength:"📶",koko:"🈁",ng:"🆖",ok:"🆗",up:"🆙",cool:"🆒",new:"🆕",free:"🆓",zero:"0️⃣",one:"1️⃣",two:"2️⃣",three:"3️⃣",four:"4️⃣",five:"5️⃣",six:"6️⃣",seven:"7️⃣",eight:"8️⃣",nine:"9️⃣",keycap_ten:"🔟",asterisk:"*⃣",eject_button:"⏏️",arrow_forward:"▶️",pause_button:"⏸",next_track_button:"⏭",stop_button:"⏹",record_button:"⏺",play_or_pause_button:"⏯",previous_track_button:"⏮",fast_forward:"⏩",rewind:"⏪",twisted_rightwards_arrows:"🔀",repeat:"🔁",repeat_one:"🔂",arrow_backward:"◀️",arrow_up_small:"🔼",arrow_down_small:"🔽",arrow_double_up:"⏫",arrow_double_down:"⏬",arrow_right:"➡️",arrow_left:"⬅️",arrow_up:"⬆️",arrow_down:"⬇️",arrow_upper_right:"↗️",arrow_lower_right:"↘️",arrow_lower_left:"↙️",arrow_upper_left:"↖️",arrow_up_down:"↕️",left_right_arrow:"↔️",arrows_counterclockwise:"🔄",arrow_right_hook:"↪️",leftwards_arrow_with_hook:"↩️",arrow_heading_up:"⤴️",arrow_heading_down:"⤵️",hash:"#️⃣",information_source:"ℹ️",abc:"🔤",abcd:"🔡",capital_abcd:"🔠",symbols:"🔣",musical_note:"🎵",notes:"🎶",wavy_dash:"〰️",curly_loop:"➰",heavy_check_mark:"✔️",arrows_clockwise:"🔃",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",heavy_multiplication_x:"✖️",infinity:"♾",heavy_dollar_sign:"💲",currency_exchange:"💱",copyright:"©️",registered:"®️",tm:"™️",end:"🔚",back:"🔙",on:"🔛",top:"🔝",soon:"🔜",ballot_box_with_check:"☑️",radio_button:"🔘",white_circle:"⚪",black_circle:"⚫",red_circle:"🔴",large_blue_circle:"🔵",small_orange_diamond:"🔸",small_blue_diamond:"🔹",large_orange_diamond:"🔶",large_blue_diamond:"🔷",small_red_triangle:"🔺",black_small_square:"▪️",white_small_square:"▫️",black_large_square:"⬛",white_large_square:"⬜",small_red_triangle_down:"🔻",black_medium_square:"◼️",white_medium_square:"◻️",black_medium_small_square:"◾",white_medium_small_square:"◽",black_square_button:"🔲",white_square_button:"🔳",speaker:"🔈",sound:"🔉",loud_sound:"🔊",mute:"🔇",mega:"📣",loudspeaker:"📢",bell:"🔔",no_bell:"🔕",black_joker:"🃏",mahjong:"🀄",spades:"♠️",clubs:"♣️",hearts:"♥️",diamonds:"♦️",flower_playing_cards:"🎴",thought_balloon:"💭",right_anger_bubble:"🗯",speech_balloon:"💬",left_speech_bubble:"🗨",clock1:"🕐",clock2:"🕑",clock3:"🕒",clock4:"🕓",clock5:"🕔",clock6:"🕕",clock7:"🕖",clock8:"🕗",clock9:"🕘",clock10:"🕙",clock11:"🕚",clock12:"🕛",clock130:"🕜",clock230:"🕝",clock330:"🕞",clock430:"🕟",clock530:"🕠",clock630:"🕡",clock730:"🕢",clock830:"🕣",clock930:"🕤",clock1030:"🕥",clock1130:"🕦",clock1230:"🕧",afghanistan:"🇦🇫",aland_islands:"🇦🇽",albania:"🇦🇱",algeria:"🇩🇿",american_samoa:"🇦🇸",andorra:"🇦🇩",angola:"🇦🇴",anguilla:"🇦🇮",antarctica:"🇦🇶",antigua_barbuda:"🇦🇬",argentina:"🇦🇷",armenia:"🇦🇲",aruba:"🇦🇼",australia:"🇦🇺",austria:"🇦🇹",azerbaijan:"🇦🇿",bahamas:"🇧🇸",bahrain:"🇧🇭",bangladesh:"🇧🇩",barbados:"🇧🇧",belarus:"🇧🇾",belgium:"🇧🇪",belize:"🇧🇿",benin:"🇧🇯",bermuda:"🇧🇲",bhutan:"🇧🇹",bolivia:"🇧🇴",caribbean_netherlands:"🇧🇶",bosnia_herzegovina:"🇧🇦",botswana:"🇧🇼",brazil:"🇧🇷",british_indian_ocean_territory:"🇮🇴",british_virgin_islands:"🇻🇬",brunei:"🇧🇳",bulgaria:"🇧🇬",burkina_faso:"🇧🇫",burundi:"🇧🇮",cape_verde:"🇨🇻",cambodia:"🇰🇭",cameroon:"🇨🇲",canada:"🇨🇦",canary_islands:"🇮🇨",cayman_islands:"🇰🇾",central_african_republic:"🇨🇫",chad:"🇹🇩",chile:"🇨🇱",cn:"🇨🇳",christmas_island:"🇨🇽",cocos_islands:"🇨🇨",colombia:"🇨🇴",comoros:"🇰🇲",congo_brazzaville:"🇨🇬",congo_kinshasa:"🇨🇩",cook_islands:"🇨🇰",costa_rica:"🇨🇷",croatia:"🇭🇷",cuba:"🇨🇺",curacao:"🇨🇼",cyprus:"🇨🇾",czech_republic:"🇨🇿",denmark:"🇩🇰",djibouti:"🇩🇯",dominica:"🇩🇲",dominican_republic:"🇩🇴",ecuador:"🇪🇨",egypt:"🇪🇬",el_salvador:"🇸🇻",equatorial_guinea:"🇬🇶",eritrea:"🇪🇷",estonia:"🇪🇪",ethiopia:"🇪🇹",eu:"🇪🇺",falkland_islands:"🇫🇰",faroe_islands:"🇫🇴",fiji:"🇫🇯",finland:"🇫🇮",fr:"🇫🇷",french_guiana:"🇬🇫",french_polynesia:"🇵🇫",french_southern_territories:"🇹🇫",gabon:"🇬🇦",gambia:"🇬🇲",georgia:"🇬🇪",de:"🇩🇪",ghana:"🇬🇭",gibraltar:"🇬🇮",greece:"🇬🇷",greenland:"🇬🇱",grenada:"🇬🇩",guadeloupe:"🇬🇵",guam:"🇬🇺",guatemala:"🇬🇹",guernsey:"🇬🇬",guinea:"🇬🇳",guinea_bissau:"🇬🇼",guyana:"🇬🇾",haiti:"🇭🇹",honduras:"🇭🇳",hong_kong:"🇭🇰",hungary:"🇭🇺",iceland:"🇮🇸",india:"🇮🇳",indonesia:"🇮🇩",iran:"🇮🇷",iraq:"🇮🇶",ireland:"🇮🇪",isle_of_man:"🇮🇲",israel:"🇮🇱",it:"🇮🇹",cote_divoire:"🇨🇮",jamaica:"🇯🇲",jp:"🇯🇵",jersey:"🇯🇪",jordan:"🇯🇴",kazakhstan:"🇰🇿",kenya:"🇰🇪",kiribati:"🇰🇮",kosovo:"🇽🇰",kuwait:"🇰🇼",kyrgyzstan:"🇰🇬",laos:"🇱🇦",latvia:"🇱🇻",lebanon:"🇱🇧",lesotho:"🇱🇸",liberia:"🇱🇷",libya:"🇱🇾",liechtenstein:"🇱🇮",lithuania:"🇱🇹",luxembourg:"🇱🇺",macau:"🇲🇴",macedonia:"🇲🇰",madagascar:"🇲🇬",malawi:"🇲🇼",malaysia:"🇲🇾",maldives:"🇲🇻",mali:"🇲🇱",malta:"🇲🇹",marshall_islands:"🇲🇭",martinique:"🇲🇶",mauritania:"🇲🇷",mauritius:"🇲🇺",mayotte:"🇾🇹",mexico:"🇲🇽",micronesia:"🇫🇲",moldova:"🇲🇩",monaco:"🇲🇨",mongolia:"🇲🇳",montenegro:"🇲🇪",montserrat:"🇲🇸",morocco:"🇲🇦",mozambique:"🇲🇿",myanmar:"🇲🇲",namibia:"🇳🇦",nauru:"🇳🇷",nepal:"🇳🇵",netherlands:"🇳🇱",new_caledonia:"🇳🇨",new_zealand:"🇳🇿",nicaragua:"🇳🇮",niger:"🇳🇪",nigeria:"🇳🇬",niue:"🇳🇺",norfolk_island:"🇳🇫",northern_mariana_islands:"🇲🇵",north_korea:"🇰🇵",norway:"🇳🇴",oman:"🇴🇲",pakistan:"🇵🇰",palau:"🇵🇼",palestinian_territories:"🇵🇸",panama:"🇵🇦",papua_new_guinea:"🇵🇬",paraguay:"🇵🇾",peru:"🇵🇪",philippines:"🇵🇭",pitcairn_islands:"🇵🇳",poland:"🇵🇱",portugal:"🇵🇹",puerto_rico:"🇵🇷",qatar:"🇶🇦",reunion:"🇷🇪",romania:"🇷🇴",ru:"🇷🇺",rwanda:"🇷🇼",st_barthelemy:"🇧🇱",st_helena:"🇸🇭",st_kitts_nevis:"🇰🇳",st_lucia:"🇱🇨",st_pierre_miquelon:"🇵🇲",st_vincent_grenadines:"🇻🇨",samoa:"🇼🇸",san_marino:"🇸🇲",sao_tome_principe:"🇸🇹",saudi_arabia:"🇸🇦",senegal:"🇸🇳",serbia:"🇷🇸",seychelles:"🇸🇨",sierra_leone:"🇸🇱",singapore:"🇸🇬",sint_maarten:"🇸🇽",slovakia:"🇸🇰",slovenia:"🇸🇮",solomon_islands:"🇸🇧",somalia:"🇸🇴",south_africa:"🇿🇦",south_georgia_south_sandwich_islands:"🇬🇸",kr:"🇰🇷",south_sudan:"🇸🇸",es:"🇪🇸",sri_lanka:"🇱🇰",sudan:"🇸🇩",suriname:"🇸🇷",swaziland:"🇸🇿",sweden:"🇸🇪",switzerland:"🇨🇭",syria:"🇸🇾",taiwan:"🇹🇼",tajikistan:"🇹🇯",tanzania:"🇹🇿",thailand:"🇹🇭",timor_leste:"🇹🇱",togo:"🇹🇬",tokelau:"🇹🇰",tonga:"🇹🇴",trinidad_tobago:"🇹🇹",tunisia:"🇹🇳",tr:"🇹🇷",turkmenistan:"🇹🇲",turks_caicos_islands:"🇹🇨",tuvalu:"🇹🇻",uganda:"🇺🇬",ukraine:"🇺🇦",united_arab_emirates:"🇦🇪",uk:"🇬🇧",england:"🏴",scotland:"🏴",wales:"🏴",us:"🇺🇸",us_virgin_islands:"🇻🇮",uruguay:"🇺🇾",uzbekistan:"🇺🇿",vanuatu:"🇻🇺",vatican_city:"🇻🇦",venezuela:"🇻🇪",vietnam:"🇻🇳",wallis_futuna:"🇼🇫",western_sahara:"🇪🇭",yemen:"🇾🇪",zambia:"🇿🇲",zimbabwe:"🇿🇼",united_nations:"🇺🇳",pirate_flag:"🏴☠️"},Ql=typeof navigator<"u"&&navigator.hardwareConcurrency?Math.max(1,Math.floor(navigator.hardwareConcurrency/2)):2,Va=wa(()=>{if(typeof Worker<"u")try{return new Ul}catch{}try{if(Zt)return Zt(Dl)}catch{}const e={message:[],error:[]};return{addEventListener(t,n){e[t]||(e[t]=[]),e[t].push(n)},removeEventListener(t,n){if(!e[t])return;const i=e[t].indexOf(n);i!==-1&&e[t].splice(i,1)},postMessage(t){setTimeout(async()=>{try{if(Xl&&typeof Ur=="function"&&t&&t.type==="stream")await Ur(t,n=>{const i={data:n};(e.message||[]).forEach(r=>r(i))});else{const i={data:await yi(t)};(e.message||[]).forEach(r=>r(i))}}catch(n){const i={data:{id:t&&t.id,error:String(n)}};(e.message||[]).forEach(r=>r(i))}},0)},terminate(){Object.keys(e).forEach(t=>e[t].length=0)}}},"markdown",Ql),wt=()=>Va.get(),bi=(e,t=3e3)=>Va.send(e,t),At=[];function Wr(e){if(e&&(typeof e=="object"||typeof e=="function")){At.push(e);try{Ee.use(e)}catch(t){k("[markdown] failed to apply plugin",t)}}}function Kl(e){At.length=0,Array.isArray(e)&&At.push(...e.filter(t=>t&&typeof t=="object"));try{At.forEach(t=>Ee.use(t))}catch(t){k("[markdown] failed to apply markdown extensions",t)}}function ta(e){try{return String(e||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}}function Vl(e,t){const n=String(e||"");if(!n||n.length<=t)return[n];const i=/^#{1,6}\s.*$/gm,r=[];let a;for(;(a=i.exec(n))!==null;)r.push(a.index);if(!r.length||r.length<2){const c=[];for(let u=0;u<n.length;u+=t)c.push(n.slice(u,u+t));return c}const s=[];r[0]>0&&s.push(n.slice(0,r[0]));for(let c=0;c<r.length;c++){const u=r[c],g=c+1<r.length?r[c+1]:n.length;s.push(n.slice(u,g))}const o=[];let l="";for(const c of s){if(!l&&c.length>=t){o.push(c);continue}l.length+c.length<=t?l+=c:(l&&o.push(l),l=c)}return l&&o.push(l),o}async function Zr(e,t,n={}){const i=n&&n.chunkSize?Number(n.chunkSize):65536,r=typeof t=="function"?t:(()=>{}),{content:a,data:s}=Yt(String(e||""));let o=a;try{o=String(o||"").replace(/:([^:\s]+):/g,(h,d)=>Jn[d]||h)}catch{}let l;if(typeof process<"u"&&process.env&&process.env.VITEST)try{const h=await Promise.resolve().then(()=>wi);l=h.initRendererWorker&&h.initRendererWorker()}catch{l=wt&&wt()}else l=wt&&wt();if(!(typeof process<"u"&&process.env&&process.env.VITEST)&&l&&typeof l.postMessage=="function")return new Promise((h,d)=>{const p=String(Math.random());let m=null;const f=()=>{m&&clearTimeout(m);try{l.removeEventListener&&l.removeEventListener("message",w)}catch{}try{l.removeEventListener&&l.removeEventListener("error",y)}catch{}},w=_=>{const b=_&&_.data?_.data:{};if(b.id===p){if(b.error)return f(),d(new Error(b.error));if(b.type==="chunk"){try{r(String(b.html||""),{index:b.index,isLast:!!b.isLast,meta:{},toc:b.toc||[]})}catch{}return}if(b.type==="done"){f();try{r("",{index:-1,isLast:!0,meta:b.meta||{}})}catch{}return h()}if(b.result){f();try{r(String(b.result&&b.result.html||""),{index:0,isLast:!0,meta:b.result.meta||{},toc:b.result.toc||[]})}catch{}return h()}}},y=_=>{f(),d(new Error(_&&_.message||"worker error"))};m=setTimeout(()=>{f(),d(new Error("worker timeout"))},n&&n.timeout?Number(n.timeout):1e4);try{l.addEventListener&&l.addEventListener("message",w),l.addEventListener&&l.addEventListener("error",y),l.postMessage({type:"stream",id:p,md:o,chunkSize:i})}catch(_){f(),d(_)}});const c=Vl(o,i),u=qe(),g=new Map;for(let h=0;h<c.length;h++){const d=c[h],p=await un(d);let m=String(p&&p.html||""),f=[];if(u)try{const y=u.parseFromString(m,"text/html");y.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(b=>{try{const v=Number(b.tagName.substring(1)),S=(b.textContent||"").trim(),E=ta(S),I=(g.get(E)||0)+1;g.set(E,I);const U=I===1?E:E+"-"+I;b.id=U,f.push({level:v,text:S,id:U})}catch{}});try{typeof XMLSerializer<"u"?m=new XMLSerializer().serializeToString(y.body).replace(/^<body[^>]*>/i,"").replace(/<\/body>$/i,""):m=Array.from(y.body.childNodes||[]).map(v=>v&&typeof v.outerHTML=="string"?v.outerHTML:v&&typeof v.textContent=="string"?v.textContent:"").join("")}catch{}}catch{}else try{const y=[];m=m.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(_,b,v,S)=>{const E=Number(b),P=S.replace(/<[^>]+>/g,"").trim(),I=ta(P),z=(g.get(I)||0)+1;g.set(I,z);const O=z===1?I:I+"-"+z;y.push({level:E,text:P,id:O});const W=(v||"").replace(/\s*(id|class)="[^"]*"/g,"");return`<h${E} ${W} id="${O}">${S}</h${E}>`}),f=y}catch{}const w={index:h,isLast:h===c.length-1,meta:h===0?s||{}:{},toc:f};try{r(m,w)}catch{}}}async function un(e){if(At&&At.length){let{content:i,data:r}=Yt(e||"");try{i=String(i||"").replace(/:([^:\s]+):/g,(s,o)=>Jn[o]||s)}catch{}Ee.setOptions({gfm:!0,mangle:!1,headerIds:!1,headerPrefix:""});try{At.forEach(s=>Ee.use(s))}catch(s){k("[markdown] apply plugins failed",s)}const a=Ee.parse(i);try{const s=qe();if(s){const o=s.parseFromString(a,"text/html"),l=o.querySelectorAll("h1,h2,h3,h4,h5,h6"),c=[],u=new Set,g=d=>{try{return String(d||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}},h=d=>{const p={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},m=d<=2?"has-text-weight-bold":d<=4?"has-text-weight-semibold":"has-text-weight-normal";return(p[d]+" "+m).trim()};l.forEach(d=>{try{const p=Number(d.tagName.substring(1)),m=(d.textContent||"").trim();let f=g(m)||"heading",w=f,y=2;for(;u.has(w);)w=f+"-"+y,y+=1;u.add(w),d.id=w,d.className=h(p),c.push({level:p,text:m,id:w})}catch{}});try{(o&&typeof o.getElementsByTagName=="function"?Array.from(o.getElementsByTagName("img")):o&&typeof o.querySelectorAll=="function"?Array.from(o.querySelectorAll("img")):[]).forEach(p=>{try{const m=p.getAttribute&&p.getAttribute("loading"),f=p.getAttribute&&p.getAttribute("data-want-lazy");!m&&!f&&p.setAttribute&&p.setAttribute("loading","lazy")}catch{}})}catch{}try{o.querySelectorAll("pre code, code[class]").forEach(d=>{try{const p=d.getAttribute&&d.getAttribute("class")||d.className||"",m=String(p||"").replace(/\blanguage-undefined\b|\blang-undefined\b/g,"").trim();if(m)try{d.setAttribute&&d.setAttribute("class",m)}catch{d.className=m}else try{d.removeAttribute&&d.removeAttribute("class")}catch{d.className=""}}catch{}})}catch{}try{let d=null;try{typeof XMLSerializer<"u"?d=new XMLSerializer().serializeToString(o.body).replace(/^<body[^>]*>/i,"").replace(/<\/body>$/i,""):d=Array.from(o.body.childNodes||[]).map(m=>m&&typeof m.outerHTML=="string"?m.outerHTML:m&&typeof m.textContent=="string"?m.textContent:"").join("")}catch{try{d=o.body.innerHTML}catch{d=""}}return{html:d,meta:r||{},toc:c}}catch{return{html:"",meta:r||{},toc:c}}}}catch{}return{html:a,meta:r||{},toc:[]}}let t;if(typeof process<"u"&&process.env&&process.env.VITEST)try{const i=await Promise.resolve().then(()=>wi);t=i.initRendererWorker&&i.initRendererWorker()}catch{t=wt&&wt()}else t=wt&&wt();try{e=String(e||"").replace(/:([^:\s]+):/g,(i,r)=>Jn[r]||i)}catch{}try{if(typeof Re<"u"&&Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")&&/```\s*\n/.test(String(e||""))){let{content:i,data:r}=Yt(e||"");try{i=String(i||"").replace(/:([^:\s]+):/g,(c,u)=>Jn[u]||c)}catch{}Ee.setOptions({gfm:!0,headerIds:!0,mangle:!1,highlighted:(c,u)=>{try{return u&&Re.getLanguage&&Re.getLanguage(u)?Re.highlight(c,{language:u}).value:Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")?Re.highlight(c,{language:"plaintext"}).value:c}catch{return c}}});let a=Ee.parse(i);try{a=a.replace(/<pre><code>([\s\S]*?)<\/code><\/pre>/g,(c,u)=>{try{if(u&&Re&&typeof Re.highlight=="function")try{const g=Re.highlight(u,{language:"plaintext"});return`<pre><code>${g&&g.value?g.value:g}</code></pre>`}catch{try{if(Re&&typeof Re.highlightElement=="function"){const h={innerHTML:u};return Re.highlightElement(h),`<pre><code>${h.innerHTML}</code></pre>`}}catch{}}}catch{}return c})}catch{}const s=[],o=new Set,l=c=>{try{return String(c||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}};return a=a.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(c,u,g,h)=>{const d=Number(u),p=h.replace(/<[^>]+>/g,"").trim();let m=l(p)||"heading",f=m,w=2;for(;o.has(f);)f=m+"-"+w,w+=1;o.add(f),s.push({level:d,text:p,id:f});const y={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},_=d<=2?"has-text-weight-bold":d<=4?"has-text-weight-semibold":"has-text-weight-normal",b=(y[d]+" "+_).trim(),S=((g||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${f}" class="${b}"`).trim();return`<h${d} ${S}>${h}</h${d}>`}),a=a.replace(/<img([^>]*)>/g,(c,u)=>/\bloading=/.test(u)?`<img${u}>`:/\bdata-want-lazy=/.test(u)?`<img${u}>`:`<img${u} loading="lazy">`),{html:a,meta:r||{},toc:s}}}catch{}if(!t)throw new Error("renderer worker required but unavailable");const n=await bi({type:"render",md:e});if(!n||typeof n!="object"||n.html===void 0)throw new Error("renderer worker returned invalid response");try{const i=new Map,r=[],a=l=>{try{return String(l||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}},s=l=>{const c={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},u=l<=2?"has-text-weight-bold":l<=4?"has-text-weight-semibold":"has-text-weight-normal";return(c[l]+" "+u).trim()};let o=n.html;o=o.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(l,c,u,g)=>{const h=Number(c),d=g.replace(/<[^>]+>/g,"").trim(),p=(u||"").match(/\sid="([^"]+)"/),m=p?p[1]:a(d)||"heading",w=(i.get(m)||0)+1;i.set(m,w);const y=w===1?m:m+"-"+w;r.push({level:h,text:d,id:y});const _=s(h),v=((u||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${y}" class="${_}"`).trim();return`<h${h} ${v}>${g}</h${h}>`});try{const l=typeof document<"u"&&document.documentElement&&document.documentElement.getAttribute&&document.documentElement.getAttribute("data-nimbi-logo-moved")||"";if(l){const c=qe();if(c){const u=c.parseFromString(o,"text/html");(u&&typeof u.getElementsByTagName=="function"?Array.from(u.getElementsByTagName("img")):u&&typeof u.querySelectorAll=="function"?Array.from(u.querySelectorAll("img")):[]).forEach(h=>{try{const d=h.getAttribute("src")||"";(d?new URL(d,location.href).toString():"")===l&&h.remove()}catch{}});try{typeof XMLSerializer<"u"?o=new XMLSerializer().serializeToString(u.body).replace(/^<body[^>]*>/i,"").replace(/<\/body>$/i,""):o=Array.from(u.body.childNodes||[]).map(d=>d&&typeof d.outerHTML=="string"?d.outerHTML:d&&typeof d.textContent=="string"?d.textContent:"").join("")}catch{try{o=u.body.innerHTML}catch{}}}else try{const u=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=o.replace(new RegExp(`<img[^>]*src=\\"${u}\\"[^>]*>`,"g"),"")}catch{}}}catch{}return{html:o,meta:n.meta||{},toc:r}}catch{return{html:n.html,meta:n.meta||{},toc:n.toc||[]}}}function An(e,t){const n=new Set,i=/```\s*([a-zA-Z0-9_\-+]+)?/g,r=new Set(["then","now","if","once","so","and","or","but","when","the","a","an","as","let","const","var","export","import","from","true","false","null","npm","run","echo","sudo","this","that","have","using","some","return","returns","function","console","log","error","warn","class","new","undefined","with","select","from","where","join","on","group","order","by","having","as","into","values","like","limit","offset","create","table","index","view","insert","update","delete","returning","and","or","not","all","any","exists","case","when","then","else","end","distance","geometry","you","which","would","why","cool","other","same","everything","check"]),a=new Set(["bash","sh","zsh","javascript","js","python","py","php","java","c","cpp","rust","go","ruby","perl","r","scala","swift","kotlin","cs","csharp","html","css","json","xml","yaml","yml","dockerfile","docker"]);let s;for(;s=i.exec(e);)if(s[1]){const o=s[1].toLowerCase();if(ei.has(o)||t&&t.size&&o.length<3&&!t.has(o)&&!(ht&&ht[o]&&t.has(ht[o])))continue;if(t&&t.size){if(t.has(o)){const c=t.get(o);c&&n.add(c);continue}if(ht&&ht[o]){const c=ht[o];if(t.has(c)){const u=t.get(c)||c;n.add(u);continue}}}(a.has(o)||o.length>=5&&o.length<=30&&/^[a-z][a-z0-9_\-+]*$/.test(o)&&!r.has(o))&&n.add(o)}return n}async function Gr(e,t){if(At&&At.length||typeof process<"u"&&process.env&&process.env.VITEST)return An(e||"",t);if(wt&&wt())try{const i=t&&t.size?Array.from(t.keys()):[],r=await bi({type:"detect",md:String(e||""),supported:i});if(Array.isArray(r))return new Set(r)}catch(i){k("[markdown] detectFenceLanguagesAsync worker failed",i)}return An(e||"",t)}const wi=Object.freeze(Object.defineProperty({__proto__:null,_sendToRenderer:bi,addMarkdownExtension:Wr,detectFenceLanguages:An,detectFenceLanguagesAsync:Gr,initRendererWorker:wt,markdownPlugins:At,parseMarkdownToHtml:un,setMarkdownExtensions:Kl,streamParseMarkdown:Zr},Symbol.toStringTag,{value:"Module"}));function Yl(e,t=150,n={}){let i=null;const r=!!n.leading;return function(...s){const o=this;if(i&&clearTimeout(i),r&&!i)try{e.apply(o,s)}catch{}i=setTimeout(()=>{if(i=null,!r)try{e.apply(o,s)}catch{}},t)}}function Jl(e){let t=!1;return function(...i){const r=this;if(!t){try{e.apply(r,i)}catch{}t=!0;const a=()=>{t=!1};typeof requestAnimationFrame=="function"?requestAnimationFrame(a):setTimeout(a,16);return}}}function ec(){let e=[],t=!1;return function(i){typeof i=="function"&&(e.push(i),!t&&(t=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{t=!1;const r=e.slice(0);e.length=0;for(const a of r)try{a()}catch{}}):setTimeout(()=>{t=!1;const r=e.slice(0);e.length=0;for(const a of r)try{a()}catch{}},0)))}}const er=ec(),tc=`/**
|
|
2092
|
+
`,aa=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",Ja],{type:"text/javascript;charset=utf-8"});function Xl(e){let t;try{if(t=aa&&(self.URL||self.webkitURL).createObjectURL(aa),!t)throw"";const n=new Worker(t,{type:"module",name:e?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(Ja),{type:"module",name:e?.name})}}function en(e){if(e.startsWith("---")){const t=e.indexOf(`
|
|
2093
|
+
---`,3);if(t!==-1){const n=e.slice(3,t+0).trim(),i=e.slice(t+4).trimStart(),r={};return n.split(/\r?\n/).forEach(a=>{const s=a.match(/^([^:]+):\s*(.*)$/);s&&(r[s[1].trim()]=s[2].trim())}),{content:i,data:r}}}return{content:e,data:{}}}function Nn(e){try{if(!e&&e!==0)return"";const t=String(e),n={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};return t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(i,r)=>{if(!r)return i;if(r[0]==="#")try{return r[1]==="x"||r[1]==="X"?String.fromCharCode(parseInt(r.slice(2),16)):String.fromCharCode(parseInt(r.slice(1),10))}catch{return i}return n[r]!==void 0?n[r]:i})}catch{return String(e||"")}}const Kt=ia&&(Me||ia)||void 0;function ki(e,t){const n=String(e||"");if(!n||n.length<=t)return[n];const i=/^#{1,6}\s.*$/gm,r=[];let a;for(;(a=i.exec(n))!==null;)r.push(a.index);if(!r.length||r.length<2){const c=[];for(let u=0;u<n.length;u+=t)c.push(n.slice(u,u+t));return c}const s=[];r[0]>0&&s.push(n.slice(0,r[0]));for(let c=0;c<r.length;c++){const u=r[c],g=c+1<r.length?r[c+1]:n.length;s.push(n.slice(u,g))}const o=[];let l="";for(const c of s){if(!l&&c.length>=t){o.push(c);continue}l.length+c.length<=t?l+=c:(l&&o.push(l),l=c)}return l&&o.push(l),o}const dr=/```\s*([a-zA-Z0-9_\-+]+)?/g,es=new Set(["bash","sh","zsh","javascript","js","python","py","php","java","c","cpp","rust","go","ruby","perl","r","scala","swift","kotlin","cs","csharp","html","css","json","xml","yaml","yml","dockerfile","docker"]);function On(e){try{return String(e||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}}let Ke=null;const Kl="https://cdn.jsdelivr.net/npm/highlight.js";function Vl(){Qs(),Ke=null}function Yl(e){Xs(e)}async function xr(e){return await Ks(e)}async function Vt(){if(Ke)return Ke;try{const e=Kl+"/lib/core.js";try{const t=await import("https://cdn.jsdelivr.net/npm/highlight.js/lib/core.js");if(t){Ke=t.default||t;try{await ai(e,async()=>t)}catch{}}else Ke=null}catch{const n=await xr(e);n?Ke=n.default||n:Ke=null}}catch{Ke=null}return Ke}Kt&&typeof Kt.setOptions=="function"&&Kt.setOptions({gfm:!0,headerIds:!0,mangle:!1,highlighted:(e,t)=>{try{return Ke&&t&&typeof Ke.getLanguage=="function"&&Ke.getLanguage(t)?Ke.highlight(e,{language:t}).value:Ke&&typeof Ke.getLanguage=="function"&&Ke.getLanguage("plaintext")?Ke.highlight(e,{language:"plaintext"}).value:e}catch{return e}}});onmessage=async e=>{const t=e.data||{};try{if(t.type==="register"){const{name:u,url:g}=t;try{if(!await Vt()){postMessage({type:"register-error",name:u,error:"hljs unavailable"});return}const d=await xr(g),p=d?d.default||d:null;if(!p)throw new Error("failed to import language module");Ke.registerLanguage(u,p),postMessage({type:"registered",name:u})}catch(h){postMessage({type:"register-error",name:u,error:String(h)})}return}if(t.type==="detect"){const u=t.md||"",g=t.supported||[],h=new Set,d=new RegExp(dr.source,dr.flags);let p;for(;p=d.exec(u);)if(p[1]){const m=String(p[1]).toLowerCase();if(!m)continue;if(m.length>=5&&m.length<=30&&/^[a-z][a-z0-9_\-+]*$/.test(m)&&h.add(m),es.has(m)&&h.add(m),g&&g.length)try{g.indexOf(m)!==-1&&h.add(m)}catch{}}postMessage({id:t.id,result:Array.from(h)});return}if(t.type==="stream"){const u=t.id;try{const g=Number(t.chunkSize)||65536,{content:h,data:d}=en(t.md||"");await Vt().catch(()=>{});const p=ki(h,g),m=new Map,f=On;for(let w=0;w<p.length;w++){let y=p[w],_=Kt.parse(y);const b=[];_=_.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(A,S,E,I)=>{const O=Number(S);let W=I.replace(/<[^>]+>/g,"").trim();try{W=Nn(W)}catch{}let z=null;const B=(E||"").match(/\sid="([^"]+)"/);B&&(z=B[1]);const Z=z||f(W)||"heading",j=(m.get(Z)||0)+1;m.set(Z,j);const C=j===1?Z:Z+"-"+j;b.push({level:O,text:W,id:C});const N={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},D=O<=2?"has-text-weight-bold":O<=4?"has-text-weight-semibold":"has-text-weight-normal",ie=(N[O]+" "+D).trim(),K=((E||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${C}" class="${ie}"`).trim();return`<h${O} ${K}>${I}</h${O}>`}),_=_.replace(/<img([^>]*)>/g,(A,S)=>/\bloading=/.test(S)?`<img${S}>`:/\bdata-want-lazy=/.test(S)?`<img${S}>`:`<img${S} loading="lazy">`),postMessage({id:u,type:"chunk",html:_,toc:b,index:w,isLast:w===p.length-1})}postMessage({id:u,type:"done",meta:d||{}})}catch(g){postMessage({id:t.id,error:String(g)})}return}const{id:n,md:i}=t,{content:r,data:a}=en(i||"");await Vt().catch(()=>{});let s=Kt.parse(r);const o=[],l=new Map,c=On;s=s.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(u,g,h,d)=>{const p=Number(g);let m=d.replace(/<[^>]+>/g,"").trim();try{m=Nn(m)}catch{}let f=null;const w=(h||"").match(/\sid="([^"]+)"/);w&&(f=w[1]);const y=f||c(m)||"heading",b=(l.get(y)||0)+1;l.set(y,b);const A=b===1?y:y+"-"+b;o.push({level:p,text:m,id:A});const S={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},E=p<=2?"has-text-weight-bold":p<=4?"has-text-weight-semibold":"has-text-weight-normal",I=(S[p]+" "+E).trim(),W=((h||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${A}" class="${I}"`).trim();return`<h${p} ${W}>${d}</h${p}>`}),s=s.replace(/<img([^>]*)>/g,(u,g)=>/\bloading=/.test(g)?`<img${g}>`:/\bdata-want-lazy=/.test(g)?`<img${g}>`:`<img${g} loading="lazy">`),postMessage({id:n,result:{html:s,meta:a||{},toc:o}})}catch(n){postMessage({id:t.id,error:String(n)})}};async function xi(e){try{if(e&&e.type==="register"){const{name:l,url:c}=e;try{if(!await Vt())return{type:"register-error",name:l,error:"hljs unavailable"};const g=await xr(c),h=g?g.default||g:null;return h?(Ke.registerLanguage(l,h),{type:"registered",name:l}):{type:"register-error",name:l,error:"failed to import language module"}}catch(u){return{type:"register-error",name:l,error:String(u)}}}if(e&&e.type==="detect"){const l=e.md||"",c=e.supported||[],u=new Set,g=new RegExp(dr.source,dr.flags);let h;for(;h=g.exec(l);)if(h[1]){const d=String(h[1]).toLowerCase();if(!d)continue;if(d.length>=5&&d.length<=30&&/^[a-z][a-z0-9_\-+]*$/.test(d)&&u.add(d),es.has(d)&&u.add(d),c&&c.length)try{c.indexOf(d)!==-1&&u.add(d)}catch{}}return{id:e.id,result:Array.from(u)}}const t=e&&e.id,{content:n,data:i}=en(e&&e.md||"");await Vt().catch(()=>{});let r=Kt.parse(n);const a=[],s=new Map,o=On;return r=r.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(l,c,u,g)=>{const h=Number(c);let d=g.replace(/<[^>]+>/g,"").trim();try{d=Nn(d)}catch{}let p=null;const m=(u||"").match(/\sid="([^"]+)"/);m&&(p=m[1]);const f=p||o(d)||"heading",y=(s.get(f)||0)+1;s.set(f,y);const _=y===1?f:f+"-"+y;a.push({level:h,text:d,id:_});const b={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},A=h<=2?"has-text-weight-bold":h<=4?"has-text-weight-semibold":"has-text-weight-normal",S=(b[h]+" "+A).trim(),I=((u||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${_}" class="${S}"`).trim();return`<h${h} ${I}>${g}</h${h}>`}),r=r.replace(/<img([^>]*)>/g,(l,c)=>/\bloading=/.test(c)?`<img${c}>`:/\bdata-want-lazy=/.test(c)?`<img${c}>`:`<img${c} loading="lazy">`),{id:t,result:{html:r,meta:i||{},toc:a}}}catch(t){return{id:e&&e.id,error:String(t)}}}async function Qr(e,t){try{if(!e||e.type!=="stream"){const u=await xi(e);return typeof t=="function"&&t(u),u}const n=e.id,i=Number(e.chunkSize)||64*1024,{content:r,data:a}=en(e.md||"");await Vt().catch(()=>{});const s=ki(r,i),o=new Map,l=On;for(let u=0;u<s.length;u++){let g=s[u],h=Kt.parse(g);const d=[];h=h.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(m,f,w,y)=>{const _=Number(f);let b=y.replace(/<[^>]+>/g,"").trim();try{b=Nn(b)}catch{}let A=null;const S=(w||"").match(/\sid="([^"]+)"/);S&&(A=S[1]);const E=A||l(b)||"heading",O=(o.get(E)||0)+1;o.set(E,O);const W=O===1?E:E+"-"+O;d.push({level:_,text:b,id:W});const z={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},B=_<=2?"has-text-weight-bold":_<=4?"has-text-weight-semibold":"has-text-weight-normal",Z=(z[_]+" "+B).trim(),j=((w||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${W}" class="${Z}"`).trim();return`<h${_} ${j}>${y}</h${_}>`}),h=h.replace(/<img([^>]*)>/g,(m,f)=>/\bloading=/.test(f)?`<img${f}>`:/\bdata-want-lazy=/.test(f)?`<img${f}>`:`<img${f} loading="lazy">`);const p={id:n,type:"chunk",html:h,toc:d,index:u,isLast:u===s.length-1};typeof t=="function"&&t(p)}const c={id:n,type:"done",meta:a||{}};return typeof t=="function"&&t(c),c}catch(n){const i={id:e&&e.id,error:String(n)};return typeof t=="function"&&t(i),i}}const Jl=Object.freeze(Object.defineProperty({__proto__:null,_splitIntoSections:ki,clearRendererImportCache:Vl,decodeHtmlEntitiesLocal:Nn,ensureHljs:Vt,handleWorkerMessage:xi,handleWorkerMessageStream:Qr,importModuleWithCache:xr,setRendererImportNegativeCacheTTL:Yl,slugifyHeading:On},Symbol.toStringTag,{value:"Module"})),rr={100:"💯",1234:"🔢",grinning:"😀",grimacing:"😬",grin:"😁",joy:"😂",rofl:"🤣",partying:"🥳",smiley:"😃",smile:"😄",sweat_smile:"😅",laughing:"😆",innocent:"😇",wink:"😉",blush:"😊",slightly_smiling_face:"🙂",upside_down_face:"🙃",relaxed:"☺️",yum:"😋",relieved:"😌",heart_eyes:"😍",smiling_face_with_three_hearts:"🥰",kissing_heart:"😘",kissing:"😗",kissing_smiling_eyes:"😙",kissing_closed_eyes:"😚",stuck_out_tongue_winking_eye:"😜",zany:"🤪",raised_eyebrow:"🤨",monocle:"🧐",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue:"😛",money_mouth_face:"🤑",nerd_face:"🤓",sunglasses:"😎",star_struck:"🤩",clown_face:"🤡",cowboy_hat_face:"🤠",hugs:"🤗",smirk:"😏",no_mouth:"😶",neutral_face:"😐",expressionless:"😑",unamused:"😒",roll_eyes:"🙄",thinking:"🤔",lying_face:"🤥",hand_over_mouth:"🤭",shushing:"🤫",symbols_over_mouth:"🤬",exploding_head:"🤯",flushed:"😳",disappointed:"😞",worried:"😟",angry:"😠",rage:"😡",pensive:"😔",confused:"😕",slightly_frowning_face:"🙁",frowning_face:"☹",persevere:"😣",confounded:"😖",tired_face:"😫",weary:"😩",pleading:"🥺",triumph:"😤",open_mouth:"😮",scream:"😱",fearful:"😨",cold_sweat:"😰",hushed:"😯",frowning:"😦",anguished:"😧",cry:"😢",disappointed_relieved:"😥",drooling_face:"🤤",sleepy:"😪",sweat:"😓",hot:"🥵",cold:"🥶",sob:"😭",dizzy_face:"😵",astonished:"😲",zipper_mouth_face:"🤐",nauseated_face:"🤢",sneezing_face:"🤧",vomiting:"🤮",mask:"😷",face_with_thermometer:"🤒",face_with_head_bandage:"🤕",woozy:"🥴",sleeping:"😴",zzz:"💤",poop:"💩",smiling_imp:"😈",imp:"👿",japanese_ogre:"👹",japanese_goblin:"👺",skull:"💀",ghost:"👻",alien:"👽",robot:"🤖",smiley_cat:"😺",smile_cat:"😸",joy_cat:"😹",heart_eyes_cat:"😻",smirk_cat:"😼",kissing_cat:"😽",scream_cat:"🙀",crying_cat_face:"😿",pouting_cat:"😾",palms_up:"🤲",raised_hands:"🙌",clap:"👏",wave:"👋",call_me_hand:"🤙","+1":"👍","-1":"👎",facepunch:"👊",fist:"✊",fist_left:"🤛",fist_right:"🤜",v:"✌",ok_hand:"👌",raised_hand:"✋",raised_back_of_hand:"🤚",open_hands:"👐",muscle:"💪",pray:"🙏",foot:"🦶",leg:"🦵",handshake:"🤝",point_up:"☝",point_up_2:"👆",point_down:"👇",point_left:"👈",point_right:"👉",fu:"🖕",raised_hand_with_fingers_splayed:"🖐",love_you:"🤟",metal:"🤘",crossed_fingers:"🤞",vulcan_salute:"🖖",writing_hand:"✍",selfie:"🤳",nail_care:"💅",lips:"👄",tooth:"🦷",tongue:"👅",ear:"👂",nose:"👃",eye:"👁",eyes:"👀",brain:"🧠",bust_in_silhouette:"👤",busts_in_silhouette:"👥",speaking_head:"🗣",baby:"👶",child:"🧒",boy:"👦",girl:"👧",adult:"🧑",man:"👨",woman:"👩",blonde_woman:"👱♀️",blonde_man:"👱",bearded_person:"🧔",older_adult:"🧓",older_man:"👴",older_woman:"👵",man_with_gua_pi_mao:"👲",woman_with_headscarf:"🧕",woman_with_turban:"👳♀️",man_with_turban:"👳",policewoman:"👮♀️",policeman:"👮",construction_worker_woman:"👷♀️",construction_worker_man:"👷",guardswoman:"💂♀️",guardsman:"💂",female_detective:"🕵️♀️",male_detective:"🕵",woman_health_worker:"👩⚕️",man_health_worker:"👨⚕️",woman_farmer:"👩🌾",man_farmer:"👨🌾",woman_cook:"👩🍳",man_cook:"👨🍳",woman_student:"👩🎓",man_student:"👨🎓",woman_singer:"👩🎤",man_singer:"👨🎤",woman_teacher:"👩🏫",man_teacher:"👨🏫",woman_factory_worker:"👩🏭",man_factory_worker:"👨🏭",woman_technologist:"👩💻",man_technologist:"👨💻",woman_office_worker:"👩💼",man_office_worker:"👨💼",woman_mechanic:"👩🔧",man_mechanic:"👨🔧",woman_scientist:"👩🔬",man_scientist:"👨🔬",woman_artist:"👩🎨",man_artist:"👨🎨",woman_firefighter:"👩🚒",man_firefighter:"👨🚒",woman_pilot:"👩✈️",man_pilot:"👨✈️",woman_astronaut:"👩🚀",man_astronaut:"👨🚀",woman_judge:"👩⚖️",man_judge:"👨⚖️",woman_superhero:"🦸♀️",man_superhero:"🦸♂️",woman_supervillain:"🦹♀️",man_supervillain:"🦹♂️",mrs_claus:"🤶",santa:"🎅",sorceress:"🧙♀️",wizard:"🧙♂️",woman_elf:"🧝♀️",man_elf:"🧝♂️",woman_vampire:"🧛♀️",man_vampire:"🧛♂️",woman_zombie:"🧟♀️",man_zombie:"🧟♂️",woman_genie:"🧞♀️",man_genie:"🧞♂️",mermaid:"🧜♀️",merman:"🧜♂️",woman_fairy:"🧚♀️",man_fairy:"🧚♂️",angel:"👼",pregnant_woman:"🤰",breastfeeding:"🤱",princess:"👸",prince:"🤴",bride_with_veil:"👰",man_in_tuxedo:"🤵",running_woman:"🏃♀️",running_man:"🏃",walking_woman:"🚶♀️",walking_man:"🚶",dancer:"💃",man_dancing:"🕺",dancing_women:"👯",dancing_men:"👯♂️",couple:"👫",two_men_holding_hands:"👬",two_women_holding_hands:"👭",bowing_woman:"🙇♀️",bowing_man:"🙇",man_facepalming:"🤦♂️",woman_facepalming:"🤦♀️",woman_shrugging:"🤷",man_shrugging:"🤷♂️",tipping_hand_woman:"💁",tipping_hand_man:"💁♂️",no_good_woman:"🙅",no_good_man:"🙅♂️",ok_woman:"🙆",ok_man:"🙆♂️",raising_hand_woman:"🙋",raising_hand_man:"🙋♂️",pouting_woman:"🙎",pouting_man:"🙎♂️",frowning_woman:"🙍",frowning_man:"🙍♂️",haircut_woman:"💇",haircut_man:"💇♂️",massage_woman:"💆",massage_man:"💆♂️",woman_in_steamy_room:"🧖♀️",man_in_steamy_room:"🧖♂️",couple_with_heart_woman_man:"💑",couple_with_heart_woman_woman:"👩❤️👩",couple_with_heart_man_man:"👨❤️👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩❤️💋👩",couplekiss_man_man:"👨❤️💋👨",family_man_woman_boy:"👪",family_man_woman_girl:"👨👩👧",family_man_woman_girl_boy:"👨👩👧👦",family_man_woman_boy_boy:"👨👩👦👦",family_man_woman_girl_girl:"👨👩👧👧",family_woman_woman_boy:"👩👩👦",family_woman_woman_girl:"👩👩👧",family_woman_woman_girl_boy:"👩👩👧👦",family_woman_woman_boy_boy:"👩👩👦👦",family_woman_woman_girl_girl:"👩👩👧👧",family_man_man_boy:"👨👨👦",family_man_man_girl:"👨👨👧",family_man_man_girl_boy:"👨👨👧👦",family_man_man_boy_boy:"👨👨👦👦",family_man_man_girl_girl:"👨👨👧👧",family_woman_boy:"👩👦",family_woman_girl:"👩👧",family_woman_girl_boy:"👩👧👦",family_woman_boy_boy:"👩👦👦",family_woman_girl_girl:"👩👧👧",family_man_boy:"👨👦",family_man_girl:"👨👧",family_man_girl_boy:"👨👧👦",family_man_boy_boy:"👨👦👦",family_man_girl_girl:"👨👧👧",yarn:"🧶",thread:"🧵",coat:"🧥",labcoat:"🥼",womans_clothes:"👚",tshirt:"👕",jeans:"👖",necktie:"👔",dress:"👗",bikini:"👙",kimono:"👘",lipstick:"💄",kiss:"💋",footprints:"👣",flat_shoe:"🥿",high_heel:"👠",sandal:"👡",boot:"👢",mans_shoe:"👞",athletic_shoe:"👟",hiking_boot:"🥾",socks:"🧦",gloves:"🧤",scarf:"🧣",womans_hat:"👒",tophat:"🎩",billed_hat:"🧢",rescue_worker_helmet:"⛑",mortar_board:"🎓",crown:"👑",school_satchel:"🎒",luggage:"🧳",pouch:"👝",purse:"👛",handbag:"👜",briefcase:"💼",eyeglasses:"👓",dark_sunglasses:"🕶",goggles:"🥽",ring:"💍",closed_umbrella:"🌂",dog:"🐶",cat:"🐱",mouse:"🐭",hamster:"🐹",rabbit:"🐰",fox_face:"🦊",bear:"🐻",panda_face:"🐼",koala:"🐨",tiger:"🐯",lion:"🦁",cow:"🐮",pig:"🐷",pig_nose:"🐽",frog:"🐸",squid:"🦑",octopus:"🐙",shrimp:"🦐",monkey_face:"🐵",gorilla:"🦍",see_no_evil:"🙈",hear_no_evil:"🙉",speak_no_evil:"🙊",monkey:"🐒",chicken:"🐔",penguin:"🐧",bird:"🐦",baby_chick:"🐤",hatching_chick:"🐣",hatched_chick:"🐥",duck:"🦆",eagle:"🦅",owl:"🦉",bat:"🦇",wolf:"🐺",boar:"🐗",horse:"🐴",unicorn:"🦄",honeybee:"🐝",bug:"🐛",butterfly:"🦋",snail:"🐌",beetle:"🐞",ant:"🐜",grasshopper:"🦗",spider:"🕷",scorpion:"🦂",crab:"🦀",snake:"🐍",lizard:"🦎","t-rex":"🦖",sauropod:"🦕",turtle:"🐢",tropical_fish:"🐠",fish:"🐟",blowfish:"🐡",dolphin:"🐬",shark:"🦈",whale:"🐳",whale2:"🐋",crocodile:"🐊",leopard:"🐆",zebra:"🦓",tiger2:"🐅",water_buffalo:"🐃",ox:"🐂",cow2:"🐄",deer:"🦌",dromedary_camel:"🐪",camel:"🐫",giraffe:"🦒",elephant:"🐘",rhinoceros:"🦏",goat:"🐐",ram:"🐏",sheep:"🐑",racehorse:"🐎",pig2:"🐖",rat:"🐀",mouse2:"🐁",rooster:"🐓",turkey:"🦃",dove:"🕊",dog2:"🐕",poodle:"🐩",cat2:"🐈",rabbit2:"🐇",chipmunk:"🐿",hedgehog:"🦔",raccoon:"🦝",llama:"🦙",hippopotamus:"🦛",kangaroo:"🦘",badger:"🦡",swan:"🦢",peacock:"🦚",parrot:"🦜",lobster:"🦞",mosquito:"🦟",paw_prints:"🐾",dragon:"🐉",dragon_face:"🐲",cactus:"🌵",christmas_tree:"🎄",evergreen_tree:"🌲",deciduous_tree:"🌳",palm_tree:"🌴",seedling:"🌱",herb:"🌿",shamrock:"☘",four_leaf_clover:"🍀",bamboo:"🎍",tanabata_tree:"🎋",leaves:"🍃",fallen_leaf:"🍂",maple_leaf:"🍁",ear_of_rice:"🌾",hibiscus:"🌺",sunflower:"🌻",rose:"🌹",wilted_flower:"🥀",tulip:"🌷",blossom:"🌼",cherry_blossom:"🌸",bouquet:"💐",mushroom:"🍄",chestnut:"🌰",jack_o_lantern:"🎃",shell:"🐚",spider_web:"🕸",earth_americas:"🌎",earth_africa:"🌍",earth_asia:"🌏",full_moon:"🌕",waning_gibbous_moon:"🌖",last_quarter_moon:"🌗",waning_crescent_moon:"🌘",new_moon:"🌑",waxing_crescent_moon:"🌒",first_quarter_moon:"🌓",waxing_gibbous_moon:"🌔",new_moon_with_face:"🌚",full_moon_with_face:"🌝",first_quarter_moon_with_face:"🌛",last_quarter_moon_with_face:"🌜",sun_with_face:"🌞",crescent_moon:"🌙",star:"⭐",star2:"🌟",dizzy:"💫",sparkles:"✨",comet:"☄",sunny:"☀️",sun_behind_small_cloud:"🌤",partly_sunny:"⛅",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",cloud:"☁️",cloud_with_rain:"🌧",cloud_with_lightning_and_rain:"⛈",cloud_with_lightning:"🌩",zap:"⚡",fire:"🔥",boom:"💥",snowflake:"❄️",cloud_with_snow:"🌨",snowman:"⛄",snowman_with_snow:"☃",wind_face:"🌬",dash:"💨",tornado:"🌪",fog:"🌫",open_umbrella:"☂",umbrella:"☔",droplet:"💧",sweat_drops:"💦",ocean:"🌊",green_apple:"🍏",apple:"🍎",pear:"🍐",tangerine:"🍊",lemon:"🍋",banana:"🍌",watermelon:"🍉",grapes:"🍇",strawberry:"🍓",melon:"🍈",cherries:"🍒",peach:"🍑",pineapple:"🍍",coconut:"🥥",kiwi_fruit:"🥝",mango:"🥭",avocado:"🥑",broccoli:"🥦",tomato:"🍅",eggplant:"🍆",cucumber:"🥒",carrot:"🥕",hot_pepper:"🌶",potato:"🥔",corn:"🌽",leafy_greens:"🥬",sweet_potato:"🍠",peanuts:"🥜",honey_pot:"🍯",croissant:"🥐",bread:"🍞",baguette_bread:"🥖",bagel:"🥯",pretzel:"🥨",cheese:"🧀",egg:"🥚",bacon:"🥓",steak:"🥩",pancakes:"🥞",poultry_leg:"🍗",meat_on_bone:"🍖",bone:"🦴",fried_shrimp:"🍤",fried_egg:"🍳",hamburger:"🍔",fries:"🍟",stuffed_flatbread:"🥙",hotdog:"🌭",pizza:"🍕",sandwich:"🥪",canned_food:"🥫",spaghetti:"🍝",taco:"🌮",burrito:"🌯",green_salad:"🥗",shallow_pan_of_food:"🥘",ramen:"🍜",stew:"🍲",fish_cake:"🍥",fortune_cookie:"🥠",sushi:"🍣",bento:"🍱",curry:"🍛",rice_ball:"🍙",rice:"🍚",rice_cracker:"🍘",oden:"🍢",dango:"🍡",shaved_ice:"🍧",ice_cream:"🍨",icecream:"🍦",pie:"🥧",cake:"🍰",cupcake:"🧁",moon_cake:"🥮",birthday:"🎂",custard:"🍮",candy:"🍬",lollipop:"🍭",chocolate_bar:"🍫",popcorn:"🍿",dumpling:"🥟",doughnut:"🍩",cookie:"🍪",milk_glass:"🥛",beer:"🍺",beers:"🍻",clinking_glasses:"🥂",wine_glass:"🍷",tumbler_glass:"🥃",cocktail:"🍸",tropical_drink:"🍹",champagne:"🍾",sake:"🍶",tea:"🍵",cup_with_straw:"🥤",coffee:"☕",baby_bottle:"🍼",salt:"🧂",spoon:"🥄",fork_and_knife:"🍴",plate_with_cutlery:"🍽",bowl_with_spoon:"🥣",takeout_box:"🥡",chopsticks:"🥢",soccer:"⚽",basketball:"🏀",football:"🏈",baseball:"⚾",softball:"🥎",tennis:"🎾",volleyball:"🏐",rugby_football:"🏉",flying_disc:"🥏","8ball":"🎱",golf:"⛳",golfing_woman:"🏌️♀️",golfing_man:"🏌",ping_pong:"🏓",badminton:"🏸",goal_net:"🥅",ice_hockey:"🏒",field_hockey:"🏑",lacrosse:"🥍",cricket:"🏏",ski:"🎿",skier:"⛷",snowboarder:"🏂",person_fencing:"🤺",women_wrestling:"🤼♀️",men_wrestling:"🤼♂️",woman_cartwheeling:"🤸♀️",man_cartwheeling:"🤸♂️",woman_playing_handball:"🤾♀️",man_playing_handball:"🤾♂️",ice_skate:"⛸",curling_stone:"🥌",skateboard:"🛹",sled:"🛷",bow_and_arrow:"🏹",fishing_pole_and_fish:"🎣",boxing_glove:"🥊",martial_arts_uniform:"🥋",rowing_woman:"🚣♀️",rowing_man:"🚣",climbing_woman:"🧗♀️",climbing_man:"🧗♂️",swimming_woman:"🏊♀️",swimming_man:"🏊",woman_playing_water_polo:"🤽♀️",man_playing_water_polo:"🤽♂️",woman_in_lotus_position:"🧘♀️",man_in_lotus_position:"🧘♂️",surfing_woman:"🏄♀️",surfing_man:"🏄",bath:"🛀",basketball_woman:"⛹️♀️",basketball_man:"⛹",weight_lifting_woman:"🏋️♀️",weight_lifting_man:"🏋",biking_woman:"🚴♀️",biking_man:"🚴",mountain_biking_woman:"🚵♀️",mountain_biking_man:"🚵",horse_racing:"🏇",business_suit_levitating:"🕴",trophy:"🏆",running_shirt_with_sash:"🎽",medal_sports:"🏅",medal_military:"🎖","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉",reminder_ribbon:"🎗",rosette:"🏵",ticket:"🎫",tickets:"🎟",performing_arts:"🎭",art:"🎨",circus_tent:"🎪",woman_juggling:"🤹♀️",man_juggling:"🤹♂️",microphone:"🎤",headphones:"🎧",musical_score:"🎼",musical_keyboard:"🎹",drum:"🥁",saxophone:"🎷",trumpet:"🎺",guitar:"🎸",violin:"🎻",clapper:"🎬",video_game:"🎮",space_invader:"👾",dart:"🎯",game_die:"🎲",chess_pawn:"♟",slot_machine:"🎰",jigsaw:"🧩",bowling:"🎳",red_car:"🚗",taxi:"🚕",blue_car:"🚙",bus:"🚌",trolleybus:"🚎",racing_car:"🏎",police_car:"🚓",ambulance:"🚑",fire_engine:"🚒",minibus:"🚐",truck:"🚚",articulated_lorry:"🚛",tractor:"🚜",kick_scooter:"🛴",motorcycle:"🏍",bike:"🚲",motor_scooter:"🛵",rotating_light:"🚨",oncoming_police_car:"🚔",oncoming_bus:"🚍",oncoming_automobile:"🚘",oncoming_taxi:"🚖",aerial_tramway:"🚡",mountain_cableway:"🚠",suspension_railway:"🚟",railway_car:"🚃",train:"🚋",monorail:"🚝",bullettrain_side:"🚄",bullettrain_front:"🚅",light_rail:"🚈",mountain_railway:"🚞",steam_locomotive:"🚂",train2:"🚆",metro:"🚇",tram:"🚊",station:"🚉",flying_saucer:"🛸",helicopter:"🚁",small_airplane:"🛩",airplane:"✈️",flight_departure:"🛫",flight_arrival:"🛬",sailboat:"⛵",motor_boat:"🛥",speedboat:"🚤",ferry:"⛴",passenger_ship:"🛳",rocket:"🚀",artificial_satellite:"🛰",seat:"💺",canoe:"🛶",anchor:"⚓",construction:"🚧",fuelpump:"⛽",busstop:"🚏",vertical_traffic_light:"🚦",traffic_light:"🚥",checkered_flag:"🏁",ship:"🚢",ferris_wheel:"🎡",roller_coaster:"🎢",carousel_horse:"🎠",building_construction:"🏗",foggy:"🌁",tokyo_tower:"🗼",factory:"🏭",fountain:"⛲",rice_scene:"🎑",mountain:"⛰",mountain_snow:"🏔",mount_fuji:"🗻",volcano:"🌋",japan:"🗾",camping:"🏕",tent:"⛺",national_park:"🏞",motorway:"🛣",railway_track:"🛤",sunrise:"🌅",sunrise_over_mountains:"🌄",desert:"🏜",beach_umbrella:"🏖",desert_island:"🏝",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",night_with_stars:"🌃",bridge_at_night:"🌉",milky_way:"🌌",stars:"🌠",sparkler:"🎇",fireworks:"🎆",rainbow:"🌈",houses:"🏘",european_castle:"🏰",japanese_castle:"🏯",stadium:"🏟",statue_of_liberty:"🗽",house:"🏠",house_with_garden:"🏡",derelict_house:"🏚",office:"🏢",department_store:"🏬",post_office:"🏣",european_post_office:"🏤",hospital:"🏥",bank:"🏦",hotel:"🏨",convenience_store:"🏪",school:"🏫",love_hotel:"🏩",wedding:"💒",classical_building:"🏛",church:"⛪",mosque:"🕌",synagogue:"🕍",kaaba:"🕋",shinto_shrine:"⛩",watch:"⌚",iphone:"📱",calling:"📲",computer:"💻",keyboard:"⌨",desktop_computer:"🖥",printer:"🖨",computer_mouse:"🖱",trackball:"🖲",joystick:"🕹",clamp:"🗜",minidisc:"💽",floppy_disk:"💾",cd:"💿",dvd:"📀",vhs:"📼",camera:"📷",camera_flash:"📸",video_camera:"📹",movie_camera:"🎥",film_projector:"📽",film_strip:"🎞",telephone_receiver:"📞",phone:"☎️",pager:"📟",fax:"📠",tv:"📺",radio:"📻",studio_microphone:"🎙",level_slider:"🎚",control_knobs:"🎛",compass:"🧭",stopwatch:"⏱",timer_clock:"⏲",alarm_clock:"⏰",mantelpiece_clock:"🕰",hourglass_flowing_sand:"⏳",hourglass:"⌛",satellite:"📡",battery:"🔋",electric_plug:"🔌",bulb:"💡",flashlight:"🔦",candle:"🕯",fire_extinguisher:"🧯",wastebasket:"🗑",oil_drum:"🛢",money_with_wings:"💸",dollar:"💵",yen:"💴",euro:"💶",pound:"💷",moneybag:"💰",credit_card:"💳",gem:"💎",balance_scale:"⚖",toolbox:"🧰",wrench:"🔧",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",pick:"⛏",nut_and_bolt:"🔩",gear:"⚙",brick:"🧱",chains:"⛓",magnet:"🧲",gun:"🔫",bomb:"💣",firecracker:"🧨",hocho:"🔪",dagger:"🗡",crossed_swords:"⚔",shield:"🛡",smoking:"🚬",skull_and_crossbones:"☠",coffin:"⚰",funeral_urn:"⚱",amphora:"🏺",crystal_ball:"🔮",prayer_beads:"📿",nazar_amulet:"🧿",barber:"💈",alembic:"⚗",telescope:"🔭",microscope:"🔬",hole:"🕳",pill:"💊",syringe:"💉",dna:"🧬",microbe:"🦠",petri_dish:"🧫",test_tube:"🧪",thermometer:"🌡",broom:"🧹",basket:"🧺",toilet_paper:"🧻",label:"🏷",bookmark:"🔖",toilet:"🚽",shower:"🚿",bathtub:"🛁",soap:"🧼",sponge:"🧽",lotion_bottle:"🧴",key:"🔑",old_key:"🗝",couch_and_lamp:"🛋",sleeping_bed:"🛌",bed:"🛏",door:"🚪",bellhop_bell:"🛎",teddy_bear:"🧸",framed_picture:"🖼",world_map:"🗺",parasol_on_ground:"⛱",moyai:"🗿",shopping:"🛍",shopping_cart:"🛒",balloon:"🎈",flags:"🎏",ribbon:"🎀",gift:"🎁",confetti_ball:"🎊",tada:"🎉",dolls:"🎎",wind_chime:"🎐",crossed_flags:"🎌",izakaya_lantern:"🏮",red_envelope:"🧧",email:"✉️",envelope_with_arrow:"📩",incoming_envelope:"📨","e-mail":"📧",love_letter:"💌",postbox:"📮",mailbox_closed:"📪",mailbox:"📫",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",package:"📦",postal_horn:"📯",inbox_tray:"📥",outbox_tray:"📤",scroll:"📜",page_with_curl:"📃",bookmark_tabs:"📑",receipt:"🧾",bar_chart:"📊",chart_with_upwards_trend:"📈",chart_with_downwards_trend:"📉",page_facing_up:"📄",date:"📅",calendar:"📆",spiral_calendar:"🗓",card_index:"📇",card_file_box:"🗃",ballot_box:"🗳",file_cabinet:"🗄",clipboard:"📋",spiral_notepad:"🗒",file_folder:"📁",open_file_folder:"📂",card_index_dividers:"🗂",newspaper_roll:"🗞",newspaper:"📰",notebook:"📓",closed_book:"📕",green_book:"📗",blue_book:"📘",orange_book:"📙",notebook_with_decorative_cover:"📔",ledger:"📒",books:"📚",open_book:"📖",safety_pin:"🧷",link:"🔗",paperclip:"📎",paperclips:"🖇",scissors:"✂️",triangular_ruler:"📐",straight_ruler:"📏",abacus:"🧮",pushpin:"📌",round_pushpin:"📍",triangular_flag_on_post:"🚩",white_flag:"🏳",black_flag:"🏴",rainbow_flag:"🏳️🌈",closed_lock_with_key:"🔐",lock:"🔒",unlock:"🔓",lock_with_ink_pen:"🔏",pen:"🖊",fountain_pen:"🖋",black_nib:"✒️",memo:"📝",pencil2:"✏️",crayon:"🖍",paintbrush:"🖌",mag:"🔍",mag_right:"🔎",heart:"❤️",orange_heart:"🧡",yellow_heart:"💛",green_heart:"💚",blue_heart:"💙",purple_heart:"💜",black_heart:"🖤",broken_heart:"💔",heavy_heart_exclamation:"❣",two_hearts:"💕",revolving_hearts:"💞",heartbeat:"💓",heartpulse:"💗",sparkling_heart:"💖",cupid:"💘",gift_heart:"💝",heart_decoration:"💟",peace_symbol:"☮",latin_cross:"✝",star_and_crescent:"☪",om:"🕉",wheel_of_dharma:"☸",star_of_david:"✡",six_pointed_star:"🔯",menorah:"🕎",yin_yang:"☯",orthodox_cross:"☦",place_of_worship:"🛐",ophiuchus:"⛎",aries:"♈",taurus:"♉",gemini:"♊",cancer:"♋",leo:"♌",virgo:"♍",libra:"♎",scorpius:"♏",sagittarius:"♐",capricorn:"♑",aquarius:"♒",pisces:"♓",id:"🆔",atom_symbol:"⚛",u7a7a:"🈳",u5272:"🈹",radioactive:"☢",biohazard:"☣",mobile_phone_off:"📴",vibration_mode:"📳",u6709:"🈶",u7121:"🈚",u7533:"🈸",u55b6:"🈺",u6708:"🈷️",eight_pointed_black_star:"✴️",vs:"🆚",accept:"🉑",white_flower:"💮",ideograph_advantage:"🉐",secret:"㊙️",congratulations:"㊗️",u5408:"🈴",u6e80:"🈵",u7981:"🈲",a:"🅰️",b:"🅱️",ab:"🆎",cl:"🆑",o2:"🅾️",sos:"🆘",no_entry:"⛔",name_badge:"📛",no_entry_sign:"🚫",x:"❌",o:"⭕",stop_sign:"🛑",anger:"💢",hotsprings:"♨️",no_pedestrians:"🚷",do_not_litter:"🚯",no_bicycles:"🚳","non-potable_water":"🚱",underage:"🔞",no_mobile_phones:"📵",exclamation:"❗",grey_exclamation:"❕",question:"❓",grey_question:"❔",bangbang:"‼️",interrobang:"⁉️",low_brightness:"🔅",high_brightness:"🔆",trident:"🔱",fleur_de_lis:"⚜",part_alternation_mark:"〽️",warning:"⚠️",children_crossing:"🚸",beginner:"🔰",recycle:"♻️",u6307:"🈯",chart:"💹",sparkle:"❇️",eight_spoked_asterisk:"✳️",negative_squared_cross_mark:"❎",white_check_mark:"✅",diamond_shape_with_a_dot_inside:"💠",cyclone:"🌀",loop:"➿",globe_with_meridians:"🌐",m:"Ⓜ️",atm:"🏧",sa:"🈂️",passport_control:"🛂",customs:"🛃",baggage_claim:"🛄",left_luggage:"🛅",wheelchair:"♿",no_smoking:"🚭",wc:"🚾",parking:"🅿️",potable_water:"🚰",mens:"🚹",womens:"🚺",baby_symbol:"🚼",restroom:"🚻",put_litter_in_its_place:"🚮",cinema:"🎦",signal_strength:"📶",koko:"🈁",ng:"🆖",ok:"🆗",up:"🆙",cool:"🆒",new:"🆕",free:"🆓",zero:"0️⃣",one:"1️⃣",two:"2️⃣",three:"3️⃣",four:"4️⃣",five:"5️⃣",six:"6️⃣",seven:"7️⃣",eight:"8️⃣",nine:"9️⃣",keycap_ten:"🔟",asterisk:"*⃣",eject_button:"⏏️",arrow_forward:"▶️",pause_button:"⏸",next_track_button:"⏭",stop_button:"⏹",record_button:"⏺",play_or_pause_button:"⏯",previous_track_button:"⏮",fast_forward:"⏩",rewind:"⏪",twisted_rightwards_arrows:"🔀",repeat:"🔁",repeat_one:"🔂",arrow_backward:"◀️",arrow_up_small:"🔼",arrow_down_small:"🔽",arrow_double_up:"⏫",arrow_double_down:"⏬",arrow_right:"➡️",arrow_left:"⬅️",arrow_up:"⬆️",arrow_down:"⬇️",arrow_upper_right:"↗️",arrow_lower_right:"↘️",arrow_lower_left:"↙️",arrow_upper_left:"↖️",arrow_up_down:"↕️",left_right_arrow:"↔️",arrows_counterclockwise:"🔄",arrow_right_hook:"↪️",leftwards_arrow_with_hook:"↩️",arrow_heading_up:"⤴️",arrow_heading_down:"⤵️",hash:"#️⃣",information_source:"ℹ️",abc:"🔤",abcd:"🔡",capital_abcd:"🔠",symbols:"🔣",musical_note:"🎵",notes:"🎶",wavy_dash:"〰️",curly_loop:"➰",heavy_check_mark:"✔️",arrows_clockwise:"🔃",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",heavy_multiplication_x:"✖️",infinity:"♾",heavy_dollar_sign:"💲",currency_exchange:"💱",copyright:"©️",registered:"®️",tm:"™️",end:"🔚",back:"🔙",on:"🔛",top:"🔝",soon:"🔜",ballot_box_with_check:"☑️",radio_button:"🔘",white_circle:"⚪",black_circle:"⚫",red_circle:"🔴",large_blue_circle:"🔵",small_orange_diamond:"🔸",small_blue_diamond:"🔹",large_orange_diamond:"🔶",large_blue_diamond:"🔷",small_red_triangle:"🔺",black_small_square:"▪️",white_small_square:"▫️",black_large_square:"⬛",white_large_square:"⬜",small_red_triangle_down:"🔻",black_medium_square:"◼️",white_medium_square:"◻️",black_medium_small_square:"◾",white_medium_small_square:"◽",black_square_button:"🔲",white_square_button:"🔳",speaker:"🔈",sound:"🔉",loud_sound:"🔊",mute:"🔇",mega:"📣",loudspeaker:"📢",bell:"🔔",no_bell:"🔕",black_joker:"🃏",mahjong:"🀄",spades:"♠️",clubs:"♣️",hearts:"♥️",diamonds:"♦️",flower_playing_cards:"🎴",thought_balloon:"💭",right_anger_bubble:"🗯",speech_balloon:"💬",left_speech_bubble:"🗨",clock1:"🕐",clock2:"🕑",clock3:"🕒",clock4:"🕓",clock5:"🕔",clock6:"🕕",clock7:"🕖",clock8:"🕗",clock9:"🕘",clock10:"🕙",clock11:"🕚",clock12:"🕛",clock130:"🕜",clock230:"🕝",clock330:"🕞",clock430:"🕟",clock530:"🕠",clock630:"🕡",clock730:"🕢",clock830:"🕣",clock930:"🕤",clock1030:"🕥",clock1130:"🕦",clock1230:"🕧",afghanistan:"🇦🇫",aland_islands:"🇦🇽",albania:"🇦🇱",algeria:"🇩🇿",american_samoa:"🇦🇸",andorra:"🇦🇩",angola:"🇦🇴",anguilla:"🇦🇮",antarctica:"🇦🇶",antigua_barbuda:"🇦🇬",argentina:"🇦🇷",armenia:"🇦🇲",aruba:"🇦🇼",australia:"🇦🇺",austria:"🇦🇹",azerbaijan:"🇦🇿",bahamas:"🇧🇸",bahrain:"🇧🇭",bangladesh:"🇧🇩",barbados:"🇧🇧",belarus:"🇧🇾",belgium:"🇧🇪",belize:"🇧🇿",benin:"🇧🇯",bermuda:"🇧🇲",bhutan:"🇧🇹",bolivia:"🇧🇴",caribbean_netherlands:"🇧🇶",bosnia_herzegovina:"🇧🇦",botswana:"🇧🇼",brazil:"🇧🇷",british_indian_ocean_territory:"🇮🇴",british_virgin_islands:"🇻🇬",brunei:"🇧🇳",bulgaria:"🇧🇬",burkina_faso:"🇧🇫",burundi:"🇧🇮",cape_verde:"🇨🇻",cambodia:"🇰🇭",cameroon:"🇨🇲",canada:"🇨🇦",canary_islands:"🇮🇨",cayman_islands:"🇰🇾",central_african_republic:"🇨🇫",chad:"🇹🇩",chile:"🇨🇱",cn:"🇨🇳",christmas_island:"🇨🇽",cocos_islands:"🇨🇨",colombia:"🇨🇴",comoros:"🇰🇲",congo_brazzaville:"🇨🇬",congo_kinshasa:"🇨🇩",cook_islands:"🇨🇰",costa_rica:"🇨🇷",croatia:"🇭🇷",cuba:"🇨🇺",curacao:"🇨🇼",cyprus:"🇨🇾",czech_republic:"🇨🇿",denmark:"🇩🇰",djibouti:"🇩🇯",dominica:"🇩🇲",dominican_republic:"🇩🇴",ecuador:"🇪🇨",egypt:"🇪🇬",el_salvador:"🇸🇻",equatorial_guinea:"🇬🇶",eritrea:"🇪🇷",estonia:"🇪🇪",ethiopia:"🇪🇹",eu:"🇪🇺",falkland_islands:"🇫🇰",faroe_islands:"🇫🇴",fiji:"🇫🇯",finland:"🇫🇮",fr:"🇫🇷",french_guiana:"🇬🇫",french_polynesia:"🇵🇫",french_southern_territories:"🇹🇫",gabon:"🇬🇦",gambia:"🇬🇲",georgia:"🇬🇪",de:"🇩🇪",ghana:"🇬🇭",gibraltar:"🇬🇮",greece:"🇬🇷",greenland:"🇬🇱",grenada:"🇬🇩",guadeloupe:"🇬🇵",guam:"🇬🇺",guatemala:"🇬🇹",guernsey:"🇬🇬",guinea:"🇬🇳",guinea_bissau:"🇬🇼",guyana:"🇬🇾",haiti:"🇭🇹",honduras:"🇭🇳",hong_kong:"🇭🇰",hungary:"🇭🇺",iceland:"🇮🇸",india:"🇮🇳",indonesia:"🇮🇩",iran:"🇮🇷",iraq:"🇮🇶",ireland:"🇮🇪",isle_of_man:"🇮🇲",israel:"🇮🇱",it:"🇮🇹",cote_divoire:"🇨🇮",jamaica:"🇯🇲",jp:"🇯🇵",jersey:"🇯🇪",jordan:"🇯🇴",kazakhstan:"🇰🇿",kenya:"🇰🇪",kiribati:"🇰🇮",kosovo:"🇽🇰",kuwait:"🇰🇼",kyrgyzstan:"🇰🇬",laos:"🇱🇦",latvia:"🇱🇻",lebanon:"🇱🇧",lesotho:"🇱🇸",liberia:"🇱🇷",libya:"🇱🇾",liechtenstein:"🇱🇮",lithuania:"🇱🇹",luxembourg:"🇱🇺",macau:"🇲🇴",macedonia:"🇲🇰",madagascar:"🇲🇬",malawi:"🇲🇼",malaysia:"🇲🇾",maldives:"🇲🇻",mali:"🇲🇱",malta:"🇲🇹",marshall_islands:"🇲🇭",martinique:"🇲🇶",mauritania:"🇲🇷",mauritius:"🇲🇺",mayotte:"🇾🇹",mexico:"🇲🇽",micronesia:"🇫🇲",moldova:"🇲🇩",monaco:"🇲🇨",mongolia:"🇲🇳",montenegro:"🇲🇪",montserrat:"🇲🇸",morocco:"🇲🇦",mozambique:"🇲🇿",myanmar:"🇲🇲",namibia:"🇳🇦",nauru:"🇳🇷",nepal:"🇳🇵",netherlands:"🇳🇱",new_caledonia:"🇳🇨",new_zealand:"🇳🇿",nicaragua:"🇳🇮",niger:"🇳🇪",nigeria:"🇳🇬",niue:"🇳🇺",norfolk_island:"🇳🇫",northern_mariana_islands:"🇲🇵",north_korea:"🇰🇵",norway:"🇳🇴",oman:"🇴🇲",pakistan:"🇵🇰",palau:"🇵🇼",palestinian_territories:"🇵🇸",panama:"🇵🇦",papua_new_guinea:"🇵🇬",paraguay:"🇵🇾",peru:"🇵🇪",philippines:"🇵🇭",pitcairn_islands:"🇵🇳",poland:"🇵🇱",portugal:"🇵🇹",puerto_rico:"🇵🇷",qatar:"🇶🇦",reunion:"🇷🇪",romania:"🇷🇴",ru:"🇷🇺",rwanda:"🇷🇼",st_barthelemy:"🇧🇱",st_helena:"🇸🇭",st_kitts_nevis:"🇰🇳",st_lucia:"🇱🇨",st_pierre_miquelon:"🇵🇲",st_vincent_grenadines:"🇻🇨",samoa:"🇼🇸",san_marino:"🇸🇲",sao_tome_principe:"🇸🇹",saudi_arabia:"🇸🇦",senegal:"🇸🇳",serbia:"🇷🇸",seychelles:"🇸🇨",sierra_leone:"🇸🇱",singapore:"🇸🇬",sint_maarten:"🇸🇽",slovakia:"🇸🇰",slovenia:"🇸🇮",solomon_islands:"🇸🇧",somalia:"🇸🇴",south_africa:"🇿🇦",south_georgia_south_sandwich_islands:"🇬🇸",kr:"🇰🇷",south_sudan:"🇸🇸",es:"🇪🇸",sri_lanka:"🇱🇰",sudan:"🇸🇩",suriname:"🇸🇷",swaziland:"🇸🇿",sweden:"🇸🇪",switzerland:"🇨🇭",syria:"🇸🇾",taiwan:"🇹🇼",tajikistan:"🇹🇯",tanzania:"🇹🇿",thailand:"🇹🇭",timor_leste:"🇹🇱",togo:"🇹🇬",tokelau:"🇹🇰",tonga:"🇹🇴",trinidad_tobago:"🇹🇹",tunisia:"🇹🇳",tr:"🇹🇷",turkmenistan:"🇹🇲",turks_caicos_islands:"🇹🇨",tuvalu:"🇹🇻",uganda:"🇺🇬",ukraine:"🇺🇦",united_arab_emirates:"🇦🇪",uk:"🇬🇧",england:"🏴",scotland:"🏴",wales:"🏴",us:"🇺🇸",us_virgin_islands:"🇻🇮",uruguay:"🇺🇾",uzbekistan:"🇺🇿",vanuatu:"🇻🇺",vatican_city:"🇻🇦",venezuela:"🇻🇪",vietnam:"🇻🇳",wallis_futuna:"🇼🇫",western_sahara:"🇪🇭",yemen:"🇾🇪",zambia:"🇿🇲",zimbabwe:"🇿🇼",united_nations:"🇺🇳",pirate_flag:"🏴☠️"},ec=typeof navigator<"u"&&navigator.hardwareConcurrency?Math.max(1,Math.floor(navigator.hardwareConcurrency/2)):2,ts=Sa(()=>{if(typeof Worker<"u")try{return new Xl}catch{}try{if(Gt)return Gt(Ql)}catch{}const e={message:[],error:[]};return{addEventListener(t,n){e[t]||(e[t]=[]),e[t].push(n)},removeEventListener(t,n){if(!e[t])return;const i=e[t].indexOf(n);i!==-1&&e[t].splice(i,1)},postMessage(t){setTimeout(async()=>{try{if(Jl&&typeof Qr=="function"&&t&&t.type==="stream")await Qr(t,n=>{const i={data:n};(e.message||[]).forEach(r=>r(i))});else{const i={data:await xi(t)};(e.message||[]).forEach(r=>r(i))}}catch(n){const i={data:{id:t&&t.id,error:String(n)}};(e.message||[]).forEach(r=>r(i))}},0)},terminate(){Object.keys(e).forEach(t=>e[t].length=0)}}},"markdown",ec),wt=()=>ts.get(),Si=(e,t=3e3)=>ts.send(e,t),At=[];function Xr(e){if(e&&(typeof e=="object"||typeof e=="function")){At.push(e);try{Me.use(e)}catch(t){k("[markdown] failed to apply plugin",t)}}}function tc(e){At.length=0,Array.isArray(e)&&At.push(...e.filter(t=>t&&typeof t=="object"));try{At.forEach(t=>Me.use(t))}catch(t){k("[markdown] failed to apply markdown extensions",t)}}function Kr(e){try{return String(e||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}}function ns(e,t){const n=String(e||"");if(!n||n.length<=t)return[n];const i=/^#{1,6}\s.*$/gm,r=[];let a;for(;(a=i.exec(n))!==null;)r.push(a.index);if(!r.length||r.length<2){const c=[];for(let u=0;u<n.length;u+=t)c.push(n.slice(u,u+t));return c}const s=[];r[0]>0&&s.push(n.slice(0,r[0]));for(let c=0;c<r.length;c++){const u=r[c],g=c+1<r.length?r[c+1]:n.length;s.push(n.slice(u,g))}const o=[];let l="";for(const c of s){if(!l&&c.length>=t){o.push(c);continue}l.length+c.length<=t?l+=c:(l&&o.push(l),l=c)}return l&&o.push(l),o}async function Vr(e,t,n={}){const i=n&&n.chunkSize?Number(n.chunkSize):65536,r=typeof t=="function"?t:(()=>{}),{content:a,data:s}=en(String(e||""));let o=a;try{o=String(o||"").replace(/:([^:\s]+):/g,(h,d)=>rr[d]||h)}catch{}let l;if(typeof process<"u"&&process.env&&process.env.VITEST)try{const h=await Promise.resolve().then(()=>vi);l=h.initRendererWorker&&h.initRendererWorker()}catch{l=wt&&wt()}else l=wt&&wt();if(!(typeof process<"u"&&process.env&&process.env.VITEST)&&l&&typeof l.postMessage=="function")return new Promise((h,d)=>{const p=String(Math.random());let m=null;const f=()=>{m&&clearTimeout(m);try{l.removeEventListener&&l.removeEventListener("message",w)}catch{}try{l.removeEventListener&&l.removeEventListener("error",y)}catch{}},w=_=>{const b=_&&_.data?_.data:{};if(b.id===p){if(b.error)return f(),d(new Error(b.error));if(b.type==="chunk"){try{r(String(b.html||""),{index:b.index,isLast:!!b.isLast,meta:{},toc:b.toc||[]})}catch{}return}if(b.type==="done"){f();try{r("",{index:-1,isLast:!0,meta:b.meta||{}})}catch{}return h()}if(b.result){f();try{r(String(b.result&&b.result.html||""),{index:0,isLast:!0,meta:b.result.meta||{},toc:b.result.toc||[]})}catch{}return h()}}},y=_=>{f(),d(new Error(_&&_.message||"worker error"))};m=setTimeout(()=>{f(),d(new Error("worker timeout"))},n&&n.timeout?Number(n.timeout):1e4);try{l.addEventListener&&l.addEventListener("message",w),l.addEventListener&&l.addEventListener("error",y),l.postMessage({type:"stream",id:p,md:o,chunkSize:i})}catch(_){f(),d(_)}});const c=ns(o,i),u=He(),g=new Map;for(let h=0;h<c.length;h++){const d=c[h],p=await hn(d);let m=String(p&&p.html||""),f=[];if(u)try{const y=u.parseFromString(m,"text/html");y.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(b=>{try{const A=Number(b.tagName.substring(1)),S=(b.textContent||"").trim(),E=Kr(S),O=(g.get(E)||0)+1;g.set(E,O);const W=O===1?E:E+"-"+O;b.id=W,f.push({level:A,text:S,id:W})}catch{}});try{typeof XMLSerializer<"u"?m=new XMLSerializer().serializeToString(y.body).replace(/^<body[^>]*>/i,"").replace(/<\/body>$/i,""):m=Array.from(y.body.childNodes||[]).map(A=>A&&typeof A.outerHTML=="string"?A.outerHTML:A&&typeof A.textContent=="string"?A.textContent:"").join("")}catch{}}catch{}else try{const y=[];m=m.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(_,b,A,S)=>{const E=Number(b),I=S.replace(/<[^>]+>/g,"").trim(),O=Kr(I),z=(g.get(O)||0)+1;g.set(O,z);const B=z===1?O:O+"-"+z;y.push({level:E,text:I,id:B});const Z=(A||"").replace(/\s*(id|class)="[^"]*"/g,"");return`<h${E} ${Z} id="${B}">${S}</h${E}>`}),f=y}catch{}const w={index:h,isLast:h===c.length-1,meta:h===0?s||{}:{},toc:f};try{r(m,w)}catch{}}}async function hn(e){if(At&&At.length){let{content:i,data:r}=en(e||"");try{i=String(i||"").replace(/:([^:\s]+):/g,(s,o)=>rr[o]||s)}catch{}Me.setOptions({gfm:!0,mangle:!1,headerIds:!1,headerPrefix:""});try{At.forEach(s=>Me.use(s))}catch(s){k("[markdown] apply plugins failed",s)}const a=Me.parse(i);try{const s=He();if(s){const o=s.parseFromString(a,"text/html"),l=o.querySelectorAll("h1,h2,h3,h4,h5,h6"),c=[],u=new Set,g=d=>{try{return String(d||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}},h=d=>{const p={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},m=d<=2?"has-text-weight-bold":d<=4?"has-text-weight-semibold":"has-text-weight-normal";return(p[d]+" "+m).trim()};l.forEach(d=>{try{const p=Number(d.tagName.substring(1)),m=(d.textContent||"").trim();let f=g(m)||"heading",w=f,y=2;for(;u.has(w);)w=f+"-"+y,y+=1;u.add(w),d.id=w,d.className=h(p),c.push({level:p,text:m,id:w})}catch{}});try{(o&&typeof o.getElementsByTagName=="function"?Array.from(o.getElementsByTagName("img")):o&&typeof o.querySelectorAll=="function"?Array.from(o.querySelectorAll("img")):[]).forEach(p=>{try{const m=p.getAttribute&&p.getAttribute("loading"),f=p.getAttribute&&p.getAttribute("data-want-lazy");!m&&!f&&p.setAttribute&&p.setAttribute("loading","lazy")}catch{}})}catch{}try{o.querySelectorAll("pre code, code[class]").forEach(d=>{try{const p=d.getAttribute&&d.getAttribute("class")||d.className||"",m=String(p||"").replace(/\blanguage-undefined\b|\blang-undefined\b/g,"").trim();if(m)try{d.setAttribute&&d.setAttribute("class",m)}catch{d.className=m}else try{d.removeAttribute&&d.removeAttribute("class")}catch{d.className=""}}catch{}})}catch{}try{let d=null;try{typeof XMLSerializer<"u"?d=new XMLSerializer().serializeToString(o.body).replace(/^<body[^>]*>/i,"").replace(/<\/body>$/i,""):d=Array.from(o.body.childNodes||[]).map(m=>m&&typeof m.outerHTML=="string"?m.outerHTML:m&&typeof m.textContent=="string"?m.textContent:"").join("")}catch{try{d=o.body.innerHTML}catch{d=""}}return{html:d,meta:r||{},toc:c}}catch{return{html:"",meta:r||{},toc:c}}}}catch{}return{html:a,meta:r||{},toc:[]}}let t;if(typeof process<"u"&&process.env&&process.env.VITEST)try{const i=await Promise.resolve().then(()=>vi);t=i.initRendererWorker&&i.initRendererWorker()}catch{t=wt&&wt()}else t=wt&&wt();try{e=String(e||"").replace(/:([^:\s]+):/g,(i,r)=>rr[r]||i)}catch{}try{if(typeof Re<"u"&&Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")&&/```\s*\n/.test(String(e||""))){let{content:i,data:r}=en(e||"");try{i=String(i||"").replace(/:([^:\s]+):/g,(c,u)=>rr[u]||c)}catch{}Me.setOptions({gfm:!0,headerIds:!0,mangle:!1,highlighted:(c,u)=>{try{return u&&Re.getLanguage&&Re.getLanguage(u)?Re.highlight(c,{language:u}).value:Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")?Re.highlight(c,{language:"plaintext"}).value:c}catch{return c}}});let a=Me.parse(i);try{a=a.replace(/<pre><code>([\s\S]*?)<\/code><\/pre>/g,(c,u)=>{try{if(u&&Re&&typeof Re.highlight=="function")try{const g=Re.highlight(u,{language:"plaintext"});return`<pre><code>${g&&g.value?g.value:g}</code></pre>`}catch{try{if(Re&&typeof Re.highlightElement=="function"){const h={innerHTML:u};return Re.highlightElement(h),`<pre><code>${h.innerHTML}</code></pre>`}}catch{}}}catch{}return c})}catch{}const s=[],o=new Set,l=c=>{try{return String(c||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}};return a=a.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(c,u,g,h)=>{const d=Number(u),p=h.replace(/<[^>]+>/g,"").trim();let m=l(p)||"heading",f=m,w=2;for(;o.has(f);)f=m+"-"+w,w+=1;o.add(f),s.push({level:d,text:p,id:f});const y={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},_=d<=2?"has-text-weight-bold":d<=4?"has-text-weight-semibold":"has-text-weight-normal",b=(y[d]+" "+_).trim(),S=((g||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${f}" class="${b}"`).trim();return`<h${d} ${S}>${h}</h${d}>`}),a=a.replace(/<img([^>]*)>/g,(c,u)=>/\bloading=/.test(u)?`<img${u}>`:/\bdata-want-lazy=/.test(u)?`<img${u}>`:`<img${u} loading="lazy">`),{html:a,meta:r||{},toc:s}}}catch{}if(!t)throw new Error("renderer worker required but unavailable");const n=await Si({type:"render",md:e});if(!n||typeof n!="object"||n.html===void 0)throw new Error("renderer worker returned invalid response");try{const i=new Map,r=[],a=l=>{try{return String(l||"").toLowerCase().trim().replace(/[^a-z0-9\-\s]+/g,"").replace(/\s+/g,"-")}catch{return"heading"}},s=l=>{const c={1:"is-size-3-mobile is-size-2-tablet is-size-1-desktop",2:"is-size-4-mobile is-size-3-tablet is-size-2-desktop",3:"is-size-5-mobile is-size-4-tablet is-size-3-desktop",4:"is-size-6-mobile is-size-5-tablet is-size-4-desktop",5:"is-size-6-mobile is-size-6-tablet is-size-5-desktop",6:"is-size-6-mobile is-size-6-tablet is-size-6-desktop"},u=l<=2?"has-text-weight-bold":l<=4?"has-text-weight-semibold":"has-text-weight-normal";return(c[l]+" "+u).trim()};let o=n.html;o=o.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(l,c,u,g)=>{const h=Number(c),d=g.replace(/<[^>]+>/g,"").trim(),p=(u||"").match(/\sid="([^"]+)"/),m=p?p[1]:a(d)||"heading",w=(i.get(m)||0)+1;i.set(m,w);const y=w===1?m:m+"-"+w;r.push({level:h,text:d,id:y});const _=s(h),A=((u||"").replace(/\s*(id|class)="[^"]*"/g,"")+` id="${y}" class="${_}"`).trim();return`<h${h} ${A}>${g}</h${h}>`});try{const l=typeof document<"u"&&document.documentElement&&document.documentElement.getAttribute&&document.documentElement.getAttribute("data-nimbi-logo-moved")||"";if(l){const c=He();if(c){const u=c.parseFromString(o,"text/html");(u&&typeof u.getElementsByTagName=="function"?Array.from(u.getElementsByTagName("img")):u&&typeof u.querySelectorAll=="function"?Array.from(u.querySelectorAll("img")):[]).forEach(h=>{try{const d=h.getAttribute("src")||"";(d?new URL(d,location.href).toString():"")===l&&h.remove()}catch{}});try{typeof XMLSerializer<"u"?o=new XMLSerializer().serializeToString(u.body).replace(/^<body[^>]*>/i,"").replace(/<\/body>$/i,""):o=Array.from(u.body.childNodes||[]).map(d=>d&&typeof d.outerHTML=="string"?d.outerHTML:d&&typeof d.textContent=="string"?d.textContent:"").join("")}catch{try{o=u.body.innerHTML}catch{}}}else try{const u=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=o.replace(new RegExp(`<img[^>]*src=\\"${u}\\"[^>]*>`,"g"),"")}catch{}}}catch{}return{html:o,meta:n.meta||{},toc:r}}catch{return{html:n.html,meta:n.meta||{},toc:n.toc||[]}}}function En(e,t){const n=new Set,i=/```\s*([a-zA-Z0-9_\-+]+)?/g,r=new Set(["then","now","if","once","so","and","or","but","when","the","a","an","as","let","const","var","export","import","from","true","false","null","npm","run","echo","sudo","this","that","have","using","some","return","returns","function","console","log","error","warn","class","new","undefined","with","select","from","where","join","on","group","order","by","having","as","into","values","like","limit","offset","create","table","index","view","insert","update","delete","returning","and","or","not","all","any","exists","case","when","then","else","end","distance","geometry","you","which","would","why","cool","other","same","everything","check"]),a=new Set(["bash","sh","zsh","javascript","js","python","py","php","java","c","cpp","rust","go","ruby","perl","r","scala","swift","kotlin","cs","csharp","html","css","json","xml","yaml","yml","dockerfile","docker"]);let s;for(;s=i.exec(e);)if(s[1]){const o=s[1].toLowerCase();if(si.has(o)||t&&t.size&&o.length<3&&!t.has(o)&&!(dt&&dt[o]&&t.has(dt[o])))continue;if(t&&t.size){if(t.has(o)){const c=t.get(o);c&&n.add(c);continue}if(dt&&dt[o]){const c=dt[o];if(t.has(c)){const u=t.get(c)||c;n.add(u);continue}}}(a.has(o)||o.length>=5&&o.length<=30&&/^[a-z][a-z0-9_\-+]*$/.test(o)&&!r.has(o))&&n.add(o)}return n}async function Yr(e,t){if(At&&At.length||typeof process<"u"&&process.env&&process.env.VITEST)return En(e||"",t);if(wt&&wt())try{const i=t&&t.size?Array.from(t.keys()):[],r=await Si({type:"detect",md:String(e||""),supported:i});if(Array.isArray(r))return new Set(r)}catch(i){k("[markdown] detectFenceLanguagesAsync worker failed",i)}return En(e||"",t)}const vi=Object.freeze(Object.defineProperty({__proto__:null,_sendToRenderer:Si,_slugifyLocal:Kr,_splitIntoSections:ns,addMarkdownExtension:Xr,detectFenceLanguages:En,detectFenceLanguagesAsync:Yr,initRendererWorker:wt,markdownPlugins:At,parseMarkdownToHtml:hn,setMarkdownExtensions:tc,streamParseMarkdown:Vr},Symbol.toStringTag,{value:"Module"}));function nc(e,t=150,n={}){let i=null;const r=!!n.leading;return function(...s){const o=this;if(i&&clearTimeout(i),r&&!i)try{e.apply(o,s)}catch{}i=setTimeout(()=>{if(i=null,!r)try{e.apply(o,s)}catch{}},t)}}function rc(e){let t=!1;return function(...i){const r=this;if(!t){try{e.apply(r,i)}catch{}t=!0;const a=()=>{t=!1};typeof requestAnimationFrame=="function"?requestAnimationFrame(a):setTimeout(a,16);return}}}function ic(){let e=[],t=!1;return function(i){typeof i=="function"&&(e.push(i),!t&&(t=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>{t=!1;const r=e.slice(0);e.length=0;for(const a of r)try{a()}catch{}}):setTimeout(()=>{t=!1;const r=e.slice(0);e.length=0;for(const a of r)try{a()}catch{}},0)))}}const ir=ic(),ac=`/**
|
|
2091
2094
|
* @module worker/anchorWorker
|
|
2092
2095
|
*/
|
|
2093
2096
|
import { _rewriteAnchors } from '../htmlBuilder.js'
|
|
@@ -2163,7 +2166,7 @@ export async function handleAnchorWorkerMessage(msg) {
|
|
|
2163
2166
|
return { id: msg && msg.id, error: String(e) }
|
|
2164
2167
|
}
|
|
2165
2168
|
}
|
|
2166
|
-
`;onmessage=async e=>{const t=e.data||{};try{if(t.type==="rewriteAnchors"){const{id:n,html:i,contentBase:r,pagePath:a}=t;try{const s=qe();if(!s)postMessage({id:n,result:i});else{const o=s.parseFromString(i||"","text/html"),l=o.body;await _i(l,r,a,{canonical:!0}),postMessage({id:n,result:o.body.innerHTML})}}catch(s){postMessage({id:n,error:String(s)})}return}}catch(n){postMessage({id:t.id,error:String(n)})}};async function Ya(e){try{if(e&&e.type==="rewriteAnchors"){const{id:t,html:n,contentBase:i,pagePath:r}=e;try{const a=qe();if(!a)return{id:t,result:n};const s=a.parseFromString(n||"","text/html"),o=s.body;return await _i(o,i,r,{canonical:!0}),{id:t,result:s.body.innerHTML}}catch(a){return{id:t,error:String(a)}}}return{id:e&&e.id,error:"unsupported message"}}catch(t){return{id:e&&e.id,error:String(t)}}}const nc=Object.freeze(Object.defineProperty({__proto__:null,handleAnchorWorkerMessage:Ya},Symbol.toStringTag,{value:"Module"}));function dt(e,t=null){try{const n=typeof location<"u"&&location&&typeof location.pathname=="string"&&location.pathname||"/";return String(n)+ji(e,t)}catch{return ji(e,t)}}function rc(...e){try{k(...e)}catch{}}function ur(e){try{if(Jt(3))return!0}catch{}try{if(typeof le=="string"&&le)return!0}catch{}try{if(V&&V.size)return!0}catch{}try{if($e&&$e.size)return!0}catch{}return!1}function vt(e,t){try{if(typeof nt=="function")try{nt(e,t);return}catch{}}catch{}try{e&&t&&V&&typeof V.set=="function"&&!V.has(e)&&V.set(e,t)}catch{}try{t&&Z&&typeof Z.set=="function"&&Z.set(t,e)}catch{}try{if($e&&typeof $e.has=="function"){if(!$e.has(t)){try{$e.add(t)}catch{}try{Array.isArray(Ne)&&!Ne.includes(t)&&Ne.push(t)}catch{}}}else try{Array.isArray(Ne)&&!Ne.includes(t)&&Ne.push(t)}catch{}}catch{}}function ic(e,t){try{return new URL(e,t).pathname}catch{try{return new URL(e,typeof location<"u"?location.href:"http://localhost/").pathname}catch{try{return(String(t||"").replace(/\/$/,"")+"/"+String(e||"").replace(/^\//,"")).replace(/\/\\+/g,"/")}catch{return String(e||"")}}}}function ac(e,t){const n=document.createElement("aside");n.className="menu box nimbi-nav";const i=document.createElement("p");i.className="menu-label",i.textContent=e("navigation"),n.appendChild(i);const r=document.createElement("ul");r.className="menu-list";try{const a=document.createDocumentFragment();t.forEach(s=>{const o=document.createElement("li"),l=document.createElement("a");try{const c=String(s.path||"");try{l.setAttribute("href",Pe(c))}catch{c&&c.indexOf("/")===-1?l.setAttribute("href","#"+encodeURIComponent(c)):l.setAttribute("href",dt(c))}}catch{l.setAttribute("href","#"+s.path)}if(l.textContent=s.name,o.appendChild(l),s.children&&s.children.length){const c=document.createElement("ul");s.children.forEach(u=>{const g=document.createElement("li"),h=document.createElement("a");try{const d=String(u.path||"");try{h.setAttribute("href",Pe(d))}catch{d&&d.indexOf("/")===-1?h.setAttribute("href","#"+encodeURIComponent(d)):h.setAttribute("href",dt(d))}}catch{h.setAttribute("href","#"+u.path)}h.textContent=u.name,g.appendChild(h),c.appendChild(g)}),o.appendChild(c)}a.appendChild(o)}),r.appendChild(a)}catch{t.forEach(s=>{try{const o=document.createElement("li"),l=document.createElement("a");try{const c=String(s.path||"");try{l.setAttribute("href",Pe(c))}catch{c&&c.indexOf("/")===-1?l.setAttribute("href","#"+encodeURIComponent(c)):l.setAttribute("href",dt(c))}}catch{l.setAttribute("href","#"+s.path)}if(l.textContent=s.name,o.appendChild(l),s.children&&s.children.length){const c=document.createElement("ul");s.children.forEach(u=>{const g=document.createElement("li"),h=document.createElement("a");try{const d=String(u.path||"");try{h.setAttribute("href",Pe(d))}catch{d&&d.indexOf("/")===-1?h.setAttribute("href","#"+encodeURIComponent(d)):h.setAttribute("href",dt(d))}}catch{h.setAttribute("href","#"+u.path)}h.textContent=u.name,g.appendChild(h),c.appendChild(g)}),o.appendChild(c)}r.appendChild(o)}catch(o){k("[htmlBuilder] createNavTree item failed",o)}})}return n.appendChild(r),n}function sc(e,t,n=""){const i=document.createElement("aside");i.className="menu box nimbi-toc-inner is-hidden-mobile";const r=document.createElement("p");r.className="menu-label",r.textContent=e("onThisPage"),i.appendChild(r);const a=document.createElement("ul");a.className="menu-list";try{const o={};(t||[]).forEach(l=>{try{if(!l||l.level===1)return;const c=Number(l.level)>=2?Number(l.level):2,u=document.createElement("li"),g=document.createElement("a"),h=so(l.text||""),d=l.id||he(h);g.textContent=h;try{const w=String(n||"").replace(/^[\\.\\/]+/,""),y=w&&Z&&Z.has&&Z.has(w)?Z.get(w):w;y?g.href=Pe(y,d):g.href=`#${encodeURIComponent(d)}`}catch(w){k("[htmlBuilder] buildTocElement href normalization failed",w),g.href=`#${encodeURIComponent(d)}`}if(u.appendChild(g),c===2){a.appendChild(u),o[2]=u,Object.keys(o).forEach(w=>{Number(w)>2&&delete o[w]});return}let p=c-1;for(;p>2&&!o[p];)p--;p<2&&(p=2);let m=o[p];if(!m){a.appendChild(u),o[c]=u;return}let f=m.querySelector("ul");f||(f=document.createElement("ul"),m.appendChild(f)),f.appendChild(u),o[c]=u}catch(c){k("[htmlBuilder] buildTocElement item failed",c,l)}})}catch(o){k("[htmlBuilder] buildTocElement failed",o)}return i.appendChild(a),a.querySelectorAll("li").length<=1?null:i}function Ja(e){e.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(n=>{n.id||(n.id=he(n.textContent||""))})}function oc(e,t,n){try{const i=e.querySelectorAll("img");if(i&&i.length){const r=t&&t.includes("/")?t.substring(0,t.lastIndexOf("/")+1):"";i.forEach(a=>{const s=a.getAttribute("src")||"";if(s&&!(/^(https?:)?\/\//.test(s)||s.startsWith("/")))try{const o=new URL(r+s,n).toString();a.src=o;try{a.getAttribute("loading")||a.setAttribute("data-want-lazy","1")}catch(l){k("[htmlBuilder] set image loading attribute failed",l)}}catch(o){k("[htmlBuilder] resolve image src failed",o)}})}}catch(i){k("[htmlBuilder] lazyLoadImages failed",i)}}function na(e,t,n){try{const i=t&&t.includes("/")?t.substring(0,t.lastIndexOf("/")+1):"";let r=null;try{const o=new URL(n,location.href);r=new URL(i||".",o).toString()}catch{try{r=new URL(i||".",location.href).toString()}catch{r=i||"./"}}let a=null;try{a=e.querySelectorAll("[src],[href],[srcset],[poster]")}catch{const l=[];try{l.push(...Array.from(e.getElementsByTagName("img")||[]))}catch{}try{l.push(...Array.from(e.getElementsByTagName("link")||[]))}catch{}try{l.push(...Array.from(e.getElementsByTagName("video")||[]))}catch{}try{l.push(...Array.from(e.getElementsByTagName("use")||[]))}catch{}try{l.push(...Array.from(e.querySelectorAll("[srcset]")||[]))}catch{}a=l}let s=Array.from(a||[]);try{const o=Array.from(e.getElementsByTagName("use")||[]);for(const l of o)s.indexOf(l)===-1&&s.push(l)}catch{}for(const o of Array.from(s||[]))try{const l=o.tagName?o.tagName.toLowerCase():"",c=u=>{try{const g=o.getAttribute(u)||"";if(!g||/^(https?:)?\/\//i.test(g)||g.startsWith("/")||g.startsWith("#"))return;try{o.setAttribute(u,new URL(g,r).toString())}catch(h){k("[htmlBuilder] rewrite asset attribute failed",u,g,h)}}catch(g){k("[htmlBuilder] rewriteAttr failed",g)}};if(o.hasAttribute&&o.hasAttribute("src")&&c("src"),o.hasAttribute&&o.hasAttribute("href")&&l!=="a"&&c("href"),o.hasAttribute&&o.hasAttribute("xlink:href")&&c("xlink:href"),o.hasAttribute&&o.hasAttribute("poster")&&c("poster"),o.hasAttribute&&o.hasAttribute("srcset")){const h=(o.getAttribute("srcset")||"").split(",").map(d=>d.trim()).filter(Boolean).map(d=>{const[p,m]=d.split(/\s+/,2);if(!p||/^(https?:)?\/\//i.test(p)||p.startsWith("/"))return d;try{const f=new URL(p,r).toString();return m?`${f} ${m}`:f}catch{return d}}).join(", ");o.setAttribute("srcset",h)}}catch(l){k("[htmlBuilder] rewriteRelativeAssets node processing failed",l)}}catch(i){k("[htmlBuilder] rewriteRelativeAssets failed",i)}}let ra="",Tr=null,ia="";async function _i(e,t,n,i={}){try{i=i||{},typeof i.canonical>"u"&&(i.canonical=!0);const r=e.querySelectorAll("a");if(!r||!r.length)return;let a,s;if(t===ra&&Tr)a=Tr,s=ia;else{try{a=new URL(t,location.href),s=Kt(a.pathname)}catch{try{a=new URL(t,location.href),s=Kt(a.pathname)}catch{a=null,s="/"}}ra=t,Tr=a,ia=s}const o=new Set,l=[],c=new Set,u=[];for(const g of Array.from(r))try{try{if(g.closest&&g.closest("h1,h2,h3,h4,h5,h6"))continue}catch{}const h=g.getAttribute("href")||"";if(!h||Nr(h))continue;try{if(h.startsWith("?")||h.indexOf("?")!==-1)try{const p=new URL(h,t||location.href),m=p.searchParams.get("page");if(m&&m.indexOf("/")===-1&&n){const f=n.includes("/")?n.substring(0,n.lastIndexOf("/")+1):"";if(f){const w=Y(f+m),y=i&&i.canonical?Pe(w,p.hash?p.hash.replace(/^#/,""):null):dt(w,p.hash?p.hash.replace(/^#/,""):null);g.setAttribute("href",y);continue}}}catch{}}catch{}if(h.startsWith("/")&&!h.endsWith(".md"))continue;const d=h.match(/^([^#?]+\.md)(?:[#](.+))?$/);if(d){let p=d[1];const m=d[2];!p.startsWith("/")&&n&&(p=(n.includes("/")?n.substring(0,n.lastIndexOf("/")+1):"")+p);try{const f=new URL(p,t).pathname;let w=f.startsWith(s)?f.slice(s.length):f;w=Y(w),l.push({node:g,mdPathRaw:p,frag:m,rel:w}),Z.has(w)||o.add(w)}catch(f){k("[htmlBuilder] resolve mdPath failed",f)}continue}try{let p=h;!h.startsWith("/")&&n&&(h.startsWith("#")?p=n+h:p=(n.includes("/")?n.substring(0,n.lastIndexOf("/")+1):"")+h);const f=new URL(p,t).pathname||"";if(f&&f.indexOf(s)!==-1){let w=f.startsWith(s)?f.slice(s.length):f;if(w=Y(w),w=ln(w),w||(w=ai),!w.endsWith(".md")){let y=null;try{if(Z&&Z.has&&Z.has(w))y=Z.get(w);else try{const _=String(w||"").replace(/^.*\//,"");_&&Z.has&&Z.has(_)&&(y=Z.get(_))}catch(_){k("[htmlBuilder] mdToSlug baseName check failed",_)}}catch(_){k("[htmlBuilder] mdToSlug access check failed",_)}if(!y)try{const _=String(w||"").replace(/^.*\//,"");for(const[b,v]of V||[])if(v===w||v===_){y=b;break}}catch{}if(y){const _=i&&i.canonical?Pe(y,null):dt(y);g.setAttribute("href",_)}else{let _=w;try{/\.[^\/]+$/.test(String(w||""))||(_=String(w||"")+".html")}catch{_=w}c.add(_),u.push({node:g,rel:_})}}}}catch(p){k("[htmlBuilder] resolving href to URL failed",p)}}catch(h){k("[htmlBuilder] processing anchor failed",h)}if(o.size)if(ur(t))await zn(Array.from(o),async g=>{try{try{const d=String(g).match(/([^\/]+)\.md$/),p=d&&d[1];if(p&&V.has(p)){try{const m=V.get(p);if(m)try{const f=typeof m=="string"?m:m&&m.default?m.default:null;f&&vt(p,f)}catch(f){k("[htmlBuilder] _storeSlugMapping failed",f)}}catch(m){k("[htmlBuilder] reading slugToMd failed",m)}return}}catch(d){k("[htmlBuilder] basename slug lookup failed",d)}const h=await Oe(g,t);if(h&&h.raw){const d=(h.raw||"").match(/^#\s+(.+)$/m);if(d&&d[1]){const p=he(d[1].trim());if(p)try{vt(p,g)}catch(m){k("[htmlBuilder] setting slug mapping failed",m)}}}}catch(h){k("[htmlBuilder] fetchMarkdown during rewriteAnchors failed",h)}},6);else{try{k("[htmlBuilder] skipping md title probes (probing disabled)")}catch{}for(const g of Array.from(o))try{const h=String(g).match(/([^\/]+)\.md$/),d=h&&h[1];if(d){const p=he(d);if(p)try{vt(p,g)}catch(m){k("[htmlBuilder] setting fallback slug mapping failed",m)}}}catch{}}if(c.size)if(ur(t))await zn(Array.from(c),async g=>{try{const h=await Oe(g,t);if(h&&h.raw)try{const d=qe(),p=d?d.parseFromString(h.raw,"text/html"):null,m=p?p.querySelector("title"):null,f=p?p.querySelector("h1"):null,w=m&&m.textContent&&m.textContent.trim()?m.textContent.trim():f&&f.textContent?f.textContent.trim():null;if(w){const y=he(w);if(y)try{vt(y,g)}catch(_){k("[htmlBuilder] setting html slug mapping failed",_)}}}catch(d){k("[htmlBuilder] parse fetched HTML failed",d)}}catch(h){k("[htmlBuilder] fetchMarkdown for htmlPending failed",h)}},5);else{try{k("[htmlBuilder] skipping html title probes (probing disabled)")}catch{}for(const g of Array.from(c))try{const h=String(g).match(/([^\/]+)\.html$/),d=h&&h[1];if(d){const p=he(d);if(p)try{vt(p,g)}catch(m){k("[htmlBuilder] setting fallback html slug mapping failed",m)}}}catch{}}for(const g of l){const{node:h,frag:d,rel:p}=g;let m=null;try{Z.has(p)&&(m=Z.get(p))}catch(f){k("[htmlBuilder] mdToSlug access failed",f)}if(m){const f=i&&i.canonical?Pe(m,d):dt(m,d);h.setAttribute("href",f)}else{const f=i&&i.canonical?Pe(p,d):dt(p,d);h.setAttribute("href",f)}}for(const g of u){const{node:h,rel:d}=g;let p=null;try{Z.has(d)&&(p=Z.get(d))}catch(m){k("[htmlBuilder] mdToSlug access failed for htmlAnchorInfo",m)}if(!p)try{const m=String(d||"").replace(/^.*\//,"");Z.has(m)&&(p=Z.get(m))}catch(m){k("[htmlBuilder] mdToSlug baseName access failed for htmlAnchorInfo",m)}if(p){const m=i&&i.canonical?Pe(p,null):dt(p);h.setAttribute("href",m)}else{const m=i&&i.canonical?Pe(d,null):dt(d);h.setAttribute("href",m)}}}catch(r){k("[htmlBuilder] rewriteAnchors failed",r)}}function lc(e,t,n,i){const r=t.querySelector("h1"),a=r?(r.textContent||"").trim():"";let s="";try{let o="";try{e&&e.meta&&e.meta.title&&(o=String(e.meta.title).trim())}catch{}if(!o&&a&&(o=a),!o)try{const l=t.querySelector("h2");l&&l.textContent&&(o=String(l.textContent).trim())}catch{}!o&&n&&(o=String(n)),o&&(s=he(o)),s||(s=ai);try{if(n){try{vt(s,n)}catch(l){k("[htmlBuilder] computeSlug set slug mapping failed",l)}try{const l=Y(String(n||""));if(Z&&typeof Z.has=="function"&&Z.has(l))s=Z.get(l);else try{for(const[c,u]of V||[])try{const g=typeof u=="string"?u:u&&u.default?u.default:null;if(g&&Y(String(g))===l){s=c;break}}catch{}}catch{}}catch{}}}catch(l){k("[htmlBuilder] computeSlug set slug mapping failed",l)}try{let l=i||"";if(!l)try{const c=it(typeof location<"u"?location.href:"");c&&c.anchor&&c.page&&String(c.page)===String(s)?l=c.anchor:l=""}catch{l=""}try{history.replaceState({page:s},"",dt(s,l))}catch(c){k("[htmlBuilder] computeSlug history replace failed",c)}}catch(l){k("[htmlBuilder] computeSlug inner failed",l)}}catch(o){k("[htmlBuilder] computeSlug failed",o)}try{if(e&&e.meta&&e.meta.title&&r){const o=String(e.meta.title).trim();if(o&&o!==a){try{s&&(r.id=s)}catch{}try{if(Array.isArray(e.toc))for(const l of e.toc)try{if(l&&Number(l.level)===1&&String(l.text).trim()===(a||"").trim()){l.id=s;break}}catch{}}catch{}}}}catch{}return{topH1:r,h1Text:a,slugKey:s}}async function cc(e,t){if(!e||!e.length)return;const n=new Set;for(const s of Array.from(e||[]))try{const o=s.getAttribute("href")||"";if(!o)continue;let u=Y(o).split(/::|#/,2)[0];try{const h=u.indexOf("?");h!==-1&&(u=u.slice(0,h))}catch{}if(!u||(u.includes(".")||(u=u+".html"),!/\.html(?:$|[?#])/.test(u)&&!u.toLowerCase().endsWith(".html")))continue;const g=u;try{if(Z&&Z.has&&Z.has(g))continue}catch(h){k("[htmlBuilder] mdToSlug check failed",h)}try{let h=!1;for(const d of V.values())if(d===g){h=!0;break}if(h)continue}catch(h){k("[htmlBuilder] slugToMd iteration failed",h)}n.add(g)}catch(o){k("[htmlBuilder] preScanHtmlSlugs anchor iteration failed",o)}if(!n.size)return;if(!ur()){try{k("[htmlBuilder] skipping preScanHtmlSlugs (probing disabled)")}catch{}for(const s of Array.from(n))try{const o=String(s).match(/([^\/]+)\.html$/),l=o&&o[1];if(l){const c=he(l);if(c)try{vt(c,s)}catch(u){k("[htmlBuilder] setting fallback preScanHtmlSlugs mapping failed",u)}}}catch{}return}const i=async s=>{try{const o=await Oe(s,t);if(o&&o.raw)try{const c=qe().parseFromString(o.raw,"text/html"),u=c.querySelector("title"),g=c.querySelector("h1"),h=u&&u.textContent&&u.textContent.trim()?u.textContent.trim():g&&g.textContent?g.textContent.trim():null;if(h){const d=he(h);if(d)try{vt(d,s)}catch(p){k("[htmlBuilder] set slugToMd/mdToSlug failed",p)}}}catch(l){k("[htmlBuilder] parse HTML title failed",l)}}catch(o){k("[htmlBuilder] fetchAndExtract failed",o)}},r=Array.from(n),a=Math.max(1,Math.min(xn(),r.length||1));await zn(r,i,a)}async function uc(e,t){if(!e||!e.length)return;const n=[],i=new Set;let r="";try{const a=new URL(t,typeof location<"u"?location.href:"http://localhost/");r=Kt(a.pathname)}catch(a){r="",k("[htmlBuilder] preMapMdSlugs parse base failed",a)}for(const a of Array.from(e||[]))try{const s=a.getAttribute("href")||"";if(!s)continue;const o=s.match(/^([^#?]+\.md)(?:[#](.+))?$/);if(o){let l=Y(o[1]);try{let c;try{c=ic(l,t)}catch(g){c=l,k("[htmlBuilder] resolve mdPath URL failed",g)}const u=c&&r&&c.startsWith(r)?c.slice(r.length):String(c||"").replace(/^\//,"");n.push({rel:u}),Z.has(u)||i.add(u)}catch(c){k("[htmlBuilder] rewriteAnchors failed",c)}continue}}catch(s){k("[htmlBuilder] preMapMdSlugs anchor iteration failed",s)}if(i.size)if(ur())await Promise.all(Array.from(i).map(async a=>{try{const s=String(a).match(/([^\/]+)\.md$/),o=s&&s[1];if(o&&V.has(o)){try{const l=V.get(o);if(l)try{const c=typeof l=="string"?l:l&&l.default?l.default:null;c&&vt(o,c)}catch(c){k("[htmlBuilder] _storeSlugMapping failed",c)}}catch(l){k("[htmlBuilder] preMapMdSlugs slug map access failed",l)}return}}catch(s){k("[htmlBuilder] preMapMdSlugs basename check failed",s)}try{const s=await Oe(a,t);if(s&&s.raw){const o=(s.raw||"").match(/^#\s+(.+)$/m);if(o&&o[1]){const l=he(o[1].trim());if(l)try{vt(l,a)}catch(c){k("[htmlBuilder] preMapMdSlugs setting slug mapping failed",c)}}}}catch(s){k("[htmlBuilder] preMapMdSlugs fetch failed",s)}}));else try{k("[htmlBuilder] skipping preMapMdSlugs probes (probing disabled)")}catch{}}qe();function zr(e){try{const n=qe().parseFromString(e||"","text/html");Ja(n);try{n.querySelectorAll("img").forEach(l=>{try{l.getAttribute("loading")||l.setAttribute("data-want-lazy","1")}catch(c){k("[htmlBuilder] parseHtml set image loading attribute failed",c)}})}catch(o){k("[htmlBuilder] parseHtml query images failed",o)}n.querySelectorAll("pre code, code[class]").forEach(o=>{try{const l=o.getAttribute&&o.getAttribute("class")||o.className||"",c=l.match(/language-([a-zA-Z0-9_+-]+)/)||l.match(/lang(?:uage)?-?([a-zA-Z0-9_+-]+)/);if(c&&c[1]){const u=(c[1]||"").toLowerCase(),g=Ae.size&&(Ae.get(u)||Ae.get(String(u).toLowerCase()))||u;try{(async()=>{try{await on(g)}catch(h){k("[htmlBuilder] registerLanguage failed",h)}})()}catch(h){k("[htmlBuilder] schedule registerLanguage failed",h)}}else try{if(Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")){const u=Re.highlight?Re.highlight(o.textContent||"",{language:"plaintext"}):null;if(u&&u.value)try{if(typeof document<"u"&&document.createRange&&typeof document.createRange=="function"){const g=document.createRange().createContextualFragment(u.value);if(typeof o.replaceChildren=="function")o.replaceChildren(...Array.from(g.childNodes));else{for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(g)}}else o.innerHTML=u.value}catch{try{o.innerHTML=u.value}catch{}}}}catch(u){k("[htmlBuilder] plaintext highlight fallback failed",u)}}catch(l){k("[htmlBuilder] code element processing failed",l)}});const r=[];n.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(o=>{r.push({level:Number(o.tagName.substring(1)),text:(o.textContent||"").trim(),id:o.id})});const s={};try{const o=n.querySelector("title");o&&o.textContent&&String(o.textContent).trim()&&(s.title=String(o.textContent).trim())}catch{}return{html:n.body.innerHTML,meta:s,toc:r}}catch(t){return k("[htmlBuilder] parseHtml failed",t),{html:e||"",meta:{},toc:[]}}}async function es(e){const t=Gr?await Gr(e||"",Ae):An(e||"",Ae),n=new Set(t),i=[];for(const r of n)try{const a=Ae.size&&(Ae.get(r)||Ae.get(String(r).toLowerCase()))||r;try{i.push(on(a))}catch(s){k("[htmlBuilder] ensureLanguages push canonical failed",s)}if(String(r)!==String(a))try{i.push(on(r))}catch(s){k("[htmlBuilder] ensureLanguages push alias failed",s)}}catch(a){k("[htmlBuilder] ensureLanguages inner failed",a)}try{await Promise.all(i)}catch(r){k("[htmlBuilder] ensureLanguages failed",r)}}async function hc(e){if(await es(e),un){const t=await un(e||"");return!t||typeof t!="object"?{html:String(e||""),meta:{},toc:[]}:(Array.isArray(t.toc)||(t.toc=[]),t.meta||(t.meta={}),t)}return{html:String(e||""),meta:{},toc:[]}}async function dc(e,t,n,i,r){let a=null,s=null;if(t.isHtml)try{const h=qe();if(h){const d=h.parseFromString(t.raw||"","text/html");try{na(d.body,n,r)}catch(p){k("[htmlBuilder] rewriteRelativeAssets failed in prepareArticle (inner)",p)}a=zr(d.documentElement&&d.documentElement.outerHTML?d.documentElement.outerHTML:t.raw||"")}else a=zr(t.raw||"")}catch{a=zr(t.raw||"")}else{const h=t.raw||"",d=64*1024;if(h&&h.length>d&&Zr){try{await es(h)}catch{}s=document.createElement("article"),s.className="nimbi-article content";const p=[];let m={};try{await Zr(h,(f,w)=>{try{w&&w.meta&&(m=Object.assign(m,w.meta))}catch{}try{w&&Array.isArray(w.toc)&&w.toc.length&&p.push(...w.toc)}catch{}try{er(()=>{try{const y=qe();if(y){const _=y.parseFromString(String(f||""),"text/html"),b=Array.from(_.body.childNodes||[]);b.length?s.append(...b):s.insertAdjacentHTML("beforeend",f||"")}else{const _=document&&typeof document.createRange=="function"?document.createRange():null;if(_&&typeof _.createContextualFragment=="function"){const b=_.createContextualFragment(String(f||""));s.append(...Array.from(b.childNodes))}else s.insertAdjacentHTML("beforeend",f||"")}}catch{try{s.insertAdjacentHTML("beforeend",f||"")}catch{}}})}catch{}},{chunkSize:d})}catch(f){k("[htmlBuilder] streamParseMarkdown failed, falling back",f)}a={html:s.innerHTML,meta:m||{},toc:p}}else a=await hc(t.raw||"")}let o;if(s)o=s;else{o=document.createElement("article"),o.className="nimbi-article content";try{const h=qe&&qe();if(h){const d=h.parseFromString(String(a.html||""),"text/html"),p=Array.from(d.body.childNodes||[]);p.length?o.replaceChildren(...p):o.innerHTML=a.html}else try{const d=document&&typeof document.createRange=="function"?document.createRange():null;if(d&&typeof d.createContextualFragment=="function"){const p=d.createContextualFragment(String(a.html||""));o.replaceChildren(...Array.from(p.childNodes))}else o.innerHTML=a.html}catch{o.innerHTML=a.html}}catch{try{o.innerHTML=a.html}catch(d){k("[htmlBuilder] set article html failed",d)}}}try{na(o,n,r)}catch(h){k("[htmlBuilder] rewriteRelativeAssets failed in prepareArticle",h)}try{Ja(o)}catch(h){k("[htmlBuilder] addHeadingIds failed",h)}try{o.querySelectorAll("pre code, code[class]").forEach(d=>{try{const p=d.getAttribute&&d.getAttribute("class")||d.className||"",m=String(p||"").replace(/\blanguage-undefined\b|\blang-undefined\b/g,"").trim();if(m)try{d.setAttribute&&d.setAttribute("class",m)}catch(f){d.className=m,k("[htmlBuilder] set element class failed",f)}else try{d.removeAttribute&&d.removeAttribute("class")}catch(f){d.className="",k("[htmlBuilder] remove element class failed",f)}}catch(p){k("[htmlBuilder] code element cleanup failed",p)}})}catch(h){k("[htmlBuilder] processing code elements failed",h)}try{ga(o)}catch(h){k("[htmlBuilder] observeCodeBlocks failed",h)}oc(o,n,r);try{(o.querySelectorAll&&o.querySelectorAll("img")||[]).forEach(d=>{try{const p=d.parentElement;if(!p||p.tagName.toLowerCase()!=="p"||p.childNodes.length!==1)return;const m=document.createElement("figure");m.className="image",p.replaceWith(m),m.appendChild(d)}catch{}})}catch(h){k("[htmlBuilder] wrap images in Bulma image helper failed",h)}try{(o.querySelectorAll&&o.querySelectorAll("table")||[]).forEach(d=>{try{if(d.classList)d.classList.contains("table")||d.classList.add("table");else{const p=d.getAttribute&&d.getAttribute("class")?d.getAttribute("class"):"",m=String(p||"").split(/\s+/).filter(Boolean);m.indexOf("table")===-1&&m.push("table");try{d.setAttribute&&d.setAttribute("class",m.join(" "))}catch{d.className=m.join(" ")}}}catch{}})}catch(h){k("[htmlBuilder] add Bulma table class failed",h)}const{topH1:l,h1Text:c,slugKey:u}=lc(a,o,n,i);try{if(l&&a&&a.meta&&(a.meta.author||a.meta.date)&&!(l.parentElement&&l.parentElement.querySelector&&l.parentElement.querySelector(".nimbi-article-subtitle"))){const d=a.meta.author?String(a.meta.author).trim():"",p=a.meta.date?String(a.meta.date).trim():"";let m="";try{const w=new Date(p);p&&!isNaN(w.getTime())?m=w.toLocaleDateString():m=p}catch{m=p}const f=[];if(d&&f.push(d),m&&f.push(m),f.length){const w=document.createElement("p"),y=f[0]?String(f[0]).replace(/"/g,"").trim():"",_=f.slice(1);if(w.className="nimbi-article-subtitle is-6 has-text-grey-light",y){const b=document.createElement("span");b.className="nimbi-article-author",b.textContent=y,w.appendChild(b)}if(_.length){const b=document.createElement("span");b.className="nimbi-article-meta",b.textContent=_.join(" • "),w.appendChild(b)}try{l.parentElement.insertBefore(w,l.nextSibling)}catch{try{l.insertAdjacentElement("afterend",w)}catch{}}}}}catch{}try{await mc(o,r,n)}catch(h){rc("[htmlBuilder] rewriteAnchorsWorker failed, falling back to main thread",h),await _i(o,r,n)}const g=sc(e,a.toc,n);return{article:o,parsed:a,toc:g,topH1:l,h1Text:c,slugKey:u}}function fc(e){if(!(!e||!e.querySelectorAll))try{const t=Array.from(e.querySelectorAll("script"));for(const n of t)try{const i=document.createElement("script");for(const a of Array.from(n.attributes||[]))try{i.setAttribute(a.name,a.value)}catch{}if(!n.src){const a=n.textContent||"";let s=!1;try{new Function(a)(),s=!0}catch{s=!1}if(s){n.parentNode&&n.parentNode.removeChild(n);try{$t("[htmlBuilder] executed inline script via Function")}catch{}continue}try{i.type="module"}catch{}i.textContent=a}if(n.src)try{if(document.querySelector&&document.querySelector(`script[src="${n.src}"]`)){n.parentNode&&n.parentNode.removeChild(n);continue}}catch{}const r=n.src||"<inline>";i.addEventListener("error",a=>{try{k("[htmlBuilder] injected script error",{src:r,ev:a})}catch{}}),i.addEventListener("load",()=>{try{$t("[htmlBuilder] injected script loaded",{src:r,hasNimbi:!!(window&&window.nimbiCMS)})}catch{}});try{(document.head||document.body||document.documentElement).appendChild(i)}catch{try{try{i.type="text/javascript"}catch{}(document.head||document.body||document.documentElement).appendChild(i)}catch(s){try{k("[htmlBuilder] injected script append failed, skipping",{src:r,err:s})}catch{}}}n.parentNode&&n.parentNode.removeChild(n);try{$t("[htmlBuilder] executed injected script",r)}catch{}}catch(i){k("[htmlBuilder] execute injected script failed",i)}}catch{}}function aa(e,t,n){if(e)try{typeof e.replaceChildren=="function"?e.replaceChildren():e.innerHTML=""}catch{try{e.innerHTML=""}catch{}}const i=document.createElement("article");i.className="nimbi-article content nimbi-not-found";const r=document.createElement("h1");r.textContent=t&&t("notFound")||"Page not found";const a=document.createElement("p");a.textContent=n&&n.message?String(n.message):"Failed to resolve the requested page.",i.appendChild(r),i.appendChild(a),e&&e.appendChild&&e.appendChild(i);try{if(!le)try{const s=document.createElement("p"),o=t&&t("goHome")||"Go back to";s.textContent=o+" ";const l=document.createElement("a");try{l.href=Pe(bt)}catch{l.href=Pe(bt||"")}l.textContent=t&&t("home")||"Home",s.appendChild(l),e&&e.appendChild&&e.appendChild(s)}catch{}}catch{}try{try{Yn({title:t&&t("notFound")||"Not Found",description:t&&t("notFoundDescription")||""},le,t&&t("notFound")||"Not Found",t&&t("notFoundDescription")||"")}catch{}}catch{}try{try{const s=typeof window<"u"&&window.__nimbiNotFoundRedirect?String(window.__nimbiNotFoundRedirect).trim():null;if(s)try{const o=new URL(s,location.origin).toString();if((location.href||"").split("#")[0]!==o)try{location.replace(o)}catch{location.href=o}}catch{}}catch{}}catch{}}const ts=no(tc,nc&&Ya,"anchor");function gc(){return ts.get()}function pc(e){return ts.send(e,2e3)}async function mc(e,t,n){if(!gc())throw new Error("anchor worker unavailable");if(!e||typeof e.innerHTML!="string")throw new Error("invalid article element");const r=String(e.innerHTML),a=await pc({type:"rewriteAnchors",html:r,contentBase:t,pagePath:n});if(a&&typeof a=="string")try{const s=qe&&qe();if(s){const o=s.parseFromString(String(a||""),"text/html"),l=Array.from(o.body.childNodes||[]);l.length?e.replaceChildren(...l):e.innerHTML=a}else try{const o=document&&typeof document.createRange=="function"?document.createRange():null;if(o&&typeof o.createContextualFragment=="function"){const l=o.createContextualFragment(String(a||""));e.replaceChildren(...Array.from(l.childNodes))}else e.innerHTML=a}catch{e.innerHTML=a}}catch(s){k("[htmlBuilder] applying rewritten anchors failed",s)}}function yc(e){try{e.addEventListener("click",t=>{const n=t.target&&t.target.closest?t.target.closest("a"):null;if(!n)return;const i=n.getAttribute("href")||"";try{const r=it(i),a=r&&r.page?r.page:null,s=r&&r.anchor?r.anchor:null;if(!a&&!s)return;t.preventDefault();let o=null;try{history&&history.state&&history.state.page&&(o=history.state.page)}catch(l){o=null,k("[htmlBuilder] access history.state failed",l)}try{o||(o=new URL(location.href).searchParams.get("page"))}catch(l){k("[htmlBuilder] parse current location failed",l)}if(!a&&s||a&&o&&String(a)===String(o)){try{if(!a&&s)try{history.replaceState(history.state,"",(location.pathname||"")+(location.search||"")+(s?"#"+encodeURIComponent(s):""))}catch(l){k("[htmlBuilder] history.replaceState failed",l)}else try{history.replaceState({page:o||a},"",dt(o||a,s))}catch(l){k("[htmlBuilder] history.replaceState failed",l)}}catch(l){k("[htmlBuilder] update history for anchor failed",l)}try{t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation()}catch(l){k("[htmlBuilder] stopPropagation failed",l)}try{Xr(s)}catch(l){k("[htmlBuilder] scrollToAnchorOrTop failed",l)}return}history.pushState({page:a},"",dt(a,s));try{if(typeof window<"u"&&typeof window.renderByQuery=="function")try{window.renderByQuery()}catch(l){k("[htmlBuilder] window.renderByQuery failed",l)}else if(typeof window<"u")try{window.dispatchEvent(new PopStateEvent("popstate"))}catch(l){k("[htmlBuilder] dispatch popstate failed",l)}else try{renderByQuery()}catch(l){k("[htmlBuilder] renderByQuery failed",l)}}catch(l){k("[htmlBuilder] SPA navigation invocation failed",l)}}catch(r){k("[htmlBuilder] non-URL href in attachTocClickHandler",r)}})}catch(t){k("[htmlBuilder] attachTocClickHandler failed",t)}}function Xr(e){const t=document.querySelector(".nimbi-cms")||null;if(e){const n=document.getElementById(e);if(n)try{const i=()=>{try{if(t&&t.scrollTo&&t.contains(n)){const r=n.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop;t.scrollTo({top:r,behavior:"smooth"})}else try{n.scrollIntoView({behavior:"smooth",block:"start"})}catch{try{n.scrollIntoView()}catch(a){k("[htmlBuilder] scrollIntoView failed",a)}}}catch{try{n.scrollIntoView()}catch(a){k("[htmlBuilder] final scroll fallback failed",a)}}};try{requestAnimationFrame(()=>setTimeout(i,50))}catch(r){k("[htmlBuilder] scheduling scroll failed",r),setTimeout(i,50)}}catch(i){try{n.scrollIntoView()}catch(r){k("[htmlBuilder] final scroll fallback failed",r)}k("[htmlBuilder] doScroll failed",i)}}else try{t&&t.scrollTo?t.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch(n){try{window.scrollTo(0,0)}catch(i){k("[htmlBuilder] window.scrollTo failed",i)}k("[htmlBuilder] scroll to top failed",n)}}function bc(e,t,{mountOverlay:n=null,container:i=null,mountEl:r=null,navWrap:a=null,t:s=null}={}){try{const o=s||(m=>typeof m=="string"?m:""),l=i||document.querySelector(".nimbi-cms"),c=r||document.querySelector(".nimbi-mount"),u=n||document.querySelector(".nimbi-overlay"),g=a||document.querySelector(".nimbi-nav-wrap");let d=document.querySelector(".nimbi-scroll-top");if(!d){d=document.createElement("button"),d.className="nimbi-scroll-top button is-primary is-rounded is-small",d.setAttribute("aria-label",o("scrollToTop")),d.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V6"/><path d="M5 12l7-7 7 7"/></svg>';try{u&&u.appendChild?u.appendChild(d):l&&l.appendChild?l.appendChild(d):c&&c.appendChild?c.appendChild(d):document.body.appendChild(d)}catch{try{document.body.appendChild(d)}catch(f){k("[htmlBuilder] append scroll top button failed",f)}}try{try{ya(d)}catch{}}catch(m){k("[htmlBuilder] set scroll-top button theme registration failed",m)}d.addEventListener("click",()=>{try{i&&i.scrollTo?i.scrollTo({top:0,left:0,behavior:"smooth"}):r&&r.scrollTo?r.scrollTo({top:0,left:0,behavior:"smooth"}):window.scrollTo({top:0,left:0,behavior:"smooth"})}catch{try{i&&(i.scrollTop=0)}catch(f){k("[htmlBuilder] fallback container scrollTop failed",f)}try{r&&(r.scrollTop=0)}catch(f){k("[htmlBuilder] fallback mountEl scrollTop failed",f)}try{document.documentElement.scrollTop=0}catch(f){k("[htmlBuilder] fallback document scrollTop failed",f)}}})}const p=g&&g.querySelector?g.querySelector(".menu-label"):null;if(t){if(!d._nimbiObserver)if(typeof globalThis<"u"&&typeof globalThis.IntersectionObserver<"u"){const m=globalThis.IntersectionObserver,f=new m(w=>{for(const y of w)y.target instanceof Element&&(y.isIntersecting?(d.classList.remove("show"),p&&p.classList.remove("show")):(d.classList.add("show"),p&&p.classList.add("show")))},{root:i instanceof Element?i:r instanceof Element?r:null,threshold:0});d._nimbiObserver=f}else d._nimbiObserver=null;try{d._nimbiObserver&&typeof d._nimbiObserver.disconnect=="function"&&d._nimbiObserver.disconnect()}catch(m){k("[htmlBuilder] observer disconnect failed",m)}try{d._nimbiObserver&&typeof d._nimbiObserver.observe=="function"&&d._nimbiObserver.observe(t)}catch(m){k("[htmlBuilder] observer observe failed",m)}try{const m=()=>{try{const f=l instanceof Element?l.getBoundingClientRect():{top:0,bottom:window.innerHeight},w=t.getBoundingClientRect();!(w.bottom<f.top||w.top>f.bottom)?(d.classList.remove("show"),p&&p.classList.remove("show")):(d.classList.add("show"),p&&p.classList.add("show"))}catch(f){k("[htmlBuilder] checkIntersect failed",f)}};m(),typeof globalThis<"u"&&typeof globalThis.IntersectionObserver<"u"||setTimeout(m,100)}catch(m){k("[htmlBuilder] checkIntersect outer failed",m)}}else{d.classList.remove("show"),p&&p.classList.remove("show");const m=i instanceof Element?i:r instanceof Element?r:window,f=()=>{try{(m===window?window.scrollY:m.scrollTop||0)>10?(d.classList.add("show"),p&&p.classList.add("show")):(d.classList.remove("show"),p&&p.classList.remove("show"))}catch(w){k("[htmlBuilder] onScroll handler failed",w)}};ir(()=>m.addEventListener("scroll",Jl(f))),f()}}catch(o){k("[htmlBuilder] ensureScrollTopButton failed",o)}}function tn(e,t){try{if(typeof nt=="function")try{nt(e,t);return}catch{}}catch{}try{e&&t&&V&&typeof V.set=="function"&&!V.has(e)&&V.set(e,t)}catch{}try{t&&Z&&typeof Z.set=="function"&&Z.set(t,e)}catch{}try{if($e&&typeof $e.has=="function"){if(!$e.has(t)){try{$e.add(t)}catch{}try{Array.isArray(Ne)&&!Ne.includes(t)&&Ne.push(t)}catch{}}}else try{Array.isArray(Ne)&&!Ne.includes(t)&&Ne.push(t)}catch{}}catch{}}function sa(e,t){try{if(!e)return;try{const n=e[t];if(typeof n<"u")return n}catch{}try{if(e.default)return e.default[t]}catch{}return}catch{return}}function wc(e){try{if(!Array.isArray(e))return e;e.forEach(t=>{try{if(!t||typeof t!="object")return;let n=typeof t.slug=="string"?String(t.slug):"",i=null;if(n&&n.indexOf("::")!==-1){const o=n.split("::");n=o[0]||"",i=o.slice(1).join("::")||null}const r=!!(n&&(n.indexOf(".")!==-1||n.indexOf("/")!==-1));let a="";try{if(t.path&&typeof t.path=="string"){const o=Y(String(t.path||""));if(a=findSlugForPath(o)||(Z&&Z.has(o)?Z.get(o):"")||"",!a)if(t.title&&String(t.title).trim())a=he(String(t.title).trim());else{const l=o.replace(/^.*\//,"").replace(/\.(?:md|html?)$/i,"");a=he(l||o)}}else if(r){const o=String(n).replace(/\.(?:md|html?)$/i,""),l=findSlugForPath(o)||(Z&&Z.has(o)?Z.get(o):"")||"";l?a=l:t.title&&String(t.title).trim()?a=he(String(t.title).trim()):a=he(o)}else!n&&t.title&&String(t.title).trim()?a=he(String(t.title).trim()):a=n||""}catch{try{a=t.title&&String(t.title).trim()?he(String(t.title).trim()):n?he(n):""}catch{a=n}}let s=a||"";i&&(s=s?`${s}::${i}`:`${he(i)}`),s&&(t.slug=s);try{if(t.path&&s){const o=String(s).split("::")[0];try{tn(o,Y(String(t.path||"")))}catch{}}}catch{}}catch{}})}catch{}return e}async function _c(e,t,n,i,r,a,s,o,l="eager",c=1,u=void 0,g="favicon"){if(!e||!(e instanceof HTMLElement))throw new TypeError("navbarWrap must be an HTMLElement");const h=qe(),d=h?h.parseFromString(n||"","text/html"):null,p=d?d.querySelectorAll("a"):[];await ir(()=>cc(p,i)),await ir(()=>uc(p,i));try{ie(p,i)}catch{}try{if(t&&t instanceof HTMLElement&&(!t.hasAttribute||!t.hasAttribute("role")))try{t.setAttribute("role","main")}catch{}}catch{}let m=null,f=null,w=null,y=null,_=null,b=null,v=!1,S=null;const E=new Map;function P(){try{const R=typeof O<"u"&&O&&O.querySelector?O.querySelector(".navbar-burger"):e&&e.querySelector?e.querySelector(".navbar-burger"):typeof document<"u"?document.querySelector(".navbar-burger"):null,N=R&&R.dataset?R.dataset.target:null,C=N?typeof O<"u"&&O&&O.querySelector?O.querySelector(`#${N}`)||document.getElementById(N):e&&e.querySelector?e.querySelector(`#${N}`):typeof document<"u"?document.getElementById(N):null:null;if(R&&R.classList&&R.classList.contains("is-active")){try{R.classList.remove("is-active")}catch{}try{R.setAttribute("aria-expanded","false")}catch{}if(C&&C.classList)try{C.classList.remove("is-active")}catch{}}}catch(R){k("[nimbi-cms] closeMobileMenu failed",R)}}async function I(){const R=t&&t instanceof HTMLElement?t:typeof document<"u"?document.querySelector(".nimbi-content"):null;try{R&&R.classList.add("is-inactive")}catch{}try{const N=s&&s();N&&typeof N.then=="function"&&await N}catch(N){try{k("[nimbi-cms] renderByQuery failed",N)}catch{}}finally{try{if(typeof requestAnimationFrame=="function")requestAnimationFrame(()=>{try{R&&R.classList.remove("is-inactive")}catch{}});else try{R&&R.classList.remove("is-inactive")}catch{}}catch{try{R&&R.classList.remove("is-inactive")}catch{}}}}function U(R){try{let N=R&&typeof R.slug=="string"?String(R.slug):"",C=null;try{N&&N.indexOf("::")!==-1&&(C=N.split("::").slice(1).join("::")||null)}catch{}try{if(R&&R.path&&typeof R.path=="string"){const A=Y(String(R.path||"")),L=A.replace(/^.*\//,"");try{if(E&&E.has(A))return{page:E.get(A),hash:C};if(E&&E.has(L))return{page:E.get(L),hash:C}}catch{}try{if(Z&&Z.has(A))return{page:Z.get(A),hash:C}}catch{}try{const D=G(A);if(D)return{page:D,hash:C}}catch{}}}catch{}if(N&&N.indexOf("::")!==-1){const A=N.split("::");N=A[0]||"",C=A.slice(1).join("::")||null}if(N&&(N.includes(".")||N.includes("/"))){const A=Y(R&&R.path?String(R.path):N),L=A.replace(/^.*\//,"");try{if(E&&E.has(A))return{page:E.get(A),hash:C};if(E&&E.has(L))return{page:E.get(L),hash:C}}catch{}try{let D=G(A);if(!D)try{const K=String(A||"").replace(/^\/+/,""),q=K.replace(/^.*\//,"");for(const[$,T]of V.entries())try{let j=null;if(typeof T=="string"?j=Y(String(T||"")):T&&typeof T=="object"&&(T.default?j=Y(String(T.default||"")):j=null),!j)continue;if(j===K||j.endsWith("/"+K)||K.endsWith("/"+j)||j.endsWith(q)||K.endsWith(q)){D=$;break}}catch{}}catch{}if(D)N=D;else try{const K=String(N).replace(/\.(?:md|html?)$/i,"");N=he(K||A)}catch{N=he(A)}}catch{N=he(A)}}return!N&&R&&R.path&&(N=he(Y(String(R.path||"")))),{page:N,hash:C}}catch{return{page:R&&R.slug||"",hash:null}}}const z=()=>m||(m=(async()=>{try{const R=await Promise.resolve().then(()=>at),N=typeof globalThis<"u"?globalThis.buildSearchIndex:void 0,C=typeof globalThis<"u"?globalThis.buildSearchIndexWorker:void 0,A=sa(R,"buildSearchIndex"),L=sa(R,"buildSearchIndexWorker"),D=typeof N=="function"?N:A||void 0,K=typeof C=="function"?C:L||void 0;Bt("[nimbi-cms test] ensureSearchIndex: buildFn="+typeof D+" workerFn="+typeof K+" (global preferred)");const q=[];try{r&&q.push(r)}catch{}try{navigationPage&&q.push(navigationPage)}catch{}if(l==="lazy"&&typeof K=="function")try{const $=await K(i,c,u,q.length?q:void 0);if($&&$.length){try{if(R&&typeof R._setSearchIndex=="function")try{R._setSearchIndex($)}catch{}}catch{}return $}}catch($){k("[nimbi-cms] worker builder threw",$)}return typeof D=="function"?(Bt("[nimbi-cms test] calling buildFn"),await D(i,c,u,q.length?q:void 0)):[]}catch(R){return k("[nimbi-cms] buildSearchIndex failed",R),[]}finally{if(f){try{f.removeAttribute("disabled")}catch{}try{w&&w.classList.remove("is-loading")}catch{}}}})(),m.then(R=>{try{try{S=Array.isArray(R)?R:null}catch{S=null}try{wc(R)}catch{}try{if(typeof window<"u"){try{(async()=>{try{const L=await Promise.resolve().then(()=>at);try{try{L&&typeof L._setSearchIndex=="function"&&L._setSearchIndex(Array.isArray(R)?R:[])}catch{}Object.defineProperty(window,"__nimbiResolvedIndex",{get(){return L&&Array.isArray(L.searchIndex)?L.searchIndex:Array.isArray(S)?S:[]},enumerable:!0,configurable:!0})}catch{try{window.__nimbiResolvedIndex=L&&Array.isArray(L.searchIndex)?L.searchIndex:Array.isArray(S)?S:[]}catch{}}}catch{try{window.__nimbiResolvedIndex=Array.isArray(re)?re:Array.isArray(S)?S:[]}catch{}}})()}catch{}try{window.__nimbi_contentBase=i}catch{}try{window.__nimbi_indexDepth=c}catch{}try{window.__nimbi_noIndexing=u}catch{}}}catch{}const N=String(f&&f.value||"").trim().toLowerCase();if(!N||!Array.isArray(R)||!R.length)return;const C=R.filter(L=>L.title&&L.title.toLowerCase().includes(N)||L.excerpt&&L.excerpt.toLowerCase().includes(N));if(!C||!C.length)return;const A=typeof _<"u"&&_?_:typeof document<"u"?document.getElementById("nimbi-search-results"):null;if(!A)return;try{typeof A.replaceChildren=="function"?A.replaceChildren():A.innerHTML=""}catch{try{A.innerHTML=""}catch{}}try{const L=document.createElement("div");L.className="panel nimbi-search-panel",C.slice(0,10).forEach(D=>{try{if(D.parentTitle){const T=document.createElement("p");T.className="panel-heading nimbi-search-title nimbi-search-parent",T.textContent=D.parentTitle,L.appendChild(T)}const K=document.createElement("a");K.className="panel-block nimbi-search-result";const q=U(D);K.href=Pe(q.page,q.hash),K.setAttribute("role","button");try{if(D.path&&typeof D.path=="string")try{tn(q.page,D.path)}catch{}}catch{}const $=document.createElement("div");$.className="is-size-6 has-text-weight-semibold",$.textContent=D.title,K.appendChild($),K.addEventListener("click",()=>{try{A.style.display="none"}catch{}}),L.appendChild(K)}catch{}}),er(()=>{try{A.appendChild(L)}catch{}});try{A.style.display="block"}catch{}}catch{}}catch{}}).catch(()=>{}).finally(()=>{(async()=>{try{if(v)return;v=!0;const R=await Promise.resolve().then(()=>Ln);try{await R.handleSitemapRequest({homePage:r,contentBase:i,indexDepth:c,noIndexing:u,includeAllMarkdown:!0})}catch(N){k("[nimbi-cms] sitemap trigger failed",N)}}catch(R){try{k("[nimbi-cms] sitemap dynamic import failed",R)}catch{}}})()}),m),O=document.createElement("nav");O.className="navbar",O.setAttribute("role","navigation"),O.setAttribute("aria-label","main navigation");const W=document.createElement("div");W.className="navbar-brand";const te=p[0],H=document.createElement("a");if(H.className="navbar-item",te){const R=te.getAttribute("href")||"#";try{const C=new URL(R,location.href).searchParams.get("page"),A=C?decodeURIComponent(C):r;let L=null;try{typeof A=="string"&&(/(?:\.md|\.html?)$/i.test(A)||A.includes("/"))&&(L=G(A))}catch{}!L&&typeof A=="string"&&!String(A).includes(".")&&(L=A);const D=L||A;H.href=Pe(D),(!H.textContent||!String(H.textContent).trim())&&(H.textContent=a("home"))}catch{try{const C=typeof r=="string"&&(/(?:\.md|\.html?)$/i.test(r)||r.includes("/"))?G(r):typeof r=="string"&&!r.includes(".")?r:null;H.href=Pe(C||r)}catch{H.href=Pe(r)}H.textContent=a("home")}}else H.href=Pe(r),H.textContent=a("home");async function M(R){try{if(!R||R==="none")return null;if(R==="favicon")try{const N=document.querySelector('link[rel~="icon"],link[rel="shortcut icon"]');if(!N)return null;const C=N.getAttribute("href")||"";return C&&/\.png(?:\?|$)/i.test(C)?new URL(C,location.href).toString():null}catch{return null}if(R==="copy-first"||R==="move-first")try{const N=await Oe(r,i);if(!N||!N.raw)return null;const C=qe(),A=C?C.parseFromString(N.raw,"text/html"):null,L=A?A.querySelector("img"):null;if(!L)return null;const D=L.getAttribute("src")||"";if(!D)return null;const K=new URL(D,location.href).toString();if(R==="move-first")try{document.documentElement.setAttribute("data-nimbi-logo-moved",K)}catch{}return K}catch{return null}try{return new URL(R,location.href).toString()}catch{return null}}catch{return null}}let F=null;try{F=await M(g)}catch{F=null}if(F)try{const R=document.createElement("img");R.className="nimbi-navbar-logo";const N=a&&typeof a=="function"&&(a("home")||a("siteLogo"))||"";R.alt=N,R.title=N,R.src=F;try{R.style.marginRight="0.5em"}catch{}try{(!H.textContent||!String(H.textContent).trim())&&(H.textContent=N)}catch{}try{H.insertBefore(R,H.firstChild)}catch{try{H.appendChild(R)}catch{}}}catch{}W.appendChild(H),H.addEventListener("click",function(R){const N=H.getAttribute("href")||"";if(N.startsWith("?page=")){R.preventDefault();const C=new URL(N,location.href),A=C.searchParams.get("page"),L=C.hash?C.hash.replace(/^#/,""):null;history.pushState({page:A},"",Pe(A,L)),I();try{P()}catch{}}});function G(R){try{if(!R)return null;const N=Y(String(R||""));try{if(Z&&Z.has(N))return Z.get(N)}catch{}const C=N.replace(/^.*\//,"");try{if(Z&&Z.has(C))return Z.get(C)}catch{}try{for(const[A,L]of V.entries())if(L){if(typeof L=="string"){if(Y(L)===N)return A}else if(L&&typeof L=="object"){if(L.default&&Y(L.default)===N)return A;const D=L.langs||{};for(const K in D)if(D[K]&&Y(D[K])===N)return A}}}catch{}return null}catch{return null}}async function ie(R,N){try{if(!R||!R.length)return;const C=[];for(let q=0;q<R.length;q++)try{const $=R[q];if(!$||typeof $.getAttribute!="function")continue;const T=$.getAttribute("href")||"";if(!T||Nr(T))continue;let j=null;try{const Se=it(T);Se&&Se.page&&(j=Se.page)}catch{}if(!j){const Se=String(T||"").split(/[?#]/,1),ze=Se&&Se[0]?Se[0]:T;(/\.(?:md|html?)$/i.test(ze)||ze.indexOf("/")!==-1)&&(j=Y(String(ze||"")))}if(!j)continue;const X=Y(String(j||"")),se=X.replace(/^.*\//,"");let pe=null;try{E&&E.has(X)&&(pe=E.get(X))}catch{}try{!pe&&Z&&Z.has(X)&&(pe=Z.get(X))}catch{}if(pe)continue;let be=null;try{be=$.textContent&&String($.textContent).trim()?String($.textContent).trim():null}catch{be=null}let ge=null;if(be)ge=he(be);else{const Se=se.replace(/\.(?:md|html?)$/i,"");ge=he(Se||X)}if(ge)try{C.push({path:X,candidate:ge})}catch{}}catch{}if(!C.length)return;const A=3;let L=0;const D=async()=>{for(;L<C.length;){const q=C[L++];if(!(!q||!q.path))try{const $=await Oe(q.path,N);if(!$||!$.raw)continue;let T=null;if($.isHtml)try{const j=qe(),X=j?j.parseFromString($.raw,"text/html"):null,se=X?X.querySelector("h1")||X.querySelector("title"):null;se&&se.textContent&&(T=String(se.textContent).trim())}catch{}else try{const j=$.raw.match(/^#\s+(.+)$/m);j&&j[1]&&(T=String(j[1]).trim())}catch{}if(T){const j=he(T);if(j&&j!==q.candidate){try{tn(j,q.path)}catch{}try{E.set(q.path,j)}catch{}try{E.set(q.path.replace(/^.*\//,""),j)}catch{}try{const X=await Promise.resolve().then(()=>at);try{if(Array.isArray(X.searchIndex)){let se=!1;for(const pe of X.searchIndex)try{if(pe&&pe.path===q.path&&pe.slug){const ge=String(pe.slug).split("::").slice(1).join("::");pe.slug=ge?`${j}::${ge}`:j,se=!0}}catch{}try{se&&typeof X._setSearchIndex=="function"&&X._setSearchIndex(X.searchIndex)}catch{}}}catch{}}catch{}}}}catch{}}},K=[];for(let q=0;q<A;q++)K.push(D());try{await Promise.all(K)}catch{}}catch{}}const ye=document.createElement("a");ye.className="navbar-burger",ye.setAttribute("role","button"),ye.setAttribute("aria-label","menu"),ye.setAttribute("aria-expanded","false");const J="nimbi-navbar-menu";ye.dataset.target=J,ye.innerHTML='<span aria-hidden="true"></span><span aria-hidden="true"></span><span aria-hidden="true"></span>',W.appendChild(ye);try{ye.addEventListener("click",R=>{try{const N=ye.dataset&&ye.dataset.target?ye.dataset.target:null,C=N?O&&O.querySelector?O.querySelector(`#${N}`)||(e&&e.querySelector?e.querySelector(`#${N}`):document.getElementById(N)):e&&e.querySelector?e.querySelector(`#${N}`)||document.getElementById(N):typeof document<"u"?document.getElementById(N):null:null;ye.classList.contains("is-active")?(ye.classList.remove("is-active"),ye.setAttribute("aria-expanded","false"),C&&C.classList.remove("is-active")):(ye.classList.add("is-active"),ye.setAttribute("aria-expanded","true"),C&&C.classList.add("is-active"))}catch(N){k("[nimbi-cms] navbar burger toggle failed",N)}})}catch(R){k("[nimbi-cms] burger event binding failed",R)}const Te=document.createElement("div");Te.className="navbar-menu",Te.id=J;const ke=document.createElement("div");ke.className="navbar-start";let xe=null,Ce=null;if(!o)xe=null,f=null,y=null,_=null,b=null;else{xe=document.createElement("div"),xe.className="navbar-end",Ce=document.createElement("div"),Ce.className="navbar-item",f=document.createElement("input"),f.className="input",f.type="search",f.placeholder=a("searchPlaceholder")||"",f.id="nimbi-search";try{const A=(a&&typeof a=="function"?a("searchAria"):null)||f.placeholder||"Search";try{f.setAttribute("aria-label",A)}catch{}try{f.setAttribute("aria-controls","nimbi-search-results")}catch{}try{f.setAttribute("aria-autocomplete","list")}catch{}try{f.setAttribute("role","combobox")}catch{}}catch{}l==="eager"&&(f.disabled=!0),w=document.createElement("div"),w.className="control",l==="eager"&&w.classList.add("is-loading"),w.appendChild(f),Ce.appendChild(w),y=document.createElement("div"),y.className="dropdown is-right",y.id="nimbi-search-dropdown";const R=document.createElement("div");R.className="dropdown-trigger",R.appendChild(Ce);const N=document.createElement("div");N.className="dropdown-menu",N.setAttribute("role","menu"),_=document.createElement("div"),_.id="nimbi-search-results",_.className="dropdown-content nimbi-search-results",b=_,N.appendChild(_),y.appendChild(R),y.appendChild(N),xe.appendChild(y);const C=A=>{if(!_)return;try{if(typeof _.replaceChildren=="function")_.replaceChildren();else for(;_.firstChild;)_.removeChild(_.firstChild)}catch{try{_.innerHTML=""}catch{}}let L=-1;function D($){try{const T=_.querySelector(".nimbi-search-result.is-selected");T&&T.classList.remove("is-selected");const j=_.querySelectorAll(".nimbi-search-result");if(!j||!j.length)return;if($<0){L=-1;return}$>=j.length&&($=j.length-1);const X=j[$];if(X){X.classList.add("is-selected"),L=$;try{X.scrollIntoView({block:"nearest"})}catch{}}}catch{}}function K($){try{const T=$.key,j=_.querySelectorAll(".nimbi-search-result");if(!j||!j.length)return;if(T==="ArrowDown"){$.preventDefault();const X=L<0?0:Math.min(j.length-1,L+1);D(X);return}if(T==="ArrowUp"){$.preventDefault();const X=L<=0?0:L-1;D(X);return}if(T==="Enter"){$.preventDefault();const X=_.querySelector(".nimbi-search-result.is-selected")||_.querySelector(".nimbi-search-result");if(X)try{X.click()}catch{}return}if(T==="Escape"){try{y.classList.remove("is-active")}catch{}try{document.documentElement.classList.remove("nimbi-search-open")}catch{}try{_.style.display="none"}catch{}try{_.classList.remove("is-open")}catch{}try{_.removeAttribute("tabindex")}catch{}try{_.removeEventListener("keydown",K)}catch{}try{f&&f.focus()}catch{}try{f&&f.removeEventListener("keydown",q)}catch{}return}}catch{}}function q($){try{if($&&$.key==="ArrowDown"){$.preventDefault();try{_.focus()}catch{}D(0)}}catch{}}try{const $=String(f&&f.value||"").trim();if(!A||!A.length){if(!$){try{y&&y.classList.remove("is-active")}catch{}try{document.documentElement.classList.remove("nimbi-search-open")}catch{}try{_&&(_.style.display="none",_.classList.remove("is-open"),_.removeAttribute("tabindex"))}catch{}try{_&&_.removeEventListener("keydown",K)}catch{}return}try{const T=document.createElement("div");T.className="panel nimbi-search-panel";const j=document.createElement("p");j.className="panel-block nimbi-search-no-results",j.textContent=a&&typeof a=="function"?a("searchNoResults"):"No results",T.appendChild(j),er(()=>{try{_.appendChild(T)}catch{}})}catch{}if(y){y.classList.add("is-active");try{document.documentElement.classList.add("nimbi-search-open")}catch{}}try{_.style.display="block"}catch{}try{_.classList.add("is-open")}catch{}try{_.setAttribute("tabindex","0")}catch{}return}}catch{}try{const $=document.createElement("div");$.className="panel nimbi-search-panel";const T=document.createDocumentFragment();A.forEach(j=>{if(j.parentTitle){const be=document.createElement("p");be.textContent=j.parentTitle,be.className="panel-heading nimbi-search-title nimbi-search-parent",T.appendChild(be)}const X=document.createElement("a");X.className="panel-block nimbi-search-result";const se=U(j);X.href=Pe(se.page,se.hash),X.setAttribute("role","button");try{if(j.path&&typeof j.path=="string")try{tn(se.page,j.path)}catch{}}catch{}const pe=document.createElement("div");pe.className="is-size-6 has-text-weight-semibold",pe.textContent=j.title,X.appendChild(pe),X.addEventListener("click",be=>{try{try{be&&be.preventDefault&&be.preventDefault()}catch{}try{be&&be.stopPropagation&&be.stopPropagation()}catch{}if(y){y.classList.remove("is-active");try{document.documentElement.classList.remove("nimbi-search-open")}catch{}}try{_.style.display="none"}catch{}try{_.classList.remove("is-open")}catch{}try{_.removeAttribute("tabindex")}catch{}try{_.removeEventListener("keydown",K)}catch{}try{f&&f.removeEventListener("keydown",q)}catch{}try{const ge=X.getAttribute&&X.getAttribute("href")||"";let Se=null,ze=null;try{const Fe=new URL(ge,location.href);Se=Fe.searchParams.get("page"),ze=Fe.hash?Fe.hash.replace(/^#/,""):null}catch{}if(Se)try{history.pushState({page:Se},"",Pe(Se,ze));try{I()}catch{try{typeof window<"u"&&typeof window.renderByQuery=="function"&&window.renderByQuery()}catch{}}return}catch{}}catch{}try{window.location.href=X.href}catch{}}catch{}}),T.appendChild(X)}),$.appendChild(T),er(()=>{try{_.appendChild($)}catch{}})}catch{}if(y){y.classList.add("is-active");try{document.documentElement.classList.add("nimbi-search-open")}catch{}}try{_.style.display="block"}catch{}try{_.classList.add("is-open")}catch{}try{_.setAttribute("tabindex","0")}catch{}try{_.addEventListener("keydown",K)}catch{}try{f&&f.addEventListener("keydown",q)}catch{}};if(f){const A=Yl(async()=>{const L=f||(typeof O<"u"&&O&&O.querySelector?O.querySelector("input#nimbi-search"):e&&e.querySelector?e.querySelector("input#nimbi-search"):typeof document<"u"?document.querySelector("input#nimbi-search"):null),D=String(L&&L.value||"").trim().toLowerCase();if(!D){try{y&&y.classList.remove("is-active")}catch{}try{document.documentElement.classList.remove("nimbi-search-open")}catch{}try{_&&(_.style.display="none",_.classList.remove("is-open"),_.removeAttribute("tabindex"))}catch{}return}try{await z();const K=await m,q=Array.isArray(K)?K.filter($=>$.title&&$.title.toLowerCase().includes(D)||$.excerpt&&$.excerpt.toLowerCase().includes(D)):[];C(q.slice(0,10))}catch(K){k("[nimbi-cms] search input handler failed",K),C([])}},50);try{f.addEventListener("input",A)}catch{}try{document.addEventListener("input",L=>{try{L&&L.target&&L.target.id==="nimbi-search"&&A(L)}catch{}},!0)}catch{}}if(l==="eager"){try{m=z()}catch(A){k("[nimbi-cms] eager search index init failed",A),m=Promise.resolve([])}m.finally(()=>{const A=f||(typeof O<"u"&&O&&O.querySelector?O.querySelector("input#nimbi-search"):e&&e.querySelector?e.querySelector("input#nimbi-search"):typeof document<"u"?document.querySelector("input#nimbi-search"):null);if(A){try{A.removeAttribute("disabled")}catch{}try{w&&w.classList.remove("is-loading")}catch{}}(async()=>{try{if(v)return;v=!0;const L=await m.catch(()=>[]),D=await Promise.resolve().then(()=>Ln);try{await D.handleSitemapRequest({index:Array.isArray(L)?L:void 0,homePage:r,contentBase:i,indexDepth:c,noIndexing:u,includeAllMarkdown:!0})}catch(K){k("[nimbi-cms] sitemap trigger failed",K)}}catch(L){try{k("[nimbi-cms] sitemap dynamic import failed",L)}catch{}}})()})}try{const A=L=>{try{const D=L&&L.target;if(!b||!b.classList.contains("is-open")&&b.style&&b.style.display!=="block"||D&&(b.contains(D)||f&&(D===f||f.contains&&f.contains(D))))return;if(y){y.classList.remove("is-active");try{document.documentElement.classList.remove("nimbi-search-open")}catch{}}try{b.style.display="none"}catch{}try{b.classList.remove("is-open")}catch{}}catch{}};document.addEventListener("click",A,!0),document.addEventListener("touchstart",A,!0)}catch{}}const He=document.createDocumentFragment();for(let R=0;R<p.length;R++){const N=p[R];if(R===0)continue;const C=N.getAttribute("href")||"#";let A=C;const L=document.createElement("a");L.className="navbar-item";try{let D=null;try{D=it(String(C||""))}catch{D=null}let K=null,q=null;if(D&&(D.type==="canonical"&&D.page||D.type==="cosmetic"&&D.page)&&(K=D.page,q=D.anchor),K&&(/\.(?:md|html?)$/i.test(K)||K.includes("/")?A=K:L.href=Pe(K,q)),/^[^#]*\.md(?:$|[#?])/.test(A)||A.endsWith(".md")){const T=Y(A).split(/::|#/,2),j=T[0],X=T[1],se=G(j);se?L.href=Pe(se,X):L.href=Pe(j,X)}else if(/\.html(?:$|[#?])/.test(A)||A.endsWith(".html")){const T=Y(A).split(/::|#/,2);let j=T[0];j&&!j.toLowerCase().endsWith(".html")&&(j=j+".html");const X=T[1],se=G(j);if(se)L.href=Pe(se,X);else try{const pe=await Oe(j,i);if(pe&&pe.raw)try{const be=qe(),ge=be?be.parseFromString(pe.raw,"text/html"):null,Se=ge?ge.querySelector("title"):null,ze=ge?ge.querySelector("h1"):null,Fe=Se&&Se.textContent&&Se.textContent.trim()?Se.textContent.trim():ze&&ze.textContent?ze.textContent.trim():null;if(Fe){const Ge=he(Fe);if(Ge){try{tn(Ge,j)}catch(Et){k("[nimbi-cms] slugToMd/mdToSlug set failed",Et)}L.href=Pe(Ge,X)}else L.href=Pe(j,X)}else L.href=Pe(j,X)}catch{L.href=Pe(j,X)}else L.href=A}catch{L.href=A}}else L.href=A}catch(D){k("[nimbi-cms] nav item href parse failed",D),L.href=A}try{const D=N.textContent&&String(N.textContent).trim()?String(N.textContent).trim():null;if(D)try{const K=he(D);if(K){const q=L.getAttribute("href")||"";let $=null;if(/^[^#?]*\.(?:md|html?)(?:$|[?#])/i.test(q))$=Y(String(q||"").split(/[?#]/)[0]);else try{const T=it(q);T&&T.type==="canonical"&&T.page&&($=Y(T.page))}catch{}if($){let T=!1;try{if(/\.(?:html?)(?:$|[?#])/i.test(String($||"")))T=!0;else if(/\.(?:md)(?:$|[?#])/i.test(String($||"")))T=!1;else{const j=String($||"").replace(/^\.\//,""),X=j.replace(/^.*\//,"");$e&&$e.size&&($e.has(j)||$e.has(X))&&(T=!0)}}catch{T=!1}if(T)try{const j=Y(String($||"").split(/[?#]/)[0]);let X=!1;try{G&&typeof G=="function"&&G(j)&&(X=!0)}catch{}try{tn(K,$)}catch{}try{if(j){try{E.set(j,K)}catch{}try{const se=j.replace(/^.*\//,"");se&&E.set(se,K)}catch{}}}catch{}if(X)try{L.href=Pe(K)}catch{}}catch{}}}}catch(K){k("[nimbi-cms] nav slug mapping failed",K)}}catch(D){k("[nimbi-cms] nav slug mapping failed",D)}L.textContent=N.textContent||A,He.appendChild(L)}try{ke.appendChild(He)}catch{}Te.appendChild(ke),xe&&Te.appendChild(xe),O.appendChild(W),O.appendChild(Te),e.appendChild(O);try{const R=N=>{try{const C=typeof O<"u"&&O&&O.querySelector?O.querySelector(".navbar-burger"):e&&e.querySelector?e.querySelector(".navbar-burger"):typeof document<"u"?document.querySelector(".navbar-burger"):null;if(!C||!C.classList.contains("is-active"))return;const A=C&&C.closest?C.closest(".navbar"):O;if(A&&A.contains(N.target))return;P()}catch{}};document.addEventListener("click",R,!0),document.addEventListener("touchstart",R,!0)}catch{}try{Te.addEventListener("click",R=>{const N=R.target&&R.target.closest?R.target.closest("a"):null;if(!N)return;const C=N.getAttribute("href")||"";try{const A=new URL(C,location.href),L=A.searchParams.get("page"),D=A.hash?A.hash.replace(/^#/,""):null;L&&(R.preventDefault(),history.pushState({page:L},"",Pe(L,D)),I())}catch(A){k("[nimbi-cms] navbar click handler failed",A)}try{const A=typeof O<"u"&&O&&O.querySelector?O.querySelector(".navbar-burger"):e&&e.querySelector?e.querySelector(".navbar-burger"):null,L=A&&A.dataset?A.dataset.target:null,D=L?O&&O.querySelector?O.querySelector(`#${L}`)||(e&&e.querySelector?e.querySelector(`#${L}`):document.getElementById(L)):e&&e.querySelector?e.querySelector(`#${L}`)||document.getElementById(L):typeof document<"u"?document.getElementById(L):null:null;A&&A.classList.contains("is-active")&&(A.classList.remove("is-active"),A.setAttribute("aria-expanded","false"),D&&D.classList.remove("is-active"))}catch(A){k("[nimbi-cms] mobile menu close failed",A)}})}catch(R){k("[nimbi-cms] attach content click handler failed",R)}try{t.addEventListener("click",R=>{const N=R.target&&R.target.closest?R.target.closest("a"):null;if(!N)return;const C=N.getAttribute("href")||"";if(C&&!Nr(C))try{const A=new URL(C,location.href),L=A.searchParams.get("page"),D=A.hash?A.hash.replace(/^#/,""):null;L&&(R.preventDefault(),history.pushState({page:L},"",Pe(L,D)),I())}catch(A){k("[nimbi-cms] container click URL parse failed",A)}})}catch(R){k("[nimbi-cms] build navbar failed",R)}return{navbar:O,linkEls:p}}try{document.addEventListener("input",e=>{try{if(e&&e.target&&e.target.id==="nimbi-search"){const t=document.getElementById("nimbi-search-results");if(t&&e.target&&e.target.value)try{t.style.display="block"}catch{}}}catch{}},!0)}catch{}let tt=null,de=null,Qe=1,St=(e,t)=>t,En=0,Cn=0,tr=()=>{},_n=.25;function kc(){if(tt&&document.contains(tt))return tt;tt=null;const e=document.createElement("dialog");e.className="nimbi-image-preview modal",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",St("imagePreviewTitle","Image preview"));try{const M=document.createElement("div");M.className="modal-background";const F=document.createElement("div");F.className="modal-content";const G=document.createElement("div");G.className="nimbi-image-preview__content box",G.setAttribute("role","document");const ie=document.createElement("button");ie.className="button is-small nimbi-image-preview__close",ie.type="button",ie.setAttribute("data-nimbi-preview-close",""),ie.textContent="✕";const ye=document.createElement("div");ye.className="nimbi-image-preview__image-wrapper";const J=document.createElement("img");J.setAttribute("data-nimbi-preview-image",""),J.alt="",ye.appendChild(J);const Te=document.createElement("div");Te.className="nimbi-image-preview__controls";const ke=document.createElement("div");ke.className="nimbi-image-preview__group";const xe=document.createElement("button");xe.className="button is-small",xe.type="button",xe.setAttribute("data-nimbi-preview-fit",""),xe.textContent="⤢";const Ce=document.createElement("button");Ce.className="button is-small",Ce.type="button",Ce.setAttribute("data-nimbi-preview-original",""),Ce.textContent="1:1";const He=document.createElement("button");He.className="button is-small",He.type="button",He.setAttribute("data-nimbi-preview-reset",""),He.textContent="⟲",ke.appendChild(xe),ke.appendChild(Ce),ke.appendChild(He);const R=document.createElement("div");R.className="nimbi-image-preview__group";const N=document.createElement("button");N.className="button is-small",N.type="button",N.setAttribute("data-nimbi-preview-zoom-out",""),N.textContent="−";const C=document.createElement("div");C.className="nimbi-image-preview__zoom",C.setAttribute("data-nimbi-preview-zoom-label",""),C.textContent="100%";const A=document.createElement("button");A.className="button is-small",A.type="button",A.setAttribute("data-nimbi-preview-zoom-in",""),A.textContent="+",R.appendChild(N),R.appendChild(C),R.appendChild(A),Te.appendChild(ke),Te.appendChild(R),G.appendChild(ie),G.appendChild(ye),G.appendChild(Te),F.appendChild(G),e.appendChild(M),e.appendChild(F)}catch{e.innerHTML=`
|
|
2169
|
+
`;onmessage=async e=>{const t=e.data||{};try{if(t.type==="rewriteAnchors"){const{id:n,html:i,contentBase:r,pagePath:a}=t;try{const s=He();if(!s)postMessage({id:n,result:i});else{const o=s.parseFromString(i||"","text/html"),l=o.body;await Ai(l,r,a,{canonical:!0}),postMessage({id:n,result:o.body.innerHTML})}}catch(s){postMessage({id:n,error:String(s)})}return}}catch(n){postMessage({id:t.id,error:String(n)})}};async function rs(e){try{if(e&&e.type==="rewriteAnchors"){const{id:t,html:n,contentBase:i,pagePath:r}=e;try{const a=He();if(!a)return{id:t,result:n};const s=a.parseFromString(n||"","text/html"),o=s.body;return await Ai(o,i,r,{canonical:!0}),{id:t,result:s.body.innerHTML}}catch(a){return{id:t,error:String(a)}}}return{id:e&&e.id,error:"unsupported message"}}catch(t){return{id:e&&e.id,error:String(t)}}}const sc=Object.freeze(Object.defineProperty({__proto__:null,handleAnchorWorkerMessage:rs},Symbol.toStringTag,{value:"Module"}));function ft(e,t=null){try{const n=typeof location<"u"&&location&&typeof location.pathname=="string"&&location.pathname||"/";return String(n)+Ui(e,t)}catch{return Ui(e,t)}}function oc(...e){try{k(...e)}catch{}}function fr(e){try{if(tn(3))return!0}catch{}try{if(typeof le=="string"&&le)return!0}catch{}try{if(Y&&Y.size)return!0}catch{}try{if($e&&$e.size)return!0}catch{}return!1}function vt(e,t){try{if(typeof rt=="function")try{rt(e,t);return}catch{}}catch{}try{e&&t&&Y&&typeof Y.set=="function"&&!Y.has(e)&&Y.set(e,t)}catch{}try{t&&G&&typeof G.set=="function"&&G.set(t,e)}catch{}try{if($e&&typeof $e.has=="function"){if(!$e.has(t)){try{$e.add(t)}catch{}try{Array.isArray(Oe)&&!Oe.includes(t)&&Oe.push(t)}catch{}}}else try{Array.isArray(Oe)&&!Oe.includes(t)&&Oe.push(t)}catch{}}catch{}}function lc(e,t){try{return new URL(e,t).pathname}catch{try{return new URL(e,typeof location<"u"?location.href:"http://localhost/").pathname}catch{try{return(String(t||"").replace(/\/$/,"")+"/"+String(e||"").replace(/^\//,"")).replace(/\/\\+/g,"/")}catch{return String(e||"")}}}}function Jr(e,t){try{if(!e)return e;if(!t)return String(e||"");const n=String(t||"").replace(/^\/+|\/+$/g,"");if(!n)return String(e||"");let i=String(e||"");i=i.replace(/^\/+/,"");const r=n+"/";for(;i.startsWith(r);)i=i.slice(r.length);return i===n?"":i}catch{return String(e||"")}}function cc(e,t){const n=document.createElement("aside");n.className="menu box nimbi-nav";const i=document.createElement("p");i.className="menu-label",i.textContent=e("navigation"),n.appendChild(i);const r=document.createElement("ul");r.className="menu-list";try{const a=document.createDocumentFragment();t.forEach(s=>{const o=document.createElement("li"),l=document.createElement("a");try{const c=String(s.path||"");try{l.setAttribute("href",Pe(c))}catch{c&&c.indexOf("/")===-1?l.setAttribute("href","#"+encodeURIComponent(c)):l.setAttribute("href",ft(c))}}catch{l.setAttribute("href","#"+s.path)}if(l.textContent=s.name,o.appendChild(l),s.children&&s.children.length){const c=document.createElement("ul");s.children.forEach(u=>{const g=document.createElement("li"),h=document.createElement("a");try{const d=String(u.path||"");try{h.setAttribute("href",Pe(d))}catch{d&&d.indexOf("/")===-1?h.setAttribute("href","#"+encodeURIComponent(d)):h.setAttribute("href",ft(d))}}catch{h.setAttribute("href","#"+u.path)}h.textContent=u.name,g.appendChild(h),c.appendChild(g)}),o.appendChild(c)}a.appendChild(o)}),r.appendChild(a)}catch{t.forEach(s=>{try{const o=document.createElement("li"),l=document.createElement("a");try{const c=String(s.path||"");try{l.setAttribute("href",Pe(c))}catch{c&&c.indexOf("/")===-1?l.setAttribute("href","#"+encodeURIComponent(c)):l.setAttribute("href",ft(c))}}catch{l.setAttribute("href","#"+s.path)}if(l.textContent=s.name,o.appendChild(l),s.children&&s.children.length){const c=document.createElement("ul");s.children.forEach(u=>{const g=document.createElement("li"),h=document.createElement("a");try{const d=String(u.path||"");try{h.setAttribute("href",Pe(d))}catch{d&&d.indexOf("/")===-1?h.setAttribute("href","#"+encodeURIComponent(d)):h.setAttribute("href",ft(d))}}catch{h.setAttribute("href","#"+u.path)}h.textContent=u.name,g.appendChild(h),c.appendChild(g)}),o.appendChild(c)}r.appendChild(o)}catch(o){k("[htmlBuilder] createNavTree item failed",o)}})}return n.appendChild(r),n}function uc(e,t,n=""){const i=document.createElement("aside");i.className="menu box nimbi-toc-inner is-hidden-mobile";const r=document.createElement("p");r.className="menu-label",r.textContent=e("onThisPage"),i.appendChild(r);const a=document.createElement("ul");a.className="menu-list";try{const o={};(t||[]).forEach(l=>{try{if(!l||l.level===1)return;const c=Number(l.level)>=2?Number(l.level):2,u=document.createElement("li"),g=document.createElement("a"),h=ho(l.text||""),d=l.id||de(h);g.textContent=h;try{const w=String(n||"").replace(/^[\\.\\/]+/,""),y=w&&G&&G.has&&G.has(w)?G.get(w):w;y?g.href=Pe(y,d):g.href=`#${encodeURIComponent(d)}`}catch(w){k("[htmlBuilder] buildTocElement href normalization failed",w),g.href=`#${encodeURIComponent(d)}`}if(u.appendChild(g),c===2){a.appendChild(u),o[2]=u,Object.keys(o).forEach(w=>{Number(w)>2&&delete o[w]});return}let p=c-1;for(;p>2&&!o[p];)p--;p<2&&(p=2);let m=o[p];if(!m){a.appendChild(u),o[c]=u;return}let f=m.querySelector("ul");f||(f=document.createElement("ul"),m.appendChild(f)),f.appendChild(u),o[c]=u}catch(c){k("[htmlBuilder] buildTocElement item failed",c,l)}})}catch(o){k("[htmlBuilder] buildTocElement failed",o)}return i.appendChild(a),a.querySelectorAll("li").length<=1?null:i}function is(e){e.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(n=>{n.id||(n.id=de(n.textContent||""))})}function hc(e,t,n){try{const i=e.querySelectorAll("img");if(i&&i.length){const r=t&&t.includes("/")?t.substring(0,t.lastIndexOf("/")+1):"";i.forEach(a=>{const s=a.getAttribute("src")||"";if(s&&!(/^(https?:)?\/\//.test(s)||s.startsWith("/")))try{const o=new URL(r+s,n).toString();a.src=o;try{a.getAttribute("loading")||a.setAttribute("data-want-lazy","1")}catch(l){k("[htmlBuilder] set image loading attribute failed",l)}}catch(o){k("[htmlBuilder] resolve image src failed",o)}})}}catch(i){k("[htmlBuilder] lazyLoadImages failed",i)}}function sa(e,t,n){try{const i=t&&t.includes("/")?t.substring(0,t.lastIndexOf("/")+1):"";let r=null;try{const o=new URL(n,location.href);r=new URL(i||".",o).toString()}catch{try{r=new URL(i||".",location.href).toString()}catch{r=i||"./"}}let a=null;try{a=e.querySelectorAll("[src],[href],[srcset],[poster]")}catch{const l=[];try{l.push(...Array.from(e.getElementsByTagName("img")||[]))}catch{}try{l.push(...Array.from(e.getElementsByTagName("link")||[]))}catch{}try{l.push(...Array.from(e.getElementsByTagName("video")||[]))}catch{}try{l.push(...Array.from(e.getElementsByTagName("use")||[]))}catch{}try{l.push(...Array.from(e.querySelectorAll("[srcset]")||[]))}catch{}a=l}let s=Array.from(a||[]);try{const o=Array.from(e.getElementsByTagName("use")||[]);for(const l of o)s.indexOf(l)===-1&&s.push(l)}catch{}for(const o of Array.from(s||[]))try{const l=o.tagName?o.tagName.toLowerCase():"",c=u=>{try{const g=o.getAttribute(u)||"";if(!g||/^(https?:)?\/\//i.test(g)||g.startsWith("/")||g.startsWith("#"))return;try{o.setAttribute(u,new URL(g,r).toString())}catch(h){k("[htmlBuilder] rewrite asset attribute failed",u,g,h)}}catch(g){k("[htmlBuilder] rewriteAttr failed",g)}};if(o.hasAttribute&&o.hasAttribute("src")&&c("src"),o.hasAttribute&&o.hasAttribute("href")&&l!=="a"&&c("href"),o.hasAttribute&&o.hasAttribute("xlink:href")&&c("xlink:href"),o.hasAttribute&&o.hasAttribute("poster")&&c("poster"),o.hasAttribute&&o.hasAttribute("srcset")){const h=(o.getAttribute("srcset")||"").split(",").map(d=>d.trim()).filter(Boolean).map(d=>{const[p,m]=d.split(/\s+/,2);if(!p||/^(https?:)?\/\//i.test(p)||p.startsWith("/"))return d;try{const f=new URL(p,r).toString();return m?`${f} ${m}`:f}catch{return d}}).join(", ");o.setAttribute("srcset",h)}}catch(l){k("[htmlBuilder] rewriteRelativeAssets node processing failed",l)}}catch(i){k("[htmlBuilder] rewriteRelativeAssets failed",i)}}let oa="",Pr=null,la="";async function Ai(e,t,n,i={}){try{i=i||{},typeof i.canonical>"u"&&(i.canonical=!0);const r=e.querySelectorAll("a");if(!r||!r.length)return;let a,s;if(t===oa&&Pr)a=Pr,s=la;else{try{a=new URL(t,location.href),s=Yt(a.pathname)}catch{try{a=new URL(t,location.href),s=Yt(a.pathname)}catch{a=null,s="/"}}oa=t,Pr=a,la=s}const o=new Set,l=[],c=new Set,u=[];for(const g of Array.from(r))try{try{if(g.closest&&g.closest("h1,h2,h3,h4,h5,h6"))continue}catch{}const h=g.getAttribute("href")||"";if(!h||qr(h))continue;try{if(h.startsWith("?")||h.indexOf("?")!==-1)try{const p=new URL(h,t||location.href),m=p.searchParams.get("page");if(m&&m.indexOf("/")===-1&&n){const f=n.includes("/")?n.substring(0,n.lastIndexOf("/")+1):"";if(f){const w=J(f+m),y=i&&i.canonical?Pe(w,p.hash?p.hash.replace(/^#/,""):null):ft(w,p.hash?p.hash.replace(/^#/,""):null);g.setAttribute("href",y);continue}}}catch{}}catch{}if(h.startsWith("/")&&!h.endsWith(".md"))continue;const d=h.match(/^([^#?]+\.md)(?:[#](.+))?$/);if(d){let p=d[1];const m=d[2];!p.startsWith("/")&&n&&(p=(n.includes("/")?n.substring(0,n.lastIndexOf("/")+1):"")+p);try{const f=new URL(p,t).pathname;let w=f.startsWith(s)?f.slice(s.length):f;w=Jr(w,s),w=J(w),l.push({node:g,mdPathRaw:p,frag:m,rel:w}),G.has(w)||o.add(w)}catch(f){k("[htmlBuilder] resolve mdPath failed",f)}continue}try{let p=h;!h.startsWith("/")&&n&&(h.startsWith("#")?p=n+h:p=(n.includes("/")?n.substring(0,n.lastIndexOf("/")+1):"")+h);const f=new URL(p,t).pathname||"";if(f&&f.indexOf(s)!==-1){let w=f.startsWith(s)?f.slice(s.length):f;if(w=Jr(w,s),w=J(w),w=cn(w),w||(w=Ot),!w.endsWith(".md")){let y=null;try{if(G&&G.has&&G.has(w))y=G.get(w);else try{const _=String(w||"").replace(/^.*\//,"");_&&G.has&&G.has(_)&&(y=G.get(_))}catch(_){k("[htmlBuilder] mdToSlug baseName check failed",_)}}catch(_){k("[htmlBuilder] mdToSlug access check failed",_)}if(!y)try{const _=String(w||"").replace(/^.*\//,"");for(const[b,A]of Y||[])if(A===w||A===_){y=b;break}}catch{}if(y){const _=i&&i.canonical?Pe(y,null):ft(y);g.setAttribute("href",_)}else{let _=w;try{/\.[^\/]+$/.test(String(w||""))||(_=String(w||"")+".html")}catch{_=w}c.add(_),u.push({node:g,rel:_})}}}}catch(p){k("[htmlBuilder] resolving href to URL failed",p)}}catch(h){k("[htmlBuilder] processing anchor failed",h)}if(o.size)if(fr(t))await Rn(Array.from(o),async g=>{try{try{const d=String(g).match(/([^\/]+)\.md$/),p=d&&d[1];if(p&&Y.has(p)){try{const m=Y.get(p);if(m)try{const f=typeof m=="string"?m:m&&m.default?m.default:null;f&&vt(p,f)}catch(f){k("[htmlBuilder] _storeSlugMapping failed",f)}}catch(m){k("[htmlBuilder] reading slugToMd failed",m)}return}}catch(d){k("[htmlBuilder] basename slug lookup failed",d)}const h=await Be(g,t);if(h&&h.raw){const d=(h.raw||"").match(/^#\s+(.+)$/m);if(d&&d[1]){const p=de(d[1].trim());if(p)try{vt(p,g)}catch(m){k("[htmlBuilder] setting slug mapping failed",m)}}}}catch(h){k("[htmlBuilder] fetchMarkdown during rewriteAnchors failed",h)}},6);else{try{k("[htmlBuilder] skipping md title probes (probing disabled)")}catch{}for(const g of Array.from(o))try{const h=String(g).match(/([^\/]+)\.md$/),d=h&&h[1];if(d){const p=de(d);if(p)try{vt(p,g)}catch(m){k("[htmlBuilder] setting fallback slug mapping failed",m)}}}catch{}}if(c.size)if(fr(t))await Rn(Array.from(c),async g=>{try{const h=await Be(g,t);if(h&&h.raw)try{const d=He(),p=d?d.parseFromString(h.raw,"text/html"):null,m=p?p.querySelector("title"):null,f=p?p.querySelector("h1"):null,w=m&&m.textContent&&m.textContent.trim()?m.textContent.trim():f&&f.textContent?f.textContent.trim():null;if(w){const y=de(w);if(y)try{vt(y,g)}catch(_){k("[htmlBuilder] setting html slug mapping failed",_)}}}catch(d){k("[htmlBuilder] parse fetched HTML failed",d)}}catch(h){k("[htmlBuilder] fetchMarkdown for htmlPending failed",h)}},5);else{try{k("[htmlBuilder] skipping html title probes (probing disabled)")}catch{}for(const g of Array.from(c))try{const h=String(g).match(/([^\/]+)\.html$/),d=h&&h[1];if(d){const p=de(d);if(p)try{vt(p,g)}catch(m){k("[htmlBuilder] setting fallback html slug mapping failed",m)}}}catch{}}for(const g of l){const{node:h,frag:d,rel:p}=g;let m=null;try{G.has(p)&&(m=G.get(p))}catch(f){k("[htmlBuilder] mdToSlug access failed",f)}if(m){const f=i&&i.canonical?Pe(m,d):ft(m,d);h.setAttribute("href",f)}else{const f=i&&i.canonical?Pe(p,d):ft(p,d);h.setAttribute("href",f)}}for(const g of u){const{node:h,rel:d}=g;let p=null;try{G.has(d)&&(p=G.get(d))}catch(m){k("[htmlBuilder] mdToSlug access failed for htmlAnchorInfo",m)}if(!p)try{const m=String(d||"").replace(/^.*\//,"");G.has(m)&&(p=G.get(m))}catch(m){k("[htmlBuilder] mdToSlug baseName access failed for htmlAnchorInfo",m)}if(p){const m=i&&i.canonical?Pe(p,null):ft(p);h.setAttribute("href",m)}else{const m=i&&i.canonical?Pe(d,null):ft(d);h.setAttribute("href",m)}}}catch(r){k("[htmlBuilder] rewriteAnchors failed",r)}}function dc(e,t,n,i){const r=t.querySelector("h1"),a=r?(r.textContent||"").trim():"";let s="";try{let o="";try{e&&e.meta&&e.meta.title&&(o=String(e.meta.title).trim())}catch{}if(!o&&a&&(o=a),!o)try{const l=t.querySelector("h2");l&&l.textContent&&(o=String(l.textContent).trim())}catch{}!o&&n&&(o=String(n)),o&&(s=de(o)),s||(s=Ot);try{if(n){try{vt(s,n)}catch(l){k("[htmlBuilder] computeSlug set slug mapping failed",l)}try{const l=J(String(n||""));if(G&&typeof G.has=="function"&&G.has(l))s=G.get(l);else try{for(const[c,u]of Y||[])try{const g=typeof u=="string"?u:u&&u.default?u.default:null;if(g&&J(String(g))===l){s=c;break}}catch{}}catch{}}catch{}}}catch(l){k("[htmlBuilder] computeSlug set slug mapping failed",l)}try{let l=i||"";if(!l)try{const c=Je(typeof location<"u"?location.href:"");c&&c.anchor&&c.page&&String(c.page)===String(s)?l=c.anchor:l=""}catch{l=""}try{history.replaceState({page:s},"",ft(s,l))}catch(c){k("[htmlBuilder] computeSlug history replace failed",c)}}catch(l){k("[htmlBuilder] computeSlug inner failed",l)}}catch(o){k("[htmlBuilder] computeSlug failed",o)}try{if(e&&e.meta&&e.meta.title&&r){const o=String(e.meta.title).trim();if(o&&o!==a){try{s&&(r.id=s)}catch{}try{if(Array.isArray(e.toc))for(const l of e.toc)try{if(l&&Number(l.level)===1&&String(l.text).trim()===(a||"").trim()){l.id=s;break}}catch{}}catch{}}}}catch{}return{topH1:r,h1Text:a,slugKey:s}}async function fc(e,t){if(!e||!e.length)return;const n=new Set;for(const s of Array.from(e||[]))try{const o=s.getAttribute("href")||"";if(!o)continue;let u=J(o).split(/::|#/,2)[0];try{const h=u.indexOf("?");h!==-1&&(u=u.slice(0,h))}catch{}if(!u||(u.includes(".")||(u=u+".html"),!/\.html(?:$|[?#])/.test(u)&&!u.toLowerCase().endsWith(".html")))continue;const g=u;try{if(G&&G.has&&G.has(g))continue}catch(h){k("[htmlBuilder] mdToSlug check failed",h)}try{let h=!1;for(const d of Y.values())if(d===g){h=!0;break}if(h)continue}catch(h){k("[htmlBuilder] slugToMd iteration failed",h)}n.add(g)}catch(o){k("[htmlBuilder] preScanHtmlSlugs anchor iteration failed",o)}if(!n.size)return;if(!fr()){try{k("[htmlBuilder] skipping preScanHtmlSlugs (probing disabled)")}catch{}for(const s of Array.from(n))try{const o=String(s).match(/([^\/]+)\.html$/),l=o&&o[1];if(l){const c=de(l);if(c)try{vt(c,s)}catch(u){k("[htmlBuilder] setting fallback preScanHtmlSlugs mapping failed",u)}}}catch{}return}const i=async s=>{try{const o=await Be(s,t);if(o&&o.raw)try{const c=He().parseFromString(o.raw,"text/html"),u=c.querySelector("title"),g=c.querySelector("h1"),h=u&&u.textContent&&u.textContent.trim()?u.textContent.trim():g&&g.textContent?g.textContent.trim():null;if(h){const d=de(h);if(d)try{vt(d,s)}catch(p){k("[htmlBuilder] set slugToMd/mdToSlug failed",p)}}}catch(l){k("[htmlBuilder] parse HTML title failed",l)}}catch(o){k("[htmlBuilder] fetchAndExtract failed",o)}},r=Array.from(n),a=Math.max(1,Math.min(Sn(),r.length||1));await Rn(r,i,a)}async function gc(e,t){if(!e||!e.length)return;const n=[],i=new Set;let r="";try{const a=new URL(t,typeof location<"u"?location.href:"http://localhost/");r=Yt(a.pathname)}catch(a){r="",k("[htmlBuilder] preMapMdSlugs parse base failed",a)}for(const a of Array.from(e||[]))try{const s=a.getAttribute("href")||"";if(!s)continue;const o=s.match(/^([^#?]+\.md)(?:[#](.+))?$/);if(o){let l=J(o[1]);try{let c;try{c=lc(l,t)}catch(g){c=l,k("[htmlBuilder] resolve mdPath URL failed",g)}let u=c&&r&&c.startsWith(r)?c.slice(r.length):String(c||"").replace(/^\//,"");u=Jr(u,r),n.push({rel:u}),G.has(u)||i.add(u)}catch(c){k("[htmlBuilder] rewriteAnchors failed",c)}continue}}catch(s){k("[htmlBuilder] preMapMdSlugs anchor iteration failed",s)}if(i.size)if(fr())await Promise.all(Array.from(i).map(async a=>{try{const s=String(a).match(/([^\/]+)\.md$/),o=s&&s[1];if(o&&Y.has(o)){try{const l=Y.get(o);if(l)try{const c=typeof l=="string"?l:l&&l.default?l.default:null;c&&vt(o,c)}catch(c){k("[htmlBuilder] _storeSlugMapping failed",c)}}catch(l){k("[htmlBuilder] preMapMdSlugs slug map access failed",l)}return}}catch(s){k("[htmlBuilder] preMapMdSlugs basename check failed",s)}try{const s=await Be(a,t);if(s&&s.raw){const o=(s.raw||"").match(/^#\s+(.+)$/m);if(o&&o[1]){const l=de(o[1].trim());if(l)try{vt(l,a)}catch(c){k("[htmlBuilder] preMapMdSlugs setting slug mapping failed",c)}}}}catch(s){k("[htmlBuilder] preMapMdSlugs fetch failed",s)}}));else try{k("[htmlBuilder] skipping preMapMdSlugs probes (probing disabled)")}catch{}}He();function Ir(e){try{const n=He().parseFromString(e||"","text/html");is(n);try{n.querySelectorAll("img").forEach(l=>{try{l.getAttribute("loading")||l.setAttribute("data-want-lazy","1")}catch(c){k("[htmlBuilder] parseHtml set image loading attribute failed",c)}})}catch(o){k("[htmlBuilder] parseHtml query images failed",o)}n.querySelectorAll("pre code, code[class]").forEach(o=>{try{const l=o.getAttribute&&o.getAttribute("class")||o.className||"",c=l.match(/language-([a-zA-Z0-9_+-]+)/)||l.match(/lang(?:uage)?-?([a-zA-Z0-9_+-]+)/);if(c&&c[1]){const u=(c[1]||"").toLowerCase(),g=Ce.size&&(Ce.get(u)||Ce.get(String(u).toLowerCase()))||u;try{(async()=>{try{await ln(g)}catch(h){k("[htmlBuilder] registerLanguage failed",h)}})()}catch(h){k("[htmlBuilder] schedule registerLanguage failed",h)}}else try{if(Re&&typeof Re.getLanguage=="function"&&Re.getLanguage("plaintext")){const u=Re.highlight?Re.highlight(o.textContent||"",{language:"plaintext"}):null;if(u&&u.value)try{if(typeof document<"u"&&document.createRange&&typeof document.createRange=="function"){const g=document.createRange().createContextualFragment(u.value);if(typeof o.replaceChildren=="function")o.replaceChildren(...Array.from(g.childNodes));else{for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(g)}}else o.innerHTML=u.value}catch{try{o.innerHTML=u.value}catch{}}}}catch(u){k("[htmlBuilder] plaintext highlight fallback failed",u)}}catch(l){k("[htmlBuilder] code element processing failed",l)}});const r=[];n.querySelectorAll("h1,h2,h3,h4,h5,h6").forEach(o=>{r.push({level:Number(o.tagName.substring(1)),text:(o.textContent||"").trim(),id:o.id})});const s={};try{const o=n.querySelector("title");o&&o.textContent&&String(o.textContent).trim()&&(s.title=String(o.textContent).trim())}catch{}return{html:n.body.innerHTML,meta:s,toc:r}}catch(t){return k("[htmlBuilder] parseHtml failed",t),{html:e||"",meta:{},toc:[]}}}async function as(e){const t=Yr?await Yr(e||"",Ce):En(e||"",Ce),n=new Set(t),i=[];for(const r of n)try{const a=Ce.size&&(Ce.get(r)||Ce.get(String(r).toLowerCase()))||r;try{i.push(ln(a))}catch(s){k("[htmlBuilder] ensureLanguages push canonical failed",s)}if(String(r)!==String(a))try{i.push(ln(r))}catch(s){k("[htmlBuilder] ensureLanguages push alias failed",s)}}catch(a){k("[htmlBuilder] ensureLanguages inner failed",a)}try{await Promise.all(i)}catch(r){k("[htmlBuilder] ensureLanguages failed",r)}}async function pc(e){if(await as(e),hn){const t=await hn(e||"");return!t||typeof t!="object"?{html:String(e||""),meta:{},toc:[]}:(Array.isArray(t.toc)||(t.toc=[]),t.meta||(t.meta={}),t)}return{html:String(e||""),meta:{},toc:[]}}async function mc(e,t,n,i,r){let a=null,s=null;if(t.isHtml)try{const h=He();if(h){const d=h.parseFromString(t.raw||"","text/html");try{sa(d.body,n,r)}catch(p){k("[htmlBuilder] rewriteRelativeAssets failed in prepareArticle (inner)",p)}a=Ir(d.documentElement&&d.documentElement.outerHTML?d.documentElement.outerHTML:t.raw||"")}else a=Ir(t.raw||"")}catch{a=Ir(t.raw||"")}else{const h=t.raw||"",d=64*1024;if(h&&h.length>d&&Vr){try{await as(h)}catch{}s=document.createElement("article"),s.className="nimbi-article content";const p=[];let m={};try{await Vr(h,(f,w)=>{try{w&&w.meta&&(m=Object.assign(m,w.meta))}catch{}try{w&&Array.isArray(w.toc)&&w.toc.length&&p.push(...w.toc)}catch{}try{ir(()=>{try{const y=He();if(y){const _=y.parseFromString(String(f||""),"text/html"),b=Array.from(_.body.childNodes||[]);b.length?s.append(...b):s.insertAdjacentHTML("beforeend",f||"")}else{const _=document&&typeof document.createRange=="function"?document.createRange():null;if(_&&typeof _.createContextualFragment=="function"){const b=_.createContextualFragment(String(f||""));s.append(...Array.from(b.childNodes))}else s.insertAdjacentHTML("beforeend",f||"")}}catch{try{s.insertAdjacentHTML("beforeend",f||"")}catch{}}})}catch{}},{chunkSize:d})}catch(f){k("[htmlBuilder] streamParseMarkdown failed, falling back",f)}a={html:s.innerHTML,meta:m||{},toc:p}}else a=await pc(t.raw||"")}let o;if(s)o=s;else{o=document.createElement("article"),o.className="nimbi-article content";try{const h=He&&He();if(h){const d=h.parseFromString(String(a.html||""),"text/html"),p=Array.from(d.body.childNodes||[]);p.length?o.replaceChildren(...p):o.innerHTML=a.html}else try{const d=document&&typeof document.createRange=="function"?document.createRange():null;if(d&&typeof d.createContextualFragment=="function"){const p=d.createContextualFragment(String(a.html||""));o.replaceChildren(...Array.from(p.childNodes))}else o.innerHTML=a.html}catch{o.innerHTML=a.html}}catch{try{o.innerHTML=a.html}catch(d){k("[htmlBuilder] set article html failed",d)}}}try{sa(o,n,r)}catch(h){k("[htmlBuilder] rewriteRelativeAssets failed in prepareArticle",h)}try{is(o)}catch(h){k("[htmlBuilder] addHeadingIds failed",h)}try{o.querySelectorAll("pre code, code[class]").forEach(d=>{try{const p=d.getAttribute&&d.getAttribute("class")||d.className||"",m=String(p||"").replace(/\blanguage-undefined\b|\blang-undefined\b/g,"").trim();if(m)try{d.setAttribute&&d.setAttribute("class",m)}catch(f){d.className=m,k("[htmlBuilder] set element class failed",f)}else try{d.removeAttribute&&d.removeAttribute("class")}catch(f){d.className="",k("[htmlBuilder] remove element class failed",f)}}catch(p){k("[htmlBuilder] code element cleanup failed",p)}})}catch(h){k("[htmlBuilder] processing code elements failed",h)}try{ba(o)}catch(h){k("[htmlBuilder] observeCodeBlocks failed",h)}hc(o,n,r);try{(o.querySelectorAll&&o.querySelectorAll("img")||[]).forEach(d=>{try{const p=d.parentElement;if(!p||p.tagName.toLowerCase()!=="p"||p.childNodes.length!==1)return;const m=document.createElement("figure");m.className="image",p.replaceWith(m),m.appendChild(d)}catch{}})}catch(h){k("[htmlBuilder] wrap images in Bulma image helper failed",h)}try{(o.querySelectorAll&&o.querySelectorAll("table")||[]).forEach(d=>{try{if(d.classList)d.classList.contains("table")||d.classList.add("table");else{const p=d.getAttribute&&d.getAttribute("class")?d.getAttribute("class"):"",m=String(p||"").split(/\s+/).filter(Boolean);m.indexOf("table")===-1&&m.push("table");try{d.setAttribute&&d.setAttribute("class",m.join(" "))}catch{d.className=m.join(" ")}}}catch{}})}catch(h){k("[htmlBuilder] add Bulma table class failed",h)}const{topH1:l,h1Text:c,slugKey:u}=dc(a,o,n,i);try{if(l&&a&&a.meta&&(a.meta.author||a.meta.date)&&!(l.parentElement&&l.parentElement.querySelector&&l.parentElement.querySelector(".nimbi-article-subtitle"))){const d=a.meta.author?String(a.meta.author).trim():"",p=a.meta.date?String(a.meta.date).trim():"";let m="";try{const w=new Date(p);p&&!isNaN(w.getTime())?m=w.toLocaleDateString():m=p}catch{m=p}const f=[];if(d&&f.push(d),m&&f.push(m),f.length){const w=document.createElement("p"),y=f[0]?String(f[0]).replace(/"/g,"").trim():"",_=f.slice(1);if(w.className="nimbi-article-subtitle is-6 has-text-grey-light",y){const b=document.createElement("span");b.className="nimbi-article-author",b.textContent=y,w.appendChild(b)}if(_.length){const b=document.createElement("span");b.className="nimbi-article-meta",b.textContent=_.join(" • "),w.appendChild(b)}try{l.parentElement.insertBefore(w,l.nextSibling)}catch{try{l.insertAdjacentElement("afterend",w)}catch{}}}}}catch{}try{await _c(o,r,n)}catch(h){oc("[htmlBuilder] rewriteAnchorsWorker failed, falling back to main thread",h),await Ai(o,r,n)}const g=uc(e,a.toc,n);return{article:o,parsed:a,toc:g,topH1:l,h1Text:c,slugKey:u}}function yc(e){if(!(!e||!e.querySelectorAll))try{const t=Array.from(e.querySelectorAll("script"));for(const n of t)try{const i=document.createElement("script");for(const a of Array.from(n.attributes||[]))try{i.setAttribute(a.name,a.value)}catch{}if(!n.src){const a=n.textContent||"";let s=!1;try{new Function(a)(),s=!0}catch{s=!1}if(s){n.parentNode&&n.parentNode.removeChild(n);try{$t("[htmlBuilder] executed inline script via Function")}catch{}continue}try{i.type="module"}catch{}i.textContent=a}if(n.src)try{if(document.querySelector&&document.querySelector(`script[src="${n.src}"]`)){n.parentNode&&n.parentNode.removeChild(n);continue}}catch{}const r=n.src||"<inline>";i.addEventListener("error",a=>{try{k("[htmlBuilder] injected script error",{src:r,ev:a})}catch{}}),i.addEventListener("load",()=>{try{$t("[htmlBuilder] injected script loaded",{src:r,hasNimbi:!!(window&&window.nimbiCMS)})}catch{}});try{(document.head||document.body||document.documentElement).appendChild(i)}catch{try{try{i.type="text/javascript"}catch{}(document.head||document.body||document.documentElement).appendChild(i)}catch(s){try{k("[htmlBuilder] injected script append failed, skipping",{src:r,err:s})}catch{}}}n.parentNode&&n.parentNode.removeChild(n);try{$t("[htmlBuilder] executed injected script",r)}catch{}}catch(i){k("[htmlBuilder] execute injected script failed",i)}}catch{}}function ca(e,t,n){if(e)try{typeof e.replaceChildren=="function"?e.replaceChildren():e.innerHTML=""}catch{try{e.innerHTML=""}catch{}}const i=document.createElement("article");i.className="nimbi-article content nimbi-not-found";const r=document.createElement("h1");r.textContent=t&&t("notFound")||"Page not found";const a=document.createElement("p");a.textContent=n&&n.message?String(n.message):"Failed to resolve the requested page.",i.appendChild(r),i.appendChild(a),e&&e.appendChild&&e.appendChild(i);try{if(!le)try{const s=document.createElement("p"),o=t&&t("goHome")||"Go back to";s.textContent=o+" ";const l=document.createElement("a");try{l.href=Pe(ot)}catch{l.href=Pe(ot||"")}l.textContent=t&&t("home")||"Home",s.appendChild(l),e&&e.appendChild&&e.appendChild(s)}catch{}}catch{}try{try{nr({title:t&&t("notFound")||"Not Found",description:t&&t("notFoundDescription")||""},le,t&&t("notFound")||"Not Found",t&&t("notFoundDescription")||"")}catch{}}catch{}try{try{const s=typeof window<"u"&&window.__nimbiNotFoundRedirect?String(window.__nimbiNotFoundRedirect).trim():null;if(s)try{const o=new URL(s,location.origin).toString();if((location.href||"").split("#")[0]!==o)try{location.replace(o)}catch{location.href=o}}catch{}}catch{}}catch{}}const ss=oo(ac,sc&&rs,"anchor");function bc(){return ss.get()}function wc(e){return ss.send(e,2e3)}async function _c(e,t,n){if(!bc())throw new Error("anchor worker unavailable");if(!e||typeof e.innerHTML!="string")throw new Error("invalid article element");const r=String(e.innerHTML),a=await wc({type:"rewriteAnchors",html:r,contentBase:t,pagePath:n});if(a&&typeof a=="string")try{const s=He&&He();if(s){const o=s.parseFromString(String(a||""),"text/html"),l=Array.from(o.body.childNodes||[]);l.length?e.replaceChildren(...l):e.innerHTML=a}else try{const o=document&&typeof document.createRange=="function"?document.createRange():null;if(o&&typeof o.createContextualFragment=="function"){const l=o.createContextualFragment(String(a||""));e.replaceChildren(...Array.from(l.childNodes))}else e.innerHTML=a}catch{e.innerHTML=a}}catch(s){k("[htmlBuilder] applying rewritten anchors failed",s)}}function kc(e){try{e.addEventListener("click",t=>{const n=t.target&&t.target.closest?t.target.closest("a"):null;if(!n)return;const i=n.getAttribute("href")||"";try{const r=Je(i),a=r&&r.page?r.page:null,s=r&&r.anchor?r.anchor:null;if(!a&&!s)return;t.preventDefault();let o=null;try{history&&history.state&&history.state.page&&(o=history.state.page)}catch(l){o=null,k("[htmlBuilder] access history.state failed",l)}try{o||(o=new URL(location.href).searchParams.get("page"))}catch(l){k("[htmlBuilder] parse current location failed",l)}if(!a&&s||a&&o&&String(a)===String(o)){try{if(!a&&s)try{history.replaceState(history.state,"",(location.pathname||"")+(location.search||"")+(s?"#"+encodeURIComponent(s):""))}catch(l){k("[htmlBuilder] history.replaceState failed",l)}else try{history.replaceState({page:o||a},"",ft(o||a,s))}catch(l){k("[htmlBuilder] history.replaceState failed",l)}}catch(l){k("[htmlBuilder] update history for anchor failed",l)}try{t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation()}catch(l){k("[htmlBuilder] stopPropagation failed",l)}try{ei(s)}catch(l){k("[htmlBuilder] scrollToAnchorOrTop failed",l)}return}history.pushState({page:a},"",ft(a,s));try{if(typeof window<"u"&&typeof window.renderByQuery=="function")try{window.renderByQuery()}catch(l){k("[htmlBuilder] window.renderByQuery failed",l)}else if(typeof window<"u")try{window.dispatchEvent(new PopStateEvent("popstate"))}catch(l){k("[htmlBuilder] dispatch popstate failed",l)}else try{renderByQuery()}catch(l){k("[htmlBuilder] renderByQuery failed",l)}}catch(l){k("[htmlBuilder] SPA navigation invocation failed",l)}}catch(r){k("[htmlBuilder] non-URL href in attachTocClickHandler",r)}})}catch(t){k("[htmlBuilder] attachTocClickHandler failed",t)}}function ei(e){const t=document.querySelector(".nimbi-cms")||null;if(e){const n=document.getElementById(e);if(n)try{const i=()=>{try{if(t&&t.scrollTo&&t.contains(n)){const r=n.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop;t.scrollTo({top:r,behavior:"smooth"})}else try{n.scrollIntoView({behavior:"smooth",block:"start"})}catch{try{n.scrollIntoView()}catch(a){k("[htmlBuilder] scrollIntoView failed",a)}}}catch{try{n.scrollIntoView()}catch(a){k("[htmlBuilder] final scroll fallback failed",a)}}};try{requestAnimationFrame(()=>setTimeout(i,50))}catch(r){k("[htmlBuilder] scheduling scroll failed",r),setTimeout(i,50)}}catch(i){try{n.scrollIntoView()}catch(r){k("[htmlBuilder] final scroll fallback failed",r)}k("[htmlBuilder] doScroll failed",i)}}else try{t&&t.scrollTo?t.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch(n){try{window.scrollTo(0,0)}catch(i){k("[htmlBuilder] window.scrollTo failed",i)}k("[htmlBuilder] scroll to top failed",n)}}function xc(e,t,{mountOverlay:n=null,container:i=null,mountEl:r=null,navWrap:a=null,t:s=null}={}){try{const o=s||(m=>typeof m=="string"?m:""),l=i||document.querySelector(".nimbi-cms"),c=r||document.querySelector(".nimbi-mount"),u=n||document.querySelector(".nimbi-overlay"),g=a||document.querySelector(".nimbi-nav-wrap");let d=document.querySelector(".nimbi-scroll-top");if(!d){d=document.createElement("button"),d.className="nimbi-scroll-top button is-primary is-rounded is-small",d.setAttribute("aria-label",o("scrollToTop")),d.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V6"/><path d="M5 12l7-7 7 7"/></svg>';try{u&&u.appendChild?u.appendChild(d):l&&l.appendChild?l.appendChild(d):c&&c.appendChild?c.appendChild(d):document.body.appendChild(d)}catch{try{document.body.appendChild(d)}catch(f){k("[htmlBuilder] append scroll top button failed",f)}}try{try{ka(d)}catch{}}catch(m){k("[htmlBuilder] set scroll-top button theme registration failed",m)}d.addEventListener("click",()=>{try{i&&i.scrollTo?i.scrollTo({top:0,left:0,behavior:"smooth"}):r&&r.scrollTo?r.scrollTo({top:0,left:0,behavior:"smooth"}):window.scrollTo({top:0,left:0,behavior:"smooth"})}catch{try{i&&(i.scrollTop=0)}catch(f){k("[htmlBuilder] fallback container scrollTop failed",f)}try{r&&(r.scrollTop=0)}catch(f){k("[htmlBuilder] fallback mountEl scrollTop failed",f)}try{document.documentElement.scrollTop=0}catch(f){k("[htmlBuilder] fallback document scrollTop failed",f)}}})}const p=g&&g.querySelector?g.querySelector(".menu-label"):null;if(t){if(!d._nimbiObserver)if(typeof globalThis<"u"&&typeof globalThis.IntersectionObserver<"u"){const m=globalThis.IntersectionObserver,f=new m(w=>{for(const y of w)y.target instanceof Element&&(y.isIntersecting?(d.classList.remove("show"),p&&p.classList.remove("show")):(d.classList.add("show"),p&&p.classList.add("show")))},{root:i instanceof Element?i:r instanceof Element?r:null,threshold:0});d._nimbiObserver=f}else d._nimbiObserver=null;try{d._nimbiObserver&&typeof d._nimbiObserver.disconnect=="function"&&d._nimbiObserver.disconnect()}catch(m){k("[htmlBuilder] observer disconnect failed",m)}try{d._nimbiObserver&&typeof d._nimbiObserver.observe=="function"&&d._nimbiObserver.observe(t)}catch(m){k("[htmlBuilder] observer observe failed",m)}try{const m=()=>{try{const f=l instanceof Element?l.getBoundingClientRect():{top:0,bottom:window.innerHeight},w=t.getBoundingClientRect();!(w.bottom<f.top||w.top>f.bottom)?(d.classList.remove("show"),p&&p.classList.remove("show")):(d.classList.add("show"),p&&p.classList.add("show"))}catch(f){k("[htmlBuilder] checkIntersect failed",f)}};m(),typeof globalThis<"u"&&typeof globalThis.IntersectionObserver<"u"||setTimeout(m,100)}catch(m){k("[htmlBuilder] checkIntersect outer failed",m)}}else{d.classList.remove("show"),p&&p.classList.remove("show");const m=i instanceof Element?i:r instanceof Element?r:window,f=()=>{try{(m===window?window.scrollY:m.scrollTop||0)>10?(d.classList.add("show"),p&&p.classList.add("show")):(d.classList.remove("show"),p&&p.classList.remove("show"))}catch(w){k("[htmlBuilder] onScroll handler failed",w)}};lr(()=>m.addEventListener("scroll",rc(f))),f()}}catch(o){k("[htmlBuilder] ensureScrollTopButton failed",o)}}function rn(e,t){try{if(typeof rt=="function")try{rt(e,t);return}catch{}}catch{}try{e&&t&&Y&&typeof Y.set=="function"&&!Y.has(e)&&Y.set(e,t)}catch{}try{t&&G&&typeof G.set=="function"&&G.set(t,e)}catch{}try{if($e&&typeof $e.has=="function"){if(!$e.has(t)){try{$e.add(t)}catch{}try{Array.isArray(Oe)&&!Oe.includes(t)&&Oe.push(t)}catch{}}}else try{Array.isArray(Oe)&&!Oe.includes(t)&&Oe.push(t)}catch{}}catch{}}function ua(e,t){try{if(!e)return;try{const n=e[t];if(typeof n<"u")return n}catch{}try{if(e.default)return e.default[t]}catch{}return}catch{return}}function Sc(e){try{if(!Array.isArray(e))return e;e.forEach(t=>{try{if(!t||typeof t!="object")return;let n=typeof t.slug=="string"?String(t.slug):"",i=null;if(n&&n.indexOf("::")!==-1){const o=n.split("::");n=o[0]||"",i=o.slice(1).join("::")||null}const r=!!(n&&(n.indexOf(".")!==-1||n.indexOf("/")!==-1));let a="";try{if(t.path&&typeof t.path=="string"){const o=J(String(t.path||""));if(a=findSlugForPath(o)||(G&&G.has(o)?G.get(o):"")||"",!a)if(t.title&&String(t.title).trim())a=de(String(t.title).trim());else{const l=o.replace(/^.*\//,"").replace(/\.(?:md|html?)$/i,"");a=de(l||o)}}else if(r){const o=String(n).replace(/\.(?:md|html?)$/i,""),l=findSlugForPath(o)||(G&&G.has(o)?G.get(o):"")||"";l?a=l:t.title&&String(t.title).trim()?a=de(String(t.title).trim()):a=de(o)}else!n&&t.title&&String(t.title).trim()?a=de(String(t.title).trim()):a=n||""}catch{try{a=t.title&&String(t.title).trim()?de(String(t.title).trim()):n?de(n):""}catch{a=n}}let s=a||"";i&&(s=s?`${s}::${i}`:`${de(i)}`),s&&(t.slug=s);try{if(t.path&&s){const o=String(s).split("::")[0];try{rn(o,J(String(t.path||"")))}catch{}}}catch{}}catch{}})}catch{}return e}async function vc(e,t,n,i,r,a,s,o,l="eager",c=1,u=void 0,g="favicon"){if(!e||!(e instanceof HTMLElement))throw new TypeError("navbarWrap must be an HTMLElement");const h=He(),d=h?h.parseFromString(n||"","text/html"):null,p=d?d.querySelectorAll("a"):[];await lr(()=>fc(p,i)),await lr(()=>gc(p,i));try{ie(p,i)}catch{}try{if(t&&t instanceof HTMLElement&&(!t.hasAttribute||!t.hasAttribute("role")))try{t.setAttribute("role","main")}catch{}}catch{}let m=null,f=null,w=null,y=null,_=null,b=null,A=!1,S=null;const E=new Map;function I(){try{const R=typeof B<"u"&&B&&B.querySelector?B.querySelector(".navbar-burger"):e&&e.querySelector?e.querySelector(".navbar-burger"):typeof document<"u"?document.querySelector(".navbar-burger"):null,P=R&&R.dataset?R.dataset.target:null,M=P?typeof B<"u"&&B&&B.querySelector?B.querySelector(`#${P}`)||document.getElementById(P):e&&e.querySelector?e.querySelector(`#${P}`):typeof document<"u"?document.getElementById(P):null:null;if(R&&R.classList&&R.classList.contains("is-active")){try{R.classList.remove("is-active")}catch{}try{R.setAttribute("aria-expanded","false")}catch{}if(M&&M.classList)try{M.classList.remove("is-active")}catch{}}}catch(R){k("[nimbi-cms] closeMobileMenu failed",R)}}async function O(){const R=t&&t instanceof HTMLElement?t:typeof document<"u"?document.querySelector(".nimbi-content"):null;try{R&&R.classList.add("is-inactive")}catch{}try{const P=s&&s();P&&typeof P.then=="function"&&await P}catch(P){try{k("[nimbi-cms] renderByQuery failed",P)}catch{}}finally{try{if(typeof requestAnimationFrame=="function")requestAnimationFrame(()=>{try{R&&R.classList.remove("is-inactive")}catch{}});else try{R&&R.classList.remove("is-inactive")}catch{}}catch{try{R&&R.classList.remove("is-inactive")}catch{}}}}function W(R){try{let P=R&&typeof R.slug=="string"?String(R.slug):"",M=null;try{P&&P.indexOf("::")!==-1&&(M=P.split("::").slice(1).join("::")||null)}catch{}try{if(R&&R.path&&typeof R.path=="string"){const v=J(String(R.path||"")),L=v.replace(/^.*\//,"");try{if(E&&E.has(v))return{page:E.get(v),hash:M};if(E&&E.has(L))return{page:E.get(L),hash:M}}catch{}try{if(G&&G.has(v))return{page:G.get(v),hash:M}}catch{}try{const U=D(v);if(U)return{page:U,hash:M}}catch{}}}catch{}if(P&&P.indexOf("::")!==-1){const v=P.split("::");P=v[0]||"",M=v.slice(1).join("::")||null}if(P&&(P.includes(".")||P.includes("/"))){const v=J(R&&R.path?String(R.path):P),L=v.replace(/^.*\//,"");try{if(E&&E.has(v))return{page:E.get(v),hash:M};if(E&&E.has(L))return{page:E.get(L),hash:M}}catch{}try{let U=D(v);if(!U)try{const V=String(v||"").replace(/^\/+/,""),H=V.replace(/^.*\//,"");for(const[$,T]of Y.entries())try{let q=null;if(typeof T=="string"?q=J(String(T||"")):T&&typeof T=="object"&&(T.default?q=J(String(T.default||"")):q=null),!q)continue;if(q===V||q.endsWith("/"+V)||V.endsWith("/"+q)||q.endsWith(H)||V.endsWith(H)){U=$;break}}catch{}}catch{}if(U)P=U;else try{const V=String(P).replace(/\.(?:md|html?)$/i,"");P=de(V||v)}catch{P=de(v)}}catch{P=de(v)}}return!P&&R&&R.path&&(P=de(J(String(R.path||"")))),{page:P,hash:M}}catch{return{page:R&&R.slug||"",hash:null}}}const z=()=>m||(m=(async()=>{try{const R=await Promise.resolve().then(()=>at),P=typeof globalThis<"u"?globalThis.buildSearchIndex:void 0,M=typeof globalThis<"u"?globalThis.buildSearchIndexWorker:void 0,v=ua(R,"buildSearchIndex"),L=ua(R,"buildSearchIndexWorker"),U=typeof P=="function"?P:v||void 0,V=typeof M=="function"?M:L||void 0;jt("[nimbi-cms test] ensureSearchIndex: buildFn="+typeof U+" workerFn="+typeof V+" (global preferred)");const H=[];try{r&&H.push(r)}catch{}try{navigationPage&&H.push(navigationPage)}catch{}if(l==="lazy"&&typeof V=="function")try{const $=await V(i,c,u,H.length?H:void 0);if($&&$.length){try{if(R&&typeof R._setSearchIndex=="function")try{R._setSearchIndex($)}catch{}}catch{}return $}}catch($){k("[nimbi-cms] worker builder threw",$)}return typeof U=="function"?(jt("[nimbi-cms test] calling buildFn"),await U(i,c,u,H.length?H:void 0)):[]}catch(R){return k("[nimbi-cms] buildSearchIndex failed",R),[]}finally{if(f){try{f.removeAttribute("disabled")}catch{}try{w&&w.classList.remove("is-loading")}catch{}}}})(),m.then(R=>{try{try{S=Array.isArray(R)?R:null}catch{S=null}try{Sc(R)}catch{}try{if(typeof window<"u"){try{(async()=>{try{const L=await Promise.resolve().then(()=>at);try{try{L&&typeof L._setSearchIndex=="function"&&L._setSearchIndex(Array.isArray(R)?R:[])}catch{}Object.defineProperty(window,"__nimbiResolvedIndex",{get(){return L&&Array.isArray(L.searchIndex)?L.searchIndex:Array.isArray(S)?S:[]},enumerable:!0,configurable:!0})}catch{try{window.__nimbiResolvedIndex=L&&Array.isArray(L.searchIndex)?L.searchIndex:Array.isArray(S)?S:[]}catch{}}}catch{try{window.__nimbiResolvedIndex=Array.isArray(re)?re:Array.isArray(S)?S:[]}catch{}}})()}catch{}try{window.__nimbi_contentBase=i}catch{}try{window.__nimbi_indexDepth=c}catch{}try{window.__nimbi_noIndexing=u}catch{}}}catch{}const P=String(f&&f.value||"").trim().toLowerCase();if(!P||!Array.isArray(R)||!R.length)return;const M=R.filter(L=>L.title&&L.title.toLowerCase().includes(P)||L.excerpt&&L.excerpt.toLowerCase().includes(P));if(!M||!M.length)return;const v=typeof _<"u"&&_?_:typeof document<"u"?document.getElementById("nimbi-search-results"):null;if(!v)return;try{typeof v.replaceChildren=="function"?v.replaceChildren():v.innerHTML=""}catch{try{v.innerHTML=""}catch{}}try{const L=document.createElement("div");L.className="panel nimbi-search-panel",M.slice(0,10).forEach(U=>{try{if(U.parentTitle){const T=document.createElement("p");T.className="panel-heading nimbi-search-title nimbi-search-parent",T.textContent=U.parentTitle,L.appendChild(T)}const V=document.createElement("a");V.className="panel-block nimbi-search-result";const H=W(U);V.href=Pe(H.page,H.hash),V.setAttribute("role","button");try{if(U.path&&typeof U.path=="string")try{rn(H.page,U.path)}catch{}}catch{}const $=document.createElement("div");$.className="is-size-6 has-text-weight-semibold",$.textContent=U.title,V.appendChild($),V.addEventListener("click",()=>{try{v.style.display="none"}catch{}}),L.appendChild(V)}catch{}}),ir(()=>{try{v.appendChild(L)}catch{}});try{v.style.display="block"}catch{}}catch{}}catch{}}).catch(()=>{}).finally(()=>{(async()=>{try{if(A)return;A=!0;const R=await Promise.resolve().then(()=>Tn);try{await R.handleSitemapRequest({homePage:r,contentBase:i,indexDepth:c,noIndexing:u,includeAllMarkdown:!0})}catch(P){k("[nimbi-cms] sitemap trigger failed",P)}}catch(R){try{k("[nimbi-cms] sitemap dynamic import failed",R)}catch{}}})()}),m),B=document.createElement("nav");B.className="navbar",B.setAttribute("role","navigation"),B.setAttribute("aria-label","main navigation");const Z=document.createElement("div");Z.className="navbar-brand";const ee=p[0],j=document.createElement("a");if(j.className="navbar-item",ee){const R=ee.getAttribute("href")||"#";try{const M=new URL(R,location.href).searchParams.get("page"),v=M?decodeURIComponent(M):r;let L=null;try{typeof v=="string"&&(/(?:\.md|\.html?)$/i.test(v)||v.includes("/"))&&(L=D(v))}catch{}!L&&typeof v=="string"&&!String(v).includes(".")&&(L=v);const U=L||v;j.href=Pe(U),(!j.textContent||!String(j.textContent).trim())&&(j.textContent=a("home"))}catch{try{const M=typeof r=="string"&&(/(?:\.md|\.html?)$/i.test(r)||r.includes("/"))?D(r):typeof r=="string"&&!r.includes(".")?r:null;j.href=Pe(M||r)}catch{j.href=Pe(r)}j.textContent=a("home")}}else j.href=Pe(r),j.textContent=a("home");async function C(R){try{if(!R||R==="none")return null;if(R==="favicon")try{const P=document.querySelector('link[rel~="icon"],link[rel="shortcut icon"]');if(!P)return null;const M=P.getAttribute("href")||"";return M&&/\.png(?:\?|$)/i.test(M)?new URL(M,location.href).toString():null}catch{return null}if(R==="copy-first"||R==="move-first")try{const P=await Be(r,i);if(!P||!P.raw)return null;const M=He(),v=M?M.parseFromString(P.raw,"text/html"):null,L=v?v.querySelector("img"):null;if(!L)return null;const U=L.getAttribute("src")||"";if(!U)return null;const V=new URL(U,location.href).toString();if(R==="move-first")try{document.documentElement.setAttribute("data-nimbi-logo-moved",V)}catch{}return V}catch{return null}try{return new URL(R,location.href).toString()}catch{return null}}catch{return null}}let N=null;try{N=await C(g)}catch{N=null}if(N)try{const R=document.createElement("img");R.className="nimbi-navbar-logo";const P=a&&typeof a=="function"&&(a("home")||a("siteLogo"))||"";R.alt=P,R.title=P,R.src=N;try{R.style.marginRight="0.5em"}catch{}try{(!j.textContent||!String(j.textContent).trim())&&(j.textContent=P)}catch{}try{j.insertBefore(R,j.firstChild)}catch{try{j.appendChild(R)}catch{}}}catch{}Z.appendChild(j),j.addEventListener("click",function(R){const P=j.getAttribute("href")||"";if(P.startsWith("?page=")){R.preventDefault();const M=new URL(P,location.href),v=M.searchParams.get("page"),L=M.hash?M.hash.replace(/^#/,""):null;history.pushState({page:v},"",Pe(v,L)),O();try{I()}catch{}}});function D(R){try{if(!R)return null;const P=J(String(R||""));try{if(G&&G.has(P))return G.get(P)}catch{}const M=P.replace(/^.*\//,"");try{if(G&&G.has(M))return G.get(M)}catch{}try{for(const[v,L]of Y.entries())if(L){if(typeof L=="string"){if(J(L)===P)return v}else if(L&&typeof L=="object"){if(L.default&&J(L.default)===P)return v;const U=L.langs||{};for(const V in U)if(U[V]&&J(U[V])===P)return v}}}catch{}return null}catch{return null}}async function ie(R,P){try{if(!R||!R.length)return;const M=[];for(let H=0;H<R.length;H++)try{const $=R[H];if(!$||typeof $.getAttribute!="function")continue;const T=$.getAttribute("href")||"";if(!T||qr(T))continue;let q=null;try{const _e=Je(T);_e&&_e.page&&(q=_e.page)}catch{}if(!q){const _e=String(T||"").split(/[?#]/,1),ve=_e&&_e[0]?_e[0]:T;(/\.(?:md|html?)$/i.test(ve)||ve.indexOf("/")!==-1)&&(q=J(String(ve||"")))}if(!q)continue;try{if(P&&typeof P=="string")try{let ve=new URL(P,typeof location<"u"?location.origin:"http://localhost").pathname||"";if(ve=ve.replace(/^\/+|\/+$/g,""),ve){let Ie=String(q||"");Ie=Ie.replace(/^\/+/,""),Ie===ve?q="":Ie.startsWith(ve+"/")?q=Ie.slice(ve.length+1):q=Ie}}catch{}}catch{}const Q=J(String(q||"")),se=Q.replace(/^.*\//,"");let ye=null;try{E&&E.has(Q)&&(ye=E.get(Q))}catch{}try{!ye&&G&&G.has(Q)&&(ye=G.get(Q))}catch{}if(ye)continue;let we=null;try{we=$.textContent&&String($.textContent).trim()?String($.textContent).trim():null}catch{we=null}let pe=null;if(we)pe=de(we);else{const _e=se.replace(/\.(?:md|html?)$/i,"");pe=de(_e||Q)}if(pe)try{M.push({path:Q,candidate:pe})}catch{}}catch{}if(!M.length)return;const v=3;let L=0;const U=async()=>{for(;L<M.length;){const H=M[L++];if(!(!H||!H.path))try{const $=await Be(H.path,P);if(!$||!$.raw)continue;let T=null;if($.isHtml)try{const q=He(),Q=q?q.parseFromString($.raw,"text/html"):null,se=Q?Q.querySelector("h1")||Q.querySelector("title"):null;se&&se.textContent&&(T=String(se.textContent).trim())}catch{}else try{const q=$.raw.match(/^#\s+(.+)$/m);q&&q[1]&&(T=String(q[1]).trim())}catch{}if(T){const q=de(T);if(q&&q!==H.candidate){try{rn(q,H.path)}catch{}try{E.set(H.path,q)}catch{}try{E.set(H.path.replace(/^.*\//,""),q)}catch{}try{const Q=await Promise.resolve().then(()=>at);try{if(Array.isArray(Q.searchIndex)){let se=!1;for(const ye of Q.searchIndex)try{if(ye&&ye.path===H.path&&ye.slug){const pe=String(ye.slug).split("::").slice(1).join("::");ye.slug=pe?`${q}::${pe}`:q,se=!0}}catch{}try{se&&typeof Q._setSearchIndex=="function"&&Q._setSearchIndex(Q.searchIndex)}catch{}}}catch{}}catch{}}}}catch{}}},V=[];for(let H=0;H<v;H++)V.push(U());try{await Promise.all(V)}catch{}}catch{}}const he=document.createElement("a");he.className="navbar-burger",he.setAttribute("role","button"),he.setAttribute("aria-label","menu"),he.setAttribute("aria-expanded","false");const K="nimbi-navbar-menu";he.dataset.target=K,he.innerHTML='<span aria-hidden="true"></span><span aria-hidden="true"></span><span aria-hidden="true"></span>',Z.appendChild(he);try{he.addEventListener("click",R=>{try{const P=he.dataset&&he.dataset.target?he.dataset.target:null,M=P?B&&B.querySelector?B.querySelector(`#${P}`)||(e&&e.querySelector?e.querySelector(`#${P}`):document.getElementById(P)):e&&e.querySelector?e.querySelector(`#${P}`)||document.getElementById(P):typeof document<"u"?document.getElementById(P):null:null;he.classList.contains("is-active")?(he.classList.remove("is-active"),he.setAttribute("aria-expanded","false"),M&&M.classList.remove("is-active")):(he.classList.add("is-active"),he.setAttribute("aria-expanded","true"),M&&M.classList.add("is-active"))}catch(P){k("[nimbi-cms] navbar burger toggle failed",P)}})}catch(R){k("[nimbi-cms] burger event binding failed",R)}const Le=document.createElement("div");Le.className="navbar-menu",Le.id=K;const me=document.createElement("div");me.className="navbar-start";let Se=null,Ee=null;if(!o)Se=null,f=null,y=null,_=null,b=null;else{Se=document.createElement("div"),Se.className="navbar-end",Ee=document.createElement("div"),Ee.className="navbar-item",f=document.createElement("input"),f.className="input",f.type="search",f.placeholder=a("searchPlaceholder")||"",f.id="nimbi-search";try{const v=(a&&typeof a=="function"?a("searchAria"):null)||f.placeholder||"Search";try{f.setAttribute("aria-label",v)}catch{}try{f.setAttribute("aria-controls","nimbi-search-results")}catch{}try{f.setAttribute("aria-autocomplete","list")}catch{}try{f.setAttribute("role","combobox")}catch{}}catch{}l==="eager"&&(f.disabled=!0),w=document.createElement("div"),w.className="control",l==="eager"&&w.classList.add("is-loading"),w.appendChild(f),Ee.appendChild(w),y=document.createElement("div"),y.className="dropdown is-right",y.id="nimbi-search-dropdown";const R=document.createElement("div");R.className="dropdown-trigger",R.appendChild(Ee);const P=document.createElement("div");P.className="dropdown-menu",P.setAttribute("role","menu"),_=document.createElement("div"),_.id="nimbi-search-results",_.className="dropdown-content nimbi-search-results",b=_,P.appendChild(_),y.appendChild(R),y.appendChild(P),Se.appendChild(y);const M=v=>{if(!_)return;try{if(typeof _.replaceChildren=="function")_.replaceChildren();else for(;_.firstChild;)_.removeChild(_.firstChild)}catch{try{_.innerHTML=""}catch{}}let L=-1;function U($){try{const T=_.querySelector(".nimbi-search-result.is-selected");T&&T.classList.remove("is-selected");const q=_.querySelectorAll(".nimbi-search-result");if(!q||!q.length)return;if($<0){L=-1;return}$>=q.length&&($=q.length-1);const Q=q[$];if(Q){Q.classList.add("is-selected"),L=$;try{Q.scrollIntoView({block:"nearest"})}catch{}}}catch{}}function V($){try{const T=$.key,q=_.querySelectorAll(".nimbi-search-result");if(!q||!q.length)return;if(T==="ArrowDown"){$.preventDefault();const Q=L<0?0:Math.min(q.length-1,L+1);U(Q);return}if(T==="ArrowUp"){$.preventDefault();const Q=L<=0?0:L-1;U(Q);return}if(T==="Enter"){$.preventDefault();const Q=_.querySelector(".nimbi-search-result.is-selected")||_.querySelector(".nimbi-search-result");if(Q)try{Q.click()}catch{}return}if(T==="Escape"){try{y.classList.remove("is-active")}catch{}try{document.documentElement.classList.remove("nimbi-search-open")}catch{}try{_.style.display="none"}catch{}try{_.classList.remove("is-open")}catch{}try{_.removeAttribute("tabindex")}catch{}try{_.removeEventListener("keydown",V)}catch{}try{f&&f.focus()}catch{}try{f&&f.removeEventListener("keydown",H)}catch{}return}}catch{}}function H($){try{if($&&$.key==="ArrowDown"){$.preventDefault();try{_.focus()}catch{}U(0)}}catch{}}try{const $=String(f&&f.value||"").trim();if(!v||!v.length){if(!$){try{y&&y.classList.remove("is-active")}catch{}try{document.documentElement.classList.remove("nimbi-search-open")}catch{}try{_&&(_.style.display="none",_.classList.remove("is-open"),_.removeAttribute("tabindex"))}catch{}try{_&&_.removeEventListener("keydown",V)}catch{}return}try{const T=document.createElement("div");T.className="panel nimbi-search-panel";const q=document.createElement("p");q.className="panel-block nimbi-search-no-results",q.textContent=a&&typeof a=="function"?a("searchNoResults"):"No results",T.appendChild(q),ir(()=>{try{_.appendChild(T)}catch{}})}catch{}if(y){y.classList.add("is-active");try{document.documentElement.classList.add("nimbi-search-open")}catch{}}try{_.style.display="block"}catch{}try{_.classList.add("is-open")}catch{}try{_.setAttribute("tabindex","0")}catch{}return}}catch{}try{const $=document.createElement("div");$.className="panel nimbi-search-panel";const T=document.createDocumentFragment();v.forEach(q=>{if(q.parentTitle){const we=document.createElement("p");we.textContent=q.parentTitle,we.className="panel-heading nimbi-search-title nimbi-search-parent",T.appendChild(we)}const Q=document.createElement("a");Q.className="panel-block nimbi-search-result";const se=W(q);Q.href=Pe(se.page,se.hash),Q.setAttribute("role","button");try{if(q.path&&typeof q.path=="string")try{rn(se.page,q.path)}catch{}}catch{}const ye=document.createElement("div");ye.className="is-size-6 has-text-weight-semibold",ye.textContent=q.title,Q.appendChild(ye),Q.addEventListener("click",we=>{try{try{we&&we.preventDefault&&we.preventDefault()}catch{}try{we&&we.stopPropagation&&we.stopPropagation()}catch{}if(y){y.classList.remove("is-active");try{document.documentElement.classList.remove("nimbi-search-open")}catch{}}try{_.style.display="none"}catch{}try{_.classList.remove("is-open")}catch{}try{_.removeAttribute("tabindex")}catch{}try{_.removeEventListener("keydown",V)}catch{}try{f&&f.removeEventListener("keydown",H)}catch{}try{const pe=Q.getAttribute&&Q.getAttribute("href")||"";let _e=null,ve=null;try{const Ie=new URL(pe,location.href);_e=Ie.searchParams.get("page"),ve=Ie.hash?Ie.hash.replace(/^#/,""):null}catch{}if(_e)try{history.pushState({page:_e},"",Pe(_e,ve));try{O()}catch{try{typeof window<"u"&&typeof window.renderByQuery=="function"&&window.renderByQuery()}catch{}}return}catch{}}catch{}try{window.location.href=Q.href}catch{}}catch{}}),T.appendChild(Q)}),$.appendChild(T),ir(()=>{try{_.appendChild($)}catch{}})}catch{}if(y){y.classList.add("is-active");try{document.documentElement.classList.add("nimbi-search-open")}catch{}}try{_.style.display="block"}catch{}try{_.classList.add("is-open")}catch{}try{_.setAttribute("tabindex","0")}catch{}try{_.addEventListener("keydown",V)}catch{}try{f&&f.addEventListener("keydown",H)}catch{}};if(f){const v=nc(async()=>{const L=f||(typeof B<"u"&&B&&B.querySelector?B.querySelector("input#nimbi-search"):e&&e.querySelector?e.querySelector("input#nimbi-search"):typeof document<"u"?document.querySelector("input#nimbi-search"):null),U=String(L&&L.value||"").trim().toLowerCase();if(!U){try{y&&y.classList.remove("is-active")}catch{}try{document.documentElement.classList.remove("nimbi-search-open")}catch{}try{_&&(_.style.display="none",_.classList.remove("is-open"),_.removeAttribute("tabindex"))}catch{}return}try{await z();const V=await m,H=Array.isArray(V)?V.filter($=>$.title&&$.title.toLowerCase().includes(U)||$.excerpt&&$.excerpt.toLowerCase().includes(U)):[];M(H.slice(0,10))}catch(V){k("[nimbi-cms] search input handler failed",V),M([])}},50);try{f.addEventListener("input",v)}catch{}try{document.addEventListener("input",L=>{try{L&&L.target&&L.target.id==="nimbi-search"&&v(L)}catch{}},!0)}catch{}}if(l==="eager"){try{m=z()}catch(v){k("[nimbi-cms] eager search index init failed",v),m=Promise.resolve([])}m.finally(()=>{const v=f||(typeof B<"u"&&B&&B.querySelector?B.querySelector("input#nimbi-search"):e&&e.querySelector?e.querySelector("input#nimbi-search"):typeof document<"u"?document.querySelector("input#nimbi-search"):null);if(v){try{v.removeAttribute("disabled")}catch{}try{w&&w.classList.remove("is-loading")}catch{}}(async()=>{try{if(A)return;A=!0;const L=await m.catch(()=>[]),U=await Promise.resolve().then(()=>Tn);try{await U.handleSitemapRequest({index:Array.isArray(L)?L:void 0,homePage:r,contentBase:i,indexDepth:c,noIndexing:u,includeAllMarkdown:!0})}catch(V){k("[nimbi-cms] sitemap trigger failed",V)}}catch(L){try{k("[nimbi-cms] sitemap dynamic import failed",L)}catch{}}})()})}try{const v=L=>{try{const U=L&&L.target;if(!b||!b.classList.contains("is-open")&&b.style&&b.style.display!=="block"||U&&(b.contains(U)||f&&(U===f||f.contains&&f.contains(U))))return;if(y){y.classList.remove("is-active");try{document.documentElement.classList.remove("nimbi-search-open")}catch{}}try{b.style.display="none"}catch{}try{b.classList.remove("is-open")}catch{}}catch{}};document.addEventListener("click",v,!0),document.addEventListener("touchstart",v,!0)}catch{}}const Fe=document.createDocumentFragment();for(let R=0;R<p.length;R++){const P=p[R];if(R===0)continue;const M=P.getAttribute("href")||"#";let v=M;const L=document.createElement("a");L.className="navbar-item";try{let U=null;try{U=Je(String(M||""))}catch{U=null}let V=null,H=null;if(U&&(U.type==="canonical"&&U.page||U.type==="cosmetic"&&U.page)&&(V=U.page,H=U.anchor),V&&(/\.(?:md|html?)$/i.test(V)||V.includes("/")?v=V:L.href=Pe(V,H)),/^[^#]*\.md(?:$|[#?])/.test(v)||v.endsWith(".md")){const T=J(v).split(/::|#/,2),q=T[0],Q=T[1],se=D(q);se?L.href=Pe(se,Q):L.href=Pe(q,Q)}else if(/\.html(?:$|[#?])/.test(v)||v.endsWith(".html")){const T=J(v).split(/::|#/,2);let q=T[0];q&&!q.toLowerCase().endsWith(".html")&&(q=q+".html");const Q=T[1],se=D(q);if(se)L.href=Pe(se,Q);else try{const ye=await Be(q,i);if(ye&&ye.raw)try{const we=He(),pe=we?we.parseFromString(ye.raw,"text/html"):null,_e=pe?pe.querySelector("title"):null,ve=pe?pe.querySelector("h1"):null,Ie=_e&&_e.textContent&&_e.textContent.trim()?_e.textContent.trim():ve&&ve.textContent?ve.textContent.trim():null;if(Ie){const Ge=de(Ie);if(Ge){try{rn(Ge,q)}catch(Et){k("[nimbi-cms] slugToMd/mdToSlug set failed",Et)}L.href=Pe(Ge,Q)}else L.href=Pe(q,Q)}else L.href=Pe(q,Q)}catch{L.href=Pe(q,Q)}else L.href=v}catch{L.href=v}}else L.href=v}catch(U){k("[nimbi-cms] nav item href parse failed",U),L.href=v}try{const U=P.textContent&&String(P.textContent).trim()?String(P.textContent).trim():null;if(U)try{const V=de(U);if(V){const H=L.getAttribute("href")||"";let $=null;if(/^[^#?]*\.(?:md|html?)(?:$|[?#])/i.test(H))$=J(String(H||"").split(/[?#]/)[0]);else try{const T=Je(H);T&&T.type==="canonical"&&T.page&&($=J(T.page))}catch{}if($){let T=!1;try{if(/\.(?:html?)(?:$|[?#])/i.test(String($||"")))T=!0;else if(/\.(?:md)(?:$|[?#])/i.test(String($||"")))T=!1;else{const q=String($||"").replace(/^\.\//,""),Q=q.replace(/^.*\//,"");$e&&$e.size&&($e.has(q)||$e.has(Q))&&(T=!0)}}catch{T=!1}if(T)try{const q=J(String($||"").split(/[?#]/)[0]);let Q=!1;try{D&&typeof D=="function"&&D(q)&&(Q=!0)}catch{}try{rn(V,$)}catch{}try{if(q){try{E.set(q,V)}catch{}try{const se=q.replace(/^.*\//,"");se&&E.set(se,V)}catch{}}}catch{}if(Q)try{L.href=Pe(V)}catch{}}catch{}}}}catch(V){k("[nimbi-cms] nav slug mapping failed",V)}}catch(U){k("[nimbi-cms] nav slug mapping failed",U)}L.textContent=P.textContent||v,Fe.appendChild(L)}try{me.appendChild(Fe)}catch{}Le.appendChild(me),Se&&Le.appendChild(Se),B.appendChild(Z),B.appendChild(Le),e.appendChild(B);try{const R=P=>{try{const M=typeof B<"u"&&B&&B.querySelector?B.querySelector(".navbar-burger"):e&&e.querySelector?e.querySelector(".navbar-burger"):typeof document<"u"?document.querySelector(".navbar-burger"):null;if(!M||!M.classList.contains("is-active"))return;const v=M&&M.closest?M.closest(".navbar"):B;if(v&&v.contains(P.target))return;I()}catch{}};document.addEventListener("click",R,!0),document.addEventListener("touchstart",R,!0)}catch{}try{Le.addEventListener("click",R=>{const P=R.target&&R.target.closest?R.target.closest("a"):null;if(!P)return;const M=P.getAttribute("href")||"";try{const v=new URL(M,location.href),L=v.searchParams.get("page"),U=v.hash?v.hash.replace(/^#/,""):null;L&&(R.preventDefault(),history.pushState({page:L},"",Pe(L,U)),O())}catch(v){k("[nimbi-cms] navbar click handler failed",v)}try{const v=typeof B<"u"&&B&&B.querySelector?B.querySelector(".navbar-burger"):e&&e.querySelector?e.querySelector(".navbar-burger"):null,L=v&&v.dataset?v.dataset.target:null,U=L?B&&B.querySelector?B.querySelector(`#${L}`)||(e&&e.querySelector?e.querySelector(`#${L}`):document.getElementById(L)):e&&e.querySelector?e.querySelector(`#${L}`)||document.getElementById(L):typeof document<"u"?document.getElementById(L):null:null;v&&v.classList.contains("is-active")&&(v.classList.remove("is-active"),v.setAttribute("aria-expanded","false"),U&&U.classList.remove("is-active"))}catch(v){k("[nimbi-cms] mobile menu close failed",v)}})}catch(R){k("[nimbi-cms] attach content click handler failed",R)}try{t.addEventListener("click",R=>{const P=R.target&&R.target.closest?R.target.closest("a"):null;if(!P)return;const M=P.getAttribute("href")||"";if(M&&!qr(M))try{const v=new URL(M,location.href),L=v.searchParams.get("page"),U=v.hash?v.hash.replace(/^#/,""):null;L&&(R.preventDefault(),history.pushState({page:L},"",Pe(L,U)),O())}catch(v){k("[nimbi-cms] container click URL parse failed",v)}})}catch(R){k("[nimbi-cms] build navbar failed",R)}return{navbar:B,linkEls:p}}try{document.addEventListener("input",e=>{try{if(e&&e.target&&e.target.id==="nimbi-search"){const t=document.getElementById("nimbi-search-results");if(t&&e.target&&e.target.value)try{t.style.display="block"}catch{}}}catch{}},!0)}catch{}let nt=null,fe=null,Xe=1,St=(e,t)=>t,Cn=0,Mn=0,ar=()=>{},kn=.25;function Ac(){if(nt&&document.contains(nt))return nt;nt=null;const e=document.createElement("dialog");e.className="nimbi-image-preview modal",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",St("imagePreviewTitle","Image preview"));try{const C=document.createElement("div");C.className="modal-background";const N=document.createElement("div");N.className="modal-content";const D=document.createElement("div");D.className="nimbi-image-preview__content box",D.setAttribute("role","document");const ie=document.createElement("button");ie.className="button is-small nimbi-image-preview__close",ie.type="button",ie.setAttribute("data-nimbi-preview-close",""),ie.textContent="✕";const he=document.createElement("div");he.className="nimbi-image-preview__image-wrapper";const K=document.createElement("img");K.setAttribute("data-nimbi-preview-image",""),K.alt="",he.appendChild(K);const Le=document.createElement("div");Le.className="nimbi-image-preview__controls";const me=document.createElement("div");me.className="nimbi-image-preview__group";const Se=document.createElement("button");Se.className="button is-small",Se.type="button",Se.setAttribute("data-nimbi-preview-fit",""),Se.textContent="⤢";const Ee=document.createElement("button");Ee.className="button is-small",Ee.type="button",Ee.setAttribute("data-nimbi-preview-original",""),Ee.textContent="1:1";const Fe=document.createElement("button");Fe.className="button is-small",Fe.type="button",Fe.setAttribute("data-nimbi-preview-reset",""),Fe.textContent="⟲",me.appendChild(Se),me.appendChild(Ee),me.appendChild(Fe);const R=document.createElement("div");R.className="nimbi-image-preview__group";const P=document.createElement("button");P.className="button is-small",P.type="button",P.setAttribute("data-nimbi-preview-zoom-out",""),P.textContent="−";const M=document.createElement("div");M.className="nimbi-image-preview__zoom",M.setAttribute("data-nimbi-preview-zoom-label",""),M.textContent="100%";const v=document.createElement("button");v.className="button is-small",v.type="button",v.setAttribute("data-nimbi-preview-zoom-in",""),v.textContent="+",R.appendChild(P),R.appendChild(M),R.appendChild(v),Le.appendChild(me),Le.appendChild(R),D.appendChild(ie),D.appendChild(he),D.appendChild(Le),N.appendChild(D),e.appendChild(C),e.appendChild(N)}catch{e.innerHTML=`
|
|
2167
2170
|
<div class="modal-background"></div>
|
|
2168
2171
|
<div class="modal-content">
|
|
2169
2172
|
<div class="nimbi-image-preview__content box" role="document">
|
|
@@ -2185,13 +2188,13 @@ export async function handleAnchorWorkerMessage(msg) {
|
|
|
2185
2188
|
</div>
|
|
2186
2189
|
</div>
|
|
2187
2190
|
</div>
|
|
2188
|
-
`}e.addEventListener("click",M=>{M.target===e&&Rr()}),e.addEventListener("wheel",M=>{if(!U())return;M.preventDefault();const F=M.deltaY<0?_n:-_n;Lt(Qe+F),c(),u()},{passive:!1}),e.addEventListener("keydown",M=>{if(M.key==="Escape"){Rr();return}if(Qe>1){const F=e.querySelector(".nimbi-image-preview__image-wrapper");if(!F)return;const G=40;switch(M.key){case"ArrowUp":F.scrollTop-=G,M.preventDefault();break;case"ArrowDown":F.scrollTop+=G,M.preventDefault();break;case"ArrowLeft":F.scrollLeft-=G,M.preventDefault();break;case"ArrowRight":F.scrollLeft+=G,M.preventDefault();break}}}),document.body.appendChild(e),tt=e,de=e.querySelector("[data-nimbi-preview-image]");const t=e.querySelector("[data-nimbi-preview-fit]"),n=e.querySelector("[data-nimbi-preview-original]"),i=e.querySelector("[data-nimbi-preview-zoom-in]"),r=e.querySelector("[data-nimbi-preview-zoom-out]"),a=e.querySelector("[data-nimbi-preview-reset]"),s=e.querySelector("[data-nimbi-preview-close]"),o=e.querySelector("[data-nimbi-preview-zoom-label]"),l=e.querySelector("[data-nimbi-preview-zoom-hud]");function c(){o&&(o.textContent=`${Math.round(Qe*100)}%`)}const u=()=>{l&&(l.textContent=`${Math.round(Qe*100)}%`,l.classList.add("visible"),clearTimeout(l._timeout),l._timeout=setTimeout(()=>l.classList.remove("visible"),800))};tr=c,i.addEventListener("click",()=>{Lt(Qe+_n),c(),u()}),r.addEventListener("click",()=>{Lt(Qe-_n),c(),u()}),t.addEventListener("click",()=>{Mn(),c(),u()}),n.addEventListener("click",()=>{Lt(1),c(),u()}),a.addEventListener("click",()=>{Mn(),c(),u()}),s.addEventListener("click",Rr),t.title=St("imagePreviewFit","Fit to screen"),n.title=St("imagePreviewOriginal","Original size"),r.title=St("imagePreviewZoomOut","Zoom out"),i.title=St("imagePreviewZoomIn","Zoom in"),s.title=St("imagePreviewClose","Close"),s.setAttribute("aria-label",St("imagePreviewClose","Close"));let g=!1,h=0,d=0,p=0,m=0;const f=new Map;let w=0,y=1;const _=(M,F)=>{const G=M.x-F.x,ie=M.y-F.y;return Math.hypot(G,ie)},b=()=>{g=!1,f.clear(),w=0,de&&(de.classList.add("is-panning"),de.classList.remove("is-grabbing"))};let v=0,S=0,E=0;const P=M=>{const F=Date.now(),G=F-v,ie=M.clientX-S,ye=M.clientY-E;v=F,S=M.clientX,E=M.clientY,G<300&&Math.hypot(ie,ye)<30&&(Lt(Qe>1?1:2),c(),M.preventDefault())},I=M=>{Lt(Qe>1?1:2),c(),M.preventDefault()},U=()=>tt?typeof tt.open=="boolean"?tt.open:tt.classList.contains("is-active"):!1,z=(M,F,G=1)=>{if(f.has(G)&&f.set(G,{x:M,y:F}),f.size===2){const Te=Array.from(f.values()),ke=_(Te[0],Te[1]);if(w>0){const xe=ke/w;Lt(y*xe)}return}if(!g)return;const ie=de.closest(".nimbi-image-preview__image-wrapper");if(!ie)return;const ye=M-h,J=F-d;ie.scrollLeft=p-ye,ie.scrollTop=m-J},O=(M,F,G=1)=>{if(!U())return;if(f.set(G,{x:M,y:F}),f.size===2){const J=Array.from(f.values());w=_(J[0],J[1]),y=Qe;return}const ie=de.closest(".nimbi-image-preview__image-wrapper");!ie||!(ie.scrollWidth>ie.clientWidth||ie.scrollHeight>ie.clientHeight)||(g=!0,h=M,d=F,p=ie.scrollLeft,m=ie.scrollTop,de.classList.add("is-panning"),de.classList.remove("is-grabbing"),window.addEventListener("pointermove",W),window.addEventListener("pointerup",te),window.addEventListener("pointercancel",te))},W=M=>{g&&(M.preventDefault(),z(M.clientX,M.clientY,M.pointerId))},te=()=>{b(),window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",te),window.removeEventListener("pointercancel",te)};de.addEventListener("pointerdown",M=>{M.preventDefault(),O(M.clientX,M.clientY,M.pointerId)}),de.addEventListener("pointermove",M=>{(g||f.size===2)&&M.preventDefault(),z(M.clientX,M.clientY,M.pointerId)}),de.addEventListener("pointerup",M=>{M.preventDefault(),M.pointerType==="touch"&&P(M),b()}),de.addEventListener("dblclick",I),de.addEventListener("pointercancel",b),de.addEventListener("mousedown",M=>{M.preventDefault(),O(M.clientX,M.clientY,1)}),de.addEventListener("mousemove",M=>{g&&M.preventDefault(),z(M.clientX,M.clientY,1)}),de.addEventListener("mouseup",M=>{M.preventDefault(),b()});const H=e.querySelector(".nimbi-image-preview__image-wrapper");return H&&(H.addEventListener("pointerdown",M=>{if(O(M.clientX,M.clientY,M.pointerId),M&&M.target&&M.target.tagName==="IMG")try{M.target.classList.add("is-grabbing")}catch{}}),H.addEventListener("pointermove",M=>{z(M.clientX,M.clientY,M.pointerId)}),H.addEventListener("pointerup",b),H.addEventListener("pointercancel",b),H.addEventListener("mousedown",M=>{if(O(M.clientX,M.clientY,1),M&&M.target&&M.target.tagName==="IMG")try{M.target.classList.add("is-grabbing")}catch{}}),H.addEventListener("mousemove",M=>{z(M.clientX,M.clientY,1)}),H.addEventListener("mouseup",b)),e}function Lt(e){if(!de)return;const t=Number(e);Qe=Number.isFinite(t)?Math.max(.1,Math.min(4,t)):1;const i=de.getBoundingClientRect(),r=En||de.naturalWidth||de.width||i.width||0,a=Cn||de.naturalHeight||de.height||i.height||0;if(r&&a){de.style.setProperty("--nimbi-preview-img-max-width","none"),de.style.setProperty("--nimbi-preview-img-max-height","none"),de.style.setProperty("--nimbi-preview-img-width",`${r*Qe}px`),de.style.setProperty("--nimbi-preview-img-height",`${a*Qe}px`),de.style.setProperty("--nimbi-preview-img-transform","none");try{de.style.width=`${r*Qe}px`,de.style.height=`${a*Qe}px`,de.style.transform="none"}catch{}}else{de.style.setProperty("--nimbi-preview-img-max-width",""),de.style.setProperty("--nimbi-preview-img-max-height",""),de.style.setProperty("--nimbi-preview-img-width",""),de.style.setProperty("--nimbi-preview-img-height",""),de.style.setProperty("--nimbi-preview-img-transform",`scale(${Qe})`);try{de.style.transform=`scale(${Qe})`}catch{}}de&&(de.classList.add("is-panning"),de.classList.remove("is-grabbing"))}function Mn(){if(!de)return;const e=de.closest(".nimbi-image-preview__image-wrapper");if(!e)return;const t=e.getBoundingClientRect();if(t.width===0||t.height===0)return;const n=En||de.naturalWidth||t.width,i=Cn||de.naturalHeight||t.height;if(!n||!i)return;const r=t.width/n,a=t.height/i,s=Math.min(r,a,1);Lt(Number.isFinite(s)?s:1)}function xc(e,t="",n=0,i=0){const r=kc();Qe=1,En=n||0,Cn=i||0,de.src=e;try{if(!t)try{const o=new URL(e,typeof location<"u"?location.href:"").pathname||"",c=(o.substring(o.lastIndexOf("/")+1)||e).replace(/\.[^/.]+$/,"").replace(/[-_]+/g," ");t=St("imagePreviewDefaultAlt",c||"Image")}catch{t=St("imagePreviewDefaultAlt","Image")}}catch{}de.alt=t,de.style.transform="scale(1)";const a=()=>{En=de.naturalWidth||de.width||0,Cn=de.naturalHeight||de.height||0};if(a(),Mn(),tr(),requestAnimationFrame(()=>{Mn(),tr()}),!En||!Cn){const s=()=>{a(),requestAnimationFrame(()=>{Mn(),tr()}),de.removeEventListener("load",s)};de.addEventListener("load",s)}typeof r.showModal=="function"&&(r.open||r.showModal()),r.classList.add("is-active");try{document.documentElement.classList.add("nimbi-image-preview-open")}catch{}r.focus()}function Rr(){if(tt){typeof tt.close=="function"&&tt.open&&tt.close(),tt.classList.remove("is-active");try{document.documentElement.classList.remove("nimbi-image-preview-open")}catch{}}}function Sc(e,{t,zoomStep:n=.25}={}){if(!e||!e.querySelectorAll)return;St=(d,p)=>(typeof t=="function"?t(d):void 0)||p,_n=n,e.addEventListener("click",d=>{const p=d.target;if(!p||p.tagName!=="IMG")return;const m=p;if(!m.src)return;const f=m.closest("a");f&&f.getAttribute("href")||xc(m.src,m.alt||"",m.naturalWidth||0,m.naturalHeight||0)});let i=!1,r=0,a=0,s=0,o=0;const l=new Map;let c=0,u=1;const g=(d,p)=>{const m=d.x-p.x,f=d.y-p.y;return Math.hypot(m,f)};e.addEventListener("pointerdown",d=>{const p=d.target;if(!p||p.tagName!=="IMG")return;const m=p.closest("a");if(m&&m.getAttribute("href")||!tt||!tt.open)return;if(l.set(d.pointerId,{x:d.clientX,y:d.clientY}),l.size===2){const w=Array.from(l.values());c=g(w[0],w[1]),u=Qe;return}const f=p.closest(".nimbi-image-preview__image-wrapper");if(f&&!(Qe<=1)){d.preventDefault(),i=!0,r=d.clientX,a=d.clientY,s=f.scrollLeft,o=f.scrollTop,p.setPointerCapture(d.pointerId);try{p.classList.add("is-grabbing")}catch{}}}),e.addEventListener("pointermove",d=>{if(l.has(d.pointerId)&&l.set(d.pointerId,{x:d.clientX,y:d.clientY}),l.size===2){d.preventDefault();const _=Array.from(l.values()),b=g(_[0],_[1]);if(c>0){const v=b/c;Lt(u*v)}return}if(!i)return;d.preventDefault();const p=d.target,m=p.closest&&p.closest("a");if(m&&m.getAttribute&&m.getAttribute("href"))return;const f=p.closest(".nimbi-image-preview__image-wrapper");if(!f)return;const w=d.clientX-r,y=d.clientY-a;f.scrollLeft=s-w,f.scrollTop=o-y});const h=()=>{i=!1,l.clear(),c=0;try{const d=document.querySelector("[data-nimbi-preview-image]");d&&(d.classList.add("is-panning"),d.classList.remove("is-grabbing"))}catch{}};e.addEventListener("pointerup",h),e.addEventListener("pointercancel",h)}function vc(e){const{contentWrap:t,navWrap:n,container:i,mountOverlay:r=null,t:a,contentBase:s,homePage:o,initialDocumentTitle:l,runHooks:c}=e||{};if(!t||!(t instanceof HTMLElement))throw new TypeError("contentWrap must be an HTMLElement");let u=null;const g=ac(a,[{path:o,name:a("home"),isIndex:!0,children:[]}]);let h=!1,d=!1;function p(b){try{if(!b)return;if(typeof b.replaceChildren=="function")return b.replaceChildren();for(;b.firstChild;)b.removeChild(b.firstChild)}catch{try{b&&(b.innerHTML="")}catch{}}}async function m(b,v){let S,E,P;try{({data:S,pagePath:E,anchor:P}=await Zo(b,s))}catch(H){const M=H&&H.message?String(H.message):"",F=(!le||typeof le!="string"||!le)&&/no page data/i.test(M);try{if(F)try{k("[nimbi-cms] fetchPageData (expected missing)",H)}catch{}else try{nr("[nimbi-cms] fetchPageData failed",H)}catch{}}catch{}try{!le&&n&&p(n)}catch{}aa(t,a,H);return}!P&&v&&(P=v);try{Xr(null)}catch(H){k("[nimbi-cms] scrollToAnchorOrTop failed",H)}try{p(t)}catch{try{t.innerHTML=""}catch{}}const{article:I,parsed:U,toc:z,topH1:O,h1Text:W,slugKey:te}=await dc(a,S,E,P,s);Ho(a,l,U,z,I,E,P,O,W,te,S);try{p(n)}catch{try{n.innerHTML=""}catch{}}z&&(n.appendChild(z),yc(z));try{await c("transformHtml",{article:I,parsed:U,toc:z,pagePath:E,anchor:P,topH1:O,h1Text:W,slugKey:te,data:S})}catch(H){k("[nimbi-cms] transformHtml hooks failed",H)}t.appendChild(I);try{fc(I)}catch(H){k("[nimbi-cms] executeEmbeddedScripts failed",H)}try{Sc(I,{t:a})}catch(H){k("[nimbi-cms] attachImagePreview failed",H)}try{Wn(i,100,!1),requestAnimationFrame(()=>Wn(i,100,!1)),setTimeout(()=>Wn(i,100,!1),250)}catch(H){k("[nimbi-cms] setEagerForAboveFoldImages failed",H)}Xr(P),bc(I,O,{mountOverlay:r,container:i,navWrap:n,t:a});try{await c("onPageLoad",{data:S,pagePath:E,anchor:P,article:I,toc:z,topH1:O,h1Text:W,slugKey:te,contentWrap:t,navWrap:n})}catch(H){k("[nimbi-cms] onPageLoad hooks failed",H)}u=E}async function f(){if(h){d=!0;return}h=!0;try{try{ua("renderByQuery")}catch{}try{ha("renderByQuery")}catch{}let b=it(location.href);if(b&&b.type==="path"&&b.page)try{let E="?page="+encodeURIComponent(b.page||"");b.params&&(E+=(E.includes("?")?"&":"?")+b.params),b.anchor&&(E+="#"+encodeURIComponent(b.anchor));try{history.replaceState(history.state,"",E)}catch{try{history.replaceState({},"",E)}catch{}}b=it(location.href)}catch{}const v=b&&b.page?b.page:o,S=b&&b.anchor?b.anchor:null;await m(v,S)}catch(b){k("[nimbi-cms] renderByQuery failed",b);try{!le&&n&&p(n)}catch{}aa(t,a,b)}finally{if(h=!1,d){d=!1;try{await f()}catch{}}}}window.addEventListener("popstate",f);const w=()=>`nimbi-cms-scroll:${location.pathname}${location.search}`,y=()=>{try{const b=i||document.querySelector(".nimbi-cms");if(!b)return;const v={top:b.scrollTop||0,left:b.scrollLeft||0};sessionStorage.setItem(w(),JSON.stringify(v))}catch(b){k("[nimbi-cms] save scroll position failed",b)}},_=()=>{try{const b=i||document.querySelector(".nimbi-cms");if(!b)return;const v=sessionStorage.getItem(w());if(!v)return;const S=JSON.parse(v);S&&typeof S.top=="number"&&b.scrollTo({top:S.top,left:S.left||0,behavior:"auto"})}catch{}};return window.addEventListener("pageshow",b=>{if(b.persisted)try{_(),Wn(i,100,!1)}catch(v){k("[nimbi-cms] bfcache restore failed",v)}}),window.addEventListener("pagehide",()=>{try{y()}catch(b){k("[nimbi-cms] save scroll position failed",b)}}),{renderByQuery:f,siteNav:g,getCurrentPagePath:()=>u}}function Ac(e){try{let t=typeof e=="string"?e:typeof window<"u"&&window.location?window.location.search:"";if(!t&&typeof window<"u"&&window.location&&window.location.hash)try{const a=it(window.location.href);a&&a.params&&(t=a.params.startsWith("?")?a.params:"?"+a.params)}catch{t=""}if(!t)return{};const n=new URLSearchParams(t.startsWith("?")?t.slice(1):t),i={},r=a=>{if(a==null)return;const s=String(a).toLowerCase();if(s==="1"||s==="true"||s==="yes")return!0;if(s==="0"||s==="false"||s==="no")return!1};if(n.has("contentPath")&&(i.contentPath=n.get("contentPath")),n.has("searchIndex")){const a=r(n.get("searchIndex"));typeof a=="boolean"&&(i.searchIndex=a)}if(n.has("searchIndexMode")){const a=n.get("searchIndexMode");(a==="eager"||a==="lazy")&&(i.searchIndexMode=a)}if(n.has("defaultStyle")){const a=n.get("defaultStyle");(a==="light"||a==="dark"||a==="system")&&(i.defaultStyle=a)}if(n.has("bulmaCustomize")&&(i.bulmaCustomize=n.get("bulmaCustomize")),n.has("lang")&&(i.lang=n.get("lang")),n.has("l10nFile")){const a=n.get("l10nFile");i.l10nFile=a==="null"?null:a}if(n.has("cacheTtlMinutes")){const a=Number(n.get("cacheTtlMinutes"));Number.isFinite(a)&&a>=0&&(i.cacheTtlMinutes=a)}if(n.has("cacheMaxEntries")){const a=Number(n.get("cacheMaxEntries"));Number.isInteger(a)&&a>=0&&(i.cacheMaxEntries=a)}if(n.has("homePage")&&(i.homePage=n.get("homePage")),n.has("navigationPage")&&(i.navigationPage=n.get("navigationPage")),n.has("notFoundPage")){const a=n.get("notFoundPage");i.notFoundPage=a==="null"?null:a}if(n.has("availableLanguages")&&(i.availableLanguages=n.get("availableLanguages").split(",").map(a=>a.trim()).filter(Boolean)),n.has("fetchConcurrency")){const a=Number(n.get("fetchConcurrency"));Number.isInteger(a)&&a>=1&&(i.fetchConcurrency=a)}if(n.has("negativeFetchCacheTTL")){const a=Number(n.get("negativeFetchCacheTTL"));Number.isFinite(a)&&a>=0&&(i.negativeFetchCacheTTL=a)}if(n.has("indexDepth")){const a=Number(n.get("indexDepth"));Number.isInteger(a)&&(a===1||a===2||a===3)&&(i.indexDepth=a)}if(n.has("noIndexing")){const s=(n.get("noIndexing")||"").split(",").map(o=>o.trim()).filter(Boolean);s.length&&(i.noIndexing=s)}return i}catch{return{}}}function $r(e){if(typeof e!="string")return!1;const t=e.trim();if(!t||t.includes("..")||/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(t)||t.startsWith("//")||t.startsWith("/")||/^[A-Za-z]:\\/.test(t))return!1;const n=t.replace(/^\.\//,"");return!!/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*\.(md|html)$/.test(n)}function Ec(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t==="."||t==="./")return!0;if(t.includes("..")||/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(t)||t.startsWith("//")||t.startsWith("/")||/^[A-Za-z]:\\/.test(t))return!1;const n=t.replace(/^\.\//,"");return!!/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*\/?$/.test(n)}let Gn="";async function ns(e={}){if(!e||typeof e!="object")throw new TypeError("initCMS(options): options must be an object");const t=Ac();if(t&&(t.contentPath||t.homePage||t.notFoundPage||t.navigationPage))if(e&&e.allowUrlPathOverrides===!0)try{k("[nimbi-cms] allowUrlPathOverrides enabled by host; honoring URL overrides for contentPath/homePage/notFoundPage/navigationPage")}catch{}else{try{k("[nimbi-cms] ignoring unsafe URL overrides for contentPath/homePage/notFoundPage/navigationPage")}catch{}delete t.contentPath,delete t.homePage,delete t.notFoundPage,delete t.navigationPage}const n=Object.assign({},t,e);try{if(Object.prototype.hasOwnProperty.call(n,"debugLevel"))Oi(n.debugLevel);else if(typeof globalThis<"u"&&globalThis.__nimbiCMSDebug&&typeof globalThis.__nimbiCMSDebug.debugLevel<"u")try{const z=Number(globalThis.__nimbiCMSDebug.debugLevel);Number.isFinite(z)&&Oi(Math.max(0,Math.min(3,Math.floor(z))))}catch{}}catch{}try{$t("[nimbi-cms] initCMS called",()=>({options:n}))}catch{}t&&typeof t.bulmaCustomize=="string"&&t.bulmaCustomize.trim()&&(n.bulmaCustomize=t.bulmaCustomize);let{el:i,contentPath:r="/content",crawlMaxQueue:a=1e3,searchIndex:s=!0,searchIndexMode:o="eager",indexDepth:l=1,noIndexing:c=void 0,defaultStyle:u="light",bulmaCustomize:g="none",lang:h=void 0,l10nFile:d=null,cacheTtlMinutes:p=5,cacheMaxEntries:m,markdownExtensions:f,availableLanguages:w,homePage:y=null,notFoundPage:_=null,navigationPage:b="_navigation.md",exposeSitemap:v=!0}=n;try{typeof y=="string"&&y.startsWith("./")&&(y=y.replace(/^\.\//,""))}catch{}try{typeof _=="string"&&_.startsWith("./")&&(_=_.replace(/^\.\//,""))}catch{}try{typeof b=="string"&&b.startsWith("./")&&(b=b.replace(/^[.]\//,""))}catch{}const{navbarLogo:S="favicon"}=n,{skipRootReadme:E=!1}=n,P=z=>{try{const O=document.querySelector(i);if(O&&O instanceof Element)try{const W=document.createElement("div");W.style.padding="1rem";try{W.style.fontFamily="system-ui, sans-serif"}catch{}W.style.color="#b00",W.style.background="#fee",W.style.border="1px solid #b00";const te=document.createElement("strong");te.textContent="NimbiCMS failed to initialize:",W.appendChild(te);try{W.appendChild(document.createElement("br"))}catch{}const H=document.createElement("pre");try{H.style.whiteSpace="pre-wrap"}catch{}H.textContent=String(z),W.appendChild(H);try{if(typeof O.replaceChildren=="function")O.replaceChildren(W);else{for(;O.firstChild;)O.removeChild(O.firstChild);O.appendChild(W)}}catch{try{O.innerHTML='<div style="padding:1rem;font-family:system-ui, sans-serif;color:#b00;background:#fee;border:1px solid #b00;"><strong>NimbiCMS failed to initialize:</strong><br><pre style="white-space:pre-wrap;">'+String(z)+"</pre></div>"}catch{}}}catch{}}catch{}};if(n.contentPath!=null&&!Ec(n.contentPath))throw new TypeError('initCMS(options): "contentPath" contains unsafe characters or patterns');if(y!=null&&!$r(y))throw new TypeError('initCMS(options): "homePage" must be a relative path (no leading "/") ending with .md or .html');if(_!=null&&!$r(_))throw new TypeError('initCMS(options): "notFoundPage" must be a relative path (no leading "/") ending with .md or .html');if(b!=null&&!$r(b))throw new TypeError('initCMS(options): "navigationPage" must be a relative path (no leading "/") ending with .md or .html');if(!i)throw new Error("el is required");let I=i;if(typeof i=="string"){if(I=document.querySelector(i),!I)throw new Error(`el selector "${i}" did not match any element`)}else if(!(i instanceof Element))throw new TypeError("el must be a CSS selector string or a DOM element");if(typeof r!="string"||!r.trim())throw new TypeError('initCMS(options): "contentPath" must be a non-empty string when provided');if(typeof s!="boolean")throw new TypeError('initCMS(options): "searchIndex" must be a boolean when provided');if(o!=null&&o!=="eager"&&o!=="lazy")throw new TypeError('initCMS(options): "searchIndexMode" must be "eager" or "lazy" when provided');if(l!=null&&l!==1&&l!==2&&l!==3)throw new TypeError('initCMS(options): "indexDepth" must be 1, 2, or 3 when provided');if(u!=="light"&&u!=="dark"&&u!=="system")throw new TypeError('initCMS(options): "defaultStyle" must be "light", "dark" or "system"');if(g!=null&&typeof g!="string")throw new TypeError('initCMS(options): "bulmaCustomize" must be a string when provided');if(h!=null&&typeof h!="string")throw new TypeError('initCMS(options): "lang" must be a string when provided');if(d!=null&&typeof d!="string")throw new TypeError('initCMS(options): "l10nFile" must be a string or null when provided');if(p!=null&&(typeof p!="number"||!Number.isFinite(p)||p<0))throw new TypeError('initCMS(options): "cacheTtlMinutes" must be a non‑negative number when provided');if(m!=null&&(typeof m!="number"||!Number.isInteger(m)||m<0))throw new TypeError('initCMS(options): "cacheMaxEntries" must be a non‑negative integer when provided');if(f!=null&&(!Array.isArray(f)||f.some(z=>!z||typeof z!="object")))throw new TypeError('initCMS(options): "markdownExtensions" must be an array of extension objects when provided');if(w!=null&&(!Array.isArray(w)||w.some(z=>typeof z!="string"||!z.trim())))throw new TypeError('initCMS(options): "availableLanguages" must be an array of non-empty strings when provided');if(c!=null&&(!Array.isArray(c)||c.some(z=>typeof z!="string"||!z.trim())))throw new TypeError('initCMS(options): "noIndexing" must be an array of non-empty strings when provided');if(E!=null&&typeof E!="boolean")throw new TypeError('initCMS(options): "skipRootReadme" must be a boolean when provided');if(n.fetchConcurrency!=null&&(typeof n.fetchConcurrency!="number"||!Number.isInteger(n.fetchConcurrency)||n.fetchConcurrency<1))throw new TypeError('initCMS(options): "fetchConcurrency" must be a positive integer when provided');if(n.negativeFetchCacheTTL!=null&&(typeof n.negativeFetchCacheTTL!="number"||!Number.isFinite(n.negativeFetchCacheTTL)||n.negativeFetchCacheTTL<0))throw new TypeError('initCMS(options): "negativeFetchCacheTTL" must be a non-negative number (ms) when provided');if(y!=null&&(typeof y!="string"||!y.trim()||!/\.(md|html)$/.test(y)))throw new TypeError('initCMS(options): "homePage" must be a non-empty string ending with .md or .html');if(_!=null&&(typeof _!="string"||!_.trim()||!/\.(md|html)$/.test(_)))throw new TypeError('initCMS(options): "notFoundPage" must be a non-empty string ending with .md or .html');const U=!!s;try{Promise.resolve().then(()=>at).then(z=>{try{z&&typeof z.setSkipRootReadme=="function"&&z.setSkipRootReadme(!!E)}catch(O){k("[nimbi-cms] setSkipRootReadme failed",O)}}).catch(z=>{})}catch(z){k("[nimbi-cms] setSkipRootReadme dynamic import failed",z)}try{try{n&&n.seoMap&&typeof n.seoMap=="object"&&jo(n.seoMap)}catch{}try{typeof window<"u"&&(window.__nimbiRenderingErrors__||(window.__nimbiRenderingErrors__=[]),window.addEventListener("error",function(z){try{const O={type:"error",message:z&&z.message?String(z.message):"",filename:z&&z.filename?String(z.filename):"",lineno:z&&z.lineno?z.lineno:null,colno:z&&z.colno?z.colno:null,stack:z&&z.error&&z.error.stack?z.error.stack:null,time:Date.now()};try{k("[nimbi-cms] runtime error",O.message)}catch{}window.__nimbiRenderingErrors__.push(O)}catch{}}),window.addEventListener("unhandledrejection",function(z){try{const O={type:"unhandledrejection",reason:z&&z.reason?String(z.reason):"",time:Date.now()};try{k("[nimbi-cms] unhandledrejection",O.reason)}catch{}window.__nimbiRenderingErrors__.push(O)}catch{}}))}catch{}try{const z=it(typeof window<"u"?window.location.href:""),O=z&&z.page?z.page:y||void 0;try{O&&qo(O,Gn||"")}catch{}}catch{}await(async()=>{try{I.classList.add("nimbi-mount")}catch(C){k("[nimbi-cms] mount element setup failed",C)}const z=document.createElement("section");z.className="section";const O=document.createElement("div");O.className="container nimbi-cms";const W=document.createElement("div");W.className="columns";const te=document.createElement("div");te.className="column is-hidden-mobile is-3-tablet nimbi-nav-wrap",te.setAttribute("role","navigation");try{const C=typeof nn=="function"?nn("navigation"):null;C&&te.setAttribute("aria-label",C)}catch(C){k("[nimbi-cms] set nav aria-label failed",C)}W.appendChild(te);const H=document.createElement("main");H.className="column nimbi-content",H.setAttribute("role","main"),W.appendChild(H),O.appendChild(W),z.appendChild(O);const M=te,F=H;I.appendChild(z);let G=null;try{G=I.querySelector(".nimbi-overlay"),G||(G=document.createElement("div"),G.className="nimbi-overlay",I.appendChild(G))}catch(C){G=null,k("[nimbi-cms] mount overlay setup failed",C)}const ie=location.pathname||"/";let ye;if(ie.endsWith("/"))ye=ie;else{const C=ie.substring(ie.lastIndexOf("/")+1);C&&!C.includes(".")?ye=ie+"/":ye=ie.substring(0,ie.lastIndexOf("/")+1)}try{Gn=document.title||""}catch(C){Gn="",k("[nimbi-cms] read initial document title failed",C)}let J=r;const Te=Object.prototype.hasOwnProperty.call(n,"contentPath"),ke=typeof location<"u"&&location.origin?location.origin:"http://localhost",xe=new URL(ye,ke).toString();(J==="."||J==="./")&&(J="");try{J=String(J||"").replace(/\\/g,"/")}catch{J=String(J||"")}J.startsWith("/")&&(J=J.replace(/^\/+/,"")),J&&!J.endsWith("/")&&(J=J+"/");try{if(J&&ye&&ye!=="/"){const C=ye.replace(/^\/+/,"").replace(/\/+$/,"")+"/";C&&J.startsWith(C)&&(J=J.slice(C.length))}}catch{}try{if(J)var Ce=new URL(J,xe.endsWith("/")?xe:xe+"/").toString();else var Ce=xe}catch{try{if(J)var Ce=new URL("/"+J,ke).toString();else var Ce=new URL(ye,ke).toString()}catch{var Ce=ke}}if(d&&await ni(d,ye),w&&Array.isArray(w)&&_a(w),h&&ri(h),typeof p=="number"&&p>=0&&typeof Wi=="function"&&Wi(p*60*1e3),typeof m=="number"&&m>=0&&typeof Ui=="function"&&Ui(m),f&&Array.isArray(f)&&f.length)try{f.forEach(C=>{typeof C=="object"&&wi&&typeof Wr=="function"&&Wr(C)})}catch(C){k("[nimbi-cms] applying markdownExtensions failed",C)}try{typeof a=="number"&&Promise.resolve().then(()=>at).then(({setDefaultCrawlMaxQueue:C})=>{try{C(a)}catch(A){k("[nimbi-cms] setDefaultCrawlMaxQueue failed",A)}}),typeof n.fetchConcurrency=="number"&&Promise.resolve().then(()=>at).then(({setFetchConcurrency:C})=>{try{C(n.fetchConcurrency)}catch(A){k("[nimbi-cms] setFetchConcurrency failed",A)}}).catch(()=>{}),typeof n.negativeFetchCacheTTL=="number"&&Promise.resolve().then(()=>at).then(({setFetchNegativeCacheTTL:C})=>{try{C(n.negativeFetchCacheTTL)}catch(A){k("[nimbi-cms] setFetchNegativeCacheTTL failed",A)}}).catch(()=>{})}catch(C){k("[nimbi-cms] setDefaultCrawlMaxQueue import failed",C)}try{try{const C=n&&n.manifest?n.manifest:typeof globalThis<"u"&&globalThis.__NIMBI_CMS_MANIFEST__?globalThis.__NIMBI_CMS_MANIFEST__:typeof window<"u"&&window.__NIMBI_CMS_MANIFEST__?window.__NIMBI_CMS_MANIFEST__:null;if(C&&typeof C=="object")try{const A=await Promise.resolve().then(()=>at);if(A&&typeof A._setAllMd=="function"){A._setAllMd(C);try{$t("[nimbi-cms diagnostic] applied content manifest",()=>({manifestKeys:Object.keys(C).length}))}catch{}}}catch(A){k("[nimbi-cms] applying content manifest failed",A)}try{si(Ce)}catch(A){k("[nimbi-cms] setContentBase failed",A)}try{try{const A=await Promise.resolve().then(()=>at);try{$t("[nimbi-cms diagnostic] after setContentBase",()=>({manifestKeys:C&&typeof C=="object"?Object.keys(C).length:0,slugToMdSize:A&&A.slugToMd&&typeof A.slugToMd.size=="number"?A.slugToMd.size:void 0,allMarkdownPathsLength:A&&Array.isArray(A.allMarkdownPaths)?A.allMarkdownPaths.length:void 0,allMarkdownPathsSetSize:A&&A.allMarkdownPathsSet&&typeof A.allMarkdownPathsSet.size=="number"?A.allMarkdownPathsSet.size:void 0,searchIndexLength:A&&Array.isArray(A.searchIndex)?A.searchIndex.length:void 0}))}catch{}}catch{}}catch{}}catch{}}catch(C){k("[nimbi-cms] setContentBase failed",C)}try{Sa(_)}catch(C){k("[nimbi-cms] setNotFoundPage failed",C)}try{typeof window<"u"&&window.__nimbiAutoAttachSitemapUI&&Promise.resolve().then(()=>Ln).then(C=>{try{C&&typeof C.attachSitemapDownloadUI=="function"&&C.attachSitemapDownloadUI(document.body,{filename:"sitemap.json"})}catch{}}).catch(()=>{})}catch{}let He=null,R=null;try{if(!Object.prototype.hasOwnProperty.call(n,"homePage")&&b)try{const L=[],D=[];try{b&&D.push(String(b))}catch{}try{const q=String(b||"").replace(/^_/,"");q&&q!==String(b)&&D.push(q)}catch{}try{D.push("navigation.md")}catch{}try{D.push("assets/navigation.md")}catch{}const K=[];for(const q of D)try{if(!q)continue;const $=String(q);K.includes($)||K.push($)}catch{}for(const q of K){L.push(q);try{if(R=await Oe(q,Ce,{force:!0}),R&&R.raw){try{b=q}catch{}try{k("[nimbi-cms] fetched navigation candidate",q,"contentBase=",Ce)}catch{}He=await un(R.raw||"");try{const $=qe();if($&&He&&He.html){const j=$.parseFromString(He.html,"text/html").querySelector("a");if(j)try{const X=j.getAttribute("href")||"",se=it(X);try{k("[nimbi-cms] parsed nav first-link href",X,"->",se)}catch{}if(se&&se.page&&(se.type==="path"||se.type==="canonical"&&(se.page.includes(".")||se.page.includes("/")))){y=se.page;try{k("[nimbi-cms] derived homePage from navigation",y)}catch{}break}}catch{}}}catch{}}}catch{}}}catch{}try{k("[nimbi-cms] final homePage before slugManager setHomePage",y)}catch{}try{va(y)}catch(L){k("[nimbi-cms] setHomePage failed",L)}let A=!0;try{const L=it(typeof location<"u"?location.href:"");L&&L.type==="cosmetic"&&(typeof _>"u"||_==null)&&(A=!1)}catch{}if(A&&y)try{await Oe(y,Ce,{force:!0})}catch(L){throw new Error(`Required ${y} not found at ${Ce}${y}: ${L&&L.message?L.message:String(L)}`)}}catch(C){throw C}ma(u),await pa(g,ye);const N=vc({contentWrap:F,navWrap:M,container:O,mountOverlay:G,t:nn,contentBase:Ce,homePage:y,initialDocumentTitle:Gn,runHooks:Ir});try{const C=document.createElement("header");C.className="nimbi-site-navbar",I.insertBefore(C,z);let A=R,L=He;L||(A=await Oe(b,Ce,{force:!0}),L=await un(A.raw||""));const{navbar:D,linkEls:K}=await _c(C,O,L.html||"",Ce,y,nn,N.renderByQuery,U,o,l,c,S);try{await Ir("onNavBuild",{navWrap:M,navbar:D,linkEls:K,contentBase:Ce})}catch(q){k("[nimbi-cms] onNavBuild hooks failed",q)}try{try{if(K&&K.length){const q=await Promise.resolve().then(()=>at);for(const $ of Array.from(K||[]))try{const T=$&&$.getAttribute&&$.getAttribute("href")||"";if(!T)continue;let j=String(T||"").split(/::|#/,1)[0];if(j=String(j||"").split("?")[0],!j)continue;/\.(?:md|html?)$/.test(j)||(j=j+".html");let X=null;try{X=Y(String(j||""))}catch{X=String(j||"")}const se=String(X||"").replace(/^.*\//,"").replace(/\?.*$/,"");if(!se)continue;try{let pe=null;try{q&&typeof q.slugify=="function"&&(pe=q.slugify(se.replace(/\.(?:md|html?)$/i,"")))}catch{pe=String(se||"").replace(/\s+/g,"-").toLowerCase()}if(!pe)continue;let be=pe;try{if(q&&q.slugToMd&&typeof q.slugToMd.has=="function"&&q.slugToMd.has(pe)){const ge=q.slugToMd.get(pe);let Se=!1;try{if(typeof ge=="string")ge===j&&(Se=!0);else if(ge&&typeof ge=="object"){ge.default===j&&(Se=!0);for(const ze of Object.keys(ge.langs||{}))if(ge.langs[ze]===j){Se=!0;break}}}catch{}if(!Se&&typeof q.uniqueSlug=="function")try{be=q.uniqueSlug(pe,new Set(q.slugToMd.keys()))}catch{be=pe}}}catch{}try{if(q&&typeof q._storeSlugMapping=="function")try{q._storeSlugMapping(be,X)}catch{}else if(q&&q.slugToMd&&typeof q.slugToMd.set=="function")try{q.slugToMd.set(be,X)}catch{}try{q&&q.mdToSlug&&typeof q.mdToSlug.set=="function"&&q.mdToSlug.set(X,be)}catch{}try{q&&Array.isArray(q.allMarkdownPaths)&&!q.allMarkdownPaths.includes(X)&&q.allMarkdownPaths.push(X)}catch{}try{q&&q.allMarkdownPathsSet&&typeof q.allMarkdownPathsSet.add=="function"&&q.allMarkdownPathsSet.add(X)}catch{}}catch{}}catch{}}catch{}try{const $=await Promise.resolve().then(()=>Mr);$&&typeof $.refreshIndexPaths=="function"&&$.refreshIndexPaths(Ce)}catch{}}}catch{}}catch{}try{let q=!1;try{const $=new URLSearchParams(location.search||"");($.has("sitemap")||$.has("rss")||$.has("atom"))&&(q=!0)}catch{}try{const T=(location.pathname||"/").replace(/\/\/+/g,"/").split("/").filter(Boolean).pop()||"";T&&/^(sitemap|sitemap\.xml|rss|rss\.xml|atom|atom\.xml)$/i.test(T)&&(q=!0)}catch{}if(q||v===!0||typeof window<"u"&&window.__nimbiExposeSitemap)try{try{const T=await Promise.resolve().then(()=>at);if(T&&typeof T.awaitSearchIndex=="function"){const j=[];y&&j.push(y),b&&j.push(b);try{await T.awaitSearchIndex({contentBase:Ce,indexDepth:Math.max(l||1,3),noIndexing:c,seedPaths:j.length?j:void 0,startBuild:!0,timeoutMs:1/0})}catch{}}}catch{}const $=await Promise.resolve().then(()=>Ln);try{if($&&typeof $.handleSitemapRequest=="function"&&await $.handleSitemapRequest({includeAllMarkdown:!0,homePage:y,navigationPage:b,notFoundPage:_,contentBase:Ce,indexDepth:l,noIndexing:c}))return}catch{}}catch{}try{Promise.resolve().then(()=>Ln).then($=>{try{if($&&typeof $.exposeSitemapGlobals=="function")try{$.exposeSitemapGlobals({includeAllMarkdown:!0,homePage:y,navigationPage:b,notFoundPage:_,contentBase:Ce,indexDepth:l,noIndexing:c,waitForIndexMs:1/0}).catch(()=>{})}catch{}}catch{}}).catch(()=>{})}catch{}}catch{}try{try{const $=await Promise.resolve().then(()=>Mr);if($&&typeof $.refreshIndexPaths=="function")try{$.refreshIndexPaths(Ce);try{try{const T=await Promise.resolve().then(()=>at);try{$t("[nimbi-cms diagnostic] after refreshIndexPaths",()=>({slugToMdSize:T&&T.slugToMd&&typeof T.slugToMd.size=="number"?T.slugToMd.size:void 0,allMarkdownPathsLength:T&&Array.isArray(T.allMarkdownPaths)?T.allMarkdownPaths.length:void 0,allMarkdownPathsSetSize:T&&T.allMarkdownPathsSet&&typeof T.allMarkdownPathsSet.size=="number"?T.allMarkdownPathsSet.size:void 0}))}catch{}}catch{}}catch{}try{const T=await Promise.resolve().then(()=>at),j=T&&T.slugToMd&&typeof T.slugToMd.size=="number"?T.slugToMd.size:0;let X=!1;try{if(!manifest){j<30&&(X=!0);try{const se=it(typeof location<"u"?location.href:"");if(se){if(se.type==="cosmetic"&&se.page)try{T.slugToMd.has(se.page)||(X=!0)}catch{}else if((se.type==="path"||se.type==="canonical")&&se.page)try{const pe=Y(se.page);!(T.mdToSlug&&T.mdToSlug.has(pe))&&!(T.allMarkdownPathsSet&&T.allMarkdownPathsSet.has(pe))&&(X=!0)}catch{}}}catch{}}}catch{}if(X){let se=null;try{se=typeof window<"u"&&(window.__nimbiSitemapFinal||window.__nimbiResolvedIndex||window.__nimbiSearchIndex||window.__nimbiLiveSearchIndex||window.__nimbiSearchIndex)||null}catch{se=null}if(Array.isArray(se)&&se.length){let pe=0;for(const be of se)try{if(!be||!be.slug)continue;const ge=String(be.slug).split("::")[0];if(T.slugToMd.has(ge))continue;let Se=be.sourcePath||be.path||null;if(!Se&&Array.isArray(se)){const Fe=(se||[]).find(Ge=>Ge&&Ge.slug===be.slug);Fe&&Fe.path&&(Se=Fe.path)}if(!Se)continue;try{Se=String(Se)}catch{continue}let ze=null;try{const Fe=Ce&&typeof Ce=="string"?Ce:typeof location<"u"&&location.origin?location.origin+"/":"";try{const Ge=new URL(Se,Fe),Et=new URL(Fe);if(Ge.origin===Et.origin){const dn=Et.pathname||"/";let Ct=Ge.pathname||"";Ct.startsWith(dn)&&(Ct=Ct.slice(dn.length)),Ct.startsWith("/")&&(Ct=Ct.slice(1)),ze=Y(Ct)}else ze=Y(Ge.pathname||"")}catch{ze=Y(Se)}}catch{ze=Y(Se)}if(!ze)continue;ze=String(ze).split(/[?#]/)[0],ze=Y(ze);try{T._storeSlugMapping(ge,ze)}catch{}pe++}catch{}if(pe){try{$t("[nimbi-cms diagnostic] populated slugToMd from sitemap/searchIndex",()=>({added:pe,total:T&&T.slugToMd&&typeof T.slugToMd.size=="number"?T.slugToMd.size:void 0}))}catch{}try{const be=await Promise.resolve().then(()=>Mr);be&&typeof be.refreshIndexPaths=="function"&&be.refreshIndexPaths(Ce)}catch{}}}}}catch{}}catch(T){k("[nimbi-cms] refreshIndexPaths after nav build failed",T)}}catch{}const q=()=>{const $=C&&C.getBoundingClientRect&&Math.round(C.getBoundingClientRect().height)||C&&C.offsetHeight||0;if($>0){try{I.style.setProperty("--nimbi-site-navbar-height",`${$}px`)}catch(T){k("[nimbi-cms] set CSS var failed",T)}try{O.style.paddingTop=""}catch(T){k("[nimbi-cms] set container paddingTop failed",T)}try{const T=I&&I.getBoundingClientRect&&Math.round(I.getBoundingClientRect().height)||I&&I.clientHeight||0;if(T>0){const j=Math.max(0,T-$);try{O.style.setProperty("--nimbi-cms-height",`${j}px`)}catch(X){k("[nimbi-cms] set --nimbi-cms-height failed",X)}}else try{O.style.setProperty("--nimbi-cms-height","calc(100vh - var(--nimbi-site-navbar-height))")}catch(j){k("[nimbi-cms] set --nimbi-cms-height failed",j)}}catch(T){k("[nimbi-cms] compute container height failed",T)}try{C.style.setProperty("--nimbi-site-navbar-height",`${$}px`)}catch(T){k("[nimbi-cms] set navbar CSS var failed",T)}}};q();try{if(typeof ResizeObserver<"u"){const $=new ResizeObserver(()=>q());try{$.observe(C)}catch(T){k("[nimbi-cms] ResizeObserver.observe failed",T)}}}catch($){k("[nimbi-cms] ResizeObserver setup failed",$)}}catch(q){k("[nimbi-cms] compute navbar height failed",q)}}catch(C){k("[nimbi-cms] build navigation failed",C)}await N.renderByQuery();try{Promise.resolve().then(()=>Cc).then(({getVersion:C})=>{typeof C=="function"&&C().then(A=>{try{const L=A||"0.0.0";try{const D=$=>{const T=document.createElement("a");T.className="nimbi-version-label tag is-small",T.textContent=`nimbiCMS v. ${L}`,T.href=$||"#",T.target="_blank",T.rel="noopener noreferrer nofollow",T.setAttribute("aria-label",`nimbiCMS version ${L}`);try{ya(T)}catch{}try{I.appendChild(T)}catch(j){k("[nimbi-cms] append version label failed",j)}},K="https://abelvm.github.io/nimbiCMS/",q=(()=>{try{if(K&&typeof K=="string")return new URL(K).toString()}catch{}return"#"})();D(q)}catch(D){k("[nimbi-cms] building version label failed",D)}}catch(L){k("[nimbi-cms] building version label failed",L)}}).catch(A=>{k("[nimbi-cms] getVersion() failed",A)})}).catch(C=>{k("[nimbi-cms] import version module failed",C)})}catch(C){k("[nimbi-cms] version label setup failed",C)}})()}catch(z){throw P(z),z}}async function rs(){try{if("1.0.6".trim())return"1.0.6"}catch{}return"0.0.0"}const Cc=Object.freeze(Object.defineProperty({__proto__:null,getVersion:rs},Symbol.toStringTag,{value:"Module"})),et=Bt,bn=k;function ki(){try{if(typeof location<"u"&&location&&typeof location.pathname=="string")return String(location.origin+location.pathname.split("?")[0])}catch{}return"http://localhost/"}function De(e){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function oa(e){try{return!e||typeof e!="string"?"":(e.split("/").filter(Boolean).pop()||e).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").split(" ").map(r=>r?r.charAt(0).toUpperCase()+r.slice(1):"").join(" ").trim()}catch{return String(e)}}function Mc(e,t){try{const n=t&&t.slug?String(t.slug):null;if(!n)return null;const r={loc:e+"?page="+encodeURIComponent(n),slug:n};return t.title&&(r.title=String(t.title)),t.excerpt&&(r.excerpt=String(t.excerpt)),t.path&&(r.sourcePath=Y(String(t.path))),r}catch{return null}}async function xi(e={}){const{includeAllMarkdown:t=!0,index:n,homePage:i,navigationPage:r,notFoundPage:a}=e||{},o=ki().split("?")[0];let l=Array.isArray(re)&&re.length?re:Array.isArray(n)?n:[];if(Array.isArray(n)&&n.length&&Array.isArray(re)&&re.length){const w=new Map;try{for(const y of n)try{y&&y.slug&&w.set(String(y.slug),y)}catch{}for(const y of re)try{y&&y.slug&&w.set(String(y.slug),y)}catch{}}catch{}l=Array.from(w.values())}const c=new Set;try{typeof a=="string"&&a.trim()&&c.add(Y(String(a)))}catch{}try{typeof r=="string"&&r.trim()&&c.add(Y(String(r)))}catch{}const u=new Set;try{if(typeof a=="string"&&a.trim()){const w=Y(String(a));try{if(Z&&typeof Z.has=="function"&&Z.has(w))try{u.add(Z.get(w))}catch{}else try{const y=await Oe(w,e&&e.contentBase?e.contentBase:void 0);if(y&&y.raw)try{let _=null;if(y.isHtml)try{const b=qe();if(b){const v=b.parseFromString(y.raw,"text/html"),S=v.querySelector("h1")||v.querySelector("title");S&&S.textContent&&(_=S.textContent.trim())}else{const v=(y.raw||"").match(/<h1[^>]*>(.*?)<\/h1>|<title[^>]*>(.*?)<\/title>/i);v&&(_=(v[1]||v[2]||"").trim())}}catch{}else{const b=(y.raw||"").match(/^#\s+(.+)$/m);b&&b[1]&&(_=b[1].trim())}_&&u.add(he(_))}catch{}}catch{}}catch{}}}catch{}const g=new Set,h=[],d=new Map,p=new Map,m=w=>{try{if(!w||typeof w!="string")return!1;const y=Y(String(w));try{if($e&&typeof $e.has=="function"&&$e.has(y))return!0}catch{}try{if(Z&&typeof Z.has=="function"&&Z.has(y))return!0}catch{}try{if(p&&p.has(y))return!0}catch{}try{if(Z&&typeof Z.keys=="function"&&Z.size)for(const _ of Z.keys())try{if(Y(String(_))===y)return!0}catch{}else for(const _ of V.values())try{if(!_)continue;if(typeof _=="string"){if(Y(String(_))===y)return!0}else if(_&&typeof _=="object"){if(_.default&&Y(String(_.default))===y)return!0;const b=_.langs||{};for(const v of Object.keys(b||{}))try{if(b[v]&&Y(String(b[v]))===y)return!0}catch{}}}catch{}}catch{}}catch{}return!1};if(Array.isArray(l)&&l.length){let w=0;for(const y of l){try{w++,await Pt(w,64)}catch{}try{if(!y||!y.slug)continue;const _=String(y.slug),b=String(_).split("::")[0];if(u.has(b))continue;const v=y.path?Y(String(y.path)):null;if(v&&c.has(v))continue;const S=y.title?String(y.title):y.parentTitle?String(y.parentTitle):void 0;d.set(_,{title:S||void 0,excerpt:y.excerpt?String(y.excerpt):void 0,path:v,source:"index"}),v&&p.set(v,{title:S||void 0,excerpt:y.excerpt?String(y.excerpt):void 0,slug:_});const E=Mc(o,y);if(!E||!E.slug||g.has(E.slug))continue;if(g.add(E.slug),d.has(E.slug)){const P=d.get(E.slug);P&&P.title&&(E.title=P.title,E._titleSource="index"),P&&P.excerpt&&(E.excerpt=P.excerpt)}h.push(E)}catch{continue}}}if(t)try{let w=0;for(const[y,_]of V.entries()){try{w++,await Pt(w,128)}catch{}try{if(!y)continue;const b=String(y).split("::")[0];if(g.has(y)||u.has(b))continue;let v=null;if(typeof _=="string"?v=Y(String(_)):_&&typeof _=="object"&&(v=Y(String(_.default||""))),v&&c.has(v))continue;const E={loc:o+"?page="+encodeURIComponent(y),slug:y};if(d.has(y)){const P=d.get(y);P&&P.title&&(E.title=P.title,E._titleSource="index"),P&&P.excerpt&&(E.excerpt=P.excerpt)}else if(v){const P=p.get(v);P&&P.title&&(E.title=P.title,E._titleSource="path",!E.excerpt&&P.excerpt&&(E.excerpt=P.excerpt))}if(g.add(y),typeof y=="string"){const P=y.indexOf("/")!==-1||/\.(md|html?)$/i.test(y),I=E.title&&typeof E.title=="string"&&(E.title.indexOf("/")!==-1||/\.(md|html?)$/i.test(E.title));(!E.title||I||P)&&(E.title=oa(y),E._titleSource="humanize")}h.push(E)}catch{}}try{if(i&&typeof i=="string"){const y=Y(String(i));let _=null;try{Z&&Z.has(y)&&(_=Z.get(y))}catch{}_||(_=y);const b=String(_).split("::")[0];if(!g.has(_)&&!c.has(y)&&!u.has(b)){const v={loc:o+"?page="+encodeURIComponent(_),slug:_};if(d.has(_)){const S=d.get(_);S&&S.title&&(v.title=S.title,v._titleSource="index"),S&&S.excerpt&&(v.excerpt=S.excerpt)}g.add(_),h.push(v)}}}catch{}}catch{}try{const w=new Set,y=new Set(h.map(E=>String(E&&E.slug?E.slug:""))),_=new Set;for(const E of h)try{E&&E.sourcePath&&_.add(String(E.sourcePath))}catch{}const b=30;let v=0,S=0;for(const E of _){try{S++,await Pt(S,8)}catch{}if(v>=b)break;try{if(!E||typeof E!="string"||!m(E))continue;v+=1;const P=await Oe(E,e&&e.contentBase?e.contentBase:void 0);if(!P||!P.raw||P&&typeof P.status=="number"&&P.status===404)continue;const I=P.raw,U=(function(H){try{return String(H||"")}catch{return""}})(I),z=[],O=/\[[^\]]+\]\(([^)]+)\)/g;let W;for(;W=O.exec(U);)try{W&&W[1]&&z.push(W[1])}catch{}const te=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/gi;for(;W=te.exec(U);)try{W&&W[1]&&z.push(W[1])}catch{}for(const H of z)try{if(!H)continue;if(H.indexOf("?")!==-1||H.indexOf("=")!==-1)try{const G=new URL(H,o).searchParams.get("page");if(G){const ie=String(G);!y.has(ie)&&!w.has(ie)&&(w.add(ie),h.push({loc:o+"?page="+encodeURIComponent(ie),slug:ie}));continue}}catch{}let M=String(H).split(/[?#]/)[0];if(M=M.replace(/^\.\//,"").replace(/^\//,""),!M||!/\.(md|html?)$/i.test(M))continue;try{const F=Y(M);if(Z&&Z.has(F)){const G=Z.get(F),ie=String(G).split("::")[0];G&&!y.has(G)&&!w.has(G)&&!u.has(ie)&&!c.has(F)&&(w.add(G),h.push({loc:o+"?page="+encodeURIComponent(G),slug:G,sourcePath:F}));continue}try{if(!m(F))continue;const G=await Oe(F,e&&e.contentBase?e.contentBase:void 0);if(G&&typeof G.status=="number"&&G.status===404)continue;if(G&&G.raw){const ie=(G.raw||"").match(/^#\s+(.+)$/m),ye=ie&&ie[1]?ie[1].trim():"",J=he(ye||F),Te=String(J).split("::")[0];J&&!y.has(J)&&!w.has(J)&&!u.has(Te)&&(w.add(J),h.push({loc:o+"?page="+encodeURIComponent(J),slug:J,sourcePath:F,title:ye||void 0}))}}catch{}}catch{}}catch{}}catch{}}}catch{}try{const w=new Map;let y=0;for(const b of h){try{y++,await Pt(y,128)}catch{}try{if(!b||!b.slug)continue;w.set(String(b.slug),b)}catch{}}const _=new Set;for(const b of h)try{if(!b||!b.slug)continue;const v=String(b.slug),S=v.split("::")[0];if(!S)continue;v!==S&&!w.has(S)&&_.add(S)}catch{}for(const b of _)try{let v=null;if(d.has(b)){const S=d.get(b);v={loc:o+"?page="+encodeURIComponent(b),slug:b},S&&S.title&&(v.title=S.title,v._titleSource="index"),S&&S.excerpt&&(v.excerpt=S.excerpt),S&&S.path&&(v.sourcePath=S.path)}else if(p&&V&&V.has(b)){const S=V.get(b);let E=null;if(typeof S=="string"?E=Y(String(S)):S&&typeof S=="object"&&(E=Y(String(S.default||""))),v={loc:o+"?page="+encodeURIComponent(b),slug:b},E&&p.has(E)){const P=p.get(E);P&&P.title&&(v.title=P.title,v._titleSource="path"),P&&P.excerpt&&(v.excerpt=P.excerpt),v.sourcePath=E}}v||(v={loc:o+"?page="+encodeURIComponent(b),slug:b,title:oa(b)},v._titleSource="humanize"),w.has(b)||(h.push(v),w.set(b,v))}catch{}}catch{}const f=[];try{const w=new Set;let y=0;for(const _ of h){try{y++,await Pt(y,128)}catch{}try{if(!_||!_.slug)continue;const b=String(_.slug),v=String(b).split("::")[0];if(u.has(v)||b.indexOf("::")!==-1||w.has(b))continue;w.add(b),f.push(_)}catch{}}}catch{}try{try{et(()=>"[runtimeSitemap] generateSitemapJson finalEntries.titleSource: "+JSON.stringify(f.map(w=>({slug:w.slug,title:w.title,titleSource:w._titleSource||null})),null,2))}catch{}}catch{}try{let y=0;const _=f.length,b=Array.from({length:Math.min(4,_)}).map(async()=>{for(;;){const v=y++;if(v>=_)break;const S=f[v];try{if(!S||!S.slug)continue;const E=String(S.slug).split("::")[0];if(u.has(E)||S._titleSource==="index")continue;let P=null;try{if(V&&V.has(S.slug)){const I=V.get(S.slug);typeof I=="string"?P=Y(String(I)):I&&typeof I=="object"&&(P=Y(String(I.default||"")))}!P&&S.sourcePath&&(P=S.sourcePath)}catch{continue}if(!P||c.has(P)||!m(P))continue;try{const I=await Oe(P,e&&e.contentBase?e.contentBase:void 0);if(!I||!I.raw||I&&typeof I.status=="number"&&I.status===404)continue;if(I&&I.raw){const U=(I.raw||"").match(/^#\s+(.+)$/m),z=U&&U[1]?U[1].trim():"";z&&(S.title=z,S._titleSource="fetched")}}catch(I){et("[runtimeSitemap] fetch title failed for",P,I)}}catch(E){et("[runtimeSitemap] worker loop failure",E)}}});await Promise.all(b)}catch(w){et("[runtimeSitemap] title enrichment failed",w)}return{generatedAt:new Date().toISOString(),entries:f}}function Qr(e){const t=e&&Array.isArray(e.entries)?e.entries:Array.isArray(e)?e:[];let n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2191
|
+
`}e.addEventListener("click",C=>{C.target===e&&Nr()}),e.addEventListener("wheel",C=>{if(!W())return;C.preventDefault();const N=C.deltaY<0?kn:-kn;Lt(Xe+N),c(),u()},{passive:!1}),e.addEventListener("keydown",C=>{if(C.key==="Escape"){Nr();return}if(Xe>1){const N=e.querySelector(".nimbi-image-preview__image-wrapper");if(!N)return;const D=40;switch(C.key){case"ArrowUp":N.scrollTop-=D,C.preventDefault();break;case"ArrowDown":N.scrollTop+=D,C.preventDefault();break;case"ArrowLeft":N.scrollLeft-=D,C.preventDefault();break;case"ArrowRight":N.scrollLeft+=D,C.preventDefault();break}}}),document.body.appendChild(e),nt=e,fe=e.querySelector("[data-nimbi-preview-image]");const t=e.querySelector("[data-nimbi-preview-fit]"),n=e.querySelector("[data-nimbi-preview-original]"),i=e.querySelector("[data-nimbi-preview-zoom-in]"),r=e.querySelector("[data-nimbi-preview-zoom-out]"),a=e.querySelector("[data-nimbi-preview-reset]"),s=e.querySelector("[data-nimbi-preview-close]"),o=e.querySelector("[data-nimbi-preview-zoom-label]"),l=e.querySelector("[data-nimbi-preview-zoom-hud]");function c(){o&&(o.textContent=`${Math.round(Xe*100)}%`)}const u=()=>{l&&(l.textContent=`${Math.round(Xe*100)}%`,l.classList.add("visible"),clearTimeout(l._timeout),l._timeout=setTimeout(()=>l.classList.remove("visible"),800))};ar=c,i.addEventListener("click",()=>{Lt(Xe+kn),c(),u()}),r.addEventListener("click",()=>{Lt(Xe-kn),c(),u()}),t.addEventListener("click",()=>{Ln(),c(),u()}),n.addEventListener("click",()=>{Lt(1),c(),u()}),a.addEventListener("click",()=>{Ln(),c(),u()}),s.addEventListener("click",Nr),t.title=St("imagePreviewFit","Fit to screen"),n.title=St("imagePreviewOriginal","Original size"),r.title=St("imagePreviewZoomOut","Zoom out"),i.title=St("imagePreviewZoomIn","Zoom in"),s.title=St("imagePreviewClose","Close"),s.setAttribute("aria-label",St("imagePreviewClose","Close"));let g=!1,h=0,d=0,p=0,m=0;const f=new Map;let w=0,y=1;const _=(C,N)=>{const D=C.x-N.x,ie=C.y-N.y;return Math.hypot(D,ie)},b=()=>{g=!1,f.clear(),w=0,fe&&(fe.classList.add("is-panning"),fe.classList.remove("is-grabbing"))};let A=0,S=0,E=0;const I=C=>{const N=Date.now(),D=N-A,ie=C.clientX-S,he=C.clientY-E;A=N,S=C.clientX,E=C.clientY,D<300&&Math.hypot(ie,he)<30&&(Lt(Xe>1?1:2),c(),C.preventDefault())},O=C=>{Lt(Xe>1?1:2),c(),C.preventDefault()},W=()=>nt?typeof nt.open=="boolean"?nt.open:nt.classList.contains("is-active"):!1,z=(C,N,D=1)=>{if(f.has(D)&&f.set(D,{x:C,y:N}),f.size===2){const Le=Array.from(f.values()),me=_(Le[0],Le[1]);if(w>0){const Se=me/w;Lt(y*Se)}return}if(!g)return;const ie=fe.closest(".nimbi-image-preview__image-wrapper");if(!ie)return;const he=C-h,K=N-d;ie.scrollLeft=p-he,ie.scrollTop=m-K},B=(C,N,D=1)=>{if(!W())return;if(f.set(D,{x:C,y:N}),f.size===2){const K=Array.from(f.values());w=_(K[0],K[1]),y=Xe;return}const ie=fe.closest(".nimbi-image-preview__image-wrapper");!ie||!(ie.scrollWidth>ie.clientWidth||ie.scrollHeight>ie.clientHeight)||(g=!0,h=C,d=N,p=ie.scrollLeft,m=ie.scrollTop,fe.classList.add("is-panning"),fe.classList.remove("is-grabbing"),window.addEventListener("pointermove",Z),window.addEventListener("pointerup",ee),window.addEventListener("pointercancel",ee))},Z=C=>{g&&(C.preventDefault(),z(C.clientX,C.clientY,C.pointerId))},ee=()=>{b(),window.removeEventListener("pointermove",Z),window.removeEventListener("pointerup",ee),window.removeEventListener("pointercancel",ee)};fe.addEventListener("pointerdown",C=>{C.preventDefault(),B(C.clientX,C.clientY,C.pointerId)}),fe.addEventListener("pointermove",C=>{(g||f.size===2)&&C.preventDefault(),z(C.clientX,C.clientY,C.pointerId)}),fe.addEventListener("pointerup",C=>{C.preventDefault(),C.pointerType==="touch"&&I(C),b()}),fe.addEventListener("dblclick",O),fe.addEventListener("pointercancel",b),fe.addEventListener("mousedown",C=>{C.preventDefault(),B(C.clientX,C.clientY,1)}),fe.addEventListener("mousemove",C=>{g&&C.preventDefault(),z(C.clientX,C.clientY,1)}),fe.addEventListener("mouseup",C=>{C.preventDefault(),b()});const j=e.querySelector(".nimbi-image-preview__image-wrapper");return j&&(j.addEventListener("pointerdown",C=>{if(B(C.clientX,C.clientY,C.pointerId),C&&C.target&&C.target.tagName==="IMG")try{C.target.classList.add("is-grabbing")}catch{}}),j.addEventListener("pointermove",C=>{z(C.clientX,C.clientY,C.pointerId)}),j.addEventListener("pointerup",b),j.addEventListener("pointercancel",b),j.addEventListener("mousedown",C=>{if(B(C.clientX,C.clientY,1),C&&C.target&&C.target.tagName==="IMG")try{C.target.classList.add("is-grabbing")}catch{}}),j.addEventListener("mousemove",C=>{z(C.clientX,C.clientY,1)}),j.addEventListener("mouseup",b)),e}function Lt(e){if(!fe)return;const t=Number(e);Xe=Number.isFinite(t)?Math.max(.1,Math.min(4,t)):1;const i=fe.getBoundingClientRect(),r=Cn||fe.naturalWidth||fe.width||i.width||0,a=Mn||fe.naturalHeight||fe.height||i.height||0;if(r&&a){fe.style.setProperty("--nimbi-preview-img-max-width","none"),fe.style.setProperty("--nimbi-preview-img-max-height","none"),fe.style.setProperty("--nimbi-preview-img-width",`${r*Xe}px`),fe.style.setProperty("--nimbi-preview-img-height",`${a*Xe}px`),fe.style.setProperty("--nimbi-preview-img-transform","none");try{fe.style.width=`${r*Xe}px`,fe.style.height=`${a*Xe}px`,fe.style.transform="none"}catch{}}else{fe.style.setProperty("--nimbi-preview-img-max-width",""),fe.style.setProperty("--nimbi-preview-img-max-height",""),fe.style.setProperty("--nimbi-preview-img-width",""),fe.style.setProperty("--nimbi-preview-img-height",""),fe.style.setProperty("--nimbi-preview-img-transform",`scale(${Xe})`);try{fe.style.transform=`scale(${Xe})`}catch{}}fe&&(fe.classList.add("is-panning"),fe.classList.remove("is-grabbing"))}function Ln(){if(!fe)return;const e=fe.closest(".nimbi-image-preview__image-wrapper");if(!e)return;const t=e.getBoundingClientRect();if(t.width===0||t.height===0)return;const n=Cn||fe.naturalWidth||t.width,i=Mn||fe.naturalHeight||t.height;if(!n||!i)return;const r=t.width/n,a=t.height/i,s=Math.min(r,a,1);Lt(Number.isFinite(s)?s:1)}function Ec(e,t="",n=0,i=0){const r=Ac();Xe=1,Cn=n||0,Mn=i||0,fe.src=e;try{if(!t)try{const o=new URL(e,typeof location<"u"?location.href:"").pathname||"",c=(o.substring(o.lastIndexOf("/")+1)||e).replace(/\.[^/.]+$/,"").replace(/[-_]+/g," ");t=St("imagePreviewDefaultAlt",c||"Image")}catch{t=St("imagePreviewDefaultAlt","Image")}}catch{}fe.alt=t,fe.style.transform="scale(1)";const a=()=>{Cn=fe.naturalWidth||fe.width||0,Mn=fe.naturalHeight||fe.height||0};if(a(),Ln(),ar(),requestAnimationFrame(()=>{Ln(),ar()}),!Cn||!Mn){const s=()=>{a(),requestAnimationFrame(()=>{Ln(),ar()}),fe.removeEventListener("load",s)};fe.addEventListener("load",s)}typeof r.showModal=="function"&&(r.open||r.showModal()),r.classList.add("is-active");try{document.documentElement.classList.add("nimbi-image-preview-open")}catch{}r.focus()}function Nr(){if(nt){typeof nt.close=="function"&&nt.open&&nt.close(),nt.classList.remove("is-active");try{document.documentElement.classList.remove("nimbi-image-preview-open")}catch{}}}function Cc(e,{t,zoomStep:n=.25}={}){if(!e||!e.querySelectorAll)return;St=(d,p)=>(typeof t=="function"?t(d):void 0)||p,kn=n,e.addEventListener("click",d=>{const p=d.target;if(!p||p.tagName!=="IMG")return;const m=p;if(!m.src)return;const f=m.closest("a");f&&f.getAttribute("href")||Ec(m.src,m.alt||"",m.naturalWidth||0,m.naturalHeight||0)});let i=!1,r=0,a=0,s=0,o=0;const l=new Map;let c=0,u=1;const g=(d,p)=>{const m=d.x-p.x,f=d.y-p.y;return Math.hypot(m,f)};e.addEventListener("pointerdown",d=>{const p=d.target;if(!p||p.tagName!=="IMG")return;const m=p.closest("a");if(m&&m.getAttribute("href")||!nt||!nt.open)return;if(l.set(d.pointerId,{x:d.clientX,y:d.clientY}),l.size===2){const w=Array.from(l.values());c=g(w[0],w[1]),u=Xe;return}const f=p.closest(".nimbi-image-preview__image-wrapper");if(f&&!(Xe<=1)){d.preventDefault(),i=!0,r=d.clientX,a=d.clientY,s=f.scrollLeft,o=f.scrollTop,p.setPointerCapture(d.pointerId);try{p.classList.add("is-grabbing")}catch{}}}),e.addEventListener("pointermove",d=>{if(l.has(d.pointerId)&&l.set(d.pointerId,{x:d.clientX,y:d.clientY}),l.size===2){d.preventDefault();const _=Array.from(l.values()),b=g(_[0],_[1]);if(c>0){const A=b/c;Lt(u*A)}return}if(!i)return;d.preventDefault();const p=d.target,m=p.closest&&p.closest("a");if(m&&m.getAttribute&&m.getAttribute("href"))return;const f=p.closest(".nimbi-image-preview__image-wrapper");if(!f)return;const w=d.clientX-r,y=d.clientY-a;f.scrollLeft=s-w,f.scrollTop=o-y});const h=()=>{i=!1,l.clear(),c=0;try{const d=document.querySelector("[data-nimbi-preview-image]");d&&(d.classList.add("is-panning"),d.classList.remove("is-grabbing"))}catch{}};e.addEventListener("pointerup",h),e.addEventListener("pointercancel",h)}function Mc(e){const{contentWrap:t,navWrap:n,container:i,mountOverlay:r=null,t:a,contentBase:s,homePage:o,initialDocumentTitle:l,runHooks:c}=e||{};if(!t||!(t instanceof HTMLElement))throw new TypeError("contentWrap must be an HTMLElement");let u=null;const g=cc(a,[{path:o,name:a("home"),isIndex:!0,children:[]}]);let h=!1,d=!1;function p(b){try{if(!b)return;if(typeof b.replaceChildren=="function")return b.replaceChildren();for(;b.firstChild;)b.removeChild(b.firstChild)}catch{try{b&&(b.innerHTML="")}catch{}}}async function m(b,A){let S,E,I;try{({data:S,pagePath:E,anchor:I}=await Vo(b,s))}catch(j){const C=j&&j.message?String(j.message):"",N=(!le||typeof le!="string"||!le)&&/no page data/i.test(C);try{if(N)try{k("[nimbi-cms] fetchPageData (expected missing)",j)}catch{}else try{sr("[nimbi-cms] fetchPageData failed",j)}catch{}}catch{}try{!le&&n&&p(n)}catch{}ca(t,a,j);return}!I&&A&&(I=A);try{ei(null)}catch(j){k("[nimbi-cms] scrollToAnchorOrTop failed",j)}try{p(t)}catch{try{t.innerHTML=""}catch{}}const{article:O,parsed:W,toc:z,topH1:B,h1Text:Z,slugKey:ee}=await mc(a,S,E,I,s);Zo(a,l,W,z,O,E,I,B,Z,ee,S);try{p(n)}catch{try{n.innerHTML=""}catch{}}z&&(n.appendChild(z),kc(z));try{await c("transformHtml",{article:O,parsed:W,toc:z,pagePath:E,anchor:I,topH1:B,h1Text:Z,slugKey:ee,data:S})}catch(j){k("[nimbi-cms] transformHtml hooks failed",j)}t.appendChild(O);try{yc(O)}catch(j){k("[nimbi-cms] executeEmbeddedScripts failed",j)}try{Cc(O,{t:a})}catch(j){k("[nimbi-cms] attachImagePreview failed",j)}try{Qn(i,100,!1),requestAnimationFrame(()=>Qn(i,100,!1)),setTimeout(()=>Qn(i,100,!1),250)}catch(j){k("[nimbi-cms] setEagerForAboveFoldImages failed",j)}ei(I),xc(O,B,{mountOverlay:r,container:i,navWrap:n,t:a});try{await c("onPageLoad",{data:S,pagePath:E,anchor:I,article:O,toc:z,topH1:B,h1Text:Z,slugKey:ee,contentWrap:t,navWrap:n})}catch(j){k("[nimbi-cms] onPageLoad hooks failed",j)}u=E}async function f(){if(h){d=!0;return}h=!0;try{try{ga("renderByQuery")}catch{}try{pa("renderByQuery")}catch{}let b=Je(location.href);try{if(b&&b.type==="path"&&b.page&&s)try{const E=typeof s=="string"?new URL(s,location.href).pathname:"",I=String(E||"").replace(/^\/+|\/+$/g,""),O=String(b.page||"").replace(/^\/+|\/+$/g,"");I&&O===I&&(b.page=null)}catch{}}catch{}if(b&&b.type==="path"&&b.page)try{let E="?page="+encodeURIComponent(b.page||"");b.params&&(E+=(E.includes("?")?"&":"?")+b.params),b.anchor&&(E+="#"+encodeURIComponent(b.anchor));try{history.replaceState(history.state,"",E)}catch{try{history.replaceState({},"",E)}catch{}}b=Je(location.href)}catch{}const A=b&&b.page?b.page:o,S=b&&b.anchor?b.anchor:null;await m(A,S)}catch(b){k("[nimbi-cms] renderByQuery failed",b);try{!le&&n&&p(n)}catch{}ca(t,a,b)}finally{if(h=!1,d){d=!1;try{await f()}catch{}}}}window.addEventListener("popstate",f);const w=()=>`nimbi-cms-scroll:${location.pathname}${location.search}`,y=()=>{try{const b=i||document.querySelector(".nimbi-cms");if(!b)return;const A={top:b.scrollTop||0,left:b.scrollLeft||0};sessionStorage.setItem(w(),JSON.stringify(A))}catch(b){k("[nimbi-cms] save scroll position failed",b)}},_=()=>{try{const b=i||document.querySelector(".nimbi-cms");if(!b)return;const A=sessionStorage.getItem(w());if(!A)return;const S=JSON.parse(A);S&&typeof S.top=="number"&&b.scrollTo({top:S.top,left:S.left||0,behavior:"auto"})}catch{}};return window.addEventListener("pageshow",b=>{if(b.persisted)try{_(),Qn(i,100,!1)}catch(A){k("[nimbi-cms] bfcache restore failed",A)}}),window.addEventListener("pagehide",()=>{try{y()}catch(b){k("[nimbi-cms] save scroll position failed",b)}}),{renderByQuery:f,siteNav:g,getCurrentPagePath:()=>u}}function Lc(e){try{let t=typeof e=="string"?e:typeof window<"u"&&window.location?window.location.search:"";if(!t&&typeof window<"u"&&window.location&&window.location.hash)try{const a=Je(window.location.href);a&&a.params&&(t=a.params.startsWith("?")?a.params:"?"+a.params)}catch{t=""}if(!t)return{};const n=new URLSearchParams(t.startsWith("?")?t.slice(1):t),i={},r=a=>{if(a==null)return;const s=String(a).toLowerCase();if(s==="1"||s==="true"||s==="yes")return!0;if(s==="0"||s==="false"||s==="no")return!1};if(n.has("contentPath")&&(i.contentPath=n.get("contentPath")),n.has("searchIndex")){const a=r(n.get("searchIndex"));typeof a=="boolean"&&(i.searchIndex=a)}if(n.has("searchIndexMode")){const a=n.get("searchIndexMode");(a==="eager"||a==="lazy")&&(i.searchIndexMode=a)}if(n.has("defaultStyle")){const a=n.get("defaultStyle");(a==="light"||a==="dark"||a==="system")&&(i.defaultStyle=a)}if(n.has("bulmaCustomize")&&(i.bulmaCustomize=n.get("bulmaCustomize")),n.has("lang")&&(i.lang=n.get("lang")),n.has("l10nFile")){const a=n.get("l10nFile");i.l10nFile=a==="null"?null:a}if(n.has("cacheTtlMinutes")){const a=Number(n.get("cacheTtlMinutes"));Number.isFinite(a)&&a>=0&&(i.cacheTtlMinutes=a)}if(n.has("cacheMaxEntries")){const a=Number(n.get("cacheMaxEntries"));Number.isInteger(a)&&a>=0&&(i.cacheMaxEntries=a)}if(n.has("homePage")&&(i.homePage=n.get("homePage")),n.has("navigationPage")&&(i.navigationPage=n.get("navigationPage")),n.has("notFoundPage")){const a=n.get("notFoundPage");i.notFoundPage=a==="null"?null:a}if(n.has("availableLanguages")&&(i.availableLanguages=n.get("availableLanguages").split(",").map(a=>a.trim()).filter(Boolean)),n.has("fetchConcurrency")){const a=Number(n.get("fetchConcurrency"));Number.isInteger(a)&&a>=1&&(i.fetchConcurrency=a)}if(n.has("negativeFetchCacheTTL")){const a=Number(n.get("negativeFetchCacheTTL"));Number.isFinite(a)&&a>=0&&(i.negativeFetchCacheTTL=a)}if(n.has("indexDepth")){const a=Number(n.get("indexDepth"));Number.isInteger(a)&&(a===1||a===2||a===3)&&(i.indexDepth=a)}if(n.has("noIndexing")){const s=(n.get("noIndexing")||"").split(",").map(o=>o.trim()).filter(Boolean);s.length&&(i.noIndexing=s)}return i}catch{return{}}}function Or(e){if(typeof e!="string")return!1;const t=e.trim();if(!t||t.includes("..")||/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(t)||t.startsWith("//")||t.startsWith("/")||/^[A-Za-z]:\\/.test(t))return!1;const n=t.replace(/^\.\//,"");return!!/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*\.(md|html)$/.test(n)}function Tc(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t==="."||t==="./")return!0;if(t.includes("..")||/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(t)||t.startsWith("//")||t.startsWith("/")||/^[A-Za-z]:\\/.test(t))return!1;const n=t.replace(/^\.\//,"");return!!/^[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*\/?$/.test(n)}let Kn="";async function os(e={}){if(!e||typeof e!="object")throw new TypeError("initCMS(options): options must be an object");const t=Lc();if(t&&(t.contentPath||t.homePage||t.notFoundPage||t.navigationPage))if(e&&e.allowUrlPathOverrides===!0)try{k("[nimbi-cms] allowUrlPathOverrides enabled by host; honoring URL overrides for contentPath/homePage/notFoundPage/navigationPage")}catch{}else{try{k("[nimbi-cms] ignoring unsafe URL overrides for contentPath/homePage/notFoundPage/navigationPage")}catch{}delete t.contentPath,delete t.homePage,delete t.notFoundPage,delete t.navigationPage}const n=Object.assign({},t,e);try{if(Object.prototype.hasOwnProperty.call(n,"debugLevel"))Fi(n.debugLevel);else if(typeof globalThis<"u"&&globalThis.__nimbiCMSDebug&&typeof globalThis.__nimbiCMSDebug.debugLevel<"u")try{const z=Number(globalThis.__nimbiCMSDebug.debugLevel);Number.isFinite(z)&&Fi(Math.max(0,Math.min(3,Math.floor(z))))}catch{}}catch{}try{$t("[nimbi-cms] initCMS called",()=>({options:n}))}catch{}t&&typeof t.bulmaCustomize=="string"&&t.bulmaCustomize.trim()&&(n.bulmaCustomize=t.bulmaCustomize);let{el:i,contentPath:r="/content",crawlMaxQueue:a=1e3,searchIndex:s=!0,searchIndexMode:o="eager",indexDepth:l=1,noIndexing:c=void 0,defaultStyle:u="light",bulmaCustomize:g="none",lang:h=void 0,l10nFile:d=null,cacheTtlMinutes:p=5,cacheMaxEntries:m,markdownExtensions:f,availableLanguages:w,homePage:y=null,notFoundPage:_=null,navigationPage:b="_navigation.md",exposeSitemap:A=!0}=n;try{typeof y=="string"&&y.startsWith("./")&&(y=y.replace(/^\.\//,""))}catch{}try{typeof _=="string"&&_.startsWith("./")&&(_=_.replace(/^\.\//,""))}catch{}try{typeof b=="string"&&b.startsWith("./")&&(b=b.replace(/^[.]\//,""))}catch{}const{navbarLogo:S="favicon"}=n,{skipRootReadme:E=!1}=n,I=z=>{try{const B=document.querySelector(i);if(B&&B instanceof Element)try{const Z=document.createElement("div");Z.style.padding="1rem";try{Z.style.fontFamily="system-ui, sans-serif"}catch{}Z.style.color="#b00",Z.style.background="#fee",Z.style.border="1px solid #b00";const ee=document.createElement("strong");ee.textContent="NimbiCMS failed to initialize:",Z.appendChild(ee);try{Z.appendChild(document.createElement("br"))}catch{}const j=document.createElement("pre");try{j.style.whiteSpace="pre-wrap"}catch{}j.textContent=String(z),Z.appendChild(j);try{if(typeof B.replaceChildren=="function")B.replaceChildren(Z);else{for(;B.firstChild;)B.removeChild(B.firstChild);B.appendChild(Z)}}catch{try{B.innerHTML='<div style="padding:1rem;font-family:system-ui, sans-serif;color:#b00;background:#fee;border:1px solid #b00;"><strong>NimbiCMS failed to initialize:</strong><br><pre style="white-space:pre-wrap;">'+String(z)+"</pre></div>"}catch{}}}catch{}}catch{}};if(n.contentPath!=null&&!Tc(n.contentPath))throw new TypeError('initCMS(options): "contentPath" contains unsafe characters or patterns');if(y!=null&&!Or(y))throw new TypeError('initCMS(options): "homePage" must be a relative path (no leading "/") ending with .md or .html');if(_!=null&&!Or(_))throw new TypeError('initCMS(options): "notFoundPage" must be a relative path (no leading "/") ending with .md or .html');if(b!=null&&!Or(b))throw new TypeError('initCMS(options): "navigationPage" must be a relative path (no leading "/") ending with .md or .html');if(!i)throw new Error("el is required");let O=i;if(typeof i=="string"){if(O=document.querySelector(i),!O)throw new Error(`el selector "${i}" did not match any element`)}else if(!(i instanceof Element))throw new TypeError("el must be a CSS selector string or a DOM element");if(typeof r!="string"||!r.trim())throw new TypeError('initCMS(options): "contentPath" must be a non-empty string when provided');if(typeof s!="boolean")throw new TypeError('initCMS(options): "searchIndex" must be a boolean when provided');if(o!=null&&o!=="eager"&&o!=="lazy")throw new TypeError('initCMS(options): "searchIndexMode" must be "eager" or "lazy" when provided');if(l!=null&&l!==1&&l!==2&&l!==3)throw new TypeError('initCMS(options): "indexDepth" must be 1, 2, or 3 when provided');if(u!=="light"&&u!=="dark"&&u!=="system")throw new TypeError('initCMS(options): "defaultStyle" must be "light", "dark" or "system"');if(g!=null&&typeof g!="string")throw new TypeError('initCMS(options): "bulmaCustomize" must be a string when provided');if(h!=null&&typeof h!="string")throw new TypeError('initCMS(options): "lang" must be a string when provided');if(d!=null&&typeof d!="string")throw new TypeError('initCMS(options): "l10nFile" must be a string or null when provided');if(p!=null&&(typeof p!="number"||!Number.isFinite(p)||p<0))throw new TypeError('initCMS(options): "cacheTtlMinutes" must be a non‑negative number when provided');if(m!=null&&(typeof m!="number"||!Number.isInteger(m)||m<0))throw new TypeError('initCMS(options): "cacheMaxEntries" must be a non‑negative integer when provided');if(f!=null&&(!Array.isArray(f)||f.some(z=>!z||typeof z!="object")))throw new TypeError('initCMS(options): "markdownExtensions" must be an array of extension objects when provided');if(w!=null&&(!Array.isArray(w)||w.some(z=>typeof z!="string"||!z.trim())))throw new TypeError('initCMS(options): "availableLanguages" must be an array of non-empty strings when provided');if(c!=null&&(!Array.isArray(c)||c.some(z=>typeof z!="string"||!z.trim())))throw new TypeError('initCMS(options): "noIndexing" must be an array of non-empty strings when provided');if(E!=null&&typeof E!="boolean")throw new TypeError('initCMS(options): "skipRootReadme" must be a boolean when provided');if(n.fetchConcurrency!=null&&(typeof n.fetchConcurrency!="number"||!Number.isInteger(n.fetchConcurrency)||n.fetchConcurrency<1))throw new TypeError('initCMS(options): "fetchConcurrency" must be a positive integer when provided');if(n.negativeFetchCacheTTL!=null&&(typeof n.negativeFetchCacheTTL!="number"||!Number.isFinite(n.negativeFetchCacheTTL)||n.negativeFetchCacheTTL<0))throw new TypeError('initCMS(options): "negativeFetchCacheTTL" must be a non-negative number (ms) when provided');if(y!=null&&(typeof y!="string"||!y.trim()||!/\.(md|html)$/.test(y)))throw new TypeError('initCMS(options): "homePage" must be a non-empty string ending with .md or .html');if(_!=null&&(typeof _!="string"||!_.trim()||!/\.(md|html)$/.test(_)))throw new TypeError('initCMS(options): "notFoundPage" must be a non-empty string ending with .md or .html');const W=!!s;try{Promise.resolve().then(()=>at).then(z=>{try{z&&typeof z.setSkipRootReadme=="function"&&z.setSkipRootReadme(!!E)}catch(B){k("[nimbi-cms] setSkipRootReadme failed",B)}}).catch(z=>{})}catch(z){k("[nimbi-cms] setSkipRootReadme dynamic import failed",z)}try{try{n&&n.seoMap&&typeof n.seoMap=="object"&&Uo(n.seoMap)}catch{}try{typeof window<"u"&&(window.__nimbiRenderingErrors__||(window.__nimbiRenderingErrors__=[]),window.addEventListener("error",function(z){try{const B={type:"error",message:z&&z.message?String(z.message):"",filename:z&&z.filename?String(z.filename):"",lineno:z&&z.lineno?z.lineno:null,colno:z&&z.colno?z.colno:null,stack:z&&z.error&&z.error.stack?z.error.stack:null,time:Date.now()};try{k("[nimbi-cms] runtime error",B.message)}catch{}window.__nimbiRenderingErrors__.push(B)}catch{}}),window.addEventListener("unhandledrejection",function(z){try{const B={type:"unhandledrejection",reason:z&&z.reason?String(z.reason):"",time:Date.now()};try{k("[nimbi-cms] unhandledrejection",B.reason)}catch{}window.__nimbiRenderingErrors__.push(B)}catch{}}))}catch{}try{const z=Je(typeof window<"u"?window.location.href:""),B=z&&z.page?z.page:y||void 0;try{B&&Wo(B,Kn||"")}catch{}}catch{}await(async()=>{try{O.classList.add("nimbi-mount")}catch(M){k("[nimbi-cms] mount element setup failed",M)}const z=document.createElement("section");z.className="section";const B=document.createElement("div");B.className="container nimbi-cms";const Z=document.createElement("div");Z.className="columns";const ee=document.createElement("div");ee.className="column is-hidden-mobile is-3-tablet nimbi-nav-wrap",ee.setAttribute("role","navigation");try{const M=typeof an=="function"?an("navigation"):null;M&&ee.setAttribute("aria-label",M)}catch(M){k("[nimbi-cms] set nav aria-label failed",M)}Z.appendChild(ee);const j=document.createElement("main");j.className="column nimbi-content",j.setAttribute("role","main"),Z.appendChild(j),B.appendChild(Z),z.appendChild(B);const C=ee,N=j;O.appendChild(z);let D=null;try{D=O.querySelector(".nimbi-overlay"),D||(D=document.createElement("div"),D.className="nimbi-overlay",O.appendChild(D))}catch(M){D=null,k("[nimbi-cms] mount overlay setup failed",M)}const ie=location.pathname||"/";let he;if(ie.endsWith("/"))he=ie;else{const M=ie.substring(ie.lastIndexOf("/")+1);M&&!M.includes(".")?he=ie+"/":he=ie.substring(0,ie.lastIndexOf("/")+1)}try{Kn=document.title||""}catch(M){Kn="",k("[nimbi-cms] read initial document title failed",M)}let K=r;const Le=Object.prototype.hasOwnProperty.call(n,"contentPath"),me=typeof location<"u"&&location.origin?location.origin:"http://localhost",Se=new URL(he,me).toString();(K==="."||K==="./")&&(K="");try{K=String(K||"").replace(/\\/g,"/")}catch{K=String(K||"")}K.startsWith("/")&&(K=K.replace(/^\/+/,"")),K&&!K.endsWith("/")&&(K=K+"/");try{if(K&&he&&he!=="/"){const M=he.replace(/^\/+/,"").replace(/\/+$/,"")+"/";M&&K.startsWith(M)&&(K=K.slice(M.length))}}catch{}try{if(K)var Ee=new URL(K,Se.endsWith("/")?Se:Se+"/").toString();else var Ee=Se}catch{try{if(K)var Ee=new URL("/"+K,me).toString();else var Ee=new URL(he,me).toString()}catch{var Ee=me}}if(d&&await li(d,he),w&&Array.isArray(w)&&Aa(w),h&&ci(h),typeof p=="number"&&p>=0&&typeof Ki=="function"&&Ki(p*60*1e3),typeof m=="number"&&m>=0&&typeof Xi=="function"&&Xi(m),f&&Array.isArray(f)&&f.length)try{f.forEach(M=>{typeof M=="object"&&vi&&typeof Xr=="function"&&Xr(M)})}catch(M){k("[nimbi-cms] applying markdownExtensions failed",M)}try{typeof a=="number"&&Promise.resolve().then(()=>at).then(({setDefaultCrawlMaxQueue:M})=>{try{M(a)}catch(v){k("[nimbi-cms] setDefaultCrawlMaxQueue failed",v)}}),typeof n.fetchConcurrency=="number"&&Promise.resolve().then(()=>at).then(({setFetchConcurrency:M})=>{try{M(n.fetchConcurrency)}catch(v){k("[nimbi-cms] setFetchConcurrency failed",v)}}).catch(()=>{}),typeof n.negativeFetchCacheTTL=="number"&&Promise.resolve().then(()=>at).then(({setFetchNegativeCacheTTL:M})=>{try{M(n.negativeFetchCacheTTL)}catch(v){k("[nimbi-cms] setFetchNegativeCacheTTL failed",v)}}).catch(()=>{})}catch(M){k("[nimbi-cms] setDefaultCrawlMaxQueue import failed",M)}try{try{const M=n&&n.manifest?n.manifest:typeof globalThis<"u"&&globalThis.__NIMBI_CMS_MANIFEST__?globalThis.__NIMBI_CMS_MANIFEST__:typeof window<"u"&&window.__NIMBI_CMS_MANIFEST__?window.__NIMBI_CMS_MANIFEST__:null;if(M&&typeof M=="object")try{const v=await Promise.resolve().then(()=>at);if(v&&typeof v._setAllMd=="function"){v._setAllMd(M);try{$t("[nimbi-cms diagnostic] applied content manifest",()=>({manifestKeys:Object.keys(M).length}))}catch{}}}catch(v){k("[nimbi-cms] applying content manifest failed",v)}try{try{const v=Je(typeof window<"u"?window.location.href:"");if(v)try{if(v.type==="cosmetic")try{Jn(v)}catch{}else if(v.type==="canonical")try{Jn(v)}catch{}else if(v.type==="path")try{const U=(typeof location<"u"&&location&&location.pathname?String(location.pathname):"/").replace(/\/\/+$/,""),V=(he||"").replace(/\/\/+$/,"");let H="";try{H=new URL(Ee).pathname.replace(/\/\/+$/,"")}catch{H=""}if(U===V||U===H||U==="")try{Jn({type:"path",page:null,anchor:v.anchor||null,params:v.params||""})}catch{}}catch{}}catch{}}catch{}hi(Ee)}catch(v){k("[nimbi-cms] setContentBase failed",v)}try{try{const v=await Promise.resolve().then(()=>at);try{$t("[nimbi-cms diagnostic] after setContentBase",()=>({manifestKeys:M&&typeof M=="object"?Object.keys(M).length:0,slugToMdSize:v&&v.slugToMd&&typeof v.slugToMd.size=="number"?v.slugToMd.size:void 0,allMarkdownPathsLength:v&&Array.isArray(v.allMarkdownPaths)?v.allMarkdownPaths.length:void 0,allMarkdownPathsSetSize:v&&v.allMarkdownPathsSet&&typeof v.allMarkdownPathsSet.size=="number"?v.allMarkdownPathsSet.size:void 0,searchIndexLength:v&&Array.isArray(v.searchIndex)?v.searchIndex.length:void 0}))}catch{}}catch{}}catch{}}catch{}}catch(M){k("[nimbi-cms] setContentBase failed",M)}try{Ma(_)}catch(M){k("[nimbi-cms] setNotFoundPage failed",M)}try{typeof window<"u"&&window.__nimbiAutoAttachSitemapUI&&Promise.resolve().then(()=>Tn).then(M=>{try{M&&typeof M.attachSitemapDownloadUI=="function"&&M.attachSitemapDownloadUI(document.body,{filename:"sitemap.json"})}catch{}}).catch(()=>{})}catch{}let Fe=null,R=null;try{if(!Object.prototype.hasOwnProperty.call(n,"homePage")&&b)try{const L=[],U=[];try{b&&U.push(String(b))}catch{}try{const H=String(b||"").replace(/^_/,"");H&&H!==String(b)&&U.push(H)}catch{}try{U.push("navigation.md")}catch{}try{U.push("assets/navigation.md")}catch{}const V=[];for(const H of U)try{if(!H)continue;const $=String(H);V.includes($)||V.push($)}catch{}for(const H of V){L.push(H);try{if(R=await Be(H,Ee,{force:!0}),R&&R.raw){try{b=H}catch{}try{k("[nimbi-cms] fetched navigation candidate",H,"contentBase=",Ee)}catch{}Fe=await hn(R.raw||"");try{const $=He();if($&&Fe&&Fe.html){const q=$.parseFromString(Fe.html,"text/html").querySelector("a");if(q)try{const Q=q.getAttribute("href")||"",se=Je(Q);try{k("[nimbi-cms] parsed nav first-link href",Q,"->",se)}catch{}if(se&&se.page&&(se.type==="path"||se.type==="canonical")&&(se.page.includes(".")||se.page.includes("/"))){y=se.page;try{k("[nimbi-cms] derived homePage from navigation",y)}catch{}break}}catch{}}}catch{}}}catch{}}}catch{}try{k("[nimbi-cms] final homePage before slugManager setHomePage",y)}catch{}try{La(y)}catch(L){k("[nimbi-cms] setHomePage failed",L)}let v=!0;try{const L=Je(typeof location<"u"?location.href:"");L&&L.type==="cosmetic"&&(typeof _>"u"||_==null)&&(v=!1)}catch{}if(v&&y)try{await Be(y,Ee,{force:!0})}catch(L){throw new Error(`Required ${y} not found at ${Ee}${y}: ${L&&L.message?L.message:String(L)}`)}}catch(M){throw M}_a(u),await wa(g,he);const P=Mc({contentWrap:N,navWrap:C,container:B,mountOverlay:D,t:an,contentBase:Ee,homePage:y,initialDocumentTitle:Kn,runHooks:jr});try{if(typeof window<"u"){try{window.__nimbiUI=P}catch{}try{window.addEventListener("nimbi.coldRouteResolved",function(M){try{P&&typeof P.renderByQuery=="function"&&P.renderByQuery().catch(v=>{try{k("[nimbi-cms] renderByQuery failed for cold-route event",v)}catch{}})}catch{}})}catch{}try{const M=Array.isArray(window.__nimbiColdRouteResolved)?window.__nimbiColdRouteResolved.slice():null;if(M&&M.length){try{P.renderByQuery().catch(()=>{})}catch{}try{window.__nimbiColdRouteResolved=[]}catch{}}}catch{}}}catch{}try{const M=document.createElement("header");M.className="nimbi-site-navbar",O.insertBefore(M,z);let v=R,L=Fe;L||(v=await Be(b,Ee,{force:!0}),L=await hn(v.raw||""));const{navbar:U,linkEls:V}=await vc(M,B,L.html||"",Ee,y,an,P.renderByQuery,W,o,l,c,S);try{await jr("onNavBuild",{navWrap:C,navbar:U,linkEls:V,contentBase:Ee})}catch(H){k("[nimbi-cms] onNavBuild hooks failed",H)}try{try{if(V&&V.length){const H=await Promise.resolve().then(()=>at);for(const $ of Array.from(V||[]))try{const T=$&&$.getAttribute&&$.getAttribute("href")||"";if(!T)continue;let q=String(T||"").split(/::|#/,1)[0];if(q=String(q||"").split("?")[0],!q)continue;/\.(?:md|html?)$/.test(q)||(q=q+".html");let Q=null;try{Q=J(String(q||""))}catch{Q=String(q||"")}const se=String(Q||"").replace(/^.*\//,"").replace(/\?.*$/,"");if(!se)continue;try{let ye=null;try{H&&typeof H.slugify=="function"&&(ye=H.slugify(se.replace(/\.(?:md|html?)$/i,"")))}catch{ye=String(se||"").replace(/\s+/g,"-").toLowerCase()}if(!ye)continue;let we=ye;try{if(H&&H.slugToMd&&typeof H.slugToMd.has=="function"&&H.slugToMd.has(ye)){const pe=H.slugToMd.get(ye);let _e=!1;try{if(typeof pe=="string")pe===q&&(_e=!0);else if(pe&&typeof pe=="object"){pe.default===q&&(_e=!0);for(const ve of Object.keys(pe.langs||{}))if(pe.langs[ve]===q){_e=!0;break}}}catch{}if(!_e&&typeof H.uniqueSlug=="function")try{we=H.uniqueSlug(ye,new Set(H.slugToMd.keys()))}catch{we=ye}}}catch{}try{if(H&&typeof H._storeSlugMapping=="function")try{H._storeSlugMapping(we,Q)}catch{}else if(H&&H.slugToMd&&typeof H.slugToMd.set=="function")try{H.slugToMd.set(we,Q)}catch{}try{H&&H.mdToSlug&&typeof H.mdToSlug.set=="function"&&H.mdToSlug.set(Q,we)}catch{}try{H&&Array.isArray(H.allMarkdownPaths)&&!H.allMarkdownPaths.includes(Q)&&H.allMarkdownPaths.push(Q)}catch{}try{H&&H.allMarkdownPathsSet&&typeof H.allMarkdownPathsSet.add=="function"&&H.allMarkdownPathsSet.add(Q)}catch{}}catch{}}catch{}}catch{}try{const $=await Promise.resolve().then(()=>Rr);$&&typeof $.refreshIndexPaths=="function"&&$.refreshIndexPaths(Ee)}catch{}}}catch{}}catch{}try{let H=!1;try{const $=new URLSearchParams(location.search||"");($.has("sitemap")||$.has("rss")||$.has("atom"))&&(H=!0)}catch{}try{const T=(location.pathname||"/").replace(/\/\/+/g,"/").split("/").filter(Boolean).pop()||"";T&&/^(sitemap|sitemap\.xml|rss|rss\.xml|atom|atom\.xml)$/i.test(T)&&(H=!0)}catch{}if(H||A===!0||typeof window<"u"&&window.__nimbiExposeSitemap)try{try{const T=await Promise.resolve().then(()=>at);if(T&&typeof T.awaitSearchIndex=="function"){const q=[];y&&q.push(y),b&&q.push(b);try{await T.awaitSearchIndex({contentBase:Ee,indexDepth:Math.max(l||1,3),noIndexing:c,seedPaths:q.length?q:void 0,startBuild:!0,timeoutMs:1/0})}catch{}}}catch{}const $=await Promise.resolve().then(()=>Tn);try{if($&&typeof $.handleSitemapRequest=="function"&&await $.handleSitemapRequest({includeAllMarkdown:!0,homePage:y,navigationPage:b,notFoundPage:_,contentBase:Ee,indexDepth:l,noIndexing:c}))return}catch{}}catch{}try{Promise.resolve().then(()=>Tn).then($=>{try{if($&&typeof $.exposeSitemapGlobals=="function")try{$.exposeSitemapGlobals({includeAllMarkdown:!0,homePage:y,navigationPage:b,notFoundPage:_,contentBase:Ee,indexDepth:l,noIndexing:c,waitForIndexMs:1/0}).catch(()=>{})}catch{}}catch{}}).catch(()=>{})}catch{}}catch{}try{try{const $=await Promise.resolve().then(()=>Rr);if($&&typeof $.refreshIndexPaths=="function")try{$.refreshIndexPaths(Ee);try{try{const T=await Promise.resolve().then(()=>at);try{$t("[nimbi-cms diagnostic] after refreshIndexPaths",()=>({slugToMdSize:T&&T.slugToMd&&typeof T.slugToMd.size=="number"?T.slugToMd.size:void 0,allMarkdownPathsLength:T&&Array.isArray(T.allMarkdownPaths)?T.allMarkdownPaths.length:void 0,allMarkdownPathsSetSize:T&&T.allMarkdownPathsSet&&typeof T.allMarkdownPathsSet.size=="number"?T.allMarkdownPathsSet.size:void 0}))}catch{}}catch{}}catch{}try{const T=await Promise.resolve().then(()=>at),q=T&&T.slugToMd&&typeof T.slugToMd.size=="number"?T.slugToMd.size:0;let Q=!1;try{if(!manifest){q<30&&(Q=!0);try{const se=Je(typeof location<"u"?location.href:"");if(se){if(se.type==="cosmetic"&&se.page)try{T.slugToMd.has(se.page)||(Q=!0)}catch{}else if((se.type==="path"||se.type==="canonical")&&se.page)try{const ye=J(se.page);!(T.mdToSlug&&T.mdToSlug.has(ye))&&!(T.allMarkdownPathsSet&&T.allMarkdownPathsSet.has(ye))&&(Q=!0)}catch{}}}catch{}}}catch{}if(Q){let se=null;try{se=typeof window<"u"&&(window.__nimbiSitemapFinal||window.__nimbiResolvedIndex||window.__nimbiSearchIndex||window.__nimbiLiveSearchIndex||window.__nimbiSearchIndex)||null}catch{se=null}if(Array.isArray(se)&&se.length){let ye=0;for(const we of se)try{if(!we||!we.slug)continue;const pe=String(we.slug).split("::")[0];if(T.slugToMd.has(pe))continue;let _e=we.sourcePath||we.path||null;if(!_e&&Array.isArray(se)){const Ie=(se||[]).find(Ge=>Ge&&Ge.slug===we.slug);Ie&&Ie.path&&(_e=Ie.path)}if(!_e)continue;try{_e=String(_e)}catch{continue}let ve=null;try{const Ie=Ee&&typeof Ee=="string"?Ee:typeof location<"u"&&location.origin?location.origin+"/":"";try{const Ge=new URL(_e,Ie),Et=new URL(Ie);if(Ge.origin===Et.origin){const fn=Et.pathname||"/";let Ct=Ge.pathname||"";Ct.startsWith(fn)&&(Ct=Ct.slice(fn.length)),Ct.startsWith("/")&&(Ct=Ct.slice(1)),ve=J(Ct)}else ve=J(Ge.pathname||"")}catch{ve=J(_e)}}catch{ve=J(_e)}if(!ve)continue;ve=String(ve).split(/[?#]/)[0],ve=J(ve);try{T._storeSlugMapping(pe,ve)}catch{}ye++}catch{}if(ye){try{$t("[nimbi-cms diagnostic] populated slugToMd from sitemap/searchIndex",()=>({added:ye,total:T&&T.slugToMd&&typeof T.slugToMd.size=="number"?T.slugToMd.size:void 0}))}catch{}try{const we=await Promise.resolve().then(()=>Rr);we&&typeof we.refreshIndexPaths=="function"&&we.refreshIndexPaths(Ee)}catch{}}}}}catch{}}catch(T){k("[nimbi-cms] refreshIndexPaths after nav build failed",T)}}catch{}const H=()=>{const $=M&&M.getBoundingClientRect&&Math.round(M.getBoundingClientRect().height)||M&&M.offsetHeight||0;if($>0){try{O.style.setProperty("--nimbi-site-navbar-height",`${$}px`)}catch(T){k("[nimbi-cms] set CSS var failed",T)}try{B.style.paddingTop=""}catch(T){k("[nimbi-cms] set container paddingTop failed",T)}try{const T=O&&O.getBoundingClientRect&&Math.round(O.getBoundingClientRect().height)||O&&O.clientHeight||0;if(T>0){const q=Math.max(0,T-$);try{B.style.setProperty("--nimbi-cms-height",`${q}px`)}catch(Q){k("[nimbi-cms] set --nimbi-cms-height failed",Q)}}else try{B.style.setProperty("--nimbi-cms-height","calc(100vh - var(--nimbi-site-navbar-height))")}catch(q){k("[nimbi-cms] set --nimbi-cms-height failed",q)}}catch(T){k("[nimbi-cms] compute container height failed",T)}try{M.style.setProperty("--nimbi-site-navbar-height",`${$}px`)}catch(T){k("[nimbi-cms] set navbar CSS var failed",T)}}};H();try{if(typeof ResizeObserver<"u"){const $=new ResizeObserver(()=>H());try{$.observe(M)}catch(T){k("[nimbi-cms] ResizeObserver.observe failed",T)}}}catch($){k("[nimbi-cms] ResizeObserver setup failed",$)}}catch(H){k("[nimbi-cms] compute navbar height failed",H)}}catch(M){k("[nimbi-cms] build navigation failed",M)}try{Promise.resolve().then(()=>zc).then(({getVersion:M})=>{typeof M=="function"&&M().then(v=>{try{const L=v||"0.0.0";try{const U=$=>{const T=document.createElement("a");T.className="nimbi-version-label tag is-small",T.textContent=`nimbiCMS v. ${L}`,T.href=$||"#",T.target="_blank",T.rel="noopener noreferrer nofollow",T.setAttribute("aria-label",`nimbiCMS version ${L}`);try{ka(T)}catch{}try{O.appendChild(T)}catch(q){k("[nimbi-cms] append version label failed",q)}},V="https://abelvm.github.io/nimbiCMS/",H=(()=>{try{if(V&&typeof V=="string")return new URL(V).toString()}catch{}return"#"})();U(H)}catch(U){k("[nimbi-cms] building version label failed",U)}}catch(L){k("[nimbi-cms] building version label failed",L)}}).catch(v=>{k("[nimbi-cms] getVersion() failed",v)})}).catch(M=>{k("[nimbi-cms] import version module failed",M)})}catch(M){k("[nimbi-cms] version label setup failed",M)}})()}catch(z){throw I(z),z}}async function ls(){try{if("1.0.8".trim())return"1.0.8"}catch{}return"0.0.0"}const zc=Object.freeze(Object.defineProperty({__proto__:null,getVersion:ls},Symbol.toStringTag,{value:"Module"})),tt=jt,wn=k;function Ei(){try{if(typeof location<"u"&&location&&typeof location.pathname=="string")return String(location.origin+location.pathname.split("?")[0])}catch{}return"http://localhost/"}function De(e){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ha(e){try{return!e||typeof e!="string"?"":(e.split("/").filter(Boolean).pop()||e).replace(/\.[a-z0-9]+$/i,"").replace(/[-_]+/g," ").split(" ").map(r=>r?r.charAt(0).toUpperCase()+r.slice(1):"").join(" ").trim()}catch{return String(e)}}function Rc(e,t){try{const n=t&&t.slug?String(t.slug):null;if(!n)return null;const r={loc:e+"?page="+encodeURIComponent(n),slug:n};return t.title&&(r.title=String(t.title)),t.excerpt&&(r.excerpt=String(t.excerpt)),t.path&&(r.sourcePath=J(String(t.path))),r}catch{return null}}async function Ci(e={}){const{includeAllMarkdown:t=!0,index:n,homePage:i,navigationPage:r,notFoundPage:a}=e||{},o=Ei().split("?")[0];let l=Array.isArray(re)&&re.length?re:Array.isArray(n)?n:[];if(Array.isArray(n)&&n.length&&Array.isArray(re)&&re.length){const w=new Map;try{for(const y of n)try{y&&y.slug&&w.set(String(y.slug),y)}catch{}for(const y of re)try{y&&y.slug&&w.set(String(y.slug),y)}catch{}}catch{}l=Array.from(w.values())}const c=new Set;try{typeof a=="string"&&a.trim()&&c.add(J(String(a)))}catch{}try{typeof r=="string"&&r.trim()&&c.add(J(String(r)))}catch{}const u=new Set;try{if(typeof a=="string"&&a.trim()){const w=J(String(a));try{if(G&&typeof G.has=="function"&&G.has(w))try{u.add(G.get(w))}catch{}else try{const y=await Be(w,e&&e.contentBase?e.contentBase:void 0);if(y&&y.raw)try{let _=null;if(y.isHtml)try{const b=He();if(b){const A=b.parseFromString(y.raw,"text/html"),S=A.querySelector("h1")||A.querySelector("title");S&&S.textContent&&(_=S.textContent.trim())}else{const A=(y.raw||"").match(/<h1[^>]*>(.*?)<\/h1>|<title[^>]*>(.*?)<\/title>/i);A&&(_=(A[1]||A[2]||"").trim())}}catch{}else{const b=(y.raw||"").match(/^#\s+(.+)$/m);b&&b[1]&&(_=b[1].trim())}_&&u.add(de(_))}catch{}}catch{}}catch{}}}catch{}const g=new Set,h=[],d=new Map,p=new Map,m=w=>{try{if(!w||typeof w!="string")return!1;const y=J(String(w));try{if($e&&typeof $e.has=="function"&&$e.has(y))return!0}catch{}try{if(G&&typeof G.has=="function"&&G.has(y))return!0}catch{}try{if(p&&p.has(y))return!0}catch{}try{if(G&&typeof G.keys=="function"&&G.size)for(const _ of G.keys())try{if(J(String(_))===y)return!0}catch{}else for(const _ of Y.values())try{if(!_)continue;if(typeof _=="string"){if(J(String(_))===y)return!0}else if(_&&typeof _=="object"){if(_.default&&J(String(_.default))===y)return!0;const b=_.langs||{};for(const A of Object.keys(b||{}))try{if(b[A]&&J(String(b[A]))===y)return!0}catch{}}}catch{}}catch{}}catch{}return!1};if(Array.isArray(l)&&l.length){let w=0;for(const y of l){try{w++,await Pt(w,64)}catch{}try{if(!y||!y.slug)continue;const _=String(y.slug),b=String(_).split("::")[0];if(u.has(b))continue;const A=y.path?J(String(y.path)):null;if(A&&c.has(A))continue;const S=y.title?String(y.title):y.parentTitle?String(y.parentTitle):void 0;d.set(_,{title:S||void 0,excerpt:y.excerpt?String(y.excerpt):void 0,path:A,source:"index"}),A&&p.set(A,{title:S||void 0,excerpt:y.excerpt?String(y.excerpt):void 0,slug:_});const E=Rc(o,y);if(!E||!E.slug||g.has(E.slug))continue;if(g.add(E.slug),d.has(E.slug)){const I=d.get(E.slug);I&&I.title&&(E.title=I.title,E._titleSource="index"),I&&I.excerpt&&(E.excerpt=I.excerpt)}h.push(E)}catch{continue}}}if(t)try{let w=0;for(const[y,_]of Y.entries()){try{w++,await Pt(w,128)}catch{}try{if(!y)continue;const b=String(y).split("::")[0];if(g.has(y)||u.has(b))continue;let A=null;if(typeof _=="string"?A=J(String(_)):_&&typeof _=="object"&&(A=J(String(_.default||""))),A&&c.has(A))continue;const E={loc:o+"?page="+encodeURIComponent(y),slug:y};if(d.has(y)){const I=d.get(y);I&&I.title&&(E.title=I.title,E._titleSource="index"),I&&I.excerpt&&(E.excerpt=I.excerpt)}else if(A){const I=p.get(A);I&&I.title&&(E.title=I.title,E._titleSource="path",!E.excerpt&&I.excerpt&&(E.excerpt=I.excerpt))}if(g.add(y),typeof y=="string"){const I=y.indexOf("/")!==-1||/\.(md|html?)$/i.test(y),O=E.title&&typeof E.title=="string"&&(E.title.indexOf("/")!==-1||/\.(md|html?)$/i.test(E.title));(!E.title||O||I)&&(E.title=ha(y),E._titleSource="humanize")}h.push(E)}catch{}}try{if(i&&typeof i=="string"){const y=J(String(i));let _=null;try{G&&G.has(y)&&(_=G.get(y))}catch{}_||(_=y);const b=String(_).split("::")[0];if(!g.has(_)&&!c.has(y)&&!u.has(b)){const A={loc:o+"?page="+encodeURIComponent(_),slug:_};if(d.has(_)){const S=d.get(_);S&&S.title&&(A.title=S.title,A._titleSource="index"),S&&S.excerpt&&(A.excerpt=S.excerpt)}g.add(_),h.push(A)}}}catch{}}catch{}try{const w=new Set,y=new Set(h.map(E=>String(E&&E.slug?E.slug:""))),_=new Set;for(const E of h)try{E&&E.sourcePath&&_.add(String(E.sourcePath))}catch{}const b=30;let A=0,S=0;for(const E of _){try{S++,await Pt(S,8)}catch{}if(A>=b)break;try{if(!E||typeof E!="string"||!m(E))continue;A+=1;const I=await Be(E,e&&e.contentBase?e.contentBase:void 0);if(!I||!I.raw||I&&typeof I.status=="number"&&I.status===404)continue;const O=I.raw,W=(function(j){try{return String(j||"")}catch{return""}})(O),z=[],B=/\[[^\]]+\]\(([^)]+)\)/g;let Z;for(;Z=B.exec(W);)try{Z&&Z[1]&&z.push(Z[1])}catch{}const ee=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/gi;for(;Z=ee.exec(W);)try{Z&&Z[1]&&z.push(Z[1])}catch{}for(const j of z)try{if(!j)continue;if(j.indexOf("?")!==-1||j.indexOf("=")!==-1)try{const D=new URL(j,o).searchParams.get("page");if(D){const ie=String(D);!y.has(ie)&&!w.has(ie)&&(w.add(ie),h.push({loc:o+"?page="+encodeURIComponent(ie),slug:ie}));continue}}catch{}let C=String(j).split(/[?#]/)[0];if(C=C.replace(/^\.\//,"").replace(/^\//,""),!C||!/\.(md|html?)$/i.test(C))continue;try{const N=J(C);if(G&&G.has(N)){const D=G.get(N),ie=String(D).split("::")[0];D&&!y.has(D)&&!w.has(D)&&!u.has(ie)&&!c.has(N)&&(w.add(D),h.push({loc:o+"?page="+encodeURIComponent(D),slug:D,sourcePath:N}));continue}try{if(!m(N))continue;const D=await Be(N,e&&e.contentBase?e.contentBase:void 0);if(D&&typeof D.status=="number"&&D.status===404)continue;if(D&&D.raw){const ie=(D.raw||"").match(/^#\s+(.+)$/m),he=ie&&ie[1]?ie[1].trim():"",K=de(he||N),Le=String(K).split("::")[0];K&&!y.has(K)&&!w.has(K)&&!u.has(Le)&&(w.add(K),h.push({loc:o+"?page="+encodeURIComponent(K),slug:K,sourcePath:N,title:he||void 0}))}}catch{}}catch{}}catch{}}catch{}}}catch{}try{const w=new Map;let y=0;for(const b of h){try{y++,await Pt(y,128)}catch{}try{if(!b||!b.slug)continue;w.set(String(b.slug),b)}catch{}}const _=new Set;for(const b of h)try{if(!b||!b.slug)continue;const A=String(b.slug),S=A.split("::")[0];if(!S)continue;A!==S&&!w.has(S)&&_.add(S)}catch{}for(const b of _)try{let A=null;if(d.has(b)){const S=d.get(b);A={loc:o+"?page="+encodeURIComponent(b),slug:b},S&&S.title&&(A.title=S.title,A._titleSource="index"),S&&S.excerpt&&(A.excerpt=S.excerpt),S&&S.path&&(A.sourcePath=S.path)}else if(p&&Y&&Y.has(b)){const S=Y.get(b);let E=null;if(typeof S=="string"?E=J(String(S)):S&&typeof S=="object"&&(E=J(String(S.default||""))),A={loc:o+"?page="+encodeURIComponent(b),slug:b},E&&p.has(E)){const I=p.get(E);I&&I.title&&(A.title=I.title,A._titleSource="path"),I&&I.excerpt&&(A.excerpt=I.excerpt),A.sourcePath=E}}A||(A={loc:o+"?page="+encodeURIComponent(b),slug:b,title:ha(b)},A._titleSource="humanize"),w.has(b)||(h.push(A),w.set(b,A))}catch{}}catch{}const f=[];try{const w=new Set;let y=0;for(const _ of h){try{y++,await Pt(y,128)}catch{}try{if(!_||!_.slug)continue;const b=String(_.slug),A=String(b).split("::")[0];if(u.has(A)||b.indexOf("::")!==-1||w.has(b))continue;w.add(b),f.push(_)}catch{}}}catch{}try{try{tt(()=>"[runtimeSitemap] generateSitemapJson finalEntries.titleSource: "+JSON.stringify(f.map(w=>({slug:w.slug,title:w.title,titleSource:w._titleSource||null})),null,2))}catch{}}catch{}try{let y=0;const _=f.length,b=Array.from({length:Math.min(4,_)}).map(async()=>{for(;;){const A=y++;if(A>=_)break;const S=f[A];try{if(!S||!S.slug)continue;const E=String(S.slug).split("::")[0];if(u.has(E)||S._titleSource==="index")continue;let I=null;try{if(Y&&Y.has(S.slug)){const O=Y.get(S.slug);typeof O=="string"?I=J(String(O)):O&&typeof O=="object"&&(I=J(String(O.default||"")))}!I&&S.sourcePath&&(I=S.sourcePath)}catch{continue}if(!I||c.has(I)||!m(I))continue;try{const O=await Be(I,e&&e.contentBase?e.contentBase:void 0);if(!O||!O.raw||O&&typeof O.status=="number"&&O.status===404)continue;if(O&&O.raw){const W=(O.raw||"").match(/^#\s+(.+)$/m),z=W&&W[1]?W[1].trim():"";z&&(S.title=z,S._titleSource="fetched")}}catch(O){tt("[runtimeSitemap] fetch title failed for",I,O)}}catch(E){tt("[runtimeSitemap] worker loop failure",E)}}});await Promise.all(b)}catch(w){tt("[runtimeSitemap] title enrichment failed",w)}return{generatedAt:new Date().toISOString(),entries:f}}function ti(e){const t=e&&Array.isArray(e.entries)?e.entries:Array.isArray(e)?e:[];let n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2189
2192
|
`;n+=`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
2190
2193
|
`;for(const i of t)try{n+=` <url>
|
|
2191
2194
|
`,n+=` <loc>${De(String(i.loc||""))}</loc>
|
|
2192
2195
|
`,n+=` </url>
|
|
2193
2196
|
`}catch{}return n+=`</urlset>
|
|
2194
|
-
`,n}function
|
|
2197
|
+
`,n}function ni(e){const t=e&&Array.isArray(e.entries)?e.entries:Array.isArray(e)?e:[],n=Ei().split("?")[0];let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2195
2198
|
`;i+=`<rss version="2.0">
|
|
2196
2199
|
`,i+=`<channel>
|
|
2197
2200
|
`,i+=`<title>${De("Sitemap RSS")}</title>
|
|
@@ -2206,7 +2209,7 @@ export async function handleAnchorWorkerMessage(msg) {
|
|
|
2206
2209
|
`,i+=`</item>
|
|
2207
2210
|
`}catch{}return i+=`</channel>
|
|
2208
2211
|
`,i+=`</rss>
|
|
2209
|
-
`,i}function
|
|
2212
|
+
`,i}function ri(e){const t=e&&Array.isArray(e.entries)?e.entries:Array.isArray(e)?e:[],n=Ei().split("?")[0],i=e&&e.generatedAt?new Date(e.generatedAt).toISOString():new Date().toISOString();let r=`<?xml version="1.0" encoding="utf-8"?>
|
|
2210
2213
|
`;r+=`<feed xmlns="http://www.w3.org/2005/Atom">
|
|
2211
2214
|
`,r+=`<title>${De("Sitemap Atom")}</title>
|
|
2212
2215
|
`,r+=`<link href="${De(n)}" />
|
|
@@ -2220,4 +2223,4 @@ export async function handleAnchorWorkerMessage(msg) {
|
|
|
2220
2223
|
`,r+=`<updated>${De(o)}</updated>
|
|
2221
2224
|
`,r+=`</entry>
|
|
2222
2225
|
`}catch{}return r+=`</feed>
|
|
2223
|
-
`,r}function la(e,t="application/xml"){try{try{document.open(t,"replace")}catch{try{document.open()}catch{}}document.write(e),document.close();try{if(typeof Blob<"u"&&typeof URL<"u"&&URL.createObjectURL){const n=new Blob([e],{type:t}),i=URL.createObjectURL(n);try{location.href=i}catch{try{window.open(i,"_self")}catch{}}setTimeout(()=>{try{URL.revokeObjectURL(i)}catch{}},5e3)}}catch{}}catch{try{try{const i=document.createElement("pre");try{i.textContent=De(e)}catch{try{i.textContent=String(e)}catch{}}if(document&&document.body)try{if(typeof document.body.replaceChildren=="function")document.body.replaceChildren(i);else{for(;document.body.firstChild;)document.body.removeChild(document.body.firstChild);document.body.appendChild(i)}}catch{try{document.body.innerHTML="<pre>"+De(e)+"</pre>"}catch{}}}catch{}}catch{}}}function ca(e){try{const t=e&&Array.isArray(e.entries)?e.entries:Array.isArray(e)?e:[];let n='<!doctype html><html><head><meta charset="utf-8"><title>Sitemap</title></head><body>';n+="<h1>Sitemap</h1><ul>";for(const i of t)try{n+=`<li><a href="${De(String(i&&i.loc?i.loc:""))}">${De(String(i&&(i.title||i.slug)||i&&i.loc||""))}</a></li>`}catch{}return n+="</ul></body></html>",n}catch{return"<!doctype html><html><body><pre>failed to render sitemap</pre></body></html>"}}function Xn(e,t="application/xml"){try{if(typeof window>"u"){try{let i=null;t==="application/rss+xml"?i=Kr(e):t==="application/atom+xml"?i=Vr(e):t==="text/html"?i=ca(e):i=Qr(e),la(i,t);try{typeof window<"u"&&(window.__nimbiSitemapRenderedAt=Date.now(),window.__nimbiSitemapJson=e,window.__nimbiSitemapFinal=e.entries||[])}catch{}}catch{}return}const n=Array.isArray(e&&e.entries)?e.entries.length:0;try{const i=window.__nimbiSitemapPendingWrite||null;if((!i||typeof i.len=="number"&&i.len<n)&&(window.__nimbiSitemapPendingWrite={finalJson:e,mimeType:t,len:n}),window.__nimbiSitemapWriteTimer)return;window.__nimbiSitemapWriteTimer=setTimeout(()=>{try{const r=window.__nimbiSitemapPendingWrite;if(!r)return;let a=null;r.mimeType==="application/rss+xml"?a=Kr(r.finalJson):r.mimeType==="application/atom+xml"?a=Vr(r.finalJson):r.mimeType==="text/html"?a=ca(r.finalJson):a=Qr(r.finalJson);try{la(a,r.mimeType)}catch{}try{window.__nimbiSitemapRenderedAt=Date.now(),window.__nimbiSitemapJson=r.finalJson,window.__nimbiSitemapFinal=r.finalJson.entries||[]}catch{}}catch{}try{clearTimeout(window.__nimbiSitemapWriteTimer)}catch{}window.__nimbiSitemapWriteTimer=null,window.__nimbiSitemapPendingWrite=null},40)}catch{}}catch{}}async function Lc(e={}){try{if(typeof document>"u"||typeof location>"u")return!1;let t=!1,n=!1,i=!1,r=!1;try{const u=new URLSearchParams(location.search||"");if(u.has("sitemap")){let g=!0;for(const h of u.keys())h!=="sitemap"&&(g=!1);g&&(t=!0)}if(u.has("rss")){let g=!0;for(const h of u.keys())h!=="rss"&&(g=!1);g&&(n=!0)}if(u.has("atom")){let g=!0;for(const h of u.keys())h!=="atom"&&(g=!1);g&&(i=!0)}}catch{}if(!t&&!n&&!i){const g=(location.pathname||"/").replace(/\/\/+/g,"/").split("/").filter(Boolean).pop()||"";if(!g||(t=/^(sitemap|sitemap\.xml)$/i.test(g),n=/^(rss|rss\.xml)$/i.test(g),i=/^(atom|atom\.xml)$/i.test(g),r=/^(sitemap|sitemap\.html)$/i.test(g),!t&&!n&&!i&&!r))return!1}let a=[];const s=typeof e.waitForIndexMs=="number"?e.waitForIndexMs:1/0;try{if(typeof Ot=="function")try{const u=await Ot({timeoutMs:s,contentBase:e&&e.contentBase,indexDepth:e&&e.indexDepth,noIndexing:e&&e.noIndexing,startBuild:!0});if(Array.isArray(u)&&u.length)if(Array.isArray(e.index)&&e.index.length){const g=new Map;try{for(const h of e.index)try{h&&h.slug&&g.set(String(h.slug),h)}catch{}for(const h of u)try{h&&h.slug&&g.set(String(h.slug),h)}catch{}}catch{}a=Array.from(g.values())}else a=u;else a=Array.isArray(e.index)&&e.index.length?e.index:Array.isArray(re)&&re.length?re:[]}catch{a=Array.isArray(e.index)&&e.index.length?e.index:Array.isArray(re)&&re.length?re:[]}else a=Array.isArray(re)&&re.length?re:Array.isArray(e.index)&&e.index.length?e.index:[]}catch{a=Array.isArray(e.index)&&e.index.length?e.index:Array.isArray(re)&&re.length?re:[]}try{if(Array.isArray(e.index)&&e.index.length)try{const u=new Map;for(const g of e.index)try{if(!g||!g.slug)continue;const h=String(g.slug).split("::")[0];if(!u.has(h))u.set(h,g);else{const d=u.get(h);d&&String(d.slug||"").indexOf("::")!==-1&&String(g.slug||"").indexOf("::")===-1&&u.set(h,g)}}catch{}try{et(()=>"[runtimeSitemap] providedIndex.dedupedByBase: "+JSON.stringify(Array.from(u.values()),null,2))}catch{et(()=>"[runtimeSitemap] providedIndex.dedupedByBase (count): "+String(u.size))}}catch(u){bn("[runtimeSitemap] logging provided index failed",u)}}catch{}if((!Array.isArray(a)||!a.length)&&typeof Wt=="function")try{const u=typeof e.waitForIndexMs=="number"?e.waitForIndexMs:1/0;let g=null;try{typeof Ot=="function"&&(g=await Ot({timeoutMs:u,contentBase:e&&e.contentBase,indexDepth:e&&e.indexDepth,noIndexing:e&&e.noIndexing,startBuild:!0}))}catch{g=null}if(Array.isArray(g)&&g.length)a=g;else{const h=typeof e.indexDepth=="number"?e.indexDepth:3,d=Array.isArray(e.noIndexing)?e.noIndexing:void 0,p=[];e&&e.homePage&&p.push(e.homePage),e&&e.navigationPage&&p.push(e.navigationPage),a=await Wt(e&&e.contentBase?e.contentBase:void 0,h,d,p.length?p:void 0)}}catch(u){bn("[runtimeSitemap] rebuild index failed",u),a=Array.isArray(re)&&re.length?re:[]}try{const u=Array.isArray(a)?a.length:0;try{et(()=>"[runtimeSitemap] usedIndex.full.length (before rebuild): "+String(u))}catch{}try{et(()=>"[runtimeSitemap] usedIndex.full (before rebuild): "+JSON.stringify(a,null,2))}catch{}}catch{}try{const u=[];e&&e.homePage&&u.push(e.homePage),e&&e.navigationPage&&u.push(e.navigationPage);const g=typeof e.indexDepth=="number"?e.indexDepth:3,h=Array.isArray(e.noIndexing)?e.noIndexing:void 0;let d=null;try{const p=typeof globalThis<"u"&&typeof globalThis.buildSearchIndexWorker=="function"?globalThis.buildSearchIndexWorker:void 0;if(typeof p=="function")try{d=await p(e&&e.contentBase?e.contentBase:void 0,g,h)}catch{d=null}}catch{d=null}if((!d||!d.length)&&typeof Wt=="function")try{d=await Wt(e&&e.contentBase?e.contentBase:void 0,g,h,u.length?u:void 0)}catch{d=null}if(Array.isArray(d)&&d.length){const p=new Map;try{for(const m of a)try{m&&m.slug&&p.set(String(m.slug),m)}catch{}for(const m of d)try{m&&m.slug&&p.set(String(m.slug),m)}catch{}}catch{}a=Array.from(p.values())}}catch(u){try{bn("[runtimeSitemap] rebuild index call failed",u)}catch{}}try{const u=Array.isArray(a)?a.length:0;try{et(()=>"[runtimeSitemap] usedIndex.full.length (after rebuild): "+String(u))}catch{}try{et(()=>"[runtimeSitemap] usedIndex.full (after rebuild): "+JSON.stringify(a,null,2))}catch{}}catch{}const o=await xi(Object.assign({},e,{index:a}));let l=[];try{const u=new Set,g=Array.isArray(o&&o.entries)?o.entries:[];for(const h of g)try{let d=null;if(h&&h.slug)d=String(h.slug);else if(h&&h.loc)try{d=new URL(String(h.loc)).searchParams.get("page")}catch{}if(!d)continue;const p=String(d).split("::")[0];if(!u.has(p)){u.add(p);const m=Object.assign({},h);m.baseSlug=p,l.push(m)}}catch{}try{et(()=>"[runtimeSitemap] finalEntries.dedupedByBase: "+JSON.stringify(l,null,2))}catch{et(()=>"[runtimeSitemap] finalEntries.dedupedByBase (count): "+String(l.length))}}catch{try{l=Array.isArray(o&&o.entries)?o.entries.slice(0):[]}catch{l=[]}}const c=Object.assign({},o||{},{entries:Array.isArray(l)?l:Array.isArray(o&&o.entries)?o.entries:[]});try{if(typeof window<"u")try{window.__nimbiSitemapJson=c,window.__nimbiSitemapFinal=l}catch{}}catch{}if(n){const u=Array.isArray(c&&c.entries)?c.entries.length:0;let g=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(g=window.__nimbiSitemapFinal.length)}catch{}if(g>u){try{et("[runtimeSitemap] skip RSS write: existing rendered sitemap larger",g,u)}catch{}return!0}return Xn(c,"application/rss+xml"),!0}if(i){const u=Array.isArray(c&&c.entries)?c.entries.length:0;let g=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(g=window.__nimbiSitemapFinal.length)}catch{}if(g>u){try{et("[runtimeSitemap] skip Atom write: existing rendered sitemap larger",g,u)}catch{}return!0}return Xn(c,"application/atom+xml"),!0}if(t){const u=Array.isArray(c&&c.entries)?c.entries.length:0;let g=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(g=window.__nimbiSitemapFinal.length)}catch{}if(g>u){try{et("[runtimeSitemap] skip XML write: existing rendered sitemap larger",g,u)}catch{}return!0}return Xn(c,"application/xml"),!0}if(r)try{const g=(Array.isArray(c&&c.entries)?c.entries:[]).length;let h=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(h=window.__nimbiSitemapFinal.length)}catch{}if(h>g){try{et("[runtimeSitemap] skip HTML write: existing rendered sitemap larger",h,g)}catch{}return!0}return Xn(c,"text/html"),!0}catch(u){return bn("[runtimeSitemap] render HTML failed",u),!1}return!1}catch(t){return bn("[runtimeSitemap] handleSitemapRequest failed",t),!1}}async function Tc(e={}){try{const t=typeof e.waitForIndexMs=="number"?e.waitForIndexMs:1/0;let n=[];try{if(typeof Ot=="function")try{const s=await Ot({timeoutMs:t,contentBase:e&&e.contentBase,indexDepth:e&&e.indexDepth,noIndexing:e&&e.noIndexing,startBuild:!0});Array.isArray(s)&&s.length&&(n=s)}catch{}}catch{}(!Array.isArray(n)||!n.length)&&Array.isArray(re)&&re.length&&(n=re),(!Array.isArray(n)||!n.length)&&Array.isArray(e.index)&&e.index.length&&(n=e.index);const i=await xi(Object.assign({},e,{index:n}));let r=[];try{const s=new Set,o=Array.isArray(i&&i.entries)?i.entries:[];for(const l of o)try{let c=null;if(l&&l.slug)c=String(l.slug);else if(l&&l.loc)try{c=new URL(String(l.loc)).searchParams.get("page")}catch{c=null}if(!c)continue;const u=String(c).split("::")[0];if(!s.has(u)){s.add(u);const g=Object.assign({},l);g.baseSlug=u,r.push(g)}}catch{}}catch{try{r=Array.isArray(i&&i.entries)?i.entries.slice(0):[]}catch{r=[]}}const a=Object.assign({},i||{},{entries:Array.isArray(r)?r:Array.isArray(i&&i.entries)?i.entries:[]});try{if(typeof window<"u")try{window.__nimbiSitemapJson=a,window.__nimbiSitemapFinal=r}catch{}}catch{}return{json:a,deduped:r}}catch{return null}}const Ln=Object.freeze(Object.defineProperty({__proto__:null,exposeSitemapGlobals:Tc,generateAtomXml:Vr,generateRssXml:Kr,generateSitemapJson:xi,generateSitemapXml:Qr,handleSitemapRequest:Lc},Symbol.toStringTag,{value:"Module"}));exports.BAD_LANGUAGES=ei;exports.SUPPORTED_HLJS_MAP=Ae;exports._clearHooks=qs;exports.addHook=hr;exports.default=ns;exports.ensureBulma=pa;exports.getVersion=rs;exports.initCMS=ns;exports.loadL10nFile=ni;exports.loadSupportedLanguages=ti;exports.observeCodeBlocks=ga;exports.onNavBuild=Bs;exports.onPageLoad=Os;exports.registerLanguage=on;exports.runHooks=Ir;exports.setHighlightTheme=Qs;exports.setLang=ri;exports.setStyle=ma;exports.setThemeVars=Vs;exports.t=nn;exports.transformHtml=js;
|
|
2226
|
+
`,r}function da(e,t="application/xml"){try{try{document.open(t,"replace")}catch{try{document.open()}catch{}}document.write(e),document.close();try{if(typeof Blob<"u"&&typeof URL<"u"&&URL.createObjectURL){const n=new Blob([e],{type:t}),i=URL.createObjectURL(n);try{location.href=i}catch{try{window.open(i,"_self")}catch{}}setTimeout(()=>{try{URL.revokeObjectURL(i)}catch{}},5e3)}}catch{}}catch{try{try{const i=document.createElement("pre");try{i.textContent=De(e)}catch{try{i.textContent=String(e)}catch{}}if(document&&document.body)try{if(typeof document.body.replaceChildren=="function")document.body.replaceChildren(i);else{for(;document.body.firstChild;)document.body.removeChild(document.body.firstChild);document.body.appendChild(i)}}catch{try{document.body.innerHTML="<pre>"+De(e)+"</pre>"}catch{}}}catch{}}catch{}}}function fa(e){try{const t=e&&Array.isArray(e.entries)?e.entries:Array.isArray(e)?e:[];let n='<!doctype html><html><head><meta charset="utf-8"><title>Sitemap</title></head><body>';n+="<h1>Sitemap</h1><ul>";for(const i of t)try{n+=`<li><a href="${De(String(i&&i.loc?i.loc:""))}">${De(String(i&&(i.title||i.slug)||i&&i.loc||""))}</a></li>`}catch{}return n+="</ul></body></html>",n}catch{return"<!doctype html><html><body><pre>failed to render sitemap</pre></body></html>"}}function Vn(e,t="application/xml"){try{if(typeof window>"u"){try{let i=null;t==="application/rss+xml"?i=ni(e):t==="application/atom+xml"?i=ri(e):t==="text/html"?i=fa(e):i=ti(e),da(i,t);try{typeof window<"u"&&(window.__nimbiSitemapRenderedAt=Date.now(),window.__nimbiSitemapJson=e,window.__nimbiSitemapFinal=e.entries||[])}catch{}}catch{}return}const n=Array.isArray(e&&e.entries)?e.entries.length:0;try{const i=window.__nimbiSitemapPendingWrite||null;if((!i||typeof i.len=="number"&&i.len<n)&&(window.__nimbiSitemapPendingWrite={finalJson:e,mimeType:t,len:n}),window.__nimbiSitemapWriteTimer)return;window.__nimbiSitemapWriteTimer=setTimeout(()=>{try{const r=window.__nimbiSitemapPendingWrite;if(!r)return;let a=null;r.mimeType==="application/rss+xml"?a=ni(r.finalJson):r.mimeType==="application/atom+xml"?a=ri(r.finalJson):r.mimeType==="text/html"?a=fa(r.finalJson):a=ti(r.finalJson);try{da(a,r.mimeType)}catch{}try{window.__nimbiSitemapRenderedAt=Date.now(),window.__nimbiSitemapJson=r.finalJson,window.__nimbiSitemapFinal=r.finalJson.entries||[]}catch{}}catch{}try{clearTimeout(window.__nimbiSitemapWriteTimer)}catch{}window.__nimbiSitemapWriteTimer=null,window.__nimbiSitemapPendingWrite=null},40)}catch{}}catch{}}async function $c(e={}){try{if(typeof document>"u"||typeof location>"u")return!1;let t=!1,n=!1,i=!1,r=!1;try{const u=new URLSearchParams(location.search||"");if(u.has("sitemap")){let g=!0;for(const h of u.keys())h!=="sitemap"&&(g=!1);g&&(t=!0)}if(u.has("rss")){let g=!0;for(const h of u.keys())h!=="rss"&&(g=!1);g&&(n=!0)}if(u.has("atom")){let g=!0;for(const h of u.keys())h!=="atom"&&(g=!1);g&&(i=!0)}}catch{}if(!t&&!n&&!i){const g=(location.pathname||"/").replace(/\/\/+/g,"/").split("/").filter(Boolean).pop()||"";if(!g||(t=/^(sitemap|sitemap\.xml)$/i.test(g),n=/^(rss|rss\.xml)$/i.test(g),i=/^(atom|atom\.xml)$/i.test(g),r=/^(sitemap|sitemap\.html)$/i.test(g),!t&&!n&&!i&&!r))return!1}let a=[];const s=typeof e.waitForIndexMs=="number"?e.waitForIndexMs:1/0;try{if(typeof Bt=="function")try{const u=await Bt({timeoutMs:s,contentBase:e&&e.contentBase,indexDepth:e&&e.indexDepth,noIndexing:e&&e.noIndexing,startBuild:!0});if(Array.isArray(u)&&u.length)if(Array.isArray(e.index)&&e.index.length){const g=new Map;try{for(const h of e.index)try{h&&h.slug&&g.set(String(h.slug),h)}catch{}for(const h of u)try{h&&h.slug&&g.set(String(h.slug),h)}catch{}}catch{}a=Array.from(g.values())}else a=u;else a=Array.isArray(e.index)&&e.index.length?e.index:Array.isArray(re)&&re.length?re:[]}catch{a=Array.isArray(e.index)&&e.index.length?e.index:Array.isArray(re)&&re.length?re:[]}else a=Array.isArray(re)&&re.length?re:Array.isArray(e.index)&&e.index.length?e.index:[]}catch{a=Array.isArray(e.index)&&e.index.length?e.index:Array.isArray(re)&&re.length?re:[]}try{if(Array.isArray(e.index)&&e.index.length)try{const u=new Map;for(const g of e.index)try{if(!g||!g.slug)continue;const h=String(g.slug).split("::")[0];if(!u.has(h))u.set(h,g);else{const d=u.get(h);d&&String(d.slug||"").indexOf("::")!==-1&&String(g.slug||"").indexOf("::")===-1&&u.set(h,g)}}catch{}try{tt(()=>"[runtimeSitemap] providedIndex.dedupedByBase: "+JSON.stringify(Array.from(u.values()),null,2))}catch{tt(()=>"[runtimeSitemap] providedIndex.dedupedByBase (count): "+String(u.size))}}catch(u){wn("[runtimeSitemap] logging provided index failed",u)}}catch{}if((!Array.isArray(a)||!a.length)&&typeof Zt=="function")try{const u=typeof e.waitForIndexMs=="number"?e.waitForIndexMs:1/0;let g=null;try{typeof Bt=="function"&&(g=await Bt({timeoutMs:u,contentBase:e&&e.contentBase,indexDepth:e&&e.indexDepth,noIndexing:e&&e.noIndexing,startBuild:!0}))}catch{g=null}if(Array.isArray(g)&&g.length)a=g;else{const h=typeof e.indexDepth=="number"?e.indexDepth:3,d=Array.isArray(e.noIndexing)?e.noIndexing:void 0,p=[];e&&e.homePage&&p.push(e.homePage),e&&e.navigationPage&&p.push(e.navigationPage),a=await Zt(e&&e.contentBase?e.contentBase:void 0,h,d,p.length?p:void 0)}}catch(u){wn("[runtimeSitemap] rebuild index failed",u),a=Array.isArray(re)&&re.length?re:[]}try{const u=Array.isArray(a)?a.length:0;try{tt(()=>"[runtimeSitemap] usedIndex.full.length (before rebuild): "+String(u))}catch{}try{tt(()=>"[runtimeSitemap] usedIndex.full (before rebuild): "+JSON.stringify(a,null,2))}catch{}}catch{}try{const u=[];e&&e.homePage&&u.push(e.homePage),e&&e.navigationPage&&u.push(e.navigationPage);const g=typeof e.indexDepth=="number"?e.indexDepth:3,h=Array.isArray(e.noIndexing)?e.noIndexing:void 0;let d=null;try{const p=typeof globalThis<"u"&&typeof globalThis.buildSearchIndexWorker=="function"?globalThis.buildSearchIndexWorker:void 0;if(typeof p=="function")try{d=await p(e&&e.contentBase?e.contentBase:void 0,g,h)}catch{d=null}}catch{d=null}if((!d||!d.length)&&typeof Zt=="function")try{d=await Zt(e&&e.contentBase?e.contentBase:void 0,g,h,u.length?u:void 0)}catch{d=null}if(Array.isArray(d)&&d.length){const p=new Map;try{for(const m of a)try{m&&m.slug&&p.set(String(m.slug),m)}catch{}for(const m of d)try{m&&m.slug&&p.set(String(m.slug),m)}catch{}}catch{}a=Array.from(p.values())}}catch(u){try{wn("[runtimeSitemap] rebuild index call failed",u)}catch{}}try{const u=Array.isArray(a)?a.length:0;try{tt(()=>"[runtimeSitemap] usedIndex.full.length (after rebuild): "+String(u))}catch{}try{tt(()=>"[runtimeSitemap] usedIndex.full (after rebuild): "+JSON.stringify(a,null,2))}catch{}}catch{}const o=await Ci(Object.assign({},e,{index:a}));let l=[];try{const u=new Set,g=Array.isArray(o&&o.entries)?o.entries:[];for(const h of g)try{let d=null;if(h&&h.slug)d=String(h.slug);else if(h&&h.loc)try{d=new URL(String(h.loc)).searchParams.get("page")}catch{}if(!d)continue;const p=String(d).split("::")[0];if(!u.has(p)){u.add(p);const m=Object.assign({},h);m.baseSlug=p,l.push(m)}}catch{}try{tt(()=>"[runtimeSitemap] finalEntries.dedupedByBase: "+JSON.stringify(l,null,2))}catch{tt(()=>"[runtimeSitemap] finalEntries.dedupedByBase (count): "+String(l.length))}}catch{try{l=Array.isArray(o&&o.entries)?o.entries.slice(0):[]}catch{l=[]}}const c=Object.assign({},o||{},{entries:Array.isArray(l)?l:Array.isArray(o&&o.entries)?o.entries:[]});try{if(typeof window<"u")try{window.__nimbiSitemapJson=c,window.__nimbiSitemapFinal=l}catch{}}catch{}if(n){const u=Array.isArray(c&&c.entries)?c.entries.length:0;let g=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(g=window.__nimbiSitemapFinal.length)}catch{}if(g>u){try{tt("[runtimeSitemap] skip RSS write: existing rendered sitemap larger",g,u)}catch{}return!0}return Vn(c,"application/rss+xml"),!0}if(i){const u=Array.isArray(c&&c.entries)?c.entries.length:0;let g=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(g=window.__nimbiSitemapFinal.length)}catch{}if(g>u){try{tt("[runtimeSitemap] skip Atom write: existing rendered sitemap larger",g,u)}catch{}return!0}return Vn(c,"application/atom+xml"),!0}if(t){const u=Array.isArray(c&&c.entries)?c.entries.length:0;let g=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(g=window.__nimbiSitemapFinal.length)}catch{}if(g>u){try{tt("[runtimeSitemap] skip XML write: existing rendered sitemap larger",g,u)}catch{}return!0}return Vn(c,"application/xml"),!0}if(r)try{const g=(Array.isArray(c&&c.entries)?c.entries:[]).length;let h=-1;try{typeof window<"u"&&Array.isArray(window.__nimbiSitemapFinal)&&typeof window.__nimbiSitemapRenderedAt=="number"&&(h=window.__nimbiSitemapFinal.length)}catch{}if(h>g){try{tt("[runtimeSitemap] skip HTML write: existing rendered sitemap larger",h,g)}catch{}return!0}return Vn(c,"text/html"),!0}catch(u){return wn("[runtimeSitemap] render HTML failed",u),!1}return!1}catch(t){return wn("[runtimeSitemap] handleSitemapRequest failed",t),!1}}async function Pc(e={}){try{const t=typeof e.waitForIndexMs=="number"?e.waitForIndexMs:1/0;let n=[];try{if(typeof Bt=="function")try{const s=await Bt({timeoutMs:t,contentBase:e&&e.contentBase,indexDepth:e&&e.indexDepth,noIndexing:e&&e.noIndexing,startBuild:!0});Array.isArray(s)&&s.length&&(n=s)}catch{}}catch{}(!Array.isArray(n)||!n.length)&&Array.isArray(re)&&re.length&&(n=re),(!Array.isArray(n)||!n.length)&&Array.isArray(e.index)&&e.index.length&&(n=e.index);const i=await Ci(Object.assign({},e,{index:n}));let r=[];try{const s=new Set,o=Array.isArray(i&&i.entries)?i.entries:[];for(const l of o)try{let c=null;if(l&&l.slug)c=String(l.slug);else if(l&&l.loc)try{c=new URL(String(l.loc)).searchParams.get("page")}catch{c=null}if(!c)continue;const u=String(c).split("::")[0];if(!s.has(u)){s.add(u);const g=Object.assign({},l);g.baseSlug=u,r.push(g)}}catch{}}catch{try{r=Array.isArray(i&&i.entries)?i.entries.slice(0):[]}catch{r=[]}}const a=Object.assign({},i||{},{entries:Array.isArray(r)?r:Array.isArray(i&&i.entries)?i.entries:[]});try{if(typeof window<"u")try{window.__nimbiSitemapJson=a,window.__nimbiSitemapFinal=r}catch{}}catch{}return{json:a,deduped:r}}catch{return null}}const Tn=Object.freeze(Object.defineProperty({__proto__:null,exposeSitemapGlobals:Pc,generateAtomXml:ri,generateRssXml:ni,generateSitemapJson:Ci,generateSitemapXml:ti,handleSitemapRequest:$c},Symbol.toStringTag,{value:"Module"}));exports.BAD_LANGUAGES=si;exports.SUPPORTED_HLJS_MAP=Ce;exports._clearHooks=Ws;exports.addHook=gr;exports.default=os;exports.ensureBulma=wa;exports.getVersion=ls;exports.initCMS=os;exports.loadL10nFile=li;exports.loadSupportedLanguages=oi;exports.observeCodeBlocks=ba;exports.onNavBuild=Ds;exports.onPageLoad=Fs;exports.registerLanguage=ln;exports.runHooks=jr;exports.setHighlightTheme=eo;exports.setLang=ci;exports.setStyle=_a;exports.setThemeVars=no;exports.t=an;exports.transformHtml=Us;
|